@pdg/react-table 1.0.38 → 1.0.40
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/InfoTable/InfoTable.style.d.ts +31 -1
- package/dist/InfoTable/InfoTable.types.d.ts +5 -1
- package/dist/index.esm.js +291 -18
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +290 -17
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
|
@@ -7,7 +7,7 @@ export declare const Label: import("@emotion/styled").StyledComponent<import("@m
|
|
|
7
7
|
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
8
8
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
9
9
|
}, ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "ref" | "children" | "component" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const ValueWrap: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
11
11
|
children?: import("react").ReactNode;
|
|
12
12
|
component?: import("react").ElementType<any> | undefined;
|
|
13
13
|
ref?: import("react").Ref<unknown> | undefined;
|
|
@@ -15,4 +15,34 @@ export declare const Value: import("@emotion/styled").StyledComponent<import("@m
|
|
|
15
15
|
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
16
16
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
17
17
|
}, ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "ref" | "children" | "component" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
18
|
+
export declare const Value: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
18
19
|
export declare const ValueEllipsis: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
20
|
+
export declare const ValueClipboard: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
21
|
+
export declare const ClipboardIconButton: import("@emotion/styled").StyledComponent<{
|
|
22
|
+
children?: import("react").ReactNode;
|
|
23
|
+
classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
|
|
24
|
+
color?: "inherit" | "default" | "primary" | "secondary" | "error" | "info" | "success" | "warning" | undefined;
|
|
25
|
+
disabled?: boolean | undefined;
|
|
26
|
+
disableFocusRipple?: boolean | undefined;
|
|
27
|
+
edge?: false | "end" | "start" | undefined;
|
|
28
|
+
size?: "small" | "medium" | "large" | undefined;
|
|
29
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
30
|
+
} & Omit<{
|
|
31
|
+
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
32
|
+
centerRipple?: boolean | undefined;
|
|
33
|
+
children?: import("react").ReactNode;
|
|
34
|
+
classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
|
|
35
|
+
disabled?: boolean | undefined;
|
|
36
|
+
disableRipple?: boolean | undefined;
|
|
37
|
+
disableTouchRipple?: boolean | undefined;
|
|
38
|
+
focusRipple?: boolean | undefined;
|
|
39
|
+
focusVisibleClassName?: string | undefined;
|
|
40
|
+
LinkComponent?: import("react").ElementType<any> | undefined;
|
|
41
|
+
onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
|
|
42
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
43
|
+
tabIndex?: number | undefined;
|
|
44
|
+
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
45
|
+
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
46
|
+
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
|
|
47
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
48
|
+
}, "color" | "tabIndex" | "children" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "size"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { BoxProps, GridProps, TypographyProps } from '@mui/material';
|
|
2
|
+
import { BoxProps, GridProps, IconButtonProps, TypographyProps } from '@mui/material';
|
|
3
3
|
import { CommonSxProps } from '../@types';
|
|
4
4
|
export interface InfoTableInfo {
|
|
5
5
|
[key: string]: any;
|
|
@@ -23,6 +23,10 @@ export interface InfoTableItem<T = InfoTableInfo> {
|
|
|
23
23
|
md?: number;
|
|
24
24
|
lg?: number;
|
|
25
25
|
xl?: number;
|
|
26
|
+
clipboard?: boolean;
|
|
27
|
+
clipboardIcon?: string;
|
|
28
|
+
clipboardText?: string;
|
|
29
|
+
clipboardProps?: Omit<IconButtonProps, 'children'>;
|
|
26
30
|
onRender?(info: T): ReactNode;
|
|
27
31
|
onRenderEmpty?(info: T): ReactNode;
|
|
28
32
|
}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as React from'react';import React__default,{useRef,useEffect,cloneElement,useState,isValidElement,createRef,PureComponent,useLayoutEffect,createContext,useContext,useMemo,useCallback,useId}from'react';import {styled,TableRow,lighten,TableCell,Box,Checkbox,Tooltip,Stack,Pagination,Paper,Table as Table$1,TableHead,TableBody,Icon,TableFooter,Grid,Button,Popper,Grow,ClickAwayListener}from'@mui/material';import {findDOMNode}from'react-dom';import {useSortable,sortableKeyboardCoordinates,arrayMove,SortableContext,verticalListSortingStrategy}from'@dnd-kit/sortable';import dayjs from'dayjs';import {useSensors,useSensor,MouseSensor,TouchSensor,KeyboardSensor,DndContext,closestCenter}from'@dnd-kit/core';import {Search,SearchGroup,FormHidden}from'@pdg/react-form';/******************************************************************************
|
|
1
|
+
import*as React from'react';import React__default,{useRef,useEffect,cloneElement,useState,isValidElement,createRef,PureComponent,useLayoutEffect,createContext,useContext,useMemo,useCallback,useId}from'react';import {styled,TableRow,lighten,TableCell,Box,Checkbox,Tooltip,Stack,Pagination,Paper,Table as Table$1,TableHead,TableBody,Icon,TableFooter,Grid,Button,Popper,Grow,ClickAwayListener,IconButton}from'@mui/material';import {findDOMNode}from'react-dom';import {useSortable,sortableKeyboardCoordinates,arrayMove,SortableContext,verticalListSortingStrategy}from'@dnd-kit/sortable';import dayjs from'dayjs';import {useSensors,useSensor,MouseSensor,TouchSensor,KeyboardSensor,DndContext,closestCenter}from'@dnd-kit/core';import {Search,SearchGroup,FormHidden}from'@pdg/react-form';/******************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -2025,17 +2025,17 @@ var anObject$b = anObject$d;
|
|
|
2025
2025
|
var concat$2 = uncurryThis$h([].concat);
|
|
2026
2026
|
|
|
2027
2027
|
// all object keys, includes non-enumerable and symbols
|
|
2028
|
-
var ownKeys$
|
|
2028
|
+
var ownKeys$3 = getBuiltIn$2('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
2029
2029
|
var keys = getOwnPropertyNamesModule$1.f(anObject$b(it));
|
|
2030
2030
|
var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
|
|
2031
2031
|
return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
|
|
2032
2032
|
};var hasOwn$4 = hasOwnProperty_1;
|
|
2033
|
-
var ownKeys$
|
|
2033
|
+
var ownKeys$2 = ownKeys$3;
|
|
2034
2034
|
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
|
2035
2035
|
var definePropertyModule$2 = objectDefineProperty;
|
|
2036
2036
|
|
|
2037
2037
|
var copyConstructorProperties$1 = function (target, source, exceptions) {
|
|
2038
|
-
var keys = ownKeys$
|
|
2038
|
+
var keys = ownKeys$2(source);
|
|
2039
2039
|
var defineProperty = definePropertyModule$2.f;
|
|
2040
2040
|
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
2041
2041
|
for (var i = 0; i < keys.length; i++) {
|
|
@@ -7151,7 +7151,7 @@ SimpleBar$1.instances = new WeakMap();/**
|
|
|
7151
7151
|
* Under MIT License
|
|
7152
7152
|
*/
|
|
7153
7153
|
|
|
7154
|
-
function ownKeys(object, enumerableOnly) {
|
|
7154
|
+
function ownKeys$1(object, enumerableOnly) {
|
|
7155
7155
|
var keys = Object.keys(object);
|
|
7156
7156
|
|
|
7157
7157
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -7167,9 +7167,9 @@ function ownKeys(object, enumerableOnly) {
|
|
|
7167
7167
|
function _objectSpread2(target) {
|
|
7168
7168
|
for (var i = 1; i < arguments.length; i++) {
|
|
7169
7169
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
7170
|
-
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
7171
|
-
_defineProperty(target, key, source[key]);
|
|
7172
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
7170
|
+
i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
|
|
7171
|
+
_defineProperty$1(target, key, source[key]);
|
|
7172
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) {
|
|
7173
7173
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
7174
7174
|
});
|
|
7175
7175
|
}
|
|
@@ -7177,7 +7177,7 @@ function _objectSpread2(target) {
|
|
|
7177
7177
|
return target;
|
|
7178
7178
|
}
|
|
7179
7179
|
|
|
7180
|
-
function _defineProperty(obj, key, value) {
|
|
7180
|
+
function _defineProperty$1(obj, key, value) {
|
|
7181
7181
|
if (key in obj) {
|
|
7182
7182
|
Object.defineProperty(obj, key, {
|
|
7183
7183
|
value: value,
|
|
@@ -7210,7 +7210,7 @@ function _extends() {
|
|
|
7210
7210
|
return _extends.apply(this, arguments);
|
|
7211
7211
|
}
|
|
7212
7212
|
|
|
7213
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
7213
|
+
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
7214
7214
|
if (source == null) return {};
|
|
7215
7215
|
var target = {};
|
|
7216
7216
|
var sourceKeys = Object.keys(source);
|
|
@@ -7225,10 +7225,10 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
7225
7225
|
return target;
|
|
7226
7226
|
}
|
|
7227
7227
|
|
|
7228
|
-
function _objectWithoutProperties(source, excluded) {
|
|
7228
|
+
function _objectWithoutProperties$1(source, excluded) {
|
|
7229
7229
|
if (source == null) return {};
|
|
7230
7230
|
|
|
7231
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
7231
|
+
var target = _objectWithoutPropertiesLoose$1(source, excluded);
|
|
7232
7232
|
|
|
7233
7233
|
var key, i;
|
|
7234
7234
|
|
|
@@ -7246,7 +7246,7 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
7246
7246
|
return target;
|
|
7247
7247
|
}
|
|
7248
7248
|
|
|
7249
|
-
var _excluded = ["children", "scrollableNodeProps", "tag"];
|
|
7249
|
+
var _excluded$1 = ["children", "scrollableNodeProps", "tag"];
|
|
7250
7250
|
/* Deprecated
|
|
7251
7251
|
* Hardcore this here until we can safely deprecated it.
|
|
7252
7252
|
* Helper function to retrieve options from element attributes
|
|
@@ -7290,7 +7290,7 @@ var SimpleBar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
7290
7290
|
scrollableNodeProps = _ref$scrollableNodePr === void 0 ? {} : _ref$scrollableNodePr,
|
|
7291
7291
|
_ref$tag = _ref.tag,
|
|
7292
7292
|
tag = _ref$tag === void 0 ? 'div' : _ref$tag,
|
|
7293
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
7293
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$1);
|
|
7294
7294
|
|
|
7295
7295
|
var RootTag = tag;
|
|
7296
7296
|
var instance;
|
|
@@ -9832,9 +9832,276 @@ TableMenuButton.defaultProps = TableMenuButtonDefaultProps;var InfoTableDefaultP
|
|
|
9832
9832
|
spacing: 2,
|
|
9833
9833
|
labelColor: 'primary',
|
|
9834
9834
|
};var Label = styled(Box)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: 12px;\n font-weight: bold;\n"], ["\n font-size: 12px;\n font-weight: bold;\n"])));
|
|
9835
|
-
var
|
|
9836
|
-
var
|
|
9837
|
-
var
|
|
9835
|
+
var ValueWrap = styled(Box)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-top: 3px;\n position: relative;\n display: flex;\n flex-direction: row;\n"], ["\n margin-top: 3px;\n position: relative;\n display: flex;\n flex-direction: row;\n"])));
|
|
9836
|
+
var Value = styled('div')(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex: 1;\n"], ["\n flex: 1;\n"])));
|
|
9837
|
+
var ValueEllipsis = styled('div')(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 1;\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"], ["\n flex: 1;\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));
|
|
9838
|
+
var ValueClipboard = styled('div')(templateObject_5 || (templateObject_5 = __makeTemplateObject([""], [""])));
|
|
9839
|
+
var ClipboardIconButton = styled(IconButton)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin-top: -10px;\n margin-bottom: -10px;\n"], ["\n margin-top: -10px;\n margin-bottom: -10px;\n"])));
|
|
9840
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;var Component = {};var toggleSelection = function () {
|
|
9841
|
+
var selection = document.getSelection();
|
|
9842
|
+
if (!selection.rangeCount) {
|
|
9843
|
+
return function () {};
|
|
9844
|
+
}
|
|
9845
|
+
var active = document.activeElement;
|
|
9846
|
+
|
|
9847
|
+
var ranges = [];
|
|
9848
|
+
for (var i = 0; i < selection.rangeCount; i++) {
|
|
9849
|
+
ranges.push(selection.getRangeAt(i));
|
|
9850
|
+
}
|
|
9851
|
+
|
|
9852
|
+
switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML
|
|
9853
|
+
case 'INPUT':
|
|
9854
|
+
case 'TEXTAREA':
|
|
9855
|
+
active.blur();
|
|
9856
|
+
break;
|
|
9857
|
+
|
|
9858
|
+
default:
|
|
9859
|
+
active = null;
|
|
9860
|
+
break;
|
|
9861
|
+
}
|
|
9862
|
+
|
|
9863
|
+
selection.removeAllRanges();
|
|
9864
|
+
return function () {
|
|
9865
|
+
selection.type === 'Caret' &&
|
|
9866
|
+
selection.removeAllRanges();
|
|
9867
|
+
|
|
9868
|
+
if (!selection.rangeCount) {
|
|
9869
|
+
ranges.forEach(function(range) {
|
|
9870
|
+
selection.addRange(range);
|
|
9871
|
+
});
|
|
9872
|
+
}
|
|
9873
|
+
|
|
9874
|
+
active &&
|
|
9875
|
+
active.focus();
|
|
9876
|
+
};
|
|
9877
|
+
};var deselectCurrent = toggleSelection;
|
|
9878
|
+
|
|
9879
|
+
var clipboardToIE11Formatting = {
|
|
9880
|
+
"text/plain": "Text",
|
|
9881
|
+
"text/html": "Url",
|
|
9882
|
+
"default": "Text"
|
|
9883
|
+
};
|
|
9884
|
+
|
|
9885
|
+
var defaultMessage = "Copy to clipboard: #{key}, Enter";
|
|
9886
|
+
|
|
9887
|
+
function format(message) {
|
|
9888
|
+
var copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
|
|
9889
|
+
return message.replace(/#{\s*key\s*}/g, copyKey);
|
|
9890
|
+
}
|
|
9891
|
+
|
|
9892
|
+
function copy(text, options) {
|
|
9893
|
+
var debug,
|
|
9894
|
+
message,
|
|
9895
|
+
reselectPrevious,
|
|
9896
|
+
range,
|
|
9897
|
+
selection,
|
|
9898
|
+
mark,
|
|
9899
|
+
success = false;
|
|
9900
|
+
if (!options) {
|
|
9901
|
+
options = {};
|
|
9902
|
+
}
|
|
9903
|
+
debug = options.debug || false;
|
|
9904
|
+
try {
|
|
9905
|
+
reselectPrevious = deselectCurrent();
|
|
9906
|
+
|
|
9907
|
+
range = document.createRange();
|
|
9908
|
+
selection = document.getSelection();
|
|
9909
|
+
|
|
9910
|
+
mark = document.createElement("span");
|
|
9911
|
+
mark.textContent = text;
|
|
9912
|
+
// avoid screen readers from reading out loud the text
|
|
9913
|
+
mark.ariaHidden = "true";
|
|
9914
|
+
// reset user styles for span element
|
|
9915
|
+
mark.style.all = "unset";
|
|
9916
|
+
// prevents scrolling to the end of the page
|
|
9917
|
+
mark.style.position = "fixed";
|
|
9918
|
+
mark.style.top = 0;
|
|
9919
|
+
mark.style.clip = "rect(0, 0, 0, 0)";
|
|
9920
|
+
// used to preserve spaces and line breaks
|
|
9921
|
+
mark.style.whiteSpace = "pre";
|
|
9922
|
+
// do not inherit user-select (it may be `none`)
|
|
9923
|
+
mark.style.webkitUserSelect = "text";
|
|
9924
|
+
mark.style.MozUserSelect = "text";
|
|
9925
|
+
mark.style.msUserSelect = "text";
|
|
9926
|
+
mark.style.userSelect = "text";
|
|
9927
|
+
mark.addEventListener("copy", function(e) {
|
|
9928
|
+
e.stopPropagation();
|
|
9929
|
+
if (options.format) {
|
|
9930
|
+
e.preventDefault();
|
|
9931
|
+
if (typeof e.clipboardData === "undefined") { // IE 11
|
|
9932
|
+
debug && console.warn("unable to use e.clipboardData");
|
|
9933
|
+
debug && console.warn("trying IE specific stuff");
|
|
9934
|
+
window.clipboardData.clearData();
|
|
9935
|
+
var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"];
|
|
9936
|
+
window.clipboardData.setData(format, text);
|
|
9937
|
+
} else { // all other browsers
|
|
9938
|
+
e.clipboardData.clearData();
|
|
9939
|
+
e.clipboardData.setData(options.format, text);
|
|
9940
|
+
}
|
|
9941
|
+
}
|
|
9942
|
+
if (options.onCopy) {
|
|
9943
|
+
e.preventDefault();
|
|
9944
|
+
options.onCopy(e.clipboardData);
|
|
9945
|
+
}
|
|
9946
|
+
});
|
|
9947
|
+
|
|
9948
|
+
document.body.appendChild(mark);
|
|
9949
|
+
|
|
9950
|
+
range.selectNodeContents(mark);
|
|
9951
|
+
selection.addRange(range);
|
|
9952
|
+
|
|
9953
|
+
var successful = document.execCommand("copy");
|
|
9954
|
+
if (!successful) {
|
|
9955
|
+
throw new Error("copy command was unsuccessful");
|
|
9956
|
+
}
|
|
9957
|
+
success = true;
|
|
9958
|
+
} catch (err) {
|
|
9959
|
+
debug && console.error("unable to copy using execCommand: ", err);
|
|
9960
|
+
debug && console.warn("trying IE specific stuff");
|
|
9961
|
+
try {
|
|
9962
|
+
window.clipboardData.setData(options.format || "text", text);
|
|
9963
|
+
options.onCopy && options.onCopy(window.clipboardData);
|
|
9964
|
+
success = true;
|
|
9965
|
+
} catch (err) {
|
|
9966
|
+
debug && console.error("unable to copy using clipboardData: ", err);
|
|
9967
|
+
debug && console.error("falling back to prompt");
|
|
9968
|
+
message = format("message" in options ? options.message : defaultMessage);
|
|
9969
|
+
window.prompt(message, text);
|
|
9970
|
+
}
|
|
9971
|
+
} finally {
|
|
9972
|
+
if (selection) {
|
|
9973
|
+
if (typeof selection.removeRange == "function") {
|
|
9974
|
+
selection.removeRange(range);
|
|
9975
|
+
} else {
|
|
9976
|
+
selection.removeAllRanges();
|
|
9977
|
+
}
|
|
9978
|
+
}
|
|
9979
|
+
|
|
9980
|
+
if (mark) {
|
|
9981
|
+
document.body.removeChild(mark);
|
|
9982
|
+
}
|
|
9983
|
+
reselectPrevious();
|
|
9984
|
+
}
|
|
9985
|
+
|
|
9986
|
+
return success;
|
|
9987
|
+
}
|
|
9988
|
+
|
|
9989
|
+
var copyToClipboard = copy;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
9990
|
+
|
|
9991
|
+
Object.defineProperty(Component, "__esModule", {
|
|
9992
|
+
value: true
|
|
9993
|
+
});
|
|
9994
|
+
Component.CopyToClipboard = void 0;
|
|
9995
|
+
|
|
9996
|
+
var _react = _interopRequireDefault(React__default);
|
|
9997
|
+
|
|
9998
|
+
var _copyToClipboard = _interopRequireDefault(copyToClipboard);
|
|
9999
|
+
|
|
10000
|
+
var _excluded = ["text", "onCopy", "options", "children"];
|
|
10001
|
+
|
|
10002
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10003
|
+
|
|
10004
|
+
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; }
|
|
10005
|
+
|
|
10006
|
+
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; }
|
|
10007
|
+
|
|
10008
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10009
|
+
|
|
10010
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10011
|
+
|
|
10012
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10013
|
+
|
|
10014
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
10015
|
+
|
|
10016
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10017
|
+
|
|
10018
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10019
|
+
|
|
10020
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
10021
|
+
|
|
10022
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10023
|
+
|
|
10024
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
10025
|
+
|
|
10026
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
10027
|
+
|
|
10028
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10029
|
+
|
|
10030
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
10031
|
+
|
|
10032
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10033
|
+
|
|
10034
|
+
var CopyToClipboard$1 = /*#__PURE__*/function (_React$PureComponent) {
|
|
10035
|
+
_inherits(CopyToClipboard, _React$PureComponent);
|
|
10036
|
+
|
|
10037
|
+
var _super = _createSuper(CopyToClipboard);
|
|
10038
|
+
|
|
10039
|
+
function CopyToClipboard() {
|
|
10040
|
+
var _this;
|
|
10041
|
+
|
|
10042
|
+
_classCallCheck(this, CopyToClipboard);
|
|
10043
|
+
|
|
10044
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10045
|
+
args[_key] = arguments[_key];
|
|
10046
|
+
}
|
|
10047
|
+
|
|
10048
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
10049
|
+
|
|
10050
|
+
_defineProperty(_assertThisInitialized(_this), "onClick", function (event) {
|
|
10051
|
+
var _this$props = _this.props,
|
|
10052
|
+
text = _this$props.text,
|
|
10053
|
+
onCopy = _this$props.onCopy,
|
|
10054
|
+
children = _this$props.children,
|
|
10055
|
+
options = _this$props.options;
|
|
10056
|
+
|
|
10057
|
+
var elem = _react["default"].Children.only(children);
|
|
10058
|
+
|
|
10059
|
+
var result = (0, _copyToClipboard["default"])(text, options);
|
|
10060
|
+
|
|
10061
|
+
if (onCopy) {
|
|
10062
|
+
onCopy(text, result);
|
|
10063
|
+
} // Bypass onClick if it was present
|
|
10064
|
+
|
|
10065
|
+
|
|
10066
|
+
if (elem && elem.props && typeof elem.props.onClick === 'function') {
|
|
10067
|
+
elem.props.onClick(event);
|
|
10068
|
+
}
|
|
10069
|
+
});
|
|
10070
|
+
|
|
10071
|
+
return _this;
|
|
10072
|
+
}
|
|
10073
|
+
|
|
10074
|
+
_createClass(CopyToClipboard, [{
|
|
10075
|
+
key: "render",
|
|
10076
|
+
value: function render() {
|
|
10077
|
+
var _this$props2 = this.props;
|
|
10078
|
+
_this$props2.text;
|
|
10079
|
+
_this$props2.onCopy;
|
|
10080
|
+
_this$props2.options;
|
|
10081
|
+
var children = _this$props2.children,
|
|
10082
|
+
props = _objectWithoutProperties(_this$props2, _excluded);
|
|
10083
|
+
|
|
10084
|
+
var elem = _react["default"].Children.only(children);
|
|
10085
|
+
|
|
10086
|
+
return /*#__PURE__*/_react["default"].cloneElement(elem, _objectSpread(_objectSpread({}, props), {}, {
|
|
10087
|
+
onClick: this.onClick
|
|
10088
|
+
}));
|
|
10089
|
+
}
|
|
10090
|
+
}]);
|
|
10091
|
+
|
|
10092
|
+
return CopyToClipboard;
|
|
10093
|
+
}(_react["default"].PureComponent);
|
|
10094
|
+
|
|
10095
|
+
Component.CopyToClipboard = CopyToClipboard$1;
|
|
10096
|
+
|
|
10097
|
+
_defineProperty(CopyToClipboard$1, "defaultProps", {
|
|
10098
|
+
onCopy: undefined,
|
|
10099
|
+
options: undefined
|
|
10100
|
+
});var _require = Component,
|
|
10101
|
+
CopyToClipboard = _require.CopyToClipboard;
|
|
10102
|
+
|
|
10103
|
+
CopyToClipboard.CopyToClipboard = CopyToClipboard;
|
|
10104
|
+
var lib = CopyToClipboard;var InfoTable = function (_a) {
|
|
9838
10105
|
var cols = _a.cols, spacing = _a.spacing, className = _a.className, style = _a.style, sx = _a.sx, labelClassName = _a.labelClassName, labelColor = _a.labelColor, labelStyle = _a.labelStyle, labelSx = _a.labelSx, valueClassName = _a.valueClassName, valueStyle = _a.valueStyle, valueSx = _a.valueSx, ellipsis = _a.ellipsis, valueUnderline = _a.valueUnderline, info = _a.info, items = _a.items;
|
|
9839
10106
|
var sizeProps = useMemo(function () {
|
|
9840
10107
|
var value = {};
|
|
@@ -9879,9 +10146,15 @@ var templateObject_1, templateObject_2, templateObject_3;var InfoTable = functio
|
|
|
9879
10146
|
data = item.onRender(info);
|
|
9880
10147
|
if (empty(data))
|
|
9881
10148
|
data = item.onRenderEmpty ? item.onRenderEmpty(info) : React__default.createElement(React__default.Fragment, null, "\u00A0");
|
|
10149
|
+
var copyToClipboardText = item.clipboardText || (typeof data === 'string' ? data : '');
|
|
9882
10150
|
return (React__default.createElement(Grid, __assign$1({ key: idx, item: true }, finalSizeProps, { className: item.className, style: item.style, sx: item.sx }),
|
|
9883
10151
|
React__default.createElement(Label, { className: classNames(labelClassName, item.labelClassName), style: __assign$1(__assign$1({}, item.labelStyle), labelStyle), sx: finalLabelSx }, item.label),
|
|
9884
|
-
React__default.createElement(
|
|
10152
|
+
React__default.createElement(ValueWrap, { className: classNames(valueClassName, item.valueClassName), style: __assign$1(__assign$1(__assign$1({}, valueStyle), item.valueStyle), valueUnderlineStyle), sx: finalValueSx },
|
|
10153
|
+
item.ellipsis || ellipsis ? React__default.createElement(ValueEllipsis, null, data) : React__default.createElement(Value, null, data),
|
|
10154
|
+
item.clipboard && notEmpty(copyToClipboardText) && (React__default.createElement(ValueClipboard, null,
|
|
10155
|
+
React__default.createElement(lib.CopyToClipboard, { text: copyToClipboardText },
|
|
10156
|
+
React__default.createElement(ClipboardIconButton, __assign$1({ size: 'small', color: 'primary' }, item.clipboardProps),
|
|
10157
|
+
React__default.createElement(TableIcon, null, item.clipboardIcon || 'ContentPaste'))))))));
|
|
9885
10158
|
}
|
|
9886
10159
|
})));
|
|
9887
10160
|
};
|