@cronocode/react-box 1.6.7 → 1.6.8
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/components/baseSvg.cjs +1 -1
- package/components/baseSvg.mjs +1 -4
- package/components/button.cjs +1 -1
- package/components/button.d.ts +1 -0
- package/components/button.mjs +7 -10
- package/components/checkbox.cjs +1 -1
- package/components/checkbox.mjs +4 -7
- package/components/dataGrid/dataGridContract.d.ts +1 -0
- package/components/dataGrid.cjs +1 -1
- package/components/dataGrid.d.ts +1 -1
- package/components/dataGrid.mjs +2 -32
- package/components/dox/doxStyles.d.ts +9 -0
- package/components/dox.cjs +2 -2
- package/components/dox.d.ts +6 -4
- package/components/dox.mjs +23 -24
- package/components/doxSvg.cjs +1 -1
- package/components/doxSvg.d.ts +1 -0
- package/components/doxSvg.mjs +4 -7
- package/components/flex.d.ts +4 -2
- package/components/form.cjs +1 -1
- package/components/form.d.ts +2 -1
- package/components/form.mjs +4 -15
- package/components/grid.cjs +1 -1
- package/components/grid.d.ts +4 -2
- package/components/grid.mjs +5 -8
- package/components/radioButton.cjs +1 -1
- package/components/radioButton.mjs +2 -5
- package/components/textarea.cjs +1 -1
- package/components/textarea.mjs +7 -10
- package/components/textbox.cjs +1 -1
- package/components/textbox.mjs +6 -9
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.d.ts +1 -1
- package/components/tooltip.mjs +5 -63
- package/package.json +14 -14
- package/plugins.cjs +1 -209
- package/plugins.mjs +0 -219
- package/style.css +1 -1
- package/theme.cjs +1 -1
- package/theme.mjs +8 -10
- package/types.d.ts +9 -0
- package/utils/utils.cjs +1 -1
- package/utils/utils.mjs +53 -63
package/theme.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),d={button:{styles:{display:"inline-block",p:3,cursor:"pointer",b:1,borderRadius:1},disabled:{cursor:"default"}},checkbox:{styles:{display:"inline-block",b:1,p:2}},radioButton:{styles:{display:"inline-block",b:1,p:2}},textbox:{styles:{display:"inline-block",b:1,borderRadius:1,p:3}},textarea:{styles:{display:"inline-block",b:1,borderRadius:1}}};let i=d;var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),d={button:{styles:{display:"inline-block",p:3,cursor:"pointer",b:1,borderRadius:1},disabled:{cursor:"default"}},checkbox:{styles:{display:"inline-block",b:1,p:2}},radioButton:{styles:{display:"inline-block",b:1,p:2}},textbox:{styles:{display:"inline-block",b:1,borderRadius:1,p:3}},textarea:{styles:{display:"inline-block",b:1,borderRadius:1}}};let i=d;var u;(a=>{function n(s){i=s,o()}a.setup=n;function o(){Object.keys(d).forEach(t=>{const e=i[t],l=d[t];e?(e.styles={...l.styles,...e.styles},e.disabled&&l.disabled&&(e.disabled={...l.disabled,...e.disabled})):i[t]=d[t]})}})(u||(u={}));function p(a){const{clean:n,disabled:o,theme:s,component:t}=a;return y.useMemo(()=>{var r,b,c;if(n)return;let e=i[t]??((r=i.components)==null?void 0:r[t]);if(!e)return;let l=s?{...e.styles,...(b=e.themes)==null?void 0:b[s].styles}:e.styles;return o?s?{...l,...e.disabled,...(c=e.themes)==null?void 0:c[s].disabled}:{...l,...e.disabled}:l},[t,n,o,s])}exports.useTheme=p;
|
package/theme.mjs
CHANGED
|
@@ -43,7 +43,7 @@ const d = {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
let i = d;
|
|
46
|
-
var
|
|
46
|
+
var u;
|
|
47
47
|
((a) => {
|
|
48
48
|
function n(s) {
|
|
49
49
|
i = s, o();
|
|
@@ -55,22 +55,20 @@ var r;
|
|
|
55
55
|
e ? (e.styles = { ...l.styles, ...e.styles }, e.disabled && l.disabled && (e.disabled = { ...l.disabled, ...e.disabled })) : i[t] = d[t];
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
})(
|
|
59
|
-
|
|
60
|
-
function m(a) {
|
|
58
|
+
})(u || (u = {}));
|
|
59
|
+
function f(a) {
|
|
61
60
|
const { clean: n, disabled: o, theme: s, component: t } = a;
|
|
62
61
|
return y(() => {
|
|
63
|
-
var b, c
|
|
62
|
+
var r, b, c;
|
|
64
63
|
if (n)
|
|
65
64
|
return;
|
|
66
|
-
let e = i[t] ?? ((
|
|
65
|
+
let e = i[t] ?? ((r = i.components) == null ? void 0 : r[t]);
|
|
67
66
|
if (!e)
|
|
68
67
|
return;
|
|
69
|
-
let l = s ? { ...e.styles, ...(
|
|
70
|
-
return o ? s ? { ...l, ...e.disabled, ...(
|
|
68
|
+
let l = s ? { ...e.styles, ...(b = e.themes) == null ? void 0 : b[s].styles } : e.styles;
|
|
69
|
+
return o ? s ? { ...l, ...e.disabled, ...(c = e.themes) == null ? void 0 : c[s].disabled } : { ...l, ...e.disabled } : l;
|
|
71
70
|
}, [t, n, o, s]);
|
|
72
71
|
}
|
|
73
72
|
export {
|
|
74
|
-
f as
|
|
75
|
-
m as useTheme
|
|
73
|
+
f as useTheme
|
|
76
74
|
};
|
package/types.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
type Hovered<T> = {
|
|
2
|
+
[K in keyof T as K extends string ? `${K}H` : never]: T[K];
|
|
3
|
+
};
|
|
4
|
+
type Focused<T> = {
|
|
5
|
+
[K in keyof T as K extends string ? `${K}F` : never]: T[K];
|
|
6
|
+
};
|
|
7
|
+
type Activated<T> = {
|
|
8
|
+
[K in keyof T as K extends string ? `${K}A` : never]: T[K];
|
|
9
|
+
};
|
|
1
10
|
export declare const styleVariables: {
|
|
2
11
|
display: readonly ["none", "block", "inline-block", "flex", "inline-flex", "grid", "inline-grid", "contents"];
|
|
3
12
|
boxSizing: readonly ["border-box", "content-box"];
|
package/utils/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";require("react");var a;(h=>{function c(...o){return o.reduce((s,n)=>n?typeof n=="string"?(s.push(n),s):Array.isArray(n)?(s.push(...c(...n)),s):(Object.entries(n).forEach(([r,e])=>{e&&s.push(r)}),s):s,[])}h.classNames=c})(a||(a={}));const x=a;class y{constructor(){this._index=0,this._cache={}}getIdentity(c){return this._cache[c]||(this._cache[c]=this.getByIndex(this._index++)),this._cache[c]}getByIndex(c){const{first:o,next:s}=b,n=c-o.length;if(n<0)return o[c];const r=Math.floor(n/s.length),e=n-r*s.length;return this.getByIndex(r)+s[e]}}const b={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};var l;(h=>{function c(s,...n){const r={...s},e={};return n.forEach(t=>{t in r&&(e[t]=r[t],delete r[t])}),[e,r]}h.moveToTagProps=c;function o(s,n,r){const e={...s},t=e.props||{};return n.forEach(i=>{if(i in e){if(t[i]=e[i],i==="disabled")return;delete e[i]}}),r&&Object.entries(r).forEach(([i,f])=>{t[i]=f}),e.props=t,e}h.buildProps=o})(l||(l={}));const I=l;var g;(h=>{function c(s){const n=Array.from(s.elements).reduce((r,e)=>{const t=e.name;return t&&(r[t]||(r[t]=[]),r[t].push(e)),r},{});return Object.entries(n).reduce((r,[e,t])=>{if(t.length===1){const i=t[0];o(r,e,i.type==="checkbox"||i.type==="radio"?i.checked:i.value)}else{const i=t.reduce((f,u)=>(u.type==="checkbox"||u.type==="radio"?u.checked&&f.push(u.value):f.push(u.value),f),[]);o(r,e,i)}return r},{})}h.getFormEntries=c;function o(s,n,r){if(n.includes(".")){const e=n.split(".");let t=s;e.forEach((i,f)=>{if(e.length>f+1){const u=i.match(/^(.+)\[(\d)\]$/);if(u){const[,d,p]=u;t[d]=t[d]||[],t[d][p]=t[d][p]||{},t=t[d][p]}else t[i]=t[i]||{},t=t[i]}else t[i]=r})}else s[n]=r}})(g||(g={}));exports.ClassNameUtils=x;exports.IdentityFactory=y;exports.ObjectUtils=I;
|
package/utils/utils.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
3
|
-
((
|
|
4
|
-
function i(...
|
|
5
|
-
return
|
|
6
|
-
e &&
|
|
7
|
-
}),
|
|
1
|
+
import "react";
|
|
2
|
+
var a;
|
|
3
|
+
((u) => {
|
|
4
|
+
function i(...c) {
|
|
5
|
+
return c.reduce((s, n) => n ? typeof n == "string" ? (s.push(n), s) : Array.isArray(n) ? (s.push(...i(...n)), s) : (Object.entries(n).forEach(([r, e]) => {
|
|
6
|
+
e && s.push(r);
|
|
7
|
+
}), s) : s, []);
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
})(
|
|
11
|
-
const y =
|
|
9
|
+
u.classNames = i;
|
|
10
|
+
})(a || (a = {}));
|
|
11
|
+
const y = a;
|
|
12
12
|
class I {
|
|
13
13
|
constructor() {
|
|
14
14
|
this._index = 0, this._cache = {};
|
|
@@ -17,91 +17,81 @@ class I {
|
|
|
17
17
|
return this._cache[i] || (this._cache[i] = this.getByIndex(this._index++)), this._cache[i];
|
|
18
18
|
}
|
|
19
19
|
getByIndex(i) {
|
|
20
|
-
const { first:
|
|
21
|
-
if (
|
|
22
|
-
return
|
|
23
|
-
const r = Math.floor(
|
|
24
|
-
return this.getByIndex(r) +
|
|
20
|
+
const { first: c, next: s } = x, n = i - c.length;
|
|
21
|
+
if (n < 0)
|
|
22
|
+
return c[i];
|
|
23
|
+
const r = Math.floor(n / s.length), e = n - r * s.length;
|
|
24
|
+
return this.getByIndex(r) + s[e];
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const x = {
|
|
28
28
|
first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
29
29
|
next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
|
30
30
|
};
|
|
31
31
|
var l;
|
|
32
|
-
((
|
|
33
|
-
function i(
|
|
34
|
-
const r = { ...
|
|
35
|
-
return
|
|
32
|
+
((u) => {
|
|
33
|
+
function i(s, ...n) {
|
|
34
|
+
const r = { ...s }, e = {};
|
|
35
|
+
return n.forEach((t) => {
|
|
36
36
|
t in r && (e[t] = r[t], delete r[t]);
|
|
37
37
|
}), [e, r];
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
const e = { ...
|
|
42
|
-
return
|
|
43
|
-
if (
|
|
44
|
-
if (t[
|
|
39
|
+
u.moveToTagProps = i;
|
|
40
|
+
function c(s, n, r) {
|
|
41
|
+
const e = { ...s }, t = e.props || {};
|
|
42
|
+
return n.forEach((o) => {
|
|
43
|
+
if (o in e) {
|
|
44
|
+
if (t[o] = e[o], o === "disabled")
|
|
45
45
|
return;
|
|
46
|
-
delete e[
|
|
46
|
+
delete e[o];
|
|
47
47
|
}
|
|
48
|
-
}), r && Object.entries(r).forEach(([
|
|
49
|
-
t[
|
|
48
|
+
}), r && Object.entries(r).forEach(([o, f]) => {
|
|
49
|
+
t[o] = f;
|
|
50
50
|
}), e.props = t, e;
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
u.buildProps = c;
|
|
53
53
|
})(l || (l = {}));
|
|
54
|
-
const
|
|
54
|
+
const P = l;
|
|
55
55
|
var g;
|
|
56
|
-
((
|
|
57
|
-
function i(
|
|
58
|
-
const
|
|
56
|
+
((u) => {
|
|
57
|
+
function i(s) {
|
|
58
|
+
const n = Array.from(s.elements).reduce((r, e) => {
|
|
59
59
|
const t = e.name;
|
|
60
60
|
return t && (r[t] || (r[t] = []), r[t].push(e)), r;
|
|
61
61
|
}, {});
|
|
62
|
-
return Object.entries(
|
|
62
|
+
return Object.entries(n).reduce((r, [e, t]) => {
|
|
63
63
|
if (t.length === 1) {
|
|
64
|
-
const
|
|
65
|
-
|
|
64
|
+
const o = t[0];
|
|
65
|
+
c(r, e, o.type === "checkbox" || o.type === "radio" ? o.checked : o.value);
|
|
66
66
|
} else {
|
|
67
|
-
const
|
|
68
|
-
|
|
67
|
+
const o = t.reduce((f, h) => (h.type === "checkbox" || h.type === "radio" ? h.checked && f.push(h.value) : f.push(h.value), f), []);
|
|
68
|
+
c(r, e, o);
|
|
69
69
|
}
|
|
70
70
|
return r;
|
|
71
71
|
}, {});
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
function
|
|
75
|
-
if (
|
|
76
|
-
const e =
|
|
77
|
-
let t =
|
|
78
|
-
e.forEach((
|
|
73
|
+
u.getFormEntries = i;
|
|
74
|
+
function c(s, n, r) {
|
|
75
|
+
if (n.includes(".")) {
|
|
76
|
+
const e = n.split(".");
|
|
77
|
+
let t = s;
|
|
78
|
+
e.forEach((o, f) => {
|
|
79
79
|
if (e.length > f + 1) {
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
const [,
|
|
83
|
-
t[
|
|
80
|
+
const h = o.match(/^(.+)\[(\d)\]$/);
|
|
81
|
+
if (h) {
|
|
82
|
+
const [, p, d] = h;
|
|
83
|
+
t[p] = t[p] || [], t[p][d] = t[p][d] || {}, t = t[p][d];
|
|
84
84
|
} else
|
|
85
|
-
t[
|
|
85
|
+
t[o] = t[o] || {}, t = t[o];
|
|
86
86
|
} else
|
|
87
|
-
t[
|
|
87
|
+
t[o] = r;
|
|
88
88
|
});
|
|
89
89
|
} else
|
|
90
|
-
n
|
|
90
|
+
s[n] = r;
|
|
91
91
|
}
|
|
92
92
|
})(g || (g = {}));
|
|
93
|
-
const P = g;
|
|
94
|
-
function v() {
|
|
95
|
-
return x(() => {
|
|
96
|
-
const c = "crono-box";
|
|
97
|
-
let i = document.getElementById(c);
|
|
98
|
-
return i || (i = document.createElement("div"), i.id = c, document.body.appendChild(i)), i;
|
|
99
|
-
}, []);
|
|
100
|
-
}
|
|
101
93
|
export {
|
|
102
94
|
y as C,
|
|
103
|
-
P as F,
|
|
104
95
|
I,
|
|
105
|
-
|
|
106
|
-
v as u
|
|
96
|
+
P as O
|
|
107
97
|
};
|