@cronocode/react-box 1.7.2 → 1.7.4
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.d.ts +5 -10
- package/box.js +9 -11
- package/components/baseSvg.d.ts +6 -6
- package/components/baseSvg.js +12 -11
- package/components/button.js +6 -5
- package/components/checkbox.js +12 -12
- package/components/dataGrid.js +18 -16
- package/components/flex.js +9 -8
- package/components/form.js +9 -8
- package/components/grid.js +9 -8
- package/components/radioButton.js +5 -4
- package/components/textarea.js +4 -3
- package/components/textbox.js +4 -3
- package/components/tooltip.js +41 -34
- package/{components/dox/doxStyles.d.ts → core/boxStyles.d.ts} +150 -176
- package/{components/dox/doxStylesFormatters.d.ts → core/boxStylesFormatters.d.ts} +1 -1
- package/core/boxTypes.d.ts +3 -0
- package/core/classNames.d.ts +2 -0
- package/{components/dox → core}/stylesContext.d.ts +3 -2
- package/core/theme.d.ts +38 -0
- package/core/types.d.ts +36 -0
- package/core/useStyles.d.ts +2 -0
- package/core/useTheme.d.ts +11 -0
- package/{components/dox.js → core.js} +524 -382
- package/package.json +10 -5
- package/ssg.d.ts +3 -0
- package/ssg.js +6 -0
- package/theme.d.ts +1 -45
- package/theme.js +3 -285
- package/utils.js +52 -89
- package/box.module.css.js +0 -4
- package/components/dox/useStyles.d.ts +0 -2
- package/plugins/box-theme.d.ts +0 -11
- package/style.css +0 -1
- package/types.d.ts +0 -245
- package/utils/className/classNameUtils.d.ts +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cronocode/react-box",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.4",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"main": "./box.js",
|
|
5
6
|
"module": "./box.js",
|
|
6
7
|
"types": "./box.d.ts",
|
|
@@ -10,14 +11,18 @@
|
|
|
10
11
|
"require": "./box.js",
|
|
11
12
|
"types": "./box.d.ts"
|
|
12
13
|
},
|
|
13
|
-
"./style.css": "./style.css",
|
|
14
14
|
"./theme": {
|
|
15
15
|
"import": "./theme.js",
|
|
16
16
|
"require": "./theme.js",
|
|
17
17
|
"types": "./theme.d.ts"
|
|
18
18
|
},
|
|
19
|
-
"./types": {
|
|
20
|
-
"types": "./types.d.ts"
|
|
19
|
+
"./core/types": {
|
|
20
|
+
"types": "./core/types.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./ssg": {
|
|
23
|
+
"import": "./ssg.js",
|
|
24
|
+
"require": "./ssg.js",
|
|
25
|
+
"types": "./ssg.d.ts"
|
|
21
26
|
},
|
|
22
27
|
"./components/*": {
|
|
23
28
|
"import": "./components/*.js",
|
|
@@ -30,7 +35,7 @@
|
|
|
30
35
|
"build:pages": "vite build ./pages --config ./pages.vite.config.ts --outDir ../dist --mode production",
|
|
31
36
|
"preview": "vite preview",
|
|
32
37
|
"build": "vite build",
|
|
33
|
-
"postbuild": "cp package.json dist & cp LICENSE dist & cp README.md dist
|
|
38
|
+
"postbuild": "cp package.json dist & cp LICENSE dist & cp README.md dist",
|
|
34
39
|
"build:dev": "vite build --mode dev",
|
|
35
40
|
"compile": "tsc --noEmit --skipLibCheck",
|
|
36
41
|
"test": "echo \"Error: no test specified\" && exit 1"
|
package/ssg.d.ts
ADDED
package/ssg.js
ADDED
package/theme.d.ts
CHANGED
|
@@ -1,46 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export interface ThemeStyles {
|
|
3
|
-
styles: BoxStyles;
|
|
4
|
-
disabled?: BoxStyles;
|
|
5
|
-
}
|
|
6
|
-
export interface ThemeComponentStyles {
|
|
7
|
-
styles: BoxStyles;
|
|
8
|
-
disabled?: BoxStyles;
|
|
9
|
-
themes?: {
|
|
10
|
-
[name: string]: ThemeStyles;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export interface ThemeSetup {
|
|
14
|
-
components?: {
|
|
15
|
-
[name: string]: ThemeComponentStyles;
|
|
16
|
-
};
|
|
17
|
-
button?: ThemeComponentStyles;
|
|
18
|
-
textbox?: ThemeComponentStyles;
|
|
19
|
-
textarea?: ThemeComponentStyles;
|
|
20
|
-
checkbox?: ThemeComponentStyles;
|
|
21
|
-
radioButton?: ThemeComponentStyles;
|
|
22
|
-
}
|
|
23
|
-
interface BoxAugmentedProps {
|
|
24
|
-
colors: Record<string, string>;
|
|
25
|
-
shadows: Record<string, string>;
|
|
26
|
-
backgrounds: Record<string, string>;
|
|
27
|
-
}
|
|
28
|
-
declare namespace Theme {
|
|
29
|
-
function setup(styles: ThemeSetup): void;
|
|
30
|
-
function setupAugmentedProps(props: BoxAugmentedProps, options?: {
|
|
31
|
-
namespacePath?: string;
|
|
32
|
-
}): {
|
|
33
|
-
variables: string;
|
|
34
|
-
themeCss: string;
|
|
35
|
-
boxDts: string;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
1
|
+
import Theme from './core/theme';
|
|
38
2
|
export default Theme;
|
|
39
|
-
type ReservedComponentName = Exclude<string, keyof Omit<ThemeSetup, 'components'>>;
|
|
40
|
-
export interface ThemeComponentProps {
|
|
41
|
-
clean?: boolean;
|
|
42
|
-
disabled?: boolean;
|
|
43
|
-
component?: ReservedComponentName;
|
|
44
|
-
theme?: string;
|
|
45
|
-
}
|
|
46
|
-
export declare function useTheme(props: ThemeComponentProps): BoxStyles | undefined;
|
package/theme.js
CHANGED
|
@@ -1,287 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
button: {
|
|
4
|
-
styles: {
|
|
5
|
-
display: "inline-block",
|
|
6
|
-
p: 3,
|
|
7
|
-
cursor: "pointer",
|
|
8
|
-
b: 1,
|
|
9
|
-
borderRadius: 1
|
|
10
|
-
},
|
|
11
|
-
disabled: {
|
|
12
|
-
cursor: "default"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
checkbox: {
|
|
16
|
-
styles: {
|
|
17
|
-
display: "inline-block",
|
|
18
|
-
b: 1,
|
|
19
|
-
p: 2
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
radioButton: {
|
|
23
|
-
styles: {
|
|
24
|
-
display: "inline-block",
|
|
25
|
-
b: 1,
|
|
26
|
-
p: 2
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
textbox: {
|
|
30
|
-
styles: {
|
|
31
|
-
display: "inline-block",
|
|
32
|
-
b: 1,
|
|
33
|
-
borderRadius: 1,
|
|
34
|
-
p: 3
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
textarea: {
|
|
38
|
-
styles: {
|
|
39
|
-
display: "inline-block",
|
|
40
|
-
b: 1,
|
|
41
|
-
borderRadius: 1
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
let _ = b;
|
|
46
|
-
var u;
|
|
47
|
-
((h) => {
|
|
48
|
-
function d(r) {
|
|
49
|
-
_ = r, i();
|
|
50
|
-
}
|
|
51
|
-
h.setup = d;
|
|
52
|
-
function $(r, e) {
|
|
53
|
-
const t = Object.entries(r.colors).map(([o, c]) => `--color${o}: ${c};`).join(`
|
|
54
|
-
`), l = Object.entries(r.shadows).map(([o, c]) => `--shadow${o}: ${c};`).join(`
|
|
55
|
-
`), n = Object.entries(r.backgrounds).map(([o, c]) => `--background${o}: ${c};`).join(`
|
|
56
|
-
`), s = [":root {"];
|
|
57
|
-
t && s.push(` ${t}`), l && s.push(` ${l}`), n && s.push(` ${n}`), s.push("}");
|
|
58
|
-
const a = Object.keys(r.colors).map((o) => `
|
|
59
|
-
.color_${o},
|
|
60
|
-
.color_h_${o}:hover,
|
|
61
|
-
._h:hover>.color_h_${o} {
|
|
62
|
-
color: var(--color${o});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.color_f_${o}:focus-within,
|
|
66
|
-
._f:focus-within>.color_f_${o} {
|
|
67
|
-
color: var(--color${o});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.color_a_${o}:active {
|
|
71
|
-
color: var(--color${o});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.bgColor_${o},
|
|
75
|
-
.bgColor_h_${o}:hover,
|
|
76
|
-
._h:hover>.bgColor_h_${o} {
|
|
77
|
-
background-color: var(--color${o});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.bgColor_f_${o}:focus-within,
|
|
81
|
-
._f:focus-within>.bgColor_f_${o} {
|
|
82
|
-
background-color: var(--color${o});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.bgColor_a_${o}:active {
|
|
86
|
-
background-color: var(--color${o});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.borderColor_${o},
|
|
90
|
-
.borderColor_h_${o}:hover,
|
|
91
|
-
._h:hover>.borderColor_h_${o} {
|
|
92
|
-
border-color: var(--color${o});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.borderColor_f_${o}:focus-within,
|
|
96
|
-
._f:focus-within>.borderColor_f_${o} {
|
|
97
|
-
border-color: var(--color${o});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.borderColor_a_${o}:active {
|
|
101
|
-
border-color: var(--color${o});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.outlineColor_${o},
|
|
105
|
-
.outlineColor_h_${o}:hover,
|
|
106
|
-
._h:hover>.outlineColor_h_${o} {
|
|
107
|
-
outline-color: var(--color${o});
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.outlineColor_f_${o}:focus-within,
|
|
111
|
-
._f:focus-within>.outlineColor_f_${o} {
|
|
112
|
-
outline-color: var(--color${o});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.outlineColor_a_${o}:active {
|
|
116
|
-
outline-color: var(--color${o});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.fill_${o},
|
|
120
|
-
.fill_h_${o}:hover,
|
|
121
|
-
._h:hover>.fill_h_${o} {
|
|
122
|
-
path,
|
|
123
|
-
circle,
|
|
124
|
-
rect,
|
|
125
|
-
line {
|
|
126
|
-
fill: var(--color${o});
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.fill_f_${o}:focus-within,
|
|
131
|
-
._f:focus-within>.fill_f_${o} {
|
|
132
|
-
path,
|
|
133
|
-
circle,
|
|
134
|
-
rect,
|
|
135
|
-
line {
|
|
136
|
-
fill: var(--color${o});
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.fill_a_${o}:active {
|
|
141
|
-
path,
|
|
142
|
-
circle,
|
|
143
|
-
rect,
|
|
144
|
-
line {
|
|
145
|
-
fill: var(--color${o});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.stroke_${o},
|
|
150
|
-
.stroke_h_${o}:hover,
|
|
151
|
-
._h:hover>.stroke_h_${o} {
|
|
152
|
-
path,
|
|
153
|
-
circle,
|
|
154
|
-
rect,
|
|
155
|
-
line {
|
|
156
|
-
stroke: var(--color${o});
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.stroke_f_${o}:focus-within,
|
|
161
|
-
._f:focus-within>.stroke_f_${o} {
|
|
162
|
-
path,
|
|
163
|
-
circle,
|
|
164
|
-
rect,
|
|
165
|
-
line {
|
|
166
|
-
stroke: var(--color${o});
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.stroke_a_${o}:active {
|
|
171
|
-
path,
|
|
172
|
-
circle,
|
|
173
|
-
rect,
|
|
174
|
-
line {
|
|
175
|
-
stroke: var(--color${o});
|
|
176
|
-
}
|
|
177
|
-
}`), y = Object.keys(r.shadows).map((o) => `
|
|
178
|
-
.shadow_${o},
|
|
179
|
-
.shadow_h_${o}:hover,
|
|
180
|
-
._h:hover>.shadow_h_${o} {
|
|
181
|
-
box-shadow: var(--shadow${o});
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.shadow_f_${o}:focus-within,
|
|
185
|
-
._f:focus-within>.shadow_f_${o} {
|
|
186
|
-
box-shadow: var(--shadow${o});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.shadow_a_${o}:active {
|
|
190
|
-
box-shadow: var(--shadow${o});
|
|
191
|
-
}`), f = Object.keys(r.backgrounds).map((o) => `
|
|
192
|
-
.bg_${o},
|
|
193
|
-
.bg_h_${o}:hover,
|
|
194
|
-
._h:hover>.bg_h_${o} {
|
|
195
|
-
background: var(--background${o});
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.bg_f_${o}:focus-within,
|
|
199
|
-
._f:focus-within>.bg_f_${o} {
|
|
200
|
-
background: var(--background${o});
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.bg_a_${o}:active {
|
|
204
|
-
background: var(--background${o});
|
|
205
|
-
}`), p = [...a, ...y, ...f].join(`
|
|
206
|
-
`) + `
|
|
207
|
-
`, C = Object.keys(r.colors).map((o) => `'${o}'`).join(" | "), v = Object.keys(r.backgrounds).map((o) => `'${o}'`).join(" | "), k = Object.keys(r.shadows).map((o) => `'${o}'`).join(" | "), T = `import '@cronocode/react-box';
|
|
208
|
-
|
|
209
|
-
declare module '${(e == null ? void 0 : e.namespacePath) ?? "@cronocode/react-box/types"}' {
|
|
210
|
-
type ColorType = ${C};
|
|
211
|
-
type BackgroundType = ${v};
|
|
212
|
-
type ShadowType = ${k};
|
|
213
|
-
|
|
214
|
-
namespace Augmented {
|
|
215
|
-
interface BoxProps {
|
|
216
|
-
color?: ColorType;
|
|
217
|
-
colorH?: ColorType;
|
|
218
|
-
colorF?: ColorType;
|
|
219
|
-
colorA?: ColorType;
|
|
220
|
-
bgColor?: ColorType;
|
|
221
|
-
bgColorH?: ColorType;
|
|
222
|
-
bgColorF?: ColorType;
|
|
223
|
-
bgColorA?: ColorType;
|
|
224
|
-
borderColor?: ColorType;
|
|
225
|
-
borderColorH?: ColorType;
|
|
226
|
-
borderColorF?: ColorType;
|
|
227
|
-
borderColorA?: ColorType;
|
|
228
|
-
outlineColor?: ColorType;
|
|
229
|
-
outlineColorH?: ColorType;
|
|
230
|
-
outlineColorF?: ColorType;
|
|
231
|
-
outlineColorA?: ColorType;
|
|
232
|
-
background?: BackgroundType;
|
|
233
|
-
backgroundH?: BackgroundType;
|
|
234
|
-
backgroundF?: BackgroundType;
|
|
235
|
-
backgroundA?: BackgroundType;
|
|
236
|
-
shadow?: ShadowType;
|
|
237
|
-
shadowH?: ShadowType;
|
|
238
|
-
shadowF?: ShadowType;
|
|
239
|
-
shadowA?: ShadowType;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
interface SvgProps {
|
|
243
|
-
fill?: ColorType;
|
|
244
|
-
fillH?: ColorType;
|
|
245
|
-
fillF?: ColorType;
|
|
246
|
-
fillA?: ColorType;
|
|
247
|
-
stroke?: ColorType;
|
|
248
|
-
strokeH?: ColorType;
|
|
249
|
-
strokeF?: ColorType;
|
|
250
|
-
strokeA?: ColorType;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
`;
|
|
255
|
-
return {
|
|
256
|
-
variables: s.join(`
|
|
257
|
-
`),
|
|
258
|
-
themeCss: p,
|
|
259
|
-
boxDts: T
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
h.setupAugmentedProps = $;
|
|
263
|
-
function i() {
|
|
264
|
-
Object.keys(b).forEach((e) => {
|
|
265
|
-
const t = _[e], l = b[e];
|
|
266
|
-
t ? (t.styles = { ...l.styles, ...t.styles }, t.disabled && l.disabled && (t.disabled = { ...l.disabled, ...t.disabled })) : _[e] = b[e];
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
})(u || (u = {}));
|
|
270
|
-
const j = u;
|
|
271
|
-
function x(h) {
|
|
272
|
-
const { clean: d, disabled: $, theme: i, component: r } = h;
|
|
273
|
-
return g(() => {
|
|
274
|
-
var l, n, s;
|
|
275
|
-
if (d)
|
|
276
|
-
return;
|
|
277
|
-
let e = _[r] ?? ((l = _.components) == null ? void 0 : l[r]);
|
|
278
|
-
if (!e)
|
|
279
|
-
return;
|
|
280
|
-
let t = i ? { ...e.styles, ...(n = e.themes) == null ? void 0 : n[i].styles } : e.styles;
|
|
281
|
-
return $ ? i ? { ...t, ...e.disabled, ...(s = e.themes) == null ? void 0 : s[i].disabled } : { ...t, ...e.disabled } : t;
|
|
282
|
-
}, [r, d, $, i]);
|
|
283
|
-
}
|
|
1
|
+
import { T as m } from "./core.js";
|
|
2
|
+
import "react";
|
|
284
3
|
export {
|
|
285
|
-
|
|
286
|
-
x as u
|
|
4
|
+
m as default
|
|
287
5
|
};
|
package/utils.js
CHANGED
|
@@ -1,107 +1,70 @@
|
|
|
1
|
-
import { useMemo as x } from "react";
|
|
2
|
-
var p;
|
|
3
|
-
((c) => {
|
|
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, []);
|
|
8
|
-
}
|
|
9
|
-
c.classNames = i;
|
|
10
|
-
})(p || (p = {}));
|
|
11
|
-
const y = p;
|
|
12
|
-
class I {
|
|
13
|
-
constructor() {
|
|
14
|
-
this._index = 0, this._cache = {};
|
|
15
|
-
}
|
|
16
|
-
getIdentity(i) {
|
|
17
|
-
return this._cache[i] || (this._cache[i] = this.getByIndex(this._index++)), this._cache[i];
|
|
18
|
-
}
|
|
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];
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const m = {
|
|
28
|
-
first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
29
|
-
next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
|
30
|
-
};
|
|
31
1
|
var l;
|
|
32
|
-
((
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
}), [
|
|
2
|
+
((f) => {
|
|
3
|
+
function a(c, ...s) {
|
|
4
|
+
const e = { ...c }, t = {};
|
|
5
|
+
return s.forEach((r) => {
|
|
6
|
+
r in e && (t[r] = e[r], delete e[r]);
|
|
7
|
+
}), [t, e];
|
|
38
8
|
}
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
return
|
|
43
|
-
if (
|
|
44
|
-
if (
|
|
9
|
+
f.moveToTagProps = a;
|
|
10
|
+
function p(c, s, e) {
|
|
11
|
+
const t = { ...c }, r = t.props || {};
|
|
12
|
+
return s.forEach((o) => {
|
|
13
|
+
if (o in t) {
|
|
14
|
+
if (r[o] = t[o], o === "disabled")
|
|
45
15
|
return;
|
|
46
|
-
delete
|
|
16
|
+
delete t[o];
|
|
47
17
|
}
|
|
48
|
-
}),
|
|
49
|
-
|
|
50
|
-
}),
|
|
18
|
+
}), e && Object.entries(e).forEach(([o, i]) => {
|
|
19
|
+
r[o] = i;
|
|
20
|
+
}), t.props = r, t;
|
|
51
21
|
}
|
|
52
|
-
|
|
22
|
+
f.buildProps = p;
|
|
53
23
|
})(l || (l = {}));
|
|
54
|
-
const
|
|
55
|
-
var
|
|
56
|
-
((
|
|
57
|
-
function
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
24
|
+
const m = l;
|
|
25
|
+
var h;
|
|
26
|
+
((f) => {
|
|
27
|
+
function a(c) {
|
|
28
|
+
const s = Array.from(c.elements).reduce(
|
|
29
|
+
(e, t) => {
|
|
30
|
+
const r = t.name;
|
|
31
|
+
return r && (e[r] || (e[r] = []), e[r].push(t)), e;
|
|
32
|
+
},
|
|
33
|
+
{}
|
|
34
|
+
);
|
|
35
|
+
return Object.entries(s).reduce((e, [t, r]) => {
|
|
36
|
+
if (r.length === 1) {
|
|
37
|
+
const o = r[0];
|
|
38
|
+
p(e, t, o.type === "checkbox" || o.type === "radio" ? o.checked : o.value);
|
|
66
39
|
} else {
|
|
67
|
-
const
|
|
68
|
-
|
|
40
|
+
const o = r.reduce((i, n) => (n.type === "checkbox" || n.type === "radio" ? n.checked && i.push(n.value) : i.push(n.value), i), []);
|
|
41
|
+
p(e, t, o);
|
|
69
42
|
}
|
|
70
|
-
return
|
|
43
|
+
return e;
|
|
71
44
|
}, {});
|
|
72
45
|
}
|
|
73
|
-
|
|
74
|
-
function
|
|
75
|
-
if (
|
|
76
|
-
const
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
if (
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
const [,
|
|
83
|
-
|
|
46
|
+
f.getFormEntries = a;
|
|
47
|
+
function p(c, s, e) {
|
|
48
|
+
if (s.includes(".")) {
|
|
49
|
+
const t = s.split(".");
|
|
50
|
+
let r = c;
|
|
51
|
+
t.forEach((o, i) => {
|
|
52
|
+
if (t.length > i + 1) {
|
|
53
|
+
const n = o.match(/^(.+)\[(\d)\]$/);
|
|
54
|
+
if (n) {
|
|
55
|
+
const [, u, d] = n;
|
|
56
|
+
r[u] = r[u] || [], r[u][d] = r[u][d] || {}, r = r[u][d];
|
|
84
57
|
} else
|
|
85
|
-
|
|
58
|
+
r[o] = r[o] || {}, r = r[o];
|
|
86
59
|
} else
|
|
87
|
-
|
|
60
|
+
r[o] = e;
|
|
88
61
|
});
|
|
89
62
|
} else
|
|
90
|
-
|
|
63
|
+
c[s] = e;
|
|
91
64
|
}
|
|
92
|
-
})(
|
|
93
|
-
const P =
|
|
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
|
-
}
|
|
65
|
+
})(h || (h = {}));
|
|
66
|
+
const P = h;
|
|
101
67
|
export {
|
|
102
|
-
y as C,
|
|
103
68
|
P as F,
|
|
104
|
-
|
|
105
|
-
E as O,
|
|
106
|
-
v as u
|
|
69
|
+
m as O
|
|
107
70
|
};
|