@cronocode/react-box 1.5.6 → 1.5.9

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.
Files changed (40) hide show
  1. package/baseSvg.module.css.cjs +1 -1
  2. package/baseSvg.module.css.mjs +2 -2
  3. package/box.cjs +1 -1
  4. package/box.mjs +10 -10
  5. package/box.module.css.cjs +1 -1
  6. package/box.module.css.mjs +2 -2
  7. package/components/dataGrid.d.ts +2 -0
  8. package/components/dox.cjs +1 -0
  9. package/components/dox.d.ts +2 -0
  10. package/components/dox.mjs +877 -0
  11. package/components/grid.cjs +1 -0
  12. package/components/grid.d.ts +4 -0
  13. package/components/grid.mjs +14 -0
  14. package/package.json +5 -3
  15. package/plugins.cjs +6 -5
  16. package/plugins.mjs +6 -5
  17. package/style.css +1 -1
  18. package/theme.cjs +1 -1
  19. package/{src/theme.d.ts → theme.d.ts} +1 -1
  20. package/theme.mjs +2 -2
  21. package/{src/types.d.ts → types.d.ts} +48 -37
  22. package/utils/utils.cjs +1 -1
  23. package/utils/utils.mjs +90 -70
  24. package/src/components/dataGrid.d.ts +0 -13
  25. package/src/index.d.ts +0 -0
  26. /package/{src/box.d.ts → box.d.ts} +0 -0
  27. /package/{src/components → components}/baseSvg.d.ts +0 -0
  28. /package/{src/components → components}/button.d.ts +0 -0
  29. /package/{src/components → components}/checkbox.d.ts +0 -0
  30. /package/{src/components → components}/flex.d.ts +0 -0
  31. /package/{src/components → components}/form.d.ts +0 -0
  32. /package/{src/components → components}/radioButton.d.ts +0 -0
  33. /package/{src/components → components}/textarea.d.ts +0 -0
  34. /package/{src/components → components}/textbox.d.ts +0 -0
  35. /package/{src/components → components}/tooltip.d.ts +0 -0
  36. /package/{src/hooks → hooks}/usePortalContainer.d.ts +0 -0
  37. /package/{src/plugins.d.ts → plugins.d.ts} +0 -0
  38. /package/{src/utils → utils}/className/classNameUtils.d.ts +0 -0
  39. /package/{src/utils → utils}/form/formUtils.d.ts +0 -0
  40. /package/{src/utils → utils}/object/objectUtils.d.ts +0 -0
package/theme.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),o={button:{styles:{inline:!0,p:3,cursor:"pointer",b:1,borderRadius:1},disabled:{cursor:"default"}},checkbox:{styles:{inline:!0,b:1,p:2}},radioButton:{styles:{inline:!0,b:1,p:2}},textbox:{styles:{inline:!0,b:1,borderRadius:1,p:3}},textarea:{styles:{inline:!0,b:1,borderRadius:1}}};let n=o;var d;(u=>{function i(t){n=t,r()}u.setup=i;function r(){Object.keys(o).forEach(s=>{const e=n[s],l=o[s];e?(e.styles={...l.styles,...e.styles},e.disabled&&l.disabled&&(e.disabled={...l.disabled,...e.disabled})):n[s]=o[s]})}})(d||(d={}));const f=d;function m(u){const{clean:i,disabled:r,theme:t,component:s}=u;return y.useMemo(()=>{var a,b,c;if(i)return{};let e=n[s]??((a=n.components)==null?void 0:a[s]);if(!e)return{};let l=t?{...e.styles,...(b=e.themes)==null?void 0:b[t].styles}:e.styles;return r?t?{...l,...e.disabled,...(c=e.themes)==null?void 0:c[t].disabled}:{...l,...e.disabled}:l},[s,i,r,t])}exports.default=f;exports.useTheme=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),r={button:{styles:{inline:!0,p:3,cursor:"pointer",b:1,borderRadius:1},disabled:{cursor:"default"}},checkbox:{styles:{inline:!0,b:1,p:2}},radioButton:{styles:{inline:!0,b:1,p:2}},textbox:{styles:{inline:!0,b:1,borderRadius:1,p:3}},textarea:{styles:{inline:!0,b:1,borderRadius:1}}};let n=r;var u;(d=>{function i(t){n=t,o()}d.setup=i;function o(){Object.keys(r).forEach(s=>{const e=n[s],l=r[s];e?(e.styles={...l.styles,...e.styles},e.disabled&&l.disabled&&(e.disabled={...l.disabled,...e.disabled})):n[s]=r[s]})}})(u||(u={}));const f=u;function m(d){const{clean:i,disabled:o,theme:t,component:s}=d;return y.useMemo(()=>{var a,b,c;if(i)return;let e=n[s]??((a=n.components)==null?void 0:a[s]);if(!e)return;let l=t?{...e.styles,...(b=e.themes)==null?void 0:b[t].styles}:e.styles;return o?t?{...l,...e.disabled,...(c=e.themes)==null?void 0:c[t].disabled}:{...l,...e.disabled}:l},[s,i,o,t])}exports.default=f;exports.useTheme=m;
@@ -31,4 +31,4 @@ export interface ThemeComponentProps {
31
31
  component?: ReservedComponentName;
32
32
  theme?: string;
33
33
  }
34
- export declare function useTheme(props: ThemeComponentProps): BoxStyles;
34
+ export declare function useTheme(props: ThemeComponentProps): BoxStyles | undefined;
package/theme.mjs CHANGED
@@ -62,10 +62,10 @@ function p(d) {
62
62
  return y(() => {
63
63
  var a, b, c;
64
64
  if (i)
65
- return {};
65
+ return;
66
66
  let e = n[s] ?? ((a = n.components) == null ? void 0 : a[s]);
67
67
  if (!e)
68
- return {};
68
+ return;
69
69
  let l = t ? { ...e.styles, ...(b = e.themes) == null ? void 0 : b[t].styles } : e.styles;
70
70
  return o ? t ? { ...l, ...e.disabled, ...(c = e.themes) == null ? void 0 : c[t].disabled } : { ...l, ...e.disabled } : l;
71
71
  }, [s, i, o, t]);
@@ -1,10 +1,10 @@
1
- export type Hovered<T> = {
1
+ type Hovered<T> = {
2
2
  [K in keyof T as K extends string ? `${K}H` : never]: T[K];
3
3
  };
4
- export type Focused<T> = {
4
+ type Focused<T> = {
5
5
  [K in keyof T as K extends string ? `${K}F` : never]: T[K];
6
6
  };
7
- export type Activated<T> = {
7
+ type Activated<T> = {
8
8
  [K in keyof T as K extends string ? `${K}A` : never]: T[K];
9
9
  };
10
10
  export declare const styleVariables: {
@@ -12,14 +12,17 @@ export declare const styleVariables: {
12
12
  boxSizing: readonly ["border-box", "content-box"];
13
13
  position: readonly ["static", "relative", "absolute", "fixed", "sticky"];
14
14
  sizeSpecialValues: readonly ["fit", "fit-screen", "auto", "fit-content", "max-content", "min-content"];
15
+ widthHeightSizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 88, 96, 100];
16
+ widthHeightStringSizes: readonly ["1/2", "1/3", "2/3", "1/4", "2/4", "3/4", "1/5", "2/5", "3/5", "4/5", "1/6", "2/6", "3/6", "4/6", "5/6", "1/12", "2/12", "3/12", "4/12", "5/12", "6/12", "7/12", "8/12", "9/12", "10/12", "11/12"];
15
17
  borderAndOutlineStyles: readonly ["solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset", "none", "hidden"];
16
18
  overflows: readonly ["auto", "hidden", "scroll", "visible"];
17
19
  textDecoration: readonly ["none", "underline"];
18
20
  textTransform: readonly ["none", "capitalize", "lowercase", "uppercase"];
19
21
  textAlign: readonly ["left", "right", "center", "justify"];
20
- opacity: readonly [10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
22
+ opacity: readonly [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
21
23
  cursors: readonly ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "e-resize", "n-resize", "ne-resize", "nw-resize", "s-resize", "se-resize", "sw-resize", "w-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "col-resize", "row-resize", "all-scroll", "zoom-in", "zoom-out", "grab", "grabbing"];
22
- sizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15];
24
+ positiveSizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 64, 68, 72, 76, 80, 88, 96, 100];
25
+ negativeSizes: readonly [-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -20, -24, -28, -32, -36, -40, -44, -48, -52, -56, -60, -68, -76, -84, -92, -100];
23
26
  sizeMultiplier: number;
24
27
  borderSizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
25
28
  fontSizes: readonly [6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 64, 70, 78, 86, 96];
@@ -44,11 +47,13 @@ export declare const styleVariables: {
44
47
  pointerEvents: readonly ["none", "auto", "all"];
45
48
  whiteSpace: readonly ["break-spaces", "normal", "nowrap", "pre", "pre-line", "pre-wrap"];
46
49
  textOverflow: readonly ["clip", "ellipsis"];
50
+ gridColumns: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
47
51
  };
52
+ export declare const sizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 64, 68, 72, 76, 80, 88, 96, 100, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -20, -24, -28, -32, -36, -40, -44, -48, -52, -56, -60, -68, -76, -84, -92, -100];
48
53
  type GapType = (typeof styleVariables.gap)[number];
49
- type BoxSizeValue = (typeof styleVariables.sizeSpecialValues)[number];
54
+ type WidthHeightSizeType = (typeof styleVariables.sizeSpecialValues)[number] | (typeof styleVariables.widthHeightSizes)[number] | (typeof styleVariables.widthHeightStringSizes)[number];
50
55
  type BorderSizeType = (typeof styleVariables.borderSizes)[number];
51
- type SizeType = (typeof styleVariables.sizes)[number];
56
+ type SizeType = (typeof sizes)[number];
52
57
  type CursorType = (typeof styleVariables.cursors)[number];
53
58
  type OverflowType = (typeof styleVariables.overflows)[number];
54
59
  type FontSizeType = (typeof styleVariables.fontSizes)[number];
@@ -79,27 +84,27 @@ interface BoxSizing {
79
84
  }
80
85
  export interface BoxPosition {
81
86
  position?: (typeof styleVariables.position)[number];
82
- inset?: SizeType;
87
+ inset?: (typeof styleVariables.positiveSizes)[number];
83
88
  top?: SizeType;
84
89
  right?: SizeType;
85
90
  bottom?: SizeType;
86
91
  left?: SizeType;
87
92
  }
88
93
  export interface BoxSize {
89
- width?: BoxSizeValue;
90
- height?: BoxSizeValue;
91
- minWidth?: BoxSizeValue;
92
- minHeight?: BoxSizeValue;
93
- maxWidth?: BoxSizeValue;
94
- maxHeight?: BoxSizeValue;
94
+ width?: WidthHeightSizeType;
95
+ height?: WidthHeightSizeType;
96
+ minWidth?: WidthHeightSizeType;
97
+ minHeight?: WidthHeightSizeType;
98
+ maxWidth?: WidthHeightSizeType;
99
+ maxHeight?: WidthHeightSizeType;
95
100
  }
96
101
  interface BoxMargin {
97
- margin?: SizeType | 'auto';
98
- m?: SizeType | 'auto';
99
- marginHorizontal?: SizeType | 'auto';
100
- mx?: SizeType | 'auto';
101
- marginVertical?: SizeType | 'auto';
102
- my?: SizeType | 'auto';
102
+ margin?: (typeof styleVariables.positiveSizes)[number] | 'auto';
103
+ m?: (typeof styleVariables.positiveSizes)[number] | 'auto';
104
+ marginHorizontal?: (typeof styleVariables.positiveSizes)[number] | 'auto';
105
+ mx?: (typeof styleVariables.positiveSizes)[number] | 'auto';
106
+ marginVertical?: (typeof styleVariables.positiveSizes)[number] | 'auto';
107
+ my?: (typeof styleVariables.positiveSizes)[number] | 'auto';
103
108
  marginTop?: SizeType | 'auto';
104
109
  mt?: SizeType | 'auto';
105
110
  marginRight?: SizeType | 'auto';
@@ -110,12 +115,12 @@ interface BoxMargin {
110
115
  ml?: SizeType | 'auto';
111
116
  }
112
117
  interface BoxPadding {
113
- padding?: SizeType;
114
- p?: SizeType;
115
- paddingHorizontal?: SizeType;
116
- px?: SizeType;
117
- paddingVertical?: SizeType;
118
- py?: SizeType;
118
+ padding?: (typeof styleVariables.positiveSizes)[number];
119
+ p?: (typeof styleVariables.positiveSizes)[number];
120
+ paddingHorizontal?: (typeof styleVariables.positiveSizes)[number];
121
+ px?: (typeof styleVariables.positiveSizes)[number];
122
+ paddingVertical?: (typeof styleVariables.positiveSizes)[number];
123
+ py?: (typeof styleVariables.positiveSizes)[number];
119
124
  paddingTop?: SizeType;
120
125
  pt?: SizeType;
121
126
  paddingRight?: SizeType;
@@ -146,15 +151,15 @@ interface BoxBorder {
146
151
  borderLeft?: BorderSizeType;
147
152
  bl?: BorderSizeType;
148
153
  borderStyle?: BorderAndOutlineStyleType;
149
- borderRadius?: SizeType;
150
- borderRadiusTop?: SizeType;
151
- borderRadiusRight?: SizeType;
152
- borderRadiusBottom?: SizeType;
153
- borderRadiusLeft?: SizeType;
154
- borderRadiusTopLeft?: SizeType;
155
- borderRadiusTopRight?: SizeType;
156
- borderRadiusBottomLeft?: SizeType;
157
- borderRadiusBottomRight?: SizeType;
154
+ borderRadius?: (typeof styleVariables.positiveSizes)[number];
155
+ borderRadiusTop?: (typeof styleVariables.positiveSizes)[number];
156
+ borderRadiusRight?: (typeof styleVariables.positiveSizes)[number];
157
+ borderRadiusBottom?: (typeof styleVariables.positiveSizes)[number];
158
+ borderRadiusLeft?: (typeof styleVariables.positiveSizes)[number];
159
+ borderRadiusTopLeft?: (typeof styleVariables.positiveSizes)[number];
160
+ borderRadiusTopRight?: (typeof styleVariables.positiveSizes)[number];
161
+ borderRadiusBottomLeft?: (typeof styleVariables.positiveSizes)[number];
162
+ borderRadiusBottomRight?: (typeof styleVariables.positiveSizes)[number];
158
163
  }
159
164
  interface BoxCursor {
160
165
  cursor?: CursorType;
@@ -172,7 +177,7 @@ interface BoxOpacity {
172
177
  }
173
178
  interface BoxFont {
174
179
  fontSize?: FontSizeType;
175
- lineHeight?: FontSizeType;
180
+ lineHeight?: FontSizeType | 'font-size';
176
181
  fontWeight?: FontWeightType;
177
182
  letterSpacing?: SizeType;
178
183
  fontStyle?: FontStyleType;
@@ -204,6 +209,12 @@ interface BoxFlex {
204
209
  alignSelf?: (typeof styleVariables.flexSelf)[number];
205
210
  justifySelf?: (typeof styleVariables.flexSelf)[number];
206
211
  }
212
+ interface BoxGrid {
213
+ gridColumns?: (typeof styleVariables.gridColumns)[number];
214
+ colSpan?: (typeof styleVariables.gridColumns)[number] | 'full-row';
215
+ colStart?: (typeof styleVariables.gridColumns)[number];
216
+ colEnd?: (typeof styleVariables.gridColumns)[number];
217
+ }
207
218
  interface BoxTransition {
208
219
  transition?: TransitionType;
209
220
  }
@@ -216,7 +227,7 @@ interface BoxAppearance {
216
227
  interface BoxPointerEvents {
217
228
  pointerEvents?: PointerEventsType;
218
229
  }
219
- type BoxNormalStyles = BoxPseudoClasses & BoxDisplay & BoxSizing & BoxPosition & BoxSize & BoxMargin & BoxPadding & BoxBorder & BoxCursor & BoxZIndex & BoxOverflow & BoxOpacity & BoxFont & BoxText & BoxFlex & BoxOutline & BoxTransition & BoxUserSelect & BoxAppearance & BoxPointerEvents;
230
+ type BoxNormalStyles = BoxPseudoClasses & BoxDisplay & BoxSizing & BoxPosition & BoxSize & BoxMargin & BoxPadding & BoxBorder & BoxCursor & BoxZIndex & BoxOverflow & BoxOpacity & BoxFont & BoxText & BoxFlex & BoxOutline & BoxTransition & BoxUserSelect & BoxAppearance & BoxPointerEvents & BoxGrid;
220
231
  export declare namespace Augmented {
221
232
  interface BoxProps {
222
233
  }
package/utils/utils.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const h=require("react"),C={hover:"_h",focus:"_f",shadow:"shadow_",shadowH:"shadow_h_",shadowF:"shadow_f_",shadowA:"shadow_a_",background:"bg_",backgroundH:"bg_h_",backgroundF:"bg_f_",backgroundA:"bg_a_",bg:"bg_",bgH:"bg_h_",bgF:"bg_f_",bgA:"bg_a_",color:"color_",colorH:"color_h_",colorF:"color_f_",colorA:"color_a_",backgroundColor:"bgColor_",backgroundColorH:"bgColor_h_",backgroundColorF:"bgColor_f_",backgroundColorA:"bgColor_a_",bgColor:"bgColor_",bgColorH:"bgColor_h_",bgColorF:"bgColor_f_",bgColorA:"bgColor_a_",borderColor:"borderColor_",borderColorH:"borderColor_h_",borderColorF:"borderColor_f_",borderColorA:"borderColor_a_",outlineColor:"outlineColor_",outlineColorH:"outlineColor_h_",outlineColorF:"outlineColor_f_",outlineColorA:"outlineColor_a_"},p={fill:"fill_",fillH:"fill_h_",fillF:"fill_f_",fillA:"fill_a_",stroke:"stroke_",strokeH:"stroke_h_",strokeF:"stroke_f_",strokeA:"stroke_a_"};var b;(i=>{function n(...u){return u.reduce((l,s)=>s?typeof s=="string"?(l.push(s),l):Array.isArray(s)?(l.push(...n(...s)),l):(Object.entries(s).forEach(([r,e])=>{e&&l.push(r)}),l):l,[])}i.classNames=n})(b||(b={}));const F=b;var f;(i=>{function n(l,...s){const r={...l},e={};return s.forEach(o=>{o in r&&(e[o]=r[o],delete r[o])}),[e,r]}i.moveToTagProps=n;function u(l,s,r){const e={...l},o=e.props||{};return s.forEach(t=>{if(t in e){if(o[t]=e[t],t==="disabled")return;delete e[t]}}),r&&Object.entries(r).forEach(([t,c])=>{o[t]=c}),e.props=o,e}i.buildProps=u})(f||(f={}));const m=f;var g;(i=>{function n(l){const s=Array.from(l.elements).reduce((r,e)=>{const o=e.name;return o&&(r[o]||(r[o]=[]),r[o].push(e)),r},{});return Object.entries(s).reduce((r,[e,o])=>{if(o.length===1){const t=o[0];u(r,e,t.type==="checkbox"||t.type==="radio"?t.checked:t.value)}else{const t=o.reduce((c,_)=>(_.type==="checkbox"||_.type==="radio"?_.checked&&c.push(_.value):c.push(_.value),c),[]);u(r,e,t)}return r},{})}i.getFormEntries=n;function u(l,s,r){if(s.includes(".")){const e=s.split(".");let o=l;e.forEach((t,c)=>{if(e.length>c+1){const _=t.match(/^(.+)\[(\d)\]$/);if(_){const[,a,d]=_;o[a]=o[a]||[],o[a][d]=o[a][d]||{},o=o[a][d]}else o[t]=o[t]||{},o=o[t]}else o[t]=r})}else l[s]=r}})(g||(g={}));const k=g;function A(){return h.useMemo(()=>{const i="crono-box";let n=document.getElementById(i);return n||(n=document.createElement("div"),n.id=i,document.body.appendChild(n)),n},[])}exports.ClassNameUtils=F;exports.FormUtils=k;exports.ObjectUtils=m;exports.themeClasses=C;exports.themeSvgClasses=p;exports.usePortalContainer=A;
1
+ "use strict";const g=require("react"),C={hover:"_h",focus:"_f",shadow:"shadow_",shadowH:"shadow_h_",shadowF:"shadow_f_",shadowA:"shadow_a_",background:"bg_",backgroundH:"bg_h_",backgroundF:"bg_f_",backgroundA:"bg_a_",bg:"bg_",bgH:"bg_h_",bgF:"bg_f_",bgA:"bg_a_",color:"color_",colorH:"color_h_",colorF:"color_f_",colorA:"color_a_",backgroundColor:"bgColor_",backgroundColorH:"bgColor_h_",backgroundColorF:"bgColor_f_",backgroundColorA:"bgColor_a_",bgColor:"bgColor_",bgColorH:"bgColor_h_",bgColorF:"bgColor_f_",bgColorA:"bgColor_a_",borderColor:"borderColor_",borderColorH:"borderColor_h_",borderColorF:"borderColor_f_",borderColorA:"borderColor_a_",outlineColor:"outlineColor_",outlineColorH:"outlineColor_h_",outlineColorF:"outlineColor_f_",outlineColorA:"outlineColor_a_"},p={fill:"fill_",fillH:"fill_h_",fillF:"fill_f_",fillA:"fill_a_",stroke:"stroke_",strokeH:"stroke_h_",strokeF:"stroke_f_",strokeA:"stroke_a_"};var h;(c=>{function l(...i){return i.reduce((e,s)=>s?typeof s=="string"?(e.push(s),e):Array.isArray(s)?(e.push(...l(...s)),e):(Object.entries(s).forEach(([r,t])=>{t&&e.push(r)}),e):e,[])}c.classNames=l})(h||(h={}));const F=h;class m{constructor(){this._index=0,this._cache={}}getIdentity(l){return this._cache[l]||(this._cache[l]=this.getByIndex(this._index++)),this._cache[l]}getByIndex(l){const{first:i,next:e}=y,s=l-i.length;if(s<0)return i[l];const r=Math.floor(s/e.length),t=s-r*e.length;return this.getByIndex(r)+e[t]}}const y={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};var f;(c=>{function l(e,...s){const r={...e},t={};return s.forEach(o=>{o in r&&(t[o]=r[o],delete r[o])}),[t,r]}c.moveToTagProps=l;function i(e,s,r){const t={...e},o=t.props||{};return s.forEach(n=>{if(n in t){if(o[n]=t[n],n==="disabled")return;delete t[n]}}),r&&Object.entries(r).forEach(([n,u])=>{o[n]=u}),t.props=o,t}c.buildProps=i})(f||(f={}));const A=f;var b;(c=>{function l(e){const s=Array.from(e.elements).reduce((r,t)=>{const o=t.name;return o&&(r[o]||(r[o]=[]),r[o].push(t)),r},{});return Object.entries(s).reduce((r,[t,o])=>{if(o.length===1){const n=o[0];i(r,t,n.type==="checkbox"||n.type==="radio"?n.checked:n.value)}else{const n=o.reduce((u,_)=>(_.type==="checkbox"||_.type==="radio"?_.checked&&u.push(_.value):u.push(_.value),u),[]);i(r,t,n)}return r},{})}c.getFormEntries=l;function i(e,s,r){if(s.includes(".")){const t=s.split(".");let o=e;t.forEach((n,u)=>{if(t.length>u+1){const _=n.match(/^(.+)\[(\d)\]$/);if(_){const[,a,d]=_;o[a]=o[a]||[],o[a][d]=o[a][d]||{},o=o[a][d]}else o[n]=o[n]||{},o=o[n]}else o[n]=r})}else e[s]=r}})(b||(b={}));const k=b;function x(){return g.useMemo(()=>{const c="crono-box";let l=document.getElementById(c);return l||(l=document.createElement("div"),l.id=c,document.body.appendChild(l)),l},[])}exports.ClassNameUtils=F;exports.FormUtils=k;exports.IdentityFactory=m;exports.ObjectUtils=A;exports.themeClasses=C;exports.themeSvgClasses=p;exports.usePortalContainer=x;
package/utils/utils.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { useMemo as h } from "react";
2
- const p = {
1
+ import { useMemo as g } from "react";
2
+ const F = {
3
3
  hover: "_h",
4
4
  focus: "_f",
5
5
  shadow: "shadow_",
@@ -34,7 +34,7 @@ const p = {
34
34
  outlineColorH: "outlineColor_h_",
35
35
  outlineColorF: "outlineColor_f_",
36
36
  outlineColorA: "outlineColor_a_"
37
- }, F = {
37
+ }, m = {
38
38
  fill: "fill_",
39
39
  fillH: "fill_h_",
40
40
  fillF: "fill_f_",
@@ -44,91 +44,111 @@ const p = {
44
44
  strokeF: "stroke_f_",
45
45
  strokeA: "stroke_a_"
46
46
  };
47
- var f;
48
- ((_) => {
49
- function n(...u) {
50
- return u.reduce((l, s) => s ? typeof s == "string" ? (l.push(s), l) : Array.isArray(s) ? (l.push(...n(...s)), l) : (Object.entries(s).forEach(([r, e]) => {
51
- e && l.push(r);
52
- }), l) : l, []);
47
+ var h;
48
+ ((c) => {
49
+ function l(...i) {
50
+ return i.reduce((e, n) => n ? typeof n == "string" ? (e.push(n), e) : Array.isArray(n) ? (e.push(...l(...n)), e) : (Object.entries(n).forEach(([r, t]) => {
51
+ t && e.push(r);
52
+ }), e) : e, []);
53
53
  }
54
- _.classNames = n;
55
- })(f || (f = {}));
56
- const k = f;
57
- var b;
58
- ((_) => {
59
- function n(l, ...s) {
60
- const r = { ...l }, e = {};
61
- return s.forEach((o) => {
62
- o in r && (e[o] = r[o], delete r[o]);
63
- }), [e, r];
54
+ c.classNames = l;
55
+ })(h || (h = {}));
56
+ const x = h;
57
+ class A {
58
+ constructor() {
59
+ this._index = 0, this._cache = {};
64
60
  }
65
- _.moveToTagProps = n;
66
- function u(l, s, r) {
67
- const e = { ...l }, o = e.props || {};
68
- return s.forEach((t) => {
69
- if (t in e) {
70
- if (o[t] = e[t], t === "disabled")
61
+ getIdentity(l) {
62
+ return this._cache[l] || (this._cache[l] = this.getByIndex(this._index++)), this._cache[l];
63
+ }
64
+ getByIndex(l) {
65
+ const { first: i, next: e } = C, n = l - i.length;
66
+ if (n < 0)
67
+ return i[l];
68
+ const r = Math.floor(n / e.length), t = n - r * e.length;
69
+ return this.getByIndex(r) + e[t];
70
+ }
71
+ }
72
+ const C = {
73
+ first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
74
+ next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
75
+ };
76
+ var f;
77
+ ((c) => {
78
+ function l(e, ...n) {
79
+ const r = { ...e }, t = {};
80
+ return n.forEach((o) => {
81
+ o in r && (t[o] = r[o], delete r[o]);
82
+ }), [t, r];
83
+ }
84
+ c.moveToTagProps = l;
85
+ function i(e, n, r) {
86
+ const t = { ...e }, o = t.props || {};
87
+ return n.forEach((s) => {
88
+ if (s in t) {
89
+ if (o[s] = t[s], s === "disabled")
71
90
  return;
72
- delete e[t];
91
+ delete t[s];
73
92
  }
74
- }), r && Object.entries(r).forEach(([t, c]) => {
75
- o[t] = c;
76
- }), e.props = o, e;
93
+ }), r && Object.entries(r).forEach(([s, a]) => {
94
+ o[s] = a;
95
+ }), t.props = o, t;
77
96
  }
78
- _.buildProps = u;
79
- })(b || (b = {}));
80
- const A = b;
81
- var g;
82
- ((_) => {
83
- function n(l) {
84
- const s = Array.from(l.elements).reduce((r, e) => {
85
- const o = e.name;
86
- return o && (r[o] || (r[o] = []), r[o].push(e)), r;
97
+ c.buildProps = i;
98
+ })(f || (f = {}));
99
+ const k = f;
100
+ var b;
101
+ ((c) => {
102
+ function l(e) {
103
+ const n = Array.from(e.elements).reduce((r, t) => {
104
+ const o = t.name;
105
+ return o && (r[o] || (r[o] = []), r[o].push(t)), r;
87
106
  }, {});
88
- return Object.entries(s).reduce((r, [e, o]) => {
107
+ return Object.entries(n).reduce((r, [t, o]) => {
89
108
  if (o.length === 1) {
90
- const t = o[0];
91
- u(r, e, t.type === "checkbox" || t.type === "radio" ? t.checked : t.value);
109
+ const s = o[0];
110
+ i(r, t, s.type === "checkbox" || s.type === "radio" ? s.checked : s.value);
92
111
  } else {
93
- const t = o.reduce((c, i) => (i.type === "checkbox" || i.type === "radio" ? i.checked && c.push(i.value) : c.push(i.value), c), []);
94
- u(r, e, t);
112
+ const s = o.reduce((a, _) => (_.type === "checkbox" || _.type === "radio" ? _.checked && a.push(_.value) : a.push(_.value), a), []);
113
+ i(r, t, s);
95
114
  }
96
115
  return r;
97
116
  }, {});
98
117
  }
99
- _.getFormEntries = n;
100
- function u(l, s, r) {
101
- if (s.includes(".")) {
102
- const e = s.split(".");
103
- let o = l;
104
- e.forEach((t, c) => {
105
- if (e.length > c + 1) {
106
- const i = t.match(/^(.+)\[(\d)\]$/);
107
- if (i) {
108
- const [, a, d] = i;
109
- o[a] = o[a] || [], o[a][d] = o[a][d] || {}, o = o[a][d];
118
+ c.getFormEntries = l;
119
+ function i(e, n, r) {
120
+ if (n.includes(".")) {
121
+ const t = n.split(".");
122
+ let o = e;
123
+ t.forEach((s, a) => {
124
+ if (t.length > a + 1) {
125
+ const _ = s.match(/^(.+)\[(\d)\]$/);
126
+ if (_) {
127
+ const [, u, d] = _;
128
+ o[u] = o[u] || [], o[u][d] = o[u][d] || {}, o = o[u][d];
110
129
  } else
111
- o[t] = o[t] || {}, o = o[t];
130
+ o[s] = o[s] || {}, o = o[s];
112
131
  } else
113
- o[t] = r;
132
+ o[s] = r;
114
133
  });
115
134
  } else
116
- l[s] = r;
135
+ e[n] = r;
117
136
  }
118
- })(g || (g = {}));
119
- const m = g;
120
- function w() {
121
- return h(() => {
122
- const _ = "crono-box";
123
- let n = document.getElementById(_);
124
- return n || (n = document.createElement("div"), n.id = _, document.body.appendChild(n)), n;
137
+ })(b || (b = {}));
138
+ const y = b;
139
+ function I() {
140
+ return g(() => {
141
+ const c = "crono-box";
142
+ let l = document.getElementById(c);
143
+ return l || (l = document.createElement("div"), l.id = c, document.body.appendChild(l)), l;
125
144
  }, []);
126
145
  }
127
146
  export {
128
- k as C,
129
- m as F,
130
- A as O,
131
- p as a,
132
- F as t,
133
- w as u
147
+ x as C,
148
+ y as F,
149
+ A as I,
150
+ k as O,
151
+ F as a,
152
+ m as t,
153
+ I as u
134
154
  };
@@ -1,13 +0,0 @@
1
- import { Grid } from './dataGridContract';
2
- export default function useGrid<T extends {}>(data?: T[]): Grid<T>;
3
- tends {}> {
4
- key: keyof T;
5
- }
6
- export interface GridRow<T extends {}> {
7
- dataRow: T;
8
- cells: GridCell<T>[];
9
- }
10
- export interface Grid<T extends {}> {
11
- columns: GridColumn<T>[];
12
- rows: GridRow<T>[];
13
- }
package/src/index.d.ts DELETED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes