@e1011/es-kit 1.0.120 → 1.0.124
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/hooks/esm/index.css +30 -30
- package/dist/hooks/index.css +30 -30
- package/dist/lib/cjs/node_modules/core-js/modules/es.object.keys.js +2 -0
- package/dist/lib/cjs/node_modules/core-js/modules/es.object.keys.js.map +1 -0
- package/dist/lib/cjs/src/core/ui/components/container/CollapsibleContainer.js +1 -1
- package/dist/lib/cjs/src/core/ui/components/container/CollapsibleContainer.js.map +1 -1
- package/dist/lib/cjs/src/core/ui/components/container/ResizableContainer.js.map +1 -1
- package/dist/lib/cjs/src/core/ui/components/dividers/DividerLine.js.map +1 -1
- package/dist/lib/cjs/src/core/ui/components/icon/IconBase.js +1 -1
- package/dist/lib/cjs/src/core/ui/components/icon/IconBase.js.map +1 -1
- package/dist/lib/cjs/src/core/utils/helpers/fileValidator.js +1 -1
- package/dist/lib/cjs/src/core/utils/helpers/fileValidator.js.map +1 -1
- package/dist/lib/esm/node_modules/core-js/modules/es.object.keys.js +2 -0
- package/dist/lib/esm/node_modules/core-js/modules/es.object.keys.js.map +1 -0
- package/dist/lib/esm/src/core/ui/components/container/CollapsibleContainer.js +1 -1
- package/dist/lib/esm/src/core/ui/components/container/CollapsibleContainer.js.map +1 -1
- package/dist/lib/esm/src/core/ui/components/container/ResizableContainer.js.map +1 -1
- package/dist/lib/esm/src/core/ui/components/dividers/DividerLine.js.map +1 -1
- package/dist/lib/esm/src/core/ui/components/icon/IconBase.js +1 -1
- package/dist/lib/esm/src/core/ui/components/icon/IconBase.js.map +1 -1
- package/dist/lib/esm/src/core/utils/helpers/fileValidator.js +1 -1
- package/dist/lib/esm/src/core/utils/helpers/fileValidator.js.map +1 -1
- package/dist/lib/src/core/ui/components/container/CollapsibleContainer.js +4 -1
- package/dist/lib/src/core/ui/components/container/CollapsibleContainer.js.map +1 -1
- package/dist/lib/src/core/ui/components/container/ResizableContainer.js +0 -3
- package/dist/lib/src/core/ui/components/container/ResizableContainer.js.map +1 -1
- package/dist/lib/src/core/ui/components/dividers/DividerLine.js.map +1 -1
- package/dist/lib/src/core/ui/components/icon/IconBase.js +10 -3
- package/dist/lib/src/core/ui/components/icon/IconBase.js.map +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/core/ui/components/container/CollapsibleContainer.d.ts +3 -2
- package/dist/types/src/core/ui/components/container/CollapsibleContainer.d.ts.map +1 -1
- package/dist/types/src/core/ui/components/container/ResizableContainer.d.ts.map +1 -1
- package/dist/types/src/core/ui/components/dividers/DividerLine.d.ts.map +1 -1
- package/dist/types/src/core/ui/components/icon/IconBase.d.ts +2 -1
- package/dist/types/src/core/ui/components/icon/IconBase.d.ts.map +1 -1
- package/dist/ui/esm/src/core/ui/components/container/CollapsibleContainer.js +1 -1
- package/dist/ui/esm/src/core/ui/components/container/CollapsibleContainer.js.map +1 -1
- package/dist/ui/esm/src/core/ui/components/container/ResizableContainer.js.map +1 -1
- package/dist/ui/esm/src/core/ui/components/dividers/DividerLine.js.map +1 -1
- package/dist/ui/esm/src/core/ui/components/icon/IconBase.js +1 -1
- package/dist/ui/esm/src/core/ui/components/icon/IconBase.js.map +1 -1
- package/dist/ui/src/core/ui/components/container/CollapsibleContainer.js +1 -1
- package/dist/ui/src/core/ui/components/container/CollapsibleContainer.js.map +1 -1
- package/dist/ui/src/core/ui/components/container/ResizableContainer.js.map +1 -1
- package/dist/ui/src/core/ui/components/dividers/DividerLine.js.map +1 -1
- package/dist/ui/src/core/ui/components/icon/IconBase.js +1 -1
- package/dist/ui/src/core/ui/components/icon/IconBase.js.map +1 -1
- package/dist/utils/esm/index.css +30 -30
- package/dist/utils/esm/node_modules/core-js/modules/es.object.keys.js +2 -0
- package/dist/utils/esm/node_modules/core-js/modules/es.object.keys.js.map +1 -0
- package/dist/utils/esm/src/core/utils/helpers/fileValidator.js +1 -1
- package/dist/utils/esm/src/core/utils/helpers/fileValidator.js.map +1 -1
- package/dist/utils/index.css +30 -30
- package/dist/utils/node_modules/core-js/modules/es.object.keys.js +2 -0
- package/dist/utils/node_modules/core-js/modules/es.object.keys.js.map +1 -0
- package/dist/utils/src/core/utils/helpers/fileValidator.js +1 -1
- package/dist/utils/src/core/utils/helpers/fileValidator.js.map +1 -1
- package/package.json +6 -5
package/dist/hooks/esm/index.css
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
.icon-module_icon-base-parent__nOMvW {
|
|
2
|
+
line-height: 1px !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.icon-module_icon-base__S0tHf {
|
|
6
|
+
min-width: var(--min-width);
|
|
7
|
+
min-height: var(--min-height);
|
|
8
|
+
width: var(--width) !important;
|
|
9
|
+
height: var(--height) !important;
|
|
10
|
+
line-height: 1px !important;
|
|
11
|
+
background-color: var(--icon-color);
|
|
12
|
+
color: var(--icon-content-color);
|
|
13
|
+
background-repeat: no-repeat;
|
|
14
|
+
mask-image: var(--icon-url);
|
|
15
|
+
-webkit-mask-image: var(--icon-url);
|
|
16
|
+
mask-repeat: no-repeat;
|
|
17
|
+
-webkit-mask-repeat: no-repeat;
|
|
18
|
+
mask-size: contain;
|
|
19
|
+
-webkit-mask-size: contain;
|
|
20
|
+
mask-position: center;
|
|
21
|
+
-webkit-mask-position: center;
|
|
22
|
+
display: inline-block;
|
|
23
|
+
will-change: transform;
|
|
24
|
+
transform: translate3d(0, 0, 0);
|
|
25
|
+
}
|
|
26
|
+
.icon-module_icon-base__S0tHf svg {
|
|
27
|
+
fill: var(--icon-content-color);
|
|
28
|
+
width: var(--height);
|
|
29
|
+
height: var(--width);
|
|
30
|
+
}
|
|
1
31
|
.divider-module_divider-line__6CesR {
|
|
2
32
|
position: relative;
|
|
3
33
|
display: block;
|
|
@@ -41,36 +71,6 @@
|
|
|
41
71
|
min-height: 0;
|
|
42
72
|
border-radius: initial;
|
|
43
73
|
}
|
|
44
|
-
.icon-module_icon-base-parent__nOMvW {
|
|
45
|
-
line-height: 1px !important;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.icon-module_icon-base__S0tHf {
|
|
49
|
-
min-width: var(--min-width);
|
|
50
|
-
min-height: var(--min-height);
|
|
51
|
-
width: var(--width) !important;
|
|
52
|
-
height: var(--height) !important;
|
|
53
|
-
line-height: 1px !important;
|
|
54
|
-
background-color: var(--icon-color);
|
|
55
|
-
color: var(--icon-content-color);
|
|
56
|
-
background-repeat: no-repeat;
|
|
57
|
-
mask-image: var(--icon-url);
|
|
58
|
-
-webkit-mask-image: var(--icon-url);
|
|
59
|
-
mask-repeat: no-repeat;
|
|
60
|
-
-webkit-mask-repeat: no-repeat;
|
|
61
|
-
mask-size: contain;
|
|
62
|
-
-webkit-mask-size: contain;
|
|
63
|
-
mask-position: center;
|
|
64
|
-
-webkit-mask-position: center;
|
|
65
|
-
display: inline-block;
|
|
66
|
-
will-change: transform;
|
|
67
|
-
transform: translate3d(0, 0, 0);
|
|
68
|
-
}
|
|
69
|
-
.icon-module_icon-base__S0tHf svg {
|
|
70
|
-
fill: var(--icon-content-color);
|
|
71
|
-
width: var(--height);
|
|
72
|
-
height: var(--width);
|
|
73
|
-
}
|
|
74
74
|
.CollapsibleContainer-module_collapsible-container__u0Jmm {
|
|
75
75
|
transform-origin: 0% 0%;
|
|
76
76
|
opacity: 0;
|
package/dist/hooks/index.css
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
.icon-module_icon-base-parent__nOMvW {
|
|
2
|
+
line-height: 1px !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.icon-module_icon-base__S0tHf {
|
|
6
|
+
min-width: var(--min-width);
|
|
7
|
+
min-height: var(--min-height);
|
|
8
|
+
width: var(--width) !important;
|
|
9
|
+
height: var(--height) !important;
|
|
10
|
+
line-height: 1px !important;
|
|
11
|
+
background-color: var(--icon-color);
|
|
12
|
+
color: var(--icon-content-color);
|
|
13
|
+
background-repeat: no-repeat;
|
|
14
|
+
mask-image: var(--icon-url);
|
|
15
|
+
-webkit-mask-image: var(--icon-url);
|
|
16
|
+
mask-repeat: no-repeat;
|
|
17
|
+
-webkit-mask-repeat: no-repeat;
|
|
18
|
+
mask-size: contain;
|
|
19
|
+
-webkit-mask-size: contain;
|
|
20
|
+
mask-position: center;
|
|
21
|
+
-webkit-mask-position: center;
|
|
22
|
+
display: inline-block;
|
|
23
|
+
will-change: transform;
|
|
24
|
+
transform: translate3d(0, 0, 0);
|
|
25
|
+
}
|
|
26
|
+
.icon-module_icon-base__S0tHf svg {
|
|
27
|
+
fill: var(--icon-content-color);
|
|
28
|
+
width: var(--height);
|
|
29
|
+
height: var(--width);
|
|
30
|
+
}
|
|
1
31
|
.divider-module_divider-line__6CesR {
|
|
2
32
|
position: relative;
|
|
3
33
|
display: block;
|
|
@@ -41,36 +71,6 @@
|
|
|
41
71
|
min-height: 0;
|
|
42
72
|
border-radius: initial;
|
|
43
73
|
}
|
|
44
|
-
.icon-module_icon-base-parent__nOMvW {
|
|
45
|
-
line-height: 1px !important;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.icon-module_icon-base__S0tHf {
|
|
49
|
-
min-width: var(--min-width);
|
|
50
|
-
min-height: var(--min-height);
|
|
51
|
-
width: var(--width) !important;
|
|
52
|
-
height: var(--height) !important;
|
|
53
|
-
line-height: 1px !important;
|
|
54
|
-
background-color: var(--icon-color);
|
|
55
|
-
color: var(--icon-content-color);
|
|
56
|
-
background-repeat: no-repeat;
|
|
57
|
-
mask-image: var(--icon-url);
|
|
58
|
-
-webkit-mask-image: var(--icon-url);
|
|
59
|
-
mask-repeat: no-repeat;
|
|
60
|
-
-webkit-mask-repeat: no-repeat;
|
|
61
|
-
mask-size: contain;
|
|
62
|
-
-webkit-mask-size: contain;
|
|
63
|
-
mask-position: center;
|
|
64
|
-
-webkit-mask-position: center;
|
|
65
|
-
display: inline-block;
|
|
66
|
-
will-change: transform;
|
|
67
|
-
transform: translate3d(0, 0, 0);
|
|
68
|
-
}
|
|
69
|
-
.icon-module_icon-base__S0tHf svg {
|
|
70
|
-
fill: var(--icon-content-color);
|
|
71
|
-
width: var(--height);
|
|
72
|
-
height: var(--width);
|
|
73
|
-
}
|
|
74
74
|
.CollapsibleContainer-module_collapsible-container__u0Jmm {
|
|
75
75
|
transform-origin: 0% 0%;
|
|
76
76
|
opacity: 0;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("../internals/export.js"),t=require("../internals/to-object.js"),r=require("../internals/object-keys.js"),s=require("../internals/fails.js"),i=e._export,n=t.toObject,o=r.objectKeys;i({target:"Object",stat:!0,forced:(0,s.fails)((function(){o(1)}))},{keys:function(e){return o(n(e))}});
|
|
2
|
+
//# sourceMappingURL=es.object.keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"es.object.keys.js","sources":["../../../../../../node_modules/core-js/modules/es.object.keys.js"],"sourcesContent":["var $ = require('../internals/export');\nvar toObject = require('../internals/to-object');\nvar nativeKeys = require('../internals/object-keys');\nvar fails = require('../internals/fails');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });\n\n// `Object.keys` method\n// https://tc39.es/ecma262/#sec-object.keys\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {\n keys: function keys(it) {\n return nativeKeys(toObject(it));\n }\n});\n"],"names":["$","require$$0","toObject","require$$1","nativeKeys","require$$2","target","stat","forced","fails","require$$3","keys","it"],"mappings":"wKAAIA,EAAIC,EAAAA,QACJC,EAAWC,EAAAA,SACXC,EAAaC,EAAAA,WAOjBL,EAAE,CAAEM,OAAQ,SAAUC,MAAM,EAAMC,QAJRC,EAFdC,EAAAA,QAEoB,WAAcN,EAAW,EAAG,KAIK,CAC/DO,KAAM,SAAcC,GAClB,OAAOR,EAAWF,EAASU,GAC5B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../../../node_modules/core-js/modules/es.array.concat.js");var r=require("react"),l=require("../../../hooks/useParseProps.js"),a=require("./CollapsibleContainer.module.scss.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../../../node_modules/core-js/modules/es.array.concat.js");var r=require("react"),l=require("../../../hooks/useParseProps.js"),a=require("./CollapsibleContainer.module.scss.js"),t=["collapsed","collapseHandler","children","horizontal","className"],o={width:"scrollWidth",height:"scrollHeight"},s=r.memo((function(s){var n=s.collapsed,i=void 0!==n&&n,u=s.collapseHandler,c=s.children,d=s.horizontal,p=void 0!==d&&d,h=s.className,f=void 0===h?"":h,m=e.objectWithoutProperties(s,t),v=r.useRef(null),j=r.useState(0),P=e.slicedToArray(j,2),b=P[0],x=P[1],g=l.useParseProps(m),y=g.dataProps,C=g.restProps,q=!p;r.useEffect((function(){null==u||u(i)}),[u,i]),r.useLayoutEffect((function(){if(null!=v&&v.current){var e=q?"height":"width";setTimeout((function(){x(v.current[o[e]])}),100)}}),[v,q]);var _=r.useMemo((function(){return e.objectSpread2({"--prop-name":q?"height":"width","--prop-max-name":q?"max-height":"max-width","--prop-value":"".concat(b,"px")},C)}),[q,C,b]),w=r.useMemo((function(){var e=[q?a.default.vertical:a.default.horizontal];return i&&b&&null!=b&&e.push(a.default.collapsed),!i&&b&&null!=b&&e.push(a.default.expanded),e.join(" ")}),[i,b,q]);return React.createElement("div",e.extends({className:"".concat(a.default["collapsible-container"]," ").concat(w," ").concat(f," "),ref:v,style:_},y),c)}));s.displayName="CollapsibleContainer",exports.CollapsibleContainer=s;
|
|
2
2
|
//# sourceMappingURL=CollapsibleContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleContainer.js","sources":["../../../../../../../../src/core/ui/components/container/CollapsibleContainer.tsx"],"sourcesContent":["import { FC, useRef, useState, memo, ReactNode
|
|
1
|
+
{"version":3,"file":"CollapsibleContainer.js","sources":["../../../../../../../../src/core/ui/components/container/CollapsibleContainer.tsx"],"sourcesContent":["import { FC, useRef, useState, memo, ReactNode,\n useEffect, useLayoutEffect, useMemo, CSSProperties, PropsWithChildren } from 'react'\n\nimport { useParseProps } from '../../../hooks/useParseProps'\n\nimport classes from './CollapsibleContainer.module.scss'\nimport { LayoutBoxProps } from './layoutBox.types'\n\n\nconst elementPropNameMap: Record<string, string> = {\n width: 'scrollWidth',\n height: 'scrollHeight',\n}\n\nexport type CollapsibleContainerProps = PropsWithChildren & LayoutBoxProps & {\n collapsed?: boolean\n collapseHandler?: (collapsed: boolean) => void\n children?: ReactNode\n className?: string\n horizontal?: boolean\n} & CSSProperties\n\nexport const CollapsibleContainer: FC<CollapsibleContainerProps> = memo(({\n collapsed = false, collapseHandler, children, horizontal = false, className = '', ...props\n}: CollapsibleContainerProps) => {\n const containerRef = useRef<HTMLDivElement>(null)\n const [contentProp, setContentProp] = useState(0)\n\n const { dataProps, restProps: style } = useParseProps(props)\n\n const vertical = !horizontal\n\n useEffect(() => {\n collapseHandler?.(collapsed)\n }, [collapseHandler, collapsed])\n\n useLayoutEffect(() => {\n if (containerRef?.current) {\n const propName = vertical ? 'height' : 'width'\n\n // TODO test with requestAnimationFrame\n setTimeout(() => {\n setContentProp((containerRef.current as any)[elementPropNameMap[propName]])\n }, 100)\n }\n }, [containerRef, vertical])\n\n const styleProps: CSSProperties = useMemo(() => ({\n '--prop-name': vertical ? 'height' : 'width',\n '--prop-max-name': vertical ? 'max-height' : 'max-width',\n '--prop-value': `${contentProp}px`,\n ...style,\n } as CSSProperties), [vertical, style, contentProp])\n\n const classNames = useMemo(() => {\n const classNames = [vertical ? classes.vertical : classes.horizontal]\n\n if (collapsed && contentProp && contentProp !== undefined && contentProp !== null) {\n classNames.push(classes.collapsed)\n }\n if (!collapsed && contentProp && contentProp !== undefined && contentProp !== null) {\n classNames.push(classes.expanded)\n }\n return classNames.join(' ')\n }, [collapsed, contentProp, vertical])\n\n return (\n <div\n className={`${classes['collapsible-container']} ${classNames} ${className} `}\n ref={containerRef}\n style={styleProps}\n {...dataProps}\n >\n {children}\n </div>\n )\n})\n\nCollapsibleContainer.displayName = 'CollapsibleContainer'\n"],"names":["elementPropNameMap","width","height","CollapsibleContainer","memo","_ref","_ref$collapsed","collapsed","collapseHandler","children","_ref$horizontal","horizontal","_ref$className","className","props","_objectWithoutProperties","objectWithoutProperties","_excluded","containerRef","useRef","_useState","useState","_useState2","_slicedToArray","contentProp","setContentProp","_useParseProps","useParseProps","dataProps","style","restProps","vertical","useEffect","useLayoutEffect","current","propName","setTimeout","styleProps","useMemo","_objectSpread","concat","classNames","classes","push","expanded","join","React","createElement","_extends","ref","displayName"],"mappings":"iZASMA,EAA6C,CACjDC,MAAO,cACPC,OAAQ,gBAWGC,EAAsDC,EAAAA,MAAK,SAAAC,GAEvC,IAAAC,EAAAD,EAD/BE,UAAAA,OAAY,IAAHD,GAAQA,EAAEE,EAAeH,EAAfG,gBAAiBC,EAAQJ,EAARI,SAAQC,EAAAL,EAAEM,WAAAA,OAAa,IAAHD,GAAQA,EAAAE,EAAAP,EAAEQ,UAAAA,OAAY,IAAHD,EAAG,GAAEA,EAAKE,EAAKC,EAAAC,wBAAAX,EAAAY,GAEpFC,EAAeC,SAAuB,MAC5CC,EAAsCC,EAAQA,SAAC,GAAEC,EAAAC,EAAAA,cAAAH,EAAA,GAA1CI,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAElCI,EAAwCC,EAAaA,cAACb,GAA9Cc,EAASF,EAATE,UAAsBC,EAAKH,EAAhBI,UAEbC,GAAYpB,EAElBqB,EAAAA,WAAU,WACRxB,SAAAA,EAAkBD,EACpB,GAAG,CAACC,EAAiBD,IAErB0B,EAAAA,iBAAgB,WACd,GAAIf,SAAAA,EAAcgB,QAAS,CACzB,IAAMC,EAAWJ,EAAW,SAAW,QAGvCK,YAAW,WACTX,EAAgBP,EAAagB,QAAgBlC,EAAmBmC,IACjE,GAAE,IACL,CACF,GAAG,CAACjB,EAAca,IAElB,IAAMM,EAA4BC,EAAAA,SAAQ,WAAA,OAAAC,gBAAA,CACxC,cAAeR,EAAW,SAAW,QACrC,kBAAmBA,EAAW,aAAe,YAC7C,eAAc,GAAAS,OAAKhB,EAAW,OAC3BK,EACc,GAAE,CAACE,EAAUF,EAAOL,IAEjCiB,EAAaH,EAAAA,SAAQ,WACzB,IAAMG,EAAa,CAACV,EAAWW,EAAAA,QAAQX,SAAWW,EAAAA,QAAQ/B,YAQ1D,OANIJ,GAAaiB,GAAbjB,MAA4BiB,GAC9BiB,EAAWE,KAAKD,UAAQnC,YAErBA,GAAaiB,GAAd,MAA6BA,GAC/BiB,EAAWE,KAAKD,UAAQE,UAEnBH,EAAWI,KAAK,IACxB,GAAE,CAACtC,EAAWiB,EAAaO,IAE5B,OACEe,MAAAC,cAAA,MAAAC,UAAA,CACEnC,UAAS2B,GAAAA,OAAKE,EAAAA,QAAQ,yBAAwBF,KAAAA,OAAIC,EAAU,KAAAD,OAAI3B,EAAa,KAC7EoC,IAAK/B,EACLW,MAAOQ,GACHT,GAEHnB,EAGP,IAEAN,EAAqB+C,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResizableContainer.js","sources":["../../../../../../../../src/core/ui/components/container/ResizableContainer.tsx"],"sourcesContent":["import { memo, useState, useRef, useMemo, useLayoutEffect, RefObject, PropsWithChildren } from 'react'\nimport debounce from 'lodash-es/debounce'\n\nimport { LayoutBox } from './LayoutBox'\nimport { LayoutBoxProps } from './layoutBox.types'\n\nexport type ResizableContainerProps = LayoutBoxProps & PropsWithChildren<any> & {\n debounceDelay?: number\n}\n\nexport type ResizableContainerRenderProps = {\n width: number | string\n height: number | string\n measured: boolean\n}\n\ntype WrapperSize = {width: undefined | number; height: undefined | number}\n\nconst styles = {\n main: {\n position: 'absolute',\n zIndex: 111,\n left: 0,\n pointerEvents: 'none',\n
|
|
1
|
+
{"version":3,"file":"ResizableContainer.js","sources":["../../../../../../../../src/core/ui/components/container/ResizableContainer.tsx"],"sourcesContent":["import { memo, useState, useRef, useMemo, useLayoutEffect, RefObject, PropsWithChildren } from 'react'\nimport debounce from 'lodash-es/debounce'\n\nimport { LayoutBox } from './LayoutBox'\nimport { LayoutBoxProps } from './layoutBox.types'\n\n\nexport type ResizableContainerProps = LayoutBoxProps & PropsWithChildren<any> & {\n debounceDelay?: number\n}\n\nexport type ResizableContainerRenderProps = {\n width: number | string\n height: number | string\n measured: boolean\n}\n\ntype WrapperSize = {width: undefined | number; height: undefined | number}\n\nconst styles = {\n main: {\n position: 'absolute',\n zIndex: 111,\n left: 0,\n pointerEvents: 'none',\n },\n empty: {\n pointerEvents: 'none',\n },\n}\n\nexport const ResizableContainer = memo<ResizableContainerProps>(\n ({ children, debounceDelay = 250, ...props }: ResizableContainerProps) => {\n const containerRef = useRef<HTMLDivElement>()\n\n const lastResizeWidthRef = useRef<{ width: number; height: number }>({ width: 0, height: 0 })\n\n const [containerSize, setContainerSize]\n = useState<WrapperSize>({ width: undefined, height: undefined })\n\n const debouncedResizeWrapper = useMemo(() => debounce((entries) => {\n const newResizeWidth = entries[0].contentRect.width\n const newResizeHeight = entries[0].contentRect.height\n\n if (lastResizeWidthRef.current?.width === newResizeWidth\n && lastResizeWidthRef.current?.height === newResizeHeight) {\n return\n }\n lastResizeWidthRef.current = { width: newResizeWidth, height: newResizeHeight }\n\n setContainerSize({\n width: containerRef?.current?.clientWidth,\n height: containerRef?.current?.clientHeight,\n })\n }, debounceDelay), [debounceDelay])\n\n useLayoutEffect(() => {\n let resizeObserver: ResizeObserver\n let containerElement: HTMLElement\n\n if (containerRef?.current) {\n containerElement = containerRef?.current\n resizeObserver = new ResizeObserver(debouncedResizeWrapper)\n resizeObserver.observe(containerElement as Element)\n\n setContainerSize({\n width: containerRef?.current?.clientWidth,\n height: containerRef?.current?.clientHeight,\n })\n }\n return () => {\n resizeObserver?.unobserve?.(containerElement as Element)\n }\n }, [debouncedResizeWrapper, containerRef])\n\n // END RESIZING\n\n return (\n <LayoutBox\n width='100%'\n height='100%'\n justify='center'\n align='center'\n direction='column'\n {...props}\n >\n <LayoutBox\n style={styles.main}\n width='100%'\n height='100%'\n ref={containerRef as RefObject<HTMLDivElement>}\n />\n {!children && (\n <LayoutBox\n width={`${Math.max(containerSize?.width || 200, 200) || 200}px`}\n height={`${Math.max(containerSize?.height || 200, 200) || 200}px`}\n style={styles.empty}\n />\n )}\n {children && children?.({\n height: `${containerSize?.height || 200}px`,\n width: `${containerSize?.width || 200}px`,\n measured: !!containerSize?.height,\n } as ResizableContainerRenderProps)}\n </LayoutBox>\n )\n },\n)\n\nResizableContainer.displayName = 'ResizableContainer'\n\n"],"names":["styles","main","position","zIndex","left","pointerEvents","empty","ResizableContainer","memo","_ref","children","_ref$debounceDelay","debounceDelay","props","_objectWithoutProperties","objectWithoutProperties","_excluded","containerRef","useRef","lastResizeWidthRef","width","height","_useState","useState","undefined","_useState2","_slicedToArray","containerSize","setContainerSize","debouncedResizeWrapper","useMemo","debounce","entries","_lastResizeWidthRef$c","_lastResizeWidthRef$c2","_containerRef$current","_containerRef$current2","newResizeWidth","contentRect","newResizeHeight","current","clientWidth","clientHeight","useLayoutEffect","resizeObserver","containerElement","_containerRef$current3","_containerRef$current4","ResizeObserver","observe","_resizeObserver","_resizeObserver$unobs","unobserve","call","React","createElement","LayoutBox","_extends","justify","align","direction","style","ref","concat","Math","max","measured","displayName"],"mappings":"uRAmBMA,EAAS,CACbC,KAAM,CACJC,SAAU,WACVC,OAAQ,IACRC,KAAM,EACNC,cAAe,QAEjBC,MAAO,CACLD,cAAe,SAINE,EAAqBC,EAAAA,MAChC,SAAAC,GAA0E,IAAvEC,EAAQD,EAARC,SAAQC,EAAAF,EAAEG,cAAAA,OAAgB,IAAHD,EAAG,IAAGA,EAAKE,EAAKC,EAAAC,wBAAAN,EAAAO,GAClCC,EAAeC,EAAAA,SAEfC,EAAqBD,EAAAA,OAA0C,CAAEE,MAAO,EAAGC,OAAQ,IAEzFC,EACEC,EAAAA,SAAsB,CAAEH,WAAOI,EAAWH,YAAQG,IAAYC,EAAAC,EAAAA,cAAAJ,EAAA,GADzDK,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GAGhCI,EAAyBC,EAAAA,SAAQ,WAAA,OAAMC,EAAAA,SAAS,SAACC,GAAY,IAAAC,EAAAC,EAAAC,EAAAC,EAC3DC,EAAiBL,EAAQ,GAAGM,YAAYlB,MACxCmB,EAAkBP,EAAQ,GAAGM,YAAYjB,QAEjBY,QAA1BA,EAAAd,EAAmBqB,eAAnBP,IAA0BA,OAA1BA,EAAAA,EAA4Bb,SAAUiB,IACb,QAA1BH,EAAAf,EAAmBqB,eAAO,IAAAN,OAAA,EAA1BA,EAA4Bb,UAAWkB,IAG1CpB,EAAmBqB,QAAU,CAAEpB,MAAOiB,EAAgBhB,OAAQkB,GAE9DX,EAAiB,CACfR,MAAOH,SAAqBkB,QAATA,EAAZlB,EAAcuB,eAAdL,IAAqBA,SAArBA,EAAuBM,YAC9BpB,OAAQJ,SAAqB,QAATmB,EAAZnB,EAAcuB,eAAO,IAAAJ,SAArBA,EAAuBM,eAElC,GAAE9B,KAAgB,CAACA,IAuBpB,OArBA+B,EAAAA,iBAAgB,WACd,IAAIC,EACAC,EAEuBC,EAAAC,EAAvB9B,SAAAA,EAAcuB,UAChBK,EAAmB5B,aAAAA,EAAAA,EAAcuB,SACjCI,EAAiB,IAAII,eAAenB,IACrBoB,QAAQJ,GAEvBjB,EAAiB,CACfR,MAAOH,SAAqB6B,QAATA,EAAZ7B,EAAcuB,eAAdM,IAAqBA,SAArBA,EAAuBL,YAC9BpB,OAAQJ,SAAqB,QAAT8B,EAAZ9B,EAAcuB,eAAO,IAAAO,SAArBA,EAAuBL,gBAGnC,OAAO,WAAM,IAAAQ,EAAAC,EACG,QAAdD,EAAAN,SAAcO,IAAAD,GAAWC,QAAXA,EAAdD,EAAgBE,qBAASD,GAAzBA,EAAAE,KAAAH,EAA4BL,GAEhC,GAAG,CAAChB,EAAwBZ,IAK1BqC,MAAAC,cAACC,EAASA,UAAAC,UAAA,CACRrC,MAAM,OACNC,OAAO,OACPqC,QAAQ,SACRC,MAAM,SACNC,UAAU,UACN/C,GAEJyC,MAAAC,cAACC,EAAAA,UAAS,CACRK,MAAO7D,EAAOC,KACdmB,MAAM,OACNC,OAAO,OACPyC,IAAK7C,KAELP,GACF4C,MAAAC,cAACC,EAAAA,UAAS,CACRpC,MAAK,GAAA2C,OAAKC,KAAKC,KAAItC,eAAAA,EAAeP,QAAS,IAAK,MAAQ,IAAQ,MAChEC,OAAM,GAAA0C,OAAKC,KAAKC,KAAItC,eAAAA,EAAeN,SAAU,IAAK,MAAQ,IAAQ,MAClEwC,MAAO7D,EAAOM,QAGfI,IAAYA,aAAAA,EAAAA,EAAW,CACtBW,OAAM0C,GAAAA,QAAKpC,aAAa,EAAbA,EAAeN,SAAU,IAAO,MAC3CD,MAAK2C,GAAAA,QAAKpC,aAAa,EAAbA,EAAeP,QAAS,IAAO,MACzC8C,WAAYvC,UAAAA,EAAeN,WAInC,IAGFd,EAAmB4D,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DividerLine.js","sources":["../../../../../../../../src/core/ui/components/dividers/DividerLine.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { memo, FC, CSSProperties, useMemo } from 'react'\n\nimport classes from './divider.module.scss'\n\ntype DividerProps = {\n orientation?: string\n margin?: string\n vertical?: boolean\n length?: string\n color?: string\n opacity?: number\n left?: string\n width?: string\n height?: string\n className?: string\n}\n\nexport const DividerLine: FC<DividerProps> = memo<DividerProps>(({\n orientation, vertical,\n color = '#999999',\n opacity,\n length = '80%', left = '0',\n width = '1px', height = '1px',\n margin,\n className = '',\n}: DividerProps) => {\n const isVertical = useMemo(() => orientation === 'vertical' || vertical === true, [orientation, vertical])\n\n const styles = useMemo(() => (\n {\n '--width': width,\n '--height': height,\n '--length': length,\n '--opacity': opacity,\n '--color': color,\n '--left': left,\n '--margin': margin || (isVertical ? 'auto 0' : '0 auto'),\n }\n ), [width, height, length, opacity, color, left, margin, isVertical])\n\n const verHorClass = isVertical ? classes.vertical : classes.horizontal\n\n return (\n <div\n className={`${(classes as any)['divider-line']} ${verHorClass} ${className}`}\n style={styles as CSSProperties}\n />\n )\n})\n\nDividerLine.displayName = 'DividerLine'\n\nexport const DividerVertical: FC<DividerProps>\n = memo((props) => <DividerLine vertical length='100%' {...props} />)\nDividerVertical.displayName = 'DividerVertical'\n\nexport const DividerHorizontal: FC<DividerProps>\n = memo((props) => <DividerLine length='100%' {...props} />)\nDividerHorizontal.displayName = 'DividerHorizontal'\n"],"names":["DividerLine","memo","_ref","orientation","vertical","_ref$color","color","opacity","_ref$length","length","_ref$left","left","_ref$width","width","_ref$height","height","margin","_ref$className","className","isVertical","useMemo","styles","verHorClass","classes","horizontal","React","createElement","concat","style","displayName","DividerVertical","props","_extends","DividerHorizontal"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DividerLine.js","sources":["../../../../../../../../src/core/ui/components/dividers/DividerLine.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { memo, FC, CSSProperties, useMemo } from 'react'\n\nimport classes from './divider.module.scss'\n\n\ntype DividerProps = {\n orientation?: string\n margin?: string\n vertical?: boolean\n length?: string\n color?: string\n opacity?: number\n left?: string\n width?: string\n height?: string\n className?: string\n}\n\nexport const DividerLine: FC<DividerProps> = memo<DividerProps>(({\n orientation, vertical,\n color = '#999999',\n opacity,\n length = '80%', left = '0',\n width = '1px', height = '1px',\n margin,\n className = '',\n}: DividerProps) => {\n const isVertical = useMemo(() => orientation === 'vertical' || vertical === true, [orientation, vertical])\n\n const styles = useMemo(() => (\n {\n '--width': width,\n '--height': height,\n '--length': length,\n '--opacity': opacity,\n '--color': color,\n '--left': left,\n '--margin': margin || (isVertical ? 'auto 0' : '0 auto'),\n }\n ), [width, height, length, opacity, color, left, margin, isVertical])\n\n const verHorClass = isVertical ? classes.vertical : classes.horizontal\n\n return (\n <div\n className={`${(classes as any)['divider-line']} ${verHorClass} ${className}`}\n style={styles as CSSProperties}\n />\n )\n})\n\nDividerLine.displayName = 'DividerLine'\n\nexport const DividerVertical: FC<DividerProps>\n = memo((props) => <DividerLine vertical length='100%' {...props} />)\nDividerVertical.displayName = 'DividerVertical'\n\nexport const DividerHorizontal: FC<DividerProps>\n = memo((props) => <DividerLine length='100%' {...props} />)\nDividerHorizontal.displayName = 'DividerHorizontal'\n"],"names":["DividerLine","memo","_ref","orientation","vertical","_ref$color","color","opacity","_ref$length","length","_ref$left","left","_ref$width","width","_ref$height","height","margin","_ref$className","className","isVertical","useMemo","styles","verHorClass","classes","horizontal","React","createElement","concat","style","displayName","DividerVertical","props","_extends","DividerHorizontal"],"mappings":"iRAmBaA,EAAgCC,EAAAA,MAAmB,SAAAC,GAQ5C,IAPlBC,EAAWD,EAAXC,YAAaC,EAAQF,EAARE,SAAQC,EAAAH,EACrBI,MAAAA,OAAQ,IAAHD,EAAG,UAASA,EACjBE,EAAOL,EAAPK,QAAOC,EAAAN,EACPO,OAAAA,OAAS,IAAHD,EAAG,MAAKA,EAAAE,EAAAR,EAAES,KAAAA,OAAO,IAAHD,EAAG,IAAGA,EAAAE,EAAAV,EAC1BW,MAAAA,OAAQ,IAAHD,EAAG,MAAKA,EAAAE,EAAAZ,EAAEa,OAAAA,OAAS,IAAHD,EAAG,MAAKA,EAC7BE,EAAMd,EAANc,OAAMC,EAAAf,EACNgB,UAAAA,OAAY,IAAHD,EAAG,GAAEA,EAERE,EAAaC,EAAAA,SAAQ,WAAA,MAAsB,aAAhBjB,IAA2C,IAAbC,CAAiB,GAAE,CAACD,EAAaC,IAE1FiB,EAASD,EAAAA,SAAQ,WAAA,MACrB,CACE,UAAWP,EACX,WAAYE,EACZ,WAAYN,EACZ,YAAaF,EACb,UAAWD,EACX,SAAUK,EACV,WAAYK,IAAWG,EAAa,SAAW,UAChD,GACA,CAACN,EAAOE,EAAQN,EAAQF,EAASD,EAAOK,EAAMK,EAAQG,IAEnDG,EAAcH,EAAaI,EAAAA,QAAQnB,SAAWmB,EAAAA,QAAQC,WAE5D,OACEC,MAAAC,cAAA,MAAA,CACER,UAASS,GAAAA,OAAMJ,EAAO,QAAS,gBAAeI,KAAAA,OAAIL,EAAW,KAAAK,OAAIT,GACjEU,MAAOP,GAGb,IAEArB,EAAY6B,YAAc,kBAEbC,EACT7B,EAAAA,MAAK,SAAC8B,GAAK,OAAKN,MAAAC,cAAC1B,EAAWgC,UAAA,CAAC5B,UAAQ,EAACK,OAAO,QAAWsB,GAAS,IACrED,EAAgBD,YAAc,sBAEjBI,EACThC,EAAAA,MAAK,SAAC8B,GAAK,OAAKN,MAAAC,cAAC1B,EAAWgC,UAAA,CAACvB,OAAO,QAAWsB,GAAS,IAC5DE,EAAkBJ,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../../../node_modules/core-js/modules/es.array.concat.js");var o=require("react"),t=require("./icon.module.scss.js"),r=["iconUrl","minWidth","minHeight","size","fontSize","width","height","color","className","children","style"],i=o.memo((function(i){var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../../../node_modules/core-js/modules/es.array.concat.js");var o=require("react"),t=require("./icon.module.scss.js"),r=["iconUrl","minWidth","minHeight","size","fontSize","width","height","color","className","children","style","onClick"],i=o.memo((function(i){var n=i.iconUrl,c=i.minWidth,s=i.minHeight,a=i.size,l=i.fontSize,u=i.width,d=i.height,m=i.color,h=void 0===m?"currentColor":m,p=i.className,b=void 0===p?"":p,j=i.children,f=i.style,S=i.onClick,g=e.objectWithoutProperties(i,r),v=o.useMemo((function(){return e.objectSpread2(e.objectSpread2(e.objectSpread2(e.objectSpread2(e.objectSpread2({"--min-width":c||a||u||"auto","--min-height":s||a||d||"auto","--width":a||u||"1rem","--height":a||d||"1rem"},l?{fontSize:l}:{}),n?{"--icon-url":"url(".concat(n,")")}:{}),n?{"--icon-color":h}:{"--icon-content-color":h}),S?{cursor:"pointer"}:{}),f)}),[c,a,u,s,d,l,n,h,S,f]),y=o.useMemo((function(){return S?{onClick:S,onkeyDown:S,role:"button",tabIndex:-1}:{}}),[S]);return React.createElement("span",e.extends({},g,y,{className:"".concat(t.default["icon-base"]," icon-base ").concat(b),style:v}),!n&&j&&j)}));i.displayName="IconBase",exports.IconBase=i;
|
|
2
2
|
//# sourceMappingURL=IconBase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconBase.js","sources":["../../../../../../../../src/core/ui/components/icon/IconBase.tsx"],"sourcesContent":["import { CSSProperties, memo, useMemo, FC, PropsWithChildren } from 'react'\n\nimport classes from './icon.module.scss'\n\nexport type IconBaseType = PropsWithChildren<unknown> & {\n id?: string\n iconUrl?: string\n minWidth?: string\n minHeight?: string\n width?: string\n height?: string\n size?: string\n fontSize?: string\n color?: string\n className?: string\n style?: CSSProperties\n}\n\nexport const IconBase: FC<IconBaseType> = memo<IconBaseType>(({\n iconUrl, minWidth, minHeight, size,\n fontSize, width, height, color = 'currentColor', className = '', children, style, ...props\n}: IconBaseType) => {\n const styles = useMemo(() => (\n {\n '--min-width': minWidth || size || width || 'auto',\n '--min-height': minHeight || size || height || 'auto',\n '--width': size || width || '1rem',\n '--height': size || height || '1rem',\n ...(fontSize ? { fontSize } : {}),\n ...(iconUrl ? { '--icon-url': `url(${iconUrl})` } : {}),\n ...(iconUrl ? { '--icon-color': color } : { '--icon-content-color': color }),\n ...style,\n }\n ), [minWidth, size, width, minHeight, height, fontSize, iconUrl, color, style])\n\n return (\n <span\n {...props}\n className={`${classes['icon-base']} icon-base ${className}`}\n style={styles as CSSProperties}\n >\n {(!iconUrl && children) && children}\n </span>\n )\n})\n\nIconBase.displayName = 'IconBase'\n"],"names":["IconBase","memo","_ref","iconUrl","minWidth","minHeight","size","fontSize","width","height","_ref$color","color","_ref$className","className","children","style","props","_objectWithoutProperties","objectWithoutProperties","_excluded","styles","useMemo","_objectSpread","objectSpread2","concat","React","createElement","_extends","classes","displayName"],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconBase.js","sources":["../../../../../../../../src/core/ui/components/icon/IconBase.tsx"],"sourcesContent":["import { CSSProperties, memo, useMemo, FC, PropsWithChildren, MouseEvent } from 'react'\n\nimport classes from './icon.module.scss'\n\nexport type IconBaseType = PropsWithChildren<unknown> & {\n id?: string\n iconUrl?: string\n minWidth?: string\n minHeight?: string\n width?: string\n height?: string\n size?: string\n fontSize?: string\n color?: string\n className?: string\n style?: CSSProperties\n onClick?: (event?: MouseEvent<HTMLSpanElement> | undefined) => void\n}\n\nexport const IconBase: FC<IconBaseType> = memo<IconBaseType>(({\n iconUrl, minWidth, minHeight, size,\n fontSize, width, height, color = 'currentColor', className = '', children, style, onClick, ...props\n}: IconBaseType) => {\n const styles = useMemo(() => (\n {\n '--min-width': minWidth || size || width || 'auto',\n '--min-height': minHeight || size || height || 'auto',\n '--width': size || width || '1rem',\n '--height': size || height || '1rem',\n ...(fontSize ? { fontSize } : {}),\n ...(iconUrl ? { '--icon-url': `url(${iconUrl})` } : {}),\n ...(iconUrl ? { '--icon-color': color } : { '--icon-content-color': color }),\n ...(onClick ? { cursor: 'pointer' } : {}),\n ...style,\n }\n ), [minWidth, size, width, minHeight, height, fontSize, iconUrl, color, onClick, style])\n\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onkeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n return (\n <span\n {...props}\n {...onClickProps}\n className={`${classes['icon-base']} icon-base ${className}`}\n style={styles as CSSProperties}\n >\n {(!iconUrl && children) && children}\n </span>\n )\n})\n\nIconBase.displayName = 'IconBase'\n"],"names":["IconBase","memo","_ref","iconUrl","minWidth","minHeight","size","fontSize","width","height","_ref$color","color","_ref$className","className","children","style","onClick","props","_objectWithoutProperties","objectWithoutProperties","_excluded","styles","useMemo","_objectSpread","objectSpread2","concat","cursor","onClickProps","onkeyDown","role","tabIndex","React","createElement","_extends","classes","displayName"],"mappings":"uYAmBaA,EAA6BC,EAAAA,MAAmB,SAAAC,GAGzC,IAFlBC,EAAOD,EAAPC,QAASC,EAAQF,EAARE,SAAUC,EAASH,EAATG,UAAWC,EAAIJ,EAAJI,KAC9BC,EAAQL,EAARK,SAAUC,EAAKN,EAALM,MAAOC,EAAMP,EAANO,OAAMC,EAAAR,EAAES,MAAAA,OAAQ,IAAHD,EAAG,eAAcA,EAAAE,EAAAV,EAAEW,UAAAA,OAAY,IAAHD,EAAG,GAAEA,EAAEE,EAAQZ,EAARY,SAAUC,EAAKb,EAALa,MAAOC,EAAOd,EAAPc,QAAYC,EAAKC,EAAAC,wBAAAjB,EAAAkB,GAE7FC,EAASC,EAAAA,SAAQ,WAAA,OAAAC,EAAAC,cAAAD,EAAAC,cAAAD,gBAAAA,EAAAA,cAAAA,EAAAA,cAAA,CAEnB,cAAenB,GAAYE,GAAQE,GAAS,OAC5C,eAAgBH,GAAaC,GAAQG,GAAU,OAC/C,UAAWH,GAAQE,GAAS,OAC5B,WAAYF,GAAQG,GAAU,QAC1BF,EAAW,CAAEA,SAAAA,GAAa,CAAA,GAC1BJ,EAAU,CAAE,aAAY,OAAAsB,OAAStB,EAAO,MAAQ,CAAA,GAChDA,EAAU,CAAE,eAAgBQ,GAAU,CAAE,uBAAwBA,IAChEK,EAAU,CAAEU,OAAQ,WAAc,CAAE,GACrCX,EAEN,GAAE,CAACX,EAAUE,EAAME,EAAOH,EAAWI,EAAQF,EAAUJ,EAASQ,EAAOK,EAASD,IAE3EY,EAAeL,EAAAA,SAAQ,WAAA,OAAON,EAAW,CAC7CA,QAAAA,EACAY,UAAWZ,EACXa,KAAM,SACNC,UAAW,GACR,EAAE,GAAG,CAACd,IAEX,OACEe,MAAAC,cAAA,OAAAC,EAAA,QACMhB,CAAAA,EAAAA,EACAU,EAAY,CAChBd,UAAS,GAAAY,OAAKS,EAAO,QAAC,aAAYT,eAAAA,OAAcZ,GAChDE,MAAOM,KAEJlB,GAAWW,GAAaA,EAGjC,IAEAd,EAASmC,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../../node_modules/core-js/modules/es.regexp.exec.js"),require("../../../../node_modules/core-js/modules/es.string.split.js"),require("../../../../node_modules/core-js/modules/es.string.trim.js"),require("../../../../node_modules/core-js/modules/es.array.splice.js"),require("../../../../node_modules/core-js/modules/es.object.to-string.js"),require("../../../../node_modules/core-js/modules/web.dom-collections.for-each.js"),require("../../../../node_modules/core-js/modules/es.array.includes.js"),require("../../../../node_modules/core-js/modules/es.regexp.to-string.js"),require("../../../../node_modules/core-js/modules/es.array.map.js"),require("../../../../node_modules/core-js/modules/es.array.iterator.js"),require("../../../../node_modules/core-js/modules/es.set.constructor.js"),require("../../../../node_modules/core-js/modules/es.string.iterator.js"),require("../../../../node_modules/core-js/modules/web.dom-collections.iterator.js");var r=require("./textValueOperations.js"),l=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:";",l=e.split("\r\n");l.length<=1&&(l=e.split("\n"));var n=l.shift(),s=n?n.split(r):null;return{firstLine:n,lines:l,columns:s,numColumns:s?s.length:0}},n=function(e,r,l,n){return e.length!==r?{message:"errors.uploadInput.file.line.invalid",params:{line:l,index:n+1}}:null},s=function(e,r,l,n){return e!==e.trim()?{message:"errors.uploadInput.file.cell.invalid",params:{line:r,cell:e,lineIndex:l,cellIndex:n}}:null},o=function(e,r){for(var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:";",o=[],i=e.length;i--;)""!==e[i].trim()&&""!==e[i].split(";").join("").trim()||e.splice(i,1);var t=null,u=null,a=null;return e.forEach((function(e,i){t=e.split(l),(u=n(t,r,e,i))&&o.push(u),t.forEach((function(r,l){(a=s(r,e,i,l))&&o.push(a)}))})),o};exports.parseCSVdata=l,exports.validateCSVFile=function(n,s){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:";";if(n)if("csv"===r.fileNameExt(n.name)&&["text/csv","text/plain","application/vnd.ms-excel"].includes(n.type)){var t=new FileReader;t.readAsText(n),t.onloadend=function(){var r=t.result?t.result.toString():"",n=l(r,i),u=n.numColumns,a=n.lines;if(u<2)s(["errors.uploadInput.file.numColumns"]);else if((null==a?void 0:a.length)<1)s(["errors.uploadInput.file.numLines"]);else{var d=o(a,u,i).map((function(e){return null!=e&&e.message?JSON.stringify(e):String(e)})),m=e.toConsumableArray(new Set(d)).map((function(e){return JSON.parse(e)}));s&&s(m.length?m:null)}},t.onerror=function(e){}}else s(["errors.uploadInput.file.invalid"]);else s(["errors.uploadInput.file.empty"])},exports.validateCSVlines=o,exports.validateJSONFile=function(e,n){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:";";if(e)if("json"===r.fileNameExt(e.name)){var o=new FileReader;o.readAsText(e),o.onloadend=function(){var e=o.result?o.result.toString():"";try{var r=JSON.parse(e);JSON.stringify(r)}catch(e){return void n(["errors.uploadInput.file.invalid"])}var i=l(e,s).lines;(null==i?void 0:i.length)<1?n(["errors.uploadInput.file.numLines"]):n&&n(null)},o.onerror=function(e){}}else n(["errors.uploadInput.file.invalid"]);else n(["errors.uploadInput.file.empty"])},exports.validateLineCellTrimmed=s,exports.validateLineNumColumns=n,exports.validateSDFFile=function(e,n){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:";";if(e)if("sdf"===r.fileNameExt(e.name)){var o=new FileReader;o.readAsText(e),o.onloadend=function(){var e=o.result?o.result.toString():"",r=l(e,s).lines;(null==r?void 0:r.length)<1?n(["errors.uploadInput.file.numLines"]):n&&n(null)},o.onerror=function(e){}}else n(["errors.uploadInput.file.invalid"]);else n(["errors.uploadInput.file.empty"])};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../../node_modules/core-js/modules/es.regexp.exec.js"),require("../../../../node_modules/core-js/modules/es.string.split.js"),require("../../../../node_modules/core-js/modules/es.string.trim.js"),require("../../../../node_modules/core-js/modules/es.array.splice.js"),require("../../../../node_modules/core-js/modules/es.object.to-string.js"),require("../../../../node_modules/core-js/modules/web.dom-collections.for-each.js"),require("../../../../node_modules/core-js/modules/es.array.includes.js"),require("../../../../node_modules/core-js/modules/es.regexp.to-string.js"),require("../../../../node_modules/core-js/modules/es.array.map.js"),require("../../../../node_modules/core-js/modules/es.array.iterator.js"),require("../../../../node_modules/core-js/modules/es.set.constructor.js"),require("../../../../node_modules/core-js/modules/es.string.iterator.js"),require("../../../../node_modules/core-js/modules/web.dom-collections.iterator.js"),require("../../../../node_modules/core-js/modules/es.object.keys.js");var r=require("./textValueOperations.js"),l=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:";",l=e.split("\r\n");l.length<=1&&(l=e.split("\n"));var n=l.shift(),s=n?n.split(r):null;return{firstLine:n,lines:l,columns:s,numColumns:s?s.length:0}},n=function(e,r,l,n){return e.length!==r?{message:"errors.uploadInput.file.line.invalid",params:{line:l,index:n+1}}:null},s=function(e,r,l,n){return e!==e.trim()?{message:"errors.uploadInput.file.cell.invalid",params:{line:r,cell:e,lineIndex:l,cellIndex:n}}:null},o=function(e,r){for(var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:";",o=[],i=e.length;i--;)""!==e[i].trim()&&""!==e[i].split(";").join("").trim()||e.splice(i,1);var t=null,u=null,a=null;return e.forEach((function(e,i){t=e.split(l),(u=n(t,r,e,i))&&o.push(u),t.forEach((function(r,l){(a=s(r,e,i,l))&&o.push(a)}))})),o};exports.parseCSVdata=l,exports.validateCSVFile=function(n,s){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:";";if(n)if("csv"===r.fileNameExt(n.name)&&["text/csv","text/plain","application/vnd.ms-excel"].includes(n.type)){var t=new FileReader;t.readAsText(n),t.onloadend=function(){var r=t.result?t.result.toString():"",n=l(r,i),u=n.numColumns,a=n.lines;if(u<2)s(["errors.uploadInput.file.numColumns"]);else if((null==a?void 0:a.length)<1)s(["errors.uploadInput.file.numLines"]);else{var d=o(a,u,i).map((function(e){return null!=e&&e.message?JSON.stringify(e):String(e)})),m=e.toConsumableArray(new Set(d)).map((function(e){return JSON.parse(e)}));s&&s(m.length?m:null)}},t.onerror=function(e){}}else s(["errors.uploadInput.file.invalid"]);else s(["errors.uploadInput.file.empty"])},exports.validateCSVlines=o,exports.validateJSONFile=function(e,n){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:";";if(e)if("json"===r.fileNameExt(e.name)){var o=new FileReader;o.readAsText(e),o.onloadend=function(){var e=o.result?o.result.toString():"";try{var r=JSON.parse(e);JSON.stringify(r)}catch(e){return void n(["errors.uploadInput.file.invalid"])}var i=l(e,s).lines;(null==i?void 0:i.length)<1?n(["errors.uploadInput.file.numLines"]):n&&n(null)},o.onerror=function(e){}}else n(["errors.uploadInput.file.invalid"]);else n(["errors.uploadInput.file.empty"])},exports.validateLineCellTrimmed=s,exports.validateLineNumColumns=n,exports.validateSDFFile=function(e,n){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:";";if(e)if("sdf"===r.fileNameExt(e.name)){var o=new FileReader;o.readAsText(e),o.onloadend=function(){var e=o.result?o.result.toString():"",r=l(e,s).lines;(null==r?void 0:r.length)<1?n(["errors.uploadInput.file.numLines"]):n&&n(null)},o.onerror=function(e){}}else n(["errors.uploadInput.file.invalid"]);else n(["errors.uploadInput.file.empty"])};
|
|
2
2
|
//# sourceMappingURL=fileValidator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileValidator.js","sources":["../../../../../../../src/core/utils/helpers/fileValidator.ts"],"sourcesContent":["import { fileNameExt } from './textValueOperations'\n\nexport const parseCSVdata = (data: string, columnDelimiter = ';'): {\n firstLine: string\n lines: string[]\n columns: null | string[]\n numColumns: number\n} => {\n let lines: string[] = data.split('\\r\\n')\n\n if (lines.length <= 1) {\n lines = data.split('\\n')\n }\n\n const firstLine: string = lines.shift() as string\n const columns: null | string[] = firstLine ? firstLine.split(columnDelimiter) : null\n const numColumns: number = columns ? columns.length : 0\n\n return {\n firstLine,\n lines,\n columns,\n numColumns,\n }\n}\n\nexport const validateLineNumColumns\n = (lineColumns: Array<string>, numColumns: number, line: string, index: number): ErrorMessage | null => {\n if (lineColumns.length !== numColumns) {\n // errors.push(`Line number of cells is not equal to the number of columns: \"${line}, index: ${index}\"`)\n return {\n message: 'errors.uploadInput.file.line.invalid',\n params: { line, index: index + 1 } } as ErrorMessage\n }\n return null\n }\n\nexport const validateLineCellTrimmed\n = (cell: string, line: string, lineIndex: number, cellIndex: number): ErrorMessage | null => {\n if (cell !== cell.trim()) {\n return {\n message: 'errors.uploadInput.file.cell.invalid',\n params: {\n line, cell, lineIndex, cellIndex,\n },\n } as ErrorMessage\n }\n return null\n }\n\nexport const validateCSVlines = (lines: string[], numColumns: number, columnDelimiter = ';'): ErrorMessage[] => {\n const errors: ErrorMessage[] = []\n // lines without first line of columns (hence the index + 1 in error message)\n let linesNum = lines.length\n\n // eslint-disable-next-line no-cond-assign\n // eslint-disable-next-line no-plusplus\n while (linesNum--) {\n if (lines[linesNum].trim() === '' || lines[linesNum].split(';').join('').trim() === '') {\n lines.splice(linesNum, 1)\n }\n }\n\n let lineColumns = null\n let errorLineNumColumns = null\n let errorLineCellNotTrimmed = null\n\n lines.forEach((line, index) => {\n lineColumns = line.split(columnDelimiter)\n\n errorLineNumColumns = validateLineNumColumns(lineColumns, numColumns, line, index)\n errorLineNumColumns && errors.push(errorLineNumColumns)\n\n lineColumns.forEach((cell, cellIndex) => {\n errorLineCellNotTrimmed = validateLineCellTrimmed(cell, line, index, cellIndex)\n errorLineCellNotTrimmed && errors.push(errorLineCellNotTrimmed)\n })\n })\n\n return errors\n}\n\n/*\n// maybe add aditional mime types\nhttp://fileformats.archiveteam.org/wiki/CSV\n['text/csv','application/csv', 'text/x-csv',\n'application/x-csv', 'text/x-comma-separated-values', 'text/comma-separated-values']\n*/\n\nexport type ErrorMessage = {\n message: string\n params: Record<string, string | number>\n}\n\nexport const validateCSVFile\n= (file: File, callBack: (errors?: (ErrorMessage | string)[] | null) => void, columnDelimiter = ';'): void => {\n if (!file) {\n callBack(['errors.uploadInput.file.empty'])\n return\n }\n if (fileNameExt(file.name) !== 'csv' || !['text/csv', 'text/plain', 'application/vnd.ms-excel'].includes(file.type)) {\n callBack(['errors.uploadInput.file.invalid'])\n return\n }\n const reader = new FileReader()\n\n reader.readAsText(file)\n reader.onloadend = () => {\n const data = reader.result ? reader.result.toString() : ''\n\n const { numColumns, lines } = parseCSVdata(data, columnDelimiter)\n\n if (numColumns < 2) {\n callBack(['errors.uploadInput.file.numColumns'])\n return\n }\n\n if (lines?.length < 1) {\n callBack(['errors.uploadInput.file.numLines'])\n return\n }\n\n const errors: (ErrorMessage | string)[] = validateCSVlines(lines, numColumns, columnDelimiter)\n\n const flatErrors: string[] = errors.map((errorMsg: ErrorMessage | string) => (\n (errorMsg as ErrorMessage)?.message ? JSON.stringify(errorMsg) : String(errorMsg)))\n\n const errorsArray: string[] = [...new Set(flatErrors)].map((serialized: string) => JSON.parse(serialized))\n\n // callBack && callBack(errorsArray.length ? errorsArray?.splice?.(0, 6) : null)\n callBack && callBack(errorsArray.length ? errorsArray : null)\n }\n\n reader.onerror = (error) => {\n console.error(error)\n }\n}\n\nexport const validateSDFFile\n= (file: File, callBack: (errors?: (ErrorMessage | string)[] | null) => void, columnDelimiter = ';'): void => {\n if (!file) {\n callBack(['errors.uploadInput.file.empty'])\n return\n }\n if (fileNameExt(file.name) !== 'sdf') {\n callBack(['errors.uploadInput.file.invalid'])\n return\n }\n const reader = new FileReader()\n\n reader.readAsText(file)\n reader.onloadend = () => {\n const data = reader.result ? reader.result.toString() : ''\n\n const { lines } = parseCSVdata(data, columnDelimiter)\n\n if (lines?.length < 1) {\n callBack(['errors.uploadInput.file.numLines'])\n return\n }\n\n callBack && callBack(null)\n }\n\n reader.onerror = (error) => {\n console.error(error)\n }\n}\n\nexport const validateJSONFile\n= (file: File, callBack: (errors?: (ErrorMessage | string)[] | null) => void, columnDelimiter = ';'): void => {\n if (!file) {\n callBack(['errors.uploadInput.file.empty'])\n return\n }\n if (fileNameExt(file.name) !== 'json') {\n callBack(['errors.uploadInput.file.invalid'])\n return\n }\n const reader = new FileReader()\n\n reader.readAsText(file)\n reader.onloadend = () => {\n const data = reader.result ? reader.result.toString() : ''\n\n try {\n const parsed = JSON.parse(data)\n\n JSON.stringify(parsed)\n } catch (error) {\n console.error(error)\n callBack(['errors.uploadInput.file.invalid'])\n return\n }\n\n const { lines } = parseCSVdata(data, columnDelimiter)\n\n if (lines?.length < 1) {\n callBack(['errors.uploadInput.file.numLines'])\n return\n }\n\n callBack && callBack(null)\n }\n\n reader.onerror = (error) => {\n console.error(error)\n }\n}\n"],"names":["parseCSVdata","data","columnDelimiter","arguments","length","undefined","lines","split","firstLine","shift","columns","numColumns","validateLineNumColumns","lineColumns","line","index","message","params","validateLineCellTrimmed","cell","lineIndex","cellIndex","trim","validateCSVlines","errors","linesNum","join","splice","errorLineNumColumns","errorLineCellNotTrimmed","forEach","push","file","callBack","fileNameExt","name","includes","type","reader","FileReader","readAsText","onloadend","result","toString","_parseCSVdata","flatErrors","map","errorMsg","JSON","stringify","String","errorsArray","_toConsumableArray","toConsumableArray","Set","serialized","parse","onerror","error","parsed"],"mappings":"
|
|
1
|
+
{"version":3,"file":"fileValidator.js","sources":["../../../../../../../src/core/utils/helpers/fileValidator.ts"],"sourcesContent":["import { fileNameExt } from './textValueOperations'\n\nexport const parseCSVdata = (data: string, columnDelimiter = ';'): {\n firstLine: string\n lines: string[]\n columns: null | string[]\n numColumns: number\n} => {\n let lines: string[] = data.split('\\r\\n')\n\n if (lines.length <= 1) {\n lines = data.split('\\n')\n }\n\n const firstLine: string = lines.shift() as string\n const columns: null | string[] = firstLine ? firstLine.split(columnDelimiter) : null\n const numColumns: number = columns ? columns.length : 0\n\n return {\n firstLine,\n lines,\n columns,\n numColumns,\n }\n}\n\nexport const validateLineNumColumns\n = (lineColumns: Array<string>, numColumns: number, line: string, index: number): ErrorMessage | null => {\n if (lineColumns.length !== numColumns) {\n // errors.push(`Line number of cells is not equal to the number of columns: \"${line}, index: ${index}\"`)\n return {\n message: 'errors.uploadInput.file.line.invalid',\n params: { line, index: index + 1 } } as ErrorMessage\n }\n return null\n }\n\nexport const validateLineCellTrimmed\n = (cell: string, line: string, lineIndex: number, cellIndex: number): ErrorMessage | null => {\n if (cell !== cell.trim()) {\n return {\n message: 'errors.uploadInput.file.cell.invalid',\n params: {\n line, cell, lineIndex, cellIndex,\n },\n } as ErrorMessage\n }\n return null\n }\n\nexport const validateCSVlines = (lines: string[], numColumns: number, columnDelimiter = ';'): ErrorMessage[] => {\n const errors: ErrorMessage[] = []\n // lines without first line of columns (hence the index + 1 in error message)\n let linesNum = lines.length\n\n // eslint-disable-next-line no-cond-assign\n // eslint-disable-next-line no-plusplus\n while (linesNum--) {\n if (lines[linesNum].trim() === '' || lines[linesNum].split(';').join('').trim() === '') {\n lines.splice(linesNum, 1)\n }\n }\n\n let lineColumns = null\n let errorLineNumColumns = null\n let errorLineCellNotTrimmed = null\n\n lines.forEach((line, index) => {\n lineColumns = line.split(columnDelimiter)\n\n errorLineNumColumns = validateLineNumColumns(lineColumns, numColumns, line, index)\n errorLineNumColumns && errors.push(errorLineNumColumns)\n\n lineColumns.forEach((cell, cellIndex) => {\n errorLineCellNotTrimmed = validateLineCellTrimmed(cell, line, index, cellIndex)\n errorLineCellNotTrimmed && errors.push(errorLineCellNotTrimmed)\n })\n })\n\n return errors\n}\n\n/*\n// maybe add aditional mime types\nhttp://fileformats.archiveteam.org/wiki/CSV\n['text/csv','application/csv', 'text/x-csv',\n'application/x-csv', 'text/x-comma-separated-values', 'text/comma-separated-values']\n*/\n\nexport type ErrorMessage = {\n message: string\n params: Record<string, string | number>\n}\n\nexport const validateCSVFile\n= (file: File, callBack: (errors?: (ErrorMessage | string)[] | null) => void, columnDelimiter = ';'): void => {\n if (!file) {\n callBack(['errors.uploadInput.file.empty'])\n return\n }\n if (fileNameExt(file.name) !== 'csv' || !['text/csv', 'text/plain', 'application/vnd.ms-excel'].includes(file.type)) {\n callBack(['errors.uploadInput.file.invalid'])\n return\n }\n const reader = new FileReader()\n\n reader.readAsText(file)\n reader.onloadend = () => {\n const data = reader.result ? reader.result.toString() : ''\n\n const { numColumns, lines } = parseCSVdata(data, columnDelimiter)\n\n if (numColumns < 2) {\n callBack(['errors.uploadInput.file.numColumns'])\n return\n }\n\n if (lines?.length < 1) {\n callBack(['errors.uploadInput.file.numLines'])\n return\n }\n\n const errors: (ErrorMessage | string)[] = validateCSVlines(lines, numColumns, columnDelimiter)\n\n const flatErrors: string[] = errors.map((errorMsg: ErrorMessage | string) => (\n (errorMsg as ErrorMessage)?.message ? JSON.stringify(errorMsg) : String(errorMsg)))\n\n const errorsArray: string[] = [...new Set(flatErrors)].map((serialized: string) => JSON.parse(serialized))\n\n // callBack && callBack(errorsArray.length ? errorsArray?.splice?.(0, 6) : null)\n callBack && callBack(errorsArray.length ? errorsArray : null)\n }\n\n reader.onerror = (error) => {\n console.error(error)\n }\n}\n\nexport const validateSDFFile\n= (file: File, callBack: (errors?: (ErrorMessage | string)[] | null) => void, columnDelimiter = ';'): void => {\n if (!file) {\n callBack(['errors.uploadInput.file.empty'])\n return\n }\n if (fileNameExt(file.name) !== 'sdf') {\n callBack(['errors.uploadInput.file.invalid'])\n return\n }\n const reader = new FileReader()\n\n reader.readAsText(file)\n reader.onloadend = () => {\n const data = reader.result ? reader.result.toString() : ''\n\n const { lines } = parseCSVdata(data, columnDelimiter)\n\n if (lines?.length < 1) {\n callBack(['errors.uploadInput.file.numLines'])\n return\n }\n\n callBack && callBack(null)\n }\n\n reader.onerror = (error) => {\n console.error(error)\n }\n}\n\nexport const validateJSONFile\n= (file: File, callBack: (errors?: (ErrorMessage | string)[] | null) => void, columnDelimiter = ';'): void => {\n if (!file) {\n callBack(['errors.uploadInput.file.empty'])\n return\n }\n if (fileNameExt(file.name) !== 'json') {\n callBack(['errors.uploadInput.file.invalid'])\n return\n }\n const reader = new FileReader()\n\n reader.readAsText(file)\n reader.onloadend = () => {\n const data = reader.result ? reader.result.toString() : ''\n\n try {\n const parsed = JSON.parse(data)\n\n JSON.stringify(parsed)\n } catch (error) {\n console.error(error)\n callBack(['errors.uploadInput.file.invalid'])\n return\n }\n\n const { lines } = parseCSVdata(data, columnDelimiter)\n\n if (lines?.length < 1) {\n callBack(['errors.uploadInput.file.numLines'])\n return\n }\n\n callBack && callBack(null)\n }\n\n reader.onerror = (error) => {\n console.error(error)\n }\n}\n"],"names":["parseCSVdata","data","columnDelimiter","arguments","length","undefined","lines","split","firstLine","shift","columns","numColumns","validateLineNumColumns","lineColumns","line","index","message","params","validateLineCellTrimmed","cell","lineIndex","cellIndex","trim","validateCSVlines","errors","linesNum","join","splice","errorLineNumColumns","errorLineCellNotTrimmed","forEach","push","file","callBack","fileNameExt","name","includes","type","reader","FileReader","readAsText","onloadend","result","toString","_parseCSVdata","flatErrors","map","errorMsg","JSON","stringify","String","errorsArray","_toConsumableArray","toConsumableArray","Set","serialized","parse","onerror","error","parsed"],"mappings":"yrCAEaA,EAAe,SAACC,GAKxB,IALsCC,EAAeC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IAMvDG,EAAkBL,EAAKM,MAAM,QAE7BD,EAAMF,QAAU,IAClBE,EAAQL,EAAKM,MAAM,OAGrB,IAAMC,EAAoBF,EAAMG,QAC1BC,EAA2BF,EAAYA,EAAUD,MAAML,GAAmB,KAGhF,MAAO,CACLM,UAAAA,EACAF,MAAAA,EACAI,QAAAA,EACAC,WANyBD,EAAUA,EAAQN,OAAS,EAQxD,EAEaQ,EACT,SAACC,EAA4BF,EAAoBG,EAAcC,GAC/D,OAAIF,EAAYT,SAAWO,EAElB,CACLK,QAAS,uCACTC,OAAQ,CAAEH,KAAAA,EAAMC,MAAOA,EAAQ,IAE5B,IACT,EAEWG,EACT,SAACC,EAAcL,EAAcM,EAAmBC,GAChD,OAAIF,IAASA,EAAKG,OACT,CACLN,QAAS,uCACTC,OAAQ,CACNH,KAAAA,EAAMK,KAAAA,EAAMC,UAAAA,EAAWC,UAAAA,IAItB,IACT,EAEWE,EAAmB,SAACjB,EAAiBK,GAOhD,IAP8G,IAA1CT,EAAeC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IAChFqB,EAAyB,GAE3BC,EAAWnB,EAAMF,OAIdqB,KAC0B,KAA3BnB,EAAMmB,GAAUH,QAAgE,KAA/ChB,EAAMmB,GAAUlB,MAAM,KAAKmB,KAAK,IAAIJ,QACvEhB,EAAMqB,OAAOF,EAAU,GAI3B,IAAIZ,EAAc,KACde,EAAsB,KACtBC,EAA0B,KAc9B,OAZAvB,EAAMwB,SAAQ,SAAChB,EAAMC,GACnBF,EAAcC,EAAKP,MAAML,IAEzB0B,EAAsBhB,EAAuBC,EAAaF,EAAYG,EAAMC,KACrDS,EAAOO,KAAKH,GAEnCf,EAAYiB,SAAQ,SAACX,EAAME,IACzBQ,EAA0BX,EAAwBC,EAAML,EAAMC,EAAOM,KAC1CG,EAAOO,KAAKF,EACzC,GACF,IAEOL,CACT,iDAeE,SAACQ,EAAYC,GAA+F,IAAhC/B,EAAeC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IAC9F,GAAK6B,EAIL,GAA+B,QAA3BE,EAAWA,YAACF,EAAKG,OAAoB,CAAC,WAAY,aAAc,4BAA4BC,SAASJ,EAAKK,MAA9G,CAIA,IAAMC,EAAS,IAAIC,WAEnBD,EAAOE,WAAWR,GAClBM,EAAOG,UAAY,WACjB,IAAMxC,EAAOqC,EAAOI,OAASJ,EAAOI,OAAOC,WAAa,GAExDC,EAA8B5C,EAAaC,EAAMC,GAAzCS,EAAUiC,EAAVjC,WAAYL,EAAKsC,EAALtC,MAEpB,GAAIK,EAAa,EACfsB,EAAS,CAAC,4CAIZ,IAAI3B,aAAK,EAALA,EAAOF,QAAS,EAClB6B,EAAS,CAAC,yCADZ,CAKA,IAEMY,EAFoCtB,EAAiBjB,EAAOK,EAAYT,GAE1C4C,KAAI,SAACC,GAA+B,OACrEA,SAAAA,EAA2B/B,QAAUgC,KAAKC,UAAUF,GAAYG,OAAOH,EAAS,IAE7EI,EAAwBC,EAAAC,kBAAI,IAAIC,IAAIT,IAAaC,KAAI,SAACS,GAAkB,OAAKP,KAAKQ,MAAMD,MAG9FtB,GAAYA,EAASkB,EAAY/C,OAAS+C,EAAc,KAVxD,GAaFb,EAAOmB,QAAU,SAACC,IA9BlB,MAFEzB,EAAS,CAAC,yCAJVA,EAAS,CAAC,iCAuCd,sDAkCE,SAACD,EAAYC,GAA+F,IAAhC/B,EAAeC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IAC9F,GAAK6B,EAIL,GAA+B,SAA3BE,cAAYF,EAAKG,MAArB,CAIA,IAAMG,EAAS,IAAIC,WAEnBD,EAAOE,WAAWR,GAClBM,EAAOG,UAAY,WACjB,IAAMxC,EAAOqC,EAAOI,OAASJ,EAAOI,OAAOC,WAAa,GAExD,IACE,IAAMgB,EAASX,KAAKQ,MAAMvD,GAE1B+C,KAAKC,UAAUU,EAChB,CAAC,MAAOD,GAGP,YADAzB,EAAS,CAAC,mCAEZ,CAEA,IAAQ3B,EAAUN,EAAaC,EAAMC,GAA7BI,OAEJA,aAAK,EAALA,EAAOF,QAAS,EAClB6B,EAAS,CAAC,qCAIZA,GAAYA,EAAS,OAGvBK,EAAOmB,QAAU,SAACC,IA3BlB,MAFEzB,EAAS,CAAC,yCAJVA,EAAS,CAAC,iCAoCd,6FArEE,SAACD,EAAYC,GAA+F,IAAhC/B,EAAeC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IAC9F,GAAK6B,EAIL,GAA+B,QAA3BE,cAAYF,EAAKG,MAArB,CAIA,IAAMG,EAAS,IAAIC,WAEnBD,EAAOE,WAAWR,GAClBM,EAAOG,UAAY,WACjB,IAAMxC,EAAOqC,EAAOI,OAASJ,EAAOI,OAAOC,WAAa,GAEhDrC,EAAUN,EAAaC,EAAMC,GAA7BI,OAEJA,aAAK,EAALA,EAAOF,QAAS,EAClB6B,EAAS,CAAC,qCAIZA,GAAYA,EAAS,OAGvBK,EAAOmB,QAAU,SAACC,IAjBlB,MAFEzB,EAAS,CAAC,yCAJVA,EAAS,CAAC,iCA0Bd"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as t}from"../internals/export.js";import{t as r}from"../internals/to-object.js";import{o}from"../internals/object-keys.js";import{f as s}from"../internals/fails.js";var e=r,n=o;t({target:"Object",stat:!0,forced:s((function(){n(1)}))},{keys:function(t){return n(e(t))}});
|
|
2
|
+
//# sourceMappingURL=es.object.keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"es.object.keys.js","sources":["../../../../../../node_modules/core-js/modules/es.object.keys.js"],"sourcesContent":["var $ = require('../internals/export');\nvar toObject = require('../internals/to-object');\nvar nativeKeys = require('../internals/object-keys');\nvar fails = require('../internals/fails');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });\n\n// `Object.keys` method\n// https://tc39.es/ecma262/#sec-object.keys\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {\n keys: function keys(it) {\n return nativeKeys(toObject(it));\n }\n});\n"],"names":["toObject","require$$1","nativeKeys","require$$2","require$$0","target","stat","forced","require$$3","keys","it"],"mappings":"8KAAA,IACIA,EAAWC,EACXC,EAAaC,EAFTC,EASN,CAAEC,OAAQ,SAAUC,MAAM,EAAMC,OANtBC,GAEoB,WAAcN,EAAW,EAAG,KAIK,CAC/DO,KAAM,SAAcC,GAClB,OAAOR,EAAWF,EAASU,GAC5B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{objectWithoutProperties as e,slicedToArray as o,objectSpread2 as r,extends as a}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import"../../../../../node_modules/core-js/modules/es.array.concat.js";import{memo as l,useRef as t,useState as n,useEffect as s,useLayoutEffect as i,useMemo as c}from"react";import{useParseProps as p}from"../../../hooks/useParseProps.js";import
|
|
1
|
+
import{objectWithoutProperties as e,slicedToArray as o,objectSpread2 as r,extends as a}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import"../../../../../node_modules/core-js/modules/es.array.concat.js";import{memo as l,useRef as t,useState as n,useEffect as s,useLayoutEffect as i,useMemo as c}from"react";import{useParseProps as p}from"../../../hooks/useParseProps.js";import u from"./CollapsibleContainer.module.scss.js";var d=["collapsed","collapseHandler","children","horizontal","className"],h={width:"scrollWidth",height:"scrollHeight"},m=l((function(l){var m=l.collapsed,f=void 0!==m&&m,v=l.collapseHandler,j=l.children,x=l.horizontal,b=void 0!==x&&x,g=l.className,P=void 0===g?"":g,w=e(l,d),y=t(null),C=n(0),H=o(C,2),N=H[0],z=H[1],_=p(w),T=_.dataProps,W=_.restProps,k=!b;s((function(){null==v||v(f)}),[v,f]),i((function(){if(null!=y&&y.current){var e=k?"height":"width";setTimeout((function(){z(y.current[h[e]])}),100)}}),[y,k]);var A=c((function(){return r({"--prop-name":k?"height":"width","--prop-max-name":k?"max-height":"max-width","--prop-value":"".concat(N,"px")},W)}),[k,W,N]),B=c((function(){var e=[k?u.vertical:u.horizontal];return f&&N&&null!=N&&e.push(u.collapsed),!f&&N&&null!=N&&e.push(u.expanded),e.join(" ")}),[f,N,k]);return React.createElement("div",a({className:"".concat(u["collapsible-container"]," ").concat(B," ").concat(P," "),ref:y,style:A},T),j)}));m.displayName="CollapsibleContainer";export{m as CollapsibleContainer};
|
|
2
2
|
//# sourceMappingURL=CollapsibleContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleContainer.js","sources":["../../../../../../../../src/core/ui/components/container/CollapsibleContainer.tsx"],"sourcesContent":["import { FC, useRef, useState, memo, ReactNode
|
|
1
|
+
{"version":3,"file":"CollapsibleContainer.js","sources":["../../../../../../../../src/core/ui/components/container/CollapsibleContainer.tsx"],"sourcesContent":["import { FC, useRef, useState, memo, ReactNode,\n useEffect, useLayoutEffect, useMemo, CSSProperties, PropsWithChildren } from 'react'\n\nimport { useParseProps } from '../../../hooks/useParseProps'\n\nimport classes from './CollapsibleContainer.module.scss'\nimport { LayoutBoxProps } from './layoutBox.types'\n\n\nconst elementPropNameMap: Record<string, string> = {\n width: 'scrollWidth',\n height: 'scrollHeight',\n}\n\nexport type CollapsibleContainerProps = PropsWithChildren & LayoutBoxProps & {\n collapsed?: boolean\n collapseHandler?: (collapsed: boolean) => void\n children?: ReactNode\n className?: string\n horizontal?: boolean\n} & CSSProperties\n\nexport const CollapsibleContainer: FC<CollapsibleContainerProps> = memo(({\n collapsed = false, collapseHandler, children, horizontal = false, className = '', ...props\n}: CollapsibleContainerProps) => {\n const containerRef = useRef<HTMLDivElement>(null)\n const [contentProp, setContentProp] = useState(0)\n\n const { dataProps, restProps: style } = useParseProps(props)\n\n const vertical = !horizontal\n\n useEffect(() => {\n collapseHandler?.(collapsed)\n }, [collapseHandler, collapsed])\n\n useLayoutEffect(() => {\n if (containerRef?.current) {\n const propName = vertical ? 'height' : 'width'\n\n // TODO test with requestAnimationFrame\n setTimeout(() => {\n setContentProp((containerRef.current as any)[elementPropNameMap[propName]])\n }, 100)\n }\n }, [containerRef, vertical])\n\n const styleProps: CSSProperties = useMemo(() => ({\n '--prop-name': vertical ? 'height' : 'width',\n '--prop-max-name': vertical ? 'max-height' : 'max-width',\n '--prop-value': `${contentProp}px`,\n ...style,\n } as CSSProperties), [vertical, style, contentProp])\n\n const classNames = useMemo(() => {\n const classNames = [vertical ? classes.vertical : classes.horizontal]\n\n if (collapsed && contentProp && contentProp !== undefined && contentProp !== null) {\n classNames.push(classes.collapsed)\n }\n if (!collapsed && contentProp && contentProp !== undefined && contentProp !== null) {\n classNames.push(classes.expanded)\n }\n return classNames.join(' ')\n }, [collapsed, contentProp, vertical])\n\n return (\n <div\n className={`${classes['collapsible-container']} ${classNames} ${className} `}\n ref={containerRef}\n style={styleProps}\n {...dataProps}\n >\n {children}\n </div>\n )\n})\n\nCollapsibleContainer.displayName = 'CollapsibleContainer'\n"],"names":["elementPropNameMap","width","height","CollapsibleContainer","memo","_ref","_ref$collapsed","collapsed","collapseHandler","children","_ref$horizontal","horizontal","_ref$className","className","props","_objectWithoutProperties","_excluded","containerRef","useRef","_useState","useState","_useState2","_slicedToArray","contentProp","setContentProp","_useParseProps","useParseProps","dataProps","style","restProps","vertical","useEffect","useLayoutEffect","current","propName","setTimeout","styleProps","useMemo","_objectSpread","concat","classNames","classes","push","expanded","join","React","createElement","_extends","ref","displayName"],"mappings":"ggBASMA,EAA6C,CACjDC,MAAO,cACPC,OAAQ,gBAWGC,EAAsDC,GAAK,SAAAC,GAEvC,IAAAC,EAAAD,EAD/BE,UAAAA,OAAY,IAAHD,GAAQA,EAAEE,EAAeH,EAAfG,gBAAiBC,EAAQJ,EAARI,SAAQC,EAAAL,EAAEM,WAAAA,OAAa,IAAHD,GAAQA,EAAAE,EAAAP,EAAEQ,UAAAA,OAAY,IAAHD,EAAG,GAAEA,EAAKE,EAAKC,EAAAV,EAAAW,GAEpFC,EAAeC,EAAuB,MAC5CC,EAAsCC,EAAS,GAAEC,EAAAC,EAAAH,EAAA,GAA1CI,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAElCI,EAAwCC,EAAcZ,GAA9Ca,EAASF,EAATE,UAAsBC,EAAKH,EAAhBI,UAEbC,GAAYnB,EAElBoB,GAAU,WACRvB,SAAAA,EAAkBD,EACpB,GAAG,CAACC,EAAiBD,IAErByB,GAAgB,WACd,GAAIf,SAAAA,EAAcgB,QAAS,CACzB,IAAMC,EAAWJ,EAAW,SAAW,QAGvCK,YAAW,WACTX,EAAgBP,EAAagB,QAAgBjC,EAAmBkC,IACjE,GAAE,IACL,CACF,GAAG,CAACjB,EAAca,IAElB,IAAMM,EAA4BC,GAAQ,WAAA,OAAAC,EAAA,CACxC,cAAeR,EAAW,SAAW,QACrC,kBAAmBA,EAAW,aAAe,YAC7C,eAAc,GAAAS,OAAKhB,EAAW,OAC3BK,EACc,GAAE,CAACE,EAAUF,EAAOL,IAEjCiB,EAAaH,GAAQ,WACzB,IAAMG,EAAa,CAACV,EAAWW,EAAQX,SAAWW,EAAQ9B,YAQ1D,OANIJ,GAAagB,GAAbhB,MAA4BgB,GAC9BiB,EAAWE,KAAKD,EAAQlC,YAErBA,GAAagB,GAAd,MAA6BA,GAC/BiB,EAAWE,KAAKD,EAAQE,UAEnBH,EAAWI,KAAK,IACxB,GAAE,CAACrC,EAAWgB,EAAaO,IAE5B,OACEe,MAAAC,cAAA,MAAAC,EAAA,CACElC,UAAS0B,GAAAA,OAAKE,EAAQ,yBAAwBF,KAAAA,OAAIC,EAAU,KAAAD,OAAI1B,EAAa,KAC7EmC,IAAK/B,EACLW,MAAOQ,GACHT,GAEHlB,EAGP,IAEAN,EAAqB8C,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResizableContainer.js","sources":["../../../../../../../../src/core/ui/components/container/ResizableContainer.tsx"],"sourcesContent":["import { memo, useState, useRef, useMemo, useLayoutEffect, RefObject, PropsWithChildren } from 'react'\nimport debounce from 'lodash-es/debounce'\n\nimport { LayoutBox } from './LayoutBox'\nimport { LayoutBoxProps } from './layoutBox.types'\n\nexport type ResizableContainerProps = LayoutBoxProps & PropsWithChildren<any> & {\n debounceDelay?: number\n}\n\nexport type ResizableContainerRenderProps = {\n width: number | string\n height: number | string\n measured: boolean\n}\n\ntype WrapperSize = {width: undefined | number; height: undefined | number}\n\nconst styles = {\n main: {\n position: 'absolute',\n zIndex: 111,\n left: 0,\n pointerEvents: 'none',\n
|
|
1
|
+
{"version":3,"file":"ResizableContainer.js","sources":["../../../../../../../../src/core/ui/components/container/ResizableContainer.tsx"],"sourcesContent":["import { memo, useState, useRef, useMemo, useLayoutEffect, RefObject, PropsWithChildren } from 'react'\nimport debounce from 'lodash-es/debounce'\n\nimport { LayoutBox } from './LayoutBox'\nimport { LayoutBoxProps } from './layoutBox.types'\n\n\nexport type ResizableContainerProps = LayoutBoxProps & PropsWithChildren<any> & {\n debounceDelay?: number\n}\n\nexport type ResizableContainerRenderProps = {\n width: number | string\n height: number | string\n measured: boolean\n}\n\ntype WrapperSize = {width: undefined | number; height: undefined | number}\n\nconst styles = {\n main: {\n position: 'absolute',\n zIndex: 111,\n left: 0,\n pointerEvents: 'none',\n },\n empty: {\n pointerEvents: 'none',\n },\n}\n\nexport const ResizableContainer = memo<ResizableContainerProps>(\n ({ children, debounceDelay = 250, ...props }: ResizableContainerProps) => {\n const containerRef = useRef<HTMLDivElement>()\n\n const lastResizeWidthRef = useRef<{ width: number; height: number }>({ width: 0, height: 0 })\n\n const [containerSize, setContainerSize]\n = useState<WrapperSize>({ width: undefined, height: undefined })\n\n const debouncedResizeWrapper = useMemo(() => debounce((entries) => {\n const newResizeWidth = entries[0].contentRect.width\n const newResizeHeight = entries[0].contentRect.height\n\n if (lastResizeWidthRef.current?.width === newResizeWidth\n && lastResizeWidthRef.current?.height === newResizeHeight) {\n return\n }\n lastResizeWidthRef.current = { width: newResizeWidth, height: newResizeHeight }\n\n setContainerSize({\n width: containerRef?.current?.clientWidth,\n height: containerRef?.current?.clientHeight,\n })\n }, debounceDelay), [debounceDelay])\n\n useLayoutEffect(() => {\n let resizeObserver: ResizeObserver\n let containerElement: HTMLElement\n\n if (containerRef?.current) {\n containerElement = containerRef?.current\n resizeObserver = new ResizeObserver(debouncedResizeWrapper)\n resizeObserver.observe(containerElement as Element)\n\n setContainerSize({\n width: containerRef?.current?.clientWidth,\n height: containerRef?.current?.clientHeight,\n })\n }\n return () => {\n resizeObserver?.unobserve?.(containerElement as Element)\n }\n }, [debouncedResizeWrapper, containerRef])\n\n // END RESIZING\n\n return (\n <LayoutBox\n width='100%'\n height='100%'\n justify='center'\n align='center'\n direction='column'\n {...props}\n >\n <LayoutBox\n style={styles.main}\n width='100%'\n height='100%'\n ref={containerRef as RefObject<HTMLDivElement>}\n />\n {!children && (\n <LayoutBox\n width={`${Math.max(containerSize?.width || 200, 200) || 200}px`}\n height={`${Math.max(containerSize?.height || 200, 200) || 200}px`}\n style={styles.empty}\n />\n )}\n {children && children?.({\n height: `${containerSize?.height || 200}px`,\n width: `${containerSize?.width || 200}px`,\n measured: !!containerSize?.height,\n } as ResizableContainerRenderProps)}\n </LayoutBox>\n )\n },\n)\n\nResizableContainer.displayName = 'ResizableContainer'\n\n"],"names":["styles","main","position","zIndex","left","pointerEvents","empty","ResizableContainer","memo","_ref","children","_ref$debounceDelay","debounceDelay","props","_objectWithoutProperties","_excluded","containerRef","useRef","lastResizeWidthRef","width","height","_useState","useState","undefined","_useState2","_slicedToArray","containerSize","setContainerSize","debouncedResizeWrapper","useMemo","debounce","entries","_lastResizeWidthRef$c","_lastResizeWidthRef$c2","_containerRef$current","_containerRef$current2","newResizeWidth","contentRect","newResizeHeight","current","clientWidth","clientHeight","useLayoutEffect","resizeObserver","containerElement","_containerRef$current3","_containerRef$current4","ResizeObserver","observe","_resizeObserver","_resizeObserver$unobs","unobserve","call","React","createElement","LayoutBox","_extends","justify","align","direction","style","ref","concat","Math","max","measured","displayName"],"mappings":"uWAmBMA,EAAS,CACbC,KAAM,CACJC,SAAU,WACVC,OAAQ,IACRC,KAAM,EACNC,cAAe,QAEjBC,MAAO,CACLD,cAAe,SAINE,EAAqBC,GAChC,SAAAC,GAA0E,IAAvEC,EAAQD,EAARC,SAAQC,EAAAF,EAAEG,cAAAA,OAAgB,IAAHD,EAAG,IAAGA,EAAKE,EAAKC,EAAAL,EAAAM,GAClCC,EAAeC,IAEfC,EAAqBD,EAA0C,CAAEE,MAAO,EAAGC,OAAQ,IAEzFC,EACEC,EAAsB,CAAEH,WAAOI,EAAWH,YAAQG,IAAYC,EAAAC,EAAAJ,EAAA,GADzDK,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GAGhCI,EAAyBC,GAAQ,WAAA,OAAMC,GAAS,SAACC,GAAY,IAAAC,EAAAC,EAAAC,EAAAC,EAC3DC,EAAiBL,EAAQ,GAAGM,YAAYlB,MACxCmB,EAAkBP,EAAQ,GAAGM,YAAYjB,QAEjBY,QAA1BA,EAAAd,EAAmBqB,eAAnBP,IAA0BA,OAA1BA,EAAAA,EAA4Bb,SAAUiB,IACb,QAA1BH,EAAAf,EAAmBqB,eAAO,IAAAN,OAAA,EAA1BA,EAA4Bb,UAAWkB,IAG1CpB,EAAmBqB,QAAU,CAAEpB,MAAOiB,EAAgBhB,OAAQkB,GAE9DX,EAAiB,CACfR,MAAOH,SAAqBkB,QAATA,EAAZlB,EAAcuB,eAAdL,IAAqBA,SAArBA,EAAuBM,YAC9BpB,OAAQJ,SAAqB,QAATmB,EAAZnB,EAAcuB,eAAO,IAAAJ,SAArBA,EAAuBM,eAElC,GAAE7B,KAAgB,CAACA,IAuBpB,OArBA8B,GAAgB,WACd,IAAIC,EACAC,EAEuBC,EAAAC,EAAvB9B,SAAAA,EAAcuB,UAChBK,EAAmB5B,aAAAA,EAAAA,EAAcuB,SACjCI,EAAiB,IAAII,eAAenB,IACrBoB,QAAQJ,GAEvBjB,EAAiB,CACfR,MAAOH,SAAqB6B,QAATA,EAAZ7B,EAAcuB,eAAdM,IAAqBA,SAArBA,EAAuBL,YAC9BpB,OAAQJ,SAAqB,QAAT8B,EAAZ9B,EAAcuB,eAAO,IAAAO,SAArBA,EAAuBL,gBAGnC,OAAO,WAAM,IAAAQ,EAAAC,EACG,QAAdD,EAAAN,SAAcO,IAAAD,GAAWC,QAAXA,EAAdD,EAAgBE,qBAASD,GAAzBA,EAAAE,KAAAH,EAA4BL,GAEhC,GAAG,CAAChB,EAAwBZ,IAK1BqC,MAAAC,cAACC,EAASC,EAAA,CACRrC,MAAM,OACNC,OAAO,OACPqC,QAAQ,SACRC,MAAM,SACNC,UAAU,UACN9C,GAEJwC,MAAAC,cAACC,EAAS,CACRK,MAAO5D,EAAOC,KACdkB,MAAM,OACNC,OAAO,OACPyC,IAAK7C,KAELN,GACF2C,MAAAC,cAACC,EAAS,CACRpC,MAAK,GAAA2C,OAAKC,KAAKC,KAAItC,eAAAA,EAAeP,QAAS,IAAK,MAAQ,IAAQ,MAChEC,OAAM,GAAA0C,OAAKC,KAAKC,KAAItC,eAAAA,EAAeN,SAAU,IAAK,MAAQ,IAAQ,MAClEwC,MAAO5D,EAAOM,QAGfI,IAAYA,aAAAA,EAAAA,EAAW,CACtBU,OAAM0C,GAAAA,QAAKpC,aAAa,EAAbA,EAAeN,SAAU,IAAO,MAC3CD,MAAK2C,GAAAA,QAAKpC,aAAa,EAAbA,EAAeP,QAAS,IAAO,MACzC8C,WAAYvC,UAAAA,EAAeN,WAInC,IAGFb,EAAmB2D,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DividerLine.js","sources":["../../../../../../../../src/core/ui/components/dividers/DividerLine.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { memo, FC, CSSProperties, useMemo } from 'react'\n\nimport classes from './divider.module.scss'\n\ntype DividerProps = {\n orientation?: string\n margin?: string\n vertical?: boolean\n length?: string\n color?: string\n opacity?: number\n left?: string\n width?: string\n height?: string\n className?: string\n}\n\nexport const DividerLine: FC<DividerProps> = memo<DividerProps>(({\n orientation, vertical,\n color = '#999999',\n opacity,\n length = '80%', left = '0',\n width = '1px', height = '1px',\n margin,\n className = '',\n}: DividerProps) => {\n const isVertical = useMemo(() => orientation === 'vertical' || vertical === true, [orientation, vertical])\n\n const styles = useMemo(() => (\n {\n '--width': width,\n '--height': height,\n '--length': length,\n '--opacity': opacity,\n '--color': color,\n '--left': left,\n '--margin': margin || (isVertical ? 'auto 0' : '0 auto'),\n }\n ), [width, height, length, opacity, color, left, margin, isVertical])\n\n const verHorClass = isVertical ? classes.vertical : classes.horizontal\n\n return (\n <div\n className={`${(classes as any)['divider-line']} ${verHorClass} ${className}`}\n style={styles as CSSProperties}\n />\n )\n})\n\nDividerLine.displayName = 'DividerLine'\n\nexport const DividerVertical: FC<DividerProps>\n = memo((props) => <DividerLine vertical length='100%' {...props} />)\nDividerVertical.displayName = 'DividerVertical'\n\nexport const DividerHorizontal: FC<DividerProps>\n = memo((props) => <DividerLine length='100%' {...props} />)\nDividerHorizontal.displayName = 'DividerHorizontal'\n"],"names":["DividerLine","memo","_ref","orientation","vertical","_ref$color","color","opacity","_ref$length","length","_ref$left","left","_ref$width","width","_ref$height","height","margin","_ref$className","className","isVertical","useMemo","styles","verHorClass","classes","horizontal","React","createElement","concat","style","displayName","DividerVertical","props","_extends","DividerHorizontal"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DividerLine.js","sources":["../../../../../../../../src/core/ui/components/dividers/DividerLine.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { memo, FC, CSSProperties, useMemo } from 'react'\n\nimport classes from './divider.module.scss'\n\n\ntype DividerProps = {\n orientation?: string\n margin?: string\n vertical?: boolean\n length?: string\n color?: string\n opacity?: number\n left?: string\n width?: string\n height?: string\n className?: string\n}\n\nexport const DividerLine: FC<DividerProps> = memo<DividerProps>(({\n orientation, vertical,\n color = '#999999',\n opacity,\n length = '80%', left = '0',\n width = '1px', height = '1px',\n margin,\n className = '',\n}: DividerProps) => {\n const isVertical = useMemo(() => orientation === 'vertical' || vertical === true, [orientation, vertical])\n\n const styles = useMemo(() => (\n {\n '--width': width,\n '--height': height,\n '--length': length,\n '--opacity': opacity,\n '--color': color,\n '--left': left,\n '--margin': margin || (isVertical ? 'auto 0' : '0 auto'),\n }\n ), [width, height, length, opacity, color, left, margin, isVertical])\n\n const verHorClass = isVertical ? classes.vertical : classes.horizontal\n\n return (\n <div\n className={`${(classes as any)['divider-line']} ${verHorClass} ${className}`}\n style={styles as CSSProperties}\n />\n )\n})\n\nDividerLine.displayName = 'DividerLine'\n\nexport const DividerVertical: FC<DividerProps>\n = memo((props) => <DividerLine vertical length='100%' {...props} />)\nDividerVertical.displayName = 'DividerVertical'\n\nexport const DividerHorizontal: FC<DividerProps>\n = memo((props) => <DividerLine length='100%' {...props} />)\nDividerHorizontal.displayName = 'DividerHorizontal'\n"],"names":["DividerLine","memo","_ref","orientation","vertical","_ref$color","color","opacity","_ref$length","length","_ref$left","left","_ref$width","width","_ref$height","height","margin","_ref$className","className","isVertical","useMemo","styles","verHorClass","classes","horizontal","React","createElement","concat","style","displayName","DividerVertical","props","_extends","DividerHorizontal"],"mappings":"4OAmBaA,EAAgCC,GAAmB,SAAAC,GAQ5C,IAPlBC,EAAWD,EAAXC,YAAaC,EAAQF,EAARE,SAAQC,EAAAH,EACrBI,MAAAA,OAAQ,IAAHD,EAAG,UAASA,EACjBE,EAAOL,EAAPK,QAAOC,EAAAN,EACPO,OAAAA,OAAS,IAAHD,EAAG,MAAKA,EAAAE,EAAAR,EAAES,KAAAA,OAAO,IAAHD,EAAG,IAAGA,EAAAE,EAAAV,EAC1BW,MAAAA,OAAQ,IAAHD,EAAG,MAAKA,EAAAE,EAAAZ,EAAEa,OAAAA,OAAS,IAAHD,EAAG,MAAKA,EAC7BE,EAAMd,EAANc,OAAMC,EAAAf,EACNgB,UAAAA,OAAY,IAAHD,EAAG,GAAEA,EAERE,EAAaC,GAAQ,WAAA,MAAsB,aAAhBjB,IAA2C,IAAbC,CAAiB,GAAE,CAACD,EAAaC,IAE1FiB,EAASD,GAAQ,WAAA,MACrB,CACE,UAAWP,EACX,WAAYE,EACZ,WAAYN,EACZ,YAAaF,EACb,UAAWD,EACX,SAAUK,EACV,WAAYK,IAAWG,EAAa,SAAW,UAChD,GACA,CAACN,EAAOE,EAAQN,EAAQF,EAASD,EAAOK,EAAMK,EAAQG,IAEnDG,EAAcH,EAAaI,EAAQnB,SAAWmB,EAAQC,WAE5D,OACEC,MAAAC,cAAA,MAAA,CACER,UAASS,GAAAA,OAAMJ,EAAgB,gBAAeI,KAAAA,OAAIL,EAAW,KAAAK,OAAIT,GACjEU,MAAOP,GAGb,IAEArB,EAAY6B,YAAc,kBAEbC,EACT7B,GAAK,SAAC8B,GAAK,OAAKN,MAAAC,cAAC1B,EAAWgC,EAAA,CAAC5B,UAAQ,EAACK,OAAO,QAAWsB,GAAS,IACrED,EAAgBD,YAAc,sBAEjBI,EACThC,GAAK,SAAC8B,GAAK,OAAKN,MAAAC,cAAC1B,EAAWgC,EAAA,CAACvB,OAAO,QAAWsB,GAAS,IAC5DE,EAAkBJ,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{objectWithoutProperties as
|
|
1
|
+
import{objectWithoutProperties as o,objectSpread2 as e,extends as t}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import"../../../../../node_modules/core-js/modules/es.array.concat.js";import{memo as i,useMemo as n}from"react";import r from"./icon.module.scss.js";var c=["iconUrl","minWidth","minHeight","size","fontSize","width","height","color","className","children","style","onClick"],s=i((function(i){var s=i.iconUrl,a=i.minWidth,l=i.minHeight,m=i.size,u=i.fontSize,h=i.width,d=i.height,p=i.color,f=void 0===p?"currentColor":p,b=i.className,g=void 0===b?"":b,j=i.children,y=i.style,v=i.onClick,w=o(i,c),z=n((function(){return e(e(e(e(e({"--min-width":a||m||h||"auto","--min-height":l||m||d||"auto","--width":m||h||"1rem","--height":m||d||"1rem"},u?{fontSize:u}:{}),s?{"--icon-url":"url(".concat(s,")")}:{}),s?{"--icon-color":f}:{"--icon-content-color":f}),v?{cursor:"pointer"}:{}),y)}),[a,m,h,l,d,u,s,f,v,y]),k=n((function(){return v?{onClick:v,onkeyDown:v,role:"button",tabIndex:-1}:{}}),[v]);return React.createElement("span",t({},w,k,{className:"".concat(r["icon-base"]," icon-base ").concat(g),style:z}),!s&&j&&j)}));s.displayName="IconBase";export{s as IconBase};
|
|
2
2
|
//# sourceMappingURL=IconBase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconBase.js","sources":["../../../../../../../../src/core/ui/components/icon/IconBase.tsx"],"sourcesContent":["import { CSSProperties, memo, useMemo, FC, PropsWithChildren } from 'react'\n\nimport classes from './icon.module.scss'\n\nexport type IconBaseType = PropsWithChildren<unknown> & {\n id?: string\n iconUrl?: string\n minWidth?: string\n minHeight?: string\n width?: string\n height?: string\n size?: string\n fontSize?: string\n color?: string\n className?: string\n style?: CSSProperties\n}\n\nexport const IconBase: FC<IconBaseType> = memo<IconBaseType>(({\n iconUrl, minWidth, minHeight, size,\n fontSize, width, height, color = 'currentColor', className = '', children, style, ...props\n}: IconBaseType) => {\n const styles = useMemo(() => (\n {\n '--min-width': minWidth || size || width || 'auto',\n '--min-height': minHeight || size || height || 'auto',\n '--width': size || width || '1rem',\n '--height': size || height || '1rem',\n ...(fontSize ? { fontSize } : {}),\n ...(iconUrl ? { '--icon-url': `url(${iconUrl})` } : {}),\n ...(iconUrl ? { '--icon-color': color } : { '--icon-content-color': color }),\n ...style,\n }\n ), [minWidth, size, width, minHeight, height, fontSize, iconUrl, color, style])\n\n return (\n <span\n {...props}\n className={`${classes['icon-base']} icon-base ${className}`}\n style={styles as CSSProperties}\n >\n {(!iconUrl && children) && children}\n </span>\n )\n})\n\nIconBase.displayName = 'IconBase'\n"],"names":["IconBase","memo","_ref","iconUrl","minWidth","minHeight","size","fontSize","width","height","_ref$color","color","_ref$className","className","children","style","props","_objectWithoutProperties","_excluded","styles","useMemo","_objectSpread","concat","React","createElement","_extends","classes","displayName"],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconBase.js","sources":["../../../../../../../../src/core/ui/components/icon/IconBase.tsx"],"sourcesContent":["import { CSSProperties, memo, useMemo, FC, PropsWithChildren, MouseEvent } from 'react'\n\nimport classes from './icon.module.scss'\n\nexport type IconBaseType = PropsWithChildren<unknown> & {\n id?: string\n iconUrl?: string\n minWidth?: string\n minHeight?: string\n width?: string\n height?: string\n size?: string\n fontSize?: string\n color?: string\n className?: string\n style?: CSSProperties\n onClick?: (event?: MouseEvent<HTMLSpanElement> | undefined) => void\n}\n\nexport const IconBase: FC<IconBaseType> = memo<IconBaseType>(({\n iconUrl, minWidth, minHeight, size,\n fontSize, width, height, color = 'currentColor', className = '', children, style, onClick, ...props\n}: IconBaseType) => {\n const styles = useMemo(() => (\n {\n '--min-width': minWidth || size || width || 'auto',\n '--min-height': minHeight || size || height || 'auto',\n '--width': size || width || '1rem',\n '--height': size || height || '1rem',\n ...(fontSize ? { fontSize } : {}),\n ...(iconUrl ? { '--icon-url': `url(${iconUrl})` } : {}),\n ...(iconUrl ? { '--icon-color': color } : { '--icon-content-color': color }),\n ...(onClick ? { cursor: 'pointer' } : {}),\n ...style,\n }\n ), [minWidth, size, width, minHeight, height, fontSize, iconUrl, color, onClick, style])\n\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onkeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n return (\n <span\n {...props}\n {...onClickProps}\n className={`${classes['icon-base']} icon-base ${className}`}\n style={styles as CSSProperties}\n >\n {(!iconUrl && children) && children}\n </span>\n )\n})\n\nIconBase.displayName = 'IconBase'\n"],"names":["IconBase","memo","_ref","iconUrl","minWidth","minHeight","size","fontSize","width","height","_ref$color","color","_ref$className","className","children","style","onClick","props","_objectWithoutProperties","_excluded","styles","useMemo","_objectSpread","concat","cursor","onClickProps","onkeyDown","role","tabIndex","React","createElement","_extends","classes","displayName"],"mappings":"kZAmBaA,EAA6BC,GAAmB,SAAAC,GAGzC,IAFlBC,EAAOD,EAAPC,QAASC,EAAQF,EAARE,SAAUC,EAASH,EAATG,UAAWC,EAAIJ,EAAJI,KAC9BC,EAAQL,EAARK,SAAUC,EAAKN,EAALM,MAAOC,EAAMP,EAANO,OAAMC,EAAAR,EAAES,MAAAA,OAAQ,IAAHD,EAAG,eAAcA,EAAAE,EAAAV,EAAEW,UAAAA,OAAY,IAAHD,EAAG,GAAEA,EAAEE,EAAQZ,EAARY,SAAUC,EAAKb,EAALa,MAAOC,EAAOd,EAAPc,QAAYC,EAAKC,EAAAhB,EAAAiB,GAE7FC,EAASC,GAAQ,WAAA,OAAAC,EAAAA,EAAAA,EAAAA,EAAAA,EAAA,CAEnB,cAAelB,GAAYE,GAAQE,GAAS,OAC5C,eAAgBH,GAAaC,GAAQG,GAAU,OAC/C,UAAWH,GAAQE,GAAS,OAC5B,WAAYF,GAAQG,GAAU,QAC1BF,EAAW,CAAEA,SAAAA,GAAa,CAAA,GAC1BJ,EAAU,CAAE,aAAY,OAAAoB,OAASpB,EAAO,MAAQ,CAAA,GAChDA,EAAU,CAAE,eAAgBQ,GAAU,CAAE,uBAAwBA,IAChEK,EAAU,CAAEQ,OAAQ,WAAc,CAAE,GACrCT,EAEN,GAAE,CAACX,EAAUE,EAAME,EAAOH,EAAWI,EAAQF,EAAUJ,EAASQ,EAAOK,EAASD,IAE3EU,EAAeJ,GAAQ,WAAA,OAAOL,EAAW,CAC7CA,QAAAA,EACAU,UAAWV,EACXW,KAAM,SACNC,UAAW,GACR,EAAE,GAAG,CAACZ,IAEX,OACEa,MAAAC,cAAA,OAAAC,EACMd,CAAAA,EAAAA,EACAQ,EAAY,CAChBZ,UAAS,GAAAU,OAAKS,EAAQ,aAAYT,eAAAA,OAAcV,GAChDE,MAAOK,KAEJjB,GAAWW,GAAaA,EAGjC,IAEAd,EAASiC,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{toConsumableArray as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import"../../../../node_modules/core-js/modules/es.regexp.exec.js";import"../../../../node_modules/core-js/modules/es.string.split.js";import"../../../../node_modules/core-js/modules/es.string.trim.js";import"../../../../node_modules/core-js/modules/es.array.splice.js";import"../../../../node_modules/core-js/modules/es.object.to-string.js";import"../../../../node_modules/core-js/modules/web.dom-collections.for-each.js";import"../../../../node_modules/core-js/modules/es.array.includes.js";import"../../../../node_modules/core-js/modules/es.regexp.to-string.js";import"../../../../node_modules/core-js/modules/es.array.map.js";import"../../../../node_modules/core-js/modules/es.array.iterator.js";import"../../../../node_modules/core-js/modules/es.set.constructor.js";import"../../../../node_modules/core-js/modules/es.string.iterator.js";import"../../../../node_modules/core-js/modules/web.dom-collections.iterator.js";import{fileNameExt as r}from"./textValueOperations.js";var
|
|
1
|
+
import{toConsumableArray as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import"../../../../node_modules/core-js/modules/es.regexp.exec.js";import"../../../../node_modules/core-js/modules/es.string.split.js";import"../../../../node_modules/core-js/modules/es.string.trim.js";import"../../../../node_modules/core-js/modules/es.array.splice.js";import"../../../../node_modules/core-js/modules/es.object.to-string.js";import"../../../../node_modules/core-js/modules/web.dom-collections.for-each.js";import"../../../../node_modules/core-js/modules/es.array.includes.js";import"../../../../node_modules/core-js/modules/es.regexp.to-string.js";import"../../../../node_modules/core-js/modules/es.array.map.js";import"../../../../node_modules/core-js/modules/es.array.iterator.js";import"../../../../node_modules/core-js/modules/es.set.constructor.js";import"../../../../node_modules/core-js/modules/es.string.iterator.js";import"../../../../node_modules/core-js/modules/web.dom-collections.iterator.js";import"../../../../node_modules/core-js/modules/es.object.keys.js";import{fileNameExt as r}from"./textValueOperations.js";var o=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:";",o=e.split("\r\n");o.length<=1&&(o=e.split("\n"));var n=o.shift(),l=n?n.split(r):null;return{firstLine:n,lines:o,columns:l,numColumns:l?l.length:0}},n=function(e,r,o,n){return e.length!==r?{message:"errors.uploadInput.file.line.invalid",params:{line:o,index:n+1}}:null},l=function(e,r,o,n){return e!==e.trim()?{message:"errors.uploadInput.file.cell.invalid",params:{line:r,cell:e,lineIndex:o,cellIndex:n}}:null},s=function(e,r){for(var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:";",s=[],t=e.length;t--;)""!==e[t].trim()&&""!==e[t].split(";").join("").trim()||e.splice(t,1);var i=null,u=null,d=null;return e.forEach((function(e,t){i=e.split(o),(u=n(i,r,e,t))&&s.push(u),i.forEach((function(r,o){(d=l(r,e,t,o))&&s.push(d)}))})),s},t=function(n,l){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:";";if(n)if("csv"===r(n.name)&&["text/csv","text/plain","application/vnd.ms-excel"].includes(n.type)){var i=new FileReader;i.readAsText(n),i.onloadend=function(){var r=i.result?i.result.toString():"",n=o(r,t),u=n.numColumns,d=n.lines;if(u<2)l(["errors.uploadInput.file.numColumns"]);else if((null==d?void 0:d.length)<1)l(["errors.uploadInput.file.numLines"]);else{var a=s(d,u,t).map((function(e){return null!=e&&e.message?JSON.stringify(e):String(e)})),m=e(new Set(a)).map((function(e){return JSON.parse(e)}));l&&l(m.length?m:null)}},i.onerror=function(e){}}else l(["errors.uploadInput.file.invalid"]);else l(["errors.uploadInput.file.empty"])},i=function(e,n){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:";";if(e)if("sdf"===r(e.name)){var s=new FileReader;s.readAsText(e),s.onloadend=function(){var e=s.result?s.result.toString():"",r=o(e,l).lines;(null==r?void 0:r.length)<1?n(["errors.uploadInput.file.numLines"]):n&&n(null)},s.onerror=function(e){}}else n(["errors.uploadInput.file.invalid"]);else n(["errors.uploadInput.file.empty"])},u=function(e,n){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:";";if(e)if("json"===r(e.name)){var s=new FileReader;s.readAsText(e),s.onloadend=function(){var e=s.result?s.result.toString():"";try{var r=JSON.parse(e);JSON.stringify(r)}catch(e){return void n(["errors.uploadInput.file.invalid"])}var t=o(e,l).lines;(null==t?void 0:t.length)<1?n(["errors.uploadInput.file.numLines"]):n&&n(null)},s.onerror=function(e){}}else n(["errors.uploadInput.file.invalid"]);else n(["errors.uploadInput.file.empty"])};export{o as parseCSVdata,t as validateCSVFile,s as validateCSVlines,u as validateJSONFile,l as validateLineCellTrimmed,n as validateLineNumColumns,i as validateSDFFile};
|
|
2
2
|
//# sourceMappingURL=fileValidator.js.map
|