@addsign/moje-agenda-shared-lib 1.0.51 → 1.0.52
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/assets/tailwind.css +0 -4
- package/dist/components/Button.d.ts +1 -0
- package/dist/components/Button.js +11 -3
- package/dist/components/Button.js.map +1 -1
- package/dist/components/form/SelectField.js +1 -1
- package/dist/components/form/SelectField.js.map +1 -1
- package/dist/main.js +5 -1
- package/dist/types.d.ts +45 -0
- package/dist/types.js +28 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/assets/tailwind.css
CHANGED
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
type ButtonVariant = "primary" | "secondary" | "transparent" | "success" | "danger" | "warning" | "icon";
|
|
3
3
|
interface IButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
4
|
variant?: ButtonVariant;
|
|
5
|
+
isLoading?: boolean;
|
|
5
6
|
}
|
|
6
7
|
declare const Button: React.FC<IButtonProps>;
|
|
7
8
|
export default Button;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import '../assets/tailwind.css';/* empty css */
|
|
3
|
+
import Spinner from "./Spinner.js";
|
|
3
4
|
const commonStyles = " py-1 px-4 leading-[32px] min-h-[32px] w-fit rounded-lg whitespace-nowrap font-medium disabled:opacity-50 ";
|
|
4
5
|
const buttonStyles = {
|
|
5
6
|
primary: "!bg-primary hover:!bg-primary-hover text-primary-text ",
|
|
@@ -12,19 +13,26 @@ const buttonStyles = {
|
|
|
12
13
|
};
|
|
13
14
|
const Button = ({
|
|
14
15
|
variant = "primary",
|
|
16
|
+
isLoading = false,
|
|
15
17
|
children,
|
|
16
18
|
onClick,
|
|
17
19
|
className,
|
|
18
20
|
...props
|
|
19
21
|
}) => {
|
|
20
22
|
const classNames = commonStyles + buttonStyles[variant];
|
|
21
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ jsxs(
|
|
22
24
|
"button",
|
|
23
25
|
{
|
|
24
26
|
className: classNames + " " + (className || " sharedLibraryource "),
|
|
25
27
|
onClick,
|
|
26
28
|
...props,
|
|
27
|
-
children
|
|
29
|
+
children: [
|
|
30
|
+
children,
|
|
31
|
+
isLoading && /* @__PURE__ */ jsxs("span", { className: "ml-2 inline-flex ", children: [
|
|
32
|
+
/* @__PURE__ */ jsx(Spinner, {}),
|
|
33
|
+
" "
|
|
34
|
+
] })
|
|
35
|
+
]
|
|
28
36
|
}
|
|
29
37
|
);
|
|
30
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../lib/components/Button.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport \"../css/tailwind.css\";\r\n\r\ntype ButtonVariant =\r\n | \"primary\"\r\n | \"secondary\"\r\n | \"transparent\"\r\n | \"success\"\r\n | \"danger\"\r\n | \"warning\"\r\n | \"icon\";\r\n\r\ninterface IButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\r\n variant?: ButtonVariant;\r\n}\r\nconst commonStyles =\r\n \" py-1 px-4 leading-[32px] min-h-[32px] w-fit rounded-lg whitespace-nowrap font-medium disabled:opacity-50 \";\r\nconst buttonStyles: { [key in ButtonVariant]: string } = {\r\n primary: \"!bg-primary hover:!bg-primary-hover text-primary-text \",\r\n secondary:\r\n \"!bg-secondary hover:!bg-secondary-hover text-secondary-text border border-secondary-border \",\r\n transparent:\r\n \"!bg-transparent border border-transparent hover:bg-gray-100 hover:border-gray-200 \",\r\n success: \"!bg-success hover:!bg-success-hover text-success-text \",\r\n danger: \"!bg-danger hover:!bg-danger-hover text-danger-text \",\r\n warning:\r\n \"!bg-warning hover:!bg-warning-hover text-warning-text border border-warning-border\",\r\n icon: \" !rounded-full text-center inline-flex items-center \",\r\n};\r\nconst Button: React.FC<IButtonProps> = ({\r\n variant = \"primary\",\r\n children,\r\n onClick,\r\n className,\r\n ...props\r\n}) => {\r\n const classNames = commonStyles + buttonStyles[variant];\r\n return (\r\n <button\r\n className={classNames + \" \" + (className || \" sharedLibraryource \")}\r\n onClick={onClick}\r\n {...props}\r\n >\r\n {children}\r\n </button>\r\n );\r\n};\r\n\r\nexport default Button;\r\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../lib/components/Button.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport \"../css/tailwind.css\";\r\nimport Spinner from \"./Spinner\";\r\n\r\ntype ButtonVariant =\r\n | \"primary\"\r\n | \"secondary\"\r\n | \"transparent\"\r\n | \"success\"\r\n | \"danger\"\r\n | \"warning\"\r\n | \"icon\";\r\n\r\ninterface IButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\r\n variant?: ButtonVariant;\r\n isLoading?: boolean;\r\n}\r\nconst commonStyles =\r\n \" py-1 px-4 leading-[32px] min-h-[32px] w-fit rounded-lg whitespace-nowrap font-medium disabled:opacity-50 \";\r\nconst buttonStyles: { [key in ButtonVariant]: string } = {\r\n primary: \"!bg-primary hover:!bg-primary-hover text-primary-text \",\r\n secondary:\r\n \"!bg-secondary hover:!bg-secondary-hover text-secondary-text border border-secondary-border \",\r\n transparent:\r\n \"!bg-transparent border border-transparent hover:bg-gray-100 hover:border-gray-200 \",\r\n success: \"!bg-success hover:!bg-success-hover text-success-text \",\r\n danger: \"!bg-danger hover:!bg-danger-hover text-danger-text \",\r\n warning:\r\n \"!bg-warning hover:!bg-warning-hover text-warning-text border border-warning-border\",\r\n icon: \" !rounded-full text-center inline-flex items-center \",\r\n};\r\nconst Button: React.FC<IButtonProps> = ({\r\n variant = \"primary\",\r\n isLoading = false,\r\n children,\r\n onClick,\r\n className,\r\n ...props\r\n}) => {\r\n const classNames = commonStyles + buttonStyles[variant];\r\n return (\r\n <button\r\n className={classNames + \" \" + (className || \" sharedLibraryource \")}\r\n onClick={onClick}\r\n {...props}\r\n >\r\n {children}\r\n {isLoading && (\r\n <span className=\"ml-2 inline-flex \">\r\n <Spinner />{\" \"}\r\n </span>\r\n )}\r\n </button>\r\n );\r\n};\r\n\r\nexport default Button;\r\n"],"names":[],"mappings":";;;AAiBA,MAAM,eACJ;AACF,MAAM,eAAmD;AAAA,EACvD,SAAS;AAAA,EACT,WACE;AAAA,EACF,aACE;AAAA,EACF,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SACE;AAAA,EACF,MAAM;AACR;AACA,MAAM,SAAiC,CAAC;AAAA,EACtC,UAAU;AAAA,EACV,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,aAAa,eAAe,aAAa,OAAO;AAEpD,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,aAAa,OAAO,aAAa;AAAA,MAC5C;AAAA,MACC,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA;AAAA,QACA,aACC,qBAAC,QAAK,EAAA,WAAU,qBACd,UAAA;AAAA,UAAA,oBAAC,SAAQ,EAAA;AAAA,UAAG;AAAA,QAAA,GACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -166,7 +166,7 @@ function SelectField({
|
|
|
166
166
|
`,
|
|
167
167
|
onClick: () => !disabled && !isLoading ? handleToggleFocus() : null,
|
|
168
168
|
children: [
|
|
169
|
-
/* @__PURE__ */ jsxs("div", { className: "grow shrink basis-0 min-h-
|
|
169
|
+
/* @__PURE__ */ jsxs("div", { className: "grow shrink basis-0 min-h-[32px] justify-start items-center gap-0 flex whitespace-nowrap w-[calc(100%-40px)] ", children: [
|
|
170
170
|
/* @__PURE__ */ jsxs(
|
|
171
171
|
"div",
|
|
172
172
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectField.js","sources":["../../../lib/components/form/SelectField.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport { IFormFieldGlobalProps, IOptionItem } from \"../../types\";\r\nimport { MdCheck, MdClose, MdExpandLess, MdExpandMore } from \"react-icons/md\";\r\nimport { useClickAway } from \"react-use\";\r\nimport { SpinnerIcon, useFederationContext } from \"../../main\";\r\nimport { FaSpinner } from \"react-icons/fa\";\r\n\r\nexport interface ISelectFieldProps extends IFormFieldGlobalProps {\r\n options?: IOptionItem[];\r\n valueKey?: string;\r\n labelKey?: string | ((item: any) => string);\r\n fetchUrl?: string;\r\n loading?: boolean;\r\n}\r\n\r\nexport default function SelectField({\r\n label,\r\n name,\r\n value,\r\n description,\r\n onInputChange,\r\n options,\r\n placeholder,\r\n className,\r\n errors = {},\r\n clearable,\r\n required,\r\n disabled,\r\n rounded = true,\r\n fetchUrl,\r\n valueKey,\r\n labelKey,\r\n loading,\r\n}: ISelectFieldProps) {\r\n const [isFocused, setIsFocused] = React.useState(false);\r\n const [isLoading, setIsLoading] = React.useState(false);\r\n const apiClient = useFederationContext()?.apiClient;\r\n const [localOptions, setLocalOptions] = React.useState(options);\r\n\r\n const ref = React.useRef(null);\r\n const handleClear = (e: any) => {\r\n // value;\r\n e.stopPropagation(); // Add this line\r\n\r\n setIsFocused(false);\r\n onInputChange({\r\n ...e,\r\n target: {\r\n value: \"\",\r\n name: name,\r\n },\r\n });\r\n };\r\n\r\n React.useEffect(() => {\r\n const fetchOptions = async (fetchUrl: string) => {\r\n setIsLoading(true);\r\n const { data } = await apiClient.get(fetchUrl);\r\n\r\n // Check if the first item in the data array is a number to determine the data type\r\n const isArrayOfNumbers = typeof data[0] === \"number\";\r\n const isInPageable = data && data.hasOwnProperty(\"content\");\r\n\r\n // Transform data based on its type\r\n const transformedOptions = (isInPageable ? data.content : data).map(\r\n (item: any) => {\r\n if (isArrayOfNumbers) {\r\n // If it's a number, use the number for both value and label\r\n return { value: item, label: item.toString() };\r\n } else {\r\n // Otherwise, extract using predefined keys or defaults\r\n return {\r\n value: item[valueKey || \"id\"],\r\n label:\r\n labelKey instanceof Function && labelKey !== undefined\r\n ? labelKey(item)\r\n : item[labelKey as string],\r\n };\r\n }\r\n }\r\n );\r\n\r\n setLocalOptions([\r\n { value: null, label: \" \" }, // Add an empty option as the first item\r\n ...transformedOptions,\r\n ]);\r\n setIsLoading(false);\r\n };\r\n\r\n if (fetchUrl) fetchOptions(fetchUrl);\r\n if (options) setLocalOptions(options);\r\n }, [fetchUrl, options, apiClient, valueKey, labelKey]); // ensure valueKey and labelKey are also in the dependency array if they are dynamic\r\n\r\n const handleToggleFocus = () => {\r\n setIsFocused((prev) => !prev);\r\n };\r\n\r\n useClickAway(ref, () => {\r\n setIsFocused(false);\r\n });\r\n\r\n const hangleChange = (option: IOptionItem) => {\r\n const tmp: any = {\r\n target: {\r\n value: option.value,\r\n name: name,\r\n },\r\n };\r\n\r\n onInputChange(tmp);\r\n setIsFocused(false);\r\n };\r\n const currentlySelectedOption = React.useMemo(() => {\r\n if (value === undefined || value === \"\") return null;\r\n return localOptions?.find((option) => option.value == value);\r\n }, [localOptions, value, options]);\r\n\r\n const listOfOptions = () => {\r\n if (!localOptions) return [];\r\n return (\r\n <div\r\n id=\"list\"\r\n className=\"max-h-[390px] min-w-20 w-full whitespace-nowrap absolute z-[100000] -top-[1px] mt-[4px] bg-white rounded-lg shadow-xl border\r\n border-gray-200 justify-start items-start inline-flex overflow-auto cursor-default\"\r\n >\r\n <div className=\"grow shrink basis-0 py-1 flex-col justify-start items-start inline-flex\">\r\n {localOptions.map((option, index) => {\r\n return (\r\n <div\r\n className=\"group self-stretch px-1.5 py-px justify-start items-center inline-flex hover:bg-gray-50 \"\r\n onClick={() => hangleChange(option)}\r\n key={index}\r\n >\r\n <div className=\"grow shrink basis-0 px-1 py-2 rounded-md flex-col justify-start items-start gap-2 inline-flex\">\r\n <div className=\"self-stretch justify-start items-center gap-2 inline-flex\">\r\n <div className=\"text-gray-900 text-sm font-normal leading-normal\">\r\n {option.label}\r\n </div>\r\n {option.description && (\r\n <div className=\"text-slate-600 sm-base font-normal leading-normal\">\r\n {option.description}\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n <div className=\"w-5 h-5 relative\">\r\n {option.value === value && value !== \"\" && (\r\n <MdCheck size={22} className=\"text-primary\" />\r\n )}{\" \"}\r\n {option.value !== value && (\r\n <MdCheck\r\n size={22}\r\n className=\"text-transparent group-hover:text-gray-300\"\r\n />\r\n )}\r\n </div>\r\n </div>\r\n );\r\n })}\r\n </div>\r\n </div>\r\n );\r\n };\r\n\r\n return (\r\n <>\r\n <div\r\n className={\r\n \"w-full min-h-30 flex-col justify-start items-start gap-0inline-flex \" +\r\n className\r\n }\r\n id=\"selectField\"\r\n ref={ref}\r\n >\r\n <div className=\"self-stretch flex-col justify-start items-start gap-1.5 flex\">\r\n {label && (\r\n <label\r\n className=\"text-slate-700 text-sm font-medium leading-tight\"\r\n htmlFor={name}\r\n >\r\n {label} {required ? \"*\" : \"\"}\r\n </label>\r\n )}\r\n <div\r\n className={`self-stretch w-full px-3 py-1 bg-white border justify-start items-center gap-0 inline-flex outline-none \r\n ${isFocused ? \"outline-4 outline-indigo-200 outline-offset-0 border-indigo-300 \" : \"\"}\r\n ${\r\n isFocused && errors[name]?.message\r\n ? \"outline-4 outline-red-200 outline-offset-0 border-none\"\r\n : \"\"\r\n } \r\n ${rounded ? \" rounded-lg \" : \" rounded-none \"}\r\n ${!isFocused && errors[name]?.message ? \"border-red-200\" : \"\"} \r\n ${disabled || isLoading ? \"opacity-80 cursor-not-allowed \" : \"\"}\r\n `}\r\n onClick={() =>\r\n !disabled && !isLoading ? handleToggleFocus() : null\r\n }\r\n >\r\n <div className=\"grow shrink basis-0 min-h-5 xl:!min-h-[32px] justify-start items-center gap-0 flex whitespace-nowrap w-[calc(100%-40px)] \">\r\n <div\r\n className=\"text-gray-900 text-sm font-normal leading-normal text-ellipsis overflow-hidden w-full\"\r\n id={name}\r\n >\r\n {currentlySelectedOption?.label}\r\n {!currentlySelectedOption?.label && placeholder && (\r\n <span className=\"text-slate-400 font-normal\">\r\n {\" \"}\r\n {placeholder}\r\n </span>\r\n )}\r\n </div>\r\n <div className=\"text-slate-600 text-base font-normal leading-normal\">\r\n {currentlySelectedOption?.description}\r\n </div>\r\n </div>\r\n {clearable &&\r\n value !== \"\" &&\r\n value !== null &&\r\n value !== undefined &&\r\n !disabled && (\r\n <div\r\n className=\"w-6 h-6 relative cursor-pointer \"\r\n id={name + \":clear\"}\r\n onClick={handleClear}\r\n >\r\n <div className=\"absolute inset-0 flex items-center justify-center hover:bg-gray-100 w-6 rounded-full text-lg\">\r\n <MdClose />\r\n </div>{\" \"}\r\n </div>\r\n )}\r\n {isLoading === true ||\r\n (loading && (\r\n <div className=\"w-6 h-6 relative flex items-center justify-center align-middle\">\r\n <SpinnerIcon icon={<FaSpinner />} />\r\n </div>\r\n ))}\r\n\r\n <div className=\"w-6 h-6 relative cursor-pointer \">\r\n <div className=\"absolute inset-0 flex items-center justify-center hover:bg-gray-100 w-6 rounded-full text-lg\">\r\n {isFocused && !disabled && <MdExpandLess />}\r\n {!isFocused && !disabled && <MdExpandMore />}\r\n </div>\r\n </div>\r\n </div>\r\n </div>{\" \"}\r\n <div className=\"w-full relative\">{isFocused && listOfOptions()}</div>\r\n {description && !isFocused && (\r\n <div\r\n className=\"self-stretch text-slate-600 text-sm font-normal leading-tight\"\r\n id={name + \":description\"}\r\n >\r\n {description}\r\n </div>\r\n )}\r\n {errors[name] && (\r\n <div\r\n className=\"HintText self-stretch text-red-600 text-sm font-normal leading-tight\"\r\n id={name + \":error\"}\r\n >\r\n {errors[name]?.message}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n );\r\n}\r\n"],"names":["fetchUrl"],"mappings":";;;;;;;;;;;AAeA,SAAwB,YAAY;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS,CAAC;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AA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AAAA,UAAA;AAAA,QACjB;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN,EAAA,CAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"SelectField.js","sources":["../../../lib/components/form/SelectField.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport { IFormFieldGlobalProps, IOptionItem } from \"../../types\";\r\nimport { MdCheck, MdClose, MdExpandLess, MdExpandMore } from \"react-icons/md\";\r\nimport { useClickAway } from \"react-use\";\r\nimport { SpinnerIcon, useFederationContext } from \"../../main\";\r\nimport { FaSpinner } from \"react-icons/fa\";\r\n\r\nexport interface ISelectFieldProps extends IFormFieldGlobalProps {\r\n options?: IOptionItem[];\r\n valueKey?: string;\r\n labelKey?: string | ((item: any) => string);\r\n fetchUrl?: string;\r\n loading?: boolean;\r\n}\r\n\r\nexport default function SelectField({\r\n label,\r\n name,\r\n value,\r\n description,\r\n onInputChange,\r\n options,\r\n placeholder,\r\n className,\r\n errors = {},\r\n clearable,\r\n required,\r\n disabled,\r\n rounded = true,\r\n fetchUrl,\r\n valueKey,\r\n labelKey,\r\n loading,\r\n}: ISelectFieldProps) {\r\n const [isFocused, setIsFocused] = React.useState(false);\r\n const [isLoading, setIsLoading] = React.useState(false);\r\n const apiClient = useFederationContext()?.apiClient;\r\n const [localOptions, setLocalOptions] = React.useState(options);\r\n\r\n const ref = React.useRef(null);\r\n const handleClear = (e: any) => {\r\n // value;\r\n e.stopPropagation(); // Add this line\r\n\r\n setIsFocused(false);\r\n onInputChange({\r\n ...e,\r\n target: {\r\n value: \"\",\r\n name: name,\r\n },\r\n });\r\n };\r\n\r\n React.useEffect(() => {\r\n const fetchOptions = async (fetchUrl: string) => {\r\n setIsLoading(true);\r\n const { data } = await apiClient.get(fetchUrl);\r\n\r\n // Check if the first item in the data array is a number to determine the data type\r\n const isArrayOfNumbers = typeof data[0] === \"number\";\r\n const isInPageable = data && data.hasOwnProperty(\"content\");\r\n\r\n // Transform data based on its type\r\n const transformedOptions = (isInPageable ? data.content : data).map(\r\n (item: any) => {\r\n if (isArrayOfNumbers) {\r\n // If it's a number, use the number for both value and label\r\n return { value: item, label: item.toString() };\r\n } else {\r\n // Otherwise, extract using predefined keys or defaults\r\n return {\r\n value: item[valueKey || \"id\"],\r\n label:\r\n labelKey instanceof Function && labelKey !== undefined\r\n ? labelKey(item)\r\n : item[labelKey as string],\r\n };\r\n }\r\n }\r\n );\r\n\r\n setLocalOptions([\r\n { value: null, label: \" \" }, // Add an empty option as the first item\r\n ...transformedOptions,\r\n ]);\r\n setIsLoading(false);\r\n };\r\n\r\n if (fetchUrl) fetchOptions(fetchUrl);\r\n if (options) setLocalOptions(options);\r\n }, [fetchUrl, options, apiClient, valueKey, labelKey]); // ensure valueKey and labelKey are also in the dependency array if they are dynamic\r\n\r\n const handleToggleFocus = () => {\r\n setIsFocused((prev) => !prev);\r\n };\r\n\r\n useClickAway(ref, () => {\r\n setIsFocused(false);\r\n });\r\n\r\n const hangleChange = (option: IOptionItem) => {\r\n const tmp: any = {\r\n target: {\r\n value: option.value,\r\n name: name,\r\n },\r\n };\r\n\r\n onInputChange(tmp);\r\n setIsFocused(false);\r\n };\r\n const currentlySelectedOption = React.useMemo(() => {\r\n if (value === undefined || value === \"\") return null;\r\n return localOptions?.find((option) => option.value == value);\r\n }, [localOptions, value, options]);\r\n\r\n const listOfOptions = () => {\r\n if (!localOptions) return [];\r\n return (\r\n <div\r\n id=\"list\"\r\n className=\"max-h-[390px] min-w-20 w-full whitespace-nowrap absolute z-[100000] -top-[1px] mt-[4px] bg-white rounded-lg shadow-xl border\r\n border-gray-200 justify-start items-start inline-flex overflow-auto cursor-default\"\r\n >\r\n <div className=\"grow shrink basis-0 py-1 flex-col justify-start items-start inline-flex\">\r\n {localOptions.map((option, index) => {\r\n return (\r\n <div\r\n className=\"group self-stretch px-1.5 py-px justify-start items-center inline-flex hover:bg-gray-50 \"\r\n onClick={() => hangleChange(option)}\r\n key={index}\r\n >\r\n <div className=\"grow shrink basis-0 px-1 py-2 rounded-md flex-col justify-start items-start gap-2 inline-flex\">\r\n <div className=\"self-stretch justify-start items-center gap-2 inline-flex\">\r\n <div className=\"text-gray-900 text-sm font-normal leading-normal\">\r\n {option.label}\r\n </div>\r\n {option.description && (\r\n <div className=\"text-slate-600 sm-base font-normal leading-normal\">\r\n {option.description}\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n <div className=\"w-5 h-5 relative\">\r\n {option.value === value && value !== \"\" && (\r\n <MdCheck size={22} className=\"text-primary\" />\r\n )}{\" \"}\r\n {option.value !== value && (\r\n <MdCheck\r\n size={22}\r\n className=\"text-transparent group-hover:text-gray-300\"\r\n />\r\n )}\r\n </div>\r\n </div>\r\n );\r\n })}\r\n </div>\r\n </div>\r\n );\r\n };\r\n\r\n return (\r\n <>\r\n <div\r\n className={\r\n \"w-full min-h-30 flex-col justify-start items-start gap-0inline-flex \" +\r\n className\r\n }\r\n id=\"selectField\"\r\n ref={ref}\r\n >\r\n <div className=\"self-stretch flex-col justify-start items-start gap-1.5 flex\">\r\n {label && (\r\n <label\r\n className=\"text-slate-700 text-sm font-medium leading-tight\"\r\n htmlFor={name}\r\n >\r\n {label} {required ? \"*\" : \"\"}\r\n </label>\r\n )}\r\n <div\r\n className={`self-stretch w-full px-3 py-1 bg-white border justify-start items-center gap-0 inline-flex outline-none \r\n ${isFocused ? \"outline-4 outline-indigo-200 outline-offset-0 border-indigo-300 \" : \"\"}\r\n ${\r\n isFocused && errors[name]?.message\r\n ? \"outline-4 outline-red-200 outline-offset-0 border-none\"\r\n : \"\"\r\n } \r\n ${rounded ? \" rounded-lg \" : \" rounded-none \"}\r\n ${!isFocused && errors[name]?.message ? \"border-red-200\" : \"\"} \r\n ${disabled || isLoading ? \"opacity-80 cursor-not-allowed \" : \"\"}\r\n `}\r\n onClick={() =>\r\n !disabled && !isLoading ? handleToggleFocus() : null\r\n }\r\n >\r\n <div className=\"grow shrink basis-0 min-h-[32px] justify-start items-center gap-0 flex whitespace-nowrap w-[calc(100%-40px)] \">\r\n <div\r\n className=\"text-gray-900 text-sm font-normal leading-normal text-ellipsis overflow-hidden w-full\"\r\n id={name}\r\n >\r\n {currentlySelectedOption?.label}\r\n {!currentlySelectedOption?.label && placeholder && (\r\n <span className=\"text-slate-400 font-normal\">\r\n {\" \"}\r\n {placeholder}\r\n </span>\r\n )}\r\n </div>\r\n <div className=\"text-slate-600 text-base font-normal leading-normal\">\r\n {currentlySelectedOption?.description}\r\n </div>\r\n </div>\r\n {clearable &&\r\n value !== \"\" &&\r\n value !== null &&\r\n value !== undefined &&\r\n !disabled && (\r\n <div\r\n className=\"w-6 h-6 relative cursor-pointer \"\r\n id={name + \":clear\"}\r\n onClick={handleClear}\r\n >\r\n <div className=\"absolute inset-0 flex items-center justify-center hover:bg-gray-100 w-6 rounded-full text-lg\">\r\n <MdClose />\r\n </div>{\" \"}\r\n </div>\r\n )}\r\n {isLoading === true ||\r\n (loading && (\r\n <div className=\"w-6 h-6 relative flex items-center justify-center align-middle\">\r\n <SpinnerIcon icon={<FaSpinner />} />\r\n </div>\r\n ))}\r\n\r\n <div className=\"w-6 h-6 relative cursor-pointer \">\r\n <div className=\"absolute inset-0 flex items-center justify-center hover:bg-gray-100 w-6 rounded-full text-lg\">\r\n {isFocused && !disabled && <MdExpandLess />}\r\n {!isFocused && !disabled && <MdExpandMore />}\r\n </div>\r\n </div>\r\n </div>\r\n </div>{\" \"}\r\n <div className=\"w-full relative\">{isFocused && listOfOptions()}</div>\r\n {description && !isFocused && (\r\n <div\r\n className=\"self-stretch text-slate-600 text-sm font-normal leading-tight\"\r\n id={name + \":description\"}\r\n >\r\n {description}\r\n </div>\r\n )}\r\n {errors[name] && (\r\n <div\r\n className=\"HintText self-stretch text-red-600 text-sm font-normal leading-tight\"\r\n id={name + \":error\"}\r\n >\r\n {errors[name]?.message}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n );\r\n}\r\n"],"names":["fetchUrl"],"mappings":";;;;;;;;;;;AAeA,SAAwB,YAAY;AAAA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AEV,UAAA;AAAA,UAAA;AAAA,QACH;AAAA,QAED,OAAO,IAAI,KACV;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,IAAI,OAAO;AAAA,YAEV,WAAA,YAAO,IAAI,MAAX,mBAAc;AAAA,UAAA;AAAA,QACjB;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN,EAAA,CAAA;AAEJ;"}
|
package/dist/main.js
CHANGED
|
@@ -29,7 +29,7 @@ import { getIntersectingDays } from "./utils/getIntersectingDays.js";
|
|
|
29
29
|
import { handleErrors } from "./utils/handleErrors.js";
|
|
30
30
|
import { hasRightInModule } from "./utils/hasRightInModule.js";
|
|
31
31
|
import { hasRole } from "./utils/hasRole.js";
|
|
32
|
-
import { EApproverRoles, EApproverTypes, EDecisionsTranslations } from "./types.js";
|
|
32
|
+
import { EApproverRoles, EApproverTypes, EDecisionsTranslations, EEntity, Eagendy, Eassignments, Estavy } from "./types.js";
|
|
33
33
|
export {
|
|
34
34
|
default3 as AutocompleteSearchBar,
|
|
35
35
|
default4 as AutocompleteSearchBarServer,
|
|
@@ -43,6 +43,10 @@ export {
|
|
|
43
43
|
EApproverRoles,
|
|
44
44
|
EApproverTypes,
|
|
45
45
|
EDecisionsTranslations,
|
|
46
|
+
EEntity,
|
|
47
|
+
Eagendy,
|
|
48
|
+
Eassignments,
|
|
49
|
+
Estavy,
|
|
46
50
|
FederationContext,
|
|
47
51
|
FederationContextProvider,
|
|
48
52
|
default9 as FileInput,
|
package/dist/types.d.ts
CHANGED
|
@@ -370,3 +370,48 @@ export interface ProcessDefinitionDto {
|
|
|
370
370
|
*/
|
|
371
371
|
startableInTasklist?: boolean | null;
|
|
372
372
|
}
|
|
373
|
+
export interface VariableValueDto {
|
|
374
|
+
/**
|
|
375
|
+
* @type {AnyValue}
|
|
376
|
+
* @memberof VariableValueDto
|
|
377
|
+
*/
|
|
378
|
+
value?: unknown;
|
|
379
|
+
/**
|
|
380
|
+
* The value type of the variable.
|
|
381
|
+
*
|
|
382
|
+
* @type {string}
|
|
383
|
+
* @memberof VariableValueDto
|
|
384
|
+
*/
|
|
385
|
+
type?: string | null;
|
|
386
|
+
/**
|
|
387
|
+
* 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)
|
|
388
|
+
*
|
|
389
|
+
* @type {{ [key: string]: any; }}
|
|
390
|
+
* @memberof VariableValueDto
|
|
391
|
+
*/
|
|
392
|
+
valueInfo?: {
|
|
393
|
+
[key: string]: unknown;
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
export interface FormValues {
|
|
397
|
+
[key: string]: VariableValueDto;
|
|
398
|
+
}
|
|
399
|
+
export declare enum Eagendy {
|
|
400
|
+
all = "V\u0161echny",
|
|
401
|
+
timeoff = "Nep\u0159\u00EDtomnost",
|
|
402
|
+
vacatransfer = "P\u0159evod dovolen\u00E9"
|
|
403
|
+
}
|
|
404
|
+
export declare enum Estavy {
|
|
405
|
+
active = "Ke zpracov\u00E1n\u00ED",
|
|
406
|
+
done = "Hotov\u00E9",
|
|
407
|
+
all = "V\u0161echny"
|
|
408
|
+
}
|
|
409
|
+
export declare enum Eassignments {
|
|
410
|
+
my = "Moje",
|
|
411
|
+
sub = "Pod\u0159\u00EDzen\u00FDch",
|
|
412
|
+
all = "V\u0161echny"
|
|
413
|
+
}
|
|
414
|
+
export declare enum EEntity {
|
|
415
|
+
task = "\u00DAkoly",
|
|
416
|
+
application = "\u017D\u00E1dosti"
|
|
417
|
+
}
|
package/dist/types.js
CHANGED
|
@@ -29,9 +29,36 @@ var EDecisionsTranslations = /* @__PURE__ */ ((EDecisionsTranslations2) => {
|
|
|
29
29
|
EDecisionsTranslations2["evided"] = "Zaevidováno";
|
|
30
30
|
return EDecisionsTranslations2;
|
|
31
31
|
})(EDecisionsTranslations || {});
|
|
32
|
+
var Eagendy = /* @__PURE__ */ ((Eagendy2) => {
|
|
33
|
+
Eagendy2["all"] = "Všechny";
|
|
34
|
+
Eagendy2["timeoff"] = "Nepřítomnost";
|
|
35
|
+
Eagendy2["vacatransfer"] = "Převod dovolené";
|
|
36
|
+
return Eagendy2;
|
|
37
|
+
})(Eagendy || {});
|
|
38
|
+
var Estavy = /* @__PURE__ */ ((Estavy2) => {
|
|
39
|
+
Estavy2["active"] = "Ke zpracování";
|
|
40
|
+
Estavy2["done"] = "Hotové";
|
|
41
|
+
Estavy2["all"] = "Všechny";
|
|
42
|
+
return Estavy2;
|
|
43
|
+
})(Estavy || {});
|
|
44
|
+
var Eassignments = /* @__PURE__ */ ((Eassignments2) => {
|
|
45
|
+
Eassignments2["my"] = "Moje";
|
|
46
|
+
Eassignments2["sub"] = "Podřízených";
|
|
47
|
+
Eassignments2["all"] = "Všechny";
|
|
48
|
+
return Eassignments2;
|
|
49
|
+
})(Eassignments || {});
|
|
50
|
+
var EEntity = /* @__PURE__ */ ((EEntity2) => {
|
|
51
|
+
EEntity2["task"] = "Úkoly";
|
|
52
|
+
EEntity2["application"] = "Žádosti";
|
|
53
|
+
return EEntity2;
|
|
54
|
+
})(EEntity || {});
|
|
32
55
|
export {
|
|
33
56
|
EApproverRoles,
|
|
34
57
|
EApproverTypes,
|
|
35
|
-
EDecisionsTranslations
|
|
58
|
+
EDecisionsTranslations,
|
|
59
|
+
EEntity,
|
|
60
|
+
Eagendy,
|
|
61
|
+
Eassignments,
|
|
62
|
+
Estavy
|
|
36
63
|
};
|
|
37
64
|
//# sourceMappingURL=types.js.map
|
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}\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}"],"names":["EApproverRoles","EApproverTypes","EDecisionsTranslations"],"mappings":"AA6QY,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;"}
|
|
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}\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":"AA6QY,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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