@e1011/es-kit 1.0.198 → 1.0.202

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.
@@ -22,6 +22,36 @@
22
22
  min-height: 0;
23
23
  border-radius: initial;
24
24
  }
25
+ .icon-module_icon-base-parent__nOMvW {
26
+ line-height: 1px !important;
27
+ }
28
+
29
+ .icon-module_icon-base__S0tHf {
30
+ min-width: var(--min-width);
31
+ min-height: var(--min-height);
32
+ width: var(--width) !important;
33
+ height: var(--height) !important;
34
+ line-height: 1px !important;
35
+ background-color: var(--icon-color);
36
+ color: var(--icon-content-color);
37
+ background-repeat: no-repeat;
38
+ mask-image: var(--icon-url);
39
+ -webkit-mask-image: var(--icon-url);
40
+ mask-repeat: no-repeat;
41
+ -webkit-mask-repeat: no-repeat;
42
+ mask-size: contain;
43
+ -webkit-mask-size: contain;
44
+ mask-position: center;
45
+ -webkit-mask-position: center;
46
+ display: inline-block;
47
+ will-change: transform;
48
+ transform: translate3d(0, 0, 0);
49
+ }
50
+ .icon-module_icon-base__S0tHf svg {
51
+ fill: var(--icon-content-color);
52
+ width: var(--height);
53
+ height: var(--width);
54
+ }
25
55
  .CollapsibleContainer-module_collapsible-container__u0Jmm {
26
56
  transform-origin: 0% 0%;
27
57
  opacity: 0;
@@ -55,36 +85,6 @@
55
85
  max-width: var(--prop-value);
56
86
  opacity: 1;
57
87
  }
58
- .icon-module_icon-base-parent__nOMvW {
59
- line-height: 1px !important;
60
- }
61
-
62
- .icon-module_icon-base__S0tHf {
63
- min-width: var(--min-width);
64
- min-height: var(--min-height);
65
- width: var(--width) !important;
66
- height: var(--height) !important;
67
- line-height: 1px !important;
68
- background-color: var(--icon-color);
69
- color: var(--icon-content-color);
70
- background-repeat: no-repeat;
71
- mask-image: var(--icon-url);
72
- -webkit-mask-image: var(--icon-url);
73
- mask-repeat: no-repeat;
74
- -webkit-mask-repeat: no-repeat;
75
- mask-size: contain;
76
- -webkit-mask-size: contain;
77
- mask-position: center;
78
- -webkit-mask-position: center;
79
- display: inline-block;
80
- will-change: transform;
81
- transform: translate3d(0, 0, 0);
82
- }
83
- .icon-module_icon-base__S0tHf svg {
84
- fill: var(--icon-content-color);
85
- width: var(--height);
86
- height: var(--width);
87
- }
88
88
  .divider-module_divider-line__6CesR {
89
89
  position: relative;
90
90
  display: block;
@@ -22,6 +22,36 @@
22
22
  min-height: 0;
23
23
  border-radius: initial;
24
24
  }
25
+ .icon-module_icon-base-parent__nOMvW {
26
+ line-height: 1px !important;
27
+ }
28
+
29
+ .icon-module_icon-base__S0tHf {
30
+ min-width: var(--min-width);
31
+ min-height: var(--min-height);
32
+ width: var(--width) !important;
33
+ height: var(--height) !important;
34
+ line-height: 1px !important;
35
+ background-color: var(--icon-color);
36
+ color: var(--icon-content-color);
37
+ background-repeat: no-repeat;
38
+ mask-image: var(--icon-url);
39
+ -webkit-mask-image: var(--icon-url);
40
+ mask-repeat: no-repeat;
41
+ -webkit-mask-repeat: no-repeat;
42
+ mask-size: contain;
43
+ -webkit-mask-size: contain;
44
+ mask-position: center;
45
+ -webkit-mask-position: center;
46
+ display: inline-block;
47
+ will-change: transform;
48
+ transform: translate3d(0, 0, 0);
49
+ }
50
+ .icon-module_icon-base__S0tHf svg {
51
+ fill: var(--icon-content-color);
52
+ width: var(--height);
53
+ height: var(--width);
54
+ }
25
55
  .CollapsibleContainer-module_collapsible-container__u0Jmm {
26
56
  transform-origin: 0% 0%;
27
57
  opacity: 0;
@@ -55,36 +85,6 @@
55
85
  max-width: var(--prop-value);
56
86
  opacity: 1;
57
87
  }
58
- .icon-module_icon-base-parent__nOMvW {
59
- line-height: 1px !important;
60
- }
61
-
62
- .icon-module_icon-base__S0tHf {
63
- min-width: var(--min-width);
64
- min-height: var(--min-height);
65
- width: var(--width) !important;
66
- height: var(--height) !important;
67
- line-height: 1px !important;
68
- background-color: var(--icon-color);
69
- color: var(--icon-content-color);
70
- background-repeat: no-repeat;
71
- mask-image: var(--icon-url);
72
- -webkit-mask-image: var(--icon-url);
73
- mask-repeat: no-repeat;
74
- -webkit-mask-repeat: no-repeat;
75
- mask-size: contain;
76
- -webkit-mask-size: contain;
77
- mask-position: center;
78
- -webkit-mask-position: center;
79
- display: inline-block;
80
- will-change: transform;
81
- transform: translate3d(0, 0, 0);
82
- }
83
- .icon-module_icon-base__S0tHf svg {
84
- fill: var(--icon-content-color);
85
- width: var(--height);
86
- height: var(--width);
87
- }
88
88
  .divider-module_divider-line__6CesR {
89
89
  position: relative;
90
90
  display: block;
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react"),t=require("styled-components");const i={start:"flex-start","flex-start":"flex-start",end:"flex-end","flex-end":"flex-end"},r=e=>e&&i[e]||e,l=e.memo(t.div.withConfig({displayName:"Flex",componentId:"sc-19vq3db-0"})(["display:flex;position:relative;flex-direction:",";flex:",";flex-grow:",";flex-shrink:",";flex-basis:",";flex-wrap:",";gap:",";text-align:",";justify-content:",";align-items:",";align-self:",";margin:",";padding:",";width:",";height:",";max-width:",";max-height:",";min-width:",";min-height:",";border-radius:",";"],(e=>{let{direction:t}=e;return t||"row"}),(e=>{let{flex:t}=e;return void 0!==t?t:"0"}),(e=>{let{flexGrow:t}=e;return void 0!==t?t:"0"}),(e=>{let{flexShrink:t}=e;return void 0!==t?t:"0"}),(e=>{let{flexBasis:t}=e;return t||"auto"}),(e=>{let{flexWrap:t}=e;return t||"nowrap"}),(e=>{let{gap:t}=e;return void 0!==t?t:"0"}),(e=>{let{alignText:t}=e;return t||"left"}),(e=>{let{justify:t}=e;return r(t)||"flex-start"}),(e=>{let{align:t}=e;return r(t)||"flex-start"}),(e=>{let{alignSelf:t}=e;return t||"auto"}),(e=>{let{margin:t}=e;return t||"0"}),(e=>{let{padding:t}=e;return t||"0"}),(e=>{let{width:t}=e;return t||"auto"}),(e=>{let{height:t}=e;return t||"auto"}),(e=>{let{maxWidth:t}=e;return t||"none"}),(e=>{let{maxHeight:t}=e;return t||"none"}),(e=>{let{minWidth:t}=e;return t||"0"===t?t:"0"}),(e=>{let{minHeight:t}=e;return t||"0"}),(e=>{let{borderRadius:t}=e;return t||"initial"}))),n=e.memo(t(l).attrs((e=>({width:e.width||"100%",height:e.height||"100%",justify:e.justify||"center",align:e.align||"center",...e}))).withConfig({displayName:"Flex__FlexWrapper",componentId:"sc-19vq3db-1"})([""])),a=e.memo(t(l).attrs((e=>({width:"initial",...e}))).withConfig({displayName:"Flex__FlexTight",componentId:"sc-19vq3db-2"})([""])),d=e.memo(t(l).attrs((e=>({width:"initial",style:{text:"blue",padding:"1rem",border:"1px solid green"},...e}))).withConfig({displayName:"Flex__FlexTightStyled",componentId:"sc-19vq3db-3"})([""]));exports.Flex=l,exports.FlexTight=a,exports.FlexTightStyled=d,exports.FlexWrapper=n;
1
+ "use strict";var e=require("react");function t(e){return e&&e.__esModule?e:{default:e}}var r=t(require("styled-components"));const i={start:"flex-start","flex-start":"flex-start",end:"flex-end","flex-end":"flex-end"},l=e=>e&&i[e]||e,n=e.memo(r.default.div.withConfig({displayName:"Flex",componentId:"sc-19vq3db-0"})(["display:flex;position:relative;flex-direction:",";flex:",";flex-grow:",";flex-shrink:",";flex-basis:",";flex-wrap:",";gap:",";text-align:",";justify-content:",";align-items:",";align-self:",";margin:",";padding:",";width:",";height:",";max-width:",";max-height:",";min-width:",";min-height:",";border-radius:",";"],(e=>{let{direction:t}=e;return t||"row"}),(e=>{let{flex:t}=e;return void 0!==t?t:"0"}),(e=>{let{flexGrow:t}=e;return void 0!==t?t:"0"}),(e=>{let{flexShrink:t}=e;return void 0!==t?t:"0"}),(e=>{let{flexBasis:t}=e;return t||"auto"}),(e=>{let{flexWrap:t}=e;return t||"nowrap"}),(e=>{let{gap:t}=e;return void 0!==t?t:"0"}),(e=>{let{alignText:t}=e;return t||"left"}),(e=>{let{justify:t}=e;return l(t)||"flex-start"}),(e=>{let{align:t}=e;return l(t)||"flex-start"}),(e=>{let{alignSelf:t}=e;return t||"auto"}),(e=>{let{margin:t}=e;return t||"0"}),(e=>{let{padding:t}=e;return t||"0"}),(e=>{let{width:t}=e;return t||"auto"}),(e=>{let{height:t}=e;return t||"auto"}),(e=>{let{maxWidth:t}=e;return t||"none"}),(e=>{let{maxHeight:t}=e;return t||"none"}),(e=>{let{minWidth:t}=e;return t||"0"===t?t:"0"}),(e=>{let{minHeight:t}=e;return t||"0"}),(e=>{let{borderRadius:t}=e;return t||"initial"}))),a=e.memo(r.default(n).attrs((e=>({width:e.width||"100%",height:e.height||"100%",justify:e.justify||"center",align:e.align||"center",...e}))).withConfig({displayName:"Flex__FlexWrapper",componentId:"sc-19vq3db-1"})([""])),d=e.memo(r.default(n).attrs((e=>({width:"initial",...e}))).withConfig({displayName:"Flex__FlexTight",componentId:"sc-19vq3db-2"})([""])),o=e.memo(r.default(n).attrs((e=>({width:"initial",style:{text:"blue",padding:"1rem",border:"1px solid green"},...e}))).withConfig({displayName:"Flex__FlexTightStyled",componentId:"sc-19vq3db-3"})([""]));exports.Flex=n,exports.FlexTight=d,exports.FlexTightStyled=o,exports.FlexWrapper=a;
2
2
  //# sourceMappingURL=Flex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.js","sources":["../../../../../../../../src/core/ui/components/container/Flex.ts"],"sourcesContent":["import { memo } from 'react'\nimport styled from 'styled-components'\n\nexport type FlexProps = {\n flex?: string\n flexGrow?: string | number\n alignText?: 'center' | 'right' | 'left'\n direction?: string\n flexShrink?: string | number\n flexBasis?: string\n flexWrap?: string\n justify?: string\n align?: string\n alignSelf?: string\n margin?: string\n padding?: string\n width?: string\n height?: string\n maxWidth?: string\n maxHeight?: string\n minWidth?: string\n minHeight?: string\n gap?: string\n css?: string\n borderRadius?: string\n}\n\nconst flexValueMap: Record<string, string> = {\n start: 'flex-start',\n 'flex-start': 'flex-start',\n end: 'flex-end',\n 'flex-end': 'flex-end',\n}\n\nconst resolveFlexProps = (value?: string): string | undefined => (value ? (flexValueMap[value] || value) : value)\n\nexport const Flex = memo(styled.div<FlexProps>`\n display: flex;\n position: relative;\n flex-direction: ${({ direction }: Partial<FlexProps>) => direction || 'row'};\n flex: ${({ flex }: Partial<FlexProps>) => (flex !== undefined ? flex : '0')};\n flex-grow: ${({ flexGrow }: Partial<FlexProps>) => (flexGrow !== undefined ? flexGrow : '0')};\n flex-shrink: ${({ flexShrink }: Partial<FlexProps>) => (flexShrink !== undefined ? flexShrink : '0')};\n flex-basis: ${({ flexBasis }: Partial<FlexProps>) => flexBasis || 'auto'};\n flex-wrap: ${({ flexWrap }: Partial<FlexProps>) => flexWrap || 'nowrap'};\n gap: ${({ gap }: Partial<FlexProps>) => (gap !== undefined ? gap : '0')};\n text-align: ${({ alignText }: Partial<FlexProps>) => alignText || 'left'};\n justify-content: ${({ justify }: Partial<FlexProps>) => resolveFlexProps(justify) || 'flex-start'};\n align-items: ${({ align }: Partial<FlexProps>) => resolveFlexProps(align) || 'flex-start'};\n align-self: ${({ alignSelf }: Partial<FlexProps>) => alignSelf || 'auto'};\n margin: ${({ margin }: Partial<FlexProps>) => margin || '0'};\n padding: ${({ padding }: Partial<FlexProps>) => padding || '0'};\n width: ${({ width }: Partial<FlexProps>) => width || 'auto'};\n height: ${({ height }: Partial<FlexProps>) => height || 'auto'};\n max-width: ${({ maxWidth }: Partial<FlexProps>) => maxWidth || 'none'};\n max-height: ${({ maxHeight }: Partial<FlexProps>) => maxHeight || 'none'};\n min-width: ${({ minWidth }: Partial<FlexProps>) => ((minWidth || minWidth === '0') ? minWidth : '0')};\n min-height: ${({ minHeight }: Partial<FlexProps>) => minHeight || '0'};\n border-radius: ${({ borderRadius }: Partial<FlexProps>) => borderRadius || 'initial'};\n`)\n\n// default flex centralized, 100% width and height\nexport const FlexWrapper = memo(styled(Flex).attrs((props: Partial<FlexProps>) => (\n {\n width: props.width || '100%',\n height: props.height || '100%',\n justify: props.justify || 'center',\n align: props.align || 'center',\n ...props,\n }\n))``)\n\nexport const FlexTight = memo(styled(Flex).attrs((props: Partial<FlexProps>) => ({\n width: 'initial',\n ...props,\n}))``)\n\nexport const FlexTightStyled = memo(styled(Flex).attrs((props: Partial<FlexProps>) => ({\n width: 'initial',\n style: {\n text: 'blue',\n padding: '1rem',\n border: '1px solid green',\n },\n ...props,\n}))``)\n"],"names":["flexValueMap","start","end","resolveFlexProps","value","Flex","memo","styled","div","withConfig","displayName","componentId","_ref","direction","_ref2","flex","undefined","_ref3","flexGrow","_ref4","flexShrink","_ref5","flexBasis","_ref6","flexWrap","_ref7","gap","_ref8","alignText","_ref9","justify","_ref10","align","_ref11","alignSelf","_ref12","margin","_ref13","padding","_ref14","width","_ref15","height","_ref16","maxWidth","_ref17","maxHeight","_ref18","minWidth","_ref19","minHeight","_ref20","borderRadius","FlexWrapper","attrs","props","FlexTight","FlexTightStyled","style","text","border"],"mappings":"mEA2BA,MAAMA,EAAuC,CAC3CC,MAAO,aACP,aAAc,aACdC,IAAK,WACL,WAAY,YAGRC,EAAoBC,GAAwCA,GAASJ,EAAaI,IAAmBA,EAE9FC,EAAOC,EAAIA,KAACC,EAAOC,IAAGC,WAAA,CAAAC,YAAA,OAAAC,YAAA,gBAAVJ,CAAU,CAAA,iDAAA,SAAA,cAAA,gBAAA,eAAA,cAAA,QAAA,eAAA,oBAAA,gBAAA,eAAA,WAAA,YAAA,UAAA,WAAA,cAAA,eAAA,cAAA,eAAA,kBAAA,MAGfK,IAAA,IAACC,UAAEA,GAA+BD,EAAA,OAAKC,GAAa,KAAK,IACnEC,IAAA,IAACC,KAAEA,GAA0BD,EAAA,YAAeE,IAATD,EAAqBA,EAAO,GAAG,IAC7DE,IAAA,IAACC,SAAEA,GAA8BD,EAAA,YAAmBD,IAAbE,EAAyBA,EAAW,GAAG,IAC5EC,IAAA,IAACC,WAAEA,GAAgCD,EAAA,YAAqBH,IAAfI,EAA2BA,EAAa,GAAG,IACrFC,IAAA,IAACC,UAAEA,GAA+BD,EAAA,OAAKC,GAAa,MAAM,IAC3DC,IAAA,IAACC,SAAEA,GAA8BD,EAAA,OAAKC,GAAY,QAA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AO,aACJe,MACF9C,WAAA,CAAAC,YAAA,kBAAAC,YAAA,gBAH2BJ,CAG3B,CAAA,MAEUkD,EAAkBnD,EAAIA,KAACC,EAAOF,GAAMiD,OAAOC,IAA+B,CACrFf,MAAO,UACPkB,MAAO,CACLC,KAAM,OACNrB,QAAS,OACTsB,OAAQ,sBAEPL,MACF9C,WAAA,CAAAC,YAAA,wBAAAC,YAAA,gBARiCJ,CAQjC,CAAA"}
1
+ {"version":3,"file":"Flex.js","sources":["../../../../../../../../src/core/ui/components/container/Flex.ts"],"sourcesContent":["import { memo } from 'react'\nimport styled from 'styled-components'\n\nexport type FlexProps = {\n flex?: string\n flexGrow?: string | number\n alignText?: 'center' | 'right' | 'left'\n direction?: string\n flexShrink?: string | number\n flexBasis?: string\n flexWrap?: string\n justify?: string\n align?: string\n alignSelf?: string\n margin?: string\n padding?: string\n width?: string\n height?: string\n maxWidth?: string\n maxHeight?: string\n minWidth?: string\n minHeight?: string\n gap?: string\n css?: string\n borderRadius?: string\n}\n\nconst flexValueMap: Record<string, string> = {\n start: 'flex-start',\n 'flex-start': 'flex-start',\n end: 'flex-end',\n 'flex-end': 'flex-end',\n}\n\nconst resolveFlexProps = (value?: string): string | undefined => (value ? (flexValueMap[value] || value) : value)\n\nexport const Flex = memo(styled.div<FlexProps>`\n display: flex;\n position: relative;\n flex-direction: ${({ direction }: Partial<FlexProps>) => direction || 'row'};\n flex: ${({ flex }: Partial<FlexProps>) => (flex !== undefined ? flex : '0')};\n flex-grow: ${({ flexGrow }: Partial<FlexProps>) => (flexGrow !== undefined ? flexGrow : '0')};\n flex-shrink: ${({ flexShrink }: Partial<FlexProps>) => (flexShrink !== undefined ? flexShrink : '0')};\n flex-basis: ${({ flexBasis }: Partial<FlexProps>) => flexBasis || 'auto'};\n flex-wrap: ${({ flexWrap }: Partial<FlexProps>) => flexWrap || 'nowrap'};\n gap: ${({ gap }: Partial<FlexProps>) => (gap !== undefined ? gap : '0')};\n text-align: ${({ alignText }: Partial<FlexProps>) => alignText || 'left'};\n justify-content: ${({ justify }: Partial<FlexProps>) => resolveFlexProps(justify) || 'flex-start'};\n align-items: ${({ align }: Partial<FlexProps>) => resolveFlexProps(align) || 'flex-start'};\n align-self: ${({ alignSelf }: Partial<FlexProps>) => alignSelf || 'auto'};\n margin: ${({ margin }: Partial<FlexProps>) => margin || '0'};\n padding: ${({ padding }: Partial<FlexProps>) => padding || '0'};\n width: ${({ width }: Partial<FlexProps>) => width || 'auto'};\n height: ${({ height }: Partial<FlexProps>) => height || 'auto'};\n max-width: ${({ maxWidth }: Partial<FlexProps>) => maxWidth || 'none'};\n max-height: ${({ maxHeight }: Partial<FlexProps>) => maxHeight || 'none'};\n min-width: ${({ minWidth }: Partial<FlexProps>) => ((minWidth || minWidth === '0') ? minWidth : '0')};\n min-height: ${({ minHeight }: Partial<FlexProps>) => minHeight || '0'};\n border-radius: ${({ borderRadius }: Partial<FlexProps>) => borderRadius || 'initial'};\n`)\n\n// default flex centralized, 100% width and height\nexport const FlexWrapper = memo(styled(Flex).attrs((props: Partial<FlexProps>) => (\n {\n width: props.width || '100%',\n height: props.height || '100%',\n justify: props.justify || 'center',\n align: props.align || 'center',\n ...props,\n }\n))``)\n\nexport const FlexTight = memo(styled(Flex).attrs((props: Partial<FlexProps>) => ({\n width: 'initial',\n ...props,\n}))``)\n\nexport const FlexTightStyled = memo(styled(Flex).attrs((props: Partial<FlexProps>) => ({\n width: 'initial',\n style: {\n text: 'blue',\n padding: '1rem',\n border: '1px solid green',\n },\n ...props,\n}))``)\n"],"names":["flexValueMap","start","end","resolveFlexProps","value","Flex","memo","styled","div","withConfig","displayName","componentId","_ref","direction","_ref2","flex","undefined","_ref3","flexGrow","_ref4","flexShrink","_ref5","flexBasis","_ref6","flexWrap","_ref7","gap","_ref8","alignText","_ref9","justify","_ref10","align","_ref11","alignSelf","_ref12","margin","_ref13","padding","_ref14","width","_ref15","height","_ref16","maxWidth","_ref17","maxHeight","_ref18","minWidth","_ref19","minHeight","_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IAACC,QAAEA,GAA6BD,EAAA,OAAKC,GAAW,GAAG,IACrDC,IAAA,IAACC,MAAEA,GAA2BD,EAAA,OAAKC,GAAS,MAAM,IACjDC,IAAA,IAACC,OAAEA,GAA4BD,EAAA,OAAKC,GAAU,MAAM,IACjDC,IAAA,IAACC,SAAEA,GAA8BD,EAAA,OAAKC,GAAY,MAAM,IACvDC,IAAA,IAACC,UAAEA,GAA+BD,EAAA,OAAKC,GAAa,MAAM,IAC3DC,IAAA,IAACC,SAAEA,GAA8BD,EAAA,OAAOC,GAAyB,MAAbA,EAAoBA,EAAW,GAAG,IACrFC,IAAA,IAACC,UAAEA,GAA+BD,EAAA,OAAKC,GAAa,GAAG,IACpDC,IAAA,IAACC,aAAEA,GAAkCD,EAAA,OAAKC,GAAgB,SAAS,KAIzEC,EAAc/C,EAAIA,KAACC,EAAM+C,QAACjD,GAAMkD,OAAOC,IAClD,CACEhB,MAAOgB,EAAMhB,OAAS,OACtBE,OAAQc,EAAMd,QAAU,OACxBZ,QAAS0B,EAAM1B,SAAW,SAC1BE,MAAOwB,EAAMxB,OAAS,YACnBwB,MAEL/C,WAAA,CAAAC,YAAA,oBAAAC,YAAA,gBAR8BJ,CAQ9B,CAAA,MAEWkD,EAAYnD,EAAIA,KAACC,EAAM+C,QAACjD,GAAMkD,OAAOC,IAA+B,CAC/EhB,MAAO,aACJgB,MACF/C,WAAA,CAAAC,YAAA,kBAAAC,YAAA,gBAH2BJ,CAG3B,CAAA,MAEUmD,EAAkBpD,EAAIA,KAACC,EAAM+C,QAACjD,GAAMkD,OAAOC,IAA+B,CACrFhB,MAAO,UACPmB,MAAO,CACLC,KAAM,OACNtB,QAAS,OACTuB,OAAQ,sBAEPL,MACF/C,WAAA,CAAAC,YAAA,wBAAAC,YAAA,gBARiCJ,CAQjC,CAAA"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),r=require("styled-components"),l=require("react"),s=require("./Flex.js");const c=l.memo((r=>{let{title:l,border:s,background:c,onClick:t,cssProp:a,children:n,...i}=r;return React.createElement(o,e.extends({onClick:t},i,{$_css:s||"border: 1px solid #999999;",$_css2:c||"background-color: rgba(0, 120, 255, 0.2);",$_css3:a}),l&&React.createElement("h2",null,l),n&&n)}));c.displayName="Placeholder";var o=r(s.FlexWrapper).withConfig({displayName:"Placeholder___StyledFlexWrapper",componentId:"sc-ozx0bx-0"})([""," "," ",""],(e=>e.$_css),(e=>e.$_css2),(e=>e.$_css3));exports.Placeholder=c;
1
+ "use strict";var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),r=require("styled-components"),l=require("react"),s=require("./Flex.js");function c(e){return e&&e.__esModule?e:{default:e}}var t=c(r);const o=l.memo((r=>{let{title:l,border:s,background:c,onClick:t,cssProp:o,children:n,...d}=r;return React.createElement(a,e.extends({onClick:t},d,{$_css:s||"border: 1px solid #999999;",$_css2:c||"background-color: rgba(0, 120, 255, 0.2);",$_css3:o}),l&&React.createElement("h2",null,l),n&&n)}));o.displayName="Placeholder";var a=t.default(s.FlexWrapper).withConfig({displayName:"Placeholder___StyledFlexWrapper",componentId:"sc-ozx0bx-0"})([""," "," ",""],(e=>e.$_css),(e=>e.$_css2),(e=>e.$_css3));exports.Placeholder=o;
2
2
  //# sourceMappingURL=Placeholder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Placeholder.js","sources":["../../../../../../../../src/core/ui/components/container/Placeholder.tsx"],"sourcesContent":["import { FC, memo, PropsWithChildren } from 'react'\n\nimport { FlexWrapper, FlexProps } from './Flex'\n\nexport type PlaceholderProps = FlexProps & PropsWithChildren<unknown> & {\n title?: string\n cssProp?: string\n background?: string\n border?: string\n onClick?: () => void\n}\n\nexport const Placeholder: FC<PlaceholderProps>\n= memo<PlaceholderProps>(({ title, border, background, onClick, cssProp, children, ...props }: PlaceholderProps) => (\n <FlexWrapper\n css={`\n ${border || 'border: 1px solid #999999;'}\n ${background || 'background-color: rgba(0, 120, 255, 0.2);'}\n ${cssProp}\n `}\n onClick={onClick}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n >\n {title && (<h2>{title}</h2>)}\n {children && children}\n </FlexWrapper>\n))\n\nPlaceholder.displayName = 'Placeholder'\n"],"names":["Placeholder","memo","_ref","title","border","background","onClick","cssProp","children","props","React","createElement","_StyledFlexWrapper","_extends","$_css","$_css2","$_css3","displayName","_styled","FlexWrapper","withConfig","componentId","p"],"mappings":"4JAYaA,MAAAA,EACXC,EAAIA,MAAmBC,IAAA,IAACC,MAAEA,EAAKC,OAAEA,EAAMC,WAAEA,EAAUC,QAAEA,EAAOC,QAAEA,EAAOC,SAAEA,KAAaC,GAAyBP,EAAA,OAC7GQ,MAAAC,cAAAC,EAAAC,UAAA,CAMEP,QAASA,GAELG,EAAK,CAAAK,MANLV,GAAU,6BAA4BW,OACtCV,GAAc,4CAA2CW,OACzDT,IAMHJ,GAAUO,MAAAC,cAAA,KAAA,KAAKR,GACfK,GAAYA,EACD,IAGhBR,EAAYiB,YAAc,cAAa,IAAAL,EAAAM,EAAAC,eAAAC,WAAA,CAAAH,YAAA,kCAAAI,YAAA,eAAAH,CAAA,CAAA,GAAA,IAAA,IAAA,KAAAI,GAAAA,EAAAR,QAAAQ,GAAAA,EAAAP,SAAAO,GAAAA,EAAAN"}
1
+ {"version":3,"file":"Placeholder.js","sources":["../../../../../../../../src/core/ui/components/container/Placeholder.tsx"],"sourcesContent":["import { FC, memo, PropsWithChildren } from 'react'\n\nimport { FlexWrapper, FlexProps } from './Flex'\n\nexport type PlaceholderProps = FlexProps & PropsWithChildren<unknown> & {\n title?: string\n cssProp?: string\n background?: string\n border?: string\n onClick?: () => void\n}\n\nexport const Placeholder: FC<PlaceholderProps>\n= memo<PlaceholderProps>(({ title, border, background, onClick, cssProp, children, ...props }: PlaceholderProps) => (\n <FlexWrapper\n css={`\n ${border || 'border: 1px solid #999999;'}\n ${background || 'background-color: rgba(0, 120, 255, 0.2);'}\n ${cssProp}\n `}\n onClick={onClick}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n >\n {title && (<h2>{title}</h2>)}\n {children && children}\n </FlexWrapper>\n))\n\nPlaceholder.displayName = 'Placeholder'\n"],"names":["Placeholder","memo","_ref","title","border","background","onClick","cssProp","children","props","React","createElement","_StyledFlexWrapper","_extends","$_css","$_css2","$_css3","displayName","_styled","default","FlexWrapper","withConfig","componentId","p"],"mappings":"0NAYaA,MAAAA,EACXC,EAAIA,MAAmBC,IAAA,IAACC,MAAEA,EAAKC,OAAEA,EAAMC,WAAEA,EAAUC,QAAEA,EAAOC,QAAEA,EAAOC,SAAEA,KAAaC,GAAyBP,EAAA,OAC7GQ,MAAAC,cAAAC,EAAAC,UAAA,CAMEP,QAASA,GAELG,EAAK,CAAAK,MANLV,GAAU,6BAA4BW,OACtCV,GAAc,4CAA2CW,OACzDT,IAMHJ,GAAUO,MAAAC,cAAA,KAAA,KAAKR,GACfK,GAAYA,EACD,IAGhBR,EAAYiB,YAAc,cAAa,IAAAL,EAAAM,EAAAC,QAAAC,eAAAC,WAAA,CAAAJ,YAAA,kCAAAK,YAAA,eAAAJ,CAAA,CAAA,GAAA,IAAA,IAAA,KAAAK,GAAAA,EAAAT,QAAAS,GAAAA,EAAAR,SAAAQ,GAAAA,EAAAP"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("styled-components"),a=require("react");let n=()=>"#000000";let o=a.memo((function(){return React.createElement("span",null)}));const l=t.div.withConfig({displayName:"Field__FieldWrapper",componentId:"sc-i8c0jy-0"})(["opacity:",";pointer-events:",";flex:1 1 auto;width:100%;@media (min-width:400px){flex:1;}.label{font-size:0.8rem !important;font-weight:normal;}.help{text-align:left;}.mainControl{flex:1;border-radius:6px;box-shadow:0 0 6px 1px rgba(0,0,0,0.06);will-change:box-shadow;transition:box-shadow 250ms ease-in-out;&:hover{box-shadow:0 0 8px 2px rgba(0,0,0,0.1);}}button{box-shadow:0 0 8px 2px rgba(0,0,0,0.1);}.select{width:100%;flex:1;&::after{border-color:#000000 !important;}}.icon{&.is-action{cursor:pointer;pointer-events:initial !important;}}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}input[type=number]{-moz-appearance:textfield;}.input[type=date]::-webkit-calendar-picker-indicator{opacity:0;-webkit-appearance:none;position:absolute;left:0;top:0;width:40px;height:100%;margin:0;padding:0;cursor:pointer;}textarea{resize:none;}"],(e=>{let{disabled:t,userDisabled:a}=e;return t||a?.5:1}),(e=>{let{disabled:t,userDisabled:a}=e;return t||a?"none":"auto"}));var i=t(l).withConfig({displayName:"Field___StyledFieldWrapper",componentId:"sc-i8c0jy-1"})(["",""],(e=>e.$_css));const c=a.memo((function(t){let{options:a,value:n,inputRef:o,...l}=t;return React.createElement("div",{className:"select"},React.createElement("select",e.extends({},l,{ref:o,defaultValue:n}),null==a?void 0:a.map((e=>React.createElement("option",{key:"".concat(JSON.stringify(e)),value:"object"==typeof e?null==e?void 0:e.value:e},"object"==typeof e?null==e?void 0:e.label:e)))))})),r=t.input.withConfig({displayName:"Field__InputComponent",componentId:"sc-i8c0jy-2"})([""]),s=t.textarea.withConfig({displayName:"Field__TextAreaComponent",componentId:"sc-i8c0jy-3"})([""]),p=t.label.withConfig({displayName:"Field__StyledFieldLabel",componentId:"sc-i8c0jy-4"})(["text-align:left;"]),d=a.memo((t=>{let{label:l,name:d,type:m="text",value:u,defaultValue:f,placeholder:h,inputRef:b,error:x,disabled:g,userDisabled:y,withoutComponent:v,helpTextInfo:w,helpText:C,children:N,iconLeft:R,iconRight:E,addon:F,className:_,onChange:k,onChangeInner:I,onBlur:j,onFocus:D,rightIconClick:B,leftIconClick:S,options:q,css:z,...L}=t,T=r;N||"textarea"!==m||(T=s);const V=a.useCallback((e=>{var t;y?null==e||null===(t=e.preventDefault)||void 0===t||t.call(e):D&&D(e)}),[y,D]),W=a.useCallback((e=>{y||(I&&null!=e&&e.target?(e.target.value=I(e.target.value),k&&k(e)):k&&k(e))}),[I,k,y]),K=a.useMemo((()=>void 0===u?{defaultValue:f}:{value:u}),[u,f]);return React.createElement(i,{className:"field ".concat(_),error:x,disabled:g,userDisabled:y,$_css:z},React.createElement(p,{htmlFor:d,className:"label"},l),React.createElement("div",{className:"field ".concat(F?"has-addons":"")},React.createElement("div",{className:"control mainControl ".concat(R&&!v?"has-icons-left":""," ").concat(E?"has-icons-right":"")},!v&&(N||"select"!==m&&!q?!N&&React.createElement(T,e.extends({name:d,id:d,ref:b,className:"input ".concat(x?"is-danger":""),type:m,placeholder:h},K,{onChange:W,onBlur:j,onFocus:V,onKeyDown:V,autoComplete:"off",disabled:g},L)):React.createElement(c,e.extends({name:d,id:d,inputRef:b,className:"input ".concat(x?"is-danger":""),type:"select",placeholder:h,value:u,options:q,onChange:k,onBlur:j,onFocus:V,onKeyDown:V,autoComplete:"off",disabled:g},L))),R&&!v&&React.createElement("span",{className:"iconLeft icon is-small is-left ".concat(S?"is-action":""),onClick:S},React.createElement(o,{iconName:R,color:n})),E&&React.createElement("span",{className:"iconRight icon is-small is-right ".concat(B?"is-action":""),onClick:B},React.createElement(o,{iconName:E,color:n})),N&&N),F&&F),w&&React.createElement("p",{className:"help"},w),C&&React.createElement("p",{className:"help ".concat(x?"is-danger":"")},C))}));d.displayName="Field",exports.Field=d,exports.FieldWrapper=l,exports.Select=c,exports.setIconColor=e=>{n=e},exports.setIconComponent=e=>{o=e};
1
+ "use strict";var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("styled-components"),a=require("react");function n(e){return e&&e.__esModule?e:{default:e}}var l=n(t);let o=()=>"#000000";let i=a.memo((function(){return React.createElement("span",null)}));const c=l.default.div.withConfig({displayName:"Field__FieldWrapper",componentId:"sc-i8c0jy-0"})(["opacity:",";pointer-events:",";flex:1 1 auto;width:100%;@media (min-width:400px){flex:1;}.label{font-size:0.8rem !important;font-weight:normal;}.help{text-align:left;}.mainControl{flex:1;border-radius:6px;box-shadow:0 0 6px 1px rgba(0,0,0,0.06);will-change:box-shadow;transition:box-shadow 250ms ease-in-out;&:hover{box-shadow:0 0 8px 2px rgba(0,0,0,0.1);}}button{box-shadow:0 0 8px 2px rgba(0,0,0,0.1);}.select{width:100%;flex:1;&::after{border-color:#000000 !important;}}.icon{&.is-action{cursor:pointer;pointer-events:initial !important;}}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}input[type=number]{-moz-appearance:textfield;}.input[type=date]::-webkit-calendar-picker-indicator{opacity:0;-webkit-appearance:none;position:absolute;left:0;top:0;width:40px;height:100%;margin:0;padding:0;cursor:pointer;}textarea{resize:none;}"],(e=>{let{disabled:t,userDisabled:a}=e;return t||a?.5:1}),(e=>{let{disabled:t,userDisabled:a}=e;return t||a?"none":"auto"}));var r=l.default(c).withConfig({displayName:"Field___StyledFieldWrapper",componentId:"sc-i8c0jy-1"})(["",""],(e=>e.$_css));const s=a.memo((function(t){let{options:a,value:n,inputRef:l,...o}=t;return React.createElement("div",{className:"select"},React.createElement("select",e.extends({},o,{ref:l,defaultValue:n}),null==a?void 0:a.map((e=>React.createElement("option",{key:"".concat(JSON.stringify(e)),value:"object"==typeof e?null==e?void 0:e.value:e},"object"==typeof e?null==e?void 0:e.label:e)))))})),p=l.default.input.withConfig({displayName:"Field__InputComponent",componentId:"sc-i8c0jy-2"})([""]),d=l.default.textarea.withConfig({displayName:"Field__TextAreaComponent",componentId:"sc-i8c0jy-3"})([""]),u=l.default.label.withConfig({displayName:"Field__StyledFieldLabel",componentId:"sc-i8c0jy-4"})(["text-align:left;"]),m=a.memo((t=>{let{label:n,name:l,type:c="text",value:m,defaultValue:f,placeholder:h,inputRef:b,error:x,disabled:g,userDisabled:y,withoutComponent:v,helpTextInfo:w,helpText:C,children:N,iconLeft:R,iconRight:_,addon:E,className:F,onChange:k,onChangeInner:I,onBlur:j,onFocus:D,rightIconClick:B,leftIconClick:S,options:q,css:z,...L}=t,T=p;N||"textarea"!==c||(T=d);const V=a.useCallback((e=>{var t;y?null==e||null===(t=e.preventDefault)||void 0===t||t.call(e):D&&D(e)}),[y,D]),W=a.useCallback((e=>{y||(I&&null!=e&&e.target?(e.target.value=I(e.target.value),k&&k(e)):k&&k(e))}),[I,k,y]),K=a.useMemo((()=>void 0===m?{defaultValue:f}:{value:m}),[m,f]);return React.createElement(r,{className:"field ".concat(F),error:x,disabled:g,userDisabled:y,$_css:z},React.createElement(u,{htmlFor:l,className:"label"},n),React.createElement("div",{className:"field ".concat(E?"has-addons":"")},React.createElement("div",{className:"control mainControl ".concat(R&&!v?"has-icons-left":""," ").concat(_?"has-icons-right":"")},!v&&(N||"select"!==c&&!q?!N&&React.createElement(T,e.extends({name:l,id:l,ref:b,className:"input ".concat(x?"is-danger":""),type:c,placeholder:h},K,{onChange:W,onBlur:j,onFocus:V,onKeyDown:V,autoComplete:"off",disabled:g},L)):React.createElement(s,e.extends({name:l,id:l,inputRef:b,className:"input ".concat(x?"is-danger":""),type:"select",placeholder:h,value:m,options:q,onChange:k,onBlur:j,onFocus:V,onKeyDown:V,autoComplete:"off",disabled:g},L))),R&&!v&&React.createElement("span",{className:"iconLeft icon is-small is-left ".concat(S?"is-action":""),onClick:S},React.createElement(i,{iconName:R,color:o})),_&&React.createElement("span",{className:"iconRight icon is-small is-right ".concat(B?"is-action":""),onClick:B},React.createElement(i,{iconName:_,color:o})),N&&N),E&&E),w&&React.createElement("p",{className:"help"},w),C&&React.createElement("p",{className:"help ".concat(x?"is-danger":"")},C))}));m.displayName="Field",exports.Field=m,exports.FieldWrapper=c,exports.Select=s,exports.setIconColor=e=>{o=e},exports.setIconComponent=e=>{i=e};
2
2
  //# sourceMappingURL=Field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","sources":["../../../../../../../../src/core/ui/components/field/Field.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\n/* eslint-disable jsx-a11y/no-static-element-interactions */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport { FC, ReactNode, memo, useMemo, useCallback, PropsWithChildren } from 'react'\nimport styled from 'styled-components'\n\nimport type { FieldError, IconComponentType } from './types'\n\nlet iconColor: string | (() => string) = () => '#000000'\n\nexport const setIconColor = (color: string | (() => string)): void => {\n iconColor = color\n}\n\nlet IconComponent: IconComponentType = memo(function IconComponent() { return <span /> })\n\nexport const setIconComponent = (component: IconComponentType): void => {\n IconComponent = component\n}\n\nexport type FileWrapperProps = PropsWithChildren<unknown> & {\n className?: string\n error?: boolean\n disabled?: boolean\n userDisabled?: boolean\n css?: string\n}\n\nexport const FieldWrapper: FC<FileWrapperProps> = styled.div<FileWrapperProps>`\n opacity: ${({ disabled, userDisabled }) => (disabled || userDisabled ? 0.5 : 1)};\n pointer-events: ${({ disabled, userDisabled }) => (disabled || userDisabled ? 'none' : 'auto')};\n flex: 1 1 auto;\n width: 100%;\n @media (min-width: 400px) {\n flex: 1;\n }\n .label {\n font-size: 0.8rem !important;\n font-weight: normal;\n }\n\n .help {\n text-align: left;\n }\n\n .mainControl {\n flex: 1;\n border-radius: 6px;\n box-shadow: 0 0 6px 1px rgba(0, 0, 0, 0.06);\n will-change: box-shadow;\n transition: box-shadow 250ms ease-in-out;\n &:hover {\n box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);\n }\n }\n button {\n box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);\n }\n .select {\n width: 100%;\n flex: 1;\n &::after {\n border-color: #000000 !important;\n }\n }\n\n .icon {\n &.is-action {\n cursor: pointer;\n pointer-events: initial !important;\n }\n }\n\n /* Chrome, Safari, Edge, Opera */\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n /* Firefox */\n input[type=number] {\n -moz-appearance: textfield;\n }\n\n .input[type=date]::-webkit-calendar-picker-indicator {\n opacity:0;\n -webkit-appearance: none;\n position: absolute;\n left: 0;\n top: 0;\n width: 40px;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n }\n\n textarea {\n resize: none;\n }\n`\n\ntype EventType = { target: any; type?: any } & Partial<Event>\nexport interface FieldProps {\n label?: string\n name?: string\n type?: string\n min?: number | string | Date | any\n max?: number | string | Date | any\n value?: string | number | readonly string[] | undefined\n defaultValue?: string | number | readonly string[] | undefined\n placeholder?: string\n inputRef?: ReactHookFormRef\n error?: boolean\n errors?: FieldError\n disabled?: boolean\n userDisabled?: boolean\n helpTextInfo?: string\n helpText?: string\n iconLeft?: string\n iconRight?: string\n withoutComponent?: boolean\n addon?: ReactNode\n children?: ReactNode\n className?: string\n onChange?: (event?: EventType) => unknown\n // TODO, rename... something like changeHandler or valueDecorator\n onChangeInner?: (value: string | number) => string | number\n onBlur?: (event?: EventType) => void\n onFocus?: (event?: EventType | undefined) => void\n rightIconClick?: (event?: EventType) => void\n leftIconClick?: (event?: EventType) => void\n options?: any[] | null\n creatable?: boolean\n async?: boolean\n css?: string\n [key: string]: any\n}\n\ninterface SelectProps extends FieldProps {\n id?: string\n}\n\ntype OptionObj = { label: string | number | undefined; value: string | number | undefined }\ntype Option = OptionObj | string | number\n\nexport const Select: FC<SelectProps>\n= memo<SelectProps>(\n function Select({ options, value, inputRef, ...props }: SelectProps) {\n return (\n <div className='select'>\n <select {...props} ref={inputRef} defaultValue={value}>\n {options?.map((option: Option) => (\n <option\n key={`${JSON.stringify(option)}`}\n value={typeof option === 'object' ? (option as OptionObj)?.value : option}\n >\n {typeof option === 'object' ? (option as OptionObj)?.label : option}\n </option>\n ))}\n </select>\n </div>\n )\n },\n)\n\nconst InputComponent = styled.input``\nconst TextAreaComponent = styled.textarea``\nconst StyledFieldLabel = styled.label`\n text-align: left;\n`\n\nexport const Field: FC<FieldProps> = memo<FieldProps>(({\n label,\n name,\n type = 'text',\n value,\n defaultValue,\n placeholder,\n inputRef,\n error,\n disabled,\n userDisabled,\n withoutComponent,\n helpTextInfo,\n helpText,\n children,\n iconLeft,\n iconRight,\n addon,\n className,\n onChange,\n onChangeInner,\n onBlur,\n onFocus,\n rightIconClick,\n leftIconClick,\n options,\n css,\n ...props\n}: FieldProps) => {\n let Component: FC<any> = InputComponent\n\n if (!children && type === 'textarea') {\n Component = TextAreaComponent\n }\n const handleFocus = useCallback((event: Event | EventType | undefined) => {\n if (userDisabled) {\n event?.preventDefault?.()\n } else {\n onFocus && onFocus(event)\n }\n }, [userDisabled, onFocus])\n\n const handleChange = useCallback((event: { target: { value: string } }) => {\n if (userDisabled) {\n return\n }\n if (onChangeInner && event?.target) {\n // eslint-disable-next-line no-param-reassign\n event.target.value = onChangeInner((event.target.value as string)) as string\n onChange && onChange(event as EventType)\n } else {\n onChange && onChange(event as EventType)\n }\n }, [onChangeInner, onChange, userDisabled])\n\n const valueProps = useMemo(() => {\n if (value === undefined) {\n return { defaultValue }\n }\n return { value }\n }, [value, defaultValue])\n\n return (\n <FieldWrapper\n className={`field ${className}`}\n error={error}\n disabled={disabled}\n userDisabled={userDisabled}\n css={css}\n >\n <StyledFieldLabel htmlFor={name} className='label'>{label}</StyledFieldLabel>\n <div className={`field ${addon ? 'has-addons' : ''}`}>\n <div\n className={`control mainControl ${iconLeft && !withoutComponent\n ? 'has-icons-left' : ''} ${iconRight ? 'has-icons-right' : ''}`}\n >\n {!withoutComponent && ((!children && (type === 'select' || options))\n ? (\n <Select\n name={name}\n id={name}\n inputRef={inputRef}\n className={`input ${error ? 'is-danger' : ''}`}\n type='select'\n placeholder={placeholder}\n value={value}\n options={options}\n // TODO also handle change but value versus event.target.value issue\n onChange={onChange}\n onBlur={onBlur}\n onFocus={handleFocus}\n onKeyDown={handleFocus}\n autoComplete='off'\n disabled={disabled}\n {...props}\n />\n )\n : (\n !children && (\n <Component\n name={name}\n id={name}\n ref={inputRef}\n className={`input ${error ? 'is-danger' : ''}`}\n type={type}\n placeholder={placeholder}\n {...valueProps}\n onChange={handleChange}\n onBlur={onBlur}\n onFocus={handleFocus}\n onKeyDown={handleFocus}\n autoComplete='off'\n disabled={disabled}\n {...props}\n />\n )))}\n\n {iconLeft && !withoutComponent && (\n <span\n className={`iconLeft icon is-small is-left ${leftIconClick ? 'is-action' : ''}`}\n onClick={leftIconClick}\n >\n <IconComponent\n iconName={iconLeft}\n color={iconColor}\n />\n </span>\n )}\n {iconRight && (\n <span\n className={`iconRight icon is-small is-right ${rightIconClick ? 'is-action' : ''}`}\n onClick={rightIconClick}\n >\n <IconComponent\n iconName={iconRight}\n color={iconColor}\n />\n </span>\n )}\n {children && children}\n </div>\n {addon && addon}\n </div>\n {helpTextInfo && <p className='help'>{helpTextInfo}</p>}\n {helpText && <p className={`help ${error ? 'is-danger' : ''}`}>{helpText}</p>}\n </FieldWrapper>\n )\n})\n\nField.displayName = 'Field'\n"],"names":["iconColor","IconComponent","memo","React","createElement","setIconComponent","FieldWrapper","styled","div","withConfig","displayName","componentId","_ref","disabled","userDisabled","_ref2","_StyledFieldWrapper","p","$_css","Select","_ref3","options","value","inputRef","props","className","_extends","ref","defaultValue","map","option","key","concat","JSON","stringify","label","InputComponent","input","TextAreaComponent","textarea","StyledFieldLabel","Field","_ref4","name","type","placeholder","error","withoutComponent","helpTextInfo","helpText","children","iconLeft","iconRight","addon","onChange","onChangeInner","onBlur","onFocus","rightIconClick","leftIconClick","css","Component","handleFocus","useCallback","event","_event$preventDefault","preventDefault","call","handleChange","target","valueProps","useMemo","undefined","htmlFor","id","onKeyDown","autoComplete","onClick","iconName","color","component"],"mappings":"qIAQA,IAAIA,EAAqCA,IAAM,UAM/C,IAAIC,EAAmCC,EAAAA,MAAK,WAA2B,OAAOC,MAAAC,cAAA,OAAA,KAAS,IAE1EC,MAYAC,EAAqCC,EAAOC,IAAGC,WAAA,CAAAC,YAAA,sBAAAC,YAAA,eAAVJ,CAAU,CAAA,WAAA,mBAAA,61BAC/CK,IAAA,IAACC,SAAEA,EAAQC,aAAEA,GAAcF,EAAA,OAAMC,GAAYC,EAAe,GAAM,CAAC,IAC5DC,IAAA,IAACF,SAAEA,EAAQC,aAAEA,GAAcC,EAAA,OAA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D,SAAUA,GACNW,IAnCNrB,MAAAC,cAACe,EAAMO,EAAAA,QAAA,CACLiB,KAAMA,EACN+B,GAAI/B,EACJpB,SAAUA,EACVE,UAAS,SAAAO,OAAWc,EAAQ,YAAc,IAC1CF,KAAK,SACLC,YAAaA,EACbvB,MAAOA,EACPD,QAASA,EAETiC,SAAUA,EACVE,OAAQA,EACRC,QAASK,EACTa,UAAWb,EACXc,aAAa,MACb/D,SAAUA,GACNW,KAuBT2B,IAAaJ,GACZ5C,MAAAC,cAAA,OAAA,CACEqB,UAAS,kCAAAO,OAAoC2B,EAAgB,YAAc,IAC3EkB,QAASlB,GAETxD,MAAAC,cAACH,EAAa,CACZ6E,SAAU3B,EACV4B,MAAO/E,KAIZoD,GACCjD,MAAAC,cAAA,OAAA,CACEqB,UAAS,oCAAAO,OAAsC0B,EAAiB,YAAc,IAC9EmB,QAASnB,GAETvD,MAAAC,cAACH,EAAa,CACZ6E,SAAU1B,EACV2B,MAAO/E,KAIZkD,GAAYA,GAEdG,GAASA,GAEXL,GAAgB7C,MAAAC,cAAA,IAAA,CAAGqB,UAAU,QAAQuB,GACrCC,GAAY9C,MAAAC,cAAA,IAAA,CAAGqB,kBAASO,OAAUc,EAAQ,YAAc,KAAOG,GACnD,IAInBR,EAAM/B,YAAc,qFAxTSqE,IAC3B/E,EAAY+E,CAAK,2BAKcC,IAC/B/E,EAAgB+E,CAAS"}
1
+ {"version":3,"file":"Field.js","sources":["../../../../../../../../src/core/ui/components/field/Field.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\n/* eslint-disable jsx-a11y/no-static-element-interactions */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport { FC, ReactNode, memo, useMemo, useCallback, PropsWithChildren } from 'react'\nimport styled from 'styled-components'\n\nimport type { FieldError, IconComponentType } from './types'\n\nlet iconColor: string | (() => string) = () => '#000000'\n\nexport const setIconColor = (color: string | (() => string)): void => {\n iconColor = color\n}\n\nlet IconComponent: IconComponentType = memo(function IconComponent() { return <span /> })\n\nexport const setIconComponent = (component: IconComponentType): void => {\n IconComponent = component\n}\n\nexport type FileWrapperProps = PropsWithChildren<unknown> & {\n className?: string\n error?: boolean\n disabled?: boolean\n userDisabled?: boolean\n css?: string\n}\n\nexport const FieldWrapper: FC<FileWrapperProps> = styled.div<FileWrapperProps>`\n opacity: ${({ disabled, userDisabled }) => (disabled || userDisabled ? 0.5 : 1)};\n pointer-events: ${({ disabled, userDisabled }) => (disabled || userDisabled ? 'none' : 'auto')};\n flex: 1 1 auto;\n width: 100%;\n @media (min-width: 400px) {\n flex: 1;\n }\n .label {\n font-size: 0.8rem !important;\n font-weight: normal;\n }\n\n .help {\n text-align: left;\n }\n\n .mainControl {\n flex: 1;\n border-radius: 6px;\n box-shadow: 0 0 6px 1px rgba(0, 0, 0, 0.06);\n will-change: box-shadow;\n transition: box-shadow 250ms ease-in-out;\n &:hover {\n box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);\n }\n }\n button {\n box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);\n }\n .select {\n width: 100%;\n flex: 1;\n &::after {\n border-color: #000000 !important;\n }\n }\n\n .icon {\n &.is-action {\n cursor: pointer;\n pointer-events: initial !important;\n }\n }\n\n /* Chrome, Safari, Edge, Opera */\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n /* Firefox */\n input[type=number] {\n -moz-appearance: textfield;\n }\n\n .input[type=date]::-webkit-calendar-picker-indicator {\n opacity:0;\n -webkit-appearance: none;\n position: absolute;\n left: 0;\n top: 0;\n width: 40px;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n }\n\n textarea {\n resize: none;\n }\n`\n\ntype EventType = { target: any; type?: any } & Partial<Event>\nexport interface FieldProps {\n label?: string\n name?: string\n type?: string\n min?: number | string | Date | any\n max?: number | string | Date | any\n value?: string | number | readonly string[] | undefined\n defaultValue?: string | number | readonly string[] | undefined\n placeholder?: string\n inputRef?: ReactHookFormRef\n error?: boolean\n errors?: FieldError\n disabled?: boolean\n userDisabled?: boolean\n helpTextInfo?: string\n helpText?: string\n iconLeft?: string\n iconRight?: string\n withoutComponent?: boolean\n addon?: ReactNode\n children?: ReactNode\n className?: string\n onChange?: (event?: EventType) => unknown\n // TODO, rename... something like changeHandler or valueDecorator\n onChangeInner?: (value: string | number) => string | number\n onBlur?: (event?: EventType) => void\n onFocus?: (event?: EventType | undefined) => void\n rightIconClick?: (event?: EventType) => void\n leftIconClick?: (event?: EventType) => void\n options?: any[] | null\n creatable?: boolean\n async?: boolean\n css?: string\n [key: string]: any\n}\n\ninterface SelectProps extends FieldProps {\n id?: string\n}\n\ntype OptionObj = { label: string | number | undefined; value: string | number | undefined }\ntype Option = OptionObj | string | number\n\nexport const Select: FC<SelectProps>\n= memo<SelectProps>(\n function Select({ options, value, inputRef, ...props }: SelectProps) {\n return (\n <div className='select'>\n <select {...props} ref={inputRef} defaultValue={value}>\n {options?.map((option: Option) => (\n <option\n key={`${JSON.stringify(option)}`}\n value={typeof option === 'object' ? (option as OptionObj)?.value : option}\n >\n {typeof option === 'object' ? (option as OptionObj)?.label : option}\n </option>\n ))}\n </select>\n </div>\n )\n },\n)\n\nconst InputComponent = styled.input``\nconst TextAreaComponent = styled.textarea``\nconst StyledFieldLabel = styled.label`\n text-align: left;\n`\n\nexport const Field: FC<FieldProps> = memo<FieldProps>(({\n label,\n name,\n type = 'text',\n value,\n defaultValue,\n placeholder,\n inputRef,\n error,\n disabled,\n userDisabled,\n withoutComponent,\n helpTextInfo,\n helpText,\n children,\n iconLeft,\n iconRight,\n addon,\n className,\n onChange,\n onChangeInner,\n onBlur,\n onFocus,\n rightIconClick,\n leftIconClick,\n options,\n css,\n ...props\n}: FieldProps) => {\n let Component: FC<any> = InputComponent\n\n if (!children && type === 'textarea') {\n Component = TextAreaComponent\n }\n const handleFocus = useCallback((event: Event | EventType | undefined) => {\n if (userDisabled) {\n event?.preventDefault?.()\n } else {\n onFocus && onFocus(event)\n }\n }, [userDisabled, onFocus])\n\n const handleChange = useCallback((event: { target: { value: string } }) => {\n if (userDisabled) {\n return\n }\n if (onChangeInner && event?.target) {\n // eslint-disable-next-line no-param-reassign\n event.target.value = onChangeInner((event.target.value as string)) as string\n onChange && onChange(event as EventType)\n } else {\n onChange && onChange(event as EventType)\n }\n }, [onChangeInner, onChange, userDisabled])\n\n const valueProps = useMemo(() => {\n if (value === undefined) {\n return { defaultValue }\n }\n return { value }\n }, [value, defaultValue])\n\n return (\n <FieldWrapper\n className={`field ${className}`}\n error={error}\n disabled={disabled}\n userDisabled={userDisabled}\n css={css}\n >\n <StyledFieldLabel htmlFor={name} className='label'>{label}</StyledFieldLabel>\n <div className={`field ${addon ? 'has-addons' : ''}`}>\n <div\n className={`control mainControl ${iconLeft && !withoutComponent\n ? 'has-icons-left' : ''} ${iconRight ? 'has-icons-right' : ''}`}\n >\n {!withoutComponent && ((!children && (type === 'select' || options))\n ? (\n <Select\n name={name}\n id={name}\n inputRef={inputRef}\n className={`input ${error ? 'is-danger' : ''}`}\n type='select'\n placeholder={placeholder}\n value={value}\n options={options}\n // TODO also handle change but value versus event.target.value issue\n onChange={onChange}\n onBlur={onBlur}\n onFocus={handleFocus}\n onKeyDown={handleFocus}\n autoComplete='off'\n disabled={disabled}\n {...props}\n />\n )\n : (\n !children && (\n <Component\n name={name}\n id={name}\n ref={inputRef}\n className={`input ${error ? 'is-danger' : ''}`}\n type={type}\n placeholder={placeholder}\n {...valueProps}\n onChange={handleChange}\n onBlur={onBlur}\n onFocus={handleFocus}\n onKeyDown={handleFocus}\n autoComplete='off'\n disabled={disabled}\n {...props}\n />\n )))}\n\n {iconLeft && !withoutComponent && (\n <span\n className={`iconLeft icon is-small is-left ${leftIconClick ? 'is-action' : ''}`}\n onClick={leftIconClick}\n >\n <IconComponent\n iconName={iconLeft}\n color={iconColor}\n />\n </span>\n )}\n {iconRight && (\n <span\n className={`iconRight icon is-small is-right ${rightIconClick ? 'is-action' : ''}`}\n onClick={rightIconClick}\n >\n <IconComponent\n iconName={iconRight}\n color={iconColor}\n />\n </span>\n )}\n {children && children}\n </div>\n {addon && addon}\n </div>\n {helpTextInfo && <p className='help'>{helpTextInfo}</p>}\n {helpText && <p className={`help ${error ? 'is-danger' : ''}`}>{helpText}</p>}\n </FieldWrapper>\n )\n})\n\nField.displayName = 'Field'\n"],"names":["iconColor","IconComponent","memo","React","createElement","setIconComponent","FieldWrapper","styled","div","withConfig","displayName","componentId","_ref","disabled","userDisabled","_ref2","_StyledFieldWrapper","default","p","$_css","Select","_ref3","options","value","inputRef","props","className","_extends","ref","defaultValue","map","option","key","concat","JSON","stringify","label","InputComponent","input","TextAreaComponent","textarea","StyledFieldLabel","Field","_ref4","name","type","placeholder","error","withoutComponent","helpTextInfo","helpText","children","iconLeft","iconRight","addon","onChange","onChangeInner","onBlur","onFocus","rightIconClick","leftIconClick","css","Component","handleFocus","useCallback","event","_event$preventDefault","preventDefault","call","handleChange","target","valueProps","useMemo","undefined","htmlFor","id","onKeyDown","autoComplete","onClick","iconName","color","component"],"mappings":"mMAQA,IAAIA,EAAqCA,IAAM,UAM/C,IAAIC,EAAmCC,EAAAA,MAAK,WAA2B,OAAOC,MAAAC,cAAA,OAAA,KAAS,IAE1EC,MAYAC,EAAqCC,EAAAA,QAAOC,IAAGC,WAAA,CAAAC,YAAA,sBAAAC,YAAA,eAAVJ,CAAU,CAAA,WAAA,mBAAA,61BAC/CK,IAAA,IAACC,SAAEA,EAAQC,aAAEA,GAAcF,EAAA,OAAMC,GAAYC,EAAe,GAAM,CAAC,IAC5DC,IAAA,IAACF,SAAEA,EAAQC,aAAEA,GAAcC,EAAA,OAAMF,GAAYC,EAAe,OAAS,MAAM,IAuE9F,IAAAE,EAAAT,EAAAU,QAAAX,GAAAG,WAAA,CAAAC,YAAA,6BAAAC,YAAA,eAAAJ,CAAA,CAAA,GAAA,KAAAW,GAAAA,EAAAC,QA8CM,MAAMC,EACXlB,EAAIA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KAAK,SACLC,YAAaA,EACbvB,MAAOA,EACPD,QAASA,EAETiC,SAAUA,EACVE,OAAQA,EACRC,QAASK,EACTa,UAAWb,EACXc,aAAa,MACbhE,SAAUA,GACNY,KAuBT2B,IAAaJ,GACZ7C,MAAAC,cAAA,OAAA,CACEsB,UAAS,kCAAAO,OAAoC2B,EAAgB,YAAc,IAC3EkB,QAASlB,GAETzD,MAAAC,cAACH,EAAa,CACZ8E,SAAU3B,EACV4B,MAAOhF,KAIZqD,GACClD,MAAAC,cAAA,OAAA,CACEsB,UAAS,oCAAAO,OAAsC0B,EAAiB,YAAc,IAC9EmB,QAASnB,GAETxD,MAAAC,cAACH,EAAa,CACZ8E,SAAU1B,EACV2B,MAAOhF,KAIZmD,GAAYA,GAEdG,GAASA,GAEXL,GAAgB9C,MAAAC,cAAA,IAAA,CAAGsB,UAAU,QAAQuB,GACrCC,GAAY/C,MAAAC,cAAA,IAAA,CAAGsB,kBAASO,OAAUc,EAAQ,YAAc,KAAOG,GACnD,IAInBR,EAAMhC,YAAc,qFAxTSsE,IAC3BhF,EAAYgF,CAAK,2BAKcC,IAC/BhF,EAAgBgF,CAAS"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("dayjs"),o=require("../../../node_modules/dayjs/plugin/relativeTime.js"),t=require("../../../node_modules/dayjs/plugin/updateLocale.js"),a=require("../../../node_modules/dayjs/plugin/customParseFormat.js");const d={future:"in %s",past:"%s ago",s:"now",m:"now",mm:"now",h:"1 hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},r={future:"za %s",past:"%s před",s:"nyní",m:"nyní",mm:"nyní",h:"1 hodinu",hh:"%d hodiny",d:"den",dd:"%d dny",M:"měsíc",MM:"%d měsíci",y:"rok",yy:"%d roky"};e.extend(a.default),e.extend(o.default,{thresholds:[{l:"s",r:1},{l:"m",r:1},{l:"mm",r:59,d:"minute"},{l:"h",r:1},{l:"hh",r:23,d:"hour"},{l:"d",r:1},{l:"dd",r:29,d:"day"},{l:"M",r:1},{l:"MM",r:11,d:"month"},{l:"y",r:1},{l:"yy",d:"year"}]}),e.extend(t.default),e.updateLocale("cz",{relativeTime:{...r}}),e.updateLocale("en",{relativeTime:{...d}});const l=o=>{let{value:t,valueFormat:a,formatString:l,language:n="en",relativeTime:s,from:i,to:u,shouldAddDay:m=!1,shouldSubtractDay:c=!1,showPreffix:y=!1}=o;if(e.updateLocale("en",{relativeTime:{..."cz"===n?r:d,...s}}),e.locale(n),!i&&u){const o=e(t,a||void 0).add(m?1:0,"day");return e(new Date).locale(n).to(o,!y)}if(i&&!u){const o=e(t,a||void 0).subtract(c?1:0,"day");return e(o,a||void 0).locale(n).fromNow(!y)}return e(t,a||void 0).locale(n).format(l)};exports.dateRangeFormat=function(o,t,a,d){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:" - ",l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"month";const n=e(o),s=e(t),i=n.diff(s,l);return"".concat(n.format(0===i?a:d)).concat(r).concat(s.format(d))},exports.getDateTime=l,exports.getTimeFromNow=(e,o)=>l({...o,from:!0,value:e}),exports.getTimeFromNowOriginal=(t,a)=>(e.updateLocale("en",{relativeTime:{..."cz"===a?r:d,...o.default}}),e(t,void 0).fromNow(!0)),exports.getTimeTo=(e,o)=>l({...o,to:!0,value:e});
1
+ "use strict";var e=require("dayjs"),t=require("../../../node_modules/dayjs/plugin/relativeTime.js"),a=require("../../../node_modules/dayjs/plugin/updateLocale.js"),d=require("../../../node_modules/dayjs/plugin/customParseFormat.js");function o(e){return e&&e.__esModule?e:{default:e}}var r=o(e);const l={future:"in %s",past:"%s ago",s:"now",m:"now",mm:"now",h:"1 hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},u={future:"za %s",past:"%s před",s:"nyní",m:"nyní",mm:"nyní",h:"1 hodinu",hh:"%d hodiny",d:"den",dd:"%d dny",M:"měsíc",MM:"%d měsíci",y:"rok",yy:"%d roky"};r.default.extend(d.default),r.default.extend(t.default,{thresholds:[{l:"s",r:1},{l:"m",r:1},{l:"mm",r:59,d:"minute"},{l:"h",r:1},{l:"hh",r:23,d:"hour"},{l:"d",r:1},{l:"dd",r:29,d:"day"},{l:"M",r:1},{l:"MM",r:11,d:"month"},{l:"y",r:1},{l:"yy",d:"year"}]}),r.default.extend(a.default),r.default.updateLocale("cz",{relativeTime:{...u}}),r.default.updateLocale("en",{relativeTime:{...l}});const n=e=>{let{value:t,valueFormat:a,formatString:d,language:o="en",relativeTime:n,from:s,to:i,shouldAddDay:m=!1,shouldSubtractDay:f=!1,showPreffix:c=!1}=e;if(r.default.updateLocale("en",{relativeTime:{..."cz"===o?u:l,...n}}),r.default.locale(o),!s&&i){const e=r.default(t,a||void 0).add(m?1:0,"day");return r.default(new Date).locale(o).to(e,!c)}if(s&&!i){const e=r.default(t,a||void 0).subtract(f?1:0,"day");return r.default(e,a||void 0).locale(o).fromNow(!c)}return r.default(t,a||void 0).locale(o).format(d)};exports.dateRangeFormat=function(e,t,a,d){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:" - ",l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"month";const u=r.default(e),n=r.default(t),s=u.diff(n,l);return"".concat(u.format(0===s?a:d)).concat(o).concat(n.format(d))},exports.getDateTime=n,exports.getTimeFromNow=(e,t)=>n({...t,from:!0,value:e}),exports.getTimeFromNowOriginal=(e,a)=>(r.default.updateLocale("en",{relativeTime:{..."cz"===a?u:l,...t.default}}),r.default(e,void 0).fromNow(!0)),exports.getTimeTo=(e,t)=>n({...t,to:!0,value:e});
2
2
  //# sourceMappingURL=date.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date.js","sources":["../../../../../../src/core/utils/date.ts"],"sourcesContent":["import dayjs, { UnitType } from 'dayjs'\nimport relativeTime from 'dayjs/plugin/relativeTime'\nimport updateLocale from 'dayjs/plugin/updateLocale'\nimport customParseFormat from 'dayjs/plugin/customParseFormat'\n\nexport type DateTimeFormat = {\n value: Date | string | number\n valueFormat?: string\n formatString?: string\n language?: string\n relativeTime?: Record<string, string>\n from?: boolean\n to?: boolean\n shouldSubtractDay?: boolean\n shouldAddDay?: boolean\n showPreffix?: boolean\n}\n\nconst relativeTimeConfig = {\n thresholds: [\n { l: 's', r: 1 },\n { l: 'm', r: 1 },\n { l: 'mm', r: 59, d: 'minute' },\n { l: 'h', r: 1 },\n { l: 'hh', r: 23, d: 'hour' },\n { l: 'd', r: 1 },\n { l: 'dd', r: 29, d: 'day' },\n { l: 'M', r: 1 },\n { l: 'MM', r: 11, d: 'month' },\n { l: 'y', r: 1 },\n { l: 'yy', d: 'year' },\n ],\n}\n\nconst relativeTimeEN = {\n future: 'in %s',\n past: '%s ago',\n s: 'now',\n m: 'now',\n mm: 'now',\n h: '1 hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days', // probably 'a week' instead?\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n}\n\nconst relativeTimeCZ = {\n future: 'za %s',\n past: '%s před',\n s: 'nyní',\n m: 'nyní',\n mm: 'nyní',\n h: '1 hodinu',\n hh: '%d hodiny',\n d: 'den',\n dd: '%d dny',\n M: 'měsíc',\n MM: '%d měsíci',\n y: 'rok',\n yy: '%d roky',\n}\n\ndayjs.extend(customParseFormat)\ndayjs.extend(relativeTime, relativeTimeConfig)\ndayjs.extend(updateLocale)\n\ndayjs.updateLocale('cz', {\n relativeTime: {\n ...relativeTimeCZ,\n },\n})\ndayjs.updateLocale('en', {\n relativeTime: {\n ...relativeTimeEN,\n },\n})\n\nexport const getTimeFromNowOriginal = (value: string, language: string): string => {\n dayjs.updateLocale('en', {\n relativeTime: {\n ...(language === 'cz' ? relativeTimeCZ : relativeTimeEN),\n ...relativeTime,\n },\n })\n return dayjs(value, undefined).fromNow(true)\n}\n\nexport const getTimeFromNow = (\n value: Date | string | number,\n valueFormat?: Partial<DateTimeFormat>,\n): string => getDateTime({ ...valueFormat, from: true, value })\n\nexport const getTimeTo = (\n value: Date | string | number,\n valueFormat?: Partial<DateTimeFormat>,\n): string => getDateTime({ ...valueFormat, to: true, value })\n\nexport const getDateTime = ({\n value,\n valueFormat,\n formatString,\n language = 'en',\n relativeTime,\n from,\n to,\n shouldAddDay = false,\n shouldSubtractDay = false,\n showPreffix = false,\n}: DateTimeFormat): string => {\n dayjs.updateLocale('en', {\n relativeTime: {\n ...(language === 'cz' ? relativeTimeCZ : relativeTimeEN),\n ...relativeTime,\n },\n })\n\n dayjs.locale(language)\n\n if (!from && to) {\n const dateTo = dayjs(value, valueFormat || undefined).add(shouldAddDay ? 1 : 0, 'day')\n\n return dayjs(new Date()).locale(language).to(dateTo, !showPreffix)\n }\n\n if (from && !to) {\n const dateTo = dayjs(value, valueFormat || undefined).subtract(shouldSubtractDay ? 1 : 0, 'day')\n\n return dayjs(dateTo, valueFormat || undefined).locale(language).fromNow(!showPreffix)\n }\n\n return dayjs(value, valueFormat || undefined).locale(language).format(formatString)\n}\n\nexport const dateRangeFormat = (\n dateFrom: Date, dateTo: Date, shortFormat: string, longFormat: string,\n delimiter = ' - ', datePeriod: UnitType = 'month',\n) : string => {\n const dayJSFrom = dayjs(dateFrom)\n const dayJSTo = dayjs(dateTo)\n\n const diffMonths = dayJSFrom.diff(dayJSTo, datePeriod)\n\n return `${dayJSFrom.format(diffMonths === 0 ? shortFormat : longFormat)}${delimiter}${dayJSTo.format(longFormat)}`\n}\n"],"names":["relativeTimeEN","future","past","s","m","mm","h","hh","d","dd","M","MM","y","yy","relativeTimeCZ","dayjs","extend","customParseFormat","relativeTime","thresholds","l","r","updateLocale","getDateTime","_ref","value","valueFormat","formatString","language","from","to","shouldAddDay","shouldSubtractDay","showPreffix","locale","dateTo","undefined","add","Date","subtract","fromNow","format","dateFrom","shortFormat","longFormat","delimiter","arguments","length","datePeriod","dayJSFrom","dayJSTo","diffMonths","diff","concat","getTimeFromNow","getTimeFromNowOriginal","getTimeTo"],"mappings":"yOAkBA,MAgB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IAERC,GAAQC,EAAI,CACf,MAAMK,EAASpB,EAAMU,EAAOC,QAAeU,GAAWC,IAAIN,EAAe,EAAI,EAAG,OAEhF,OAAOhB,EAAM,IAAIuB,MAAQJ,OAAON,GAAUE,GAAGK,GAASF,EACxD,CAEA,GAAIJ,IAASC,EAAI,CACf,MAAMK,EAASpB,EAAMU,EAAOC,QAAeU,GAAWG,SAASP,EAAoB,EAAI,EAAG,OAE1F,OAAOjB,EAAMoB,EAAQT,QAAeU,GAAWF,OAAON,GAAUY,SAASP,EAC3E,CAEA,OAAOlB,EAAMU,EAAOC,QAAeU,GAAWF,OAAON,GAAUa,OAAOd,EAAa,0BAGtD,SAC7Be,EAAgBP,EAAcQ,EAAqBC,GAEvC,IADZC,EAASC,UAAAC,OAAA,QAAAX,IAAAU,UAAA,GAAAA,UAAA,GAAG,MAAOE,EAAoBF,UAAAC,OAAA,QAAAX,IAAAU,UAAA,GAAAA,UAAA,GAAG,QAE1C,MAAMG,EAAYlC,EAAM2B,GAClBQ,EAAUnC,EAAMoB,GAEhBgB,EAAaF,EAAUG,KAAKF,EAASF,GAE3C,MAAAK,GAAAA,OAAUJ,EAAUR,OAAsB,IAAfU,EAAmBR,EAAcC,IAAWS,OAAGR,GAASQ,OAAGH,EAAQT,OAAOG,GACvG,+CAxD8BU,CAC5B7B,EACAC,IACWH,EAAY,IAAKG,EAAaG,MAAM,EAAMJ,yCAbjB8B,CAAC9B,EAAeG,KACpDb,EAAMO,aAAa,KAAM,CACvBJ,aAAc,IACK,OAAbU,EAAoBd,EAAiBd,KACtCkB,EAAAA,WAGAH,EAAMU,OAAOW,GAAWI,SAAQ,sBAQhBgB,CACvB/B,EACAC,IACWH,EAAY,IAAKG,EAAaI,IAAI,EAAML"}
1
+ {"version":3,"file":"date.js","sources":["../../../../../../src/core/utils/date.ts"],"sourcesContent":["import dayjs, { UnitType } from 'dayjs'\nimport relativeTime from 'dayjs/plugin/relativeTime'\nimport updateLocale from 'dayjs/plugin/updateLocale'\nimport customParseFormat from 'dayjs/plugin/customParseFormat'\n\nexport type DateTimeFormat = {\n value: Date | string | number\n valueFormat?: string\n formatString?: string\n language?: string\n relativeTime?: Record<string, string>\n from?: boolean\n to?: boolean\n shouldSubtractDay?: boolean\n shouldAddDay?: boolean\n showPreffix?: boolean\n}\n\nconst relativeTimeConfig = {\n thresholds: [\n { l: 's', r: 1 },\n { l: 'm', r: 1 },\n { l: 'mm', r: 59, d: 'minute' },\n { l: 'h', r: 1 },\n { l: 'hh', r: 23, d: 'hour' },\n { l: 'd', r: 1 },\n { l: 'dd', r: 29, d: 'day' },\n { l: 'M', r: 1 },\n { l: 'MM', r: 11, d: 'month' },\n { l: 'y', r: 1 },\n { l: 'yy', d: 'year' },\n ],\n}\n\nconst relativeTimeEN = {\n future: 'in %s',\n past: '%s ago',\n s: 'now',\n m: 'now',\n mm: 'now',\n h: '1 hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days', // probably 'a week' instead?\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n}\n\nconst relativeTimeCZ = {\n future: 'za %s',\n past: '%s před',\n s: 'nyní',\n m: 'nyní',\n mm: 'nyní',\n h: '1 hodinu',\n hh: '%d hodiny',\n d: 'den',\n dd: '%d dny',\n M: 'měsíc',\n MM: '%d měsíci',\n y: 'rok',\n yy: '%d roky',\n}\n\ndayjs.extend(customParseFormat)\ndayjs.extend(relativeTime, relativeTimeConfig)\ndayjs.extend(updateLocale)\n\ndayjs.updateLocale('cz', {\n relativeTime: {\n ...relativeTimeCZ,\n },\n})\ndayjs.updateLocale('en', {\n relativeTime: {\n ...relativeTimeEN,\n },\n})\n\nexport const getTimeFromNowOriginal = (value: string, language: string): string => {\n dayjs.updateLocale('en', {\n relativeTime: {\n ...(language === 'cz' ? relativeTimeCZ : relativeTimeEN),\n ...relativeTime,\n },\n })\n return dayjs(value, undefined).fromNow(true)\n}\n\nexport const getTimeFromNow = (\n value: Date | string | number,\n valueFormat?: Partial<DateTimeFormat>,\n): string => getDateTime({ ...valueFormat, from: true, value })\n\nexport const getTimeTo = (\n value: Date | string | number,\n valueFormat?: Partial<DateTimeFormat>,\n): string => getDateTime({ ...valueFormat, to: true, value })\n\nexport const getDateTime = ({\n value,\n valueFormat,\n formatString,\n language = 'en',\n relativeTime,\n from,\n to,\n shouldAddDay = false,\n shouldSubtractDay = false,\n showPreffix = false,\n}: DateTimeFormat): string => {\n dayjs.updateLocale('en', {\n relativeTime: {\n ...(language === 'cz' ? relativeTimeCZ : relativeTimeEN),\n ...relativeTime,\n },\n })\n\n dayjs.locale(language)\n\n if (!from && to) {\n const dateTo = dayjs(value, valueFormat || undefined).add(shouldAddDay ? 1 : 0, 'day')\n\n return dayjs(new Date()).locale(language).to(dateTo, !showPreffix)\n }\n\n if (from && !to) {\n const dateTo = dayjs(value, valueFormat || undefined).subtract(shouldSubtractDay ? 1 : 0, 'day')\n\n return dayjs(dateTo, valueFormat || undefined).locale(language).fromNow(!showPreffix)\n }\n\n return dayjs(value, valueFormat || undefined).locale(language).format(formatString)\n}\n\nexport const dateRangeFormat = (\n dateFrom: Date, dateTo: Date, shortFormat: string, longFormat: string,\n delimiter = ' - ', datePeriod: UnitType = 'month',\n) : string => {\n const dayJSFrom = dayjs(dateFrom)\n const dayJSTo = dayjs(dateTo)\n\n const diffMonths = dayJSFrom.diff(dayJSTo, datePeriod)\n\n return `${dayJSFrom.format(diffMonths === 0 ? shortFormat : longFormat)}${delimiter}${dayJSTo.format(longFormat)}`\n}\n"],"names":["relativeTimeEN","future","past","s","m","mm","h","hh","d","dd","M","MM","y","yy","relativeTimeCZ","dayjs","extend","customParseFormat","relativeTime","thresholds","l","r","updateLocale","getDateTime","_ref","value","valueFormat","formatString","language","from","to","shouldAddDay","shouldSubtractDay","showPreffix","default","locale","dateTo","undefined","add","Date","subtract","fromNow","format","dateFrom","shortFormat","longFormat","delimiter","arguments","length","datePeriod","dayJSFrom","dayJSTo","diffMonths","diff","concat","getTimeFromNow","getTimeFromNow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";var t=require("dayjs");exports.DATE_FORMAT="MM-DD-YYYY HH-mm",exports.formatDateToTimestamp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return t(e).format("YYYY-MM-DD HH:mm:ss")},exports.getDate=()=>(new Date).toString();
1
+ "use strict";function t(t){return t&&t.__esModule?t:{default:t}}var e=t(require("dayjs"));exports.DATE_FORMAT="MM-DD-YYYY HH-mm",exports.formatDateToTimestamp=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return e.default(t).format("YYYY-MM-DD HH:mm:ss")},exports.getDate=()=>(new Date).toString();
2
2
  //# sourceMappingURL=date.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date.js","sources":["../../../../../../../src/core/utils/helpers/date.ts"],"sourcesContent":["import dayjs from 'dayjs'\n\nexport const getDate = (): string => new Date().toString()\nexport const DATE_FORMAT = 'MM-DD-YYYY HH-mm'\n\nexport const formatDateToTimestamp = (date = new Date()): string => dayjs(date).format('YYYY-MM-DD HH:mm:ss')\n"],"names":["date","arguments","length","undefined","Date","dayjs","format","getDate","toString"],"mappings":"wDAG2B,iDAEU,WAAA,IAACA,EAAIC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAA,GAAG,IAAIG,KAAM,OAAaC,EAAML,GAAMM,OAAO,sBAAsB,kBAHtFC,KAAc,IAAIH,MAAOI"}
1
+ {"version":3,"file":"date.js","sources":["../../../../../../../src/core/utils/helpers/date.ts"],"sourcesContent":["import dayjs from 'dayjs'\n\nexport const getDate = (): string => new Date().toString()\nexport const DATE_FORMAT = 'MM-DD-YYYY HH-mm'\n\nexport const formatDateToTimestamp = (date = new Date()): string => dayjs(date).format('YYYY-MM-DD HH:mm:ss')\n"],"names":["date","arguments","length","undefined","Date","dayjs","default","format","getDate","toString"],"mappings":"8GAG2B,iDAEU,WAAA,IAACA,EAAIC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAA,GAAG,IAAIG,KAAM,OAAaC,EAAKC,QAACN,GAAMO,OAAO,sBAAsB,kBAHtFC,KAAc,IAAIJ,MAAOK"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react"),t=require("styled-components");const i={start:"flex-start","flex-start":"flex-start",end:"flex-end","flex-end":"flex-end"},r=e=>e&&i[e]||e,l=e.memo(t.div.withConfig({displayName:"Flex",componentId:"sc-19vq3db-0"})(["display:flex;position:relative;flex-direction:",";flex:",";flex-grow:",";flex-shrink:",";flex-basis:",";flex-wrap:",";gap:",";text-align:",";justify-content:",";align-items:",";align-self:",";margin:",";padding:",";width:",";height:",";max-width:",";max-height:",";min-width:",";min-height:",";border-radius:",";"],(e=>{let{direction:t}=e;return t||"row"}),(e=>{let{flex:t}=e;return void 0!==t?t:"0"}),(e=>{let{flexGrow:t}=e;return void 0!==t?t:"0"}),(e=>{let{flexShrink:t}=e;return void 0!==t?t:"0"}),(e=>{let{flexBasis:t}=e;return t||"auto"}),(e=>{let{flexWrap:t}=e;return t||"nowrap"}),(e=>{let{gap:t}=e;return void 0!==t?t:"0"}),(e=>{let{alignText:t}=e;return t||"left"}),(e=>{let{justify:t}=e;return r(t)||"flex-start"}),(e=>{let{align:t}=e;return r(t)||"flex-start"}),(e=>{let{alignSelf:t}=e;return t||"auto"}),(e=>{let{margin:t}=e;return t||"0"}),(e=>{let{padding:t}=e;return t||"0"}),(e=>{let{width:t}=e;return t||"auto"}),(e=>{let{height:t}=e;return t||"auto"}),(e=>{let{maxWidth:t}=e;return t||"none"}),(e=>{let{maxHeight:t}=e;return t||"none"}),(e=>{let{minWidth:t}=e;return t||"0"===t?t:"0"}),(e=>{let{minHeight:t}=e;return t||"0"}),(e=>{let{borderRadius:t}=e;return t||"initial"}))),n=e.memo(t(l).attrs((e=>({width:e.width||"100%",height:e.height||"100%",justify:e.justify||"center",align:e.align||"center",...e}))).withConfig({displayName:"Flex__FlexWrapper",componentId:"sc-19vq3db-1"})([""])),a=e.memo(t(l).attrs((e=>({width:"initial",...e}))).withConfig({displayName:"Flex__FlexTight",componentId:"sc-19vq3db-2"})([""])),d=e.memo(t(l).attrs((e=>({width:"initial",style:{text:"blue",padding:"1rem",border:"1px solid green"},...e}))).withConfig({displayName:"Flex__FlexTightStyled",componentId:"sc-19vq3db-3"})([""]));exports.Flex=l,exports.FlexTight=a,exports.FlexTightStyled=d,exports.FlexWrapper=n;
1
+ "use strict";var e=require("react");function t(e){return e&&e.__esModule?e:{default:e}}var r=t(require("styled-components"));const i={start:"flex-start","flex-start":"flex-start",end:"flex-end","flex-end":"flex-end"},l=e=>e&&i[e]||e,n=e.memo(r.default.div.withConfig({displayName:"Flex",componentId:"sc-19vq3db-0"})(["display:flex;position:relative;flex-direction:",";flex:",";flex-grow:",";flex-shrink:",";flex-basis:",";flex-wrap:",";gap:",";text-align:",";justify-content:",";align-items:",";align-self:",";margin:",";padding:",";width:",";height:",";max-width:",";max-height:",";min-width:",";min-height:",";border-radius:",";"],(e=>{let{direction:t}=e;return t||"row"}),(e=>{let{flex:t}=e;return void 0!==t?t:"0"}),(e=>{let{flexGrow:t}=e;return void 0!==t?t:"0"}),(e=>{let{flexShrink:t}=e;return void 0!==t?t:"0"}),(e=>{let{flexBasis:t}=e;return t||"auto"}),(e=>{let{flexWrap:t}=e;return t||"nowrap"}),(e=>{let{gap:t}=e;return void 0!==t?t:"0"}),(e=>{let{alignText:t}=e;return t||"left"}),(e=>{let{justify:t}=e;return l(t)||"flex-start"}),(e=>{let{align:t}=e;return l(t)||"flex-start"}),(e=>{let{alignSelf:t}=e;return t||"auto"}),(e=>{let{margin:t}=e;return t||"0"}),(e=>{let{padding:t}=e;return t||"0"}),(e=>{let{width:t}=e;return t||"auto"}),(e=>{let{height:t}=e;return t||"auto"}),(e=>{let{maxWidth:t}=e;return t||"none"}),(e=>{let{maxHeight:t}=e;return t||"none"}),(e=>{let{minWidth:t}=e;return t||"0"===t?t:"0"}),(e=>{let{minHeight:t}=e;return t||"0"}),(e=>{let{borderRadius:t}=e;return t||"initial"}))),a=e.memo(r.default(n).attrs((e=>({width:e.width||"100%",height:e.height||"100%",justify:e.justify||"center",align:e.align||"center",...e}))).withConfig({displayName:"Flex__FlexWrapper",componentId:"sc-19vq3db-1"})([""])),d=e.memo(r.default(n).attrs((e=>({width:"initial",...e}))).withConfig({displayName:"Flex__FlexTight",componentId:"sc-19vq3db-2"})([""])),o=e.memo(r.default(n).attrs((e=>({width:"initial",style:{text:"blue",padding:"1rem",border:"1px solid green"},...e}))).withConfig({displayName:"Flex__FlexTightStyled",componentId:"sc-19vq3db-3"})([""]));exports.Flex=n,exports.FlexTight=d,exports.FlexTightStyled=o,exports.FlexWrapper=a;
2
2
  //# sourceMappingURL=Flex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.js","sources":["../../../../../../../src/core/ui/components/container/Flex.ts"],"sourcesContent":["import { memo } from 'react'\nimport styled from 'styled-components'\n\nexport type FlexProps = {\n flex?: string\n flexGrow?: string | number\n alignText?: 'center' | 'right' | 'left'\n direction?: string\n flexShrink?: string | number\n flexBasis?: string\n flexWrap?: string\n justify?: string\n align?: string\n alignSelf?: string\n margin?: string\n padding?: string\n width?: string\n height?: string\n maxWidth?: string\n maxHeight?: string\n minWidth?: string\n minHeight?: string\n gap?: string\n css?: string\n borderRadius?: string\n}\n\nconst flexValueMap: Record<string, string> = {\n start: 'flex-start',\n 'flex-start': 'flex-start',\n end: 'flex-end',\n 'flex-end': 'flex-end',\n}\n\nconst resolveFlexProps = (value?: string): string | undefined => (value ? (flexValueMap[value] || value) : value)\n\nexport const Flex = memo(styled.div<FlexProps>`\n display: flex;\n position: relative;\n flex-direction: ${({ direction }: Partial<FlexProps>) => direction || 'row'};\n flex: ${({ flex }: Partial<FlexProps>) => (flex !== undefined ? flex : '0')};\n flex-grow: ${({ flexGrow }: Partial<FlexProps>) => (flexGrow !== undefined ? flexGrow : '0')};\n flex-shrink: ${({ flexShrink }: Partial<FlexProps>) => (flexShrink !== undefined ? flexShrink : '0')};\n flex-basis: ${({ flexBasis }: Partial<FlexProps>) => flexBasis || 'auto'};\n flex-wrap: ${({ flexWrap }: Partial<FlexProps>) => flexWrap || 'nowrap'};\n gap: ${({ gap }: Partial<FlexProps>) => (gap !== undefined ? gap : '0')};\n text-align: ${({ alignText }: Partial<FlexProps>) => alignText || 'left'};\n justify-content: ${({ justify }: Partial<FlexProps>) => resolveFlexProps(justify) || 'flex-start'};\n align-items: ${({ align }: Partial<FlexProps>) => resolveFlexProps(align) || 'flex-start'};\n align-self: ${({ alignSelf }: Partial<FlexProps>) => alignSelf || 'auto'};\n margin: ${({ margin }: Partial<FlexProps>) => margin || '0'};\n padding: ${({ padding }: Partial<FlexProps>) => padding || '0'};\n width: ${({ width }: Partial<FlexProps>) => width || 'auto'};\n height: ${({ height }: Partial<FlexProps>) => height || 'auto'};\n max-width: ${({ maxWidth }: Partial<FlexProps>) => maxWidth || 'none'};\n max-height: ${({ maxHeight }: Partial<FlexProps>) => maxHeight || 'none'};\n min-width: ${({ minWidth }: Partial<FlexProps>) => ((minWidth || minWidth === '0') ? minWidth : '0')};\n min-height: ${({ minHeight }: Partial<FlexProps>) => minHeight || '0'};\n border-radius: ${({ borderRadius }: Partial<FlexProps>) => borderRadius || 'initial'};\n`)\n\n// default flex centralized, 100% width and height\nexport const FlexWrapper = memo(styled(Flex).attrs((props: Partial<FlexProps>) => (\n {\n width: props.width || '100%',\n height: props.height || '100%',\n justify: props.justify || 'center',\n align: props.align || 'center',\n ...props,\n }\n))``)\n\nexport const FlexTight = memo(styled(Flex).attrs((props: Partial<FlexProps>) => ({\n width: 'initial',\n ...props,\n}))``)\n\nexport const FlexTightStyled = memo(styled(Flex).attrs((props: Partial<FlexProps>) => ({\n width: 'initial',\n style: {\n text: 'blue',\n padding: '1rem',\n border: '1px solid green',\n },\n ...props,\n}))``)\n"],"names":["flexValueMap","start","end","resolveFlexProps","value","Flex","memo","styled","div","withConfig","displayName","componentId","_ref","direction","_ref2","flex","undefined","_ref3","flexGrow","_ref4","flexShrink","_ref5","flexBasis","_ref6","flexWrap","_ref7","gap","_ref8","alignText","_ref9","justify","_ref10","align","_ref11","alignSelf","_ref12","margin","_ref13","padding","_ref14","width","_ref15","height","_ref16","maxWidth","_ref17","maxHeight","_ref18","minWidth","_ref19","minHeight","_ref20","borderRadius","FlexWrapper","attrs","props","FlexTight","FlexTightStyled","style","text","border"],"mappings":"mEA2BA,MAAMA,EAAuC,CAC3CC,MAAO,aACP,aAAc,aACdC,IAAK,WACL,WAAY,YAGRC,EAAoBC,GAAwCA,GAASJ,EAAaI,IAAmBA,EAE9FC,EAAOC,EAAIA,KAACC,EAAOC,IAAGC,WAAA,CAAAC,YAAA,OAAAC,YAAA,gBAAVJ,CAAU,CAAA,iDAAA,SAAA,cAAA,gBAAA,eAAA,cAAA,QAAA,eAAA,oBAAA,gBAAA,eAAA,WAAA,YAAA,UAAA,WAAA,cAAA,eAAA,cAAA,eAAA,kBAAA,MAGfK,IAAA,IAACC,UAAEA,GAA+BD,EAAA,OAAKC,GAAa,KAAK,IACnEC,IAAA,IAACC,KAAEA,GAA0BD,EAAA,YAAeE,IAATD,EAAqBA,EAAO,GAAG,IAC7DE,IAAA,IAACC,SAAEA,GAA8BD,EAAA,YAAmBD,IAAbE,EAAyBA,EAAW,GAAG,IAC5EC,IAAA,IAACC,WAAEA,GAAgCD,EAAA,YAAqBH,IAAfI,EAA2BA,EAAa,GAAG,IACrFC,IAAA,IAACC,UAAEA,GAA+BD,EAAA,OAAKC,GAAa,MAAM,IAC3DC,IAAA,IAACC,SAAEA,GAA8BD,EAAA,OAAKC,GAAY,QAAQ,IAChEC,IAAA,IAACC,IAAEA,GAAyBD,EAAA,YAAcT,IAARU,EAAoBA,EAAM,GAAG,IACxDC,IAAA,IAACC,UAAEA,GAA+BD,EAAA,OAAKC,GAAa,MAAM,IACrDC,IAAA,IAACC,QAAEA,GAA6BD,EAAA,OAAK1B,EAAiB2B,IAAY,YAAY,IAClFC,IAAA,IAACC,MAAEA,GAA2BD,EAAA,OAA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ARiCJ,CAQjC,CAAA"}
1
+ {"version":3,"file":"Flex.js","sources":["../../../../../../../src/core/ui/components/container/Flex.ts"],"sourcesContent":["import { memo } from 'react'\nimport styled from 'styled-components'\n\nexport type FlexProps = {\n flex?: string\n flexGrow?: string | number\n alignText?: 'center' | 'right' | 'left'\n direction?: string\n flexShrink?: string | number\n flexBasis?: string\n flexWrap?: string\n justify?: string\n align?: string\n alignSelf?: string\n margin?: string\n padding?: string\n width?: string\n height?: string\n maxWidth?: string\n maxHeight?: string\n minWidth?: string\n minHeight?: string\n gap?: string\n css?: string\n borderRadius?: string\n}\n\nconst flexValueMap: Record<string, string> = {\n start: 'flex-start',\n 'flex-start': 'flex-start',\n end: 'flex-end',\n 'flex-end': 'flex-end',\n}\n\nconst resolveFlexProps = (value?: string): string | undefined => (value ? (flexValueMap[value] || value) : value)\n\nexport const Flex = memo(styled.div<FlexProps>`\n display: flex;\n position: relative;\n flex-direction: ${({ direction }: Partial<FlexProps>) => direction || 'row'};\n flex: ${({ flex }: Partial<FlexProps>) => (flex !== undefined ? flex : '0')};\n flex-grow: ${({ flexGrow }: Partial<FlexProps>) => (flexGrow !== undefined ? flexGrow : '0')};\n flex-shrink: ${({ flexShrink }: Partial<FlexProps>) => (flexShrink !== undefined ? flexShrink : '0')};\n flex-basis: ${({ flexBasis }: Partial<FlexProps>) => flexBasis || 'auto'};\n flex-wrap: ${({ flexWrap }: Partial<FlexProps>) => flexWrap || 'nowrap'};\n gap: ${({ gap }: Partial<FlexProps>) => (gap !== undefined ? gap : '0')};\n text-align: ${({ alignText }: Partial<FlexProps>) => alignText || 'left'};\n justify-content: ${({ justify }: Partial<FlexProps>) => resolveFlexProps(justify) || 'flex-start'};\n align-items: ${({ align }: Partial<FlexProps>) => resolveFlexProps(align) || 'flex-start'};\n align-self: ${({ alignSelf }: Partial<FlexProps>) => alignSelf || 'auto'};\n margin: ${({ margin }: Partial<FlexProps>) => margin || '0'};\n padding: ${({ padding }: Partial<FlexProps>) => padding || '0'};\n width: ${({ width }: Partial<FlexProps>) => width || 'auto'};\n height: ${({ height }: Partial<FlexProps>) => height || 'auto'};\n max-width: ${({ maxWidth }: Partial<FlexProps>) => maxWidth || 'none'};\n max-height: ${({ maxHeight }: Partial<FlexProps>) => maxHeight || 'none'};\n min-width: ${({ minWidth }: Partial<FlexProps>) => ((minWidth || minWidth === '0') ? minWidth : '0')};\n min-height: ${({ minHeight }: Partial<FlexProps>) => minHeight || '0'};\n border-radius: ${({ borderRadius }: Partial<FlexProps>) => borderRadius || 'initial'};\n`)\n\n// default flex centralized, 100% width and height\nexport const FlexWrapper = memo(styled(Flex).attrs((props: Partial<FlexProps>) => (\n {\n width: props.width || '100%',\n height: props.height || '100%',\n justify: props.justify || 'center',\n align: props.align || 'center',\n ...props,\n }\n))``)\n\nexport const FlexTight = memo(styled(Flex).attrs((props: Partial<FlexProps>) => ({\n width: 'initial',\n ...props,\n}))``)\n\nexport const FlexTightStyled = memo(styled(Flex).attrs((props: Partial<FlexProps>) => ({\n width: 'initial',\n style: {\n text: 'blue',\n padding: '1rem',\n border: '1px solid green',\n },\n ...props,\n}))``)\n"],"names":["flexValueMap","start","end","resolveFlexProps","value","Flex","memo","styled","div","withConfig","displayName","componentId","_ref","direction","_ref2","flex","undefined","_ref3","flexGrow","_ref4","flexShrink","_ref5","flexBasis","_ref6","flexWrap","_ref7","gap","_ref8","alignText","_ref9","justify","_ref10","align","_ref11","alignSelf","_ref12","margin","_ref13","padding","_ref14","width","_ref15","height","_ref16","maxWidth","_ref17","maxHeight","_ref18","minWidth","_ref19","minHeight","_ref20","borderRadius","FlexWrapper","default","attrs","props","FlexTight","FlexTightStyled","style","text","border"],"mappings":"6HA2BA,MAAMA,EAAuC,CAC3CC,MAAO,aACP,aAAc,aACdC,IAAK,WACL,WAAY,YAGRC,EAAoBC,GAAwCA,GAASJ,EAAaI,IAAmBA,EAE9FC,EAAOC,EAAIA,KAACC,UAAOC,IAAGC,WAAA,CAAAC,YAAA,OAAAC,YAA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AA+BD,EAAA,OAAKC,GAAa,MAAM,IAC3DC,IAAA,IAACC,SAAEA,GAA8BD,EAAA,OAAOC,GAAyB,MAAbA,EAAoBA,EAAW,GAAG,IACrFC,IAAA,IAACC,UAAEA,GAA+BD,EAAA,OAAKC,GAAa,GAAG,IACpDC,IAAA,IAACC,aAAEA,GAAkCD,EAAA,OAAKC,GAAgB,SAAS,KAIzEC,EAAc/C,EAAIA,KAACC,EAAM+C,QAACjD,GAAMkD,OAAOC,IAClD,CACEhB,MAAOgB,EAAMhB,OAAS,OACtBE,OAAQc,EAAMd,QAAU,OACxBZ,QAAS0B,EAAM1B,SAAW,SAC1BE,MAAOwB,EAAMxB,OAAS,YACnBwB,MAEL/C,WAAA,CAAAC,YAAA,oBAAAC,YAAA,gBAR8BJ,CAQ9B,CAAA,MAEWkD,EAAYnD,EAAIA,KAACC,EAAM+C,QAACjD,GAAMkD,OAAOC,IAA+B,CAC/EhB,MAAO,aACJgB,MACF/C,WAAA,CAAAC,YAAA,kBAAAC,YAAA,gBAH2BJ,CAG3B,CAAA,MAEUmD,EAAkBpD,EAAIA,KAACC,EAAM+C,QAACjD,GAAMkD,OAAOC,IAA+B,CACrFhB,MAAO,UACPmB,MAAO,CACLC,KAAM,OACNtB,QAAS,OACTuB,OAAQ,sBAEPL,MACF/C,WAAA,CAAAC,YAAA,wBAAAC,YAAA,gBARiCJ,CAQjC,CAAA"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),r=require("styled-components"),l=require("react"),s=require("./Flex.js");const c=l.memo((r=>{let{title:l,border:s,background:c,onClick:t,cssProp:a,children:n,...i}=r;return React.createElement(o,e.extends({onClick:t},i,{$_css:s||"border: 1px solid #999999;",$_css2:c||"background-color: rgba(0, 120, 255, 0.2);",$_css3:a}),l&&React.createElement("h2",null,l),n&&n)}));c.displayName="Placeholder";var o=r(s.FlexWrapper).withConfig({displayName:"Placeholder___StyledFlexWrapper",componentId:"sc-ozx0bx-0"})([""," "," ",""],(e=>e.$_css),(e=>e.$_css2),(e=>e.$_css3));exports.Placeholder=c;
1
+ "use strict";var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),r=require("styled-components"),l=require("react"),s=require("./Flex.js");function c(e){return e&&e.__esModule?e:{default:e}}var t=c(r);const o=l.memo((r=>{let{title:l,border:s,background:c,onClick:t,cssProp:o,children:n,...d}=r;return React.createElement(a,e.extends({onClick:t},d,{$_css:s||"border: 1px solid #999999;",$_css2:c||"background-color: rgba(0, 120, 255, 0.2);",$_css3:o}),l&&React.createElement("h2",null,l),n&&n)}));o.displayName="Placeholder";var a=t.default(s.FlexWrapper).withConfig({displayName:"Placeholder___StyledFlexWrapper",componentId:"sc-ozx0bx-0"})([""," "," ",""],(e=>e.$_css),(e=>e.$_css2),(e=>e.$_css3));exports.Placeholder=o;
2
2
  //# sourceMappingURL=Placeholder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Placeholder.js","sources":["../../../../../../../src/core/ui/components/container/Placeholder.tsx"],"sourcesContent":["import { FC, memo, PropsWithChildren } from 'react'\n\nimport { FlexWrapper, FlexProps } from './Flex'\n\nexport type PlaceholderProps = FlexProps & PropsWithChildren<unknown> & {\n title?: string\n cssProp?: string\n background?: string\n border?: string\n onClick?: () => void\n}\n\nexport const Placeholder: FC<PlaceholderProps>\n= memo<PlaceholderProps>(({ title, border, background, onClick, cssProp, children, ...props }: PlaceholderProps) => (\n <FlexWrapper\n css={`\n ${border || 'border: 1px solid #999999;'}\n ${background || 'background-color: rgba(0, 120, 255, 0.2);'}\n ${cssProp}\n `}\n onClick={onClick}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n >\n {title && (<h2>{title}</h2>)}\n {children && children}\n </FlexWrapper>\n))\n\nPlaceholder.displayName = 'Placeholder'\n"],"names":["Placeholder","memo","_ref","title","border","background","onClick","cssProp","children","props","React","createElement","_StyledFlexWrapper","_extends","$_css","$_css2","$_css3","displayName","_styled","FlexWrapper","withConfig","componentId","p"],"mappings":"4JAYaA,MAAAA,EACXC,EAAIA,MAAmBC,IAAA,IAACC,MAAEA,EAAKC,OAAEA,EAAMC,WAAEA,EAAUC,QAAEA,EAAOC,QAAEA,EAAOC,SAAEA,KAAaC,GAAyBP,EAAA,OAC7GQ,MAAAC,cAAAC,EAAAC,UAAA,CAMEP,QAASA,GAELG,EAAK,CAAAK,MANLV,GAAU,6BAA4BW,OACtCV,GAAc,4CAA2CW,OACzDT,IAMHJ,GAAUO,MAAAC,cAAA,KAAA,KAAKR,GACfK,GAAYA,EACD,IAGhBR,EAAYiB,YAAc,cAAa,IAAAL,EAAAM,EAAAC,eAAAC,WAAA,CAAAH,YAAA,kCAAAI,YAAA,eAAAH,CAAA,CAAA,GAAA,IAAA,IAAA,KAAAI,GAAAA,EAAAR,QAAAQ,GAAAA,EAAAP,SAAAO,GAAAA,EAAAN"}
1
+ {"version":3,"file":"Placeholder.js","sources":["../../../../../../../src/core/ui/components/container/Placeholder.tsx"],"sourcesContent":["import { FC, memo, PropsWithChildren } from 'react'\n\nimport { FlexWrapper, FlexProps } from './Flex'\n\nexport type PlaceholderProps = FlexProps & PropsWithChildren<unknown> & {\n title?: string\n cssProp?: string\n background?: string\n border?: string\n onClick?: () => void\n}\n\nexport const Placeholder: FC<PlaceholderProps>\n= memo<PlaceholderProps>(({ title, border, background, onClick, cssProp, children, ...props }: PlaceholderProps) => (\n <FlexWrapper\n css={`\n ${border || 'border: 1px solid #999999;'}\n ${background || 'background-color: rgba(0, 120, 255, 0.2);'}\n ${cssProp}\n `}\n onClick={onClick}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n >\n {title && (<h2>{title}</h2>)}\n {children && children}\n </FlexWrapper>\n))\n\nPlaceholder.displayName = 'Placeholder'\n"],"names":["Placeholder","memo","_ref","title","border","background","onClick","cssProp","children","props","React","createElement","_StyledFlexWrapper","_extends","$_css","$_css2","$_css3","displayName","_styled","default","FlexWrapper","withConfig","componentId","p"],"mappings":"0NAYaA,MAAAA,EACXC,EAAIA,MAAmBC,IAAA,IAACC,MAAEA,EAAKC,OAAEA,EAAMC,WAAEA,EAAUC,QAAEA,EAAOC,QAAEA,EAAOC,SAAEA,KAAaC,GAAyBP,EAAA,OAC7GQ,MAAAC,cAAAC,EAAAC,UAAA,CAMEP,QAASA,GAELG,EAAK,CAAAK,MANLV,GAAU,6BAA4BW,OACtCV,GAAc,4CAA2CW,OACzDT,IAMHJ,GAAUO,MAAAC,cAAA,KAAA,KAAKR,GACfK,GAAYA,EACD,IAGhBR,EAAYiB,YAAc,cAAa,IAAAL,EAAAM,EAAAC,QAAAC,eAAAC,WAAA,CAAAJ,YAAA,kCAAAK,YAAA,eAAAJ,CAAA,CAAA,GAAA,IAAA,IAAA,KAAAK,GAAAA,EAAAT,QAAAS,GAAAA,EAAAR,SAAAQ,GAAAA,EAAAP"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("styled-components"),a=require("react");let n=()=>"#000000";let o=a.memo((function(){return React.createElement("span",null)}));const l=t.div.withConfig({displayName:"Field__FieldWrapper",componentId:"sc-i8c0jy-0"})(["opacity:",";pointer-events:",";flex:1 1 auto;width:100%;@media (min-width:400px){flex:1;}.label{font-size:0.8rem !important;font-weight:normal;}.help{text-align:left;}.mainControl{flex:1;border-radius:6px;box-shadow:0 0 6px 1px rgba(0,0,0,0.06);will-change:box-shadow;transition:box-shadow 250ms ease-in-out;&:hover{box-shadow:0 0 8px 2px rgba(0,0,0,0.1);}}button{box-shadow:0 0 8px 2px rgba(0,0,0,0.1);}.select{width:100%;flex:1;&::after{border-color:#000000 !important;}}.icon{&.is-action{cursor:pointer;pointer-events:initial !important;}}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}input[type=number]{-moz-appearance:textfield;}.input[type=date]::-webkit-calendar-picker-indicator{opacity:0;-webkit-appearance:none;position:absolute;left:0;top:0;width:40px;height:100%;margin:0;padding:0;cursor:pointer;}textarea{resize:none;}"],(e=>{let{disabled:t,userDisabled:a}=e;return t||a?.5:1}),(e=>{let{disabled:t,userDisabled:a}=e;return t||a?"none":"auto"}));var i=t(l).withConfig({displayName:"Field___StyledFieldWrapper",componentId:"sc-i8c0jy-1"})(["",""],(e=>e.$_css));const c=a.memo((function(t){let{options:a,value:n,inputRef:o,...l}=t;return React.createElement("div",{className:"select"},React.createElement("select",e.extends({},l,{ref:o,defaultValue:n}),null==a?void 0:a.map((e=>React.createElement("option",{key:"".concat(JSON.stringify(e)),value:"object"==typeof e?null==e?void 0:e.value:e},"object"==typeof e?null==e?void 0:e.label:e)))))})),r=t.input.withConfig({displayName:"Field__InputComponent",componentId:"sc-i8c0jy-2"})([""]),s=t.textarea.withConfig({displayName:"Field__TextAreaComponent",componentId:"sc-i8c0jy-3"})([""]),p=t.label.withConfig({displayName:"Field__StyledFieldLabel",componentId:"sc-i8c0jy-4"})(["text-align:left;"]),d=a.memo((t=>{let{label:l,name:d,type:m="text",value:u,defaultValue:f,placeholder:h,inputRef:b,error:x,disabled:g,userDisabled:y,withoutComponent:v,helpTextInfo:w,helpText:C,children:N,iconLeft:R,iconRight:E,addon:F,className:_,onChange:k,onChangeInner:I,onBlur:j,onFocus:D,rightIconClick:B,leftIconClick:S,options:q,css:z,...L}=t,T=r;N||"textarea"!==m||(T=s);const V=a.useCallback((e=>{var t;y?null==e||null===(t=e.preventDefault)||void 0===t||t.call(e):D&&D(e)}),[y,D]),W=a.useCallback((e=>{y||(I&&null!=e&&e.target?(e.target.value=I(e.target.value),k&&k(e)):k&&k(e))}),[I,k,y]),K=a.useMemo((()=>void 0===u?{defaultValue:f}:{value:u}),[u,f]);return React.createElement(i,{className:"field ".concat(_),error:x,disabled:g,userDisabled:y,$_css:z},React.createElement(p,{htmlFor:d,className:"label"},l),React.createElement("div",{className:"field ".concat(F?"has-addons":"")},React.createElement("div",{className:"control mainControl ".concat(R&&!v?"has-icons-left":""," ").concat(E?"has-icons-right":"")},!v&&(N||"select"!==m&&!q?!N&&React.createElement(T,e.extends({name:d,id:d,ref:b,className:"input ".concat(x?"is-danger":""),type:m,placeholder:h},K,{onChange:W,onBlur:j,onFocus:V,onKeyDown:V,autoComplete:"off",disabled:g},L)):React.createElement(c,e.extends({name:d,id:d,inputRef:b,className:"input ".concat(x?"is-danger":""),type:"select",placeholder:h,value:u,options:q,onChange:k,onBlur:j,onFocus:V,onKeyDown:V,autoComplete:"off",disabled:g},L))),R&&!v&&React.createElement("span",{className:"iconLeft icon is-small is-left ".concat(S?"is-action":""),onClick:S},React.createElement(o,{iconName:R,color:n})),E&&React.createElement("span",{className:"iconRight icon is-small is-right ".concat(B?"is-action":""),onClick:B},React.createElement(o,{iconName:E,color:n})),N&&N),F&&F),w&&React.createElement("p",{className:"help"},w),C&&React.createElement("p",{className:"help ".concat(x?"is-danger":"")},C))}));d.displayName="Field",exports.Field=d,exports.FieldWrapper=l,exports.Select=c,exports.setIconColor=e=>{n=e},exports.setIconComponent=e=>{o=e};
1
+ "use strict";var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("styled-components"),a=require("react");function n(e){return e&&e.__esModule?e:{default:e}}var l=n(t);let o=()=>"#000000";let i=a.memo((function(){return React.createElement("span",null)}));const c=l.default.div.withConfig({displayName:"Field__FieldWrapper",componentId:"sc-i8c0jy-0"})(["opacity:",";pointer-events:",";flex:1 1 auto;width:100%;@media (min-width:400px){flex:1;}.label{font-size:0.8rem !important;font-weight:normal;}.help{text-align:left;}.mainControl{flex:1;border-radius:6px;box-shadow:0 0 6px 1px rgba(0,0,0,0.06);will-change:box-shadow;transition:box-shadow 250ms ease-in-out;&:hover{box-shadow:0 0 8px 2px rgba(0,0,0,0.1);}}button{box-shadow:0 0 8px 2px rgba(0,0,0,0.1);}.select{width:100%;flex:1;&::after{border-color:#000000 !important;}}.icon{&.is-action{cursor:pointer;pointer-events:initial !important;}}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}input[type=number]{-moz-appearance:textfield;}.input[type=date]::-webkit-calendar-picker-indicator{opacity:0;-webkit-appearance:none;position:absolute;left:0;top:0;width:40px;height:100%;margin:0;padding:0;cursor:pointer;}textarea{resize:none;}"],(e=>{let{disabled:t,userDisabled:a}=e;return t||a?.5:1}),(e=>{let{disabled:t,userDisabled:a}=e;return t||a?"none":"auto"}));var r=l.default(c).withConfig({displayName:"Field___StyledFieldWrapper",componentId:"sc-i8c0jy-1"})(["",""],(e=>e.$_css));const s=a.memo((function(t){let{options:a,value:n,inputRef:l,...o}=t;return React.createElement("div",{className:"select"},React.createElement("select",e.extends({},o,{ref:l,defaultValue:n}),null==a?void 0:a.map((e=>React.createElement("option",{key:"".concat(JSON.stringify(e)),value:"object"==typeof e?null==e?void 0:e.value:e},"object"==typeof e?null==e?void 0:e.label:e)))))})),p=l.default.input.withConfig({displayName:"Field__InputComponent",componentId:"sc-i8c0jy-2"})([""]),d=l.default.textarea.withConfig({displayName:"Field__TextAreaComponent",componentId:"sc-i8c0jy-3"})([""]),u=l.default.label.withConfig({displayName:"Field__StyledFieldLabel",componentId:"sc-i8c0jy-4"})(["text-align:left;"]),m=a.memo((t=>{let{label:n,name:l,type:c="text",value:m,defaultValue:f,placeholder:h,inputRef:b,error:x,disabled:g,userDisabled:y,withoutComponent:v,helpTextInfo:w,helpText:C,children:N,iconLeft:R,iconRight:_,addon:E,className:F,onChange:k,onChangeInner:I,onBlur:j,onFocus:D,rightIconClick:B,leftIconClick:S,options:q,css:z,...L}=t,T=p;N||"textarea"!==c||(T=d);const V=a.useCallback((e=>{var t;y?null==e||null===(t=e.preventDefault)||void 0===t||t.call(e):D&&D(e)}),[y,D]),W=a.useCallback((e=>{y||(I&&null!=e&&e.target?(e.target.value=I(e.target.value),k&&k(e)):k&&k(e))}),[I,k,y]),K=a.useMemo((()=>void 0===m?{defaultValue:f}:{value:m}),[m,f]);return React.createElement(r,{className:"field ".concat(F),error:x,disabled:g,userDisabled:y,$_css:z},React.createElement(u,{htmlFor:l,className:"label"},n),React.createElement("div",{className:"field ".concat(E?"has-addons":"")},React.createElement("div",{className:"control mainControl ".concat(R&&!v?"has-icons-left":""," ").concat(_?"has-icons-right":"")},!v&&(N||"select"!==c&&!q?!N&&React.createElement(T,e.extends({name:l,id:l,ref:b,className:"input ".concat(x?"is-danger":""),type:c,placeholder:h},K,{onChange:W,onBlur:j,onFocus:V,onKeyDown:V,autoComplete:"off",disabled:g},L)):React.createElement(s,e.extends({name:l,id:l,inputRef:b,className:"input ".concat(x?"is-danger":""),type:"select",placeholder:h,value:m,options:q,onChange:k,onBlur:j,onFocus:V,onKeyDown:V,autoComplete:"off",disabled:g},L))),R&&!v&&React.createElement("span",{className:"iconLeft icon is-small is-left ".concat(S?"is-action":""),onClick:S},React.createElement(i,{iconName:R,color:o})),_&&React.createElement("span",{className:"iconRight icon is-small is-right ".concat(B?"is-action":""),onClick:B},React.createElement(i,{iconName:_,color:o})),N&&N),E&&E),w&&React.createElement("p",{className:"help"},w),C&&React.createElement("p",{className:"help ".concat(x?"is-danger":"")},C))}));m.displayName="Field",exports.Field=m,exports.FieldWrapper=c,exports.Select=s,exports.setIconColor=e=>{o=e},exports.setIconComponent=e=>{i=e};
2
2
  //# sourceMappingURL=Field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","sources":["../../../../../../../src/core/ui/components/field/Field.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\n/* eslint-disable jsx-a11y/no-static-element-interactions */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport { FC, ReactNode, memo, useMemo, useCallback, PropsWithChildren } from 'react'\nimport styled from 'styled-components'\n\nimport type { FieldError, IconComponentType } from './types'\n\nlet iconColor: string | (() => string) = () => '#000000'\n\nexport const setIconColor = (color: string | (() => string)): void => {\n iconColor = color\n}\n\nlet IconComponent: IconComponentType = memo(function IconComponent() { return <span /> })\n\nexport const setIconComponent = (component: IconComponentType): void => {\n IconComponent = component\n}\n\nexport type FileWrapperProps = PropsWithChildren<unknown> & {\n className?: string\n error?: boolean\n disabled?: boolean\n userDisabled?: boolean\n css?: string\n}\n\nexport const FieldWrapper: FC<FileWrapperProps> = styled.div<FileWrapperProps>`\n opacity: ${({ disabled, userDisabled }) => (disabled || userDisabled ? 0.5 : 1)};\n pointer-events: ${({ disabled, userDisabled }) => (disabled || userDisabled ? 'none' : 'auto')};\n flex: 1 1 auto;\n width: 100%;\n @media (min-width: 400px) {\n flex: 1;\n }\n .label {\n font-size: 0.8rem !important;\n font-weight: normal;\n }\n\n .help {\n text-align: left;\n }\n\n .mainControl {\n flex: 1;\n border-radius: 6px;\n box-shadow: 0 0 6px 1px rgba(0, 0, 0, 0.06);\n will-change: box-shadow;\n transition: box-shadow 250ms ease-in-out;\n &:hover {\n box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);\n }\n }\n button {\n box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);\n }\n .select {\n width: 100%;\n flex: 1;\n &::after {\n border-color: #000000 !important;\n }\n }\n\n .icon {\n &.is-action {\n cursor: pointer;\n pointer-events: initial !important;\n }\n }\n\n /* Chrome, Safari, Edge, Opera */\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n /* Firefox */\n input[type=number] {\n -moz-appearance: textfield;\n }\n\n .input[type=date]::-webkit-calendar-picker-indicator {\n opacity:0;\n -webkit-appearance: none;\n position: absolute;\n left: 0;\n top: 0;\n width: 40px;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n }\n\n textarea {\n resize: none;\n }\n`\n\ntype EventType = { target: any; type?: any } & Partial<Event>\nexport interface FieldProps {\n label?: string\n name?: string\n type?: string\n min?: number | string | Date | any\n max?: number | string | Date | any\n value?: string | number | readonly string[] | undefined\n defaultValue?: string | number | readonly string[] | undefined\n placeholder?: string\n inputRef?: ReactHookFormRef\n error?: boolean\n errors?: FieldError\n disabled?: boolean\n userDisabled?: boolean\n helpTextInfo?: string\n helpText?: string\n iconLeft?: string\n iconRight?: string\n withoutComponent?: boolean\n addon?: ReactNode\n children?: ReactNode\n className?: string\n onChange?: (event?: EventType) => unknown\n // TODO, rename... something like changeHandler or valueDecorator\n onChangeInner?: (value: string | number) => string | number\n onBlur?: (event?: EventType) => void\n onFocus?: (event?: EventType | undefined) => void\n rightIconClick?: (event?: EventType) => void\n leftIconClick?: (event?: EventType) => void\n options?: any[] | null\n creatable?: boolean\n async?: boolean\n css?: string\n [key: string]: any\n}\n\ninterface SelectProps extends FieldProps {\n id?: string\n}\n\ntype OptionObj = { label: string | number | undefined; value: string | number | undefined }\ntype Option = OptionObj | string | number\n\nexport const Select: FC<SelectProps>\n= memo<SelectProps>(\n function Select({ options, value, inputRef, ...props }: SelectProps) {\n return (\n <div className='select'>\n <select {...props} ref={inputRef} defaultValue={value}>\n {options?.map((option: Option) => (\n <option\n key={`${JSON.stringify(option)}`}\n value={typeof option === 'object' ? (option as OptionObj)?.value : option}\n >\n {typeof option === 'object' ? (option as OptionObj)?.label : option}\n </option>\n ))}\n </select>\n </div>\n )\n },\n)\n\nconst InputComponent = styled.input``\nconst TextAreaComponent = styled.textarea``\nconst StyledFieldLabel = styled.label`\n text-align: left;\n`\n\nexport const Field: FC<FieldProps> = memo<FieldProps>(({\n label,\n name,\n type = 'text',\n value,\n defaultValue,\n placeholder,\n inputRef,\n error,\n disabled,\n userDisabled,\n withoutComponent,\n helpTextInfo,\n helpText,\n children,\n iconLeft,\n iconRight,\n addon,\n className,\n onChange,\n onChangeInner,\n onBlur,\n onFocus,\n rightIconClick,\n leftIconClick,\n options,\n css,\n ...props\n}: FieldProps) => {\n let Component: FC<any> = InputComponent\n\n if (!children && type === 'textarea') {\n Component = TextAreaComponent\n }\n const handleFocus = useCallback((event: Event | EventType | undefined) => {\n if (userDisabled) {\n event?.preventDefault?.()\n } else {\n onFocus && onFocus(event)\n }\n }, [userDisabled, onFocus])\n\n const handleChange = useCallback((event: { target: { value: string } }) => {\n if (userDisabled) {\n return\n }\n if (onChangeInner && event?.target) {\n // eslint-disable-next-line no-param-reassign\n event.target.value = onChangeInner((event.target.value as string)) as string\n onChange && onChange(event as EventType)\n } else {\n onChange && onChange(event as EventType)\n }\n }, [onChangeInner, onChange, userDisabled])\n\n const valueProps = useMemo(() => {\n if (value === undefined) {\n return { defaultValue }\n }\n return { value }\n }, [value, defaultValue])\n\n return (\n <FieldWrapper\n className={`field ${className}`}\n error={error}\n disabled={disabled}\n userDisabled={userDisabled}\n css={css}\n >\n <StyledFieldLabel htmlFor={name} className='label'>{label}</StyledFieldLabel>\n <div className={`field ${addon ? 'has-addons' : ''}`}>\n <div\n className={`control mainControl ${iconLeft && !withoutComponent\n ? 'has-icons-left' : ''} ${iconRight ? 'has-icons-right' : ''}`}\n >\n {!withoutComponent && ((!children && (type === 'select' || options))\n ? (\n <Select\n name={name}\n id={name}\n inputRef={inputRef}\n className={`input ${error ? 'is-danger' : ''}`}\n type='select'\n placeholder={placeholder}\n value={value}\n options={options}\n // TODO also handle change but value versus event.target.value issue\n onChange={onChange}\n onBlur={onBlur}\n onFocus={handleFocus}\n onKeyDown={handleFocus}\n autoComplete='off'\n disabled={disabled}\n {...props}\n />\n )\n : (\n !children && (\n <Component\n name={name}\n id={name}\n ref={inputRef}\n className={`input ${error ? 'is-danger' : ''}`}\n type={type}\n placeholder={placeholder}\n {...valueProps}\n onChange={handleChange}\n onBlur={onBlur}\n onFocus={handleFocus}\n onKeyDown={handleFocus}\n autoComplete='off'\n disabled={disabled}\n {...props}\n />\n )))}\n\n {iconLeft && !withoutComponent && (\n <span\n className={`iconLeft icon is-small is-left ${leftIconClick ? 'is-action' : ''}`}\n onClick={leftIconClick}\n >\n <IconComponent\n iconName={iconLeft}\n color={iconColor}\n />\n </span>\n )}\n {iconRight && (\n <span\n className={`iconRight icon is-small is-right ${rightIconClick ? 'is-action' : ''}`}\n onClick={rightIconClick}\n >\n <IconComponent\n iconName={iconRight}\n color={iconColor}\n />\n </span>\n )}\n {children && children}\n </div>\n {addon && addon}\n </div>\n {helpTextInfo && <p className='help'>{helpTextInfo}</p>}\n {helpText && <p className={`help ${error ? 'is-danger' : ''}`}>{helpText}</p>}\n </FieldWrapper>\n )\n})\n\nField.displayName = 'Field'\n"],"names":["iconColor","IconComponent","memo","React","createElement","setIconComponent","FieldWrapper","styled","div","withConfig","displayName","componentId","_ref","disabled","userDisabled","_ref2","_StyledFieldWrapper","p","$_css","Select","_ref3","options","value","inputRef","props","className","_extends","ref","defaultValue","map","option","key","concat","JSON","stringify","label","InputComponent","input","TextAreaComponent","textarea","StyledFieldLabel","Field","_ref4","name","type","placeholder","error","withoutComponent","helpTextInfo","helpText","children","iconLeft","iconRight","addon","onChange","onChangeInner","onBlur","onFocus","rightIconClick","leftIconClick","css","Component","handleFocus","useCallback","event","_event$preventDefault","preventDefault","call","handleChange","target","valueProps","useMemo","undefined","htmlFor","id","onKeyDown","autoComplete","onClick","iconName","color","component"],"mappings":"qIAQA,IAAIA,EAAqCA,IAAM,UAM/C,IAAIC,EAAmCC,EAAAA,MAAK,WAA2B,OAAOC,MAAAC,cAAA,OAAA,KAAS,IAE1EC,MAYAC,EAAqCC,EAAOC,IAAGC,WAAA,CAAAC,YAAA,sBAAAC,YAAA,eAAVJ,CAAU,CAAA,WAAA,mBAAA,61BAC/CK,IAAA,IAACC,SAAEA,EAAQC,aAAEA,GAAcF,EAAA,OAAMC,GAAYC,EAAe,GAAM,CAAC,IAC5DC,IAAA,IAACF,SAAEA,EAAQC,aAAEA,GAAcC,EAAA,OAAMF,GAAYC,EAAe,OAAS,MAAM,IAuE9F,IAAAE,EAAAT,EAAAD,GAAAG,WAAA,CAAAC,YAAA,6BAAAC,YAAA,eAAAJ,CAAA,CAAA,GAAA,KAAAU,GAAAA,EAAAC,QA8CM,MAAMC,EACXjB,EAAIA,MACJ,SAAekB,GAAsD,IAArDC,QAAEA,EAAOC,MAAEA,EAAKC,SAAEA,KAAaC,GAAoBJ,E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Aa,MACb/D,SAAUA,GACNW,KAuBT2B,IAAaJ,GACZ5C,MAAAC,cAAA,OAAA,CACEqB,UAAS,kCAAAO,OAAoC2B,EAAgB,YAAc,IAC3EkB,QAASlB,GAETxD,MAAAC,cAACH,EAAa,CACZ6E,SAAU3B,EACV4B,MAAO/E,KAIZoD,GACCjD,MAAAC,cAAA,OAAA,CACEqB,UAAS,oCAAAO,OAAsC0B,EAAiB,YAAc,IAC9EmB,QAASnB,GAETvD,MAAAC,cAACH,EAAa,CACZ6E,SAAU1B,EACV2B,MAAO/E,KAIZkD,GAAYA,GAEdG,GAASA,GAEXL,GAAgB7C,MAAAC,cAAA,IAAA,CAAGqB,UAAU,QAAQuB,GACrCC,GAAY9C,MAAAC,cAAA,IAAA,CAAGqB,kBAASO,OAAUc,EAAQ,YAAc,KAAOG,GACnD,IAInBR,EAAM/B,YAAc,qFAxTSqE,IAC3B/E,EAAY+E,CAAK,2BAKcC,IAC/B/E,EAAgB+E,CAAS"}
1
+ {"version":3,"file":"Field.js","sources":["../../../../../../../src/core/ui/components/field/Field.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\n/* eslint-disable jsx-a11y/no-static-element-interactions */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport { FC, ReactNode, memo, useMemo, useCallback, PropsWithChildren } from 'react'\nimport styled from 'styled-components'\n\nimport type { FieldError, IconComponentType } from './types'\n\nlet iconColor: string | (() => string) = () => '#000000'\n\nexport const setIconColor = (color: string | (() => string)): void => {\n iconColor = color\n}\n\nlet IconComponent: IconComponentType = memo(function IconComponent() { return <span /> })\n\nexport const setIconComponent = (component: IconComponentType): void => {\n IconComponent = component\n}\n\nexport type FileWrapperProps = PropsWithChildren<unknown> & {\n className?: string\n error?: boolean\n disabled?: boolean\n userDisabled?: boolean\n css?: string\n}\n\nexport const FieldWrapper: FC<FileWrapperProps> = styled.div<FileWrapperProps>`\n opacity: ${({ disabled, userDisabled }) => (disabled || userDisabled ? 0.5 : 1)};\n pointer-events: ${({ disabled, userDisabled }) => (disabled || userDisabled ? 'none' : 'auto')};\n flex: 1 1 auto;\n width: 100%;\n @media (min-width: 400px) {\n flex: 1;\n }\n .label {\n font-size: 0.8rem !important;\n font-weight: normal;\n }\n\n .help {\n text-align: left;\n }\n\n .mainControl {\n flex: 1;\n border-radius: 6px;\n box-shadow: 0 0 6px 1px rgba(0, 0, 0, 0.06);\n will-change: box-shadow;\n transition: box-shadow 250ms ease-in-out;\n &:hover {\n box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);\n }\n }\n button {\n box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);\n }\n .select {\n width: 100%;\n flex: 1;\n &::after {\n border-color: #000000 !important;\n }\n }\n\n .icon {\n &.is-action {\n cursor: pointer;\n pointer-events: initial !important;\n }\n }\n\n /* Chrome, Safari, Edge, Opera */\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n /* Firefox */\n input[type=number] {\n -moz-appearance: textfield;\n }\n\n .input[type=date]::-webkit-calendar-picker-indicator {\n opacity:0;\n -webkit-appearance: none;\n position: absolute;\n left: 0;\n top: 0;\n width: 40px;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n }\n\n textarea {\n resize: none;\n }\n`\n\ntype EventType = { target: any; type?: any } & Partial<Event>\nexport interface FieldProps {\n label?: string\n name?: string\n type?: string\n min?: number | string | Date | any\n max?: number | string | Date | any\n value?: string | number | readonly string[] | undefined\n defaultValue?: string | number | readonly string[] | undefined\n placeholder?: string\n inputRef?: ReactHookFormRef\n error?: boolean\n errors?: FieldError\n disabled?: boolean\n userDisabled?: boolean\n helpTextInfo?: string\n helpText?: string\n iconLeft?: string\n iconRight?: string\n withoutComponent?: boolean\n addon?: ReactNode\n children?: ReactNode\n className?: string\n onChange?: (event?: EventType) => unknown\n // TODO, rename... something like changeHandler or valueDecorator\n onChangeInner?: (value: string | number) => string | number\n onBlur?: (event?: EventType) => void\n onFocus?: (event?: EventType | undefined) => void\n rightIconClick?: (event?: EventType) => void\n leftIconClick?: (event?: EventType) => void\n options?: any[] | null\n creatable?: boolean\n async?: boolean\n css?: string\n [key: string]: any\n}\n\ninterface SelectProps extends FieldProps {\n id?: string\n}\n\ntype OptionObj = { label: string | number | undefined; value: string | number | undefined }\ntype Option = OptionObj | string | number\n\nexport const Select: FC<SelectProps>\n= memo<SelectProps>(\n function Select({ options, value, inputRef, ...props }: SelectProps) {\n return (\n <div className='select'>\n <select {...props} ref={inputRef} defaultValue={value}>\n {options?.map((option: Option) => (\n <option\n key={`${JSON.stringify(option)}`}\n value={typeof option === 'object' ? (option as OptionObj)?.value : option}\n >\n {typeof option === 'object' ? (option as OptionObj)?.label : option}\n </option>\n ))}\n </select>\n </div>\n )\n },\n)\n\nconst InputComponent = styled.input``\nconst TextAreaComponent = styled.textarea``\nconst StyledFieldLabel = styled.label`\n text-align: left;\n`\n\nexport const Field: FC<FieldProps> = memo<FieldProps>(({\n label,\n name,\n type = 'text',\n value,\n defaultValue,\n placeholder,\n inputRef,\n error,\n disabled,\n userDisabled,\n withoutComponent,\n helpTextInfo,\n helpText,\n children,\n iconLeft,\n iconRight,\n addon,\n className,\n onChange,\n onChangeInner,\n onBlur,\n onFocus,\n rightIconClick,\n leftIconClick,\n options,\n css,\n ...props\n}: FieldProps) => {\n let Component: FC<any> = InputComponent\n\n if (!children && type === 'textarea') {\n Component = TextAreaComponent\n }\n const handleFocus = useCallback((event: Event | EventType | undefined) => {\n if (userDisabled) {\n event?.preventDefault?.()\n } else {\n onFocus && onFocus(event)\n }\n }, [userDisabled, onFocus])\n\n const handleChange = useCallback((event: { target: { value: string } }) => {\n if (userDisabled) {\n return\n }\n if (onChangeInner && event?.target) {\n // eslint-disable-next-line no-param-reassign\n event.target.value = onChangeInner((event.target.value as string)) as string\n onChange && onChange(event as EventType)\n } else {\n onChange && onChange(event as EventType)\n }\n }, [onChangeInner, onChange, userDisabled])\n\n const valueProps = useMemo(() => {\n if (value === undefined) {\n return { defaultValue }\n }\n return { value }\n }, [value, defaultValue])\n\n return (\n <FieldWrapper\n className={`field ${className}`}\n error={error}\n disabled={disabled}\n userDisabled={userDisabled}\n css={css}\n >\n <StyledFieldLabel htmlFor={name} className='label'>{label}</StyledFieldLabel>\n <div className={`field ${addon ? 'has-addons' : ''}`}>\n <div\n className={`control mainControl ${iconLeft && !withoutComponent\n ? 'has-icons-left' : ''} ${iconRight ? 'has-icons-right' : ''}`}\n >\n {!withoutComponent && ((!children && (type === 'select' || options))\n ? (\n <Select\n name={name}\n id={name}\n inputRef={inputRef}\n className={`input ${error ? 'is-danger' : ''}`}\n type='select'\n placeholder={placeholder}\n value={value}\n options={options}\n // TODO also handle change but value versus event.target.value issue\n onChange={onChange}\n onBlur={onBlur}\n onFocus={handleFocus}\n onKeyDown={handleFocus}\n autoComplete='off'\n disabled={disabled}\n {...props}\n />\n )\n : (\n !children && (\n <Component\n name={name}\n id={name}\n ref={inputRef}\n className={`input ${error ? 'is-danger' : ''}`}\n type={type}\n placeholder={placeholder}\n {...valueProps}\n onChange={handleChange}\n onBlur={onBlur}\n onFocus={handleFocus}\n onKeyDown={handleFocus}\n autoComplete='off'\n disabled={disabled}\n {...props}\n />\n )))}\n\n {iconLeft && !withoutComponent && (\n <span\n className={`iconLeft icon is-small is-left ${leftIconClick ? 'is-action' : ''}`}\n onClick={leftIconClick}\n >\n <IconComponent\n iconName={iconLeft}\n color={iconColor}\n />\n </span>\n )}\n {iconRight && (\n <span\n className={`iconRight icon is-small is-right ${rightIconClick ? 'is-action' : ''}`}\n onClick={rightIconClick}\n >\n <IconComponent\n iconName={iconRight}\n color={iconColor}\n />\n </span>\n )}\n {children && children}\n </div>\n {addon && addon}\n </div>\n {helpTextInfo && <p className='help'>{helpTextInfo}</p>}\n {helpText && <p className={`help ${error ? 'is-danger' : ''}`}>{helpText}</p>}\n </FieldWrapper>\n )\n})\n\nField.displayName = 'Field'\n"],"names":["iconColor","IconComponent","memo","React","createElement","setIconComponent","FieldWrapper","styled","div","withConfig","displayName","componentId","_ref","disabled","userDisabled","_ref2","_StyledFieldWrapper","default","p","$_css","Select","_ref3","options","value","inputRef","props","className","_extends","ref","defaultValue","map","option","key","concat","JSON","stringify","label","InputComponent","input","TextAreaComponent","textarea","StyledFieldLabel","Field","_ref4","name","type","placeholder","error","withoutComponent","helpTextInfo","helpText","children","iconLeft","iconRight","addon","onChange","onChangeInner","onBlur","onFocus","rightIconClick","leftIconClick","css","Component","handleFocus","useCallback","event","_event$preventDefault","preventDefault","call","handleChange","target","valueProps","useMemo","undefined","htmlFor","id","onKeyDown","autoComplete","onClick","iconName","color","component"],"mappings":"mMAQA,IAAIA,EAAqCA,IAAM,UAM/C,IAAIC,EAAmCC,EAAAA,MAAK,WAA2B,OAAOC,MAAAC,cAAA,OAAA,KAAS,IAE1EC,MAYAC,EAAqCC,EAAAA,QAAOC,IAAGC,WAAA,CAAAC,YAAA,sBAAAC,YAAA,eAAVJ,CAAU,CAAA,WAAA,mBAAA,61BAC/CK,IAAA,IAACC,SAAEA,EAAQC,aAAEA,GAAcF,EAAA,OAAMC,GAAYC,EAAe,GAAM,CAAC,IAC5DC,IAAA,IAACF,SAAEA,EAAQC,aAAEA,GAAcC,EAAA,OAAMF,GAAYC,EAAe,OAAS,MAAM,IAuE9F,IAAAE,EAAAT,EAAAU,QAAAX,GAAAG,WAAA,CAAAC,YAAA,6BAAAC,YAAA,eAAAJ,CAAA,CAAA,GAAA,KAAAW,GAAAA,EAAAC,QA8CM,MAAMC,EACXlB,EAAIA,MACJ,SAAemB,GAAsD,IAArDC,QAAEA,EAAOC,MAAEA,EAAKC,SAAEA,KAAaC,GAAoBJ,EACjE,OACElB,MAAAC,cAAA,MAAA,CAAKsB,UAAU,UACbvB,MAAAC,cAAAuB,SAAAA,EAAAA,WAAYF,EAAK,CAAEG,IAAKJ,EAAUK,aAAcN,IAC7CD,aAAO,EAAPA,EAASQ,KAAKC,GACb5B,MAAAC,c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AAa,CACZ8E,SAAU3B,EACV4B,MAAOhF,KAIZqD,GACClD,MAAAC,cAAA,OAAA,CACEsB,UAAS,oCAAAO,OAAsC0B,EAAiB,YAAc,IAC9EmB,QAASnB,GAETxD,MAAAC,cAACH,EAAa,CACZ8E,SAAU1B,EACV2B,MAAOhF,KAIZmD,GAAYA,GAEdG,GAASA,GAEXL,GAAgB9C,MAAAC,cAAA,IAAA,CAAGsB,UAAU,QAAQuB,GACrCC,GAAY/C,MAAAC,cAAA,IAAA,CAAGsB,kBAASO,OAAUc,EAAQ,YAAc,KAAOG,GACnD,IAInBR,EAAMhC,YAAc,qFAxTSsE,IAC3BhF,EAAYgF,CAAK,2BAKcC,IAC/BhF,EAAgBgF,CAAS"}
@@ -22,6 +22,36 @@
22
22
  min-height: 0;
23
23
  border-radius: initial;
24
24
  }
25
+ .icon-module_icon-base-parent__nOMvW {
26
+ line-height: 1px !important;
27
+ }
28
+
29
+ .icon-module_icon-base__S0tHf {
30
+ min-width: var(--min-width);
31
+ min-height: var(--min-height);
32
+ width: var(--width) !important;
33
+ height: var(--height) !important;
34
+ line-height: 1px !important;
35
+ background-color: var(--icon-color);
36
+ color: var(--icon-content-color);
37
+ background-repeat: no-repeat;
38
+ mask-image: var(--icon-url);
39
+ -webkit-mask-image: var(--icon-url);
40
+ mask-repeat: no-repeat;
41
+ -webkit-mask-repeat: no-repeat;
42
+ mask-size: contain;
43
+ -webkit-mask-size: contain;
44
+ mask-position: center;
45
+ -webkit-mask-position: center;
46
+ display: inline-block;
47
+ will-change: transform;
48
+ transform: translate3d(0, 0, 0);
49
+ }
50
+ .icon-module_icon-base__S0tHf svg {
51
+ fill: var(--icon-content-color);
52
+ width: var(--height);
53
+ height: var(--width);
54
+ }
25
55
  .CollapsibleContainer-module_collapsible-container__u0Jmm {
26
56
  transform-origin: 0% 0%;
27
57
  opacity: 0;
@@ -55,36 +85,6 @@
55
85
  max-width: var(--prop-value);
56
86
  opacity: 1;
57
87
  }
58
- .icon-module_icon-base-parent__nOMvW {
59
- line-height: 1px !important;
60
- }
61
-
62
- .icon-module_icon-base__S0tHf {
63
- min-width: var(--min-width);
64
- min-height: var(--min-height);
65
- width: var(--width) !important;
66
- height: var(--height) !important;
67
- line-height: 1px !important;
68
- background-color: var(--icon-color);
69
- color: var(--icon-content-color);
70
- background-repeat: no-repeat;
71
- mask-image: var(--icon-url);
72
- -webkit-mask-image: var(--icon-url);
73
- mask-repeat: no-repeat;
74
- -webkit-mask-repeat: no-repeat;
75
- mask-size: contain;
76
- -webkit-mask-size: contain;
77
- mask-position: center;
78
- -webkit-mask-position: center;
79
- display: inline-block;
80
- will-change: transform;
81
- transform: translate3d(0, 0, 0);
82
- }
83
- .icon-module_icon-base__S0tHf svg {
84
- fill: var(--icon-content-color);
85
- width: var(--height);
86
- height: var(--width);
87
- }
88
88
  .divider-module_divider-line__6CesR {
89
89
  position: relative;
90
90
  display: block;
@@ -22,6 +22,36 @@
22
22
  min-height: 0;
23
23
  border-radius: initial;
24
24
  }
25
+ .icon-module_icon-base-parent__nOMvW {
26
+ line-height: 1px !important;
27
+ }
28
+
29
+ .icon-module_icon-base__S0tHf {
30
+ min-width: var(--min-width);
31
+ min-height: var(--min-height);
32
+ width: var(--width) !important;
33
+ height: var(--height) !important;
34
+ line-height: 1px !important;
35
+ background-color: var(--icon-color);
36
+ color: var(--icon-content-color);
37
+ background-repeat: no-repeat;
38
+ mask-image: var(--icon-url);
39
+ -webkit-mask-image: var(--icon-url);
40
+ mask-repeat: no-repeat;
41
+ -webkit-mask-repeat: no-repeat;
42
+ mask-size: contain;
43
+ -webkit-mask-size: contain;
44
+ mask-position: center;
45
+ -webkit-mask-position: center;
46
+ display: inline-block;
47
+ will-change: transform;
48
+ transform: translate3d(0, 0, 0);
49
+ }
50
+ .icon-module_icon-base__S0tHf svg {
51
+ fill: var(--icon-content-color);
52
+ width: var(--height);
53
+ height: var(--width);
54
+ }
25
55
  .CollapsibleContainer-module_collapsible-container__u0Jmm {
26
56
  transform-origin: 0% 0%;
27
57
  opacity: 0;
@@ -55,36 +85,6 @@
55
85
  max-width: var(--prop-value);
56
86
  opacity: 1;
57
87
  }
58
- .icon-module_icon-base-parent__nOMvW {
59
- line-height: 1px !important;
60
- }
61
-
62
- .icon-module_icon-base__S0tHf {
63
- min-width: var(--min-width);
64
- min-height: var(--min-height);
65
- width: var(--width) !important;
66
- height: var(--height) !important;
67
- line-height: 1px !important;
68
- background-color: var(--icon-color);
69
- color: var(--icon-content-color);
70
- background-repeat: no-repeat;
71
- mask-image: var(--icon-url);
72
- -webkit-mask-image: var(--icon-url);
73
- mask-repeat: no-repeat;
74
- -webkit-mask-repeat: no-repeat;
75
- mask-size: contain;
76
- -webkit-mask-size: contain;
77
- mask-position: center;
78
- -webkit-mask-position: center;
79
- display: inline-block;
80
- will-change: transform;
81
- transform: translate3d(0, 0, 0);
82
- }
83
- .icon-module_icon-base__S0tHf svg {
84
- fill: var(--icon-content-color);
85
- width: var(--height);
86
- height: var(--width);
87
- }
88
88
  .divider-module_divider-line__6CesR {
89
89
  position: relative;
90
90
  display: block;
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("dayjs"),o=require("../../../node_modules/dayjs/plugin/relativeTime.js"),t=require("../../../node_modules/dayjs/plugin/updateLocale.js"),r=require("../../../node_modules/dayjs/plugin/customParseFormat.js");const a={future:"in %s",past:"%s ago",s:"now",m:"now",mm:"now",h:"1 hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},d={future:"za %s",past:"%s před",s:"nyní",m:"nyní",mm:"nyní",h:"1 hodinu",hh:"%d hodiny",d:"den",dd:"%d dny",M:"měsíc",MM:"%d měsíci",y:"rok",yy:"%d roky"};e.extend(r),e.extend(o,{thresholds:[{l:"s",r:1},{l:"m",r:1},{l:"mm",r:59,d:"minute"},{l:"h",r:1},{l:"hh",r:23,d:"hour"},{l:"d",r:1},{l:"dd",r:29,d:"day"},{l:"M",r:1},{l:"MM",r:11,d:"month"},{l:"y",r:1},{l:"yy",d:"year"}]}),e.extend(t),e.updateLocale("cz",{relativeTime:{...d}}),e.updateLocale("en",{relativeTime:{...a}});const n=o=>{let{value:t,valueFormat:r,formatString:n,language:l="en",relativeTime:s,from:i,to:m,shouldAddDay:u=!1,shouldSubtractDay:c=!1,showPreffix:y=!1}=o;if(e.updateLocale("en",{relativeTime:{..."cz"===l?d:a,...s}}),e.locale(l),!i&&m){const o=e(t,r||void 0).add(u?1:0,"day");return e(new Date).locale(l).to(o,!y)}if(i&&!m){const o=e(t,r||void 0).subtract(c?1:0,"day");return e(o,r||void 0).locale(l).fromNow(!y)}return e(t,r||void 0).locale(l).format(n)};exports.dateRangeFormat=function(o,t,r,a){let d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:" - ",n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"month";const l=e(o),s=e(t),i=l.diff(s,n);return"".concat(l.format(0===i?r:a)).concat(d).concat(s.format(a))},exports.getDateTime=n,exports.getTimeFromNow=(e,o)=>n({...o,from:!0,value:e}),exports.getTimeFromNowOriginal=(t,r)=>(e.updateLocale("en",{relativeTime:{..."cz"===r?d:a,...o}}),e(t,void 0).fromNow(!0)),exports.getTimeTo=(e,o)=>n({...o,to:!0,value:e});
1
+ "use strict";var e=require("dayjs"),t=require("../../../node_modules/dayjs/plugin/relativeTime.js"),a=require("../../../node_modules/dayjs/plugin/updateLocale.js"),d=require("../../../node_modules/dayjs/plugin/customParseFormat.js");function o(e){return e&&e.__esModule?e:{default:e}}var r=o(e);const l={future:"in %s",past:"%s ago",s:"now",m:"now",mm:"now",h:"1 hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},u={future:"za %s",past:"%s před",s:"nyní",m:"nyní",mm:"nyní",h:"1 hodinu",hh:"%d hodiny",d:"den",dd:"%d dny",M:"měsíc",MM:"%d měsíci",y:"rok",yy:"%d roky"};r.default.extend(d),r.default.extend(t,{thresholds:[{l:"s",r:1},{l:"m",r:1},{l:"mm",r:59,d:"minute"},{l:"h",r:1},{l:"hh",r:23,d:"hour"},{l:"d",r:1},{l:"dd",r:29,d:"day"},{l:"M",r:1},{l:"MM",r:11,d:"month"},{l:"y",r:1},{l:"yy",d:"year"}]}),r.default.extend(a),r.default.updateLocale("cz",{relativeTime:{...u}}),r.default.updateLocale("en",{relativeTime:{...l}});const n=e=>{let{value:t,valueFormat:a,formatString:d,language:o="en",relativeTime:n,from:s,to:i,shouldAddDay:m=!1,shouldSubtractDay:f=!1,showPreffix:c=!1}=e;if(r.default.updateLocale("en",{relativeTime:{..."cz"===o?u:l,...n}}),r.default.locale(o),!s&&i){const e=r.default(t,a||void 0).add(m?1:0,"day");return r.default(new Date).locale(o).to(e,!c)}if(s&&!i){const e=r.default(t,a||void 0).subtract(f?1:0,"day");return r.default(e,a||void 0).locale(o).fromNow(!c)}return r.default(t,a||void 0).locale(o).format(d)};exports.dateRangeFormat=function(e,t,a,d){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:" - ",l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"month";const u=r.default(e),n=r.default(t),s=u.diff(n,l);return"".concat(u.format(0===s?a:d)).concat(o).concat(n.format(d))},exports.getDateTime=n,exports.getTimeFromNow=(e,t)=>n({...t,from:!0,value:e}),exports.getTimeFromNowOriginal=(e,a)=>(r.default.updateLocale("en",{relativeTime:{..."cz"===a?u:l,...t}}),r.default(e,void 0).fromNow(!0)),exports.getTimeTo=(e,t)=>n({...t,to:!0,value:e});
2
2
  //# sourceMappingURL=date.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date.js","sources":["../../../../../src/core/utils/date.ts"],"sourcesContent":["import dayjs, { UnitType } from 'dayjs'\nimport relativeTime from 'dayjs/plugin/relativeTime'\nimport updateLocale from 'dayjs/plugin/updateLocale'\nimport customParseFormat from 'dayjs/plugin/customParseFormat'\n\nexport type DateTimeFormat = {\n value: Date | string | number\n valueFormat?: string\n formatString?: string\n language?: string\n relativeTime?: Record<string, string>\n from?: boolean\n to?: boolean\n shouldSubtractDay?: boolean\n shouldAddDay?: boolean\n showPreffix?: boolean\n}\n\nconst relativeTimeConfig = {\n thresholds: [\n { l: 's', r: 1 },\n { l: 'm', r: 1 },\n { l: 'mm', r: 59, d: 'minute' },\n { l: 'h', r: 1 },\n { l: 'hh', r: 23, d: 'hour' },\n { l: 'd', r: 1 },\n { l: 'dd', r: 29, d: 'day' },\n { l: 'M', r: 1 },\n { l: 'MM', r: 11, d: 'month' },\n { l: 'y', r: 1 },\n { l: 'yy', d: 'year' },\n ],\n}\n\nconst relativeTimeEN = {\n future: 'in %s',\n past: '%s ago',\n s: 'now',\n m: 'now',\n mm: 'now',\n h: '1 hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days', // probably 'a week' instead?\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n}\n\nconst relativeTimeCZ = {\n future: 'za %s',\n past: '%s před',\n s: 'nyní',\n m: 'nyní',\n mm: 'nyní',\n h: '1 hodinu',\n hh: '%d hodiny',\n d: 'den',\n dd: '%d dny',\n M: 'měsíc',\n MM: '%d měsíci',\n y: 'rok',\n yy: '%d roky',\n}\n\ndayjs.extend(customParseFormat)\ndayjs.extend(relativeTime, relativeTimeConfig)\ndayjs.extend(updateLocale)\n\ndayjs.updateLocale('cz', {\n relativeTime: {\n ...relativeTimeCZ,\n },\n})\ndayjs.updateLocale('en', {\n relativeTime: {\n ...relativeTimeEN,\n },\n})\n\nexport const getTimeFromNowOriginal = (value: string, language: string): string => {\n dayjs.updateLocale('en', {\n relativeTime: {\n ...(language === 'cz' ? relativeTimeCZ : relativeTimeEN),\n ...relativeTime,\n },\n })\n return dayjs(value, undefined).fromNow(true)\n}\n\nexport const getTimeFromNow = (\n value: Date | string | number,\n valueFormat?: Partial<DateTimeFormat>,\n): string => getDateTime({ ...valueFormat, from: true, value })\n\nexport const getTimeTo = (\n value: Date | string | number,\n valueFormat?: Partial<DateTimeFormat>,\n): string => getDateTime({ ...valueFormat, to: true, value })\n\nexport const getDateTime = ({\n value,\n valueFormat,\n formatString,\n language = 'en',\n relativeTime,\n from,\n to,\n shouldAddDay = false,\n shouldSubtractDay = false,\n showPreffix = false,\n}: DateTimeFormat): string => {\n dayjs.updateLocale('en', {\n relativeTime: {\n ...(language === 'cz' ? relativeTimeCZ : relativeTimeEN),\n ...relativeTime,\n },\n })\n\n dayjs.locale(language)\n\n if (!from && to) {\n const dateTo = dayjs(value, valueFormat || undefined).add(shouldAddDay ? 1 : 0, 'day')\n\n return dayjs(new Date()).locale(language).to(dateTo, !showPreffix)\n }\n\n if (from && !to) {\n const dateTo = dayjs(value, valueFormat || undefined).subtract(shouldSubtractDay ? 1 : 0, 'day')\n\n return dayjs(dateTo, valueFormat || undefined).locale(language).fromNow(!showPreffix)\n }\n\n return dayjs(value, valueFormat || undefined).locale(language).format(formatString)\n}\n\nexport const dateRangeFormat = (\n dateFrom: Date, dateTo: Date, shortFormat: string, longFormat: string,\n delimiter = ' - ', datePeriod: UnitType = 'month',\n) : string => {\n const dayJSFrom = dayjs(dateFrom)\n const dayJSTo = dayjs(dateTo)\n\n const diffMonths = dayJSFrom.diff(dayJSTo, datePeriod)\n\n return `${dayJSFrom.format(diffMonths === 0 ? shortFormat : longFormat)}${delimiter}${dayJSTo.format(longFormat)}`\n}\n"],"names":["relativeTimeEN","future","past","s","m","mm","h","hh","d","dd","M","MM","y","yy","relativeTimeCZ","dayjs","extend","customParseFormat","relativeTime","thresholds","l","r","updateLocale","getDateTime","_ref","value","valueFormat","formatString","language","from","to","shouldAddDay","shouldSubtractDay","showPreffix","locale","dateTo","undefined","add","Date","subtract","fromNow","format","dateFrom","shortFormat","longFormat","delimiter","arguments","length","datePeriod","dayJSFrom","dayJSTo","diffMonths","diff","concat","getTimeFromNow","getTimeFromNowOriginal","getTimeTo"],"mappings":"yOAkBA,MAgBMA,EAAiB,CACrBC,OAAQ,QACRC,KAAM,SACNC,EAAG,MACHC,EAAG,MACHC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EAAI,EAAG,OAEhF,OAAOhB,EAAM,IAAIuB,MAAQJ,OAAON,GAAUE,GAAGK,GAASF,EACxD,CAEA,GAAIJ,IAASC,EAAI,CACf,MAAMK,EAASpB,EAAMU,EAAOC,QAAeU,GAAWG,SAASP,EAAoB,EAAI,EAAG,OAE1F,OAAOjB,EAAMoB,EAAQT,QAAeU,GAAWF,OAAON,GAAUY,SAASP,EAC3E,CAEA,OAAOlB,EAAMU,EAAOC,QAAeU,GAAWF,OAAON,GAAUa,OAAOd,EAAa,0BAGtD,SAC7Be,EAAgBP,EAAcQ,EAAqBC,GAEvC,IADZC,EAASC,UAAAC,OAAA,QAAAX,IAAAU,UAAA,GAAAA,UAAA,GAAG,MAAOE,EAAoBF,UAAAC,OAAA,QAAAX,IAAAU,UAAA,GAAAA,UAAA,GAAG,QAE1C,MAAMG,EAAYlC,EAAM2B,GAClBQ,EAAUnC,EAAMoB,GAEhBgB,EAAaF,EAAUG,KAAKF,EAASF,GAE3C,MAAAK,GAAAA,OAAUJ,EAAUR,OAAsB,IAAfU,EAAmBR,EAAcC,IAAWS,OAAGR,GAASQ,OAAGH,EAAQT,OAAOG,GACvG,+CAxD8BU,CAC5B7B,EACAC,IACWH,EAAY,IAAKG,EAAaG,MAAM,EAAMJ,yCAbjB8B,CAAC9B,EAAeG,KACpDb,EAAMO,aAAa,KAAM,CACvBJ,aAAc,IACK,OAAbU,EAAoBd,EAAiBd,KACtCkB,KAGAH,EAAMU,OAAOW,GAAWI,SAAQ,sBAQhBgB,CACvB/B,EACAC,IACWH,EAAY,IAAKG,EAAaI,IAAI,EAAML"}
1
+ {"version":3,"file":"date.js","sources":["../../../../../src/core/utils/date.ts"],"sourcesContent":["import dayjs, { UnitType } from 'dayjs'\nimport relativeTime from 'dayjs/plugin/relativeTime'\nimport updateLocale from 'dayjs/plugin/updateLocale'\nimport customParseFormat from 'dayjs/plugin/customParseFormat'\n\nexport type DateTimeFormat = {\n value: Date | string | number\n valueFormat?: string\n formatString?: string\n language?: string\n relativeTime?: Record<string, string>\n from?: boolean\n to?: boolean\n shouldSubtractDay?: boolean\n shouldAddDay?: boolean\n showPreffix?: boolean\n}\n\nconst relativeTimeConfig = {\n thresholds: [\n { l: 's', r: 1 },\n { l: 'm', r: 1 },\n { l: 'mm', r: 59, d: 'minute' },\n { l: 'h', r: 1 },\n { l: 'hh', r: 23, d: 'hour' },\n { l: 'd', r: 1 },\n { l: 'dd', r: 29, d: 'day' },\n { l: 'M', r: 1 },\n { l: 'MM', r: 11, d: 'month' },\n { l: 'y', r: 1 },\n { l: 'yy', d: 'year' },\n ],\n}\n\nconst relativeTimeEN = {\n future: 'in %s',\n past: '%s ago',\n s: 'now',\n m: 'now',\n mm: 'now',\n h: '1 hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days', // probably 'a week' instead?\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n}\n\nconst relativeTimeCZ = {\n future: 'za %s',\n past: '%s před',\n s: 'nyní',\n m: 'nyní',\n mm: 'nyní',\n h: '1 hodinu',\n hh: '%d hodiny',\n d: 'den',\n dd: '%d dny',\n M: 'měsíc',\n MM: '%d měsíci',\n y: 'rok',\n yy: '%d roky',\n}\n\ndayjs.extend(customParseFormat)\ndayjs.extend(relativeTime, relativeTimeConfig)\ndayjs.extend(updateLocale)\n\ndayjs.updateLocale('cz', {\n relativeTime: {\n ...relativeTimeCZ,\n },\n})\ndayjs.updateLocale('en', {\n relativeTime: {\n ...relativeTimeEN,\n },\n})\n\nexport const getTimeFromNowOriginal = (value: string, language: string): string => {\n dayjs.updateLocale('en', {\n relativeTime: {\n ...(language === 'cz' ? relativeTimeCZ : relativeTimeEN),\n ...relativeTime,\n },\n })\n return dayjs(value, undefined).fromNow(true)\n}\n\nexport const getTimeFromNow = (\n value: Date | string | number,\n valueFormat?: Partial<DateTimeFormat>,\n): string => getDateTime({ ...valueFormat, from: true, value })\n\nexport const getTimeTo = (\n value: Date | string | number,\n valueFormat?: Partial<DateTimeFormat>,\n): string => getDateTime({ ...valueFormat, to: true, value })\n\nexport const getDateTime = ({\n value,\n valueFormat,\n formatString,\n language = 'en',\n relativeTime,\n from,\n to,\n shouldAddDay = false,\n shouldSubtractDay = false,\n showPreffix = false,\n}: DateTimeFormat): string => {\n dayjs.updateLocale('en', {\n relativeTime: {\n ...(language === 'cz' ? relativeTimeCZ : relativeTimeEN),\n ...relativeTime,\n },\n })\n\n dayjs.locale(language)\n\n if (!from && to) {\n const dateTo = dayjs(value, valueFormat || undefined).add(shouldAddDay ? 1 : 0, 'day')\n\n return dayjs(new Date()).locale(language).to(dateTo, !showPreffix)\n }\n\n if (from && !to) {\n const dateTo = dayjs(value, valueFormat || undefined).subtract(shouldSubtractDay ? 1 : 0, 'day')\n\n return dayjs(dateTo, valueFormat || undefined).locale(language).fromNow(!showPreffix)\n }\n\n return dayjs(value, valueFormat || undefined).locale(language).format(formatString)\n}\n\nexport const dateRangeFormat = (\n dateFrom: Date, dateTo: Date, shortFormat: string, longFormat: string,\n delimiter = ' - ', datePeriod: UnitType = 'month',\n) : string => {\n const dayJSFrom = dayjs(dateFrom)\n const dayJSTo = dayjs(dateTo)\n\n const diffMonths = dayJSFrom.diff(dayJSTo, datePeriod)\n\n return `${dayJSFrom.format(diffMonths === 0 ? shortFormat : longFormat)}${delimiter}${dayJSTo.format(longFormat)}`\n}\n"],"names":["relativeTimeEN","future","past","s","m","mm","h","hh","d","dd","M","MM","y","yy","relativeTimeCZ","dayjs","extend","customParseFormat","relativeTime","thresholds","l","r","updateLocale","getDateTime","_ref","value","valueFormat","formatString","language","from","to","shouldAddDay","shouldSubtractDay","showPreffix","default","locale","dateTo","undefined","add","Date","subtract","fromNow","format","dateFrom","shortFormat","longFormat","delimiter","arguments","length","datePeriod","dayJSFrom","dayJSTo","diffMonths","diff","concat","getTimeFromNow","getTimeFromNowOriginal","getTimeTo"],"mappings":"uSAkBA,MAgBMA,EAAiB,CACrBC,OAAQ,QACRC,KAAM,SACNC,EAAG,MACH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f,MAAMM,EAASrB,EAAAA,QAAMU,EAAOC,QAAeW,GAAWC,IAAIP,EAAe,EAAI,EAAG,OAEhF,OAAOhB,UAAM,IAAIwB,MAAQJ,OAAOP,GAAUE,GAAGM,GAASH,EACxD,CAEA,GAAIJ,IAASC,EAAI,CACf,MAAMM,EAASrB,EAAAA,QAAMU,EAAOC,QAAeW,GAAWG,SAASR,EAAoB,EAAI,EAAG,OAE1F,OAAOjB,UAAMqB,EAAQV,QAAeW,GAAWF,OAAOP,GAAUa,SAASR,EAC3E,CAEA,OAAOlB,EAAKmB,QAACT,EAAOC,QAAeW,GAAWF,OAAOP,GAAUc,OAAOf,EAAa,0BAGtD,SAC7BgB,EAAgBP,EAAcQ,EAAqBC,GAEvC,IADZC,EAASC,UAAAC,OAAA,QAAAX,IAAAU,UAAA,GAAAA,UAAA,GAAG,MAAOE,EAAoBF,UAAAC,OAAA,QAAAX,IAAAU,UAAA,GAAAA,UAAA,GAAG,QAE1C,MAAMG,EAAYnC,UAAM4B,GAClBQ,EAAUpC,UAAMqB,GAEhBgB,EAAaF,EAAUG,KAAKF,EAASF,GAE3C,MAAAK,GAAAA,OAAUJ,EAAUR,OAAsB,IAAfU,EAAmBR,EAAcC,IAAWS,OAAGR,GAASQ,OAAGH,EAAQT,OAAOG,GACvG,+CAxD8BU,CAC5B9B,EACAC,IACWH,EAAY,IAAKG,EAAaG,MAAM,EAAMJ,yCAbjB+B,CAAC/B,EAAeG,KACpDb,EAAKmB,QAACZ,aAAa,KAAM,CACvBJ,aAAc,IACK,OAAbU,EAAoBd,EAAiBd,KACtCkB,KAGAH,EAAAA,QAAMU,OAAOY,GAAWI,SAAQ,sBAQhBgB,CACvBhC,EACAC,IACWH,EAAY,IAAKG,EAAaI,IAAI,EAAML"}
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("dayjs");exports.DATE_FORMAT="MM-DD-YYYY HH-mm",exports.formatDateToTimestamp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return t(e).format("YYYY-MM-DD HH:mm:ss")},exports.getDate=()=>(new Date).toString();
1
+ "use strict";function t(t){return t&&t.__esModule?t:{default:t}}var e=t(require("dayjs"));exports.DATE_FORMAT="MM-DD-YYYY HH-mm",exports.formatDateToTimestamp=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return e.default(t).format("YYYY-MM-DD HH:mm:ss")},exports.getDate=()=>(new Date).toString();
2
2
  //# sourceMappingURL=date.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date.js","sources":["../../../../../../src/core/utils/helpers/date.ts"],"sourcesContent":["import dayjs from 'dayjs'\n\nexport const getDate = (): string => new Date().toString()\nexport const DATE_FORMAT = 'MM-DD-YYYY HH-mm'\n\nexport const formatDateToTimestamp = (date = new Date()): string => dayjs(date).format('YYYY-MM-DD HH:mm:ss')\n"],"names":["date","arguments","length","undefined","Date","dayjs","format","getDate","toString"],"mappings":"wDAG2B,iDAEU,WAAA,IAACA,EAAIC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAA,GAAG,IAAIG,KAAM,OAAaC,EAAML,GAAMM,OAAO,sBAAsB,kBAHtFC,KAAc,IAAIH,MAAOI"}
1
+ {"version":3,"file":"date.js","sources":["../../../../../../src/core/utils/helpers/date.ts"],"sourcesContent":["import dayjs from 'dayjs'\n\nexport const getDate = (): string => new Date().toString()\nexport const DATE_FORMAT = 'MM-DD-YYYY HH-mm'\n\nexport const formatDateToTimestamp = (date = new Date()): string => dayjs(date).format('YYYY-MM-DD HH:mm:ss')\n"],"names":["date","arguments","length","undefined","Date","dayjs","default","format","getDate","toString"],"mappings":"8GAG2B,iDAEU,WAAA,IAACA,EAAIC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAA,GAAG,IAAIG,KAAM,OAAaC,EAAKC,QAACN,GAAMO,OAAO,sBAAsB,kBAHtFC,KAAc,IAAIJ,MAAOK"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e1011/es-kit",
3
- "version": "1.0.198",
3
+ "version": "1.0.202",
4
4
  "main": "dist/lib/cjs/src/index.js",
5
5
  "module": "dist/lib/esm/src/index.js",
6
6
  "sideEffects": false,