@addsign/moje-agenda-shared-lib 2.0.66 → 2.0.68
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/Calendar-DWT4e7Th.js.map +1 -1
- package/dist/Combination-DmhTQmbL.js +996 -0
- package/dist/Combination-DmhTQmbL.js.map +1 -0
- package/dist/Dialog-3u5-ws89.js +424 -0
- package/dist/Dialog-3u5-ws89.js.map +1 -0
- package/dist/Dialog-CCrUyF91.js.map +1 -1
- package/dist/assets/style.css +3 -3
- package/dist/components/datatable/DataTableServer.js +349 -252
- package/dist/components/datatable/DataTableServer.js.map +1 -1
- package/dist/components/form/FileInputForm.d.ts +14 -0
- package/dist/components/form/FileInputForm.js +173 -0
- package/dist/components/form/FileInputForm.js.map +1 -0
- package/dist/components/form/FileInputFormMultiple.d.ts +16 -0
- package/dist/components/form/FileInputFormMultiple.js +240 -0
- package/dist/components/form/FileInputFormMultiple.js.map +1 -0
- package/dist/components/form/FileInputFull.d.ts +17 -0
- package/dist/components/form/FileInputFull.js +188 -0
- package/dist/components/form/FileInputFull.js.map +1 -0
- package/dist/components/form/FileInputFullMultiple.d.ts +19 -0
- package/dist/components/form/FileInputFullMultiple.js +226 -0
- package/dist/components/form/FileInputFullMultiple.js.map +1 -0
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/multi-select.js.map +1 -1
- package/dist/components/ui/radioGroup.js.map +1 -1
- package/dist/components/ui/toast.js.map +1 -1
- package/dist/handleErrors-B2be_Hgy.js +31615 -0
- package/dist/handleErrors-B2be_Hgy.js.map +1 -0
- package/dist/handleErrors-P52guX3U.js +32 -0
- package/dist/handleErrors-P52guX3U.js.map +1 -0
- package/dist/index-BikTN7j8.js +2266 -0
- package/dist/index-BikTN7j8.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +34 -30
- package/dist/main.js.map +1 -1
- package/dist/popover-BLI2Jq-c.js +319 -0
- package/dist/popover-BLI2Jq-c.js.map +1 -0
- package/dist/popover-CcrzvSk7.js.map +1 -1
- package/dist/tslib.es6-e8r3nMQ9.js +172 -0
- package/dist/tslib.es6-e8r3nMQ9.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js.map +1 -1
- package/lib/components/datatable/DataTableServer.tsx +165 -42
- package/lib/components/form/FileInputForm.tsx +184 -0
- package/lib/components/form/FileInputFormMultiple.tsx +220 -0
- package/lib/components/ui/Calendar.tsx +0 -2
- package/lib/components/ui/Combobox.tsx +0 -2
- package/lib/components/ui/Dialog.tsx +0 -2
- package/lib/components/ui/checkbox.tsx +0 -2
- package/lib/components/ui/command.tsx +0 -2
- package/lib/components/ui/multi-select.tsx +387 -387
- package/lib/components/ui/popover.tsx +0 -2
- package/lib/components/ui/radioGroup.tsx +0 -2
- package/lib/components/ui/toast.tsx +0 -1
- package/lib/main.ts +2 -0
- package/lib/types.ts +1 -0
- package/package.json +1 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tslib.es6-e8r3nMQ9.js","sources":["../node_modules/tslib/tslib.es6.mjs"],"sourcesContent":["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n"],"names":["__assign"],"mappings":"AA+BU,IAAC,WAAW,WAAW;AAC/B,aAAW,OAAO,UAAU,SAASA,UAAS,GAAG;AAC7C,aAAS,GAAG,IAAI,GAAG,IAAI,UAAU,QAAQ,IAAI,GAAG,KAAK;AACjD,UAAI,UAAU,CAAC;AACf,eAAS,KAAK;AAAG,YAAI,OAAO,UAAU,eAAe,KAAK,GAAG,CAA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,OAAO,GAAG,GAAG;AAC3B,MAAI,IAAI,OAAO,WAAW,cAAc,EAAE,OAAO,QAAQ;AACzD,MAAI,CAAC;AAAG,WAAO;AACf,MAAI,IAAI,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAE,GAAE;AAC/B,MAAI;AACA,YAAQ,MAAM,UAAU,MAAM,MAAM,EAAE,IAAI,EAAE,KAAM,GAAE;AAAM,SAAG,KAAK,EAAE,KAAK;AAAA,EAC5E,SACM,OAAO;AAAE,QAAI,EAAE,MAAc;AAAA,EAAG,UAC/B;AACJ,QAAI;AACA,UAAI,KAAK,CAAC,EAAE,SAAS,IAAI,EAAE,QAAQ;AAAI,UAAE,KAAK,CAAC;AAAA,IAClD,UACO;AAAE,UAAI;AAAG,cAAM,EAAE;AAAA,IAAQ;AAAA,EACpC;AACD,SAAO;AACT;AAkBO,SAAS,cAAc,IAAI,MAAM,MAAM;AAC5C,MAAI,QAAQ,UAAU,WAAW;AAAG,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,IAAI,IAAI,GAAG,KAAK;AACjF,UAAI,MAAM,EAAE,KAAK,OAAO;AACpB,YAAI,CAAC;AAAI,eAAK,MAAM,UAAU,MAAM,KAAK,MAAM,GAAG,CAAC;AACnD,WAAG,CAAC,IAAI,KAAK,CAAC;AAAA,MACjB;AAAA,IACJ;AACD,SAAO,GAAG,OAAO,MAAM,MAAM,UAAU,MAAM,KAAK,IAAI,CAAC;AACzD;AA8FuB,OAAO,oBAAoB,aAAa,kBAAkB,SAAU,OAAO,YAAY,SAAS;AACrH,MAAI,IAAI,IAAI,MAAM,OAAO;AACzB,SAAO,EAAE,OAAO,mBAAmB,EAAE,QAAQ,OAAO,EAAE,aAAa,YAAY;AACjF;","x_google_ignoreList":[0]}
|
package/dist/types.d.ts
CHANGED
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 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 createdByEmp: IEmployee;\r\n updated: string;\r\n updatedByEmp: IEmployee;\r\n mimeType: string;\r\n size: number;\r\n filename: string;\r\n attachmentName?: 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\r\n\r\nexport interface IEmployeeWithDepartment extends IEmployee {\r\n department: IDepartment;\r\n}"],"names":["EApproverRoles","EApproverTypes","EDecisionsTranslations","Eagendy","Estavy","Eassignments","EEntity"],"mappings":"AAsRY,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;AACA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iosInstance } 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 createdByEmp: IEmployee;\r\n updated: string;\r\n updatedByEmp: IEmployee;\r\n mimeType: string;\r\n size: number;\r\n filename: string;\r\n attachmentName?: string;\r\n attachmentType?: 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\r\n\r\nexport interface IEmployeeWithDepartment extends IEmployee {\r\n department: IDepartment;\r\n}"],"names":["EApproverRoles","EApproverTypes","EDecisionsTranslations","Eagendy","Estavy","Eassignments","EEntity"],"mappings":"AAsRY,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,gBAA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T extends DataTableInternalItems>({
|
|
|
362
362
|
column.filterSource
|
|
363
363
|
);
|
|
364
364
|
|
|
365
|
-
const options
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
item[column.
|
|
370
|
-
|
|
365
|
+
const options: IOptionItem[] = [];
|
|
366
|
+
|
|
367
|
+
response.data.forEach((item: any) => {
|
|
368
|
+
const categoryId =
|
|
369
|
+
item[column.filterValueKey as keyof typeof item]?.toString();
|
|
370
|
+
const categoryLabel =
|
|
371
|
+
item[column.filterLabelKey as keyof typeof item]?.toString();
|
|
372
|
+
const subcategories = item.subcategories;
|
|
373
|
+
|
|
374
|
+
if (
|
|
375
|
+
Array.isArray(subcategories) &&
|
|
376
|
+
subcategories.length > 0 &&
|
|
377
|
+
column.filterParam2
|
|
378
|
+
) {
|
|
379
|
+
//add parent categoriz without subcategiries
|
|
380
|
+
options.push({
|
|
381
|
+
value: categoryId,
|
|
382
|
+
label: categoryLabel,
|
|
383
|
+
});
|
|
384
|
+
// Multiply options by subcategories
|
|
385
|
+
subcategories.forEach((subcategory: any) => {
|
|
386
|
+
const subcategoryId = subcategory.id?.toString();
|
|
387
|
+
const subcategoryLabel = subcategory.name?.toString();
|
|
388
|
+
|
|
389
|
+
if (subcategoryId && subcategoryLabel) {
|
|
390
|
+
options.push({
|
|
391
|
+
value: `${categoryId}-${subcategoryId}`,
|
|
392
|
+
label: `${categoryLabel} - ${subcategoryLabel}`,
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
} else {
|
|
397
|
+
// No subcategories, use category only
|
|
398
|
+
options.push({
|
|
399
|
+
value: categoryId,
|
|
400
|
+
label: categoryLabel,
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
|
|
371
405
|
return options;
|
|
372
406
|
} catch (error) {
|
|
373
407
|
console.error("Error fetching filter options:", error);
|
|
@@ -514,8 +548,79 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
514
548
|
// Pagination display logic
|
|
515
549
|
const paginationDisplay = `Strana ${(currentPage || 0) + 1} z ${data?.totalPages || 1}`;
|
|
516
550
|
|
|
517
|
-
const filterHandler = (
|
|
518
|
-
|
|
551
|
+
const filterHandler = (
|
|
552
|
+
filterParam: keyof T,
|
|
553
|
+
value: string | string[],
|
|
554
|
+
filterParam2?: string,
|
|
555
|
+
clearFilterParam2?: boolean
|
|
556
|
+
) => {
|
|
557
|
+
setColumnFilters((prev) => {
|
|
558
|
+
const newFilters = { ...prev };
|
|
559
|
+
|
|
560
|
+
// Handle clearing both filters
|
|
561
|
+
if (
|
|
562
|
+
value === "" ||
|
|
563
|
+
value === "__clear__" ||
|
|
564
|
+
(Array.isArray(value) && value.length === 0)
|
|
565
|
+
) {
|
|
566
|
+
delete newFilters[String(filterParam)];
|
|
567
|
+
if (filterParam2) {
|
|
568
|
+
delete newFilters[filterParam2];
|
|
569
|
+
}
|
|
570
|
+
return newFilters;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
// Handle filterParam2 logic
|
|
574
|
+
if (filterParam2) {
|
|
575
|
+
// Check if we should clear filterParam2
|
|
576
|
+
if (clearFilterParam2) {
|
|
577
|
+
newFilters[String(filterParam)] = value;
|
|
578
|
+
delete newFilters[filterParam2];
|
|
579
|
+
return newFilters;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
// Handle combined values with delimiter
|
|
583
|
+
if (typeof value === "string" && value.includes("-")) {
|
|
584
|
+
const parts = value.split("-");
|
|
585
|
+
if (parts.length === 2) {
|
|
586
|
+
newFilters[String(filterParam)] = parts[0];
|
|
587
|
+
newFilters[filterParam2] = parts[1];
|
|
588
|
+
return newFilters;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
// Handle array values (multi-select) with subcategories
|
|
593
|
+
if (Array.isArray(value)) {
|
|
594
|
+
const subcategoryIds: string[] = [];
|
|
595
|
+
value.forEach((val: string) => {
|
|
596
|
+
if (val.includes("-")) {
|
|
597
|
+
const parts = val.split("-");
|
|
598
|
+
if (parts.length === 2) {
|
|
599
|
+
subcategoryIds.push(parts[1]);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
});
|
|
603
|
+
|
|
604
|
+
newFilters[String(filterParam)] =
|
|
605
|
+
value.length > 0 ? value : undefined;
|
|
606
|
+
if (subcategoryIds.length > 0) {
|
|
607
|
+
newFilters[filterParam2] = subcategoryIds;
|
|
608
|
+
} else {
|
|
609
|
+
delete newFilters[filterParam2];
|
|
610
|
+
}
|
|
611
|
+
return newFilters;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
// Value without subcategory - clear filterParam2
|
|
615
|
+
newFilters[String(filterParam)] = value;
|
|
616
|
+
delete newFilters[filterParam2];
|
|
617
|
+
return newFilters;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
// Regular case without filterParam2
|
|
621
|
+
newFilters[String(filterParam)] = value;
|
|
622
|
+
return newFilters;
|
|
623
|
+
});
|
|
519
624
|
setCurrentPage(0);
|
|
520
625
|
};
|
|
521
626
|
const handleToggleShowColFilters = () => {
|
|
@@ -827,7 +932,20 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
827
932
|
)}
|
|
828
933
|
|
|
829
934
|
{/* Main scrollable content area */}
|
|
830
|
-
<div
|
|
935
|
+
<div
|
|
936
|
+
ref={bottomScrollbarRef}
|
|
937
|
+
className="overflow-auto min-h-[500px] relative"
|
|
938
|
+
>
|
|
939
|
+
{isLoading && (
|
|
940
|
+
<div className="absolute inset-0 flex items-center justify-center h-[500px] py-2 z-10">
|
|
941
|
+
<Spinner />
|
|
942
|
+
</div>
|
|
943
|
+
)}
|
|
944
|
+
{!isLoading && (!data || data?.content?.length === 0) && (
|
|
945
|
+
<div className="absolute inset-0 flex items-center justify-center py-2 text-gray-600 font-medium text-xs top-[90px]">
|
|
946
|
+
Žádná data
|
|
947
|
+
</div>
|
|
948
|
+
)}
|
|
831
949
|
<table
|
|
832
950
|
ref={tableRef}
|
|
833
951
|
className="w-full leading-normal"
|
|
@@ -916,18 +1034,38 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
916
1034
|
<Select
|
|
917
1035
|
onValueChange={(value) => {
|
|
918
1036
|
if (value === "__clear__") {
|
|
919
|
-
filterHandler(filterParam as keyof T, "");
|
|
920
|
-
} else {
|
|
921
1037
|
filterHandler(
|
|
922
1038
|
filterParam as keyof T,
|
|
923
|
-
|
|
1039
|
+
"",
|
|
1040
|
+
filterParam2
|
|
924
1041
|
);
|
|
1042
|
+
} else {
|
|
1043
|
+
// Check if value contains delimiter (has subcategory)
|
|
1044
|
+
if (value.includes("-") && filterParam2) {
|
|
1045
|
+
filterHandler(
|
|
1046
|
+
filterParam as keyof T,
|
|
1047
|
+
value,
|
|
1048
|
+
filterParam2
|
|
1049
|
+
);
|
|
1050
|
+
} else {
|
|
1051
|
+
// Value without subcategory - clear filterParam2 if it exists
|
|
1052
|
+
filterHandler(
|
|
1053
|
+
filterParam as keyof T,
|
|
1054
|
+
value,
|
|
1055
|
+
filterParam2,
|
|
1056
|
+
true
|
|
1057
|
+
);
|
|
1058
|
+
}
|
|
925
1059
|
}
|
|
926
1060
|
}}
|
|
927
1061
|
value={
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
1062
|
+
filterParam2 &&
|
|
1063
|
+
mergedFilters?.[String(filterParam)] &&
|
|
1064
|
+
mergedFilters?.[String(filterParam2)]
|
|
1065
|
+
? `${mergedFilters[String(filterParam)]}-${mergedFilters[String(filterParam2)]}`
|
|
1066
|
+
: mergedFilters?.[
|
|
1067
|
+
String(filterParam)
|
|
1068
|
+
]?.toString() || "__clear__"
|
|
931
1069
|
}
|
|
932
1070
|
disabled={Object.keys(
|
|
933
1071
|
(filters as object) || {}
|
|
@@ -963,14 +1101,21 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
963
1101
|
options={
|
|
964
1102
|
filterOptions[String(filterParam)] || []
|
|
965
1103
|
}
|
|
966
|
-
onChange={(values) =>
|
|
1104
|
+
onChange={(values) => {
|
|
967
1105
|
filterHandler(
|
|
968
1106
|
filterParam as keyof T,
|
|
969
|
-
values
|
|
970
|
-
|
|
971
|
-
|
|
1107
|
+
values,
|
|
1108
|
+
filterParam2
|
|
1109
|
+
);
|
|
1110
|
+
}}
|
|
972
1111
|
value={
|
|
973
|
-
|
|
1112
|
+
Array.isArray(
|
|
1113
|
+
mergedFilters?.[String(filterParam)]
|
|
1114
|
+
)
|
|
1115
|
+
? mergedFilters[String(filterParam)]
|
|
1116
|
+
: mergedFilters?.[String(filterParam)]
|
|
1117
|
+
? [mergedFilters[String(filterParam)]]
|
|
1118
|
+
: []
|
|
974
1119
|
}
|
|
975
1120
|
placeholder={"Zadejte filtr"}
|
|
976
1121
|
className="px-0"
|
|
@@ -1148,28 +1293,6 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
1148
1293
|
)}
|
|
1149
1294
|
</tbody>
|
|
1150
1295
|
)}
|
|
1151
|
-
{isLoading && (
|
|
1152
|
-
<tbody className="relative">
|
|
1153
|
-
<tr>
|
|
1154
|
-
<td colSpan={100}>
|
|
1155
|
-
<div className="w-full flex items-center justify-center h-[500px] py-2">
|
|
1156
|
-
<Spinner />
|
|
1157
|
-
</div>
|
|
1158
|
-
</td>
|
|
1159
|
-
</tr>
|
|
1160
|
-
</tbody>
|
|
1161
|
-
)}
|
|
1162
|
-
{!isLoading && (!data || data?.content?.length === 0) && (
|
|
1163
|
-
<tbody className="relative h-[440px]">
|
|
1164
|
-
<tr>
|
|
1165
|
-
<td colSpan={100}>
|
|
1166
|
-
<div className="w-full flex items-center justify-center h-full py-2 text-gray-600 font-medium text-xs ">
|
|
1167
|
-
Žádná data
|
|
1168
|
-
</div>
|
|
1169
|
-
</td>
|
|
1170
|
-
</tr>
|
|
1171
|
-
</tbody>
|
|
1172
|
-
)}
|
|
1173
1296
|
</table>
|
|
1174
1297
|
</div>
|
|
1175
1298
|
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import React, { useState, useEffect, useCallback } from "react";
|
|
2
|
+
import { useDropzone } from "react-dropzone";
|
|
3
|
+
import { MdDeleteOutline, MdInsertDriveFile } from "react-icons/md";
|
|
4
|
+
import { AxiosError } from "axios";
|
|
5
|
+
import { cn } from "../../utils/utils";
|
|
6
|
+
import { IAttachment } from "../../types";
|
|
7
|
+
import { handleErrors, useFederationContext, useFormField } from "../../main";
|
|
8
|
+
|
|
9
|
+
export interface FileInputFormProps {
|
|
10
|
+
name: string;
|
|
11
|
+
value?: IAttachment | null;
|
|
12
|
+
onFileChanged: (file: IAttachment | null) => void;
|
|
13
|
+
description?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
attachmentName?: string;
|
|
16
|
+
attachmentType?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const MAX_FILE_SIZE = 1024 * 1024; // 1MB
|
|
20
|
+
|
|
21
|
+
const FileInputForm: React.FC<FileInputFormProps> = ({
|
|
22
|
+
value,
|
|
23
|
+
onFileChanged,
|
|
24
|
+
name,
|
|
25
|
+
description,
|
|
26
|
+
disabled,
|
|
27
|
+
attachmentName,
|
|
28
|
+
attachmentType,
|
|
29
|
+
}) => {
|
|
30
|
+
const [fileData, setFileData] = useState<IAttachment | null>(value || null);
|
|
31
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
32
|
+
|
|
33
|
+
const federationContext = useFederationContext();
|
|
34
|
+
const { error } = useFormField();
|
|
35
|
+
const hasError = !!error;
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
setFileData(value || null);
|
|
38
|
+
}, [value]);
|
|
39
|
+
const onDrop = useCallback(
|
|
40
|
+
async (acceptedFiles: File[]) => {
|
|
41
|
+
if (acceptedFiles.length > 0) {
|
|
42
|
+
const file = acceptedFiles[0];
|
|
43
|
+
|
|
44
|
+
if (file.size > MAX_FILE_SIZE) {
|
|
45
|
+
// Handle the case when the file size is exceeded
|
|
46
|
+
federationContext.emitter.emit("message", {
|
|
47
|
+
title: "Velikost souboru byla překročena",
|
|
48
|
+
message: `Maximální povolená velikost je ${MAX_FILE_SIZE / (1024 * 1024)} MB.`,
|
|
49
|
+
classes: "bg-danger ",
|
|
50
|
+
timeout: 0,
|
|
51
|
+
type: "error",
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const formData = new FormData();
|
|
57
|
+
|
|
58
|
+
// Add the JSON data object
|
|
59
|
+
const dataObject = {
|
|
60
|
+
...(attachmentName && { attachmentName }),
|
|
61
|
+
...(attachmentType && { attachmentType }),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
formData.append(
|
|
65
|
+
"data",
|
|
66
|
+
new Blob([JSON.stringify(dataObject)], { type: "application/json" })
|
|
67
|
+
);
|
|
68
|
+
formData.append("file", file);
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
const response = await federationContext.apiClient.post<IAttachment>(
|
|
72
|
+
"/files/upload",
|
|
73
|
+
formData,
|
|
74
|
+
{
|
|
75
|
+
headers: {
|
|
76
|
+
"Content-Type": "multipart/form-data",
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
const uploadedFile = response.data;
|
|
81
|
+
setFileData(uploadedFile);
|
|
82
|
+
onFileChanged(uploadedFile);
|
|
83
|
+
setIsFocused(false);
|
|
84
|
+
} catch (error) {
|
|
85
|
+
handleErrors(error as AxiosError, federationContext.emitter);
|
|
86
|
+
console.error("There was an error!", error);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
[
|
|
91
|
+
federationContext.apiClient,
|
|
92
|
+
federationContext.emitter,
|
|
93
|
+
onFileChanged,
|
|
94
|
+
attachmentName,
|
|
95
|
+
attachmentType,
|
|
96
|
+
]
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const { getRootProps, getInputProps, isDragActive } = useDropzone({
|
|
100
|
+
onDrop,
|
|
101
|
+
disabled,
|
|
102
|
+
multiple: false,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const handleRemove = () => {
|
|
106
|
+
setFileData(null);
|
|
107
|
+
onFileChanged(null);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<div className="w-full min-h-30 flex-col justify-start items-start gap-1.5 inline-flex sharedLibrary">
|
|
112
|
+
<div className="self-stretch flex-col justify-start items-start gap-1.5 flex">
|
|
113
|
+
<div
|
|
114
|
+
className={cn(
|
|
115
|
+
`self-stretch px-2 py-2 rounded-lg justify-start items-center gap-2 inline-flex outline-none border`,
|
|
116
|
+
isFocused &&
|
|
117
|
+
!hasError &&
|
|
118
|
+
"outline-4 outline-indigo-200 outline-offset-0 border-indigo-300",
|
|
119
|
+
|
|
120
|
+
hasError &&
|
|
121
|
+
"outline-4 outline-red-200 outline-offset-0 border-none",
|
|
122
|
+
!isFocused && hasError && "border-red-200 ",
|
|
123
|
+
disabled ? "bg-gray-100" : "bg-transparent"
|
|
124
|
+
)}
|
|
125
|
+
onFocus={() => setIsFocused(true)}
|
|
126
|
+
onBlur={() => setIsFocused(false)}
|
|
127
|
+
>
|
|
128
|
+
<div className="flex relative grow shrink basis-0 min-h-5 lg:min-h-[32px] justify-start items-stretch gap-2 max-w-full ">
|
|
129
|
+
{!fileData ? (
|
|
130
|
+
<div
|
|
131
|
+
{...getRootProps()}
|
|
132
|
+
className={`w-full p-4 border-dashed border-2 rounded-lg text-center ${
|
|
133
|
+
isDragActive
|
|
134
|
+
? "border-indigo-300 bg-indigo-50"
|
|
135
|
+
: "border-gray-300"
|
|
136
|
+
}`}
|
|
137
|
+
>
|
|
138
|
+
<input {...getInputProps()} id={name} />
|
|
139
|
+
<p className="text-gray-500">
|
|
140
|
+
{isDragActive
|
|
141
|
+
? "Sem přetáhněte soubor"
|
|
142
|
+
: "Klikněte pro nahrání, nebo nahrajte přetažením souboru"}
|
|
143
|
+
</p>
|
|
144
|
+
</div>
|
|
145
|
+
) : (
|
|
146
|
+
<div className="w-full flex items-center justify-between">
|
|
147
|
+
<div className=" flex">
|
|
148
|
+
<MdInsertDriveFile style={{ fontSize: "2rem" }} />
|
|
149
|
+
<a
|
|
150
|
+
href={`/api/files/download/${fileData.id}`}
|
|
151
|
+
className="pl-2 text-left underline text-primary"
|
|
152
|
+
target="_blank"
|
|
153
|
+
>
|
|
154
|
+
{fileData.filename}
|
|
155
|
+
</a>
|
|
156
|
+
</div>
|
|
157
|
+
{!disabled && (
|
|
158
|
+
<div
|
|
159
|
+
onClick={handleRemove}
|
|
160
|
+
className="text-gray-600 cursor-pointer hover:text-primary hover:bg-gray-200 rounded-full ml-4"
|
|
161
|
+
>
|
|
162
|
+
<MdDeleteOutline
|
|
163
|
+
style={{ fontSize: "1.5rem", margin: "15px" }}
|
|
164
|
+
/>
|
|
165
|
+
</div>
|
|
166
|
+
)}
|
|
167
|
+
</div>
|
|
168
|
+
)}
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
{description && (
|
|
173
|
+
<div
|
|
174
|
+
className="HintText self-stretch text-slate-600 text-sm font-normal leading-tight"
|
|
175
|
+
id={name + ":description"}
|
|
176
|
+
>
|
|
177
|
+
{description}
|
|
178
|
+
</div>
|
|
179
|
+
)}
|
|
180
|
+
</div>
|
|
181
|
+
);
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export default FileInputForm;
|