@pingux/astro 2.112.0-alpha.1 → 2.112.0-alpha.3
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/lib/cjs/components/AIComponents/Response/Response.stories.js +24 -24
- package/lib/cjs/components/AIComponents/Response/Response.test.jsx +40 -70
- package/lib/cjs/components/AIComponents/Response/ResponseAttachment.js +3 -2
- package/lib/cjs/components/AIComponents/Response/ResponseToolbar.js +23 -35
- package/lib/cjs/components/AIComponents/Response/ResponseToolbarIcon.d.ts +4 -0
- package/lib/cjs/components/AIComponents/Response/ResponseToolbarIcon.js +57 -0
- package/lib/cjs/components/AIComponents/Response/index.d.ts +1 -0
- package/lib/cjs/components/AIComponents/Response/index.js +8 -1
- package/lib/cjs/components/DataTable/DataTable.js +9 -1
- package/lib/cjs/components/DataTable/DataTable.stories.js +23 -16
- package/lib/cjs/components/DataTable/DataTable.styles.d.ts +7 -1
- package/lib/cjs/components/DataTable/DataTable.styles.js +10 -2
- package/lib/cjs/components/DataTable/DataTableBadge.js +5 -32
- package/lib/cjs/components/DataTable/DataTableBadge.test.js +0 -2
- package/lib/cjs/components/Loader/Loader.js +6 -5
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +8 -0
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +33 -0
- package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +33 -0
- package/lib/cjs/styles/themes/next-gen/variants/button.js +6 -0
- package/lib/cjs/types/loader.d.ts +2 -0
- package/lib/cjs/types/response.d.ts +10 -3
- package/lib/components/AIComponents/Response/Response.stories.js +24 -24
- package/lib/components/AIComponents/Response/Response.test.jsx +40 -70
- package/lib/components/AIComponents/Response/ResponseAttachment.js +3 -2
- package/lib/components/AIComponents/Response/ResponseToolbar.js +25 -37
- package/lib/components/AIComponents/Response/ResponseToolbarIcon.js +43 -0
- package/lib/components/AIComponents/Response/index.js +2 -1
- package/lib/components/DataTable/DataTable.js +9 -1
- package/lib/components/DataTable/DataTable.stories.js +23 -16
- package/lib/components/DataTable/DataTable.styles.js +10 -2
- package/lib/components/DataTable/DataTableBadge.js +6 -33
- package/lib/components/DataTable/DataTableBadge.test.js +0 -2
- package/lib/components/Loader/Loader.js +6 -5
- package/lib/index.js +1 -0
- package/lib/styles/themes/next-gen/variants/button.js +6 -0
- package/package.json +1 -1
@@ -7,6 +7,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
7
7
|
});
|
8
8
|
exports["default"] = exports.Default = void 0;
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
10
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
10
11
|
var _react = _interopRequireDefault(require("react"));
|
11
12
|
var _ContentCopyIcon = _interopRequireDefault(require("@pingux/mdi-react/ContentCopyIcon"));
|
12
13
|
var _TextIcon = _interopRequireDefault(require("@pingux/mdi-react/TextIcon"));
|
@@ -19,6 +20,7 @@ var _ResponseAttachment = _interopRequireDefault(require("./ResponseAttachment")
|
|
19
20
|
var _ResponseList = _interopRequireDefault(require("./ResponseList"));
|
20
21
|
var _ResponseText = _interopRequireDefault(require("./ResponseText"));
|
21
22
|
var _ResponseToolbar = _interopRequireDefault(require("./ResponseToolbar"));
|
23
|
+
var _ResponseToolbarIcon = _interopRequireDefault(require("./ResponseToolbarIcon"));
|
22
24
|
var _react2 = require("@emotion/react");
|
23
25
|
var _default = {
|
24
26
|
title: 'Ai Components/Response',
|
@@ -27,28 +29,22 @@ var _default = {
|
|
27
29
|
exports["default"] = _default;
|
28
30
|
var testText = 'Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet';
|
29
31
|
var Default = function Default(args) {
|
30
|
-
var
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
},
|
47
|
-
rephraseButtonProps: {
|
48
|
-
title: 'Rephrase Answer',
|
49
|
-
icon: _TextIcon["default"]
|
50
|
-
}
|
51
|
-
};
|
32
|
+
var icons = [{
|
33
|
+
title: 'Read aloud',
|
34
|
+
icon: _VolumeHighIcon["default"]
|
35
|
+
}, {
|
36
|
+
title: 'Copy',
|
37
|
+
icon: _ContentCopyIcon["default"]
|
38
|
+
}, {
|
39
|
+
title: 'Good Response',
|
40
|
+
icon: _ThumbUpOutlineIcon["default"]
|
41
|
+
}, {
|
42
|
+
title: 'Bad Response',
|
43
|
+
icon: _ThumbDownOutlineIcon["default"]
|
44
|
+
}, {
|
45
|
+
title: 'Rephrase Answer',
|
46
|
+
icon: _TextIcon["default"]
|
47
|
+
}];
|
52
48
|
var delay = 20;
|
53
49
|
return (0, _react2.jsx)(_.AstroWrapper, (0, _extends2["default"])({}, args, {
|
54
50
|
themeOverrides: [_.NextGenTheme]
|
@@ -56,7 +52,9 @@ var Default = function Default(args) {
|
|
56
52
|
delay: delay
|
57
53
|
}, (0, _react2.jsx)(_ResponseText["default"], {
|
58
54
|
text: testText
|
59
|
-
}), (0, _react2.jsx)(_ResponseAttachment["default"],
|
55
|
+
}), (0, _react2.jsx)(_ResponseAttachment["default"], {
|
56
|
+
text: "Attachment Text"
|
57
|
+
}), (0, _react2.jsx)(_ResponseText["default"], {
|
60
58
|
text: testText
|
61
59
|
}), (0, _react2.jsx)(_ResponseText["default"], {
|
62
60
|
text: testText
|
@@ -77,6 +75,8 @@ var Default = function Default(args) {
|
|
77
75
|
text: "list item 3"
|
78
76
|
})), (0, _react2.jsx)(_ResponseText["default"], {
|
79
77
|
text: "follow up text"
|
80
|
-
}), (0, _react2.jsx)(_ResponseToolbar["default"],
|
78
|
+
}), (0, _react2.jsx)(_ResponseToolbar["default"], null, (0, _map["default"])(icons).call(icons, function (icon) {
|
79
|
+
return (0, _react2.jsx)(_ResponseToolbarIcon["default"], icon);
|
80
|
+
}))));
|
81
81
|
};
|
82
82
|
exports.Default = Default;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
2
|
+
import CopyIcon from '@pingux/mdi-react/ContentCopyIcon';
|
3
|
+
import TextIcon from '@pingux/mdi-react/TextIcon';
|
4
|
+
import ThumbDownOutlineIcon from '@pingux/mdi-react/ThumbDownOutlineIcon';
|
5
|
+
import ThumbUpOutlineIcon from '@pingux/mdi-react/ThumbUpOutlineIcon';
|
6
|
+
import VolumeHighIcon from '@pingux/mdi-react/VolumeHighIcon';
|
7
7
|
|
8
8
|
import { act, render, screen } from '../../../utils/testUtils/testWrapper';
|
9
9
|
|
@@ -12,6 +12,7 @@ import ResponseAttachment from './ResponseAttachment';
|
|
12
12
|
import ResponseList from './ResponseList';
|
13
13
|
import ResponseText from './ResponseText';
|
14
14
|
import ResponseToolbar from './ResponseToolbar';
|
15
|
+
import ResponseToolBarIcon from './ResponseToolbarIcon';
|
15
16
|
|
16
17
|
const delay = 100;
|
17
18
|
|
@@ -24,28 +25,24 @@ const nextText = 'nextText';
|
|
24
25
|
const attachmentWrapperId = 'wrapper-id';
|
25
26
|
const toolbarId = 'id';
|
26
27
|
|
27
|
-
const
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
title: 'Rephrase Answer test',
|
46
|
-
icon: TagIcon,
|
47
|
-
},
|
48
|
-
};
|
28
|
+
const attachmentText = 'Attachment Text';
|
29
|
+
|
30
|
+
const icons = [{
|
31
|
+
title: 'Read aloud test',
|
32
|
+
icon: VolumeHighIcon,
|
33
|
+
}, {
|
34
|
+
title: 'Copy test',
|
35
|
+
icon: CopyIcon,
|
36
|
+
}, {
|
37
|
+
title: 'Good Response test',
|
38
|
+
icon: ThumbUpOutlineIcon,
|
39
|
+
}, {
|
40
|
+
title: 'Bad Response test',
|
41
|
+
icon: ThumbDownOutlineIcon,
|
42
|
+
}, {
|
43
|
+
title: 'Rephrase Answer test',
|
44
|
+
icon: TextIcon,
|
45
|
+
}];
|
49
46
|
|
50
47
|
const defaultProps = {
|
51
48
|
containerProps: {
|
@@ -80,25 +77,25 @@ const getComponentWithList = props => render(
|
|
80
77
|
const getComponentWithToolbar = props => render(
|
81
78
|
<Response {...defaultProps} {...props}>
|
82
79
|
<ResponseText text={defaultProps.text} />
|
83
|
-
<ResponseToolbar data-testid={toolbarId}
|
80
|
+
<ResponseToolbar data-testid={toolbarId}>
|
81
|
+
{icons.map(icon => {
|
82
|
+
return (
|
83
|
+
<ResponseToolBarIcon key={icon.title} {...icon} />
|
84
|
+
);
|
85
|
+
})}
|
86
|
+
</ResponseToolbar>
|
87
|
+
<ResponseText text={defaultProps.text} />
|
84
88
|
</Response>,
|
85
89
|
);
|
86
90
|
|
87
91
|
const getComponentWithAttachment = props => render(
|
88
92
|
<Response {...defaultProps} {...props}>
|
89
93
|
<ResponseText text={defaultProps.text} />
|
90
|
-
<ResponseAttachment wrapperProps={{ 'data-testid': attachmentWrapperId }} />
|
94
|
+
<ResponseAttachment text={attachmentText} wrapperProps={{ 'data-testid': attachmentWrapperId }} />
|
91
95
|
<ResponseText text={defaultProps.text} />
|
92
96
|
</Response>,
|
93
97
|
);
|
94
98
|
|
95
|
-
const getComponentWithToolbarCustomProps = props => render(
|
96
|
-
<Response {...defaultProps} {...props}>
|
97
|
-
<ResponseText text={defaultProps.text} />
|
98
|
-
<ResponseToolbar data-testid={toolbarId} {...customProps} />
|
99
|
-
</Response>,
|
100
|
-
);
|
101
|
-
|
102
99
|
test('component renders', () => {
|
103
100
|
getComponent();
|
104
101
|
const container = screen.getByTestId('container');
|
@@ -166,13 +163,19 @@ test('ResponseToolbar renders correctly', async () => {
|
|
166
163
|
act(() => { jest.advanceTimersByTime(100); });
|
167
164
|
}
|
168
165
|
expect(toolbar).not.toHaveClass('is-not-loaded');
|
166
|
+
for (let i = 1; i < icons.length + 1; i += 1) {
|
167
|
+
act(() => { jest.advanceTimersByTime(100); });
|
168
|
+
expect(screen.getByTitle(icons[i - 1].title)).toBeInTheDocument();
|
169
|
+
expect(screen.getByTitle(icons[i - 1].title)).not.toHaveClass('is-not-loaded');
|
170
|
+
}
|
171
|
+
act(() => { jest.advanceTimersByTime(2000); });
|
169
172
|
});
|
170
173
|
|
171
174
|
test('ResponseAttachment renders correctly', async () => {
|
172
175
|
getComponentWithAttachment();
|
173
176
|
act(() => { jest.advanceTimersByTime(10); });
|
174
177
|
|
175
|
-
expect(screen.getByText(
|
178
|
+
expect(screen.getByText(attachmentText)).toBeInTheDocument();
|
176
179
|
const wrapper = screen.getByTestId(attachmentWrapperId);
|
177
180
|
expect(wrapper).toHaveClass('is-not-loaded');
|
178
181
|
for (let i = 1; i < defaultProps.text.length + 1; i += 1) {
|
@@ -180,36 +183,3 @@ test('ResponseAttachment renders correctly', async () => {
|
|
180
183
|
}
|
181
184
|
expect(wrapper).not.toHaveClass('is-not-loaded');
|
182
185
|
});
|
183
|
-
|
184
|
-
test('ResponseAttachment renders correctly, with custom props', async () => {
|
185
|
-
getComponentWithToolbarCustomProps();
|
186
|
-
act(() => { jest.advanceTimersByTime(10); });
|
187
|
-
|
188
|
-
expect(screen.getByTitle('Read aloud test')).toBeInTheDocument();
|
189
|
-
expect(screen.getByTitle('Copy test')).toBeInTheDocument();
|
190
|
-
expect(screen.getByTitle('Good Response test')).toBeInTheDocument();
|
191
|
-
expect(screen.getByTitle('Bad Response test')).toBeInTheDocument();
|
192
|
-
expect(screen.getByTitle('Rephrase Answer test')).toBeInTheDocument();
|
193
|
-
});
|
194
|
-
|
195
|
-
test('ResponseToolbar conditional rendering of IconButton based on title prop', async () => {
|
196
|
-
render(
|
197
|
-
<Response {...defaultProps}>
|
198
|
-
<ResponseText text={defaultProps.text} />
|
199
|
-
<ResponseToolbar
|
200
|
-
data-testid={toolbarId}
|
201
|
-
readButtonProps={{ title: 'Read aloud' }}
|
202
|
-
copyButtonProps={{ title: '' }}
|
203
|
-
goodButtonProps={{ title: 'Good Response' }}
|
204
|
-
badButtonProps={{ title: '' }}
|
205
|
-
rephraseButtonProps={{ title: 'Rephrase Answer' }}
|
206
|
-
/>
|
207
|
-
</Response>,
|
208
|
-
);
|
209
|
-
|
210
|
-
expect(screen.getByTitle('Read aloud')).toBeInTheDocument();
|
211
|
-
expect(screen.queryByTitle('Copy')).not.toBeInTheDocument();
|
212
|
-
expect(screen.getByTitle('Good Response')).toBeInTheDocument();
|
213
|
-
expect(screen.queryByTitle('Bad Response')).not.toBeInTheDocument();
|
214
|
-
expect(screen.getByTitle('Rephrase Answer')).toBeInTheDocument();
|
215
|
-
});
|
@@ -25,7 +25,8 @@ var ResponseAttachment = function ResponseAttachment(props) {
|
|
25
25
|
iconProps = props.iconProps,
|
26
26
|
className = props.className,
|
27
27
|
animationIndex = props.animationIndex,
|
28
|
-
shouldStartAnimation = props.shouldStartAnimation
|
28
|
+
shouldStartAnimation = props.shouldStartAnimation,
|
29
|
+
text = props.text;
|
29
30
|
var isLoaded = (0, _react.useRef)(false);
|
30
31
|
(0, _react.useEffect)(function () {
|
31
32
|
if (shouldStartAnimation && setAnimationIndex && animationIndex !== undefined && isLoaded.current === false) {
|
@@ -48,7 +49,7 @@ var ResponseAttachment = function ResponseAttachment(props) {
|
|
48
49
|
title: {
|
49
50
|
name: 'attachment icon'
|
50
51
|
}
|
51
|
-
}, iconProps)), (0, _react2.jsx)(_index.Text, textProps,
|
52
|
+
}, iconProps)), (0, _react2.jsx)(_index.Text, textProps, text));
|
52
53
|
};
|
53
54
|
var _default = ResponseAttachment;
|
54
55
|
exports["default"] = _default;
|
@@ -9,49 +9,40 @@ _Object$defineProperty(exports, "__esModule", {
|
|
9
9
|
value: true
|
10
10
|
});
|
11
11
|
exports["default"] = void 0;
|
12
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
12
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
13
15
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
14
16
|
var _react = _interopRequireWildcard(require("react"));
|
15
|
-
var _ContentCopyIcon = _interopRequireDefault(require("@pingux/mdi-react/ContentCopyIcon"));
|
16
|
-
var _TextIcon = _interopRequireDefault(require("@pingux/mdi-react/TextIcon"));
|
17
|
-
var _ThumbDownOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/ThumbDownOutlineIcon"));
|
18
|
-
var _ThumbUpOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/ThumbUpOutlineIcon"));
|
19
|
-
var _VolumeHighIcon = _interopRequireDefault(require("@pingux/mdi-react/VolumeHighIcon"));
|
20
17
|
var _hooks = require("../../../hooks");
|
21
18
|
var _index = require("../../../index");
|
22
19
|
var _react2 = require("@emotion/react");
|
23
|
-
var _excluded = ["parentIndex", "setAnimationIndex", "
|
20
|
+
var _excluded = ["parentIndex", "setAnimationIndex", "children", "className", "shouldStartAnimation", "animationIndex", "delay"];
|
24
21
|
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); }
|
25
22
|
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; }
|
26
|
-
var ResponseToolbarIcon = function ResponseToolbarIcon(props) {
|
27
|
-
var title = props.title,
|
28
|
-
icon = props.icon;
|
29
|
-
return (0, _react2.jsx)(_index.IconButton, {
|
30
|
-
title: title
|
31
|
-
}, (0, _react2.jsx)(_index.Icon, {
|
32
|
-
icon: icon,
|
33
|
-
title: {
|
34
|
-
name: title
|
35
|
-
}
|
36
|
-
}));
|
37
|
-
};
|
38
23
|
var ResponseToolbar = function ResponseToolbar(props) {
|
39
24
|
var parentIndex = props.parentIndex,
|
40
25
|
setAnimationIndex = props.setAnimationIndex,
|
41
|
-
|
42
|
-
copyButtonProps = props.copyButtonProps,
|
43
|
-
goodButtonProps = props.goodButtonProps,
|
44
|
-
badButtonProps = props.badButtonProps,
|
45
|
-
rephraseButtonProps = props.rephraseButtonProps,
|
26
|
+
children = props.children,
|
46
27
|
className = props.className,
|
47
28
|
shouldStartAnimation = props.shouldStartAnimation,
|
48
29
|
animationIndex = props.animationIndex,
|
30
|
+
delay = props.delay,
|
49
31
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
50
32
|
var isLoaded = (0, _react.useRef)(false);
|
33
|
+
var _useState = (0, _react.useState)(-1),
|
34
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
35
|
+
index = _useState2[0],
|
36
|
+
setIndex = _useState2[1];
|
37
|
+
(0, _react.useEffect)(function () {
|
38
|
+
if (index === (children === null || children === void 0 ? void 0 : children.length) && animationIndex !== undefined && setAnimationIndex) {
|
39
|
+
setAnimationIndex(animationIndex + 1);
|
40
|
+
}
|
41
|
+
}, [setAnimationIndex, index, shouldStartAnimation, animationIndex, children === null || children === void 0 ? void 0 : children.length]);
|
51
42
|
(0, _react.useEffect)(function () {
|
52
43
|
if (shouldStartAnimation && setAnimationIndex && animationIndex !== undefined && isLoaded.current === false) {
|
53
44
|
isLoaded.current = true;
|
54
|
-
|
45
|
+
setIndex(0);
|
55
46
|
}
|
56
47
|
}, [setAnimationIndex, parentIndex, shouldStartAnimation, animationIndex]);
|
57
48
|
var _useStatusClasses = (0, _hooks.useStatusClasses)(className, {
|
@@ -63,17 +54,14 @@ var ResponseToolbar = function ResponseToolbar(props) {
|
|
63
54
|
gap: "sm",
|
64
55
|
variant: "response.toolbar",
|
65
56
|
className: classNames
|
66
|
-
}, others), (
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
}, badButtonProps)), (rephraseButtonProps === null || rephraseButtonProps === void 0 ? void 0 : rephraseButtonProps.title) && (0, _react2.jsx)(ResponseToolbarIcon, (0, _extends2["default"])({
|
75
|
-
icon: _TextIcon["default"]
|
76
|
-
}, rephraseButtonProps)));
|
57
|
+
}, others), (0, _map["default"])(_react.Children).call(_react.Children, children, function (child, i) {
|
58
|
+
return (0, _react2.jsx)(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].cloneElement(child, {
|
59
|
+
setAnimationIndex: setIndex,
|
60
|
+
animationIndex: i,
|
61
|
+
parentIndex: index,
|
62
|
+
delay: delay
|
63
|
+
}));
|
64
|
+
}));
|
77
65
|
};
|
78
66
|
var _default = ResponseToolbar;
|
79
67
|
exports["default"] = _default;
|
@@ -0,0 +1,57 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
4
|
+
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
5
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
6
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
7
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
8
|
+
_Object$defineProperty(exports, "__esModule", {
|
9
|
+
value: true
|
10
|
+
});
|
11
|
+
exports["default"] = void 0;
|
12
|
+
var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-timeout"));
|
13
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
15
|
+
var _react = _interopRequireWildcard(require("react"));
|
16
|
+
var _hooks = require("../../../hooks");
|
17
|
+
var _index = require("../../../index");
|
18
|
+
var _react2 = require("@emotion/react");
|
19
|
+
var _excluded = ["title", "icon", "className", "parentIndex", "animationIndex", "setAnimationIndex", "delay", "iconProps"];
|
20
|
+
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); }
|
21
|
+
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; }
|
22
|
+
var ResponseToolbarIcon = function ResponseToolbarIcon(props) {
|
23
|
+
var title = props.title,
|
24
|
+
icon = props.icon,
|
25
|
+
className = props.className,
|
26
|
+
parentIndex = props.parentIndex,
|
27
|
+
animationIndex = props.animationIndex,
|
28
|
+
setAnimationIndex = props.setAnimationIndex,
|
29
|
+
delay = props.delay,
|
30
|
+
iconProps = props.iconProps,
|
31
|
+
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
32
|
+
var isLoaded = (0, _react.useRef)(false);
|
33
|
+
(0, _react.useEffect)(function () {
|
34
|
+
if (parentIndex === animationIndex && setAnimationIndex && parentIndex !== undefined) {
|
35
|
+
(0, _setTimeout2["default"])(function () {
|
36
|
+
isLoaded.current = true;
|
37
|
+
setAnimationIndex(parentIndex + 1);
|
38
|
+
}, delay);
|
39
|
+
}
|
40
|
+
}, [parentIndex, animationIndex, setAnimationIndex, delay]);
|
41
|
+
var _useStatusClasses = (0, _hooks.useStatusClasses)(className, {
|
42
|
+
isNotLoaded: !isLoaded.current
|
43
|
+
}),
|
44
|
+
classNames = _useStatusClasses.classNames;
|
45
|
+
return (0, _react2.jsx)(_index.IconButton, (0, _extends2["default"])({
|
46
|
+
title: title,
|
47
|
+
className: classNames,
|
48
|
+
variant: "responseToolbar"
|
49
|
+
}, others), (0, _react2.jsx)(_index.Icon, (0, _extends2["default"])({
|
50
|
+
icon: icon,
|
51
|
+
title: {
|
52
|
+
name: title
|
53
|
+
}
|
54
|
+
}, iconProps)));
|
55
|
+
};
|
56
|
+
var _default = ResponseToolbarIcon;
|
57
|
+
exports["default"] = _default;
|
@@ -3,3 +3,4 @@ export { default as ResponseAttachment } from './ResponseAttachment';
|
|
3
3
|
export { default as ResponseList } from './ResponseList';
|
4
4
|
export { default as ResponseText } from './ResponseText';
|
5
5
|
export { default as ResponseToolbar } from './ResponseToolbar';
|
6
|
+
export { default as ResponseToolbarIcon } from './ResponseToolbarIcon';
|
@@ -29,6 +29,12 @@ _Object$defineProperty(exports, "ResponseToolbar", {
|
|
29
29
|
return _ResponseToolbar["default"];
|
30
30
|
}
|
31
31
|
});
|
32
|
+
_Object$defineProperty(exports, "ResponseToolbarIcon", {
|
33
|
+
enumerable: true,
|
34
|
+
get: function get() {
|
35
|
+
return _ResponseToolbarIcon["default"];
|
36
|
+
}
|
37
|
+
});
|
32
38
|
_Object$defineProperty(exports, "default", {
|
33
39
|
enumerable: true,
|
34
40
|
get: function get() {
|
@@ -39,4 +45,5 @@ var _Response = _interopRequireDefault(require("./Response"));
|
|
39
45
|
var _ResponseAttachment = _interopRequireDefault(require("./ResponseAttachment"));
|
40
46
|
var _ResponseList = _interopRequireDefault(require("./ResponseList"));
|
41
47
|
var _ResponseText = _interopRequireDefault(require("./ResponseText"));
|
42
|
-
var _ResponseToolbar = _interopRequireDefault(require("./ResponseToolbar"));
|
48
|
+
var _ResponseToolbar = _interopRequireDefault(require("./ResponseToolbar"));
|
49
|
+
var _ResponseToolbarIcon = _interopRequireDefault(require("./ResponseToolbarIcon"));
|
@@ -203,7 +203,15 @@ var DataTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
203
203
|
case 'loader':
|
204
204
|
return (0, _react2.jsx)(CenteredWrapper, null, (0, _react2.jsx)(_index.Loader, {
|
205
205
|
color: "accent.70",
|
206
|
-
"aria-label": state.collection.size > 0 ? 'loadingMore' : 'loading'
|
206
|
+
"aria-label": state.collection.size > 0 ? 'loadingMore' : 'loading',
|
207
|
+
sx: {
|
208
|
+
gap: '9px'
|
209
|
+
},
|
210
|
+
dotProps: {
|
211
|
+
sx: {
|
212
|
+
m: 0
|
213
|
+
}
|
214
|
+
}
|
207
215
|
}));
|
208
216
|
default:
|
209
217
|
return undefined;
|
@@ -154,6 +154,13 @@ var _default = {
|
|
154
154
|
}
|
155
155
|
};
|
156
156
|
exports["default"] = _default;
|
157
|
+
var getHeaderProps = function getHeaderProps() {
|
158
|
+
return {
|
159
|
+
sx: {
|
160
|
+
fontWeight: '3'
|
161
|
+
}
|
162
|
+
};
|
163
|
+
};
|
157
164
|
var getCellProps = function getCellProps(columnKey, align) {
|
158
165
|
return {
|
159
166
|
pr: columnKey !== 'menu' ? 'lg' : 0,
|
@@ -189,7 +196,7 @@ var Default = function Default(args) {
|
|
189
196
|
id: 1,
|
190
197
|
timestamp: timestampCell,
|
191
198
|
eventType: 'User Access Allowed',
|
192
|
-
description: (0, _react2.jsx)(
|
199
|
+
description: (0, _react2.jsx)(_index.Box, null, "Passed Role Access Control"),
|
193
200
|
status: (0, _react2.jsx)(_index.DataTableBadge, {
|
194
201
|
cell: "Approved"
|
195
202
|
}),
|
@@ -199,13 +206,10 @@ var Default = function Default(args) {
|
|
199
206
|
id: 2,
|
200
207
|
timestamp: timestampCell,
|
201
208
|
eventType: 'User Access Denied',
|
202
|
-
description: (0, _react2.jsx)(
|
203
|
-
display: "
|
204
|
-
|
205
|
-
|
206
|
-
}, "Control"), (0, _react2.jsx)(_index.Box, {
|
207
|
-
display: "block"
|
208
|
-
}, "Words Words Words Words Words Words Words Words Words Words Words Words Words Words")),
|
209
|
+
description: (0, _react2.jsx)(_index.Box, {
|
210
|
+
display: "-webkit-box",
|
211
|
+
variant: "dataTable.truncateText"
|
212
|
+
}, "Passed Role Access Control Words Words Words Words Words Words Words Words Words Words Words Words Words Words"),
|
209
213
|
status: (0, _react2.jsx)(_index.DataTableBadge, {
|
210
214
|
cell: "Rejected"
|
211
215
|
}),
|
@@ -215,7 +219,10 @@ var Default = function Default(args) {
|
|
215
219
|
id: 3,
|
216
220
|
timestamp: timestampCell,
|
217
221
|
eventType: 'User Access Allowed',
|
218
|
-
description:
|
222
|
+
description: (0, _react2.jsx)(_index.Box, {
|
223
|
+
display: "-webkit-box",
|
224
|
+
variant: "dataTable.truncateText"
|
225
|
+
}, "Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words"),
|
219
226
|
status: (0, _react2.jsx)(_index.DataTableBadge, {
|
220
227
|
cell: "Approved"
|
221
228
|
}),
|
@@ -225,7 +232,7 @@ var Default = function Default(args) {
|
|
225
232
|
id: 4,
|
226
233
|
timestamp: timestampCell,
|
227
234
|
eventType: 'User Access Allowed',
|
228
|
-
description: (0, _react2.jsx)(
|
235
|
+
description: (0, _react2.jsx)(_index.Box, null, "Passed Role Access Control"),
|
229
236
|
status: (0, _react2.jsx)(_index.DataTableBadge, {
|
230
237
|
cell: "Approved"
|
231
238
|
}),
|
@@ -235,7 +242,7 @@ var Default = function Default(args) {
|
|
235
242
|
id: 5,
|
236
243
|
timestamp: timestampCell,
|
237
244
|
eventType: 'User Access Allowed',
|
238
|
-
description: (0, _react2.jsx)(
|
245
|
+
description: (0, _react2.jsx)(_index.Box, null, "Passed Role Access Control"),
|
239
246
|
status: (0, _react2.jsx)(_index.DataTableBadge, {
|
240
247
|
cell: "Approved"
|
241
248
|
}),
|
@@ -248,7 +255,7 @@ var Default = function Default(args) {
|
|
248
255
|
}), (0, _react2.jsx)(_index.DataTableHeader, {
|
249
256
|
columns: columns
|
250
257
|
}, function (column) {
|
251
|
-
return (0, _react2.jsx)(_index.DataTableColumn, (0, _extends2["default"])({}, getCellProps(column.key, false), {
|
258
|
+
return (0, _react2.jsx)(_index.DataTableColumn, (0, _extends2["default"])({}, getCellProps(column.key, false), getHeaderProps(), {
|
252
259
|
minWidth: column.key !== 'menu' ? 175 : 32,
|
253
260
|
width: column.key !== 'menu' ? '19.4%' : 32
|
254
261
|
}), column.name);
|
@@ -308,7 +315,7 @@ var Dynamic = function Dynamic(args) {
|
|
308
315
|
id: 5,
|
309
316
|
country: 'Mexico',
|
310
317
|
population: '126,000,000',
|
311
|
-
continent: '
|
318
|
+
continent: 'North America'
|
312
319
|
}, {
|
313
320
|
id: 6,
|
314
321
|
country: 'Ethiopia',
|
@@ -415,7 +422,7 @@ var Sortable = function Sortable(args) {
|
|
415
422
|
id: 6,
|
416
423
|
country: 'Mexico',
|
417
424
|
population: '126,000,000',
|
418
|
-
continent: '
|
425
|
+
continent: 'North America'
|
419
426
|
}, {
|
420
427
|
id: 7,
|
421
428
|
country: 'USA',
|
@@ -550,7 +557,7 @@ var Selection = function Selection(args) {
|
|
550
557
|
id: 5,
|
551
558
|
country: 'Mexico',
|
552
559
|
population: '126,000,000',
|
553
|
-
continent: '
|
560
|
+
continent: 'North America'
|
554
561
|
}, {
|
555
562
|
id: 6,
|
556
563
|
country: 'Ethiopia',
|
@@ -635,7 +642,7 @@ var ControlledSelection = function ControlledSelection(args) {
|
|
635
642
|
id: 5,
|
636
643
|
country: 'Mexico',
|
637
644
|
population: '126,000,000',
|
638
|
-
continent: '
|
645
|
+
continent: 'North America'
|
639
646
|
}, {
|
640
647
|
id: 6,
|
641
648
|
country: 'Ethiopia',
|
@@ -51,7 +51,6 @@ declare const _default: {
|
|
51
51
|
};
|
52
52
|
tableCellContents: {
|
53
53
|
maxHeight: number;
|
54
|
-
overflow: string;
|
55
54
|
display: string;
|
56
55
|
'-webkit-line-clamp': string;
|
57
56
|
'-webkit-box-orient': string;
|
@@ -167,5 +166,12 @@ declare const _default: {
|
|
167
166
|
borderRadius: string;
|
168
167
|
mr: string;
|
169
168
|
};
|
169
|
+
truncateText: {
|
170
|
+
whiteSpace: string;
|
171
|
+
WebkitBoxOrient: string;
|
172
|
+
display: string;
|
173
|
+
WebkitLineClamp: string;
|
174
|
+
overflow: string;
|
175
|
+
};
|
170
176
|
};
|
171
177
|
export default _default;
|
@@ -48,7 +48,7 @@ var tableCell = _objectSpread(_objectSpread({}, _Text.text.tableData), {}, {
|
|
48
48
|
});
|
49
49
|
var tableCellContents = {
|
50
50
|
maxHeight: 80,
|
51
|
-
overflow: 'hidden',
|
51
|
+
// overflow: 'hidden',
|
52
52
|
display: '-webkit-box !important',
|
53
53
|
'-webkit-line-clamp': '4',
|
54
54
|
'-webkit-box-orient': 'vertical'
|
@@ -159,6 +159,13 @@ var tableMenu = {
|
|
159
159
|
borderRadius: '50px',
|
160
160
|
mr: 'md'
|
161
161
|
};
|
162
|
+
var truncateText = {
|
163
|
+
whiteSpace: 'normal',
|
164
|
+
WebkitBoxOrient: 'vertical',
|
165
|
+
display: '-webkit-box',
|
166
|
+
WebkitLineClamp: '2',
|
167
|
+
overflow: 'hidden'
|
168
|
+
};
|
162
169
|
var _default = {
|
163
170
|
selectableTableRow: selectableTableRow,
|
164
171
|
tableBody: tableBody,
|
@@ -168,6 +175,7 @@ var _default = {
|
|
168
175
|
tableCell: tableCell,
|
169
176
|
tableRow: tableRow,
|
170
177
|
tableHeadCell: tableHeadCell,
|
171
|
-
tableMenu: tableMenu
|
178
|
+
tableMenu: tableMenu,
|
179
|
+
truncateText: truncateText
|
172
180
|
};
|
173
181
|
exports["default"] = _default;
|