@hybridcore/ui 1.5.8 → 1.5.10

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,6 +1,6 @@
1
1
  import { jsx as d, jsxs as x } from "react/jsx-runtime";
2
2
  import s from "lodash";
3
- import y from "./property.js";
3
+ import { Property as y } from "./property.js";
4
4
  import { Box as c, Typography as I } from "@mui/material";
5
5
  import { Accordion as A, AccordionSummary as K, AccordionDetails as N } from "./styled.js";
6
6
  const j = ({
@@ -1,6 +1,6 @@
1
1
  import { jsxs as m, jsx as t, Fragment as T } from "react/jsx-runtime";
2
2
  import { useState as Y } from "react";
3
- import c from "dayjs";
3
+ import u from "dayjs";
4
4
  import { KeyboardArrowUp as z, KeyboardArrowDown as L } from "@mui/icons-material";
5
5
  import { Typography as f, FormLabel as P, FormGroup as D, Button as W } from "@mui/material";
6
6
  import { DatePicker as C } from "@mui/x-date-pickers";
@@ -9,13 +9,13 @@ import { T as b } from "../../TextField-BjFXx91l.js";
9
9
  import { F as O } from "../../FormControlLabel-BNT5EI0b.js";
10
10
  import { C as k } from "../../Checkbox-B0P8LhCl.js";
11
11
  import { F as B } from "../../InputLabel-ClDXuWBr.js";
12
- function R({
12
+ const R = ({
13
13
  property: e,
14
14
  value: a,
15
15
  size: r = "medium",
16
- variant: u,
16
+ variant: c,
17
17
  onChange: p
18
- }) {
18
+ }) => {
19
19
  var I, S, y, V, M;
20
20
  const h = (l) => (n) => {
21
21
  let o = { ...a };
@@ -33,7 +33,7 @@ function R({
33
33
  });
34
34
  }, g = (l) => (n) => {
35
35
  let o = { ...a };
36
- o[l] = c(n).format("YYYY-MM-DD"), p({
36
+ o[l] = u(n).format("YYYY-MM-DD"), p({
37
37
  [e.propertyId]: o
38
38
  });
39
39
  };
@@ -47,7 +47,7 @@ function R({
47
47
  value: a.exact ?? e.defaultValue ?? "",
48
48
  size: r,
49
49
  onChange: h("exact"),
50
- variant: u,
50
+ variant: c,
51
51
  type: "text",
52
52
  multiline: e.type === "text",
53
53
  disabled: !e.editable,
@@ -69,7 +69,7 @@ function R({
69
69
  value: a.min ?? e.defaultValue ?? "",
70
70
  size: r,
71
71
  onChange: h("min"),
72
- variant: u,
72
+ variant: c,
73
73
  type: "number",
74
74
  disabled: !e.editable,
75
75
  fullWidth: !0,
@@ -87,7 +87,7 @@ function R({
87
87
  value: a.max ?? e.defaultValue ?? "",
88
88
  size: r,
89
89
  onChange: h("max"),
90
- variant: u,
90
+ variant: c,
91
91
  type: "number",
92
92
  disabled: !e.editable,
93
93
  fullWidth: !0,
@@ -100,7 +100,7 @@ function R({
100
100
  ] })
101
101
  ] });
102
102
  if (e.type === "date") {
103
- const l = "DD/MM/YYYY", n = "YYYY-MM-DD", o = a.min && c(a.min, n, !0).isValid() ? c(a.min, n) : null, i = a.max && c(a.max, n, !0).isValid() ? c(a.max, n) : null;
103
+ const l = "DD/MM/YYYY", n = "YYYY-MM-DD", o = a.min && u(a.min, n, !0).isValid() ? u(a.min, n) : null, i = a.max && u(a.max, n, !0).isValid() ? u(a.max, n) : null;
104
104
  return /* @__PURE__ */ m(d, { mb: 1, children: [
105
105
  /* @__PURE__ */ t(f, { variant: "caption", mb: 0.5, display: "block", children: e.name }),
106
106
  /* @__PURE__ */ m(d, { display: "flex", alignItems: "center", children: [
@@ -112,7 +112,7 @@ function R({
112
112
  views: ["year", "month", "day"],
113
113
  slotProps: {
114
114
  textField: {
115
- variant: u,
115
+ variant: c,
116
116
  name: e.propertyId,
117
117
  size: r,
118
118
  fullWidth: !0,
@@ -139,7 +139,7 @@ function R({
139
139
  views: ["year", "month", "day"],
140
140
  slotProps: {
141
141
  textField: {
142
- variant: u,
142
+ variant: c,
143
143
  name: e.propertyId,
144
144
  size: r,
145
145
  fullWidth: !0,
@@ -183,8 +183,8 @@ function R({
183
183
  if (e.type === "enum" || e.type === "composite-list" && ((S = (I = e.dataTypeInfo) == null ? void 0 : I.innerType) == null ? void 0 : S.type) === "enum") {
184
184
  const [l, n] = Y(!1), o = 10;
185
185
  let i = [];
186
- return (y = e.dataTypeInfo) != null && y.enumValues && (i = e.dataTypeInfo.enumValues), (M = (V = e.dataTypeInfo) == null ? void 0 : V.innerType) != null && M.enumValues && (i = e.dataTypeInfo.innerType.enumValues), /* @__PURE__ */ m(d, { children: [
187
- /* @__PURE__ */ m(B, { fullWidth: !0, component: "fieldset", variant: u, children: [
186
+ return (y = e.dataTypeInfo) != null && y.enumValues && (i = e.dataTypeInfo.enumValues), (M = (V = e.dataTypeInfo) == null ? void 0 : V.innerType) != null && M.enumValues && (i = e.dataTypeInfo.innerType.enumValues), /* @__PURE__ */ m(d, { mb: 1, children: [
187
+ /* @__PURE__ */ m(B, { fullWidth: !0, component: "fieldset", variant: c, children: [
188
188
  /* @__PURE__ */ t(P, { component: "legend", sx: { mb: 1, fontSize: 12 }, children: e.name }),
189
189
  /* @__PURE__ */ t(D, { children: i.slice(0, l ? 9999 : o).map((s, x) => /* @__PURE__ */ t(
190
190
  O,
@@ -237,7 +237,7 @@ function R({
237
237
  ] });
238
238
  }
239
239
  return /* @__PURE__ */ t(T, {});
240
- }
240
+ };
241
241
  export {
242
- R as default
242
+ R as Property
243
243
  };
package/dist/main.d.ts CHANGED
@@ -555,6 +555,16 @@ declare type OrientationType_2 = "portrait" | "landscape";
555
555
 
556
556
  export declare const PhoneInput: React.FC<Props_9>;
557
557
 
558
+ export declare const PropertyFilterInput: FC<PropertyProps>;
559
+
560
+ declare interface PropertyProps {
561
+ property: ONTOLOGY.Property;
562
+ value: FV.PropertyFilterValue;
563
+ size?: "small" | "medium";
564
+ variant?: "standard" | "outlined" | "filled";
565
+ onChange(value: any): void;
566
+ }
567
+
558
568
  declare interface Props<T extends string> {
559
569
  /**
560
570
  *
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Access as Ht } from "./components/access/index.js";
2
- import { alert as Ft, confirm as Ct } from "./components/confirm/index.js";
2
+ import { alert as Bt, confirm as It } from "./components/confirm/index.js";
3
3
  import { Card as jt } from "./components/card/index.js";
4
4
  import { CardAlternate as $t } from "./components/card-alternate/index.js";
5
5
  import { CollapsibleCard as Et } from "./components/collapsible-card/index.js";
@@ -23,14 +23,15 @@ import { SecurityLevel as ge } from "./components/data-security-selectors/securi
23
23
  import { TemplateForm as Te } from "./components/template-form/index.js";
24
24
  import { TemplateFilters as we } from "./components/template-filters/index.js";
25
25
  import { TemplatePropertyFilters as ve } from "./components/template-property-filters/index.js";
26
- import { TreeSelect as Se } from "./components/tree-select/index.js";
27
- import { TreeViewFilter as be } from "./components/treeview-filter/index.js";
28
- import { S as Be } from "./utils-Bq0ye5vf.js";
29
- import { i as Ce } from "./index-DlnzUkwe.js";
30
- import { b as je } from "./helpers-DaCoWmi2.js";
31
- import { ThemeProvider as $e, createTheme as We } from "@mui/material";
26
+ import { Property as Se } from "./components/template-property-filters/property.js";
27
+ import { TreeSelect as be } from "./components/tree-select/index.js";
28
+ import { TreeViewFilter as Fe } from "./components/treeview-filter/index.js";
29
+ import { S as Ie } from "./utils-Bq0ye5vf.js";
30
+ import { i as je } from "./index-DlnzUkwe.js";
31
+ import { b as $e } from "./helpers-DaCoWmi2.js";
32
+ import { ThemeProvider as Ee, createTheme as Ue } from "@mui/material";
32
33
  import { a as dt } from "./objectWithoutPropertiesLoose-DJteAcBH.js";
33
- import C from "dayjs";
34
+ import I from "dayjs";
34
35
  import { h as U, j as z } from "./createTheme-DrgvKMA_.js";
35
36
  import { b as ut } from "./index-CAaDu0NI.js";
36
37
  var tt = { exports: {} };
@@ -115,7 +116,7 @@ var et = { exports: {} };
115
116
  }], Y: [/[+-]?\d+/, a("year")], YY: [e, function(r) {
116
117
  this.year = i(r);
117
118
  }], YYYY: [/\d{4}/, a("year")], Z: x, ZZ: x };
118
- function B(r) {
119
+ function F(r) {
119
120
  var h, d;
120
121
  h = r, d = n && n.formats;
121
122
  for (var u = (r = h.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(S, w, M) {
@@ -124,16 +125,16 @@ var et = { exports: {} };
124
125
  return v || A.slice(1);
125
126
  });
126
127
  })).match(c), g = u.length, Y = 0; Y < g; Y += 1) {
127
- var I = u[Y], O = Z[I], T = O && O[0], L = O && O[1];
128
- u[Y] = L ? { regex: T, parser: L } : I.replace(/^\[|\]$/g, "");
128
+ var C = u[Y], O = Z[C], T = O && O[0], L = O && O[1];
129
+ u[Y] = L ? { regex: T, parser: L } : C.replace(/^\[|\]$/g, "");
129
130
  }
130
131
  return function(S) {
131
132
  for (var w = {}, M = 0, y = 0; M < g; M += 1) {
132
133
  var k = u[M];
133
134
  if (typeof k == "string") y += k.length;
134
135
  else {
135
- var v = k.regex, A = k.parser, j = S.slice(y), F = v.exec(j)[0];
136
- A.call(w, F), S = S.replace(F, "");
136
+ var v = k.regex, A = k.parser, j = S.slice(y), B = v.exec(j)[0];
137
+ A.call(w, B), S = S.replace(B, "");
137
138
  }
138
139
  }
139
140
  return function(b) {
@@ -149,22 +150,22 @@ var et = { exports: {} };
149
150
  d.p.customParseFormat = !0, r && r.parseTwoDigitYear && (i = r.parseTwoDigitYear);
150
151
  var u = h.prototype, g = u.parse;
151
152
  u.parse = function(Y) {
152
- var I = Y.date, O = Y.utc, T = Y.args;
153
+ var C = Y.date, O = Y.utc, T = Y.args;
153
154
  this.$u = O;
154
155
  var L = T[1];
155
156
  if (typeof L == "string") {
156
157
  var S = T[2] === !0, w = T[3] === !0, M = S || w, y = T[2];
157
- w && (y = T[2]), n = this.$locale(), !S && y && (n = d.Ls[y]), this.$d = function(j, F, b, P) {
158
+ w && (y = T[2]), n = this.$locale(), !S && y && (n = d.Ls[y]), this.$d = function(j, B, b, P) {
158
159
  try {
159
- if (["x", "X"].indexOf(F) > -1) return new Date((F === "X" ? 1e3 : 1) * j);
160
- var m = B(F)(j), N = m.year, $ = m.month, nt = m.day, ot = m.hours, at = m.minutes, it = m.seconds, ht = m.milliseconds, R = m.zone, X = m.week, J = /* @__PURE__ */ new Date(), _ = nt || (N || $ ? 1 : J.getDate()), V = N || J.getFullYear(), W = 0;
160
+ if (["x", "X"].indexOf(B) > -1) return new Date((B === "X" ? 1e3 : 1) * j);
161
+ var m = F(B)(j), N = m.year, $ = m.month, nt = m.day, ot = m.hours, at = m.minutes, it = m.seconds, ht = m.milliseconds, R = m.zone, X = m.week, J = /* @__PURE__ */ new Date(), _ = nt || (N || $ ? 1 : J.getDate()), V = N || J.getFullYear(), W = 0;
161
162
  N && !$ || (W = $ > 0 ? $ - 1 : J.getMonth());
162
163
  var E, q = ot || 0, G = at || 0, K = it || 0, Q = ht || 0;
163
164
  return R ? new Date(Date.UTC(V, W, _, q, G, K, Q + 60 * R.offset * 1e3)) : b ? new Date(Date.UTC(V, W, _, q, G, K, Q)) : (E = new Date(V, W, _, q, G, K, Q), X && (E = P(E).week(X).toDate()), E);
164
165
  } catch {
165
166
  return /* @__PURE__ */ new Date("");
166
167
  }
167
- }(I, L, O, d), this.init(), y && y !== !0 && (this.$L = this.locale(y).$L), M && I != this.format(L) && (this.$d = /* @__PURE__ */ new Date("")), n = {};
168
+ }(C, L, O, d), this.init(), y && y !== !0 && (this.$L = this.locale(y).$L), M && C != this.format(L) && (this.$d = /* @__PURE__ */ new Date("")), n = {};
168
169
  } else if (L instanceof Array) for (var k = L.length, v = 1; v <= k; v += 1) {
169
170
  T[1] = L[v - 1];
170
171
  var A = d.apply(this, T);
@@ -192,9 +193,9 @@ var rt = { exports: {} };
192
193
  e.en.formats = f, s.format = function(n) {
193
194
  n === void 0 && (n = "YYYY-MM-DDTHH:mm:ssZ");
194
195
  var i = this.$locale().formats, a = function(x, p) {
195
- return x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(H, Z, B) {
196
- var r = B && B.toUpperCase();
197
- return Z || p[B] || f[B] || p[r].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(h, d, u) {
196
+ return x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(H, Z, F) {
197
+ var r = F && F.toUpperCase();
198
+ return Z || p[F] || f[F] || p[r].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(h, d, u) {
198
199
  return d || u.slice(1);
199
200
  });
200
201
  });
@@ -221,9 +222,9 @@ var st = { exports: {} };
221
222
  })(st);
222
223
  var Mt = st.exports;
223
224
  const Dt = /* @__PURE__ */ z(Mt);
224
- C.extend(lt);
225
- C.extend(yt);
226
- C.extend(Dt);
225
+ I.extend(lt);
226
+ I.extend(yt);
227
+ I.extend(Dt);
227
228
  const xt = ut(["Your locale has not been found.", "Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale", "Or you forget to import the locale with `require('dayjs/locale/{localeUsed}')`", "fallback on English locale"]), gt = {
228
229
  // Year
229
230
  YY: "year",
@@ -346,7 +347,7 @@ class St {
346
347
  end: "]"
347
348
  }, this.formatTokenMap = gt, this.getLocaleFormats = () => {
348
349
  var t;
349
- const e = (t = this.rawDayJsInstance.Ls) != null ? t : C.Ls, s = this.locale || "en";
350
+ const e = (t = this.rawDayJsInstance.Ls) != null ? t : I.Ls, s = this.locale || "en";
350
351
  let o = e[s];
351
352
  return o === void 0 && (xt(), o = e.en), o.formats;
352
353
  }, this.date = (t) => t === null ? null : this.dayjs(t), this.toJsDate = (t) => t.toDate(), this.parseISO = (t) => this.dayjs(t), this.toISO = (t) => t.toISOString(), this.parse = (t, e) => t === "" ? null : this.dayjs(t, e, this.locale, !0), this.getCurrentLocaleCode = () => this.locale || "en", this.is12HourCycleInCurrentLocale = () => /A|a/.test(this.getLocaleFormats().LT || ""), this.expandFormat = (t) => {
@@ -380,12 +381,12 @@ class St {
380
381
  for (; i.isBefore(o); )
381
382
  n.push(i), i = i.add(1, "year");
382
383
  return n;
383
- }, this.getMeridiemText = (t) => t === "am" ? "AM" : "PM", this.rawDayJsInstance = c || C, this.dayjs = Tt(this.rawDayJsInstance, D), this.locale = D, this.formats = dt({}, Yt, f), C.extend(ft);
384
+ }, this.getMeridiemText = (t) => t === "am" ? "AM" : "PM", this.rawDayJsInstance = c || I, this.dayjs = Tt(this.rawDayJsInstance, D), this.locale = D, this.formats = dt({}, Yt, f), I.extend(ft);
384
385
  }
385
386
  }
386
387
  export {
387
388
  Ht as Access,
388
- je as AccessUtils,
389
+ $e as AccessUtils,
389
390
  St as AdapterDayjs,
390
391
  jt as Card,
391
392
  $t as CardAlternate,
@@ -400,22 +401,23 @@ export {
400
401
  re as InstanceForm,
401
402
  ne as InstanceHierarchyTable,
402
403
  ae as InstanceTable,
403
- Be as KeyProductionUtils,
404
+ Ie as KeyProductionUtils,
404
405
  he as KeyProtectionMenu,
405
406
  ue as LinearIndicator,
406
407
  fe as Loading,
407
408
  le as LocalizationProvider,
408
- Ce as Map,
409
+ je as Map,
409
410
  ye as PhoneInput,
411
+ Se as PropertyFilterInput,
410
412
  De as SearchInput,
411
413
  ge as SecurityLevel,
412
414
  we as TemplateFilters,
413
415
  Te as TemplateForm,
414
416
  ve as TemplatePropertyFilters,
415
- $e as ThemeProvider,
416
- Se as TreeSelect,
417
- be as TreeViewFilter,
418
- Ft as alert,
419
- Ct as confirm,
420
- We as createTheme
417
+ Ee as ThemeProvider,
418
+ be as TreeSelect,
419
+ Fe as TreeViewFilter,
420
+ Bt as alert,
421
+ It as confirm,
422
+ Ue as createTheme
421
423
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hybridcore/ui",
3
3
  "description": "Hybrid Core UI Library",
4
- "version": "1.5.8",
4
+ "version": "1.5.10",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",