@sito/dashboard 0.0.67 → 0.0.68
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/dist/{FileInput-DCR_Pyqe.js → FileInput-DNoJELoS.js} +18 -18
- package/dist/FileInput-YvKQ-wok.cjs +1 -0
- package/dist/FiltersProvider-BlHv12dU.cjs +1 -0
- package/dist/{FiltersProvider-CY2fsw_F.js → FiltersProvider-gfC9gS8u.js} +5 -5
- package/dist/FiltersProvider.cjs +1 -1
- package/dist/FiltersProvider.js +1 -1
- package/dist/Form.cjs +1 -1
- package/dist/Form.js +2 -2
- package/dist/{Table-BtZGG0d7.js → Table-B5vsXjAq.js} +399 -375
- package/dist/Table-DgFzKIJZ.cjs +1 -0
- package/dist/Table.cjs +1 -1
- package/dist/Table.css +1 -1
- package/dist/Table.js +1 -1
- package/dist/TableOptions.cjs +1 -1
- package/dist/TableOptions.js +1 -1
- package/dist/TableOptionsProvider-CDLZ4TXE.cjs +1 -0
- package/dist/TableOptionsProvider-HHCDcRbO.js +55 -0
- package/dist/TextInput-C27RFuya.cjs +1 -0
- package/dist/TextInput-DPYxzgm3.js +335 -0
- package/dist/TextInput.css +1 -1
- package/dist/Translation.cjs +1 -1
- package/dist/Translation.js +1 -1
- package/dist/{TranslationProvider-COebIyxr.js → TranslationProvider-BR4s--Vu.js} +2 -2
- package/dist/TranslationProvider-Czr0WIDH.cjs +1 -0
- package/dist/components/Form/CheckInput/CheckInput.stories.d.ts +2 -0
- package/dist/components/Form/CheckInput/CheckInput.test.d.ts +1 -0
- package/dist/components/Form/SelectInput/SelectInput.stories.d.ts +1 -0
- package/dist/components/Form/TextInput/TextInput.stories.d.ts +2 -0
- package/dist/components/Table/Table.stories.d.ts +2 -0
- package/dist/components/Table/components/Footer/Navigation.test.d.ts +1 -0
- package/dist/components/Table/components/TableHeader/TableHeader.test.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +6 -6
- package/dist/providers/FiltersProvider/FiltersProvider.test.d.ts +1 -0
- package/dist/providers/Translation/TranslationProvider.d.ts +5 -4
- package/dist/providers/Translation/TranslationProvider.test.d.ts +1 -0
- package/package.json +1 -1
- package/dist/FileInput-Ch-GCxrS.cjs +0 -1
- package/dist/FiltersProvider-CYqLFEI9.cjs +0 -1
- package/dist/Table-DjIhOMXQ.cjs +0 -1
- package/dist/TableOptionsProvider-BchUDA3B.cjs +0 -1
- package/dist/TableOptionsProvider-BfQS8l1N.js +0 -50
- package/dist/TextInput-BqW5YX-3.js +0 -320
- package/dist/TextInput-CY1fh4mf.cjs +0 -1
- package/dist/TranslationProvider-51Pc9Xrr.cjs +0 -1
|
@@ -6,17 +6,17 @@ import { F as q } from "./File-BuJndWMv.js";
|
|
|
6
6
|
import { C as A } from "./Chip-C5ogKbFn.js";
|
|
7
7
|
import { I as B } from "./IconButton-BpsTEj0z.js";
|
|
8
8
|
import { C as D } from "./Close-rKC9AcNX.js";
|
|
9
|
-
function x(t,
|
|
10
|
-
if (t.length <=
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
return t.slice(0,
|
|
14
|
-
const p = t.slice(0,
|
|
9
|
+
function x(t, i = 25) {
|
|
10
|
+
if (t.length <= i) return t;
|
|
11
|
+
const s = t.lastIndexOf(".");
|
|
12
|
+
if (s === -1)
|
|
13
|
+
return t.slice(0, i - 3) + "...";
|
|
14
|
+
const p = t.slice(0, s), r = t.slice(s), f = i - r.length - 3;
|
|
15
15
|
return p.slice(0, f) + "..." + r;
|
|
16
16
|
}
|
|
17
|
-
const K = j(function(t,
|
|
17
|
+
const K = j(function(t, i) {
|
|
18
18
|
const {
|
|
19
|
-
children:
|
|
19
|
+
children: s,
|
|
20
20
|
label: p,
|
|
21
21
|
containerClassName: r = "",
|
|
22
22
|
inputClassName: f = "",
|
|
@@ -27,26 +27,26 @@ const K = j(function(t, s) {
|
|
|
27
27
|
multiple: b = !1,
|
|
28
28
|
onChange: N,
|
|
29
29
|
onClear: o,
|
|
30
|
-
...
|
|
31
|
-
} = t, [n,
|
|
30
|
+
...d
|
|
31
|
+
} = t, [n, h] = R([]), I = m(
|
|
32
32
|
(e) => {
|
|
33
33
|
if (e.target.files) {
|
|
34
34
|
const a = Array.from(e.target.files);
|
|
35
|
-
|
|
35
|
+
h((c) => [...c, ...a]);
|
|
36
36
|
}
|
|
37
37
|
N?.(e);
|
|
38
38
|
},
|
|
39
39
|
[N]
|
|
40
40
|
), w = m(
|
|
41
41
|
(e) => {
|
|
42
|
-
|
|
42
|
+
h((a) => {
|
|
43
43
|
const c = a.filter((M, y) => y !== e);
|
|
44
44
|
return c.length === 0 && o?.(), c;
|
|
45
45
|
});
|
|
46
46
|
},
|
|
47
47
|
[o]
|
|
48
48
|
), T = m(() => {
|
|
49
|
-
|
|
49
|
+
h([]), o?.();
|
|
50
50
|
}, [o]), k = m(
|
|
51
51
|
(e) => {
|
|
52
52
|
e.currentTarget.value = "";
|
|
@@ -54,21 +54,21 @@ const K = j(function(t, s) {
|
|
|
54
54
|
[]
|
|
55
55
|
);
|
|
56
56
|
return /* @__PURE__ */ u("div", { className: `file-input-container ${r}`, children: [
|
|
57
|
-
n.length === 0 && /* @__PURE__ */ u("label", { htmlFor:
|
|
57
|
+
n.length === 0 && /* @__PURE__ */ u("label", { htmlFor: d.id, className: `${v}`, children: [
|
|
58
58
|
p,
|
|
59
59
|
/* @__PURE__ */ l(
|
|
60
60
|
"input",
|
|
61
61
|
{
|
|
62
62
|
type: "file",
|
|
63
|
-
ref:
|
|
63
|
+
ref: i,
|
|
64
64
|
multiple: b,
|
|
65
65
|
onClick: k,
|
|
66
66
|
onChange: I,
|
|
67
67
|
className: `file-input ${f}`,
|
|
68
|
-
...
|
|
68
|
+
...d
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
|
-
|
|
71
|
+
d.required ? " *" : ""
|
|
72
72
|
] }),
|
|
73
73
|
n.length > 1 && /* @__PURE__ */ l("ul", { className: "file-preview-list", children: n.map((e, a) => /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l(g, { content: e.name, children: /* @__PURE__ */ l(
|
|
74
74
|
A,
|
|
@@ -82,7 +82,7 @@ const K = j(function(t, s) {
|
|
|
82
82
|
/* @__PURE__ */ l(g, { content: n[0]?.name ?? "", children: /* @__PURE__ */ l("span", { className: "file-preview-name", children: x(n[0]?.name ?? "", 25) }) }),
|
|
83
83
|
/* @__PURE__ */ l(B, { icon: /* @__PURE__ */ l(D, {}), onClick: T, type: "button" })
|
|
84
84
|
] }),
|
|
85
|
-
|
|
85
|
+
s,
|
|
86
86
|
!!C && /* @__PURE__ */ l("p", { className: `file-input-helper-text ${F}`, children: C })
|
|
87
87
|
] });
|
|
88
88
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var D=require("./FileInput.css");const e=require("react/jsx-runtime"),n=require("react"),m=require("./Tooltip-BSKAgRkc.cjs"),T=require("./File-_Hjw2d3F.cjs"),w=require("./Chip-D17UJHW6.cjs"),y=require("./IconButton-CVnmT2E9.cjs"),R=require("./Close-O9P7wJGf.cjs");function j(s,i=25){if(s.length<=i)return s;const c=s.lastIndexOf(".");if(c===-1)return s.slice(0,i-3)+"...";const h=s.slice(0,c),r=s.slice(c),d=i-r.length-3;return h.slice(0,d)+"..."+r}const B=n.forwardRef(function(s,i){const{children:c,label:h,containerClassName:r="",inputClassName:d="",labelClassName:N="",helperText:x="",helperTextClassName:g="",iconClassName:b="",multiple:q=!1,onChange:C,onClear:o,...p}=s,[t,f]=n.useState([]),k=n.useCallback(l=>{if(l.target.files){const a=Array.from(l.target.files);f(u=>[...u,...a])}C?.(l)},[C]),v=n.useCallback(l=>{f(a=>{const u=a.filter((A,$)=>$!==l);return u.length===0&&o?.(),u})},[o]),F=n.useCallback(()=>{f([]),o?.()},[o]),I=n.useCallback(l=>{l.currentTarget.value=""},[]);return e.jsxs("div",{className:`file-input-container ${r}`,children:[t.length===0&&e.jsxs("label",{htmlFor:p.id,className:`${N}`,children:[h,e.jsx("input",{type:"file",ref:i,multiple:q,onClick:I,onChange:k,className:`file-input ${d}`,...p}),p.required?" *":""]}),t.length>1&&e.jsx("ul",{className:"file-preview-list",children:t.map((l,a)=>e.jsx("li",{children:e.jsx(m.Tooltip,{content:l.name,children:e.jsx(w.Chip,{text:j(l.name,25),onDelete:()=>v(a)})})},`${l.name}-${l.lastModified}`))}),t.length===1&&e.jsxs("div",{className:"file-preview",children:[e.jsx(T.File,{className:`file-icon ${b}`}),e.jsx(m.Tooltip,{content:t[0]?.name??"",children:e.jsx("span",{className:"file-preview-name",children:j(t[0]?.name??"",25)})}),e.jsx(y.IconButton,{icon:e.jsx(R.Close,{}),onClick:F,type:"button"})]}),c,!!x&&e.jsx("p",{className:`file-input-helper-text ${g}`,children:x})]})});exports.FileInput=B;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const p=require("react/jsx-runtime"),i=require("react"),f=require("./TableOptionsProvider-CDLZ4TXE.cjs");var n=(e=>(e[e.update=0]="update",e[e.reset=1]="reset",e))(n||{});const o=e=>{if(e){const t={};return Object.keys(e)?.forEach(s=>{t[s]={value:e[s]}}),t}return{}};function a(e,t){const{type:r}=t;switch(r){case n.reset:return{};case n.update:{const{toUpdate:s}=t;return{...e,...s}}default:return e}}const d=i.createContext(void 0),v=e=>{const{children:t}=e,{filters:r}=f.useTableOptions(),[s,u]=i.useReducer(a,o(r));i.useEffect(()=>{u({type:n.reset});const c=o(r);Object.keys(c).length&&u({type:n.update,toUpdate:c})},[r]);const l={currentFilters:s,setCurrentFilters:u};return p.jsx(d.Provider,{value:l,children:t})},x=()=>{const e=i.useContext(d);if(!e)throw new Error("filtersContext must be used within a Provider");return e};exports.FiltersActions=n;exports.FiltersProvider=v;exports.filtersReducer=a;exports.initializer=o;exports.useFilters=x;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { useReducer as p, useEffect as f, createContext as l, useContext as m } from "react";
|
|
3
|
-
import { u as v } from "./TableOptionsProvider-
|
|
3
|
+
import { u as v } from "./TableOptionsProvider-HHCDcRbO.js";
|
|
4
4
|
var n = /* @__PURE__ */ ((e) => (e[e.update = 0] = "update", e[e.reset = 1] = "reset", e))(n || {});
|
|
5
5
|
const a = (e) => {
|
|
6
6
|
if (e) {
|
|
@@ -24,7 +24,7 @@ function x(e, t) {
|
|
|
24
24
|
return e;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
const c = l(
|
|
27
|
+
const c = l(void 0), b = (e) => {
|
|
28
28
|
const { children: t } = e, { filters: r } = v(), [s, o] = p(
|
|
29
29
|
x,
|
|
30
30
|
a(r)
|
|
@@ -44,12 +44,12 @@ const c = l({}), C = (e) => {
|
|
|
44
44
|
return /* @__PURE__ */ d(c.Provider, { value: i, children: t });
|
|
45
45
|
}, w = () => {
|
|
46
46
|
const e = m(c);
|
|
47
|
-
if (e
|
|
48
|
-
throw new Error("
|
|
47
|
+
if (!e)
|
|
48
|
+
throw new Error("filtersContext must be used within a Provider");
|
|
49
49
|
return e;
|
|
50
50
|
};
|
|
51
51
|
export {
|
|
52
|
-
|
|
52
|
+
b as F,
|
|
53
53
|
n as a,
|
|
54
54
|
x as f,
|
|
55
55
|
a as i,
|
package/dist/FiltersProvider.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./FiltersProvider-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./FiltersProvider-BlHv12dU.cjs");exports.FiltersActions=e.FiltersActions;exports.FiltersProvider=e.FiltersProvider;exports.filtersReducer=e.filtersReducer;exports.initializer=e.initializer;exports.useFilters=e.useFilters;
|
package/dist/FiltersProvider.js
CHANGED
package/dist/Form.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TextInput-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TextInput-C27RFuya.cjs"),t=require("./FileInput-YvKQ-wok.cjs");exports.AutocompleteInput=e.AutocompleteInput;exports.CheckInput=e.CheckInput;exports.SelectInput=e.SelectInput;exports.State=e.State;exports.TextInput=e.TextInput;exports.helperTextStateClassName=e.helperTextStateClassName;exports.inputStateClassName=e.inputStateClassName;exports.labelStateClassName=e.labelStateClassName;exports.FileInput=t.FileInput;
|
package/dist/Form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as e, C as s, S as l, a as p, T as u, h as m, i as n, l as o } from "./TextInput-
|
|
2
|
-
import { F as r } from "./FileInput-
|
|
1
|
+
import { A as e, C as s, S as l, a as p, T as u, h as m, i as n, l as o } from "./TextInput-DPYxzgm3.js";
|
|
2
|
+
import { F as r } from "./FileInput-DNoJELoS.js";
|
|
3
3
|
export {
|
|
4
4
|
e as AutocompleteInput,
|
|
5
5
|
s as CheckInput,
|