@hybridcore/ui 1.4.10 → 1.4.12
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.
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { a as
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { a as m } from "../../helpers-B4UL9NMD.js";
|
|
3
3
|
import n from "lodash";
|
|
4
4
|
import { Loading as d } from "../loading/index.js";
|
|
5
|
-
|
|
5
|
+
function x({
|
|
6
6
|
pagePath: s,
|
|
7
7
|
feature: o,
|
|
8
8
|
appRoles: t,
|
|
9
9
|
fallback: i,
|
|
10
10
|
loading: e = !1,
|
|
11
11
|
children: r
|
|
12
|
-
})
|
|
12
|
+
}) {
|
|
13
|
+
return s && (s = s.split("/").slice(1)[0] || "dashboard", s === "dashboard" ? o = "MAIN" : s === "agent-based-simulations" ? o = "SIMULATION" : o = n.toUpper(n.snakeCase(s))), s && e ? /* @__PURE__ */ f(d, { show: !0, position: "fixed", top: 0, left: 0, zIndex: 99999 }) : o && m(o, t) && r ? r : i || null;
|
|
14
|
+
}
|
|
13
15
|
export {
|
|
14
|
-
|
|
16
|
+
x as Access
|
|
15
17
|
};
|
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import { jsx as t, jsxs as u, Fragment as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as t, jsxs as u, Fragment as F } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S } from "react";
|
|
3
3
|
import r from "dayjs";
|
|
4
|
-
import { RadioButtonUnchecked as
|
|
5
|
-
import { Typography as
|
|
6
|
-
import { DatePicker as
|
|
4
|
+
import { RadioButtonUnchecked as T, CheckCircle as Y, KeyboardArrowUp as D, KeyboardArrowDown as B } from "@mui/icons-material";
|
|
5
|
+
import { Typography as y, FormLabel as W, FormGroup as z, Button as $ } from "@mui/material";
|
|
6
|
+
import { DatePicker as M } from "@mui/x-date-pickers";
|
|
7
7
|
import { T as b } from "../../TextField-D87qTh1k.js";
|
|
8
8
|
import { B as h } from "../../Box-BPyg-Ybm.js";
|
|
9
|
-
import { F as
|
|
10
|
-
import { C as
|
|
11
|
-
import { F as
|
|
9
|
+
import { F as O } from "../../FormControlLabel-D9KFjcIx.js";
|
|
10
|
+
import { C as P } from "../../Checkbox-qy3cjvnb.js";
|
|
11
|
+
import { F as j } from "../../InputLabel-CWkW8NtU.js";
|
|
12
12
|
function X({
|
|
13
13
|
property: e,
|
|
14
|
-
value:
|
|
14
|
+
value: a,
|
|
15
15
|
size: s = "medium",
|
|
16
16
|
variant: d,
|
|
17
17
|
onChange: x
|
|
18
18
|
}) {
|
|
19
|
-
var g, I, V, C,
|
|
20
|
-
const
|
|
21
|
-
let
|
|
19
|
+
var g, I, V, C, L;
|
|
20
|
+
const f = (o) => (n) => {
|
|
21
|
+
let l = { ...a };
|
|
22
22
|
const i = n.target.type === "checkbox" ? n.target.checked : n.target.value;
|
|
23
|
-
|
|
24
|
-
[n.target.name]:
|
|
23
|
+
l[o] = String(i), x({
|
|
24
|
+
[n.target.name]: l
|
|
25
25
|
});
|
|
26
|
-
},
|
|
27
|
-
var
|
|
28
|
-
const n = { ...
|
|
29
|
-
i ? (n.
|
|
26
|
+
}, k = (o) => {
|
|
27
|
+
var c;
|
|
28
|
+
const n = { ...a }, { value: l, checked: i, name: m } = o.target;
|
|
29
|
+
i ? (n.atLeastOneOf || (n.atLeastOneOf = []), n.atLeastOneOf.push(l)) : n.atLeastOneOf = (c = n.atLeastOneOf) == null ? void 0 : c.filter(
|
|
30
|
+
(w) => w !== l
|
|
31
|
+
), x({
|
|
30
32
|
[m]: n
|
|
31
33
|
});
|
|
32
34
|
}, p = (o) => (n) => {
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
[e.propertyId]:
|
|
35
|
+
let l = { ...a };
|
|
36
|
+
l[o] = r(n).format("YYYY-MM-DD"), x({
|
|
37
|
+
[e.propertyId]: l
|
|
36
38
|
});
|
|
37
39
|
};
|
|
38
40
|
if (["string", "text", "list"].includes(e.type))
|
|
@@ -41,9 +43,9 @@ function X({
|
|
|
41
43
|
{
|
|
42
44
|
label: e.name,
|
|
43
45
|
name: e.propertyId,
|
|
44
|
-
value:
|
|
46
|
+
value: a.exact ?? e.defaultValue ?? "",
|
|
45
47
|
size: s,
|
|
46
|
-
onChange:
|
|
48
|
+
onChange: f("exact"),
|
|
47
49
|
variant: d,
|
|
48
50
|
type: "text",
|
|
49
51
|
multiline: e.type === "text",
|
|
@@ -62,9 +64,9 @@ function X({
|
|
|
62
64
|
{
|
|
63
65
|
label: `${e.name} (Min)`,
|
|
64
66
|
name: e.propertyId,
|
|
65
|
-
value:
|
|
67
|
+
value: a.min ?? e.defaultValue ?? "",
|
|
66
68
|
size: s,
|
|
67
|
-
onChange:
|
|
69
|
+
onChange: f("min"),
|
|
68
70
|
variant: d,
|
|
69
71
|
type: "number",
|
|
70
72
|
disabled: !e.editable,
|
|
@@ -74,15 +76,15 @@ function X({
|
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
),
|
|
77
|
-
/* @__PURE__ */ t(
|
|
79
|
+
/* @__PURE__ */ t(y, { px: 1, children: "-" }),
|
|
78
80
|
/* @__PURE__ */ t(
|
|
79
81
|
b,
|
|
80
82
|
{
|
|
81
83
|
label: `${e.name} (Max)`,
|
|
82
84
|
name: e.propertyId,
|
|
83
|
-
value:
|
|
85
|
+
value: a.max ?? e.defaultValue ?? "",
|
|
84
86
|
size: s,
|
|
85
|
-
onChange:
|
|
87
|
+
onChange: f("max"),
|
|
86
88
|
variant: d,
|
|
87
89
|
type: "number",
|
|
88
90
|
disabled: !e.editable,
|
|
@@ -94,13 +96,13 @@ function X({
|
|
|
94
96
|
)
|
|
95
97
|
] });
|
|
96
98
|
if (e.type === "date") {
|
|
97
|
-
const o = "DD/MM/YYYY", n = "YYYY-MM-DD",
|
|
99
|
+
const o = "DD/MM/YYYY", n = "YYYY-MM-DD", l = a.min && r(a.min, n, !0).isValid() ? r(a.min, n) : null, i = a.max && r(a.max, n, !0).isValid() ? r(a.max, n) : null;
|
|
98
100
|
return /* @__PURE__ */ u(h, { mb: 2, display: "flex", alignItems: "end", children: [
|
|
99
101
|
/* @__PURE__ */ t(
|
|
100
|
-
|
|
102
|
+
M,
|
|
101
103
|
{
|
|
102
104
|
label: `${e.name} (Min)`,
|
|
103
|
-
value:
|
|
105
|
+
value: l,
|
|
104
106
|
format: o,
|
|
105
107
|
views: ["year", "month", "day"],
|
|
106
108
|
slotProps: {
|
|
@@ -116,14 +118,14 @@ function X({
|
|
|
116
118
|
onChange: p("min")
|
|
117
119
|
}
|
|
118
120
|
),
|
|
119
|
-
/* @__PURE__ */ t(
|
|
121
|
+
/* @__PURE__ */ t(y, { px: 1, children: "-" }),
|
|
120
122
|
/* @__PURE__ */ t(
|
|
121
|
-
|
|
123
|
+
M,
|
|
122
124
|
{
|
|
123
125
|
label: `${e.name} (Max)`,
|
|
124
126
|
value: i,
|
|
125
127
|
format: o,
|
|
126
|
-
minDate:
|
|
128
|
+
minDate: l !== null ? l : void 0,
|
|
127
129
|
views: ["year", "month", "day"],
|
|
128
130
|
slotProps: {
|
|
129
131
|
textField: {
|
|
@@ -142,18 +144,18 @@ function X({
|
|
|
142
144
|
}
|
|
143
145
|
if (e.type === "boolean")
|
|
144
146
|
return /* @__PURE__ */ t(h, { mb: 2, children: /* @__PURE__ */ t(
|
|
145
|
-
|
|
147
|
+
O,
|
|
146
148
|
{
|
|
147
149
|
label: e.name,
|
|
148
150
|
control: /* @__PURE__ */ t(
|
|
149
|
-
|
|
151
|
+
P,
|
|
150
152
|
{
|
|
151
153
|
size: s,
|
|
152
154
|
name: e.propertyId,
|
|
153
|
-
checked: !!
|
|
154
|
-
icon: /* @__PURE__ */ t(
|
|
155
|
-
checkedIcon: /* @__PURE__ */ t(
|
|
156
|
-
onChange:
|
|
155
|
+
checked: !!a,
|
|
156
|
+
icon: /* @__PURE__ */ t(T, {}),
|
|
157
|
+
checkedIcon: /* @__PURE__ */ t(Y, {}),
|
|
158
|
+
onChange: f("exact")
|
|
157
159
|
}
|
|
158
160
|
),
|
|
159
161
|
slotProps: {
|
|
@@ -164,23 +166,23 @@ function X({
|
|
|
164
166
|
}
|
|
165
167
|
) });
|
|
166
168
|
if (e.type === "enum" || e.type === "composite-list" && ((I = (g = e.dataTypeInfo) == null ? void 0 : g.innerType) == null ? void 0 : I.type) === "enum") {
|
|
167
|
-
const [o, n] =
|
|
169
|
+
const [o, n] = S(!1), l = 10;
|
|
168
170
|
let i = [];
|
|
169
|
-
return (V = e.dataTypeInfo) != null && V.enumValues && (i = e.dataTypeInfo.enumValues), (
|
|
170
|
-
/* @__PURE__ */ u(
|
|
171
|
-
/* @__PURE__ */ t(
|
|
172
|
-
/* @__PURE__ */ t(
|
|
173
|
-
|
|
171
|
+
return (V = e.dataTypeInfo) != null && V.enumValues && (i = e.dataTypeInfo.enumValues), (L = (C = e.dataTypeInfo) == null ? void 0 : C.innerType) != null && L.enumValues && (i = e.dataTypeInfo.innerType.enumValues), /* @__PURE__ */ u(h, { mb: 2, children: [
|
|
172
|
+
/* @__PURE__ */ u(j, { fullWidth: !0, component: "fieldset", variant: d, children: [
|
|
173
|
+
/* @__PURE__ */ t(W, { component: "legend", sx: { mb: 1 }, children: e.name }),
|
|
174
|
+
/* @__PURE__ */ t(z, { children: i.slice(0, o ? 9999 : l).map((m, c) => /* @__PURE__ */ t(
|
|
175
|
+
O,
|
|
174
176
|
{
|
|
175
177
|
label: m,
|
|
176
178
|
control: /* @__PURE__ */ t(
|
|
177
|
-
|
|
179
|
+
P,
|
|
178
180
|
{
|
|
179
181
|
name: e.propertyId,
|
|
180
182
|
value: m,
|
|
181
183
|
size: "small",
|
|
182
|
-
checked:
|
|
183
|
-
onChange:
|
|
184
|
+
checked: a.atLeastOneOf ? a.atLeastOneOf.includes(m) : !1,
|
|
185
|
+
onChange: k
|
|
184
186
|
}
|
|
185
187
|
),
|
|
186
188
|
componentsProps: {
|
|
@@ -189,15 +191,15 @@ function X({
|
|
|
189
191
|
}
|
|
190
192
|
}
|
|
191
193
|
},
|
|
192
|
-
|
|
194
|
+
c
|
|
193
195
|
)) })
|
|
194
196
|
] }),
|
|
195
|
-
i.length >
|
|
196
|
-
|
|
197
|
+
i.length > l && /* @__PURE__ */ u(
|
|
198
|
+
$,
|
|
197
199
|
{
|
|
198
200
|
size: "small",
|
|
199
201
|
sx: { p: 0, textTransform: "none" },
|
|
200
|
-
endIcon: o ? /* @__PURE__ */ t(
|
|
202
|
+
endIcon: o ? /* @__PURE__ */ t(D, {}) : /* @__PURE__ */ t(B, {}),
|
|
201
203
|
onClick: () => n((m) => !m),
|
|
202
204
|
children: [
|
|
203
205
|
"Show ",
|
|
@@ -207,7 +209,7 @@ function X({
|
|
|
207
209
|
)
|
|
208
210
|
] });
|
|
209
211
|
}
|
|
210
|
-
return /* @__PURE__ */ t(
|
|
212
|
+
return /* @__PURE__ */ t(F, {});
|
|
211
213
|
}
|
|
212
214
|
export {
|
|
213
215
|
X as default
|
package/dist/main.d.ts
CHANGED
|
@@ -15,15 +15,17 @@ import { Feature } from 'ol';
|
|
|
15
15
|
import { Geometry } from 'ol/geom';
|
|
16
16
|
import { GridActionsCellItemProps } from '@mui/x-data-grid';
|
|
17
17
|
import { IconButtonProps } from '@mui/material/IconButton';
|
|
18
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
18
19
|
import { LocalizationProvider } from '@mui/x-date-pickers';
|
|
19
20
|
import { Pixel } from 'ol/pixel';
|
|
21
|
+
import { ReactNode } from 'react';
|
|
20
22
|
import { Size } from 'ol/size';
|
|
21
23
|
import { SxProps } from '@mui/material';
|
|
22
24
|
import { SxProps as SxProps_2 } from '@mui/material/styles';
|
|
23
25
|
import { Theme } from '@mui/material/styles';
|
|
24
26
|
import { View } from 'ol';
|
|
25
27
|
|
|
26
|
-
export declare
|
|
28
|
+
export declare function Access<T extends string>({ pagePath, feature, appRoles, fallback, loading, children, }: Props<T>): string | number | true | Iterable<ReactNode> | JSX_2.Element | null;
|
|
27
29
|
|
|
28
30
|
declare type AccessType = "READ" | "ALL" | "SUPER_ADMIN";
|
|
29
31
|
|
|
@@ -512,7 +514,7 @@ declare type OrientationType_2 = "portrait" | "landscape";
|
|
|
512
514
|
|
|
513
515
|
export declare const PhoneInput: React.FC<Props_9>;
|
|
514
516
|
|
|
515
|
-
declare interface Props {
|
|
517
|
+
declare interface Props<T extends string> {
|
|
516
518
|
/**
|
|
517
519
|
*
|
|
518
520
|
*/
|
|
@@ -528,7 +530,7 @@ declare interface Props {
|
|
|
528
530
|
/**
|
|
529
531
|
*
|
|
530
532
|
*/
|
|
531
|
-
feature?:
|
|
533
|
+
feature?: FeatureType | T;
|
|
532
534
|
/**
|
|
533
535
|
*
|
|
534
536
|
*/
|
|
@@ -1068,7 +1070,7 @@ declare namespace FV {
|
|
|
1068
1070
|
min?: string;
|
|
1069
1071
|
max?: string;
|
|
1070
1072
|
exact?: string;
|
|
1071
|
-
|
|
1073
|
+
atLeastOneOf?: Array<string | number>;
|
|
1072
1074
|
}
|
|
1073
1075
|
|
|
1074
1076
|
interface SearchResults {
|