eli-video-interview 1.2.42-alpha.40 → 1.2.42-alpha.41

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.
@@ -41,7 +41,7 @@ import { Accordion, AccordionDetails, AccordionSummary, List, ListItem, ListItem
41
41
  import { memo, useCallback, useEffect, useRef, useState } from 'react';
42
42
  var LANGUAGE_TYPE_LIST = [LANGUAGE_TYPE.MANDARIN, LANGUAGE_TYPE.CANTONESE, LANGUAGE_TYPE.JAPANESE, LANGUAGE_TYPE.ENGLISH];
43
43
  var BaseAccordion = function (props) {
44
- var name = props.name, positionName = props.positionName, list = props.list, index = props.index, isShowOnlyAITest = props.isShowOnlyAITest, _a = props.isShowDesc, isShowDesc = _a === void 0 ? false : _a, _b = props.isShowSummaryAction, isShowSummaryAction = _b === void 0 ? false : _b, _c = props.isShowConfirm, isShowConfirm = _c === void 0 ? false : _c, _d = props.isShowPreview, isShowPreview = _d === void 0 ? true : _d, _e = props.isNew, isNew = _e === void 0 ? false : _e, _f = props.isOem, isOem = _f === void 0 ? false : _f;
44
+ var name = props.name, positionName = props.positionName, list = props.list, index = props.index, isShowOnlyAITest = props.isShowOnlyAITest, _a = props.isShowDesc, isShowDesc = _a === void 0 ? false : _a, _b = props.isShowSummaryAction, isShowSummaryAction = _b === void 0 ? false : _b, _c = props.isShowConfirm, isShowConfirm = _c === void 0 ? false : _c, _d = props.isShowPreview, isShowPreview = _d === void 0 ? true : _d, _e = props.isNew, isNew = _e === void 0 ? false : _e, _f = props.isOem, isOem = _f === void 0 ? false : _f, expanded = props.expanded, token = props.token, onExpandedChange = props.onExpandedChange;
45
45
  var ref = useRef(null);
46
46
  var isHovering = useHover(ref);
47
47
  var updatePreview = useQuestionPreviewStore().updatePreview;
@@ -104,7 +104,7 @@ var BaseAccordion = function (props) {
104
104
  setQuestionsList(filterList);
105
105
  }
106
106
  }, [list, isShowOnlyAITest, isOem]);
107
- return (_jsx(_Fragment, { children: questionsList.length > 0 && (_jsx(AccordionRoot, { children: _jsxs(Accordion, __assign({ defaultExpanded: index === 0 }, { children: [_jsx(AccordionSummary, __assign({ expandIcon: _jsx(ExpandMore, {}), sx: {
107
+ return (_jsx(_Fragment, { children: questionsList.length > 0 && (_jsx(AccordionRoot, { children: _jsxs(Accordion, __assign({ defaultExpanded: index === 0, expanded: expanded === token, onChange: onExpandedChange(token) }, { children: [_jsx(AccordionSummary, __assign({ expandIcon: _jsx(ExpandMore, {}), sx: {
108
108
  '&:after': {
109
109
  content: "".concat(isNew ? 'url(//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn)' : '" "'),
110
110
  position: 'absolute',
@@ -113,13 +113,13 @@ var BaseAccordion = function (props) {
113
113
  width: 38,
114
114
  height: 16,
115
115
  },
116
- } }, { children: _jsxs(Box, __assign({ flex: "1 0", display: "flex", justifyContent: "space-between", alignItems: "center", overflow: "hidden" }, { children: [_jsxs(Box, __assign({ flex: "1 0", overflow: "hidden" }, { children: [_jsx(AccordionTitle, { children: positionName || name }), positionName && _jsxs(AccordionSubTitle, __assign({ color: "secondary" }, { children: ["\u6B65\u9AA4\uFF1A", name] }))] })), isShowSummaryAction && (_jsx(Button, __assign({ sx: { mr: 1, flexShrink: 0, height: 24 }, variant: "outlined", color: "inherit", size: "small", onClick: handleUseAllQuestion }, { children: "\u4F7F\u7528" })))] })) })), _jsxs(AccordionDetails, { children: [_jsx(List, __assign({ ref: ref }, { children: questionsList.map(function (item) {
116
+ } }, { children: _jsxs(Box, __assign({ flex: "1 0", display: "flex", justifyContent: "space-between", alignItems: "center", overflow: "hidden" }, { children: [_jsxs(Box, __assign({ flex: "1 0", overflow: "hidden" }, { children: [_jsx(AccordionTitle, { children: positionName || name }), positionName && _jsxs(AccordionSubTitle, __assign({ color: "secondary" }, { children: ["\u6B65\u9AA4\uFF1A", name] }))] })), isShowSummaryAction && (_jsx(Button, __assign({ sx: { mr: 1, flexShrink: 0, height: 24 }, variant: "outlined", color: "inherit", size: "small", onClick: handleUseAllQuestion }, { children: "\u4F7F\u7528" })))] })) })), expanded === token && (_jsxs(AccordionDetails, { children: [_jsx(List, __assign({ ref: ref }, { children: questionsList.map(function (item) {
117
117
  var token = item.token, name = item.name, category = item.category;
118
118
  var isUsed = questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps.find(function (step) { return step.originToken === token; });
119
119
  return (_jsx(ListItem, __assign({ secondaryAction: [
120
120
  isUsed && _jsx(Done, {}, "icon"),
121
121
  _jsx(Box, __assign({ className: "secondary-action-buttons" }, { children: _jsx(Button, __assign({ variant: "outlined", color: "inherit", size: "small", onClick: function () { return handleUseQuestion(item); } }, { children: "\u4F7F\u7528" })) }), "buttons"),
122
122
  ], onMouseOver: function () { return handleMouseOver(item); } }, { children: _jsx(ListItemText, { primary: name, secondary: isShowDesc && category ? category[0] : '' }) }), token));
123
- }) })), isPaging && (_jsx(Button, __assign({ variant: "text", sx: { width: '100%', justifyContent: 'start', color: '#576B95' }, onClick: handleShowAll }, { children: "\u5C55\u793A\u5168\u90E8" })))] })] })) })) }));
123
+ }) })), isPaging && (_jsx(Button, __assign({ variant: "text", sx: { width: '100%', justifyContent: 'start', color: '#576B95' }, onClick: handleShowAll }, { children: "\u5C55\u793A\u5168\u90E8" })))] }))] })) })) }));
124
124
  };
125
125
  export default memo(BaseAccordion);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AiEvaluationDataList } from '../QuestionTemplate/interface';
2
3
  export interface BaseAccordionProps extends AiEvaluationDataList {
3
4
  index?: number;
@@ -7,4 +8,6 @@ export interface BaseAccordionProps extends AiEvaluationDataList {
7
8
  isShowSummaryAction?: boolean;
8
9
  isShowConfirm?: boolean;
9
10
  isOem?: boolean;
11
+ expanded: string | false;
12
+ onExpandedChange: (panel: string) => (event: React.SyntheticEvent, expanded: boolean) => void;
10
13
  }
@@ -40,7 +40,7 @@ import { uniqueId } from "../../../../utils/utils";
40
40
  import { useSetState } from 'ahooks';
41
41
  import { AddIcon, Box, Button, LayerOutlineIcon, MicIcon, Popover, RadioCheckedIcon, SMSOneIcon, Typography } from 'fbm-ui';
42
42
  import { List, ListItem, ListItemButton, ListItemIcon, ListItemText } from 'fbm-ui/lib/mui';
43
- import { useCallback } from 'react';
43
+ import { useCallback, useState } from 'react';
44
44
  var ICONS = (_a = {},
45
45
  _a[ADD_QUESTION_TYPE.FREE] = _jsx(SMSOneIcon, { color: "secondary" }),
46
46
  _a[ADD_QUESTION_TYPE.LANGUAGE] = _jsx(MicIcon, { color: "secondary" }),
@@ -59,6 +59,10 @@ var AiEvaluation = function (_a) {
59
59
  showOnlyAITest: false,
60
60
  }), 2), state = _b[0], setState = _b[1];
61
61
  var addQuestionOpen = state.addQuestionOpen, showOnlyAITest = state.showOnlyAITest;
62
+ var _c = __read(useState(false), 2), expanded = _c[0], setExpanded = _c[1];
63
+ var handleExpandedChange = function (panel) { return function (event, isExpanded) {
64
+ setExpanded(isExpanded ? panel : false);
65
+ }; };
62
66
  var handleClickAdd = useCallback(function (aiShowType) {
63
67
  setState({ addQuestionOpen: false });
64
68
  updateQuestionState({
@@ -77,7 +81,7 @@ var AiEvaluation = function (_a) {
77
81
  var name = _a.name, list = _a.list;
78
82
  return (_jsxs(Box, { children: [_jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, weight: "500", mb: 2 }, { children: name })), list
79
83
  .filter(function (v) { return !isEdit || !v.isNew || selctedAbilitys.includes(v.token); })
80
- .map(function (item, i) { return (_jsx(BaseAccordion, __assign({ index: i, isOem: isOem, isShowOnlyAITest: showOnlyAITest, isShowDesc: index !== 0, isShowSummaryAction: index !== 0, isShowConfirm: index !== 0 }, item), item.token)); })] }, name));
84
+ .map(function (item, i) { return (_jsx(BaseAccordion, __assign({ index: i, isOem: isOem, isShowOnlyAITest: showOnlyAITest, isShowDesc: index !== 0, isShowSummaryAction: index !== 0, isShowConfirm: index !== 0, expanded: expanded, onExpandedChange: handleExpandedChange }, item), item.token)); })] }, name));
81
85
  })] }));
82
86
  };
83
87
  export default AiEvaluation;
@@ -43,7 +43,7 @@ var mui_1 = require("fbm-ui/lib/mui");
43
43
  var react_1 = require("react");
44
44
  var LANGUAGE_TYPE_LIST = [ai_question_2.LANGUAGE_TYPE.MANDARIN, ai_question_2.LANGUAGE_TYPE.CANTONESE, ai_question_2.LANGUAGE_TYPE.JAPANESE, ai_question_2.LANGUAGE_TYPE.ENGLISH];
45
45
  var BaseAccordion = function (props) {
46
- var name = props.name, positionName = props.positionName, list = props.list, index = props.index, isShowOnlyAITest = props.isShowOnlyAITest, _a = props.isShowDesc, isShowDesc = _a === void 0 ? false : _a, _b = props.isShowSummaryAction, isShowSummaryAction = _b === void 0 ? false : _b, _c = props.isShowConfirm, isShowConfirm = _c === void 0 ? false : _c, _d = props.isShowPreview, isShowPreview = _d === void 0 ? true : _d, _e = props.isNew, isNew = _e === void 0 ? false : _e, _f = props.isOem, isOem = _f === void 0 ? false : _f;
46
+ var name = props.name, positionName = props.positionName, list = props.list, index = props.index, isShowOnlyAITest = props.isShowOnlyAITest, _a = props.isShowDesc, isShowDesc = _a === void 0 ? false : _a, _b = props.isShowSummaryAction, isShowSummaryAction = _b === void 0 ? false : _b, _c = props.isShowConfirm, isShowConfirm = _c === void 0 ? false : _c, _d = props.isShowPreview, isShowPreview = _d === void 0 ? true : _d, _e = props.isNew, isNew = _e === void 0 ? false : _e, _f = props.isOem, isOem = _f === void 0 ? false : _f, expanded = props.expanded, token = props.token, onExpandedChange = props.onExpandedChange;
47
47
  var ref = (0, react_1.useRef)(null);
48
48
  var isHovering = (0, ahooks_1.useHover)(ref);
49
49
  var updatePreview = (0, question_preview_store_1.useQuestionPreviewStore)().updatePreview;
@@ -106,7 +106,7 @@ var BaseAccordion = function (props) {
106
106
  setQuestionsList(filterList);
107
107
  }
108
108
  }, [list, isShowOnlyAITest, isOem]);
109
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: questionsList.length > 0 && ((0, jsx_runtime_1.jsx)(styled_1.AccordionRoot, { children: (0, jsx_runtime_1.jsxs)(mui_1.Accordion, __assign({ defaultExpanded: index === 0 }, { children: [(0, jsx_runtime_1.jsx)(mui_1.AccordionSummary, __assign({ expandIcon: (0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, {}), sx: {
109
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: questionsList.length > 0 && ((0, jsx_runtime_1.jsx)(styled_1.AccordionRoot, { children: (0, jsx_runtime_1.jsxs)(mui_1.Accordion, __assign({ defaultExpanded: index === 0, expanded: expanded === token, onChange: onExpandedChange(token) }, { children: [(0, jsx_runtime_1.jsx)(mui_1.AccordionSummary, __assign({ expandIcon: (0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, {}), sx: {
110
110
  '&:after': {
111
111
  content: "".concat(isNew ? 'url(//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn)' : '" "'),
112
112
  position: 'absolute',
@@ -115,13 +115,13 @@ var BaseAccordion = function (props) {
115
115
  width: 38,
116
116
  height: 16,
117
117
  },
118
- } }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", display: "flex", justifyContent: "space-between", alignItems: "center", overflow: "hidden" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", overflow: "hidden" }, { children: [(0, jsx_runtime_1.jsx)(styled_1.AccordionTitle, { children: positionName || name }), positionName && (0, jsx_runtime_1.jsxs)(styled_1.AccordionSubTitle, __assign({ color: "secondary" }, { children: ["\u6B65\u9AA4\uFF1A", name] }))] })), isShowSummaryAction && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ sx: { mr: 1, flexShrink: 0, height: 24 }, variant: "outlined", color: "inherit", size: "small", onClick: handleUseAllQuestion }, { children: "\u4F7F\u7528" })))] })) })), (0, jsx_runtime_1.jsxs)(mui_1.AccordionDetails, { children: [(0, jsx_runtime_1.jsx)(mui_1.List, __assign({ ref: ref }, { children: questionsList.map(function (item) {
118
+ } }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", display: "flex", justifyContent: "space-between", alignItems: "center", overflow: "hidden" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", overflow: "hidden" }, { children: [(0, jsx_runtime_1.jsx)(styled_1.AccordionTitle, { children: positionName || name }), positionName && (0, jsx_runtime_1.jsxs)(styled_1.AccordionSubTitle, __assign({ color: "secondary" }, { children: ["\u6B65\u9AA4\uFF1A", name] }))] })), isShowSummaryAction && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ sx: { mr: 1, flexShrink: 0, height: 24 }, variant: "outlined", color: "inherit", size: "small", onClick: handleUseAllQuestion }, { children: "\u4F7F\u7528" })))] })) })), expanded === token && ((0, jsx_runtime_1.jsxs)(mui_1.AccordionDetails, { children: [(0, jsx_runtime_1.jsx)(mui_1.List, __assign({ ref: ref }, { children: questionsList.map(function (item) {
119
119
  var token = item.token, name = item.name, category = item.category;
120
120
  var isUsed = questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps.find(function (step) { return step.originToken === token; });
121
121
  return ((0, jsx_runtime_1.jsx)(mui_1.ListItem, __assign({ secondaryAction: [
122
122
  isUsed && (0, jsx_runtime_1.jsx)(icons_material_1.Done, {}, "icon"),
123
123
  (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ className: "secondary-action-buttons" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", color: "inherit", size: "small", onClick: function () { return handleUseQuestion(item); } }, { children: "\u4F7F\u7528" })) }), "buttons"),
124
124
  ], onMouseOver: function () { return handleMouseOver(item); } }, { children: (0, jsx_runtime_1.jsx)(mui_1.ListItemText, { primary: name, secondary: isShowDesc && category ? category[0] : '' }) }), token));
125
- }) })), isPaging && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", sx: { width: '100%', justifyContent: 'start', color: '#576B95' }, onClick: handleShowAll }, { children: "\u5C55\u793A\u5168\u90E8" })))] })] })) })) }));
125
+ }) })), isPaging && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", sx: { width: '100%', justifyContent: 'start', color: '#576B95' }, onClick: handleShowAll }, { children: "\u5C55\u793A\u5168\u90E8" })))] }))] })) })) }));
126
126
  };
127
127
  exports.default = (0, react_1.memo)(BaseAccordion);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AiEvaluationDataList } from '../QuestionTemplate/interface';
2
3
  export interface BaseAccordionProps extends AiEvaluationDataList {
3
4
  index?: number;
@@ -7,4 +8,6 @@ export interface BaseAccordionProps extends AiEvaluationDataList {
7
8
  isShowSummaryAction?: boolean;
8
9
  isShowConfirm?: boolean;
9
10
  isOem?: boolean;
11
+ expanded: string | false;
12
+ onExpandedChange: (panel: string) => (event: React.SyntheticEvent, expanded: boolean) => void;
10
13
  }
@@ -64,6 +64,10 @@ var AiEvaluation = function (_a) {
64
64
  showOnlyAITest: false,
65
65
  }), 2), state = _b[0], setState = _b[1];
66
66
  var addQuestionOpen = state.addQuestionOpen, showOnlyAITest = state.showOnlyAITest;
67
+ var _c = __read((0, react_1.useState)(false), 2), expanded = _c[0], setExpanded = _c[1];
68
+ var handleExpandedChange = function (panel) { return function (event, isExpanded) {
69
+ setExpanded(isExpanded ? panel : false);
70
+ }; };
67
71
  var handleClickAdd = (0, react_1.useCallback)(function (aiShowType) {
68
72
  setState({ addQuestionOpen: false });
69
73
  updateQuestionState({
@@ -82,7 +86,7 @@ var AiEvaluation = function (_a) {
82
86
  var name = _a.name, list = _a.list;
83
87
  return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ fontSize: 12, lineHeight: 1.5, weight: "500", mb: 2 }, { children: name })), list
84
88
  .filter(function (v) { return !isEdit || !v.isNew || selctedAbilitys.includes(v.token); })
85
- .map(function (item, i) { return ((0, jsx_runtime_1.jsx)(BaseAccordion_1.default, __assign({ index: i, isOem: isOem, isShowOnlyAITest: showOnlyAITest, isShowDesc: index !== 0, isShowSummaryAction: index !== 0, isShowConfirm: index !== 0 }, item), item.token)); })] }, name));
89
+ .map(function (item, i) { return ((0, jsx_runtime_1.jsx)(BaseAccordion_1.default, __assign({ index: i, isOem: isOem, isShowOnlyAITest: showOnlyAITest, isShowDesc: index !== 0, isShowSummaryAction: index !== 0, isShowConfirm: index !== 0, expanded: expanded, onExpandedChange: handleExpandedChange }, item), item.token)); })] }, name));
86
90
  })] }));
87
91
  };
88
92
  exports.default = AiEvaluation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eli-video-interview",
3
- "version": "1.2.42-alpha.40",
3
+ "version": "1.2.42-alpha.41",
4
4
  "description": "鳄梨科技 AI视频面试 React SDK",
5
5
  "author": "鳄梨科技",
6
6
  "license": "MIT",