@laerdal/life-react-components 3.2.1-dev.3 → 3.2.1-dev.5
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 +114 -0
- package/dist/InputFields/RichTextField.cjs.map +1 -0
- package/dist/InputFields/RichTextField.d.ts +51 -0
- package/dist/InputFields/RichTextField.js +106 -0
- package/dist/InputFields/RichTextField.js.map +1 -0
- package/dist/InputFields/index.cjs +12 -0
- package/dist/InputFields/index.cjs.map +1 -1
- package/dist/InputFields/index.d.ts +1 -0
- package/dist/InputFields/index.js +1 -0
- package/dist/InputFields/index.js.map +1 -1
- package/dist/Table/TableBody.cjs +6 -18
- package/dist/Table/TableBody.cjs.map +1 -1
- package/dist/Table/TableBody.js +9 -21
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableStyles.cjs +12 -20
- package/dist/Table/TableStyles.cjs.map +1 -1
- package/dist/Table/TableStyles.d.ts +1 -7
- package/dist/Table/TableStyles.js +11 -17
- package/dist/Table/TableStyles.js.map +1 -1
- package/dist/Table/TableTypes.cjs.map +1 -1
- package/dist/Table/TableTypes.d.ts +0 -1
- package/dist/Table/TableTypes.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.RichTextFieldFormats = exports.RichTextField = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
var _reactQuill = _interopRequireDefault(require("react-quill"));
|
|
14
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
var _styling = require("./styling");
|
|
16
|
+
var _types = require("../types");
|
|
17
|
+
var _styles = require("../styles");
|
|
18
|
+
var _systemicons = require("../icons/systemicons");
|
|
19
|
+
require("react-quill/dist/quill.snow.css");
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
var _excluded = ["readOnly", "disabled", "validationMessage", "note", "size", "state", "resizable", "modules"];
|
|
22
|
+
var _templateObject;
|
|
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
|
+
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 Wrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n height: 100%;\n display: flex;\n flex-direction: column;\n\n .quill {\n display: flex;\n flex-direction: column;\n width: 100%;\n flex: 1;\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.ql-blank::before {\n ", "\n }\n\n .ql-toolbar {\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\n .ql-container {\n flex: 1;\n border: none;\n overflow-y: hidden;\n padding: 8px;\n }\n\n .ql-editor {\n padding: 8px;\n overflow-y: auto;\n flex: 1;\n\n ", "\n }\n\n &.resizable {\n height: initial;\n\n .quill {\n flex: none;\n overflow: initial;\n }\n\n .ql-container {\n padding: 0;\n flex: none;\n }\n\n .ql-editor {\n padding: 16px;\n resize: vertical;\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\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.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
|
+
var RichTextFieldFormats;
|
|
27
|
+
exports.RichTextFieldFormats = RichTextFieldFormats;
|
|
28
|
+
(function (RichTextFieldFormats) {
|
|
29
|
+
RichTextFieldFormats["Background"] = "background";
|
|
30
|
+
RichTextFieldFormats["Bold"] = "bold";
|
|
31
|
+
RichTextFieldFormats["Color"] = "color";
|
|
32
|
+
RichTextFieldFormats["Font"] = "font";
|
|
33
|
+
RichTextFieldFormats["Code"] = "code";
|
|
34
|
+
RichTextFieldFormats["Italic"] = "italic";
|
|
35
|
+
RichTextFieldFormats["Link"] = "link";
|
|
36
|
+
RichTextFieldFormats["Size"] = "size";
|
|
37
|
+
RichTextFieldFormats["Strike"] = "strike";
|
|
38
|
+
RichTextFieldFormats["Script"] = "script";
|
|
39
|
+
RichTextFieldFormats["Underline"] = "underline";
|
|
40
|
+
RichTextFieldFormats["Blockquote"] = "blockquote";
|
|
41
|
+
RichTextFieldFormats["Header"] = "header";
|
|
42
|
+
RichTextFieldFormats["Indent"] = "indent";
|
|
43
|
+
RichTextFieldFormats["List"] = "list";
|
|
44
|
+
RichTextFieldFormats["Align"] = "align";
|
|
45
|
+
RichTextFieldFormats["Direction"] = "direction";
|
|
46
|
+
RichTextFieldFormats["CodeBlock"] = "code-block";
|
|
47
|
+
RichTextFieldFormats["Formula"] = "formula";
|
|
48
|
+
RichTextFieldFormats["Image"] = "image";
|
|
49
|
+
RichTextFieldFormats["Video"] = "video";
|
|
50
|
+
})(RichTextFieldFormats || (exports.RichTextFieldFormats = RichTextFieldFormats = {}));
|
|
51
|
+
var defaultToolBarOptions = [[{
|
|
52
|
+
header: [1, 2, 3, false]
|
|
53
|
+
}], ['bold', 'italic', 'underline', 'strike'], [{
|
|
54
|
+
'list': 'ordered'
|
|
55
|
+
}, {
|
|
56
|
+
'list': 'bullet'
|
|
57
|
+
}], ['link'], ['clean']];
|
|
58
|
+
var RichTextField = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
59
|
+
var _modules$toolbar;
|
|
60
|
+
var readOnly = _ref.readOnly,
|
|
61
|
+
disabled = _ref.disabled,
|
|
62
|
+
validationMessage = _ref.validationMessage,
|
|
63
|
+
note = _ref.note,
|
|
64
|
+
_ref$size = _ref.size,
|
|
65
|
+
size = _ref$size === void 0 ? _types.Size.Medium : _ref$size,
|
|
66
|
+
state = _ref.state,
|
|
67
|
+
resizable = _ref.resizable,
|
|
68
|
+
modules = _ref.modules,
|
|
69
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
70
|
+
var m = _objectSpread(_objectSpread({}, modules), {}, {
|
|
71
|
+
toolbar: (_modules$toolbar = modules === null || modules === void 0 ? void 0 : modules.toolbar) !== null && _modules$toolbar !== void 0 ? _modules$toolbar : defaultToolBarOptions
|
|
72
|
+
});
|
|
73
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
|
|
74
|
+
className: "".concat(resizable ? 'resizable' : '', " ").concat(state || '', " ").concat(readOnly ? 'readonly' : '', " ").concat(disabled ? 'disabled' : ''),
|
|
75
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactQuill.default, _objectSpread({
|
|
76
|
+
ref: ref,
|
|
77
|
+
readOnly: readOnly || disabled,
|
|
78
|
+
modules: m,
|
|
79
|
+
theme: 'snow'
|
|
80
|
+
}, rest)), validationMessage && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styling.ValidationMessage, {
|
|
81
|
+
className: size || '',
|
|
82
|
+
type: state !== null && state !== void 0 ? state : _types.States.Invalid,
|
|
83
|
+
children: [state === _types.States.Valid ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_systemicons.CheckMark, {
|
|
84
|
+
color: _styles.COLORS.correct_400
|
|
85
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_systemicons.TechnicalWarning, {
|
|
86
|
+
color: _styles.COLORS.critical_400
|
|
87
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
88
|
+
children: validationMessage
|
|
89
|
+
})]
|
|
90
|
+
}), note && !disabled && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styling.NoteMessage, {
|
|
91
|
+
className: size,
|
|
92
|
+
children: [note.icon, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
93
|
+
children: note.message
|
|
94
|
+
})]
|
|
95
|
+
})]
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
exports.RichTextField = RichTextField;
|
|
99
|
+
RichTextField.propTypes = {
|
|
100
|
+
id: _propTypes.default.string,
|
|
101
|
+
className: _propTypes.default.string,
|
|
102
|
+
placeholder: _propTypes.default.string,
|
|
103
|
+
readOnly: _propTypes.default.bool,
|
|
104
|
+
disabled: _propTypes.default.bool,
|
|
105
|
+
resizable: _propTypes.default.bool,
|
|
106
|
+
formats: _propTypes.default.arrayOf(_propTypes.default.oneOf(["background", "bold", "color", "font", "code", "italic", "link", "size", "strike", "script", "underline", "blockquote", "header", "indent", "list", "align", "direction", "code-block", "formula", "image", "video"])),
|
|
107
|
+
onKeyDown: _propTypes.default.func,
|
|
108
|
+
onKeyPress: _propTypes.default.func,
|
|
109
|
+
onKeyUp: _propTypes.default.func,
|
|
110
|
+
value: _propTypes.default.any.isRequired,
|
|
111
|
+
onChange: _propTypes.default.func.isRequired,
|
|
112
|
+
validationMessage: _propTypes.default.string
|
|
113
|
+
};
|
|
114
|
+
//# sourceMappingURL=RichTextField.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextField.cjs","names":["Wrapper","styled","div","COLORS","neutral_400","correct_500","critical_500","primary_700","primary_800","ComponentSStyling","ComponentTextStyle","Italic","neutral_500","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","rest","m","toolbar","States","Invalid","Valid","correct_400","critical_400","icon","message","id","className","placeholder","formats","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, ComponentSStyling, ComponentTextStyle, scrollBarStyling} from \"../styles\";\nimport {CheckMark, TechnicalWarning} from \"../icons/systemicons\";\nimport {Sources, StringMap} from \"quill\";\nimport 'react-quill/dist/quill.snow.css';\n\nconst Wrapper = styled.div`\n height: 100%;\n display: flex;\n flex-direction: column;\n\n .quill {\n display: flex;\n flex-direction: column;\n width: 100%;\n flex: 1;\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.ql-blank::before {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n\n .ql-toolbar {\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\n .ql-container {\n flex: 1;\n border: none;\n overflow-y: hidden;\n padding: 8px;\n }\n\n .ql-editor {\n padding: 8px;\n overflow-y: auto;\n flex: 1;\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 padding: 0;\n flex: none;\n }\n\n .ql-editor {\n padding: 16px;\n resize: vertical;\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\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 ...rest\n }: RichTextFieldProps, ref) => {\n\n let m = {...modules, toolbar: modules?.toolbar ?? defaultToolBarOptions};\n\n return (\n <Wrapper\n className={`${resizable ? 'resizable' : ''} ${state || ''} ${readOnly ? 'readonly' : ''} ${disabled ? 'disabled' : ''}`}>\n <ReactQuill ref={ref}\n readOnly={readOnly || disabled}\n modules={m}\n theme={'snow'}\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 </Wrapper>\n )\n});"],"mappings":";;;;;;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAyC;AAAA;AAAA;AAAA;AAAA;AAEzC,IAAMA,OAAO,GAAGC,yBAAM,CAACC,GAAG,yrDAaQC,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,MAAM,EAAER,cAAM,CAACS,WAAW,CAAC,EAOvCT,cAAM,CAACU,WAAW,EAwB3C,IAAAC,wBAAgB,EAACC,WAAI,CAACC,KAAK,CAAC,EAwB1BC,sBAAa,EASed,cAAM,CAACe,WAAW,EACvCf,cAAM,CAACgB,WAAW,EAGhBhB,cAAM,CAACgB,WAAW,CAOlC;AAAC,IAEUC,oBAAoB;AAAA;AAAA,WAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;AAAA,GAApBA,oBAAoB,oCAApBA,oBAAoB;AAwBhC,IAAMC,qBAAqB,GAAG,CAC5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GAAIM,aAAM,CAACC,OAAQ;MAAA,WAEpEP,KAAK,KAAKM,aAAM,CAACE,KAAK,gBAClB,qBAAC,sBAAS;QAAC,KAAK,EAAEtC,cAAM,CAACuC;MAAY,EAAE,gBACvC,qBAAC,6BAAgB;QAAC,KAAK,EAAEvC,cAAM,CAACwC;MAAa,EAAE,eAErD;QAAA,UAAOd;MAAiB,EAAQ;IAAA,EAEnC,EACAC,IAAI,IAAI,CAACF,QAAQ,iBAChB,sBAAC,oBAAW;MAAC,SAAS,EAAEG,IAAK;MAAA,WAC1BD,IAAI,CAACc,IAAI,eACV;QAAA,UAAOd,IAAI,CAACe;MAAO,EAAQ;IAAA,EAE9B;EAAA,EACO;AAEd,CAAC,CAAC;AAAC;AAAA;EApEDC,EAAE;EACFC,SAAS;EACTC,WAAW;EACXrB,QAAQ;EACRC,QAAQ;EACRM,SAAS;EAGTe,OAAO;EAMPC,SAAS;EACTC,UAAU;EACVC,OAAO;EAEPC,KAAK;EACLC,QAAQ;EAERzB,iBAAiB;AAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Range, UnprivilegedEditor } from "react-quill";
|
|
3
|
+
import { TextFieldNote } from "./types";
|
|
4
|
+
import { Size, States } from "../types";
|
|
5
|
+
import { Sources, StringMap } from "quill";
|
|
6
|
+
import 'react-quill/dist/quill.snow.css';
|
|
7
|
+
export declare enum RichTextFieldFormats {
|
|
8
|
+
Background = "background",
|
|
9
|
+
Bold = "bold",
|
|
10
|
+
Color = "color",
|
|
11
|
+
Font = "font",
|
|
12
|
+
Code = "code",
|
|
13
|
+
Italic = "italic",
|
|
14
|
+
Link = "link",
|
|
15
|
+
Size = "size",
|
|
16
|
+
Strike = "strike",
|
|
17
|
+
Script = "script",
|
|
18
|
+
Underline = "underline",
|
|
19
|
+
Blockquote = "blockquote",
|
|
20
|
+
Header = "header",
|
|
21
|
+
Indent = "indent",
|
|
22
|
+
List = "list",
|
|
23
|
+
Align = "align",
|
|
24
|
+
Direction = "direction",
|
|
25
|
+
CodeBlock = "code-block",
|
|
26
|
+
Formula = "formula",
|
|
27
|
+
Image = "image",
|
|
28
|
+
Video = "video"
|
|
29
|
+
}
|
|
30
|
+
export interface RichTextFieldProps {
|
|
31
|
+
id?: string;
|
|
32
|
+
className?: string;
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
readOnly?: boolean;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
resizable?: boolean;
|
|
37
|
+
modules?: StringMap;
|
|
38
|
+
formats?: RichTextFieldFormats[];
|
|
39
|
+
onFocus?(selection: Range, source: Sources, editor: UnprivilegedEditor): void;
|
|
40
|
+
onBlur?(previousSelection: Range, source: Sources, editor: UnprivilegedEditor): void;
|
|
41
|
+
onKeyDown?: React.EventHandler<any>;
|
|
42
|
+
onKeyPress?: React.EventHandler<any>;
|
|
43
|
+
onKeyUp?: React.EventHandler<any>;
|
|
44
|
+
value: any;
|
|
45
|
+
onChange: (value: any) => void;
|
|
46
|
+
validationMessage?: string;
|
|
47
|
+
note?: TextFieldNote;
|
|
48
|
+
size?: Size.Small | Size.Medium;
|
|
49
|
+
state?: States.Invalid | States.Valid;
|
|
50
|
+
}
|
|
51
|
+
export declare const RichTextField: React.ForwardRefExoticComponent<RichTextFieldProps & React.RefAttributes<any>>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
4
|
+
import _pt from "prop-types";
|
|
5
|
+
var _excluded = ["readOnly", "disabled", "validationMessage", "note", "size", "state", "resizable", "modules"];
|
|
6
|
+
var _templateObject;
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import ReactQuill from "react-quill";
|
|
11
|
+
import styled from "styled-components";
|
|
12
|
+
import { NoteMessage, readOnlyState, ValidationMessage } from "./styling";
|
|
13
|
+
import { Size, States } from "../types";
|
|
14
|
+
import { COLORS, ComponentSStyling, ComponentTextStyle, scrollBarStyling } from "../styles";
|
|
15
|
+
import { CheckMark, TechnicalWarning } from "../icons/systemicons";
|
|
16
|
+
import 'react-quill/dist/quill.snow.css';
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 100%;\n display: flex;\n flex-direction: column;\n\n .quill {\n display: flex;\n flex-direction: column;\n width: 100%;\n flex: 1;\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.ql-blank::before {\n ", "\n }\n\n .ql-toolbar {\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\n .ql-container {\n flex: 1;\n border: none;\n overflow-y: hidden;\n padding: 8px;\n }\n\n .ql-editor {\n padding: 8px;\n overflow-y: auto;\n flex: 1;\n\n ", "\n }\n\n &.resizable {\n height: initial;\n\n .quill {\n flex: none;\n overflow: initial;\n }\n\n .ql-container {\n padding: 0;\n flex: none;\n }\n\n .ql-editor {\n padding: 16px;\n resize: vertical;\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\n\n\n"])), COLORS.neutral_400, COLORS.correct_500, COLORS.critical_500, COLORS.primary_700, COLORS.primary_800, ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500), COLORS.neutral_200, scrollBarStyling(Size.Small), readOnlyState, COLORS.neutral_100, COLORS.neutral_300, COLORS.neutral_300);
|
|
20
|
+
export var RichTextFieldFormats;
|
|
21
|
+
(function (RichTextFieldFormats) {
|
|
22
|
+
RichTextFieldFormats["Background"] = "background";
|
|
23
|
+
RichTextFieldFormats["Bold"] = "bold";
|
|
24
|
+
RichTextFieldFormats["Color"] = "color";
|
|
25
|
+
RichTextFieldFormats["Font"] = "font";
|
|
26
|
+
RichTextFieldFormats["Code"] = "code";
|
|
27
|
+
RichTextFieldFormats["Italic"] = "italic";
|
|
28
|
+
RichTextFieldFormats["Link"] = "link";
|
|
29
|
+
RichTextFieldFormats["Size"] = "size";
|
|
30
|
+
RichTextFieldFormats["Strike"] = "strike";
|
|
31
|
+
RichTextFieldFormats["Script"] = "script";
|
|
32
|
+
RichTextFieldFormats["Underline"] = "underline";
|
|
33
|
+
RichTextFieldFormats["Blockquote"] = "blockquote";
|
|
34
|
+
RichTextFieldFormats["Header"] = "header";
|
|
35
|
+
RichTextFieldFormats["Indent"] = "indent";
|
|
36
|
+
RichTextFieldFormats["List"] = "list";
|
|
37
|
+
RichTextFieldFormats["Align"] = "align";
|
|
38
|
+
RichTextFieldFormats["Direction"] = "direction";
|
|
39
|
+
RichTextFieldFormats["CodeBlock"] = "code-block";
|
|
40
|
+
RichTextFieldFormats["Formula"] = "formula";
|
|
41
|
+
RichTextFieldFormats["Image"] = "image";
|
|
42
|
+
RichTextFieldFormats["Video"] = "video";
|
|
43
|
+
})(RichTextFieldFormats || (RichTextFieldFormats = {}));
|
|
44
|
+
var defaultToolBarOptions = [[{
|
|
45
|
+
header: [1, 2, 3, false]
|
|
46
|
+
}], ['bold', 'italic', 'underline', 'strike'], [{
|
|
47
|
+
'list': 'ordered'
|
|
48
|
+
}, {
|
|
49
|
+
'list': 'bullet'
|
|
50
|
+
}], ['link'], ['clean']];
|
|
51
|
+
export var RichTextField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
52
|
+
var _modules$toolbar;
|
|
53
|
+
var readOnly = _ref.readOnly,
|
|
54
|
+
disabled = _ref.disabled,
|
|
55
|
+
validationMessage = _ref.validationMessage,
|
|
56
|
+
note = _ref.note,
|
|
57
|
+
_ref$size = _ref.size,
|
|
58
|
+
size = _ref$size === void 0 ? Size.Medium : _ref$size,
|
|
59
|
+
state = _ref.state,
|
|
60
|
+
resizable = _ref.resizable,
|
|
61
|
+
modules = _ref.modules,
|
|
62
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
63
|
+
var m = _objectSpread(_objectSpread({}, modules), {}, {
|
|
64
|
+
toolbar: (_modules$toolbar = modules === null || modules === void 0 ? void 0 : modules.toolbar) !== null && _modules$toolbar !== void 0 ? _modules$toolbar : defaultToolBarOptions
|
|
65
|
+
});
|
|
66
|
+
return /*#__PURE__*/_jsxs(Wrapper, {
|
|
67
|
+
className: "".concat(resizable ? 'resizable' : '', " ").concat(state || '', " ").concat(readOnly ? 'readonly' : '', " ").concat(disabled ? 'disabled' : ''),
|
|
68
|
+
children: [/*#__PURE__*/_jsx(ReactQuill, _objectSpread({
|
|
69
|
+
ref: ref,
|
|
70
|
+
readOnly: readOnly || disabled,
|
|
71
|
+
modules: m,
|
|
72
|
+
theme: 'snow'
|
|
73
|
+
}, rest)), validationMessage && /*#__PURE__*/_jsxs(ValidationMessage, {
|
|
74
|
+
className: size || '',
|
|
75
|
+
type: state !== null && state !== void 0 ? state : States.Invalid,
|
|
76
|
+
children: [state === States.Valid ? /*#__PURE__*/_jsx(CheckMark, {
|
|
77
|
+
color: COLORS.correct_400
|
|
78
|
+
}) : /*#__PURE__*/_jsx(TechnicalWarning, {
|
|
79
|
+
color: COLORS.critical_400
|
|
80
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
81
|
+
children: validationMessage
|
|
82
|
+
})]
|
|
83
|
+
}), note && !disabled && /*#__PURE__*/_jsxs(NoteMessage, {
|
|
84
|
+
className: size,
|
|
85
|
+
children: [note.icon, /*#__PURE__*/_jsx("span", {
|
|
86
|
+
children: note.message
|
|
87
|
+
})]
|
|
88
|
+
})]
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
RichTextField.propTypes = {
|
|
92
|
+
id: _pt.string,
|
|
93
|
+
className: _pt.string,
|
|
94
|
+
placeholder: _pt.string,
|
|
95
|
+
readOnly: _pt.bool,
|
|
96
|
+
disabled: _pt.bool,
|
|
97
|
+
resizable: _pt.bool,
|
|
98
|
+
formats: _pt.arrayOf(_pt.oneOf(["background", "bold", "color", "font", "code", "italic", "link", "size", "strike", "script", "underline", "blockquote", "header", "indent", "list", "align", "direction", "code-block", "formula", "image", "video"])),
|
|
99
|
+
onKeyDown: _pt.func,
|
|
100
|
+
onKeyPress: _pt.func,
|
|
101
|
+
onKeyUp: _pt.func,
|
|
102
|
+
value: _pt.any.isRequired,
|
|
103
|
+
onChange: _pt.func.isRequired,
|
|
104
|
+
validationMessage: _pt.string
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=RichTextField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextField.js","names":["React","ReactQuill","styled","NoteMessage","readOnlyState","ValidationMessage","Size","States","COLORS","ComponentSStyling","ComponentTextStyle","scrollBarStyling","CheckMark","TechnicalWarning","Wrapper","div","neutral_400","correct_500","critical_500","primary_700","primary_800","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","rest","m","toolbar","Invalid","Valid","correct_400","critical_400","icon","message","id","className","placeholder","formats","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, ComponentSStyling, ComponentTextStyle, scrollBarStyling} from \"../styles\";\nimport {CheckMark, TechnicalWarning} from \"../icons/systemicons\";\nimport {Sources, StringMap} from \"quill\";\nimport 'react-quill/dist/quill.snow.css';\n\nconst Wrapper = styled.div`\n height: 100%;\n display: flex;\n flex-direction: column;\n\n .quill {\n display: flex;\n flex-direction: column;\n width: 100%;\n flex: 1;\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.ql-blank::before {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n\n .ql-toolbar {\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\n .ql-container {\n flex: 1;\n border: none;\n overflow-y: hidden;\n padding: 8px;\n }\n\n .ql-editor {\n padding: 8px;\n overflow-y: auto;\n flex: 1;\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 padding: 0;\n flex: none;\n }\n\n .ql-editor {\n padding: 16px;\n resize: vertical;\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\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 ...rest\n }: RichTextFieldProps, ref) => {\n\n let m = {...modules, toolbar: modules?.toolbar ?? defaultToolBarOptions};\n\n return (\n <Wrapper\n className={`${resizable ? 'resizable' : ''} ${state || ''} ${readOnly ? 'readonly' : ''} ${disabled ? 'disabled' : ''}`}>\n <ReactQuill ref={ref}\n readOnly={readOnly || disabled}\n modules={m}\n theme={'snow'}\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 </Wrapper>\n )\n});"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAmC,aAAa;AAEjE,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAAQC,WAAW,EAAEC,aAAa,EAAEC,iBAAiB,QAAO,WAAW;AACvE,SAAQC,IAAI,EAAEC,MAAM,QAAO,UAAU;AACrC,SAAQC,MAAM,EAAEC,iBAAiB,EAAEC,kBAAkB,EAAEC,gBAAgB,QAAO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nC,EACAC,IAAI,IAAI,CAACF,QAAQ,iBAChB,MAAC,WAAW;MAAC,SAAS,EAAEG,IAAK;MAAA,WAC1BD,IAAI,CAACa,IAAI,eACV;QAAA,UAAOb,IAAI,CAACc;MAAO,EAAQ;IAAA,EAE9B;EAAA,EACO;AAEd,CAAC,CAAC;AAAC;EApEDC,EAAE;EACFC,SAAS;EACTC,WAAW;EACXpB,QAAQ;EACRC,QAAQ;EACRM,SAAS;EAGTc,OAAO;EAMPC,SAAS;EACTC,UAAU;EACVC,OAAO;EAEPC,KAAK;EACLC,QAAQ;EAERxB,iBAAiB;AAAA"}
|
|
@@ -98,4 +98,16 @@ Object.keys(_styling).forEach(function (key) {
|
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
});
|
|
101
|
+
var _RichTextField = require("./RichTextField");
|
|
102
|
+
Object.keys(_RichTextField).forEach(function (key) {
|
|
103
|
+
if (key === "default" || key === "__esModule") return;
|
|
104
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
105
|
+
if (key in exports && exports[key] === _RichTextField[key]) return;
|
|
106
|
+
Object.defineProperty(exports, key, {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function get() {
|
|
109
|
+
return _RichTextField[key];
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
});
|
|
101
113
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/InputFields/index.ts"],"sourcesContent":["import TextField, { TextFieldProps } from './TextField';\nimport PasswordField, { PasswordFieldProps } from './PasswordField';\nimport Checkbox from './Checkbox';\nimport RadioButton, { RadioButtonProps } from './RadioButton';\nimport SearchBar, { SearchBarProps } from './SearchBar';\nimport InputLabel, { LabelProps } from './Label';\nimport DatepickerField, { DatepickerFieldProps } from './DatepickerField';\nimport Textarea from './Textarea';\nimport QuickSearch, { QuickSearchProps } from './QuickSearch';\nimport NumberField, { NumberFieldProps } from './NumberField';\nimport { TextareaProps, CheckboxProps } from './types';\n\nexport * from './styling';\n\nexport { TextField, PasswordField, Checkbox, RadioButton, SearchBar, InputLabel, DatepickerField, Textarea, QuickSearch, NumberField };\n\nexport type { TextFieldProps, CheckboxProps, TextareaProps, DatepickerFieldProps, LabelProps, NumberFieldProps, PasswordFieldProps, QuickSearchProps, RadioButtonProps, SearchBarProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/InputFields/index.ts"],"sourcesContent":["import TextField, { TextFieldProps } from './TextField';\nimport PasswordField, { PasswordFieldProps } from './PasswordField';\nimport Checkbox from './Checkbox';\nimport RadioButton, { RadioButtonProps } from './RadioButton';\nimport SearchBar, { SearchBarProps } from './SearchBar';\nimport InputLabel, { LabelProps } from './Label';\nimport DatepickerField, { DatepickerFieldProps } from './DatepickerField';\nimport Textarea from './Textarea';\nimport QuickSearch, { QuickSearchProps } from './QuickSearch';\nimport NumberField, { NumberFieldProps } from './NumberField';\nimport { TextareaProps, CheckboxProps } from './types';\n\nexport * from './styling';\nexport * from './RichTextField';\n\nexport { TextField, PasswordField, Checkbox, RadioButton, SearchBar, InputLabel, DatepickerField, Textarea, QuickSearch, NumberField };\n\nexport type { TextFieldProps, CheckboxProps, TextareaProps, DatepickerFieldProps, LabelProps, NumberFieldProps, PasswordFieldProps, QuickSearchProps, RadioButtonProps, SearchBarProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -10,5 +10,6 @@ import QuickSearch, { QuickSearchProps } from './QuickSearch';
|
|
|
10
10
|
import NumberField, { NumberFieldProps } from './NumberField';
|
|
11
11
|
import { TextareaProps, CheckboxProps } from './types';
|
|
12
12
|
export * from './styling';
|
|
13
|
+
export * from './RichTextField';
|
|
13
14
|
export { TextField, PasswordField, Checkbox, RadioButton, SearchBar, InputLabel, DatepickerField, Textarea, QuickSearch, NumberField };
|
|
14
15
|
export type { TextFieldProps, CheckboxProps, TextareaProps, DatepickerFieldProps, LabelProps, NumberFieldProps, PasswordFieldProps, QuickSearchProps, RadioButtonProps, SearchBarProps };
|
|
@@ -9,5 +9,6 @@ import Textarea from './Textarea';
|
|
|
9
9
|
import QuickSearch from './QuickSearch';
|
|
10
10
|
import NumberField from './NumberField';
|
|
11
11
|
export * from './styling';
|
|
12
|
+
export * from './RichTextField';
|
|
12
13
|
export { TextField, PasswordField, Checkbox, RadioButton, SearchBar, InputLabel, DatepickerField, Textarea, QuickSearch, NumberField };
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["TextField","PasswordField","Checkbox","RadioButton","SearchBar","InputLabel","DatepickerField","Textarea","QuickSearch","NumberField"],"sources":["../../src/InputFields/index.ts"],"sourcesContent":["import TextField, { TextFieldProps } from './TextField';\nimport PasswordField, { PasswordFieldProps } from './PasswordField';\nimport Checkbox from './Checkbox';\nimport RadioButton, { RadioButtonProps } from './RadioButton';\nimport SearchBar, { SearchBarProps } from './SearchBar';\nimport InputLabel, { LabelProps } from './Label';\nimport DatepickerField, { DatepickerFieldProps } from './DatepickerField';\nimport Textarea from './Textarea';\nimport QuickSearch, { QuickSearchProps } from './QuickSearch';\nimport NumberField, { NumberFieldProps } from './NumberField';\nimport { TextareaProps, CheckboxProps } from './types';\n\nexport * from './styling';\n\nexport { TextField, PasswordField, Checkbox, RadioButton, SearchBar, InputLabel, DatepickerField, Textarea, QuickSearch, NumberField };\n\nexport type { TextFieldProps, CheckboxProps, TextareaProps, DatepickerFieldProps, LabelProps, NumberFieldProps, PasswordFieldProps, QuickSearchProps, RadioButtonProps, SearchBarProps };\n"],"mappings":"AAAA,OAAOA,SAAS,MAA0B,aAAa;AACvD,OAAOC,aAAa,MAA8B,iBAAiB;AACnE,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,WAAW,MAA4B,eAAe;AAC7D,OAAOC,SAAS,MAA0B,aAAa;AACvD,OAAOC,UAAU,MAAsB,SAAS;AAChD,OAAOC,eAAe,MAAgC,mBAAmB;AACzE,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,WAAW,MAA4B,eAAe;AAC7D,OAAOC,WAAW,MAA4B,eAAe;AAG7D,cAAc,WAAW;
|
|
1
|
+
{"version":3,"file":"index.js","names":["TextField","PasswordField","Checkbox","RadioButton","SearchBar","InputLabel","DatepickerField","Textarea","QuickSearch","NumberField"],"sources":["../../src/InputFields/index.ts"],"sourcesContent":["import TextField, { TextFieldProps } from './TextField';\nimport PasswordField, { PasswordFieldProps } from './PasswordField';\nimport Checkbox from './Checkbox';\nimport RadioButton, { RadioButtonProps } from './RadioButton';\nimport SearchBar, { SearchBarProps } from './SearchBar';\nimport InputLabel, { LabelProps } from './Label';\nimport DatepickerField, { DatepickerFieldProps } from './DatepickerField';\nimport Textarea from './Textarea';\nimport QuickSearch, { QuickSearchProps } from './QuickSearch';\nimport NumberField, { NumberFieldProps } from './NumberField';\nimport { TextareaProps, CheckboxProps } from './types';\n\nexport * from './styling';\nexport * from './RichTextField';\n\nexport { TextField, PasswordField, Checkbox, RadioButton, SearchBar, InputLabel, DatepickerField, Textarea, QuickSearch, NumberField };\n\nexport type { TextFieldProps, CheckboxProps, TextareaProps, DatepickerFieldProps, LabelProps, NumberFieldProps, PasswordFieldProps, QuickSearchProps, RadioButtonProps, SearchBarProps };\n"],"mappings":"AAAA,OAAOA,SAAS,MAA0B,aAAa;AACvD,OAAOC,aAAa,MAA8B,iBAAiB;AACnE,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,WAAW,MAA4B,eAAe;AAC7D,OAAOC,SAAS,MAA0B,aAAa;AACvD,OAAOC,UAAU,MAAsB,SAAS;AAChD,OAAOC,eAAe,MAAgC,mBAAmB;AACzE,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,WAAW,MAA4B,eAAe;AAC7D,OAAOC,WAAW,MAA4B,eAAe;AAG7D,cAAc,WAAW;AACzB,cAAc,iBAAiB;AAE/B,SAAST,SAAS,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,SAAS,EAAEC,UAAU,EAAEC,eAAe,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,WAAW"}
|
package/dist/Table/TableBody.cjs
CHANGED
|
@@ -8,7 +8,6 @@ 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"));
|
|
12
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
12
|
var _Button = require("../Button");
|
|
14
13
|
var _types = require("../types");
|
|
@@ -20,14 +19,11 @@ var _TableStyles = require("./TableStyles");
|
|
|
20
19
|
var _common = require("../common");
|
|
21
20
|
var _icons = require("../icons");
|
|
22
21
|
var _rooks = require("rooks");
|
|
23
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
24
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
-
var _templateObject;
|
|
26
23
|
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); }
|
|
27
24
|
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; }
|
|
28
25
|
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; }
|
|
29
26
|
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"])));
|
|
31
27
|
var TableBody = function TableBody(props) {
|
|
32
28
|
var _props$noRowsLabel;
|
|
33
29
|
var _useDimensionsRef = (0, _rooks.useDimensionsRef)({
|
|
@@ -118,15 +114,8 @@ var TableBody = function TableBody(props) {
|
|
|
118
114
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
119
115
|
children: [column.icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableCellIcon, {
|
|
120
116
|
children: column.icon
|
|
121
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
122
|
-
|
|
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
|
-
})]
|
|
117
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableCellText, {
|
|
118
|
+
children: row[column.key]
|
|
130
119
|
})]
|
|
131
120
|
});
|
|
132
121
|
}
|
|
@@ -175,13 +164,13 @@ var TableBody = function TableBody(props) {
|
|
|
175
164
|
tabIndex: column.sortable && !props.showLoadingIndicator ? 0 : -1,
|
|
176
165
|
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 || ''),
|
|
177
166
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_TableStyles.StyledTableHeaderColumnContent, {
|
|
178
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
167
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
179
168
|
children: column.name
|
|
180
169
|
}), column.key === ((_props$sortProps8 = props.sortProps) === null || _props$sortProps8 === void 0 ? void 0 : _props$sortProps8.column) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableHeaderColumnSortDirection, {
|
|
181
170
|
children: ((_props$sortProps9 = props.sortProps) === null || _props$sortProps9 === void 0 ? void 0 : _props$sortProps9.direction) === 'asc' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.ArrowLineUp, {
|
|
182
|
-
size: '
|
|
171
|
+
size: '24px'
|
|
183
172
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.ArrowLineDown, {
|
|
184
|
-
size: '
|
|
173
|
+
size: '24px'
|
|
185
174
|
})
|
|
186
175
|
})]
|
|
187
176
|
})
|
|
@@ -214,9 +203,8 @@ var TableBody = function TableBody(props) {
|
|
|
214
203
|
style: {
|
|
215
204
|
maxWidth: column.width
|
|
216
205
|
},
|
|
217
|
-
title: column.shortenText
|
|
206
|
+
title: column.shortenText && row[column.key],
|
|
218
207
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableCellContent, {
|
|
219
|
-
withNote: Boolean(column.noteKey),
|
|
220
208
|
className: "".concat(column.shortenText ? "truncate-text" : '', " ").concat(column.justify || ''),
|
|
221
209
|
style: {
|
|
222
210
|
color: column.colorFn && column.colorFn(row, column.key)
|
|
@@ -1 +1 @@
|
|
|
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;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N,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"}
|
|
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;AA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AAS,YAAKX,MAAM,CAACgD,WAAW,qBAAqB,EAAE,cAAIhD,MAAM,CAACwC,OAAO,IAAI,EAAE,CAAG;kBAClF,KAAK,EAAE;oBACL9B,KAAK,EAAEV,MAAM,CAACS,OAAO,IAAIT,MAAM,CAACS,OAAO,CAACR,GAAG,EAAED,MAAM,CAACW,GAAG;kBACzD,CAAE;kBAAA,UACDZ,cAAc,CAACC,MAAM,EAAEC,GAAG;gBAAC;cACL,iBATE2C,KAAK,cAAI5C,MAAM,CAACW,GAAG,EAU9B;YAAA,CACnB,CAAC;UAAA,iBA/B4BiC,KAAK,EAgChB;QAAA,CACtB,CAAC,gBAEF,qBAAC,sCAAyB;UAAC,eAAY,oBAAoB;UAAA,uBACzD,qBAAC,4BAAe;YAAC,OAAO,EAAE5D,KAAK,CAACa,OAAO,CAAC8C,MAAM,IAAI3D,KAAK,CAACyC,WAAW,GAAG,CAAC,GAAG,CAAC,CAAE;YAAA,uBAC3E,qBAAC,mCAAsB;cAAC,SAAS,EAAE,QAAS;cAAA,gCACzCzC,KAAK,CAACiE,WAAW,mEAAI;YAA8B;UAC7B;QACT;MAErB,EAEe;IAAA;EACN,EACS;AAE7B,CAAC;AACF;EA3MCP,eAAe;EACfI,UAAU;EACVpB,QAAQ;EACRS,YAAY;EACZJ,gBAAgB;EAChBD,cAAc,4BAAE,KAAK,EAAG,MAAM,EAAG,MAAM;AAAA;AAAA,eAwM1B/C,SAAS;AAAA"}
|
package/dist/Table/TableBody.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
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";
|
|
4
3
|
import _pt from "prop-types";
|
|
5
|
-
var _templateObject;
|
|
6
4
|
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; }
|
|
7
5
|
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; }
|
|
8
6
|
import { Button } from '../Button';
|
|
@@ -11,15 +9,13 @@ import * as React from 'react';
|
|
|
11
9
|
import { Checkbox } from '../InputFields';
|
|
12
10
|
import IconButton from '../Button/Iconbutton';
|
|
13
11
|
import { HyperLink } from '../HyperLink';
|
|
14
|
-
import { StyledTableBody, StyledTableBodyRow, StyledTableCell, StyledTableCellContent, StyledTableCellIcon, StyledTableCellText, StyledTableHeaderColumn, StyledTableHeaderColumnContent, StyledTableHeaderColumns, StyledTableNoRowsLabelRow, StyledTable, StyledTableBodyWrapper, StyledTableHeaderRow, StyledTableHeaderColumnSortDirection
|
|
12
|
+
import { StyledTableBody, StyledTableBodyRow, StyledTableCell, StyledTableCellContent, StyledTableCellIcon, StyledTableCellText, StyledTableHeaderColumn, StyledTableHeaderColumnContent, StyledTableHeaderColumns, StyledTableNoRowsLabelRow, StyledTable, StyledTableBodyWrapper, StyledTableHeaderRow, StyledTableHeaderColumnSortDirection } from './TableStyles';
|
|
15
13
|
import { defaultOnMouseDownHandler } from '../common';
|
|
16
|
-
import { SystemIcons } from
|
|
17
|
-
import { useDimensionsRef } from
|
|
18
|
-
import styled from 'styled-components';
|
|
14
|
+
import { SystemIcons } from "../icons";
|
|
15
|
+
import { useDimensionsRef } from "rooks";
|
|
19
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
17
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
18
|
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"])));
|
|
23
19
|
var TableBody = function TableBody(props) {
|
|
24
20
|
var _props$noRowsLabel;
|
|
25
21
|
var _useDimensionsRef = useDimensionsRef({
|
|
@@ -110,15 +106,8 @@ var TableBody = function TableBody(props) {
|
|
|
110
106
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
111
107
|
children: [column.icon && /*#__PURE__*/_jsx(StyledTableCellIcon, {
|
|
112
108
|
children: column.icon
|
|
113
|
-
}), /*#__PURE__*/
|
|
114
|
-
|
|
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
|
-
})]
|
|
109
|
+
}), /*#__PURE__*/_jsx(StyledTableCellText, {
|
|
110
|
+
children: row[column.key]
|
|
122
111
|
})]
|
|
123
112
|
});
|
|
124
113
|
}
|
|
@@ -167,13 +156,13 @@ var TableBody = function TableBody(props) {
|
|
|
167
156
|
tabIndex: column.sortable && !props.showLoadingIndicator ? 0 : -1,
|
|
168
157
|
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 || ''),
|
|
169
158
|
children: /*#__PURE__*/_jsxs(StyledTableHeaderColumnContent, {
|
|
170
|
-
children: [/*#__PURE__*/_jsx(
|
|
159
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
171
160
|
children: column.name
|
|
172
161
|
}), column.key === ((_props$sortProps8 = props.sortProps) === null || _props$sortProps8 === void 0 ? void 0 : _props$sortProps8.column) && /*#__PURE__*/_jsx(StyledTableHeaderColumnSortDirection, {
|
|
173
162
|
children: ((_props$sortProps9 = props.sortProps) === null || _props$sortProps9 === void 0 ? void 0 : _props$sortProps9.direction) === 'asc' ? /*#__PURE__*/_jsx(SystemIcons.ArrowLineUp, {
|
|
174
|
-
size: '
|
|
163
|
+
size: '24px'
|
|
175
164
|
}) : /*#__PURE__*/_jsx(SystemIcons.ArrowLineDown, {
|
|
176
|
-
size: '
|
|
165
|
+
size: '24px'
|
|
177
166
|
})
|
|
178
167
|
})]
|
|
179
168
|
})
|
|
@@ -206,9 +195,8 @@ var TableBody = function TableBody(props) {
|
|
|
206
195
|
style: {
|
|
207
196
|
maxWidth: column.width
|
|
208
197
|
},
|
|
209
|
-
title: column.shortenText
|
|
198
|
+
title: column.shortenText && row[column.key],
|
|
210
199
|
children: /*#__PURE__*/_jsx(StyledTableCellContent, {
|
|
211
|
-
withNote: Boolean(column.noteKey),
|
|
212
200
|
className: "".concat(column.shortenText ? "truncate-text" : '', " ").concat(column.justify || ''),
|
|
213
201
|
style: {
|
|
214
202
|
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","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 </StyledT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OAAO,CAACR,GAAG,EAAED,MAAM,CAACW,GAAG;kBACzD,CAAE;kBAAA,UACDZ,cAAc,CAACC,MAAM,EAAEC,GAAG;gBAAC;cACL,iBARE4C,KAAK,cAAI7C,MAAM,CAACW,GAAG,EAS9B;YAAA,CACnB,CAAC;UAAA,iBA7BUkC,KAAK,EA8BE;QAAA,CACtB,CAAC,gBAEF,KAAC,yBAAyB;UAAC,eAAY,oBAAoB;UAAA,uBACzD,KAAC,eAAe;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"}
|
|
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;A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AI,EAAE,CAAG;kBAClF,KAAK,EAAE;oBACL5B,KAAK,EAAEV,MAAM,CAACS,OAAO,IAAIT,MAAM,CAACS,OAAO,CAACR,GAAG,EAAED,MAAM,CAACW,GAAG;kBACzD,CAAE;kBAAA,UACDZ,cAAc,CAACC,MAAM,EAAEC,GAAG;gBAAC;cACL,iBATEyC,KAAK,cAAI1C,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"}
|
|
@@ -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.
|
|
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;
|
|
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;
|
|
16
16
|
/**
|
|
17
17
|
* Table styles
|
|
18
18
|
*/
|
|
@@ -45,35 +45,27 @@ 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:
|
|
49
|
-
return props.withNote ? '64px' : '48px';
|
|
50
|
-
}, (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.black), _Checkbox.StyledCheckBox);
|
|
48
|
+
var StyledTableCellContent = _styledComponents.default.div(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["\n min-height: 48px;\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"])), (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.black), _Checkbox.StyledCheckBox);
|
|
51
49
|
exports.StyledTableCellContent = StyledTableCellContent;
|
|
52
|
-
var StyledTableCellIcon = _styledComponents.default.div(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n width:
|
|
50
|
+
var StyledTableCellIcon = _styledComponents.default.div(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n width: 24px;\n height: 24px;\n\n svg {\n color: ", ";\n width: 24px;\n height: 24px;\n }\n"])), _styles.COLORS.neutral_700, _styles.COLORS.neutral_700);
|
|
53
51
|
exports.StyledTableCellIcon = StyledTableCellIcon;
|
|
54
|
-
var StyledTableCellText = _styledComponents.default.span(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["\n
|
|
52
|
+
var StyledTableCellText = _styledComponents.default.span(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["\n padding: 12px 0;\n"])));
|
|
55
53
|
exports.StyledTableCellText = StyledTableCellText;
|
|
56
|
-
var
|
|
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"])));
|
|
54
|
+
var StyledTableFooter = _styledComponents.default.div(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2.default)(["\n"])));
|
|
63
55
|
exports.StyledTableFooter = StyledTableFooter;
|
|
64
|
-
var StyledTableFooterContent = _styledComponents.default.div(
|
|
56
|
+
var StyledTableFooterContent = _styledComponents.default.div(_templateObject19 || (_templateObject19 = (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);
|
|
65
57
|
exports.StyledTableFooterContent = StyledTableFooterContent;
|
|
66
|
-
var StyledTableFooterCurrentInfo = _styledComponents.default.span(
|
|
58
|
+
var StyledTableFooterCurrentInfo = _styledComponents.default.span(_templateObject20 || (_templateObject20 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 16px;\n ", "\n"])), (0, _typography.ComponentXSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.black));
|
|
67
59
|
exports.StyledTableFooterCurrentInfo = StyledTableFooterCurrentInfo;
|
|
68
|
-
var StyledTableFooterControls = _styledComponents.default.div(
|
|
60
|
+
var StyledTableFooterControls = _styledComponents.default.div(_templateObject21 || (_templateObject21 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n"])));
|
|
69
61
|
exports.StyledTableFooterControls = StyledTableFooterControls;
|
|
70
|
-
var StyledTableSpinner = _styledComponents.default.div(
|
|
62
|
+
var StyledTableSpinner = _styledComponents.default.div(_templateObject22 || (_templateObject22 = (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) {
|
|
71
63
|
var _props$zindex;
|
|
72
64
|
return (_props$zindex = props.zindex) !== null && _props$zindex !== void 0 ? _props$zindex : _zIndexes.Z_INDEXES.loader;
|
|
73
65
|
});
|
|
74
66
|
exports.StyledTableSpinner = StyledTableSpinner;
|
|
75
|
-
var StyledTableFooterCollapseButton = _styledComponents.default.button(
|
|
67
|
+
var StyledTableFooterCollapseButton = _styledComponents.default.button(_templateObject23 || (_templateObject23 = (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);
|
|
76
68
|
exports.StyledTableFooterCollapseButton = StyledTableFooterCollapseButton;
|
|
77
|
-
var StyledTableBodyWrapper = _styledComponents.default.div(
|
|
69
|
+
var StyledTableBodyWrapper = _styledComponents.default.div(_templateObject24 || (_templateObject24 = (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));
|
|
78
70
|
exports.StyledTableBodyWrapper = StyledTableBodyWrapper;
|
|
79
71
|
//# 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","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,GAAGf,yBAAM,CAACgB,EAAE,uFAChD;AAAC;AAEK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BD,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"}
|
|
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":";;;;;;;;AAGA;AAKA;AACA;AA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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"}
|
|
@@ -15,15 +15,9 @@ 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, {
|
|
19
|
-
withNote?: boolean | undefined;
|
|
20
|
-
}, never>;
|
|
18
|
+
export declare const StyledTableCellContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
21
19
|
export declare const StyledTableCellIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
22
20
|
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>;
|
|
27
21
|
export declare const StyledTableFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
28
22
|
export declare const StyledTableFooterContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
29
23
|
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;
|
|
3
3
|
/**
|
|
4
4
|
* Import third-party libraries.
|
|
5
5
|
*/
|
|
@@ -32,23 +32,17 @@ 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
|
-
|
|
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) {
|
|
35
|
+
export var StyledTableCellContent = styled.div(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n min-height: 48px;\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"])), ComponentSStyling(ComponentTextStyle.Regular, COLORS.black), StyledCheckBox);
|
|
36
|
+
export var StyledTableCellIcon = styled.div(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n color: ", ";\n width: 24px;\n height: 24px;\n\n svg {\n color: ", ";\n width: 24px;\n height: 24px;\n }\n"])), COLORS.neutral_700, COLORS.neutral_700);
|
|
37
|
+
export var StyledTableCellText = styled.span(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n padding: 12px 0;\n"])));
|
|
38
|
+
export var StyledTableFooter = styled.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n"])));
|
|
39
|
+
export var StyledTableFooterContent = styled.div(_templateObject19 || (_templateObject19 = _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);
|
|
40
|
+
export var StyledTableFooterCurrentInfo = styled.span(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n padding: 0 16px;\n ", "\n"])), ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black));
|
|
41
|
+
export var StyledTableFooterControls = styled.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
42
|
+
export var StyledTableSpinner = styled.div(_templateObject22 || (_templateObject22 = _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) {
|
|
49
43
|
var _props$zindex;
|
|
50
44
|
return (_props$zindex = props.zindex) !== null && _props$zindex !== void 0 ? _props$zindex : Z_INDEXES.loader;
|
|
51
45
|
});
|
|
52
|
-
export var StyledTableFooterCollapseButton = styled.button(
|
|
53
|
-
export var StyledTableBodyWrapper = styled.div(
|
|
46
|
+
export var StyledTableFooterCollapseButton = styled.button(_templateObject23 || (_templateObject23 = _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);
|
|
47
|
+
export var StyledTableBodyWrapper = styled.div(_templateObject24 || (_templateObject24 = _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));
|
|
54
48
|
//# 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","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;AA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A4B,GAAG3D,MAAM,CAAC4B,IAAI,wGAEnDpB,kBAAkB,CAACD,kBAAkB,CAAC2C,OAAO,EAAEjD,MAAM,CAACoB,KAAK,CAAC,CAC/D;AAED,OAAO,IAAMuC,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
|
+
{"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,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,sBAAsB,GAAGlB,MAAM,CAACa,GAAG,yEAC/C;AAED,OAAO,IAAMM,6BAA6B,GAAGnB,MAAM,CAACa,GAAG,sWAO1BZ,MAAM,CAACa,WAAW,EACrBb,MAAM,CAACa,WAAW,EAGxCV,iBAAiB,CAACG,kBAAkB,CAACa,IAAI,EAAEnB,MAAM,CAACoB,KAAK,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BnC,MAAM,CAACoC,WAAW,CAO9B;AAGD,OAAO,IAAMyB,sBAAsB,GAAG9D,MAAM,CAACa,GAAG,6OAE5CV,gBAAgB,CAACQ,IAAI,CAACoD,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
|
|
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\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
|
|
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\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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@laerdal/life-react-components",
|
|
3
|
-
"version": "3.2.1-dev.
|
|
3
|
+
"version": "3.2.1-dev.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Erik Martirosyan <erik.martirosyan@laerdal.com>",
|
|
6
6
|
"contributors": [],
|
|
@@ -67,7 +67,8 @@
|
|
|
67
67
|
"react-resize-detector": "^7.1.2",
|
|
68
68
|
"rooks": "^7.1.1",
|
|
69
69
|
"styled-components": "^5.3.5",
|
|
70
|
-
"typescript": "^4.8.2"
|
|
70
|
+
"typescript": "^4.8.2",
|
|
71
|
+
"react-quill": "^2.0.0"
|
|
71
72
|
},
|
|
72
73
|
"devDependencies": {
|
|
73
74
|
"@babel/cli": "^7.18.10",
|