@laerdal/life-react-components 3.2.3-dev.8.full → 3.3.1-dev.1
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/InputFields/RichTextField.cjs +1 -1
- package/dist/InputFields/RichTextField.cjs.map +1 -1
- package/dist/InputFields/RichTextField.js +1 -1
- package/dist/InputFields/RichTextField.js.map +1 -1
- package/dist/Table/TableBody.cjs +18 -6
- package/dist/Table/TableBody.cjs.map +1 -1
- package/dist/Table/TableBody.js +21 -9
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableStyles.cjs +20 -12
- package/dist/Table/TableStyles.cjs.map +1 -1
- package/dist/Table/TableStyles.d.ts +7 -1
- package/dist/Table/TableStyles.js +17 -11
- package/dist/Table/TableStyles.js.map +1 -1
- package/dist/Table/TableTypes.cjs.map +1 -1
- package/dist/Table/TableTypes.d.ts +1 -0
- package/dist/Table/TableTypes.js.map +1 -1
- package/dist/Table/index.cjs +27 -0
- package/dist/Table/index.cjs.map +1 -1
- package/dist/Table/index.d.ts +2 -1
- package/dist/Table/index.js +2 -0
- package/dist/Table/index.js.map +1 -1
- package/dist/styles/colors.cjs +6 -0
- package/dist/styles/colors.cjs.map +1 -1
- package/dist/styles/colors.d.ts +6 -0
- package/dist/styles/colors.js +6 -0
- package/dist/styles/colors.js.map +1 -1
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ var _excluded = ["readOnly", "disabled", "validationMessage", "note", "size", "s
|
|
|
22
22
|
var _templateObject;
|
|
23
23
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
24
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
-
var RichTextFieldContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .quill {\n width: 100%;\n margin-bottom: 4px;\n overflow: hidden;\n\n box-shadow: inset 0 0 0 1px ", ";\n border-radius: 4px;\n }\n\n .quill.valid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .quill.invalid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .quill:hover {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .quill:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .ql-editor {\n ", "\n }\n\n .ql-editor.ql-blank::before {\n ", "\n }\n\n &.medium {\n .ql-editor {\n ", "\n }\n\n .ql-editor.ql-blank::before {\n ", "\n }\n }\n\n .ql-toolbar.ql-snow {\n border: none;\n padding: 8px 7px;\n margin: 0 1px;\n border-bottom: 1px solid ", ";\n }\n\n .quill.valid .ql-toolbar,\n .quill.invalid .ql-toolbar,\n .quill:hover .ql-toolbar,\n .quill:focus-within .ql-toolbar {\n padding: 8px 6px;\n margin: 0 2px;\n }\n\n .ql-container {\n font-family: unset !important;\n }\n\n .ql-container.ql-snow {\n border: none;\n overflow-y: hidden;\n padding: 8px;\n }\n\n .ql-editor {\n padding: 8px;\n overflow-y: auto;\n\n ", "\n }\n\n &.resizable {\n height: initial;\n\n .quill {\n flex: none;\n overflow: initial;\n }\n\n .ql-container {\n flex: none;\n resize: vertical;\n }\n\n .ql-editor {\n height: 100%;\n }\n }\n\n &.readonly {\n .quill {\n ", "\n }\n }\n\n &.disabled {\n cursor: not-allowed;\n\n .quill {\n pointer-events: none;\n box-shadow: inset 0 0 0 1px ", ";\n color: ", ";\n\n .ql-editor.ql-blank::before {\n color: ", ";\n }\n }\n }\n"])), _styles.COLORS.neutral_400, _styles.COLORS.correct_500, _styles.COLORS.critical_500, _styles.COLORS.primary_700, _styles.COLORS.primary_800, (0, _styles.ComponentSStyling)(_styles.ComponentTextStyle.Regular, _styles.COLORS.black), (0, _styles.ComponentSStyling)(_styles.ComponentTextStyle.Italic, _styles.COLORS.neutral_500), (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Regular, _styles.COLORS.black), (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Italic, _styles.COLORS.neutral_500), _styles.COLORS.neutral_200, (0, _styles.scrollBarStyling)(_types.Size.Small), _styling.readOnlyState, _styles.COLORS.neutral_100, _styles.COLORS.neutral_300, _styles.COLORS.neutral_300);
|
|
25
|
+
var RichTextFieldContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .quill {\n width: 100%;\n margin-bottom: 4px;\n overflow: hidden;\n\n box-shadow: inset 0 0 0 1px ", ";\n border-radius: 4px;\n }\n\n .quill.valid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .quill.invalid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .quill:hover {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .quill:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .ql-editor,\n .ql-editor p{\n ", "\n }\n\n .ql-editor.ql-blank::before {\n ", "\n }\n\n &.medium {\n .ql-editor,\n .ql-editor p{\n ", "\n }\n\n .ql-editor.ql-blank::before {\n ", "\n }\n }\n\n .ql-toolbar.ql-snow {\n border: none;\n padding: 8px 7px;\n margin: 0 1px;\n border-bottom: 1px solid ", ";\n }\n\n .quill.valid .ql-toolbar,\n .quill.invalid .ql-toolbar,\n .quill:hover .ql-toolbar,\n .quill:focus-within .ql-toolbar {\n padding: 8px 6px;\n margin: 0 2px;\n }\n\n .ql-container {\n font-family: unset !important;\n }\n\n .ql-container.ql-snow {\n border: none;\n overflow-y: hidden;\n padding: 8px;\n }\n\n .ql-editor {\n padding: 8px;\n overflow-y: auto;\n\n ", "\n }\n\n &.resizable {\n height: initial;\n\n .quill {\n flex: none;\n overflow: initial;\n }\n\n .ql-container {\n flex: none;\n resize: vertical;\n }\n\n .ql-editor {\n height: 100%;\n }\n }\n\n &.readonly {\n .quill {\n ", "\n }\n }\n\n &.disabled {\n cursor: not-allowed;\n\n .quill {\n pointer-events: none;\n box-shadow: inset 0 0 0 1px ", ";\n color: ", ";\n\n .ql-editor.ql-blank::before {\n color: ", ";\n }\n }\n }\n"])), _styles.COLORS.neutral_400, _styles.COLORS.correct_500, _styles.COLORS.critical_500, _styles.COLORS.primary_700, _styles.COLORS.primary_800, (0, _styles.ComponentSStyling)(_styles.ComponentTextStyle.Regular, _styles.COLORS.black), (0, _styles.ComponentSStyling)(_styles.ComponentTextStyle.Italic, _styles.COLORS.neutral_500), (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Regular, _styles.COLORS.black), (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Italic, _styles.COLORS.neutral_500), _styles.COLORS.neutral_200, (0, _styles.scrollBarStyling)(_types.Size.Small), _styling.readOnlyState, _styles.COLORS.neutral_100, _styles.COLORS.neutral_300, _styles.COLORS.neutral_300);
|
|
26
26
|
exports.RichTextFieldContainer = RichTextFieldContainer;
|
|
27
27
|
var RichTextFieldFormats;
|
|
28
28
|
exports.RichTextFieldFormats = RichTextFieldFormats;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextField.cjs","names":["RichTextFieldContainer","styled","div","COLORS","neutral_400","correct_500","critical_500","primary_700","primary_800","ComponentSStyling","ComponentTextStyle","Regular","black","Italic","neutral_500","ComponentMStyling","neutral_200","scrollBarStyling","Size","Small","readOnlyState","neutral_100","neutral_300","RichTextFieldFormats","defaultToolBarOptions","header","RichTextField","React","forwardRef","ref","readOnly","disabled","validationMessage","note","size","Medium","state","resizable","modules","formats","rest","m","toolbar","f","Object","values","filter","a","Image","Video","Formula","States","Invalid","Valid","correct_400","critical_400","icon","message","id","className","placeholder","onKeyDown","onKeyPress","onKeyUp","value","onChange"],"sources":["../../src/InputFields/RichTextField.tsx"],"sourcesContent":["import React from 'react';\nimport ReactQuill, {Range, UnprivilegedEditor} from \"react-quill\";\nimport {TextFieldNote} from \"./types\";\nimport styled from \"styled-components\";\nimport {NoteMessage, readOnlyState, ValidationMessage} from \"./styling\";\nimport {Size, States} from \"../types\";\nimport {COLORS, ComponentMStyling, ComponentSStyling, ComponentTextStyle, scrollBarStyling} from \"../styles\";\nimport {CheckMark, TechnicalWarning} from \"../icons/systemicons\";\nimport {Sources, StringMap} from \"quill\";\nimport 'react-quill/dist/quill.snow.css';\n\nexport const RichTextFieldContainer = styled.div`\n .quill {\n width: 100%;\n margin-bottom: 4px;\n overflow: hidden;\n\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_400};\n border-radius: 4px;\n }\n\n .quill.valid {\n box-shadow: inset 0 0 0 2px ${COLORS.correct_500};\n }\n\n .quill.invalid {\n box-shadow: inset 0 0 0 2px ${COLORS.critical_500};\n }\n\n .quill:hover {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_700};\n }\n\n .quill:focus-within {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_800};\n }\n\n .ql-editor {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n\n .ql-editor.ql-blank::before {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n\n &.medium {\n .ql-editor {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n\n .ql-editor.ql-blank::before {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n\n .ql-toolbar.ql-snow {\n border: none;\n padding: 8px 7px;\n margin: 0 1px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n }\n\n .quill.valid .ql-toolbar,\n .quill.invalid .ql-toolbar,\n .quill:hover .ql-toolbar,\n .quill:focus-within .ql-toolbar {\n padding: 8px 6px;\n margin: 0 2px;\n }\n\n .ql-container {\n font-family: unset !important;\n }\n\n .ql-container.ql-snow {\n border: none;\n overflow-y: hidden;\n padding: 8px;\n }\n\n .ql-editor {\n padding: 8px;\n overflow-y: auto;\n\n ${scrollBarStyling(Size.Small)}\n }\n\n &.resizable {\n height: initial;\n\n .quill {\n flex: none;\n overflow: initial;\n }\n\n .ql-container {\n flex: none;\n resize: vertical;\n }\n\n .ql-editor {\n height: 100%;\n }\n }\n\n &.readonly {\n .quill {\n ${readOnlyState}\n }\n }\n\n &.disabled {\n cursor: not-allowed;\n\n .quill {\n pointer-events: none;\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_100};\n color: ${COLORS.neutral_300};\n\n .ql-editor.ql-blank::before {\n color: ${COLORS.neutral_300};\n }\n }\n }\n`;\n\nexport enum RichTextFieldFormats {\n Background = 'background',\n Bold = 'bold',\n Color = 'color',\n Font = 'font',\n Code = 'code',\n Italic = 'italic',\n Link = 'link',\n Size = 'size',\n Strike = 'strike',\n Script = 'script',\n Underline = 'underline',\n Blockquote = 'blockquote',\n Header = 'header',\n Indent = 'indent',\n List = 'list',\n Align = 'align',\n Direction = 'direction',\n CodeBlock = 'code-block',\n Formula = 'formula',\n Image = 'image',\n Video = 'video'\n}\n\nconst defaultToolBarOptions = [\n [{header: [1, 2, 3, false]}],\n ['bold', 'italic', 'underline', 'strike'],\n [{'list': 'ordered'}, {'list': 'bullet'}],\n ['link'],\n ['clean']\n];\n\nexport interface RichTextFieldProps {\n id?: string;\n className?: string;\n placeholder?: string;\n readOnly?: boolean;\n disabled?: boolean;\n resizable?: boolean;\n\n modules?: StringMap;\n formats?: RichTextFieldFormats[];\n\n onFocus?(selection: Range, source: Sources, editor: UnprivilegedEditor): void;\n\n onBlur?(previousSelection: Range, source: Sources, editor: UnprivilegedEditor): void;\n\n onKeyDown?: React.EventHandler<any>;\n onKeyPress?: React.EventHandler<any>;\n onKeyUp?: React.EventHandler<any>;\n\n value: any;\n onChange: (value: any) => void;\n\n validationMessage?: string;\n note?: TextFieldNote;\n size?: Size.Small | Size.Medium;\n state?: States.Invalid | States.Valid;\n}\n\nexport const RichTextField = React.forwardRef<any, RichTextFieldProps>(({\n readOnly,\n disabled,\n validationMessage,\n note,\n size = Size.Medium,\n state,\n resizable,\n modules,\n formats,\n ...rest\n }: RichTextFieldProps, ref) => {\n\n let m = {...(modules ?? {}), toolbar: modules?.toolbar ?? defaultToolBarOptions};\n let f = formats ?? Object.values(RichTextFieldFormats).filter(a => a !== RichTextFieldFormats.Image && a !== RichTextFieldFormats.Video && a !== RichTextFieldFormats.Formula);\n\n return (\n <RichTextFieldContainer\n className={`${resizable ? 'resizable' : ''} ${size} ${state || ''} ${readOnly ? 'readonly' : ''} ${disabled ? 'disabled' : ''}`}>\n <ReactQuill ref={ref}\n readOnly={readOnly || disabled}\n modules={m}\n theme={'snow'}\n formats={f}\n {...rest}\n />\n {validationMessage && (\n <ValidationMessage className={size || ''} type={state ?? States.Invalid}>\n {\n state === States.Valid\n ? <CheckMark color={COLORS.correct_400}/>\n : <TechnicalWarning color={COLORS.critical_400}/>\n }\n <span>{validationMessage}</span>\n </ValidationMessage>\n )}\n {note && !disabled && (\n <NoteMessage className={size}>\n {note.icon}\n <span>{note.message}</span>\n </NoteMessage>\n )}\n </RichTextFieldContainer>\n )\n});"],"mappings":";;;;;;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAyC;AAAA;AAAA;AAAA;AAAA;AAElC,IAAMA,sBAAsB,GAAGC,yBAAM,CAACC,GAAG,muDAMdC,cAAM,CAACC,WAAW,EAKlBD,cAAM,CAACE,WAAW,EAIlBF,cAAM,CAACG,YAAY,EAInBH,cAAM,CAACI,WAAW,EAIlBJ,cAAM,CAACK,WAAW,EAI9C,IAAAC,yBAAiB,EAACC,0BAAkB,CAACC,OAAO,EAAER,cAAM,CAACS,KAAK,CAAC,EA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AG;MAAC,IAAI,EAAEE,KAAK,aAALA,KAAK,cAALA,KAAK,GAAIe,aAAM,CAACC,OAAQ;MAAA,WAEpEhB,KAAK,KAAKe,aAAM,CAACE,KAAK,gBAClB,qBAAC,sBAAS;QAAC,KAAK,EAAElD,cAAM,CAACmD;MAAY,EAAE,gBACvC,qBAAC,6BAAgB;QAAC,KAAK,EAAEnD,cAAM,CAACoD;MAAa,EAAE,eAErD;QAAA,UAAOvB;MAAiB,EAAQ;IAAA,EAEnC,EACAC,IAAI,IAAI,CAACF,QAAQ,iBAChB,sBAAC,oBAAW;MAAC,SAAS,EAAEG,IAAK;MAAA,WAC1BD,IAAI,CAACuB,IAAI,eACV;QAAA,UAAOvB,IAAI,CAACwB;MAAO,EAAQ;IAAA,EAE9B;EAAA,EACsB;AAE7B,CAAC,CAAC;AAAC;AAAA;EAvEDC,EAAE;EACFC,SAAS;EACTC,WAAW;EACX9B,QAAQ;EACRC,QAAQ;EACRM,SAAS;EAGTE,OAAO;EAMPsB,SAAS;EACTC,UAAU;EACVC,OAAO;EAEPC,KAAK;EACLC,QAAQ;EAERjC,iBAAiB;AAAA"}
|
|
1
|
+
{"version":3,"file":"RichTextField.cjs","names":["RichTextFieldContainer","styled","div","COLORS","neutral_400","correct_500","critical_500","primary_700","primary_800","ComponentSStyling","ComponentTextStyle","Regular","black","Italic","neutral_500","ComponentMStyling","neutral_200","scrollBarStyling","Size","Small","readOnlyState","neutral_100","neutral_300","RichTextFieldFormats","defaultToolBarOptions","header","RichTextField","React","forwardRef","ref","readOnly","disabled","validationMessage","note","size","Medium","state","resizable","modules","formats","rest","m","toolbar","f","Object","values","filter","a","Image","Video","Formula","States","Invalid","Valid","correct_400","critical_400","icon","message","id","className","placeholder","onKeyDown","onKeyPress","onKeyUp","value","onChange"],"sources":["../../src/InputFields/RichTextField.tsx"],"sourcesContent":["import React from 'react';\nimport ReactQuill, {Range, UnprivilegedEditor} from \"react-quill\";\nimport {TextFieldNote} from \"./types\";\nimport styled from \"styled-components\";\nimport {NoteMessage, readOnlyState, ValidationMessage} from \"./styling\";\nimport {Size, States} from \"../types\";\nimport {COLORS, ComponentMStyling, ComponentSStyling, ComponentTextStyle, scrollBarStyling} from \"../styles\";\nimport {CheckMark, TechnicalWarning} from \"../icons/systemicons\";\nimport {Sources, StringMap} from \"quill\";\nimport 'react-quill/dist/quill.snow.css';\n\nexport const RichTextFieldContainer = styled.div`\n .quill {\n width: 100%;\n margin-bottom: 4px;\n overflow: hidden;\n\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_400};\n border-radius: 4px;\n }\n\n .quill.valid {\n box-shadow: inset 0 0 0 2px ${COLORS.correct_500};\n }\n\n .quill.invalid {\n box-shadow: inset 0 0 0 2px ${COLORS.critical_500};\n }\n\n .quill:hover {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_700};\n }\n\n .quill:focus-within {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_800};\n }\n\n .ql-editor,\n .ql-editor p{\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n\n .ql-editor.ql-blank::before {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n\n &.medium {\n .ql-editor,\n .ql-editor p{\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n\n .ql-editor.ql-blank::before {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n\n .ql-toolbar.ql-snow {\n border: none;\n padding: 8px 7px;\n margin: 0 1px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n }\n\n .quill.valid .ql-toolbar,\n .quill.invalid .ql-toolbar,\n .quill:hover .ql-toolbar,\n .quill:focus-within .ql-toolbar {\n padding: 8px 6px;\n margin: 0 2px;\n }\n\n .ql-container {\n font-family: unset !important;\n }\n\n .ql-container.ql-snow {\n border: none;\n overflow-y: hidden;\n padding: 8px;\n }\n\n .ql-editor {\n padding: 8px;\n overflow-y: auto;\n\n ${scrollBarStyling(Size.Small)}\n }\n\n &.resizable {\n height: initial;\n\n .quill {\n flex: none;\n overflow: initial;\n }\n\n .ql-container {\n flex: none;\n resize: vertical;\n }\n\n .ql-editor {\n height: 100%;\n }\n }\n\n &.readonly {\n .quill {\n ${readOnlyState}\n }\n }\n\n &.disabled {\n cursor: not-allowed;\n\n .quill {\n pointer-events: none;\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_100};\n color: ${COLORS.neutral_300};\n\n .ql-editor.ql-blank::before {\n color: ${COLORS.neutral_300};\n }\n }\n }\n`;\n\nexport enum RichTextFieldFormats {\n Background = 'background',\n Bold = 'bold',\n Color = 'color',\n Font = 'font',\n Code = 'code',\n Italic = 'italic',\n Link = 'link',\n Size = 'size',\n Strike = 'strike',\n Script = 'script',\n Underline = 'underline',\n Blockquote = 'blockquote',\n Header = 'header',\n Indent = 'indent',\n List = 'list',\n Align = 'align',\n Direction = 'direction',\n CodeBlock = 'code-block',\n Formula = 'formula',\n Image = 'image',\n Video = 'video'\n}\n\nconst defaultToolBarOptions = [\n [{header: [1, 2, 3, false]}],\n ['bold', 'italic', 'underline', 'strike'],\n [{'list': 'ordered'}, {'list': 'bullet'}],\n ['link'],\n ['clean']\n];\n\nexport interface RichTextFieldProps {\n id?: string;\n className?: string;\n placeholder?: string;\n readOnly?: boolean;\n disabled?: boolean;\n resizable?: boolean;\n\n modules?: StringMap;\n formats?: RichTextFieldFormats[];\n\n onFocus?(selection: Range, source: Sources, editor: UnprivilegedEditor): void;\n\n onBlur?(previousSelection: Range, source: Sources, editor: UnprivilegedEditor): void;\n\n onKeyDown?: React.EventHandler<any>;\n onKeyPress?: React.EventHandler<any>;\n onKeyUp?: React.EventHandler<any>;\n\n value: any;\n onChange: (value: any) => void;\n\n validationMessage?: string;\n note?: TextFieldNote;\n size?: Size.Small | Size.Medium;\n state?: States.Invalid | States.Valid;\n}\n\nexport const RichTextField = React.forwardRef<any, RichTextFieldProps>(({\n readOnly,\n disabled,\n validationMessage,\n note,\n size = Size.Medium,\n state,\n resizable,\n modules,\n formats,\n ...rest\n }: RichTextFieldProps, ref) => {\n\n let m = {...(modules ?? {}), toolbar: modules?.toolbar ?? defaultToolBarOptions};\n let f = formats ?? Object.values(RichTextFieldFormats).filter(a => a !== RichTextFieldFormats.Image && a !== RichTextFieldFormats.Video && a !== RichTextFieldFormats.Formula);\n\n return (\n <RichTextFieldContainer\n className={`${resizable ? 'resizable' : ''} ${size} ${state || ''} ${readOnly ? 'readonly' : ''} ${disabled ? 'disabled' : ''}`}>\n <ReactQuill ref={ref}\n readOnly={readOnly || disabled}\n modules={m}\n theme={'snow'}\n formats={f}\n {...rest}\n />\n {validationMessage && (\n <ValidationMessage className={size || ''} type={state ?? States.Invalid}>\n {\n state === States.Valid\n ? <CheckMark color={COLORS.correct_400}/>\n : <TechnicalWarning color={COLORS.critical_400}/>\n }\n <span>{validationMessage}</span>\n </ValidationMessage>\n )}\n {note && !disabled && (\n <NoteMessage className={size}>\n {note.icon}\n <span>{note.message}</span>\n </NoteMessage>\n )}\n </RichTextFieldContainer>\n )\n});"],"mappings":";;;;;;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAyC;AAAA;AAAA;AAAA;AAAA;AAElC,IAAMA,sBAAsB,GAAGC,yBAAM,CAACC,GAAG,qwDAMdC,cAAM,CAACC,WAAW,EAKlBD,cAAM,CAACE,WAAW,EAIlBF,cAAM,CAACG,YAAY,EAInBH,cAAM,CAACI,WAAW,EAIlBJ,cAAM,CAACK,WAAW,EAK9C,IAAAC,yBAAiB,EAACC,0BAAkB,CAACC,OAAO,EAAER,cAAM,CAACS,KAAK,CAAC,EAI3D,IAAAH,yBAAiB,EAACC,0BAAkB,CAACG,MAAM,EAAEV,cAAM,CAACW,WAAW,CAAC,EAM9D,IAAAC,yBAAiB,EAACL,0BAAkB,CAACC,OAAO,EAAER,cAAM,CAACS,KAAK,CAAC,EAI3D,IAAAG,yBAAiB,EAACL,0BAAkB,CAACG,MAAM,EAAEV,cA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AAC,KAAK,EAAEnD,cAAM,CAACoD;MAAa,EAAE,eAErD;QAAA,UAAOvB;MAAiB,EAAQ;IAAA,EAEnC,EACAC,IAAI,IAAI,CAACF,QAAQ,iBAChB,sBAAC,oBAAW;MAAC,SAAS,EAAEG,IAAK;MAAA,WAC1BD,IAAI,CAACuB,IAAI,eACV;QAAA,UAAOvB,IAAI,CAACwB;MAAO,EAAQ;IAAA,EAE9B;EAAA,EACsB;AAE7B,CAAC,CAAC;AAAC;AAAA;EAvEDC,EAAE;EACFC,SAAS;EACTC,WAAW;EACX9B,QAAQ;EACRC,QAAQ;EACRM,SAAS;EAGTE,OAAO;EAMPsB,SAAS;EACTC,UAAU;EACVC,OAAO;EAEPC,KAAK;EACLC,QAAQ;EAERjC,iBAAiB;AAAA"}
|
|
@@ -16,7 +16,7 @@ import { CheckMark, TechnicalWarning } from "../icons/systemicons";
|
|
|
16
16
|
import 'react-quill/dist/quill.snow.css';
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
-
export var RichTextFieldContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .quill {\n width: 100%;\n margin-bottom: 4px;\n overflow: hidden;\n\n box-shadow: inset 0 0 0 1px ", ";\n border-radius: 4px;\n }\n\n .quill.valid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .quill.invalid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .quill:hover {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .quill:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .ql-editor {\n ", "\n }\n\n .ql-editor.ql-blank::before {\n ", "\n }\n\n &.medium {\n .ql-editor {\n ", "\n }\n\n .ql-editor.ql-blank::before {\n ", "\n }\n }\n\n .ql-toolbar.ql-snow {\n border: none;\n padding: 8px 7px;\n margin: 0 1px;\n border-bottom: 1px solid ", ";\n }\n\n .quill.valid .ql-toolbar,\n .quill.invalid .ql-toolbar,\n .quill:hover .ql-toolbar,\n .quill:focus-within .ql-toolbar {\n padding: 8px 6px;\n margin: 0 2px;\n }\n\n .ql-container {\n font-family: unset !important;\n }\n\n .ql-container.ql-snow {\n border: none;\n overflow-y: hidden;\n padding: 8px;\n }\n\n .ql-editor {\n padding: 8px;\n overflow-y: auto;\n\n ", "\n }\n\n &.resizable {\n height: initial;\n\n .quill {\n flex: none;\n overflow: initial;\n }\n\n .ql-container {\n flex: none;\n resize: vertical;\n }\n\n .ql-editor {\n height: 100%;\n }\n }\n\n &.readonly {\n .quill {\n ", "\n }\n }\n\n &.disabled {\n cursor: not-allowed;\n\n .quill {\n pointer-events: none;\n box-shadow: inset 0 0 0 1px ", ";\n color: ", ";\n\n .ql-editor.ql-blank::before {\n color: ", ";\n }\n }\n }\n"])), COLORS.neutral_400, COLORS.correct_500, COLORS.critical_500, COLORS.primary_700, COLORS.primary_800, ComponentSStyling(ComponentTextStyle.Regular, COLORS.black), ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500), ComponentMStyling(ComponentTextStyle.Regular, COLORS.black), ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500), COLORS.neutral_200, scrollBarStyling(Size.Small), readOnlyState, COLORS.neutral_100, COLORS.neutral_300, COLORS.neutral_300);
|
|
19
|
+
export var RichTextFieldContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .quill {\n width: 100%;\n margin-bottom: 4px;\n overflow: hidden;\n\n box-shadow: inset 0 0 0 1px ", ";\n border-radius: 4px;\n }\n\n .quill.valid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .quill.invalid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .quill:hover {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .quill:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n .ql-editor,\n .ql-editor p{\n ", "\n }\n\n .ql-editor.ql-blank::before {\n ", "\n }\n\n &.medium {\n .ql-editor,\n .ql-editor p{\n ", "\n }\n\n .ql-editor.ql-blank::before {\n ", "\n }\n }\n\n .ql-toolbar.ql-snow {\n border: none;\n padding: 8px 7px;\n margin: 0 1px;\n border-bottom: 1px solid ", ";\n }\n\n .quill.valid .ql-toolbar,\n .quill.invalid .ql-toolbar,\n .quill:hover .ql-toolbar,\n .quill:focus-within .ql-toolbar {\n padding: 8px 6px;\n margin: 0 2px;\n }\n\n .ql-container {\n font-family: unset !important;\n }\n\n .ql-container.ql-snow {\n border: none;\n overflow-y: hidden;\n padding: 8px;\n }\n\n .ql-editor {\n padding: 8px;\n overflow-y: auto;\n\n ", "\n }\n\n &.resizable {\n height: initial;\n\n .quill {\n flex: none;\n overflow: initial;\n }\n\n .ql-container {\n flex: none;\n resize: vertical;\n }\n\n .ql-editor {\n height: 100%;\n }\n }\n\n &.readonly {\n .quill {\n ", "\n }\n }\n\n &.disabled {\n cursor: not-allowed;\n\n .quill {\n pointer-events: none;\n box-shadow: inset 0 0 0 1px ", ";\n color: ", ";\n\n .ql-editor.ql-blank::before {\n color: ", ";\n }\n }\n }\n"])), COLORS.neutral_400, COLORS.correct_500, COLORS.critical_500, COLORS.primary_700, COLORS.primary_800, ComponentSStyling(ComponentTextStyle.Regular, COLORS.black), ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500), ComponentMStyling(ComponentTextStyle.Regular, COLORS.black), ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500), COLORS.neutral_200, scrollBarStyling(Size.Small), readOnlyState, COLORS.neutral_100, COLORS.neutral_300, COLORS.neutral_300);
|
|
20
20
|
export var RichTextFieldFormats;
|
|
21
21
|
(function (RichTextFieldFormats) {
|
|
22
22
|
RichTextFieldFormats["Background"] = "background";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextField.js","names":["React","ReactQuill","styled","NoteMessage","readOnlyState","ValidationMessage","Size","States","COLORS","ComponentMStyling","ComponentSStyling","ComponentTextStyle","scrollBarStyling","CheckMark","TechnicalWarning","RichTextFieldContainer","div","neutral_400","correct_500","critical_500","primary_700","primary_800","Regular","black","Italic","neutral_500","neutral_200","Small","neutral_100","neutral_300","RichTextFieldFormats","defaultToolBarOptions","header","RichTextField","forwardRef","ref","readOnly","disabled","validationMessage","note","size","Medium","state","resizable","modules","formats","rest","m","toolbar","f","Object","values","filter","a","Image","Video","Formula","Invalid","Valid","correct_400","critical_400","icon","message","id","className","placeholder","onKeyDown","onKeyPress","onKeyUp","value","onChange"],"sources":["../../src/InputFields/RichTextField.tsx"],"sourcesContent":["import React from 'react';\nimport ReactQuill, {Range, UnprivilegedEditor} from \"react-quill\";\nimport {TextFieldNote} from \"./types\";\nimport styled from \"styled-components\";\nimport {NoteMessage, readOnlyState, ValidationMessage} from \"./styling\";\nimport {Size, States} from \"../types\";\nimport {COLORS, ComponentMStyling, ComponentSStyling, ComponentTextStyle, scrollBarStyling} from \"../styles\";\nimport {CheckMark, TechnicalWarning} from \"../icons/systemicons\";\nimport {Sources, StringMap} from \"quill\";\nimport 'react-quill/dist/quill.snow.css';\n\nexport const RichTextFieldContainer = styled.div`\n .quill {\n width: 100%;\n margin-bottom: 4px;\n overflow: hidden;\n\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_400};\n border-radius: 4px;\n }\n\n .quill.valid {\n box-shadow: inset 0 0 0 2px ${COLORS.correct_500};\n }\n\n .quill.invalid {\n box-shadow: inset 0 0 0 2px ${COLORS.critical_500};\n }\n\n .quill:hover {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_700};\n }\n\n .quill:focus-within {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_800};\n }\n\n .ql-editor {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n\n .ql-editor.ql-blank::before {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n\n &.medium {\n .ql-editor {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n\n .ql-editor.ql-blank::before {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n\n .ql-toolbar.ql-snow {\n border: none;\n padding: 8px 7px;\n margin: 0 1px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n }\n\n .quill.valid .ql-toolbar,\n .quill.invalid .ql-toolbar,\n .quill:hover .ql-toolbar,\n .quill:focus-within .ql-toolbar {\n padding: 8px 6px;\n margin: 0 2px;\n }\n\n .ql-container {\n font-family: unset !important;\n }\n\n .ql-container.ql-snow {\n border: none;\n overflow-y: hidden;\n padding: 8px;\n }\n\n .ql-editor {\n padding: 8px;\n overflow-y: auto;\n\n ${scrollBarStyling(Size.Small)}\n }\n\n &.resizable {\n height: initial;\n\n .quill {\n flex: none;\n overflow: initial;\n }\n\n .ql-container {\n flex: none;\n resize: vertical;\n }\n\n .ql-editor {\n height: 100%;\n }\n }\n\n &.readonly {\n .quill {\n ${readOnlyState}\n }\n }\n\n &.disabled {\n cursor: not-allowed;\n\n .quill {\n pointer-events: none;\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_100};\n color: ${COLORS.neutral_300};\n\n .ql-editor.ql-blank::before {\n color: ${COLORS.neutral_300};\n }\n }\n }\n`;\n\nexport enum RichTextFieldFormats {\n Background = 'background',\n Bold = 'bold',\n Color = 'color',\n Font = 'font',\n Code = 'code',\n Italic = 'italic',\n Link = 'link',\n Size = 'size',\n Strike = 'strike',\n Script = 'script',\n Underline = 'underline',\n Blockquote = 'blockquote',\n Header = 'header',\n Indent = 'indent',\n List = 'list',\n Align = 'align',\n Direction = 'direction',\n CodeBlock = 'code-block',\n Formula = 'formula',\n Image = 'image',\n Video = 'video'\n}\n\nconst defaultToolBarOptions = [\n [{header: [1, 2, 3, false]}],\n ['bold', 'italic', 'underline', 'strike'],\n [{'list': 'ordered'}, {'list': 'bullet'}],\n ['link'],\n ['clean']\n];\n\nexport interface RichTextFieldProps {\n id?: string;\n className?: string;\n placeholder?: string;\n readOnly?: boolean;\n disabled?: boolean;\n resizable?: boolean;\n\n modules?: StringMap;\n formats?: RichTextFieldFormats[];\n\n onFocus?(selection: Range, source: Sources, editor: UnprivilegedEditor): void;\n\n onBlur?(previousSelection: Range, source: Sources, editor: UnprivilegedEditor): void;\n\n onKeyDown?: React.EventHandler<any>;\n onKeyPress?: React.EventHandler<any>;\n onKeyUp?: React.EventHandler<any>;\n\n value: any;\n onChange: (value: any) => void;\n\n validationMessage?: string;\n note?: TextFieldNote;\n size?: Size.Small | Size.Medium;\n state?: States.Invalid | States.Valid;\n}\n\nexport const RichTextField = React.forwardRef<any, RichTextFieldProps>(({\n readOnly,\n disabled,\n validationMessage,\n note,\n size = Size.Medium,\n state,\n resizable,\n modules,\n formats,\n ...rest\n }: RichTextFieldProps, ref) => {\n\n let m = {...(modules ?? {}), toolbar: modules?.toolbar ?? defaultToolBarOptions};\n let f = formats ?? Object.values(RichTextFieldFormats).filter(a => a !== RichTextFieldFormats.Image && a !== RichTextFieldFormats.Video && a !== RichTextFieldFormats.Formula);\n\n return (\n <RichTextFieldContainer\n className={`${resizable ? 'resizable' : ''} ${size} ${state || ''} ${readOnly ? 'readonly' : ''} ${disabled ? 'disabled' : ''}`}>\n <ReactQuill ref={ref}\n readOnly={readOnly || disabled}\n modules={m}\n theme={'snow'}\n formats={f}\n {...rest}\n />\n {validationMessage && (\n <ValidationMessage className={size || ''} type={state ?? States.Invalid}>\n {\n state === States.Valid\n ? <CheckMark color={COLORS.correct_400}/>\n : <TechnicalWarning color={COLORS.critical_400}/>\n }\n <span>{validationMessage}</span>\n </ValidationMessage>\n )}\n {note && !disabled && (\n <NoteMessage className={size}>\n {note.icon}\n <span>{note.message}</span>\n </NoteMessage>\n )}\n </RichTextFieldContainer>\n )\n});"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAmC,aAAa;AAEjE,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAAQC,WAAW,EAAEC,aAAa,EAAEC,iB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led","NoteMessage","readOnlyState","ValidationMessage","Size","States","COLORS","ComponentMStyling","ComponentSStyling","ComponentTextStyle","scrollBarStyling","CheckMark","TechnicalWarning","RichTextFieldContainer","div","neutral_400","correct_500","critical_500","primary_700","primary_800","Regular","black","Italic","neutral_500","neutral_200","Small","neutral_100","neutral_300","RichTextFieldFormats","defaultToolBarOptions","header","RichTextField","forwardRef","ref","readOnly","disabled","validationMessage","note","size","Medium","state","resizable","modules","formats","rest","m","toolbar","f","Object","values","filter","a","Image","Video","Formula","Invalid","Valid","correct_400","critical_400","icon","message","id","className","placeholder","onKeyDown","onKeyPress","onKeyUp","value","onChange"],"sources":["../../src/InputFields/RichTextField.tsx"],"sourcesContent":["import React from 'react';\nimport ReactQuill, {Range, UnprivilegedEditor} from \"react-quill\";\nimport {TextFieldNote} from \"./types\";\nimport styled from \"styled-components\";\nimport {NoteMessage, readOnlyState, ValidationMessage} from \"./styling\";\nimport {Size, States} from \"../types\";\nimport {COLORS, ComponentMStyling, ComponentSStyling, ComponentTextStyle, scrollBarStyling} from \"../styles\";\nimport {CheckMark, TechnicalWarning} from \"../icons/systemicons\";\nimport {Sources, StringMap} from \"quill\";\nimport 'react-quill/dist/quill.snow.css';\n\nexport const RichTextFieldContainer = styled.div`\n .quill {\n width: 100%;\n margin-bottom: 4px;\n overflow: hidden;\n\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_400};\n border-radius: 4px;\n }\n\n .quill.valid {\n box-shadow: inset 0 0 0 2px ${COLORS.correct_500};\n }\n\n .quill.invalid {\n box-shadow: inset 0 0 0 2px ${COLORS.critical_500};\n }\n\n .quill:hover {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_700};\n }\n\n .quill:focus-within {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_800};\n }\n\n .ql-editor,\n .ql-editor p{\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n\n .ql-editor.ql-blank::before {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n\n &.medium {\n .ql-editor,\n .ql-editor p{\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n\n .ql-editor.ql-blank::before {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n\n .ql-toolbar.ql-snow {\n border: none;\n padding: 8px 7px;\n margin: 0 1px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n }\n\n .quill.valid .ql-toolbar,\n .quill.invalid .ql-toolbar,\n .quill:hover .ql-toolbar,\n .quill:focus-within .ql-toolbar {\n padding: 8px 6px;\n margin: 0 2px;\n }\n\n .ql-container {\n font-family: unset !important;\n }\n\n .ql-container.ql-snow {\n border: none;\n overflow-y: hidden;\n padding: 8px;\n }\n\n .ql-editor {\n padding: 8px;\n overflow-y: auto;\n\n ${scrollBarStyling(Size.Small)}\n }\n\n &.resizable {\n height: initial;\n\n .quill {\n flex: none;\n overflow: initial;\n }\n\n .ql-container {\n flex: none;\n resize: vertical;\n }\n\n .ql-editor {\n height: 100%;\n }\n }\n\n &.readonly {\n .quill {\n ${readOnlyState}\n }\n }\n\n &.disabled {\n cursor: not-allowed;\n\n .quill {\n pointer-events: none;\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_100};\n color: ${COLORS.neutral_300};\n\n .ql-editor.ql-blank::before {\n color: ${COLORS.neutral_300};\n }\n }\n }\n`;\n\nexport enum RichTextFieldFormats {\n Background = 'background',\n Bold = 'bold',\n Color = 'color',\n Font = 'font',\n Code = 'code',\n Italic = 'italic',\n Link = 'link',\n Size = 'size',\n Strike = 'strike',\n Script = 'script',\n Underline = 'underline',\n Blockquote = 'blockquote',\n Header = 'header',\n Indent = 'indent',\n List = 'list',\n Align = 'align',\n Direction = 'direction',\n CodeBlock = 'code-block',\n Formula = 'formula',\n Image = 'image',\n Video = 'video'\n}\n\nconst defaultToolBarOptions = [\n [{header: [1, 2, 3, false]}],\n ['bold', 'italic', 'underline', 'strike'],\n [{'list': 'ordered'}, {'list': 'bullet'}],\n ['link'],\n ['clean']\n];\n\nexport interface RichTextFieldProps {\n id?: string;\n className?: string;\n placeholder?: string;\n readOnly?: boolean;\n disabled?: boolean;\n resizable?: boolean;\n\n modules?: StringMap;\n formats?: RichTextFieldFormats[];\n\n onFocus?(selection: Range, source: Sources, editor: UnprivilegedEditor): void;\n\n onBlur?(previousSelection: Range, source: Sources, editor: UnprivilegedEditor): void;\n\n onKeyDown?: React.EventHandler<any>;\n onKeyPress?: React.EventHandler<any>;\n onKeyUp?: React.EventHandler<any>;\n\n value: any;\n onChange: (value: any) => void;\n\n validationMessage?: string;\n note?: TextFieldNote;\n size?: Size.Small | Size.Medium;\n state?: States.Invalid | States.Valid;\n}\n\nexport const RichTextField = React.forwardRef<any, RichTextFieldProps>(({\n readOnly,\n disabled,\n validationMessage,\n note,\n size = Size.Medium,\n state,\n resizable,\n modules,\n formats,\n ...rest\n }: RichTextFieldProps, ref) => {\n\n let m = {...(modules ?? {}), toolbar: modules?.toolbar ?? defaultToolBarOptions};\n let f = formats ?? Object.values(RichTextFieldFormats).filter(a => a !== RichTextFieldFormats.Image && a !== RichTextFieldFormats.Video && a !== RichTextFieldFormats.Formula);\n\n return (\n <RichTextFieldContainer\n className={`${resizable ? 'resizable' : ''} ${size} ${state || ''} ${readOnly ? 'readonly' : ''} ${disabled ? 'disabled' : ''}`}>\n <ReactQuill ref={ref}\n readOnly={readOnly || disabled}\n modules={m}\n theme={'snow'}\n formats={f}\n {...rest}\n />\n {validationMessage && (\n <ValidationMessage className={size || ''} type={state ?? States.Invalid}>\n {\n state === States.Valid\n ? <CheckMark color={COLORS.correct_400}/>\n : <TechnicalWarning color={COLORS.critical_400}/>\n }\n <span>{validationMessage}</span>\n </ValidationMessage>\n )}\n {note && !disabled && (\n <NoteMessage className={size}>\n {note.icon}\n <span>{note.message}</span>\n </NoteMessage>\n )}\n </RichTextFieldContainer>\n )\n});"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB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AAO;EAEPC,KAAK;EACLC,QAAQ;EAERhC,iBAAiB;AAAA"}
|
package/dist/Table/TableBody.cjs
CHANGED
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
13
|
var _Button = require("../Button");
|
|
13
14
|
var _types = require("../types");
|
|
@@ -19,11 +20,14 @@ var _TableStyles = require("./TableStyles");
|
|
|
19
20
|
var _common = require("../common");
|
|
20
21
|
var _icons = require("../icons");
|
|
21
22
|
var _rooks = require("rooks");
|
|
23
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
22
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
+
var _templateObject;
|
|
23
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
24
27
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
28
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
26
29
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
30
|
+
var ColumnLabel = _styledComponents.default.span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n"])));
|
|
27
31
|
var TableBody = function TableBody(props) {
|
|
28
32
|
var _props$noRowsLabel;
|
|
29
33
|
var _useDimensionsRef = (0, _rooks.useDimensionsRef)({
|
|
@@ -114,8 +118,15 @@ var TableBody = function TableBody(props) {
|
|
|
114
118
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
115
119
|
children: [column.icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableCellIcon, {
|
|
116
120
|
children: column.icon
|
|
117
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
118
|
-
|
|
121
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_TableStyles.StyledTableCellTextWrapper, {
|
|
122
|
+
textWrap: !column.shortenText,
|
|
123
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableCellText, {
|
|
124
|
+
children: row[column.key]
|
|
125
|
+
}), Boolean(column.noteKey) && Boolean(row[column.noteKey]) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
126
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableCellNoteText, {
|
|
127
|
+
children: row[column.noteKey]
|
|
128
|
+
})
|
|
129
|
+
})]
|
|
119
130
|
})]
|
|
120
131
|
});
|
|
121
132
|
}
|
|
@@ -164,13 +175,13 @@ var TableBody = function TableBody(props) {
|
|
|
164
175
|
tabIndex: column.sortable && !props.showLoadingIndicator ? 0 : -1,
|
|
165
176
|
className: "".concat(!!column.sortable ? 'sortable' : '', " ").concat(column.key === ((_props$sortProps6 = props.sortProps) === null || _props$sortProps6 === void 0 ? void 0 : _props$sortProps6.column) && !!((_props$sortProps7 = props.sortProps) !== null && _props$sortProps7 !== void 0 && _props$sortProps7.direction) ? 'sorted' : '', " ").concat(column.justify || ''),
|
|
166
177
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_TableStyles.StyledTableHeaderColumnContent, {
|
|
167
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
178
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ColumnLabel, {
|
|
168
179
|
children: column.name
|
|
169
180
|
}), column.key === ((_props$sortProps8 = props.sortProps) === null || _props$sortProps8 === void 0 ? void 0 : _props$sortProps8.column) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableHeaderColumnSortDirection, {
|
|
170
181
|
children: ((_props$sortProps9 = props.sortProps) === null || _props$sortProps9 === void 0 ? void 0 : _props$sortProps9.direction) === 'asc' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.ArrowLineUp, {
|
|
171
|
-
size: '
|
|
182
|
+
size: '20px'
|
|
172
183
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.ArrowLineDown, {
|
|
173
|
-
size: '
|
|
184
|
+
size: '20px'
|
|
174
185
|
})
|
|
175
186
|
})]
|
|
176
187
|
})
|
|
@@ -203,8 +214,9 @@ var TableBody = function TableBody(props) {
|
|
|
203
214
|
style: {
|
|
204
215
|
maxWidth: column.width
|
|
205
216
|
},
|
|
206
|
-
title: column.shortenText
|
|
217
|
+
title: column.shortenText ? "".concat(row[column.key], " \n ").concat(column.noteKey ? row[column.noteKey] : '') : '',
|
|
207
218
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableCellContent, {
|
|
219
|
+
withNote: Boolean(column.noteKey),
|
|
208
220
|
className: "".concat(column.shortenText ? "truncate-text" : '', " ").concat(column.justify || ''),
|
|
209
221
|
style: {
|
|
210
222
|
color: column.colorFn && column.colorFn(row, column.key)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableBody.cjs","names":["TableBody","props","useDimensionsRef","updateOnResize","scrollContainerRef","dimensions","node","React","useState","scrollable","setScrollable","useEffect","clientWidth","scrollWidth","columns","rows","renderCellBody","column","row","type","tmp","variant","href","tabIndex","showLoadingIndicator","additionalProps","colorFn","color","key","e","preventDefault","stopPropagation","action","iconColor","shape","useTransparentBackground","icon","size","Size","Small","customContent","isSelected","multiSelect","selected","indexOf","keyExpr","layout","selectAllState","onSelectAllClick","map","defaultOnMouseDownHandler","sortable","sortByColumn","sortProps","direction","undefined","width","justify","name","currentPageRows","length","index","selectable","onRowClick","maxWidth","shortenText","noRowsLabel"],"sources":["../../src/Table/TableBody.tsx"],"sourcesContent":["import {TableColumn, TableProps} from './TableTypes';\nimport {Button} from '../Button';\nimport {Size} from '../types';\nimport * as React from 'react';\nimport {Checkbox} from '../InputFields';\nimport {ButtonProps} from '../Button/Button';\nimport IconButton, {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\nimport {HyperLink} from '../HyperLink';\nimport {\n StyledTableBody,\n StyledTableBodyRow,\n StyledTableCell,\n StyledTableCellContent,\n StyledTableCellIcon,\n StyledTableCellText,\n StyledTableHeaderColumn,\n StyledTableHeaderColumnContent,\n StyledTableHeaderColumns,\n StyledTableNoRowsLabelRow,\n StyledTable, StyledTableBodyWrapper, StyledTableHeaderRow, StyledTableHeaderColumnSortDirection,\n} from './TableStyles';\nimport {defaultOnMouseDownHandler} from '../common';\nimport {SystemIcons} from \"../icons\";\nimport {useDimensionsRef} from \"rooks\";\n\n\ninterface TableBodyProps extends TableProps {\n currentPageRows: any[];\n onRowClick?: (row: any) => void;\n selected?: any | any[];\n sortByColumn: (column: TableColumn) => void;\n onSelectAllClick: () => void;\n selectAllState: 'all' | 'some' | 'none';\n}\n\nconst TableBody: React.FC<TableBodyProps> = (props) => {\n\n const [scrollContainerRef, dimensions, node] = useDimensionsRef({updateOnResize: true});\n const [scrollable, setScrollable] = React.useState(false);\n\n React.useEffect(() => {\n const clientWidth = node?.clientWidth ?? 0;\n const scrollWidth = node?.scrollWidth ?? 0;\n setScrollable(scrollWidth > clientWidth);\n }, [dimensions, node, props.columns, props.rows]);\n\n\n const renderCellBody = (column: TableColumn, row: any) => {\n switch (column.type) {\n case 'link': {\n const tmp = ({\n variant: 'default',\n href: '#',\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n ...column.additionalProps\n }) as HyperlinkProps;\n return (\n <HyperLink style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...tmp}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </HyperLink>\n );\n }\n case 'icon': {\n const tmp = ({\n iconColor: column.colorFn && column.colorFn(row, column.key),\n variant: 'secondary',\n shape: 'circular',\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n useTransparentBackground: true,\n ...column.additionalProps\n }) as IconButtonProps;\n return <IconButton {...tmp}\n action={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {column.icon}\n </IconButton>\n }\n case 'button': {\n const tmp = ({\n variant: 'tertiary',\n size: Size.Small,\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n ...column.additionalProps\n }) as ButtonProps;\n return <Button style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...tmp}\n onClick={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </Button>\n }\n case 'boolean':\n return <Checkbox selected={!!row[column.key]} readOnly={true}/>;\n case 'custom':\n return column.customContent && column.customContent(row, column.key);\n case 'number':\n case 'text':\n default:\n return (\n <>\n {\n column.icon &&\n <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>\n }\n <StyledTableCellText>{row[column.key]}</StyledTableCellText>\n </>\n );\n }\n }\n\n const isSelected = (row: any) => {\n return (props.multiSelect && props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1) ||\n (!props.multiSelect && props.selected === (props.keyExpr ? row[props.keyExpr] : row));\n }\n\n return (\n <StyledTableBodyWrapper ref={scrollContainerRef as any} className={scrollable ? 'scrollable' : ''}>\n <StyledTable cellPadding=\"0\" cellSpacing=\"0\" data-testid=\"TestTable\" className={`table ${props.layout || ''}`}>\n <StyledTableHeaderRow>\n <StyledTableHeaderColumns data-testid=\"TestTableColumnHeaderRow\">\n {\n props.multiSelect &&\n <StyledTableHeaderColumn>\n <StyledTableHeaderColumnContent>\n <Checkbox selected={props.selectAllState === 'all'}\n disabled={props.showLoadingIndicator}\n semiSelected={props.selectAllState === 'some'}\n select={props.onSelectAllClick}/>\n </StyledTableHeaderColumnContent>\n </StyledTableHeaderColumn>\n }\n {props.columns.map((column: TableColumn) => (\n <StyledTableHeaderColumn key={column.key}\n onMouseDown={defaultOnMouseDownHandler}\n onClick={(e) => column.sortable && props.sortByColumn(column)}\n onKeyPress={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n column.sortable && props.sortByColumn(column)\n }\n }}\n aria-pressed={column.key === props.sortProps?.column && !!props.sortProps?.direction ? true : undefined}\n aria-sort={column.key === props.sortProps?.column && !!props.sortProps?.direction ? \n (props.sortProps?.direction == 'asc' ? 'ascending' : 'descending' ) \n : undefined}\n style={{width: column.width}}\n tabIndex={column.sortable && !props.showLoadingIndicator ? 0 : -1}\n className={`${!!column.sortable ? 'sortable' : ''} ${column.key === props.sortProps?.column && !!props.sortProps?.direction ? 'sorted' : ''} ${column.justify || ''}`}>\n <StyledTableHeaderColumnContent>\n <span>\n {column.name}\n </span>\n {\n column.key === props.sortProps?.column &&\n (\n <StyledTableHeaderColumnSortDirection>\n {\n props.sortProps?.direction === 'asc'\n ? <SystemIcons.ArrowLineUp size={'24px'}/>\n : <SystemIcons.ArrowLineDown size={'24px'}/>\n }\n </StyledTableHeaderColumnSortDirection>\n )\n }\n </StyledTableHeaderColumnContent>\n </StyledTableHeaderColumn>\n ))}\n </StyledTableHeaderColumns>\n </StyledTableHeaderRow>\n <StyledTableBody>\n {props.currentPageRows.length > 0 ? (\n props.currentPageRows.map((row: any, index: number) => (\n <StyledTableBodyRow key={`row_${index}`}\n className={`${props.selectable ? 'selectable' : ''} ${isSelected(row) ? 'selected' : ''}`}\n onClick={() => props.onRowClick && props.onRowClick(row)}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n props.onRowClick && props.onRowClick(row);\n }\n }}\n tabIndex={props.selectable && !props.showLoadingIndicator ? 0 : undefined}\n data-testid=\"TestTableDataRow\">\n {\n props.multiSelect &&\n <StyledTableCell>\n <StyledTableCellContent>\n <Checkbox selected={isSelected(row)}/>\n </StyledTableCellContent>\n </StyledTableCell>\n }\n {props.columns.map((column: TableColumn) => (\n <StyledTableCell key={`row_${index}_${column.key}`}\n style={{maxWidth: column.width}}\n title={column.shortenText && row[column.key]}>\n <StyledTableCellContent\n className={`${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`}\n style={{\n color: column.colorFn && column.colorFn(row, column.key),\n }}>\n {renderCellBody(column, row)}\n </StyledTableCellContent>\n </StyledTableCell>\n ))}\n </StyledTableBodyRow>\n ))\n ) : (\n <StyledTableNoRowsLabelRow data-testid=\"TestTableNoDataRow\">\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\n <StyledTableCellContent className={'center'}>\n {props.noRowsLabel ?? 'There are no rows to display'}\n </StyledTableCellContent>\n </StyledTableCell>\n </StyledTableNoRowsLabelRow>\n )}\n\n </StyledTableBody>\n </StyledTable>\n </StyledTableBodyWrapper>\n );\n }\n;\n\nexport default TableBody;\n"],"mappings":";;;;;;;;;;;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAaA;AACA;AACA;AAAuC;AAAA;AAAA;AAAA;AAAA;AAYvC,IAAMA,SAAmC,GAAG,SAAtCA,SAAmC,CAAIC,KAAK,EAAK;EAAA;EAErD,wBAA+C,IAAAC,uBAAgB,EAAC;MAACC,cAAc,EAAE;IAAI,CAAC,CAAC;IAAA;IAAhFC,kBAAkB;IAAEC,UAAU;IAAEC,IAAI;EAC3C,sBAAoCC,KAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;IAAA;IAAlDC,UAAU;IAAEC,aAAa;EAEhCH,KAAK,CAACI,SAAS,CAAC,YAAM;IAAA;IACpB,IAAMC,WAAW,wBAAGN,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEM,WAAW,iEAAI,CAAC;IAC1C,IAAMC,WAAW,wBAAGP,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEO,WAAW,iEAAI,CAAC;IAC1CH,aAAa,CAACG,WAAW,GAAGD,WAAW,CAAC;EAC1C,CAAC,EAAE,CAACP,UAAU,EAAEC,IAAI,EAAEL,KAAK,CAACa,OAAO,EAAEb,KAAK,CAACc,IAAI,CAAC,CAAC;EAGjD,IAAMC,cAAc,GAAG,SAAjBA,cAAc,CAAIC,MAAmB,EAAEC,GAAQ,EAAK;IACtD,QAAQD,MAAM,CAACE,IAAI;MACjB,KAAK,MAAM;QAAE;UACX,IAAMC,GAAG;YACPC,OAAO,EAAE,SAAS;Y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;AAAA"}
|
|
1
|
+
{"version":3,"file":"TableBody.cjs","names":["ColumnLabel","styled","span","TableBody","props","useDimensionsRef","updateOnResize","scrollContainerRef","dimensions","node","React","useState","scrollable","setScrollable","useEffect","clientWidth","scrollWidth","columns","rows","renderCellBody","column","row","type","tmp","variant","href","tabIndex","showLoadingIndicator","additionalProps","colorFn","color","key","e","preventDefault","stopPropagation","action","iconColor","shape","useTransparentBackground","icon","size","Size","Small","customContent","shortenText","Boolean","noteKey","isSelected","multiSelect","selected","indexOf","keyExpr","layout","selectAllState","onSelectAllClick","map","defaultOnMouseDownHandler","sortable","sortByColumn","sortProps","direction","undefined","width","justify","name","currentPageRows","length","index","selectable","onRowClick","maxWidth","noRowsLabel"],"sources":["../../src/Table/TableBody.tsx"],"sourcesContent":["import { TableColumn, TableProps } from './TableTypes';\nimport { Button } from '../Button';\nimport { Size } from '../types';\nimport * as React from 'react';\nimport { Checkbox } from '../InputFields';\nimport { ButtonProps } from '../Button/Button';\nimport IconButton, { IconButtonProps } from '../Button/Iconbutton';\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\nimport { HyperLink } from '../HyperLink';\nimport {\n StyledTableBody,\n StyledTableBodyRow,\n StyledTableCell,\n StyledTableCellContent,\n StyledTableCellIcon,\n StyledTableCellText,\n StyledTableHeaderColumn,\n StyledTableHeaderColumnContent,\n StyledTableHeaderColumns,\n StyledTableNoRowsLabelRow,\n StyledTable,\n StyledTableBodyWrapper,\n StyledTableHeaderRow,\n StyledTableHeaderColumnSortDirection,\n StyledTableCellNoteText,\n StyledTableCellTextWrapper,\n} from './TableStyles';\nimport { defaultOnMouseDownHandler } from '../common';\nimport { SystemIcons } from '../icons';\nimport { useDimensionsRef } from 'rooks';\nimport styled from 'styled-components';\n\ninterface TableBodyProps extends TableProps {\n currentPageRows: any[];\n onRowClick?: (row: any) => void;\n selected?: any | any[];\n sortByColumn: (column: TableColumn) => void;\n onSelectAllClick: () => void;\n selectAllState: 'all' | 'some' | 'none';\n}\n\nconst ColumnLabel = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n`;\n\nconst TableBody: React.FC<TableBodyProps> = (props) => {\n const [scrollContainerRef, dimensions, node] = useDimensionsRef({ updateOnResize: true });\n const [scrollable, setScrollable] = React.useState(false);\n\n React.useEffect(() => {\n const clientWidth = node?.clientWidth ?? 0;\n const scrollWidth = node?.scrollWidth ?? 0;\n setScrollable(scrollWidth > clientWidth);\n }, [dimensions, node, props.columns, props.rows]);\n\n const renderCellBody = (column: TableColumn, row: any) => {\n switch (column.type) {\n case 'link': {\n const tmp = {\n variant: 'default',\n href: '#',\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n ...column.additionalProps,\n } as HyperlinkProps;\n return (\n <HyperLink\n style={column.colorFn && { color: column.colorFn(row, column.key) }}\n {...tmp}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </HyperLink>\n );\n }\n case 'icon': {\n const tmp = {\n iconColor: column.colorFn && column.colorFn(row, column.key),\n variant: 'secondary',\n shape: 'circular',\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n useTransparentBackground: true,\n ...column.additionalProps,\n } as IconButtonProps;\n return (\n <IconButton\n {...tmp}\n action={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {column.icon}\n </IconButton>\n );\n }\n case 'button': {\n const tmp = {\n variant: 'tertiary',\n size: Size.Small,\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n ...column.additionalProps,\n } as ButtonProps;\n return (\n <Button\n style={column.colorFn && { color: column.colorFn(row, column.key) }}\n {...tmp}\n onClick={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </Button>\n );\n }\n case 'boolean':\n return <Checkbox selected={!!row[column.key]} readOnly={true} />;\n case 'custom':\n return column.customContent && column.customContent(row, column.key);\n case 'number':\n case 'text':\n default:\n return (\n <>\n {column.icon && <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>}\n <StyledTableCellTextWrapper textWrap={!column.shortenText}>\n <StyledTableCellText>{row[column.key]}</StyledTableCellText>\n {Boolean(column.noteKey) && Boolean(row[column.noteKey!]) && (\n <>\n <StyledTableCellNoteText>{row[column.noteKey!]}</StyledTableCellNoteText>\n </>\n )}\n </StyledTableCellTextWrapper>\n </>\n );\n }\n };\n\n const isSelected = (row: any) => {\n return (\n (props.multiSelect && props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1) ||\n (!props.multiSelect && props.selected === (props.keyExpr ? row[props.keyExpr] : row))\n );\n };\n\n return (\n <StyledTableBodyWrapper ref={scrollContainerRef as any} className={scrollable ? 'scrollable' : ''}>\n <StyledTable cellPadding=\"0\" cellSpacing=\"0\" data-testid=\"TestTable\" className={`table ${props.layout || ''}`}>\n <StyledTableHeaderRow>\n <StyledTableHeaderColumns data-testid=\"TestTableColumnHeaderRow\">\n {props.multiSelect && (\n <StyledTableHeaderColumn>\n <StyledTableHeaderColumnContent>\n <Checkbox\n selected={props.selectAllState === 'all'}\n disabled={props.showLoadingIndicator}\n semiSelected={props.selectAllState === 'some'}\n select={props.onSelectAllClick}\n />\n </StyledTableHeaderColumnContent>\n </StyledTableHeaderColumn>\n )}\n {props.columns.map((column: TableColumn) => (\n <StyledTableHeaderColumn\n key={column.key}\n onMouseDown={defaultOnMouseDownHandler}\n onClick={(e) => column.sortable && props.sortByColumn(column)}\n onKeyPress={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n column.sortable && props.sortByColumn(column);\n }\n }}\n aria-pressed={column.key === props.sortProps?.column && !!props.sortProps?.direction ? true : undefined}\n aria-sort={column.key === props.sortProps?.column && !!props.sortProps?.direction ? (props.sortProps?.direction == 'asc' ? 'ascending' : 'descending') : undefined}\n style={{ width: column.width }}\n tabIndex={column.sortable && !props.showLoadingIndicator ? 0 : -1}\n className={`${!!column.sortable ? 'sortable' : ''} ${column.key === props.sortProps?.column && !!props.sortProps?.direction ? 'sorted' : ''} ${\n column.justify || ''\n }`}>\n <StyledTableHeaderColumnContent>\n <ColumnLabel>{column.name}</ColumnLabel>\n {column.key === props.sortProps?.column && (\n <StyledTableHeaderColumnSortDirection>\n {props.sortProps?.direction === 'asc' ? <SystemIcons.ArrowLineUp size={'20px'} /> : <SystemIcons.ArrowLineDown size={'20px'} />}\n </StyledTableHeaderColumnSortDirection>\n )}\n </StyledTableHeaderColumnContent>\n </StyledTableHeaderColumn>\n ))}\n </StyledTableHeaderColumns>\n </StyledTableHeaderRow>\n <StyledTableBody>\n {props.currentPageRows.length > 0 ? (\n props.currentPageRows.map((row: any, index: number) => (\n <StyledTableBodyRow\n key={`row_${index}`}\n className={`${props.selectable ? 'selectable' : ''} ${isSelected(row) ? 'selected' : ''}`}\n onClick={() => props.onRowClick && props.onRowClick(row)}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n props.onRowClick && props.onRowClick(row);\n }\n }}\n tabIndex={props.selectable && !props.showLoadingIndicator ? 0 : undefined}\n data-testid=\"TestTableDataRow\">\n {props.multiSelect && (\n <StyledTableCell>\n <StyledTableCellContent>\n <Checkbox selected={isSelected(row)} />\n </StyledTableCellContent>\n </StyledTableCell>\n )}\n {props.columns.map((column: TableColumn) => (\n <StyledTableCell key={`row_${index}_${column.key}`} style={{ maxWidth: column.width }} title={column.shortenText ? `${row[column.key]} \\n ${column.noteKey ? row[column.noteKey!] : ''}` : ''}>\n <StyledTableCellContent\n withNote={Boolean(column.noteKey)}\n className={`${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`}\n style={{\n color: column.colorFn && column.colorFn(row, column.key),\n }}>\n {renderCellBody(column, row)}\n </StyledTableCellContent>\n </StyledTableCell>\n ))}\n </StyledTableBodyRow>\n ))\n ) : (\n <StyledTableNoRowsLabelRow data-testid=\"TestTableNoDataRow\">\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\n <StyledTableCellContent className={'center'}>{props.noRowsLabel ?? 'There are no rows to display'}</StyledTableCellContent>\n </StyledTableCell>\n </StyledTableNoRowsLabelRow>\n )}\n </StyledTableBody>\n </StyledTable>\n </StyledTableBodyWrapper>\n );\n};\nexport default TableBody;\n"],"mappings":";;;;;;;;;;;;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAkBA;AACA;AACA;AACA;AAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAWvC,IAAMA,WAAW,GAAGC,yBAAM,CAACC,IAAI,8JAI9B;AAED,IAAMC,SAAmC,GAAG,SAAtCA,SAAmC,CAAIC,KAAK,EAAK;EAAA;EACrD,wBAA+C,IAAAC,uBAAgB,EAAC;MAAEC,cAAc,EAAE;IAAK,CAAC,CAAC;IAAA;IAAlFC,kBAAkB;IAAEC,UAAU;IAAEC,IAAI;EAC3C,sBAAoCC,KAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;IAAA;IAAlDC,UAAU;IAAEC,aAAa;EAEhCH,KAAK,CAACI,SAAS,CAAC,YAAM;IAAA;IACpB,IAAMC,WAAW,wBAAGN,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEM,WAAW,iEAAI,CAAC;IAC1C,IAAMC,WAAW,wBAAGP,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEO,WAAW,iEAAI,CAAC;IAC1CH,aAAa,CAACG,WAAW,GAAGD,WAAW,CAAC;EAC1C,CAAC,EAAE,CAACP,UAAU,EAAEC,IAAI,EAAEL,KAAK,CAACa,OAAO,EAAEb,KAAK,CAACc,IAAI,CAAC,CAAC;EAEjD,IAAMC,cAAc,GAAG,SAAjBA,cAAc,CAAIC,MAAmB,EAAEC,GAAQ,EAAK;IACxD,QAAQD,MAAM,CAACE,IAAI;MACjB,KAAK,MAAM;QAAE;UACX,IAAMC,GAAG;YACPC,OAAO,EAAE,SAAS;YAClBC,IAAI,EAAE,GAAG;YACTC,QAAQ,EAAEtB,KAAK,CAACuB,oBAAoB,GAAG,CAAC,CAAC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AACa,OAAO,CAACiD,MAAM,IAAI9D,KAAK,CAAC4C,WAAW,GAAG,CAAC,GAAG,CAAC,CAAE;YAAA,uBAC3E,qBAAC,mCAAsB;cAAC,SAAS,EAAE,QAAS;cAAA,gCAAE5C,KAAK,CAACmE,WAAW,mEAAI;YAA8B;UAA0B;QAC3G;MAErB,EACe;IAAA;EACN,EACS;AAE7B,CAAC;AAAC;EAhNAN,eAAe;EACfI,UAAU;EACVpB,QAAQ;EACRS,YAAY;EACZJ,gBAAgB;EAChBD,cAAc,4BAAE,KAAK,EAAG,MAAM,EAAG,MAAM;AAAA;AAAA,eA4M1BlD,SAAS;AAAA"}
|
package/dist/Table/TableBody.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
3
4
|
import _pt from "prop-types";
|
|
5
|
+
var _templateObject;
|
|
4
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
8
|
import { Button } from '../Button';
|
|
@@ -9,13 +11,15 @@ import * as React from 'react';
|
|
|
9
11
|
import { Checkbox } from '../InputFields';
|
|
10
12
|
import IconButton from '../Button/Iconbutton';
|
|
11
13
|
import { HyperLink } from '../HyperLink';
|
|
12
|
-
import { StyledTableBody, StyledTableBodyRow, StyledTableCell, StyledTableCellContent, StyledTableCellIcon, StyledTableCellText, StyledTableHeaderColumn, StyledTableHeaderColumnContent, StyledTableHeaderColumns, StyledTableNoRowsLabelRow, StyledTable, StyledTableBodyWrapper, StyledTableHeaderRow, StyledTableHeaderColumnSortDirection } from './TableStyles';
|
|
14
|
+
import { StyledTableBody, StyledTableBodyRow, StyledTableCell, StyledTableCellContent, StyledTableCellIcon, StyledTableCellText, StyledTableHeaderColumn, StyledTableHeaderColumnContent, StyledTableHeaderColumns, StyledTableNoRowsLabelRow, StyledTable, StyledTableBodyWrapper, StyledTableHeaderRow, StyledTableHeaderColumnSortDirection, StyledTableCellNoteText, StyledTableCellTextWrapper } from './TableStyles';
|
|
13
15
|
import { defaultOnMouseDownHandler } from '../common';
|
|
14
|
-
import { SystemIcons } from
|
|
15
|
-
import { useDimensionsRef } from
|
|
16
|
+
import { SystemIcons } from '../icons';
|
|
17
|
+
import { useDimensionsRef } from 'rooks';
|
|
18
|
+
import styled from 'styled-components';
|
|
16
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
20
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
21
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
var ColumnLabel = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n"])));
|
|
19
23
|
var TableBody = function TableBody(props) {
|
|
20
24
|
var _props$noRowsLabel;
|
|
21
25
|
var _useDimensionsRef = useDimensionsRef({
|
|
@@ -106,8 +110,15 @@ var TableBody = function TableBody(props) {
|
|
|
106
110
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
107
111
|
children: [column.icon && /*#__PURE__*/_jsx(StyledTableCellIcon, {
|
|
108
112
|
children: column.icon
|
|
109
|
-
}), /*#__PURE__*/
|
|
110
|
-
|
|
113
|
+
}), /*#__PURE__*/_jsxs(StyledTableCellTextWrapper, {
|
|
114
|
+
textWrap: !column.shortenText,
|
|
115
|
+
children: [/*#__PURE__*/_jsx(StyledTableCellText, {
|
|
116
|
+
children: row[column.key]
|
|
117
|
+
}), Boolean(column.noteKey) && Boolean(row[column.noteKey]) && /*#__PURE__*/_jsx(_Fragment, {
|
|
118
|
+
children: /*#__PURE__*/_jsx(StyledTableCellNoteText, {
|
|
119
|
+
children: row[column.noteKey]
|
|
120
|
+
})
|
|
121
|
+
})]
|
|
111
122
|
})]
|
|
112
123
|
});
|
|
113
124
|
}
|
|
@@ -156,13 +167,13 @@ var TableBody = function TableBody(props) {
|
|
|
156
167
|
tabIndex: column.sortable && !props.showLoadingIndicator ? 0 : -1,
|
|
157
168
|
className: "".concat(!!column.sortable ? 'sortable' : '', " ").concat(column.key === ((_props$sortProps6 = props.sortProps) === null || _props$sortProps6 === void 0 ? void 0 : _props$sortProps6.column) && !!((_props$sortProps7 = props.sortProps) !== null && _props$sortProps7 !== void 0 && _props$sortProps7.direction) ? 'sorted' : '', " ").concat(column.justify || ''),
|
|
158
169
|
children: /*#__PURE__*/_jsxs(StyledTableHeaderColumnContent, {
|
|
159
|
-
children: [/*#__PURE__*/_jsx(
|
|
170
|
+
children: [/*#__PURE__*/_jsx(ColumnLabel, {
|
|
160
171
|
children: column.name
|
|
161
172
|
}), column.key === ((_props$sortProps8 = props.sortProps) === null || _props$sortProps8 === void 0 ? void 0 : _props$sortProps8.column) && /*#__PURE__*/_jsx(StyledTableHeaderColumnSortDirection, {
|
|
162
173
|
children: ((_props$sortProps9 = props.sortProps) === null || _props$sortProps9 === void 0 ? void 0 : _props$sortProps9.direction) === 'asc' ? /*#__PURE__*/_jsx(SystemIcons.ArrowLineUp, {
|
|
163
|
-
size: '
|
|
174
|
+
size: '20px'
|
|
164
175
|
}) : /*#__PURE__*/_jsx(SystemIcons.ArrowLineDown, {
|
|
165
|
-
size: '
|
|
176
|
+
size: '20px'
|
|
166
177
|
})
|
|
167
178
|
})]
|
|
168
179
|
})
|
|
@@ -195,8 +206,9 @@ var TableBody = function TableBody(props) {
|
|
|
195
206
|
style: {
|
|
196
207
|
maxWidth: column.width
|
|
197
208
|
},
|
|
198
|
-
title: column.shortenText
|
|
209
|
+
title: column.shortenText ? "".concat(row[column.key], " \n ").concat(column.noteKey ? row[column.noteKey] : '') : '',
|
|
199
210
|
children: /*#__PURE__*/_jsx(StyledTableCellContent, {
|
|
211
|
+
withNote: Boolean(column.noteKey),
|
|
200
212
|
className: "".concat(column.shortenText ? "truncate-text" : '', " ").concat(column.justify || ''),
|
|
201
213
|
style: {
|
|
202
214
|
color: column.colorFn && column.colorFn(row, column.key)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableBody.js","names":["Button","Size","React","Checkbox","IconButton","HyperLink","StyledTableBody","StyledTableBodyRow","StyledTableCell","StyledTableCellContent","StyledTableCellIcon","StyledTableCellText","StyledTableHeaderColumn","StyledTableHeaderColumnContent","StyledTableHeaderColumns","StyledTableNoRowsLabelRow","StyledTable","StyledTableBodyWrapper","StyledTableHeaderRow","StyledTableHeaderColumnSortDirection","defaultOnMouseDownHandler","SystemIcons","useDimensionsRef","TableBody","props","updateOnResize","scrollContainerRef","dimensions","node","useState","scrollable","setScrollable","useEffect","clientWidth","scrollWidth","columns","rows","renderCellBody","column","row","type","tmp","variant","href","tabIndex","showLoadingIndicator","additionalProps","colorFn","color","key","e","preventDefault","stopPropagation","action","iconColor","shape","useTransparentBackground","icon","size","Small","customContent","isSelected","multiSelect","selected","indexOf","keyExpr","layout","selectAllState","onSelectAllClick","map","sortable","sortByColumn","sortProps","direction","undefined","width","justify","name","currentPageRows","length","index","selectable","onRowClick","maxWidth","shortenText","noRowsLabel"],"sources":["../../src/Table/TableBody.tsx"],"sourcesContent":["import {TableColumn, TableProps} from './TableTypes';\nimport {Button} from '../Button';\nimport {Size} from '../types';\nimport * as React from 'react';\nimport {Checkbox} from '../InputFields';\nimport {ButtonProps} from '../Button/Button';\nimport IconButton, {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\nimport {HyperLink} from '../HyperLink';\nimport {\n StyledTableBody,\n StyledTableBodyRow,\n StyledTableCell,\n StyledTableCellContent,\n StyledTableCellIcon,\n StyledTableCellText,\n StyledTableHeaderColumn,\n StyledTableHeaderColumnContent,\n StyledTableHeaderColumns,\n StyledTableNoRowsLabelRow,\n StyledTable, StyledTableBodyWrapper, StyledTableHeaderRow, StyledTableHeaderColumnSortDirection,\n} from './TableStyles';\nimport {defaultOnMouseDownHandler} from '../common';\nimport {SystemIcons} from \"../icons\";\nimport {useDimensionsRef} from \"rooks\";\n\n\ninterface TableBodyProps extends TableProps {\n currentPageRows: any[];\n onRowClick?: (row: any) => void;\n selected?: any | any[];\n sortByColumn: (column: TableColumn) => void;\n onSelectAllClick: () => void;\n selectAllState: 'all' | 'some' | 'none';\n}\n\nconst TableBody: React.FC<TableBodyProps> = (props) => {\n\n const [scrollContainerRef, dimensions, node] = useDimensionsRef({updateOnResize: true});\n const [scrollable, setScrollable] = React.useState(false);\n\n React.useEffect(() => {\n const clientWidth = node?.clientWidth ?? 0;\n const scrollWidth = node?.scrollWidth ?? 0;\n setScrollable(scrollWidth > clientWidth);\n }, [dimensions, node, props.columns, props.rows]);\n\n\n const renderCellBody = (column: TableColumn, row: any) => {\n switch (column.type) {\n case 'link': {\n const tmp = ({\n variant: 'default',\n href: '#',\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n ...column.additionalProps\n }) as HyperlinkProps;\n return (\n <HyperLink style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...tmp}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </HyperLink>\n );\n }\n case 'icon': {\n const tmp = ({\n iconColor: column.colorFn && column.colorFn(row, column.key),\n variant: 'secondary',\n shape: 'circular',\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n useTransparentBackground: true,\n ...column.additionalProps\n }) as IconButtonProps;\n return <IconButton {...tmp}\n action={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {column.icon}\n </IconButton>\n }\n case 'button': {\n const tmp = ({\n variant: 'tertiary',\n size: Size.Small,\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n ...column.additionalProps\n }) as ButtonProps;\n return <Button style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...tmp}\n onClick={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </Button>\n }\n case 'boolean':\n return <Checkbox selected={!!row[column.key]} readOnly={true}/>;\n case 'custom':\n return column.customContent && column.customContent(row, column.key);\n case 'number':\n case 'text':\n default:\n return (\n <>\n {\n column.icon &&\n <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>\n }\n <StyledTableCellText>{row[column.key]}</StyledTableCellText>\n </>\n );\n }\n }\n\n const isSelected = (row: any) => {\n return (props.multiSelect && props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1) ||\n (!props.multiSelect && props.selected === (props.keyExpr ? row[props.keyExpr] : row));\n }\n\n return (\n <StyledTableBodyWrapper ref={scrollContainerRef as any} className={scrollable ? 'scrollable' : ''}>\n <StyledTable cellPadding=\"0\" cellSpacing=\"0\" data-testid=\"TestTable\" className={`table ${props.layout || ''}`}>\n <StyledTableHeaderRow>\n <StyledTableHeaderColumns data-testid=\"TestTableColumnHeaderRow\">\n {\n props.multiSelect &&\n <StyledTableHeaderColumn>\n <StyledTableHeaderColumnContent>\n <Checkbox selected={props.selectAllState === 'all'}\n disabled={props.showLoadingIndicator}\n semiSelected={props.selectAllState === 'some'}\n select={props.onSelectAllClick}/>\n </StyledTableHeaderColumnContent>\n </StyledTableHeaderColumn>\n }\n {props.columns.map((column: TableColumn) => (\n <StyledTableHeaderColumn key={column.key}\n onMouseDown={defaultOnMouseDownHandler}\n onClick={(e) => column.sortable && props.sortByColumn(column)}\n onKeyPress={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n column.sortable && props.sortByColumn(column)\n }\n }}\n aria-pressed={column.key === props.sortProps?.column && !!props.sortProps?.direction ? true : undefined}\n aria-sort={column.key === props.sortProps?.column && !!props.sortProps?.direction ? \n (props.sortProps?.direction == 'asc' ? 'ascending' : 'descending' ) \n : undefined}\n style={{width: column.width}}\n tabIndex={column.sortable && !props.showLoadingIndicator ? 0 : -1}\n className={`${!!column.sortable ? 'sortable' : ''} ${column.key === props.sortProps?.column && !!props.sortProps?.direction ? 'sorted' : ''} ${column.justify || ''}`}>\n <StyledTableHeaderColumnContent>\n <span>\n {column.name}\n </span>\n {\n column.key === props.sortProps?.column &&\n (\n <StyledTableHeaderColumnSortDirection>\n {\n props.sortProps?.direction === 'asc'\n ? <SystemIcons.ArrowLineUp size={'24px'}/>\n : <SystemIcons.ArrowLineDown size={'24px'}/>\n }\n </StyledTableHeaderColumnSortDirection>\n )\n }\n </StyledTableHeaderColumnContent>\n </StyledTableHeaderColumn>\n ))}\n </StyledTableHeaderColumns>\n </StyledTableHeaderRow>\n <StyledTableBody>\n {props.currentPageRows.length > 0 ? (\n props.currentPageRows.map((row: any, index: number) => (\n <StyledTableBodyRow key={`row_${index}`}\n className={`${props.selectable ? 'selectable' : ''} ${isSelected(row) ? 'selected' : ''}`}\n onClick={() => props.onRowClick && props.onRowClick(row)}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n props.onRowClick && props.onRowClick(row);\n }\n }}\n tabIndex={props.selectable && !props.showLoadingIndicator ? 0 : undefined}\n data-testid=\"TestTableDataRow\">\n {\n props.multiSelect &&\n <StyledTableCell>\n <StyledTableCellContent>\n <Checkbox selected={isSelected(row)}/>\n </StyledTableCellContent>\n </StyledTableCell>\n }\n {props.columns.map((column: TableColumn) => (\n <StyledTableCell key={`row_${index}_${column.key}`}\n style={{maxWidth: column.width}}\n title={column.shortenText && row[column.key]}>\n <StyledTableCellContent\n className={`${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`}\n style={{\n color: column.colorFn && column.colorFn(row, column.key),\n }}>\n {renderCellBody(column, row)}\n </StyledTableCellContent>\n </StyledTableCell>\n ))}\n </StyledTableBodyRow>\n ))\n ) : (\n <StyledTableNoRowsLabelRow data-testid=\"TestTableNoDataRow\">\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\n <StyledTableCellContent className={'center'}>\n {props.noRowsLabel ?? 'There are no rows to display'}\n </StyledTableCellContent>\n </StyledTableCell>\n </StyledTableNoRowsLabelRow>\n )}\n\n </StyledTableBody>\n </StyledTable>\n </StyledTableBodyWrapper>\n );\n }\n;\n\nexport default TableBody;\n"],"mappings":";;;;;AACA,SAAQA,MAAM,QAAO,WAAW;AAChC,SAAQC,IAAI,QAAO,UAAU;AAC7B,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAAQC,QAAQ,QAAO,gBAAgB;AAEvC,OAAOC,UAAU,MAAyB,sBAAsB;AAEhE,SAAQC,SAAS,QAAO,cAAc;AACtC,SACEC,eAAe,EACfC,kBAAkB,EAClBC,eAAe,EACfC,sBAAsB,EACtBC,mBAAmB,EACnBC,mBAAmB,EACnBC,uBAAuB,EACvBC,8BAA8B,EAC9BC,wBAAwB,EACxBC,yBAAyB,EACzBC,WAAW,EAAEC,sBAAsB,EAAEC,oBAAoB,EAAEC,oCAAoC,QAC1F,eAAe;AACtB,SAAQC,yBAAyB,QAAO,WAAW;AACnD,SAAQC,WAAW,QAAO,UAAU;AACpC,SAAQC,gBAAgB,QAAO,OAAO;AAAC;AAAA;AAAA;AAYvC,IAAMC,SAAmC,GAAG,SAAtCA,SAAmC,CAAIC,KAAK,EAAK;EAAA;EAErD,wBAA+CF,gBAAgB,CAAC;MAACG,cAAc,EAAE;IAAI,CAAC,CAAC;IAAA;IAAhFC,kBAAkB;IAAEC,UAAU;IAAE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1C,MAAM,CAACW,GAAG,EAU9B;YAAA,CACnB,CAAC;UAAA,iBA/B4B+B,KAAK,EAgChB;QAAA,CACtB,CAAC,gBAEF,KAAC,yBAAyB;UAAC,eAAY,oBAAoB;UAAA,uBACzD,KAAC,eAAe;YAAC,OAAO,EAAExD,KAAK,CAACW,OAAO,CAAC4C,MAAM,IAAIvD,KAAK,CAACsC,WAAW,GAAG,CAAC,GAAG,CAAC,CAAE;YAAA,uBAC3E,KAAC,sBAAsB;cAAC,SAAS,EAAE,QAAS;cAAA,gCACzCtC,KAAK,CAAC6D,WAAW,mEAAI;YAA8B;UAC7B;QACT;MAErB,EAEe;IAAA;EACN,EACS;AAE7B,CAAC;AACF;EA3MCP,eAAe;EACfI,UAAU;EACVnB,QAAQ;EACRQ,YAAY;EACZH,gBAAgB;EAChBD,cAAc,aAAE,KAAK,EAAG,MAAM,EAAG,MAAM;AAAA;AAwMzC,eAAe5C,SAAS"}
|
|
1
|
+
{"version":3,"file":"TableBody.js","names":["Button","Size","React","Checkbox","IconButton","HyperLink","StyledTableBody","StyledTableBodyRow","StyledTableCell","StyledTableCellContent","StyledTableCellIcon","StyledTableCellText","StyledTableHeaderColumn","StyledTableHeaderColumnContent","StyledTableHeaderColumns","StyledTableNoRowsLabelRow","StyledTable","StyledTableBodyWrapper","StyledTableHeaderRow","StyledTableHeaderColumnSortDirection","StyledTableCellNoteText","StyledTableCellTextWrapper","defaultOnMouseDownHandler","SystemIcons","useDimensionsRef","styled","ColumnLabel","span","TableBody","props","updateOnResize","scrollContainerRef","dimensions","node","useState","scrollable","setScrollable","useEffect","clientWidth","scrollWidth","columns","rows","renderCellBody","column","row","type","tmp","variant","href","tabIndex","showLoadingIndicator","additionalProps","colorFn","color","key","e","preventDefault","stopPropagation","action","iconColor","shape","useTransparentBackground","icon","size","Small","customContent","shortenText","Boolean","noteKey","isSelected","multiSelect","selected","indexOf","keyExpr","layout","selectAllState","onSelectAllClick","map","sortable","sortByColumn","sortProps","direction","undefined","width","justify","name","currentPageRows","length","index","selectable","onRowClick","maxWidth","noRowsLabel"],"sources":["../../src/Table/TableBody.tsx"],"sourcesContent":["import { TableColumn, TableProps } from './TableTypes';\nimport { Button } from '../Button';\nimport { Size } from '../types';\nimport * as React from 'react';\nimport { Checkbox } from '../InputFields';\nimport { ButtonProps } from '../Button/Button';\nimport IconButton, { IconButtonProps } from '../Button/Iconbutton';\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\nimport { HyperLink } from '../HyperLink';\nimport {\n StyledTableBody,\n StyledTableBodyRow,\n StyledTableCell,\n StyledTableCellContent,\n StyledTableCellIcon,\n StyledTableCellText,\n StyledTableHeaderColumn,\n StyledTableHeaderColumnContent,\n StyledTableHeaderColumns,\n StyledTableNoRowsLabelRow,\n StyledTable,\n StyledTableBodyWrapper,\n StyledTableHeaderRow,\n StyledTableHeaderColumnSortDirection,\n StyledTableCellNoteText,\n StyledTableCellTextWrapper,\n} from './TableStyles';\nimport { defaultOnMouseDownHandler } from '../common';\nimport { SystemIcons } from '../icons';\nimport { useDimensionsRef } from 'rooks';\nimport styled from 'styled-components';\n\ninterface TableBodyProps extends TableProps {\n currentPageRows: any[];\n onRowClick?: (row: any) => void;\n selected?: any | any[];\n sortByColumn: (column: TableColumn) => void;\n onSelectAllClick: () => void;\n selectAllState: 'all' | 'some' | 'none';\n}\n\nconst ColumnLabel = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n`;\n\nconst TableBody: React.FC<TableBodyProps> = (props) => {\n const [scrollContainerRef, dimensions, node] = useDimensionsRef({ updateOnResize: true });\n const [scrollable, setScrollable] = React.useState(false);\n\n React.useEffect(() => {\n const clientWidth = node?.clientWidth ?? 0;\n const scrollWidth = node?.scrollWidth ?? 0;\n setScrollable(scrollWidth > clientWidth);\n }, [dimensions, node, props.columns, props.rows]);\n\n const renderCellBody = (column: TableColumn, row: any) => {\n switch (column.type) {\n case 'link': {\n const tmp = {\n variant: 'default',\n href: '#',\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n ...column.additionalProps,\n } as HyperlinkProps;\n return (\n <HyperLink\n style={column.colorFn && { color: column.colorFn(row, column.key) }}\n {...tmp}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </HyperLink>\n );\n }\n case 'icon': {\n const tmp = {\n iconColor: column.colorFn && column.colorFn(row, column.key),\n variant: 'secondary',\n shape: 'circular',\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n useTransparentBackground: true,\n ...column.additionalProps,\n } as IconButtonProps;\n return (\n <IconButton\n {...tmp}\n action={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {column.icon}\n </IconButton>\n );\n }\n case 'button': {\n const tmp = {\n variant: 'tertiary',\n size: Size.Small,\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n ...column.additionalProps,\n } as ButtonProps;\n return (\n <Button\n style={column.colorFn && { color: column.colorFn(row, column.key) }}\n {...tmp}\n onClick={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </Button>\n );\n }\n case 'boolean':\n return <Checkbox selected={!!row[column.key]} readOnly={true} />;\n case 'custom':\n return column.customContent && column.customContent(row, column.key);\n case 'number':\n case 'text':\n default:\n return (\n <>\n {column.icon && <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>}\n <StyledTableCellTextWrapper textWrap={!column.shortenText}>\n <StyledTableCellText>{row[column.key]}</StyledTableCellText>\n {Boolean(column.noteKey) && Boolean(row[column.noteKey!]) && (\n <>\n <StyledTableCellNoteText>{row[column.noteKey!]}</StyledTableCellNoteText>\n </>\n )}\n </StyledTableCellTextWrapper>\n </>\n );\n }\n };\n\n const isSelected = (row: any) => {\n return (\n (props.multiSelect && props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1) ||\n (!props.multiSelect && props.selected === (props.keyExpr ? row[props.keyExpr] : row))\n );\n };\n\n return (\n <StyledTableBodyWrapper ref={scrollContainerRef as any} className={scrollable ? 'scrollable' : ''}>\n <StyledTable cellPadding=\"0\" cellSpacing=\"0\" data-testid=\"TestTable\" className={`table ${props.layout || ''}`}>\n <StyledTableHeaderRow>\n <StyledTableHeaderColumns data-testid=\"TestTableColumnHeaderRow\">\n {props.multiSelect && (\n <StyledTableHeaderColumn>\n <StyledTableHeaderColumnContent>\n <Checkbox\n selected={props.selectAllState === 'all'}\n disabled={props.showLoadingIndicator}\n semiSelected={props.selectAllState === 'some'}\n select={props.onSelectAllClick}\n />\n </StyledTableHeaderColumnContent>\n </StyledTableHeaderColumn>\n )}\n {props.columns.map((column: TableColumn) => (\n <StyledTableHeaderColumn\n key={column.key}\n onMouseDown={defaultOnMouseDownHandler}\n onClick={(e) => column.sortable && props.sortByColumn(column)}\n onKeyPress={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n column.sortable && props.sortByColumn(column);\n }\n }}\n aria-pressed={column.key === props.sortProps?.column && !!props.sortProps?.direction ? true : undefined}\n aria-sort={column.key === props.sortProps?.column && !!props.sortProps?.direction ? (props.sortProps?.direction == 'asc' ? 'ascending' : 'descending') : undefined}\n style={{ width: column.width }}\n tabIndex={column.sortable && !props.showLoadingIndicator ? 0 : -1}\n className={`${!!column.sortable ? 'sortable' : ''} ${column.key === props.sortProps?.column && !!props.sortProps?.direction ? 'sorted' : ''} ${\n column.justify || ''\n }`}>\n <StyledTableHeaderColumnContent>\n <ColumnLabel>{column.name}</ColumnLabel>\n {column.key === props.sortProps?.column && (\n <StyledTableHeaderColumnSortDirection>\n {props.sortProps?.direction === 'asc' ? <SystemIcons.ArrowLineUp size={'20px'} /> : <SystemIcons.ArrowLineDown size={'20px'} />}\n </StyledTableHeaderColumnSortDirection>\n )}\n </StyledTableHeaderColumnContent>\n </StyledTableHeaderColumn>\n ))}\n </StyledTableHeaderColumns>\n </StyledTableHeaderRow>\n <StyledTableBody>\n {props.currentPageRows.length > 0 ? (\n props.currentPageRows.map((row: any, index: number) => (\n <StyledTableBodyRow\n key={`row_${index}`}\n className={`${props.selectable ? 'selectable' : ''} ${isSelected(row) ? 'selected' : ''}`}\n onClick={() => props.onRowClick && props.onRowClick(row)}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n props.onRowClick && props.onRowClick(row);\n }\n }}\n tabIndex={props.selectable && !props.showLoadingIndicator ? 0 : undefined}\n data-testid=\"TestTableDataRow\">\n {props.multiSelect && (\n <StyledTableCell>\n <StyledTableCellContent>\n <Checkbox selected={isSelected(row)} />\n </StyledTableCellContent>\n </StyledTableCell>\n )}\n {props.columns.map((column: TableColumn) => (\n <StyledTableCell key={`row_${index}_${column.key}`} style={{ maxWidth: column.width }} title={column.shortenText ? `${row[column.key]} \\n ${column.noteKey ? row[column.noteKey!] : ''}` : ''}>\n <StyledTableCellContent\n withNote={Boolean(column.noteKey)}\n className={`${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`}\n style={{\n color: column.colorFn && column.colorFn(row, column.key),\n }}>\n {renderCellBody(column, row)}\n </StyledTableCellContent>\n </StyledTableCell>\n ))}\n </StyledTableBodyRow>\n ))\n ) : (\n <StyledTableNoRowsLabelRow data-testid=\"TestTableNoDataRow\">\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\n <StyledTableCellContent className={'center'}>{props.noRowsLabel ?? 'There are no rows to display'}</StyledTableCellContent>\n </StyledTableCell>\n </StyledTableNoRowsLabelRow>\n )}\n </StyledTableBody>\n </StyledTable>\n </StyledTableBodyWrapper>\n );\n};\nexport default TableBody;\n"],"mappings":";;;;;;;AACA,SAASA,MAAM,QAAQ,WAAW;AAClC,SAASC,IAAI,QAAQ,UAAU;AAC/B,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,gBAAgB;AAEzC,OAAOC,UAAU,MAA2B,sBAAsB;AAElE,SAASC,SAAS,QAAQ,cAAc;AACxC,SACEC,eAAe,EACfC,kBAAkB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YAAC,OAAO,EAAE3D,KAAK,CAACW,OAAO,CAAC+C,MAAM,IAAI1D,KAAK,CAACyC,WAAW,GAAG,CAAC,GAAG,CAAC,CAAE;YAAA,uBAC3E,KAAC,sBAAsB;cAAC,SAAS,EAAE,QAAS;cAAA,gCAAEzC,KAAK,CAAC+D,WAAW,mEAAI;YAA8B;UAA0B;QAC3G;MAErB,EACe;IAAA;EACN,EACS;AAE7B,CAAC;AAAC;EAhNAN,eAAe;EACfI,UAAU;EACVnB,QAAQ;EACRQ,YAAY;EACZH,gBAAgB;EAChBD,cAAc,aAAE,KAAK,EAAG,MAAM,EAAG,MAAM;AAAA;AA4MzC,eAAe/C,SAAS"}
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.TableWrapper = exports.StyledTableSpinner = exports.StyledTableNoRowsLabelRow = exports.StyledTableHeaderTitleContent = exports.StyledTableHeaderTitle = exports.StyledTableHeaderRow = exports.StyledTableHeaderColumns = exports.StyledTableHeaderColumnSortDirection = exports.StyledTableHeaderColumnContent = exports.StyledTableHeaderColumn = exports.StyledTableHeader = exports.StyledTableFooterCurrentInfo = exports.StyledTableFooterControls = exports.StyledTableFooterContent = exports.StyledTableFooterCollapseButton = exports.StyledTableFooter = exports.StyledTableCellText = exports.StyledTableCellIcon = exports.StyledTableCellContent = exports.StyledTableCell = exports.StyledTableBodyWrapper = exports.StyledTableBodyRow = exports.StyledTableBody = exports.StyledTable = void 0;
|
|
7
|
+
exports.TableWrapper = exports.StyledTableSpinner = exports.StyledTableNoRowsLabelRow = exports.StyledTableHeaderTitleContent = exports.StyledTableHeaderTitle = exports.StyledTableHeaderRow = exports.StyledTableHeaderColumns = exports.StyledTableHeaderColumnSortDirection = exports.StyledTableHeaderColumnContent = exports.StyledTableHeaderColumn = exports.StyledTableHeader = exports.StyledTableFooterCurrentInfo = exports.StyledTableFooterControls = exports.StyledTableFooterContent = exports.StyledTableFooterCollapseButton = exports.StyledTableFooter = exports.StyledTableCellTextWrapper = exports.StyledTableCellText = exports.StyledTableCellNoteText = exports.StyledTableCellIcon = exports.StyledTableCellContent = exports.StyledTableCell = exports.StyledTableBodyWrapper = exports.StyledTableBodyRow = exports.StyledTableBody = exports.StyledTable = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
10
|
var _styles = require("../styles");
|
|
@@ -12,7 +12,7 @@ var _typography = require("../styles/typography");
|
|
|
12
12
|
var _zIndexes = require("../styles/z-indexes");
|
|
13
13
|
var _Checkbox = require("../InputFields/Checkbox");
|
|
14
14
|
var _types = require("../types");
|
|
15
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24;
|
|
15
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26;
|
|
16
16
|
/**
|
|
17
17
|
* Table styles
|
|
18
18
|
*/
|
|
@@ -45,27 +45,35 @@ var StyledTableBody = _styledComponents.default.tbody(_templateObject13 || (_tem
|
|
|
45
45
|
exports.StyledTableBody = StyledTableBody;
|
|
46
46
|
var StyledTableCell = _styledComponents.default.td(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)([""])));
|
|
47
47
|
exports.StyledTableCell = StyledTableCell;
|
|
48
|
-
var StyledTableCellContent = _styledComponents.default.div(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["\n min-height:
|
|
48
|
+
var StyledTableCellContent = _styledComponents.default.div(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["\n min-height: ", ";\n\n padding: 0 16px;\n ", "\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n \n ", "{\n width: fit-content;\n }\n"])), function (props) {
|
|
49
|
+
return props.withNote ? '64px' : '48px';
|
|
50
|
+
}, (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.black), _Checkbox.StyledCheckBox);
|
|
49
51
|
exports.StyledTableCellContent = StyledTableCellContent;
|
|
50
|
-
var StyledTableCellIcon = _styledComponents.default.div(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n width:
|
|
52
|
+
var StyledTableCellIcon = _styledComponents.default.div(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n width: 20px;\n height: 20px;\n\n svg {\n color: ", ";\n width: 20px;\n height: 20px;\n }\n"])), _styles.COLORS.neutral_700, _styles.COLORS.neutral_700);
|
|
51
53
|
exports.StyledTableCellIcon = StyledTableCellIcon;
|
|
52
|
-
var StyledTableCellText = _styledComponents.default.span(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["\n
|
|
54
|
+
var StyledTableCellText = _styledComponents.default.span(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["\n display: block;\n"])));
|
|
53
55
|
exports.StyledTableCellText = StyledTableCellText;
|
|
54
|
-
var
|
|
56
|
+
var StyledTableCellTextWrapper = _styledComponents.default.div(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2.default)(["\n padding: 12px 0px;\n width: 100%;\n ", "\n"])), function (props) {
|
|
57
|
+
return !props.textWrap ? "\n overflow: hidden;\n text-overflow: ellipsis;\n " : "";
|
|
58
|
+
});
|
|
59
|
+
exports.StyledTableCellTextWrapper = StyledTableCellTextWrapper;
|
|
60
|
+
var StyledTableCellNoteText = _styledComponents.default.span(_templateObject19 || (_templateObject19 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n display: inline-block;\n width: 100%;\n"])), (0, _typography.ComponentXSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.neutral_600));
|
|
61
|
+
exports.StyledTableCellNoteText = StyledTableCellNoteText;
|
|
62
|
+
var StyledTableFooter = _styledComponents.default.div(_templateObject20 || (_templateObject20 = (0, _taggedTemplateLiteral2.default)(["\n"])));
|
|
55
63
|
exports.StyledTableFooter = StyledTableFooter;
|
|
56
|
-
var StyledTableFooterContent = _styledComponents.default.div(
|
|
64
|
+
var StyledTableFooterContent = _styledComponents.default.div(_templateObject21 || (_templateObject21 = (0, _taggedTemplateLiteral2.default)(["\n border-top: 2px solid ", ";\n border-bottom: 1px solid ", ";\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n"])), _styles.COLORS.neutral_200, _styles.COLORS.neutral_200);
|
|
57
65
|
exports.StyledTableFooterContent = StyledTableFooterContent;
|
|
58
|
-
var StyledTableFooterCurrentInfo = _styledComponents.default.span(
|
|
66
|
+
var StyledTableFooterCurrentInfo = _styledComponents.default.span(_templateObject22 || (_templateObject22 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 16px;\n ", "\n"])), (0, _typography.ComponentXSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.black));
|
|
59
67
|
exports.StyledTableFooterCurrentInfo = StyledTableFooterCurrentInfo;
|
|
60
|
-
var StyledTableFooterControls = _styledComponents.default.div(
|
|
68
|
+
var StyledTableFooterControls = _styledComponents.default.div(_templateObject23 || (_templateObject23 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n"])));
|
|
61
69
|
exports.StyledTableFooterControls = StyledTableFooterControls;
|
|
62
|
-
var StyledTableSpinner = _styledComponents.default.div(
|
|
70
|
+
var StyledTableSpinner = _styledComponents.default.div(_templateObject24 || (_templateObject24 = (0, _taggedTemplateLiteral2.default)(["\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(255, 255, 255, 0.75);\n top: 0;\n z-index: ", ";\n"])), function (props) {
|
|
63
71
|
var _props$zindex;
|
|
64
72
|
return (_props$zindex = props.zindex) !== null && _props$zindex !== void 0 ? _props$zindex : _zIndexes.Z_INDEXES.loader;
|
|
65
73
|
});
|
|
66
74
|
exports.StyledTableSpinner = StyledTableSpinner;
|
|
67
|
-
var StyledTableFooterCollapseButton = _styledComponents.default.button(
|
|
75
|
+
var StyledTableFooterCollapseButton = _styledComponents.default.button(_templateObject25 || (_templateObject25 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n border-bottom: 1px solid ", ";\n border-top: 1px solid ", ";\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ", ";\n\n cursor: pointer;\n\n ", "\n \n &:focus {\n ", "\n }\n\n &:hover {\n z-index: ", ";\n background: ", ";\n color: ", ";\n }\n\n &:active {\n z-index: ", ";\n background: ", ";\n color: ", ";\n }\n\n &:disabled {\n display: none;\n }\n\n"])), _styles.COLORS.neutral_200, _styles.COLORS.neutral_200, _styles.COLORS.white, (0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Bold, _styles.COLORS.neutral_600), _styles.focusStyles, _zIndexes.Z_INDEXES.hover, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _zIndexes.Z_INDEXES.active, _styles.COLORS.primary_100, _styles.COLORS.primary_800);
|
|
68
76
|
exports.StyledTableFooterCollapseButton = StyledTableFooterCollapseButton;
|
|
69
|
-
var StyledTableBodyWrapper = _styledComponents.default.div(
|
|
77
|
+
var StyledTableBodyWrapper = _styledComponents.default.div(_templateObject26 || (_templateObject26 = (0, _taggedTemplateLiteral2.default)(["\n overflow-x: auto;\n ", "\n\n ::-webkit-scrollbar-track {\n margin: 6px;\n }\n\n &.scrollable{\n margin-bottom: 6px;\n padding-bottom: 10px;\n }\n"])), (0, _styles.scrollBarStyling)(_types.Size.Small));
|
|
70
78
|
exports.StyledTableBodyWrapper = StyledTableBodyWrapper;
|
|
71
79
|
//# sourceMappingURL=TableStyles.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableStyles.cjs","names":["TableWrapper","styled","div","COLORS","neutral_200","StyledTable","table","StyledTableHeader","StyledTableHeaderTitle","StyledTableHeaderTitleContent","ComponentLStyling","ComponentTextStyle","Bold","black","StyledTableHeaderRow","thead","StyledTableHeaderColumns","tr","StyledTableHeaderColumnContent","StyledTableHeaderColumnSortDirection","span","StyledTableHeaderColumn","th","ComponentSStyling","neutral_600","white","primary_20","primary_700","Z_INDEXES","hover","primary_100","primary_800","active","focusStyles","neutral_20","StyledTableBodyRow","StyledTableNoRowsLabelRow","neutral_50","StyledTableBody","tbody","StyledTableCell","td","StyledTableCellContent","Regular","StyledCheckBox","StyledTableCellIcon","neutral_700","StyledTableCellText","StyledTableFooter","StyledTableFooterContent","StyledTableFooterCurrentInfo","ComponentXSStyling","StyledTableFooterControls","StyledTableSpinner","props","zindex","loader","StyledTableFooterCollapseButton","button","ComponentMStyling","StyledTableBodyWrapper","scrollBarStyling","Size","Small"],"sources":["../../src/Table/TableStyles.ts"],"sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS, focusStyles, scrollBarStyling} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport {StyledCheckBox} from '../InputFields/Checkbox';\nimport {Size} from \"../types\";\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n\n &.border{\n border-left: 1px solid ${COLORS.neutral_200};\n border-right: 1px solid ${COLORS.neutral_200};\n }\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n border-collapse: collapse;\n width: 100%;\n\n &.fixed {\n table-layout: fixed;\n }\n\n &.auto {\n table-layout: auto;\n }\n`;\n\nexport const StyledTableHeader = styled.div`\n`;\n\nexport const StyledTableHeaderTitle = styled.div`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderRow = styled.thead`\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumnSortDirection = styled.span`\n width: 24px;\n height: 24px;\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n text-align: unset;\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n ${focusStyles}\n }\n }\n\n &.left {\n & > div {\n justify-content: left;\n }\n }\n\n &.right {\n & > div {\n justify-content: right;\n }\n }\n\n &.center {\n & > div {\n justify-content: center;\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n background-color: ${COLORS.white};\n \n &:not(:last-child) {\n border-bottom: 1px solid ${COLORS.neutral_200};\n }\n\n &.selected{\n background-color: ${COLORS.primary_100};\n }\n \n &:hover {\n background-color: ${COLORS.primary_100};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n ${focusStyles}\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableNoRowsLabelRow = styled.tr`\n position: relative;\n outline: none;\n background-color: ${COLORS.neutral_50};\n`;\n\nexport const StyledTableBody = styled.tbody`\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div`\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n \n ${StyledCheckBox}{\n width: fit-content;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n`;\n\nexport const StyledTableCellText = styled.span`\n padding: 12px 0;\n`;\n\n\nexport const StyledTableFooter = styled.div`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div<{zindex?: string}>`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(255, 255, 255, 0.75);\n top: 0;\n z-index: ${(props) => (props.zindex ?? Z_INDEXES.loader)};\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n \n &:focus {\n ${focusStyles}\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n\n\nexport const StyledTableBodyWrapper = styled.div`\n overflow-x: auto;\n ${scrollBarStyling(Size.Small)}\n\n ::-webkit-scrollbar-track {\n margin: 6px;\n }\n\n &.scrollable{\n margin-bottom: 6px;\n padding-bottom: 10px;\n }\n`;\n"],"mappings":";;;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BAAM,CAACC,GAAG,2GAElD;AAAC;AAEK,IAAMmD,kBAAkB,GAAGpD,yBAAM,CAACC,GAAG,+NAM/B,UAACoD,KAAK;EAAA;EAAA,wBAAMA,KAAK,CAACC,MAAM,yDAAI3B,mBAAS,CAAC4B,MAAM;AAAA,CAAC,CACzD;AAAC;AAEK,IAAMC,+BAA+B,GAAGxD,yBAAM,CAACyD,MAAM,upBAE/BvD,cAAM,CAACC,WAAW,EACrBD,cAAM,CAACC,WAAW,EAU5BD,cAAM,CAACsB,KAAK,EAIxB,IAAAkC,6BAAiB,EAAChD,8BAAkB,CAACC,IAAI,EAAET,cAAM,CAACqB,WAAW,CAAC,EAG5DS,mBAAW,EAIFL,mBAAS,CAACC,KAAK,EACZ1B,cAAM,CAACuB,UAAU,EACtBvB,cAAM,CAACwB,WAAW,EAIhBC,mBAAS,CAACI,MAAM,EACb7B,cAAM,CAAC2B,WAAW,EACvB3B,cAAM,CAAC4B,WAAW,CAO9B;AAAC;AAGK,IAAM6B,sBAAsB,GAAG3D,yBAAM,CAACC,GAAG,2PAE5C,IAAA2D,wBAAgB,EAACC,WAAI,CAACC,KAAK,CAAC,CAU/B;AAAC"}
|
|
1
|
+
{"version":3,"file":"TableStyles.cjs","names":["TableWrapper","styled","div","COLORS","neutral_200","StyledTable","table","StyledTableHeader","StyledTableHeaderTitle","StyledTableHeaderTitleContent","ComponentLStyling","ComponentTextStyle","Bold","black","StyledTableHeaderRow","thead","StyledTableHeaderColumns","tr","StyledTableHeaderColumnContent","StyledTableHeaderColumnSortDirection","span","StyledTableHeaderColumn","th","ComponentSStyling","neutral_600","white","primary_20","primary_700","Z_INDEXES","hover","primary_100","primary_800","active","focusStyles","neutral_20","StyledTableBodyRow","StyledTableNoRowsLabelRow","neutral_50","StyledTableBody","tbody","StyledTableCell","td","StyledTableCellContent","props","withNote","Regular","StyledCheckBox","StyledTableCellIcon","neutral_700","StyledTableCellText","StyledTableCellTextWrapper","textWrap","StyledTableCellNoteText","ComponentXSStyling","StyledTableFooter","StyledTableFooterContent","StyledTableFooterCurrentInfo","StyledTableFooterControls","StyledTableSpinner","zindex","loader","StyledTableFooterCollapseButton","button","ComponentMStyling","StyledTableBodyWrapper","scrollBarStyling","Size","Small"],"sources":["../../src/Table/TableStyles.ts"],"sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS, focusStyles, scrollBarStyling} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport {StyledCheckBox} from '../InputFields/Checkbox';\nimport {Size} from \"../types\";\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n\n &.border{\n border-left: 1px solid ${COLORS.neutral_200};\n border-right: 1px solid ${COLORS.neutral_200};\n }\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n border-collapse: collapse;\n width: 100%;\n\n &.fixed {\n table-layout: fixed;\n }\n\n &.auto {\n table-layout: auto;\n }\n`;\n\nexport const StyledTableHeader = styled.div`\n`;\n\nexport const StyledTableHeaderTitle = styled.div`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderRow = styled.thead`\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumnSortDirection = styled.span`\n width: 24px;\n height: 24px;\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n text-align: unset;\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n ${focusStyles}\n }\n }\n\n &.left {\n & > div {\n justify-content: left;\n }\n }\n\n &.right {\n & > div {\n justify-content: right;\n }\n }\n\n &.center {\n & > div {\n justify-content: center;\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n background-color: ${COLORS.white};\n \n &:not(:last-child) {\n border-bottom: 1px solid ${COLORS.neutral_200};\n }\n\n &.selected{\n background-color: ${COLORS.primary_100};\n }\n \n &:hover {\n background-color: ${COLORS.primary_100};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n ${focusStyles}\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableNoRowsLabelRow = styled.tr`\n position: relative;\n outline: none;\n background-color: ${COLORS.neutral_50};\n`;\n\nexport const StyledTableBody = styled.tbody`\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div<{withNote?: boolean}>`\n min-height: ${props => props.withNote ? '64px' : '48px'};\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n \n ${StyledCheckBox}{\n width: fit-content;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 20px;\n height: 20px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 20px;\n height: 20px;\n }\n`;\n\nexport const StyledTableCellText = styled.span`\n display: block;\n`;\n\nexport const StyledTableCellTextWrapper = styled.div<{ textWrap?: boolean }>`\n padding: 12px 0px;\n width: 100%;\n ${props => !props.textWrap ? `\n overflow: hidden;\n text-overflow: ellipsis;\n ` : ``}\n`;\n\nexport const StyledTableCellNoteText = styled.span`\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n display: inline-block;\n width: 100%;\n`;\n\n\nexport const StyledTableFooter = styled.div`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div<{zindex?: string}>`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(255, 255, 255, 0.75);\n top: 0;\n z-index: ${(props) => (props.zindex ?? Z_INDEXES.loader)};\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n \n &:focus {\n ${focusStyles}\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n\n\nexport const StyledTableBodyWrapper = styled.div`\n overflow-x: auto;\n ${scrollBarStyling(Size.Small)}\n\n ::-webkit-scrollbar-track {\n margin: 6px;\n }\n\n &.scrollable{\n margin-bottom: 6px;\n padding-bottom: 10px;\n }\n`;\n"],"mappings":";;;;;;;;AAGA;AAKA;AACA;AAOA;AACA;AACA;AAA8B;AAE9B;AACA;AACA;;AAEO,IAAMA,YAAY,GAAGC,yBAAM,CAACC,GAAG,sMAITC,cAAM,CAACC,WAAW,EACjBD,cAAM,CAACC,WAAW,CAE/C;AAAC;AAGK,IAAMC,WAAW,GAAGJ,yBAAM,CAACK,KAAK,2PAYtC;AAAC;AAEK,IAAMC,iBAAiB,GAAGN,yBAAM,CAACC,GAAG,uFAC1C;AAAC;AAEK,IAAMM,sBAAsB,GAAGP,yBAAM,CAACC,GAAG,uFAC/C;AAAC;AAEK,IAAMO,6BAA6B,GAAGR,yBAAM,CAACC,GAAG,oXAO1BC,cAAM,CAACC,WAAW,EACrBD,cAAM,CAACC,WAAW,EAGxC,IAAAM,6BAAiB,EAACC,8BAAkB,CAACC,IAAI,EAAET,cAAM,CAACU,KAAK,CAAC,CAI3D;AAAC;AAEK,IAAMC,oBAAoB,GAAGb,yBAAM,CAACc,KAAK,uFAC/C;AAAC;AAEK,IAAMC,wBAAwB,GAAG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AACC,WAAW,EACrBD,cAAM,CAACC,WAAW,EAU5BD,cAAM,CAACsB,KAAK,EAIxB,IAAAsC,6BAAiB,EAACpD,8BAAkB,CAACC,IAAI,EAAET,cAAM,CAACqB,WAAW,CAAC,EAG5DS,mBAAW,EAIFL,mBAAS,CAACC,KAAK,EACZ1B,cAAM,CAACuB,UAAU,EACtBvB,cAAM,CAACwB,WAAW,EAIhBC,mBAAS,CAACI,MAAM,EACb7B,cAAM,CAAC2B,WAAW,EACvB3B,cAAM,CAAC4B,WAAW,CAO9B;AAAC;AAGK,IAAMiC,sBAAsB,GAAG/D,yBAAM,CAACC,GAAG,2PAE5C,IAAA+D,wBAAgB,EAACC,WAAI,CAACC,KAAK,CAAC,CAU/B;AAAC"}
|
|
@@ -15,9 +15,15 @@ export declare const StyledTableBodyRow: import("styled-components").StyledCompo
|
|
|
15
15
|
export declare const StyledTableNoRowsLabelRow: import("styled-components").StyledComponent<"tr", any, {}, never>;
|
|
16
16
|
export declare const StyledTableBody: import("styled-components").StyledComponent<"tbody", any, {}, never>;
|
|
17
17
|
export declare const StyledTableCell: import("styled-components").StyledComponent<"td", any, {}, never>;
|
|
18
|
-
export declare const StyledTableCellContent: import("styled-components").StyledComponent<"div", any, {
|
|
18
|
+
export declare const StyledTableCellContent: import("styled-components").StyledComponent<"div", any, {
|
|
19
|
+
withNote?: boolean | undefined;
|
|
20
|
+
}, never>;
|
|
19
21
|
export declare const StyledTableCellIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
20
22
|
export declare const StyledTableCellText: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
23
|
+
export declare const StyledTableCellTextWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
24
|
+
textWrap?: boolean | undefined;
|
|
25
|
+
}, never>;
|
|
26
|
+
export declare const StyledTableCellNoteText: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
21
27
|
export declare const StyledTableFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
22
28
|
export declare const StyledTableFooterContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
23
29
|
export declare const StyledTableFooterCurrentInfo: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24;
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26;
|
|
3
3
|
/**
|
|
4
4
|
* Import third-party libraries.
|
|
5
5
|
*/
|
|
@@ -32,17 +32,23 @@ export var StyledTableBodyRow = styled.tr(_templateObject11 || (_templateObject1
|
|
|
32
32
|
export var StyledTableNoRowsLabelRow = styled.tr(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n position: relative;\n outline: none;\n background-color: ", ";\n"])), COLORS.neutral_50);
|
|
33
33
|
export var StyledTableBody = styled.tbody(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n"])));
|
|
34
34
|
export var StyledTableCell = styled.td(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral([""])));
|
|
35
|
-
export var StyledTableCellContent = styled.div(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n min-height:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export var
|
|
39
|
-
export var
|
|
40
|
-
export var
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
export var StyledTableCellContent = styled.div(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n min-height: ", ";\n\n padding: 0 16px;\n ", "\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n \n ", "{\n width: fit-content;\n }\n"])), function (props) {
|
|
36
|
+
return props.withNote ? '64px' : '48px';
|
|
37
|
+
}, ComponentSStyling(ComponentTextStyle.Regular, COLORS.black), StyledCheckBox);
|
|
38
|
+
export var StyledTableCellIcon = styled.div(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n color: ", ";\n width: 20px;\n height: 20px;\n\n svg {\n color: ", ";\n width: 20px;\n height: 20px;\n }\n"])), COLORS.neutral_700, COLORS.neutral_700);
|
|
39
|
+
export var StyledTableCellText = styled.span(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n display: block;\n"])));
|
|
40
|
+
export var StyledTableCellTextWrapper = styled.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n padding: 12px 0px;\n width: 100%;\n ", "\n"])), function (props) {
|
|
41
|
+
return !props.textWrap ? "\n overflow: hidden;\n text-overflow: ellipsis;\n " : "";
|
|
42
|
+
});
|
|
43
|
+
export var StyledTableCellNoteText = styled.span(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n ", "\n display: inline-block;\n width: 100%;\n"])), ComponentXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600));
|
|
44
|
+
export var StyledTableFooter = styled.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n"])));
|
|
45
|
+
export var StyledTableFooterContent = styled.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n border-top: 2px solid ", ";\n border-bottom: 1px solid ", ";\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n"])), COLORS.neutral_200, COLORS.neutral_200);
|
|
46
|
+
export var StyledTableFooterCurrentInfo = styled.span(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n padding: 0 16px;\n ", "\n"])), ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black));
|
|
47
|
+
export var StyledTableFooterControls = styled.div(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
48
|
+
export var StyledTableSpinner = styled.div(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(255, 255, 255, 0.75);\n top: 0;\n z-index: ", ";\n"])), function (props) {
|
|
43
49
|
var _props$zindex;
|
|
44
50
|
return (_props$zindex = props.zindex) !== null && _props$zindex !== void 0 ? _props$zindex : Z_INDEXES.loader;
|
|
45
51
|
});
|
|
46
|
-
export var StyledTableFooterCollapseButton = styled.button(
|
|
47
|
-
export var StyledTableBodyWrapper = styled.div(
|
|
52
|
+
export var StyledTableFooterCollapseButton = styled.button(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n position: relative;\n border-bottom: 1px solid ", ";\n border-top: 1px solid ", ";\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ", ";\n\n cursor: pointer;\n\n ", "\n \n &:focus {\n ", "\n }\n\n &:hover {\n z-index: ", ";\n background: ", ";\n color: ", ";\n }\n\n &:active {\n z-index: ", ";\n background: ", ";\n color: ", ";\n }\n\n &:disabled {\n display: none;\n }\n\n"])), COLORS.neutral_200, COLORS.neutral_200, COLORS.white, ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_600), focusStyles, Z_INDEXES.hover, COLORS.primary_20, COLORS.primary_700, Z_INDEXES.active, COLORS.primary_100, COLORS.primary_800);
|
|
53
|
+
export var StyledTableBodyWrapper = styled.div(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n overflow-x: auto;\n ", "\n\n ::-webkit-scrollbar-track {\n margin: 6px;\n }\n\n &.scrollable{\n margin-bottom: 6px;\n padding-bottom: 10px;\n }\n"])), scrollBarStyling(Size.Small));
|
|
48
54
|
//# sourceMappingURL=TableStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableStyles.js","names":["styled","COLORS","focusStyles","scrollBarStyling","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","Z_INDEXES","StyledCheckBox","Size","TableWrapper","div","neutral_200","StyledTable","table","StyledTableHeader","StyledTableHeaderTitle","StyledTableHeaderTitleContent","Bold","black","StyledTableHeaderRow","thead","StyledTableHeaderColumns","tr","StyledTableHeaderColumnContent","StyledTableHeaderColumnSortDirection","span","StyledTableHeaderColumn","th","neutral_600","white","primary_20","primary_700","hover","primary_100","primary_800","active","neutral_20","StyledTableBodyRow","StyledTableNoRowsLabelRow","neutral_50","StyledTableBody","tbody","StyledTableCell","td","StyledTableCellContent","Regular","StyledTableCellIcon","neutral_700","StyledTableCellText","StyledTableFooter","StyledTableFooterContent","StyledTableFooterCurrentInfo","StyledTableFooterControls","StyledTableSpinner","props","zindex","loader","StyledTableFooterCollapseButton","button","StyledTableBodyWrapper","Small"],"sources":["../../src/Table/TableStyles.ts"],"sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS, focusStyles, scrollBarStyling} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport {StyledCheckBox} from '../InputFields/Checkbox';\nimport {Size} from \"../types\";\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n\n &.border{\n border-left: 1px solid ${COLORS.neutral_200};\n border-right: 1px solid ${COLORS.neutral_200};\n }\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n border-collapse: collapse;\n width: 100%;\n\n &.fixed {\n table-layout: fixed;\n }\n\n &.auto {\n table-layout: auto;\n }\n`;\n\nexport const StyledTableHeader = styled.div`\n`;\n\nexport const StyledTableHeaderTitle = styled.div`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderRow = styled.thead`\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumnSortDirection = styled.span`\n width: 24px;\n height: 24px;\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n text-align: unset;\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n ${focusStyles}\n }\n }\n\n &.left {\n & > div {\n justify-content: left;\n }\n }\n\n &.right {\n & > div {\n justify-content: right;\n }\n }\n\n &.center {\n & > div {\n justify-content: center;\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n background-color: ${COLORS.white};\n \n &:not(:last-child) {\n border-bottom: 1px solid ${COLORS.neutral_200};\n }\n\n &.selected{\n background-color: ${COLORS.primary_100};\n }\n \n &:hover {\n background-color: ${COLORS.primary_100};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n ${focusStyles}\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableNoRowsLabelRow = styled.tr`\n position: relative;\n outline: none;\n background-color: ${COLORS.neutral_50};\n`;\n\nexport const StyledTableBody = styled.tbody`\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div`\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n \n ${StyledCheckBox}{\n width: fit-content;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n`;\n\nexport const StyledTableCellText = styled.span`\n padding: 12px 0;\n`;\n\n\nexport const StyledTableFooter = styled.div`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div<{zindex?: string}>`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(255, 255, 255, 0.75);\n top: 0;\n z-index: ${(props) => (props.zindex ?? Z_INDEXES.loader)};\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n \n &:focus {\n ${focusStyles}\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n\n\nexport const StyledTableBodyWrapper = styled.div`\n overflow-x: auto;\n ${scrollBarStyling(Size.Small)}\n\n ::-webkit-scrollbar-track {\n margin: 6px;\n }\n\n &.scrollable{\n margin-bottom: 6px;\n padding-bottom: 10px;\n }\n`;\n"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,mBAAmB;;AAEtC;AACA;AACA;AACA,SAAQC,MAAM,EAAEC,WAAW,EAAEC,gBAAgB,QAAO,WAAW;AAC/D,SACEC,iBAAiB,EACjBC,iBAAiB,EACjBC,iBAAiB,EACjB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AM,CAACoB,KAAK,CAAC,CAC/D;AAED,OAAO,IAAMkC,yBAAyB,GAAGvD,MAAM,CAACa,GAAG,6FAElD;AAED,OAAO,IAAM2C,kBAAkB,GAAGxD,MAAM,CAACa,GAAG,iNAM/B,UAAC4C,KAAK;EAAA;EAAA,wBAAMA,KAAK,CAACC,MAAM,yDAAIjD,SAAS,CAACkD,MAAM;AAAA,CAAC,CACzD;AAED,OAAO,IAAMC,+BAA+B,GAAG5D,MAAM,CAAC6D,MAAM,yoBAE/B5D,MAAM,CAACa,WAAW,EACrBb,MAAM,CAACa,WAAW,EAU5Bb,MAAM,CAAC+B,KAAK,EAIxB3B,iBAAiB,CAACE,kBAAkB,CAACa,IAAI,EAAEnB,MAAM,CAAC8B,WAAW,CAAC,EAG5D7B,WAAW,EAIFO,SAAS,CAAC0B,KAAK,EACZlC,MAAM,CAACgC,UAAU,EACtBhC,MAAM,CAACiC,WAAW,EAIhBzB,SAAS,CAAC6B,MAAM,EACbrC,MAAM,CAACmC,WAAW,EACvBnC,MAAM,CAACoC,WAAW,CAO9B;AAGD,OAAO,IAAMyB,sBAAsB,GAAG9D,MAAM,CAACa,GAAG,6OAE5CV,gBAAgB,CAACQ,IAAI,CAACoD,KAAK,CAAC,CAU/B"}
|
|
1
|
+
{"version":3,"file":"TableStyles.js","names":["styled","COLORS","focusStyles","scrollBarStyling","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","Z_INDEXES","StyledCheckBox","Size","TableWrapper","div","neutral_200","StyledTable","table","StyledTableHeader","StyledTableHeaderTitle","StyledTableHeaderTitleContent","Bold","black","StyledTableHeaderRow","thead","StyledTableHeaderColumns","tr","StyledTableHeaderColumnContent","StyledTableHeaderColumnSortDirection","span","StyledTableHeaderColumn","th","neutral_600","white","primary_20","primary_700","hover","primary_100","primary_800","active","neutral_20","StyledTableBodyRow","StyledTableNoRowsLabelRow","neutral_50","StyledTableBody","tbody","StyledTableCell","td","StyledTableCellContent","props","withNote","Regular","StyledTableCellIcon","neutral_700","StyledTableCellText","StyledTableCellTextWrapper","textWrap","StyledTableCellNoteText","StyledTableFooter","StyledTableFooterContent","StyledTableFooterCurrentInfo","StyledTableFooterControls","StyledTableSpinner","zindex","loader","StyledTableFooterCollapseButton","button","StyledTableBodyWrapper","Small"],"sources":["../../src/Table/TableStyles.ts"],"sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS, focusStyles, scrollBarStyling} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport {StyledCheckBox} from '../InputFields/Checkbox';\nimport {Size} from \"../types\";\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n\n &.border{\n border-left: 1px solid ${COLORS.neutral_200};\n border-right: 1px solid ${COLORS.neutral_200};\n }\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n border-collapse: collapse;\n width: 100%;\n\n &.fixed {\n table-layout: fixed;\n }\n\n &.auto {\n table-layout: auto;\n }\n`;\n\nexport const StyledTableHeader = styled.div`\n`;\n\nexport const StyledTableHeaderTitle = styled.div`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderRow = styled.thead`\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumnSortDirection = styled.span`\n width: 24px;\n height: 24px;\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n text-align: unset;\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n ${focusStyles}\n }\n }\n\n &.left {\n & > div {\n justify-content: left;\n }\n }\n\n &.right {\n & > div {\n justify-content: right;\n }\n }\n\n &.center {\n & > div {\n justify-content: center;\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n background-color: ${COLORS.white};\n \n &:not(:last-child) {\n border-bottom: 1px solid ${COLORS.neutral_200};\n }\n\n &.selected{\n background-color: ${COLORS.primary_100};\n }\n \n &:hover {\n background-color: ${COLORS.primary_100};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n ${focusStyles}\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableNoRowsLabelRow = styled.tr`\n position: relative;\n outline: none;\n background-color: ${COLORS.neutral_50};\n`;\n\nexport const StyledTableBody = styled.tbody`\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div<{withNote?: boolean}>`\n min-height: ${props => props.withNote ? '64px' : '48px'};\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n \n ${StyledCheckBox}{\n width: fit-content;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 20px;\n height: 20px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 20px;\n height: 20px;\n }\n`;\n\nexport const StyledTableCellText = styled.span`\n display: block;\n`;\n\nexport const StyledTableCellTextWrapper = styled.div<{ textWrap?: boolean }>`\n padding: 12px 0px;\n width: 100%;\n ${props => !props.textWrap ? `\n overflow: hidden;\n text-overflow: ellipsis;\n ` : ``}\n`;\n\nexport const StyledTableCellNoteText = styled.span`\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n display: inline-block;\n width: 100%;\n`;\n\n\nexport const StyledTableFooter = styled.div`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div<{zindex?: string}>`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(255, 255, 255, 0.75);\n top: 0;\n z-index: ${(props) => (props.zindex ?? Z_INDEXES.loader)};\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n \n &:focus {\n ${focusStyles}\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n\n\nexport const StyledTableBodyWrapper = styled.div`\n overflow-x: auto;\n ${scrollBarStyling(Size.Small)}\n\n ::-webkit-scrollbar-track {\n margin: 6px;\n }\n\n &.scrollable{\n margin-bottom: 6px;\n padding-bottom: 10px;\n }\n`;\n"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,mBAAmB;;AAEtC;AACA;AACA;AACA,SAAQC,MAAM,EAAEC,WAAW,EAAEC,gBAAgB,QAAO,WAAW;AAC/D,SACEC,iBAAiB,EACjBC,iBAAiB,EACjBC,iBAAiB,EACjBC,kBAAkB,EAClBC,kBAAkB,QACb,sBAAsB;AAC7B,SAAQC,SAAS,QAAO,qBAAqB;AAC7C,SAAQC,cAAc,QAAO,yBAAyB;AACtD,SAAQC,IAAI,QAAO,UAAU;;AAE7B;AACA;AACA;;AAEA,OAAO,IAAMC,YAAY,GAAGZ,MAAM,CAACa,GAAG,wLAITZ,MAAM,CAACa,WAAW,EACjBb,MAAM,CAACa,WAAW,CAE/C;AAGD,OAAO,IAAMC,WAAW,GAAGf,MAAM,CAACgB,KAAK,6OAYtC;AAED,OAAO,IAAMC,iBAAiB,GAAGjB,MAAM,CAACa,GAAG,yEAC1C;AAED,OAAO,IAAMK,sBA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,yBAAyB,GAAG5D,MAAM,CAACa,GAAG,6FAElD;AAED,OAAO,IAAMgD,kBAAkB,GAAG7D,MAAM,CAACa,GAAG,iNAM/B,UAACmC,KAAK;EAAA;EAAA,wBAAMA,KAAK,CAACc,MAAM,yDAAIrD,SAAS,CAACsD,MAAM;AAAA,CAAC,CACzD;AAED,OAAO,IAAMC,+BAA+B,GAAGhE,MAAM,CAACiE,MAAM,yoBAE/BhE,MAAM,CAACa,WAAW,EACrBb,MAAM,CAACa,WAAW,EAU5Bb,MAAM,CAAC+B,KAAK,EAIxB3B,iBAAiB,CAACE,kBAAkB,CAACa,IAAI,EAAEnB,MAAM,CAAC8B,WAAW,CAAC,EAG5D7B,WAAW,EAIFO,SAAS,CAAC0B,KAAK,EACZlC,MAAM,CAACgC,UAAU,EACtBhC,MAAM,CAACiC,WAAW,EAIhBzB,SAAS,CAAC6B,MAAM,EACbrC,MAAM,CAACmC,WAAW,EACvBnC,MAAM,CAACoC,WAAW,CAO9B;AAGD,OAAO,IAAM6B,sBAAsB,GAAGlE,MAAM,CAACa,GAAG,6OAE5CV,gBAAgB,CAACQ,IAAI,CAACwD,KAAK,CAAC,CAU/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableTypes.cjs","names":[],"sources":["../../src/Table/TableTypes.ts"],"sourcesContent":["/**\n * Types for the table.\n */\nimport {DropdownButtonProps} from '../Dropdown/DropdownButtonTypes';\nimport {ButtonProps} from '../Button/Button';\nimport {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\n\nexport interface TableProps {\n title?: string; // Will render header row\n\n columns: TableColumn[];\n rows: any[];\n\n border?: boolean;\n accordion?: boolean; // Will render accordion table\n collapsed?: boolean; // whether table should be collapsed or not\n collapsedRows?: number; // Number of rows to show when table is collapsed\n sortProps?: TableSortProps;\n\n remoteOperations?: boolean; // Indicates that pagination should be done remotely\n pagination?: TablePagination; // Required only in case remotePagination is set to true\n onPreviousPageClick?: () => void; // Will fire on previous page click in case remotePagination is set to true\n onNextPageClick?: () => void; // Will fire on next page click in case remotePagination is set to true\n onRowsPerPageChange?: (count: number) => void; // Will fire when rows per page changes in case remotePagination is set to true\n onTriggerSortingChange?: (key: string, direction?: TableSortingDirection) => void; // Will fire when the sorting direction changes. Used with remote pagination,\n\n showLoadingIndicator?: boolean;\n rowsPerPageLabel? :string; //label that will be shown next to the rows per page selector\n noRowsLabel?: string; //label that will be shown when there are no rows in the grid\n showMoreLabel?: string; //label that will be shown for 'accordion' grid when there are some rows collapsed\n showFewerLabel?: string; //label that will be shown for 'accordion' grid when user can 'collapse' some of the rows\n\n menu?: Pick<DropdownButtonProps, 'items' | 'onClick' | 'disabled' | 'width' | 'itemsType' | 'multiSelect'>;\n\n selectable?: boolean;\n onSelectionChange?: (value: any | any[]) => void;\n multiSelect?: boolean;\n keyExpr?: string;\n selectedRows?: any[];\n loaderZIndex?: string;\n\n layout?: TableLayout;\n}\n\nexport interface TableSortProps {\n column: string;\n direction: TableSortingDirection;\n allowClearingSort?: boolean;\n}\n\nexport interface TableColumn {\n key: string;\n name: string;\n filterValue?: string;\n\n icon?: React.ReactNode;\n\n width?: string | number;\n colorFn?: (row: any, key: string) => string;\n justify?: TableJustification;\n shortenText?: boolean;\n\n action?: (row: any, event: any) => void;\n type?: TableColumnTypes;\n additionalProps?: Pick<ButtonProps, 'variant' | 'size' | 'width' | 'icon'> | Pick<IconButtonProps, 'variant' | 'shape' | 'disabled' | 'tooltip'> | Pick<HyperlinkProps, 'variant'>;\n customContent?: (row: any, key: string) => any;\n
|
|
1
|
+
{"version":3,"file":"TableTypes.cjs","names":[],"sources":["../../src/Table/TableTypes.ts"],"sourcesContent":["/**\n * Types for the table.\n */\nimport {DropdownButtonProps} from '../Dropdown/DropdownButtonTypes';\nimport {ButtonProps} from '../Button/Button';\nimport {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\n\nexport interface TableProps {\n title?: string; // Will render header row\n\n columns: TableColumn[];\n rows: any[];\n\n border?: boolean;\n accordion?: boolean; // Will render accordion table\n collapsed?: boolean; // whether table should be collapsed or not\n collapsedRows?: number; // Number of rows to show when table is collapsed\n sortProps?: TableSortProps;\n\n remoteOperations?: boolean; // Indicates that pagination should be done remotely\n pagination?: TablePagination; // Required only in case remotePagination is set to true\n onPreviousPageClick?: () => void; // Will fire on previous page click in case remotePagination is set to true\n onNextPageClick?: () => void; // Will fire on next page click in case remotePagination is set to true\n onRowsPerPageChange?: (count: number) => void; // Will fire when rows per page changes in case remotePagination is set to true\n onTriggerSortingChange?: (key: string, direction?: TableSortingDirection) => void; // Will fire when the sorting direction changes. Used with remote pagination,\n\n showLoadingIndicator?: boolean;\n rowsPerPageLabel? :string; //label that will be shown next to the rows per page selector\n noRowsLabel?: string; //label that will be shown when there are no rows in the grid\n showMoreLabel?: string; //label that will be shown for 'accordion' grid when there are some rows collapsed\n showFewerLabel?: string; //label that will be shown for 'accordion' grid when user can 'collapse' some of the rows\n\n menu?: Pick<DropdownButtonProps, 'items' | 'onClick' | 'disabled' | 'width' | 'itemsType' | 'multiSelect'>;\n\n selectable?: boolean;\n onSelectionChange?: (value: any | any[]) => void;\n multiSelect?: boolean;\n keyExpr?: string;\n selectedRows?: any[];\n loaderZIndex?: string;\n\n layout?: TableLayout;\n}\n\nexport interface TableSortProps {\n column: string;\n direction: TableSortingDirection;\n allowClearingSort?: boolean;\n}\n\nexport interface TableColumn {\n key: string;\n noteKey?: string;\n name: string;\n filterValue?: string;\n\n icon?: React.ReactNode;\n\n width?: string | number;\n colorFn?: (row: any, key: string) => string;\n justify?: TableJustification;\n shortenText?: boolean;\n\n action?: (row: any, event: any) => void;\n type?: TableColumnTypes;\n additionalProps?: Pick<ButtonProps, 'variant' | 'size' | 'width' | 'icon'> | Pick<IconButtonProps, 'variant' | 'shape' | 'disabled' | 'tooltip'> | Pick<HyperlinkProps, 'variant'>;\n customContent?: (row: any, key: string) => any;\n sortable?: boolean;\n}\n\nexport type TableColumnTypes = 'text' | 'boolean' | 'number' | 'custom' | 'button' | 'icon' | 'link';\n\nexport type TableJustification = 'right' | 'left' | 'center';\n\nexport type TableSortingDirection = 'asc' | 'desc';\n\nexport type TableLayout = 'auto' | 'fixed';\n\nexport interface TablePagination {\n from: number;\n to: number;\n total: number;\n currentPage: number;\n rowsPerPage: number;\n}\n\n// will override component properties in case of button, icon and link\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableTypes.js","names":[],"sources":["../../src/Table/TableTypes.ts"],"sourcesContent":["/**\n * Types for the table.\n */\nimport {DropdownButtonProps} from '../Dropdown/DropdownButtonTypes';\nimport {ButtonProps} from '../Button/Button';\nimport {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\n\nexport interface TableProps {\n title?: string; // Will render header row\n\n columns: TableColumn[];\n rows: any[];\n\n border?: boolean;\n accordion?: boolean; // Will render accordion table\n collapsed?: boolean; // whether table should be collapsed or not\n collapsedRows?: number; // Number of rows to show when table is collapsed\n sortProps?: TableSortProps;\n\n remoteOperations?: boolean; // Indicates that pagination should be done remotely\n pagination?: TablePagination; // Required only in case remotePagination is set to true\n onPreviousPageClick?: () => void; // Will fire on previous page click in case remotePagination is set to true\n onNextPageClick?: () => void; // Will fire on next page click in case remotePagination is set to true\n onRowsPerPageChange?: (count: number) => void; // Will fire when rows per page changes in case remotePagination is set to true\n onTriggerSortingChange?: (key: string, direction?: TableSortingDirection) => void; // Will fire when the sorting direction changes. Used with remote pagination,\n\n showLoadingIndicator?: boolean;\n rowsPerPageLabel? :string; //label that will be shown next to the rows per page selector\n noRowsLabel?: string; //label that will be shown when there are no rows in the grid\n showMoreLabel?: string; //label that will be shown for 'accordion' grid when there are some rows collapsed\n showFewerLabel?: string; //label that will be shown for 'accordion' grid when user can 'collapse' some of the rows\n\n menu?: Pick<DropdownButtonProps, 'items' | 'onClick' | 'disabled' | 'width' | 'itemsType' | 'multiSelect'>;\n\n selectable?: boolean;\n onSelectionChange?: (value: any | any[]) => void;\n multiSelect?: boolean;\n keyExpr?: string;\n selectedRows?: any[];\n loaderZIndex?: string;\n\n layout?: TableLayout;\n}\n\nexport interface TableSortProps {\n column: string;\n direction: TableSortingDirection;\n allowClearingSort?: boolean;\n}\n\nexport interface TableColumn {\n key: string;\n name: string;\n filterValue?: string;\n\n icon?: React.ReactNode;\n\n width?: string | number;\n colorFn?: (row: any, key: string) => string;\n justify?: TableJustification;\n shortenText?: boolean;\n\n action?: (row: any, event: any) => void;\n type?: TableColumnTypes;\n additionalProps?: Pick<ButtonProps, 'variant' | 'size' | 'width' | 'icon'> | Pick<IconButtonProps, 'variant' | 'shape' | 'disabled' | 'tooltip'> | Pick<HyperlinkProps, 'variant'>;\n customContent?: (row: any, key: string) => any;\n
|
|
1
|
+
{"version":3,"file":"TableTypes.js","names":[],"sources":["../../src/Table/TableTypes.ts"],"sourcesContent":["/**\n * Types for the table.\n */\nimport {DropdownButtonProps} from '../Dropdown/DropdownButtonTypes';\nimport {ButtonProps} from '../Button/Button';\nimport {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\n\nexport interface TableProps {\n title?: string; // Will render header row\n\n columns: TableColumn[];\n rows: any[];\n\n border?: boolean;\n accordion?: boolean; // Will render accordion table\n collapsed?: boolean; // whether table should be collapsed or not\n collapsedRows?: number; // Number of rows to show when table is collapsed\n sortProps?: TableSortProps;\n\n remoteOperations?: boolean; // Indicates that pagination should be done remotely\n pagination?: TablePagination; // Required only in case remotePagination is set to true\n onPreviousPageClick?: () => void; // Will fire on previous page click in case remotePagination is set to true\n onNextPageClick?: () => void; // Will fire on next page click in case remotePagination is set to true\n onRowsPerPageChange?: (count: number) => void; // Will fire when rows per page changes in case remotePagination is set to true\n onTriggerSortingChange?: (key: string, direction?: TableSortingDirection) => void; // Will fire when the sorting direction changes. Used with remote pagination,\n\n showLoadingIndicator?: boolean;\n rowsPerPageLabel? :string; //label that will be shown next to the rows per page selector\n noRowsLabel?: string; //label that will be shown when there are no rows in the grid\n showMoreLabel?: string; //label that will be shown for 'accordion' grid when there are some rows collapsed\n showFewerLabel?: string; //label that will be shown for 'accordion' grid when user can 'collapse' some of the rows\n\n menu?: Pick<DropdownButtonProps, 'items' | 'onClick' | 'disabled' | 'width' | 'itemsType' | 'multiSelect'>;\n\n selectable?: boolean;\n onSelectionChange?: (value: any | any[]) => void;\n multiSelect?: boolean;\n keyExpr?: string;\n selectedRows?: any[];\n loaderZIndex?: string;\n\n layout?: TableLayout;\n}\n\nexport interface TableSortProps {\n column: string;\n direction: TableSortingDirection;\n allowClearingSort?: boolean;\n}\n\nexport interface TableColumn {\n key: string;\n noteKey?: string;\n name: string;\n filterValue?: string;\n\n icon?: React.ReactNode;\n\n width?: string | number;\n colorFn?: (row: any, key: string) => string;\n justify?: TableJustification;\n shortenText?: boolean;\n\n action?: (row: any, event: any) => void;\n type?: TableColumnTypes;\n additionalProps?: Pick<ButtonProps, 'variant' | 'size' | 'width' | 'icon'> | Pick<IconButtonProps, 'variant' | 'shape' | 'disabled' | 'tooltip'> | Pick<HyperlinkProps, 'variant'>;\n customContent?: (row: any, key: string) => any;\n sortable?: boolean;\n}\n\nexport type TableColumnTypes = 'text' | 'boolean' | 'number' | 'custom' | 'button' | 'icon' | 'link';\n\nexport type TableJustification = 'right' | 'left' | 'center';\n\nexport type TableSortingDirection = 'asc' | 'desc';\n\nexport type TableLayout = 'auto' | 'fixed';\n\nexport interface TablePagination {\n from: number;\n to: number;\n total: number;\n currentPage: number;\n rowsPerPage: number;\n}\n\n// will override component properties in case of button, icon and link\n"],"mappings":""}
|
package/dist/Table/index.cjs
CHANGED
|
@@ -4,11 +4,38 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
var _exportNames = {
|
|
8
|
+
Table: true
|
|
9
|
+
};
|
|
7
10
|
Object.defineProperty(exports, "Table", {
|
|
8
11
|
enumerable: true,
|
|
9
12
|
get: function get() {
|
|
10
13
|
return _Table.default;
|
|
11
14
|
}
|
|
12
15
|
});
|
|
16
|
+
var _TableTypes = require("./TableTypes");
|
|
17
|
+
Object.keys(_TableTypes).forEach(function (key) {
|
|
18
|
+
if (key === "default" || key === "__esModule") return;
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
20
|
+
if (key in exports && exports[key] === _TableTypes[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _TableTypes[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _TableStyles = require("./TableStyles");
|
|
29
|
+
Object.keys(_TableStyles).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
32
|
+
if (key in exports && exports[key] === _TableStyles[key]) return;
|
|
33
|
+
Object.defineProperty(exports, key, {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function get() {
|
|
36
|
+
return _TableStyles[key];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
13
40
|
var _Table = _interopRequireDefault(require("./Table"));
|
|
14
41
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Table/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/Table/index.ts"],"sourcesContent":["export
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/Table/index.ts"],"sourcesContent":["export * from './TableTypes'\nexport * from './TableStyles';\nexport {default as Table} from './Table';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA"}
|
package/dist/Table/index.d.ts
CHANGED
package/dist/Table/index.js
CHANGED
package/dist/Table/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","Table"],"sources":["../../src/Table/index.ts"],"sourcesContent":["export
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","Table"],"sources":["../../src/Table/index.ts"],"sourcesContent":["export * from './TableTypes'\nexport * from './TableStyles';\nexport {default as Table} from './Table';\n"],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,eAAe;AAC7B,SAAQA,OAAO,IAAIC,KAAK,QAAO,SAAS"}
|
package/dist/styles/colors.cjs
CHANGED
|
@@ -25,6 +25,7 @@ var COLORS = {
|
|
|
25
25
|
// Semantic / Critical - Core 500
|
|
26
26
|
|
|
27
27
|
primary_20: '#F1FBFE',
|
|
28
|
+
primary_50: '#E3F5FC',
|
|
28
29
|
primary_100: '#D4E9F2',
|
|
29
30
|
primary_200: '#A9D3E5',
|
|
30
31
|
primary_300: '#7FBCD7',
|
|
@@ -35,6 +36,7 @@ var COLORS = {
|
|
|
35
36
|
primary_700: '#215369',
|
|
36
37
|
primary_800: '#163746',
|
|
37
38
|
accent1_20: '#EDFCFB',
|
|
39
|
+
accent1_50: '#E4F6F6',
|
|
38
40
|
accent1_100: '#C8EEEC',
|
|
39
41
|
accent1_200: '#98D8D5',
|
|
40
42
|
accent1_300: '#6BC2BE',
|
|
@@ -45,6 +47,7 @@ var COLORS = {
|
|
|
45
47
|
accent1_700: '#145653',
|
|
46
48
|
accent1_800: '#0F3937',
|
|
47
49
|
accent2_20: '#FFFAEE',
|
|
50
|
+
accent2_50: '#FDF0DE',
|
|
48
51
|
accent2_100: '#F8E2BF',
|
|
49
52
|
accent2_200: '#EAC785',
|
|
50
53
|
// 200 Core
|
|
@@ -55,6 +58,7 @@ var COLORS = {
|
|
|
55
58
|
accent2_700: '#604920',
|
|
56
59
|
accent2_800: '#42300F',
|
|
57
60
|
correct_20: '#ECFEF1',
|
|
61
|
+
correct_50: '#E2F8E4',
|
|
58
62
|
correct_100: '#CCEED2',
|
|
59
63
|
correct_200: '#A0D9AD',
|
|
60
64
|
correct_300: '#77C589',
|
|
@@ -65,6 +69,7 @@ var COLORS = {
|
|
|
65
69
|
correct_700: '#025A15',
|
|
66
70
|
correct_800: '#003D0E',
|
|
67
71
|
warning_20: '#FEF7F1',
|
|
72
|
+
warning_50: '#FDF0E7',
|
|
68
73
|
warning_100: '#FCDDC5',
|
|
69
74
|
warning_200: '#F8C096',
|
|
70
75
|
warning_300: '#F4A162',
|
|
@@ -75,6 +80,7 @@ var COLORS = {
|
|
|
75
80
|
warning_700: '#803700',
|
|
76
81
|
warning_800: '#572600',
|
|
77
82
|
critical_20: '#FEF5F7',
|
|
83
|
+
critical_50: '#FEECF1',
|
|
78
84
|
critical_100: '#FDDEE2',
|
|
79
85
|
critical_200: '#FDBAC2',
|
|
80
86
|
critical_300: '#FD96A4',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.cjs","names":["COLORS","black","white","grey","primary","accent1","accent2","correct","warning","critical","primary_20","primary_100","primary_200","primary_300","primary_400","primary_500","primary_600","primary_700","primary_800","accent1_20","accent1_100","accent1_200","accent1_300","accent1_400","accent1_500","accent1_600","accent1_700","accent1_800","accent2_20","accent2_100","accent2_200","accent2_300","accent2_400","accent2_500","accent2_600","accent2_700","accent2_800","correct_20","correct_100","correct_200","correct_300","correct_400","correct_500","correct_600","correct_700","correct_800","warning_20","warning_100","warning_200","warning_300","warning_400","warning_500","warning_600","warning_700","warning_800","critical_20","critical_100","critical_200","critical_300","critical_400","critical_500","critical_600","critical_700","critical_800","neutral_20","neutral_50","neutral_100","neutral_200","neutral_300","neutral_400","neutral_500","neutral_600","neutral_700","neutral_800","focus","focus_25","white_gradient","toast_info","toast_success","toast_warning","toast_error"],"sources":["../../src/styles/colors.ts"],"sourcesContent":["const COLORS = {\n black: '#1F1F1F', // Neutrals / Black\n white: '#FFFFFF', // Neutrals / White\n grey:
|
|
1
|
+
{"version":3,"file":"colors.cjs","names":["COLORS","black","white","grey","primary","accent1","accent2","correct","warning","critical","primary_20","primary_50","primary_100","primary_200","primary_300","primary_400","primary_500","primary_600","primary_700","primary_800","accent1_20","accent1_50","accent1_100","accent1_200","accent1_300","accent1_400","accent1_500","accent1_600","accent1_700","accent1_800","accent2_20","accent2_50","accent2_100","accent2_200","accent2_300","accent2_400","accent2_500","accent2_600","accent2_700","accent2_800","correct_20","correct_50","correct_100","correct_200","correct_300","correct_400","correct_500","correct_600","correct_700","correct_800","warning_20","warning_50","warning_100","warning_200","warning_300","warning_400","warning_500","warning_600","warning_700","warning_800","critical_20","critical_50","critical_100","critical_200","critical_300","critical_400","critical_500","critical_600","critical_700","critical_800","neutral_20","neutral_50","neutral_100","neutral_200","neutral_300","neutral_400","neutral_500","neutral_600","neutral_700","neutral_800","focus","focus_25","white_gradient","toast_info","toast_success","toast_warning","toast_error"],"sources":["../../src/styles/colors.ts"],"sourcesContent":["const COLORS = {\n black: '#1F1F1F', // Neutrals / Black\n white: '#FFFFFF', // Neutrals / White\n grey: '#949494', // Neutrals / grey\n primary: '#2E7FA1', // Brand / Primary - Core 500\n accent1: '#25837E', // Brand / Accent 1 - Core 500\n accent2: '#EAC785', // Brand / Accent 2 - Core 200\n correct: '#37A851', // Semantic / Correct - Core 400\n warning: '#E97116', // Semantic / Warning - Core 400\n critical: '#DC3449', // Semantic / Critical - Core 500\n\n primary_20: '#F1FBFE',\n primary_50: '#E3F5FC',\n primary_100: '#D4E9F2',\n primary_200: '#A9D3E5',\n primary_300: '#7FBCD7',\n primary_400: '#519DBD',\n primary_500: '#2E7FA1', // 500 Core\n primary_600: '#276D8B',\n primary_700: '#215369',\n primary_800: '#163746',\n\n accent1_20: '#EDFCFB',\n accent1_50: '#E4F6F6',\n accent1_100: '#C8EEEC',\n accent1_200: '#98D8D5',\n accent1_300: '#6BC2BE',\n accent1_400: '#3EA39E',\n accent1_500: '#25837E', // 500 Core\n accent1_600: '#23716D',\n accent1_700: '#145653',\n accent1_800: '#0F3937',\n\n accent2_20: '#FFFAEE',\n accent2_50: '#FDF0DE',\n accent2_100: '#F8E2BF',\n accent2_200: '#EAC785', // 200 Core\n accent2_300: '#D6AD61',\n accent2_400: '#B58E45',\n accent2_500: '#92702F',\n accent2_600: '#806128',\n accent2_700: '#604920',\n accent2_800: '#42300F',\n\n correct_20: '#ECFEF1',\n correct_50: '#E2F8E4',\n correct_100: '#CCEED2',\n correct_200: '#A0D9AD',\n correct_300: '#77C589',\n correct_400: '#37A851', // 400 Core\n correct_500: '#14892F',\n correct_600: '#13772A',\n correct_700: '#025A15',\n correct_800: '#003D0E',\n\n warning_20: '#FEF7F1',\n warning_50: '#FDF0E7',\n warning_100: '#FCDDC5',\n warning_200: '#F8C096',\n warning_300: '#F4A162',\n warning_400: '#E97116', // 400 Core\n warning_500: '#C45402',\n warning_600: '#AD4B00',\n warning_700: '#803700',\n warning_800: '#572600',\n\n critical_20: '#FEF5F7',\n critical_50: '#FEECF1',\n critical_100: '#FDDEE2',\n critical_200: '#FDBAC2',\n critical_300: '#FD96A4',\n critical_400: '#FC5A6F',\n critical_500: '#DC3449', // 500 Core\n critical_600: '#C32238',\n critical_700: '#9C0D1D',\n critical_800: '#6B0613',\n\n neutral_20: '#FAFAFA', // 020 Core\n neutral_50: '#F2F2F2',\n neutral_100: '#E5E5E5',\n neutral_200: '#CCCCCC',\n neutral_300: '#B3B3B3',\n neutral_400: '#949494',\n neutral_500: '#767676',\n neutral_600: '#666666',\n neutral_700: '#4D4D4D',\n neutral_800: '#333333',\n\n focus: 'rgba(46, 127, 161, 1)', // Semantic / Focus 100%\n focus_25: 'rgba(46, 127, 161, 0.25)', // Semantic / Focus 25%\n\n white_gradient: 'linear-gradient(255deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 100%)',\n\n toast_info: '#2E7FA1',\n toast_success: '#37A851',\n toast_warning: '#E97116',\n toast_error: '#DC3449',\n};\n\nexport default COLORS;\n"],"mappings":";;;;;;AAAA,IAAMA,MAAM,GAAG;EACbC,KAAK,EAAE,SAAS;EAAE;EAClBC,KAAK,EAAE,SAAS;EAAE;EAClBC,IAAI,EAAE,SAAS;EAAE;EACjBC,OAAO,EAAE,SAAS;EAAE;EACpBC,OAAO,EAAE,SAAS;EAAE;EACpBC,OAAO,EAAE,SAAS;EAAE;EACpBC,OAAO,EAAE,SAAS;EAAE;EACpBC,OAAO,EAAE,SAAS;EAAE;EACpBC,QAAQ,EAAE,SAAS;EAAE;;EAErBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EAAE;EACxBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EAEtBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EAAE;EACxBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EAEtBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EAAE;EACxBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,S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W,EAAE;AACf,CAAC;AAAC,eAEatF,MAAM;AAAA"}
|
package/dist/styles/colors.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ declare const COLORS: {
|
|
|
9
9
|
warning: string;
|
|
10
10
|
critical: string;
|
|
11
11
|
primary_20: string;
|
|
12
|
+
primary_50: string;
|
|
12
13
|
primary_100: string;
|
|
13
14
|
primary_200: string;
|
|
14
15
|
primary_300: string;
|
|
@@ -18,6 +19,7 @@ declare const COLORS: {
|
|
|
18
19
|
primary_700: string;
|
|
19
20
|
primary_800: string;
|
|
20
21
|
accent1_20: string;
|
|
22
|
+
accent1_50: string;
|
|
21
23
|
accent1_100: string;
|
|
22
24
|
accent1_200: string;
|
|
23
25
|
accent1_300: string;
|
|
@@ -27,6 +29,7 @@ declare const COLORS: {
|
|
|
27
29
|
accent1_700: string;
|
|
28
30
|
accent1_800: string;
|
|
29
31
|
accent2_20: string;
|
|
32
|
+
accent2_50: string;
|
|
30
33
|
accent2_100: string;
|
|
31
34
|
accent2_200: string;
|
|
32
35
|
accent2_300: string;
|
|
@@ -36,6 +39,7 @@ declare const COLORS: {
|
|
|
36
39
|
accent2_700: string;
|
|
37
40
|
accent2_800: string;
|
|
38
41
|
correct_20: string;
|
|
42
|
+
correct_50: string;
|
|
39
43
|
correct_100: string;
|
|
40
44
|
correct_200: string;
|
|
41
45
|
correct_300: string;
|
|
@@ -45,6 +49,7 @@ declare const COLORS: {
|
|
|
45
49
|
correct_700: string;
|
|
46
50
|
correct_800: string;
|
|
47
51
|
warning_20: string;
|
|
52
|
+
warning_50: string;
|
|
48
53
|
warning_100: string;
|
|
49
54
|
warning_200: string;
|
|
50
55
|
warning_300: string;
|
|
@@ -54,6 +59,7 @@ declare const COLORS: {
|
|
|
54
59
|
warning_700: string;
|
|
55
60
|
warning_800: string;
|
|
56
61
|
critical_20: string;
|
|
62
|
+
critical_50: string;
|
|
57
63
|
critical_100: string;
|
|
58
64
|
critical_200: string;
|
|
59
65
|
critical_300: string;
|
package/dist/styles/colors.js
CHANGED
|
@@ -19,6 +19,7 @@ var COLORS = {
|
|
|
19
19
|
// Semantic / Critical - Core 500
|
|
20
20
|
|
|
21
21
|
primary_20: '#F1FBFE',
|
|
22
|
+
primary_50: '#E3F5FC',
|
|
22
23
|
primary_100: '#D4E9F2',
|
|
23
24
|
primary_200: '#A9D3E5',
|
|
24
25
|
primary_300: '#7FBCD7',
|
|
@@ -29,6 +30,7 @@ var COLORS = {
|
|
|
29
30
|
primary_700: '#215369',
|
|
30
31
|
primary_800: '#163746',
|
|
31
32
|
accent1_20: '#EDFCFB',
|
|
33
|
+
accent1_50: '#E4F6F6',
|
|
32
34
|
accent1_100: '#C8EEEC',
|
|
33
35
|
accent1_200: '#98D8D5',
|
|
34
36
|
accent1_300: '#6BC2BE',
|
|
@@ -39,6 +41,7 @@ var COLORS = {
|
|
|
39
41
|
accent1_700: '#145653',
|
|
40
42
|
accent1_800: '#0F3937',
|
|
41
43
|
accent2_20: '#FFFAEE',
|
|
44
|
+
accent2_50: '#FDF0DE',
|
|
42
45
|
accent2_100: '#F8E2BF',
|
|
43
46
|
accent2_200: '#EAC785',
|
|
44
47
|
// 200 Core
|
|
@@ -49,6 +52,7 @@ var COLORS = {
|
|
|
49
52
|
accent2_700: '#604920',
|
|
50
53
|
accent2_800: '#42300F',
|
|
51
54
|
correct_20: '#ECFEF1',
|
|
55
|
+
correct_50: '#E2F8E4',
|
|
52
56
|
correct_100: '#CCEED2',
|
|
53
57
|
correct_200: '#A0D9AD',
|
|
54
58
|
correct_300: '#77C589',
|
|
@@ -59,6 +63,7 @@ var COLORS = {
|
|
|
59
63
|
correct_700: '#025A15',
|
|
60
64
|
correct_800: '#003D0E',
|
|
61
65
|
warning_20: '#FEF7F1',
|
|
66
|
+
warning_50: '#FDF0E7',
|
|
62
67
|
warning_100: '#FCDDC5',
|
|
63
68
|
warning_200: '#F8C096',
|
|
64
69
|
warning_300: '#F4A162',
|
|
@@ -69,6 +74,7 @@ var COLORS = {
|
|
|
69
74
|
warning_700: '#803700',
|
|
70
75
|
warning_800: '#572600',
|
|
71
76
|
critical_20: '#FEF5F7',
|
|
77
|
+
critical_50: '#FEECF1',
|
|
72
78
|
critical_100: '#FDDEE2',
|
|
73
79
|
critical_200: '#FDBAC2',
|
|
74
80
|
critical_300: '#FD96A4',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","names":["COLORS","black","white","grey","primary","accent1","accent2","correct","warning","critical","primary_20","primary_100","primary_200","primary_300","primary_400","primary_500","primary_600","primary_700","primary_800","accent1_20","accent1_100","accent1_200","accent1_300","accent1_400","accent1_500","accent1_600","accent1_700","accent1_800","accent2_20","accent2_100","accent2_200","accent2_300","accent2_400","accent2_500","accent2_600","accent2_700","accent2_800","correct_20","correct_100","correct_200","correct_300","correct_400","correct_500","correct_600","correct_700","correct_800","warning_20","warning_100","warning_200","warning_300","warning_400","warning_500","warning_600","warning_700","warning_800","critical_20","critical_100","critical_200","critical_300","critical_400","critical_500","critical_600","critical_700","critical_800","neutral_20","neutral_50","neutral_100","neutral_200","neutral_300","neutral_400","neutral_500","neutral_600","neutral_700","neutral_800","focus","focus_25","white_gradient","toast_info","toast_success","toast_warning","toast_error"],"sources":["../../src/styles/colors.ts"],"sourcesContent":["const COLORS = {\n black: '#1F1F1F', // Neutrals / Black\n white: '#FFFFFF', // Neutrals / White\n grey:
|
|
1
|
+
{"version":3,"file":"colors.js","names":["COLORS","black","white","grey","primary","accent1","accent2","correct","warning","critical","primary_20","primary_50","primary_100","primary_200","primary_300","primary_400","primary_500","primary_600","primary_700","primary_800","accent1_20","accent1_50","accent1_100","accent1_200","accent1_300","accent1_400","accent1_500","accent1_600","accent1_700","accent1_800","accent2_20","accent2_50","accent2_100","accent2_200","accent2_300","accent2_400","accent2_500","accent2_600","accent2_700","accent2_800","correct_20","correct_50","correct_100","correct_200","correct_300","correct_400","correct_500","correct_600","correct_700","correct_800","warning_20","warning_50","warning_100","warning_200","warning_300","warning_400","warning_500","warning_600","warning_700","warning_800","critical_20","critical_50","critical_100","critical_200","critical_300","critical_400","critical_500","critical_600","critical_700","critical_800","neutral_20","neutral_50","neutral_100","neutral_200","neutral_300","neutral_400","neutral_500","neutral_600","neutral_700","neutral_800","focus","focus_25","white_gradient","toast_info","toast_success","toast_warning","toast_error"],"sources":["../../src/styles/colors.ts"],"sourcesContent":["const COLORS = {\n black: '#1F1F1F', // Neutrals / Black\n white: '#FFFFFF', // Neutrals / White\n grey: '#949494', // Neutrals / grey\n primary: '#2E7FA1', // Brand / Primary - Core 500\n accent1: '#25837E', // Brand / Accent 1 - Core 500\n accent2: '#EAC785', // Brand / Accent 2 - Core 200\n correct: '#37A851', // Semantic / Correct - Core 400\n warning: '#E97116', // Semantic / Warning - Core 400\n critical: '#DC3449', // Semantic / Critical - Core 500\n\n primary_20: '#F1FBFE',\n primary_50: '#E3F5FC',\n primary_100: '#D4E9F2',\n primary_200: '#A9D3E5',\n primary_300: '#7FBCD7',\n primary_400: '#519DBD',\n primary_500: '#2E7FA1', // 500 Core\n primary_600: '#276D8B',\n primary_700: '#215369',\n primary_800: '#163746',\n\n accent1_20: '#EDFCFB',\n accent1_50: '#E4F6F6',\n accent1_100: '#C8EEEC',\n accent1_200: '#98D8D5',\n accent1_300: '#6BC2BE',\n accent1_400: '#3EA39E',\n accent1_500: '#25837E', // 500 Core\n accent1_600: '#23716D',\n accent1_700: '#145653',\n accent1_800: '#0F3937',\n\n accent2_20: '#FFFAEE',\n accent2_50: '#FDF0DE',\n accent2_100: '#F8E2BF',\n accent2_200: '#EAC785', // 200 Core\n accent2_300: '#D6AD61',\n accent2_400: '#B58E45',\n accent2_500: '#92702F',\n accent2_600: '#806128',\n accent2_700: '#604920',\n accent2_800: '#42300F',\n\n correct_20: '#ECFEF1',\n correct_50: '#E2F8E4',\n correct_100: '#CCEED2',\n correct_200: '#A0D9AD',\n correct_300: '#77C589',\n correct_400: '#37A851', // 400 Core\n correct_500: '#14892F',\n correct_600: '#13772A',\n correct_700: '#025A15',\n correct_800: '#003D0E',\n\n warning_20: '#FEF7F1',\n warning_50: '#FDF0E7',\n warning_100: '#FCDDC5',\n warning_200: '#F8C096',\n warning_300: '#F4A162',\n warning_400: '#E97116', // 400 Core\n warning_500: '#C45402',\n warning_600: '#AD4B00',\n warning_700: '#803700',\n warning_800: '#572600',\n\n critical_20: '#FEF5F7',\n critical_50: '#FEECF1',\n critical_100: '#FDDEE2',\n critical_200: '#FDBAC2',\n critical_300: '#FD96A4',\n critical_400: '#FC5A6F',\n critical_500: '#DC3449', // 500 Core\n critical_600: '#C32238',\n critical_700: '#9C0D1D',\n critical_800: '#6B0613',\n\n neutral_20: '#FAFAFA', // 020 Core\n neutral_50: '#F2F2F2',\n neutral_100: '#E5E5E5',\n neutral_200: '#CCCCCC',\n neutral_300: '#B3B3B3',\n neutral_400: '#949494',\n neutral_500: '#767676',\n neutral_600: '#666666',\n neutral_700: '#4D4D4D',\n neutral_800: '#333333',\n\n focus: 'rgba(46, 127, 161, 1)', // Semantic / Focus 100%\n focus_25: 'rgba(46, 127, 161, 0.25)', // Semantic / Focus 25%\n\n white_gradient: 'linear-gradient(255deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 100%)',\n\n toast_info: '#2E7FA1',\n toast_success: '#37A851',\n toast_warning: '#E97116',\n toast_error: '#DC3449',\n};\n\nexport default COLORS;\n"],"mappings":"AAAA,IAAMA,MAAM,GAAG;EACbC,KAAK,EAAE,SAAS;EAAE;EAClBC,KAAK,EAAE,SAAS;EAAE;EAClBC,IAAI,EAAE,SAAS;EAAE;EACjBC,OAAO,EAAE,SAAS;EAAE;EACpBC,OAAO,EAAE,SAAS;EAAE;EACpBC,OAAO,EAAE,SAAS;EAAE;EACpBC,OAAO,EAAE,SAAS;EAAE;EACpBC,OAAO,EAAE,SAAS;EAAE;EACpBC,QAAQ,EAAE,SAAS;EAAE;;EAErBC,UAAU,EAAE,SAAS;EACrBC,UAAU,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