@heliux-org/design-system-core 0.0.478-single-row-select-updates → 0.0.478-testBuild
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/ExpandedContent.js +1 -1
- package/dist/ExpandedContent.js.map +1 -1
- package/dist/Row.js +1 -1
- package/dist/Row.js.map +1 -1
- package/dist/components/CopyToClipboard/CopyToClipboard.js +27 -0
- package/dist/components/CopyToClipboard/CopyToClipboard.js.map +1 -0
- package/dist/components/NewTable/components/Row/InternalRowBase.js +1 -2
- package/dist/components/NewTable/components/Row/InternalRowBase.js.map +1 -1
- package/dist/esm/components/CopyToClipboard/CopyToClipboard.d.ts +11 -0
- package/dist/esm/components/CopyToClipboard/CopyToClipboard.d.ts.map +1 -0
- package/dist/esm/components/NewTable/components/Row/InternalRowBase.d.ts.map +1 -1
- package/dist/esm/src/components/NewTable/components/Row/InternalRowBase.js +1 -1
- package/dist/esm/src/components/NewTable/components/Row/InternalRowBase.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/mocked_classnames_esm/components/CopyToClipboard/CopyToClipboard.d.ts +11 -0
- package/dist/mocked_classnames_esm/components/CopyToClipboard/CopyToClipboard.d.ts.map +1 -0
- package/dist/mocked_classnames_esm/components/NewTable/components/Row/InternalRowBase.d.ts.map +1 -1
- package/dist/mocked_classnames_esm/src/components/NewTable/components/Row/InternalRowBase.js +1 -1
- package/dist/mocked_classnames_esm/src/components/NewTable/components/Row/InternalRowBase.js.map +1 -1
- package/dist/types/components/CopyToClipboard/CopyToClipboard.d.ts +11 -0
- package/dist/types/components/CopyToClipboard/CopyToClipboard.d.ts.map +1 -0
- package/dist/types/components/NewTable/components/Row/InternalRowBase.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/CopyToClipboard/CopyToClipboard.tsx +50 -0
- package/src/components/CopyToClipboard/__stories__/CopyToClipboard.mdx +21 -0
- package/src/components/CopyToClipboard/__stories__/CopyToClipboard.stories.tsx +12 -0
- package/src/components/NewTable/components/Row/InternalRowBase.tsx +1 -2
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
7
|
+
const Icon_1 = __importDefault(require("../Icon/Icon"));
|
8
|
+
const Tooltip_1 = __importDefault(require("../Tooltip/Tooltip"));
|
9
|
+
const react_1 = require("react");
|
10
|
+
const CopyToClipboard = ({ textToCopy = '', preCopyTooltipContent, postCopyTooltipMessage = 'Copied', onClick, resetDelayMs = 2000, }) => {
|
11
|
+
const [copied, setCopied] = (0, react_1.useState)(false);
|
12
|
+
(0, react_1.useEffect)(() => {
|
13
|
+
let timeout;
|
14
|
+
if (copied) {
|
15
|
+
timeout = setTimeout(() => setCopied(false), resetDelayMs);
|
16
|
+
}
|
17
|
+
return () => clearTimeout(timeout);
|
18
|
+
}, [copied, resetDelayMs]);
|
19
|
+
const handleCopy = () => {
|
20
|
+
navigator.clipboard.writeText(textToCopy);
|
21
|
+
setCopied(true);
|
22
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
23
|
+
};
|
24
|
+
return ((0, jsx_runtime_1.jsx)(Tooltip_1.default, Object.assign({ content: copied ? postCopyTooltipMessage : preCopyTooltipContent }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { icon: "", iconType: Icon_1.default.type.PATH, iconPath: copied ? "ic_checkmark_16" : "ic_view_double_24", customColor: copied ? "green" : undefined, clickable: !copied, onClick: !copied ? handleCopy : undefined }) })));
|
25
|
+
};
|
26
|
+
exports.default = CopyToClipboard;
|
27
|
+
//# sourceMappingURL=CopyToClipboard.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CopyToClipboard.js","sourceRoot":"","sources":["../../../src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O,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,GAC3C,IACI,CACb,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC"}
|
@@ -20,12 +20,11 @@ const Row_module_scss_1 = __importDefault(require("./Row.module.scss")); // Ensu
|
|
20
20
|
const RowContext_1 = require("./RowContext");
|
21
21
|
const InternalRowBase = (_a) => {
|
22
22
|
var { className, onClick } = _a, rest = __rest(_a, ["className", "onClick"]);
|
23
|
-
const { disabled
|
23
|
+
const { disabled } = (0, RowContext_1.useRowContext)();
|
24
24
|
// Assume that `theme` class (e.g., `theme-dark`, `theme-light`) is set on a higher-level component, like `<body>` or `<div id="root">`
|
25
25
|
return ((0, jsx_runtime_1.jsx)("tr", Object.assign({ onClick: onClick, "aria-disabled": disabled, tabIndex: onClick ? 0 : undefined, className: (0, classnames_1.default)({
|
26
26
|
[Row_module_scss_1.default.disabledRow]: disabled,
|
27
27
|
[Row_module_scss_1.default.clickableRow]: !!onClick,
|
28
|
-
[Row_module_scss_1.default.clickedRow]: isClicked,
|
29
28
|
}, className) }, rest)));
|
30
29
|
};
|
31
30
|
exports.default = InternalRowBase;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"InternalRowBase.js","sourceRoot":"","sources":["../../../../../src/components/NewTable/components/Row/InternalRowBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,4DAA4B;AAE5B,wEAAuC,CAAE,8BAA8B;AAEvE,6CAA6C;AAE7C,MAAM,eAAe,GAAG,CAAC,EAIF,EAAE,EAAE;QAJF,EACvB,SAAS,EACT,OAAO,OAEc,EADlB,IAAI,cAHgB,wBAIxB,CADQ;IAEP,MAAM,EAAE,QAAQ,EAAE,
|
1
|
+
{"version":3,"file":"InternalRowBase.js","sourceRoot":"","sources":["../../../../../src/components/NewTable/components/Row/InternalRowBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,4DAA4B;AAE5B,wEAAuC,CAAE,8BAA8B;AAEvE,6CAA6C;AAE7C,MAAM,eAAe,GAAG,CAAC,EAIF,EAAE,EAAE;QAJF,EACvB,SAAS,EACT,OAAO,OAEc,EADlB,IAAI,cAHgB,wBAIxB,CADQ;IAEP,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,0BAAa,GAAE,CAAC;IAErC,uIAAuI;IACvI,OAAO,CACL,6CACE,OAAO,EAAE,OAAO,mBACD,QAAQ,EACvB,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EACjC,SAAS,EAAE,IAAA,oBAAE,EACX;YACE,CAAC,yBAAM,CAAC,WAAW,CAAC,EAAE,QAAQ;YAC9B,CAAC,yBAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO;SACjC,EACD,SAAS,CACV,IACG,IAAI,EACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
type CopyToClipboardProps = {
|
3
|
+
textToCopy: string;
|
4
|
+
preCopyTooltipContent?: string;
|
5
|
+
postCopyTooltipMessage?: string;
|
6
|
+
onClick?: () => void;
|
7
|
+
resetDelayMs?: number;
|
8
|
+
};
|
9
|
+
declare const CopyToClipboard: React.FC<CopyToClipboardProps>;
|
10
|
+
export default CopyToClipboard;
|
11
|
+
//# sourceMappingURL=CopyToClipboard.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CopyToClipboard.d.ts","sourceRoot":"","sources":["../../../../src/components/CopyToClipboard/CopyToClipboard.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,KAAK,oBAAoB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoCnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"InternalRowBase.d.ts","sourceRoot":"","sources":["../../../../../../src/components/NewTable/components/Row/InternalRowBase.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,QAAA,MAAM,eAAe,oCAIlB,oBAAoB,
|
1
|
+
{"version":3,"file":"InternalRowBase.d.ts","sourceRoot":"","sources":["../../../../../../src/components/NewTable/components/Row/InternalRowBase.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,QAAA,MAAM,eAAe,oCAIlB,oBAAoB,qDAmBtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{defineProperty as o}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import{__rest as
|
1
|
+
import{defineProperty as o}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import{__rest as r}from"../../../../../_virtual/_tslib.js";import{jsx as s}from"@emotion/react/jsx-runtime";import a from"classnames";import e from"./Row.module.scss.js";import{useRowContext as i}from"./RowContext.js";var l=function(l){var t=l.className,m=l.onClick,n=r(l,["className","onClick"]),c=i().disabled;return s("tr",Object.assign({onClick:m,"aria-disabled":c,tabIndex:m?0:void 0,className:a(o(o({},e.disabledRow,c),e.clickableRow,!!m),t)},n))};export{l as default};
|
2
2
|
//# sourceMappingURL=InternalRowBase.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"InternalRowBase.js","sources":["../../../../../../../src/components/NewTable/components/Row/InternalRowBase.tsx"],"sourcesContent":["import React from 'react';\nimport cx from 'classnames';\n\nimport styles from './Row.module.scss'; // Ensure this path is correct\nimport { InternalRowBaseProps } from './Row.types';\nimport { useRowContext } from './RowContext';\n\nconst InternalRowBase = ({\n className,\n onClick,\n ...rest\n}: InternalRowBaseProps) => {\n const { disabled
|
1
|
+
{"version":3,"file":"InternalRowBase.js","sources":["../../../../../../../src/components/NewTable/components/Row/InternalRowBase.tsx"],"sourcesContent":["import React from 'react';\nimport cx from 'classnames';\n\nimport styles from './Row.module.scss'; // Ensure this path is correct\nimport { InternalRowBaseProps } from './Row.types';\nimport { useRowContext } from './RowContext';\n\nconst InternalRowBase = ({\n className,\n onClick,\n ...rest\n}: InternalRowBaseProps) => {\n const { disabled } = useRowContext();\n \n // Assume that `theme` class (e.g., `theme-dark`, `theme-light`) is set on a higher-level component, like `<body>` or `<div id=\"root\">`\n return (\n <tr\n onClick={onClick}\n aria-disabled={disabled}\n tabIndex={onClick ? 0 : undefined}\n className={cx(\n {\n [styles.disabledRow]: disabled,\n [styles.clickableRow]: !!onClick,\n },\n className,\n )}\n {...rest}\n />\n );\n};\n\nexport default InternalRowBase;\n"],"names":["InternalRowBase","_a","className","onClick","rest","__rest","disabled","useRowContext","_jsx","tabIndex","undefined","cx","_defineProperty","styles","disabledRow","clickableRow"],"mappings":"gTAOA,IAAMA,EAAkB,SAACC,OACvBC,EACOD,EADPC,UACAC,EAAOF,EAAPE,QACGC,EAAIC,EAAAJ,EAHgB,yBAKfK,EAAaC,IAAbD,SAGR,OACEE,sBACEL,QAASA,EACM,gBAAAG,EACfG,SAAUN,EAAU,OAAIO,EACxBR,UAAWS,EAAEC,EAAAA,EAAA,CAAA,EAERC,EAAOC,YAAcR,GACrBO,EAAOE,eAAiBZ,GAE3BD,IAEEE,GAGV"}
|