@addsign/moje-agenda-shared-lib 2.0.11 → 2.0.13

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.
Files changed (152) hide show
  1. package/dist/Dialog-4hkwYHTJ.js +424 -0
  2. package/dist/Dialog-4hkwYHTJ.js.map +1 -0
  3. package/dist/Dialog-CrRXl-G2.js +424 -0
  4. package/dist/Dialog-CrRXl-G2.js.map +1 -0
  5. package/dist/Dialog-D9rsAQnn.js +424 -0
  6. package/dist/Dialog-D9rsAQnn.js.map +1 -0
  7. package/dist/Dialog-v5zgZE_G.js +424 -0
  8. package/dist/Dialog-v5zgZE_G.js.map +1 -0
  9. package/dist/assets/style.css +192 -0
  10. package/dist/components/datatable/DataTable.js +2 -1
  11. package/dist/components/datatable/DataTable.js.map +1 -1
  12. package/dist/components/datatable/DataTableServer.js +2 -1
  13. package/dist/components/datatable/DataTableServer.js.map +1 -1
  14. package/dist/components/form/AutocompleteSearchBar.js +2 -1
  15. package/dist/components/form/AutocompleteSearchBar.js.map +1 -1
  16. package/dist/components/form/AutocompleteSearchBarServer.js +2 -1
  17. package/dist/components/form/AutocompleteSearchBarServer.js.map +1 -1
  18. package/dist/components/form/FileInput.js +3 -2
  19. package/dist/components/form/FileInput.js.map +1 -1
  20. package/dist/components/form/FileInputMultiple.js +5 -3
  21. package/dist/components/form/FileInputMultiple.js.map +1 -1
  22. package/dist/components/form/FormField.js +2 -1
  23. package/dist/components/form/FormField.js.map +1 -1
  24. package/dist/components/form/PositionsSelectorSingle.js +2 -1
  25. package/dist/components/form/PositionsSelectorSingle.js.map +1 -1
  26. package/dist/components/form/SelectField.js +2 -1
  27. package/dist/components/form/SelectField.js.map +1 -1
  28. package/dist/components/layout/CollapsibleSection.d.ts +11 -0
  29. package/dist/components/layout/CollapsibleSection.js +35 -0
  30. package/dist/components/layout/CollapsibleSection.js.map +1 -0
  31. package/dist/components/profiles/ProfileOverview.js +2 -1
  32. package/dist/components/profiles/ProfileOverview.js.map +1 -1
  33. package/dist/components/ui/Combobox.js +1 -1
  34. package/dist/components/ui/DateTimePicker.js +35 -28
  35. package/dist/components/ui/DateTimePicker.js.map +1 -1
  36. package/dist/components/ui/Dialog.js +1 -1
  37. package/dist/components/ui/ScrollArea.js +1 -1
  38. package/dist/components/ui/checkbox.js +1 -1
  39. package/dist/components/ui/command.js +2 -2
  40. package/dist/components/ui/datepicker.js +1 -1
  41. package/dist/components/ui/label.js +1 -1
  42. package/dist/components/ui/popover.js +7 -314
  43. package/dist/components/ui/popover.js.map +1 -1
  44. package/dist/components/ui/radioGroup.js +1 -1
  45. package/dist/components/ui/select.js +7 -5
  46. package/dist/components/ui/select.js.map +1 -1
  47. package/dist/components/ui/separator.js +1 -1
  48. package/dist/components/ui/sonner.d.ts +5 -0
  49. package/dist/components/ui/sonner.js +27 -0
  50. package/dist/components/ui/sonner.js.map +1 -0
  51. package/dist/components/ui/toast.d.ts +15 -0
  52. package/dist/components/ui/toast.js +742 -0
  53. package/dist/components/ui/toast.js.map +1 -0
  54. package/dist/components/ui/tooltip.js +4 -4
  55. package/dist/index-B4D9tlF2.js +37 -0
  56. package/dist/index-B4D9tlF2.js.map +1 -0
  57. package/dist/index-BIGXjoju.js +1162 -0
  58. package/dist/index-BIGXjoju.js.map +1 -0
  59. package/dist/index-BM2wqH4l.js +270 -0
  60. package/dist/index-BM2wqH4l.js.map +1 -0
  61. package/dist/index-BkUJPEGE.js +43 -0
  62. package/dist/index-BkUJPEGE.js.map +1 -0
  63. package/dist/index-BqfaqJMm.js +43 -0
  64. package/dist/index-BqfaqJMm.js.map +1 -0
  65. package/dist/index-BvG0B6Se.js +43 -0
  66. package/dist/index-BvG0B6Se.js.map +1 -0
  67. package/dist/index-ByYhNx4V.js +2204 -0
  68. package/dist/index-ByYhNx4V.js.map +1 -0
  69. package/dist/index-C1NhngpB.js +2212 -0
  70. package/dist/index-C1NhngpB.js.map +1 -0
  71. package/dist/index-C5uX_8yI.js +36 -0
  72. package/dist/index-C5uX_8yI.js.map +1 -0
  73. package/dist/index-CEVipgcd.js +234 -0
  74. package/dist/index-CEVipgcd.js.map +1 -0
  75. package/dist/index-CFdw_5ue.js +2204 -0
  76. package/dist/index-CFdw_5ue.js.map +1 -0
  77. package/dist/index-CQ3u2ZB9.js +28845 -0
  78. package/dist/index-CQ3u2ZB9.js.map +1 -0
  79. package/dist/index-CcUZ0rsE.js +2397 -0
  80. package/dist/index-CcUZ0rsE.js.map +1 -0
  81. package/dist/index-CmEWEow1.js +304 -0
  82. package/dist/index-CmEWEow1.js.map +1 -0
  83. package/dist/index-CwJgIvMz.js +43 -0
  84. package/dist/index-CwJgIvMz.js.map +1 -0
  85. package/dist/index-CxRvlMsQ.js +1162 -0
  86. package/dist/index-CxRvlMsQ.js.map +1 -0
  87. package/dist/index-Cxv2lY-3.js +234 -0
  88. package/dist/index-Cxv2lY-3.js.map +1 -0
  89. package/dist/index-CzU-7Pp-.js +1162 -0
  90. package/dist/index-CzU-7Pp-.js.map +1 -0
  91. package/dist/index-D2vw2lEy.js +2266 -0
  92. package/dist/index-D2vw2lEy.js.map +1 -0
  93. package/dist/index-D71KqwUL.js +28839 -0
  94. package/dist/index-D71KqwUL.js.map +1 -0
  95. package/dist/index-DVCdWg5e.js +36 -0
  96. package/dist/index-DVCdWg5e.js.map +1 -0
  97. package/dist/index-DWPKrsrN.js +234 -0
  98. package/dist/index-DWPKrsrN.js.map +1 -0
  99. package/dist/index-DiJxz9_S.js +36 -0
  100. package/dist/index-DiJxz9_S.js.map +1 -0
  101. package/dist/index-DjS0QG2f.js +28845 -0
  102. package/dist/index-DjS0QG2f.js.map +1 -0
  103. package/dist/index-FMLr5tN7.js +19 -0
  104. package/dist/index-FMLr5tN7.js.map +1 -0
  105. package/dist/index-GT3w9A2i.js +19 -0
  106. package/dist/index-GT3w9A2i.js.map +1 -0
  107. package/dist/index-Gbap2fMl.js +304 -0
  108. package/dist/index-Gbap2fMl.js.map +1 -0
  109. package/dist/index-R1AkuSsS.js +2204 -0
  110. package/dist/index-R1AkuSsS.js.map +1 -0
  111. package/dist/index-VCw-BbEd.js +36 -0
  112. package/dist/index-VCw-BbEd.js.map +1 -0
  113. package/dist/index-WjZKx4Rq.js +2266 -0
  114. package/dist/index-WjZKx4Rq.js.map +1 -0
  115. package/dist/index-XoubH6QK.js +19 -0
  116. package/dist/index-XoubH6QK.js.map +1 -0
  117. package/dist/index-cAAySw6z.js +19 -0
  118. package/dist/index-cAAySw6z.js.map +1 -0
  119. package/dist/index-eb1oES0O.js +234 -0
  120. package/dist/index-eb1oES0O.js.map +1 -0
  121. package/dist/index-efRbPAF9.js +304 -0
  122. package/dist/index-efRbPAF9.js.map +1 -0
  123. package/dist/index-g4PMBWfd.js +1162 -0
  124. package/dist/index-g4PMBWfd.js.map +1 -0
  125. package/dist/index-kx4d2yA2.js +2204 -0
  126. package/dist/index-kx4d2yA2.js.map +1 -0
  127. package/dist/index-tDQ16jIS.js +304 -0
  128. package/dist/index-tDQ16jIS.js.map +1 -0
  129. package/dist/index-u7IL3f7h.js +28811 -0
  130. package/dist/index-u7IL3f7h.js.map +1 -0
  131. package/dist/index.es-CORXX5Cy.js +9594 -0
  132. package/dist/index.es-CORXX5Cy.js.map +1 -0
  133. package/dist/jspdf.plugin.autotable-f-NQ-KEg.js +11475 -0
  134. package/dist/jspdf.plugin.autotable-f-NQ-KEg.js.map +1 -0
  135. package/dist/main.d.ts +2 -0
  136. package/dist/main.js +21 -15
  137. package/dist/main.js.map +1 -1
  138. package/dist/popover-BtPiVBn9.js +319 -0
  139. package/dist/popover-BtPiVBn9.js.map +1 -0
  140. package/dist/types.d.ts +1 -0
  141. package/dist/types.js.map +1 -1
  142. package/dist/utils/handleErrors.js +2 -1
  143. package/dist/utils/handleErrors.js.map +1 -1
  144. package/lib/components/form/FileInputMultiple.tsx +1 -0
  145. package/lib/components/layout/CollapsibleSection.tsx +48 -0
  146. package/lib/components/ui/DateTimePicker.tsx +50 -37
  147. package/lib/components/ui/sonner.tsx +31 -0
  148. package/lib/components/ui/toast.tsx +129 -0
  149. package/lib/main.ts +5 -0
  150. package/lib/types.ts +1 -0
  151. package/lib/utils/handleErrors.ts +2 -1
  152. package/package.json +4 -1
package/dist/main.d.ts CHANGED
@@ -17,6 +17,7 @@ export { default as Modal } from './components/Modal.tsx';
17
17
  export { default as PositionsSelectorSingle } from './components/form/PositionsSelectorSingle.tsx';
18
18
  export { default as Calendar } from './components/Calendar.tsx';
19
19
  export { default as DataTable } from './components/datatable/DataTable.tsx';
20
+ export { default as CollapsibleSection } from './components/layout/CollapsibleSection.tsx';
20
21
  export { default as DataTableServer, resetAllDataTablePaging, } from './components/datatable/DataTableServer.tsx';
21
22
  export { default as DateRangeField } from './components/form/DateRangeField.tsx';
22
23
  export { default as DateField } from './components/form/DateField.tsx';
@@ -43,6 +44,7 @@ export * from './components/ui/tooltip.tsx';
43
44
  export * from './components/ui/separator.tsx';
44
45
  export * from './components/ui/textarea.tsx';
45
46
  export * from './components/ui/checkbox.tsx';
47
+ export * from './components/ui/sonner.tsx';
46
48
  export { Button as ButtonCN, buttonVariants } from './components/ui/button.tsx';
47
49
  export { Calendar as CalendarCn } from './components/ui/Calendar.tsx';
48
50
  export { default as DateTimePicker } from './components/ui/DateTimePicker.tsx';
package/dist/main.js CHANGED
@@ -17,11 +17,12 @@ import { Modal } from "./components/Modal.js";
17
17
  import { default as default14 } from "./components/form/PositionsSelectorSingle.js";
18
18
  import { default as default15 } from "./components/Calendar.js";
19
19
  import { default as default16 } from "./components/datatable/DataTable.js";
20
- import { default as default17, resetAllDataTablePaging } from "./components/datatable/DataTableServer.js";
21
- import { default as default18 } from "./components/form/DateRangeField.js";
22
- import { default as default19 } from "./components/form/DateField.js";
23
- import { default as default20 } from "./components/SpinnerIcon.js";
24
- import { default as default21 } from "./utils/PdfManager.js";
20
+ import { default as default17 } from "./components/layout/CollapsibleSection.js";
21
+ import { default as default18, resetAllDataTablePaging } from "./components/datatable/DataTableServer.js";
22
+ import { default as default19 } from "./components/form/DateRangeField.js";
23
+ import { default as default20 } from "./components/form/DateField.js";
24
+ import { default as default21 } from "./components/SpinnerIcon.js";
25
+ import { default as default22 } from "./utils/PdfManager.js";
25
26
  import { FederationContext, FederationContextProvider } from "./contexts/FederationContext.js";
26
27
  import { useFederationContext } from "./contexts/useFederationContext.js";
27
28
  import { getFullName, getFullNameList, getFullNameListPositionWithEmployee, getFullNamePositionWithEmployee } from "./utils/getFullName.js";
@@ -30,7 +31,7 @@ import { handleErrors } from "./utils/handleErrors.js";
30
31
  import { hasRightInModule } from "./utils/hasRightInModule.js";
31
32
  import { hasRole } from "./utils/hasRole.js";
32
33
  import { EApproverRoles, EApproverTypes, EDecisionsTranslations, EEntity, Eagendy, Eassignments, Estavy } from "./types.js";
33
- import { D, c, e, i, g, f, b, a, h, d } from "./Dialog-BtXGfOmv.js";
34
+ import { D, c, e, i, g, f, b, a, h, d } from "./Dialog-D9rsAQnn.js";
34
35
  import { ScrollArea, ScrollBar } from "./components/ui/ScrollArea.js";
35
36
  import { Input } from "./components/ui/input.js";
36
37
  import { Form, FormControl, FormDescription, FormFieldCN, FormItem, FormLabel, FormMessage, useFormField } from "./components/ui/form.js";
@@ -42,10 +43,12 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./comp
42
43
  import { Separator } from "./components/ui/separator.js";
43
44
  import { Textarea } from "./components/ui/textarea.js";
44
45
  import { Checkbox } from "./components/ui/checkbox.js";
46
+ import { Toaster } from "./components/ui/sonner.js";
45
47
  import { Button, buttonVariants } from "./components/ui/button.js";
46
48
  import { C } from "./Calendar-DWT4e7Th.js";
47
- import { default as default22 } from "./components/ui/DateTimePicker.js";
48
- import { default as default23 } from "./components/ui/DatePicker.js";
49
+ import { default as default23 } from "./components/ui/DateTimePicker.js";
50
+ import { default as default24 } from "./components/ui/DatePicker.js";
51
+ import { t } from "./index-CmEWEow1.js";
49
52
  export {
50
53
  default3 as AutocompleteSearchBar,
51
54
  default4 as AutocompleteSearchBarServer,
@@ -54,6 +57,7 @@ export {
54
57
  default15 as Calendar,
55
58
  C as CalendarCn,
56
59
  Checkbox,
60
+ default17 as CollapsibleSection,
57
61
  Command,
58
62
  CommandDialog,
59
63
  CommandEmpty,
@@ -65,11 +69,11 @@ export {
65
69
  CommandShortcut,
66
70
  ConfirmationModalDialog,
67
71
  default16 as DataTable,
68
- default17 as DataTableServer,
69
- default19 as DateField,
70
- default23 as DatePicker,
71
- default18 as DateRangeField,
72
- default22 as DateTimePicker,
72
+ default18 as DataTableServer,
73
+ default20 as DateField,
74
+ default24 as DatePicker,
75
+ default19 as DateRangeField,
76
+ default23 as DateTimePicker,
73
77
  D as Dialog,
74
78
  c as DialogClose,
75
79
  e as DialogContent,
@@ -104,7 +108,7 @@ export {
104
108
  Modal,
105
109
  ModalDialog,
106
110
  default12 as PageTitle,
107
- default21 as PdfManager,
111
+ default22 as PdfManager,
108
112
  default14 as PositionsSelectorSingle,
109
113
  default8 as RadioGroup,
110
114
  RadioGroupCN,
@@ -125,8 +129,9 @@ export {
125
129
  SelectValue,
126
130
  Separator,
127
131
  default13 as Spinner,
128
- default20 as SpinnerIcon,
132
+ default21 as SpinnerIcon,
129
133
  Textarea,
134
+ Toaster,
130
135
  Tooltip,
131
136
  TooltipContent,
132
137
  TooltipProvider,
@@ -141,6 +146,7 @@ export {
141
146
  hasRightInModule,
142
147
  hasRole,
143
148
  resetAllDataTablePaging,
149
+ t as toast,
144
150
  useFederationContext,
145
151
  useFormField
146
152
  };
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,319 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { c as createContextScope, b as composeEventHandlers } from "./index-CDCkSjVs.js";
4
+ import { u as useComposedRefs, S as Slot } from "./index-D9mvqz1C.js";
5
+ import { D as DismissableLayer } from "./index-CEVipgcd.js";
6
+ import { h as hideOthers, R as ReactRemoveScroll, u as useFocusGuards, F as FocusScope } from "./index-g4PMBWfd.js";
7
+ import { u as useId } from "./index-Deoi9R3y.js";
8
+ import { c as createPopperScope, A as Anchor, C as Content, a as Arrow, R as Root2$1 } from "./index-kx4d2yA2.js";
9
+ import { P as Portal$1 } from "./index-cAAySw6z.js";
10
+ import { P as Presence } from "./index-CA2QNu6z.js";
11
+ import { P as Primitive } from "./index-BkUJPEGE.js";
12
+ import { u as useControllableState } from "./index-DFSwSCB0.js";
13
+ import { cn } from "./utils/utils.js";
14
+ var POPOVER_NAME = "Popover";
15
+ var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
16
+ createPopperScope
17
+ ]);
18
+ var usePopperScope = createPopperScope();
19
+ var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
20
+ var Popover$1 = (props) => {
21
+ const {
22
+ __scopePopover,
23
+ children,
24
+ open: openProp,
25
+ defaultOpen,
26
+ onOpenChange,
27
+ modal = false
28
+ } = props;
29
+ const popperScope = usePopperScope(__scopePopover);
30
+ const triggerRef = React.useRef(null);
31
+ const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
32
+ const [open = false, setOpen] = useControllableState({
33
+ prop: openProp,
34
+ defaultProp: defaultOpen,
35
+ onChange: onOpenChange
36
+ });
37
+ return /* @__PURE__ */ jsx(Root2$1, { ...popperScope, children: /* @__PURE__ */ jsx(
38
+ PopoverProvider,
39
+ {
40
+ scope: __scopePopover,
41
+ contentId: useId(),
42
+ triggerRef,
43
+ open,
44
+ onOpenChange: setOpen,
45
+ onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
46
+ hasCustomAnchor,
47
+ onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),
48
+ onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),
49
+ modal,
50
+ children
51
+ }
52
+ ) });
53
+ };
54
+ Popover$1.displayName = POPOVER_NAME;
55
+ var ANCHOR_NAME = "PopoverAnchor";
56
+ var PopoverAnchor = React.forwardRef(
57
+ (props, forwardedRef) => {
58
+ const { __scopePopover, ...anchorProps } = props;
59
+ const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
60
+ const popperScope = usePopperScope(__scopePopover);
61
+ const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
62
+ React.useEffect(() => {
63
+ onCustomAnchorAdd();
64
+ return () => onCustomAnchorRemove();
65
+ }, [onCustomAnchorAdd, onCustomAnchorRemove]);
66
+ return /* @__PURE__ */ jsx(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
67
+ }
68
+ );
69
+ PopoverAnchor.displayName = ANCHOR_NAME;
70
+ var TRIGGER_NAME = "PopoverTrigger";
71
+ var PopoverTrigger$1 = React.forwardRef(
72
+ (props, forwardedRef) => {
73
+ const { __scopePopover, ...triggerProps } = props;
74
+ const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
75
+ const popperScope = usePopperScope(__scopePopover);
76
+ const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
77
+ const trigger = /* @__PURE__ */ jsx(
78
+ Primitive.button,
79
+ {
80
+ type: "button",
81
+ "aria-haspopup": "dialog",
82
+ "aria-expanded": context.open,
83
+ "aria-controls": context.contentId,
84
+ "data-state": getState(context.open),
85
+ ...triggerProps,
86
+ ref: composedTriggerRef,
87
+ onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
88
+ }
89
+ );
90
+ return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(Anchor, { asChild: true, ...popperScope, children: trigger });
91
+ }
92
+ );
93
+ PopoverTrigger$1.displayName = TRIGGER_NAME;
94
+ var PORTAL_NAME = "PopoverPortal";
95
+ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {
96
+ forceMount: void 0
97
+ });
98
+ var PopoverPortal = (props) => {
99
+ const { __scopePopover, forceMount, children, container } = props;
100
+ const context = usePopoverContext(PORTAL_NAME, __scopePopover);
101
+ return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$1, { asChild: true, container, children }) }) });
102
+ };
103
+ PopoverPortal.displayName = PORTAL_NAME;
104
+ var CONTENT_NAME = "PopoverContent";
105
+ var PopoverContent$1 = React.forwardRef(
106
+ (props, forwardedRef) => {
107
+ const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);
108
+ const { forceMount = portalContext.forceMount, ...contentProps } = props;
109
+ const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
110
+ return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
111
+ }
112
+ );
113
+ PopoverContent$1.displayName = CONTENT_NAME;
114
+ var PopoverContentModal = React.forwardRef(
115
+ (props, forwardedRef) => {
116
+ const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
117
+ const contentRef = React.useRef(null);
118
+ const composedRefs = useComposedRefs(forwardedRef, contentRef);
119
+ const isRightClickOutsideRef = React.useRef(false);
120
+ React.useEffect(() => {
121
+ const content = contentRef.current;
122
+ if (content)
123
+ return hideOthers(content);
124
+ }, []);
125
+ return /* @__PURE__ */ jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(
126
+ PopoverContentImpl,
127
+ {
128
+ ...props,
129
+ ref: composedRefs,
130
+ trapFocus: context.open,
131
+ disableOutsidePointerEvents: true,
132
+ onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
133
+ var _a;
134
+ event.preventDefault();
135
+ if (!isRightClickOutsideRef.current)
136
+ (_a = context.triggerRef.current) == null ? void 0 : _a.focus();
137
+ }),
138
+ onPointerDownOutside: composeEventHandlers(
139
+ props.onPointerDownOutside,
140
+ (event) => {
141
+ const originalEvent = event.detail.originalEvent;
142
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
143
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
144
+ isRightClickOutsideRef.current = isRightClick;
145
+ },
146
+ { checkForDefaultPrevented: false }
147
+ ),
148
+ onFocusOutside: composeEventHandlers(
149
+ props.onFocusOutside,
150
+ (event) => event.preventDefault(),
151
+ { checkForDefaultPrevented: false }
152
+ )
153
+ }
154
+ ) });
155
+ }
156
+ );
157
+ var PopoverContentNonModal = React.forwardRef(
158
+ (props, forwardedRef) => {
159
+ const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
160
+ const hasInteractedOutsideRef = React.useRef(false);
161
+ const hasPointerDownOutsideRef = React.useRef(false);
162
+ return /* @__PURE__ */ jsx(
163
+ PopoverContentImpl,
164
+ {
165
+ ...props,
166
+ ref: forwardedRef,
167
+ trapFocus: false,
168
+ disableOutsidePointerEvents: false,
169
+ onCloseAutoFocus: (event) => {
170
+ var _a, _b;
171
+ (_a = props.onCloseAutoFocus) == null ? void 0 : _a.call(props, event);
172
+ if (!event.defaultPrevented) {
173
+ if (!hasInteractedOutsideRef.current)
174
+ (_b = context.triggerRef.current) == null ? void 0 : _b.focus();
175
+ event.preventDefault();
176
+ }
177
+ hasInteractedOutsideRef.current = false;
178
+ hasPointerDownOutsideRef.current = false;
179
+ },
180
+ onInteractOutside: (event) => {
181
+ var _a, _b;
182
+ (_a = props.onInteractOutside) == null ? void 0 : _a.call(props, event);
183
+ if (!event.defaultPrevented) {
184
+ hasInteractedOutsideRef.current = true;
185
+ if (event.detail.originalEvent.type === "pointerdown") {
186
+ hasPointerDownOutsideRef.current = true;
187
+ }
188
+ }
189
+ const target = event.target;
190
+ const targetIsTrigger = (_b = context.triggerRef.current) == null ? void 0 : _b.contains(target);
191
+ if (targetIsTrigger)
192
+ event.preventDefault();
193
+ if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
194
+ event.preventDefault();
195
+ }
196
+ }
197
+ }
198
+ );
199
+ }
200
+ );
201
+ var PopoverContentImpl = React.forwardRef(
202
+ (props, forwardedRef) => {
203
+ const {
204
+ __scopePopover,
205
+ trapFocus,
206
+ onOpenAutoFocus,
207
+ onCloseAutoFocus,
208
+ disableOutsidePointerEvents,
209
+ onEscapeKeyDown,
210
+ onPointerDownOutside,
211
+ onFocusOutside,
212
+ onInteractOutside,
213
+ ...contentProps
214
+ } = props;
215
+ const context = usePopoverContext(CONTENT_NAME, __scopePopover);
216
+ const popperScope = usePopperScope(__scopePopover);
217
+ useFocusGuards();
218
+ return /* @__PURE__ */ jsx(
219
+ FocusScope,
220
+ {
221
+ asChild: true,
222
+ loop: true,
223
+ trapped: trapFocus,
224
+ onMountAutoFocus: onOpenAutoFocus,
225
+ onUnmountAutoFocus: onCloseAutoFocus,
226
+ children: /* @__PURE__ */ jsx(
227
+ DismissableLayer,
228
+ {
229
+ asChild: true,
230
+ disableOutsidePointerEvents,
231
+ onInteractOutside,
232
+ onEscapeKeyDown,
233
+ onPointerDownOutside,
234
+ onFocusOutside,
235
+ onDismiss: () => context.onOpenChange(false),
236
+ children: /* @__PURE__ */ jsx(
237
+ Content,
238
+ {
239
+ "data-state": getState(context.open),
240
+ role: "dialog",
241
+ id: context.contentId,
242
+ ...popperScope,
243
+ ...contentProps,
244
+ ref: forwardedRef,
245
+ style: {
246
+ ...contentProps.style,
247
+ // re-namespace exposed content custom properties
248
+ ...{
249
+ "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
250
+ "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
251
+ "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
252
+ "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
253
+ "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
254
+ }
255
+ }
256
+ }
257
+ )
258
+ }
259
+ )
260
+ }
261
+ );
262
+ }
263
+ );
264
+ var CLOSE_NAME = "PopoverClose";
265
+ var PopoverClose = React.forwardRef(
266
+ (props, forwardedRef) => {
267
+ const { __scopePopover, ...closeProps } = props;
268
+ const context = usePopoverContext(CLOSE_NAME, __scopePopover);
269
+ return /* @__PURE__ */ jsx(
270
+ Primitive.button,
271
+ {
272
+ type: "button",
273
+ ...closeProps,
274
+ ref: forwardedRef,
275
+ onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
276
+ }
277
+ );
278
+ }
279
+ );
280
+ PopoverClose.displayName = CLOSE_NAME;
281
+ var ARROW_NAME = "PopoverArrow";
282
+ var PopoverArrow = React.forwardRef(
283
+ (props, forwardedRef) => {
284
+ const { __scopePopover, ...arrowProps } = props;
285
+ const popperScope = usePopperScope(__scopePopover);
286
+ return /* @__PURE__ */ jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
287
+ }
288
+ );
289
+ PopoverArrow.displayName = ARROW_NAME;
290
+ function getState(open) {
291
+ return open ? "open" : "closed";
292
+ }
293
+ var Root2 = Popover$1;
294
+ var Trigger = PopoverTrigger$1;
295
+ var Portal = PopoverPortal;
296
+ var Content2 = PopoverContent$1;
297
+ const Popover = Root2;
298
+ const PopoverTrigger = Trigger;
299
+ const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
300
+ Content2,
301
+ {
302
+ ref,
303
+ align,
304
+ sideOffset,
305
+ className: cn(
306
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
307
+ className
308
+ ),
309
+ ...props
310
+ }
311
+ ) }));
312
+ PopoverContent.displayName = Content2.displayName;
313
+ export {
314
+ Popover as P,
315
+ PopoverTrigger as a,
316
+ PopoverContent as b,
317
+ PopoverClose as c
318
+ };
319
+ //# sourceMappingURL=popover-BtPiVBn9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover-BtPiVBn9.js","sources":["../node_modules/@radix-ui/react-popover/dist/index.mjs","../lib/components/ui/popover.tsx"],"sourcesContent":["\"use client\";\n\n// packages/react/popover/src/Popover.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { jsx } from \"react/jsx-runtime\";\nvar POPOVER_NAME = \"Popover\";\nvar [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [\n createPopperScope\n]);\nvar usePopperScope = createPopperScope();\nvar [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);\nvar Popover = (props) => {\n const {\n __scopePopover,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = false\n } = props;\n const popperScope = usePopperScope(__scopePopover);\n const triggerRef = React.useRef(null);\n const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n PopoverProvider,\n {\n scope: __scopePopover,\n contentId: useId(),\n triggerRef,\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n hasCustomAnchor,\n onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),\n onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),\n modal,\n children\n }\n ) });\n};\nPopover.displayName = POPOVER_NAME;\nvar ANCHOR_NAME = \"PopoverAnchor\";\nvar PopoverAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...anchorProps } = props;\n const context = usePopoverContext(ANCHOR_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const { onCustomAnchorAdd, onCustomAnchorRemove } = context;\n React.useEffect(() => {\n onCustomAnchorAdd();\n return () => onCustomAnchorRemove();\n }, [onCustomAnchorAdd, onCustomAnchorRemove]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });\n }\n);\nPopoverAnchor.displayName = ANCHOR_NAME;\nvar TRIGGER_NAME = \"PopoverTrigger\";\nvar PopoverTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...triggerProps } = props;\n const context = usePopoverContext(TRIGGER_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n const trigger = /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: trigger });\n }\n);\nPopoverTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"PopoverPortal\";\nvar [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar PopoverPortal = (props) => {\n const { __scopePopover, forceMount, children, container } = props;\n const context = usePopoverContext(PORTAL_NAME, __scopePopover);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nPopoverPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"PopoverContent\";\nvar PopoverContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nPopoverContent.displayName = CONTENT_NAME;\nvar PopoverContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const isRightClickOutsideRef = React.useRef(false);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(\n PopoverContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(\n props.onPointerDownOutside,\n (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n isRightClickOutsideRef.current = isRightClick;\n },\n { checkForDefaultPrevented: false }\n ),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nvar PopoverContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n PopoverContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar PopoverContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopePopover,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n ...contentProps\n } = props;\n const context = usePopoverContext(CONTENT_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n useFocusGuards();\n return /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents,\n onInteractOutside,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onDismiss: () => context.onOpenChange(false),\n children: /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n \"data-state\": getState(context.open),\n role: \"dialog\",\n id: context.contentId,\n ...popperScope,\n ...contentProps,\n ref: forwardedRef,\n style: {\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-popover-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-popover-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-popover-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-popover-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-popover-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n )\n }\n )\n }\n );\n }\n);\nvar CLOSE_NAME = \"PopoverClose\";\nvar PopoverClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...closeProps } = props;\n const context = usePopoverContext(CLOSE_NAME, __scopePopover);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nPopoverClose.displayName = CLOSE_NAME;\nvar ARROW_NAME = \"PopoverArrow\";\nvar PopoverArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopePopover);\n return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nPopoverArrow.displayName = ARROW_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Root2 = Popover;\nvar Anchor2 = PopoverAnchor;\nvar Trigger = PopoverTrigger;\nvar Portal = PopoverPortal;\nvar Content2 = PopoverContent;\nvar Close = PopoverClose;\nvar Arrow2 = PopoverArrow;\nexport {\n Anchor2 as Anchor,\n Arrow2 as Arrow,\n Close,\n Content2 as Content,\n Popover,\n PopoverAnchor,\n PopoverArrow,\n PopoverClose,\n PopoverContent,\n PopoverPortal,\n PopoverTrigger,\n Portal,\n Root2 as Root,\n Trigger,\n createPopoverScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\r\n\r\nimport { cn } from \"../../utils/utils\";\r\n\r\nconst Popover = PopoverPrimitive.Root;\r\n\r\nconst PopoverTrigger = PopoverPrimitive.Trigger;\r\n\r\nconst PopoverContent = React.forwardRef<\r\n React.ElementRef<typeof PopoverPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\r\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\r\n <PopoverPrimitive.Portal>\r\n <PopoverPrimitive.Content\r\n ref={ref}\r\n align={align}\r\n sideOffset={sideOffset}\r\n className={cn(\r\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n </PopoverPrimitive.Portal>\r\n));\r\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\r\n\r\nexport { Popover, PopoverTrigger, PopoverContent };\r\n"],"names":["Popover","PopperPrimitive.Root","PopperPrimitive.Anchor","PopoverTrigger","PortalPrimitive","PopoverContent","RemoveScroll","PopperPrimitive.Content","PopperPrimitive.Arrow","PopoverPrimitive.Root","PopoverPrimitive.Trigger","PopoverPrimitive.Portal","PopoverPrimitive.Content"],"mappings":";;;;;;;;;;;;;AAqBA,IAAI,eAAe;AACnB,IAAI,CAAC,sBAAsB,kBAAkB,IAAI,mBAAmB,cAAc;AAAA,EAChF;AACF,CAAC;AACD,IAAI,iBAAiB,kBAAiB;AACtC,IAAI,CAAC,iBAAiB,iBAAiB,IAAI,qBAAqB,YAAY;AAC5E,IAAIA,YAAU,CAAC,UAAU;AACvB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACT,IAAG;AACJ,QAAM,cAAc,eAAe,cAAc;AACjD,QAAM,aAAa,MAAM,OAAO,IAAI;AACpC,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,MAAM,SAAS,KAAK;AAClE,QAAM,CAAC,OAAO,OAAO,OAAO,IAAI,qBAAqB;AAAA,IACnD,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACd,CAAG;AACD,SAAuB,oBAAIC,SAAsB,EAAE,GAAG,aAAa,UAA0B;AAAA,IAC3F;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,WAAW,MAAO;AAAA,MAClB;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,cAAc,MAAM,YAAY,MAAM,QAAQ,CAAC,aAAa,CAAC,QAAQ,GAAG,CAAC,OAAO,CAAC;AAAA,MACjF;AAAA,MACA,mBAAmB,MA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,WAAW,QAAQ,UAAU,aAAa,GAAG,GAAG,MAAM,GAAG,QAC3D,oBAAAC,QAAA,EACC,UAAA;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,EAAA;AACN,EAAA,CACF,CACD;AACD,eAAe,cAAcA,SAAyB;","x_google_ignoreList":[0]}
package/dist/types.d.ts CHANGED
@@ -58,6 +58,7 @@ export interface IEventMessage {
58
58
  message?: string;
59
59
  timeout?: number;
60
60
  classes?: string;
61
+ type?: "success" | "info" | "warning" | "error";
61
62
  }
62
63
  export type Events = {
63
64
  message?: IEventMessage;
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../lib/types.ts"],"sourcesContent":["import { AxiosInstance } from \"axios\";\r\nimport { Emitter } from \"mitt\";\r\n\r\n\r\nimport { UseFormReturn } from \"react-hook-form\";\r\n\r\nexport interface IUserInfo {\r\n contractGroup: number;\r\n degreeAfter: string;\r\n degreeBefore: string;\r\n departmentId: string;\r\n departmentName: string;\r\n departmentNameLong: string;\r\n email: string;\r\n employeeId: number;\r\n firstName: string;\r\n lastName: string;\r\n positionName: string;\r\n positionNumber: string;\r\n userId: string;\r\n mobile: string;\r\n phone: string;\r\n contractTitle: string;\r\n managerTitle: string;\r\n manager: string;\r\n functionTitle: string;\r\n officeAddress: string;\r\n\r\n}\r\nexport interface IBuilding {\r\n buildingId: string;\r\n nameFull: string;\r\n\r\n}export interface IBuildingLOV {\r\n buildingId: string;\r\n name: string;\r\n ofsId?: number;\r\n\r\n}\r\nexport interface IEmployee extends IUserInfo {\r\n\r\n deleted: boolean\r\n hasComputer: string\r\n language: string\r\n manager: string\r\n parentFrId: number\r\n positionId: number\r\n validFrom: string\r\n validTo: string\r\n contractType: number\r\n exemption: number\r\n activatedOn: string\r\n building?: IBuilding | null\r\n}\r\n\r\nexport interface IAuthApp {\r\n name: string;\r\n label: string;\r\n roles: string[];\r\n}\r\n\r\nexport type IAuthApps = IAuthApp[];\r\n\r\nexport interface IEventMessage {\r\n title?: string;\r\n message?: string;\r\n timeout?: number;\r\n classes?: string;\r\n}\r\n\r\nexport type Events = {\r\n message?: IEventMessage;\r\n loading?: boolean;\r\n};\r\n\r\nexport interface IContextValue {\r\n userInfo: IUserInfo;\r\n apiClient: AxiosInstance;\r\n authApps: IAuthApps;\r\n emitter: Emitter<Events>;\r\n isAdminApp?: boolean;\r\n}\r\nexport interface IOptionItem {\r\n value: string | number | null;\r\n label: string;\r\n description?: string;\r\n}\r\n\r\nexport type IFormProps = {\r\n formName: string;\r\n entityId: string;\r\n entityName: string;\r\n context: IContextValue;\r\n onSuccess: (path: string, message?: string) => void;\r\n};\r\nexport type IListProps = {\r\n id?: string;\r\n listName: string;\r\n filters: object; //{ [key: string]: any };\r\n context: IContextValue;\r\n title?: string;\r\n};\r\nexport type IPageProps = {\r\n pageName: string;\r\n context: IContextValue;\r\n};\r\n\r\nexport type IStartProcessProps = {\r\n context: IContextValue;\r\n\r\n onNavigate: (path: string) => void;\r\n};\r\n\r\nexport interface IModuleProcess {\r\n\r\n key: string;\r\n name: string;\r\n description: string;\r\n disabled?: boolean;\r\n\r\n}\r\nexport interface IModulePage {\r\n\r\n pageName: string;\r\n name: string;\r\n description: string;\r\n disabled?: boolean;\r\n roles?: string[];\r\n admin?: boolean;\r\n}\r\nexport interface IModuleSettings {\r\n\r\n key: string;\r\n name: string;\r\n description: string;\r\n disabled?: boolean;\r\n roles?: string[];\r\n admin?: boolean;\r\n\r\n}\r\n\r\nexport interface IModuleConstants {\r\n\r\n key: string\r\n name: string\r\n processes: IModuleProcess[],\r\n reports?: IModulePage[],\r\n pages?: IModulePage[],\r\n\r\n}\r\n\r\n\r\nexport interface IPosition {\r\n id: number;\r\n departmentId: string;\r\n positionName: string;\r\n positionNumber: string;\r\n manager: string;\r\n virtual: boolean;\r\n title: string;\r\n}\r\nexport interface IPositionEmployee extends IPosition {\r\n employee: IEmployee;\r\n}\r\nexport interface IEmployeePosition extends IEmployee {\r\n position: IPosition;\r\n}\r\nexport type { ICalendarItem } from \"./components/Calendar\";\r\n\r\n\r\nexport interface ITimeOffCategoryDto {\r\n id?: number;\r\n name?: string;\r\n}\r\nexport interface ITimeOffData {\r\n id: number;\r\n startDate: string;\r\n endDate: string;\r\n days?: number;\r\n year?: number;\r\n comment?: string;\r\n applicant?: IEmployee;\r\n place?: string;\r\n leaveType?: string;\r\n initiator?: string;\r\n dateFromEvidence?: string;\r\n dateToEvidence?: string;\r\n status?: number;\r\n statusText?: string;\r\n timeOffCategoryDto: ITimeOffCategoryDto;\r\n applicantContractGroup?: number;\r\n name?: string;\r\n daysOfEvidence?: number;\r\n daysInStartMonth?: number;\r\n daysInEndMonth?: number;\r\n lastChange?: string;\r\n created?: string;\r\n updated?: string;\r\n attachment?: IAttachment;\r\n steps?: IStep[];\r\n}\r\n\r\nexport interface IDepartment {\r\n departmentId: string;\r\n nameLong: string;\r\n parentDepartmentId: string;\r\n parentLocationId: number;\r\n nameShort: string;\r\n}\r\n\r\nexport interface IPageable<T> {\r\n content: T[];\r\n empty: boolean;\r\n first: boolean;\r\n last: boolean;\r\n number: number;\r\n numberOfElements: number;\r\n size: number;\r\n totalElements: number;\r\n totalPages: number;\r\n}\r\n\r\n\r\nexport interface IFormFieldGlobalProps {\r\n label?: string;\r\n description?: string;\r\n name: string;\r\n type?: string;\r\n value?: any;\r\n\r\n methods?: UseFormReturn<any>;\r\n\r\n errors?: any;\r\n register?: any;\r\n disabled?: boolean;\r\n required?: boolean;\r\n clearable?: boolean;\r\n placeholder?: string;\r\n children?: React.ReactNode;\r\n className?: string;\r\n rounded?: boolean;\r\n onInputChange: (\r\n e: React.ChangeEvent<\r\n HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | any\r\n >\r\n ) => void;\r\n\r\n onFocus?: () => void;\r\n onBlur?: () => void;\r\n inline?: boolean,\r\n ref?: any;\r\n}\r\n\r\n\r\nexport interface SysConfigHolidayEntityResponse {\r\n \"id\": number,\r\n \"date\": string,\r\n \"day\": number,\r\n \"month\": number,\r\n \"year\": number,\r\n \"dayOfWeek\": number\r\n}\r\n\r\n\r\nexport interface IProfileApprover {\r\n id: number;\r\n role: number;\r\n roleTxt: string;\r\n approverOrder: number;\r\n approver: IEmployee;\r\n position: IPositionEmployee;\r\n isEmployee: boolean;\r\n ignore: boolean;\r\n makePreapprover: boolean;\r\n}\r\n\r\n\r\nexport enum EApproverRoles {\r\n predschvalovatel = 10,\r\n zastupce = 20,\r\n zastupce9 = 30,\r\n vedouci = 40,\r\n vyssiSchvalovatel = 60,\r\n vyssiSchvalovatelZastupce = 61,\r\n vyssiSchvalovatelZastupce9 = 62,\r\n dochazkovyVedouci = 90,\r\n}\r\nexport enum EApproverTypes {\r\n vyssiSchvalovatel = \"vyssiSchvalovatel\",\r\n vyssiSchvalovatelZastupce = \"vyssiSchvalovatelZastupce\",\r\n vyssiSchvalovatelZastupce9 = \"vyssiSchvalovatelZastupce9\",\r\n vedouci = \"vedouci\",\r\n zastupce9 = \"zastupce9\",\r\n zastupce = \"zastupce\",\r\n predschvalovatel1 = \"predschvalovatel1\",\r\n predschvalovatel2 = \"predschvalovatel2\",\r\n predschvalovatel3 = \"predschvalovatel3\",\r\n dochazkovyVedouci = \"dochazkovyVedouci\",\r\n}\r\n\r\nexport interface IAttachment {\r\n\r\n\r\n id: number;\r\n created: string;\r\n createdByEmpId: string;\r\n updated: string;\r\n updatedByEmpId: string;\r\n mimeType: string;\r\n size: number;\r\n filename: string;\r\n\r\n}\r\n\r\n\r\n\r\nexport interface IStep {\r\n\r\n\r\n date: string;\r\n type: number;\r\n comment: string;\r\n decision: string;\r\n employee: IEmployee;\r\n\r\n}\r\n\r\n\r\nexport enum EDecisionsTranslations {\r\n approved = 'Schváleno',\r\n rejected = 'Zamítnuto',\r\n cancelled = 'Stornováno',\r\n evided = 'Zaevidováno',\r\n}\r\n\r\n\r\nexport interface ProcessDefinitionDto {\r\n /**\r\n * The id of the process definition\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n id?: string | null;\r\n\r\n /**\r\n * The key of the process definition, i.e., the id of the BPMN 2.0 XML process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n key?: string | null;\r\n\r\n /**\r\n * The category of the process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n category?: string | null;\r\n\r\n /**\r\n * The description of the process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n description?: string | null;\r\n\r\n /**\r\n * The name of the process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n name?: string | null;\r\n\r\n /**\r\n * The version of the process definition that the engine assigned to it.\r\n *\r\n * @type {number}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n version?: number | null;\r\n\r\n /**\r\n * The file name of the process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n resource?: string | null;\r\n\r\n /**\r\n * The deployment id of the process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n deploymentId?: string | null;\r\n\r\n /**\r\n * The file name of the process definition diagram, if it exists.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n diagram?: string | null;\r\n\r\n /**\r\n * A flag indicating whether the definition is suspended or not.\r\n *\r\n * @type {boolean}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n suspended?: boolean | null;\r\n\r\n /**\r\n * The tenant id of the process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n tenantId?: string | null;\r\n\r\n /**\r\n * The version tag of the process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n versionTag?: string | null;\r\n\r\n /**\r\n * History time to live value of the process definition. Is used within [History cleanup](https://docs.camunda.org/manual/7.20/user-guide/process-engine/history/#history-cleanup).\r\n *\r\n * @type {number}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n historyTimeToLive?: number | null;\r\n\r\n /**\r\n * A flag indicating whether the process definition is startable in Tasklist or not.\r\n *\r\n * @type {boolean}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n startableInTasklist?: boolean | null;\r\n}\r\n\r\nexport interface VariableValueDto {\r\n /**\r\n * @type {AnyValue}\r\n * @memberof VariableValueDto\r\n */\r\n value?: unknown;\r\n\r\n /**\r\n * The value type of the variable.\r\n *\r\n * @type {string}\r\n * @memberof VariableValueDto\r\n */\r\n type?: string | null;\r\n\r\n /**\r\n * A JSON object containing additional, value-type-dependent properties. For serialized variables of type Object, the following properties can be provided: * `objectTypeName`: A string representation of the object's type name. * `serializationDataFormat`: The serialization format used to store the variable. For serialized variables of type File, the following properties can be provided: * `filename`: The name of the file. This is not the variable name but the name that will be used when downloading the file again. * `mimetype`: The MIME type of the file that is being uploaded. * `encoding`: The encoding of the file that is being uploaded. The following property can be provided for all value types: * `transient`: Indicates whether the variable should be transient or not. See [documentation](https://docs.camunda.org/manual/7.20/user-guide/process-engine/variables#transient-variables) for more informations. (Not applicable for `decision-definition`, ` /process-instance/variables-async`, and `/migration/executeAsync` endpoints)\r\n *\r\n * @type {{ [key: string]: any; }}\r\n * @memberof VariableValueDto\r\n */\r\n valueInfo?: { [key: string]: unknown };\r\n}\r\n\r\n\r\n\r\nexport interface FormValues {\r\n [key: string]: VariableValueDto;\r\n}\r\n\r\n\r\nexport enum Eagendy {\r\n all = \"Všechny\",\r\n timeoff = \"Nepřítomnost\",\r\n vacatransfer = \"Převod dovolené\",\r\n}\r\nexport enum Estavy {\r\n active = \"Ke zpracování\",\r\n done = \"Hotové\",\r\n all = 'Všechny',\r\n}\r\nexport enum Eassignments {\r\n my = \"Moje\",\r\n sub = \"Podřízených\",\r\n all = 'Všechny',\r\n}\r\nexport enum EEntity {\r\n task = \"Úkoly\",\r\n application = \"Žádosti\",\r\n}\r\n"],"names":["EApproverRoles","EApproverTypes","EDecisionsTranslations","Eagendy","Estavy","Eassignments","EEntity"],"mappings":"AAqRY,IAAA,mCAAAA,oBAAL;AACLA,kBAAAA,gBAAA,sBAAmB,EAAnB,IAAA;AACAA,kBAAAA,gBAAA,cAAW,EAAX,IAAA;AACAA,kBAAAA,gBAAA,eAAY,EAAZ,IAAA;AACAA,kBAAAA,gBAAA,aAAU,EAAV,IAAA;AACAA,kBAAAA,gBAAA,uBAAoB,EAApB,IAAA;AACAA,kBAAAA,gBAAA,+BAA4B,EAA5B,IAAA;AACAA,kBAAAA,gBAAA,gCAA6B,EAA7B,IAAA;AACAA,kBAAAA,gBAAA,uBAAoB,EAApB,IAAA;AARUA,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;AAUA,IAAA,mCAAAC,oBAAL;AACLA,kBAAA,mBAAoB,IAAA;AACpBA,kBAAA,2BAA4B,IAAA;AAC5BA,kBAAA,4BAA6B,IAAA;AAC7BA,kBAAA,SAAU,IAAA;AACVA,kBAAA,WAAY,IAAA;AACZA,kBAAA,UAAW,IAAA;AACXA,kBAAA,mBAAoB,IAAA;AACpBA,kBAAA,mBAAoB,IAAA;AACpBA,kBAAA,mBAAoB,IAAA;AACpBA,kBAAA,mBAAoB,IAAA;AAVVA,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;AAyCA,IAAA,2CAAAC,4BAAL;AACLA,0BAAA,UAAW,IAAA;AACXA,0BAAA,UAAW,IAAA;AACXA,0BAAA,WAAY,IAAA;AACZA,0BAAA,QAAS,IAAA;AAJCA,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;AAyJA,IAAA,4BAAAC,aAAL;AACLA,WAAA,KAAM,IAAA;AACNA,WAAA,SAAU,IAAA;AACVA,WAAA,cAAe,IAAA;AAHLA,SAAAA;AAAA,GAAA,WAAA,CAAA,CAAA;AAKA,IAAA,2BAAAC,YAAL;AACLA,UAAA,QAAS,IAAA;AACTA,UAAA,MAAO,IAAA;AACPA,UAAA,KAAM,IAAA;AAHIA,SAAAA;AAAA,GAAA,UAAA,CAAA,CAAA;AAKA,IAAA,iCAAAC,kBAAL;AACLA,gBAAA,IAAK,IAAA;AACLA,gBAAA,KAAM,IAAA;AACNA,gBAAA,KAAM,IAAA;AAHIA,SAAAA;AAAA,GAAA,gBAAA,CAAA,CAAA;AAKA,IAAA,4BAAAC,aAAL;AACLA,WAAA,MAAO,IAAA;AACPA,WAAA,aAAc,IAAA;AAFJA,SAAAA;AAAA,GAAA,WAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"types.js","sources":["../lib/types.ts"],"sourcesContent":["import { AxiosInstance } from \"axios\";\r\nimport { Emitter } from \"mitt\";\r\n\r\n\r\nimport { UseFormReturn } from \"react-hook-form\";\r\n\r\nexport interface IUserInfo {\r\n contractGroup: number;\r\n degreeAfter: string;\r\n degreeBefore: string;\r\n departmentId: string;\r\n departmentName: string;\r\n departmentNameLong: string;\r\n email: string;\r\n employeeId: number;\r\n firstName: string;\r\n lastName: string;\r\n positionName: string;\r\n positionNumber: string;\r\n userId: string;\r\n mobile: string;\r\n phone: string;\r\n contractTitle: string;\r\n managerTitle: string;\r\n manager: string;\r\n functionTitle: string;\r\n officeAddress: string;\r\n\r\n}\r\nexport interface IBuilding {\r\n buildingId: string;\r\n nameFull: string;\r\n\r\n}export interface IBuildingLOV {\r\n buildingId: string;\r\n name: string;\r\n ofsId?: number;\r\n\r\n}\r\nexport interface IEmployee extends IUserInfo {\r\n\r\n deleted: boolean\r\n hasComputer: string\r\n language: string\r\n manager: string\r\n parentFrId: number\r\n positionId: number\r\n validFrom: string\r\n validTo: string\r\n contractType: number\r\n exemption: number\r\n activatedOn: string\r\n building?: IBuilding | null\r\n}\r\n\r\nexport interface IAuthApp {\r\n name: string;\r\n label: string;\r\n roles: string[];\r\n}\r\n\r\nexport type IAuthApps = IAuthApp[];\r\n\r\nexport interface IEventMessage {\r\n title?: string;\r\n message?: string;\r\n timeout?: number;\r\n classes?: string;\r\n type?: \"success\" | \"info\" | \"warning\" | \"error\";\r\n}\r\n\r\nexport type Events = {\r\n message?: IEventMessage;\r\n loading?: boolean;\r\n};\r\n\r\nexport interface IContextValue {\r\n userInfo: IUserInfo;\r\n apiClient: AxiosInstance;\r\n authApps: IAuthApps;\r\n emitter: Emitter<Events>;\r\n isAdminApp?: boolean;\r\n}\r\nexport interface IOptionItem {\r\n value: string | number | null;\r\n label: string;\r\n description?: string;\r\n}\r\n\r\nexport type IFormProps = {\r\n formName: string;\r\n entityId: string;\r\n entityName: string;\r\n context: IContextValue;\r\n onSuccess: (path: string, message?: string) => void;\r\n};\r\nexport type IListProps = {\r\n id?: string;\r\n listName: string;\r\n filters: object; //{ [key: string]: any };\r\n context: IContextValue;\r\n title?: string;\r\n};\r\nexport type IPageProps = {\r\n pageName: string;\r\n context: IContextValue;\r\n};\r\n\r\nexport type IStartProcessProps = {\r\n context: IContextValue;\r\n\r\n onNavigate: (path: string) => void;\r\n};\r\n\r\nexport interface IModuleProcess {\r\n\r\n key: string;\r\n name: string;\r\n description: string;\r\n disabled?: boolean;\r\n\r\n}\r\nexport interface IModulePage {\r\n\r\n pageName: string;\r\n name: string;\r\n description: string;\r\n disabled?: boolean;\r\n roles?: string[];\r\n admin?: boolean;\r\n}\r\nexport interface IModuleSettings {\r\n\r\n key: string;\r\n name: string;\r\n description: string;\r\n disabled?: boolean;\r\n roles?: string[];\r\n admin?: boolean;\r\n\r\n}\r\n\r\nexport interface IModuleConstants {\r\n\r\n key: string\r\n name: string\r\n processes: IModuleProcess[],\r\n reports?: IModulePage[],\r\n pages?: IModulePage[],\r\n\r\n}\r\n\r\n\r\nexport interface IPosition {\r\n id: number;\r\n departmentId: string;\r\n positionName: string;\r\n positionNumber: string;\r\n manager: string;\r\n virtual: boolean;\r\n title: string;\r\n}\r\nexport interface IPositionEmployee extends IPosition {\r\n employee: IEmployee;\r\n}\r\nexport interface IEmployeePosition extends IEmployee {\r\n position: IPosition;\r\n}\r\nexport type { ICalendarItem } from \"./components/Calendar\";\r\n\r\n\r\nexport interface ITimeOffCategoryDto {\r\n id?: number;\r\n name?: string;\r\n}\r\nexport interface ITimeOffData {\r\n id: number;\r\n startDate: string;\r\n endDate: string;\r\n days?: number;\r\n year?: number;\r\n comment?: string;\r\n applicant?: IEmployee;\r\n place?: string;\r\n leaveType?: string;\r\n initiator?: string;\r\n dateFromEvidence?: string;\r\n dateToEvidence?: string;\r\n status?: number;\r\n statusText?: string;\r\n timeOffCategoryDto: ITimeOffCategoryDto;\r\n applicantContractGroup?: number;\r\n name?: string;\r\n daysOfEvidence?: number;\r\n daysInStartMonth?: number;\r\n daysInEndMonth?: number;\r\n lastChange?: string;\r\n created?: string;\r\n updated?: string;\r\n attachment?: IAttachment;\r\n steps?: IStep[];\r\n}\r\n\r\nexport interface IDepartment {\r\n departmentId: string;\r\n nameLong: string;\r\n parentDepartmentId: string;\r\n parentLocationId: number;\r\n nameShort: string;\r\n}\r\n\r\nexport interface IPageable<T> {\r\n content: T[];\r\n empty: boolean;\r\n first: boolean;\r\n last: boolean;\r\n number: number;\r\n numberOfElements: number;\r\n size: number;\r\n totalElements: number;\r\n totalPages: number;\r\n}\r\n\r\n\r\nexport interface IFormFieldGlobalProps {\r\n label?: string;\r\n description?: string;\r\n name: string;\r\n type?: string;\r\n value?: any;\r\n\r\n methods?: UseFormReturn<any>;\r\n\r\n errors?: any;\r\n register?: any;\r\n disabled?: boolean;\r\n required?: boolean;\r\n clearable?: boolean;\r\n placeholder?: string;\r\n children?: React.ReactNode;\r\n className?: string;\r\n rounded?: boolean;\r\n onInputChange: (\r\n e: React.ChangeEvent<\r\n HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | any\r\n >\r\n ) => void;\r\n\r\n onFocus?: () => void;\r\n onBlur?: () => void;\r\n inline?: boolean,\r\n ref?: any;\r\n}\r\n\r\n\r\nexport interface SysConfigHolidayEntityResponse {\r\n \"id\": number,\r\n \"date\": string,\r\n \"day\": number,\r\n \"month\": number,\r\n \"year\": number,\r\n \"dayOfWeek\": number\r\n}\r\n\r\n\r\nexport interface IProfileApprover {\r\n id: number;\r\n role: number;\r\n roleTxt: string;\r\n approverOrder: number;\r\n approver: IEmployee;\r\n position: IPositionEmployee;\r\n isEmployee: boolean;\r\n ignore: boolean;\r\n makePreapprover: boolean;\r\n}\r\n\r\n\r\nexport enum EApproverRoles {\r\n predschvalovatel = 10,\r\n zastupce = 20,\r\n zastupce9 = 30,\r\n vedouci = 40,\r\n vyssiSchvalovatel = 60,\r\n vyssiSchvalovatelZastupce = 61,\r\n vyssiSchvalovatelZastupce9 = 62,\r\n dochazkovyVedouci = 90,\r\n}\r\nexport enum EApproverTypes {\r\n vyssiSchvalovatel = \"vyssiSchvalovatel\",\r\n vyssiSchvalovatelZastupce = \"vyssiSchvalovatelZastupce\",\r\n vyssiSchvalovatelZastupce9 = \"vyssiSchvalovatelZastupce9\",\r\n vedouci = \"vedouci\",\r\n zastupce9 = \"zastupce9\",\r\n zastupce = \"zastupce\",\r\n predschvalovatel1 = \"predschvalovatel1\",\r\n predschvalovatel2 = \"predschvalovatel2\",\r\n predschvalovatel3 = \"predschvalovatel3\",\r\n dochazkovyVedouci = \"dochazkovyVedouci\",\r\n}\r\n\r\nexport interface IAttachment {\r\n\r\n\r\n id: number;\r\n created: string;\r\n createdByEmpId: string;\r\n updated: string;\r\n updatedByEmpId: string;\r\n mimeType: string;\r\n size: number;\r\n filename: string;\r\n\r\n}\r\n\r\n\r\n\r\nexport interface IStep {\r\n\r\n\r\n date: string;\r\n type: number;\r\n comment: string;\r\n decision: string;\r\n employee: IEmployee;\r\n\r\n}\r\n\r\n\r\nexport enum EDecisionsTranslations {\r\n approved = 'Schváleno',\r\n rejected = 'Zamítnuto',\r\n cancelled = 'Stornováno',\r\n evided = 'Zaevidováno',\r\n}\r\n\r\n\r\nexport interface ProcessDefinitionDto {\r\n /**\r\n * The id of the process definition\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n id?: string | null;\r\n\r\n /**\r\n * The key of the process definition, i.e., the id of the BPMN 2.0 XML process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n key?: string | null;\r\n\r\n /**\r\n * The category of the process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n category?: string | null;\r\n\r\n /**\r\n * The description of the process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n description?: string | null;\r\n\r\n /**\r\n * The name of the process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n name?: string | null;\r\n\r\n /**\r\n * The version of the process definition that the engine assigned to it.\r\n *\r\n * @type {number}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n version?: number | null;\r\n\r\n /**\r\n * The file name of the process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n resource?: string | null;\r\n\r\n /**\r\n * The deployment id of the process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n deploymentId?: string | null;\r\n\r\n /**\r\n * The file name of the process definition diagram, if it exists.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n diagram?: string | null;\r\n\r\n /**\r\n * A flag indicating whether the definition is suspended or not.\r\n *\r\n * @type {boolean}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n suspended?: boolean | null;\r\n\r\n /**\r\n * The tenant id of the process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n tenantId?: string | null;\r\n\r\n /**\r\n * The version tag of the process definition.\r\n *\r\n * @type {string}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n versionTag?: string | null;\r\n\r\n /**\r\n * History time to live value of the process definition. Is used within [History cleanup](https://docs.camunda.org/manual/7.20/user-guide/process-engine/history/#history-cleanup).\r\n *\r\n * @type {number}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n historyTimeToLive?: number | null;\r\n\r\n /**\r\n * A flag indicating whether the process definition is startable in Tasklist or not.\r\n *\r\n * @type {boolean}\r\n * @memberof ProcessDefinitionDto\r\n */\r\n startableInTasklist?: boolean | null;\r\n}\r\n\r\nexport interface VariableValueDto {\r\n /**\r\n * @type {AnyValue}\r\n * @memberof VariableValueDto\r\n */\r\n value?: unknown;\r\n\r\n /**\r\n * The value type of the variable.\r\n *\r\n * @type {string}\r\n * @memberof VariableValueDto\r\n */\r\n type?: string | null;\r\n\r\n /**\r\n * A JSON object containing additional, value-type-dependent properties. For serialized variables of type Object, the following properties can be provided: * `objectTypeName`: A string representation of the object's type name. * `serializationDataFormat`: The serialization format used to store the variable. For serialized variables of type File, the following properties can be provided: * `filename`: The name of the file. This is not the variable name but the name that will be used when downloading the file again. * `mimetype`: The MIME type of the file that is being uploaded. * `encoding`: The encoding of the file that is being uploaded. The following property can be provided for all value types: * `transient`: Indicates whether the variable should be transient or not. See [documentation](https://docs.camunda.org/manual/7.20/user-guide/process-engine/variables#transient-variables) for more informations. (Not applicable for `decision-definition`, ` /process-instance/variables-async`, and `/migration/executeAsync` endpoints)\r\n *\r\n * @type {{ [key: string]: any; }}\r\n * @memberof VariableValueDto\r\n */\r\n valueInfo?: { [key: string]: unknown };\r\n}\r\n\r\n\r\n\r\nexport interface FormValues {\r\n [key: string]: VariableValueDto;\r\n}\r\n\r\n\r\nexport enum Eagendy {\r\n all = \"Všechny\",\r\n timeoff = \"Nepřítomnost\",\r\n vacatransfer = \"Převod dovolené\",\r\n}\r\nexport enum Estavy {\r\n active = \"Ke zpracování\",\r\n done = \"Hotové\",\r\n all = 'Všechny',\r\n}\r\nexport enum Eassignments {\r\n my = \"Moje\",\r\n sub = \"Podřízených\",\r\n all = 'Všechny',\r\n}\r\nexport enum EEntity {\r\n task = \"Úkoly\",\r\n application = \"Žádosti\",\r\n}\r\n"],"names":["EApproverRoles","EApproverTypes","EDecisionsTranslations","Eagendy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A,UAAA,CAAA,CAAA;AAKA,IAAA,iCAAAC,kBAAL;AACLA,gBAAA,IAAK,IAAA;AACLA,gBAAA,KAAM,IAAA;AACNA,gBAAA,KAAM,IAAA;AAHIA,SAAAA;AAAA,GAAA,gBAAA,CAAA,CAAA;AAKA,IAAA,4BAAAC,aAAL;AACLA,WAAA,MAAO,IAAA;AACPA,WAAA,aAAc,IAAA;AAFJA,SAAAA;AAAA,GAAA,WAAA,CAAA,CAAA;"}
@@ -18,7 +18,8 @@ const handleErrors = (error, emitter, customMessage) => {
18
18
  title: errorTitle,
19
19
  message: errmsgToDisplay,
20
20
  classes: "bg-danger ",
21
- timeout: 0
21
+ timeout: 0,
22
+ type: "error"
22
23
  });
23
24
  };
24
25
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"handleErrors.js","sources":["../../lib/utils/handleErrors.ts"],"sourcesContent":["import { AxiosError } from \"axios\";\r\nimport { Emitter } from \"mitt\";\r\nimport { Events } from \"../types\";\r\n\r\nconst handleErrors = (error: AxiosError, emitter: Emitter<Events>, customMessage?: string) => {\r\n let errmsgToDisplay = (customMessage || \"\") + \" \" + ((error.response?.data as any)?.error?.message || error.message || \"\")\r\n\r\n let errorTitle = \"\"\r\n if (error.code == 'ERR_NETWORK') {\r\n errorTitle = \"Síťová chyba\"\r\n errmsgToDisplay = errmsgToDisplay + \" \" + new Date().toLocaleString();\r\n } else if (error.code == 'ERR_BAD_REQUEST') {\r\n if (error.response?.status == 403) {\r\n errorTitle = \"Přístup zamítnut\"\r\n } else {\r\n errorTitle = \"Interní chyba aplikace\"\r\n }\r\n errmsgToDisplay = new Date().toLocaleString() + \" (\" + error.response?.status + \") \\n\" + errmsgToDisplay;\r\n }\r\n console.error(error);\r\n emitter.emit(\"message\", {\r\n title: errorTitle,\r\n message: errmsgToDisplay,\r\n classes: \"bg-danger \",\r\n timeout: 0\r\n });\r\n}\r\nexport { handleErrors }"],"names":[],"mappings":"AAIA,MAAM,eAAe,CAAC,OAAmB,SAA0B,kBAA2B;AAA9F;AACQ,MAAA,mBAAmB,iBAAiB,MAAM,SAAQ,uBAAM,aAAN,mBAAgB,SAAhB,mBAA8B,UAA9B,mBAAqC,YAAW,MAAM,WAAW;AAEvH,MAAI,aAAa;AACb,MAAA,MAAM,QAAQ,eAAe;AAChB,iBAAA;AACb,sBAAkB,kBAAkB,OAAU,oBAAA,KAAA,GAAO;EAAe,WAC7D,MAAM,QAAQ,mBAAmB;AACpC,UAAA,WAAM,aAAN,mBAAgB,WAAU,KAAK;AAClB,mBAAA;AAAA,IAAA,OACV;AACU,mBAAA;AAAA,IACjB;AACkB,uBAAA,oBAAI,KAAO,GAAA,mBAAmB,SAAO,WAAM,aAAN,mBAAgB,UAAS,SAAS;AAAA,EAC7F;AACA,UAAQ,MAAM,KAAK;AACnB,UAAQ,KAAK,WAAW;AAAA,IACpB,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS;AAAA,IACT,SAAS;AAAA,EAAA,CACZ;AACL;"}
1
+ {"version":3,"file":"handleErrors.js","sources":["../../lib/utils/handleErrors.ts"],"sourcesContent":["import { AxiosError } from \"axios\";\r\nimport { Emitter } from \"mitt\";\r\nimport { Events } from \"../types\";\r\n\r\nconst handleErrors = (error: AxiosError, emitter: Emitter<Events>, customMessage?: string) => {\r\n let errmsgToDisplay = (customMessage || \"\") + \" \" + ((error.response?.data as any)?.error?.message || error.message || \"\")\r\n\r\n let errorTitle = \"\"\r\n if (error.code == 'ERR_NETWORK') {\r\n errorTitle = \"Síťová chyba\"\r\n errmsgToDisplay = errmsgToDisplay + \" \" + new Date().toLocaleString();\r\n } else if (error.code == 'ERR_BAD_REQUEST') {\r\n if (error.response?.status == 403) {\r\n errorTitle = \"Přístup zamítnut\"\r\n } else {\r\n errorTitle = \"Interní chyba aplikace\"\r\n }\r\n errmsgToDisplay = new Date().toLocaleString() + \" (\" + error.response?.status + \") \\n\" + errmsgToDisplay;\r\n }\r\n console.error(error);\r\n emitter.emit(\"message\", {\r\n title: errorTitle,\r\n message: errmsgToDisplay,\r\n classes: \"bg-danger \",\r\n timeout: 0,\r\n type: \"error\"\r\n });\r\n}\r\nexport { handleErrors }"],"names":[],"mappings":"AAIA,MAAM,eAAe,CAAC,OAAmB,SAA0B,kBAA2B;AAA9F;AACQ,MAAA,mBAAmB,iBAAiB,MAAM,SAAQ,uBAAM,aAAN,mBAAgB,SAAhB,mBAA8B,UAA9B,mBAAqC,YAAW,MAAM,WAAW;AAEvH,MAAI,aAAa;AACb,MAAA,MAAM,QAAQ,eAAe;AAChB,iBAAA;AACb,sBAAkB,kBAAkB,OAAU,oBAAA,KAAA,GAAO;EAAe,WAC7D,MAAM,QAAQ,mBAAmB;AACpC,UAAA,WAAM,aAAN,mBAAgB,WAAU,KAAK;AAClB,mBAAA;AAAA,IAAA,OACV;AACU,mBAAA;AAAA,IACjB;AACkB,uBAAA,oBAAI,KAAO,GAAA,mBAAmB,SAAO,WAAM,aAAN,mBAAgB,UAAS,SAAS;AAAA,EAC7F;AACA,UAAQ,MAAM,KAAK;AACnB,UAAQ,KAAK,WAAW;AAAA,IACpB,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,EAAA,CACT;AACL;"}
@@ -49,6 +49,7 @@ const FileInputMultiple: React.FC<FileInputMultipleProps> = ({
49
49
  message: `Maximální povolená velikost je ${MAX_FILE_SIZE / (1024 * 1024)} MB.`,
50
50
  classes: "bg-danger ",
51
51
  timeout: 0,
52
+ type: "error",
52
53
  });
53
54
 
54
55
  return null;
@@ -0,0 +1,48 @@
1
+ import { useState } from "react";
2
+ import { MdExpandLess, MdExpandMore } from "react-icons/md";
3
+ import { cn } from "../../utils/utils";
4
+
5
+ interface CollapsibleSectionProps {
6
+ title: string;
7
+ expanded?: boolean;
8
+ children: React.ReactNode;
9
+
10
+ className?: string;
11
+ classNameEnvelope?: string;
12
+ classNameTitle?: string;
13
+ }
14
+
15
+ const CollapsibleSection = ({
16
+ title,
17
+ expanded = true,
18
+ children,
19
+ className,
20
+ classNameEnvelope,
21
+ classNameTitle,
22
+ }: CollapsibleSectionProps) => {
23
+ const [isExpanded, setIsExpanded] = useState(expanded);
24
+
25
+ return (
26
+ <div className={cn("rounded-md shadow-lg border", classNameEnvelope)}>
27
+ <div
28
+ className={cn(
29
+ "w-full justify-between border-b hover:bg-muted flex py-4 px-5 items-center cursor-pointer",
30
+ classNameTitle
31
+ )}
32
+ onClick={() => setIsExpanded((prev) => !prev)}
33
+ >
34
+ <div className="font-medium text-lg">{title}</div>
35
+ <div>
36
+ {isExpanded ? (
37
+ <MdExpandLess size={"24px"} className="text-gray-600" />
38
+ ) : (
39
+ <MdExpandMore size={"24px"} className="text-gray-600" />
40
+ )}
41
+ </div>
42
+ </div>
43
+ {isExpanded && <div className={cn("p-5", className)}>{children}</div>}
44
+ </div>
45
+ );
46
+ };
47
+
48
+ export default CollapsibleSection;