biblio-react 3.0.0-alpha261-popup → 3.0.0-alpha262-popup

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/README.md CHANGED
@@ -1,30 +1,30 @@
1
- # biblio-react
2
-
3
- > Framework de Metiri hecho en React
4
-
5
- [![NPM](https://img.shields.io/npm/v/biblio-react.svg)](https://www.npmjs.com/package/biblio-react) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
6
-
7
- ## Install
8
-
9
- ```bash
10
- yarn add biblio-react
11
- ```
12
-
13
- ## Usage
14
-
15
- ```jsx
16
- import React, { Component } from 'react'
17
-
18
- import MyComponent from 'biblio-react'
19
- import 'biblio-react/dist/index.css'
20
-
21
- class Example extends Component {
22
- render() {
23
- return <MyComponent />
24
- }
25
- }
26
- ```
27
-
28
- ## License
29
-
30
- MIT © [WiXSL](https://github.com/WiXSL)
1
+ # biblio-react
2
+
3
+ > Framework de Metiri hecho en React
4
+
5
+ [![NPM](https://img.shields.io/npm/v/biblio-react.svg)](https://www.npmjs.com/package/biblio-react) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ yarn add biblio-react
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```jsx
16
+ import React, { Component } from 'react'
17
+
18
+ import MyComponent from 'biblio-react'
19
+ import 'biblio-react/dist/index.css'
20
+
21
+ class Example extends Component {
22
+ render() {
23
+ return <MyComponent />
24
+ }
25
+ }
26
+ ```
27
+
28
+ ## License
29
+
30
+ MIT © [WiXSL](https://github.com/WiXSL)
package/dist/index.js CHANGED
@@ -34125,9 +34125,11 @@ const Fj = x.forwardRef(/* @__PURE__ */ a(function(e, n) {
34125
34125
  ...s
34126
34126
  } = t, [l, u] = Le(!1), d = oo(s), p = fr(), { trigger: f } = tn(), { hidden: h } = BE(), m = x.useContext(Gn) || {}, y = et(
34127
34127
  async (g, v, S) => {
34128
- typeof e == "function" ? await f() ? (u(!0), e(d, v, S, g).finally(() => {
34129
- u(!1);
34130
- })) : p("Formulario no válido", { type: "warning" }) : p("Falta implementar jsBotoneraPart", {
34128
+ typeof e == "function" ? (S?.skipValidation ? !0 : await f()) ? (u(!0), e(d, v, S?.name, g).finally(
34129
+ () => {
34130
+ u(!1);
34131
+ }
34132
+ )) : p("Formulario no válido", { type: "warning" }) : p("Falta implementar jsBotoneraPart", {
34131
34133
  type: "error"
34132
34134
  });
34133
34135
  },
@@ -34143,7 +34145,7 @@ const Fj = x.forwardRef(/* @__PURE__ */ a(function(e, n) {
34143
34145
  label: g.label,
34144
34146
  disabled: l,
34145
34147
  onClick: /* @__PURE__ */ a(async (v) => {
34146
- await y(v, n, g.name);
34148
+ await y(v, n, g);
34147
34149
  }, "onClick"),
34148
34150
  children: g.icon
34149
34151
  },
@@ -35025,50 +35027,66 @@ const Gj = me([/* @__PURE__ */ b("circle", {
35025
35027
  const r = t && typeof t == "object" ? { ...t } : {};
35026
35028
  return (r.id === void 0 || r.id === null || r.id === "") && (r.id = e), (r.etiqueta === void 0 || r.etiqueta === null || r.etiqueta === "") && r.id !== void 0 && r.id !== null && r.id !== "" && (r.etiqueta = Ub(r, n)), r;
35027
35029
  }, "buildChoiceRecord"), t6 = /* @__PURE__ */ a((t) => {
35028
- const { callback: e, sx: n, isTC: r, onChange: o, injectedChoices: i = [], ...s } = t, {
35029
- isFetching: l,
35030
- allChoices: u,
35031
- availableChoices: d
35032
- } = sT(), p = bn(null), f = Ot(() => {
35033
- const h = Array.isArray(d) ? d : [];
35030
+ const {
35031
+ callback: e,
35032
+ sx: n,
35033
+ isTC: r,
35034
+ onChange: o,
35035
+ injectedChoices: i = [],
35036
+ fullWidth: s = !1,
35037
+ ...l
35038
+ } = t, {
35039
+ isFetching: u,
35040
+ allChoices: d,
35041
+ availableChoices: p
35042
+ } = sT(), f = bn(null), h = Ot(() => {
35043
+ const m = Array.isArray(p) ? p : [];
35034
35044
  if (!Array.isArray(i) || i.length === 0)
35035
- return h;
35036
- const m = [...i];
35037
- return h.forEach((y) => {
35038
- m.some((g) => ql(g?.id, y?.id)) || m.push(y);
35039
- }), m;
35040
- }, [d, i]);
35045
+ return m;
35046
+ const y = [...i];
35047
+ return m.forEach((g) => {
35048
+ y.some((v) => ql(v?.id, g?.id)) || y.push(g);
35049
+ }), y;
35050
+ }, [p, i]);
35041
35051
  return Ae(() => {
35042
- l || typeof e == "function" && e(Object.values([u]));
35043
- }, [u, e, l]), /* @__PURE__ */ b(Qj, { title: p.current?.value || "", placement: "top", arrow: !0, children: /* @__PURE__ */ b(
35052
+ u || typeof e == "function" && e(Object.values([d]));
35053
+ }, [d, e, u]), /* @__PURE__ */ b(Qj, { title: f.current?.value || "", placement: "top", arrow: !0, children: /* @__PURE__ */ b(
35044
35054
  Ve,
35045
35055
  {
35046
35056
  sx: r ? { marginLeft: 1, ...n } : {
35047
- display: { xs: "inherit", md: "inline-flex" },
35048
- // ✅ inline en md+
35057
+ display: {
35058
+ xs: "inherit",
35059
+ md: s ? "flex" : "inline-flex"
35060
+ },
35049
35061
  verticalAlign: "top",
35050
35062
  ...n
35051
35063
  },
35052
- width: r ? {} : { xs: "100%", md: "auto" },
35064
+ width: r ? {} : {
35065
+ xs: "100%",
35066
+ md: s ? "100%" : "auto"
35067
+ },
35053
35068
  children: /* @__PURE__ */ b(
35054
35069
  fA,
35055
35070
  {
35056
35071
  size: "small",
35057
- sx: r ? { width: "100% !important" } : {},
35058
- ...s,
35059
- choices: f,
35060
- onChange: /* @__PURE__ */ a((h) => {
35061
- const m = f.find(
35062
- (y) => ql(y?.id, h)
35072
+ sx: {
35073
+ width: "100%",
35074
+ ...r ? { width: "100% !important" } : {}
35075
+ },
35076
+ ...l,
35077
+ choices: h,
35078
+ onChange: /* @__PURE__ */ a((m) => {
35079
+ const y = h.find(
35080
+ (g) => ql(g?.id, m)
35063
35081
  );
35064
35082
  o({
35065
35083
  target: {
35066
- value: h
35084
+ value: m
35067
35085
  },
35068
- label: Ub(m, s.source)
35086
+ label: Ub(y, l.source)
35069
35087
  });
35070
35088
  }, "onChange"),
35071
- TextFieldProps: { inputRef: p }
35089
+ TextFieldProps: { inputRef: f }
35072
35090
  }
35073
35091
  )
35074
35092
  }
@@ -35080,24 +35098,24 @@ const Gj = me([/* @__PURE__ */ b("circle", {
35080
35098
  asistantResource: p,
35081
35099
  perPage: f = 500,
35082
35100
  ...h
35083
- } = e, { source: m, reference: y } = t, [g, v] = Le([]), S = ko(), T = By((N) => hb(N.reload_cb, m, S)), E = bn(T), C = T === null && E.current ? E.current : T;
35084
- let w, k;
35085
- if (C) {
35086
- const { callback: N, ...A } = C;
35087
- w = N, k = A;
35088
- }
35089
- const R = et(
35090
- (N, A) => {
35091
- const D = N?.id ?? N?.[m] ?? A?.id ?? A?.data?.id ?? A?.data?.[m], P = e6(N, D, m);
35092
- P && P.id !== void 0 && P.id !== null && P.id !== "" && v((O) => O.some(
35093
- (I) => ql(I?.id, P.id)
35094
- ) ? O : [P, ...O].slice(0, 50)), o.invalidateQueries({
35101
+ } = e, { source: m, reference: y, fullWidth: g = !1 } = t, [v, S] = Le([]), T = ko(), E = By((A) => hb(A.reload_cb, m, T)), C = bn(E), w = E === null && C.current ? C.current : E;
35102
+ let k, R;
35103
+ if (w) {
35104
+ const { callback: A, ...D } = w;
35105
+ k = A, R = D;
35106
+ }
35107
+ const N = et(
35108
+ (A, D) => {
35109
+ const P = A?.id ?? A?.[m] ?? D?.id ?? D?.data?.id ?? D?.data?.[m], O = e6(A, P, m);
35110
+ O && O.id !== void 0 && O.id !== null && O.id !== "" && S((M) => M.some(
35111
+ (L) => ql(L?.id, O.id)
35112
+ ) ? M : [O, ...M].slice(0, 50)), o.invalidateQueries({
35095
35113
  queryKey: [y, "getList"]
35096
35114
  }), o.invalidateQueries({
35097
35115
  queryKey: [y, "getMany"]
35098
35116
  }), o.invalidateQueries({
35099
35117
  queryKey: [y, "getManyReference"]
35100
- }), typeof i?.setValue == "function" && D !== void 0 && D !== null && D !== "" && i.setValue(m, D, {
35118
+ }), typeof i?.setValue == "function" && P !== void 0 && P !== null && P !== "" && i.setValue(m, P, {
35101
35119
  shouldDirty: !0,
35102
35120
  shouldTouch: !0,
35103
35121
  shouldValidate: !0
@@ -35106,20 +35124,19 @@ const Gj = me([/* @__PURE__ */ b("circle", {
35106
35124
  [i, o, y, m]
35107
35125
  );
35108
35126
  return Ae(() => {
35109
- T !== null && (E.current = T, r(pL(m, void 0, S)));
35110
- }, [r, T, S, m]), !n && !s ? /* @__PURE__ */ q(
35127
+ E !== null && (C.current = E, r(pL(m, void 0, T)));
35128
+ }, [r, E, T, m]), !n && !s ? /* @__PURE__ */ q(
35111
35129
  Ve,
35112
35130
  {
35113
35131
  sx: {
35114
- // En xs: fila propia (100% de ancho) pero mantiene input + botón en la MISMA línea
35115
35132
  display: {
35116
35133
  xs: "flex",
35117
- md: t.isTC ? "flex" : "inline-flex"
35134
+ md: g || t.isTC ? "flex" : "inline-flex"
35118
35135
  },
35119
35136
  flexWrap: "nowrap",
35120
35137
  alignItems: "center",
35121
35138
  gap: 1,
35122
- width: t.isTC ? "80%" : { xs: "100%", md: "auto" },
35139
+ width: g ? "100%" : t.isTC ? "80%" : { xs: "100%", md: "auto" },
35123
35140
  mr: 1,
35124
35141
  verticalAlign: "top"
35125
35142
  },
@@ -35130,7 +35147,7 @@ const Gj = me([/* @__PURE__ */ b("circle", {
35130
35147
  reference: y,
35131
35148
  source: m,
35132
35149
  perPage: f,
35133
- filter: k,
35150
+ filter: R,
35134
35151
  queryOptions: {
35135
35152
  ...u || {},
35136
35153
  enabled: (u?.enabled ?? !0) && l
@@ -35139,10 +35156,14 @@ const Gj = me([/* @__PURE__ */ b("circle", {
35139
35156
  t6,
35140
35157
  {
35141
35158
  ...h,
35142
- callback: w,
35143
- injectedChoices: g,
35144
- optionText: /* @__PURE__ */ a((N) => Ub(N, m), "optionText"),
35145
- sx: { width: "100% !important", minWidth: 220 }
35159
+ callback: k,
35160
+ injectedChoices: v,
35161
+ fullWidth: g,
35162
+ optionText: /* @__PURE__ */ a((A) => Ub(A, m), "optionText"),
35163
+ sx: {
35164
+ width: "100%",
35165
+ minWidth: g ? 0 : 220
35166
+ }
35146
35167
  }
35147
35168
  )
35148
35169
  }
@@ -35155,7 +35176,7 @@ const Gj = me([/* @__PURE__ */ b("circle", {
35155
35176
  tipo: "ventana",
35156
35177
  inline: !0,
35157
35178
  mutationOptions: {
35158
- onSuccess: R
35179
+ onSuccess: N
35159
35180
  },
35160
35181
  ButtonProps: {
35161
35182
  size: "small",
@@ -35163,7 +35184,7 @@ const Gj = me([/* @__PURE__ */ b("circle", {
35163
35184
  }
35164
35185
  },
35165
35186
  mutationOptions: {
35166
- onSuccess: R
35187
+ onSuccess: N
35167
35188
  }
35168
35189
  }
35169
35190
  ) : null
@@ -36030,84 +36051,84 @@ const Gj = me([/* @__PURE__ */ b("circle", {
36030
36051
  all: !0,
36031
36052
  none: !1
36032
36053
  }, b6 = /* @__PURE__ */ a((t) => String(t) === t ? t === "" ? "Ninguno" : "Selección (1)" : !t || t?.all ? "Todos" : t?.none || t.seleccion.length === 0 ? "Ninguno" : `Selección (${t.seleccion.split(",").length})`, "format"), v6 = /* @__PURE__ */ a((t) => t, "parse"), jY = /* @__PURE__ */ a((t) => {
36033
- const { source: e, onChange: n } = t, [r] = lT({ resource: "form_224" }), [o, i] = Le(!1), s = tn(), { estado: l, fichaProps: u = {} } = Rt(), d = bn(!1), {
36034
- hidden: p,
36054
+ const { source: e, onChange: n, fullWidth: r = !1 } = t, [o] = lT({ resource: "form_224" }), [i, s] = Le(!1), l = tn(), { estado: u, fichaProps: d = {} } = Rt(), p = bn(!1), {
36055
+ hidden: f,
36035
36056
  propsContenido: {
36036
- readOnly: f,
36037
- sx: h,
36038
- label: m = "Funcionarios",
36039
- allowNone: y = !0,
36040
- allowAll: g = !0,
36041
- filgrilla: v,
36042
- meta: S,
36043
- ...T
36057
+ readOnly: h,
36058
+ sx: m,
36059
+ label: y = "Funcionarios",
36060
+ allowNone: g = !0,
36061
+ allowAll: v = !0,
36062
+ filgrilla: S,
36063
+ meta: T,
36064
+ ...E
36044
36065
  }
36045
- } = kn(t), { [e]: E = {} } = u, C = oo(t), w = E.onChange === void 0 ? n : E.onChange;
36066
+ } = kn(t), { [e]: C = {} } = d, w = oo(t), k = C.onChange === void 0 ? n : C.onChange;
36046
36067
  Ae(() => {
36047
- d.current || (setTimeout(() => {
36048
- s.setValue(e, y6);
36049
- }, 0), d.current = !0);
36050
- }, [s, e]);
36051
- const k = et(() => {
36052
- i(!1);
36053
- }, [i]), R = /* @__PURE__ */ a((D, P) => {
36054
- i(!1), s.setValue(e, {
36055
- seleccion: r.join(",").replaceAll("funnro=", ""),
36068
+ p.current || (setTimeout(() => {
36069
+ l.setValue(e, y6);
36070
+ }, 0), p.current = !0);
36071
+ }, [l, e]);
36072
+ const R = et(() => {
36073
+ s(!1);
36074
+ }, [s]), N = /* @__PURE__ */ a((P, O) => {
36075
+ s(!1), l.setValue(e, {
36076
+ seleccion: o.join(",").replaceAll("funnro=", ""),
36056
36077
  all: !1,
36057
36078
  none: !1
36058
- }), w && w(C, l, D);
36059
- }, "handleConfirm"), N = /* @__PURE__ */ a((D) => {
36060
- s.setValue(e, {
36079
+ }), k && k(w, u, P);
36080
+ }, "handleConfirm"), A = /* @__PURE__ */ a((P) => {
36081
+ l.setValue(e, {
36061
36082
  seleccion: "",
36062
36083
  all: !1,
36063
36084
  none: !0
36064
- }), w && w(C, l, D);
36065
- }, "handleNinguno"), A = /* @__PURE__ */ a((D) => {
36066
- s.setValue(e, {
36085
+ }), k && k(w, u, P);
36086
+ }, "handleNinguno"), D = /* @__PURE__ */ a((P) => {
36087
+ l.setValue(e, {
36067
36088
  seleccion: "",
36068
36089
  all: !0,
36069
36090
  none: !1
36070
- }), w && w(C, l, D);
36091
+ }), k && k(w, u, P);
36071
36092
  }, "handleTodos");
36072
- return p ? null : /* @__PURE__ */ q(ar, { children: [
36093
+ return f ? null : /* @__PURE__ */ q(ar, { children: [
36073
36094
  /* @__PURE__ */ b(
36074
36095
  Ve,
36075
36096
  {
36076
36097
  display: "flex",
36077
36098
  alignItems: "center",
36078
36099
  sx: {
36079
- ...h,
36100
+ ...m,
36080
36101
  display: "inline-flex",
36081
- width: { xs: "100%", md: "auto" }
36102
+ width: r ? "100%" : { xs: "100%", md: "auto" }
36082
36103
  },
36083
36104
  children: /* @__PURE__ */ b(
36084
36105
  Kr,
36085
36106
  {
36086
- ...T,
36107
+ ...E,
36087
36108
  source: e,
36088
- label: m,
36109
+ label: y,
36089
36110
  readOnly: !0,
36090
36111
  parse: v6,
36091
36112
  format: b6,
36092
36113
  helperText: !1,
36093
36114
  InputProps: {
36094
36115
  endAdornment: /* @__PURE__ */ q(ar, { children: [
36095
- y && /* @__PURE__ */ b(
36116
+ g && /* @__PURE__ */ b(
36096
36117
  $n,
36097
36118
  {
36098
- onClick: N,
36099
- disabled: f,
36119
+ onClick: A,
36120
+ disabled: h,
36100
36121
  "aria-label": "Ninguno",
36101
36122
  size: "small",
36102
36123
  title: "Ninguno",
36103
36124
  children: /* @__PURE__ */ b(Nk, {})
36104
36125
  }
36105
36126
  ),
36106
- g && /* @__PURE__ */ b(
36127
+ v && /* @__PURE__ */ b(
36107
36128
  $n,
36108
36129
  {
36109
- onClick: A,
36110
- disabled: f,
36130
+ onClick: D,
36131
+ disabled: h,
36111
36132
  "aria-label": "Todos",
36112
36133
  size: "small",
36113
36134
  title: "Todos",
@@ -36117,8 +36138,8 @@ const Gj = me([/* @__PURE__ */ b("circle", {
36117
36138
  /* @__PURE__ */ b(
36118
36139
  $n,
36119
36140
  {
36120
- onClick: /* @__PURE__ */ a((D) => i(!0), "onClick"),
36121
- disabled: f,
36141
+ onClick: /* @__PURE__ */ a((P) => s(!0), "onClick"),
36142
+ disabled: h,
36122
36143
  "aria-label": "Selección",
36123
36144
  size: "small",
36124
36145
  title: "Selección",
@@ -36134,12 +36155,12 @@ const Gj = me([/* @__PURE__ */ b("circle", {
36134
36155
  /* @__PURE__ */ b(
36135
36156
  g6,
36136
36157
  {
36137
- isOpen: o,
36138
- title: `Selección de ${m}`,
36139
- onConfirm: R,
36140
- onClose: k,
36141
- filgrilla: v,
36142
- meta: S
36158
+ isOpen: i,
36159
+ title: `Selección de ${y}`,
36160
+ onConfirm: N,
36161
+ onClose: R,
36162
+ filgrilla: S,
36163
+ meta: T
36143
36164
  }
36144
36165
  )
36145
36166
  ] });