@cronocode/react-box 1.6.4 → 1.6.6
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/box.cjs +1 -1
- package/box.d.ts +2 -18
- package/box.mjs +5 -51
- package/components/baseSvg.cjs +1 -1
- package/components/baseSvg.d.ts +2 -19
- package/components/baseSvg.mjs +7 -20
- package/components/button.cjs +1 -1
- package/components/button.mjs +7 -8
- package/components/checkbox.cjs +1 -1
- package/components/checkbox.mjs +1 -1
- package/components/dataGrid.cjs +1 -1
- package/components/dataGrid.mjs +3 -4
- package/components/dox/doxStyles.d.ts +13 -0
- package/components/dox.cjs +3 -3
- package/components/dox.d.ts +5 -2
- package/components/dox.mjs +113 -105
- package/components/doxSvg.cjs +1 -1
- package/components/doxSvg.d.ts +7 -8
- package/components/doxSvg.mjs +10 -10
- package/components/flex.cjs +1 -1
- package/components/flex.d.ts +3 -2
- package/components/flex.mjs +7 -8
- package/components/form.cjs +1 -1
- package/components/form.mjs +3 -4
- package/components/grid.cjs +1 -1
- package/components/grid.d.ts +3 -2
- package/components/grid.mjs +4 -5
- package/components/radioButton.cjs +1 -1
- package/components/radioButton.mjs +4 -5
- package/components/textarea.cjs +1 -1
- package/components/textarea.mjs +8 -9
- package/components/textbox.cjs +1 -1
- package/components/textbox.mjs +6 -7
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.mjs +1 -2
- package/package.json +1 -1
- package/style.css +1 -1
- package/utils/utils.cjs +1 -1
- package/utils/utils.mjs +74 -121
- package/baseSvg.module.css.cjs +0 -1
- package/baseSvg.module.css.mjs +0 -4
package/utils/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const y=require("react");var a;(c=>{function i(...u){return u.reduce((n,o)=>o?typeof o=="string"?(n.push(o),n):Array.isArray(o)?(n.push(...i(...o)),n):(Object.entries(o).forEach(([e,r])=>{r&&n.push(e)}),n):n,[])}c.classNames=i})(a||(a={}));const b=a;class m{constructor(){this._index=0,this._cache={}}getIdentity(i){return this._cache[i]||(this._cache[i]=this.getByIndex(this._index++)),this._cache[i]}getByIndex(i){const{first:u,next:n}=x,o=i-u.length;if(o<0)return u[i];const e=Math.floor(o/n.length),r=o-e*n.length;return this.getByIndex(e)+n[r]}}const x={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};var p;(c=>{function i(n,...o){const e={...n},r={};return o.forEach(t=>{t in e&&(r[t]=e[t],delete e[t])}),[r,e]}c.moveToTagProps=i;function u(n,o,e){const r={...n},t=r.props||{};return o.forEach(s=>{if(s in r){if(t[s]=r[s],s==="disabled")return;delete r[s]}}),e&&Object.entries(e).forEach(([s,h])=>{t[s]=h}),r.props=t,r}c.buildProps=u})(p||(p={}));const I=p;var g;(c=>{function i(n){const o=Array.from(n.elements).reduce((e,r)=>{const t=r.name;return t&&(e[t]||(e[t]=[]),e[t].push(r)),e},{});return Object.entries(o).reduce((e,[r,t])=>{if(t.length===1){const s=t[0];u(e,r,s.type==="checkbox"||s.type==="radio"?s.checked:s.value)}else{const s=t.reduce((h,d)=>(d.type==="checkbox"||d.type==="radio"?d.checked&&h.push(d.value):h.push(d.value),h),[]);u(e,r,s)}return e},{})}c.getFormEntries=i;function u(n,o,e){if(o.includes(".")){const r=o.split(".");let t=n;r.forEach((s,h)=>{if(r.length>h+1){const d=s.match(/^(.+)\[(\d)\]$/);if(d){const[,f,l]=d;t[f]=t[f]||[],t[f][l]=t[f][l]||{},t=t[f][l]}else t[s]=t[s]||{},t=t[s]}else t[s]=e})}else n[o]=e}})(g||(g={}));const P=g;function E(){return y.useMemo(()=>{const c="crono-box";let i=document.getElementById(c);return i||(i=document.createElement("div"),i.id=c,document.body.appendChild(i)),i},[])}exports.ClassNameUtils=b;exports.FormUtils=P;exports.IdentityFactory=m;exports.ObjectUtils=I;exports.usePortalContainer=E;
|
package/utils/utils.mjs
CHANGED
|
@@ -1,154 +1,107 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
|
|
3
|
-
hover: "_h",
|
|
4
|
-
focus: "_f",
|
|
5
|
-
shadow: "shadow_",
|
|
6
|
-
shadowH: "shadow_h_",
|
|
7
|
-
shadowF: "shadow_f_",
|
|
8
|
-
shadowA: "shadow_a_",
|
|
9
|
-
background: "bg_",
|
|
10
|
-
backgroundH: "bg_h_",
|
|
11
|
-
backgroundF: "bg_f_",
|
|
12
|
-
backgroundA: "bg_a_",
|
|
13
|
-
bg: "bg_",
|
|
14
|
-
bgH: "bg_h_",
|
|
15
|
-
bgF: "bg_f_",
|
|
16
|
-
bgA: "bg_a_",
|
|
17
|
-
color: "color_",
|
|
18
|
-
colorH: "color_h_",
|
|
19
|
-
colorF: "color_f_",
|
|
20
|
-
colorA: "color_a_",
|
|
21
|
-
backgroundColor: "bgColor_",
|
|
22
|
-
backgroundColorH: "bgColor_h_",
|
|
23
|
-
backgroundColorF: "bgColor_f_",
|
|
24
|
-
backgroundColorA: "bgColor_a_",
|
|
25
|
-
bgColor: "bgColor_",
|
|
26
|
-
bgColorH: "bgColor_h_",
|
|
27
|
-
bgColorF: "bgColor_f_",
|
|
28
|
-
bgColorA: "bgColor_a_",
|
|
29
|
-
borderColor: "borderColor_",
|
|
30
|
-
borderColorH: "borderColor_h_",
|
|
31
|
-
borderColorF: "borderColor_f_",
|
|
32
|
-
borderColorA: "borderColor_a_",
|
|
33
|
-
outlineColor: "outlineColor_",
|
|
34
|
-
outlineColorH: "outlineColor_h_",
|
|
35
|
-
outlineColorF: "outlineColor_f_",
|
|
36
|
-
outlineColorA: "outlineColor_a_"
|
|
37
|
-
}, m = {
|
|
38
|
-
fill: "fill_",
|
|
39
|
-
fillH: "fill_h_",
|
|
40
|
-
fillF: "fill_f_",
|
|
41
|
-
fillA: "fill_a_",
|
|
42
|
-
stroke: "stroke_",
|
|
43
|
-
strokeH: "stroke_h_",
|
|
44
|
-
strokeF: "stroke_f_",
|
|
45
|
-
strokeA: "stroke_a_"
|
|
46
|
-
};
|
|
47
|
-
var h;
|
|
1
|
+
import { useMemo as x } from "react";
|
|
2
|
+
var p;
|
|
48
3
|
((c) => {
|
|
49
|
-
function
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
}),
|
|
4
|
+
function i(...u) {
|
|
5
|
+
return u.reduce((n, o) => o ? typeof o == "string" ? (n.push(o), n) : Array.isArray(o) ? (n.push(...i(...o)), n) : (Object.entries(o).forEach(([r, e]) => {
|
|
6
|
+
e && n.push(r);
|
|
7
|
+
}), n) : n, []);
|
|
53
8
|
}
|
|
54
|
-
c.classNames =
|
|
55
|
-
})(
|
|
56
|
-
const
|
|
57
|
-
class
|
|
9
|
+
c.classNames = i;
|
|
10
|
+
})(p || (p = {}));
|
|
11
|
+
const y = p;
|
|
12
|
+
class I {
|
|
58
13
|
constructor() {
|
|
59
14
|
this._index = 0, this._cache = {};
|
|
60
15
|
}
|
|
61
|
-
getIdentity(
|
|
62
|
-
return this._cache[
|
|
16
|
+
getIdentity(i) {
|
|
17
|
+
return this._cache[i] || (this._cache[i] = this.getByIndex(this._index++)), this._cache[i];
|
|
63
18
|
}
|
|
64
|
-
getByIndex(
|
|
65
|
-
const { first:
|
|
66
|
-
if (
|
|
67
|
-
return i
|
|
68
|
-
const r = Math.floor(
|
|
69
|
-
return this.getByIndex(r) + e
|
|
19
|
+
getByIndex(i) {
|
|
20
|
+
const { first: u, next: n } = m, o = i - u.length;
|
|
21
|
+
if (o < 0)
|
|
22
|
+
return u[i];
|
|
23
|
+
const r = Math.floor(o / n.length), e = o - r * n.length;
|
|
24
|
+
return this.getByIndex(r) + n[e];
|
|
70
25
|
}
|
|
71
26
|
}
|
|
72
|
-
const
|
|
27
|
+
const m = {
|
|
73
28
|
first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
74
29
|
next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
|
75
30
|
};
|
|
76
|
-
var
|
|
31
|
+
var l;
|
|
77
32
|
((c) => {
|
|
78
|
-
function
|
|
79
|
-
const r = { ...
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
}), [
|
|
33
|
+
function i(n, ...o) {
|
|
34
|
+
const r = { ...n }, e = {};
|
|
35
|
+
return o.forEach((t) => {
|
|
36
|
+
t in r && (e[t] = r[t], delete r[t]);
|
|
37
|
+
}), [e, r];
|
|
83
38
|
}
|
|
84
|
-
c.moveToTagProps =
|
|
85
|
-
function
|
|
86
|
-
const
|
|
87
|
-
return
|
|
88
|
-
if (s in
|
|
89
|
-
if (
|
|
39
|
+
c.moveToTagProps = i;
|
|
40
|
+
function u(n, o, r) {
|
|
41
|
+
const e = { ...n }, t = e.props || {};
|
|
42
|
+
return o.forEach((s) => {
|
|
43
|
+
if (s in e) {
|
|
44
|
+
if (t[s] = e[s], s === "disabled")
|
|
90
45
|
return;
|
|
91
|
-
delete
|
|
46
|
+
delete e[s];
|
|
92
47
|
}
|
|
93
|
-
}), r && Object.entries(r).forEach(([s,
|
|
94
|
-
|
|
95
|
-
}),
|
|
48
|
+
}), r && Object.entries(r).forEach(([s, f]) => {
|
|
49
|
+
t[s] = f;
|
|
50
|
+
}), e.props = t, e;
|
|
96
51
|
}
|
|
97
|
-
c.buildProps =
|
|
98
|
-
})(
|
|
99
|
-
const
|
|
100
|
-
var
|
|
52
|
+
c.buildProps = u;
|
|
53
|
+
})(l || (l = {}));
|
|
54
|
+
const E = l;
|
|
55
|
+
var g;
|
|
101
56
|
((c) => {
|
|
102
|
-
function
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
return
|
|
57
|
+
function i(n) {
|
|
58
|
+
const o = Array.from(n.elements).reduce((r, e) => {
|
|
59
|
+
const t = e.name;
|
|
60
|
+
return t && (r[t] || (r[t] = []), r[t].push(e)), r;
|
|
106
61
|
}, {});
|
|
107
|
-
return Object.entries(
|
|
108
|
-
if (
|
|
109
|
-
const s =
|
|
110
|
-
|
|
62
|
+
return Object.entries(o).reduce((r, [e, t]) => {
|
|
63
|
+
if (t.length === 1) {
|
|
64
|
+
const s = t[0];
|
|
65
|
+
u(r, e, s.type === "checkbox" || s.type === "radio" ? s.checked : s.value);
|
|
111
66
|
} else {
|
|
112
|
-
const s =
|
|
113
|
-
|
|
67
|
+
const s = t.reduce((f, d) => (d.type === "checkbox" || d.type === "radio" ? d.checked && f.push(d.value) : f.push(d.value), f), []);
|
|
68
|
+
u(r, e, s);
|
|
114
69
|
}
|
|
115
70
|
return r;
|
|
116
71
|
}, {});
|
|
117
72
|
}
|
|
118
|
-
c.getFormEntries =
|
|
119
|
-
function
|
|
120
|
-
if (
|
|
121
|
-
const
|
|
122
|
-
let
|
|
123
|
-
|
|
124
|
-
if (
|
|
125
|
-
const
|
|
126
|
-
if (
|
|
127
|
-
const [,
|
|
128
|
-
|
|
73
|
+
c.getFormEntries = i;
|
|
74
|
+
function u(n, o, r) {
|
|
75
|
+
if (o.includes(".")) {
|
|
76
|
+
const e = o.split(".");
|
|
77
|
+
let t = n;
|
|
78
|
+
e.forEach((s, f) => {
|
|
79
|
+
if (e.length > f + 1) {
|
|
80
|
+
const d = s.match(/^(.+)\[(\d)\]$/);
|
|
81
|
+
if (d) {
|
|
82
|
+
const [, h, a] = d;
|
|
83
|
+
t[h] = t[h] || [], t[h][a] = t[h][a] || {}, t = t[h][a];
|
|
129
84
|
} else
|
|
130
|
-
|
|
85
|
+
t[s] = t[s] || {}, t = t[s];
|
|
131
86
|
} else
|
|
132
|
-
|
|
87
|
+
t[s] = r;
|
|
133
88
|
});
|
|
134
89
|
} else
|
|
135
|
-
|
|
90
|
+
n[o] = r;
|
|
136
91
|
}
|
|
137
|
-
})(
|
|
138
|
-
const
|
|
139
|
-
function
|
|
140
|
-
return
|
|
92
|
+
})(g || (g = {}));
|
|
93
|
+
const P = g;
|
|
94
|
+
function v() {
|
|
95
|
+
return x(() => {
|
|
141
96
|
const c = "crono-box";
|
|
142
|
-
let
|
|
143
|
-
return
|
|
97
|
+
let i = document.getElementById(c);
|
|
98
|
+
return i || (i = document.createElement("div"), i.id = c, document.body.appendChild(i)), i;
|
|
144
99
|
}, []);
|
|
145
100
|
}
|
|
146
101
|
export {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
m as t,
|
|
153
|
-
I as u
|
|
102
|
+
y as C,
|
|
103
|
+
P as F,
|
|
104
|
+
I,
|
|
105
|
+
E as O,
|
|
106
|
+
v as u
|
|
154
107
|
};
|
package/baseSvg.module.css.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const a={base:"cal",rotate0:"cam",rotateH0:"can",hovertrue:"_h",rotate90:"cao",rotateH90:"cap",rotate180:"caq",rotateH180:"car",rotate270:"cas",rotateH270:"cat",flipxAxis:"cau",flipHxAxis:"cav",flipyAxis:"caw",flipHyAxis:"cax",rotateF0:"cay",focustrue:"_f",rotateF90:"caz",rotateF180:"caA",rotateF270:"caB",flipFxAxis:"caC",flipFyAxis:"caD",rotateA0:"caE",rotateA90:"caF",rotateA180:"caG",rotateA270:"caH",flipAxAxis:"caI",flipAyAxis:"caJ"};exports.classes=a;
|
package/baseSvg.module.css.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const a = { base: "cal", rotate0: "cam", rotateH0: "can", hovertrue: "_h", rotate90: "cao", rotateH90: "cap", rotate180: "caq", rotateH180: "car", rotate270: "cas", rotateH270: "cat", flipxAxis: "cau", flipHxAxis: "cav", flipyAxis: "caw", flipHyAxis: "cax", rotateF0: "cay", focustrue: "_f", rotateF90: "caz", rotateF180: "caA", rotateF270: "caB", flipFxAxis: "caC", flipFyAxis: "caD", rotateA0: "caE", rotateA90: "caF", rotateA180: "caG", rotateA270: "caH", flipAxAxis: "caI", flipAyAxis: "caJ" };
|
|
2
|
-
export {
|
|
3
|
-
a as c
|
|
4
|
-
};
|