frst-components 0.23.39 → 0.23.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.
- package/dist/index.js +20 -7
- package/dist/src/components/hypothesisComponent/index.d.ts +1 -1
- package/dist/src/components/hypothesisComponent/index.d.ts.map +1 -1
- package/dist/src/components/hypothesisComponent/types.d.ts +68 -0
- package/dist/src/components/hypothesisComponent/types.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3337,6 +3337,13 @@ styled__default["default"].div `
|
|
|
3337
3337
|
|
|
3338
3338
|
`;
|
|
3339
3339
|
|
|
3340
|
+
var HypothesisEnum;
|
|
3341
|
+
(function (HypothesisEnum) {
|
|
3342
|
+
HypothesisEnum["PRIORITIZE"] = "prioritize";
|
|
3343
|
+
HypothesisEnum["RAISED"] = "raised";
|
|
3344
|
+
HypothesisEnum["SUGGESTED"] = "suggested";
|
|
3345
|
+
})(HypothesisEnum || (HypothesisEnum = {}));
|
|
3346
|
+
|
|
3340
3347
|
const container = styled__default["default"].div `
|
|
3341
3348
|
display: flex;
|
|
3342
3349
|
justify-content: center;
|
|
@@ -3612,7 +3619,7 @@ const ModalConfirme = ({ open, onClose, title, children, onConfirm }) => {
|
|
|
3612
3619
|
return (jsxRuntime.jsx(material.Modal, { open: open, onClose: onClose, children: jsxRuntime.jsxs(ModalContainer, { children: [jsxRuntime.jsxs(ModalHeader$1, { children: [jsxRuntime.jsx(ModalTitle, { children: title }), jsxRuntime.jsx(CloseButton$1, { onClick: onClose, children: "X" })] }), jsxRuntime.jsx(HorizontalLine, {}), jsxRuntime.jsxs(ContainerContent, { children: [children, jsxRuntime.jsxs(ButtonContainer$1, { children: [jsxRuntime.jsx(Button$4, { variant: "link", style: { color: '#444444' }, handleClick: onClose, label: "N\u00E3o, cancelar" }), jsxRuntime.jsx(Button$4, { variant: "primary", label: "Sim, excluir", handleClick: onConfirm })] })] })] }) }));
|
|
3613
3620
|
};
|
|
3614
3621
|
|
|
3615
|
-
const HypothesisComponent = ({ description, type, id, title, votes = [], onVote, canVote = false, canViewVote = false, userLoggedId, deleteVote, canViewListVotes, votesSingularText, votesPluralText, voteText, deleteVoteText, handleViewProfile, avatar, hasEditHipotesis, onDeleteHipotesis, showAvatar, authorId, hasVoteGoal, loading, onChangeVote, authorGoalId, changeVoteText, onSaveEditHipotesis }) => {
|
|
3622
|
+
const HypothesisComponent = ({ description, type, id, title, votes = [], onVote, canVote = false, canViewVote = false, userLoggedId, deleteVote, canViewListVotes, votesSingularText, votesPluralText, voteText, deleteVoteText, handleViewProfile, avatar, hasEditHipotesis, onDeleteHipotesis, showAvatar, authorId, hasVoteGoal, loading, onChangeVote, authorGoalId, changeVoteText, onSaveEditHipotesis, }) => {
|
|
3616
3623
|
const [isHover, seIsHover] = React.useState(false);
|
|
3617
3624
|
const [hasVoteHypothesis, setHasVoteHypothesis] = React.useState(false);
|
|
3618
3625
|
const [showVotesList, setShowVotesList] = React.useState(false);
|
|
@@ -3632,11 +3639,6 @@ const HypothesisComponent = ({ description, type, id, title, votes = [], onVote,
|
|
|
3632
3639
|
setShowVotesList(false);
|
|
3633
3640
|
}
|
|
3634
3641
|
};
|
|
3635
|
-
const handleDoubleClick = (e) => {
|
|
3636
|
-
if (authorId === userLoggedId || authorGoalId === userLoggedId) {
|
|
3637
|
-
setIsEditing(true);
|
|
3638
|
-
}
|
|
3639
|
-
};
|
|
3640
3642
|
React.useEffect(() => {
|
|
3641
3643
|
setHasVoteHypothesis(votes?.some((vote) => vote?.user_uuid === userLoggedId));
|
|
3642
3644
|
}, [votes]);
|
|
@@ -3670,7 +3672,18 @@ const HypothesisComponent = ({ description, type, id, title, votes = [], onVote,
|
|
|
3670
3672
|
onSaveEditHipotesis(editDescription);
|
|
3671
3673
|
setIsEditing(false);
|
|
3672
3674
|
};
|
|
3673
|
-
const validHasEditHipotesis =
|
|
3675
|
+
const validHasEditHipotesis = typeof HypothesisEnum.PRIORITIZE
|
|
3676
|
+
? hasEditHipotesis && authorGoalId === userLoggedId
|
|
3677
|
+
: hasEditHipotesis && (authorId === userLoggedId || authorGoalId === userLoggedId);
|
|
3678
|
+
const handleDoubleClick = (e) => {
|
|
3679
|
+
setIsEditing(true);
|
|
3680
|
+
if (typeof HypothesisEnum.PRIORITIZE && authorGoalId === userLoggedId) {
|
|
3681
|
+
setIsEditing(true);
|
|
3682
|
+
}
|
|
3683
|
+
else {
|
|
3684
|
+
setIsEditing(false);
|
|
3685
|
+
}
|
|
3686
|
+
};
|
|
3674
3687
|
return (jsxRuntime.jsx(MainContainer, { children: jsxRuntime.jsxs(Container$m, { type: type, id: id, ref: ContainerRef, children: [jsxRuntime.jsxs(SplitContainerDescription, { children: [showAvatar && (jsxRuntime.jsx(Avatar, { src: avatar, size: "24px", style: { marginRight: '8px', cursor: authorId ? 'pointer' : 'default' }, onClick: () => handleViewProfile(authorId) })), jsxRuntime.jsx(Title$6, { children: title }), jsxRuntime.jsx(Separator, { children: "|" }), jsxRuntime.jsx(Description$4, { children: isEditing ? (jsxRuntime.jsx("span", { style: { display: 'flex', width: '100%' }, children: jsxRuntime.jsx("div", { contentEditable: true, style: { width: '100%', background: 'white' }, onInput: (e) => setEditDescription(e.currentTarget.textContent), onBlur: handleSaveDescription, children: description }) })) : (jsxRuntime.jsx("div", { style: { width: '100%' }, onDoubleClick: handleDoubleClick, children: jsxRuntime.jsx("span", { children: editDescription }) })) }), validHasEditHipotesis && (jsxRuntime.jsx(MenuMore, { options: [
|
|
3675
3688
|
{
|
|
3676
3689
|
description: 'Editar',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Vote } from './types';
|
|
3
|
-
export declare const HypothesisComponent: ({ description, type, id, title, votes, onVote, canVote, canViewVote, userLoggedId, deleteVote, canViewListVotes, votesSingularText, votesPluralText, voteText, deleteVoteText, handleViewProfile, avatar, hasEditHipotesis, onDeleteHipotesis, showAvatar, authorId, hasVoteGoal, loading, onChangeVote, authorGoalId, changeVoteText, onSaveEditHipotesis }: {
|
|
3
|
+
export declare const HypothesisComponent: ({ description, type, id, title, votes, onVote, canVote, canViewVote, userLoggedId, deleteVote, canViewListVotes, votesSingularText, votesPluralText, voteText, deleteVoteText, handleViewProfile, avatar, hasEditHipotesis, onDeleteHipotesis, showAvatar, authorId, hasVoteGoal, loading, onChangeVote, authorGoalId, changeVoteText, onSaveEditHipotesis, }: {
|
|
4
4
|
description: string;
|
|
5
5
|
type: string;
|
|
6
6
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/hypothesisComponent/index.tsx"],"names":[],"mappings":";AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/hypothesisComponent/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAkB,IAAI,EAAE,MAAM,SAAS,CAAA;AAO9C,eAAO,MAAM,mBAAmB;iBA8BjB,MAAM;UACb,MAAM;QACR,MAAM;WACH,MAAM;WACN,IAAI,EAAE;kBACC,MAAM;2BACG,MAAM,KAAK,GAAG;0BACf,MAAM,KAAK,GAAG;iCACP,MAAM,KAAK,GAAG;cACjC,OAAO;uBACE,OAAO;kBACZ,OAAO;kBACP,OAAO;uBACF,OAAO;wBACN,MAAM;sBACR,MAAM;eACb,MAAM;qBACA,MAAM;aACd,MAAM;wBACK,MAAM,IAAI;iBACjB,OAAO;eACT,MAAM;mBACF,MAAM;cACX,OAAO;iCACY,MAAM,KAAK,GAAG;qBAC1B,MAAM;wCACa,MAAM,KAAK,IAAI;iBAsVpD,CAAA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export declare enum HypothesisEnum {
|
|
2
|
+
PRIORITIZE = "prioritize",
|
|
3
|
+
RAISED = "raised",
|
|
4
|
+
SUGGESTED = "suggested"
|
|
5
|
+
}
|
|
6
|
+
export type Tests = {
|
|
7
|
+
action_id: string;
|
|
8
|
+
description: string;
|
|
9
|
+
hypothese_id: string;
|
|
10
|
+
successValue: number;
|
|
11
|
+
};
|
|
12
|
+
export type ActionPlan = {
|
|
13
|
+
id: string;
|
|
14
|
+
who: string;
|
|
15
|
+
who_id: string;
|
|
16
|
+
what: string;
|
|
17
|
+
when: string;
|
|
18
|
+
tests?: Tests[];
|
|
19
|
+
isTested?: boolean;
|
|
20
|
+
expectedResult: string;
|
|
21
|
+
action_completed: string;
|
|
22
|
+
ratings: Rating[];
|
|
23
|
+
who_data: {
|
|
24
|
+
name: string;
|
|
25
|
+
uuid: string;
|
|
26
|
+
email: string;
|
|
27
|
+
avatar?: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type HypothesisType = {
|
|
31
|
+
id: string;
|
|
32
|
+
new: boolean;
|
|
33
|
+
changed: boolean;
|
|
34
|
+
actionPlan: ActionPlan[];
|
|
35
|
+
description: string;
|
|
36
|
+
isPriorized: boolean;
|
|
37
|
+
title: string;
|
|
38
|
+
type: HypothesisEnum;
|
|
39
|
+
votes: Vote[];
|
|
40
|
+
};
|
|
41
|
+
export type Rating = {
|
|
42
|
+
id: number;
|
|
43
|
+
anonymous: boolean;
|
|
44
|
+
user_uuid: string;
|
|
45
|
+
obj_code: string;
|
|
46
|
+
obj_type: string;
|
|
47
|
+
rating: number;
|
|
48
|
+
description?: string;
|
|
49
|
+
user: {
|
|
50
|
+
name: string;
|
|
51
|
+
uuid: string;
|
|
52
|
+
email: string;
|
|
53
|
+
avatar?: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export type Vote = {
|
|
57
|
+
id: number;
|
|
58
|
+
user_uuid: string;
|
|
59
|
+
obj_code: string;
|
|
60
|
+
obj_type: string;
|
|
61
|
+
user: {
|
|
62
|
+
name: string;
|
|
63
|
+
uuid: string;
|
|
64
|
+
email: string;
|
|
65
|
+
avatar?: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/hypothesisComponent/types.ts"],"names":[],"mappings":"AACA,oBAAY,cAAc;IACxB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,SAAS,cAAc;CACxB;AAED,MAAM,MAAM,KAAK,GAAG;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAA;AACD,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AACD,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,EAAE,CAAA;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;CAEd,CAAA;AAED,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA"}
|