@e1011/es-kit 1.0.186 → 1.0.190
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/esm/index.css +43 -43
- package/dist/hooks/index.css +43 -43
- package/dist/lib/cjs/_virtual/_rollupPluginBabelHelpers.js +1 -1
- package/dist/lib/cjs/src/core/ui/components/container/Flex.js +1 -1
- package/dist/lib/cjs/src/core/ui/components/container/Flex.js.map +1 -1
- package/dist/lib/cjs/src/core/ui/components/container/Placeholder.js +1 -1
- package/dist/lib/cjs/src/core/ui/components/container/Placeholder.js.map +1 -1
- package/dist/lib/cjs/src/core/ui/components/field/Field.js +1 -1
- package/dist/lib/cjs/src/core/ui/components/field/Field.js.map +1 -1
- package/dist/lib/esm/_virtual/_rollupPluginBabelHelpers.js +1 -1
- package/dist/lib/esm/src/core/ui/components/container/Flex.js +1 -1
- package/dist/lib/esm/src/core/ui/components/container/Flex.js.map +1 -1
- package/dist/lib/esm/src/core/ui/components/container/Placeholder.js +1 -1
- package/dist/lib/esm/src/core/ui/components/container/Placeholder.js.map +1 -1
- package/dist/lib/esm/src/core/ui/components/field/Field.js +1 -1
- package/dist/lib/esm/src/core/ui/components/field/Field.js.map +1 -1
- package/dist/ui/_virtual/_rollupPluginBabelHelpers.js +1 -1
- package/dist/ui/esm/_virtual/_rollupPluginBabelHelpers.js +1 -1
- package/dist/ui/esm/src/core/ui/components/container/Flex.js +1 -1
- package/dist/ui/esm/src/core/ui/components/container/Flex.js.map +1 -1
- package/dist/ui/esm/src/core/ui/components/container/Placeholder.js +1 -1
- package/dist/ui/esm/src/core/ui/components/container/Placeholder.js.map +1 -1
- package/dist/ui/esm/src/core/ui/components/field/Field.js +1 -1
- package/dist/ui/esm/src/core/ui/components/field/Field.js.map +1 -1
- package/dist/ui/src/core/ui/components/container/Flex.js +1 -1
- package/dist/ui/src/core/ui/components/container/Flex.js.map +1 -1
- package/dist/ui/src/core/ui/components/container/Placeholder.js +1 -1
- package/dist/ui/src/core/ui/components/container/Placeholder.js.map +1 -1
- package/dist/ui/src/core/ui/components/field/Field.js +1 -1
- package/dist/ui/src/core/ui/components/field/Field.js.map +1 -1
- package/dist/utils/esm/index.css +43 -43
- package/dist/utils/index.css +43 -43
- package/package.json +2 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function
|
|
1
|
+
"use strict";function r(r,t){if("object"!=typeof r||!r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var i=e.call(r,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}function t(t){var e=r(t,"string");return"symbol"==typeof e?e:String(e)}function e(){return e=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},e.apply(this,arguments)}exports.defineProperty=function(r,e,i){return(e=t(e))in r?Object.defineProperty(r,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[e]=i,r},exports.extends=e,exports.toPrimitive=r,exports.toPropertyKey=t;
|
|
2
2
|
//# sourceMappingURL=_rollupPluginBabelHelpers.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
1
|
+
function r(r,t){if("object"!=typeof r||!r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var i=e.call(r,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}function t(t){var e=r(t,"string");return"symbol"==typeof e?e:String(e)}function e(r,e,i){return(e=t(e))in r?Object.defineProperty(r,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[e]=i,r}function i(){return i=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},i.apply(this,arguments)}export{e as defineProperty,i as extends,r as toPrimitive,t as toPropertyKey};
|
|
2
2
|
//# sourceMappingURL=_rollupPluginBabelHelpers.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{memo as t}from"react";import e from"styled-components";const i={start:"flex-start","flex-start":"flex-start",end:"flex-end","flex-end":"flex-end"},r=t=>t&&i[t]||t,n=t(e.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:",";"],(t=>{let{direction:e}=t;return e||"row"}),(t=>{let{flex:e}=t;return void 0!==e?e:"0"}),(t=>{let{flexGrow:e}=t;return void 0!==e?e:"0"}),(t=>{let{flexShrink:e}=t;return void 0!==e?e:"0"}),(t=>{let{flexBasis:e}=t;return e||"auto"}),(t=>{let{flexWrap:e}=t;return e||"nowrap"}),(t=>{let{gap:e}=t;return void 0!==e?e:"0"}),(t=>{let{alignText:e}=t;return e||"left"}),(t=>{let{justify:e}=t;return r(e)||"flex-start"}),(t=>{let{align:e}=t;return r(e)||"flex-start"}),(t=>{let{alignSelf:e}=t;return e||"auto"}),(t=>{let{margin:e}=t;return e||"0"}),(t=>{let{padding:e}=t;return e||"0"}),(t=>{let{width:e}=t;return e||"auto"}),(t=>{let{height:e}=t;return e||"auto"}),(t=>{let{maxWidth:e}=t;return e||"none"}),(t=>{let{maxHeight:e}=t;return e||"none"}),(t=>{let{minWidth:e}=t;return e||"0"===e?e:"0"}),(t=>{let{minHeight:e}=t;return e||"0"}),(t=>{let{borderRadius:e}=t;return e||"initial"}))),l=t(e(n).attrs((t=>({width:t.width||"100%",height:t.height||"100%",justify:t.justify||"center",align:t.align||"center",...t}))).withConfig({displayName:"Flex__FlexWrapper",componentId:"sc-19vq3db-1"})([""])),a=t(e(n).attrs((t=>({width:"initial",...t}))).withConfig({displayName:"Flex__FlexTight",componentId:"sc-19vq3db-2"})([""])),d=t(e(n).attrs((t=>({width:"initial",style:{text:"blue",padding:"1rem",border:"1px solid green"},...t}))).withConfig({displayName:"Flex__FlexTightStyled",componentId:"sc-19vq3db-3"})([""]));export{n as Flex,a as FlexTight,d as FlexTightStyled,l as FlexWrapper};
|
|
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","
|
|
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":"8DA2BA,MAAMA,EAAuC,CAC3CC,MAAO,aACP,aAAc,aACdC,IAAK,WACL,WAAY,YAGRC,EAAoBC,GAAwCA,GAASJ,EAAaI,IAAmBA,EAE9FC,EAAOC,EAAKC,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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AKC,EAAOF,GAAMiD,OAAOC,IAClD,CACEf,MAAOe,EAAMf,OAAS,OACtBE,OAAQa,EAAMb,QAAU,OACxBZ,QAASyB,EAAMzB,SAAW,SAC1BE,MAAOuB,EAAMvB,OAAS,YACnBuB,MAEL9C,WAAA,CAAAC,YAAA,oBAAAC,YAAA,gBAR8BJ,CAQ9B,CAAA,MAEWiD,EAAYlD,EAAKC,EAAOF,GAAMiD,OAAOC,IAA+B,CAC/Ef,MAAO,aACJe,MACF9C,WAAA,CAAAC,YAAA,kBAAAC,YAAA,gBAH2BJ,CAG3B,CAAA,MAEUkD,EAAkBnD,EAAKC,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,2 +1,2 @@
|
|
|
1
|
-
import{extends as e}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import{memo as
|
|
1
|
+
import{extends as e}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import r from"styled-components";import{memo as o}from"react";import{FlexWrapper as l}from"./Flex.js";const s=o((r=>{let{title:o,border:l,background:s,onClick:t,cssProp:a,children:n,...i}=r;return React.createElement(c,e({onClick:t},i,{$_css:l||"border: 1px solid #999999;",$_css2:s||"background-color: rgba(0, 120, 255, 0.2);",$_css3:a}),o&&React.createElement("h2",null,o),n&&n)}));s.displayName="Placeholder";var c=r(l).withConfig({displayName:"Placeholder___StyledFlexWrapper",componentId:"sc-ozx0bx-0"})([""," "," ",""],(e=>e.$_css),(e=>e.$_css2),(e=>e.$_css3));export{s as Placeholder};
|
|
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","
|
|
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":"qLAYaA,MAAAA,EACXC,GAAuBC,IAAA,IAACC,MAAEA,EAAKC,OAAEA,EAAMC,WAAEA,EAAUC,QAAEA,EAAOC,QAAEA,EAAOC,SAAEA,KAAaC,GAAyBP,EAAA,OAC7GQ,MAAAC,cAAAC,EAAAC,EAAA,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,GAAAC,WAAA,CAAAH,YAAA,kCAAAI,YAAA,eAAAH,CAAA,CAAA,GAAA,IAAA,IAAA,KAAAI,GAAAA,EAAAR,QAAAQ,GAAAA,EAAAP,SAAAO,GAAAA,EAAAN"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{extends as e}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import t from"styled-components";import{memo as a,useCallback as n,useMemo as o}from"react";let l=()=>"#000000";const i=e=>{l=e};let c=a((function(){return React.createElement("span",null)}));const r=e=>{c=e},s=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 p=t(s).withConfig({displayName:"Field___StyledFieldWrapper",componentId:"sc-i8c0jy-1"})(["",""],(e=>e.$_css));const d=a((function(t){let{options:a,value:n,inputRef:o,...l}=t;return React.createElement("div",{className:"select"},React.createElement("select",e({},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)))))})),m=t.input.withConfig({displayName:"Field__InputComponent",componentId:"sc-i8c0jy-2"})([""]),u=t.textarea.withConfig({displayName:"Field__TextAreaComponent",componentId:"sc-i8c0jy-3"})([""]),f=t.label.withConfig({displayName:"Field__StyledFieldLabel",componentId:"sc-i8c0jy-4"})(["text-align:left;"]),h=a((t=>{let{label:a,name:i,type:r="text",value:s,defaultValue:h,placeholder:b,inputRef:g,error:x,disabled:y,userDisabled:v,withoutComponent:w,helpTextInfo:N,helpText:R,children:C,iconLeft:E,iconRight:_,addon:F,className:k,onChange:I,onChangeInner:j,onBlur:D,onFocus:B,rightIconClick:z,leftIconClick:L,options:S,css:T,...V}=t,K=m;C||"textarea"!==r||(K=u);const W=n((e=>{var t;v?null==e||null===(t=e.preventDefault)||void 0===t||t.call(e):B&&B(e)}),[v,B]),$=n((e=>{v||(j&&null!=e&&e.target?(e.target.value=j(e.target.value),I&&I(e)):I&&I(e))}),[j,I,v]),A=o((()=>void 0===s?{defaultValue:h}:{value:s}),[s,h]);return React.createElement(p,{className:"field ".concat(k),error:x,disabled:y,userDisabled:v,$_css:T},React.createElement(f,{htmlFor:i,className:"label"},a),React.createElement("div",{className:"field ".concat(F?"has-addons":"")},React.createElement("div",{className:"control mainControl ".concat(E&&!w?"has-icons-left":""," ").concat(_?"has-icons-right":"")},!w&&(C||"select"!==r&&!S?!C&&React.createElement(K,e({name:i,id:i,ref:g,className:"input ".concat(x?"is-danger":""),type:r,placeholder:b},A,{onChange:$,onBlur:D,onFocus:W,onKeyDown:W,autoComplete:"off",disabled:y},V)):React.createElement(d,e({name:i,id:i,inputRef:g,className:"input ".concat(x?"is-danger":""),type:"select",placeholder:b,value:s,options:S,onChange:I,onBlur:D,onFocus:W,onKeyDown:W,autoComplete:"off",disabled:y},V))),E&&!w&&React.createElement("span",{className:"iconLeft icon is-small is-left ".concat(L?"is-action":""),onClick:L},React.createElement(c,{iconName:E,color:l})),_&&React.createElement("span",{className:"iconRight icon is-small is-right ".concat(z?"is-action":""),onClick:z},React.createElement(c,{iconName:_,color:l})),C&&C),F&&F),N&&React.createElement("p",{className:"help"},N),R&&React.createElement("p",{className:"help ".concat(x?"is-danger":"")},R))}));h.displayName="Field";export{h as Field,s as FieldWrapper,d as Select,i as setIconColor,r as setIconComponent};
|
|
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","setIconColor","color","IconComponent","memo","React","createElement","setIconComponent","component","FieldWrapper","styled","div","_templateObject","_taggedTemplateLiteral","_ref","disabled","userDisabled","_ref2","Select","_ref3","options","value","inputRef","props","className","_extends","ref","defaultValue","map","option","key","concat","JSON","stringify","label","InputComponent","input","_templateObject2","TextAreaComponent","textarea","_templateObject3","StyledFieldLabel","_templateObject4","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","displayName"],"mappings":"kNAQA,IAAIA,EAAqCA,IAAM,UAElCC,MAAAA,EAAgBC,IAC3BF,EAAYE,CAAK,EAGnB,IAAIC,EAAmCC,GAAK,WAA2B,OAAOC,MAAAC,cAAA,OAAA,KAAS,IAE1EC,MAAAA,EAAoBC,IAC/BL,EAAgBK,CAAS,EAWdC,EAAqCC,EAAOC,IAAGC,IAAAA,EAAAC,20CAC/CC,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,IAqHlFE,EACXd,GACA,SAAee,GAAsD,IAArDC,QAAEA,EAAOC,MAAEA,EAAKC,SAAEA,KAAaC,GAAoBJ,EACjE,OACEd,MAAAC,cAAA,MAAA,CAAKkB,UAAU,UACbnB,MAAAC,cAAAmB,SAAAA,KAAYF,EAAK,CAAEG,IAAKJ,EAAUK,aAAcN,IAC7CD,aAAO,EAAPA,EAASQ,KAAKC,GACbxB,MAAAC,cAAA,SAAA,CACEwB,IAAG,GAAAC,OAAKC,KAAKC,UAAUJ,IACvBR,MAAyB,iB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dG,GAASA,GAEXL,GAAgB7C,MAAAC,cAAA,IAAA,CAAGkB,UAAU,QAAQ0B,GACrCC,GAAY9C,MAAAC,cAAA,IAAA,CAAGkB,kBAASO,OAAUiB,EAAQ,YAAc,KAAOG,GACnD,IAInBR,EAAMsC,YAAc"}
|
|
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","setIconColor","color","IconComponent","memo","React","createElement","setIconComponent","component","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"],"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";var e
|
|
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;
|
|
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","
|
|
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,GAA8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OAAS,OACtBE,OAAQa,EAAMb,QAAU,OACxBZ,QAASyB,EAAMzB,SAAW,SAC1BE,MAAOuB,EAAMvB,OAAS,YACnBuB,MAEL9C,WAAA,CAAAC,YAAA,oBAAAC,YAAA,gBAR8BJ,CAQ9B,CAAA,MAEWiD,EAAYlD,EAAIA,KAACC,EAAOF,GAAMiD,OAAOC,IAA+B,CAC/Ef,MAAO,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,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),r=require("
|
|
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;
|
|
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","
|
|
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,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e
|
|
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};
|
|
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","_templateObject","_taggedTemplateLiteral","_ref","disabled","userDisabled","_ref2","Select","_ref3","options","value","inputRef","props","className","_extends","ref","defaultValue","map","option","key","concat","JSON","stringify","label","InputComponent","input","_templateObject2","TextAreaComponent","textarea","_templateObject3","StyledFieldLabel","_templateObject4","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","displayName","component"],"mappings":"6IAQA,IAAIA,EAAqCA,IAAM,UAM/C,IAAIC,EAAmCC,EAAAA,MAAK,WAA2B,OAAOC,MAAAC,cAAA,OAAA,KAAS,IAE1EC,MAYAC,EAAqCC,EAAOC,IAAGC,IAAAA,EAAAC,EAAAA,+1CAC/CC,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,IAqHlFE,EACXb,EAAIA,MACJ,SAAec,GAAsD,IAArDC,QAAEA,EAAOC,MAAEA,EAAKC,SAAEA,KAAaC,GAAoBJ,EACjE,OACEb,MAAAC,cAAA,MAAA,CAAKiB,UAAU,UACblB,MAAAC,cAAAkB,SAAAA,EAAAA,WAAYF,EAAK,CAAEG,IAAKJ,EAAUK,aAAcN,IAC7CD,aAAO,EAAPA,EAASQ,KAAKC,GACbvB,MAAAC,cAAA,SAAA,CACEuB,IAAG,GAAAC,OAAKC,KAAKC,UAAUJ,IACvBR,MAAyB,iBAAXQ,EAAuBA,aAAM,EAANA,EAAsBR,MAAQQ,GAEhD,iBAAXA,E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,GAASA,GAEXL,GAAgB5C,MAAAC,cAAA,IAAA,CAAGiB,UAAU,QAAQ0B,GACrCC,GAAY7C,MAAAC,cAAA,IAAA,CAAGiB,kBAASO,OAAUiB,EAAQ,YAAc,KAAOG,GACnD,IAInBR,EAAMuC,YAAc,qFAxTSD,IAC3B9E,EAAY8E,CAAK,2BAKcE,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","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","value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C3B/E,EAAY+E,CAAK,2BAKcC,IAC/B/E,EAAgB+E,CAAS"}
|
package/dist/utils/esm/index.css
CHANGED
|
@@ -28,6 +28,49 @@
|
|
|
28
28
|
width: var(--height);
|
|
29
29
|
height: var(--width);
|
|
30
30
|
}
|
|
31
|
+
.divider-module_divider-line__6CesR {
|
|
32
|
+
position: relative;
|
|
33
|
+
display: block;
|
|
34
|
+
transition: opacity, width, height 250ms ease-in-out;
|
|
35
|
+
background-color: var(--color);
|
|
36
|
+
opacity: var(--opacity);
|
|
37
|
+
}
|
|
38
|
+
.divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
|
|
39
|
+
height: var(--length);
|
|
40
|
+
left: var(--left);
|
|
41
|
+
width: var(--width);
|
|
42
|
+
margin: var(--margin);
|
|
43
|
+
}
|
|
44
|
+
.divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
|
|
45
|
+
width: var(--length);
|
|
46
|
+
left: var(--left);
|
|
47
|
+
height: var(--height);
|
|
48
|
+
margin: var(--margin);
|
|
49
|
+
}
|
|
50
|
+
.layoutBox-module_layout-box__faPND {
|
|
51
|
+
display: flex;
|
|
52
|
+
position: relative;
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
flex: 0;
|
|
55
|
+
flex-grow: 0;
|
|
56
|
+
flex-shrink: 0;
|
|
57
|
+
flex-basis: auto;
|
|
58
|
+
flex-wrap: nowrap;
|
|
59
|
+
gap: 0;
|
|
60
|
+
text-align: left;
|
|
61
|
+
justify-content: flex-start;
|
|
62
|
+
align-items: flex-start;
|
|
63
|
+
align-self: auto;
|
|
64
|
+
margin: 0;
|
|
65
|
+
padding: 0;
|
|
66
|
+
width: auto;
|
|
67
|
+
height: auto;
|
|
68
|
+
max-width: none;
|
|
69
|
+
max-height: none;
|
|
70
|
+
min-width: 0;
|
|
71
|
+
min-height: 0;
|
|
72
|
+
border-radius: initial;
|
|
73
|
+
}
|
|
31
74
|
.CollapsibleContainer-module_collapsible-container__u0Jmm {
|
|
32
75
|
transform-origin: 0% 0%;
|
|
33
76
|
opacity: 0;
|
|
@@ -61,49 +104,6 @@
|
|
|
61
104
|
max-width: var(--prop-value);
|
|
62
105
|
opacity: 1;
|
|
63
106
|
}
|
|
64
|
-
.layoutBox-module_layout-box__faPND {
|
|
65
|
-
display: flex;
|
|
66
|
-
position: relative;
|
|
67
|
-
flex-direction: row;
|
|
68
|
-
flex: 0;
|
|
69
|
-
flex-grow: 0;
|
|
70
|
-
flex-shrink: 0;
|
|
71
|
-
flex-basis: auto;
|
|
72
|
-
flex-wrap: nowrap;
|
|
73
|
-
gap: 0;
|
|
74
|
-
text-align: left;
|
|
75
|
-
justify-content: flex-start;
|
|
76
|
-
align-items: flex-start;
|
|
77
|
-
align-self: auto;
|
|
78
|
-
margin: 0;
|
|
79
|
-
padding: 0;
|
|
80
|
-
width: auto;
|
|
81
|
-
height: auto;
|
|
82
|
-
max-width: none;
|
|
83
|
-
max-height: none;
|
|
84
|
-
min-width: 0;
|
|
85
|
-
min-height: 0;
|
|
86
|
-
border-radius: initial;
|
|
87
|
-
}
|
|
88
|
-
.divider-module_divider-line__6CesR {
|
|
89
|
-
position: relative;
|
|
90
|
-
display: block;
|
|
91
|
-
transition: opacity, width, height 250ms ease-in-out;
|
|
92
|
-
background-color: var(--color);
|
|
93
|
-
opacity: var(--opacity);
|
|
94
|
-
}
|
|
95
|
-
.divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
|
|
96
|
-
height: var(--length);
|
|
97
|
-
left: var(--left);
|
|
98
|
-
width: var(--width);
|
|
99
|
-
margin: var(--margin);
|
|
100
|
-
}
|
|
101
|
-
.divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
|
|
102
|
-
width: var(--length);
|
|
103
|
-
left: var(--left);
|
|
104
|
-
height: var(--height);
|
|
105
|
-
margin: var(--margin);
|
|
106
|
-
}
|
|
107
107
|
.flowLayout-module_flowLayout__VHpnY {
|
|
108
108
|
overflow: auto;
|
|
109
109
|
}
|
package/dist/utils/index.css
CHANGED
|
@@ -28,6 +28,49 @@
|
|
|
28
28
|
width: var(--height);
|
|
29
29
|
height: var(--width);
|
|
30
30
|
}
|
|
31
|
+
.divider-module_divider-line__6CesR {
|
|
32
|
+
position: relative;
|
|
33
|
+
display: block;
|
|
34
|
+
transition: opacity, width, height 250ms ease-in-out;
|
|
35
|
+
background-color: var(--color);
|
|
36
|
+
opacity: var(--opacity);
|
|
37
|
+
}
|
|
38
|
+
.divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
|
|
39
|
+
height: var(--length);
|
|
40
|
+
left: var(--left);
|
|
41
|
+
width: var(--width);
|
|
42
|
+
margin: var(--margin);
|
|
43
|
+
}
|
|
44
|
+
.divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
|
|
45
|
+
width: var(--length);
|
|
46
|
+
left: var(--left);
|
|
47
|
+
height: var(--height);
|
|
48
|
+
margin: var(--margin);
|
|
49
|
+
}
|
|
50
|
+
.layoutBox-module_layout-box__faPND {
|
|
51
|
+
display: flex;
|
|
52
|
+
position: relative;
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
flex: 0;
|
|
55
|
+
flex-grow: 0;
|
|
56
|
+
flex-shrink: 0;
|
|
57
|
+
flex-basis: auto;
|
|
58
|
+
flex-wrap: nowrap;
|
|
59
|
+
gap: 0;
|
|
60
|
+
text-align: left;
|
|
61
|
+
justify-content: flex-start;
|
|
62
|
+
align-items: flex-start;
|
|
63
|
+
align-self: auto;
|
|
64
|
+
margin: 0;
|
|
65
|
+
padding: 0;
|
|
66
|
+
width: auto;
|
|
67
|
+
height: auto;
|
|
68
|
+
max-width: none;
|
|
69
|
+
max-height: none;
|
|
70
|
+
min-width: 0;
|
|
71
|
+
min-height: 0;
|
|
72
|
+
border-radius: initial;
|
|
73
|
+
}
|
|
31
74
|
.CollapsibleContainer-module_collapsible-container__u0Jmm {
|
|
32
75
|
transform-origin: 0% 0%;
|
|
33
76
|
opacity: 0;
|
|
@@ -61,49 +104,6 @@
|
|
|
61
104
|
max-width: var(--prop-value);
|
|
62
105
|
opacity: 1;
|
|
63
106
|
}
|
|
64
|
-
.layoutBox-module_layout-box__faPND {
|
|
65
|
-
display: flex;
|
|
66
|
-
position: relative;
|
|
67
|
-
flex-direction: row;
|
|
68
|
-
flex: 0;
|
|
69
|
-
flex-grow: 0;
|
|
70
|
-
flex-shrink: 0;
|
|
71
|
-
flex-basis: auto;
|
|
72
|
-
flex-wrap: nowrap;
|
|
73
|
-
gap: 0;
|
|
74
|
-
text-align: left;
|
|
75
|
-
justify-content: flex-start;
|
|
76
|
-
align-items: flex-start;
|
|
77
|
-
align-self: auto;
|
|
78
|
-
margin: 0;
|
|
79
|
-
padding: 0;
|
|
80
|
-
width: auto;
|
|
81
|
-
height: auto;
|
|
82
|
-
max-width: none;
|
|
83
|
-
max-height: none;
|
|
84
|
-
min-width: 0;
|
|
85
|
-
min-height: 0;
|
|
86
|
-
border-radius: initial;
|
|
87
|
-
}
|
|
88
|
-
.divider-module_divider-line__6CesR {
|
|
89
|
-
position: relative;
|
|
90
|
-
display: block;
|
|
91
|
-
transition: opacity, width, height 250ms ease-in-out;
|
|
92
|
-
background-color: var(--color);
|
|
93
|
-
opacity: var(--opacity);
|
|
94
|
-
}
|
|
95
|
-
.divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
|
|
96
|
-
height: var(--length);
|
|
97
|
-
left: var(--left);
|
|
98
|
-
width: var(--width);
|
|
99
|
-
margin: var(--margin);
|
|
100
|
-
}
|
|
101
|
-
.divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
|
|
102
|
-
width: var(--length);
|
|
103
|
-
left: var(--left);
|
|
104
|
-
height: var(--height);
|
|
105
|
-
margin: var(--margin);
|
|
106
|
-
}
|
|
107
107
|
.flowLayout-module_flowLayout__VHpnY {
|
|
108
108
|
overflow: auto;
|
|
109
109
|
}
|