{"version":3,"file":"index-bnBcOTtc.js","sources":["../../../../../_ovlclient/src/library/snackapi.ts","../../../../../_ovlclient/src/effects.ts","../../../../../_ovlclient/src/dataapi.ts","../../../../../_ovlclient/src/global/hooks.ts","../../../../../_ovlclient/src/library/longrunningprocesstracker/processapi.ts","../../../../../_ovlclient/src/library/screenapi.ts","../../../../../_ovlclient/src/library/forms/validatorsapi.ts","../../../../../_ovlclient/src/library/forms/validators.ts","../../../../../_ovlclient/src/library/forms/helper.ts","../../../../../_ovlclient/src/library/forms/fieldapi.ts","../../../../../_ovlclient/src/library/forms/controls/helpers.ts","../../../../../_ovlclient/src/tracker/reactor.ts","../../../../../_ovlclient/src/tracker/tracker.ts","../../../../../_ovlclient/src/library/table/helpers.ts","../../../../../_ovlclient/src/library/forms/controls/actions.ts","../../../../../_ovlclient/src/tracker/proxyhandler.ts","../../../../../_ovlclient/src/library/forms/actions.ts","../../../../../_ovlclient/src/library/forms/formapi.ts","../../../../../_ovlclient/src/helpers.ts","../../../../../_ovlclient/node_modules/idb/build/index.js","../../../../../_ovlclient/src/offlinestorage.ts","../../../../../_ovlclient/src/global/actions.ts","../../../../../_ovlclient/src/library/sysbaseelement.ts","../../../../../_ovlclient/src/library/table/rowwrapper.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablesettings/helpers.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablesettings/hookactions.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablesettings/columnfilter/helpers.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablesettings/columnfilter/tabledef.ts","../../../../../_ovlclient/src/library/table/tableapi.ts","../../../../../_ovlclient/src/global/displayformats.ts","../../../../../_ovlclient/src/global/globals.ts","../../../../../_ovlclient/src/library/table/table.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablesettings/formdef.ts","../../../../../_ovlclient/src/library/table/actions.ts","../../../../../_ovlclient/src/library/actions.ts","../../../../../_ovlclient/src/library/dialog/dialogapi.ts","../../../../../_ovlclient/src/global/globalapi.ts","../../../../../_ovlclient/src/library/forms/sysformelement.ts","../../src/features/sys/login/hookActions.ts","../../src/features/sys/login/allactions.ts","../../img/logosmall.png","../../img/flags/4x3/de.svg","../../img/flags/4x3/fr.svg","../../src/features/sys/shellbar/hookactions.ts","../../src/features/sys/shellbar/allactions.ts","../../src/features/datdocuments/feedback/hookactions.ts","../../src/features/datdocuments/feedback/actions.ts","../../src/features/datdocuments/feedback/allactions.ts","../../src/features/datdocuments/searchpaket/hookactions.ts","../../src/features/datdocuments/searchpaket/allactions.ts","../../src/features/pkgpackaging/packaging/hookactions.ts","../../src/features/pkgpackaging/packaging/allactions.ts","../../src/screens/qutoffering/offering/helpers.ts","../../src/components/bpfilter/hookactions.ts","../../src/components/bpfilter/allactions.ts","../../src/screens/qutoffering/offering/details/helpers.ts","../../src/features/qutoffering/offeringsettings/helpers.ts","../../src/features/qutoffering/offeringsettings/hookactions.ts","../../../../../_ovlclient/ovlsyscomponents/syseditors/sysassetconfig01/formdef.ts","../../../../../_ovlclient/ovlsyscomponents/syseditors/sysassetconfig01/helpers.ts","../../../../../_ovlclient/ovlsyscomponents/syseditors/sysassetconfig01/defaulthookactions.ts","../../../../../_ovlclient/src/moduleHelpers.ts","../../src/features/qutoffering/offering/adminupload/hookactions.ts","../../src/features/qutoffering/offering/hookactions.ts","../../src/features/qutoffering/offering/actions.ts","../../src/features/qutoffering/offering/allactions.ts","../../src/features/qutoffering/offering/cut/poslist/hookactions.ts","../../src/features/qutoffering/offering/cut/poslist/allactions.ts","../../src/features/qutoffering/offering/adminupload/allactions.ts","../../src/features/qutoffering/offering/details/hookactions.ts","../../src/features/qutoffering/offering/details/allactions.ts","../../src/features/qutoffering/offeringsettings/allactions.ts","../../src/features/spcsymbolpc/hookactions.ts","../../src/features/spcsymbolpc/allactions.ts","../../src/appactions/features.ts","../../src/screens/datdocuments/feedback/allactions.ts","../../src/screens/datdocuments/order/allactions.ts","../../src/screens/datdocuments/quotation/allactions.ts","../../src/features/datdocuments/searchpaket/tabledef.ts","../../src/screens/datdocuments/searchpaket/allactions.ts","../../src/screens/pkgpackaging/packagingcustomerchooser/allactions.ts","../../src/screens/qutoffering/offering/allactions.ts","../../src/screens/qutoffering/offering/details/actions.ts","../../src/screens/qutoffering/offering/details/allactions.ts","../../src/screens/spcsymbolpc/allactions.ts","../../src/screens/spcsymbolpcenduser/allactions.ts","../../src/appactions/screens.ts","../../src/components/bpfilter/bpfilter.ts","../../src/components/bpfilter/compdef.ts","../../src/components/imagepopup/imagepopup.ts","../../src/components/imagepopup/compdef.ts","../../src/screens/datdocuments/feedback/feedbackform.ts","../../src/screens/datdocuments/invoice/dpinvoiceoverview.ts","../../src/screens/datdocuments/invoice/invoiceoverview.ts","../../src/screens/datdocuments/order/orderdetail.ts","../../src/screens/datdocuments/order/orderdetaillayout.ts","../../src/screens/datdocuments/order/orderfeedback.ts","../../src/screens/datdocuments/order/orderoverview.ts","../../src/screens/datdocuments/order/ordertimeline.ts","../../src/screens/datdocuments/quotation/quotationoverview.ts","../../src/screens/datdocuments/searchpaket/searchpaket.ts","../../src/features/datdocuments/compdef.ts","../../src/screens/qutoffering/offering/details/offeringdetails.ts","../../src/screens/qutoffering/offering/offering.ts","../../src/components/bpfilter/formdef.ts","../../src/screens/qutoffering/offering/offeringadmin.ts","../../src/screens/qutoffering/offering/offeringadmincut.ts","../../../../../_ovlclient/node_modules/lit-html/lit-html.js","../../../../../_ovlclient/src/library/dialog/helpers.ts","../../../../../_ovlclient/src/library/dialog/sysdialog2base.ts","../../src/features/qutoffering/offering/cut/poslist/poslist.ts","../../src/features/qutoffering/offeringsettings/offeringsettings.ts","../../src/features/qutoffering/compdef.ts","../../src/screens/spcsymbolpc/symbolpc.ts","../../src/screens/spcsymbolpcenduser/symbolpcenduser.ts","../../src/features/spcsymbolpc/compdef.ts","../../../../../_ovlclient/ovlsyscomponents/sysaudit01/screens/audit.ts","../../../../../_ovlclient/ovlsyscomponents/sysaudit01/compdef.ts","../../../../../_ovlclient/src/library/dialog/editorbase.ts","../../../../../_ovlclient/ovlsyscomponents/syseditors/sysassetconfig01/assetconfig.ts","../../../../../_ovlclient/ovlsyscomponents/syseditors/sysassetconfig01/compdef.ts","../../../../../_ovlclient/ovlsyscomponents/syslogin01/features/loginform.ts","../../../../../_ovlclient/ovlsyscomponents/syslogin01/compdef.ts","../../../../../_ovlclient/ovlsyscomponents/syslogin01/features/hooks.ts","../../../../../_ovlclient/ovlsyscomponents/syslogin01/features/helpers.ts","../../../../../_ovlclient/ovlsyscomponents/syslogin01/features/sysloginapi.ts","../../../../../_ovlclient/ovlsyscomponents/sysshellbar01/parts/backbutton.ts","../../../../../_ovlclient/ovlsyscomponents/sysshellbar01/hooks.ts","../../../../../_ovlclient/ovlsyscomponents/sysshellbar01/parts/hint.ts","../../../../../_ovlclient/ovlsyscomponents/sysshellbar01/parts/refresh.ts","../../../../../_ovlclient/ovlsyscomponents/sysdefaulthtmlsnippets01/index.ts","../../../../../_ovlclient/ovlsyscomponents/sysshellbar01/parts/shellbar.ts","../../../../../_ovlclient/ovlsyscomponents/sysshellbar01/compdef.ts","../../../../../_ovlclient/ovlsyscomponents/systranslation01/screens/translation.ts","../../../../../_ovlclient/ovlsyscomponents/systranslation01/compdef.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/company/company.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/parts/settings.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/helpers.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/permission/dialogpermission.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/permission/permission.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/role/role.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/user/user.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/userrole/userrole.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/userroletransfer/userroletransfer.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/compdef.ts","../../../../../_ovlclient/ovlsyscomponents/sysusersettings01/password/parts/passwordsettingsform.ts","../../../../../_ovlclient/ovlsyscomponents/sysusersettings01/password/compdef.ts","../../src/features/pkgpackaging/packaging/packagingsplit/packagingsplit.ts","../../src/screens/pkgpackaging/packaging/packaging.ts","../../src/screens/pkgpackaging/packagingcustomerchooser/packagingcustomerchooser.ts","../../src/screens/pkgpackaging/compdef.ts","../../src/parts/downloadpopup/downloadpopup.ts","../../src/parts/filelist/filelist.ts","../../node_modules/chart.js/dist/chunks/helpers.segment.js","../../node_modules/chart.js/dist/chart.js","../../src/parts/summarychart/summarychart.ts","../../src/screens/gen/dashboard/dashboard.ts","../../src/screens/gen/dashboard/compdef.ts","../../src/screens/gen/settings/settingsscreen.ts","../../src/screens/gen/settings/compdef.ts","../../src/global/hookactions.ts","../../src/global/actions.ts","../../src/appactions/global.ts","../../src/appactions/index.ts","../../src/components/imagepopup/state.ts","../../src/features/datdocuments/feedback/state.ts","../../src/features/datdocuments/searchpaket/state.ts","../../src/features/qutoffering/offering/state.ts","../../src/appstate/features.ts","../../src/screens/datdocuments/order/state.ts","../../src/screens/datdocuments/quotation/state.ts","../../src/screens/datdocuments/invoice/state.ts","../../src/screens/pkgpackaging/packagingcustomerchooser/state.ts","../../src/screens/qutoffering/offering/state.ts","../../src/appstate/screens.ts","../../src/features/pkgpackaging/packaging/packagingsplit/tabledef.ts","../../src/features/pkgpackaging/packaging/tabledef.ts","../../src/features/qutoffering/offering/adminupload/tabledef.ts","../../src/features/qutoffering/offering/details/tabledefs.ts","../../src/features/qutoffering/offering/tabledef.ts","../../src/features/qutoffering/offeringsettings/tabledef.ts","../../src/features/spcsymbolpc/tabledef.ts","../../src/features/spcsymbolpc/tabledefenduser.ts","../../src/features/qutoffering/offering/cut/poslist/tabledef.ts","../../src/global/state.ts","../../src/appstate/index.ts","../../src/appdef.ts","../../src/index.ts","../../../../../_ovlclient/src/library/snack/snack.ts","../../../../../_ovlclient/src/library/snack/actions.ts","../../../../../_ovlclient/src/library/longrunningprocesstracker/longrunningprocesstracker.ts","../../../../../_ovlclient/src/library/dialog/actions.ts","../../../../../_ovlclient/src/actions.ts","../../../../../_ovlclient/src/baseobjects.ts","../../../../../_ovlclient/src/appdefformvalidation.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablesettings/columnfilter/columnfilter.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablesettings/filtersort/tabledialog.ts","../../../../../_ovlclient/src/library/dialog/dialog.ts","../../../../../_ovlclient/src/library/dialog/sysdialogbase.ts","../../../../../_ovlclient/src/library/dialog/sysdialogholder.ts","../../../../../_ovlclient/src/library/forms/controls/syscontrolbase.ts","../../../../../_ovlclient/src/library/forms/controls/asset.ts","../../../../../_ovlclient/src/library/forms/controls/checkbox.ts","../../../../../_ovlclient/src/library/forms/controls/date.ts","../../../../../_ovlclient/src/library/forms/controls/datetime.ts","../../../../../_ovlclient/src/library/forms/controls/formvalidationhint.ts","../../../../../_ovlclient/src/library/forms/controls/listcontrol.ts","../../../../../_ovlclient/src/library/forms/controls/option.ts","../../../../../_ovlclient/src/library/forms/controls/parts/controlcustomvaluehint.ts","../../../../../_ovlclient/src/library/forms/controls/parts/controllabel.ts","../../../../../_ovlclient/src/library/forms/controls/parts/controlvalidationhint.ts","../../../../../_ovlclient/src/library/forms/controls/parts/hitlist.ts","../../../../../_ovlclient/src/library/forms/controls/parts/hitlistdialog/hitlistdialog.ts","../../../../../_ovlclient/src/library/forms/controls/parts/okcanceldeletefooter.ts","../../../../../_ovlclient/src/library/forms/controls/textarea.ts","../../../../../_ovlclient/src/library/forms/controls/textbox.ts","../../../../../_ovlclient/src/library/forms/controls/time.ts","../../../../../_ovlclient/src/library/specialcontainers/dialogcontainer/dialogcontainter.ts","../../../../../_ovlclient/src/library/specialcontainers/screencontainer/screencontainter.ts","../../../../../_ovlclient/src/library/table/headermenu.ts","../../../../../_ovlclient/src/library/table/navcontrol.ts","../../../../../_ovlclient/src/library/table/row.ts","../../../../../_ovlclient/src/library/table/rowcontrol.ts","../../../../../_ovlclient/src/library/table/rowform.ts","../../../../../_ovlclient/src/library/table/rowformbig.ts","../../../../../_ovlclient/src/library/table/rowformsavecancel.ts","../../../../../_ovlclient/src/library/table/rowvalidationsummary.ts","../../../../../_ovlclient/src/library/table/tableroweditformdialog/tableroweditformdialog.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablesettings/filter/filter.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablesettings/filter/rangefilter.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablesettings/filter/columnfilter.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablesettings/filtersortsettings/filtersortsettings.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablerowheadermenu.ts","../../../../../_ovlclient/src/registercomponents.ts","../../../../../_ovlclient/src/prepare.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablesettings/filtersort/tabledef.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablesettings/columnfilter/state.ts","../../../../../_ovlclient/src/library/table/tablerowheadermenu/tablesettings/state.ts","../../../../../_ovlclient/ovlsyscomponents/sysaudit01/features/tabledef.ts","../../../../../_ovlclient/ovlsyscomponents/systranslation01/features/tabledef.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/company/tabledef.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/permission/tabledef.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/role/tabledef.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/user/tabledef.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/userrole/tabledef.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/userroletransfer/tabledef.ts","../../../../../_ovlclient/ovlsyscomponents/sysportalsettings01/features/tabledef.ts","../../../../../_ovlclient/src/state.ts","../../../../../_ovlclient/ovlsyscomponents/sysaudit01/features/hookactions.ts","../../../../../_ovlclient/ovlsyscomponents/sysaudit01/features/allactions.ts","../../../../../_ovlclient/ovlsyscomponents/syslogin01/features/hookactions.ts","../../../../../_ovlclient/ovlsyscomponents/syslogin01/features/actions.ts","../../../../../_ovlclient/ovlsyscomponents/syslogin01/features/allactions.ts","../../../../../_ovlclient/ovlsyscomponents/systranslation01/features/hookactions.ts","../../../../../_ovlclient/ovlsyscomponents/systranslation01/features/allactions.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/hookactions.ts","../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/features/allactions.ts","../../../../../_ovlclient/ovlsyscomponents/sysusersettings01/password/features/hookactions.ts","../../../../../_ovlclient/ovlsyscomponents/sysusersettings01/password/features/actions.ts","../../../../../_ovlclient/ovlsyscomponents/sysusersettings01/password/features/allactions.ts","../../../../../_ovlclient/src/syscomponentsactions/features.ts","../../../../../_ovlclient/ovlsyscomponents/systranslation01/screens/allactions.ts","../../../../../_ovlclient/ovlsyscomponents/sysaudit01/screens/allactions.ts","../../../../../_ovlclient/src/syscomponentsactions/screens.ts","../../../../../_ovlclient/src/syscomponentsactions/index.ts","../../../../../_ovlclient/node_modules/lit-html/directive.js","../../../../../_ovlclient/node_modules/lit-html/directives/if-defined.js","../../../../../_ovlclient/node_modules/lit-html/directive-helpers.js","../../../../../_ovlclient/node_modules/lit-html/directives/repeat.js","../../../../../_ovlclient/node_modules/lit-html/directives/unsafe-html.js","../../../../../_ovlclient/src/index.ts"],"sourcesContent":["import { DirectiveResult, TemplateResult, ovl } from \"..\"\r\nimport { SYSSeqId } from \"../global/globals\"\r\nimport type { ReplaceSnackContentType } from \"./snack/actions\"\r\nimport type { SnackType } from \"./snack/snack\"\r\n\r\nexport const SnackTrackedReplaceContent = (\r\n content: ReplaceSnackContentType\r\n) => {\r\n ovl.getActions().ovl.internal._ReplaceSnackContent(content)\r\n}\r\n\r\nexport const SnackAdd = (\r\n text: string | DirectiveResult | TemplateResult,\r\n type: SnackType = \"Information\",\r\n durationMs: number = 4000\r\n) => {\r\n ovl.getActions().ovl.internal._AddSnack({ text, type, durationMs })\r\n}\r\nexport const SnackTrackedAdd = (\r\n text: string,\r\n type: SnackType = \"Information\",\r\n key?: string\r\n) => {\r\n if (!key) {\r\n key = SYSSeqId()\r\n }\r\n ovl.getActions().ovl.internal._AddSnack({\r\n text,\r\n type,\r\n durationMs: 999999,\r\n key,\r\n })\r\n return key\r\n}\r\nexport const SnackTrackedRemove = (key: string) => {\r\n setTimeout(() => {\r\n ovl.getActions().ovl.internal._RemoveSnack(key)\r\n }, 1000)\r\n}\r\n","import { ovl, SYSConfig } from \"./\"\r\nimport { Logout, SessionUpdate } from \"./global/globalapi\"\r\nimport { stringifyReplacer, T } from \"./global/globals\"\r\nimport { DialogModal, DialogOk } from \"./library/dialog/dialogapi\"\r\nimport type { SnackType } from \"./library/snack/snack\"\r\nimport { SnackAdd } from \"./library/snackapi\"\r\n\r\nexport let lastNoServerConnectionMsg: number\r\n\r\nexport const postRequest = async (\r\n url,\r\n data,\r\n isBlob?: boolean,\r\n noSnack?: boolean,\r\n customTimeoutMs?: number,\r\n authCookieCheck?: boolean\r\n //indicatorOptions?: IndicatorOptions\r\n) => {\r\n return await ovlFetch(\r\n url,\r\n data,\r\n \"POST\",\r\n isBlob,\r\n noSnack,\r\n customTimeoutMs,\r\n false\r\n\r\n //indicatorOptions\r\n )\r\n}\r\n\r\nexport const postFormDataRequest = async (\r\n url,\r\n data\r\n //indicatorOptions?: IndicatorOptions\r\n) => {\r\n return await ovlFetch(\r\n url,\r\n data,\r\n \"POST\",\r\n false,\r\n false,\r\n -1,\r\n true\r\n //indicatorOptions\r\n )\r\n}\r\n\r\n//export type AssetDisplayMode = \"Table\" | \"Edit\"\r\n\r\n// now when used for the fetch stuff we need an extended AssetType\r\n// export const getAssetRequest = async (\r\n// url,\r\n// data: AssetRequestParams,\r\n// isBlob?: boolean,\r\n// noSnack?: boolean\r\n// //indicatorOptions?: IndicatorOptions\r\n// ) => {\r\n// return await ovlFetch(\r\n// url,\r\n// data,\r\n// \"GET\",\r\n// isBlob,\r\n// noSnack,\r\n// -1,\r\n// false\r\n// //indicatorOptions\r\n// )\r\n// }\r\n\r\nexport const getRequest = async (\r\n url,\r\n data: any,\r\n isBlob?: boolean,\r\n noSnack?: boolean\r\n //indicatorOptions?: IndicatorOptions\r\n) => {\r\n return await ovlFetch(\r\n url,\r\n data,\r\n \"GET\",\r\n isBlob,\r\n noSnack,\r\n -1,\r\n false\r\n //indicatorOptions\r\n )\r\n}\r\n\r\nlet lastAppNoServerConnectionTimestamp = 0\r\nlet lastAppReloginTimestamp = 0\r\n\r\nexport type FetchExceptionType = {\r\n fetchParams?: { url: string; reqOptions: any }\r\n headers: any\r\n data?: any\r\n status: number\r\n message: string\r\n stacktrace?: string\r\n type: string\r\n}\r\n\r\nfunction FetchException(message: FetchExceptionType) {\r\n this.fetchParams = message.fetchParams\r\n this.headers = message.headers\r\n this.data = message.data\r\n this.status = message.status\r\n this.message = message.message\r\n this.stacktrace = message.stacktrace\r\n this.type = message.type\r\n}\r\n\r\nexport type SYSFetchResult = {\r\n status: number\r\n data: any\r\n headers: any\r\n message: string\r\n type: string\r\n}\r\n\r\nexport const ovlFetch = async (\r\n url,\r\n data,\r\n method: string,\r\n isBlob?: boolean,\r\n noSnack?: boolean,\r\n customTimeoutMs?: number,\r\n isFormData?: boolean,\r\n isAuthCheck?: boolean\r\n //indicatorOptions?: IndicatorOptions\r\n): Promise => {\r\n let res\r\n let snackMessage = \"\"\r\n let type = \"\"\r\n let snackMessageType: SnackType = \"Information\"\r\n let reqOptions\r\n let timer\r\n let state = ovl.getState()\r\n let isApiAccess = url.indexOf(state.ovl.apiUrl) > -1\r\n let token = state.ovl.session.Token\r\n try {\r\n //ovl.getActions().ovl.indicator.SetIndicatorOpen(indicatorOptions)\r\n // Create request to api service\r\n\r\n reqOptions = {\r\n method,\r\n headers: {},\r\n signal: undefined,\r\n }\r\n\r\n let headers = {}\r\n if (method === \"POST\" && !isFormData) {\r\n let contentType = \"application/json\"\r\n reqOptions.headers[\"Content-Type\"] = contentType\r\n }\r\n let user = state.ovl.user\r\n if (SYSConfig.fetch.authMode === \"token\" && user && token) {\r\n reqOptions.headers[\"itfprt\"] = token\r\n } else if (SYSConfig.fetch.authMode === \"jwtToken\" && user && token) {\r\n reqOptions.headers[\"Authorization\"] = \"Bearer \" + token\r\n } else if (SYSConfig.fetch.authMode === \"cookie\") {\r\n reqOptions.credentials = \"include\"\r\n }\r\n\r\n if (url.indexOf(\"ovlnocache\") > -1) {\r\n reqOptions[\"Cache\"] = \"no-cache\"\r\n headers[\"pragma\"] = \"no-cache\"\r\n }\r\n\r\n if (isFormData) {\r\n reqOptions[\"body\"] = data\r\n } else if (method === \"POST\") {\r\n reqOptions[\"body\"] = JSON.stringify(data, stringifyReplacer)\r\n } else if (data) {\r\n if (typeof data !== \"object\") {\r\n throw new Error(\r\n \"ovl fetch: Get Request Param need to be an flat Object\"\r\n )\r\n }\r\n url = GetUrlWithParams(url, data)\r\n }\r\n\r\n // forced timeout only in offline mode...timeouts are normally handled by the browser itself\r\n // but we need to rely on a timeout in offline mode which works the same across browsers, hence the forced timeout\r\n if (SYSConfig.offline.enabled) {\r\n let timeOutMs = SYSConfig.fetch.timeout\r\n if (customTimeoutMs && customTimeoutMs > -1) {\r\n timeOutMs = customTimeoutMs\r\n }\r\n if (timeOutMs && timeOutMs > 0) {\r\n const controller = new AbortController()\r\n const { signal } = controller\r\n\r\n timer = setTimeout(() => {\r\n controller.abort()\r\n }, timeOutMs)\r\n\r\n reqOptions.signal = signal\r\n }\r\n }\r\n const req = await fetch(url, reqOptions)\r\n if (SYSConfig.offline.enabled) {\r\n clearTimeout(timer)\r\n }\r\n if (\r\n isApiAccess &&\r\n (!SYSConfig.offline.enabled || reqOptions.method === \"POST\")\r\n ) {\r\n ovl.getState().ovl.app.offline.api = false\r\n }\r\n // with fetch we will have the repsonse status here on req object\r\n if (req.ok) {\r\n // ok all good\r\n // whenever there is a token change. save it to localStorage\r\n let itfprttoken = req.headers.get(\"itfprttoken\")\r\n if (itfprttoken !== null) {\r\n await SessionUpdate(\"Token\", itfprttoken)\r\n }\r\n let itfprtsession = req.headers.get(\"itfprtsession\")\r\n if (itfprtsession !== null) {\r\n let sessionObj = JSON.parse(itfprtsession)\r\n Object.keys(sessionObj).forEach((k) => {\r\n state.ovl.session[k] = sessionObj[k]\r\n })\r\n }\r\n\r\n if (isBlob) {\r\n res = await req.blob()\r\n } else {\r\n const contentType = req.headers.get(\"content-type\")\r\n\r\n if (contentType && contentType.indexOf(\"application/json\") !== -1) {\r\n res = await req.json()\r\n }\r\n }\r\n let res0 = { res }\r\n if (SYSConfig.fetch.useCompressed === true) {\r\n checkAllArrayPropertiesForCompressedAndUncompress(res0)\r\n }\r\n snackMessageType = \"Success\"\r\n\r\n return {\r\n headers: req.headers,\r\n data: res0.res,\r\n status: req.status,\r\n message: \"\",\r\n type: \"\",\r\n }\r\n } else {\r\n snackMessageType = \"Error\"\r\n snackMessage = \"\"\r\n if (req.status === 401) {\r\n // unauthorised\r\n snackMessage = \"\"\r\n let now = Date.now()\r\n if (token && now > lastAppReloginTimestamp + 5000 && !isAuthCheck) {\r\n lastAppReloginTimestamp = now\r\n SnackAdd(T(\"SYSLoginPleaseRelogin\"))\r\n }\r\n await DialogModal(\"SYSLogin\")\r\n if (isAuthCheck) {\r\n return\r\n }\r\n return await ovlFetch(\r\n url,\r\n data,\r\n method,\r\n isBlob,\r\n noSnack,\r\n customTimeoutMs,\r\n isFormData\r\n )\r\n } else if (req.status === 413) {\r\n if (!noSnack) {\r\n snackMessage = T(\"SYSUploadTooBig\")\r\n }\r\n throw new FetchException({\r\n headers: req.headers,\r\n data: undefined,\r\n status: 413,\r\n message: T(\"SYSUploadTooBig\"),\r\n type: \"\",\r\n })\r\n } else if (req.status === 404) {\r\n // well... go to offline mode. We need it as well here (depends on the webserver...)\r\n if (isApiAccess) {\r\n ovl.getState().ovl.app.offline.api = true\r\n }\r\n let nfurl = url\r\n if (data && data.id1) {\r\n nfurl = data.id1\r\n }\r\n if (!SYSConfig.offline.enabled && !noSnack) {\r\n snackMessage = T(\"SYSResourceNotFound\", [nfurl])\r\n }\r\n throw new FetchException({\r\n headers: req.headers,\r\n data: undefined,\r\n status: 404,\r\n message: snackMessage,\r\n type: \"\",\r\n })\r\n } else if (req.status === 403) {\r\n snackMessage = T(\"SYSResourceForbidden\")\r\n // we need to throw the FetchException for the callers logic\r\n // test usecase BAR ACTActivitiesUserExt Close an activity when in Role Close is not configured\r\n setTimeout(async () => {\r\n await DialogOk(snackMessage)\r\n Logout(true)\r\n }, 1000)\r\n throw new FetchException({\r\n headers: req.headers,\r\n data: undefined,\r\n status: 403,\r\n message: snackMessage,\r\n type: \"OvlResourceForbidden\",\r\n })\r\n } else if (req.status === 400) {\r\n // when having a 400 we may have a returned type property which could be important for ovl (validation)\r\n let msg = await req.json()\r\n if (msg) {\r\n if (msg.type) {\r\n type = msg.type\r\n }\r\n if (msg.message) {\r\n snackMessage = msg.message\r\n } else {\r\n snackMessage = req.statusText\r\n }\r\n }\r\n\r\n throw new FetchException({\r\n headers: req.headers,\r\n data: undefined,\r\n status: 400,\r\n message: snackMessage,\r\n type: type,\r\n })\r\n } else if (req.status === 422) {\r\n let type = \"\"\r\n let msg = await req.json()\r\n if (msg.type) {\r\n type = msg.type\r\n }\r\n throw new FetchException({\r\n headers: req.headers,\r\n data: undefined,\r\n status: 422,\r\n message: msg.errormessage,\r\n type,\r\n })\r\n } else {\r\n let msg = undefined\r\n try {\r\n msg = await req.json()\r\n } catch {\r\n // if there is no json result (eg. a 500 error throwed from server)\r\n // create a generic one\r\n msg = { message: \"Server Error\" }\r\n }\r\n let type = \"\"\r\n if (msg) {\r\n if (!msg.message) {\r\n snackMessage = \"Server Error\"\r\n } else {\r\n snackMessage = msg.message\r\n }\r\n }\r\n\r\n throw new FetchException({\r\n headers: req.headers,\r\n data: undefined,\r\n status: req.status,\r\n message: msg.message,\r\n stacktrace: msg.stacktrace,\r\n type: type,\r\n })\r\n }\r\n // init with error\r\n }\r\n } catch (err) {\r\n console.log(err)\r\n if (err instanceof FetchException) {\r\n throw err\r\n }\r\n\r\n // connection error\r\n // well... go to offline mode\r\n if (isApiAccess) {\r\n ovl.getState().ovl.app.offline.api = true\r\n }\r\n\r\n let state = ovl.getState()\r\n // don't display connection error msgs in offline mode and already logged in\r\n // instead use other indication (blinking offline stuff to signalize we are offline)\r\n let noServerConnectionMsg = \"No Server Connection!\"\r\n if (!SYSConfig.offline.enabled || !state.ovl.app.ready) {\r\n let now = Date.now()\r\n if (now > lastAppNoServerConnectionTimestamp + 5000) {\r\n lastAppNoServerConnectionTimestamp = now\r\n setTimeout(() => {\r\n SnackAdd(noServerConnectionMsg, \"Warning\")\r\n }, 2000)\r\n }\r\n }\r\n throw new FetchException({\r\n fetchParams: { url, reqOptions },\r\n headers: undefined,\r\n data: undefined,\r\n status: 449,\r\n message: noServerConnectionMsg,\r\n type: \"OvlServerOffline\",\r\n })\r\n } finally {\r\n //ovl.getActions().ovl.indicator.SetIndicatorClose(indicatorOptions)\r\n if (timer) {\r\n clearTimeout(timer)\r\n }\r\n if (snackMessage && !type) {\r\n //@ts-ignore\r\n if (!noSnack || snackMessageType === \"Error\") {\r\n //@ts-ignore\r\n if (snackMessageType === \"Error\") {\r\n console.log(\"Fetch Error: \" + snackMessage)\r\n }\r\n if (!noSnack) {\r\n SnackAdd(snackMessage, snackMessageType)\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nconst checkAllArrayPropertiesForCompressedAndUncompress = (obj) => {\r\n for (const key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n if (Array.isArray(obj[key])) {\r\n obj[key] = _uncompressAndMassageServerData(obj[key])\r\n checkAllArrayPropertiesForCompressedAndUncompress(obj[key])\r\n } else if (typeof obj[key] === \"object\") {\r\n checkAllArrayPropertiesForCompressedAndUncompress(obj[key])\r\n }\r\n }\r\n }\r\n}\r\n\r\nconst _uncompressAndMassageServerData = (serverData: any[]): any[] => {\r\n if (serverData[1] !== undefined) {\r\n // there is more than 1 row check if first object.keys from second row is in first row\r\n\r\n // and it needs to be an array of objects\r\n // and first entriy object value needs to be string\r\n // if no its the compressed format\r\n if (\r\n typeof serverData[0] === \"object\" &&\r\n typeof Object.keys(serverData[0])[0] === \"string\" &&\r\n serverData[0][Object.keys(serverData[1])[0]] === undefined\r\n ) {\r\n // compressed format...\r\n // create a map with colIndex -> colName\r\n let colIndexToColName = new Map()\r\n Object.keys(serverData[0]).forEach((key) => {\r\n colIndexToColName.set(serverData[0][key].toString(), key)\r\n })\r\n\r\n // remove first row\r\n serverData.shift()\r\n let uncompressedData = serverData.map((row) => {\r\n let newRow = {}\r\n for (let key of colIndexToColName.keys()) {\r\n let colVal = row[key]\r\n if (colVal === undefined) {\r\n colVal = null\r\n }\r\n let colName = colIndexToColName.get(key)\r\n if (newRow[colName] === undefined) {\r\n newRow[colName] = colVal\r\n }\r\n }\r\n return newRow\r\n })\r\n serverData = uncompressedData\r\n }\r\n }\r\n return serverData\r\n}\r\n\r\nexport const GetUrlWithParams = (url: string, data: {}): string => {\r\n // encode data as url param\r\n const UrlCreator = window.URL || window.webkitURL\r\n var urlWithParams = new UrlCreator(url)\r\n Object.keys(data).forEach((k) => {\r\n urlWithParams.searchParams.append(k, data[k])\r\n })\r\n urlWithParams.searchParams.append(\r\n \"v\",\r\n ovl.getState().ovl.app.discCacheVersion.toString()\r\n )\r\n return urlWithParams.toString()\r\n}\r\n","import { ovl } from \".\"\r\nimport { ovlFetch, SYSFetchResult } from \"./effects\"\r\n\r\ntype DataOptions = {\r\n customUrl?: string\r\n method?: \"POST\" | \"GET\"\r\n ignoreSnack?: boolean\r\n expectBlob?: boolean\r\n isFormData?: boolean\r\n isAuthCheck?: boolean\r\n}\r\n\r\nexport const Data = async (\r\n endpoint,\r\n data?,\r\n options?: DataOptions\r\n): Promise => {\r\n if (data === undefined) {\r\n data = {}\r\n }\r\n let url = options?.customUrl\r\n if (!url) {\r\n url = `${ovl.getState().ovl.apiUrl}${endpoint}`\r\n }\r\n let method = options?.method\r\n if (!method) {\r\n method = \"POST\"\r\n }\r\n let expectBlob = options?.expectBlob\r\n if (expectBlob === undefined) {\r\n expectBlob = false\r\n }\r\n let ignoreSnack = options?.ignoreSnack\r\n if (ignoreSnack === undefined) {\r\n ignoreSnack = false\r\n }\r\n let isFormData = options?.isFormData\r\n if (isFormData === undefined) {\r\n isFormData = false\r\n }\r\n return await ovlFetch(\r\n url,\r\n data,\r\n method,\r\n expectBlob,\r\n ignoreSnack,\r\n undefined,\r\n isFormData,\r\n options?.isAuthCheck\r\n )\r\n}\r\n","//Screen Functions ###################################\r\n\r\nimport type {\r\n CustomValidatorsType,\r\n DirectiveResult,\r\n SYSDialog,\r\n SYSEditor,\r\n SYSFeature,\r\n SYSForm,\r\n SYSFormValidationValidators,\r\n SYSScreen,\r\n SYSTableDefIds,\r\n TemplateResult,\r\n} from \"../\"\r\n\r\nimport type { SYSField, SYSFormState } from \"../library/forms/actions\"\r\nimport type { LookupListPostData } from \"../library/forms/controls/helpers\"\r\n\r\nimport { DialogsState } from \"../library/dialog/sysdialogbase\"\r\nimport type { SYSFormField, Schema } from \"../library/forms/sysformelement\"\r\nimport type { FileUploadContainer } from \"../library/table/actions\"\r\nimport type { CellClass } from \"../library/table/row\"\r\nimport type { GroupHeaderFooterBreaksValueType } from \"../library/table/rowwrapper\"\r\nimport type {\r\n ColumnDisplayDef,\r\n DisplayMode,\r\n DragDropEventType,\r\n EditDisplayMode,\r\n EditGroups,\r\n EditMode,\r\n ListDefinition,\r\n SYSTableData,\r\n SYSTableDef,\r\n SaveMode,\r\n RowFunctionResultToSet,\r\n TableClickModifiersType,\r\n TableDataAndDef,\r\n ViewRowClassType,\r\n _ColumnVisibility,\r\n GroupBreakType,\r\n SelectRowDefMode,\r\n} from \"../library/table/table\"\r\nimport { _TableGetReturnType } from \"../library/table/tableapi\"\r\n\r\nimport {\r\n OptionsValidate,\r\n OptionsValidateResultError,\r\n ValidateResultError,\r\n ValidateResultVisibleSummaryError,\r\n ValidationsAddOptions,\r\n ValidatorOptions,\r\n ValidatorUseOptions,\r\n} from \"../library/forms/validators\"\r\nimport { LongRunningProcessState } from \"../library/longrunningprocesstracker/longrunningprocesstracker\"\r\n\r\nexport type HookFormSummaryValidationTextDisplay_Type = {\r\n formState: SYSFormState\r\n visibleErrors: ValidateResultVisibleSummaryError[]\r\n}\r\n\r\nexport type HookFormSummaryValidationTextDisplay_ReturnType = {\r\n // default and implmeneted: All the Errors\r\n res?: TemplateResult | TemplateResult[]\r\n // @todo if the user wants to display the full summary boxes himself he can use \"ResultIsCompleteHtml\" (Default is \"ResultIsTextHtml\")\r\n resolve?: \"UseDefault\" | \"ResultIsCompleteHtml\" | \"ResultIsTextHtml\"\r\n}\r\n\r\n// subFeature X\r\nexport const HookFormSummaryValidationTextDisplay =\r\n \"HookForm{subFeature}SummaryValidationTextDisplay\"\r\n\r\nexport type HookFormValidatorsCustom_Type = {\r\n field: SYSField\r\n options: ValidatorOptions\r\n validator: CustomValidatorsType\r\n}\r\n\r\nexport type HookFormValidatorsCustom_ReturnType = boolean\r\n// subFeature unclear\r\nexport const HookFormValidatorsCustom = \"HookFormValidatorsCustom\"\r\n\r\nexport type HookFormValidatorsDefaults_Type = {\r\n defaultsToSet: OptionsValidate\r\n formState: SYSFormState\r\n}\r\n// subFeature unclear\r\nexport const HookFormValidatorsDefaults = \"HookFormValidatorsDefaults\"\r\n\r\nexport type HookFieldValidationTextDisplay_Type = {\r\n formState: SYSFormState\r\n field: SYSField\r\n visibleErrors: ValidateResultError[]\r\n}\r\nexport type HookFieldValidationTextDisplay_ReturnType = {\r\n res?: TemplateResult | TemplateResult[]\r\n resolve?: \"UseDefault\"\r\n}\r\n\r\n//subFeature X\r\nexport const HookFieldValidationTextDisplay =\r\n \"HookField{subFeature}ValidationTextDisplay\"\r\n\r\nexport type HookAppUrlResolver_Type = {\r\n apiUrlToSet: string\r\n wsUrlToSet: string\r\n isDemoToSet: boolean\r\n isTestingToSet: boolean\r\n cleanUrlToSet: boolean\r\n}\r\n\r\nexport const HookAppUrlResolver = \"HookAppUrlResolver\"\r\n\r\nexport type HookAppFileOpen_Type = {\r\n blob: any\r\n mimeType: string\r\n feature: SYSFeature\r\n fileName: string\r\n responseHeaders: any\r\n}\r\n\r\nexport const HookAppFileOpen = \"HookAppFileOpen\"\r\n\r\nexport const HookAppReady = \"HookAppReady\"\r\nexport const HookAppInit = \"HookAppInit\"\r\nexport const HookAppStateReady = \"HookAppStateReady\"\r\nexport const HookAppRouting = \"HookAppRouting\"\r\nexport const HookAppAfterRehydrate = \"HookAppAfterRehydrate\"\r\nexport const HookAppSaveState = \"HookAppSaveState\"\r\n\r\nexport type HookTableInit_Type = {\r\n context: \"before\" | \"after\"\r\n tableDef: SYSTableDef\r\n}\r\nexport const HookTableInit = \"HookTableInit\"\r\n\r\nexport type HookTableSchemaAssign_Type = {\r\n tableDefId: SYSTableDefIds\r\n schemaToSet: { [key in keyof RowType]: Schema }\r\n}\r\nexport const HookTableSchemaAssign = \"HookTableSchemaAssign\"\r\n\r\nexport type HookTableDragDrop_Type = {\r\n type: DragDropEventType\r\n e: DragEvent\r\n row: { [key in keyof RowType]: any }\r\n key: string\r\n el: HTMLElement\r\n formState: SYSFormState\r\n columnKey: keyof RowType\r\n tableDefId: SYSTableDefIds\r\n}\r\nexport const HookTableDragDrop = \"HookTableDragDrop\"\r\n\r\n// the eventhandler if the user selected/clicked the cell\r\nexport type HookDialogClose_Type = {\r\n dialog: SYSDialog\r\n dialogState: DialogsState\r\n dialogInstance: any\r\n}\r\nexport type HookDialogClose_ReturnType = boolean\r\nexport const HookDialogClose = \"HookDialogClose\"\r\n\r\nexport type HookDialogActivate_Type = HookDialogClose_Type\r\nexport const HookDialogActivate = \"HookDialogActivate\"\r\n\r\ntype NavDirection = \"Back\" | \"Forward\"\r\n// gets called when user navigates into a screen\r\nexport type HookScreenNavigateIn_ReturnType = boolean\r\n\r\nexport type HookScreenNavigateIn_Type = {\r\n navDirection: NavDirection\r\n screen: SYSScreen\r\n fromScreen: SYSScreen\r\n instance?: any\r\n}\r\nexport type HookScreenNavigateOut_Type = {\r\n navDirection: NavDirection\r\n screen: SYSScreen\r\n toScreen: SYSScreen\r\n instance?: any\r\n}\r\nexport const HookScreenNavigateIn = \"HookScreenNavigateIn\"\r\n\r\nexport type HookScreenNavigateOut_ReturnType = boolean\r\nexport const HookScreenNavigateOut = \"HookScreenNavigateOut\"\r\n\r\n//Default interceptable Functions\r\nexport type HookTableFn_ReturnType = boolean | void\r\nexport type HookTableFnTypes =\r\n | \"ColumnFilter\"\r\n | \"ColumnRangeFilter\"\r\n | \"CustomFilter\"\r\n | \"AttributeFilter\"\r\n | \"Filter\"\r\n | \"FilterSelected\"\r\n | \"ColumnSort\"\r\n | \"CustomSort\"\r\n | \"CustomColumnFunction\"\r\n | \"TableSettingsApplyFilterSort\"\r\n | \"SelectAll\"\r\n\r\nexport type HookTableFn_Type = {\r\n FnType: HookTableFnTypes\r\n // contains keys like column keys, filtered keys, ...\r\n id?: any\r\n val1?: any\r\n val2?: any\r\n // if started for a selection this is true\r\n selection?: any\r\n // in before context we can return cancel = true from our functions to not start the fn\r\n before: boolean\r\n // if called from ovl itself and is not triggered directly by user action\r\n innerEvent?: boolean\r\n}\r\nexport const HookTableFn = \"HookTableFn\"\r\n\r\n//Form Functions ####################################\r\n\r\nexport type HookFormInit_Type = {\r\n formState: SYSFormState\r\n fields: { [key in keyof RowType]: SYSField }\r\n}\r\nexport type HookFormInit_ReturnType =\r\n | undefined\r\n | {\r\n fieldsToRemove?: string[]\r\n groupsToRemove?: string[]\r\n }\r\n\r\n// subFeature X\r\nexport const HookFormInit = \"HookForm{subFeature}Init\"\r\n\r\nexport type HookFormRemove_Type = {\r\n formState: SYSFormState\r\n fields: { [key in keyof RowType]: SYSField }\r\n}\r\n\r\n// subFeature x\r\nexport const HookFormRemove = \"HookForm{subFeature}Remove\"\r\n\r\nexport type FieldValueChanged = {\r\n isValid: boolean\r\n field: SYSField\r\n fieldKey: keyof RowType\r\n oldValue: any\r\n newValue: any\r\n oldValidValue: any\r\n validValueChanged: boolean\r\n fromInit: boolean\r\n tab: number\r\n group: number\r\n}\r\n\r\nexport type ValidatorCheckOptions = {\r\n field: SYSField\r\n val: any\r\n}\r\n\r\nexport type HookFormChanged_Type = {\r\n formState: SYSFormState\r\n fields: { [key in keyof RowType]: SYSField }\r\n row: RowType\r\n validatorUse: (\r\n validator: SYSFormValidationValidators,\r\n options?: ValidatorUseOptions\r\n ) => boolean\r\n validatorCheck: (\r\n validator: SYSFormValidationValidators,\r\n options?: ValidatorCheckOptions\r\n ) => boolean\r\n validationsAdd: (\r\n translationKey: string,\r\n options?: ValidationsAddOptions\r\n ) => void\r\n validationsRemove: (\r\n fields: SYSField | SYSField[],\r\n valisationKey: string\r\n ) => boolean\r\n\r\n changedFieldSetCorrectedValue: (val: string) => Promise\r\n\r\n initiatedByFormInit?: boolean\r\n changedField?: FieldValueChanged\r\n}\r\n//subFeature x\r\nexport const HookFormChanged = \"HookForm{subFeature}Changed\"\r\n\r\n// // gets called whenever detailview rendered\r\n// export type HookViewAfterRender_Type = { view: ViewRowDef }\r\n// export const HookViewAfterRender = \"ViewAfterRender\"\r\n\r\nexport type HookFormRenderingAfterRender_Type = {\r\n formState: SYSFormState\r\n comp: HTMLElement\r\n}\r\n// subFeature x\r\nexport const HookFormRenderingAfterRender =\r\n \"HookForm{subFeature}RenderingAfterRender\"\r\n\r\nexport type HookFormRenderingFirstUpdated_Type = {\r\n formState: SYSFormState\r\n comp: HTMLElement\r\n}\r\n\r\n// subFeature x\r\nexport const HookFormRenderingFirstUpdated =\r\n \"HookForm{subFeature}RenderingFirstUpdated\"\r\n\r\nexport type HookFormRenderingUpdated_Type = {\r\n formState: SYSFormState\r\n comp: HTMLElement\r\n}\r\n\r\n// subFeature x\r\nexport const HookFormRenderingUpdated = \"HookForm{subFeature}RenderingUpdated\"\r\n\r\n// same for table\r\n\r\nexport type HookTableRenderingAfterRender_Type = {\r\n defId: SYSTableDefIds\r\n comp: HTMLElement\r\n}\r\nexport const HookTableRenderingAfterRender = \"HookTableRenderingAfterRender\"\r\n\r\nexport type HookTableRenderingFirstUpdated_Type = {\r\n defId: SYSTableDefIds\r\n comp: HTMLElement\r\n}\r\nexport const HookTableRenderingFirstUpdated = \"HookTableRenderingFirstUpdated\"\r\n\r\nexport type HookTableRenderingUpdated_Type = {\r\n defId: SYSTableDefIds\r\n comp: HTMLElement\r\n}\r\nexport const HookTableRenderingUpdated = \"HookTableRenderingUpdated\"\r\n\r\nexport type HookFormDirtyChanged_Type = {\r\n formState: SYSFormState\r\n newDirty: boolean\r\n}\r\n\r\n// subFeature x\r\nexport const HookFormDirtyChanged = \"HookForm{subFeature}DirtyChanged\"\r\n\r\nexport type HookFormIsDirty_Type = {\r\n formState: SYSFormState\r\n dirtyFromFields: boolean\r\n}\r\nexport type HookFormIsDirty_ReturnType = {\r\n forceIsDirtyTrue?: boolean\r\n}\r\n\r\n// subFeature x\r\nexport const HookFormIsDirty = \"HookForm{subFeature}IsDirty\"\r\n\r\n// subFeature x\r\nexport const HookFormIsValid = \"HookFormIsValid\"\r\nexport type HookFormIsValid_Type = {\r\n formState: SYSFormState\r\n validFromFields: boolean\r\n}\r\nexport type HookFormIsValid_ReturnType = {\r\n forceIsInvalidTrue?: boolean\r\n}\r\n\r\n// gets called when a form fields current value is changed by user input\r\nexport type HookFormValidate_Type = {\r\n formState: SYSFormState\r\n\r\n field: SYSField\r\n fieldKey: keyof RowType\r\n fields: { [key in keyof RowType]: SYSField }\r\n oldValue: any\r\n newValue: any\r\n row: RowType\r\n correctedValue: any\r\n validatorUse: (\r\n validator: SYSFormValidationValidators,\r\n options?: ValidatorUseOptions\r\n ) => boolean\r\n validatorCheck: (\r\n validator: SYSFormValidationValidators,\r\n options?: ValidatorCheckOptions\r\n ) => boolean\r\n validationsAdd: (\r\n translationKey: string,\r\n options?: ValidationsAddOptions\r\n ) => void\r\n group: number\r\n tab: number\r\n}\r\n\r\n// subFeature x\r\nexport const HookFormValidate = \"HookFormValidate\"\r\n// gets called when formdata is added\r\n// eg. useful if user defined some values in the FormDataAdd Hook which are not columns\r\n// those values gets saved as well (think: nonvisible in form fields but client dictated defaults for add)\r\nexport type HookFormAdd_Type = {\r\n newRow: RowType\r\n tableDef: SYSTableDef\r\n tableData: SYSTableData\r\n copyFromKey: string\r\n}\r\nexport type HookFormAdd_ReturnType = {\r\n fieldKeyToFocus?: keyof RowType\r\n}\r\nexport const HookFormAdd = \"HookFormAdd\"\r\nexport type HookTableRowFnResultExecution_Type = {\r\n def: SYSTableDef\r\n data: SYSTableData\r\n fnKey: string\r\n fnName: string\r\n mode: \"start\" | \"beforeResultHandler\" | \"afterResultHandler\" | \"end\"\r\n currentResult: TableRowFnProcessFeedbackFull_Type\r\n executionContextToSet: {\r\n doNotExecuteSystemAfterResultHandler?: boolean\r\n doNotSetFeedbackOnProcess?: boolean\r\n custom?: any\r\n }\r\n currentFeedback: { [key: string]: TableRowFnProcessRawFeedback_Type }\r\n}\r\n\r\nexport const HookTableRowFnResultExecution = \"HookTableRowFnResultExecution\"\r\n\r\nexport type TableRowFnProcessRawFeedbackSummaryCount_Type = \"cis\" | \"ncis\"\r\n\r\nexport type TableRowFnProcessRawFeedback_Type = {\r\n type: \"error\" | \"warning\" | \"success\" | \"information\" | \"remove\"\r\n text?: string | TemplateResult | DirectiveResult\r\n code?: string\r\n id?: string\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n}\r\n\r\nexport type TableRowFnProcessFeedback_Type =\r\n TableRowFnProcessRawFeedback_Type & {\r\n fieldsRes?: any\r\n // if any, put the known data entity directly here. It will be composed to an array and handed over to TableServerRefresh fn\r\n tableRefreshData?: any\r\n }\r\n\r\nexport type TableRowFnProcessFeedbackFull_Type =\r\n TableRowFnProcessFeedback_Type & {\r\n ts?: number\r\n fnId?: string //id of the function (needed when we need to create a process on the fly)\r\n defId?: SYSTableDefIds\r\n // if any, put specific fields into fieldsRes which needs to be processed separately by the hook\r\n }\r\n\r\n// if it returns false no generic success snack will be displayed\r\nexport type HookTableRowFn_Type = {\r\n isSingle: boolean\r\n fnKey: string\r\n rowKey: string\r\n def: SYSTableDef\r\n data: SYSTableData\r\n row: RowType\r\n rows: { [key: string]: RowType }\r\n // multi will be undefined if not called form multiple selection (headermenu)\r\n multi?: { isFirst: boolean; isLast: boolean; currentIndex: number }\r\n selectedKeys: string[]\r\n resultToSet: RowFunctionResultToSet\r\n connectedConfirmFormState: SYSFormState\r\n}\r\nexport const HookTableRowFn = \"HookTableRowFn\"\r\n\r\nexport type HookTableRowFnConfirmToSet_Type = {\r\n systemValidationContent: string | TemplateResult\r\n systemConfirmContent: string | TemplateResult\r\n customConfirmContent: string | TemplateResult\r\n // push invalidkeys to this array\r\n // if in confirm dialog and we need more control\r\n // usecase kaltag spcsymbol. should only be delete if not already used by customer\r\n invalidKeys: string[]\r\n cancelFn?: boolean\r\n noPrompt?: boolean\r\n}\r\n\r\nexport type RowFnConfirmContentFieldsReset_Type =\r\n | \"Never\"\r\n | \"ResultHasSuccessAndOrWarning\"\r\n | \"ResultHasOnlySuccess\"\r\n | \"Always\"\r\n// gets called for additional info or even a connected form when prompting rowfns (ok button disabled in OkCancel Dialog when form invalid)\r\nexport type HookTableRowFnConfirm_Type = {\r\n connectedFormState: SYSFormState\r\n defaultFormBodyRenderer: () => TemplateResult\r\n isMulti: boolean\r\n toSet: HookTableRowFnConfirmToSet_Type\r\n fnName: string\r\n fnKey: string\r\n tableDefId: SYSTableDefIds\r\n selectedKeys: string[]\r\n validKeys: string[]\r\n rows: { [key: string]: RowType }\r\n}\r\nexport const HookTableRowFnConfirm = \"HookTableRowFnConfirm\"\r\n\r\n// gets called when a form/row is selected and controls the row edit enabled\r\nexport type HookTableRowFnCan_Type<\r\n RowType = any,\r\n RowFnType extends \"OvlEdit\" | \"OvlCopy\" | string | number | symbol = any\r\n> = {\r\n rowKey: string\r\n tableDef: SYSTableDef\r\n tableData: SYSTableData\r\n row: RowType\r\n // set fun makes sure that only existing keys get set and that Transition from \"NotVisible\" to \"Disabled\" is not possible\r\n set: (\r\n fnKey:\r\n | (RowFnType | \"OvlEdit\" | \"OvlCopy\")\r\n | Array,\r\n options: {\r\n visibility?: FormFnCan_Visibility\r\n tooltip?: string\r\n icon?: string\r\n customClass?: string\r\n }\r\n ) => void\r\n _functionsToSet: {}\r\n}\r\nexport type FormFnCan_Visibility = \"Visible\" | \"Disabled\" | \"NotVisible\"\r\n\r\nexport const HookTableRowFnCan = \"HookTableRowFnCan\"\r\n\r\nexport type HookTablePrepareFn_Type = {\r\n type: \"Filter\" | \"Sort\" | \"Column\" | \"Table\"\r\n mode: \"TableTitle\" | \"HeaderMenu\"\r\n values: { [key: string]: { description: string } }\r\n def: SYSTableDef\r\n data: SYSTableData\r\n columnKey: string\r\n}\r\n\r\nexport type HookTablePrepareFn_ReturnTypeEntry = {\r\n res?: TemplateResult | TemplateResult[] | DirectiveResult | string\r\n visibility?: FormFnCan_Visibility\r\n tooltip?: string\r\n icon?: string\r\n}\r\n\r\nexport type HookTablePrepareFn_ReturnType = {\r\n [key: string]: HookTablePrepareFn_ReturnTypeEntry\r\n}\r\n\r\nexport const HookTablePrepareFn = \"HookTablePrepareFn\"\r\n\r\n// custom filter function\r\nexport type HookTableCustomFilter_Type = {\r\n def: SYSTableDef\r\n //lang: string\r\n data: SYSTableData\r\n row: RowType\r\n}\r\nexport type HookTableCustomFilter_ReturnType = boolean\r\nexport const HookTableCustomFilter = \"HookTableCustom_{filterKey}_Filter\"\r\n// custom sort function\r\nexport type HookTableCustomSort_Type = {\r\n def: SYSTableDef\r\n //lang: string\r\n a: string\r\n b: string\r\n data: { [key: string]: RowType }\r\n}\r\nexport type HookTableCustomSort_ReturnType = number\r\nexport const HookTableCustomSort = \"HookTableCustom_{sortKey}_Sort\"\r\n\r\n// defines custom column functions (eg. goto valid values)\r\nexport type HookTableColumnFn_Type = {\r\n columnKey: string\r\n fnKey: string\r\n def: SYSTableDef\r\n data: SYSTableData\r\n innerEvent?: boolean\r\n}\r\nexport const HookTableColumnFn = \"HookTableColumnFn\"\r\n\r\n//Form Field Functions ####################################\r\n// defines the list of ListControl and Option so far\r\n\r\n// sample for generic GetList approach to be done soon\r\n// export type HookGetList_Type = {\r\n// fieldKey: keyof RowType\r\n// formState: SYSFormState\r\n// needsFullList: boolean\r\n// }\r\n// export type HookGetList_ReturnType = ListDefinition\r\n// export const HookGetList = \"HookGetList\"\r\n\r\nexport type HookFieldGetList_Type = {\r\n formState: SYSFormState\r\n needsFullList: boolean\r\n}\r\nexport type HookFieldGetList_ReturnType = ListDefinition\r\n// subFeature x\r\nexport const HookFieldGetList = \"HookField{subFeature}_{fieldKey}_GetList\"\r\n\r\ntype EditorFormSettingsToSetType = {\r\n fieldsToSet: { [key in keyof RowType]: SYSFormField }\r\n groups: EditGroups[]\r\n}\r\n\r\ntype FormSettingsToSetType = {\r\n fieldsToSet: { [key in keyof RowType]: SYSFormField }\r\n formIdToSet: string\r\n}\r\n\r\nexport type HookFormFieldsInit_Type = {\r\n formFieldsToSet: { [key in keyof RowType]: SYSFormField }\r\n /*schema: Schema*/\r\n}\r\n// subFeature x\r\nexport const HookFormFieldsInit = \"HookForm{subFeature}FieldsInit\"\r\n\r\nexport type HookFormAutoInit_Type = {\r\n formType: SYSForm\r\n formId?: any\r\n\r\n toSet: FormSettingsToSetType\r\n}\r\n\r\n// subFeature not necessary\r\nexport const HookFormAutoInit = \"HookFormAutoInit\"\r\n\r\nexport type HookFormEditorInit_Type = {\r\n parentField?: SYSField\r\n toSet: EditorFormSettingsToSetType\r\n formType: string\r\n formId: string\r\n feature: SYSFeature\r\n}\r\n\r\n// subFeature x\r\nexport const HookFormEditorInit = \"HookForm{subFeature}EditorInit\"\r\n\r\nexport type HookFormEditorAction_Type = {\r\n formState: SYSFormState\r\n parentField: SYSField\r\n}\r\n\r\nexport type HookFormEditorActionReturn_Type = {\r\n cancel?: boolean\r\n}\r\n\r\n// subFeature x\r\nexport const HookFormEditorSave = \"HookForm{subFeature}EditorSave\"\r\n\r\n// subFeature x\r\nexport const HookFormEditorDelete = \"HookForm{subFeature}EditorDelete\"\r\n\r\n// subFeature x\r\nexport const HookFormEditorCancel = \"HookForm{subFeature}EditorCancel\"\r\n\r\nexport type HookTableFilterSortSettingsDifferentiator_Type = {\r\n differentiator: string\r\n def: SYSTableDef\r\n}\r\nexport type HookTableFilterSortSettingsDifferentiator_ReturnType = {\r\n differentiator: string\r\n}\r\nexport const HookTableFilterSortSettingsDifferentiator =\r\n \"HookTableFilterSortSettingsDifferentiator\"\r\n\r\n// use RefreshLookups if you have a tbale containing lookups and would like to deliver the tabledata cobtaining the lookup columns\r\n// just make sure to define the lookup (LookupDef: Col1: {type\"\"}...)\r\n// it needs to return the root of the lookup object\r\n// currently the Key of The Lookup needs to be the same like the field name\r\n\r\nexport type HookLookupsRefresh_Type = {\r\n formState: SYSFormState\r\n tableDefId: SYSTableDefIds\r\n}\r\nexport type HookLookupsRefresh_ReturnType = { [Key: string]: ListDefinition }\r\nexport const HookLookupsRefresh = \"HookLookupsRefresh\"\r\n\r\n// use this hook for calculated lookup columns\r\nexport type HookLookupRowRefreshed_Type = {\r\n lookupDefKey: string\r\n lookupDataRow: any\r\n}\r\nexport const HookLookupRowRefreshed = \"HookLookupRowRefreshed\"\r\n\r\ntype RefreshAction = \"Cancel\" | \"ForceRefresh\" | \"Default\"\r\n// lets you modify the post body of the lookup request\r\nexport type HookFieldLookupPostRefresh_Type = {\r\n postToServerData: LookupListPostData\r\n // set it to false to not start a postback to server\r\n cancelRefresh: RefreshAction\r\n //set it to false to not show snack\r\n showSnack: boolean\r\n forceClear: boolean\r\n innerEvent: boolean\r\n info: {\r\n _timeStamp: number\r\n _row: RowType\r\n _lastPostToServerData: string\r\n }\r\n}\r\n\r\n// subFeature x\r\nexport const HookFieldLookupPostRefresh =\r\n \"HookField{subFeature}_{fieldKey}_LookupPostRefresh\"\r\n\r\n// if a field should not be displayed. Make sure to return a FieldVisibilty - Type\r\nexport type HookTableSetColumnVisibility_Type = {\r\n def: SYSTableDef\r\n columnsVisibilityToSet: { [key in keyof RowType]: _ColumnVisibility }\r\n screen: SYSScreen\r\n fromInit: boolean\r\n}\r\nexport const HookTableSetColumnVisibility = \"HookTableSetColumnVisibility\"\r\n\r\n// if you would like to do the rendering of a cell value on your own\r\nexport type HookFieldGetValueRender_Type = {\r\n tableDef: SYSTableDef\r\n rowKey: any\r\n row: RowType\r\n columnKey: string\r\n displayMode: DisplayMode\r\n comp: any\r\n}\r\nexport type HookFieldGetValueRender_ReturnType =\r\n | {\r\n res?: any\r\n valueRaw?: any\r\n }\r\n | undefined\r\n\r\n// subFeature x (2 calls replace with \"\" because there is no subFeature at tableDef Level. Should be fine)\r\nexport const HookFieldGetValueRender =\r\n \"HookField{subFeature}_{fieldKey}_GetValueRender\"\r\n\r\n// if you would like to do the rendering of a cell value on your own\r\nexport type HookFieldGetEditHint_Type = {\r\n row: RowType\r\n field: SYSField\r\n formState: SYSFormState\r\n align: string\r\n displayMode: EditDisplayMode\r\n}\r\n// return undefined for no hintcontrol rendering\r\nexport type HookFieldGetEditHint_ReturnType =\r\n | TemplateResult\r\n | TemplateResult[]\r\n | string\r\n\r\n// subFeature x\r\nexport const HookFieldGetEditHint =\r\n \"HookField{subFeature}_{fieldKey}_GetEditHint\"\r\n\r\n// customizing thGroup headers\r\nexport type HookTHGroupGetLabelRender_Type = {\r\n caption: string\r\n}\r\nexport type HookTHGroupGetLabelRender_ReturnType = {\r\n res: string | TemplateResult\r\n tooltip?: string\r\n cssClass?: string\r\n}\r\nexport const HookTHGroupGetLabelRender = \"HookTHGroup_{fieldKey}_GetLabelRender\"\r\n\r\n// if you would like to do the rendering of a column header resp. field label in edit mode\r\nexport type HookFieldGetLabelRender_Type = {\r\n columnKey: string\r\n caption: string\r\n align: string\r\n formState?: SYSFormState\r\n displayMode: DisplayMode | EditDisplayMode\r\n}\r\nexport type HookFieldGetLabelRender_ReturnType = {\r\n res: TemplateResult | string | DirectiveResult\r\n valueRaw?: string\r\n}\r\n\r\n// subFeature x (1 calls replace with \"\" because there is no subFeature at tableDef Level. Should be fine)\r\nexport const HookFieldGetLabelRender =\r\n \"HookField{subFeature}_{fieldKey}_GetLabelRender\"\r\n\r\n// subFeature x\r\nexport const HookFormGetBodyRender = \"HookForm{subFeature}GetBodyRender\"\r\nexport type HookFormGetBodyRender_Type = {\r\n formState: SYSFormState\r\n tableDef: SYSTableDef\r\n fields: { [key in keyof RowType]: SYSField }\r\n}\r\nexport type HookFormGetBodyRender_ReturnType = {\r\n res: TemplateResult | TemplateResult[]\r\n}\r\n\r\n// custom title on the bigedit forms\r\nexport type HookFormGetCaptionRender_Type = {\r\n rowKey: string\r\n tableDefId: SYSTableDefIds\r\n row: RowType\r\n formState: SYSFormState\r\n mode: EditMode\r\n}\r\nexport type HookFormGetCaptionRender_ReturnType = TemplateResult\r\n// subFeature x\r\nexport const HookFormGetCaptionRender = \"HookForm{subFeature}GetCaptionRender\"\r\n\r\n// custom value on bigedit form. you are also responsible for rendering the label\r\n// check existing controls for stuff todo\r\n// easiest is to copy the existing custom element and change it (eg. textbox.ts)\r\nexport type HookFormCustomControlRender_Type = {\r\n field: SYSField\r\n formState: SYSFormState\r\n //readonly: boolean\r\n}\r\nexport type HookFormCustomControlRender_ReturnType = TemplateResult\r\n\r\n// subFeature x (one call from Tabledef replaced with \"\")\r\nexport const HookFormCustomControlRender =\r\n \"HookForm{subFeature}_{fieldKey}_CustomControlRender\"\r\n\r\n// gets called for displaying ROW hints/status (warning,...)\r\nexport type HookViewRowClass_Type = {\r\n rowKey: string\r\n tableDef: SYSTableDef\r\n tableData: SYSTableData\r\n row: RowType\r\n}\r\nexport type HookViewRowClass_ReturnType = ViewRowClassType\r\nexport const HookViewRowClass = \"HookViewRowClass\"\r\n\r\n// to style the header and row cells in tableview\r\n// this functions must return a object whose key is the fieldKey and the value is the custom classname to set\r\nexport type HookViewRowCellClass_Type = {\r\n columns: { [key: string]: ColumnDisplayDef }\r\n row: RowType\r\n rowKey: string\r\n displayMode: DisplayMode | EditDisplayMode\r\n tableDefId?: SYSTableDefIds\r\n feature?: SYSFeature\r\n def?: SYSTableDef\r\n}\r\nexport type HookViewRowCellClass_ReturnType =\r\n | {\r\n [key in keyof RowType]: CellClass\r\n }\r\n\r\n// subFeature x (one from table replaced with \"\")\r\nexport const HookViewRowCellClass = \"HookViewRowCellClass{subFeature}\"\r\n\r\nexport type HookViewHeaderCellClass_Type = {\r\n columns: { [key in keyof RowType]: ColumnDisplayDef }\r\n\r\n displayMode: DisplayMode | EditDisplayMode\r\n tableDefId?: SYSTableDefIds\r\n feature?: SYSFeature\r\n}\r\nexport type HookViewHeaderCellClass_ReturnType = {\r\n [key in keyof RowType]: CellClass\r\n}\r\n// subFeature x (one from table replaced with \"\")\r\nexport const HookViewHeaderCellClass = \"HookViewHeaderCellClass{subFeature}\"\r\n\r\nexport type HookTableServerBeforeMergeRow_Type = {\r\n defId: SYSTableDefIds\r\n rowKey: string\r\n tableData: SYSTableData\r\n serverRow: { [key in keyof RowType]: any }\r\n localRowJustForChecking: { [key in keyof RowType]: any }\r\n}\r\n// return true for handled = canceling further logic\r\nexport type HookTableServerBeforeMergeRow_ReturnType = boolean\r\nexport const HookTableServerBeforeMergeRow = \"HookTableServerBeforeMergeRow\"\r\n\r\nexport type ServerData_ChangedType = {\r\n isAdd: boolean\r\n columns: { [key: string]: boolean }\r\n}\r\n\r\nexport type HookTableServerData_Type = {\r\n tableDefId: SYSTableDefIds\r\n type: \"RefreshData\" | \"RefreshRow\"\r\n //contains all the returned keys. check for changed by columns.size>0\r\n returnedKeys: Map\r\n more: boolean\r\n ext: any\r\n tableData: SYSTableData\r\n}\r\nexport const HookTableServerData = \"HookTableServerData\"\r\n\r\nexport type HookTableCustomTitle_ReturnType =\r\n | string\r\n | TemplateResult\r\n | DirectiveResult\r\nexport type HookTableCustomTitle_Type = {\r\n title: any\r\n titleAsTemplate: string\r\n titleText: string\r\n titleTemplate: string\r\n setText: string\r\n setTemplate: string\r\n sortText: string\r\n sortTemplate: string\r\n filterText: string\r\n filterTemplate: string\r\n filterTextArray: string[]\r\n filterAttributeText: string\r\n filterAttributeTemplate: string\r\n filterAttributeArray: string[]\r\n staticFilter: { [key: string]: any }\r\n forcedFilterKeys: string[]\r\n forcedFilterContextTitle: string\r\n defId: SYSTableDefIds\r\n}\r\nexport const HookTableCustomTitle = \"HookTableCustomTitle\"\r\n\r\nexport type HookEditCustomTabRender_Type = {\r\n row: { [key: string]: {} }\r\n formState: SYSFormState\r\n displayMode: EditDisplayMode\r\n comp: any\r\n}\r\n\r\n// gets all the attributes per row\r\nexport type HookTableRowAttributesGetAttributes_Type = {\r\n defId: SYSTableDefIds\r\n row: { [key in keyof RowType]: {} }\r\n rowAttributeDefKey: string\r\n}\r\nexport type HookTableRowAttributesGetAttributes_ReturnType = [] | {}\r\nexport const HookTableRowAttributesGetAttributes =\r\n \"HookTableRowAttributesGetAttributes\"\r\n\r\n// gets all the possible attributes to select from\r\nexport type HookTableRowAttributesGetAllAttributes_Type = {\r\n defId: SYSTableDefIds\r\n rowAttributeDefKey: string\r\n}\r\nexport type HookTableRowAttributesGetAllAttributes_ReturnType = {\r\n allAttributes: [] | {}\r\n //titleTranslationKey?: string\r\n}\r\nexport const HookTableRowAttributesGetAllAttributes =\r\n \"HookTableRowAttributesGetAllAttributes\"\r\n\r\n// use this hook to get a nice description which will be displayed\r\nexport type HookTableRowAttributeGetProperties_ReturnType =\r\n HookTablePrepareFn_ReturnTypeEntry\r\nexport type HookTableRowAttributeGetProperties_Type = {\r\n rowAttributeDefKey: string\r\n defId: SYSTableDefIds\r\n rowAttributeKey: any\r\n //count will be the precalculated count if defined so in tableDef\r\n // so we can display AttributeX(111)\r\n count?: number\r\n mode: \"TableTitle\" | \"HeaderMenu\"\r\n}\r\nexport const HookTableRowAttributeGetProperties =\r\n \"HookTableRowAttributeGetProperties\"\r\n\r\nexport type _HookTableClickedExecutionToSetType = {\r\n selectionLogic?: SelectRowDefMode | \"Ignore\"\r\n expandTextLogic?: \"Ignore\" | \"Default\" | \"NotDebounced\"\r\n}\r\nexport type HookTableClicked_Type = {\r\n e: Event\r\n defId: SYSTableDefIds\r\n // rowKey will be set if inside row is clicked\r\n // if empty its an indication that we are on the header\r\n rowKey: string\r\n row: { [key in keyof RowType]: any }\r\n columnKey: string\r\n modifiers: TableClickModifiersType\r\n expandClicked?: boolean\r\n linkType?: \"OvlHook\" | \"System\" | \"None\"\r\n executionToSet: _HookTableClickedExecutionToSetType\r\n}\r\n\r\nexport const HookTableClicked = \"HookTableClicked\"\r\n\r\n// // the eventhandler if the user selected/clicked the cell\r\n// export type HookFieldRowCellSelectedHandler_Type = {\r\n// e: Event\r\n// def: SYSTableDef\r\n// data: SYSTableData\r\n// rowKey: string\r\n// columnKey: string\r\n// row: RowType\r\n// displayMode: DisplayMode | EditDisplayMode\r\n// modifiers: TableClickModifiersType\r\n// expandClicked?: boolean\r\n// formState?: SYSFormState\r\n// }\r\n// export type HookFieldRowCellSelectedHandler_ReturnType = boolean\r\n// // subFeature x (one call from table replaced with \"\")\r\n// export const HookFieldRowCellSelectedHandler =\r\n// \"HookField{subFeature}_{fieldKey}_RowCellSelectedHandler\"\r\n\r\n// export type HookTableRowSelectedEventControlHandler_Type =\r\n// HookFieldRowCellSelectedHandler_Type\r\n// export type HookTableRowSelectedEventControlHandler_ReturnType =\r\n// HookFieldRowCellSelectedHandler_ReturnType\r\n\r\n// // subFeature no uses with forms found\r\n// export const HookTableRowSelectedEventControlHandler =\r\n// \"HookTableRowSelectedEventControlHandler\"\r\n\r\n// export const HookTableRowSelectedHandler = \"HookTableRowSelectedHandler\"\r\n// export type HookTableRowSelectedHandler_Type = {\r\n// e?: Event\r\n// def: SYSTableDef\r\n// data: SYSTableData\r\n// rowKey: string\r\n// row: RowType\r\n// modifiers?: TableClickModifiersType\r\n\r\n// customData?: any\r\n// innerEvent?: boolean\r\n// }\r\n// export type HookTableRowSelectedHandler_ReturnType = boolean\r\n\r\n// export type HookFieldHeaderCellSelectedHandler_Type = {\r\n// e: Event\r\n// def: SYSTableDef\r\n// displayMode: DisplayMode | EditDisplayMode\r\n// }\r\n// export type HookFieldHeaderCellSelectedHandler_ReturnType = boolean\r\n\r\n// // subFeature no uses with forms found\r\n// export const HookFieldHeaderCellSelectedHandler =\r\n// \"HookField_{fieldKey}_HeaderCellSelectedHandler\"\r\n\r\n// export type HookFieldHeaderCellSelectedEventControlHandler_Type =\r\n// HookFieldHeaderCellSelectedHandler_Type\r\n// export type HookFieldHeaderCellSelectedEventControlHandler_ReturnType =\r\n// HookFieldHeaderCellSelectedHandler_ReturnType\r\n\r\n// // subFeature no uses with forms found\r\n// export const HookFieldHeaderCellSelectedEventControlHandler =\r\n// \"HookField_{fieldKey}_HeaderCellSelectedEventControlHandler\"\r\n\r\n//Form Save/Delete/Postback Functions ####################################\r\n// provide your complete form postback to server logic here if you don't wanna use the default\r\n\r\n// export type HookTableCustomSave_Type = {\r\n// key: string\r\n// tableDef: SYSTableDef\r\n// mode: SaveMode\r\n// newData: { [key in keyof RowType]: {} }\r\n// isOfflineRetry: boolean\r\n// formState: SYSFormState\r\n// resFiles: FileUploadContainer[]\r\n// }\r\n\r\n// //it should return a newId\r\n// export type HookTableCustomSave_ReturnType = string\r\n// export const HookTableCustomSave = \"HookTableCustomSave\"\r\n\r\n// gets called before the form gets saved/posted back to the server\r\nexport type HookTableBeforeDelete_Type = {\r\n key: string\r\n idValue: any\r\n tableDefId: string\r\n row: RowType\r\n isOfflineRetry: boolean\r\n multi?: { isFirst: boolean; isLast: boolean }\r\n}\r\n\r\n// use it to an additional validation before save\r\n// or to do a custom save\r\n// continue will just save the result as well (be it only locally if no endpoint or as well on the table endpoint)\r\n// handled will mark the form as undirty and exit (no saving of the table)\r\nexport type HookTableBeforeDelete_ReturnType = {\r\n resolve?: \"Cancel\" | \"Continue\" | \"DeleteLocally\"\r\n customPostData?: any\r\n rowFnResult?: TableRowFnProcessRawFeedback_Type\r\n}\r\n\r\nexport const HookTableBeforeDelete = \"HookTableBeforeDelete\"\r\n\r\n// gets called before the form gets saved/posted back to the server\r\nexport type HookTableBeforeSave_Type = {\r\n key: string\r\n\r\n mode: SaveMode\r\n tableDef: TableDataAndDef\r\n changedFields: { [key in keyof RowType]: {} }\r\n originalRow: RowType\r\n changedRow: RowType\r\n filter: {}\r\n isOfflineRetry: boolean\r\n formState: SYSFormState\r\n resFiles: FileUploadContainer[]\r\n hasChanges: boolean\r\n multi?: { isFirst: boolean; isLast: boolean }\r\n batch?: { isFirst: boolean; isLast: boolean }\r\n}\r\n\r\n// use it to an additional validation before save\r\n// or to do a custom save\r\n// continue will just save the result as well (be it only locally if no endpoint or as well on the table endpoint)\r\n// handled will mark the form as undirty and exit (no saving of the table)\r\nexport type HookTableBeforeSave_ReturnType = {\r\n resolve?:\r\n | \"Cancel\"\r\n | \"Handled\"\r\n | \"Error\"\r\n | \"Continue\"\r\n | \"SaveLocally\"\r\n | \"ForceSaveAndContinue\"\r\n\r\n customPostData?: any\r\n rowFnResult?: TableRowFnProcessRawFeedback_Type\r\n}\r\n\r\nexport type HookFormBeforeCancel_ReturnType = {\r\n resolve: \"Cancel\" | \"Continue\"\r\n}\r\nexport type HookFormBeforeCancel_Type = { formState: SYSFormState }\r\nexport const HookFormBeforeCancel = \"HookFormBeforeCancel\"\r\n\r\nexport type HookFormAfterCancel_Type = { formState: SYSFormState }\r\nexport const HookFormAfterCancel = \"HookFormAfterCancel\"\r\n\r\nexport const HookTableBeforeSave = \"HookTableBeforeSave\"\r\n\r\n// // if you would like to process save errors yourself\r\n// export type HookTableSaveError_ReturnType = {\r\n// resolve: \"ValidationError\" | \"Continue\"\r\n// }\r\n\r\nexport type HookTableSaveError_Type = {\r\n rowFnResult: TableRowFnProcessRawFeedback_Type\r\n originatingBatchKey: string\r\n currentKey: string\r\n def: SYSTableDef\r\n data: SYSTableData\r\n formState: SYSFormState\r\n mode: SaveMode\r\n isOfflineRetry: boolean\r\n resFiles: FileUploadContainer[]\r\n}\r\nexport const HookTableSaveError = \"HookTableSaveError\"\r\n\r\n// gets called after save\r\n// use it to refresh other data as well (eg. translations use case)\r\nexport type HookTableAfterSave_Type = {\r\n rowFnResult: TableRowFnProcessRawFeedback_Type\r\n key: string\r\n def: SYSTableDef\r\n data: SYSTableData\r\n mode: SaveMode\r\n res: { data: RowType[]; ext: any }\r\n isOfflineRetry: boolean\r\n formState: SYSFormState\r\n //contains all the returned keys. check for changed by columns.size>0\r\n returnedKeys: Map\r\n resFiles: FileUploadContainer[]\r\n multi?: { isFirst: boolean; isLast: boolean }\r\n}\r\n\r\nexport const HookTableAfterSave = \"HookTableAfterSave\"\r\n\r\n// if you would like to process delete offline mode yourself\r\nexport type HookTableDeleteOffline_Type = {\r\n key: string\r\n tableDef: SYSTableDef\r\n res: SYSTableData\r\n isOfflineRetry: boolean\r\n}\r\n// export type HookTableDeleteOffline_ReturnType = HookTableSaveError_ReturnType\r\nexport const HookTableDeleteOffline = \"HookTableDeleteOffline\"\r\n\r\n// if you would like to process delete errors yourself\r\nexport type HookTableDeleteError_Type = {\r\n rowFnResult: TableRowFnProcessRawFeedback_Type\r\n key: string\r\n tableDef: SYSTableDef\r\n res: any\r\n}\r\n\r\nexport const HookTableDeleteError = \"HookTableDeleteError\"\r\n\r\nexport type HookTableRowsAfterRebuild_Type = {\r\n def: SYSTableDef\r\n rows: { [key: string]: RowType }\r\n rowKeys: string[]\r\n}\r\nexport const HookTableRowsAfterRebuild = \"HookTableRowsAfterRebuild\"\r\n\r\n// if you would like to do smth after delete\r\nexport type HookTableAfterDelete_Type = {\r\n key: string\r\n def: SYSTableDef\r\n data: SYSTableData\r\n res: any\r\n deletedRow: RowType\r\n isOfflineRetry: boolean\r\n multi?: { isFirst: boolean; isLast: boolean }\r\n}\r\nexport const HookTableAfterDelete = \"HookTableAfterDelete\"\r\n\r\nexport type HookTableGroupValue_Type = {\r\n def: SYSTableDef\r\n data: SYSTableData\r\n row: RowType\r\n}\r\nexport type HookTableGroupValue_ReturnType = string\r\nexport const HookTableGroupValue = \"HookTableGroup_{groupKey}_Value\"\r\n\r\nexport type HookTableGroupCalcValue_ReturnType = string | number\r\nexport type HookTableGroupCalcValue_Type = {\r\n def: SYSTableDef\r\n data: SYSTableData\r\n row: RowType\r\n}\r\n\r\nexport type HookTableGroupSortValue_Type = HookTableGroupValue_Type\r\nexport type HookTableGroupSortValue_ReturnType = any\r\nexport const HookTableGroupSortValue = \"HookTableGroupSort_{groupKey}_Value\"\r\n\r\nexport const HookTableGroupCalcValue = \"HookTableGroup_{aggregateKey}_CalcValue\"\r\n\r\nexport type _GroupHeaderFooterColumnType = {\r\n value: any\r\n cssClass?: string\r\n colSpan?: number\r\n}\r\n\r\nexport type _TableGroupColumnsToSetType = {\r\n [key in keyof RowType]: _GroupHeaderFooterColumnType\r\n}\r\n// export type GroupHeaderFooterResultToSetType = {\r\n// // groups contains the groups covered by this headr/footer\r\n// // (remember can be more than 1 header/footer for condensed header/footer s)\r\n// // and we need to know the groups covered for at least setting a nice css class\r\n// cssClassToSet: string\r\n// _type: GroupHeaderFooterBreaksValueType\r\n// valuesToSet:\r\n// | _TableGroupColumnsToSetType\r\n// | _GroupHeaderFooterColumnType\r\n// | TemplateResult\r\n// }\r\n\r\nexport type HookTableGroupHeadersFooters_Type = {\r\n def: SYSTableDef\r\n data: SYSTableData\r\n grouping: {\r\n groups: { [key: string]: GroupBreakType }\r\n fullGroupAccessStrings: string[]\r\n visibleColumns: string[]\r\n }\r\n allGrouping: {\r\n [key: string]: {\r\n isBreak?: boolean\r\n isFirstRow?: boolean\r\n isLastRow?: boolean\r\n groups?: { [key: string]: GroupBreakType }\r\n groupAccessStrings?: string[]\r\n }\r\n }\r\n row: RowType\r\n previousRowKey: string\r\n nextRowKey: string\r\n rowKey: string\r\n isFirstRow: boolean\r\n isLastRow: boolean\r\n results: any[]\r\n getTemplate(\r\n type: \"columns\",\r\n columnsToSet?: _TableGroupColumnsToSetType\r\n ): {\r\n cssClassToSet: string\r\n _type: GroupHeaderFooterBreaksValueType\r\n valueToSet: _TableGroupColumnsToSetType\r\n }\r\n getTemplate(\r\n type: \"custom\",\r\n columnsToSet?: _TableGroupColumnsToSetType\r\n ): {\r\n cssClassToSet: string\r\n _type: GroupHeaderFooterBreaksValueType\r\n valueToSet: TemplateResult\r\n }\r\n getTemplate(\r\n type: GroupHeaderFooterBreaksValueType,\r\n columnsToSet?: _TableGroupColumnsToSetType\r\n ):\r\n | {\r\n cssClassToSet: string\r\n _type: GroupHeaderFooterBreaksValueType\r\n valueToSet: _TableGroupColumnsToSetType\r\n }\r\n | {\r\n cssClassToSet: string\r\n _type: GroupHeaderFooterBreaksValueType\r\n valueToSet: TemplateResult\r\n }\r\n}\r\n\r\nexport const HookTableGroupHeaders = \"HookTableGroupHeaders\"\r\nexport const HookTableGroupFooters = \"HookTableGroupFooters\"\r\n\r\nexport const HookTableFormDataLoaded = \"HookTableFormDataLoaded\"\r\nexport type HookTableFormDataLoaded_Type = {\r\n mode: \"Add\" | \"Update\"\r\n tableDef: _TableGetReturnType\r\n fresh: boolean\r\n formState: SYSFormState\r\n}\r\n","import { ovl, SYSScreen } from \"../..\"\r\nimport type { SYSLongRunningProcess, SYSDialog, SYSTableDefIds } from \"../..\"\r\nimport { T } from \"../../textapi\"\r\nimport { SnackAdd, SnackTrackedAdd, SnackTrackedRemove } from \"../snackapi\"\r\nimport type { SYSFormState } from \"../forms/actions\"\r\nimport type {\r\n LongRunningProcessState,\r\n _ProcessReturnType,\r\n ProcessSnackType,\r\n} from \"./longrunningprocesstracker\"\r\nimport { TableRowFnProcessFeedback_Type } from \"../../global/hooks\"\r\nimport { RowControlAction, SYSTableData, SYSTableDef } from \"../table/table\"\r\nimport { TableGet, _TableGetReturnType } from \"../table/tableapi\"\r\n\r\nexport const ProcessRunningChangeSnack = (\r\n processType: SYSLongRunningProcess,\r\n snack: ProcessSnackType,\r\n instance?: string\r\n) => {\r\n if (!instance) {\r\n instance = processType\r\n }\r\n let processState = ovl.getState().ovl.longRunningProcessTracker[processType]\r\n let processInstanceState = processState.instance[instance]\r\n if (snack.type !== \"none\") {\r\n processState.snack = snack\r\n let hasTrackedSnack = snack.fireAndForgetSnackDuration === undefined\r\n let id = `${processType}_${instance}`\r\n\r\n let text = snack.text\r\n if (!text) {\r\n text = T(processType, [instance])\r\n }\r\n if (hasTrackedSnack) {\r\n let snackId = SnackTrackedAdd(text, snack.type, id)\r\n processInstanceState.id = snackId\r\n processInstanceState.hasTrackedSnack = hasTrackedSnack\r\n } else {\r\n SnackAdd(text, snack.type, snack.fireAndForgetSnackDuration)\r\n }\r\n } else {\r\n SnackTrackedRemove(processInstanceState.id)\r\n }\r\n}\r\n\r\nexport const ProcessStart = (\r\n processType: SYSLongRunningProcess,\r\n options?: {\r\n snack?: ProcessSnackType\r\n lock?: {\r\n formState?: SYSFormState[] | SYSFormState\r\n dialog?: SYSDialog\r\n dialogInstance?: any\r\n screen?: SYSScreen\r\n }\r\n instance?: string\r\n isRefresh?: boolean\r\n // provide the locked tableKeys as Object wo we can quickly can check the keys\r\n tableFn?: {\r\n lockedTableKeys?: {}\r\n selectedKeys?: {}\r\n fnName?: string\r\n fnId: string\r\n tableDefId: SYSTableDefIds\r\n rowKey: string\r\n }\r\n }\r\n): _ProcessReturnType => {\r\n let instance\r\n let snack\r\n let lock\r\n if (options) {\r\n snack = options.snack\r\n instance = options.instance\r\n lock = options.lock\r\n if (lock && !lock.dialogInstance) {\r\n lock.dialogInstance = lock.dialog\r\n }\r\n }\r\n return ovl.getActions().ovl.internal._LongRunningProcessStart({\r\n processType,\r\n instance,\r\n snack,\r\n lock,\r\n tableFn: options?.tableFn,\r\n })\r\n}\r\n\r\nexport type _ProcessGetRowFnsFeedbackOptionsType = {\r\n rowFnIds?: string[]\r\n customRowActions?: RowControlAction[]\r\n rowKeys?: string[]\r\n}\r\n\r\nexport type _ProcessGetRowFnsFeedbackReturnType = {\r\n involvedProcessInstances: LongRunningProcessState[]\r\n}\r\n\r\n// export const ProcessGetRowFnsFeedback = (\r\n// tableDefId: SYSTableDefIds,\r\n// options?: _ProcessGetRowFnsFeedbackOptionsType\r\n// ): _ProcessGetRowFnsFeedbackReturnType => {\r\n// let result: _ProcessGetRowFnsFeedbackReturnType = {\r\n// involvedProcessInstances: [],\r\n// }\r\n// let customRowActions = options?.customRowActions\r\n// let processesState = ovl.getState().ovl.longRunningProcessTracker\r\n// if (!customRowActions) {\r\n// let def = TableGet(tableDefId).def\r\n// if (options?.rowFnIds) {\r\n// customRowActions = options.rowFnIds\r\n// .filter((k) => def.options.customRowActions[k].process !== \"None\")\r\n// .map((k) => def.options.customRowActions[k])\r\n// } else {\r\n// customRowActions = Object.keys(def.options.customRowActions)\r\n// .filter((k) => def.options.customRowActions[k].process !== \"None\")\r\n// .map((k) => def.options.customRowActions[k])\r\n// }\r\n// }\r\n// customRowActions = customRowActions.filter((f) => f.process !== \"None\")\r\n// // now if we have rowKeys in options we can use those to retrieve the key instance of the process\r\n// // (thats faster than looping through instances and used eg. from row component)\r\n// if (options?.rowKeys) {\r\n// // options.rowKeys.forEach((rowKey) => {\r\n// // customRowActions.forEach((customRowAction) => {\r\n// // let processInstance =\r\n// // processesState[customRowAction.process].instance?.[\r\n// // `${tableDefId}_OvlSep_${customRowAction.fnKey}_OvlSep_${rowKey}`\r\n// // ]\r\n// // // let feedback = processInstance?.feedback?.[rowKey]\r\n// // // if (feedback) {\r\n// // // if (!result.rowKeyRowFnsFeedback[rowKey]) {\r\n// // // result.rowKeyRowFnsFeedback[rowKey] = {}\r\n// // // }\r\n// // // result.involvedProcessInstances.push(processInstance)\r\n// // // result.rowKeyRowFnsFeedback[rowKey][customRowAction.fnKey] = feedback\r\n// // // }\r\n// // })\r\n// // })\r\n// // add the ones from multi process\r\n// customRowActions.forEach((customRowAction) => {\r\n// let processInstance =\r\n// processesState[customRowAction.process].instance?.[\r\n// `${tableDefId}_OvlSep_${customRowAction.fnKey}_OvlSep_Multi`\r\n// ]\r\n// // let multiFeedback = processInstance?.feedback\r\n// // if (multiFeedback) {\r\n// // let keys\r\n// // if (options?.rowKeys) {\r\n// // keys = options.rowKeys\r\n// // } else {\r\n// // keys = Object.keys(multiFeedback)\r\n// // }\r\n// // keys.forEach((k) => {\r\n// // if (multiFeedback[k]) {\r\n// // if (!result.rowKeyRowFnsFeedback[k]) {\r\n// // result.rowKeyRowFnsFeedback[k] = {}\r\n// // }\r\n// // result.rowKeyRowFnsFeedback[k][customRowAction.fnKey] =\r\n// // multiFeedback[k]\r\n// // }\r\n// // })\r\n// result.involvedProcessInstances.push(processInstance)\r\n// // }\r\n// })\r\n// } else {\r\n// // loop all relevant\r\n// customRowActions.forEach((customRowAction) => {\r\n// let processInstance: { [key: string]: LongRunningProcessState } =\r\n// processesState[customRowAction.process].instance\r\n// Object.keys(processInstance)\r\n// .filter(\r\n// (k) =>\r\n// processInstance[k].tableFn?.tableDefId === tableDefId &&\r\n// //processInstance[k].feedback &&\r\n// processInstance[k].tableFn?.fnId === customRowAction.fnKey\r\n// )\r\n// .forEach((instanceKey) => {\r\n// result.involvedProcessInstances.push(processInstance[instanceKey])\r\n// // Object.keys(processInstance[instanceKey].feedback).forEach((k) => {\r\n// // let feedback = processInstance[instanceKey].feedback[k]\r\n// // if (!result.rowKeyRowFnsFeedback[k]) {\r\n// // result.rowKeyRowFnsFeedback[k] = {}\r\n// // }\r\n// // result.rowKeyRowFnsFeedback[k][customRowAction.fnKey] = feedback\r\n// // })\r\n// })\r\n// })\r\n// }\r\n// return result\r\n// }\r\n\r\nexport const ProcessEnd = (\r\n processType: SYSLongRunningProcess,\r\n instance?: string\r\n) => {\r\n ovl.getActions().ovl.internal._LongRunningProcessEnd({\r\n processType,\r\n instance,\r\n })\r\n}\r\n\r\nexport const ProcessIsServerAccessRunning = (): boolean => {\r\n let procState = ovl.getState().ovl.longRunningProcessTracker\r\n return Object.keys(procState)\r\n .filter((f) => procState[f].isRefresh)\r\n .some((s) => ProcessIsRunning(s))\r\n}\r\n\r\nexport const ProcessIsRunning = (\r\n processType: SYSLongRunningProcess,\r\n instance?: string\r\n): boolean => {\r\n let procState = ovl.getState().ovl.longRunningProcessTracker[processType]\r\n if (procState) {\r\n if (!instance) {\r\n // if there is no isntance just check if any is running\r\n let procState = ovl.getState().ovl.longRunningProcessTracker[processType]\r\n if (procState?.instance) {\r\n return Object.keys(procState.instance).some(\r\n (s) => procState.instance[s].isRunning\r\n )\r\n }\r\n return false\r\n }\r\n if (!procState[\"instance\"][instance]) {\r\n // its important to init here because tracking wont work elsewise\r\n procState[\"instance\"][instance] = {\r\n hasTrackedSnack: false,\r\n id: \"\",\r\n isRunning: false,\r\n refCounter: 0,\r\n\r\n currentFeedback: {},\r\n tableFn: {},\r\n processType,\r\n instanceId: instance,\r\n }\r\n procState[\"instance\"][instance][\"tableFn\"].lockedTableKeys = {}\r\n }\r\n let instanceState = procState[\"instance\"][instance]\r\n let isRunning = !!instanceState.isRunning\r\n\r\n // leave it for the tracking\r\n !!instanceState?.tableFn?.lockedTableKeys\r\n\r\n return isRunning\r\n }\r\n return false\r\n}\r\n\r\n// not needed... just call ProcessIsRunning without providing an instance\r\n// export const ProcessIsAnyInstanceRunning = (\r\n// processType: SYSLongRunningProcess\r\n// ): boolean => {\r\n// let procState = ovl.getState().ovl.longRunningProcessTracker[processType]\r\n// if (procState?.instance) {\r\n// return Object.keys(procState.instance).some(\r\n// (s) => procState.instance[s].isRunning\r\n// )\r\n// }\r\n// return false\r\n// }\r\n","import { SYSScreen, ovl } from \"../\"\r\nimport type { _ScreenState } from \"./sysbaseelement\"\r\nexport type HookScreenRefresh_Type = {\r\n ignoreSnack?: boolean\r\n instance?: string\r\n triggeredFromRefreshMenu?: boolean\r\n}\r\nexport const ScreenRefresh = async (\r\n screen?: SYSScreen,\r\n\r\n options?: HookScreenRefresh_Type\r\n) => {\r\n let screensFunctions = ovl.getActions().app.screens\r\n let screenCurrentState = ScreenCurrentState()\r\n if (!screen) {\r\n screen = screenCurrentState.screen\r\n }\r\n let instance = options?.instance\r\n if (instance === undefined) {\r\n instance = screenCurrentState.instance\r\n }\r\n if (screensFunctions[screen].hooks[\"HookScreenRefresh\"]) {\r\n let context = instance\r\n await screensFunctions[screen].hooks[\"HookScreenRefresh\"](<\r\n HookScreenRefresh_Type\r\n >{\r\n instance: context,\r\n ignoreSnack: options?.ignoreSnack,\r\n triggeredFromRefreshMenu: options?.triggeredFromRefreshMenu,\r\n })\r\n }\r\n}\r\n\r\nexport type NavigateToScreenOptionsType = {\r\n instance: any\r\n}\r\n\r\nexport const ScreenCurrent = (): SYSScreen => {\r\n return ovl.getState().ovl.screens.nav.nextScreen\r\n}\r\n\r\nexport const ScreenCurrentState = (): _ScreenState => {\r\n let nav = ovl.getState().ovl.screens.nav\r\n let screen = nav.nextScreen\r\n let instance = nav.nextScreenInstance\r\n return ScreenState(screen, instance)\r\n}\r\n\r\nexport const ScreenState = (screen: SYSScreen, instance?: string) => {\r\n if (!instance) {\r\n instance = screen\r\n }\r\n return ovl.getState().ovl.screens.screens[screen]?.instance?.[instance]\r\n}\r\n\r\nexport const ScreenNavigateTo = async (\r\n screen: SYSScreen,\r\n options?: NavigateToScreenOptionsType\r\n) => {\r\n await ovl.getActions().ovl.navigation._Navigate({\r\n screen,\r\n navigateBack: false,\r\n options,\r\n })\r\n}\r\nexport const ScreenNavigateBack = async () => {\r\n let state = ovl.getState()\r\n if (state.ovl.screens.nav.screensHistory.length > 1) {\r\n let nextScreen =\r\n state.ovl.screens.nav.screensHistory[\r\n state.ovl.screens.nav.screensHistory.length - 2\r\n ]\r\n await ovl.getActions().ovl.navigation._Navigate({\r\n screen: nextScreen.screen,\r\n navigateBack: true,\r\n options: { instance: nextScreen.instance },\r\n })\r\n }\r\n}\r\n\r\nexport const ScreenIsNavigating = () => {\r\n return ovl.getState().ovl.screens.nav.isNavigating\r\n}\r\n\r\nexport const ScreenLock = (\r\n screen: SYSScreen,\r\n lock: boolean,\r\n instance = undefined\r\n) => {\r\n ovl.getActions().ovl.screen._ScreenSetLock({\r\n screen,\r\n locked: lock,\r\n instance,\r\n })\r\n}\r\n","import type { SYSFormValidationValidators } from \"../..\"\r\nimport { ovl } from \"../..\"\r\nimport { T } from \"../../textapi\"\r\nimport type { SYSField, SYSFormState } from \"./actions\"\r\n\r\nimport type {\r\n OptionsValidateResultError,\r\n ValidateResultError,\r\n ValidationResetContext,\r\n ValidatorOptions,\r\n} from \"./validators\"\r\n\r\nimport { _callValidator, _enrichValidation, _addValidation } from \"./validators\"\r\n\r\nexport const ValidationSummaryHandle = (\r\n valid: boolean,\r\n formState: SYSFormState,\r\n translationKey: string,\r\n translationReps?: any[],\r\n tab?: number\r\n) => {\r\n if (!valid) {\r\n ValidationSummaryAdd(formState, translationKey, translationReps, tab)\r\n } else {\r\n ValidationSummaryRemove(formState, translationKey, tab)\r\n }\r\n}\r\n\r\nexport const ValidationSummaryAdd = (\r\n formState: SYSFormState,\r\n translationKey: string,\r\n translationReps?: any[],\r\n tab?: number\r\n) => {\r\n if (tab === undefined) {\r\n tab = 0\r\n }\r\n let summaryErrors = formState.validationResult[tab].summaryErrors\r\n summaryErrors[translationKey] = {\r\n translationKey,\r\n translationReps,\r\n }\r\n}\r\n\r\nexport const ValidationSummaryRemove = (\r\n formState: SYSFormState,\r\n translationKey: string,\r\n tab?: number\r\n) => {\r\n if (tab === undefined) {\r\n tab = 0\r\n }\r\n let summaryErrors = formState.validationResult[tab].summaryErrors\r\n delete summaryErrors[translationKey]\r\n}\r\n\r\nexport type AddValidationTypeOptions = {\r\n validation?: OptionsValidateResultError\r\n setFocus?: boolean\r\n}\r\n\r\n// multi purpose ValidationAdd\r\nexport const ValidationsAdd = (\r\n fields: SYSField | SYSField[],\r\n translationKey: string,\r\n resetContext: ValidationResetContext,\r\n options?: AddValidationTypeOptions\r\n) => {\r\n if (fields === undefined) {\r\n return\r\n }\r\n if (!Array.isArray(fields)) {\r\n fields = [fields]\r\n }\r\n let formState = ovl.getState().ovl.forms[fields[0].formType][fields[0].formId]\r\n let validation = _enrichValidation(\r\n formState,\r\n options?.validation,\r\n translationKey,\r\n resetContext\r\n )\r\n _addValidation(fields, validation, options?.setFocus)\r\n}\r\n\r\nexport const ValidatorAdd = (\r\n field: SYSField,\r\n validator: SYSFormValidationValidators,\r\n resetContext: ValidationResetContext,\r\n options?: ValidatorOptions\r\n): boolean => {\r\n if (!options) {\r\n options = { val: undefined }\r\n }\r\n let validation = options?.validation\r\n let formState = ovl.getState().ovl.forms[field.formType][field.formId]\r\n validation = _enrichValidation(\r\n formState,\r\n validation,\r\n `SYSValidator${validator}`,\r\n resetContext\r\n )\r\n options.validation = validation\r\n let res = _callValidator(validator, field, options)\r\n let fields = [field]\r\n if (res) {\r\n _addValidation(fields, validation, options.setFocus)\r\n }\r\n return !res\r\n}\r\n\r\nexport const ValidationGetTranslation = (\r\n formState: SYSFormState,\r\n translationKey: string,\r\n translationReps: any[],\r\n involvedFieldKeys: string[]\r\n) => {\r\n if (involvedFieldKeys && involvedFieldKeys.length > 1) {\r\n let allFieldKeys = involvedFieldKeys\r\n .map((m) => formState.fields[m].ui.labelCaption)\r\n .join(\",\")\r\n let allPlaceholders = [allFieldKeys].concat(translationReps.toSpliced(0, 1))\r\n let tres = T(`${translationKey}Multi`, allPlaceholders, \"Empty\")\r\n if (tres) {\r\n return tres\r\n }\r\n }\r\n return T(translationKey, translationReps)\r\n}\r\n\r\nexport const ValidatorCheck = (\r\n field: SYSField,\r\n validator: SYSFormValidationValidators,\r\n val?: any\r\n): boolean => {\r\n let options: ValidatorOptions = { val, validation: { translationReps: [] } }\r\n return _callValidator(validator, field, options)\r\n}\r\n","import type { SYSFormValidationValidators } from \"../..\"\r\nimport { ovl } from \"../..\"\r\n\r\nimport {\r\n HookFormDirtyChanged,\r\n HookFormValidatorsCustom,\r\n HookFormValidatorsCustom_Type,\r\n} from \"../../global/hooks\"\r\n\r\nimport { FieldSetFocus, SYSField, SYSFields, SYSFormState } from \"./fieldapi\"\r\nimport { validatorsFunctions } from \"./helper\"\r\nimport { ValidationsAdd } from \"./validatorsapi\"\r\n\r\nexport type ValidationSummaryGroup = \"Field\" | \"ValidationKey\"\r\n\r\nexport type ValidationContextType = {\r\n mode: \"System\" | \"Validate\" | \"ValueChanged\"\r\n}\r\n\r\nexport type ValidationResetContext = \"System\" | \"Validate\" | \"ValueChanged\"\r\n\r\nexport type OptionsValidate = {\r\n displayType?: FormValidationDisplayType\r\n summaryGroup?: ValidationSummaryGroup\r\n summaryDisplayType?: FormValidationSummaryDisplayType\r\n}\r\n\r\nexport type OptionsValidateResultError = OptionsValidate & {\r\n translationReps?: any[]\r\n}\r\n\r\nexport type FieldValidationResult = {\r\n System: ValidateResultError[]\r\n ValueChanged: ValidateResultError[]\r\n Validate: ValidateResultError[]\r\n}\r\n\r\nexport type ValidateResultError = {\r\n translationKey?: string\r\n translationReps?: any[]\r\n displayType?: FormValidationDisplayType\r\n resetContext?: ValidationResetContext\r\n summaryGroup?: ValidationSummaryGroup\r\n summaryDisplayType?: FormValidationSummaryDisplayType\r\n // visible will be filled by the setValidate Method and tells ovl that this validation should be displayed\r\n\r\n handledFieldKeys?: string[]\r\n validationKey?: string\r\n}\r\n\r\nexport type ValidateResultVisibleSummaryError = {\r\n translationKey: string\r\n translationReps?: string[]\r\n}\r\n\r\nexport type ValidateResultSummaryError = {\r\n translationKey: string\r\n translationReps?: string[]\r\n displayType: FormValidationSummaryDisplayType\r\n standalone?: boolean\r\n}\r\nexport type ValidateResult = {\r\n // its just an array\r\n errors: ValidateResultError[]\r\n}\r\n\r\nexport type ValidateSummaryResult = {\r\n // its just an array\r\n visibleErrors: ValidateResultVisibleSummaryError[]\r\n errors: ValidateResultSummaryError[]\r\n}\r\n\r\nexport type ValidationsAddOptions = {\r\n validation?: OptionsValidateResultError\r\n fields?: SYSField | SYSField[]\r\n setFocus?: boolean\r\n resetContext?: ValidationResetContext\r\n}\r\n\r\nexport type ValidatorOptions = {\r\n validation?: OptionsValidateResultError\r\n // val could be like 10 for an ExactLength === 10 Validation. or {min:8,max:10} for an Range Validation ...\r\n // its really multi purpose and should be checked in the validator\r\n val?: any\r\n setFocus?: boolean\r\n resetContext?: ValidationResetContext\r\n}\r\n\r\nexport type ValidatorUseOptions = ValidatorOptions & {\r\n field?: SYSField\r\n}\r\n\r\nexport type FormValidationDisplayType = \"WhenTouched\" | \"Always\" | \"OnlyOutline\"\r\nexport type FormValidationSummaryDisplayType =\r\n | \"WhenTouched\"\r\n | \"WhenAllRelatedFieldsTouched\"\r\n | \"Always\"\r\n\r\nexport const _validationsAdd = (\r\n fields: SYSField | SYSField[],\r\n translationKey: string,\r\n resetContext: ValidationResetContext,\r\n options?: ValidatorOptions\r\n) => {\r\n ValidationsAdd(fields, translationKey, resetContext, options)\r\n}\r\nexport const _validatorUse = (\r\n field: SYSField,\r\n validator: SYSFormValidationValidators,\r\n resetContext: ValidationResetContext,\r\n options?: ValidatorOptions\r\n): boolean => {\r\n let formState: SYSFormState =\r\n ovl.getState().ovl.forms[field.formType][field.formId]\r\n if (!formState) {\r\n return\r\n }\r\n if (!options) {\r\n options = { val: undefined }\r\n }\r\n let validation = options?.validation\r\n validation = _enrichValidation(\r\n formState,\r\n validation,\r\n `SYSValidator${validator}`,\r\n resetContext\r\n )\r\n options.validation = validation\r\n let res = _callValidator(validator, field, options)\r\n let fields = [field]\r\n if (res) {\r\n _addValidation(fields, validation, options.setFocus)\r\n }\r\n return !res\r\n}\r\n\r\nexport const _callValidator = (\r\n validator: SYSFormValidationValidators,\r\n field: SYSField,\r\n options: ValidatorOptions\r\n) => {\r\n let res\r\n if (options.validation.translationReps)\r\n if (validatorsFunctions[validator].type === \"SYS\") {\r\n res = validatorsFunctions[validator].fn(field, options)\r\n } else if (ovl.getActions().app.global.hooks?.[HookFormValidatorsCustom]) {\r\n res = ovl.getActions().app.global.hooks?.[HookFormValidatorsCustom]({\r\n field,\r\n options,\r\n validator,\r\n } as HookFormValidatorsCustom_Type)\r\n } else {\r\n throw new Error(`Ovl: hook ${HookFormValidatorsCustom} not found`)\r\n }\r\n return res\r\n}\r\n\r\nexport const _enrichValidation = (\r\n formState: SYSFormState,\r\n validation: ValidateResultError,\r\n translationKey: string,\r\n resetContext: ValidationResetContext,\r\n group?: any\r\n): ValidateResultError => {\r\n if (validation === undefined) {\r\n validation = {\r\n displayType: formState.validationDefault.displayType,\r\n translationKey,\r\n translationReps: [],\r\n }\r\n }\r\n validation.translationKey = translationKey\r\n validation.validationKey = translationKey\r\n if (group !== undefined) {\r\n validation.validationKey = `validation.validationKey${group}`\r\n }\r\n\r\n // set the defaults if necessary\r\n if (!validation.summaryDisplayType) {\r\n if (formState.validationDefault.summaryDisplayType) {\r\n validation.summaryDisplayType =\r\n formState.validationDefault.summaryDisplayType\r\n }\r\n }\r\n\r\n // for summary display either summaryGroup or summaryDisplayType (or both) needs to be set\r\n // create the defaults if one is missing\r\n //\r\n if (!validation.summaryGroup) {\r\n if (formState.validationDefault.summaryGroup) {\r\n validation.summaryGroup = formState.validationDefault.summaryGroup\r\n } else if (validation.summaryDisplayType) {\r\n validation.summaryGroup = \"ValidationKey\"\r\n }\r\n }\r\n if (!validation.summaryDisplayType) {\r\n if (formState.validationDefault.summaryDisplayType) {\r\n validation.summaryDisplayType =\r\n formState.validationDefault.summaryDisplayType\r\n } else if (validation.summaryGroup) {\r\n validation.summaryDisplayType = \"WhenTouched\"\r\n }\r\n }\r\n //\r\n\r\n if (!validation.displayType) {\r\n if (validation.summaryDisplayType) {\r\n validation.displayType = \"OnlyOutline\"\r\n } else {\r\n validation.displayType = \"WhenTouched\"\r\n }\r\n }\r\n if (!validation.translationReps) {\r\n validation.translationReps = []\r\n }\r\n\r\n validation.resetContext = resetContext\r\n\r\n // if (validation.summaryGroup && !validation.summaryDisplayType) {\r\n // validation.summaryDisplayType =\r\n // formState.validationDefault.summaryDisplayType\r\n // }\r\n\r\n // if (validation.summaryDisplayType && !validation.summaryGroup) {\r\n // validation.summaryGroup = formState.validationDefault.summaryGroup\r\n // }\r\n\r\n return validation\r\n}\r\n\r\nexport const ValidationsRemove = (\r\n fields: SYSField | SYSField[],\r\n validationkey?: string\r\n) => {\r\n if (!Array.isArray(fields)) {\r\n fields = [fields]\r\n }\r\n _removeValidation(fields, validationkey)\r\n}\r\n\r\nconst _removeValidation = (fields: SYSField[], validationkey?: string) => {\r\n fields.forEach((field) => {\r\n // if validatiuonkey is undefine just remove all field validations\r\n let needsSetVisibleValidation = false\r\n let formsState = ovl.getState().ovl.forms\r\n var res = field.validationResult.System.filter(\r\n (f) => validationkey !== undefined && f.validationKey !== validationkey\r\n )\r\n if (res.length !== field.validationResult.System.length) {\r\n field.validationResult.System = res\r\n needsSetVisibleValidation = true\r\n }\r\n\r\n res = field.validationResult.Validate.filter(\r\n (f) => validationkey !== undefined && f.validationKey !== validationkey\r\n )\r\n if (res.length !== field.validationResult.Validate.length) {\r\n field.validationResult.Validate = res\r\n needsSetVisibleValidation = true\r\n }\r\n\r\n res = field.validationResult.ValueChanged.filter(\r\n (f) => validationkey !== undefined && f.validationKey !== validationkey\r\n )\r\n if (res.length !== field.validationResult.ValueChanged.length) {\r\n field.validationResult.ValueChanged = res\r\n needsSetVisibleValidation = true\r\n }\r\n if (\r\n needsSetVisibleValidation &&\r\n (field.ui.alwaysReadOnly ||\r\n (formsState[field.formType][field.formId])._state\r\n ._inInitOrChangedCount === 0)\r\n ) {\r\n // only do immediate summary visible and form valid if other form than initiating form\r\n setVisibleValidation(formsState[field.formType][field.formId])\r\n _setFormValid(formsState[field.formType][field.formId])\r\n }\r\n })\r\n}\r\n\r\nexport const _addValidation = (\r\n fields: SYSField[],\r\n v: ValidateResultError,\r\n\r\n setFocus?: boolean\r\n) => {\r\n v.handledFieldKeys = fields.map((m) => m.fieldKey)\r\n let formState: SYSFormState\r\n try {\r\n fields.forEach((field) => {\r\n if (!formState) {\r\n formState = ovl.getState().ovl.forms[field.formType][field.formId]\r\n }\r\n // if we set mandatory in valuechanged and there are already System Errors delete the System Error\r\n // UseCase: A Field accepts onl List Entries -> This gets Set in the System Group\r\n // A User adds a Mandatory afterwards (Be it Changed or Validate Hook) then it displays 2 Error whereas Mandatory only should be displayed\r\n if (\r\n v.resetContext !== \"System\" &&\r\n v.translationKey === \"SYSValidatorMandatory\"\r\n ) {\r\n field.validationResult.System = []\r\n }\r\n\r\n // do nothing if key is already added\r\n let allValidation = field.validationResult.System.concat(\r\n field.validationResult.Validate\r\n ).concat(field.validationResult.ValueChanged)\r\n if (\r\n allValidation.filter(\r\n (f) =>\r\n (f.translationKey === v.translationKey &&\r\n f.summaryGroup === v.summaryGroup &&\r\n f.resetContext === v.resetContext) ||\r\n f.validationKey === v.validationKey\r\n ).length < 1\r\n ) {\r\n formState.valid = false\r\n if (setFocus && v.displayType !== \"OnlyOutline\") {\r\n v.displayType = \"Always\"\r\n }\r\n\r\n let translationReps = []\r\n\r\n translationReps.push(field.ui.labelCaption)\r\n\r\n if (v.translationReps) {\r\n translationReps = translationReps.concat(\r\n v.translationReps.filter((f) => f)\r\n )\r\n }\r\n v.translationReps = translationReps\r\n field.validationResult[v.resetContext].push(v)\r\n }\r\n })\r\n\r\n if (setFocus) {\r\n setTimeout(() => {\r\n FieldSetFocus(fields[0])\r\n }, 400)\r\n }\r\n } finally {\r\n // do the debounced one\r\n setVisibleValidation(formState)\r\n }\r\n}\r\n\r\ntype ValidateResultErrorWithFieldWatched = ValidateResultError & {\r\n watched?: boolean\r\n fieldKey?: string\r\n}\r\n\r\nexport const setVisibleValidation = (\r\n formState: SYSFormState,\r\n debounce: number = 300\r\n) => {\r\n // if (ValidationContext.mode === undefined) {\r\n // // use debounced if called from outside ovl base context\r\n // // user might use a lot of subsequent validations from whatever event. so only the last one should be relevant\r\n if (formState._state._summaryDebouncer) {\r\n clearTimeout(formState._state._summaryDebouncer)\r\n }\r\n if (debounce < 1) {\r\n _setVisibleValidation(formState)\r\n return\r\n }\r\n formState._state._summaryDebouncer = setTimeout(() => {\r\n _setVisibleValidation(formState)\r\n }, debounce)\r\n}\r\n\r\ntype SummaryFirstOrAllWatchedType = {\r\n [key in string]: {\r\n fieldKey: string\r\n watched: boolean\r\n translationReps: any[]\r\n }[]\r\n}\r\n\r\nexport const _setFieldValid = (field: SYSField) => {\r\n if (field === undefined || !field._state.fieldInitialValidated) {\r\n return\r\n }\r\n\r\n if (field.inactive && !field.inactiveButRelevantForValidation) {\r\n field.valid = true\r\n }\r\n\r\n let allValidation = []\r\n\r\n allValidation = allValidation.concat(field.validationResult.System)\r\n\r\n allValidation = allValidation.concat(field.validationResult.Validate)\r\n\r\n allValidation = allValidation.concat(field.validationResult.ValueChanged)\r\n\r\n field.valid = allValidation.length === 0\r\n}\r\n\r\nconst _setVisibleValidation = (formState: SYSFormState) => {\r\n // for some reason there were console errors indicating that formstate was not anmore there\r\n // (its possible because timeout calling stuff)\r\n // so just leave if its not anymore there\r\n if (!formState) {\r\n return\r\n }\r\n\r\n let fields: SYSFields = formState.fields\r\n let summaryFieldKeysAllWatched: SummaryFirstOrAllWatchedType = {}\r\n\r\n // delete the field validation results\r\n Object.keys(formState.validationResult).forEach((k) => {\r\n formState.validationResult[k].fieldErrors = []\r\n formState.validationResult[k].summaryErrors = {}\r\n formState.validationResult[k].validationKeyErrors = {}\r\n })\r\n\r\n Object.keys(fields)\r\n .filter(\r\n (f) => !fields[f].inactive || fields[f].inactiveButRelevantForValidation\r\n )\r\n .forEach((fieldKey) => {\r\n let allValidation = fields[fieldKey].validationResult.System.concat(\r\n fields[fieldKey].validationResult.Validate\r\n ).concat(fields[fieldKey].validationResult.ValueChanged)\r\n\r\n allValidation.forEach((r) => {\r\n let tabErrors = formState.validationResult[fields[fieldKey].groups.tab]\r\n let rr: ValidateResultErrorWithFieldWatched = r\r\n rr.watched = fields[fieldKey].watched\r\n rr.fieldKey = fieldKey\r\n if (rr.summaryGroup) {\r\n if (rr.summaryDisplayType === \"WhenAllRelatedFieldsTouched\") {\r\n if (!summaryFieldKeysAllWatched[rr.translationKey]) {\r\n summaryFieldKeysAllWatched[rr.translationKey] = []\r\n }\r\n summaryFieldKeysAllWatched[rr.translationKey].push({\r\n fieldKey,\r\n watched: rr.watched,\r\n translationReps: rr.translationReps,\r\n })\r\n }\r\n\r\n if (\r\n rr.summaryDisplayType === \"Always\" ||\r\n (rr.summaryDisplayType === \"WhenTouched\" &&\r\n fields[fieldKey].watched)\r\n ) {\r\n if (rr.summaryGroup === \"Field\") {\r\n let fieldErrors = tabErrors.fieldErrors\r\n fieldErrors.push({\r\n translationKey: rr.translationKey,\r\n translationReps: rr.translationReps,\r\n })\r\n } else {\r\n if (!tabErrors.validationKeyErrors[rr.validationKey]) {\r\n tabErrors.validationKeyErrors[rr.validationKey] = {\r\n translationKey: rr.translationKey,\r\n translationReps: rr.translationReps,\r\n involvedFieldKeys: [rr.fieldKey],\r\n }\r\n } else {\r\n let involvedFieldKeys =\r\n tabErrors.validationKeyErrors[rr.validationKey]\r\n .involvedFieldKeys\r\n\r\n involvedFieldKeys.push(rr.fieldKey)\r\n }\r\n }\r\n }\r\n }\r\n })\r\n })\r\n\r\n // now the allWatched\r\n Object.keys(summaryFieldKeysAllWatched).forEach((f) => {\r\n let allWatchedPerKey = summaryFieldKeysAllWatched[f]\r\n let watchedLength = allWatchedPerKey.filter((f) => f.watched).length\r\n if (watchedLength > 0 && allWatchedPerKey.length === watchedLength) {\r\n allWatchedPerKey.forEach((allWatchedEntry) => {\r\n let tabErrors =\r\n formState.validationResult[\r\n fields[allWatchedEntry.fieldKey].groups.tab\r\n ]\r\n if (!tabErrors.validationKeyErrors[f]) {\r\n tabErrors.validationKeyErrors[f] = {\r\n translationKey: f,\r\n translationReps: allWatchedEntry.translationReps,\r\n involvedFieldKeys: [allWatchedEntry.fieldKey],\r\n }\r\n } else {\r\n let involvedFieldKeys =\r\n tabErrors.validationKeyErrors[f].involvedFieldKeys\r\n\r\n involvedFieldKeys.push(allWatchedEntry.fieldKey)\r\n }\r\n })\r\n }\r\n })\r\n}\r\n\r\nexport const _checkFormValid = (formState: SYSFormState) => {\r\n let fields = formState.fields\r\n let validationResults = Object.keys(formState.validationResult)\r\n return (\r\n !validationResults.some(\r\n (f) => Object.keys(formState.validationResult[f].summaryErrors).length > 0\r\n ) &&\r\n !Object.keys(fields)\r\n .filter(\r\n (f) =>\r\n !fields[f].schema.isCalculatedColumn &&\r\n (!fields[f].inactive || fields[f].inactiveButRelevantForValidation)\r\n )\r\n .some(\r\n (s) =>\r\n fields[s].validationResult.System.length +\r\n fields[s].validationResult.Validate.length +\r\n fields[s].validationResult.ValueChanged.length >\r\n 0\r\n )\r\n )\r\n}\r\n\r\nexport const _setFormValid = (formState: SYSFormState): boolean => {\r\n if (!formState) {\r\n return false\r\n }\r\n formState.valid = _checkFormValid(formState)\r\n}\r\n\r\nexport const _getFormValid = (formState: SYSFormState): boolean => {\r\n if (!formState) {\r\n return false\r\n }\r\n if (formState._state._inInitOrChangedCount > 0) {\r\n // we are possibly inside hooks in init or validate or changed\r\n // they assume the errors list to be correctly at that stage. so call the full shabang\r\n return _checkFormValid(formState)\r\n }\r\n return formState.valid\r\n}\r\n\r\n// export const _clearAllErrors = (formState: SYSFormState) => {\r\n// Object.keys(formState.validationResult.errors = []\r\n// formState.validationResult.visibleErrors = []\r\n// let fields = formState.fields\r\n// Object.keys(fields).forEach((f) => {\r\n// fields[f].validationResult.Validate = []\r\n// fields[f].validationResult.System = []\r\n// fields[f].validationResult.ValueChanged = []\r\n// })\r\n// setVisibleValidation(formState, 0)\r\n// //_setFormValid(formState)\r\n// }\r\n\r\nexport const setFormDirty = (formState: SYSFormState) => {\r\n let newDirty = Object.keys(formState.fields).some(\r\n (s) =>\r\n formState.fields[s].dirty &&\r\n !formState.fields[s].schema.isCalculatedColumn // &&\r\n // (!formState.fields[s].inactive ||\r\n // formState.fields[s].inactiveButRelevantForValidation)\r\n )\r\n\r\n if (newDirty !== formState.dirty) {\r\n if (newDirty) {\r\n ovl.getActions().ovl.internal._SetFormDirty(formState)\r\n } else {\r\n ovl.getActions().ovl.internal._SetFormUndirty(formState)\r\n }\r\n\r\n let fn = ovl.getActions().app.features[formState.feature]\r\n\r\n let hookFormDirtyChanged =\r\n fn?.hooks?.[\r\n HookFormDirtyChanged.replace(\"{subFeature}\", formState.subFeature)\r\n ]\r\n if (hookFormDirtyChanged) {\r\n hookFormDirtyChanged({ formState, newDirty })\r\n }\r\n }\r\n}\r\n\r\n// export const SetFormUnDirty = (formState: SYSFormState) => {\r\n// ovl.getActions().ovl.internal._SetFormUndirty(formState)\r\n// }\r\n\r\nexport const HasVisibleSummaryErrors = (formState: SYSFormState) => {\r\n return Object.keys(formState.validationResult).some(\r\n (s) =>\r\n formState.validationResult[s].fieldErrors.length > 0 ||\r\n Object.keys(formState.validationResult[s].summaryErrors).length > 0 ||\r\n Object.keys(formState.validationResult[s].validationKeyErrors).length > 0\r\n )\r\n}\r\n\r\n// export const HasVisibleSummaryErrors = (formState: SYSFormState) => {\r\n// return Object.keys(formState.validationResult).some(\r\n// (s) =>\r\n// Object.keys(formState.validationResult[s].summaryErrors).length > 0 ||\r\n// Object.keys(formState.fields).some((s) => {\r\n// return (\r\n// formState.fields[s].validationResult.System.some(\r\n// (s) => s.summaryGroup\r\n// ) ||\r\n// formState.fields[s].validationResult.Validate.some(\r\n// (s) => s.summaryGroup\r\n// ) ||\r\n// formState.fields[s].validationResult.ValueChanged.some(\r\n// (s) => s.summaryGroup\r\n// )\r\n// )\r\n// })\r\n// )\r\n// }\r\n","import type { SYSFeature, SYSTableDefIds } from \"../..\"\r\nimport { SYSConfig, ovl } from \"../..\"\r\nimport { IsComplexType, T } from \"../../global/globals\"\r\nimport {\r\n _GetFieldListCacheKey,\r\n _cachedFieldLists,\r\n getDisplayValue,\r\n} from \"../table/helpers\"\r\nimport type { ControlVisiblity, FieldValueMap } from \"./actions\"\r\nimport { _ValidateField } from \"./actions\"\r\nimport type { SetFieldStateMode } from \"./fieldapi\"\r\nimport { FieldSetFocus, FieldSetVal } from \"./fieldapi\"\r\n\r\nimport type { SYSField, SYSFormState } from \"./fieldapi\"\r\n\r\nimport {\r\n HookFormFieldsInit,\r\n HookFormFieldsInit_Type,\r\n HookLookupsRefresh,\r\n HookLookupsRefresh_Type,\r\n} from \"../../global/hooks\"\r\nimport { DialogsState } from \"../dialog/sysdialogbase\"\r\nimport { TableGet } from \"../table/tableapi\"\r\nimport type { SYSFormField, Schema } from \"./sysformelement\"\r\nimport {\r\n ValidationResetContext,\r\n _setFieldValid,\r\n setVisibleValidation,\r\n} from \"./validators\"\r\nexport let validatorsFunctions: { type?: \"SYS\" | \"Custom\"; fn?: any } = {}\r\n\r\nexport const getFormFields = (\r\n schema: { [key: string]: Schema },\r\n formFields: { [key: string]: SYSFormField },\r\n instanceId: string,\r\n formType: string,\r\n feature: SYSFeature,\r\n subFeature: string,\r\n mode: \"Add\" | \"Update\",\r\n defId: SYSTableDefIds,\r\n fillSpaceIfEmptyField: boolean\r\n): FieldValueMap => {\r\n let fields: FieldValueMap = {}\r\n Object.keys(formFields).forEach((k) => {\r\n //always make sure we have a schema and set the defaults\r\n\r\n if (formFields[k].schema === undefined) {\r\n if (schema && schema[k]) {\r\n formFields[k].schema = JSON.parse(JSON.stringify(schema[k]))\r\n } else {\r\n formFields[k].schema = {\r\n defaultValue: null,\r\n maxLength: 99999999,\r\n nullable: true,\r\n }\r\n }\r\n } else {\r\n if (formFields[k].schema.defaultValue === undefined) {\r\n if (schema?.[k]?.defaultValue !== undefined) {\r\n formFields[k].schema.defaultValue = schema[k].defaultValue\r\n } else {\r\n formFields[k].schema.defaultValue = null\r\n }\r\n }\r\n if (formFields[k].schema.maxLength === undefined) {\r\n if (\r\n schema?.[k]?.maxLength !== undefined &&\r\n formFields[k].type === \"text\"\r\n ) {\r\n formFields[k].schema.maxLength = schema[k].maxLength\r\n } else {\r\n formFields[k].schema.maxLength = 99999999\r\n }\r\n }\r\n\r\n if (formFields[k].control === undefined) {\r\n formFields[k].control = \"text\"\r\n }\r\n\r\n if (formFields[k].order === undefined) {\r\n formFields[k].order = 0\r\n }\r\n\r\n if (formFields[k].schema.nullable === undefined) {\r\n if (schema?.[k]?.nullable !== undefined) {\r\n formFields[k].schema.nullable = schema[k].nullable\r\n } else {\r\n formFields[k].schema.nullable = true\r\n }\r\n }\r\n }\r\n\r\n // was troublesome because:\r\n // not nullable fields which are null (eg. DocNum in B1 SalesOrder when Add. Its filled after Adding)\r\n // // now if there is schema and nullable is false in the schema then it can not be configured otherwise\r\n // // remember: schema comes from db (or is overwritten using schema hook) and needs to be fulfilled\r\n // //\r\n // if (\r\n // mode === \"Update\" &&\r\n // schema &&\r\n // schema[k] &&\r\n // schema[k].nullable === false &&\r\n // formFields[k].schema.nullable === true\r\n // ) {\r\n // console.error(\r\n // \"ovl error: field.schema.nullable cannot be set to true if its false in schema. it will be set to false\"\r\n // )\r\n // formFields[k].schema.nullable = false\r\n // }\r\n\r\n if (formFields[k].schema.nullValidatorToUse === undefined) {\r\n if (!formFields[k].schema.nullable) {\r\n // formFields[k].schema.nullValidatorToUse = \"OvlAllowEmpty\"\r\n // } else {\r\n formFields[k].schema.nullValidatorToUse = SYSConfig._system\r\n .defaultNullValidatorToUse\r\n ? SYSConfig._system.defaultNullValidatorToUse\r\n : \"Mandatory\"\r\n }\r\n }\r\n\r\n let type = formFields[k].type\r\n if (!type) {\r\n if (schema && schema[k]) {\r\n type = schema[k].type\r\n } else {\r\n type = \"text\"\r\n }\r\n }\r\n formFields[k].type = type\r\n\r\n // default values from schema\r\n if (\r\n (mode === \"Add\" && formFields[k].value === undefined) ||\r\n formFields[k].value === null\r\n ) {\r\n if (formFields[k].schema.defaultValue !== null) {\r\n formFields[k].value = formFields[k].schema.defaultValue\r\n } else if (\r\n formFields[k].ui?.checkedValue &&\r\n formFields[k].schema.nullable === false\r\n ) {\r\n //for checkboxes there is strictly checkedValue/uncheckedValue if schema says its not nullable\r\n formFields[k].value = formFields[k].ui?.uncheckedValue\r\n }\r\n }\r\n\r\n if (formFields[k].value === undefined) {\r\n formFields[k].value = null\r\n }\r\n if (formFields[k].groups === undefined) {\r\n formFields[k].groups = {\r\n tab: 0,\r\n group: 0,\r\n }\r\n }\r\n\r\n if (IsComplexType(formFields[k].value)) {\r\n throw Error(\r\n `ovl formfield init error: no complext types allowed:feature: ${feature} field: ${k}`\r\n )\r\n }\r\n\r\n if (formFields[k].groups.group === undefined) {\r\n formFields[k].groups.group = 0\r\n }\r\n if (formFields[k].groups.tab === undefined) {\r\n formFields[k].groups.tab = 0\r\n }\r\n\r\n if (formFields[k].nullHandling === undefined) {\r\n formFields[k].nullHandling = {\r\n enabled: false,\r\n }\r\n }\r\n\r\n if (formFields[k].control === \"asset\" && !formFields[k].editor) {\r\n formFields[k].editor = { id: \"SYSEditorAsset\" }\r\n }\r\n // check nullHandling. it only can be set to null if underlying schema allows it\r\n if (formFields[k].nullHandling.enabled) {\r\n if (formFields[k].schema.nullable === false) {\r\n throw new Error(\r\n `ovl error: column ${k} nullHandling.enabled cannot be set to null because of schema violation`\r\n )\r\n }\r\n }\r\n })\r\n\r\n let formFieldsInitHook =\r\n ovl.getActions().app.features[feature]?.hooks?.[\r\n HookFormFieldsInit.replace(\"{subFeature}\", subFeature)\r\n ]\r\n if (formFieldsInitHook) {\r\n formFieldsInitHook({\r\n formFieldsToSet: formFields,\r\n })\r\n }\r\n Object.keys(formFields).forEach((k) => {\r\n if (formFields[k].ui?.alwaysReadOnly) {\r\n formFields[k].ui.readonly = true\r\n }\r\n\r\n let value = formFields[k].value\r\n let type = formFields[k].type\r\n if (!formFields[k].list && value !== null) {\r\n if (formFields[k].type === \"datetime\") {\r\n if (value !== null && value.length > 16) {\r\n value = value.replace(\"+00:00\", \"Z\")\r\n let dt = new Date(value)\r\n let t = dt.getTimezoneOffset()\r\n var offsetTime = new Date(dt.getTime() - t * 60 * 1000)\r\n value = offsetTime.toISOString().substring(0, 16)\r\n }\r\n } else {\r\n value = getDisplayValue(\r\n k,\r\n { list: undefined, type, ui: formFields[k].ui },\r\n value,\r\n feature,\r\n /* we need this fake formstate so displayEmptyIfValue works */\r\n { firstInitOrSituationChanged: true }\r\n )\r\n }\r\n }\r\n fields[k] = {\r\n control: formFields[k].control,\r\n order: formFields[k].order,\r\n valid: true,\r\n value,\r\n nullHandling: {\r\n enabled: formFields[k].nullHandling.enabled,\r\n setToNullIf: formFields[k].nullHandling.setToNullIf,\r\n setToValueIfNull: formFields[k].nullHandling.setToValueIfNull,\r\n },\r\n groups: {\r\n tab: formFields[k].groups.tab,\r\n group: formFields[k].groups.group,\r\n },\r\n convertedValue:\r\n formFields[k].type === \"object\"\r\n ? JSON.parse(formFields[k].value)\r\n : formFields[k].value,\r\n originalValue: formFields[k].value,\r\n previousValid: true,\r\n previousValidConvertedValue:\r\n mode === \"Add\" ? undefined : formFields[k].value,\r\n previousConvertedValue: mode === \"Add\" ? undefined : formFields[k].value,\r\n previousValue: undefined,\r\n type: type,\r\n schema: formFields[k].schema,\r\n dirty: false,\r\n watched: false,\r\n touched: false,\r\n customState: {},\r\n validationResult: {\r\n System: [],\r\n Validate: [],\r\n ValueChanged: [],\r\n },\r\n id: `${formType}_${instanceId}_${k}`,\r\n list: formFields[k].list,\r\n\r\n editor: formFields[k].editor,\r\n formId: instanceId,\r\n formType,\r\n fieldKey: k,\r\n\r\n ui: formFields[k].ui,\r\n inactive: formFields[k].inactive,\r\n hasFocus: false,\r\n /*ignoreForFormValid: formFields[k].ignoreForFormValid,*/\r\n _state: {\r\n forceSave: false,\r\n closing: false,\r\n visible: true,\r\n removedAndIrrelevantInCurrentSituation: false,\r\n forceChange: false,\r\n valueAfterGotFocus: undefined,\r\n },\r\n }\r\n if (formFields[k].inactive === undefined) {\r\n formFields[k].inactive = false\r\n }\r\n if (formFields[k].list) {\r\n if (formFields[k].list.mode === undefined) {\r\n if (!formFields[k].list.serverEndpoint) {\r\n fields[k].list.mode = \"Select\"\r\n } else {\r\n fields[k].list.mode = \"List\"\r\n }\r\n }\r\n if (formFields[k].list.acceptOnlyListValues === undefined) {\r\n fields[k].list.acceptOnlyListValues = true\r\n }\r\n if (\r\n formFields[k].list.acceptNotOnlyListValuesIgnoreFilter === undefined\r\n ) {\r\n formFields[k].list.acceptNotOnlyListValuesIgnoreFilter =\r\n fields[k].list.acceptOnlyListValues === false\r\n }\r\n if (\r\n formFields[k].list\r\n .tryGetLookupFromServerInFormInitIfNotFoundIgnoreValues === undefined\r\n ) {\r\n if (\r\n SYSConfig.formDefaults\r\n ?.tryGetLookupFromServerInFormInitIfNotFoundIgnoreValues\r\n ) {\r\n formFields[\r\n k\r\n ].list.tryGetLookupFromServerInFormInitIfNotFoundIgnoreValues =\r\n SYSConfig.formDefaults.tryGetLookupFromServerInFormInitIfNotFoundIgnoreValues\r\n } else {\r\n formFields[\r\n k\r\n ].list.tryGetLookupFromServerInFormInitIfNotFoundIgnoreValues = \"None\"\r\n }\r\n }\r\n\r\n // if (formFields[k].list.acceptEmpty === undefined) {\r\n // fields[k].list.acceptEmpty = false\r\n // }\r\n\r\n if (\r\n formFields[k].list.displayField === undefined &&\r\n formFields[k].list.valueField\r\n ) {\r\n formFields[k].list.displayField = formFields[k].list.valueField\r\n }\r\n\r\n if (formFields[k].list.displayValueField === undefined) {\r\n fields[k].list.displayValueField =\r\n formFields[k].list.valueField !== formFields[k].list.displayField\r\n }\r\n if (fields[k].list.refreshMode === undefined) {\r\n fields[k].list.refreshMode = \"Refresh\"\r\n }\r\n if (fields[k].list.selectOnly === undefined) {\r\n fields[k].list.selectOnly = false\r\n }\r\n if (fields[k].list.showCachedHitsWhileTyping === undefined) {\r\n if (!fields[k].list.selectOnly) {\r\n fields[k].list.showCachedHitsWhileTyping = true\r\n }\r\n }\r\n\r\n if (fields[k].list.onlyRefreshFromServerIfOlderThanMs === undefined) {\r\n fields[k].list.onlyRefreshFromServerIfOlderThanMs = 0\r\n }\r\n if (fields[k].list.showRefreshFromServerSnack === undefined) {\r\n fields[k].list.showRefreshFromServerSnack = true\r\n }\r\n\r\n if (fields[k].list.mode === \"Option\") {\r\n if (fields[k].list.acceptOnlyListValuesValidatorOptions === undefined) {\r\n fields[k].list.acceptOnlyListValuesValidatorOptions = {\r\n displayType: \"OnlyOutline\",\r\n }\r\n }\r\n if (\r\n fields[k].list.acceptOnlyListValuesValidatorOptions.displayType ===\r\n undefined\r\n ) {\r\n fields[k].list.acceptOnlyListValuesValidatorOptions.displayType =\r\n \"OnlyOutline\"\r\n }\r\n }\r\n\r\n fields[k].list._state = {\r\n needsRefresh: false,\r\n lastRefreshTimestamp: 0,\r\n lastPostParams: undefined,\r\n }\r\n }\r\n\r\n if (fields[k].groups === undefined) {\r\n fields[k].groups = {\r\n tab: 0,\r\n group: 0,\r\n }\r\n }\r\n\r\n if (fields[k].groups.group === undefined) {\r\n fields[k].groups.group = 0\r\n }\r\n\r\n if (fields[k].groups.tab === undefined) {\r\n fields[k].groups.tab = 0\r\n }\r\n\r\n if (!fields[k].ui) {\r\n fields[k].ui = { noLabel: true }\r\n }\r\n let ui = fields[k].ui\r\n\r\n if (ui.readonly === undefined) {\r\n ui.readonly = false\r\n }\r\n\r\n if (ui.fillSpaceIfNotVisible === undefined) {\r\n ui.fillSpaceIfNotVisible = fillSpaceIfEmptyField\r\n if (ui.fillSpaceIfNotVisible === undefined) {\r\n ui.fillSpaceIfNotVisible = true\r\n }\r\n }\r\n\r\n if (ui.autocomplete === undefined) {\r\n ui.autocomplete = \"off\"\r\n }\r\n if (ui.useSpellcheck === undefined) {\r\n ui.useSpellcheck = false\r\n }\r\n if (ui.visible === undefined) {\r\n ui.visible = \"true\"\r\n }\r\n if (ui.visible === \"fadeOut\" || ui.visible === \"false\") {\r\n fields[k]._state.visible = false\r\n }\r\n if (ui.checkedValue === undefined) {\r\n ui.checkedValue = true\r\n } else typeof ui.checkedValue === \"string\"\r\n {\r\n if (ui.uncheckedValue === undefined) {\r\n ui.uncheckedValue = \"N\"\r\n }\r\n }\r\n if (ui.useBrowserDatePicker === undefined) {\r\n ui.useBrowserDatePicker = false\r\n }\r\n\r\n //@ts-ignore\r\n if (ui.infoValueTranslationCode) {\r\n //@ts-ignore\r\n ui.infoValue = T(ui.infoValueTranslationCode)\r\n }\r\n if (fields[k].ui) {\r\n SetTranslatedLabel(defId, fields[k], k)\r\n }\r\n })\r\n return fields\r\n}\r\n\r\nexport const SetTranslatedLabel = (\r\n defId: SYSTableDefIds,\r\n field: SYSField,\r\n columnKey: string\r\n) => {\r\n let caption = undefined\r\n //if (fields[k].ui.noLabel !== true) {\r\n let def\r\n if (defId) {\r\n def = TableGet(defId).def\r\n }\r\n\r\n if (field.ui.labelTranslationKey) {\r\n caption = T(field.ui.labelTranslationKey)\r\n } else if (\r\n def &&\r\n def.options.labelAndColumnTitleHandling?.translationPrefix !== undefined\r\n ) {\r\n caption = T(\r\n `${def.options.labelAndColumnTitleHandling.translationPrefix}${columnKey}`\r\n )\r\n }\r\n if (!caption) {\r\n caption = columnKey\r\n }\r\n //}\r\n field.ui.labelCaption = caption\r\n}\r\n\r\nexport const _setDialogVisible = (\r\n visible: boolean,\r\n dialogState: DialogsState\r\n) => {\r\n // explicit tracking shouldn't be necessary here because we are firing the Reactors now in proxyHandler even if its tracking\r\n // (moved the logic to ignore rendering below rectors call)\r\n // try {\r\n //_RenderTracking.forceTracking = true\r\n dialogState.visible = visible\r\n if (visible === false) {\r\n dialogState.closing = false\r\n }\r\n // } finally {\r\n // //_RenderTracking.forceTracking = false\r\n // }\r\n}\r\n\r\nexport const _setFieldReadonly = (field: SYSField, readOnly: boolean) => {\r\n if (field.ui.alwaysReadOnly) {\r\n readOnly = true\r\n }\r\n field.ui.readonly = readOnly\r\n}\r\n\r\nexport const _setFieldInactive = async (\r\n field: SYSField,\r\n inactive: boolean,\r\n animate?: \"fade\" | \"none\",\r\n mode?: SetFieldStateMode,\r\n focus?: boolean,\r\n calledFromGroup?: boolean,\r\n forceValueWhenInactive?: any,\r\n forceValue?: any,\r\n keepValidation?: boolean,\r\n clearList?: boolean,\r\n forceFocus?: boolean,\r\n selectIfFocusSet?: boolean,\r\n noRetrigger?: boolean\r\n) => {\r\n // early bail out if not relevant\r\n if (field._state.removedAndIrrelevantInCurrentSituation) {\r\n return\r\n }\r\n\r\n field.inactiveButRelevantForValidation = !!keepValidation\r\n\r\n let formState: SYSFormState =\r\n ovl.getState().ovl.forms[field.formType][field.formId]\r\n\r\n try {\r\n if (!calledFromGroup) {\r\n // if field belongs to a group and group is inactive do not allow modification\r\n if (formState.groups.edit[field.groups.group].inactive) {\r\n return\r\n }\r\n }\r\n\r\n // important: if field switched to inactive then do forceval before fild.inactive is set\r\n\r\n if (forceValue !== undefined) {\r\n if (field.convertedValue !== forceValue) {\r\n await FieldSetVal(field, forceValue, { noRetrigger })\r\n }\r\n\r\n // introduced because when selecting a vlue which has formchanged and sets a force value this field should be revisited?\r\n // if it's not a good behaviour consider to introduce forceWatched analogous forceValue in FieldSetState\r\n // same further down for whenInactive\r\n _setFieldWatched(field, false)\r\n // reset previousvalid... because this was a non user change and if user changes it again it validValueChanged should be true\r\n field.previousValidConvertedValue = undefined\r\n }\r\n\r\n if (field.list && clearList) {\r\n _clearFieldList(field)\r\n }\r\n\r\n // some defaults\r\n if (animate === undefined) {\r\n animate = \"fade\"\r\n }\r\n if (mode === undefined) {\r\n mode = \"visible/notvisible\"\r\n }\r\n\r\n let wasActive = !field.inactive\r\n let activeChanged = !!field.inactive !== inactive\r\n if (!activeChanged) {\r\n if (inactive) {\r\n if (!field.inactiveButRelevantForValidation) {\r\n field.validationResult = {\r\n System: [],\r\n Validate: [],\r\n ValueChanged: [],\r\n }\r\n }\r\n\r\n if (forceValueWhenInactive !== undefined) {\r\n if (\r\n field.convertedValue !== forceValueWhenInactive ||\r\n field.value !== forceValueWhenInactive\r\n ) {\r\n await FieldSetVal(field, forceValueWhenInactive, { noRetrigger })\r\n }\r\n // reset previousvalid... because this was a non user change and if user changes it again it validValueChanged should be true\r\n field.previousValidConvertedValue = undefined\r\n }\r\n }\r\n } else {\r\n field.inactive = inactive\r\n let validated = false\r\n if (inactive) {\r\n _setFieldWatched(field, false)\r\n if (forceValueWhenInactive !== undefined) {\r\n if (\r\n field.convertedValue !== forceValueWhenInactive ||\r\n field.value !== forceValueWhenInactive\r\n ) {\r\n await FieldSetVal(field, forceValueWhenInactive, { noRetrigger })\r\n\r\n validated = true\r\n }\r\n // reset previousvalid... because this was a non user change and if user changes it again it validValueChanged should be true\r\n field.previousValidConvertedValue = undefined\r\n }\r\n\r\n // fieldInactiveButRelevantFirValidation fields will also be saved even if they are inactive\r\n // and because we would like to save only valid values to our backend according to definition in schema and clientcolumn it's a good idea to keep the validation for those\r\n if (!field.inactiveButRelevantForValidation) {\r\n field.validationResult = {\r\n System: [],\r\n Validate: [],\r\n ValueChanged: [],\r\n }\r\n }\r\n }\r\n\r\n //if (field.inactive !== inactive) {\r\n // if (!wasActive) {\r\n // //reset watched\r\n // //new 30.03.2023 we assume that if a field switches from inactive to active state we also reset the watched flag\r\n // //because: if it was invisible and now appears (or reappear)the user needs to use the field again before its again watched\r\n // _setFieldWatched(field, false)\r\n // }\r\n // field.inactive = inactive\r\n\r\n //if (!field.inactive || field.inactiveButRelevantForValidation) {\r\n if (!validated) {\r\n if (field.list) {\r\n field.value = field.convertedValue\r\n }\r\n await _ValidateField(\r\n field,\r\n formState,\r\n ovl.getActions(),\r\n false,\r\n false,\r\n true\r\n )\r\n }\r\n //}\r\n //}\r\n }\r\n if (!calledFromGroup) {\r\n if (inactive) {\r\n if (mode === \"visible/notvisible\" || mode === \"readonly/notvisible\") {\r\n _setFieldVisibility(field, animate === \"fade\" ? \"fadeOut\" : \"false\")\r\n } else {\r\n //it should be visible but readonly\r\n _setFieldVisibility(field, animate === \"fade\" ? \"fadeIn\" : \"true\")\r\n _setFieldReadonly(field, true)\r\n }\r\n } else {\r\n _setFieldVisibility(field, animate === \"fade\" ? \"fadeIn\" : \"true\")\r\n if (mode === \"readonly/notvisible\") {\r\n _setFieldReadonly(field, true)\r\n } else {\r\n _setFieldReadonly(field, false)\r\n if (\r\n (forceFocus || (!wasActive && focus)) &&\r\n !formState.firstInitOrSituationChanged\r\n ) {\r\n setTimeout(() => {\r\n FieldSetFocus(field, selectIfFocusSet)\r\n }, 200)\r\n }\r\n }\r\n }\r\n } else {\r\n if (\r\n (forceFocus || (!wasActive && focus)) &&\r\n !formState.firstInitOrSituationChanged\r\n ) {\r\n setTimeout(() => {\r\n FieldSetFocus(field, selectIfFocusSet)\r\n }, 200)\r\n }\r\n }\r\n } finally {\r\n _setFieldValid(field)\r\n setVisibleValidation(formState)\r\n }\r\n}\r\n\r\nexport const _clearFieldList = (field: SYSField) => {\r\n let formState = ovl.getState().ovl.forms[field.formType][field.formId]\r\n let functionName = HookLookupsRefresh\r\n let fn = ovl.getActions().app.features[formState.feature]\r\n if (fn?.hooks?.[functionName]) {\r\n let lookupsState = fn.hooks[functionName]({\r\n formState,\r\n tableDefId: formState.tableDefId,\r\n })\r\n if (!lookupsState) {\r\n return\r\n }\r\n lookupsState[field.list.valueField].data = {}\r\n field.list._state.lastRefreshTimestamp = 0\r\n }\r\n}\r\n\r\nexport const _setFieldTouched = (field: SYSField, touched: boolean) => {\r\n if (field.touched !== touched) {\r\n ovl.getActions().ovl.internal._SetFieldTouched({ field, touched })\r\n }\r\n}\r\n\r\nexport const _setFieldWatched = (field: SYSField, watched: boolean) => {\r\n if (field.watched !== watched) {\r\n ovl.getActions().ovl.internal._WatchField({ field, watched })\r\n setVisibleValidation(ovl.getState().ovl.forms[field.formType][field.formId])\r\n }\r\n}\r\n\r\nexport const _setFieldFocus = (field: SYSField, focus: boolean) => {\r\n if (field.hasFocus !== focus) {\r\n ovl.getActions().ovl.internal._FocusField({ field, hasFocus: focus })\r\n }\r\n}\r\n\r\nexport const _setFieldVisibility = (\r\n field: SYSField,\r\n visible: ControlVisiblity\r\n) => {\r\n if (\r\n field.ui.visible === visible ||\r\n (field._state.closing && visible === \"fadeOut\")\r\n ) {\r\n return\r\n }\r\n field.ui.visible = visible\r\n // if field disappears it will be watched false (because it could reappear but user didnt see it)\r\n if (visible === \"false\" || visible === \"fadeOut\") {\r\n _setFieldWatched(field, false)\r\n }\r\n\r\n let el = document.getElementById(\"ovl_\" + field.id)\r\n if ((!field._state.visible || field._state.closing) && visible === \"fadeIn\") {\r\n if (field.inactive) {\r\n field.inactive = false\r\n }\r\n if (el) {\r\n el.classList.remove(\"fadeOutControl\")\r\n el.classList.remove(\"ovl-hideControl\")\r\n el.classList.add(\"fadeInControl\")\r\n // if (focus) {\r\n // setTimeout(() => {\r\n // SetFocus(field.id)\r\n // }, 200)\r\n // }\r\n } else {\r\n // we are accessing the el from another screen probably. so el is not defined...no fadeIn required just set to true\r\n // same below for fadeOut from another screen...\r\n field._state.visible = true\r\n }\r\n } else if (visible === \"true\") {\r\n if (field.inactive) {\r\n field.inactive = false\r\n }\r\n\r\n if (el) {\r\n el.classList.remove(\"fadeInControl\")\r\n el.classList.remove(\"fadeOutControl\")\r\n el.classList.remove(\"ovl-hideControl\")\r\n }\r\n field._state.visible = true\r\n\r\n // if (focus) {\r\n // setTimeout(() => {\r\n // SetFocus(field.id)\r\n // }, 200)\r\n // }\r\n } else if (field._state.visible && visible === \"fadeOut\") {\r\n if (el) {\r\n el.classList.remove(\"fadeInControl\")\r\n el.classList.add(\"fadeOutControl\")\r\n } else {\r\n field._state.visible = false\r\n }\r\n } else if (visible === \"false\") {\r\n if (el) {\r\n el.classList.remove(\"fadeInControl\")\r\n el.classList.remove(\"fadeOutControl\")\r\n\r\n el.classList.add(\"ovl-hideControl\")\r\n }\r\n field._state.visible = false\r\n }\r\n}\r\n\r\nexport const _resetValidationForContext = (\r\n formState: SYSFormState,\r\n field: SYSField,\r\n context: ValidationResetContext\r\n) => {\r\n let fields = formState.fields\r\n Object.keys(fields).forEach((k) => {\r\n if (k === field.fieldKey) {\r\n return\r\n }\r\n let _field = fields[k]\r\n let indexesToDelete: Set = new Set()\r\n _field.validationResult[context].forEach((v, i) => {\r\n if (v.handledFieldKeys) {\r\n v.handledFieldKeys.forEach((k) => {\r\n if (k === field.fieldKey) {\r\n indexesToDelete.add(i)\r\n }\r\n })\r\n }\r\n })\r\n if (indexesToDelete.size > 0) {\r\n _field.validationResult[context] = field.validationResult[context].filter(\r\n (f, i) => !indexesToDelete.has(i)\r\n )\r\n }\r\n })\r\n field.validationResult[context] = []\r\n}\r\n\r\nexport const _FieldListBustCache = (field: SYSField) => {\r\n if (!field?._state) {\r\n return\r\n }\r\n let formState: SYSFormState =\r\n ovl.getState().ovl.forms[field.formType][field.formId]\r\n let cacheKey = _GetFieldListCacheKey(\r\n field.fieldKey,\r\n formState.tableDefId,\r\n formState\r\n )\r\n _cachedFieldLists.set(cacheKey, undefined)\r\n}\r\n","import { ovl, SYSConfig, SYSForm, SYSFormValidationValidators } from \"../../\"\r\nimport { getDateISOString, getDateValue } from \"../../global/globals\"\r\nimport { HookLookupsRefresh, HookLookupsRefresh_Type } from \"../../global/hooks\"\r\nimport { _GetFieldList, getDisplayValue, getListValue } from \"../table/helpers\"\r\nimport type { ListDefinition } from \"../table/table\"\r\nimport type { SYSField, SYSFormState } from \"./actions\"\r\nimport { _ValidateField } from \"./actions\"\r\nimport { FormGet, IsFieldValidOptions } from \"./formapi\"\r\n\r\nimport {\r\n GetRowFromFormState,\r\n KeyValueListFromServerFn,\r\n} from \"./controls/helpers\"\r\n\r\nimport { _clearFieldList, _setFieldInactive } from \"./helper\"\r\n\r\nimport { FocusSet } from \"../../global/globalapi\"\r\nimport { _setFormValid, setVisibleValidation } from \"./validators\"\r\n\r\nexport type SetFieldStateMode =\r\n | \"visible/notvisible\"\r\n | \"readonly/notvisible\"\r\n | \"visible/readonly\"\r\nexport type FieldSetStateOptionsType = {\r\n animate?: \"fade\" | \"none\"\r\n mode?: SetFieldStateMode\r\n focusWhenVisible?: boolean\r\n focusForce?: boolean\r\n selectIfFocusSet?: boolean\r\n forceValueWhenInactive?: any\r\n forceValue?: any\r\n forceWatched?: boolean\r\n keepValidation?: boolean\r\n clearList?: boolean\r\n noRetrigger?: boolean\r\n}\r\n\r\nexport type SYSFields = { [key in string]: SYSField }\r\n\r\nexport const FieldValidate = async (field: SYSField) => {\r\n if (!field?._state || field._state.removedAndIrrelevantInCurrentSituation) {\r\n return\r\n }\r\n if (field.list) {\r\n field.value = field.convertedValue\r\n }\r\n let formState = FormGet(field.formType, {\r\n instance: field.formId,\r\n }).formState\r\n _ValidateField(field, formState, ovl.getActions())\r\n //setVisibleValidation(formState)\r\n}\r\n\r\nexport const FieldInitMandatory = async (\r\n field: SYSField,\r\n mandatoryValidator: SYSFormValidationValidators\r\n) => {\r\n // allow user to set a field mandatory by config in forminit\r\n // restricted to init process by now because other usages need testing\r\n\r\n if (!field?._state || field._state.removedAndIrrelevantInCurrentSituation) {\r\n return\r\n }\r\n if (field._state.fieldInitialValidated) {\r\n throw Error(\r\n `SYS Error: FieldInitMandatory only in Init possible. Field: ${field.fieldKey}`\r\n )\r\n }\r\n field.schema.nullable = false\r\n field.schema.nullValidatorToUse = mandatoryValidator\r\n}\r\n\r\nexport const FieldSetState = async (\r\n field: SYSField,\r\n active: boolean,\r\n options?: FieldSetStateOptionsType\r\n) => {\r\n if (!field?._state || field._state.removedAndIrrelevantInCurrentSituation) {\r\n return\r\n }\r\n // let valueToSetWhenInactive\r\n // let valueToSet\r\n // if (options) {\r\n // if (options.hasOwnProperty(\"forceValueWhenInactive\")) {\r\n // valueToSetWhenInactive = { val: options.forceValueWhenInactive }\r\n // }\r\n // if (options.hasOwnProperty(\"forceValue\")) {\r\n // valueToSet = { val: options.forceValue }\r\n // }\r\n // }\r\n await _setFieldInactive(\r\n field,\r\n !active,\r\n options?.animate,\r\n options?.mode,\r\n options?.focusWhenVisible,\r\n false,\r\n options?.forceValueWhenInactive,\r\n options?.forceValue,\r\n options?.keepValidation,\r\n options?.clearList,\r\n options?.focusForce,\r\n options?.selectIfFocusSet,\r\n options?.noRetrigger\r\n )\r\n}\r\n\r\nexport const FieldReset = async (\r\n field: SYSField,\r\n clearValue: boolean = false\r\n) => {\r\n if (!field?._state) {\r\n return\r\n }\r\n let formState: SYSFormState =\r\n ovl.getState().ovl.forms[field.formType][field.formId]\r\n\r\n field = JSON.parse(JSON.stringify(formState.initFields[field.fieldKey]))\r\n field._state._files = undefined\r\n // in either case trigger a setval which triggers validation\r\n if (clearValue) {\r\n await FieldSetVal(field, null, { watched: false })\r\n } else {\r\n await FieldSetVal(field, field.value, { watched: false })\r\n }\r\n setVisibleValidation(formState)\r\n}\r\n\r\nexport type SetFieldValueOptions = {\r\n debounce?: number\r\n /* todo try to get rid of those \r\n and use isCorrected instead?\r\n */\r\n ignoreCustomValidation?: boolean\r\n ignoreValueChanged?: boolean\r\n /* -- */\r\n\r\n watched?: boolean\r\n forceChanged?: boolean\r\n clearList?: boolean\r\n setFocus?: boolean\r\n noRetrigger?: boolean\r\n}\r\ntype _FieldForceChange = {\r\n watched?: boolean\r\n setFocus?: boolean\r\n}\r\nexport const FieldForceChange = async (\r\n field: SYSField,\r\n options?: _FieldForceChange\r\n) => {\r\n if (!field?._state) {\r\n return\r\n }\r\n FieldSetVal(field, FieldVal(field), {\r\n forceChanged: true,\r\n watched: options?.watched,\r\n setFocus: options?.setFocus,\r\n })\r\n}\r\n\r\ntype FieldSetForceChangeOptions = {\r\n setFocus?: boolean\r\n}\r\n\r\nexport const FieldSetForceChange = async (\r\n field: SYSField,\r\n options?: FieldSetForceChangeOptions\r\n) => {\r\n if (!field?._state) {\r\n return\r\n }\r\n field._state.forceChange = true\r\n if (options?.setFocus) {\r\n FieldSetFocus(field)\r\n }\r\n}\r\nlet fieldSetValDebounce = {}\r\nexport const FieldSetVal = async (\r\n field: SYSField,\r\n value: any,\r\n options?: SetFieldValueOptions\r\n) => {\r\n if (!field?._state || field._state.removedAndIrrelevantInCurrentSituation) {\r\n // don't do anything if field is irrelevant\r\n return\r\n }\r\n if (options?.debounce !== undefined) {\r\n // we need to remember if we were in init mode when calling setFieldVal debounced\r\n let formState: SYSFormState =\r\n ovl.getState().ovl.forms[field.formType][field.formId]\r\n if (!formState) {\r\n return\r\n }\r\n let wasInit = formState.firstInitOrSituationChanged\r\n\r\n if (fieldSetValDebounce[field.fieldKey] !== undefined) {\r\n clearTimeout(fieldSetValDebounce[field.fieldKey])\r\n }\r\n fieldSetValDebounce[field.fieldKey] = setTimeout(async () => {\r\n try {\r\n formState._state._fieldSetValFromDebouncedInit = wasInit\r\n await _fieldSetVal(field, value, options)\r\n } finally {\r\n formState._state._fieldSetValFromDebouncedInit = false\r\n }\r\n }, options.debounce)\r\n } else {\r\n await _fieldSetVal(field, value, options)\r\n }\r\n}\r\n\r\nconst _fieldSetVal = async (\r\n field: SYSField,\r\n value: any,\r\n options?: SetFieldValueOptions\r\n) => {\r\n let formState: SYSFormState =\r\n ovl.getState().ovl.forms[field.formType][field.formId]\r\n if (!formState) {\r\n return\r\n }\r\n if (value === undefined) {\r\n value = null\r\n }\r\n\r\n if (value && field.type === \"date\" && typeof value.getMonth === \"function\") {\r\n // its a date already\r\n value = getDateISOString(value)\r\n value = getDateValue(value)\r\n } else if (\r\n field.type === \"datetime\" &&\r\n value !== undefined &&\r\n value !== null &&\r\n value.length > 16\r\n ) {\r\n value = value.replace(\"+00:00\", \"Z\")\r\n let dt = new Date(value)\r\n let t = dt.getTimezoneOffset()\r\n var offsetTime = new Date(dt.getTime() - t * 60 * 1000)\r\n value = offsetTime.toISOString().substring(0, 16)\r\n }\r\n if (options?.forceChanged) {\r\n field._state.forceChange = true\r\n }\r\n\r\n await ovl.getActions().ovl.form._ChangeField({\r\n fieldKey: field.fieldKey,\r\n formState,\r\n value,\r\n watched: options?.watched,\r\n ignoreCustomValidation: options?.ignoreCustomValidation,\r\n ignoreValueChanged: options?.ignoreValueChanged,\r\n isInnerEvent: false,\r\n noRetrigger: options?.noRetrigger,\r\n })\r\n if (options?.clearList) {\r\n _clearFieldList(field)\r\n }\r\n if (options?.setFocus) {\r\n FieldSetFocus(field)\r\n }\r\n}\r\n\r\nexport const FieldIsValid = (field: SYSField) => {\r\n if (field === undefined || !field._state.fieldInitialValidated) {\r\n return false\r\n }\r\n // we need to check if we are within ChangeField resp. FormInit Process\r\n // because if yes the we have Hooks that get called in between (Before Setting Field.valid)\r\n // and therefore we should check the whole thing\r\n // i was thinking of setting field.valid before every hook call.\r\n // but imo that wouldn't work if we SetFieldValue of another field in that hook and so on\r\n // so its a safe bet to just use the full shabang as it was before introducing this .valid check\r\n // (remember .valid checking and therefore tracking only .valid makes perfectly sense for outside compss depending on field validity)\r\n if (\r\n (ovl.getState().ovl.forms[field.formType][field.formId])\r\n ._state._inInitOrChangedCount > 0\r\n ) {\r\n return FieldIsValidSelective(field)\r\n }\r\n return field.valid\r\n}\r\n\r\nexport const FieldIsValidSelective = (\r\n field: SYSField,\r\n options?: IsFieldValidOptions\r\n) => {\r\n if (field === undefined || !field._state.fieldInitialValidated) {\r\n return false\r\n }\r\n if (field.inactive && !field.inactiveButRelevantForValidation) {\r\n return true\r\n }\r\n\r\n let allValidation = []\r\n if (!options?.ignoreSystemValidations) {\r\n allValidation = allValidation.concat(field.validationResult.System)\r\n }\r\n if (!options?.ignoreValidateValidations) {\r\n allValidation = allValidation.concat(field.validationResult.Validate)\r\n }\r\n\r\n if (!options?.ignoreValueChangedValidations) {\r\n allValidation = allValidation.concat(field.validationResult.ValueChanged)\r\n }\r\n if (options?.ignoreValidationKeys) {\r\n allValidation = allValidation.filter(\r\n (f) => options?.ignoreValidationKeys.indexOf(f.translationKey) < 0\r\n )\r\n }\r\n return allValidation.length === 0\r\n}\r\n\r\nexport const FieldIsFocused = (field: SYSField) => {\r\n if (!field?._state || field._state.removedAndIrrelevantInCurrentSituation) {\r\n return false\r\n }\r\n return field.hasFocus\r\n}\r\n\r\nexport const FieldIsVisible = (field: SYSField) => {\r\n if (!field?._state || field._state.removedAndIrrelevantInCurrentSituation) {\r\n return false\r\n }\r\n return field._state.visible\r\n}\r\n\r\nexport const FieldIsTouched = (field: SYSField) => {\r\n if (!field?._state || field._state.removedAndIrrelevantInCurrentSituation) {\r\n return false\r\n }\r\n return field.touched\r\n}\r\n\r\nexport const FieldIsVisibleOrFillsSpace = (field: SYSField) => {\r\n return field?.ui?.fillSpaceIfNotVisible || FieldIsVisible(field)\r\n}\r\n\r\nexport const FieldIsDirty = (field: SYSField) => {\r\n if (!field?._state || field._state.removedAndIrrelevantInCurrentSituation) {\r\n return false\r\n }\r\n return field.dirty\r\n}\r\n\r\nexport const FieldIsNothing = (field: SYSField) => {\r\n if (field === undefined) {\r\n return true\r\n }\r\n return field.convertedValue === undefined || field.convertedValue === null\r\n}\r\n\r\nexport const FieldIsEmpty = (field: SYSField) => {\r\n return FieldIsNothing(field) || field.convertedValue === \"\"\r\n}\r\n\r\nexport const FieldIsActive = (field: SYSField) => {\r\n if (!field?._state || field._state.removedAndIrrelevantInCurrentSituation) {\r\n return false\r\n }\r\n return !field.inactive\r\n}\r\n\r\nexport const FieldIsWatched = (field: SYSField) => {\r\n if (field === undefined) {\r\n return false\r\n }\r\n return field.watched\r\n}\r\n\r\nexport interface FieldValueOptionsType {\r\n useDisplayValue?: boolean\r\n mode?: \"RawCurrent\" | \"Converted\"\r\n lookupColumnKey?: string\r\n ignoreValidationKeys?: string[]\r\n}\r\n\r\nexport interface FieldByKeyValueOptionsType extends FieldValueOptionsType {\r\n instance?: string\r\n}\r\n\r\nexport const FieldSetFocus = (field: SYSField, forceSelect?: boolean) => {\r\n if (!field?._state) {\r\n return\r\n }\r\n if (document.getElementById(field.id)) {\r\n FocusSet(field.id, { forceSelect })\r\n } else {\r\n // its not visible yet (maybe we are inside form Init?)\r\n // so just set the key so it gets focused when ready\r\n ;((\r\n ovl.getState().ovl.forms[field.formType][field.formId]\r\n )).forceFocusWhenVisibleFieldKey = field.fieldKey\r\n }\r\n}\r\n\r\nexport const FieldForceSave = (field: SYSField) => {\r\n if (!field?._state) {\r\n return\r\n }\r\n field._state.forceSave = true\r\n}\r\n\r\nexport const FieldValByKey = (\r\n fieldKey: string,\r\n formType: SYSForm,\r\n options?: FieldByKeyValueOptionsType\r\n): any => {\r\n let instance: string = formType\r\n if (options?.instance) {\r\n instance = options?.instance\r\n }\r\n let field = ovl.getState().ovl.forms[formType][instance].fields[fieldKey]\r\n return FieldVal(field, options)\r\n}\r\n\r\n// export const FieldValidate = (field: SYSField, formState: SYSFormState) => {\r\n// if (!field?._state) {\r\n// return\r\n// }\r\n// _ValidateField(field, formState, ovl.getActions(), false)\r\n// }\r\n\r\nexport const FieldCurrentVal = (field: SYSField): any => {\r\n if (field === undefined) {\r\n return undefined\r\n }\r\n return field.value\r\n}\r\n\r\nexport const FieldVal = (\r\n field: SYSField,\r\n options?: FieldValueOptionsType\r\n): any => {\r\n if (field === undefined) {\r\n return undefined\r\n }\r\n let val\r\n let mode = options?.mode\r\n if (!mode) {\r\n if (SYSConfig._system.fieldValConvertedValueIfInvalid) {\r\n // see flag for desc\r\n mode = \"Converted\"\r\n } else {\r\n // somewhen in 2021: if going for the finished valid value but its not valid then return undefined\r\n // should help in validation to not need a IsFieldValid followed by a getVal\r\n // 2022-12-20: nopeeee -> this is the \"old\" style and will be depreceated âfter running new style successfully for a while\r\n let isValid = FieldIsValidSelective(field, {\r\n ignoreValidationKeys: options?.ignoreValidationKeys,\r\n })\r\n if (!isValid) {\r\n return undefined\r\n }\r\n }\r\n val = field.convertedValue\r\n } else if (mode === \"Converted\") {\r\n // always get converted value when request like this\r\n val = field.convertedValue\r\n } else if (mode === \"RawCurrent\") {\r\n // always get raw current value when request like this\r\n val = field.value\r\n }\r\n\r\n let useDisplayValue = options?.useDisplayValue\r\n\r\n let formState: SYSFormState =\r\n ovl.getState().ovl.forms[field.formType][field.formId]\r\n let lookupColumnKey = options?.lookupColumnKey\r\n if (useDisplayValue) {\r\n return getDisplayValue(\r\n field.fieldKey,\r\n { list: field.list, type: field.type, ui: field.ui },\r\n val,\r\n formState.feature,\r\n formState,\r\n formState.tableDefId,\r\n lookupColumnKey\r\n )\r\n } else {\r\n if (!options?.lookupColumnKey || !field.list) {\r\n return val\r\n }\r\n return getListValue(\r\n field.fieldKey,\r\n val,\r\n formState.feature,\r\n field.list,\r\n formState,\r\n lookupColumnKey\r\n )\r\n }\r\n}\r\nexport type FieldListModeType = \"Refresh\" | \"ClearAndRefresh\" | \"LocalRefresh\"\r\nexport type FieldListOptionsType = {\r\n mode?: FieldListModeType\r\n filterValue?: string\r\n forceNoSnack?: boolean\r\n notFullList?: boolean\r\n}\r\n\r\nexport const FieldCurrentList = (field: SYSField): ListDefinition => {\r\n if (!field?._state || !field.list) {\r\n return\r\n }\r\n let formState: SYSFormState =\r\n ovl.getState().ovl.forms[field.formType][field.formId]\r\n // its a local list only\r\n return _GetFieldList(\r\n undefined,\r\n field.fieldKey,\r\n formState,\r\n formState?.tableDefId,\r\n true,\r\n false\r\n )\r\n}\r\n\r\nexport const FieldList = async (\r\n field: SYSField,\r\n\r\n options?: FieldListOptionsType\r\n): Promise => {\r\n if (!field?._state || !field.list) {\r\n return\r\n }\r\n let functionName = HookLookupsRefresh\r\n let formState: SYSFormState =\r\n ovl.getState().ovl.forms[field.formType][field.formId]\r\n let fn = ovl.getActions().app.features[formState.feature]\r\n if (!fn.hooks[functionName] || !field.list.serverEndpoint) {\r\n // its a local list only\r\n let res = _GetFieldList(\r\n undefined,\r\n field.fieldKey,\r\n formState,\r\n formState?.tableDefId,\r\n true,\r\n options?.notFullList === true\r\n )\r\n //_setFieldWatched(field, false)\r\n await FieldValidate(field)\r\n // if (options?.validateField) {\r\n // await ovl.getActions().ovl.internal._ValidateList({\r\n // field,\r\n // correctedValue: undefined,\r\n // formState,\r\n // isInnerEvent: false,\r\n // value: field.convertedValue,\r\n // listData: res,\r\n // })\r\n //}\r\n\r\n return res\r\n } else {\r\n let listDataState = fn.hooks[functionName]({\r\n formState,\r\n tableDefId: formState.tableDefId,\r\n })\r\n if (!listDataState) {\r\n return\r\n }\r\n if (\r\n options?.mode !== \"LocalRefresh\" // &&\r\n // (options.notFullList !== true ||\r\n // field.list.tryGetLookupFromServerInFormInitIfNotFoundIgnoreValues ===\r\n // \"None\" ||\r\n // field.list.tryGetLookupFromServerInFormInitIfNotFoundIgnoreValues.indexOf(\r\n // options.filterValue\r\n // ) < 0)\r\n ) {\r\n let forceClear = false\r\n if (options?.mode === \"ClearAndRefresh\") {\r\n forceClear = true\r\n }\r\n await KeyValueListFromServerFn(\r\n ovl.getState(),\r\n field.list,\r\n field.fieldKey,\r\n listDataState,\r\n options?.filterValue,\r\n GetRowFromFormState(formState),\r\n formState.feature,\r\n formState.subFeature,\r\n formState.formType,\r\n formState.formId,\r\n false,\r\n options?.forceNoSnack,\r\n forceClear,\r\n options?.notFullList\r\n )\r\n }\r\n let res = _GetFieldList(\r\n undefined,\r\n field.fieldKey,\r\n formState,\r\n formState?.tableDefId,\r\n true\r\n )\r\n //_setFieldWatched(field, false)\r\n await FieldValidate(field)\r\n // await ovl.getActions().ovl.internal._ValidateList({\r\n // field,\r\n // correctedValue: undefined,\r\n // formState,\r\n // isInnerEvent: false,\r\n // value: field.convertedValue,\r\n // listData: res,\r\n // })\r\n\r\n // this is necessary because we have in BAR ACTActivities\r\n // await FieldSetVal(formState.fields.CardCode, state.ovl.user.cardCode)\r\n // -> at this stage the form IsInvalid because the cardcode is not in the list because the list is empty in that case\r\n // // we also need the List... Because we do not manually trigger it\r\n // await FieldList(formState.fields.CardCode, { notFullList: true })\r\n // -> now we expect the error from before to be gone. thats why we need the _setFormValid()\r\n // console.log(\"ScreenNavigaeInFinished formvalid:\", FormIsValid(formState))\r\n _setFormValid(formState)\r\n return res\r\n }\r\n}\r\nexport type { SYSField, SYSFormState } from \"../../library/forms/actions\"\r\nexport type { SYSFormField } from \"../../library/forms/sysformelement\"\r\nexport type { ActiveInactiveVisiblity as SYSFieldVisiblity } from \"./actions\"\r\n","import { ovl, TemplateResult } from \"../../../\"\r\nimport {\r\n getDateValue,\r\n getDecimalValue,\r\n UIContextType,\r\n} from \"../../../global/globals\"\r\nimport type {\r\n HookFieldGetEditHint_ReturnType,\r\n HookFieldGetEditHint_Type,\r\n HookFieldGetLabelRender_Type,\r\n HookFieldGetList_ReturnType,\r\n HookFieldLookupPostRefresh_Type,\r\n HookLookupRowRefreshed_Type,\r\n} from \"../../../global/hooks\"\r\nimport {\r\n HookFieldGetEditHint,\r\n HookFieldGetLabelRender,\r\n HookFieldGetList,\r\n HookFieldLookupPostRefresh,\r\n HookLookupRowRefreshed,\r\n} from \"../../../global/hooks\"\r\n\r\nimport type { SYSFeature, SYSState } from \"../../../index\"\r\nimport {\r\n _GetFieldList,\r\n CachedRendererData,\r\n GetRendererFn,\r\n} from \"../../table/helpers\"\r\n\r\nimport type {\r\n ColumnDisplayDef,\r\n DisplayMode,\r\n EditDisplayMode,\r\n ListDefinition,\r\n LookupsType,\r\n} from \"../../table/table\"\r\nimport type { SYSField, SYSFormState } from \"../actions\"\r\n\r\nimport { AppDefProcess } from \"../../../config\"\r\nimport { Data } from \"../../../dataapi\"\r\nimport {\r\n ProcessEnd,\r\n ProcessIsRunning,\r\n ProcessStart,\r\n} from \"../../longrunningprocesstracker/processapi\"\r\nimport { ScreenCurrent, ScreenCurrentState } from \"../../screenapi\"\r\nimport { FieldForceChange } from \"../fieldapi\"\r\nimport { _setFieldFocus } from \"../helper\"\r\nimport type { ListState } from \"./listcontrol\"\r\n\r\nexport const _focusOutHelper = (e: Event, field: SYSField) => {\r\n //@ts-ignore\r\n if (e.relatedTarget && e.relatedTarget.id.indexOf(\"SYSEditCancel\") > -1) {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n /*@ts-ignore*/\r\n } else if (e.relatedTarget !== \"SYSNavigateBack\") {\r\n _setFieldFocus(field, false)\r\n\r\n if (field._state.forceChange) {\r\n FieldForceChange(field)\r\n }\r\n }\r\n}\r\n\r\nexport type LookupListPostData = {\r\n url: string\r\n filterValue: string\r\n uiContext: UIContextType\r\n paramList?: { [key: string]: {} }\r\n notFullList?: boolean\r\n}\r\n\r\nexport const KeyValueListFromServerFn = async (\r\n state: SYSState,\r\n list: ListState,\r\n columnKey: string,\r\n lookupsState: LookupsType,\r\n filterValue: string,\r\n row: {},\r\n feature: SYSFeature,\r\n subFeature: string,\r\n formType: string,\r\n formId: any,\r\n //ignore timestamp, lastParam... and always issue a server req\r\n isInnerEvent?: boolean,\r\n forceNoSnack?: boolean,\r\n forceClear?: boolean,\r\n notFullList?: boolean\r\n): Promise => {\r\n try {\r\n let url = state.ovl.apiUrl + list.serverEndpoint\r\n if (filterValue === undefined) {\r\n // important because the object gets stringified for param comparison and filterValue would be completely missung if undefined...\r\n filterValue = \"\"\r\n }\r\n isInnerEvent = isInnerEvent === true\r\n\r\n let screenCurrentState = ScreenCurrentState()\r\n let uiContext: UIContextType = {\r\n feature: feature,\r\n formType,\r\n formId,\r\n screen: screenCurrentState?.screen,\r\n screenInstance: screenCurrentState?.instance,\r\n }\r\n let postData: LookupListPostData = {\r\n url,\r\n filterValue,\r\n uiContext,\r\n paramList: row,\r\n notFullList: notFullList === true,\r\n }\r\n if (!postData.paramList) {\r\n postData.paramList = {}\r\n }\r\n if (list.refreshMode === \"ClearAndRefresh\") {\r\n forceClear = true\r\n }\r\n let fieldId = list.valueField\r\n let listdata\r\n if (list.lookupDefKey) {\r\n listdata = lookupsState[list.lookupDefKey]\r\n } else {\r\n listdata = lookupsState[fieldId]\r\n }\r\n if (listdata === undefined) {\r\n throw new Error(\r\n `Ovl Error: Feature ${(\r\n feature\r\n )}, column: ${columnKey}: listdata is empty. Did you forget to add lookupKey to the listdef?`\r\n )\r\n }\r\n\r\n let ignoreRefreshLogic = false\r\n let fn = ovl.getActions().app.features[feature]\r\n let functionName = HookFieldLookupPostRefresh.replace(\r\n \"{subFeature}\",\r\n subFeature\r\n ).replace(\"{fieldKey}\", columnKey)\r\n if (fn?.hooks?.[functionName]) {\r\n let fnParam: HookFieldLookupPostRefresh_Type = {\r\n postToServerData: postData,\r\n showSnack: list.showRefreshFromServerSnack,\r\n cancelRefresh: isInnerEvent ? \"Default\" : \"ForceRefresh\",\r\n forceClear,\r\n innerEvent: isInnerEvent,\r\n info: {\r\n _row: row,\r\n _timeStamp: list._state.lastRefreshTimestamp,\r\n _lastPostToServerData: list._state.lastPostParams,\r\n },\r\n }\r\n await fn.hooks[functionName](fnParam)\r\n if (fnParam.cancelRefresh === \"Cancel\") {\r\n return listdata\r\n }\r\n\r\n if (fnParam.cancelRefresh === \"ForceRefresh\") {\r\n ignoreRefreshLogic = true\r\n }\r\n\r\n forceNoSnack = !fnParam.showSnack\r\n }\r\n\r\n let now = new Date().getTime()\r\n list._state.needsRefresh = false\r\n if (ignoreRefreshLogic) {\r\n list._state.needsRefresh = true\r\n } else {\r\n // refresh if either timestamp is old\r\n if (\r\n now - list._state.lastRefreshTimestamp >\r\n list.onlyRefreshFromServerIfOlderThanMs\r\n ) {\r\n list._state.needsRefresh = true\r\n }\r\n // or the params have changed\r\n if (!list._state.needsRefresh) {\r\n if (list._state.lastPostParams !== JSON.stringify(postData)) {\r\n list._state.needsRefresh = true\r\n }\r\n }\r\n }\r\n\r\n if (!list._state.needsRefresh) {\r\n return listdata\r\n }\r\n let options: AppDefProcess\r\n if (list.showRefreshFromServerSnack && !forceNoSnack) {\r\n options = { snack: { type: \"BusyIndicator\" } }\r\n }\r\n if (!ProcessIsRunning(\"SYSGetLookupData\")) {\r\n ProcessStart(\"SYSGetLookupData\", options)\r\n }\r\n\r\n let res = await Data(list.serverEndpoint, {\r\n filterValue: postData.filterValue,\r\n columnKey,\r\n uiContext: postData.uiContext,\r\n paramList: postData.paramList,\r\n notFullList: postData.notFullList,\r\n })\r\n // now sync the result with the local state\r\n if (res.data && res.data.data) {\r\n if (forceClear) {\r\n listdata.data = {}\r\n }\r\n list._state.lastRefreshTimestamp = now\r\n list._state.lastPostParams = JSON.stringify(postData)\r\n if (listdata.data === undefined) {\r\n listdata.data = {}\r\n list._state.lastRefreshTimestamp = 0\r\n }\r\n let localListState = listdata.data\r\n let serverData = res.data.data\r\n if (serverData && serverData.length > 0) {\r\n let ignoreNulls = listdata.nullHandling?.ignoreIfKeyIsNull\r\n // let fillWithEmpty =\r\n // listdata.nullHandling?.replaceLookupColumnsWithEmptyIfNull\r\n let keyColumns = Object.keys(listdata.lookupDef).filter(\r\n (f) => listdata.lookupDef[f].isKey === true\r\n )\r\n let keyColumn\r\n if (keyColumns.length > 0) {\r\n keyColumn = keyColumns[0]\r\n }\r\n // check mandatory lookup columns, but only do it in the first row for now\r\n let mandatoryColumns = Object.keys(listdata.lookupDef).filter(\r\n (f) => !listdata.lookupDef[f].optional\r\n )\r\n\r\n let firstRow = serverData[0]\r\n mandatoryColumns.forEach((f) => {\r\n if (firstRow[f] === undefined) {\r\n console.error(\r\n `Ovl Lookup Sync: Column ${f} (Lookupdef ${list.lookupDefKey}) not found in results from server...`\r\n )\r\n }\r\n })\r\n\r\n serverData.forEach((k) => {\r\n if (k[fieldId] === null && ignoreNulls) {\r\n return\r\n }\r\n if (!localListState[k[fieldId]]) {\r\n localListState[k[fieldId]] = {}\r\n }\r\n Object.keys(k).forEach((c) => {\r\n let val = k[c]\r\n // if (c !== keyColumn && val === null && fillWithEmpty) {\r\n // val = \"\"\r\n // }\r\n\r\n localListState[k[fieldId]][c] = val\r\n })\r\n if (fn?.hooks?.[HookLookupRowRefreshed]) {\r\n fn.hooks[HookLookupRowRefreshed]({\r\n lookupDataRow: localListState[k[fieldId]],\r\n lookupDefKey: list.lookupDefKey,\r\n })\r\n }\r\n })\r\n }\r\n }\r\n return listdata\r\n } finally {\r\n ProcessEnd(\"SYSGetLookupData\")\r\n }\r\n}\r\n\r\nexport const FilterHitList = (\r\n list: ListState,\r\n filterValue: string,\r\n formState: SYSFormState,\r\n fieldId: string,\r\n top?: number,\r\n forceCacheBust?: boolean,\r\n type?: \"inline\" | \"overlay\"\r\n): { filteredKeys: string[]; directValue?: any; directDescription?: any } => {\r\n let hitLength = {}\r\n //let functionName = FieldGetFilteredList.replace(\"%\", fieldId)\r\n\r\n let dataList: HookFieldGetList_ReturnType = _GetFieldList(\r\n ovl.getActions().app.features[formState.feature].hooks[\r\n HookFieldGetList.replace(\"{subFeature}\", formState.subFeature).replace(\r\n \"{fieldKey}\",\r\n fieldId\r\n )\r\n ],\r\n fieldId,\r\n formState,\r\n formState?.tableDefId,\r\n forceCacheBust\r\n )\r\n\r\n if (dataList.data) {\r\n let directValue\r\n let directDescription\r\n let res = Object.keys(dataList.data)\r\n let resForSelectIfEmpty = JSON.parse(JSON.stringify(res))\r\n let directKeyHits = res.filter((f) => f == filterValue)\r\n if (directKeyHits.length === 1) {\r\n directValue = directKeyHits[0]\r\n directDescription = dataList.data[directValue][list.displayField]\r\n }\r\n\r\n // // filter ignored\r\n let exact = false\r\n if (formState) {\r\n let field = formState.fields[fieldId]\r\n if (!field.list.acceptOnlyListValues) {\r\n exact = true\r\n }\r\n if (field.ui.displayEmptyIfValue !== undefined) {\r\n res = res.filter((f) => f !== field.ui.displayEmptyIfValue)\r\n }\r\n }\r\n\r\n let lookupTypes = dataList.lookupDef\r\n\r\n if (!lookupTypes) {\r\n lookupTypes = {}\r\n lookupTypes[list.displayField] = { type: \"text\" }\r\n lookupTypes[list.valueField] = { type: \"text\" }\r\n }\r\n if (!filterValue) {\r\n filterValue = \"\"\r\n }\r\n\r\n res = res.filter((f) => {\r\n if (filterValue === \"\") {\r\n return true\r\n }\r\n let checkRow = dataList.data[f]\r\n let found = false\r\n Object.keys(lookupTypes)\r\n .filter(\r\n (f) =>\r\n lookupTypes[f].ignoreForSearch !== true &&\r\n lookupTypes[f].type !== \"html\"\r\n )\r\n .forEach((c) => {\r\n let checkVal = checkRow[c]\r\n if (checkVal !== undefined) {\r\n let typ = lookupTypes[c].type\r\n if (typ === \"date\") {\r\n checkVal = getDateValue(checkVal)\r\n } else if (typ === \"decimal\") {\r\n checkVal = getDecimalValue(checkVal)\r\n }\r\n if (checkVal === null) {\r\n checkVal = \"\"\r\n }\r\n checkVal = checkVal.toString()\r\n if (!exact) {\r\n checkVal = checkVal.toLowerCase()\r\n filterValue = filterValue.toLowerCase()\r\n }\r\n console.log(`checkVal: ${checkVal}, filterValue:${filterValue}`)\r\n let idx = checkVal.indexOf(filterValue)\r\n if (idx > -1) {\r\n //let length = checkVal.length - filterValue.length\r\n if (!hitLength[f] || idx < hitLength[f]) {\r\n hitLength[f] = idx\r\n }\r\n found = true\r\n }\r\n }\r\n })\r\n return found\r\n })\r\n if (dataList.sortMode === undefined) {\r\n dataList.sortMode = \"HitLengthThenCustom\"\r\n }\r\n res = res.sort((a, b) => {\r\n let sres = 0\r\n if (dataList.sortMode === \"HitLengthThenCustom\") {\r\n sres = filterValue ? hitLength[a] - hitLength[b] : 0\r\n if (sres === 0 && dataList.sortFn !== undefined) {\r\n sres = dataList.sortFn(dataList.data[a], dataList.data[b])\r\n }\r\n } else {\r\n if (dataList.sortFn !== undefined) {\r\n sres = dataList.sortFn(dataList.data[a], dataList.data[b])\r\n }\r\n if (sres === 0) {\r\n sres = filterValue ? hitLength[a] - hitLength[b] : 0\r\n }\r\n }\r\n return sres\r\n })\r\n if (top) {\r\n res.splice(top)\r\n }\r\n\r\n if (!directValue && res.length === 1) {\r\n let refVal = dataList.data[res[0]][list.valueField]\r\n if (refVal) {\r\n directValue = refVal\r\n } else {\r\n directValue = res[0]\r\n }\r\n directDescription = dataList.data[res[0]][list.displayField]\r\n }\r\n if (res.length === 0 && list.mode === \"Select\" && type === \"overlay\") {\r\n res = resForSelectIfEmpty\r\n }\r\n return { filteredKeys: res, directValue, directDescription }\r\n }\r\n return { filteredKeys: [] }\r\n}\r\n\r\nexport const _GetListValue = (\r\n list: ListState,\r\n value: string,\r\n listdata: ListDefinition,\r\n lookupColumnKey?: string,\r\n useDisplayValue?: boolean\r\n) => {\r\n let displayField = lookupColumnKey\r\n ? lookupColumnKey\r\n : useDisplayValue\r\n ? list.displayField\r\n : list.valueField\r\n // was let listValue = value before. Ruuning into issues when eg. usecase BPFilter BAR FieldVal(\"CardCode\", {lookupColumn:\"CardType\"}) was returning CardCode\r\n let listValue = displayField !== list.valueField ? null : value\r\n if (listdata.data) {\r\n if (listdata.data[value]) {\r\n listValue = listdata.data[value][displayField]\r\n } else if (!list.acceptOnlyListValues) {\r\n listValue = value\r\n }\r\n }\r\n return listValue\r\n}\r\n\r\nexport const GetRowFromFormState = (formState: SYSFormState) => {\r\n //pauseTracking()\r\n //try {\r\n let fields = formState.fields\r\n let row = formState.row\r\n\r\n let fieldKeys = []\r\n let rowKeys = []\r\n if (row) {\r\n rowKeys = Object.keys(row)\r\n }\r\n fieldKeys = Object.keys(fields)\r\n\r\n let allKeys = [...new Set([...rowKeys, ...fieldKeys])]\r\n\r\n return allKeys.reduce((val, k) => {\r\n if (fields[k]) {\r\n val[k] = fields[k].convertedValue\r\n } else {\r\n if (row) {\r\n val[k] = row[k]\r\n }\r\n }\r\n return val\r\n }, {})\r\n // } finally {\r\n // //resumeTracking()\r\n // }\r\n}\r\n\r\nexport let cachedValueRendererFn: Map = new Map<\r\n string,\r\n CachedRendererData\r\n>()\r\n\r\nexport let cachedRendererFn: Map = new Map<\r\n string,\r\n CachedRendererData\r\n>()\r\n\r\nexport const GetValueFromCustomFunction = (\r\n row: { [key: string]: {} },\r\n field: SYSField,\r\n formState: SYSFormState,\r\n align: string,\r\n\r\n state: SYSState\r\n): TemplateResult | TemplateResult[] | string => {\r\n let rendererFn = GetRendererFn(\r\n formState.feature,\r\n cachedValueRendererFn,\r\n HookFieldGetEditHint.replace(\"{subFeature}\", formState.subFeature),\r\n field.fieldKey\r\n )\r\n if (rendererFn) {\r\n let val: HookFieldGetEditHint_ReturnType = rendererFn(<\r\n HookFieldGetEditHint_Type\r\n >{\r\n row,\r\n align,\r\n field,\r\n formState,\r\n displayMode: formState.isInline\r\n ? \"EditInline\"\r\n : \"Edit\",\r\n })\r\n if (val !== undefined) {\r\n return val\r\n }\r\n }\r\n return null\r\n}\r\n\r\n// const fillReactiveRows = (\r\n// originalRow: { [key: string]: {} },\r\n// formState: SYSFormState\r\n// ): { [key: string]: {} } => {\r\n// let row = {}\r\n// if (originalRow !== undefined) {\r\n// row = JSON.parse(JSON.stringify(originalRow), stringifyReplacer)\r\n// }\r\n// Object.keys(formState.fields).forEach((f) => {\r\n// let field = formState.fields[f]\r\n// row[field.fieldKey] = field.convertedValue\r\n// })\r\n// return row\r\n// }\r\n\r\nexport const getColumnDefsFromFormState = (\r\n formState: SYSFormState\r\n): { [key: string]: ColumnDisplayDef } => {\r\n let colDisplayDefs = Object.keys(formState.fields).reduce((val, f) => {\r\n let field = formState.fields[f]\r\n let res: ColumnDisplayDef = {\r\n list: field.list,\r\n ui: field.ui,\r\n type: field.type,\r\n }\r\n val[field.fieldKey] = res\r\n return val\r\n }, {})\r\n return colDisplayDefs\r\n}\r\n\r\nexport const GetFieldLabel = (\r\n field: SYSField,\r\n feature: SYSFeature,\r\n caption: string\r\n): any => {\r\n let formState = ovl.getState().ovl.forms[field.formType][field.formId]\r\n if (!formState) {\r\n return\r\n }\r\n let state = ovl.getState()\r\n let rendererFn = GetRendererFn(\r\n feature,\r\n cachedRendererFn,\r\n HookFieldGetLabelRender.replace(\"{subFeature}\", formState.subFeature),\r\n field.fieldKey\r\n )\r\n\r\n if (rendererFn) {\r\n let labelRender = rendererFn({\r\n columnKey: field.fieldKey,\r\n caption,\r\n align: field.ui.align,\r\n formState,\r\n displayMode: \"Edit\",\r\n state,\r\n })\r\n\r\n if (labelRender !== undefined) {\r\n if (labelRender.res !== undefined) {\r\n caption = labelRender.res\r\n }\r\n if (labelRender.valueRaw !== undefined) {\r\n field.ui.labelCaption = labelRender.valueRaw\r\n }\r\n }\r\n }\r\n\r\n return caption\r\n}\r\n","import type { SYSActions, SYSState } from \"..\"\r\nimport { ovl } from \"..\"\r\n\r\ntype ReactorsValueType = {\r\n fn: (context: ReactorFnState) => ReactorReturnType\r\n debounce: {\r\n debounceMS?: number\r\n timeoutHandle?: any\r\n }\r\n}\r\nexport let reactors = new Map()\r\nexport type ReactorFnState = {\r\n state: SYSState\r\n actions: SYSActions\r\n hitPath: string\r\n value: any\r\n}\r\n\r\nexport const RemoveGlobalReactor = (paths: string[]) => {\r\n paths.map((m) => reactors.delete(m))\r\n}\r\n\r\nexport const AddGlobalReactor = (\r\n paths: string[],\r\n cb: (context: ReactorFnState) => any,\r\n debounceMS: number = 0\r\n) => {\r\n let debounce = { debounceMS }\r\n paths.forEach((p) => {\r\n let exist: ReactorsValueType[] = reactors.get(p)\r\n if (exist) {\r\n exist.push({ fn: cb, debounce })\r\n } else {\r\n exist = [{ fn: cb, debounce }]\r\n }\r\n // make sure debounced onces gets called last\r\n exist.sort((a, b) => a.debounce.debounceMS - b.debounce.debounceMS)\r\n reactors.set(p, exist)\r\n })\r\n}\r\n\r\nexport type ReactorReturnType = { cancel?: boolean; newValue?: any }\r\n\r\nexport const handleReactor = (path: string, value): ReactorReturnType => {\r\n let reactorvalues = reactors.get(path)\r\n if (reactorvalues) {\r\n let retValue: ReactorReturnType = { cancel: undefined, newValue: undefined }\r\n reactorvalues.forEach((reactor) => {\r\n if (reactor.debounce.debounceMS !== 0) {\r\n clearTimeout(reactor.debounce.timeoutHandle)\r\n reactor.debounce.timeoutHandle = setTimeout(async () => {\r\n if (retValue.cancel) {\r\n return\r\n }\r\n await reactor.fn({\r\n actions: ovl.getActions(),\r\n\r\n state: ovl.getState(),\r\n hitPath: path,\r\n value: retValue.newValue ? retValue.newValue : value,\r\n })\r\n }, reactor.debounce.debounceMS)\r\n } else {\r\n let res = reactor.fn({\r\n actions: ovl.getActions(),\r\n\r\n state: ovl.getState(),\r\n hitPath: path,\r\n value,\r\n })\r\n if (res?.cancel) {\r\n retValue.cancel = true\r\n }\r\n if (res?.newValue !== undefined) {\r\n retValue.newValue = res.newValue\r\n }\r\n }\r\n })\r\n return retValue\r\n }\r\n}\r\n","import { ovl } from \"..\"\r\nimport { resolvePath } from \"../global/globals\"\r\nimport { SYSBaseElement } from \"../library/sysbaseelement\"\r\nimport { actionTracking } from \"./proxyhandler\"\r\n\r\nimport { reactors } from \"./reactor\"\r\nexport let callbacks = new WeakMap()\r\nexport let paths = new Map()\r\n// export let activeCallback: SYSBaseElement | undefined\r\n\r\n// let noTracking: boolean = false\r\n\r\nlet activeComponents = []\r\nexport let _RenderTracking = {\r\n currentComponent: undefined,\r\n pauseTracking: false,\r\n totalCompRendered: 0,\r\n}\r\n\r\nexport const startTrack = (cb: SYSBaseElement) => {\r\n //console.log(\"startTrack \", cb)\r\n _RenderTracking.currentComponent = cb\r\n _RenderTracking.pauseTracking = false\r\n}\r\n\r\nexport const stopTrack = () => {\r\n _RenderTracking.pauseTracking = true\r\n _RenderTracking.currentComponent = undefined\r\n}\r\n\r\nexport const pauseTracking = () => {\r\n _RenderTracking.pauseTracking = true\r\n}\r\n\r\nexport const resumeTracking = () => {\r\n _RenderTracking.pauseTracking = false\r\n}\r\n\r\nexport const disposeTrack = (cb: SYSBaseElement) => {\r\n // get all paths and remove from there as well\r\n\r\n let pathsSet = callbacks.get(cb)\r\n if (pathsSet) {\r\n pathsSet.forEach((path: string) => {\r\n pathsSet.delete(path)\r\n let pathsCallbackSet = paths.get(path)\r\n pathsCallbackSet.delete(cb)\r\n if (pathsCallbackSet.size === 0) {\r\n paths.delete(path)\r\n }\r\n })\r\n }\r\n callbacks.delete(cb)\r\n}\r\n\r\nexport const logTrackingList = () => {\r\n console.log(\"tracking information\")\r\n console.log(\"components:\")\r\n console.log(callbacks)\r\n console.log(\"paths:\")\r\n console.log(paths)\r\n console.log(\"reactors:\")\r\n console.log(reactors)\r\n}\r\n\r\nexport const testReactorsPaths = () => {\r\n for (const key of reactors.keys()) {\r\n console.log(key)\r\n let res = resolvePath(ovl.getState(), key)\r\n if (res === undefined) {\r\n console.log(\"%cUndefined\", \"color:red\")\r\n } else {\r\n console.log(\"%cOk\", \"color:green\", \"Current Value:\", res)\r\n }\r\n }\r\n}\r\n\r\n// export const pauseTracking = () => {\r\n// noTracking = true\r\n// }\r\n\r\n// export const resumeTracking = () => {\r\n// noTracking = false\r\n// }\r\n\r\nexport const isTracking = () => {\r\n return (\r\n _RenderTracking.currentComponent !== undefined &&\r\n _RenderTracking.pauseTracking === false /*&&\r\n actionTracking.actionRunning === false */\r\n ) //!noTracking && activeCallback !== undefined\r\n}\r\n\r\nexport const addTrackedPath = (path: string) => {\r\n let currentComp = _RenderTracking.currentComponent\r\n // if (\r\n // path.indexOf(\"CERGlobalGAP_OvlSep_ForceRenew_OvlSep_Multi\") > -1 &&\r\n // path.indexOf(\"lockedTableKeys\") > -1\r\n // ) {\r\n // console.log(currentComp)\r\n // }\r\n\r\n // if (\r\n // path.indexOf(\r\n // \"ACTActivities6_OvlSep_ExternalUseSendNotification_OvlSep_Multi\"\r\n // ) > -1 &&\r\n // path.indexOf(\"lockedTableKeys\") > -1\r\n // ) {\r\n // console.log(currentComp)\r\n // }\r\n\r\n if (currentComp !== undefined) {\r\n let compPaths = callbacks.get(currentComp)\r\n if (compPaths === undefined) {\r\n compPaths = new Set()\r\n callbacks.set(currentComp, compPaths)\r\n }\r\n compPaths.add(path)\r\n if (!paths.has(path)) {\r\n paths.set(path, new Set())\r\n }\r\n paths.get(path).add(currentComp)\r\n }\r\n}\r\n","import type {\r\n _ColumnAlign,\r\n _ColumnVisibility,\r\n _RebuildType,\r\n ColumnDisplayDef,\r\n DisplayMode,\r\n ListDefinition,\r\n OvlSysColumn,\r\n RowFnTrackingInterval,\r\n RowFunctionResultToSet,\r\n Sort,\r\n SYSTableData,\r\n SYSTableDef,\r\n TableDataAndDef,\r\n} from \"./table\"\r\n\r\nimport type { SYSFormState } from \"../forms/actions\"\r\nimport type { ListState } from \"../forms/controls/listcontrol\"\r\nimport type {\r\n _ClientConversion,\r\n DataType,\r\n FieldFormat,\r\n LookupResultDataType,\r\n SYSFormField,\r\n} from \"../forms/sysformelement\"\r\nimport type { RowControlAllAction } from \"./rowcontrol\"\r\n\r\nimport {\r\n FormFnCan_Visibility,\r\n HookFieldGetList_ReturnType,\r\n HookFieldGetValueRender_ReturnType,\r\n HookFieldGetValueRender_Type,\r\n HookFormCustomControlRender,\r\n HookFormCustomControlRender_Type,\r\n HookFormGetBodyRender,\r\n HookFormGetBodyRender_ReturnType,\r\n HookFormGetBodyRender_Type,\r\n HookLookupRowRefreshed,\r\n HookLookupRowRefreshed_Type,\r\n HookLookupsRefresh_Type,\r\n HookTableCustomFilter_Type,\r\n HookTableCustomSort_ReturnType,\r\n HookTableCustomSort_Type,\r\n HookTableFilterSortSettingsDifferentiator,\r\n HookTableFilterSortSettingsDifferentiator_ReturnType,\r\n HookTableFilterSortSettingsDifferentiator_Type,\r\n HookTableGroupSortValue,\r\n HookTableInit,\r\n HookTableRowAttributesGetAttributes,\r\n HookTableRowAttributesGetAttributes_Type,\r\n HookTableRowFn_Type,\r\n HookTableRowFnCan_Type,\r\n HookTableRowFnConfirm,\r\n HookTableRowFnConfirm_Type,\r\n HookTableRowFnConfirmToSet_Type,\r\n HookTableServerBeforeMergeRow_ReturnType,\r\n HookTableServerBeforeMergeRow_Type,\r\n HookTableSetColumnVisibility,\r\n HookTableSetColumnVisibility_Type,\r\n RowFnConfirmContentFieldsReset_Type,\r\n ServerData_ChangedType,\r\n TableRowFnProcessRawFeedbackSummaryCount_Type,\r\n} from \"../../global/hooks\"\r\n\r\nimport type {\r\n SYSActions,\r\n SYSFeature,\r\n SYSForm,\r\n SYSLongRunningProcess,\r\n SYSState,\r\n SYSTableDefIds,\r\n} from \"../../index\"\r\n\r\nimport { html, ovl, SYSConfig } from \"../../\"\r\nimport { cachedRendererFn } from \"./table\"\r\n\r\nimport {\r\n _HasPermission,\r\n getDateValue,\r\n getDecimalValue,\r\n getIntegerValue,\r\n getOnlyDateISOString,\r\n isMobile,\r\n isTouch,\r\n stringifyReplacer,\r\n T,\r\n UIContextType,\r\n} from \"../../global/globals\"\r\nimport {\r\n HookFieldGetList,\r\n HookFieldGetValueRender,\r\n HookLookupsRefresh,\r\n HookTableCustomFilter,\r\n HookTableCustomSort,\r\n HookTableGroupValue,\r\n HookTableRowFn,\r\n HookTableRowFnCan,\r\n} from \"../../global/hooks\"\r\n\r\nimport { _GetListValue } from \"../forms/controls/helpers\"\r\nimport {\r\n ProcessIsRunning,\r\n ProcessStart,\r\n} from \"../longrunningprocesstracker/processapi\"\r\n\r\nimport { Data } from \"../../dataapi\"\r\nimport { FeatureInfo, SortGet } from \"../../global/globalapi\"\r\nimport { _RenderTracking } from \"../../tracker/tracker\"\r\nimport { DialogIsOpen, DialogOkCancel } from \"../dialog/dialogapi\"\r\nimport { FieldIsDirty, FieldSetVal, SYSFields } from \"../forms/fieldapi\"\r\nimport {\r\n FormGet,\r\n FormHasVisibleSummaryErrors,\r\n FormInit,\r\n FormReset,\r\n} from \"../forms/formapi\"\r\nimport {\r\n _ProcessReturnType,\r\n ProcessSnackType,\r\n} from \"../longrunningprocesstracker/longrunningprocesstracker\"\r\nimport { ScreenCurrent, ScreenCurrentState } from \"../screenapi\"\r\nimport { SnackAdd, SnackTrackedReplaceContent } from \"../snackapi\"\r\nimport {\r\n _GetTableOptions,\r\n TableAttributeFilter,\r\n TableCellVal,\r\n TableColumnFilter,\r\n TableCustomFilter,\r\n TableFormGetControl,\r\n TableGet,\r\n TableRebuild,\r\n TableStaticFilterGet,\r\n} from \"./tableapi\"\r\nimport { _LocalDataSyncType } from \"./actions\"\r\n\r\nexport let cachedListFn: Map = new Map()\r\n\r\nexport const _GetAlign = (align: _ColumnAlign) => {\r\n switch (align) {\r\n case \"center\":\r\n return \"ovlca_c\"\r\n case \"right\":\r\n return \"ovlca_r\"\r\n default:\r\n return \"\"\r\n }\r\n}\r\n\r\nexport const _GetColumnInTableVisibility = (visible: _ColumnVisibility) => {\r\n let validColumn = true\r\n if (!visible) {\r\n throw Error(\r\n \"SYS Table: Either Initialise Table first or define column.ui.visibility\"\r\n )\r\n }\r\n if (isMobile()) {\r\n if (visible.indexOf(\"TableNotMobile\") > -1) {\r\n validColumn = false\r\n }\r\n } else {\r\n if (visible.indexOf(\"TableOnlyMobile\") > -1) {\r\n validColumn = false\r\n }\r\n }\r\n if (visible.indexOf(\"Table\") < 0) {\r\n validColumn = false\r\n }\r\n return validColumn\r\n}\r\n\r\nexport const getListValue = (\r\n key: string,\r\n value: any,\r\n feature: SYSFeature,\r\n list: ListState,\r\n formState?: SYSFormState,\r\n lookupColumnKey?: string\r\n): string => {\r\n if (list && feature) {\r\n let cachedListKey =\r\n feature + (formState ? formState.subFeature : \"\") + key\r\n let listFn = cachedListFn.get(cachedListKey)\r\n if (!listFn) {\r\n listFn =\r\n ovl.getActions().app.features[feature]?.hooks?.[\r\n HookFieldGetList.replace(\r\n \"{subFeature}\",\r\n formState ? formState.subFeature : \"\"\r\n ).replace(\"{fieldKey}\", key)\r\n ]\r\n if (!listFn) {\r\n throw new Error(\r\n \"Listfunction: \" +\r\n HookFieldGetList.replace(\r\n \"{subFeature}\",\r\n formState ? formState.subFeature : \"\"\r\n ).replace(\"{fieldKey}\", key) +\r\n \" not found!\"\r\n )\r\n }\r\n cachedListFn.set(cachedListKey, listFn)\r\n }\r\n let listdata: HookFieldGetList_ReturnType = _GetFieldList(\r\n listFn,\r\n key,\r\n formState,\r\n formState?.tableDefId\r\n )\r\n\r\n value = _GetListValue(list, value, listdata, lookupColumnKey)\r\n }\r\n return value\r\n}\r\n\r\nexport const getDisplayValue = (\r\n key: string,\r\n col: ColumnDisplayDef,\r\n value: any,\r\n feature: SYSFeature,\r\n formState?: SYSFormState,\r\n tableDefId?: SYSTableDefIds,\r\n lookupColumnKey?: string\r\n): string => {\r\n if (\r\n (col.list && value === undefined) ||\r\n (!formState &&\r\n col.ui &&\r\n col.ui.displayEmptyIfValue !== undefined &&\r\n value === col.ui.displayEmptyIfValue)\r\n ) {\r\n return \"\"\r\n }\r\n let format\r\n if (col.ui) {\r\n format = col.ui.format\r\n }\r\n let type: LookupResultDataType = col.type\r\n let isHtmlType = false\r\n if (col.list && feature) {\r\n let cachedListKey = feature + key\r\n let listFn = cachedListFn.get(cachedListKey)\r\n if (!listFn) {\r\n listFn =\r\n ovl.getActions().app.features[feature]?.hooks?.[\r\n HookFieldGetList.replace(\r\n \"{subFeature}\",\r\n formState ? formState.subFeature : \"\"\r\n ).replace(\"{fieldKey}\", key)\r\n ]\r\n if (!listFn) {\r\n throw new Error(\r\n \"Listfunction: \" +\r\n HookFieldGetList.replace(\r\n \"{subFeature}\",\r\n formState ? formState.subFeature : \"\"\r\n ).replace(\"{fieldKey}\", key) +\r\n \" not found!\"\r\n )\r\n }\r\n cachedListFn.set(cachedListKey, listFn)\r\n }\r\n let listdata: HookFieldGetList_ReturnType = _GetFieldList(\r\n listFn,\r\n key,\r\n formState,\r\n tableDefId,\r\n undefined,\r\n true\r\n )\r\n\r\n value = _GetListValue(col.list, value, listdata, lookupColumnKey, true)\r\n\r\n if (lookupColumnKey) {\r\n type = listdata.lookupDef?.[lookupColumnKey]?.type\r\n } else {\r\n type = listdata.lookupDef?.[col.list.displayField]?.type\r\n }\r\n if (type === \"html\") {\r\n isHtmlType = true\r\n }\r\n }\r\n if (isHtmlType) {\r\n return value\r\n }\r\n let res = GetDisplayValueByType(format, type, value)\r\n if (res === null) {\r\n res = \"\"\r\n }\r\n return res\r\n}\r\n\r\nexport let _cachedFieldLists = new Map()\r\n\r\nexport const _GetFieldListCacheKey = (\r\n fieldKey: string,\r\n tableDefId: SYSTableDefIds = undefined,\r\n formState: SYSFormState = undefined\r\n): string => {\r\n return `@@table:${tableDefId ? tableDefId : \"\"}@@form:${\r\n formState ? `${formState.formType}${formState.formId}` : \"\"\r\n }@@fieldkey:${fieldKey}`\r\n}\r\n\r\nexport const _GetFieldList = (\r\n listFn: any = undefined,\r\n fieldKey: string,\r\n formState: SYSFormState,\r\n tableDefId: SYSTableDefIds,\r\n forceCacheBust?: boolean,\r\n notFullList?: boolean\r\n): HookFieldGetList_ReturnType => {\r\n let cacheKey = _GetFieldListCacheKey(fieldKey, tableDefId, formState)\r\n let list\r\n if (!forceCacheBust) {\r\n list = _cachedFieldLists.get(cacheKey)\r\n if (list) {\r\n //console.log(\"from cache \", fieldKey, cacheKey)\r\n return list\r\n }\r\n }\r\n if (listFn === undefined) {\r\n let feature = formState?.feature\r\n if (feature === undefined) {\r\n feature = TableGet(tableDefId).def.feature\r\n }\r\n\r\n let fnKey = HookFieldGetList.replace(\r\n \"{subFeature}\",\r\n formState ? formState.subFeature : \"\"\r\n ).replace(\"{fieldKey}\", fieldKey)\r\n listFn = ovl.getActions().app.features[feature]?.hooks?.[fnKey]\r\n }\r\n list = listFn({ formState, needsFullList: notFullList !== true })\r\n //if (!formState || !formState.firstInitOrSituationChanged) {\r\n //console.log(\"set cache \", fieldKey, cacheKey)\r\n _cachedFieldLists.set(cacheKey, list)\r\n // }\r\n return list\r\n}\r\n\r\nexport const GetDisplayValueByType = (\r\n format: FieldFormat,\r\n type: any,\r\n value: any\r\n) => {\r\n switch (type) {\r\n case \"date\":\r\n if (!value) {\r\n return \"\"\r\n }\r\n return getDateValue(value, format)\r\n case \"datetime\":\r\n if (!value) {\r\n return \"\"\r\n }\r\n return getDateValue(value, format)\r\n\r\n case \"decimal\":\r\n if ((!value && value != 0) || value === \"\") {\r\n return \"\"\r\n }\r\n return getDecimalValue(value, format)\r\n case \"int\":\r\n if ((!value && value != 0) || value === \"\") {\r\n return \"\"\r\n }\r\n return getIntegerValue(value, format)\r\n\r\n case \"bool\":\r\n return value\r\n\r\n case \"asset\":\r\n return value\r\n default:\r\n if (!value && value !== 0) {\r\n value = \"\"\r\n }\r\n return value.toString()\r\n }\r\n}\r\n\r\nlet customRendering = false\r\n\r\nexport const GetRowRawValue = (\r\n def: SYSTableDef,\r\n columnKey: string,\r\n row: any,\r\n rowKey: any,\r\n displayMode: DisplayMode = \"Table\"\r\n) => {\r\n let rendererFn = GetRendererFn(\r\n def.feature,\r\n cachedRendererFn,\r\n HookFieldGetValueRender.replace(\"{subFeature}\", \"\"),\r\n columnKey\r\n )\r\n if (rendererFn) {\r\n var customRendererResult = rendererFn({\r\n tableDef: def,\r\n rowKey,\r\n row,\r\n columnKey,\r\n displayMode,\r\n comp: this,\r\n })\r\n if (!customRendererResult) {\r\n // return raw value\r\n return row[columnKey]\r\n }\r\n return customRendererResult.valueRaw !== undefined\r\n ? customRendererResult.valueRaw\r\n : customRendererResult.res\r\n }\r\n return row[columnKey]\r\n}\r\n\r\nexport const GetRowDisplayValue = (\r\n def: SYSTableDef,\r\n columnKey: string,\r\n row: any,\r\n rowKey: any,\r\n displayMode: DisplayMode = \"Table\",\r\n ignoreRenderBarrier?: boolean,\r\n rendererFn?: any\r\n) => {\r\n // check for custom renderer\r\n let rowPart\r\n let customRendererResult: HookFieldGetValueRender_ReturnType\r\n // use a barrier (customRendering bool) if getrowdisplayvalue is calling itself (eg. calling CellTableVal inside a FieldValue (Rendering) Hook will call GetRow...)\r\n if (!customRendering || ignoreRenderBarrier) {\r\n if (!rendererFn) {\r\n rendererFn = GetRendererFn(\r\n def.feature,\r\n cachedRendererFn,\r\n HookFieldGetValueRender.replace(\"{subFeature}\", \"\"),\r\n columnKey\r\n )\r\n }\r\n if (rendererFn) {\r\n customRendering = true\r\n customRendererResult = rendererFn({\r\n tableDef: def,\r\n rowKey,\r\n row,\r\n columnKey,\r\n displayMode,\r\n comp: this,\r\n })\r\n if (customRendererResult) {\r\n rowPart = customRendererResult.res\r\n }\r\n customRendering = false\r\n }\r\n }\r\n let col = def.columns[columnKey]\r\n if (!customRendererResult) {\r\n if (col.nullHandling.enabled && row[columnKey] === null) {\r\n rowPart = col.nullHandling.displayValue\r\n } else if (col.control === \"checkbox\") {\r\n if (row[columnKey] === col.ui.checkedValue) {\r\n rowPart = def.options.controlsRendering.checkbox.table.checked\r\n } else {\r\n rowPart = def.options.controlsRendering.checkbox.table.unchecked\r\n }\r\n } else {\r\n rowPart = getDisplayValue(\r\n columnKey,\r\n col,\r\n row[columnKey],\r\n def.feature,\r\n undefined,\r\n def.id\r\n )\r\n }\r\n }\r\n return rowPart\r\n}\r\n\r\n// same applies to this method...use it from your customdeleters\r\nexport const deleteTableRow = (\r\n tableDataAndDef: TableDataAndDef,\r\n key: string\r\n) => {\r\n let data = tableDataAndDef.data\r\n Object.keys(tableDataAndDef.data.tableDef).forEach((k) => {\r\n let def = tableDataAndDef.data.tableDef[k] as SYSTableDef\r\n if (!def.uiState) {\r\n return\r\n }\r\n let tableGroupHeaderBreaks = def.uiState.tableGroupHeaderBreaks\r\n let tableGroupFooterBreaks = def.uiState.tableGroupFooterBreaks\r\n\r\n let tableGroupResults = def.uiState.tableGroupResults\r\n delete tableGroupHeaderBreaks[key]\r\n delete tableGroupFooterBreaks[key]\r\n\r\n delete tableGroupResults[key]\r\n\r\n delete tableDataAndDef.def.uiState.selectedRow[key]\r\n\r\n // let wasAdd =\r\n // (tableDataAndDef.data.data[key]?.OvlSysState).rowState\r\n // .state === \"Add\"\r\n\r\n // // delete any errors on processes for that rowkey\r\n // let res = ProcessGetRowFnsFeedback(def.id)\r\n // res.involvedProcessInstances.forEach((s) => {\r\n // delete s.feedback[key]\r\n // })\r\n\r\n // let i = def.uiState.dataFilteredAndSorted.indexOf(key)\r\n // if (i > -1) {\r\n // def.uiState.dataFilteredAndSorted.splice(i, 1)\r\n // }\r\n // if (!def.uiState.rebuild.deletedKeys[key]) {\r\n // if (def.id === tableDataAndDef.def.id) {\r\n // def.uiState.rowsCount--\r\n // }\r\n def.uiState.rebuild.deletedKeys[key] = true\r\n //}\r\n\r\n // fixPagingAndSetCountAndNeedsRefresh(\r\n // Object.keys(tableDataAndDef.data.tableDef).map(\r\n // (m) => tableDataAndDef.data.tableDef[m]\r\n // ),\r\n // !wasAdd,\r\n // def.id,\r\n // true,\r\n // data.data[key]\r\n // )\r\n })\r\n let index = data.index\r\n if (data.data[key]) {\r\n let rowId = data.data[key][tableDataAndDef.def.database.dataIdField]\r\n delete index[rowId]\r\n delete data.data[key]\r\n }\r\n}\r\n\r\n// export const fixPagingAndSetCountAndNeedsRefresh_ToBeRemoved = (\r\n// defs: SYSTableDef[],\r\n// needsRefresh: boolean = false,\r\n// currentDefId: SYSTableDefIds,\r\n// wasDelete: boolean = false,\r\n// changedFields: { [key: string]: any } = undefined\r\n// ) => {\r\n// defs\r\n// .filter((f) => f.initialised === true)\r\n// .forEach((def) => {\r\n// let dataFilteredAndSorted = def.uiState.dataFilteredAndSorted\r\n// let count = dataFilteredAndSorted.length\r\n// def.uiState.rowsCount = count\r\n// if (wasDelete) {\r\n// def.uiState.rebuild.modified = true\r\n// } else {\r\n// def.uiState.rebuild.added = true\r\n// }\r\n// if (needsRefresh === true && def.uiState.rebuild.needsRefresh !== true) {\r\n// if (def.id !== currentDefId) {\r\n// //check if staticfilter is involved in changedfields\r\n// let staticFilter = def.uiState.filter.filter.static\r\n// if (\r\n// staticFilter &&\r\n// Object.keys(staticFilter).length > 0 &&\r\n// changedFields\r\n// ) {\r\n// needsRefresh = Object.keys(changedFields).some((k1) =>\r\n// Object.keys(staticFilter).some(\r\n// (k) => staticFilter[k] === changedFields[k1]\r\n// )\r\n// )\r\n// }\r\n// }\r\n// if (needsRefresh) {\r\n// // if it was a delete needsRefresh should be set only if aggregates involved\r\n// if (\r\n// (def.uiState.rowsCount > 1 || !wasDelete) &&\r\n// (!wasDelete ||\r\n// (wasDelete &&\r\n// !def.options.tableGroupAggregates.disabled &&\r\n// (def.options.tableGroupAggregates.aggregates.length > 0 ||\r\n// def.options.tableGroupAggregates.groups.length > 0)))\r\n// ) {\r\n// def.uiState.rebuild.needsRefresh = true\r\n// }\r\n// }\r\n// if (def.uiState.rowsCount <= 1) {\r\n// def.uiState.rebuild.needsRefresh = false\r\n// }\r\n// }\r\n\r\n// if (def.features.page) {\r\n// let paging = def.uiState.paging\r\n// let pages = Math.ceil(count / paging.pageSize) - 1\r\n// if (pages > -1) {\r\n// if (paging.page > pages) {\r\n// paging.page = pages\r\n// } else if (paging.page < 0) {\r\n// paging.page = 0\r\n// }\r\n// }\r\n// }\r\n// })\r\n// }\r\n\r\nexport const _GetEntityNameMulti = (entityTranslationKey: string): string => {\r\n let multiEntityTranslationKey = `${entityTranslationKey}Multi`\r\n if (ovl.getState().ovl.language[multiEntityTranslationKey]) {\r\n entityTranslationKey = multiEntityTranslationKey\r\n } else {\r\n entityTranslationKey = \"SYSDefaultEntityNameMulti\"\r\n }\r\n return entityTranslationKey\r\n}\r\n\r\nexport const _GetTableDialogTitle = (\r\n def: SYSTableDef,\r\n actionName: string,\r\n count: number,\r\n rows: any,\r\n rowKey: string,\r\n ignoreId?: boolean\r\n) => {\r\n let selectionText = \"\"\r\n let idTranslation = \"\"\r\n let entityTranslationKey = def.title.entityTitle.entityNameTranslationKey\r\n if (count > 1) {\r\n entityTranslationKey = _GetEntityNameMulti(entityTranslationKey)\r\n selectionText = T(\"SYSTableDialogTitleSelected\")\r\n } else {\r\n if (\r\n !def.title.entityTitle.tableDialogTitleDoNotDisplayId &&\r\n !ignoreId &&\r\n rowKey &&\r\n def.uiState.columnsRenderingState.visibleInTable.indexOf(\r\n def.database.dataIdField\r\n ) > -1\r\n ) {\r\n idTranslation = \"Id\"\r\n\r\n let idColumnTranslationKey\r\n if (def.columns[def.database.dataIdField]?.ui?.labelTranslationKey) {\r\n idColumnTranslationKey =\r\n def.columns[def.database.dataIdField].ui.labelTranslationKey\r\n } else {\r\n let translationPrefix\r\n if (\r\n def.options.labelAndColumnTitleHandling?.translationPrefix !==\r\n undefined\r\n ) {\r\n translationPrefix =\r\n def.options.labelAndColumnTitleHandling.translationPrefix\r\n }\r\n if (translationPrefix) {\r\n idColumnTranslationKey = `${translationPrefix}${def.database.dataIdField}`\r\n }\r\n }\r\n\r\n if (idColumnTranslationKey) {\r\n idTranslation = T(idColumnTranslationKey)\r\n }\r\n let val = GetRowDisplayValue(\r\n def,\r\n def.database.dataIdField,\r\n rows[rowKey],\r\n rowKey,\r\n \"DialogTitle\"\r\n )\r\n if (typeof val !== \"string\") {\r\n val = rows[rowKey][def.database.dataIdField]\r\n }\r\n idTranslation = ` (${idTranslation}: ${val})`\r\n }\r\n }\r\n let entityName = T(entityTranslationKey)\r\n let translationKey = def.title.entityTitle.tableDialogTitleTranslationKey\r\n if (count > 1) {\r\n let multiTranslationKey = `${translationKey}Multi`\r\n if (ovl.getState().ovl.language.translations[multiTranslationKey]) {\r\n translationKey = multiTranslationKey\r\n }\r\n }\r\n\r\n return T(translationKey, [\r\n selectionText,\r\n entityName,\r\n idTranslation,\r\n actionName,\r\n count,\r\n ])\r\n}\r\n\r\nexport const initTableState = async (\r\n def: SYSTableDef,\r\n data: SYSTableData,\r\n defId: SYSTableDefIds,\r\n onlyColumns?: boolean\r\n) => {\r\n let wasInitialised = def.initialised === true\r\n if (!def.initialised || onlyColumns) {\r\n // prepare state/ complete state / set sensible defaults\r\n if (!def.initialised) {\r\n def.initialised = true\r\n def.id = defId\r\n if (data === undefined) {\r\n throw Error(\"ovl state init: data object not present\")\r\n }\r\n if (data.data === undefined) {\r\n data.data = {}\r\n }\r\n if (data.clientConversion === undefined) {\r\n data.clientConversion = {}\r\n }\r\n // if (data.schema === undefined) {\r\n // data.schema = {}\r\n // }\r\n if (data.offline === undefined) {\r\n data.offlineSeq = 0\r\n data.offline = {\r\n addedKeys: {},\r\n deletedKeys: {},\r\n errors: {},\r\n updatedKeys: {},\r\n offlineHandlerInProcess: false,\r\n }\r\n }\r\n if (data.index === undefined) {\r\n data.index = {}\r\n }\r\n\r\n if (!def.title) {\r\n def.title = {\r\n entityTitle: {\r\n entityNameTranslationKey: \"SYSDefaultEntityName\",\r\n tableDialogTitleTranslationKey: \"SYSTableDialogTitle\",\r\n },\r\n }\r\n }\r\n if (def.title.translationKey) {\r\n def.title.show = true\r\n }\r\n if (def.title.show === undefined) {\r\n def.title.show = false\r\n }\r\n if (def.title.invalidFavoritDisplayMode === undefined) {\r\n def.title.invalidFavoritDisplayMode = \"Mark\"\r\n }\r\n if (!def.title.entityTitle) {\r\n def.title.entityTitle = {\r\n entityNameTranslationKey: \"SYSDefaultEntityName\",\r\n tableDialogTitleTranslationKey: \"SYSTableDialogTitle\",\r\n }\r\n }\r\n\r\n if (!def.title.entityTitle.entityNameTranslationKey) {\r\n def.title.entityTitle.entityNameTranslationKey = \"SYSDefaultEntityName\"\r\n }\r\n if (!def.title.entityTitle.tableDialogTitleTranslationKey) {\r\n def.title.entityTitle.tableDialogTitleTranslationKey =\r\n \"SYSTableDialogTitle\"\r\n }\r\n\r\n if (!def.database) {\r\n def.database = {}\r\n }\r\n if (def.database.dataIdField === undefined) {\r\n if (\r\n def.database.dbInsertMode &&\r\n def.database.dbInsertMode.indexOf(\"UDT\") > -1\r\n ) {\r\n def.database.dataIdField = \"Code\"\r\n } else {\r\n def.database.dataIdField = Object.keys(def.columns)[0]\r\n }\r\n }\r\n if (def.database.dbInsertMode === undefined) {\r\n def.database.dbInsertMode = \"Manual\"\r\n }\r\n\r\n // if (def.database.disableConstraintViolationSnacks === undefined) {\r\n // def.database.disableConstraintViolationSnacks = false\r\n // }\r\n\r\n // if (def.database.constraintViolationBehaviour === undefined) {\r\n // def.database.constraintViolationBehaviour = \"Cancel\"\r\n // }\r\n\r\n if (def.database.useSchema === undefined) {\r\n def.database.useSchema = def.database.dbInsertMode !== \"Manual\"\r\n }\r\n\r\n if (!def.server) {\r\n def.server = { endpoint: \"\" }\r\n }\r\n if (!def.feature) {\r\n def.feature = def.id\r\n }\r\n if (ovl.getActions().app.features[def.feature]?.hooks?.[HookTableInit]) {\r\n await ovl.getActions().app.features[def.feature].hooks[HookTableInit]({\r\n tableDef: def,\r\n context: \"before\",\r\n })\r\n }\r\n\r\n if (def.options === undefined) {\r\n def.options = {}\r\n }\r\n if (def.uiState === undefined) {\r\n def.uiState = {}\r\n }\r\n let options = def.options\r\n\r\n if (options.feedback === undefined) {\r\n options.feedback = { level: undefined }\r\n }\r\n\r\n if (options.feedback.level === undefined) {\r\n if (SYSConfig.tableDefaults?.feedback?.level) {\r\n options.feedback.level = SYSConfig.tableDefaults?.feedback.level\r\n } else {\r\n options.feedback = { level: \"0:none\" }\r\n }\r\n }\r\n\r\n if (options.addedRowsPosition === undefined) {\r\n if (SYSConfig.tableDefaults?.addNewRowsPosition) {\r\n options.addedRowsPosition = SYSConfig.tableDefaults.addNewRowsPosition\r\n } else {\r\n options.addedRowsPosition = \"bottom\"\r\n }\r\n }\r\n // if (options.copyColumnsIgnore === undefined) {\r\n // options.copyColumnsIgnore = {}\r\n // }\r\n if (options.nullHandling === undefined) {\r\n options.nullHandling = {\r\n defaultDisplayValue: \"\",\r\n nullValidatorToUse: \"Mandatory\",\r\n }\r\n }\r\n if (options.nullHandling.defaultDisplayValue === undefined) {\r\n options.nullHandling.defaultDisplayValue = \"\"\r\n }\r\n\r\n if (options.nullHandling.nullValidatorToUse === undefined) {\r\n options.nullHandling.nullValidatorToUse = \"Mandatory\"\r\n }\r\n\r\n if (options.filterSortSettings === undefined) {\r\n options.filterSortSettings = {\r\n staticFilterKey: undefined,\r\n doNotPersist: false,\r\n showInTitle: true,\r\n }\r\n }\r\n if (options.filterSortSettings.showInTitle === undefined) {\r\n options.filterSortSettings.showInTitle = true\r\n }\r\n if (options.filterSortSettings.doNotPersist === undefined) {\r\n options.filterSortSettings.doNotPersist = false\r\n }\r\n\r\n if (options.customRowActions === undefined) {\r\n options.customRowActions = {}\r\n }\r\n //init group\r\n Object.keys(options.customRowActions).forEach((k) => {\r\n options.customRowActions[k].fnKey = k\r\n if (!options.customRowActions[k].visualGroup) {\r\n options.customRowActions[k].visualGroup = \"ovld\"\r\n }\r\n\r\n if (options.customRowActions[k].blocking === undefined) {\r\n // no blocking at all if not defined\r\n options.customRowActions[k].blocking = { group: \"view\" }\r\n }\r\n if (options.customRowActions[k].blocking.group === undefined) {\r\n options.customRowActions[k].blocking.group = \"view\"\r\n }\r\n\r\n if (options.customRowActions[k].process === undefined) {\r\n if (\r\n options.customRowActions[k].prompt?.type === \"WhenMulti\" ||\r\n options.customRowActions[k].whenMultiple ||\r\n options.customRowActions[k].handleFeedback\r\n ) {\r\n options.customRowActions[k].process = \"SYSTableRowFnProcess\"\r\n } else {\r\n options.customRowActions[k].process = \"None\"\r\n }\r\n }\r\n\r\n if (options.customRowActions[k].prompt === undefined) {\r\n options.customRowActions[k].prompt = {}\r\n }\r\n if (options.customRowActions[k].prompt.type === undefined) {\r\n options.customRowActions[k].prompt.type = \"None\"\r\n }\r\n if (options.customRowActions[k].trackData === undefined) {\r\n options.customRowActions[k].trackData = \"None\"\r\n }\r\n\r\n if (options.customRowActions[k].summary === undefined) {\r\n options.customRowActions[k].summary = \"Snack\"\r\n }\r\n // if (options.customRowActions[k].prompt.type === \"WhenMulti\") {\r\n // if (options.customRowActions[k].whenMultiple === undefined) {\r\n // options.customRowActions[k].whenMultiple = {\r\n // callForEveryRow: false,\r\n // }\r\n // }\r\n // }\r\n // if (options.customRowActions[k].whenMultiple === undefined) {\r\n // options.customRowActions[k].whenMultiple = { callForEveryRow: false }\r\n // }\r\n })\r\n\r\n if (options.customColumnActions === undefined) {\r\n options.customColumnActions = {}\r\n }\r\n //init group\r\n Object.keys(options.customColumnActions).forEach((k) => {\r\n options.customColumnActions[k].forEach((kk) => {\r\n if (!kk.visualGroup) {\r\n kk.visualGroup = \"ovld\"\r\n }\r\n })\r\n })\r\n\r\n if (options.navType === undefined) {\r\n options.navType = \"bottom\"\r\n }\r\n if (options.initial_filter === undefined) {\r\n options.initial_filter = { showSelected: false, value: \"\", static: {} }\r\n }\r\n if (options.initial_filter.value === undefined) {\r\n options.initial_filter.value = \"\"\r\n }\r\n if (options.initial_filter.trimValue === undefined) {\r\n options.initial_filter.trimValue =\r\n !!SYSConfig.tableDefaults?.trimTableFilterValue\r\n }\r\n\r\n if (options.initial_filter.static === undefined) {\r\n options.initial_filter.static = {}\r\n }\r\n if (options.initial_sort === undefined) {\r\n options.initial_sort = {\r\n direction: \"desc\",\r\n field: def.database.dataIdField,\r\n useValue: false,\r\n }\r\n }\r\n if (options.initial_sort.useValue === undefined) {\r\n options.initial_sort.useValue = false\r\n }\r\n\r\n if (options.initial_paging === undefined) {\r\n options.initial_paging = { page: 0, pageSize: 10000 }\r\n }\r\n if (options.edit === undefined) {\r\n options.edit = { editType: \"big\" }\r\n }\r\n\r\n if (options.edit.editType === undefined) {\r\n options.edit.editType = \"big\"\r\n }\r\n if (options.edit.groups === undefined) {\r\n options.edit.groups = {}\r\n }\r\n if (options.edit.displayValueHintWhileTyping === undefined) {\r\n options.edit.displayValueHintWhileTyping = false\r\n }\r\n\r\n if (options.edit.doFormChangedForEveryFieldInInit === undefined) {\r\n options.edit.doFormChangedForEveryFieldInInit = true\r\n }\r\n\r\n if (options.initial_sortCustom === undefined) {\r\n options.initial_sortCustom = { sorts: {}, selected: \"\" }\r\n }\r\n if (options.initial_sortCustom.sorts === undefined) {\r\n options.initial_sortCustom.sorts = {}\r\n }\r\n //init group\r\n Object.keys(options.initial_sortCustom.sorts).forEach((k) => {\r\n if (!options.initial_sortCustom.sorts[k].visualGroup) {\r\n options.initial_sortCustom.sorts[k].visualGroup = \"ovld\"\r\n }\r\n })\r\n\r\n if (options.initial_filterCustom === undefined) {\r\n options.initial_filterCustom = {}\r\n }\r\n //init group\r\n Object.keys(options.initial_filterCustom).forEach((k) => {\r\n if (!options.initial_filterCustom[k].visualGroup) {\r\n options.initial_filterCustom[k].visualGroup = \"ovld\"\r\n }\r\n })\r\n\r\n if (options.initial_rowAttributes === undefined) {\r\n options.initial_rowAttributes = {}\r\n }\r\n\r\n Object.keys(options.initial_rowAttributes).forEach((k) => {\r\n if (options.initial_rowAttributes[k].attributes === undefined) {\r\n options.initial_rowAttributes[k].attributes = {}\r\n }\r\n })\r\n\r\n if (options.controlsRendering === undefined) {\r\n options.controlsRendering = {\r\n checkbox: {\r\n view: { checked: \"✔️\", unchecked: \"☐\" },\r\n table: { checked: \"✔️\", unchecked: \" \" },\r\n },\r\n }\r\n }\r\n if (options.controlsRendering.useAlignRight === undefined) {\r\n options.controlsRendering.useAlignRight =\r\n options.edit.editType === \"inline\"\r\n }\r\n\r\n if (options.controlsRendering.fillSpaceIfNotVisible === undefined) {\r\n options.controlsRendering.fillSpaceIfNotVisible = true\r\n }\r\n if (options.controlsRendering.checkbox === undefined) {\r\n options.controlsRendering.checkbox = {\r\n view: { checked: \"✔️\", unchecked: \"☐\" },\r\n table: { checked: \"✔️\", unchecked: \" \" },\r\n }\r\n }\r\n if (options.controlsRendering.checkbox.view === undefined) {\r\n options.controlsRendering.checkbox.view = {\r\n checked: \"??\",\r\n unchecked: \"?\",\r\n }\r\n }\r\n if (options.controlsRendering.checkbox.table === undefined) {\r\n options.controlsRendering.checkbox.table = {\r\n checked: \"??\",\r\n unchecked: \"\",\r\n }\r\n }\r\n\r\n if (options.controlsRendering.fillSpaceIfNotVisible === undefined) {\r\n options.controlsRendering.fillSpaceIfNotVisible = true\r\n }\r\n\r\n if (options.controlsRendering.list === undefined) {\r\n options.controlsRendering.list = { displayCachedListsWhileTyping: true }\r\n }\r\n\r\n // if (def.uiState.rangeFilter === undefined) {\r\n // def.uiState.rangeFilter = { control: \"text\" }\r\n // }\r\n\r\n let initialSort: Sort\r\n let sortDef = def.options.initial_sort\r\n if (isMobile && sortDef.fieldMobile) {\r\n initialSort = {\r\n useValue: sortDef.useValue,\r\n direction: sortDef.directionMobile,\r\n field: sortDef.fieldMobile,\r\n }\r\n } else {\r\n initialSort = {\r\n direction: sortDef.direction,\r\n field: sortDef.field,\r\n useValue: sortDef.useValue,\r\n }\r\n }\r\n\r\n if (def.uiState.currentSelectedFilterSort === undefined) {\r\n def.uiState.currentSelectedFilterSort = \"\"\r\n }\r\n if (def.uiState.currentSelectedFilterSortStore === undefined) {\r\n def.uiState.currentSelectedFilterSortStore = {}\r\n }\r\n\r\n if (def.uiState.sort === undefined) {\r\n def.uiState.sort = {}\r\n }\r\n def.uiState.sort.sort = initialSort\r\n\r\n //def.uiState.sort.sort = JSON.parse(JSON.stringify(def.options.initial_sort))\r\n def.uiState.sort.sortCustom = JSON.parse(\r\n JSON.stringify(def.options.initial_sortCustom)\r\n )\r\n\r\n def.uiState.paging = JSON.parse(\r\n JSON.stringify(def.options.initial_paging)\r\n )\r\n if (def.uiState.filter === undefined) {\r\n def.uiState.filter = {}\r\n }\r\n if (def.uiState.filter.columns === undefined) {\r\n def.uiState.filter.columns = {}\r\n }\r\n\r\n def.uiState.filter.filter = JSON.parse(\r\n JSON.stringify(def.options.initial_filter)\r\n )\r\n\r\n if (def.uiState._lastFilterSortDifferentiator === undefined) {\r\n def.uiState._lastFilterSortDifferentiator = \"@@OvlInitValue@@Ovl\"\r\n }\r\n\r\n if (!def.uiState.filter.filterCustom) {\r\n def.uiState.filter.filterCustom = {}\r\n }\r\n Object.keys(def.options.initial_filterCustom).forEach((f) => {\r\n def.uiState.filter.filterCustom[f] = {\r\n active: def.options.initial_filterCustom[f].active,\r\n }\r\n })\r\n\r\n //if (def.options.rowAttributes !== undefined) {\r\n def.uiState.filter.filterAttributes = {}\r\n Object.keys(def.options.initial_rowAttributes).forEach((f) => {\r\n def.uiState.filter.filterAttributes[f] = {\r\n attributes: JSON.parse(\r\n JSON.stringify(def.options.initial_rowAttributes[f].attributes)\r\n ),\r\n }\r\n })\r\n // console.log(\r\n // JSON.parse(JSON.stringify(def.uiState.filter.filterAttributes))\r\n // )\r\n //}\r\n // def.uiState.filter.filterCustom = JSON.parse(\r\n // JSON.stringify(def.options.initial_filterCustom)\r\n // )\r\n let uiState = def.uiState\r\n\r\n // if (uiState.viewRow === undefined) {\r\n // uiState.viewRow = {}\r\n // }\r\n\r\n if (uiState.headerSelected === undefined) {\r\n uiState.headerSelected = \"\"\r\n }\r\n\r\n if (uiState.currentlyAddingKey === undefined) {\r\n //uiState.currentlyAddingKey = \"\"\r\n }\r\n\r\n if (uiState.dataFilteredAndSorted === undefined) {\r\n uiState.dataFilteredAndSorted = []\r\n }\r\n\r\n if (uiState.selectedCounter === undefined) {\r\n uiState.selectedCounter = 0\r\n }\r\n\r\n if (uiState.selectedRow === undefined) {\r\n uiState.selectedRow = {}\r\n }\r\n\r\n if (uiState.rebuild === undefined) {\r\n uiState.rebuild = {\r\n deletedKeys: {},\r\n updatedKeys: {},\r\n addedKeys: {},\r\n changed: {},\r\n needsRefresh: false,\r\n }\r\n }\r\n\r\n if (uiState.rowsCount === undefined) {\r\n uiState.rowsCount = 0\r\n }\r\n\r\n if (def.features === undefined) {\r\n def.features = {}\r\n }\r\n let features = def.features\r\n if (features.focusToFirstEditableField === undefined) {\r\n features.focusToFirstEditableField = true\r\n }\r\n\r\n if (features.detailView === undefined) {\r\n features.detailView = \"None\"\r\n }\r\n\r\n if (features.add === undefined) {\r\n features.add =\r\n features.multiCopy !== undefined ? features.multiCopy : false\r\n }\r\n\r\n if (features.delete === undefined) {\r\n features.delete =\r\n features.multiDelete !== undefined ? features.multiDelete : false\r\n }\r\n if (features.edit === undefined) {\r\n features.edit =\r\n features.multiEdit !== undefined ? features.multiEdit : false\r\n }\r\n\r\n if (features.copy === undefined) {\r\n features.copy =\r\n features.multiCopy !== undefined ? features.multiCopy : false\r\n }\r\n\r\n if (features.filter === undefined) {\r\n features.filter = false\r\n }\r\n\r\n if (isMobile()) {\r\n def.options.edit.editType = \"big\"\r\n }\r\n\r\n if (features.multiCopy === undefined) {\r\n features.multiCopy = false\r\n }\r\n if (features.multiCopy && def.options.edit.editType !== \"inline\") {\r\n features.multiCopy = false\r\n }\r\n if (features.multiEdit === undefined) {\r\n features.multiEdit = false\r\n }\r\n if (features.multiEdit && def.options.edit.editType !== \"inline\") {\r\n features.multiEdit = false\r\n }\r\n\r\n if (features.multiDelete === undefined) {\r\n features.multiDelete = false\r\n }\r\n\r\n if (features.multiFilter === undefined) {\r\n features.multiFilter = false\r\n }\r\n\r\n if (options.filterSortSettings.selectionClipping === undefined) {\r\n if (features.multiFilter) {\r\n options.filterSortSettings.selectionClipping = \"Keep\"\r\n } else {\r\n options.filterSortSettings.selectionClipping = \"Remove\"\r\n }\r\n }\r\n\r\n if (features.multiSelect === undefined) {\r\n features.multiSelect =\r\n features.multiCopy ||\r\n features.multiEdit ||\r\n features.multiDelete ||\r\n features.multiFilter ||\r\n Object.keys(def.options.customRowActions).some(\r\n (k) => def.options.customRowActions[k].whenMultiple\r\n )\r\n }\r\n if (!features.multiSelect) {\r\n features.displayMultiSelectEndSelectButton = \"None\"\r\n }\r\n if (features.displayMultiSelectEndSelectButton === undefined) {\r\n features.displayMultiSelectEndSelectButton = \"TouchDevice\"\r\n }\r\n if (features.stickyHeader === undefined) {\r\n features.stickyHeader = true\r\n }\r\n\r\n if (features.page === undefined) {\r\n features.page = false\r\n }\r\n if (features.showFooterButtons === undefined) {\r\n features.showFooterButtons = false\r\n }\r\n if (features.showRefreshButton === undefined) {\r\n features.showRefreshButton = \"TableNav\"\r\n }\r\n\r\n if (features.forceFreshServerDataIfOlderThan === undefined) {\r\n features.forceFreshServerDataIfOlderThan = -1\r\n }\r\n\r\n // if you need to adjust this delete then pls use tableinit in after mode\r\n if (features.delete) {\r\n let customRowActions = def.options.customRowActions\r\n customRowActions[\"OvlDelete\"] = {\r\n permission: def.permission,\r\n permissionModifier: \"D\",\r\n icon: \"sap-icon--delete\",\r\n translationKey: \"SYSTableRowFnDelete\",\r\n visualGroup: \"ovld\",\r\n fnKey: \"OvlDelete\",\r\n trackData: \"None\",\r\n process: \"SYSTableRowFnProcess\",\r\n prompt: { type: \"Always\" },\r\n handleFeedback: true,\r\n blocking: { group: \"edit\" },\r\n summary: \"Snack\",\r\n }\r\n if (features.multiDelete) {\r\n customRowActions[\"OvlDelete\"].whenMultiple = {\r\n callForEveryRow: true,\r\n }\r\n }\r\n }\r\n\r\n if (features.copy) {\r\n let customRowActions = def.options.customRowActions\r\n customRowActions[\"OvlCopy\"] = {\r\n permission: def.permission,\r\n permissionModifier: \"A\",\r\n icon: \"sap-icon--copy\",\r\n translationKey: \"SYSTableRowFnCopy\",\r\n visualGroup: \"ovld\",\r\n fnKey: \"OvlCopy\",\r\n blocking: { group: \"view\" },\r\n prompt: { type: \"WhenMultiOrHookResult\" },\r\n handleFeedback: true,\r\n process: \"None\",\r\n summary: \"None\",\r\n }\r\n if (features.multiCopy) {\r\n customRowActions[\"OvlCopy\"].whenMultiple = {\r\n callForEveryRow: true,\r\n }\r\n }\r\n }\r\n\r\n if (features.edit) {\r\n let customRowActions = def.options.customRowActions\r\n customRowActions[\"OvlEdit\"] = {\r\n permission: def.permission,\r\n permissionModifier: \"M\",\r\n icon: \"sap-icon--edit\",\r\n translationKey: \"SYSTableRowFnEdit\",\r\n visualGroup: \"ovld\",\r\n fnKey: \"OvlEdit\",\r\n prompt: { type: \"WhenMultiOrHookResult\" },\r\n handleFeedback: true,\r\n blocking: { group: \"edit\" },\r\n process: \"None\",\r\n summary: \"None\",\r\n }\r\n if (features.multiEdit) {\r\n customRowActions[\"OvlEdit\"].whenMultiple = {\r\n callForEveryRow: true,\r\n }\r\n }\r\n }\r\n\r\n let customRowActions = def.options.customRowActions\r\n customRowActions[\"OvlSaveRow\"] = {\r\n mode: \"Hidden\",\r\n permission: def.permission,\r\n permissionModifier: \"M\",\r\n translationKey: \"SYSTableRowFnSave\",\r\n fnKey: \"OvlSaveRow\",\r\n prompt: { type: \"None\" },\r\n handleFeedback: true,\r\n blocking: { group: \"edit\" },\r\n process: \"SYSSaveRow\",\r\n }\r\n\r\n Object.keys(def.options.customRowActions).forEach((k) => {\r\n // disable already all fns which are not accesible due of role or feature config\r\n // check roles and permissions as well\r\n let custom = def.options.customRowActions[k]\r\n let hidden =\r\n !(\r\n !custom.permission ||\r\n _HasPermission(custom.permission, custom.permissionModifier)\r\n ) &&\r\n (!custom.role || !!FeatureInfo(custom.role))\r\n custom.mode = hidden\r\n ? \"Hidden\"\r\n : def.options.customRowActions[k]?.mode === undefined\r\n ? \"Row\"\r\n : def.options.customRowActions[k].mode\r\n if (custom.visibleOnColumns === undefined) {\r\n custom.visibleOnColumns = \"All\"\r\n }\r\n })\r\n\r\n // if add is explicitly enabled but no headermenu or footerbuutons enable...just enable footerbuttons\r\n\r\n if (!def.dataFetching) {\r\n def.dataFetching = {}\r\n }\r\n\r\n let dataFetching = def.dataFetching\r\n\r\n if (dataFetching.useCustomDataFetching === undefined) {\r\n dataFetching.useCustomDataFetching = false\r\n }\r\n\r\n // set some values if we are on mobile\r\n }\r\n\r\n def.uiState.tableGroupHeaderBreaks = {}\r\n def.uiState.tableGroupFooterBreaks = {}\r\n def.uiState.tableGroupResults = {}\r\n def.uiState.hasGroupedHeader = false\r\n def.uiState.groupHeaderFooterResultToSet = undefined\r\n let options = def.options\r\n\r\n if (options.tableGroupAggregates === undefined) {\r\n options.tableGroupAggregates = {\r\n aggregates: [],\r\n groups: [],\r\n disabled: true,\r\n }\r\n }\r\n\r\n if (options.tableGroupAggregates.aggregates === undefined) {\r\n options.tableGroupAggregates.aggregates = []\r\n }\r\n\r\n if (options.tableGroupAggregates.groups === undefined) {\r\n options.tableGroupAggregates.groups = []\r\n }\r\n\r\n if (options.tableGroupAggregates.disabled === undefined) {\r\n if (\r\n options.tableGroupAggregates.groups.length > 0 ||\r\n options.tableGroupAggregates.aggregates.length > 0\r\n ) {\r\n options.tableGroupAggregates.disabled = false\r\n } else {\r\n options.tableGroupAggregates.disabled = true\r\n }\r\n }\r\n\r\n if (\r\n options.tableGroupAggregates.aggregates.filter(\r\n (f) => f.aggregateCode === \"@@SYSTotal\"\r\n ).length === 0\r\n ) {\r\n options.tableGroupAggregates.aggregates.unshift({\r\n aggregateCode: \"@@SYSTotal\",\r\n })\r\n }\r\n if (\r\n options.tableGroupAggregates.groups.filter(\r\n (f) => f.groupCode === \"@@SYSTotal\"\r\n ).length === 0\r\n ) {\r\n options.tableGroupAggregates.groups.unshift({ groupCode: \"@@SYSTotal\" })\r\n }\r\n if (\r\n options.tableGroupAggregates.onlyApplyWhenColumnSortStartsWith ===\r\n undefined\r\n ) {\r\n options.tableGroupAggregates.onlyApplyWhenColumnSortStartsWith = []\r\n }\r\n if (options.tableGroupAggregates.onlyApplyWhenCustomSort === undefined) {\r\n options.tableGroupAggregates.onlyApplyWhenCustomSort = []\r\n }\r\n\r\n // update columns to always include idfield and sortfield if not there (as visible false)\r\n let columns = def.columns\r\n if (def.database.dataIdField && !def.columns[def.database.dataIdField]) {\r\n columns[def.database.dataIdField] = {\r\n ui: { visibility: \"None\" },\r\n sortable: true,\r\n }\r\n }\r\n if (\r\n def.uiState.sort.sort.field &&\r\n !def.columns[def.uiState.sort.sort.field]\r\n ) {\r\n columns[def.uiState.sort.sort.field] = {\r\n ui: { visibility: \"None\" },\r\n sortable: true,\r\n }\r\n }\r\n if (def.uiState.columnsRenderingState === undefined) {\r\n def.uiState.columnsRenderingState = { columns: {}, visibleInTable: [] }\r\n }\r\n\r\n let hasEditableColumns = false\r\n let order = 0\r\n Object.keys(def.columns).forEach((f) => {\r\n let col = def.columns[f]\r\n if (col.order === undefined) {\r\n col.order = order\r\n } else {\r\n order = col.order\r\n }\r\n order++\r\n if (col.ui === undefined) {\r\n col.ui = {}\r\n }\r\n if (col.ui.thGroupTranslationKey) {\r\n def.uiState.hasGroupedHeader = true\r\n }\r\n\r\n if (col.groups === undefined) {\r\n col.groups = { group: 0, tab: 0 }\r\n }\r\n\r\n if (col.groups.tab === undefined) {\r\n col.groups.tab = 0\r\n }\r\n if (col.groups.group === undefined) {\r\n col.groups.group = 0\r\n }\r\n if (col.ui.visibility === undefined) {\r\n col.ui.visibility = \"Table_Edit_View\"\r\n }\r\n if (col.ui.fillSpaceIfNotVisible === undefined) {\r\n col.ui.fillSpaceIfNotVisible =\r\n def.options.controlsRendering.fillSpaceIfNotVisible\r\n }\r\n\r\n if (col.ui.language) {\r\n if (col.ui.translationVisibility === undefined) {\r\n col.ui.translationVisibility = \"Edit\"\r\n }\r\n }\r\n\r\n if (\r\n col.ui.selectIfFocused === undefined &&\r\n options.controlsRendering.selectIfFocused !== undefined\r\n ) {\r\n col.ui.selectIfFocused = options.controlsRendering.selectIfFocused\r\n }\r\n\r\n // if (col.ui.showLabelIfNoValueInView === undefined) {\r\n // col.ui.showLabelIfNoValueInView = true\r\n // }\r\n if (col.nullHandling === undefined) {\r\n col.nullHandling = {\r\n enabled: false,\r\n displayValue: def.options.nullHandling.defaultDisplayValue,\r\n setToNullIf: data.clientConversion?.[f]?.setToNullIf,\r\n setToValueIfNull: data.clientConversion?.[f]?.setToValueIfNull,\r\n }\r\n }\r\n if (col.nullHandling.displayValue === undefined) {\r\n col.nullHandling.displayValue =\r\n def.options.nullHandling.defaultDisplayValue\r\n }\r\n if (col.nullHandling.enabled === undefined) {\r\n col.nullHandling.enabled = false\r\n }\r\n if (col.type === \"asset\") {\r\n col.control = \"asset\"\r\n if (col.editor === undefined) {\r\n col.editor = { id: \"SYSEditorAsset\" }\r\n }\r\n }\r\n if (\r\n col.control === \"checkbox\" ||\r\n (col.control === undefined && col.type === \"bool\")\r\n ) {\r\n if (col.ui.checkedValue === undefined) {\r\n col.ui.checkedValue = true\r\n }\r\n\r\n if (col.type === undefined) {\r\n if (typeof col.ui.checkedValue === \"string\") {\r\n col.type = \"text\"\r\n } else {\r\n col.type = \"bool\"\r\n }\r\n }\r\n }\r\n if (col.control === undefined) {\r\n if (col.type === \"datetime\") {\r\n col.control = \"datetime\"\r\n } else if (col.list) {\r\n col.control = \"list\"\r\n if (col.list.mode === \"Option\") {\r\n col.control = \"option\"\r\n }\r\n } else {\r\n if (col.ui.checkedValue) {\r\n col.control = \"checkbox\"\r\n } else {\r\n col.control = \"text\"\r\n }\r\n }\r\n }\r\n if (col.ui.checkedValue === \"Y\" && col.ui.uncheckedValue === undefined) {\r\n col.ui.uncheckedValue = \"N\"\r\n }\r\n if (col.filter === undefined) {\r\n col.filter = {}\r\n }\r\n if (col.filter.columnFilter) {\r\n if (col.filter.columnFilter.list === undefined) {\r\n col.filter.columnFilter.list = []\r\n }\r\n if (!col.filter.columnFilter.exclusive) {\r\n col.filter.columnFilter.exclusive = false\r\n }\r\n }\r\n\r\n if (col.list) {\r\n if (col.list.displayField === undefined && col.list.valueField) {\r\n col.list.displayField = col.list.valueField\r\n }\r\n\r\n if (\r\n col.list.displayValueField === undefined &&\r\n col.list.valueField === col.list.displayField\r\n ) {\r\n col.list.displayValueField = false\r\n }\r\n }\r\n def.uiState.filter.columns[f] = JSON.parse(JSON.stringify(col.filter))\r\n\r\n // if schema is used the align will be done in enrichColumn after TableServerRefresh\r\n if (col.ui.align === undefined && (!def.database.useSchema || col.type)) {\r\n if (!col.list && (col.type === \"decimal\" || col.type === \"int\")) {\r\n col.ui.align = \"right\"\r\n } else {\r\n col.ui.align = \"left\"\r\n }\r\n }\r\n // if (col.type === undefined) {\r\n // col.type = \"text\"\r\n // }\r\n if (\r\n def.features.headerMenu === undefined &&\r\n (col.sortable || col.filter.rangeFilter || col.filter.columnFilter)\r\n ) {\r\n def.features.headerMenu = true\r\n }\r\n if (!hasEditableColumns && col.ui.visibility.indexOf(\"Edit\") > -1) {\r\n hasEditableColumns = true\r\n }\r\n def.uiState.columnsRenderingState.columns[f] = {\r\n visibility: col.ui.visibility,\r\n alignCss: _GetAlign(col.ui.align),\r\n }\r\n })\r\n def.uiState.hasEditableColumns = hasEditableColumns\r\n if (\r\n def.features.headerMenu === undefined &&\r\n (Object.keys(def.options.initial_filterCustom).length > 0 ||\r\n Object.keys(def.options.initial_sortCustom).length > 0)\r\n ) {\r\n def.features.headerMenu = true\r\n }\r\n\r\n if (def.features.add && !def.features.headerMenu) {\r\n def.features.showFooterButtons = true\r\n }\r\n if (!wasInitialised) {\r\n if (ovl.getActions().app.features[def.feature]?.hooks?.[HookTableInit]) {\r\n await ovl.getActions().app.features[def.feature].hooks[HookTableInit]({\r\n tableDef: def,\r\n context: \"after\",\r\n })\r\n }\r\n }\r\n }\r\n\r\n await _TableSetColumnVisibility(def, ovl.getActions(), ovl.getState(), true)\r\n}\r\n\r\nexport const _TableRefreshServerData = async (\r\n def: SYSTableDef,\r\n data: SYSTableData,\r\n actions: SYSActions,\r\n forceServerDataRefresh?: boolean,\r\n localData?: any[],\r\n serverFilter?: {},\r\n localDataSync?: _LocalDataSyncType\r\n) => {\r\n if (!data.timestamp || localData || !!forceServerDataRefresh) {\r\n // now if there is no data do a get request\r\n\r\n await actions.ovl.table._TableRefreshDataFromServer({\r\n def,\r\n data,\r\n localData,\r\n serverFilter,\r\n localDataSync,\r\n })\r\n }\r\n}\r\n\r\nexport const _EnrichColumnsFromSchema = (\r\n data: SYSTableData,\r\n def: SYSTableDef\r\n) => {\r\n let schema = data.schema\r\n if (\r\n !def.columnsInitialisedFromSchema &&\r\n def.database.useSchema &&\r\n schema !== undefined\r\n ) {\r\n def.columnsInitialisedFromSchema = true\r\n Object.keys(def.columns).forEach((f) => {\r\n let col = def.columns[f]\r\n if (!col.type && schema?.[f]) {\r\n col.type = schema[f].type\r\n }\r\n if (!col.ui?.align) {\r\n let align: _ColumnAlign =\r\n !col.list && (col.type === \"decimal\" || col.type === \"int\")\r\n ? \"right\"\r\n : \"left\"\r\n if (!col.ui) {\r\n col.ui = { align }\r\n } else {\r\n col.ui.align = align\r\n }\r\n }\r\n })\r\n }\r\n}\r\n\r\nexport const TableSortFn = (def: SYSTableDef, restable: any[], data: any) => {\r\n let validSortGroupsFn = []\r\n let fn = ovl.getActions().app.features[def.feature]\r\n if (fn?.hooks) {\r\n def.options.tableGroupAggregates.groups\r\n .filter((f) => f.respectInSort === \"ForceGroup\")\r\n .forEach((group) => {\r\n let fnName = HookTableGroupSortValue.replace(\r\n \"{groupKey}\",\r\n group.groupCode\r\n )\r\n if (!fn.hooks[fnName]) {\r\n fnName = HookTableGroupValue.replace(\"{groupKey}\", group.groupCode)\r\n }\r\n if (fn.hooks[fnName]) {\r\n validSortGroupsFn.push(fn.hooks[fnName])\r\n }\r\n })\r\n }\r\n const sortfield = def.uiState.sort.sort.field\r\n let type\r\n let isList: boolean\r\n let colDef\r\n if (sortfield) {\r\n type = def.columns[sortfield].type\r\n isList = def.columns[sortfield].list !== undefined\r\n colDef = def.columns[sortfield]\r\n }\r\n let lang = ovl.getState().ovl.session.Language\r\n\r\n let customSortFn = undefined\r\n let sortCustom = def.uiState.sort.sortCustom\r\n\r\n if (sortCustom.selected && sortCustom.sorts[sortCustom.selected]) {\r\n let functionName = HookTableCustomSort.replace(\r\n \"{sortKey}\",\r\n sortCustom.selected\r\n )\r\n if (fn?.hooks?.[functionName]) {\r\n customSortFn = fn.hooks[functionName]\r\n } else {\r\n throw new Error(\r\n \"ovl customSort function: \" +\r\n functionName +\r\n \" in customFunctions not found!\"\r\n )\r\n }\r\n }\r\n\r\n let renderSortfieldValueFn = undefined\r\n\r\n if (sortfield && fn?.hooks) {\r\n let fnName = HookFieldGetValueRender.replace(\"{subFeature}\", \"\").replace(\r\n \"{fieldKey}\",\r\n sortfield\r\n )\r\n if (fn?.hooks?.[fnName]) {\r\n renderSortfieldValueFn = fn.hooks[fnName]\r\n }\r\n }\r\n\r\n const ascending = def.uiState.sort.sort.direction === \"asc\" ? 1 : -1\r\n const useValue = def.uiState.sort.sort.useValue\r\n let sortByFeedback = !!def.uiState.sort.byFeedback\r\n let res: number = 0\r\n return restable.sort((a, b) => {\r\n for (let fn of validSortGroupsFn) {\r\n let groupValA = fn({\r\n def,\r\n data,\r\n row: data[a],\r\n })\r\n let groupValB = fn({\r\n def,\r\n data,\r\n row: data[b],\r\n })\r\n res = SortGet(groupValA, groupValB)\r\n if (res !== 0) {\r\n return res\r\n }\r\n }\r\n if (sortByFeedback) {\r\n res =\r\n data[b].OvlSysState.lastFeedbackTS - data[a].OvlSysState.lastFeedbackTS\r\n if (res !== 0) {\r\n return res\r\n }\r\n }\r\n if (customSortFn !== undefined) {\r\n return customSortFn(<\r\n HookTableCustomSort_Type\r\n >{\r\n def,\r\n lang,\r\n a,\r\n b,\r\n data /*if we have other logic than \"ForceGroup\" submit the groupRes here as param -> , groupRes*/,\r\n })\r\n }\r\n if (sortfield) {\r\n let valB\r\n let valA\r\n if (!renderSortfieldValueFn) {\r\n valA = data[a][sortfield]\r\n valB = data[b][sortfield]\r\n } else {\r\n let renderVal: HookFieldGetValueRender_ReturnType\r\n renderVal = renderSortfieldValueFn({\r\n tableDef: def,\r\n rowKey: a,\r\n row: data[a],\r\n columnKey: sortfield,\r\n displayMode: \"Table\",\r\n })\r\n if (!renderVal) {\r\n valA = data[a][sortfield]\r\n } else {\r\n valA =\r\n renderVal.valueRaw !== undefined\r\n ? renderVal.valueRaw\r\n : renderVal.res\r\n }\r\n renderVal = renderSortfieldValueFn(<\r\n HookFieldGetValueRender_Type\r\n >{\r\n tableDef: def,\r\n rowKey: b,\r\n row: data[b],\r\n columnKey: sortfield,\r\n displayMode: \"Table\",\r\n })\r\n if (!renderVal) {\r\n valB = data[b][sortfield]\r\n } else {\r\n valB =\r\n renderVal.valueRaw !== undefined\r\n ? renderVal.valueRaw\r\n : renderVal.res\r\n }\r\n }\r\n\r\n if (isList && !useValue) {\r\n valB = getDisplayValue(\r\n sortfield,\r\n colDef,\r\n valB,\r\n def.feature,\r\n undefined,\r\n def.id\r\n )\r\n valA = getDisplayValue(\r\n sortfield,\r\n colDef,\r\n valA,\r\n def.feature,\r\n undefined,\r\n def.id\r\n )\r\n }\r\n res = SortGet(valA, valB)\r\n return res * ascending\r\n }\r\n })\r\n}\r\n\r\nexport const _TableFilterFn = (\r\n tableDataAndDef: TableDataAndDef,\r\n calledFromColumnFilterId?: string\r\n): string[] => {\r\n // filter should only operate on rows not in add-mode\r\n let def = tableDataAndDef.def\r\n let lang = ovl.getState().ovl.session.Language\r\n let data = tableDataAndDef.data.data\r\n let columns = def.uiState.filter.columns\r\n let originalColumns = def.columns\r\n let restable: string[]\r\n restable = Object.keys(data)\r\n\r\n // new 01.07.2024, do not filter out add mode. because we habve autoRebuild feature which would make this rows in edit/add disappear\r\n // let restable = Object.keys(data).filter(\r\n // (f) => tableDataAndDef.data.rowState[f].state !== \"Add\"\r\n // )\r\n const staticFilter = def.uiState.filter.filter.static\r\n // make sure that\r\n // 1. staticFilter gets applied (for master - details scenarios)\r\n // 2. temp rows in add mode get filtered out (they are handled in addRwos array)\r\n // 3. rows which point to null gets filtered out (eg. delete => sets em to null)\r\n\r\n let filterKeys = Object.keys(staticFilter)\r\n filterKeys.forEach((f) => {\r\n restable = restable.filter((v) => {\r\n let rowState = (data[v].OvlSysState as OvlSysColumn).rowState\r\n if (rowState && rowState.lastChangeBelongsToTableDefId) {\r\n // now if staticfilter still matches\r\n // then it still belongs to selection. else delete it from selection\r\n if (\r\n filterKeys.filter((f2) => staticFilter[f2] === data[v][f2]).length !==\r\n filterKeys.length\r\n ) {\r\n if (def.uiState.selectedRow[v]) {\r\n def.uiState.selectedRow[v].selected = false\r\n def.uiState.selectedRow[v].showNav = false\r\n }\r\n }\r\n rowState.lastChangeBelongsToTableDefId = undefined\r\n }\r\n return data[v][f] === staticFilter[f]\r\n })\r\n })\r\n let filterCustom = def.uiState.filter.filterCustom\r\n let customFilter = Object.keys(filterCustom).filter(\r\n (k) => filterCustom[k].active\r\n )\r\n let customFilterFn = customFilter.reduce((val, k) => {\r\n let functionName = HookTableCustomFilter.replace(\"{filterKey}\", k)\r\n let fn = ovl.getActions().app.features[def.feature]\r\n if (fn?.hooks?.[functionName]) {\r\n val.push(fn.hooks[functionName])\r\n return val\r\n } else {\r\n throw new Error(\r\n \"ovl customFilter function: \" + functionName + \" not found!\"\r\n )\r\n }\r\n }, [])\r\n let hasCustomFilter = customFilterFn.length > 0\r\n let selectedRow = def.uiState.selectedRow\r\n let visibleColumns = Object.keys(def.columns).filter(\r\n (f) => def.columns[f].ui.visibility.indexOf(\"Table\") > -1\r\n )\r\n\r\n let columnFilterColumns = Object.keys(def.uiState.filter.columns).filter(\r\n (k) =>\r\n columns[k].columnFilter &&\r\n columns[k].columnFilter.type !== \"none\" &&\r\n k !== calledFromColumnFilterId\r\n )\r\n let hasColumnFilter = columnFilterColumns.length > 0\r\n let rangeFilterColumns = Object.keys(def.uiState.filter.columns).filter(\r\n (s) => columns[s].rangeFilter && columns[s].rangeFilter.selected !== \"none\"\r\n )\r\n let hasRangeFilters = rangeFilterColumns.length > 0\r\n\r\n // restable is now filtered by static filter already, thats fine and our starting point for the next 4 filters\r\n\r\n // 1. selectedFilter = just ignore other filters\r\n // 2. columnFilters\r\n // 3. customFilters\r\n // 4. attributeFilter\r\n // 5. tableFilter\r\n\r\n // 1st Selected filter is easy. When activated just return the selected rows\r\n\r\n if (\r\n calledFromColumnFilterId === undefined &&\r\n def.uiState.filter.filter.showSelected\r\n ) {\r\n return Object.keys(selectedRow).filter((k) => selectedRow[k].selected)\r\n }\r\n\r\n // now the rangefilters\r\n if (hasRangeFilters) {\r\n restable = restable.filter((rowKey) => {\r\n // now go column by column\r\n return (\r\n rangeFilterColumns.filter((columnId) => {\r\n let column = columns[columnId]\r\n let row = data[rowKey]\r\n let val = column.rangeFilter.val\r\n let val2 = column.rangeFilter.val2\r\n let valToCompare = row[columnId]\r\n if (originalColumns[columnId].type === \"date\") {\r\n valToCompare = `${getOnlyDateISOString(\r\n new Date(valToCompare)\r\n )}T00:00:00`\r\n }\r\n switch (column.rangeFilter.selected) {\r\n case \"equal\":\r\n return val === valToCompare\r\n case \"greaterThanOrEqual\":\r\n return valToCompare >= val && (!val2 || valToCompare <= val2)\r\n case \"lessThanOrEqual\":\r\n return valToCompare <= val\r\n }\r\n }).length === rangeFilterColumns.length\r\n )\r\n })\r\n }\r\n\r\n // now do the columnfilters\r\n if (hasColumnFilter) {\r\n restable = restable.filter((rowKey) => {\r\n let res = columnFilterColumns.filter((columnId) => {\r\n let column = columns[columnId]\r\n let filter = column.columnFilter\r\n\r\n let nullHandling = def.columns[columnId].nullHandling.enabled\r\n let val\r\n // if its caluclated we need to get caluclatedvalue as well here\r\n // if (def.columns[columnId].schema?.isCalculatedColumn) {\r\n val = GetRowRawValue(def, columnId, data[rowKey], rowKey)\r\n // } else {\r\n // val = data[rowKey][columnId]\r\n // }\r\n // there can be multiple filters so if one fits its valid (=>some())\r\n let res = filter.list.some((s) => {\r\n return val === s || (!nullHandling && s === \"\" && val === null)\r\n })\r\n if (filter.exclusive) {\r\n res = !res\r\n }\r\n return res\r\n })\r\n return res.length === columnFilterColumns.length\r\n })\r\n }\r\n\r\n // now the customFilters\r\n if (hasCustomFilter) {\r\n let data = tableDataAndDef.data\r\n restable = restable.filter((rowKey) => {\r\n let row = data.data[rowKey]\r\n return !customFilterFn.some(\r\n (f) => !f({ def, lang, data, row } as HookTableCustomFilter_Type)\r\n )\r\n })\r\n }\r\n //console.log(JSON.parse(JSON.stringify(def.uiState.filter.filterAttributes)))\r\n let filterAttributes = def.uiState.filter.filterAttributes\r\n if (filterAttributes) {\r\n let getAttributesFn =\r\n ovl.getActions().app.features[def.feature]?.hooks?.[\r\n HookTableRowAttributesGetAttributes\r\n ]\r\n if (getAttributesFn) {\r\n let data = tableDataAndDef.data\r\n let attributeDefKeys = Object.keys(filterAttributes)\r\n attributeDefKeys.forEach((defKey) => {\r\n restable = restable.filter((rowKey) => {\r\n let row = data.data[rowKey]\r\n let attributesToCheckFor = Object.keys(\r\n filterAttributes[defKey].attributes\r\n )\r\n let cnt = attributesToCheckFor.length\r\n if (cnt === 0) {\r\n return true\r\n }\r\n let rowAttributes = getAttributesFn({\r\n defId: def.id,\r\n row,\r\n rowAttributeDefKey: defKey,\r\n } as HookTableRowAttributesGetAttributes_Type)\r\n if (rowAttributes === undefined) {\r\n return false\r\n }\r\n let isArray = Array.isArray(rowAttributes)\r\n return (\r\n attributesToCheckFor.filter((attributeKey) => {\r\n if (isArray) {\r\n return rowAttributes.indexOf(attributeKey) > -1\r\n } else {\r\n return rowAttributes[attributeKey]\r\n }\r\n }).length === cnt\r\n )\r\n })\r\n })\r\n }\r\n }\r\n\r\n // if tablefiltering is switched off thats it, just return\r\n if (!def.features.filter) {\r\n return restable\r\n }\r\n let hasTableFilter = def.uiState.filter.filter.value !== \"\"\r\n //and the tableFilter which checks all the columns\r\n if (hasTableFilter) {\r\n let renderValueFns = {}\r\n let fn = ovl.getActions().app.features[def.feature]?.hooks\r\n if (fn) {\r\n visibleColumns.forEach((columnKey) => {\r\n let fnName = HookFieldGetValueRender.replace(\r\n \"{subFeature}\",\r\n \"\"\r\n ).replace(\"{fieldKey}\", columnKey)\r\n if (fn[fnName]) {\r\n renderValueFns[columnKey] = fn[fnName]\r\n }\r\n })\r\n }\r\n\r\n restable = restable.filter((rowKey) => {\r\n return visibleColumns.some((columnId) => {\r\n let column = def.columns[columnId]\r\n let dispValue\r\n if (renderValueFns[columnId]) {\r\n let renderVal: HookFieldGetValueRender_ReturnType = renderValueFns[\r\n columnId\r\n ]({\r\n tableDef: def,\r\n rowKey,\r\n row: data[rowKey],\r\n columnKey: columnId,\r\n displayMode: \"Table\",\r\n })\r\n dispValue = renderVal.valueRaw ? renderVal.valueRaw : renderVal.res\r\n } else {\r\n dispValue = getDisplayValue(\r\n columnId,\r\n column,\r\n data[rowKey][columnId],\r\n def.feature,\r\n undefined,\r\n def.id\r\n )\r\n }\r\n\r\n if (dispValue === null || dispValue === undefined) {\r\n return false\r\n }\r\n return (\r\n dispValue\r\n .toString()\r\n .toLowerCase()\r\n .indexOf(def.uiState.filter.filter.value.toLowerCase()) > -1\r\n )\r\n })\r\n })\r\n }\r\n\r\n return restable\r\n}\r\n\r\nexport const getFormFieldsFromColumns = (\r\n def: SYSTableDef,\r\n row,\r\n noLabel?: boolean\r\n) => {\r\n // use this to initialise formfields when coming from table\r\n // if something is generic to a formfield put it in the other helper method which also will be used for custom forms\r\n let formFields: { [key: string]: SYSFormField } = {}\r\n let columns = def.columns\r\n Object.keys(columns).map((k) => {\r\n let col = columns[k]\r\n if (col.ui.visibility.indexOf(\"Edit\") > -1) {\r\n let type: DataType = \"text\"\r\n if (col.control === \"checkbox\") {\r\n if (col.ui.checkedValue === undefined) {\r\n col.ui.checkedValue = true\r\n }\r\n if (col.type === undefined) {\r\n col.type = \"bool\"\r\n }\r\n }\r\n if (col.type) {\r\n type = col.type\r\n }\r\n formFields[k] = {\r\n type,\r\n value:\r\n type === \"object\" && row[k] !== null\r\n ? JSON.stringify(row[k])\r\n : row[k],\r\n nullHandling: {\r\n enabled: col.nullHandling.enabled,\r\n setToNullIf: col.nullHandling.setToNullIf,\r\n setToValueIfNull: col.nullHandling.setToValueIfNull,\r\n },\r\n list: col.list\r\n ? JSON.parse(JSON.stringify(col.list), stringifyReplacer)\r\n : undefined,\r\n ui: col.ui\r\n ? JSON.parse(JSON.stringify(col.ui), stringifyReplacer)\r\n : undefined,\r\n schema: col.schema ? JSON.parse(JSON.stringify(col.schema)) : undefined,\r\n groups: col.groups,\r\n\r\n editor: col.editor,\r\n }\r\n if (!formFields[k].ui) {\r\n formFields[k].ui = {}\r\n }\r\n formFields[k].ui.noLabel = col.ui?.noLabel === true ? true : !!noLabel\r\n let visible: _ColumnVisibility\r\n if (\r\n col.ui.language &&\r\n col.ui.language !== ovl.getState().ovl.session.Language\r\n ) {\r\n visible = col.ui.translationVisibility\r\n } else {\r\n visible = col.ui.visibility\r\n }\r\n if (visible && visible.indexOf(\"Edit\") < 0) {\r\n formFields[k].inactive = true\r\n formFields[k].ui.visible = \"false\"\r\n }\r\n\r\n if (formFields[k].groups === undefined) {\r\n formFields[k].groups = { group: 0, tab: 0 }\r\n }\r\n\r\n if (formFields[k].groups.group === undefined) {\r\n formFields[k].groups.group = 0\r\n }\r\n\r\n if (formFields[k].groups.tab === undefined) {\r\n formFields[k].groups.tab = 0\r\n }\r\n\r\n if (col.control === \"option\") {\r\n if (!formFields[k].list) {\r\n throw new Error(\"ovl controltype 'control' needs list defined..\")\r\n }\r\n formFields[k].list.mode = \"Option\"\r\n }\r\n if (col.type === \"date\" && col.ui.useBrowserDatePicker) {\r\n col.control = \"date\"\r\n }\r\n if (\r\n formFields[k].list &&\r\n formFields[k].list.showCachedHitsWhileTyping === undefined\r\n ) {\r\n formFields[k].list.showCachedHitsWhileTyping =\r\n def.options.controlsRendering.list.displayCachedListsWhileTyping\r\n }\r\n formFields[k].ui.displayValueHintWhileTyping =\r\n def.options.edit.displayValueHintWhileTyping\r\n\r\n formFields[k].control = col.control\r\n formFields[k].order = col.order\r\n def.options.edit.displayValueHintWhileTyping\r\n }\r\n })\r\n return formFields\r\n}\r\n\r\nexport type _RowFnCanToSet = {\r\n [key: string]: {\r\n visibility?: FormFnCan_Visibility\r\n tooltip?: string\r\n icon?: string\r\n customClass?: string\r\n }\r\n}\r\n\r\nexport const _GetRowFnToSet = (def: SYSTableDef): _RowFnCanToSet => {\r\n let customRowActions = def.options.customRowActions\r\n let res: any = Object.keys(customRowActions)\r\n .filter((f) => customRowActions[f].mode.indexOf(\"Row\") > -1)\r\n .reduce((val, fnNameId) => {\r\n let custom = customRowActions[fnNameId]\r\n\r\n val[fnNameId] = {\r\n visibility: \"Visible\",\r\n icon: custom.icon,\r\n tooltip: T(custom.translationKey),\r\n customClass: undefined,\r\n }\r\n return val\r\n }, {})\r\n\r\n if (\r\n !Object.keys(def.columns).some(\r\n (k) => def.columns[k].ui.visibility.indexOf(\"Edit\") > -1\r\n )\r\n ) {\r\n if (res.OvlCopy) {\r\n res.OvlCopy.visibility = \"NotVisible\"\r\n }\r\n if (res.OvlEdit) {\r\n res.OvlEdit.visibility = \"NotVisible\"\r\n }\r\n }\r\n\r\n return res\r\n}\r\n\r\nexport const _DoRowFnProcessRunningCheck = (\r\n rowControlActions: _RowFnCanToSet,\r\n def: SYSTableDef,\r\n key: string,\r\n singleFnId: string\r\n) => {\r\n let customRowActions = def.options.customRowActions\r\n let processState = ovl.getState().ovl.longRunningProcessTracker\r\n let hasEditBlock = false\r\n let hasViewBlock = false\r\n let alreadyDisabled = new Set()\r\n Object.keys(customRowActions)\r\n .filter(\r\n (k) =>\r\n customRowActions[k].process !== \"None\" &&\r\n (!singleFnId || k === singleFnId)\r\n )\r\n .forEach((fnNameId) => {\r\n // get the process name out of def\r\n let process = (\r\n def.options.customRowActions?.[fnNameId]?.process\r\n )\r\n // danger code: when changing check tracking with some rowfns and also in rehydrate mode\r\n // reason: checking if a process is running will check some state. this state is not guaranteed to be there thats why it will be cerated in ProcessIsRunning\r\n let instanceKey = `${def.id}_OvlSep_${fnNameId}_OvlSep_Multi`\r\n let isRunning = ProcessIsRunning(process, instanceKey)\r\n let instanceState = processState[process].instance?.[instanceKey]\r\n isRunning = !!instanceState.tableFn.lockedTableKeys[key] && isRunning\r\n if (isRunning) {\r\n if (!hasEditBlock) {\r\n hasEditBlock = customRowActions[fnNameId].blocking?.group === \"edit\"\r\n }\r\n if (!hasViewBlock) {\r\n hasViewBlock = customRowActions[fnNameId].blocking?.group === \"view\"\r\n }\r\n }\r\n if (!isRunning) {\r\n instanceKey = `${def.id}_OvlSep_${fnNameId}_OvlSep_${key}`\r\n isRunning = ProcessIsRunning(process, instanceKey)\r\n instanceState = processState[process].instance?.[instanceKey]\r\n isRunning = !!instanceState.tableFn.lockedTableKeys[key] && isRunning\r\n if (isRunning) {\r\n if (!hasEditBlock) {\r\n hasEditBlock = customRowActions[fnNameId].blocking?.group === \"edit\"\r\n }\r\n if (!hasViewBlock) {\r\n hasViewBlock = customRowActions[fnNameId].blocking?.group === \"view\"\r\n }\r\n }\r\n }\r\n if (isRunning) {\r\n if (rowControlActions[fnNameId]) {\r\n rowControlActions[fnNameId].visibility = \"Disabled\"\r\n alreadyDisabled.add(fnNameId)\r\n }\r\n }\r\n })\r\n if (hasEditBlock || hasViewBlock) {\r\n Object.keys(rowControlActions)\r\n .filter(\r\n (f) =>\r\n rowControlActions[f].visibility !== \"NotVisible\" &&\r\n (!singleFnId || f === singleFnId) &&\r\n !alreadyDisabled.has(f)\r\n )\r\n .forEach((fnNameId) => {\r\n if (hasEditBlock) {\r\n rowControlActions[fnNameId].visibility = \"Disabled\"\r\n } else if (\r\n hasViewBlock &&\r\n customRowActions[fnNameId].blocking.group === \"edit\"\r\n ) {\r\n rowControlActions[fnNameId].visibility = \"Disabled\"\r\n }\r\n })\r\n }\r\n}\r\n\r\nexport const createDynamicRowFunctions = async (\r\n def: SYSTableDef,\r\n data: SYSTableData,\r\n key: string,\r\n isTableRowDetailView: boolean\r\n): Promise<_RowFnCanToSet> => {\r\n let rowControlActions: _RowFnCanToSet = _GetRowFnToSet(def)\r\n // first all custom ones\r\n let comp = _RenderTracking.currentComponent\r\n // now check if an action is running and disable\r\n // we only need to do it for custom actions because the other ones are handled\r\n // but we will set the delete and edit,copy to disabled if one of the proc is running\r\n\r\n let fn = ovl.getActions().app.features[def.feature]\r\n let functionName = HookTableRowFnCan\r\n\r\n if (fn?.hooks?.[functionName]) {\r\n await fn.hooks[functionName]({\r\n _functionsToSet: rowControlActions,\r\n rowKey: key,\r\n tableDef: def,\r\n tableData: data,\r\n row: data.data[key],\r\n set: (fnKey: string, options: {}) => {\r\n _tableRowFnSetHelper(fnKey, options, rowControlActions)\r\n },\r\n } as HookTableRowFnCan_Type)\r\n }\r\n\r\n _RenderTracking.currentComponent = comp\r\n _RenderTracking.pauseTracking = false\r\n\r\n _DoRowFnProcessRunningCheck(rowControlActions, def, key, undefined)\r\n\r\n return rowControlActions\r\n}\r\n\r\nexport const _tableRowFnSetHelper = (\r\n fnKey: string | string[],\r\n options: any,\r\n functionsToSet: {}\r\n) => {\r\n if (!Array.isArray(fnKey)) {\r\n fnKey = [fnKey]\r\n }\r\n fnKey.forEach((key) => {\r\n if (functionsToSet[key]) {\r\n if (options.visibility) {\r\n if (\r\n options.visibility !== \"Disabled\" ||\r\n functionsToSet[key].visibility !== \"NotVisible\"\r\n ) {\r\n functionsToSet[key].visibility = options.visibility\r\n }\r\n }\r\n if (options.icon) {\r\n functionsToSet[key].icon = options.icon\r\n }\r\n if (options.tooltip) {\r\n functionsToSet[key].tooltip = options.tooltip\r\n }\r\n if (options.customClass) {\r\n functionsToSet[key].customClass = options.customClass\r\n }\r\n }\r\n })\r\n}\r\n\r\nexport const _showTableRowFnConfirm = async (\r\n systemValidationContent: any,\r\n systemConfirmContent: any,\r\n customConfirmContent: any,\r\n title: any,\r\n connectedForm: { formType: string; formId: string }\r\n): Promise => {\r\n return DialogOkCancel(\r\n html`
\r\n
${systemValidationContent}
\r\n
${customConfirmContent}
\r\n
${systemConfirmContent}
\r\n
`,\r\n { title, connectedForm }\r\n )\r\n}\r\n\r\nexport let _GetFnResultToSet = (\r\n fnKey,\r\n process,\r\n data\r\n): RowFunctionResultToSet => {\r\n return {\r\n setFromResult: async (res) => {\r\n let res2 = JSON.parse(JSON.stringify(res))\r\n let rowKey = data.index[res2.id]\r\n // if its an new data, we need the id lateron after we have created the row\r\n if (rowKey) {\r\n res2.id = rowKey\r\n }\r\n res2.fnId = fnKey\r\n await process.setFromResult(res2)\r\n return rowKey\r\n },\r\n setSuccess(\r\n id,\r\n text,\r\n code,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) {\r\n let rowKey = data.index[id]\r\n process.setSuccess(id, text, code, cnt)\r\n return rowKey\r\n },\r\n setInformation(\r\n id,\r\n text,\r\n code,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) {\r\n let rowKey = data.index[id]\r\n process.setInformation(id, text, code, cnt)\r\n return rowKey\r\n },\r\n setWarning(\r\n id,\r\n text,\r\n code,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) {\r\n let rowKey = data.index[id]\r\n process.setWarning(id, text, code, cnt)\r\n return rowKey\r\n },\r\n setError(\r\n id,\r\n text,\r\n code,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) {\r\n let rowKey = data.index[id]\r\n process.setError(id, text, code, cnt)\r\n return rowKey\r\n },\r\n }\r\n}\r\n\r\nexport const rowControlActionsHandler = async (\r\n isCustom: boolean,\r\n\r\n key: string,\r\n def: SYSTableDef,\r\n data: SYSTableData,\r\n rowKey: string,\r\n isTableRowDetailView: boolean\r\n //formState?: SYSFormState\r\n) => {\r\n //if (isCustom) {\r\n let customFns = ovl.getActions().app.features[def.feature]\r\n let fnResultToSet: RowFunctionResultToSet = {}\r\n\r\n let connectedFormBehaviour = {\r\n formType: undefined,\r\n formId: undefined,\r\n fieldsResetType: undefined,\r\n }\r\n if (customFns) {\r\n let customFunctionName = HookTableRowFn\r\n let customFunction = customFns.hooks[customFunctionName]\r\n let customFnDef = def.options.customRowActions[key]\r\n if (\r\n key === \"OvlDelete\" ||\r\n key === \"OvlCopy\" ||\r\n key === \"OvlEdit\" ||\r\n customFunction ||\r\n customFnDef?.endpoint?.url\r\n ) {\r\n let process: _ProcessReturnType\r\n let connectedConfirmFormState\r\n // if (isTableRowDetailView) {\r\n // ovl.getActions().ovl.dialog._DialogClose(\"SYSTableRowDetailView\")\r\n // }\r\n let trackStatusIntervall = { id: -1 }\r\n let clientId = ovl.getState().ovl.app.clientId\r\n if (customFnDef) {\r\n let systemConfirmContent = T(\"SYSTableRowFnConfirm\", [\r\n T(customFnDef.translationKey),\r\n \"\",\r\n ])\r\n let systemValidationContent\r\n let customConfirmContent\r\n let fnName = T(customFnDef.translationKey)\r\n if (\r\n customFnDef?.prompt.type === \"Always\" ||\r\n customFnDef?.prompt.type === \"WhenMultiOrHookResult\"\r\n ) {\r\n let validKeys = [rowKey]\r\n let confirmRes = await _RowFnConfirmFormHelper(\r\n systemConfirmContent,\r\n systemValidationContent,\r\n customConfirmContent,\r\n key,\r\n connectedFormBehaviour,\r\n customFnDef,\r\n customFns,\r\n data,\r\n def,\r\n rowKey,\r\n fnName,\r\n validKeys,\r\n [rowKey],\r\n customFnDef?.prompt.type === \"WhenMultiOrHookResult\"\r\n )\r\n if (!confirmRes || validKeys.length === 0) {\r\n return\r\n }\r\n }\r\n\r\n if (customFnDef.process !== \"None\") {\r\n // we don't do snacks fro local deletes\r\n let snack: ProcessSnackType = { type: \"none\" }\r\n if (\r\n !(\r\n key === \"OvlDelete\" &&\r\n def.features.saveLocallyMode === \"SaveLocally\"\r\n )\r\n ) {\r\n snack = {\r\n text: T(customFnDef.process, [T(customFnDef.translationKey), \"\"]),\r\n type: \"BusyIndicator\",\r\n }\r\n }\r\n process = ProcessStart(customFnDef.process, {\r\n instance: `${def.id}_OvlSep_${key}_OvlSep_${rowKey}`,\r\n snack,\r\n tableFn: {\r\n fnId: key,\r\n tableDefId: def.id,\r\n fnName,\r\n lockedTableKeys: { [rowKey]: true },\r\n rowKey,\r\n },\r\n })\r\n fnResultToSet = _GetFnResultToSet(key, process, data)\r\n\r\n if (process && customFnDef.trackData !== \"None\") {\r\n _handleRowFnTracking(\r\n customFnDef.trackData,\r\n trackStatusIntervall,\r\n `${key}_${rowKey}`,\r\n clientId,\r\n process,\r\n fnResultToSet,\r\n fnName\r\n )\r\n }\r\n }\r\n\r\n if (connectedFormBehaviour?.formType) {\r\n connectedConfirmFormState = FormGet(\r\n connectedFormBehaviour.formType,\r\n {\r\n instance: connectedFormBehaviour.formId,\r\n }\r\n )\r\n }\r\n }\r\n try {\r\n if (customFnDef?.endpoint?.url) {\r\n await _handleRowFnEndpointData(\r\n `${key}_${rowKey}`,\r\n clientId,\r\n customFnDef.endpoint.url,\r\n fnResultToSet,\r\n data,\r\n def,\r\n [rowKey],\r\n connectedConfirmFormState,\r\n process,\r\n undefined\r\n )\r\n } else {\r\n if (key === \"OvlDelete\") {\r\n await ovl.getActions().ovl.internal._TableDeleteRow({\r\n key: rowKey,\r\n def: def,\r\n data,\r\n process: process,\r\n })\r\n } else if (key === \"OvlCopy\") {\r\n let res = await ovl.getActions().ovl.internal._TableCopyRow({\r\n key: rowKey,\r\n def: def,\r\n data,\r\n })\r\n await ovl\r\n .getActions()\r\n .ovl.table._TableEditRow({ key: res.key, data, def })\r\n } else if (key === \"OvlEdit\") {\r\n await ovl\r\n .getActions()\r\n .ovl.table._TableEditRow({ key: rowKey, data, def })\r\n } else {\r\n await customFunction({\r\n fnKey: key,\r\n isSingle: true,\r\n rowKey,\r\n def,\r\n data,\r\n row: data.data[rowKey],\r\n rows: data.data,\r\n selectedKeys: [rowKey],\r\n resultToSet: fnResultToSet,\r\n connectedConfirmFormState,\r\n })\r\n }\r\n }\r\n if (\r\n !(\r\n key === \"OvlDelete\" &&\r\n def.features.saveLocallyMode === \"SaveLocally\"\r\n ) &&\r\n process\r\n ) {\r\n process.showSummary(customFnDef.summary)\r\n }\r\n if (process) {\r\n _handleRowFnConfirmFieldsReset(\r\n connectedFormBehaviour,\r\n process?.currentFeedback\r\n )\r\n _DoRebuildAndFixPage(def)\r\n }\r\n } finally {\r\n if (process) {\r\n clearInterval(trackStatusIntervall.id)\r\n process.stop()\r\n }\r\n }\r\n } else if (isCustom) {\r\n throw Error(\r\n \"SYS error: Custom Action: \" + customFunctionName + \" not found!\"\r\n )\r\n }\r\n }\r\n}\r\nexport const _RowFnConfirmFormHelper = async (\r\n systemConfirmContent,\r\n systemValidationContent,\r\n customConfirmContent,\r\n fnKey: string,\r\n connectedFormBehaviour,\r\n customFnDef,\r\n customFns,\r\n data: SYSTableData,\r\n def: SYSTableDef,\r\n rowKey: string,\r\n fnName: string,\r\n validKeys: string[],\r\n selectedKeys: string[],\r\n noPromptDependentFromHookResult?: boolean,\r\n title?: string\r\n): Promise => {\r\n let connectedFormState: SYSFormState\r\n let connectedForm: { formType: string; formId: string }\r\n let confirmContentFn = HookTableRowFnConfirm\r\n\r\n if (customFnDef?.prompt?.connectedForm) {\r\n let formIdKey\r\n if (rowKey) {\r\n formIdKey = rowKey\r\n } else {\r\n formIdKey = \"Multi\"\r\n }\r\n connectedFormState = await FormInit(\r\n `SYSTableRowFn${fnKey}`,\r\n customFnDef.prompt.connectedForm.formFields,\r\n {\r\n formId: `${def.id}_OvlSep_${formIdKey}`,\r\n feature: `${def.feature}`,\r\n subFeature: fnKey,\r\n\r\n tableDefId: def.id,\r\n }\r\n )\r\n connectedForm = {\r\n formType: connectedFormState.formType,\r\n formId: connectedFormState.formId,\r\n }\r\n connectedFormBehaviour.formType = connectedFormState.formType\r\n connectedFormBehaviour.formId = connectedFormState.formId\r\n connectedFormBehaviour.fieldsResetType =\r\n customFnDef.prompt.connectedForm.fieldsResetType\r\n }\r\n\r\n if (!title) {\r\n title = _GetTableDialogTitle(\r\n def,\r\n fnName,\r\n 1,\r\n data.data,\r\n validKeys[0],\r\n !!customFnDef?.whenCalledFromSelection?.grouped\r\n )\r\n }\r\n\r\n let cancelPrompt = false\r\n if (customFns?.hooks?.[confirmContentFn]) {\r\n let invalidKeys: string[] = []\r\n let toSet: HookTableRowFnConfirmToSet_Type = {\r\n systemConfirmContent,\r\n systemValidationContent,\r\n customConfirmContent,\r\n invalidKeys,\r\n }\r\n if (noPromptDependentFromHookResult) {\r\n // we have a usecase where we want to do some further checking in the confirm hook and cancel\r\n // use case: OvlCopy,OvlEdit do some further checking if action makes sense\r\n toSet.noPrompt = true\r\n }\r\n await customFns.hooks[confirmContentFn]({\r\n connectedFormState,\r\n defaultFormBodyRenderer: () =>\r\n FormBodyRenderer(\r\n connectedFormState,\r\n {\r\n feature: connectedFormState.feature,\r\n columns: connectedFormState.fields,\r\n options: { edit: { groups: {} } },\r\n },\r\n\r\n data.data[rowKey],\r\n data,\r\n rowKey\r\n ),\r\n isMulti: rowKey === undefined,\r\n fnKey: fnKey,\r\n rows: data.data,\r\n fnName,\r\n title,\r\n tableDefId: def.id,\r\n selectedKeys,\r\n validKeys,\r\n toSet,\r\n })\r\n systemConfirmContent = toSet.systemConfirmContent\r\n systemValidationContent = toSet.systemValidationContent\r\n customConfirmContent = toSet.customConfirmContent\r\n if (toSet.cancelFn) {\r\n return false\r\n }\r\n if (toSet.noPrompt) {\r\n cancelPrompt = true\r\n }\r\n // using splice here because the ref still should work\r\n toSet.invalidKeys.forEach((k) => {\r\n validKeys.splice(validKeys.indexOf(k), 1)\r\n })\r\n } else if (noPromptDependentFromHookResult) {\r\n cancelPrompt = true\r\n } else {\r\n // if there is no hook but a connected form just use default form renderer\r\n if (connectedForm) {\r\n customConfirmContent = FormBodyRenderer(\r\n connectedFormState,\r\n {\r\n feature: connectedFormState.feature,\r\n columns: connectedFormState.fields,\r\n options: { edit: { groups: {} } },\r\n },\r\n\r\n data.data[rowKey],\r\n data,\r\n rowKey\r\n )\r\n }\r\n }\r\n\r\n if (!cancelPrompt) {\r\n let res = await _showTableRowFnConfirm(\r\n systemValidationContent,\r\n systemConfirmContent,\r\n customConfirmContent,\r\n title,\r\n connectedForm\r\n )\r\n if (res === 2) {\r\n return false\r\n }\r\n }\r\n return true\r\n}\r\n\r\n// export const RowFnProcessErrorHelper = async (\r\n// process: ProcessReturnType,\r\n// errors: { [key: string]: string },\r\n// singleId: string,\r\n// rowKey: string\r\n// ) => {\r\n// // make sure that rowFnErrors are either on the _multi instance or on a single executed instance of the process\r\n// // this way we could execute a batch, then have a error in this batch, fix it and execute that specific line directly on the row\r\n// // and still the batches errors will persist even that single line now resolved successfully\r\n// let state = ovl.getState()\r\n// if (process) {\r\n// let instancesState =\r\n// state.ovl.longRunningProcessTracker[process.process].instance\r\n// let processDef = process.instance.split(\"_OvlSep_\")\r\n// let rowFnNameId = processDef[1]\r\n// let tableDefId = processDef[0]\r\n// let instanceStartWith = processDef.slice(0, 2).join(\"_OvlSep_\")\r\n// if (singleId) {\r\n// // if it was a single row execution now only the error from the single row is relevant\r\n// let processErrors2 = ProcessGetErrors(\r\n// process.process,\r\n// `${instanceStartWith}_OvlSep_Multi`\r\n// )\r\n// if (processErrors2) {\r\n// delete processErrors2[singleId]\r\n// }\r\n// } else {\r\n// Object.keys(instancesState)\r\n// .filter(\r\n// (k) =>\r\n// k.indexOf(\"_OvlSep_Multi\") < 0 &&\r\n// k.startsWith(instanceStartWith) &&\r\n// instancesState[process.instance].lockedTableKeys[\r\n// Object.keys(instancesState[k].lockedTableKeys)[0]\r\n// ]\r\n// )\r\n// .forEach((k) => (instancesState[k].errors = {}))\r\n// }\r\n// Object.keys(errors).forEach((k) => {\r\n// if (errors[k]) {\r\n// process.errors[k] = errors[k]\r\n// }\r\n// })\r\n\r\n// let tb = TableGet(tableDefId)\r\n// let fncName = HookTableRowFnCan\r\n// let fnc = ovl.getActions().app.features[tb.def.feature]?.hooks?.[fncName]\r\n// if (fnc) {\r\n// // delete all the errors for which the validate fn doesn not return visible\r\n// // first we need to get all the errors involved with this processtype\r\n// let errorsArray = Object.keys(instancesState)\r\n// .filter((k) => k.startsWith(instanceStartWith))\r\n// .map((k) => instancesState[k].errors)\r\n// let errorsMap = errorsArray.reduce((val, k) => {\r\n// Object.keys(k).forEach((k2) => {\r\n// //@ts-ignore\r\n// val[k2] = k\r\n// })\r\n// return val\r\n// }, {})\r\n// await Promise.all(\r\n// Object.keys(errorsMap).map(async (k) => {\r\n// let rowKey = tb.dataDef.index[k]\r\n// let iCan: HookTableRowFnCan_ReturnType = await fnc(<\r\n// HookTableRowFnCan_Type\r\n// >{\r\n// rowKey,\r\n// tableDef: tb.def,\r\n// tableData: tb.dataDef,\r\n// row: tb.dataDef.data[rowKey],\r\n// })\r\n// if (iCan?.[rowFnNameId]?.visibility !== \"Visible\") {\r\n// //delete the corresponding error on the process\r\n// delete errorsMap[k][k]\r\n// }\r\n// })\r\n// )\r\n// }\r\n// }\r\n// }\r\n\r\nexport type CachedRendererData = {\r\n hasRenderer: boolean\r\n fn: any\r\n}\r\n\r\nexport const GetRendererFn = (\r\n feature: SYSFeature,\r\n cachedRendererFn: Map,\r\n hookDef: string,\r\n fieldKey: string\r\n) => {\r\n let cachedRendererKey = feature + fieldKey + hookDef\r\n let cachedRenderer = cachedRendererFn.get(cachedRendererKey)\r\n let rendererFn\r\n if (!cachedRenderer) {\r\n let functionName = hookDef.replace(\"{fieldKey}\", fieldKey)\r\n let fn = ovl.getActions().app.features[feature]\r\n if (fn?.hooks?.[functionName]) {\r\n rendererFn = fn.hooks[functionName]\r\n cachedRendererFn.set(cachedRendererKey, {\r\n fn: rendererFn,\r\n hasRenderer: true,\r\n })\r\n } else {\r\n cachedRendererFn.set(cachedRendererKey, {\r\n fn: undefined,\r\n hasRenderer: false,\r\n })\r\n }\r\n } else if (cachedRenderer.hasRenderer) {\r\n rendererFn = cachedRenderer.fn\r\n }\r\n return rendererFn\r\n}\r\n\r\n// export const TableGetSelectedRowKeys = (def: SYSTableDef): string[] => {\r\n// let selected = def.uiState.selectedRow\r\n// return Object.keys(selected).filter((f) => selected[f].selected)\r\n// }\r\n\r\nexport const _TableSetColumnVisibility = async (\r\n def: SYSTableDef,\r\n actions: SYSActions,\r\n state: SYSState,\r\n fromInit: boolean\r\n) => {\r\n let columnsVisible = Object.keys(def.columns)\r\n .sort((a, b) => def.columns[a].order - def.columns[b].order)\r\n .reduce((val, k) => {\r\n let visible: _ColumnVisibility = \"Table_Edit_View\"\r\n let column = def.columns[k]\r\n\r\n if (\r\n column.ui &&\r\n column.ui.language &&\r\n column.ui.language !== state.ovl.session.Language\r\n ) {\r\n visible = column.ui.translationVisibility\r\n } else if (column.ui) {\r\n visible = column.ui.visibility\r\n }\r\n val[k] = visible\r\n return val\r\n }, {})\r\n\r\n let fn =\r\n actions.app.features[def.feature]?.hooks?.[HookTableSetColumnVisibility]\r\n if (fn) {\r\n await fn({\r\n def,\r\n columnsVisibilityToSet: columnsVisible,\r\n fromInit,\r\n screen: ScreenCurrent(),\r\n })\r\n }\r\n\r\n def.uiState.columnsRenderingState.visibleInTable = []\r\n Object.keys(columnsVisible).forEach((f) => {\r\n def.uiState.columnsRenderingState.columns[f].visibility = columnsVisible[f]\r\n if (_GetColumnInTableVisibility(columnsVisible[f])) {\r\n def.uiState.columnsRenderingState.visibleInTable.push(f)\r\n }\r\n })\r\n}\r\n\r\nexport const DoRefreshLookups = (\r\n actions: SYSActions,\r\n def: SYSTableDef,\r\n data: any,\r\n formState: SYSFormState\r\n) => {\r\n // if data contains lookup columns and GetLookups defined -> sync Lookups\r\n // this helps by sending the lookup cols in one query on the backend\r\n // (and still the lookups will be extended when eg. clicking on the db lookup in list)\r\n\r\n if (data && Array.isArray(data)) {\r\n if (data.length > 0) {\r\n let allColumnKeys = Object.keys(data[0])\r\n let keyToOvlL_Columns = {}\r\n for (let i = 0; i < allColumnKeys.length; i++) {\r\n let colKey = allColumnKeys[i]\r\n if (colKey.indexOf(\"OvlL_\") > 0) {\r\n let keyAndRest = colKey.split(\"OvlL_\")\r\n let keyColumn = keyAndRest[0]\r\n let rest = keyAndRest[1].split(\"_\")\r\n let lookupKey = rest[0]\r\n if (keyToOvlL_Columns[keyColumn] === undefined) {\r\n keyToOvlL_Columns[keyColumn] = { lookupKey, columns: {} }\r\n keyToOvlL_Columns[keyColumn].alreadySet = new Set()\r\n }\r\n let lookupColumnKey = keyAndRest[1].replace(`${lookupKey}_`, \"\")\r\n keyToOvlL_Columns[keyColumn].columns[lookupColumnKey] = {\r\n colKey,\r\n useFromRow: true,\r\n }\r\n }\r\n }\r\n let isV2Mode = Object.keys(keyToOvlL_Columns).length > 0\r\n let functionName = HookLookupsRefresh\r\n let fn = actions.app.features[def.feature]\r\n if (fn?.hooks?.[functionName]) {\r\n let lookups = fn.hooks[functionName]({\r\n formState,\r\n tableDefId: def.id,\r\n })\r\n if (!lookups) {\r\n return\r\n }\r\n let lookupsKeys = Object.keys(lookups)\r\n\r\n if (isV2Mode) {\r\n /* now lets see if:\r\n - there are columns in the lookupDef which are not satisfied \r\n - can be used directly from the row\r\n - are optional and can be ignored\r\n - have default values\r\n - is the Id Value\r\n */\r\n\r\n Object.keys(keyToOvlL_Columns).forEach((f) => {\r\n let lookupKey = keyToOvlL_Columns[f].lookupKey\r\n let lookupMainDef = lookups[lookupKey]\r\n if (lookupMainDef === undefined) {\r\n throw new Error(\r\n `Ovl Lookup Sync V2: TableDef ${def.id} Lookup ${lookupKey} not found in HookLookupsRefresh results...`\r\n )\r\n }\r\n // keyToOvlL_Columns[f].ignoreNulls =\r\n // lookupMainDef.nullHandling?.ignoreIfKeyIsNull === true\r\n // keyToOvlL_Columns[f].replaceLookupColumnsWithEmptyIfNull =\r\n // lookupMainDef.nullHandling\r\n // ?.replaceLookupColumnsWithEmptyIfNull === true\r\n\r\n let lookupDef = lookupMainDef.lookupDef\r\n let lookupDefKeys = Object.keys(lookupDef)\r\n lookupDefKeys.forEach((f2) => {\r\n if (!keyToOvlL_Columns[f].columns[f2]) {\r\n // its not a OvlL mapped one from the result so do some checks\r\n if (lookupDef[f2].isKey) {\r\n keyToOvlL_Columns[f].columns[f2] = { colKey: f, isKey: true }\r\n } else if (\r\n lookupDef[f2].mapToColumn &&\r\n allColumnKeys.indexOf(lookupDef[f2].mapToColumn) > -1\r\n ) {\r\n keyToOvlL_Columns[f].columns[f2] = {\r\n colKey: lookupDef[f2].mapToColumn,\r\n useFromRow: true,\r\n }\r\n } else if (lookupDef[f2].defaultValue) {\r\n keyToOvlL_Columns[f].columns[f2] = {\r\n colKey: undefined,\r\n useDefaultValue: true,\r\n defaultValue: lookupDef[f2].defaultValue,\r\n }\r\n } else if (lookupDef[f2].optional) {\r\n return\r\n } else {\r\n throw new Error(\r\n `Ovl Lookup Sync V2: TableDef ${\r\n def.id\r\n } Lookup ${lookupKey} not all columns satisfied from result. Missing ${f2}, ColumnDef: ${JSON.stringify(\r\n lookupDef[f2]\r\n )}`\r\n )\r\n }\r\n }\r\n })\r\n })\r\n // now that we know everything is ok with the lookups we can refresh them with data from the result\r\n // OvlL COlumsn can be deleted after refreshing the lookups\r\n let colsToDelete = Object.keys(data[0]).filter(\r\n (f) => f.indexOf(\"OvlL_\") > 0\r\n )\r\n\r\n data.forEach((resultRow) => {\r\n Object.keys(keyToOvlL_Columns).forEach((f) => {\r\n let idValue = resultRow[f]\r\n if (idValue === null || idValue === undefined) {\r\n return\r\n }\r\n if (!keyToOvlL_Columns[f].alreadySet.has(idValue)) {\r\n keyToOvlL_Columns[f].alreadySet.add(idValue)\r\n let lookupKey = keyToOvlL_Columns[f].lookupKey\r\n let lookupData = lookups[lookupKey].data\r\n let refreshed = false\r\n Object.keys(keyToOvlL_Columns[f].columns).forEach((c) => {\r\n let keyToOvl = keyToOvlL_Columns[f].columns[c]\r\n if (resultRow[keyToOvl.colKey] === undefined) {\r\n return\r\n }\r\n refreshed = true\r\n if (!lookupData[idValue]) {\r\n lookupData[idValue] = {}\r\n }\r\n\r\n if (keyToOvl.isKey) {\r\n lookupData[idValue][c] = idValue\r\n } else if (keyToOvl.useFromRow) {\r\n lookupData[idValue][c] = resultRow[keyToOvl.colKey]\r\n } else {\r\n lookupData[idValue][c] = keyToOvl.defaultValue\r\n }\r\n // if (\r\n // lookupData[idValue][c] === null &&\r\n // keyToOvlL_Columns[f].replaceLookupColumnsWithEmptyIfNull ===\r\n // true\r\n // ) {\r\n // lookupData[idValue][c] = \"\"\r\n // }\r\n })\r\n // call a hook which could add calculated lookup columns\r\n if (refreshed && fn?.hooks?.[HookLookupRowRefreshed]) {\r\n fn?.hooks?.[HookLookupRowRefreshed](<\r\n HookLookupRowRefreshed_Type\r\n >{\r\n lookupDataRow: lookupData[idValue],\r\n lookupDefKey: lookupKey,\r\n })\r\n }\r\n }\r\n })\r\n colsToDelete.forEach((c) => delete resultRow[c])\r\n })\r\n } else {\r\n lookupsKeys.forEach((lookupKey) => {\r\n let lookupDef: ListDefinition = lookups[lookupKey]\r\n if (lookupDef?.lookupDef === undefined) {\r\n return\r\n }\r\n let mappedDataToLookupColumnKeys = {}\r\n Object.keys(lookupDef.lookupDef).forEach((lookupColKey) => {\r\n let matchingDataColumnKey = Object.keys(data[0]).filter(\r\n (dataColKey) => dataColKey === lookupColKey\r\n )\r\n if (matchingDataColumnKey.length > 0) {\r\n mappedDataToLookupColumnKeys[matchingDataColumnKey[0]] =\r\n lookupColKey\r\n }\r\n })\r\n let keyColumnSearch = Object.keys(\r\n mappedDataToLookupColumnKeys\r\n ).filter(\r\n (k) => lookupDef.lookupDef[mappedDataToLookupColumnKeys[k]].isKey\r\n )\r\n let keyColumn\r\n let dataKeyColumn\r\n if (keyColumnSearch.length > 0) {\r\n keyColumn = mappedDataToLookupColumnKeys[keyColumnSearch[0]]\r\n dataKeyColumn = keyColumnSearch[0]\r\n }\r\n if (!keyColumn) {\r\n // get it from name convention Lookup Key = LookupColumn Key\r\n keyColumnSearch = Object.keys(\r\n mappedDataToLookupColumnKeys\r\n ).filter((k) => mappedDataToLookupColumnKeys[k] === lookupKey)\r\n if (keyColumnSearch.length < 1) {\r\n // throw new Error(\r\n // \"SYS no lookup key found. (Not in LookupCol.isKey or by LookupKey == LookupColKey\"\r\n // )\r\n return\r\n }\r\n keyColumn = mappedDataToLookupColumnKeys[keyColumnSearch[0]]\r\n dataKeyColumn = keyColumnSearch[0]\r\n }\r\n\r\n if (!lookups[lookupKey].data) {\r\n lookups[lookupKey][\"data\"] = {}\r\n }\r\n let lookupsData = lookups[lookupKey][\"data\"]\r\n data.forEach((row) => {\r\n let keyVal = row[dataKeyColumn]\r\n if (!lookupsData[keyVal]) {\r\n // its a new one\r\n lookupsData[keyVal] = {}\r\n }\r\n Object.keys(mappedDataToLookupColumnKeys).forEach(\r\n (mappedDataColumnKey) => {\r\n let lookupColumnKey =\r\n mappedDataToLookupColumnKeys[mappedDataColumnKey]\r\n lookupsData[keyVal][lookupColumnKey] =\r\n row[mappedDataColumnKey]\r\n }\r\n )\r\n })\r\n })\r\n }\r\n }\r\n //delete lookup list cache\r\n _cachedFieldLists.forEach((_value, key) => {\r\n if (key.startsWith(`@@table:${def.id}`)) {\r\n _cachedFieldLists.set(key, undefined)\r\n }\r\n })\r\n }\r\n } else {\r\n throw new Error(\"SYS Error: result needs to be an array\")\r\n }\r\n}\r\n\r\nexport const _ResetFilters = async (\r\n def: SYSTableDef,\r\n clear: boolean = false\r\n) => {\r\n // let def = tableDef.def\r\n let columns = def.columns\r\n let uiState = def.uiState\r\n if (!clear) {\r\n // if clear = false we are already in forcedFilter Context\r\n uiState.filter.filter.forcedFilterKeys = undefined\r\n }\r\n await Promise.all(\r\n Object.keys(columns).map(async (f) => {\r\n let col = def.columns[f]\r\n // todo separate loop for range filters\r\n // now just do it here\r\n if (col.filter.rangeFilter) {\r\n if (clear) {\r\n uiState.filter.columns[f].rangeFilter.selected = \"none\"\r\n } else {\r\n uiState.filter.columns[f].rangeFilter = JSON.parse(\r\n JSON.stringify(col.filter.rangeFilter)\r\n )\r\n }\r\n }\r\n if (col.filter.columnFilter) {\r\n let list = []\r\n if (!clear) {\r\n list = col.filter.columnFilter.list\r\n }\r\n if (\r\n !(await TableColumnFilter(\r\n def.id,\r\n f,\r\n JSON.parse(JSON.stringify(list)),\r\n { _innerEvent: true }\r\n ))\r\n ) {\r\n return\r\n }\r\n }\r\n })\r\n )\r\n\r\n await Promise.all(\r\n Object.keys(uiState.filter.filterCustom).map(async (m) => {\r\n let val = def.options.initial_filterCustom[m].active\r\n if (clear) {\r\n val = false\r\n }\r\n if (!(await TableCustomFilter(def.id, m, val, { _innerEvent: true }))) {\r\n return\r\n }\r\n })\r\n )\r\n\r\n let filterAttributes = uiState.filter.filterAttributes\r\n let filterAttributesInitial = def.options.initial_rowAttributes\r\n await Promise.all(\r\n Object.keys(filterAttributesInitial).map(async (defKey) =>\r\n Object.keys(filterAttributesInitial[defKey].attributes)\r\n .concat(\r\n Object.keys(\r\n filterAttributes[defKey]?.attributes\r\n ? filterAttributes[defKey].attributes\r\n : {}\r\n )\r\n )\r\n\r\n .map(async (attributeKey) => {\r\n let val = !!filterAttributesInitial[defKey].attributes[attributeKey]\r\n if (clear) {\r\n val = false\r\n }\r\n\r\n if (\r\n !(await TableAttributeFilter(def.id, defKey, attributeKey, val, {\r\n _innerEvent: true,\r\n }))\r\n ) {\r\n return\r\n }\r\n })\r\n )\r\n )\r\n\r\n // last but not least\r\n // if the headermenu is open and rangefilter active then those textbox fields needs to be updated as well\r\n\r\n let instance = DialogIsOpen(\"SYSTableHeaderMenu\", \"2\") ? \"2\" : \"1\"\r\n let formState = FormGet(\"SYSHeaderMenuFilter\", { instance }).formState\r\n if (formState && formState.tableDefId) {\r\n let fromColumnHeaderColumn = TableGet(formState.tableDefId).def.uiState\r\n .headerSelected\r\n if (fromColumnHeaderColumn) {\r\n let rangeFilterState =\r\n def.uiState.filter?.columns?.[fromColumnHeaderColumn]?.rangeFilter\r\n if (rangeFilterState) {\r\n await FieldSetVal(\r\n formState.fields[\"HeaderMenuRangeFilterType\"],\r\n rangeFilterState.selected,\r\n {\r\n ignoreValueChanged: true,\r\n }\r\n )\r\n await FieldSetVal(\r\n formState.fields[\"HeaderMenuRangeFilterValue\"],\r\n rangeFilterState.val,\r\n {\r\n ignoreValueChanged: true,\r\n }\r\n )\r\n await FieldSetVal(\r\n formState.fields[\"HeaderMenuRangeFilterValue2\"],\r\n rangeFilterState.val2,\r\n {\r\n ignoreValueChanged: true,\r\n }\r\n )\r\n }\r\n }\r\n }\r\n\r\n // uiState.filter.filterCustom = JSON.parse(\r\n // JSON.stringify(def.options.initial_filterCustom)\r\n // )\r\n uiState.filter.filter.value = \"\"\r\n uiState.filter.filter.showSelected = false\r\n}\r\nexport const _ResetSort = (def: SYSTableDef) => {\r\n let sortDef = def.options.initial_sort\r\n let initialSort\r\n if (isMobile() && sortDef.fieldMobile) {\r\n initialSort = {\r\n useValue: sortDef.useValue,\r\n direction: sortDef.directionMobile,\r\n field: sortDef.fieldMobile,\r\n }\r\n } else {\r\n initialSort = {\r\n direction: sortDef.direction,\r\n field: sortDef.field,\r\n useValue: sortDef.useValue,\r\n }\r\n }\r\n def.uiState.sort.sort = initialSort\r\n def.uiState.sort.sortCustom = JSON.parse(\r\n JSON.stringify(def.options.initial_sortCustom)\r\n )\r\n}\r\n\r\nexport const GetTableKeys = (\r\n def: SYSTableDef,\r\n dataDef: SYSTableData,\r\n options?: _GetTableOptions\r\n) => {\r\n let onlyUseTheseKeys = options?.onlyUseTheseKeys\r\n let resKeys = []\r\n if (def.initialised) {\r\n let opt = options\r\n let data = dataDef.data\r\n let keys: string[]\r\n if (onlyUseTheseKeys) {\r\n keys = onlyUseTheseKeys\r\n } else {\r\n keys = Object.keys(data).filter(\r\n (f) => (data[f].OvlSysState as OvlSysColumn).rowState.state !== \"Add\"\r\n )\r\n }\r\n\r\n if (opt.byKey !== undefined) {\r\n return [opt.byKey]\r\n } else if (opt.byIdValue !== undefined) {\r\n if (dataDef.index[opt.byIdValue] !== undefined) {\r\n resKeys = [dataDef.index[opt.byIdValue]]\r\n }\r\n } else if (opt.byCustomFilter !== undefined) {\r\n resKeys = keys.filter((k) => opt.byCustomFilter(data[k], k))\r\n } else if (opt.byCustomFilterInVisible !== undefined) {\r\n resKeys = def.uiState.dataFilteredAndSorted\r\n .filter(\r\n (f) => (data[f].OvlSysState as OvlSysColumn).rowState.state !== \"Add\"\r\n )\r\n .filter(\r\n (f) =>\r\n onlyUseTheseKeys === undefined || onlyUseTheseKeys.indexOf(f) > -1\r\n )\r\n .filter((k) => opt.byCustomFilterInVisible(data[k], k))\r\n } else {\r\n if (!opt.byKeys) {\r\n opt.byKeys = \"Visible\"\r\n }\r\n if (opt.byFilter) {\r\n let filter = opt.byFilter\r\n let filterKeys = Object.keys(filter)\r\n resKeys = keys.filter(\r\n (k) =>\r\n filterKeys.filter((f) => filter[f] === data[k][f]).length ===\r\n filterKeys.length\r\n )\r\n } else if (opt.byKeys === \"All\") {\r\n resKeys = keys\r\n } else if (opt.byKeys === \"StaticFiltered\") {\r\n resKeys = keys\r\n let staticFilter = def.uiState.filter.filter.static\r\n let filterKeys = Object.keys(staticFilter)\r\n resKeys = keys.filter(\r\n (k) =>\r\n filterKeys.filter((f) => staticFilter[f] === data[k][f]).length ===\r\n filterKeys.length\r\n )\r\n } else if (opt.byKeys.indexOf(\"Selected\") > -1) {\r\n let staticFilter = def.uiState.filter.filter.static\r\n let filterKeys = Object.keys(staticFilter)\r\n\r\n let selected = def.uiState.selectedRow\r\n resKeys = Object.keys(selected)\r\n .filter(\r\n (f) =>\r\n onlyUseTheseKeys === undefined || onlyUseTheseKeys.indexOf(f) > -1\r\n )\r\n .filter(\r\n (f) =>\r\n selected[f].selected &&\r\n ((data[f].OvlSysState as OvlSysColumn).rowState\r\n .lastChangeBelongsToTableDefId === def.id ||\r\n filterKeys.filter((f2) => staticFilter[f2] === data[f][f2])\r\n .length === filterKeys.length)\r\n )\r\n if (opt.byKeys === \"SelectedTimeDesc\") {\r\n resKeys = resKeys.sort(\r\n (a, b) => selected[b].count - selected[a].count\r\n )\r\n } else if (opt.byKeys === \"SelectedTimeAsc\") {\r\n resKeys = resKeys.sort(\r\n (a, b) => selected[a].count - selected[b].count\r\n )\r\n }\r\n } else if (opt.byKeys === \"Visible\") {\r\n resKeys = def.uiState.dataFilteredAndSorted.filter(\r\n (f) =>\r\n (data[f].OvlSysState as OvlSysColumn).rowState.state !== \"Add\" &&\r\n (onlyUseTheseKeys === undefined || onlyUseTheseKeys.indexOf(f) > -1)\r\n )\r\n }\r\n }\r\n }\r\n return resKeys\r\n}\r\n\r\nexport const _GetFilterSortDifferentiator = (defId: SYSTableDefIds) => {\r\n let def = TableGet(defId).def\r\n let filterSortStoreDifferentiator\r\n if (def.options?.filterSortSettings?.staticFilterKey) {\r\n filterSortStoreDifferentiator =\r\n def.uiState.filter.filter.static[\r\n def.options.filterSortSettings.staticFilterKey\r\n ]\r\n }\r\n let fn =\r\n ovl.getActions().app.features?.[def.feature]?.hooks?.[\r\n HookTableFilterSortSettingsDifferentiator\r\n ]\r\n\r\n if (fn) {\r\n filterSortStoreDifferentiator = (<\r\n HookTableFilterSortSettingsDifferentiator_ReturnType\r\n >fn({\r\n differentiator: filterSortStoreDifferentiator,\r\n def,\r\n })).differentiator\r\n }\r\n // if (filterSortStoreDifferentiator === undefined) {\r\n // return \"\"\r\n // }\r\n return filterSortStoreDifferentiator\r\n}\r\n\r\nexport const _GetFilterSortMainDifferentiator = (defId: SYSTableDefIds) => {\r\n let def = TableGet(defId).def\r\n let filterSortStoreDifferentiator = \"\"\r\n if (def.options?.filterSortSettings?.staticFilterKey) {\r\n filterSortStoreDifferentiator =\r\n def.uiState.filter.filter.static[\r\n def.options.filterSortSettings.staticFilterKey\r\n ]\r\n }\r\n return filterSortStoreDifferentiator\r\n}\r\n\r\nexport const FormBodyRenderer = (\r\n formState: SYSFormState,\r\n def: SYSTableDef,\r\n row?: any,\r\n data?: any,\r\n rowKey?: string\r\n) => {\r\n let formHookFns = ovl.getActions().app.features[formState.feature]?.hooks\r\n let fields = formState.fields\r\n let formValidationHint\r\n if (FormHasVisibleSummaryErrors(formState)) {\r\n formValidationHint = html`\r\n formState}\r\n >\r\n `\r\n }\r\n\r\n let columns = def.columns\r\n\r\n let hookFormBodyRender =\r\n formHookFns?.[\r\n HookFormGetBodyRender.replace(\"{subFeature}\", formState.subFeature)\r\n ]\r\n\r\n if (hookFormBodyRender) {\r\n let getBodyHookRes: HookFormGetBodyRender_ReturnType = hookFormBodyRender({\r\n fields: fields,\r\n formState: formState,\r\n tableDef: def,\r\n } as HookFormGetBodyRender_Type)\r\n return html`${getBodyHookRes.res}${formValidationHint}`\r\n }\r\n\r\n // group by editGroups\r\n let groupedColumns = {}\r\n Object.keys(columns)\r\n .sort((a, b) => columns[a].groups.group - columns[b].groups.group)\r\n .forEach((k) => {\r\n if (!groupedColumns[columns[k].groups.group]) {\r\n groupedColumns[columns[k].groups.group] = {}\r\n }\r\n groupedColumns[columns[k].groups.group][k] = columns[k]\r\n })\r\n return html`\r\n ${Object.keys(groupedColumns).map((g) => {\r\n let groupsState = def.options.edit.groups[g]\r\n let formStateGroupsState = formState.groups.edit[(g)]\r\n if (\r\n formStateGroupsState === undefined ||\r\n formStateGroupsState.removedAndIrrelevantInCurrentSituation\r\n ) {\r\n return html``\r\n }\r\n let editGroupClassName = `editgroup_${g}`\r\n let editGroupLabelClassName = `grp__label`\r\n let editGroupFieldsClassName = `grp__fields`\r\n let groupLabel\r\n if (groupsState) {\r\n if (formStateGroupsState.visible !== \"false\") {\r\n if (groupsState.className) {\r\n editGroupClassName = `ovl-editgroupuser ${groupsState.className}`\r\n } else {\r\n editGroupClassName = \"ovl-editgroupuser\"\r\n }\r\n groupLabel = groupsState.translationKey\r\n if (groupLabel) {\r\n groupLabel = html`${T(groupLabel)}`\r\n }\r\n } else {\r\n return html``\r\n }\r\n }\r\n let columnRenderingState = def?.uiState?.columnsRenderingState?.columns\r\n return html`
\r\n ${groupLabel}\r\n
\r\n ${Object.keys(groupedColumns[g])\r\n .sort((a, b) => columns[a].order - columns[b].order)\r\n .filter((f) => {\r\n let valid = true\r\n let visibility = columnRenderingState?.[f]?.visibility\r\n if (visibility && visibility.indexOf(\"Edit\") < 0) {\r\n valid = false\r\n }\r\n return valid\r\n })\r\n .map((k) => {\r\n let rendererFn = GetRendererFn(\r\n def.feature,\r\n cachedRendererFn,\r\n HookFormCustomControlRender.replace(\"{subFeature}\", \"\"),\r\n k\r\n )\r\n let uiItem\r\n let id = \"ovlRFNFocus_\" + k\r\n if (rendererFn) {\r\n uiItem = rendererFn({\r\n field: fields[k],\r\n formState: formState,\r\n id,\r\n })\r\n } else {\r\n uiItem = TableFormGetControl(fields[k], def)\r\n }\r\n\r\n return html`
${uiItem}
`\r\n })}\r\n
\r\n
`\r\n })}\r\n ${formValidationHint}\r\n `\r\n}\r\n\r\nexport const _handleRowFnConfirmFieldsReset = (\r\n connectedFormBehaviour: {\r\n formType: string\r\n formId: string\r\n fieldsResetType: RowFnConfirmContentFieldsReset_Type\r\n },\r\n feedback: any\r\n) => {\r\n if (connectedFormBehaviour) {\r\n let form = FormGet(connectedFormBehaviour.formType, {\r\n instance: connectedFormBehaviour.formId,\r\n })\r\n\r\n let errorCount = Object.keys(feedback).filter(\r\n (k) => feedback[k].type === \"error\"\r\n ).length\r\n let warningCount = Object.keys(feedback).filter(\r\n (k) => feedback[k].type === \"warning\"\r\n ).length\r\n let resetFields = false\r\n if (connectedFormBehaviour.fieldsResetType === \"Always\") {\r\n resetFields = true\r\n } else if (errorCount === 0) {\r\n if (\r\n connectedFormBehaviour.fieldsResetType === \"ResultHasOnlySuccess\" &&\r\n warningCount === 0\r\n ) {\r\n resetFields = true\r\n } else if (\r\n connectedFormBehaviour.fieldsResetType ===\r\n \"ResultHasSuccessAndOrWarning\"\r\n ) {\r\n resetFields = true\r\n }\r\n }\r\n\r\n if (resetFields) {\r\n FormReset(form)\r\n }\r\n }\r\n}\r\n\r\nexport const _handleRowFnEndpointData = async (\r\n fnKey: string,\r\n clientId: string,\r\n url: string,\r\n fnResultToSet: RowFunctionResultToSet,\r\n data: SYSTableData,\r\n def: SYSTableDef,\r\n selectedObjects: string[],\r\n connectedConfirmFormState: SYSFormState,\r\n process: _ProcessReturnType,\r\n trackingPromise: Promise\r\n) => {\r\n let ids = selectedObjects.map((k) => data.data[k][def.database.dataIdField])\r\n let formValues = undefined\r\n let files = []\r\n if (connectedConfirmFormState) {\r\n let fields: SYSFields = connectedConfirmFormState.fields\r\n formValues = Object.keys(fields)\r\n .filter((f) => FieldIsDirty(fields[f]))\r\n .reduce((val, k) => {\r\n val[k] = fields[k].convertedValue\r\n\r\n return val\r\n }, {})\r\n\r\n files = Object.keys(fields)\r\n .filter(\r\n (k) => fields[k]._state._files && fields[k]._state._files.length > 0\r\n )\r\n .map((k) => {\r\n return { fieldKey: k, files: fields[k]._state._files }\r\n })\r\n }\r\n\r\n let screenCurrentState = ScreenCurrentState()\r\n let uiContext: UIContextType = {\r\n feature: def.feature,\r\n formType: undefined,\r\n formId: undefined,\r\n screen: screenCurrentState?.screen,\r\n screenInstance: screenCurrentState?.instance,\r\n }\r\n\r\n let withFiles = \"\"\r\n let postData: any = {\r\n ids,\r\n formValues,\r\n staticFilter: TableStaticFilterGet(def.id),\r\n tracking: { fnKey: `${process.tableFn.tableDefId}_${fnKey}`, clientId },\r\n uiContext,\r\n }\r\n\r\n if (files.length > 0) {\r\n // we have files\r\n withFiles = \"withfiles\"\r\n let formData = new FormData()\r\n formData.append(\"tableData\", JSON.stringify(postData))\r\n files.forEach((f, i) => {\r\n for (let z = 0; z < f.files.length; z++) {\r\n formData.append(`${f.fieldKey}`, f.files[z])\r\n }\r\n })\r\n postData = formData\r\n }\r\n try {\r\n let sendres = await Data(`${url}${withFiles}`, postData, {\r\n isFormData: files.length > 0,\r\n })\r\n if (sendres.status === 202) {\r\n if (!trackingPromise) {\r\n throw new Error(\r\n `Ovl: tracking not enabled but backend wants tracking...tabledef: ${def.id}`\r\n )\r\n }\r\n await trackingPromise\r\n } else {\r\n await Promise.all(\r\n sendres.data.map(async (r) => {\r\n await fnResultToSet.setFromResult(r)\r\n })\r\n )\r\n }\r\n } catch (error) {\r\n let type = error?.type\r\n let msg = error?.message ? error.message : \"\"\r\n\r\n if (Object.keys(process.tableFn.lockedTableKeys).length > 0) {\r\n Object.keys(process.tableFn.lockedTableKeys).forEach((k) => {\r\n fnResultToSet.setError(k, msg, type)\r\n })\r\n } else {\r\n fnResultToSet.setError(\"\", msg, type)\r\n }\r\n return\r\n }\r\n}\r\nexport const _handleRowFnTracking = (\r\n trackType: RowFnTrackingInterval,\r\n trackStatusIntervall: any,\r\n fnKey: string,\r\n clientId: string,\r\n process: _ProcessReturnType,\r\n fnResultToSet: RowFunctionResultToSet,\r\n fnName: string\r\n): Promise => {\r\n let trackingPromise = new Promise((resolve, reject) => {\r\n let intervallMS\r\n switch (trackType) {\r\n case \"Every2Secs\":\r\n intervallMS = 2000\r\n break\r\n case \"Every5Secs\":\r\n intervallMS = 5000\r\n break\r\n case \"Every10Secs\":\r\n intervallMS = 10000\r\n break\r\n case \"Every20Secs\":\r\n intervallMS = 20000\r\n }\r\n let interValRunning = false\r\n trackStatusIntervall.id = setInterval(async () => {\r\n if (interValRunning) {\r\n return\r\n }\r\n interValRunning = true\r\n try {\r\n let status = await Data(\"users/tracktablerowfn\", {\r\n fnKey: `${process.tableFn.tableDefId}_${fnKey}`,\r\n clientId,\r\n })\r\n if (status.data.currentResults) {\r\n await Promise.all(\r\n status.data.currentResults.map((r) => {\r\n return fnResultToSet.setFromResult(r)\r\n })\r\n )\r\n }\r\n if (\r\n !status.data\r\n .isTracking /*|| !ProcessIsRunning(process.process, process.instance) */\r\n ) {\r\n clearInterval(trackStatusIntervall.id)\r\n resolve(true)\r\n return\r\n }\r\n\r\n let hint\r\n if (status.data.currentTask) {\r\n hint = status.data.currentTask\r\n } else {\r\n hint = `(${status.data.currentIndex + 1} / ${status.data.totalCount})`\r\n }\r\n\r\n if (process?.trackedSnackId) {\r\n SnackTrackedReplaceContent({\r\n key: process.trackedSnackId,\r\n content: T(process.process, [fnName, hint]),\r\n })\r\n }\r\n } catch (error) {\r\n let type = error.type\r\n Object.keys(process.tableFn.lockedTableKeys).forEach((k) => {\r\n fnResultToSet.setError(k, type, type)\r\n })\r\n\r\n clearInterval(trackStatusIntervall.id)\r\n resolve(false)\r\n return\r\n } finally {\r\n interValRunning = false\r\n }\r\n }, intervallMS)\r\n })\r\n return trackingPromise\r\n}\r\n\r\nexport const _AddRowToDisplayedArray = (def: SYSTableDef, key: string) => {\r\n if (def.uiState.dataFilteredAndSorted.indexOf(key) < 0) {\r\n if (def.options.addedRowsPosition === \"bottom\") {\r\n //push it, if not done already in inline edit\r\n def.uiState.dataFilteredAndSorted.push(key)\r\n } else {\r\n def.uiState.dataFilteredAndSorted.unshift(key)\r\n }\r\n def.uiState.rowsCount++\r\n }\r\n}\r\n\r\nexport const _DoRebuildAndFixPage = (def: SYSTableDef) => {\r\n /*\r\n We have different Actions triggered either by User clicking the corresponding action or by using APIs which loads TableRow(s) from Server:\r\n -- (R) Refresh Button -> gets multiple rows from Server\r\n -- (E) Editing an existing Row -> gets the updated row from Server (Eventually containing updates from other Users meanwhile)\r\n -- (A) Adding a new Row -> gets the row from Server (after it was saved)\r\n -- (D) Deleting a row -> needs to set deletedKeys (see further down)\r\n -- (F) Executing a rowFn which sets fieldresult or datatorefresh -> gets the added/updated row (resp. fields in case fieldresult) from server\r\n Whenever there is Data retrieved from Server we need to check if the TableDef on which we operate still displays valid information.\r\n \r\n Please keep in mind that for Feedback Sorting this part is handled externally\r\n\r\n Thats why we keep track on the the following state for those actions:\r\n\r\n export type _RebuildType = {\r\n deletedKeys?: { [key: string]: boolean }\r\n addedKeys?: { [key: string]: boolean }\r\n updatedKeys?: { [key: string]: boolean }\r\n needsRefresh?: boolean\r\n changed: { [key: string]: ServerData_ChangedType }\r\n }\r\n\r\n The visible Rows itself are depending on:\r\n - Filters (Tabletext Filter, ColumnFilter, ColumnRangeFilter, CustomFilter)\r\n - Sort (Field Sort, Custom Sort)\r\n - Aggregates \r\n - Paging information (Page x of y)\r\n\r\n That means we should update the view as well when the returned data affects it.\r\n -> The updated cell values itself are automatically displayed thanks to ovl-reactive layer\r\n -> but it could be that now filter/sort/aggregates are out of synch\r\n\r\n That means we need some logic to set the needsRefresh.\r\n Setting needsRefresh to true can have 2 consequences:\r\n\r\n if def.features.autoRebuild is: \"AfterModifyOrDelete\" or \"AfterModifyOrDeleteOrAdd\" and one of the actions is met. \r\n -> Then we do an automatic Rebuild(...) on the current def\r\n -> otherwise thanks to this flag set the user gets an indication (Rebuild Button) on the UI\r\n\r\n Paging is different and a less expensive action. \r\n Thats why we always set it when needed on the current def already and set needsRefresh on the other defs\r\n Rebuild(...) always will also adjust the paging\r\n\r\n\r\n*/\r\n // we need access to all tableDefs, not just the current one\r\n let tb = TableGet(def.id)\r\n\r\n let currentDefId = def.id\r\n\r\n // we do 2 passes\r\n // first one just sets needsRefresh\r\n // second one takes care of Paging Settings\r\n\r\n // and in the end we check if current def can be auto rebuild\r\n let rowChanges = def.uiState.rebuild.changed\r\n Object.keys(tb.dataDef.tableDef).forEach((tdKey) => {\r\n let td: SYSTableDef = tb.dataDef.tableDef[tdKey]\r\n\r\n if (!td.initialised) {\r\n // if not intialised (= for sure not displayed somewhere) we just proceed with next one\r\n // or if already a refresh needed we do not need to evaluate again...\r\n return\r\n }\r\n\r\n let rebuildTracking = td.uiState.rebuild\r\n\r\n let deletedKeys = Object.keys(rebuildTracking.deletedKeys)\r\n let deleted = deletedKeys.length > 0\r\n\r\n let hasAggregates =\r\n td.uiState.rowsCount > 0 &&\r\n !td.options.tableGroupAggregates.disabled &&\r\n (td.options.tableGroupAggregates.aggregates.length > 0 ||\r\n td.options.tableGroupAggregates.groups.length > 0)\r\n\r\n let deletedInside = false\r\n if (hasAggregates) {\r\n if (deleted) {\r\n // if the deleted key was inside\r\n // the displayed area\r\n deletedInside = deletedKeys.some((dk) =>\r\n td.uiState.dataFilteredAndSorted.some((tk) => tk === dk)\r\n )\r\n }\r\n }\r\n if (deleted) {\r\n deletedKeys.forEach((key) => {\r\n let i = td.uiState.dataFilteredAndSorted.indexOf(key)\r\n if (i > -1) {\r\n td.uiState.dataFilteredAndSorted.splice(i, 1)\r\n td.uiState.rowsCount--\r\n delete deletedKeys[key]\r\n\r\n delete td.uiState.selectedRow[key]\r\n if (deletedInside) {\r\n if (td.uiState.rowsCount > 0) {\r\n rebuildTracking.needsRefresh = true\r\n }\r\n return\r\n }\r\n }\r\n })\r\n }\r\n\r\n // we set added and updatedkeys according to changedInfo so we can quickly check them\r\n Object.keys(rowChanges).forEach((k) => {\r\n let changed: ServerData_ChangedType = def.uiState.rebuild.changed[k]\r\n if (changed.isAdd) {\r\n rebuildTracking.addedKeys[k] = true\r\n } else {\r\n rebuildTracking.updatedKeys[k] = true\r\n }\r\n })\r\n if (td.uiState.rebuild.needsRefresh) {\r\n return\r\n }\r\n\r\n let addedKeys = Object.keys(rebuildTracking.addedKeys)\r\n let added = addedKeys.length > 0\r\n\r\n let updatedKeys = Object.keys(rebuildTracking.updatedKeys)\r\n let updated = updatedKeys.length > 0\r\n\r\n // and another early out if the\r\n // check if result is in filter\r\n // so we execute the changed data with the current filtersettings from td\r\n // if we have no results and we are not on the current def -> no rebuild on the def\r\n let currentData = Object.keys(rowChanges).reduce((val, k) => {\r\n // it could have been deleted meanwhile\r\n // Test Add A row, Delete it, add it again was failing because of this missing check\r\n if (tb.rows[k] !== undefined) {\r\n val[k] = tb.rows[k]\r\n }\r\n return val\r\n }, {})\r\n\r\n let currentDataFilteredKeys = _TableFilterFn({\r\n data: { data: currentData, tableDef: undefined },\r\n def: td,\r\n })\r\n if (currentDataFilteredKeys.length === 0) {\r\n // currentdef gets the added row automatically at top or bottom\r\n // in case of add on current the also rebuild\r\n if (currentDefId === td.id && added) {\r\n rebuildTracking.needsRefresh = true\r\n }\r\n //all other defs if not affected -> all good, go to next def\r\n return\r\n } else {\r\n // filtered result as visible in the other def affected\r\n // -> needsRebuild (needsRefresh)\r\n\r\n if (updated || added) {\r\n rebuildTracking.needsRefresh = true\r\n }\r\n return\r\n }\r\n })\r\n\r\n // 2nd pass for the page settings\r\n Object.keys(tb.dataDef.tableDef).forEach((tdKey) => {\r\n let td: SYSTableDef = tb.dataDef.tableDef[tdKey]\r\n if (!td.initialised) {\r\n return\r\n }\r\n let rebuildTracking = td.uiState.rebuild\r\n let addedKeys = Object.keys(rebuildTracking.addedKeys)\r\n let added = addedKeys.length > 0\r\n\r\n let deletedKeys = Object.keys(rebuildTracking.deletedKeys)\r\n let deleted = deletedKeys.length > 0\r\n\r\n if (added || deleted) {\r\n if (def.features.page) {\r\n if (currentDefId === td.id) {\r\n let paging = def.uiState.paging\r\n let pages = Math.ceil(def.uiState.rowsCount / paging.pageSize) - 1\r\n if (pages > -1) {\r\n if (paging.page > pages) {\r\n paging.page = pages\r\n } else if (paging.page < 0) {\r\n paging.page = 0\r\n }\r\n }\r\n } //else {\r\n // // we just say it needs refresh if there is another (not the active one) tabledef using paging\r\n // rebuildTracking.needsRefresh = true\r\n // }\r\n }\r\n }\r\n })\r\n\r\n // now if there are any needsRefresh but rowsCount is 0\r\n Object.keys(tb.dataDef.tableDef).forEach((tdKey) => {\r\n let td: SYSTableDef = tb.dataDef.tableDef[tdKey]\r\n if (!td.initialised) {\r\n return\r\n }\r\n let allCount = Object.keys(tb.dataDef.data).length\r\n if (td.uiState.rebuild.needsRefresh && allCount === 0) {\r\n td.uiState.rebuild.needsRefresh = false\r\n }\r\n })\r\n\r\n // now if there is a changed to b and a is filtered in a table and b in another\r\n // case b is handled but a doesn't know that \"it has lost an a\"\r\n Object.keys(tb.dataDef.tableDef).forEach((tdKey) => {\r\n let td: SYSTableDef = tb.dataDef.tableDef[tdKey]\r\n if (!td.initialised || td.uiState.rebuild.needsRefresh === true) {\r\n return\r\n }\r\n\r\n let filterCustomDef = td.options.initial_filterCustom\r\n\r\n // let activeSortCols = {}\r\n // if (td.uiState.sort.sortCustom.selected) {\r\n // activeSortCols[td.uiState.sort.sortCustom.selected] = true\r\n // }\r\n // if (td.uiState.sort.sort.field) {\r\n // activeSortCols[td.uiState.sort.sort.field] = true\r\n // }\r\n\r\n let rebuildTracking = td.uiState.rebuild\r\n let changedKeys = Object.keys(rebuildTracking.updatedKeys)\r\n let changed = changedKeys.length > 0\r\n\r\n if (!changed) {\r\n return\r\n }\r\n if (\r\n changedKeys.some((ck) =>\r\n td.uiState.dataFilteredAndSorted.some((dfk) => ck === dfk)\r\n )\r\n ) {\r\n rebuildTracking.needsRefresh = true\r\n return\r\n }\r\n // let activeCustomFilterKeys = Object.keys(filterCustomDef).filter(\r\n // (fcd) => !!td.uiState.filter.filterCustom[fcd]?.active\r\n // )\r\n\r\n // let activeFilterCols = activeCustomFilterKeys.reduce((val, fcd) => {\r\n // Object.keys(filterCustomDef[fcd].involvedColumnKeys).forEach((ick) => {\r\n // val[ick] = true\r\n // })\r\n // return val\r\n // }, {})\r\n\r\n // // staticFilter\r\n // let staticFilter = td.uiState.filter.filter.static\r\n // Object.keys(staticFilter).forEach((k) => {\r\n // activeFilterCols[k] = true\r\n // })\r\n\r\n // // columnfilter and rangefilter\r\n // let columnFilterDef = td.uiState.filter.columns\r\n // Object.keys(columnFilterDef).forEach((cfd) => {\r\n // if (\r\n // columnFilterDef[cfd].columnFilter?.type === \"list\" ||\r\n // columnFilterDef[cfd].rangeFilter?.selected\r\n // ) {\r\n // activeFilterCols[cfd] = true\r\n // }\r\n // })\r\n\r\n // let hasActiveFilters = Object.keys(activeFilterCols).length > 0\r\n // if (hasActiveFilters) {\r\n // // now check if the changed field is involved in a filter\r\n // if (changedKeys.some)\r\n // }\r\n })\r\n\r\n // check if the current one can already be rebuilded\r\n if (def.uiState.rebuild.needsRefresh) {\r\n let td: SYSTableDef = def\r\n let rebuildTracking = td.uiState.rebuild\r\n let addedKeys = Object.keys(rebuildTracking.addedKeys)\r\n let added = addedKeys.length > 0\r\n\r\n let updatedKeys = Object.keys(rebuildTracking.updatedKeys)\r\n let updated = updatedKeys.length > 0\r\n\r\n let deletedKeys = Object.keys(rebuildTracking.deletedKeys)\r\n let deleted = deletedKeys.length > 0\r\n\r\n if (\r\n (td.features.autoRebuild === \"AfterModifyOrDelete\" &&\r\n (updated || deleted)) ||\r\n (td.features.autoRebuild === \"AfterModifyOrDeleteOrAdd\" &&\r\n (updated || deleted || added))\r\n ) {\r\n TableRebuild(td.id)\r\n return\r\n }\r\n }\r\n}\r\n\r\nexport type _MergeRowHookParamsType = {\r\n fn: any\r\n tableData: SYSTableData\r\n defId: SYSTableDefIds\r\n}\r\n\r\n/*\r\nchanged: a helper set for the HookTableServerData\r\n*/\r\nexport const _DoServerDataConversionSyncAndBuildUpRebuildAndChangedInfo = (\r\n rowKey: string,\r\n clientConversion: _ClientConversion,\r\n serverRow: { [key: string]: any },\r\n currentRow: { [key: string]: any },\r\n rebuild: _RebuildType,\r\n isAdd: boolean,\r\n mergeRowHookParams: _MergeRowHookParamsType,\r\n checkForOtherModifications?: boolean,\r\n changedColumns?: { [key: string]: any }\r\n): ServerData_ChangedType => {\r\n let changed: ServerData_ChangedType = { columns: {}, isAdd }\r\n // keep a list of other modified (if another user modified a field and its not in the data.fieldChangeReportingIgnoreList (like updateTime, updateDate which gets done by server))\r\n let otherModified = new Set()\r\n\r\n if (mergeRowHookParams) {\r\n if (\r\n mergeRowHookParams.fn({\r\n rowKey,\r\n serverRow: serverRow,\r\n localRowJustForChecking: currentRow,\r\n tableData: mergeRowHookParams.tableData,\r\n defId: mergeRowHookParams.defId,\r\n })\r\n ) {\r\n // if handled by hook no need for default dance\r\n return changed\r\n }\r\n }\r\n\r\n Object.keys(serverRow).forEach((columnKey) => {\r\n // do the hard conversions\r\n // todo: remove this from columndefs in tablecolumndef\r\n let setToNullIf = clientConversion[columnKey]?.setToNullIf\r\n let setToValueIfNull = clientConversion[columnKey]?.setToValueIfNull\r\n if (setToNullIf && setToNullIf === serverRow[columnKey]) {\r\n serverRow[columnKey] = null\r\n }\r\n if (setToValueIfNull && serverRow[columnKey] === null) {\r\n serverRow[columnKey] = setToValueIfNull\r\n }\r\n if (isAdd) {\r\n // add is a different beast\r\n // no value comparison\r\n // -> treat column as changed\r\n // -> mark as addedkey\r\n changed.columns[columnKey] = true\r\n //rebuild.addedKeys[rowKey] = true\r\n // still do the conversion\r\n if (\r\n clientConversion[columnKey]?.jsonParse &&\r\n typeof serverRow[columnKey] === \"string\"\r\n ) {\r\n currentRow[columnKey] = JSON.parse(serverRow[columnKey])\r\n } else {\r\n currentRow[columnKey] = serverRow[columnKey]\r\n }\r\n } else {\r\n if (\r\n clientConversion[columnKey]?.jsonParse &&\r\n typeof serverRow[columnKey] === \"string\"\r\n ) {\r\n // compare and parse and sync\r\n if (JSON.stringify(currentRow[columnKey]) !== serverRow[columnKey]) {\r\n changed.columns[columnKey] = true\r\n //rebuild.updatedKeys[rowKey] = true\r\n // we should be fine parsing without undefined checks... there never should be undefined as a server value\r\n // and as well server should not return empty string to be parsed. thats not valid. should be sent from server as null\r\n // (todo: take care of undefined when using localData in Table)\r\n currentRow[columnKey] = JSON.parse(serverRow[columnKey])\r\n if (\r\n checkForOtherModifications &&\r\n !clientConversion[columnKey]?.doNotCheckForOtherModification &&\r\n !changedColumns?.[columnKey] &&\r\n (currentRow.OvlSysState as OvlSysColumn).rowState.state === \"Update\"\r\n ) {\r\n otherModified.add(columnKey)\r\n }\r\n }\r\n } else {\r\n // just compare and sync\r\n if (currentRow[columnKey] !== serverRow[columnKey]) {\r\n changed.columns[columnKey] = true\r\n //rebuild.updatedKeys[rowKey] = true\r\n currentRow[columnKey] = serverRow[columnKey]\r\n if (\r\n checkForOtherModifications &&\r\n !clientConversion[columnKey]?.doNotCheckForOtherModification &&\r\n !changedColumns?.[columnKey] &&\r\n (currentRow.OvlSysState as OvlSysColumn).rowState.state === \"Update\"\r\n ) {\r\n otherModified.add(columnKey)\r\n }\r\n }\r\n }\r\n }\r\n })\r\n if (otherModified.size > 0) {\r\n let modifiedColumnList = Array.from(otherModified)\r\n .map((k) => k)\r\n .join(\",\")\r\n SnackAdd(`Some column(s) got modified meanwhile: ${modifiedColumnList}`)\r\n }\r\n rebuild.changed[rowKey] = changed\r\n return changed\r\n}\r\n","import {\r\n HookLookupsRefresh,\r\n HookLookupsRefresh_Type,\r\n} from \"../../../global/hooks\"\r\nimport type { SYSAction, SYSFeature } from \"../../../index\"\r\nimport { SYSFormState } from \"../formapi\"\r\nimport { KeyValueListFromServerFn } from \"./helpers\"\r\nimport type { ListState } from \"./listcontrol\"\r\n\r\nexport const _FillListControl: SYSAction<{\r\n list: ListState\r\n columnKey: string\r\n filterValue: string\r\n row: {}\r\n feature: SYSFeature\r\n formState: SYSFormState\r\n}> = async (value, { global }) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n let fn = actions.app.features[value.feature]\r\n if (fn?.hooks?.[HookLookupsRefresh]) {\r\n let lookups = fn.hooks[HookLookupsRefresh]({\r\n formState: value.formState,\r\n tableDefId: value.formState.tableDefId,\r\n })\r\n await KeyValueListFromServerFn(\r\n state,\r\n value.list,\r\n value.columnKey,\r\n lookups,\r\n value.filterValue,\r\n value.row,\r\n value.feature,\r\n value.formState?.subFeature,\r\n value.formState?.formType,\r\n value.formState?.formId,\r\n\r\n undefined,\r\n undefined\r\n )\r\n } else {\r\n throw Error(\"SYS Error: RefreshLookups Hook is mandatory for any list\")\r\n }\r\n}\r\n","// @ts-nocheck\r\nimport { currentScreenAndDialog } from \"..\"\r\nimport { handleReactor, ReactorReturnType } from \"./reactor\"\r\nimport { _RenderTracking, addTrackedPath, isTracking, paths } from \"./tracker\"\r\nexport let actionTracking = {\r\n actionRunning: false,\r\n lastActionName: undefined,\r\n canceled: false,\r\n}\r\nlet cumulatedPathsFromProxify = new Set()\r\n\r\nexport function createDeepProxy(target) {\r\n const preproxy = new WeakMap()\r\n //let ignore = false\r\n function makeHandler(path) {\r\n return {\r\n get(target, key, receiver) {\r\n if (key !== \"toJSON\" && isTracking()) {\r\n let isArray = Array.isArray(target)\r\n let value = target[key]\r\n if (\r\n typeof key === \"symbol\" ||\r\n (typeof value !== \"function\" &&\r\n !(isArray && \"push;pop;splice;unshift;shift;\".indexOf(key) > -1)) //&&\r\n //key !== \"toJSON\"\r\n ) {\r\n let pathToTrack\r\n if (typeof key === \"symbol\" || (isArray && key === \"length\")) {\r\n pathToTrack = [...path].join(\".\")\r\n } else {\r\n pathToTrack = [...path, key].join(\".\")\r\n }\r\n // if (\r\n // window.dbg === true &&\r\n // pathToTrack.indexOf(\"U_FillingWeight\") > -1 &&\r\n // key === \"hasFocus\"\r\n // ) {\r\n // debugger\r\n // }\r\n addTrackedPath(pathToTrack)\r\n }\r\n }\r\n return Reflect.get(...arguments)\r\n },\r\n //traps the Object.keys(...)\r\n ownKeys(target) {\r\n // if (ignore) {\r\n // return Reflect.ownKeys(target)\r\n // }\r\n // // if (window.dbg) {\r\n // // debugger\r\n // // }\r\n\r\n let ownKeys = Reflect.ownKeys(target)\r\n if (isTracking()) {\r\n ownKeys.forEach((m) => {\r\n let pathToTrack = [...path, m].join(\".\")\r\n addTrackedPath(pathToTrack)\r\n })\r\n }\r\n return ownKeys\r\n },\r\n // traps (in operator)\r\n has(target, key) {\r\n if (isTracking()) {\r\n if (!Array.isArray(target)) {\r\n Reflect.ownKeys(target).forEach((m) => {\r\n let pathToTrack = [...path, m].join(\".\")\r\n addTrackedPath(pathToTrack)\r\n })\r\n }\r\n }\r\n return Reflect.has(...arguments)\r\n },\r\n set(target, key, value, receiver) {\r\n if (value !== null && typeof value === \"object\" && key !== \"_files\") {\r\n if (!preproxy.has(value)) {\r\n value = proxify(value, [...path, key])\r\n }\r\n } else {\r\n // we don't want stuff to rerender/reactors called if the primitive value didn't change\r\n if (target[key] === value) {\r\n return true\r\n }\r\n }\r\n\r\n let isArray = Array.isArray(target)\r\n let pathToTrackParent\r\n let dotpath = [...path].join(\".\")\r\n if (typeof target === \"object\" && target[key] === undefined) {\r\n pathToTrackParent = dotpath\r\n }\r\n\r\n let startScreenUpdate = false\r\n if (pathToTrackParent) {\r\n let rres = handleReactor(pathToTrackParent, value)\r\n if (rres?.cancel) {\r\n return false\r\n }\r\n if (rres?.newValue) {\r\n value = rres.newValue\r\n }\r\n if (!cumulatedPathsFromProxify.has(pathToTrackParent)) {\r\n // if (pathToTrackParent === \"ovl.screens.nav\") {\r\n // console.trace()\r\n // }\r\n startScreenUpdate = true\r\n cumulatedPathsFromProxify.add(pathToTrackParent)\r\n }\r\n }\r\n\r\n let pathToTrack = `${dotpath}.${key}`\r\n if (isArray && key === \"length\") {\r\n pathToTrack = dotpath\r\n }\r\n\r\n // if (pathToTrack.indexOf(\".OvlSysState\") > -1) {\r\n // console.log(\"from tracker \", pathToTrack, key, value)\r\n // debugger\r\n // }\r\n\r\n // if (pathToTrack.indexOf(\".OvlSysState.fnFeedback\") > -1) {\r\n // console.log(\"from tracker \", pathToTrack, key, value)\r\n // debugger\r\n // }\r\n\r\n // if (pathToTrack.indexOf(\"tables.effort.data\") > -1) {\r\n // console.log(\"from tracker \", pathToTrack, key, value)\r\n // console.trace()\r\n // }\r\n\r\n // if (\r\n // pathToTrack.indexOf(\r\n // \"ovl.longRunningProcessTracker.GENPrintDefChooserExecute.instance.Reklamation_8744_PDF_\"\r\n // ) > -1\r\n // ) {\r\n // let yyy = 1\r\n // debugger\r\n // }\r\n let rres = handleReactor(pathToTrack, value)\r\n if (rres?.cancel) {\r\n return false\r\n }\r\n if (rres?.newValue !== undefined) {\r\n value = rres.newValue\r\n }\r\n\r\n // we are not here yet...needed to remove because sometimes it's tracking as well inside actions\r\n // needs very deep investigation and maybe a base rewrite...\r\n // removed...@@todorenderingtrackingrework\r\n // if (!_RenderTracking.forceTracking && isTracking()) {\r\n // target[key] = value\r\n // return true\r\n // }\r\n target[key] = value\r\n\r\n if (!cumulatedPathsFromProxify.has(pathToTrack)) {\r\n // if (\r\n // !isTracking() &&\r\n // key !== \"screenCounter\" &&\r\n // key !== \"dialogCounter\"\r\n // ) {\r\n // // // console.log(key, value)\r\n // // if (key === \"isRunning\" && value === false) {\r\n // // console.log(_RenderTracking.currentComponent)\r\n // // }\r\n // // console.log(\"bail out because of isTracking()\")\r\n // return true\r\n // }\r\n cumulatedPathsFromProxify.add(pathToTrack)\r\n //console.log(pathToTrack)\r\n // if (pathToTrack === \"ovl.screens.nav\") {\r\n // console.trace()\r\n // }\r\n startScreenUpdate = true\r\n } else {\r\n //console.log(\"bail out because of already added\")\r\n }\r\n\r\n if (startScreenUpdate) {\r\n StartScreenUpdate()\r\n }\r\n\r\n return true\r\n },\r\n\r\n deleteProperty(target, key) {\r\n if (Reflect.has(target, key)) {\r\n unproxy(target, key)\r\n let deleted = Reflect.deleteProperty(target, key)\r\n if (deleted /*&& !isTracking()*/) {\r\n let pathToTrack = [...path, key].join(\".\")\r\n\r\n if (!cumulatedPathsFromProxify.has(pathToTrack)) {\r\n cumulatedPathsFromProxify.add(pathToTrack)\r\n StartScreenUpdate()\r\n }\r\n }\r\n return deleted\r\n }\r\n return true\r\n },\r\n }\r\n }\r\n\r\n function unproxy(obj, key) {\r\n //ignore = true\r\n // if (JSON.stringify(obj).indexOf(\"OvlSysState\") > -1) {\r\n // debugger\r\n // }\r\n if (preproxy.has(obj[key])) {\r\n obj[key] = preproxy.get(obj[key])\r\n preproxy.delete(obj[key])\r\n }\r\n if (obj[key]) {\r\n for (let k of Object.keys(obj[key])) {\r\n if (typeof obj[key][k] === \"object\") {\r\n unproxy(obj[key], k)\r\n }\r\n }\r\n }\r\n //ignore = false\r\n }\r\n\r\n function proxify(obj, path) {\r\n //ignore = true\r\n if (obj) {\r\n for (let key of Object.keys(obj)) {\r\n if (typeof obj[key] === \"object\" && obj[key] !== null) {\r\n if (!preproxy.has(obj[key])) {\r\n obj[key] = proxify(obj[key], [...path, key])\r\n }\r\n }\r\n }\r\n let p = new Proxy(obj, makeHandler(path))\r\n preproxy.set(p, obj)\r\n return p\r\n }\r\n //ignore = false\r\n }\r\n return proxify(target, [])\r\n}\r\nlet debouncedScreenUpdate\r\n\r\nexport let StartScreenUpdate = async (debounceMS = 34) => {\r\n if (debounceMS === -1) {\r\n doScreenUpdates()\r\n return\r\n }\r\n\r\n if (debouncedScreenUpdate) {\r\n //console.log(\"debounce\", debounceMS)\r\n clearTimeout(debouncedScreenUpdate)\r\n }\r\n\r\n debouncedScreenUpdate = setTimeout(async () => {\r\n await doScreenUpdates()\r\n }, debounceMS)\r\n}\r\n\r\nconst doScreenUpdates = async () => {\r\n let updateCount = cumulatedPathsFromProxify.size\r\n if (updateCount > 0) {\r\n // we need to know if the screen is fading out\r\n // if the screen is fading out we don't need to update the screen\r\n // this helps as well if eg. a datasource is used on 2 screens. so if changing to screen 2 is manipulating the datasource we won't have any flickering thanks to that\r\n\r\n let trackingBlock = currentScreenAndDialog.screens.some((s) =>\r\n s.classList.contains(\"trackingBlock\")\r\n )\r\n let componentsRendered = new WeakSet()\r\n let pathsIgnoredBecauseInScreenTransition = false\r\n for (let f of cumulatedPathsFromProxify) {\r\n //if a screen is fading out don't accept any updates besides dialogs\r\n if (trackingBlock && f.indexOf(\"ovl.screens.nav.dialogCounter\") < 0) {\r\n pathsIgnoredBecauseInScreenTransition = true\r\n continue\r\n }\r\n // sample for testing paths\r\n // if (\r\n // f.indexOf(\"ovl.forms.SYSTableRowEdit.trowQORQuickOrderDetails\") > -1\r\n // ) {\r\n // if (f.split(\".\").length === 3) {\r\n // debugger\r\n // }\r\n // }\r\n cumulatedPathsFromProxify.delete(f)\r\n\r\n let cbs = paths.get(f)\r\n\r\n if (cbs) {\r\n for (let k of cbs) {\r\n if (!componentsRendered.has(k)) {\r\n componentsRendered.add(k)\r\n // its important to check initialsed because in comp base init gets tracked and therefore could trigger itself\r\n // usecase hedin rpt table column favorites list (there are some lookups loaded when the favorite list initialises)\r\n if (k.isConnected && k._initialised) {\r\n // do not use await here...was causing sequence and tracking to wrong comp issues\r\n k.doRender()\r\n _RenderTracking.totalCompRendered++\r\n }\r\n k = null\r\n }\r\n }\r\n }\r\n cbs = null\r\n }\r\n if (pathsIgnoredBecauseInScreenTransition) {\r\n debouncedScreenUpdate = setTimeout(() => {\r\n doScreenUpdates()\r\n }, 17)\r\n }\r\n }\r\n}\r\n","import { SYSConfig } from \"../../config\"\r\nimport {\r\n DisplayFormats,\r\n getDateISOString,\r\n getDateValue,\r\n getDecimalValue,\r\n getIntegerValue,\r\n stringifyReplacer,\r\n T,\r\n} from \"../../global/globals\"\r\n\r\nimport {\r\n HookFieldGetList,\r\n HookFormAutoInit,\r\n HookFormAutoInit_Type,\r\n HookFormChanged,\r\n HookFormEditorInit,\r\n HookFormInit,\r\n HookFormRemove,\r\n HookFormValidate,\r\n HookFormValidatorsDefaults,\r\n HookViewHeaderCellClass,\r\n HookViewRowCellClass,\r\n} from \"../../global/hooks\"\r\n\r\nimport type {\r\n FieldValueChanged,\r\n HookFieldGetList_ReturnType,\r\n HookFormChanged_Type,\r\n HookFormEditorInit_Type,\r\n HookFormInit_ReturnType,\r\n HookFormInit_Type,\r\n HookFormRemove_Type,\r\n HookFormValidate_Type,\r\n HookFormValidatorsDefaults_Type,\r\n HookViewHeaderCellClass_Type,\r\n HookViewRowCellClass_Type,\r\n ValidatorCheckOptions,\r\n} from \"../../global/hooks\"\r\n\r\nimport {\r\n ovl,\r\n type SYSAction,\r\n type SYSActions,\r\n type SYSEditor,\r\n type SYSFeature,\r\n type SYSForm,\r\n type SYSFormValidationValidators,\r\n type SYSState,\r\n type SYSTableDefIds,\r\n} from \"../../\"\r\n\r\nimport {\r\n _cachedFieldLists,\r\n _GetFieldList,\r\n getDisplayValue,\r\n} from \"../table/helpers\"\r\nimport type {\r\n _ColumnAlign,\r\n ColumnDisplayDef,\r\n ControlType,\r\n EditDisplayMode,\r\n EditGroups,\r\n EditorType,\r\n ListDefinition,\r\n ViewRowClassType,\r\n} from \"../table/table\"\r\nimport { _FillListControl } from \"./controls/actions\"\r\nimport {\r\n getColumnDefsFromFormState,\r\n GetFieldLabel,\r\n GetRowFromFormState,\r\n} from \"./controls/helpers\"\r\nimport type { ListState } from \"./controls/listcontrol\"\r\nimport {\r\n FieldCurrentList,\r\n FieldIsValid,\r\n FieldIsValidSelective,\r\n FieldList,\r\n FieldReset,\r\n FieldSetState,\r\n FieldSetVal,\r\n} from \"./fieldapi\"\r\nimport {\r\n _resetValidationForContext,\r\n _setFieldTouched,\r\n _setFieldWatched,\r\n getFormFields,\r\n} from \"./helper\"\r\nimport type {\r\n DataType,\r\n FieldFormat,\r\n FieldSchema,\r\n Schema,\r\n SYSFormField,\r\n} from \"./sysformelement\"\r\nimport type {\r\n FieldValidationResult,\r\n OptionsValidate,\r\n OptionsValidateResultError,\r\n ValidateResult,\r\n ValidateResultError,\r\n ValidateResultVisibleSummaryError,\r\n ValidateSummaryResult,\r\n ValidationResetContext,\r\n ValidationsAddOptions,\r\n ValidatorOptions,\r\n ValidatorUseOptions,\r\n} from \"./validators\"\r\nimport {\r\n _setFieldValid,\r\n _setFormValid,\r\n _validationsAdd,\r\n _validatorUse,\r\n setFormDirty,\r\n setVisibleValidation,\r\n ValidationsRemove,\r\n} from \"./validators\"\r\n\r\nimport { SortGet } from \"../../global/globalapi\"\r\n\r\nimport { actionTracking, StartScreenUpdate } from \"../../tracker/proxyhandler\"\r\nimport { _RenderTracking } from \"../../tracker/tracker\"\r\nimport {\r\n TableGet,\r\n _TableGetReturnType,\r\n TableSchemaGet,\r\n} from \"../table/tableapi\"\r\nimport {\r\n ValidationSummaryAdd,\r\n ValidationsAdd,\r\n ValidatorAdd,\r\n ValidatorCheck,\r\n} from \"./validatorsapi\"\r\nimport { FormInit, FormIsValid } from \"./formapi\"\r\nimport { MergeDeep } from \"../../global/actions\"\r\nimport { SnackAdd } from \"../snackapi\"\r\n\r\nexport { _FillListControl }\r\nexport type AutoComplete =\r\n | \"off\"\r\n | \"on\"\r\n | \"name\"\r\n | \"honorific-prefix\"\r\n | \"given-name\"\r\n | \"additional-name\"\r\n | \"family-name\"\r\n | \"honorific-suffix\"\r\n | \"nickname\"\r\n | \"email\"\r\n | \"username\"\r\n | \"new-password\"\r\n | \"current-password\"\r\n | \"one-time-code\"\r\n | \"organization-title\"\r\n | \"organization\"\r\n | \"street-address\"\r\n | \"country\"\r\n | \"country-name\"\r\n | \"postal-code\"\r\n | \"cc-name\"\r\n | \"cc-given-name\"\r\n | \"cc-additional-name\"\r\n | \"cc-family-name\"\r\n | \"cc-number\"\r\n | \"cc-exp\"\r\n | \"cc-exp-month\"\r\n | \"cc-exp-year\"\r\n | \"cc-csc\"\r\n | \"cc-type\"\r\n | \"transaction-currency\"\r\n | \"transaction-amount\"\r\n | \"language\"\r\n | \"bday\"\r\n | \"bday-day\"\r\n | \"bday-month\"\r\n | \"bday-year\"\r\n | \"sex\"\r\n | \"tel\"\r\n\r\nexport type SYSField = {\r\n order?: number\r\n control?: ControlType\r\n value: string\r\n\r\n previousValue: string\r\n convertedValue: any\r\n originalValue: any\r\n type: DataType\r\n dirty: boolean\r\n valid: boolean\r\n // touched is used just for listControl now. and it doesn't mean its touched so its misleading\r\n touched: boolean\r\n watched: boolean\r\n hasFocus?: boolean\r\n inactive?: boolean\r\n\r\n // removed in favor of schema.isCalculated\r\n //ignoreForFormValid?: boolean\r\n\r\n inactiveButRelevantForValidation?: boolean\r\n validationResult: FieldValidationResult\r\n id: string\r\n formType: string\r\n formId: string\r\n fieldKey: string\r\n groups: {\r\n tab: number\r\n group: number\r\n }\r\n nullHandling: {\r\n enabled: boolean\r\n setToNullIf?: any\r\n setToValueIfNull?: any\r\n }\r\n schema: FieldSchema\r\n\r\n ui?: {\r\n labelTranslationKey?: string\r\n labelCaption?: string\r\n noLabel?: boolean\r\n format?: FieldFormat\r\n align?: _ColumnAlign\r\n option?: { inline?: boolean }\r\n isPassword?: boolean\r\n readonly?: boolean\r\n alwaysReadOnly?: boolean\r\n checkedValue?: any\r\n uncheckedValue?: any\r\n useSpellcheck?: boolean\r\n autocomplete?: AutoComplete\r\n visible?: ControlVisiblity\r\n useBrowserDatePicker?: boolean\r\n fillSpaceIfNotVisible?: boolean\r\n displayEmptyIfValue?: any\r\n displayValueHintWhileTyping?: boolean\r\n infoValue?: string\r\n selectIfFocused?: boolean\r\n }\r\n previousConvertedValue: any\r\n previousValid: boolean\r\n previousValidConvertedValue: any\r\n customState: any\r\n _state?: {\r\n // use forcesave for client values filled and not saved (eg. usecase permissions were we build a table from template values only on client. in that case the dirty ccheck and value compare would fail and report no changes)\r\n forceSave: boolean\r\n visible: boolean\r\n closing: boolean\r\n removedAndIrrelevantInCurrentSituation: boolean\r\n forceChange: boolean\r\n valueAfterGotFocus: any\r\n valueChangedHandled?: boolean\r\n\r\n fieldInitialValidated?: boolean\r\n fieldInitialChanged?: boolean\r\n\r\n noRetrigger?: boolean\r\n\r\n // needed for EditorFields...They need to save groupState for creating a pseudo Tabledef for BodyRendering\r\n groupState?: EditGroups[]\r\n _files?: File[]\r\n }\r\n list?: ListState\r\n\r\n editor?: EditorType\r\n}\r\n\r\nexport type ControlVisiblity = \"true\" | \"false\" | \"fadeIn\" | \"fadeOut\"\r\nexport type ActiveInactiveVisiblity =\r\n | \"noVisibilityChange\"\r\n | \"true/false\"\r\n | \"fadeIn/fadeOut\"\r\n | \"true/readonly\"\r\n\r\n// export type BuiltInValidationDisplayType = {\r\n// dataTypeValidation?: ValidationSettingsType\r\n// schemaValidation?: ValidationSettingsType\r\n// listValidation?: ValidationSettingsType\r\n// customValidationDefaults?: CustomValidationSettingsType\r\n// }\r\n\r\n// export type CustomValidationSettingsType = {\r\n// field: {\r\n// displayType: FormValidationDisplayType\r\n// displayTypeIfSummary: FormValidationDisplayType\r\n// }\r\n// summary?: {\r\n// displayType: FormValidationSummaryDisplayType\r\n// }\r\n// }\r\n\r\n// export type ValidationSettingsType = {\r\n// isGrouped?: boolean\r\n// _validationGroup?: string\r\n// field: {\r\n// displayType: FormValidationDisplayType\r\n// }\r\n// summary?: {\r\n// displayType: FormValidationSummaryDisplayType\r\n// msg?: { translationKey: string }\r\n// }\r\n// }\r\nexport type FieldValueMap = { [key: string]: SYSField }\r\ntype FormFieldValueMap = { [key: string]: SYSFormField }\r\ntype SummaryErrorList = {\r\n translationKey: string\r\n translationReps: string[]\r\n involvedFieldKeys?: string[]\r\n}\r\n\r\nexport type SYSFormState = {\r\n dirty: boolean\r\n valid: boolean\r\n fields: FieldValueMap\r\n formType: SYSForm\r\n formId: string\r\n parent?: {\r\n formType?: SYSForm\r\n formId?: string\r\n fieldKey: string\r\n }\r\n initFields: FieldValueMap\r\n initialFields: FormFieldValueMap\r\n feature: SYSFeature\r\n subFeature: string\r\n schema: { [key: string]: Schema }\r\n validationDefault: OptionsValidate\r\n forceFocusWhenVisibleFieldKey: string\r\n firstEditableFocusSet?: boolean\r\n\r\n validationResult?: {\r\n // 1st key is the tab\r\n [key: string]: {\r\n //key is translationKey for now (with future enhancement for a free group)\r\n summaryErrors: {\r\n [key: string]: SummaryErrorList\r\n }\r\n //key is translationKey for now (with future enhancement for a free group)\r\n validationKeyErrors: {\r\n [key: string]: SummaryErrorList\r\n }\r\n // field errors is just an array\r\n fieldErrors: SummaryErrorList[]\r\n }\r\n }\r\n tableDefId?: SYSTableDefIds\r\n tableRowKey?: string\r\n tableDataMode?: \"Add\" | \"Update\"\r\n isInline?: boolean\r\n row?: any\r\n\r\n // locked eg. when form is saving nothing should be changed\r\n locked?: boolean\r\n firstInitOrSituationChanged?: boolean\r\n forceKeepFormStateOnCancel?: boolean\r\n doFormChangedForEveryFieldInInit?: boolean\r\n useAlignRight?: boolean\r\n\r\n _state: {\r\n _oldSituation: string\r\n _fieldSetValFromDebouncedInit?: boolean\r\n _viewRowCell?: ViewRowClassType\r\n _viewHeaderCell?: ViewRowClassType\r\n _activeEditTab?: number\r\n _firstTimeToUpdate?: boolean\r\n _noCancelOnEditFormIfFormStateWasInvalidWhenOpened?: boolean\r\n _summaryDebouncer: number\r\n _inInitOrChangedCount: number\r\n }\r\n\r\n groups?: {\r\n edit?: {\r\n [key in number]: {\r\n visible?: \"true\" | \"false\"\r\n inactive?: boolean\r\n closing?: boolean\r\n removedAndIrrelevantInCurrentSituation?: boolean\r\n }\r\n }\r\n }\r\n}\r\ntype FormStatePerInstance = {\r\n // key corresponds here to instanceId of form\r\n [key: string]: SYSFormState\r\n}\r\n\r\nexport type InitFormType = {\r\n formType: SYSForm\r\n formId?: string\r\n fields: { [key: string]: SYSFormField }\r\n feature?: SYSFeature\r\n subFeature?: string\r\n schema?: { [key: string]: Schema }\r\n forceOverwrite?: boolean\r\n forceKeepFormStateOnCancel?: boolean\r\n doFormChangedForEveryFieldInInit?: boolean\r\n initialFocusFieldKey?: string\r\n tableDefId?: SYSTableDefIds\r\n tableRowKey?: string\r\n tableDataMode?: \"Add\" | \"Update\"\r\n isInline?: boolean\r\n row?: any\r\n parentFormType?: SYSForm\r\n parentFormId?: string\r\n parentFieldKey?: string\r\n _fromAutoInit?: boolean\r\n useAlignRight?: boolean\r\n fillSpaceIfEmptyField?: boolean\r\n}\r\n\r\nexport type FormsState = { [key in SYSForm]: FormStatePerInstance }\r\n\r\nexport const _ResetForm: SYSAction = (value) => {\r\n if (value.validationResult) {\r\n Object.keys(value.validationResult).forEach((k) => {\r\n value.validationResult[k].fieldErrors = []\r\n value.validationResult[k].summaryErrors = {}\r\n value.validationResult[k].validationKeyErrors = {}\r\n })\r\n }\r\n Object.keys(value.fields).forEach((k) => {\r\n FieldReset(value.fields[k])\r\n })\r\n value.valid = true\r\n value.dirty = false\r\n}\r\n\r\nexport const _RemoveForm: SYSAction<{ formType: string; formId: string }> = (\r\n value,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n let forms = state.ovl.forms\r\n let f: SYSFormState = forms[value.formType]?.[value.formId]\r\n if (f) {\r\n // call FormRemove Hook\r\n let fn =\r\n actions.app.features[f.feature]?.hooks?.[\r\n HookFormRemove.replace(\"{subFeature}\", f.subFeature)\r\n ]\r\n if (fn) {\r\n fn({\r\n formState: f,\r\n fields: f.fields,\r\n })\r\n }\r\n }\r\n if (f && !f.forceKeepFormStateOnCancel) {\r\n Object.keys(f.fields).forEach((k) => {\r\n f.fields[k]._state._files = undefined\r\n })\r\n\r\n delete forms[value.formType][value.formId]\r\n }\r\n}\r\n\r\nexport const _SetFormUndirty: SYSAction = (value) => {\r\n if (value.dirty) {\r\n value.dirty = false\r\n }\r\n if (value.locked) {\r\n value.locked = false\r\n }\r\n Object.keys(value.fields).forEach((e) => {\r\n let field = value.fields[e]\r\n if (field.dirty) {\r\n field.dirty = false\r\n field.originalValue = field.convertedValue\r\n }\r\n if (field.touched) {\r\n field.touched = false\r\n }\r\n })\r\n}\r\n\r\nexport const _SetFormLock: SYSAction<{\r\n formState: SYSFormState\r\n locked: boolean\r\n}> = (value) => {\r\n if (value.locked && !value.formState.locked) {\r\n value.formState.locked = value.locked\r\n }\r\n}\r\n\r\nexport const _SetFormDirty: SYSAction = (value) => {\r\n if (!value.dirty) {\r\n value.dirty = true\r\n }\r\n}\r\n\r\n// export const _SetFieldDirty: SYSAction<{ field: SYSField; dirty: boolean }> = ({\r\n// field,\r\n// dirty,\r\n// }) => {\r\n// field.dirty = dirty\r\n// }\r\n\r\nexport const _SetFieldTouched: SYSAction<{\r\n field: SYSField\r\n touched: boolean\r\n}> = ({ field, touched }) => {\r\n field.touched = touched\r\n}\r\n\r\nexport const _ValidateDataType: SYSAction = (\r\n value,\r\n { global }\r\n) => {\r\n let actions = global.getActions()\r\n let field = value.field\r\n let type = field.type\r\n let format\r\n if (field.ui.format) {\r\n format = field.ui.format\r\n }\r\n let val: any = field.value\r\n\r\n if (value.isInnerEvent && field.list) {\r\n field.convertedValue = field.value\r\n }\r\n\r\n if (field.type !== \"text\" && val === \"\") {\r\n val = null\r\n }\r\n if (!value.isInnerEvent) {\r\n let hardValueSet = false\r\n\r\n if (field.nullHandling.setToNullIf !== undefined) {\r\n if (val === field.nullHandling.setToNullIf) {\r\n field.dirty = true\r\n field.value = null\r\n field.convertedValue = field.value\r\n val = field.value\r\n hardValueSet = true\r\n }\r\n }\r\n if (field.nullHandling.setToValueIfNull !== undefined) {\r\n if (val === null) {\r\n field.dirty = true\r\n field.value = field.nullHandling.setToValueIfNull\r\n field.convertedValue = field.value\r\n val = field.value\r\n hardValueSet = true\r\n }\r\n }\r\n\r\n if (hardValueSet) {\r\n return\r\n }\r\n }\r\n if (!value.isInnerEvent && field.list && val !== undefined) {\r\n let functionName = HookFieldGetList.replace(\r\n \"{subFeature}\",\r\n value.formState.subFeature\r\n ).replace(\"{fieldKey}\", field.fieldKey)\r\n let listdata: HookFieldGetList_ReturnType\r\n let fn = actions.app.features[value.formState.feature]\r\n if (\r\n field.ui.displayEmptyIfValue !== undefined &&\r\n val === field.ui.displayEmptyIfValue\r\n ) {\r\n field.value = undefined\r\n } else if (fn?.hooks?.[functionName]) {\r\n listdata = _GetFieldList(\r\n fn.hooks[functionName],\r\n field.fieldKey,\r\n value.formState,\r\n value.formState?.tableDefId,\r\n undefined,\r\n true\r\n )\r\n\r\n let entry = listdata.data[val]\r\n if (entry) {\r\n // we really assume here that the type is correct\r\n field.value = entry[field.list.displayField]\r\n if (entry[field.list.valueField] !== undefined) {\r\n field.convertedValue = entry[field.list.valueField]\r\n // listvalues are always assumed to be of correct type\r\n return\r\n } else {\r\n field.convertedValue = val\r\n }\r\n } else {\r\n field.convertedValue = val\r\n }\r\n }\r\n if (field.list.acceptOnlyListValues) {\r\n // further checks will be done in subsequent _ValidateList\r\n // but if it allows values which are not in the list we need to proceed with datatype check\r\n return\r\n }\r\n }\r\n\r\n // only do type validation if there is a value\r\n // other scenarios should be handled in the custom validation\r\n switch (type) {\r\n case \"object\": {\r\n if (!value.isInnerEvent) {\r\n if (typeof val === \"string\") {\r\n field.convertedValue = JSON.parse(val)\r\n } else if (val === null) {\r\n field.convertedValue = null\r\n }\r\n }\r\n break\r\n }\r\n case \"bool\": {\r\n if (val !== field.convertedValue && !value.isInnerEvent) {\r\n field.convertedValue = val\r\n }\r\n break\r\n }\r\n case \"asset\":\r\n case \"text\":\r\n if (!value.isInnerEvent) {\r\n field.convertedValue = val\r\n }\r\n break\r\n\r\n case \"inttime\":\r\n if (val) {\r\n if (!value.isInnerEvent) {\r\n timehelper(field, val, true)\r\n }\r\n } else {\r\n if (!value.isInnerEvent) {\r\n field.convertedValue = null\r\n }\r\n field.value = null\r\n }\r\n break\r\n\r\n case \"time\":\r\n if (val) {\r\n if (!value.isInnerEvent) {\r\n timehelper(field, val, false)\r\n }\r\n } else {\r\n if (!value.isInnerEvent) {\r\n field.convertedValue = null\r\n }\r\n field.value = null\r\n }\r\n break\r\n\r\n case \"date\":\r\n if (val) {\r\n if (\r\n (val.length === 10 || val.length === 24 || val.length === 19) &&\r\n (val.indexOf(\"-\") > -1 || val.indexOf(\"/\") > -1)\r\n ) {\r\n // looks like the well formed date select format coming from chooser\r\n if (val.indexOf(\"/\") > -1) {\r\n val.replace(\"/\", \"-\")\r\n }\r\n let parts = val.split(\"-\")\r\n //its the one if we have year 4 digits\r\n if (parts[0].length === 4) {\r\n let newDate = new Date(\r\n parseInt(parts[0]),\r\n parseInt(parts[1]) - 1,\r\n parseInt(parts[2])\r\n )\r\n\r\n field.convertedValue = getDateISOString(newDate)\r\n\r\n field.value = getDateValue(field.convertedValue, format)\r\n return\r\n }\r\n }\r\n\r\n let vals\r\n let dayFirst = DisplayFormats.dateSpecifics.dayFirst\r\n if (val.indexOf(\".\") > 0) {\r\n vals = val.split(\".\")\r\n } else {\r\n vals = val.split(\"/\")\r\n }\r\n // there should be 3 entries (dd,mm,yyyy) for a complete date as supported for now\r\n let cDate = new Date()\r\n let cDay = cDate.getDate()\r\n let cMonth = cDate.getMonth() + 1\r\n let cYear = cDate.getFullYear()\r\n\r\n let day\r\n let month\r\n let year\r\n\r\n if (vals.length === 1) {\r\n day = parseInt(vals[0])\r\n } else if (vals.length > 1) {\r\n if (vals.length > 2) {\r\n year = parseInt(vals[2])\r\n if (year.toString().length < 4) {\r\n year += 2000\r\n }\r\n }\r\n if (!dayFirst) {\r\n day = parseInt(vals[1])\r\n month = parseInt(vals[0])\r\n } else {\r\n month = parseInt(vals[1])\r\n day = parseInt(vals[0])\r\n }\r\n }\r\n let newDate =\r\n (year ? year.toString().padStart(4, \"0\") : cYear.toString()) +\r\n \"-\" +\r\n (month\r\n ? month.toString().padStart(2, \"0\")\r\n : cMonth.toString().padStart(2, \"0\")) +\r\n \"-\" +\r\n (day\r\n ? day.toString().padStart(2, \"0\")\r\n : cDay.toString().padStart(2, \"0\")) +\r\n \"T00:00:00\"\r\n let resp = new Date(newDate).getTime()\r\n if (!resp) {\r\n ValidationsAdd(field, \"SYSValidatorDataTypeDate\", \"System\")\r\n } else {\r\n let dval = new Date(resp)\r\n newDate = getDateISOString(dval)\r\n if (!value.isInnerEvent) {\r\n field.convertedValue = newDate\r\n field.value = getDateValue(dval, format)\r\n }\r\n }\r\n } else {\r\n if (!value.isInnerEvent) {\r\n field.convertedValue = null\r\n }\r\n field.value = null\r\n }\r\n\r\n break\r\n\r\n case \"datetime\": {\r\n // assume this only comes from the datetime-local control so far\r\n // so just add timezone info\r\n if (!value.isInnerEvent) {\r\n if (!field.value) {\r\n field.convertedValue = null\r\n } else {\r\n try {\r\n if (\r\n SYSConfig._system.defaultDateTimeControlSubmitType === \"Offset\"\r\n ) {\r\n // keep the users timezone info (DateTimeOffset db type)\r\n field.convertedValue = toIsoString(new Date(field.value))\r\n } else {\r\n // create utc (should work with DateTime db type becuase datekind will be UTC)\r\n field.convertedValue = new Date(field.value).toISOString()\r\n }\r\n } catch {\r\n ValidationsAdd(field, \"SYSValidatorDataTypeDate\", \"System\")\r\n }\r\n }\r\n }\r\n break\r\n }\r\n\r\n case \"int\": {\r\n if (val || val === 0) {\r\n let parsedVal = parseInt(val)\r\n //if (parsedVal.toString() !== val.toString()) {\r\n if (parsedVal || parsedVal === 0) {\r\n if (!value.isInnerEvent) {\r\n let pval = getIntegerValue(parsedVal, format)\r\n if (pval !== field.value) {\r\n field.value = pval\r\n }\r\n } else {\r\n if (val !== field.value) {\r\n field.value = val\r\n }\r\n }\r\n if (field.convertedValue !== parsedVal && !value.isInnerEvent) {\r\n field.convertedValue = parsedVal\r\n }\r\n //RemoveFieldValidation(field, \"AppValidationInvalidNumberFormat\")\r\n } else {\r\n ValidationsAdd(field, \"SYSValidatorDataTypeNumber\", \"System\")\r\n }\r\n } else {\r\n if (!value.isInnerEvent) {\r\n field.convertedValue = null\r\n }\r\n field.value = null\r\n }\r\n break\r\n }\r\n\r\n case \"decimal\": {\r\n if (val || val === 0) {\r\n let parsedVal\r\n if (typeof val === \"string\") {\r\n let valToParse = val.replace(/[^0-9.,-]/g, \"\")\r\n valToParse = valToParse.replace(/[,]/g, \".\")\r\n let splits = valToParse.split(\".\")\r\n if (splits.length > 1) {\r\n let fixed = splits.map((m, i) => {\r\n if (i === splits.length - 1) {\r\n return `.${m}`\r\n }\r\n return m\r\n })\r\n parsedVal = parseFloat(fixed.join(\"\"))\r\n } else {\r\n parsedVal = parseFloat(valToParse)\r\n }\r\n } else {\r\n parsedVal = val\r\n }\r\n if (parsedVal || parsedVal == 0) {\r\n if (!value.isInnerEvent) {\r\n // as long as we are entering the value digit by digit we don't like formatting\r\n field.value = getDecimalValue(parsedVal, format) //parsedVal.toString()\r\n field.convertedValue = parsedVal\r\n }\r\n\r\n //RemoveFieldValidation(field, \"AppValidationInvalidNumberFormat\")\r\n } else {\r\n ValidationsAdd(field, \"SYSValidatorDataTypeNumber\", \"System\")\r\n }\r\n } else {\r\n if (!value.isInnerEvent) {\r\n field.convertedValue = null\r\n }\r\n field.value = null\r\n }\r\n break\r\n }\r\n }\r\n}\r\n\r\nconst timehelper = (field: SYSField, val: string, asInt: boolean) => {\r\n let valLeftInt = 0\r\n let valRightInt = 0\r\n val = val.replace(\"+\", \"\").replace(\"-\", \"\")\r\n let splitter = val.indexOf(\":\") > -1 ? \":\" : val.indexOf(\".\") > -1 ? \".\" : \"\"\r\n if (splitter) {\r\n let vals = val.split(splitter)\r\n valLeftInt = parseInt(vals[0])\r\n if (vals.length > 1) {\r\n valRightInt = parseInt(vals[1])\r\n if (vals[1].length < 2) {\r\n valRightInt = valRightInt * 10\r\n }\r\n }\r\n } else {\r\n if (val.length === 3) {\r\n valLeftInt = parseInt(val.substring(0, 1))\r\n valRightInt = parseInt(val.substring(1))\r\n } else if (val.length > 3) {\r\n valLeftInt = parseInt(val.substring(0, 2))\r\n valRightInt = parseInt(val.substring(2))\r\n } else {\r\n valLeftInt = parseInt(val.substring(0))\r\n }\r\n }\r\n let valid = true\r\n if (\r\n isNaN(valLeftInt) ||\r\n isNaN(valRightInt) ||\r\n valLeftInt > 23 ||\r\n valRightInt > 59\r\n ) {\r\n valid = false\r\n }\r\n if (!valid) {\r\n ValidationsAdd(field, \"SYSValidatorTime\", \"System\")\r\n } else {\r\n let valueCorrected = `${valLeftInt\r\n .toString()\r\n .padStart(2, \"0\")}:${valRightInt.toString().padStart(2, \"0\")}`\r\n field.value = valueCorrected\r\n if (asInt) {\r\n field.convertedValue = parseInt(valueCorrected.replace(\":\", \"\"))\r\n } else {\r\n field.convertedValue = valueCorrected\r\n }\r\n }\r\n}\r\n\r\nfunction toIsoString(date) {\r\n var tzo = -date.getTimezoneOffset(),\r\n dif = tzo >= 0 ? \"+\" : \"-\",\r\n pad = function (num) {\r\n return (num < 10 ? \"0\" : \"\") + num\r\n }\r\n\r\n return (\r\n date.getFullYear() +\r\n \"-\" +\r\n pad(date.getMonth() + 1) +\r\n \"-\" +\r\n pad(date.getDate()) +\r\n \"T\" +\r\n pad(date.getHours()) +\r\n \":\" +\r\n pad(date.getMinutes()) +\r\n \":\" +\r\n pad(date.getSeconds()) +\r\n dif +\r\n pad(Math.floor(Math.abs(tzo) / 60)) +\r\n \":\" +\r\n pad(Math.abs(tzo) % 60)\r\n )\r\n}\r\n\r\nexport const _ValidateSchema: SYSAction = (value) => {\r\n let field = value.field\r\n let type = field.type\r\n // check for size\r\n if (!field.list) {\r\n if (type === \"text\") {\r\n if (field.value) {\r\n if (field.value.length > field.schema.maxLength) {\r\n let validation: OptionsValidateResultError = {\r\n translationReps: [field.schema.maxLength],\r\n }\r\n ValidationsAdd(field, \"SYSValidatorSchemaNrOfChars\", \"System\", {\r\n validation,\r\n })\r\n return\r\n }\r\n }\r\n }\r\n } else {\r\n if (field.type === \"text\" && !value.isInnerEvent) {\r\n if (field.convertedValue && !field.hasFocus) {\r\n if (field.convertedValue.length > field.schema.maxLength) {\r\n let validation: OptionsValidateResultError = {\r\n translationReps: [field.schema.maxLength],\r\n }\r\n ValidationsAdd(field, \"SYSValidatorSchemaNrOfChars\", \"System\", {\r\n validation,\r\n })\r\n return\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport const _ValidateList: SYSAction = (\r\n value,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n let field = value.field\r\n\r\n let feature = value.formState.feature\r\n let list = field.list\r\n let val = field.convertedValue\r\n if (\r\n field.schema.nullValidatorToUse === undefined ||\r\n !ValidatorCheck(\r\n field,\r\n field.schema.nullValidatorToUse,\r\n field.schema.nullValidatorOptions?.val\r\n )\r\n ) {\r\n if (val === null || val === \"\") {\r\n return\r\n }\r\n }\r\n let functionName = HookFieldGetList.replace(\r\n \"{subFeature}\",\r\n value.formState.subFeature\r\n ).replace(\"{fieldKey}\", field.fieldKey)\r\n let fn = actions.app.features[feature]\r\n let listdata: HookFieldGetList_ReturnType = value.listData\r\n if (listdata === undefined) {\r\n if (fn?.hooks?.[functionName]) {\r\n listdata = _GetFieldList(\r\n fn.hooks[functionName],\r\n field.fieldKey,\r\n value.formState,\r\n value.formState?.tableDefId,\r\n undefined,\r\n true\r\n )\r\n } else {\r\n throw new Error(`Ovl Error: ${functionName} not found!`)\r\n }\r\n }\r\n\r\n if (list.acceptOnlyListValues && listdata) {\r\n let entry = listdata.data[val]\r\n if (entry === undefined) {\r\n let validation: ValidateResultError = {}\r\n if (list.acceptOnlyListValuesValidatorOptions) {\r\n if (\r\n list.acceptOnlyListValuesValidatorOptions.displayType !== undefined\r\n ) {\r\n validation.displayType =\r\n list.acceptOnlyListValuesValidatorOptions.displayType\r\n }\r\n if (\r\n list.acceptOnlyListValuesValidatorOptions.summaryDisplayType !==\r\n undefined\r\n ) {\r\n validation.summaryDisplayType =\r\n list.acceptOnlyListValuesValidatorOptions.summaryDisplayType\r\n }\r\n if (\r\n list.acceptOnlyListValuesValidatorOptions.summaryGroup !== undefined\r\n ) {\r\n validation.summaryGroup =\r\n list.acceptOnlyListValuesValidatorOptions.summaryGroup\r\n }\r\n if (\r\n list.acceptOnlyListValuesValidatorOptions.translationReps !==\r\n undefined\r\n ) {\r\n validation.translationReps =\r\n list.acceptOnlyListValuesValidatorOptions.translationReps\r\n }\r\n }\r\n // we don't want any other mandatory validation if we have the list validation\r\n _resetValidationForContext(value.formState, field, \"Validate\")\r\n ValidationsAdd(field, \"SYSValidatorListValue\", \"System\", { validation })\r\n }\r\n }\r\n}\r\n\r\nexport const _ValidateField = async (\r\n field: SYSField,\r\n formState: SYSFormState,\r\n actions: SYSActions,\r\n isInnerEvent?: boolean,\r\n ignoreCustomValidation?: boolean,\r\n forceValidation?: boolean\r\n) => {\r\n // console.log(\r\n // \"Validate Start \",\r\n // field.fieldKey,\r\n // field.value,\r\n // field.convertedValue\r\n // )\r\n // create an all fields Validity hash to compare at the end of validate which previousValid and previousConvertedValue should be changed\r\n\r\n // let fieldValidBefore = new Set()\r\n // Object.keys(formState.fields).forEach((k) => {\r\n // if (k === field.fieldKey) {\r\n // // don't check itself\r\n // return\r\n // }\r\n // let checkField = formState.fields[k]\r\n // if (checkField.inactive && !checkField.inactiveButRelevantForValidation) {\r\n // }\r\n // if (\r\n // checkField.validationResult.System.length +\r\n // checkField.validationResult.Validate.length ===\r\n // 0\r\n // ) {\r\n // fieldValidBefore.add(checkField.fieldKey)\r\n // }\r\n // })\r\n\r\n _resetValidationForContext(formState, field, \"System\")\r\n let feature = formState.feature\r\n\r\n actions.ovl.internal._ValidateDataType({\r\n field,\r\n formState,\r\n isInnerEvent,\r\n } as ValidateFieldType)\r\n\r\n let fn = actions.app.features[feature]\r\n\r\n if (\r\n field.validationResult.System.filter((f) => f.resetContext === \"System\")\r\n .length === 0\r\n ) {\r\n if (!isInnerEvent && field.list) {\r\n actions.ovl.internal._ValidateList({\r\n field,\r\n formState,\r\n isInnerEvent,\r\n } as ValidateFieldType)\r\n }\r\n\r\n if (\r\n field.validationResult.System.filter((f) => f.resetContext === \"System\")\r\n .length === 0\r\n ) {\r\n actions.ovl.internal._ValidateSchema({\r\n field,\r\n formState,\r\n isInnerEvent,\r\n } as ValidateFieldType)\r\n\r\n let changed = true\r\n // forceValidation ||\r\n // field.value !== field.previousValue ||\r\n // field.convertedValue !== field.previousConvertedValue ||\r\n // !field.previousValid\r\n\r\n if (\r\n changed &&\r\n field.validationResult.System.filter((f) => f.resetContext === \"System\")\r\n .length === 0\r\n ) {\r\n if (field.schema.nullValidatorToUse) {\r\n _validatorUse(\r\n field,\r\n field.schema.nullValidatorToUse,\r\n \"System\",\r\n field.schema.nullValidatorOptions\r\n ? JSON.parse(JSON.stringify(field.schema.nullValidatorOptions))\r\n : undefined\r\n )\r\n }\r\n }\r\n\r\n let systemValidationCount = field.validationResult.System.filter(\r\n (f) => f.resetContext === \"System\"\r\n ).length\r\n\r\n if (ignoreCustomValidation || systemValidationCount > 0) {\r\n _resetValidationForContext(formState, field, \"Validate\")\r\n }\r\n\r\n if (ignoreCustomValidation !== true && systemValidationCount === 0) {\r\n if (changed) {\r\n _resetValidationForContext(formState, field, \"Validate\")\r\n\r\n if (field.schema.validator1ToUse) {\r\n _validatorUse(\r\n field,\r\n field.schema.validator1ToUse,\r\n \"Validate\",\r\n field.schema.validator1Options\r\n ? JSON.parse(JSON.stringify(field.schema.validator1Options))\r\n : undefined\r\n )\r\n }\r\n let hookFormValidate =\r\n fn?.hooks?.[\r\n HookFormValidate.replace(\"{subFeature}\", formState.subFeature)\r\n ]\r\n if (hookFormValidate) {\r\n let val: HookFormValidate_Type = {\r\n field,\r\n fieldKey: field.fieldKey,\r\n fields: formState.fields,\r\n\r\n formState,\r\n oldValue: field.previousValue,\r\n newValue: field.value,\r\n row: GetRowFromFormState(formState),\r\n correctedValue: undefined,\r\n tab: field.groups.tab,\r\n group: field.groups.group,\r\n validatorUse: (\r\n validator: SYSFormValidationValidators,\r\n options?: ValidatorUseOptions\r\n ): boolean => {\r\n let resetContext: ValidationResetContext = \"Validate\"\r\n if (options?.resetContext) {\r\n resetContext = options.resetContext\r\n }\r\n let fieldToUse = field\r\n if (options?.field) {\r\n fieldToUse = options.field\r\n }\r\n return _validatorUse(\r\n fieldToUse,\r\n validator,\r\n resetContext,\r\n options\r\n )\r\n },\r\n validatorCheck: (\r\n validator: SYSFormValidationValidators,\r\n options?: ValidatorCheckOptions\r\n ): boolean => {\r\n let fieldToUse = field\r\n if (options?.field) {\r\n fieldToUse = options.field\r\n }\r\n return ValidatorCheck(fieldToUse, validator, options?.val)\r\n },\r\n\r\n validationsAdd: (\r\n translationKey: string,\r\n options?: ValidationsAddOptions\r\n ): void => {\r\n let fields = options?.fields\r\n if (fields === undefined) {\r\n fields = [field]\r\n }\r\n let resetContext: ValidationResetContext = \"Validate\"\r\n if (options?.resetContext) {\r\n resetContext = options.resetContext\r\n }\r\n _validationsAdd(\r\n fields,\r\n translationKey,\r\n resetContext,\r\n options\r\n )\r\n },\r\n }\r\n await hookFormValidate(val)\r\n\r\n if (val && val.correctedValue !== undefined) {\r\n field.convertedValue = val.correctedValue\r\n field.value = getDisplayValue(\r\n field.fieldKey,\r\n { list: field.list, type: field.type, ui: field.ui },\r\n val.correctedValue,\r\n formState.feature,\r\n formState,\r\n formState.tableDefId\r\n )\r\n }\r\n }\r\n }\r\n }\r\n }\r\n field.previousValue = field.value\r\n }\r\n}\r\n\r\nexport const _InitForm: SYSAction> = async (\r\n value,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n let instanceId = value.formId\r\n if (!instanceId) {\r\n instanceId = value.formType\r\n }\r\n try {\r\n let feature = value.feature\r\n let subFeature = value.subFeature ? value.subFeature : \"\"\r\n\r\n let parentField: SYSField\r\n if (value.parentFieldKey) {\r\n let parentFormState =\r\n state.ovl.forms[value.parentFormType][value.parentFormId]\r\n parentField = parentFormState.fields[value.parentFieldKey]\r\n }\r\n if (!feature) {\r\n // if (actions.app.features && actions.app.features[value.formType]) {\r\n feature = value.formType\r\n // }\r\n }\r\n let formInstanceList = state.ovl.forms[value.formType]\r\n if (!formInstanceList) {\r\n state.ovl.forms[value.formType] = {}\r\n formInstanceList = state.ovl.forms[value.formType]\r\n }\r\n\r\n // if there is already a formstate -> do nothing (except its forceOverwrite)\r\n let formStateCreated = false\r\n\r\n let fn\r\n fn = actions.app?.features?.[feature]\r\n\r\n let td: _TableGetReturnType\r\n if (value.tableDefId) {\r\n td = TableGet(value.tableDefId)\r\n }\r\n if (!formInstanceList[instanceId] || value.forceOverwrite === true) {\r\n value.fields = JSON.parse(JSON.stringify(value.fields))\r\n formStateCreated = true\r\n if (td) {\r\n value.schema = await TableSchemaGet(td.def.id)\r\n }\r\n\r\n if (parentField && parentField.editor) {\r\n let editorInitHookName = `${HookFormEditorInit.replace(\r\n \"{subFeature}\",\r\n subFeature\r\n )}`\r\n // we have an editor\r\n // call the autoInitFields for Editor hook\r\n let editorInitHook = fn.hooks?.[editorInitHookName]\r\n if (!editorInitHook) {\r\n throw Error(\r\n `Ovl Error: Editor Init Hook ${editorInitHookName} is missing in feature ${feature} hooks`\r\n )\r\n }\r\n\r\n let editorInit: HookFormEditorInit_Type = {\r\n parentField,\r\n toSet: {\r\n fieldsToSet: value.fields === undefined ? {} : value.fields,\r\n groups: [],\r\n },\r\n feature,\r\n formType: value.formType,\r\n formId: instanceId,\r\n }\r\n await editorInitHook(editorInit)\r\n if (actionTracking.canceled === true) {\r\n return\r\n }\r\n value.fields = editorInit.toSet.fieldsToSet\r\n // for editor fields label translation key is given to feature+key\r\n let prefix = parentField.editor.translationPrefix\r\n if (!prefix) {\r\n prefix = \"\"\r\n }\r\n Object.keys(value.fields).forEach((k) => {\r\n if (!value.fields[k].ui?.noLabel) {\r\n let transKey = `${feature}${prefix}${subFeature}${parentField.fieldKey}${k}`\r\n if (!state.ovl.language.translations[transKey]) {\r\n transKey = `${feature}${prefix}${subFeature}${k}`\r\n if (!state.ovl.language.translations[transKey]) {\r\n transKey = `${parentField.editor.id}${prefix}${k}`\r\n if (!state.ovl.language.translations[transKey]) {\r\n transKey = `${parentField.editor.id}${k}`\r\n }\r\n }\r\n }\r\n if (value.fields[k].ui) {\r\n value.fields[k].ui.labelTranslationKey = `${transKey}`\r\n } else {\r\n value.fields[k].ui = {\r\n labelTranslationKey: `${transKey}`,\r\n }\r\n }\r\n }\r\n })\r\n\r\n if (editorInit.toSet.groups && Array.isArray(editorInit.toSet.groups)) {\r\n parentField._state.groupState = editorInit.toSet.groups\r\n } else {\r\n parentField._state.groupState = []\r\n }\r\n }\r\n\r\n if (!value._fromAutoInit) {\r\n // call provide FieldsHook if there\r\n let autoInitHook = fn?.hooks?.[HookFormAutoInit]\r\n\r\n if (autoInitHook) {\r\n let autoInit: HookFormAutoInit_Type = {\r\n formType: value.formType,\r\n formId: value.formId,\r\n toSet: {\r\n fieldsToSet: value.fields === undefined ? {} : value.fields,\r\n formIdToSet: value.formId,\r\n },\r\n }\r\n await autoInitHook(autoInit)\r\n\r\n value.fields = autoInit.toSet.fieldsToSet\r\n }\r\n }\r\n // initialise schema (get from server) if not already done\r\n // so fields can be filled with schema default value if necessary\r\n\r\n if (value.tableDataMode === undefined && value.parentFormType) {\r\n value.tableDataMode =\r\n state.ovl.forms[value.parentFormType][\r\n value.parentFormId\r\n ].tableDataMode\r\n }\r\n let fields: FieldValueMap = getFormFields(\r\n value.schema,\r\n value.fields,\r\n instanceId,\r\n value.formType,\r\n feature,\r\n subFeature,\r\n value.tableDataMode,\r\n value.tableDefId,\r\n value.fillSpaceIfEmptyField\r\n )\r\n\r\n // default for ValueChanged Hook is per Field (New Style from Sept. 22)\r\n if (value.doFormChangedForEveryFieldInInit === undefined) {\r\n value.doFormChangedForEveryFieldInInit = true\r\n }\r\n formInstanceList[instanceId] = {\r\n dirty: false,\r\n valid: true,\r\n fields,\r\n initFields: undefined,\r\n initialFields: undefined,\r\n formId: instanceId,\r\n formType: value.formType,\r\n feature: feature,\r\n subFeature: subFeature,\r\n schema: value.schema\r\n ? JSON.parse(JSON.stringify(value.schema))\r\n : undefined,\r\n forceFocusWhenVisibleFieldKey: value.initialFocusFieldKey,\r\n tableDefId: value.tableDefId,\r\n tableRowKey: value.tableRowKey,\r\n tableDataMode: value.tableDataMode,\r\n row: value.row ? JSON.parse(JSON.stringify(value.row)) : undefined,\r\n forceKeepFormStateOnCancel: value.forceKeepFormStateOnCancel,\r\n doFormChangedForEveryFieldInInit:\r\n value.doFormChangedForEveryFieldInInit,\r\n isInline: value.isInline,\r\n useAlignRight: value.useAlignRight,\r\n _state: {\r\n _oldSituation: \"\",\r\n _activeEditTab: 0,\r\n _fieldSetValFromDebouncedInit: undefined,\r\n _viewHeaderCell: undefined,\r\n _viewRowCell: undefined,\r\n _summaryDebouncer: 0,\r\n _inInitOrChangedCount: 0,\r\n },\r\n /* these will be set using defualt validator hook */\r\n validationDefault: {\r\n displayType: undefined,\r\n summaryDisplayType: undefined,\r\n summaryGroup: undefined,\r\n },\r\n }\r\n if (value.parentFormType) {\r\n let parent = {\r\n formType: value.parentFormType,\r\n formId: value.parentFormId,\r\n fieldKey: value.parentFieldKey,\r\n }\r\n formInstanceList[instanceId].parent = parent\r\n }\r\n\r\n Object.keys(fields).forEach((f) => {\r\n // there is no align center for formfields\r\n // so set those to align left\r\n if (fields[f].ui.align === \"center\" || !value.useAlignRight) {\r\n fields[f].ui.align = \"left\"\r\n }\r\n\r\n if (formInstanceList[instanceId].groups === undefined) {\r\n formInstanceList[instanceId].groups = { edit: {} }\r\n }\r\n\r\n if (\r\n formInstanceList[instanceId].groups.edit[fields[f].groups.group] ===\r\n undefined\r\n ) {\r\n formInstanceList[instanceId].groups.edit[fields[f].groups.group] = {\r\n closing: false,\r\n inactive: false,\r\n visible: \"true\",\r\n }\r\n }\r\n })\r\n //\r\n }\r\n let formState = formInstanceList[instanceId]\r\n formState._state._inInitOrChangedCount++\r\n formState.initialFields = JSON.parse(JSON.stringify(value.fields))\r\n let validatorDefaultHook =\r\n actions.app.global?.hooks?.[HookFormValidatorsDefaults]\r\n if (validatorDefaultHook) {\r\n validatorDefaultHook({\r\n defaultsToSet: formState.validationDefault,\r\n formState,\r\n })\r\n }\r\n\r\n //delete lookup list cache\r\n\r\n _cachedFieldLists.forEach((_value, key) => {\r\n if (\r\n key.startsWith(\r\n `@@table:${formState.tableDefId ? formState.tableDefId : \"\"}@@form:${\r\n formState.formType\r\n }${formState.formId}`\r\n )\r\n ) {\r\n _cachedFieldLists.set(key, undefined)\r\n }\r\n })\r\n\r\n // prepare a summary validation error result for each tab\r\n formState.validationResult = Object.keys(formState.fields).reduce(\r\n (val, k) => {\r\n val[formState.fields[k].groups.tab] = {\r\n summaryErrors: {},\r\n fieldErrors: [],\r\n validationKeyErrors: {},\r\n }\r\n return val\r\n },\r\n {}\r\n )\r\n\r\n if (formState._state._firstTimeToUpdate === undefined) {\r\n formState._state._firstTimeToUpdate = formStateCreated\r\n }\r\n formState.firstInitOrSituationChanged = formStateCreated\r\n if (feature) {\r\n let formInitHook =\r\n fn?.hooks?.[HookFormInit.replace(\"{subFeature}\", subFeature)]\r\n if (formInitHook) {\r\n var initRes: HookFormInit_ReturnType = await formInitHook(<\r\n HookFormInit_Type\r\n >{\r\n formState,\r\n fields: formState.fields,\r\n })\r\n var newSituationObject = { fieldKeys: [], groupKeys: [] }\r\n if (initRes?.fieldsToRemove?.length > 0) {\r\n newSituationObject.fieldKeys = initRes.fieldsToRemove\r\n }\r\n if (initRes?.groupsToRemove?.length > 0) {\r\n newSituationObject.groupKeys = initRes.groupsToRemove\r\n }\r\n let newSituation = JSON.stringify(newSituationObject)\r\n if (newSituation !== formState._state._oldSituation) {\r\n formState.firstInitOrSituationChanged = true\r\n formState._state._oldSituation = newSituation\r\n }\r\n Object.keys(formState.fields)\r\n .filter(\r\n (f) =>\r\n formState.fields[f]._state.removedAndIrrelevantInCurrentSituation\r\n )\r\n .forEach((f) => {\r\n let field = formState.fields[f]\r\n field._state.removedAndIrrelevantInCurrentSituation = false\r\n FieldSetState(field, true)\r\n })\r\n\r\n Object.keys(formState.groups.edit)\r\n .filter(\r\n (f) =>\r\n formState.groups.edit[parseInt(f)]\r\n .removedAndIrrelevantInCurrentSituation\r\n )\r\n .forEach((f) => {\r\n formState.groups.edit[\r\n parseInt(f)\r\n ].removedAndIrrelevantInCurrentSituation = false\r\n })\r\n\r\n if (initRes) {\r\n // if there were irrelevants before remove them\r\n // this enables us to recreate a relevant set everytime we hit forminit\r\n if (initRes.fieldsToRemove !== undefined) {\r\n initRes.fieldsToRemove.forEach((fieldKey) => {\r\n let field = formState.fields[fieldKey]\r\n //FieldSetState(field, false)\r\n field.inactive = true\r\n field._state.visible = false\r\n field.ui.visible = \"false\"\r\n field._state.removedAndIrrelevantInCurrentSituation = true\r\n //console.log(\"set irrelevenat\", field.fieldKey)\r\n })\r\n }\r\n\r\n if (initRes.groupsToRemove !== undefined) {\r\n initRes.groupsToRemove.forEach((groupKey: string) => {\r\n formState.groups.edit[\r\n parseInt(groupKey)\r\n ].removedAndIrrelevantInCurrentSituation = true\r\n Object.keys(formState.fields)\r\n .filter(\r\n (f) => formState.fields[f].groups.group === parseInt(groupKey)\r\n )\r\n .forEach((f2) => {\r\n let field = formState.fields[f2]\r\n field.inactive = true\r\n field._state.visible = false\r\n field.ui.visible = \"false\"\r\n field._state.removedAndIrrelevantInCurrentSituation = true\r\n })\r\n })\r\n }\r\n }\r\n }\r\n }\r\n\r\n //check if there are lists fieldss which have no list match\r\n // and refresh list automatically\r\n let fields = formState.fields\r\n let defColumns = td?.def?.columns\r\n let endpointListFields = Object.keys(fields).filter((f) => {\r\n if (\r\n fields[f].list &&\r\n fields[f].list.serverEndpoint &&\r\n fields[f].list.tryGetLookupFromServerInFormInitIfNotFound\r\n ) {\r\n let existingList = FieldCurrentList(fields[f])\r\n let checkValue = fields[f].convertedValue\r\n if (\r\n checkValue === null ||\r\n (fields[f].list\r\n .tryGetLookupFromServerInFormInitIfNotFoundIgnoreValues !==\r\n \"None\" &&\r\n fields[\r\n f\r\n ].list.tryGetLookupFromServerInFormInitIfNotFoundIgnoreValues.indexOf(\r\n checkValue\r\n ) > -1)\r\n ) {\r\n return false\r\n }\r\n if (existingList.data[checkValue] !== undefined) {\r\n // in addition if one of the lookup column is undefined it needs to be completed as well using this method\r\n return Object.keys(existingList.lookupDef).some(\r\n (s) => existingList.data[checkValue][s] === undefined\r\n )\r\n } else {\r\n return true\r\n }\r\n } else {\r\n return false\r\n }\r\n })\r\n await Promise.all(\r\n endpointListFields.map((m) =>\r\n FieldList(fields[m], {\r\n forceNoSnack: true,\r\n notFullList: true,\r\n })\r\n )\r\n )\r\n _RenderTracking.pauseTracking = true\r\n if (formState.firstInitOrSituationChanged) {\r\n let fieldKeys = Object.keys(formState.fields)\r\n .filter((f) => !formState.fields[f]._state.fieldInitialValidated)\r\n .sort((a, b) => SortGet(defColumns?.[a]?.order, defColumns?.[b]?.order))\r\n\r\n for (let i = 0; i < fieldKeys.length; i++) {\r\n let field = formState.fields[fieldKeys[i]]\r\n if (!field.inactive || field.inactiveButRelevantForValidation) {\r\n if (field.list) {\r\n field.value = field.convertedValue\r\n }\r\n\r\n // make sure we have a ui.labelCaption\r\n await GetFieldLabel(field, formState.feature, field.ui.labelCaption)\r\n field._state.fieldInitialValidated = true\r\n await _ValidateField(field, formState, actions, false, false, true)\r\n\r\n let isValid = FieldIsValidSelective(field)\r\n if (isValid) {\r\n field.previousValid = true\r\n field.previousValidConvertedValue = field.convertedValue\r\n }\r\n }\r\n }\r\n setFormDirty(formState)\r\n }\r\n // // if the field in the underlying data is different than the one on the form its considered dirty\r\n if (formStateCreated && !formState.initFields) {\r\n formState.initFields = JSON.parse(\r\n JSON.stringify(formState.fields),\r\n stringifyReplacer\r\n )\r\n }\r\n if (formState.doFormChangedForEveryFieldInInit) {\r\n let fieldKeys = Object.keys(formState.fields).sort((a, b) =>\r\n SortGet(defColumns?.[a]?.order, defColumns?.[b]?.order)\r\n )\r\n for (let i = 0; i < fieldKeys.length; i++) {\r\n let field = formState.fields[fieldKeys[i]]\r\n if (!field._state.fieldInitialChanged) {\r\n let isValid = FieldIsValidSelective(field)\r\n\r\n let validValueChanged =\r\n field.previousConvertedValue !== field.convertedValue && isValid\r\n ? true\r\n : false\r\n let changedParams: FieldValueChanged = {\r\n field,\r\n isValid,\r\n fieldKey: field.fieldKey,\r\n oldValue: field.previousConvertedValue,\r\n newValue: field.convertedValue,\r\n oldValidValue: field.previousValidConvertedValue,\r\n validValueChanged,\r\n fromInit: true,\r\n group: field.groups.group,\r\n tab: field.groups.tab,\r\n }\r\n let hookFormChanged =\r\n fn?.hooks?.[\r\n HookFormChanged.replace(\"{subFeature}\", formState.subFeature)\r\n ]\r\n\r\n if (hookFormChanged) {\r\n await hookFormChanged({\r\n formState,\r\n fields: formState.fields,\r\n row: GetRowFromFormState(formState),\r\n validatorUse: (\r\n validator: SYSFormValidationValidators,\r\n options?: ValidatorUseOptions\r\n ): boolean => {\r\n let resetContext: ValidationResetContext = \"Validate\"\r\n if (options?.resetContext) {\r\n resetContext = options.resetContext\r\n }\r\n let fieldToUse = field\r\n if (options?.field) {\r\n fieldToUse = options.field\r\n }\r\n return _validatorUse(\r\n fieldToUse,\r\n validator,\r\n resetContext,\r\n options\r\n )\r\n },\r\n validatorCheck: (\r\n validator: SYSFormValidationValidators,\r\n options?: ValidatorCheckOptions\r\n ): boolean => {\r\n let fieldToUse = field\r\n if (options?.field) {\r\n fieldToUse = options.field\r\n }\r\n return ValidatorCheck(fieldToUse, validator, options?.val)\r\n },\r\n validationsAdd: (\r\n translationKey: string,\r\n options?: ValidationsAddOptions\r\n ): void => {\r\n let fields = options?.fields\r\n if (fields === undefined) {\r\n fields = [field]\r\n }\r\n let resetContext: ValidationResetContext = \"Validate\"\r\n if (options?.resetContext) {\r\n resetContext = options.resetContext\r\n }\r\n _validationsAdd(\r\n fields,\r\n translationKey,\r\n resetContext,\r\n options\r\n )\r\n },\r\n validationsRemove: (\r\n fields: SYSField | SYSField[],\r\n validationKey: string\r\n ) => {\r\n if (fields === undefined) {\r\n fields = [field]\r\n }\r\n ValidationsRemove(fields, validationKey)\r\n },\r\n changedFieldSetCorrectedValue: async (val: string) => {\r\n await actions.ovl.form._ChangeField({\r\n fieldKey: changedParams.fieldKey,\r\n formState,\r\n value: val,\r\n isCorrectedValue: true,\r\n })\r\n },\r\n\r\n changedField: changedParams,\r\n })\r\n }\r\n field._state.fieldInitialChanged = true\r\n }\r\n }\r\n }\r\n\r\n // support for old style form init handling\r\n // is disabled by default...\r\n if (!formState.doFormChangedForEveryFieldInInit) {\r\n let hookFormChanged =\r\n fn?.hooks?.[\r\n HookFormChanged.replace(\"{subFeature}\", formState.subFeature)\r\n ]\r\n\r\n if (hookFormChanged) {\r\n await hookFormChanged({\r\n formState,\r\n fields: formState.fields,\r\n row: GetRowFromFormState(formState),\r\n initiatedByFormInit: true,\r\n })\r\n }\r\n }\r\n\r\n formState.firstInitOrSituationChanged = false\r\n Object.keys(formState.fields).forEach((k) => {\r\n _setFieldValid(formState.fields[k])\r\n })\r\n _setFormValid(formState)\r\n setVisibleValidation(formState, 0)\r\n setRowCellInformation(formState, actions, state)\r\n if (\r\n td?.def.options.edit.noCancelOnEditFormIfFormStateWasInvalidWhenOpened &&\r\n formState.tableDataMode === \"Update\" &&\r\n !FormIsValid(formState)\r\n ) {\r\n formState._state._noCancelOnEditFormIfFormStateWasInvalidWhenOpened = true\r\n }\r\n formState._state._inInitOrChangedCount--\r\n\r\n return formState\r\n } catch (e) {\r\n // we need to remove any invalid formstate already created\r\n delete ovl.getState().ovl.forms[value.formType][instanceId]\r\n throw e\r\n }\r\n}\r\nexport type ValidateFieldType = {\r\n value: any\r\n field: SYSField\r\n correctedValue: any\r\n formState: SYSFormState\r\n isInnerEvent: boolean\r\n listData?: ListDefinition\r\n}\r\n\r\nexport type ChangeFieldType = {\r\n formState: SYSFormState\r\n fieldKey: string\r\n value: any\r\n // if initilised touched and dirty should not be set\r\n watched?: boolean\r\n // if innerEvent then just shortcircuit some validation and just do value update (textbox char entry -> every key gets recorded -> keeps state in value but not convertedValue)\r\n // this also means if innerevent is false then for sure the editing is done and lost focus\r\n isInnerEvent?: boolean\r\n\r\n // make oboslete? see FieldSetVal API.\r\n // the submitted value is already the finished converted and user checked value\r\n // so no validation will happen and eventually the form valid will be set to true\r\n ignoreCustomValidation?: boolean\r\n // make oboslete? see FieldSetVal API.\r\n // we don't want the value changed to be fired\r\n ignoreValueChanged?: boolean\r\n\r\n // triggered will not be overwritten by subsequent FieldSetVal in the same process if set to true (prevent endless loops)\r\n noRetrigger?: boolean\r\n\r\n // if its a correctedValue just do the ValidateDataType and remove any Validate and Changed Context Validations\r\n // UseCase Bar: Time Value Correction (Now moved to default time type)\r\n isCorrectedValue?: boolean\r\n}\r\n\r\nexport type SetField = {\r\n formState: SYSFormState\r\n fieldKey: string\r\n convertedValue: any\r\n setToWatched?: boolean\r\n}\r\n\r\nexport type FieldChanged = {\r\n formState: SYSFormState\r\n field: SYSField\r\n convertedValue: any\r\n oldConvertedValue: any\r\n value: any\r\n oldValue: any\r\n row: any\r\n}\r\n\r\nexport type _FocusField = {\r\n field: SYSField\r\n hasFocus: boolean\r\n}\r\n\r\nexport const _FocusField: SYSAction<_FocusField> = (\r\n { field, hasFocus },\r\n { global }\r\n) => {\r\n let formState = ovl.getState().ovl.forms[field.formType][field.formId]\r\n if (!formState) {\r\n return\r\n }\r\n field.hasFocus = hasFocus\r\n if (hasFocus) {\r\n _setFieldWatched(field, true)\r\n formState.fieldToFocus = field.fieldKey\r\n } else {\r\n _setFieldTouched(field, false)\r\n }\r\n}\r\n\r\nexport const _WatchField: SYSAction<{ field: SYSField; watched: boolean }> = (\r\n { field, watched },\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n field.watched = watched\r\n // if (!ValidationContext.mode) {\r\n // setVisibleValidation(ovl.getState().ovl.forms[field.formType][field.formId])\r\n // }\r\n}\r\n\r\n// this method is just used to get the tooltips and custom class names when in form-context\r\nexport const setRowCellInformation = (\r\n formState: SYSFormState,\r\n actions: SYSActions,\r\n state: SYSState\r\n) => {\r\n let columns: { [key: string]: ColumnDisplayDef } =\r\n getColumnDefsFromFormState(formState)\r\n let displayMode: EditDisplayMode = formState.isInline ? \"EditInline\" : \"Edit\"\r\n let resolveFn = actions.app.features[formState.feature]\r\n let def\r\n if (formState.tableDefId) {\r\n def = TableGet(formState.tableDefId).def\r\n }\r\n\r\n if (resolveFn) {\r\n let hookViewRowCellClass =\r\n resolveFn.hooks?.[\r\n HookViewRowCellClass.replace(\"{subFeature}\", formState.subFeature)\r\n ]\r\n if (hookViewRowCellClass) {\r\n let viewRowCellParams: HookViewRowCellClass_Type = {\r\n columns,\r\n displayMode,\r\n rowKey: formState.tableRowKey,\r\n row: GetRowFromFormState(formState),\r\n feature: formState.feature,\r\n tableDefId: formState.tableDefId,\r\n def,\r\n }\r\n let res = hookViewRowCellClass(viewRowCellParams)\r\n // only set it if different\r\n // elsewise a lot of rerendering could happen\r\n if (\r\n JSON.stringify(res) !== JSON.stringify(formState._state._viewRowCell)\r\n ) {\r\n formState._state._viewRowCell = res\r\n }\r\n }\r\n }\r\n if (resolveFn) {\r\n let hookViewHeaderCellClass =\r\n resolveFn.hooks?.[\r\n HookViewHeaderCellClass.replace(\"{subFeature}\", formState.subFeature)\r\n ]\r\n\r\n if (hookViewHeaderCellClass) {\r\n let viewHeaderCellParams: HookViewHeaderCellClass_Type = {\r\n columns,\r\n displayMode,\r\n\r\n feature: formState.feature,\r\n tableDefId: formState.tableDefId,\r\n }\r\n\r\n let res = hookViewHeaderCellClass(viewHeaderCellParams)\r\n if (\r\n JSON.stringify(res) !== JSON.stringify(formState._state._viewHeaderCell)\r\n ) {\r\n formState._state._viewHeaderCell = res\r\n }\r\n }\r\n }\r\n}\r\n\r\nlet changedParams: FieldValueChanged\r\n// we need that barrier to check in FieldIsValid or FormIsValid to call the full shabang\r\n/* changefield itself should not be async cuz it happens a lot */\r\n/* if you need to do async validation use the changed hooks */\r\nexport const _ChangeField: SYSAction = async (\r\n value,\r\n { global }\r\n) => {\r\n value.formState._state._inInitOrChangedCount++\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n if (!value.formState.validationResult) {\r\n throw Error(\r\n \"SetField/ChangeField can only be used on an finished, initialised form\"\r\n )\r\n }\r\n let field: SYSField = value.formState.fields[value.fieldKey]\r\n\r\n if (!value.isCorrectedValue && field._state.noRetrigger) {\r\n // if we are in the middle of a user triggered change and the field get changed again in between\r\n // we don't allow that\r\n return\r\n }\r\n try {\r\n field._state.noRetrigger = value.noRetrigger\r\n value.isInnerEvent = value.isInnerEvent === true\r\n\r\n // important for our Validators to know\r\n if (value.watched !== undefined) {\r\n let _watched = value.watched === true\r\n _setFieldWatched(field, _watched)\r\n }\r\n // => we want userinputs to be reflected immeditaely in the ui (imagine a fast typer)\r\n StartScreenUpdate(0)\r\n\r\n field.value = value.value\r\n if (field.list && !value.isInnerEvent) {\r\n // this is currently the way to bust the list cache...\r\n _GetFieldList(\r\n undefined,\r\n field.fieldKey,\r\n value.formState,\r\n value.formState?.tableDefId,\r\n true,\r\n true\r\n )\r\n }\r\n\r\n if (value.isCorrectedValue) {\r\n // if its a corrected value just do the DataType Check (Which also handles converted Value)\r\n // and also make sure all recorded errors on thies field are resetted\r\n _resetValidationForContext(value.formState, field, \"System\")\r\n _resetValidationForContext(value.formState, field, \"Validate\")\r\n actions.ovl.internal._ValidateDataType({\r\n field,\r\n formState: value.formState,\r\n isInnerEvent: value.isInnerEvent,\r\n } as ValidateFieldType)\r\n } else {\r\n await _ValidateField(\r\n field,\r\n value.formState,\r\n actions,\r\n value.isInnerEvent,\r\n value.ignoreCustomValidation\r\n )\r\n }\r\n\r\n field._state.fieldInitialValidated = true\r\n\r\n if (value.isInnerEvent) {\r\n _setFieldTouched(field, true)\r\n } else {\r\n _setFieldTouched(field, false)\r\n }\r\n let fromInit =\r\n value.formState._state._fieldSetValFromDebouncedInit ||\r\n value.formState.firstInitOrSituationChanged\r\n\r\n if (!value.isInnerEvent) {\r\n let feature = value.formState.feature\r\n let fn = actions.app.features[feature]\r\n\r\n let newValForChanged\r\n let oldValForChanged\r\n let changed = false\r\n let isValid = FieldIsValidSelective(field)\r\n let validValueChanged = !!field._state.forceChange\r\n\r\n if (\r\n field.convertedValue !== field.previousConvertedValue ||\r\n field.previousValid !== isValid ||\r\n (isValid && field.previousValidConvertedValue !== field.convertedValue)\r\n ) {\r\n field._state.forceChange = false\r\n newValForChanged = field.convertedValue\r\n oldValForChanged = field.previousConvertedValue\r\n changed = true\r\n }\r\n\r\n if (field._state.forceChange) {\r\n field._state.forceChange = false\r\n newValForChanged = field.convertedValue\r\n oldValForChanged = field.previousConvertedValue\r\n validValueChanged = true\r\n changed = true\r\n }\r\n\r\n if (changed /*&& !value.ignoreValueChanged*/) {\r\n let oldValidValue = field.previousValidConvertedValue\r\n //@ts-ignore\r\n\r\n if (\r\n isValid &&\r\n field.previousValidConvertedValue !== field.convertedValue\r\n ) {\r\n validValueChanged = true\r\n }\r\n\r\n _resetValidationForContext(value.formState, field, \"ValueChanged\")\r\n isValid = FieldIsValidSelective(field)\r\n if (value.ignoreValueChanged !== true) {\r\n changedParams = {\r\n field,\r\n fieldKey: field.fieldKey,\r\n isValid,\r\n oldValue: oldValForChanged,\r\n newValue: newValForChanged,\r\n oldValidValue,\r\n validValueChanged,\r\n fromInit,\r\n group: field.groups.group,\r\n tab: field.groups.tab,\r\n }\r\n if (!value.isCorrectedValue) {\r\n let hookFormChanged =\r\n fn?.hooks?.[\r\n HookFormChanged.replace(\r\n \"{subFeature}\",\r\n value.formState.subFeature\r\n )\r\n ]\r\n if (hookFormChanged) {\r\n await hookFormChanged({\r\n formState: value.formState,\r\n fields: value.formState.fields,\r\n row: GetRowFromFormState(value.formState),\r\n validatorUse: (\r\n validator: SYSFormValidationValidators,\r\n options?: ValidatorUseOptions\r\n ): boolean => {\r\n let resetContext: ValidationResetContext = \"ValueChanged\"\r\n if (options?.resetContext) {\r\n resetContext = options.resetContext\r\n }\r\n let fieldToUse = field\r\n if (options?.field) {\r\n fieldToUse = options.field\r\n }\r\n\r\n return _validatorUse(\r\n fieldToUse,\r\n validator,\r\n resetContext,\r\n options\r\n )\r\n },\r\n validatorCheck: (\r\n validator: SYSFormValidationValidators,\r\n options?: ValidatorCheckOptions\r\n ): boolean => {\r\n let fieldToUse = field\r\n if (options?.field) {\r\n fieldToUse = options.field\r\n }\r\n return ValidatorCheck(fieldToUse, validator, options?.val)\r\n },\r\n\r\n validationsAdd: (\r\n translationKey: string,\r\n options?: ValidationsAddOptions\r\n ): void => {\r\n let fields = options?.fields\r\n if (fields === undefined) {\r\n fields = [field]\r\n }\r\n let resetContext: ValidationResetContext = \"ValueChanged\"\r\n if (options?.resetContext) {\r\n resetContext = options.resetContext\r\n }\r\n _validationsAdd(\r\n fields,\r\n translationKey,\r\n resetContext,\r\n options\r\n )\r\n },\r\n validationsRemove: (\r\n fields: SYSField | SYSField[],\r\n validationKey: string\r\n ) => {\r\n ValidationsRemove(fields, validationKey)\r\n },\r\n changedFieldSetCorrectedValue: async (val: string) => {\r\n await actions.ovl.form._ChangeField({\r\n fieldKey: changedParams.fieldKey,\r\n formState: value.formState,\r\n value: val,\r\n isCorrectedValue: true,\r\n })\r\n },\r\n\r\n changedField: changedParams,\r\n initiatedByFormInit: false,\r\n })\r\n }\r\n field._state.fieldInitialChanged = true\r\n }\r\n }\r\n field.previousConvertedValue = field.convertedValue\r\n let newValid = FieldIsValidSelective(field)\r\n if (newValid) {\r\n field.previousValidConvertedValue = field.convertedValue\r\n }\r\n // this was field.previousValid = true and inside the if above\r\n // if changing test usecase kaltAG import zuschnittliste with errors that got added in ValueChanged but have resetcontext Validate\r\n field.previousValid = newValid\r\n }\r\n }\r\n if (!field._state.removedAndIrrelevantInCurrentSituation) {\r\n let oldDirty = field.dirty\r\n field.dirty =\r\n /* new 18-04.2024 if tableDataMode = Add don't set dirty on init\r\n this enables canceling the form without prompting if the user really didn't change anything\r\n usecase: casic \"Neuer Auftrag\" -> cancel -> there should be no prompt even the docdate was initialised to todays date\r\n */\r\n (value.formState.tableDataMode !== \"Add\" || !fromInit) &&\r\n !field.schema?.isCalculatedColumn &&\r\n field.convertedValue !== field.originalValue\r\n\r\n if (oldDirty !== field.dirty) {\r\n setFormDirty(value.formState)\r\n }\r\n }\r\n } catch (err) {\r\n if (err.type !== \"OvlServerOffline\") {\r\n SnackAdd(err.message, \"Error\")\r\n }\r\n } finally {\r\n field._state.noRetrigger = false\r\n setVisibleValidation(value.formState)\r\n _setFieldValid(field)\r\n _setFormValid(value.formState)\r\n setRowCellInformation(value.formState, actions, state)\r\n value.formState._state._inInitOrChangedCount--\r\n }\r\n}\r\n\r\n// unclear filter and usage is low in projects (TimePortal)\r\n// better access field validation directly\r\n\r\n// export const GetFormValidationErrors = (formState: SYSFormState): string[] => {\r\n// let res: string[] = []\r\n// Object.keys(formState.fields).map((k) => {\r\n// let field = formState.fields[k]\r\n// res = res.concat(\r\n// field.validationResult.System.concat(\r\n// field.validationResult.Validate.concat(\r\n// field.validationResult.ValueChanged\r\n// )\r\n// )\r\n// .filter((f) => f.displayType !== \"OnlyOutline\")\r\n// .map((m) => T(m.translationKey, m.translationReps))\r\n// )\r\n// })\r\n// res = res.concat(\r\n// formState.validationResult.errors.map((m) =>\r\n// T(m.translationKey, m.translationReps)\r\n// )\r\n// )\r\n// return res\r\n// }\r\n","import type { SYSEditor, SYSFeature, SYSForm, SYSTableDefIds } from \"../../\"\r\nimport { ovl, SYSConfig } from \"../../\"\r\nimport {\r\n HookFormIsDirty,\r\n HookFormIsDirty_ReturnType,\r\n HookFormIsDirty_Type,\r\n HookFormIsValid,\r\n HookFormIsValid_ReturnType,\r\n HookFormIsValid_Type,\r\n} from \"../../global/hooks\"\r\nimport { DialogClose } from \"../dialog/dialogapi\"\r\n\r\nimport type { OvlSysColumn, SYSTableData } from \"../table/table\"\r\nimport { TableRemoveRowFromData } from \"../table/tableapi\"\r\nimport { _SetFormLock, InitFormType } from \"./actions\"\r\nimport {\r\n FieldIsValid,\r\n FieldIsValidSelective,\r\n FieldSetFocus,\r\n FieldSetStateOptionsType,\r\n FieldSetVal,\r\n SYSField,\r\n SYSFormState,\r\n} from \"./fieldapi\"\r\nimport { _setFieldInactive, _setFieldReadonly } from \"./helper\"\r\nimport type { Schema, SYSFormField } from \"./sysformelement\"\r\nimport { _getFormValid, setFormDirty, setVisibleValidation } from \"./validators\"\r\n\r\nexport type FormInitOptions = {\r\n feature?: SYSFeature\r\n subFeature?: string\r\n schema?: { [key: string]: Schema }\r\n initialFocusFieldKey?: string\r\n formId?: string\r\n parentFormType?: SYSForm\r\n parentFormId?: string\r\n parentFieldKey?: string\r\n forceOverwrite?: boolean\r\n forceKeepFormStateOnCancel?: boolean\r\n doFormChangedForEveryFieldInInit?: boolean\r\n tableDefId?: SYSTableDefIds\r\n useAlignRight?: boolean\r\n _fromAutoInit?: boolean\r\n}\r\n\r\nexport type EditorFormInitOptions = {\r\n initialFocusFieldKey?: string\r\n}\r\n\r\nexport const FormInit = async (\r\n formType: SYSForm,\r\n fields: { [key: string]: SYSFormField },\r\n options?: FormInitOptions\r\n): Promise => {\r\n let initForm: InitFormType = {\r\n formType,\r\n fields,\r\n feature: options?.feature,\r\n subFeature: options?.subFeature,\r\n formId: options?.formId,\r\n schema: options?.schema,\r\n initialFocusFieldKey: options?.initialFocusFieldKey,\r\n parentFormType: options?.parentFormType,\r\n parentFormId: options?.parentFormId,\r\n parentFieldKey: options?.parentFieldKey,\r\n forceOverwrite: options?.forceKeepFormStateOnCancel\r\n ? false\r\n : options?.forceOverwrite,\r\n tableDefId: options?.tableDefId,\r\n forceKeepFormStateOnCancel: options?.forceKeepFormStateOnCancel,\r\n doFormChangedForEveryFieldInInit: options?.doFormChangedForEveryFieldInInit,\r\n _fromAutoInit: options?._fromAutoInit,\r\n useAlignRight: options?.useAlignRight,\r\n }\r\n return await ovl.getActions().ovl.form._InitForm(initForm)\r\n}\r\n\r\nexport type GetFormOptions = {\r\n instance?: string\r\n}\r\n\r\nexport type GetFormReturnType = {\r\n formState: SYSFormState\r\n fields: { [key in keyof T]: SYSField }\r\n}\r\n\r\nexport const FormGet = (\r\n formType: SYSForm,\r\n options?: GetFormOptions\r\n): GetFormReturnType => {\r\n let instance\r\n if (options) {\r\n instance = options.instance\r\n }\r\n if (!instance) {\r\n instance = formType\r\n }\r\n let formState = ovl.getState().ovl.forms[formType]?.[instance]\r\n if (!formState) {\r\n return {\r\n formState: undefined,\r\n fields: {} as { [key in keyof FieldType]: SYSField },\r\n }\r\n }\r\n\r\n return {\r\n formState,\r\n fields: <{ [key in keyof FieldType]: SYSField }>formState.fields,\r\n }\r\n}\r\n\r\nexport const FormEditorInit = async (\r\n // formType = editorId in this case\r\n formType: SYSForm,\r\n fields: { [key: string]: SYSFormField },\r\n parentFormState: SYSFormState,\r\n parentFieldKey: string,\r\n options?: EditorFormInitOptions\r\n): Promise => {\r\n let initForm: InitFormType = {\r\n formType,\r\n fields,\r\n feature: `${parentFormState.feature}`,\r\n subFeature: `${parentFormState.subFeature}${formType}`,\r\n formId: `${parentFormState.feature}_${parentFieldKey}_${parentFormState.formId}`,\r\n initialFocusFieldKey: options?.initialFocusFieldKey,\r\n parentFormType: parentFormState.formType,\r\n parentFormId: parentFormState.formId,\r\n parentFieldKey: parentFieldKey,\r\n fillSpaceIfEmptyField: false,\r\n }\r\n return await ovl.getActions().ovl.form._InitForm(initForm)\r\n}\r\n\r\nexport const FormDiscard = (formState: SYSFormState) => {\r\n if (!formState.tableDefId) {\r\n throw new Error(\"Ovl: FormDiscard only works on Forms backed by a Table!\")\r\n }\r\n let data: SYSTableData = SYSConfig.app.tableDefIds[\r\n formState.tableDefId\r\n ].getData(ovl.getState())\r\n\r\n let isAdd = formState.tableDataMode === \"Add\"\r\n\r\n if (isAdd) {\r\n ovl.getActions().ovl.internal._TableDeleteRowFromData({\r\n key: formState.tableRowKey,\r\n def: data.tableDef[formState.tableDefId],\r\n data,\r\n })\r\n }\r\n\r\n ovl.getActions().ovl.table._TableEditClose({\r\n key: formState.tableRowKey,\r\n tableDef: data.tableDef[formState.tableDefId],\r\n data,\r\n })\r\n setTimeout(() => {\r\n ovl.getActions().ovl.form._RemoveForm(formState)\r\n }, 200)\r\n}\r\n\r\nexport type FormSaveOptions = {\r\n ignoreSnack?: boolean\r\n}\r\n\r\nexport const FormSave = async (\r\n formState: SYSFormState,\r\n options?: FormSaveOptions\r\n) => {\r\n let data: SYSTableData = SYSConfig.app.tableDefIds[\r\n formState.tableDefId\r\n ].getData(ovl.getState())\r\n let tableDef = data.tableDef[formState.tableDefId]\r\n var res = await ovl.getActions().ovl.internal._TableEditSaveRow({\r\n key: formState.tableRowKey,\r\n def: tableDef,\r\n data,\r\n formState: formState,\r\n ignoreSnack: options?.ignoreSnack === true,\r\n })\r\n\r\n let result = res.results.filter((f) => f.key === formState.tableRowKey)[0]\r\n // if (result.type === \"beforesavehook_cancel\") {\r\n // ovl.getActions().ovl.dialog._DialogClose({\r\n // dialog: \"SYSTableRowEdit\",\r\n // instance: `${tableDef.id}_${formState.tableRowKey}`,\r\n // })\r\n // return\r\n // }\r\n\r\n if (result && result.type === \"error\") {\r\n return\r\n }\r\n\r\n if (FormIsValid(formState) || result.type === \"beforesavehook_cancel\") {\r\n if (formState.isInline) {\r\n ovl.getActions().ovl.table._TableEditClose({\r\n key: formState.tableRowKey,\r\n tableDef,\r\n data,\r\n })\r\n } else {\r\n DialogClose(\"SYSTableRowEdit\", {\r\n instance: `${tableDef.id}_${formState.tableRowKey}`,\r\n })\r\n }\r\n // new 04.04.2024 .. always removform. was before only in the not inline logic\r\n FormRemove(formState.formType, formState.formId)\r\n }\r\n\r\n //dont use formState.TableRowMode...That gets changed in EditSaveRowHelper for currently unknown reason\r\n let ovlSysState = data.data[formState.tableRowKey]\r\n ?.OvlSysState as OvlSysColumn\r\n // check for ovlSysState because if backendDecidedToMakeUpdate then it's all already set\r\n // and there won't be an entry at formState.tableRowKey\r\n if (ovlSysState) {\r\n let isAdd = ovlSysState.editRow.mode !== \"edit\"\r\n if (isAdd) {\r\n if (result.type !== \"beforesavehook_cancel\") {\r\n if (\r\n tableDef.uiState.dataFilteredAndSorted.indexOf(\r\n formState.tableRowKey\r\n ) < 0\r\n ) {\r\n //push it, if not done already in inline edit\r\n if (tableDef.options.addedRowsPosition === \"bottom\") {\r\n tableDef.uiState.dataFilteredAndSorted.push(formState.tableRowKey)\r\n } else {\r\n tableDef.uiState.dataFilteredAndSorted.unshift(\r\n formState.tableRowKey\r\n )\r\n }\r\n }\r\n } else {\r\n TableRemoveRowFromData(tableDef.id, formState.tableRowKey)\r\n }\r\n }\r\n ovlSysState.editRow.mode = undefined\r\n }\r\n}\r\n\r\nexport const FormReset = (formState) => {\r\n ovl.getActions().ovl.form._ResetForm(formState)\r\n}\r\n\r\nexport const FormRemove = (formType: string, formId?: string) => {\r\n if (!formId) {\r\n formId = formType\r\n }\r\n ovl.getActions().ovl.form._RemoveForm({ formId, formType })\r\n}\r\n\r\nexport const FormSetLock = (formState: SYSFormState, lock: boolean) => {\r\n _SetFormLock({ formState, locked: lock })\r\n}\r\n\r\nexport const FormSetGroupState = (\r\n formState: SYSFormState,\r\n group: number,\r\n active: boolean,\r\n options?: FieldSetStateOptionsType\r\n) => {\r\n let groupState = formState.groups.edit[group]\r\n if (\r\n groupState === undefined ||\r\n groupState.removedAndIrrelevantInCurrentSituation\r\n ) {\r\n return\r\n }\r\n\r\n let fields = formState.fields\r\n let validFields = Object.keys(fields)\r\n .filter((f) => {\r\n return fields[f].groups.group === group\r\n })\r\n .map((m) => fields[m])\r\n let first = true\r\n\r\n let mode = options?.mode\r\n if (!mode) {\r\n mode = \"visible/notvisible\"\r\n }\r\n\r\n validFields.forEach((field) => {\r\n _setFieldInactive(\r\n field,\r\n !active,\r\n options?.animate,\r\n mode,\r\n // focus on the first\r\n first && options?.focusWhenVisible,\r\n true,\r\n options?.forceValueWhenInactive,\r\n options?.forceValue,\r\n options?.keepValidation,\r\n first && options?.focusForce\r\n )\r\n first = false\r\n if (active) {\r\n if (mode === \"readonly/notvisible\") {\r\n _setFieldReadonly(field, true)\r\n } else if (mode === \"visible/readonly\") {\r\n _setFieldReadonly(field, false)\r\n }\r\n } else if (mode === \"visible/readonly\") {\r\n _setFieldReadonly(field, true)\r\n }\r\n })\r\n\r\n if (!active) {\r\n if (mode === \"readonly/notvisible\" || mode === \"visible/notvisible\") {\r\n groupState.visible = \"false\"\r\n }\r\n } else {\r\n groupState.visible = \"true\"\r\n }\r\n groupState.inactive = !active\r\n}\r\n\r\nexport type FormSetGroupValOptionsType = {\r\n setFocus?: boolean\r\n clearList?: boolean\r\n}\r\n\r\nexport const FormSetGroupVal = async (\r\n formState: SYSFormState,\r\n group: number,\r\n val: any,\r\n options?: FormSetGroupValOptionsType\r\n) => {\r\n let groupState = formState.groups.edit[group]\r\n if (\r\n groupState === undefined ||\r\n groupState.removedAndIrrelevantInCurrentSituation\r\n ) {\r\n return\r\n }\r\n let fields = formState.fields\r\n let f_options = { clearList: options?.clearList }\r\n let setFocus = options?.setFocus\r\n let validFields = Object.keys(fields)\r\n .filter((f) => {\r\n return fields[f].groups.group === group\r\n })\r\n .map((m) => fields[m])\r\n await Promise.all(\r\n validFields.map(async (field) => {\r\n await FieldSetVal(field, val, f_options)\r\n })\r\n )\r\n if (setFocus) {\r\n await FormSetGroupFocusToFirstActive(formState, group)\r\n }\r\n}\r\n\r\nexport const FormSetGroupFocusToFirstActive = (\r\n formState: SYSFormState,\r\n group: number\r\n) => {\r\n let groupState = formState.groups.edit[group]\r\n if (\r\n groupState === undefined ||\r\n groupState.removedAndIrrelevantInCurrentSituation\r\n ) {\r\n return\r\n }\r\n let fields = formState.fields\r\n\r\n let validFields = Object.keys(fields)\r\n .filter((f) => {\r\n return fields[f].groups.group === group\r\n })\r\n .map((m) => fields[m])\r\n validFields.some((field) => {\r\n if (!field.inactive && !field.ui.readonly) {\r\n FieldSetFocus(field)\r\n return true\r\n }\r\n })\r\n}\r\n\r\nexport const FormEditGroupIsValidSelective = (\r\n formState: SYSFormState,\r\n group: number,\r\n options?: IsFieldValidOptions\r\n) => {\r\n let keys = Object.keys(formState.fields).filter(\r\n (f) => formState.fields[f] && formState.fields[f].groups.group === group\r\n )\r\n return keys.some((k) => !FieldIsValidSelective(formState.fields[k], options))\r\n}\r\n\r\nexport const FormEditGroupIsValid = (\r\n formState: SYSFormState,\r\n group: number\r\n) => {\r\n let keys = Object.keys(formState.fields).filter(\r\n (f) => formState.fields[f] && formState.fields[f].groups.group === group\r\n )\r\n if (formState._state._inInitOrChangedCount > 0) {\r\n return keys.some((k) => !FieldIsValidSelective(formState.fields[k]))\r\n }\r\n return keys.some((k) => !FieldIsValid(formState.fields[k]))\r\n}\r\n\r\nexport const FormEditTabSet = (formState: SYSFormState, tab: number) => {\r\n if (tab !== formState._state._activeEditTab) {\r\n formState._state._activeEditTab = tab\r\n }\r\n}\r\n\r\nexport const FormEditTabGet = (formState: SYSFormState) => {\r\n return formState._state._activeEditTab\r\n}\r\n\r\nexport const FormEditTabIsValidSelective = (\r\n formState: SYSFormState,\r\n tab: number,\r\n options?: IsFieldValidOptions\r\n) => {\r\n let keys = Object.keys(formState.fields).filter(\r\n (f) => formState.fields[f] && formState.fields[f].groups.tab === tab\r\n )\r\n return !keys.some((k) => !FieldIsValidSelective(formState.fields[k], options))\r\n}\r\n\r\nexport const FormEditTabIsValid = (formState: SYSFormState, tab: number) => {\r\n let keys = Object.keys(formState.fields).filter(\r\n (f) => formState.fields[f] && formState.fields[f].groups.tab === tab\r\n )\r\n if (formState._state._inInitOrChangedCount > 0) {\r\n return !keys.some((k) => !FieldIsValidSelective(formState.fields[k]))\r\n }\r\n return !keys.some((k) => !FieldIsValid(formState.fields[k]))\r\n}\r\n\r\nexport type IsFieldValidOptions = {\r\n ignoreValidationKeys?: string[]\r\n ignoreSystemValidations?: boolean\r\n ignoreValidateValidations?: boolean\r\n ignoreValueChangedValidations?: boolean\r\n}\r\n\r\nexport const FormIsValid = (formState: SYSFormState) => {\r\n if (formState === undefined) {\r\n return false\r\n }\r\n let formIsValid = _getFormValid(formState)\r\n let fn = ovl.getActions().app.features[formState.feature]\r\n let hookFormIsValid =\r\n fn?.hooks?.[HookFormIsValid.replace(\"{subFeature}\", formState.subFeature)]\r\n if (hookFormIsValid) {\r\n let validRes: HookFormIsValid_ReturnType = hookFormIsValid(<\r\n HookFormIsValid_Type\r\n >{\r\n formState,\r\n validFromFields: formIsValid,\r\n })\r\n if (validRes?.forceIsInvalidTrue === true) {\r\n return false\r\n }\r\n }\r\n return formIsValid\r\n}\r\n\r\nexport const FormIsDirty = (formState: SYSFormState) => {\r\n if (formState === undefined) {\r\n return false\r\n }\r\n let fn = ovl.getActions().app.features[formState.feature]\r\n\r\n let hookFormIsDirty =\r\n fn?.hooks?.[HookFormIsDirty.replace(\"{subFeature}\", formState.subFeature)]\r\n if (hookFormIsDirty) {\r\n let dirtyRes: HookFormIsDirty_ReturnType = hookFormIsDirty(<\r\n HookFormIsDirty_Type\r\n >{\r\n formState,\r\n dirtyFromFields: formState.dirty,\r\n })\r\n if (dirtyRes?.forceIsDirtyTrue === true) {\r\n return true\r\n }\r\n }\r\n return formState.dirty\r\n}\r\n\r\nexport const FormSetUnDirty = (formState: SYSFormState) => {\r\n if (formState === undefined) {\r\n return\r\n }\r\n\r\n Object.keys(formState.fields)\r\n .filter((k) => formState.fields[k].dirty)\r\n .forEach((k) => {\r\n formState.fields[k].dirty = false\r\n // new 11.04.24 when undirty form and keeping form then set the new original values\r\n formState.fields[k].originalValue = formState.fields[k].convertedValue\r\n })\r\n setFormDirty(formState)\r\n}\r\n\r\nexport const FormGetDirtyFields = (\r\n formState: SYSFormState\r\n): {\r\n formDirty: boolean\r\n fields: { [key: string]: SYSField }\r\n dirtyFieldsCount: number\r\n} => {\r\n let hasDirty = false\r\n let dirtyFieldsCount = 0\r\n let fieldsRes = {}\r\n if (formState) {\r\n let fields = formState.fields\r\n fieldsRes = Object.keys(fields)\r\n .filter((f) => fields[f].dirty)\r\n .reduce((val, k) => {\r\n hasDirty = true\r\n dirtyFieldsCount++\r\n val[k] = fields[k]\r\n return val\r\n }, {})\r\n }\r\n return { fields: fieldsRes, formDirty: hasDirty, dirtyFieldsCount }\r\n}\r\n\r\nexport const FormIsLocked = (formState: SYSFormState) => {\r\n return formState.locked\r\n}\r\nexport { HasVisibleSummaryErrors as FormHasVisibleSummaryErrors } from \"./validators\"\r\n\r\n// export { GetFormValidationErrors as FormGetValidationErrors } from \"../../library/forms/actions\"\r\nexport type { SYSFormState } from \"../../library/forms/actions\"\r\n","import { SYSDialog, SYSScreen, currentScreenAndDialog, ovl } from \".\"\r\nimport { FocusSet } from \"./global/globalapi\"\r\nimport { _globals } from \"./global/globals\"\r\nimport { DialogCurrentState } from \"./library/dialog/dialogapi\"\r\nimport type { DialogsState } from \"./library/dialog/sysdialogbase\"\r\nimport { FormInit } from \"./library/forms/formapi\"\r\nimport {\r\n ScreenCurrent,\r\n ScreenCurrentState,\r\n ScreenState,\r\n} from \"./library/screenapi\"\r\nimport { _FocusState } from \"./library/sysbaseelement\"\r\nimport { ReactorFnState, RemoveGlobalReactor } from \"./tracker/reactor\"\r\nexport const handleScreenVisible = async (\r\n screen: SYSScreen,\r\n visible: boolean,\r\n instance?: string\r\n) => {\r\n if (instance === undefined) {\r\n instance = screen\r\n }\r\n let screensState = ovl.getState().ovl.screens\r\n let screenState = screensState.screens[screen]\r\n let screenEl = document.getElementById(`ovlscreen_${screen}_${instance}`)\r\n if (visible) {\r\n // switched to visible = true\r\n\r\n if (!screenEl) {\r\n currentScreenAndDialog.screens.push(\r\n document.createElement(screenState.tag)\r\n )\r\n let screenIndex = currentScreenAndDialog.screens.length\r\n let el = currentScreenAndDialog.screens[screenIndex - 1]\r\n el.screen = screen\r\n el.screenInstance = instance\r\n el.id = `ovlscreen_${screen}_${instance}`\r\n const tabIndex = document.createAttribute(\"tabindex\")\r\n tabIndex.value = \"-1\"\r\n el.setAttributeNode(tabIndex)\r\n el.classList.add(\"ovl-screen\")\r\n el.classList.add(`ovl-screen-${screen}`)\r\n el.classList.add(\"fadeInScreen\")\r\n //_RenderTracking.forceTracking = true\r\n screensState.nav.screenCounter++\r\n //_RenderTracking.forceTracking = false\r\n } else {\r\n if (screenState.screenCloseBehaviour === \"ovl-hide\" && screenEl) {\r\n screenEl.classList.remove(\"ovl-hide\")\r\n screenEl.classList.remove(\"fadeOutScreen\")\r\n screenEl.classList.add(\"fadeInScreen\")\r\n\r\n let elsToInit = document.querySelectorAll(\r\n `#ovlscreen_${screen}_${instance} .ovl-reinitwhenreenter`\r\n )\r\n if (elsToInit.length > 0) {\r\n let lastScreen = screensState.nav.previousScreen\r\n for (let i = 0; i < elsToInit.length; i++) {\r\n //@ts-ignore\r\n if (!(await elsToInit[i].init(lastScreen))) {\r\n //@ts-ignore\r\n elsToInit[i].doRender()\r\n }\r\n }\r\n }\r\n }\r\n if (screenEl) {\r\n //screenEl.classList.remove(\"fadeInScreen\")\r\n //@ts-ignore\r\n screenEl.firstUpdatedCalled = false\r\n }\r\n }\r\n // set the focus back to where it was when left\r\n if (screenState.instance?.[instance]?.focus.focusWhenLeft)\r\n setTimeout(() => {\r\n FocusSet(screenState.instance[instance].focus.focusWhenLeft, {\r\n ignoreIfAlreadySetOnScreenOrDialog: true,\r\n })\r\n }, 100)\r\n } else if (screenEl) {\r\n screenState.instance[instance].focus.focusWhenLeft =\r\n _globals.lastValidFocusId\r\n // switched to visible = false\r\n if (screenState.screenCloseBehaviour === \"ovl-hide\") {\r\n screenEl.classList.add(\"ovl-hide\")\r\n screenEl.classList.remove(\"fadeOutScreen\")\r\n screenEl.classList.remove(\"ovl-disabled\")\r\n } else {\r\n let screenIndex = currentScreenAndDialog.screens.findIndex(\r\n (w) => w.screen === screen\r\n )\r\n currentScreenAndDialog.screens.splice(screenIndex, 1)\r\n\r\n //_RenderTracking.forceTracking = true\r\n screensState.nav.screenCounter++\r\n\r\n //_RenderTracking.forceTracking = false\r\n }\r\n screenState.instance[instance].focus.focusSet = false\r\n }\r\n}\r\n\r\nexport const _handleDialogVisible = (context: ReactorFnState) => {\r\n // we are just interested in the visible prop\r\n let p = context.hitPath.split(\".\")\r\n let dialog = p[p.length - 4]\r\n let instance = p[p.length - 2]\r\n let dialogsState = context.state.ovl.dialogs\r\n let dialogState: DialogsState =\r\n context.state.ovl.dialogs[dialog].instance[instance]\r\n\r\n if (!dialogState) {\r\n return\r\n }\r\n let dialogEl = document.getElementById(`ovldialog_${dialog}_${instance}`)\r\n if (context.value) {\r\n // open dialog\r\n if (!dialogEl) {\r\n //disable shellbar and make it non clickable as long at least one dialog is open\r\n let shellbars = document.getElementsByClassName(\"fd-shellbar\")\r\n if (shellbars.length > 0) {\r\n shellbars[0].classList.add(\"ovl-disabled\")\r\n }\r\n\r\n let currentDialog = document.createElement(dialogsState[dialog].tag)\r\n\r\n currentScreenAndDialog.dialogs[`${dialog}@@Ovl${instance}`] =\r\n currentDialog\r\n //@ts-ignore\r\n currentDialog.dialog = dialog\r\n //@ts-ignore\r\n currentDialog.dialogInstance = instance\r\n\r\n currentDialog.id = `ovldialog_${dialog}_${instance}`\r\n\r\n // if (!dialogState.zIndex) {\r\n // let dlgsCount = Object.keys(currentScreenAndDialog.dialogs).length\r\n // dialogState.zIndex = 6 + dlgsCount\r\n // }\r\n\r\n //if a formshandling matches exactly to this dialog then set do it already here\r\n if (dialogState.formsHandling) {\r\n //explicitly connected\r\n let formHandling = dialogState.formsHandling.filter(\r\n (f) => f.isConnectedToDialog\r\n )\r\n if (formHandling.length > 0) {\r\n //@ts-ignore\r\n currentDialog.formType = formHandling[0].formType\r\n //@ts-ignore\r\n currentDialog.formId = formHandling[0].formId\r\n //@ts-ignore\r\n currentDialog.formState =\r\n context.state.ovl.forms[formHandling[0].formType][\r\n formHandling[0].formId\r\n ]\r\n }\r\n }\r\n\r\n //context.state.ovl.screens.nav.dialogCounter++\r\n // reset focusSet\r\n let focusState: _FocusState\r\n //let forceFocus\r\n let currentDialogStates = DialogCurrentState()\r\n if (currentDialogStates.length === 0) {\r\n let screenState = ScreenCurrentState()\r\n focusState = screenState?.focus\r\n } else {\r\n focusState = currentDialogStates[0].focus\r\n //forceFocus = currentDialogStates[0].forceElementIdToFocusAfterClose\r\n }\r\n if (focusState && !focusState.focusWhenLeft) {\r\n focusState.focusSet = false\r\n focusState.focusWhenLeft = _globals.lastValidFocusId\r\n // focusState.focusWhenLeft =\r\n // forceFocus !== undefined ? forceFocus : _globals.lastValidFocusId\r\n }\r\n currentScreenAndDialog.dialogFocusSet.dialog = dialog\r\n currentScreenAndDialog.dialogFocusSet.instance = instance\r\n }\r\n } else if (dialogEl) {\r\n // close dialog\r\n delete currentScreenAndDialog.dialogs[`${dialog}@@Ovl${instance}`]\r\n\r\n if (dialogState.formsHandling) {\r\n dialogState.formsHandling.forEach((f) => {\r\n if (f.removeFormStateWhenClose) {\r\n context.actions.ovl.form._RemoveForm({\r\n formType: f.formType,\r\n formId: f.formId,\r\n })\r\n }\r\n })\r\n dialogState.formsHandling = undefined\r\n }\r\n dialogState.resolver = undefined\r\n dialogState.focus.focusSet = false\r\n dialogState.closing = false\r\n\r\n let currentDialogStates = DialogCurrentState()\r\n let focusState: _FocusState\r\n if (currentDialogStates.length < 2) {\r\n // focusWhenLeft is from screen\r\n focusState = ScreenCurrentState()?.focus\r\n\r\n // no more dialogs open, make shellbar accesible again\r\n let shellbars = document.getElementsByClassName(\"fd-shellbar\")\r\n if (shellbars.length > 0) {\r\n shellbars[0].classList.remove(\"ovl-disabled\")\r\n }\r\n } else {\r\n // there is an underlying dialog. so set focus back from the item when dialog was opened\r\n\r\n focusState = currentDialogStates[1].focus\r\n }\r\n RemoveGlobalReactor([`ovl.dialogs.${dialog}.instance.${instance}.visible`])\r\n delete ovl.getState().ovl.dialogs[dialog].instance[instance]\r\n\r\n if (focusState?.focusWhenLeft) {\r\n setTimeout(() => {\r\n FocusSet(focusState.focusWhenLeft, {\r\n ignoreIfAlreadySetOnScreenOrDialog: true,\r\n preventScroll: true,\r\n })\r\n focusState.focusWhenLeft = undefined\r\n }, 50)\r\n }\r\n }\r\n\r\n // important, setting dialog.visible will be caught in here using a reactor (btw. its a todo to change that and just use the actions)\r\n // that means the visible valueis not written back to state at this point (reactor can cancel setting of value)\r\n // that means we need do trigger the rerender of the dialog after this code runs, thus the settimeout\r\n setTimeout(() => {\r\n context.state.ovl.screens.nav.dialogCounter++\r\n }, 0)\r\n}\r\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst transactionDoneMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(this.request);\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nconst advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance'];\nconst methodMap = {};\nconst advanceResults = new WeakMap();\nconst ittrProxiedCursorToOriginalProxy = new WeakMap();\nconst cursorIteratorTraps = {\n get(target, prop) {\n if (!advanceMethodProps.includes(prop))\n return target[prop];\n let cachedFunc = methodMap[prop];\n if (!cachedFunc) {\n cachedFunc = methodMap[prop] = function (...args) {\n advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args));\n };\n }\n return cachedFunc;\n },\n};\nasync function* iterate(...args) {\n // tslint:disable-next-line:no-this-assignment\n let cursor = this;\n if (!(cursor instanceof IDBCursor)) {\n cursor = await cursor.openCursor(...args);\n }\n if (!cursor)\n return;\n cursor = cursor;\n const proxiedCursor = new Proxy(cursor, cursorIteratorTraps);\n ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor);\n // Map this double-proxy back to the original, so other cursor methods work.\n reverseTransformCache.set(proxiedCursor, unwrap(cursor));\n while (cursor) {\n yield proxiedCursor;\n // If one of the advancing methods was not called, call continue().\n cursor = await (advanceResults.get(proxiedCursor) || cursor.continue());\n advanceResults.delete(proxiedCursor);\n }\n}\nfunction isIteratorProp(target, prop) {\n return ((prop === Symbol.asyncIterator &&\n instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) ||\n (prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore])));\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get(target, prop, receiver) {\n if (isIteratorProp(target, prop))\n return iterate;\n return oldTraps.get(target, prop, receiver);\n },\n has(target, prop) {\n return isIteratorProp(target, prop) || oldTraps.has(target, prop);\n },\n}));\n\nexport { deleteDB, openDB, unwrap, wrap };\n","import { openDB } from \"idb\"\r\nimport { SYSConfig } from \"./config\"\r\n// make stores use _001_ instead of appid\r\n// changes to schema should be handled with a different version\r\nexport const _GetSYSStateStoreName = () => `ovl_001_state`\r\nexport const _GetSYSFilterSortStoreName = () => {\r\n return `ovl_001_filtersortstate`\r\n}\r\n\r\nexport const _GetSYSSessionStoreName = () => {\r\n return `ovl_001_session`\r\n}\r\n\r\nconst dbPromiseSYS = openDB(\"ovl\", 5, {\r\n upgrade(db) {\r\n try {\r\n db.createObjectStore(_GetSYSSessionStoreName())\r\n } catch {}\r\n try {\r\n db.createObjectStore(_GetSYSStateStoreName())\r\n } catch {}\r\n try {\r\n db.createObjectStore(_GetSYSFilterSortStoreName())\r\n } catch {}\r\n },\r\n})\r\n\r\n//usecase: save and rehydrate full app\r\nexport const stateStore = {\r\n async get(key: string) {\r\n return (await dbPromiseSYS).get(_GetSYSStateStoreName(), key)\r\n },\r\n async set(key: string, val) {\r\n return (await dbPromiseSYS).put(_GetSYSStateStoreName(), val, key)\r\n },\r\n async clear() {\r\n return (await dbPromiseSYS).clear(_GetSYSStateStoreName())\r\n },\r\n}\r\n\r\n//usecase: persist filter sort settings\r\nexport const filterSortStore = {\r\n async get(key: string) {\r\n return (await dbPromiseSYS).get(_GetSYSFilterSortStoreName(), key)\r\n },\r\n\r\n async getAllKeys(filter: string) {\r\n return (await dbPromiseSYS).getAllKeys(_GetSYSFilterSortStoreName(), filter)\r\n },\r\n\r\n async set(key: string, val) {\r\n return (await dbPromiseSYS).put(\r\n _GetSYSFilterSortStoreName(),\r\n JSON.parse(JSON.stringify(val)),\r\n key\r\n )\r\n },\r\n async clear() {\r\n return (await dbPromiseSYS).clear(_GetSYSFilterSortStoreName())\r\n },\r\n}\r\n\r\n//usecase: session inf (language, token, selected Company, ...)\r\nexport const sessionStore = {\r\n async get(key: string) {\r\n return (await dbPromiseSYS).get(_GetSYSSessionStoreName(), key)\r\n },\r\n\r\n async getAllKeys(filter: string) {\r\n return (await dbPromiseSYS).getAllKeys(_GetSYSSessionStoreName(), filter)\r\n },\r\n\r\n async set(key: string, val) {\r\n return (await dbPromiseSYS).put(_GetSYSSessionStoreName(), val, key)\r\n },\r\n async clear() {\r\n return (await dbPromiseSYS).clear(_GetSYSSessionStoreName())\r\n },\r\n}\r\n","import { actions } from \"../../ovlsyscomponents/syslogin01/features/actions\"\r\nimport { Data } from \"../dataapi\"\r\nimport { postRequest } from \"../effects\"\r\nimport { _handleDialogVisible, handleScreenVisible } from \"../helpers\"\r\nimport type {\r\n SYSAction,\r\n SYSActions,\r\n SYSFeature,\r\n SYSScreen,\r\n SYSState,\r\n SYSTableDefIds,\r\n} from \"../index\"\r\nimport { SYSConfig, currentScreenAndDialog, ovl } from \"../index\"\r\n\r\nimport { DialogOkCancel } from \"../library/dialog/dialogapi\"\r\nimport type { DialogsState } from \"../library/dialog/sysdialogbase\"\r\nimport { _setDialogVisible } from \"../library/forms/helper\"\r\nimport { setVisibleValidation } from \"../library/forms/validators\"\r\n\r\nimport {\r\n ProcessEnd,\r\n ProcessStart,\r\n} from \"../library/longrunningprocesstracker/processapi\"\r\nimport {\r\n NavigateToScreenOptionsType,\r\n ScreenCurrent,\r\n ScreenCurrentState,\r\n ScreenNavigateBack,\r\n ScreenNavigateTo,\r\n} from \"../library/screenapi\"\r\nimport { SnackAdd } from \"../library/snackapi\"\r\nimport { setLastScrollPosition } from \"../library/sysbaseelement\"\r\nimport { SYSTableDef, TableGet } from \"../library/table/tableapi\"\r\nimport { sessionStore, stateStore } from \"../offlinestorage\"\r\n\r\nimport { AddGlobalReactor } from \"../tracker/reactor\"\r\nimport { FileGetDefaultUrl, SessionUpdate } from \"./globalapi\"\r\nimport { ResetT, T, _ShowFile, hasOSReducedMotion, logout } from \"./globals\"\r\nimport {\r\n HookAppAfterRehydrate,\r\n HookAppUrlResolver,\r\n HookAppUrlResolver_Type,\r\n HookScreenNavigateIn,\r\n HookScreenNavigateIn_Type,\r\n HookScreenNavigateOut,\r\n HookScreenNavigateOut_Type,\r\n} from \"./hooks\"\r\n\r\nexport const _SetLastScrollPosition: SYSAction = (_, { global }) => {\r\n let state = global.getState()\r\n setLastScrollPosition(state.ovl.screens)\r\n}\r\n\r\nexport let screenFadedOutResolver\r\n\r\ntype _NavigateScreenOptionsType = {\r\n instance: any\r\n fromRehydrate?: boolean\r\n}\r\n\r\nexport const _Navigate: SYSAction<{\r\n screen: SYSScreen\r\n navigateBack?: boolean\r\n options?: _NavigateScreenOptionsType\r\n}> = async ({ screen, navigateBack, options }, { global }) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n let screensState = state.ovl.screens\r\n if (screensState.nav.isNavigating) {\r\n return\r\n }\r\n\r\n let currentScreenState = ScreenCurrentState()\r\n if (currentScreenState) {\r\n if (\r\n currentScreenState.screen === screen &&\r\n (options?.instance === undefined ||\r\n currentScreenState.instance === options?.instance)\r\n ) {\r\n return\r\n }\r\n }\r\n let savedPreviousScreen = screensState.nav.previousScreen\r\n let savedPreviousScreenContext = screensState.nav.previousScreenInstance\r\n let instance = options?.instance\r\n if (instance === undefined) {\r\n instance = screen\r\n }\r\n if (screensState.screens[screen]?.instance[instance] === undefined) {\r\n // console.log(screen)\r\n // if (screensState.screens[screen] === undefined) {\r\n // screensState.screens[screen] = { instance: {} }\r\n // }\r\n // if (screensState.screens[screen]?.instance === undefined) {\r\n // screensState.screens[screen][\"instance\"] = {}\r\n // }\r\n screensState.screens[screen].instance[instance] = {\r\n screen: screen,\r\n instance: instance,\r\n visible: false,\r\n closing: false,\r\n lastScrollTop: 0,\r\n focus: {\r\n focusSet: false,\r\n focusWhenLeft: undefined,\r\n },\r\n }\r\n }\r\n if (\r\n options?.fromRehydrate !== true &&\r\n currentScreenState?.screen === screen &&\r\n currentScreenState?.instance === instance\r\n ) {\r\n return\r\n }\r\n screensState.nav.isNavigating = true\r\n let screenElement\r\n let navDirection = navigateBack ? \"Back\" : \"Forward\"\r\n try {\r\n let hooks\r\n\r\n // call navigateOut. for now ignore navigateout when coming from rehydrate\r\n if (currentScreenState?.screen != undefined && !options?.fromRehydrate) {\r\n hooks = actions.app.screens?.[currentScreenState.screen]?.hooks\r\n if (hooks && hooks[HookScreenNavigateOut]) {\r\n let navigateOutResult = await hooks[HookScreenNavigateOut](<\r\n HookScreenNavigateOut_Type\r\n >{\r\n navDirection,\r\n screen: currentScreenState.screen,\r\n toScreen: screen,\r\n instance:\r\n state.ovl.screens.screens[currentScreenState.screen].instance\r\n .context,\r\n })\r\n if (navigateOutResult) {\r\n return\r\n }\r\n }\r\n }\r\n hooks = actions.app.screens?.[screen]?.hooks\r\n\r\n let screenHookPromise\r\n if (hooks && hooks[HookScreenNavigateIn]) {\r\n screenHookPromise = hooks[HookScreenNavigateIn](<\r\n HookScreenNavigateIn_Type\r\n >{\r\n navDirection: navigateBack ? \"Back\" : \"Forward\",\r\n screen,\r\n fromScreen: currentScreenState?.screen,\r\n instance: instance,\r\n })\r\n }\r\n\r\n if (\r\n options?.fromRehydrate &&\r\n currentScreenState?.screen === screen &&\r\n currentScreenState?.instance === instance\r\n ) {\r\n screensState.nav.screensHistory.push({ screen: screen, instance })\r\n if (screenHookPromise !== undefined) {\r\n await screenHookPromise\r\n }\r\n return\r\n }\r\n let screenFadedOutPromise\r\n if (currentScreenState?.screen !== undefined) {\r\n screenFadedOutPromise = new Promise((resolve, reject) => {\r\n screenFadedOutResolver = resolve\r\n })\r\n screenElement = document.getElementById(\r\n `ovlscreen_${currentScreenState.screen}_${currentScreenState.instance}`\r\n )\r\n\r\n if (screenElement) {\r\n screenElement.classList.remove(\"fadeInScreen\")\r\n screenElement.classList.add(\"fadeOutScreen\")\r\n screenElement.classList.add(\"ovl-disabled\")\r\n if (hasOSReducedMotion()) {\r\n screenFadedOutResolver(true)\r\n //screenFadedOutResolver = undefined\r\n } else {\r\n // do not track whilst fading out screen\r\n screenElement.classList.add(\"trackingBlock\")\r\n }\r\n }\r\n }\r\n screensState.nav.previousScreen = screensState.nav.nextScreen\r\n screensState.nav.previousScreenInstance =\r\n screensState.nav.nextScreenInstance\r\n screensState.nav.nextScreen = screen\r\n screensState.nav.nextScreenInstance = instance\r\n let screenHookPromiseRes\r\n await screenFadedOutPromise\r\n if (screenHookPromise !== undefined) {\r\n screenHookPromiseRes = await screenHookPromise\r\n }\r\n\r\n if (screenHookPromise !== undefined && screenHookPromiseRes) {\r\n // will be handled in the catch\r\n throw new Error()\r\n }\r\n //}\r\n actions.ovl.internal._SetLastScrollPosition()\r\n if (currentScreenState?.screen) {\r\n screensState.screens[currentScreenState.screen].instance[\r\n currentScreenState.instance\r\n ].visible = false\r\n handleScreenVisible(\r\n currentScreenState.screen,\r\n false,\r\n currentScreenState.instance\r\n )\r\n }\r\n screensState.screens[screen].instance[instance].disabled =\r\n isScreenDisabledByRunningProcess(state, instance)\r\n\r\n if (!navigateBack) {\r\n if (screensState.screens[screen].noHistory !== true) {\r\n // let foundIndex = screensState.nav.screensHistory.findIndex(\r\n // (f) =>\r\n // f === screen &&\r\n // JSON.stringify(screensState.screens[f].context) === instance\r\n // )\r\n // if (foundIndex !== -1) {\r\n // state.ovl.screens.nav.screensHistory.splice(foundIndex, 1)\r\n // }\r\n state.ovl.screens.nav.screensHistory.push({ screen, instance })\r\n }\r\n screensState.screens[screen].instance[instance].instance = instance\r\n } else {\r\n state.ovl.screens.nav.screensHistory.pop()\r\n }\r\n // if (sameScreen) {\r\n // if (screenElement) {\r\n // screenElement.classList.remove(\"fadeOutScreen\")\r\n // screenElement.classList.remove(\"trackingBlock\")\r\n // screenElement.classList.remove(\"ovl-disabled\")\r\n // screenElement.classList.add(\"fadeInScreen\")\r\n // }\r\n // } else {\r\n screensState.screens[screen].instance[instance].visible = true\r\n handleScreenVisible(screen, true, instance)\r\n //}\r\n } catch (e) {\r\n console.log(e)\r\n if (currentScreenState) {\r\n screensState.nav.nextScreen = currentScreenState.screen\r\n screensState.nav.nextScreenInstance = currentScreenState.instance\r\n screensState.nav.previousScreen = savedPreviousScreen\r\n screensState.nav.previousScreenInstance = savedPreviousScreenContext\r\n }\r\n if (screenElement) {\r\n screenElement.classList.remove(\"fadeOutScreen\")\r\n screenElement.classList.remove(\"trackingBlock\")\r\n screenElement.classList.remove(\"ovl-disabled\")\r\n screenElement.classList.add(\"fadeInScreen\")\r\n }\r\n if (!currentScreenState) {\r\n // there was nothing before (eg. usecase routed directly to screen)\r\n setTimeout(async () => {\r\n if (SYSConfig.init.initalScreen) {\r\n await ScreenNavigateTo(SYSConfig.init.initalScreen)\r\n }\r\n }, 1000)\r\n }\r\n } finally {\r\n state.ovl.screens.nav.isNavigating = false\r\n }\r\n}\r\nexport const isScreenDisabledByRunningProcess = (\r\n state: SYSState,\r\n instance: any\r\n) => {\r\n let processTracker = state.ovl.longRunningProcessTracker\r\n return Object.keys(processTracker).some((f) => {\r\n processTracker[f].lockScreen &&\r\n Object.keys(processTracker[f].instance).some(\r\n (s) => s === instance && processTracker[f].instance[s].isRunning\r\n )\r\n })\r\n}\r\n\r\nexport const _SetPortalTestingMode: SYSAction = async (\r\n value,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n let res = await Data(\"users/setportaltestingmode\", value)\r\n state.ovl.app.isPortalTestingMode = value\r\n}\r\n\r\nexport const _SetLanguage: SYSAction<{\r\n language: string\r\n startup: boolean\r\n}> = async (value, { global }) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n let lang = value.language\r\n let startup = !!value.startup\r\n let res = await Data(\"users/translations\", {\r\n language: lang,\r\n startup,\r\n })\r\n\r\n ResetT()\r\n\r\n /* checking for undefined and null because less dependent on backend... */\r\n let language = state.ovl.language\r\n if (language.translations === undefined && language.translations !== null) {\r\n language.translations = {}\r\n }\r\n Object.keys(res.data.translations).forEach((k) => {\r\n language.translations[k] = res.data.translations[k]\r\n })\r\n if (res.data.lang !== undefined && res.data.lang !== null) {\r\n await SessionUpdate(\"Language\", res.data.lang)\r\n }\r\n if (\r\n res.data.availableTranslations !== undefined &&\r\n res.data.availableTranslations !== null\r\n ) {\r\n language.availableTranslations = res.data.availableTranslations\r\n }\r\n if (\r\n res.data.translationFallbackLanguage !== undefined &&\r\n res.data.translationFallbackLanguage !== null\r\n ) {\r\n language.translationFallbackLanguage = res.data.translationFallbackLanguage\r\n }\r\n\r\n if (res.data.isTest !== undefined && res.data.isTest !== null) {\r\n state.ovl.app.isPortalTestingMode = res.data.isTest\r\n }\r\n if (res.data.pwRegex !== undefined && res.data.pwRegex !== null) {\r\n state.ovl.app.pwRegex = res.data.pwRegex\r\n }\r\n if (res.data.testingEmail !== undefined && res.data.testingEmail !== null) {\r\n state.ovl.app.testingEmail = res.data.testingEmail\r\n }\r\n if (res.data.backendType !== undefined && res.data.backendType !== null) {\r\n state.ovl.app.backendType = res.data.backendType\r\n }\r\n\r\n if (\r\n res.data.translationComplete !== undefined &&\r\n res.data.translationComplete !== null\r\n ) {\r\n state.ovl.language.translationComplete = res.data.translationComplete\r\n }\r\n\r\n // also set body lang fro screenreaders, spellcheck, etc\r\n let body = document.getElementsByTagName(\"body\")[0]\r\n let langCode\r\n switch (res.data.lang) {\r\n case \"DE\":\r\n langCode = \"de-CH\"\r\n break\r\n case \"FR\":\r\n langCode = \"fr-CH\"\r\n break\r\n }\r\n body.setAttribute(\"lang\", state.ovl.session.Language)\r\n if (res.data.additionalRes !== undefined && res.data.additionalRes !== null) {\r\n let fn = actions.app.global?.hooks?.[\"HookHandleAdditionalLanguageResult\"]\r\n if (fn) {\r\n fn(res.data.additionalRes)\r\n }\r\n }\r\n}\r\n\r\nexport const _Logout: SYSAction<{ force?: boolean }> = async (\r\n _,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n if (_.force) {\r\n await postRequest(`${state.ovl.apiUrl}users/logout`, {})\r\n logout()\r\n return\r\n }\r\n if (\r\n (state.ovl.app.offline.api || state.ovl.app.offline.site) &&\r\n SYSConfig.offline.enabled\r\n ) {\r\n SnackAdd(\r\n \"Abmelden und Neuinitialisierung nur im Onlinemodus möglich!\",\r\n \"Error\"\r\n )\r\n return\r\n }\r\n if ((await DialogOkCancel(T(\"SYSLoginLogoutConfirm\"))) === 1) {\r\n //if (SYSConfig.fetch.authMode === \"cookie\") {\r\n await postRequest(`${state.ovl.apiUrl}users/logout`, {})\r\n //}\r\n logout()\r\n }\r\n}\r\n\r\nexport const _GetFile: SYSAction<{\r\n url: string\r\n dataToUrlParams: {}\r\n feature?: SYSFeature\r\n fileName?: string\r\n ignoreSnack?: boolean\r\n}> = async (value) => {\r\n let url = value.url\r\n if (!url) {\r\n url = FileGetDefaultUrl()\r\n }\r\n try {\r\n let processOptions\r\n if (value.ignoreSnack) {\r\n processOptions = { snack: { type: \"none\" } }\r\n }\r\n ProcessStart(\"SYSFileGet\", processOptions)\r\n let res = await Data(undefined, value.dataToUrlParams, {\r\n expectBlob: true,\r\n method: \"GET\",\r\n customUrl: url,\r\n })\r\n if (res.status === 200) {\r\n //let mimeType = res.headers[\"content-type\"]\r\n\r\n await _ShowFile(\r\n res.data,\r\n undefined,\r\n value.feature,\r\n value.fileName,\r\n res.headers\r\n )\r\n }\r\n } finally {\r\n ProcessEnd(\"SYSFileGet\")\r\n }\r\n}\r\n\r\nexport const _RehydrateApp: SYSAction<\r\n {\r\n storeId: string\r\n fn?: (state: SYSState) => {}\r\n contents?: string\r\n },\r\n Promise\r\n> = async (value, { global }) => {\r\n if (\r\n value.storeId !== undefined ||\r\n value.contents ||\r\n SYSConfig.offline.enabled\r\n ) {\r\n try {\r\n let state = global.getState()\r\n let persistedState\r\n if (!value.contents) {\r\n let stateStoreId = SYSConfig._system.statePersistVersion.toString()\r\n if (value.storeId !== undefined) {\r\n stateStoreId = `${stateStoreId}_User_${value.storeId}`\r\n }\r\n persistedState = await stateStore.get(stateStoreId)\r\n } else {\r\n persistedState = JSON.parse(value.contents)\r\n }\r\n\r\n let offlineState = JSON.parse(JSON.stringify(state.ovl.app.offline))\r\n let currentScreen = state.ovl.screens.nav.nextScreen\r\n let currentScreenInstance = state.ovl.screens.nav.nextScreenInstance\r\n if (!persistedState) {\r\n // clear also maybe old versions lingering around...\r\n stateStore.clear()\r\n } else {\r\n if (value.fn) {\r\n value.fn(persistedState)\r\n }\r\n // // set all screens, dialogs to visible false\r\n let screens = state.ovl.screens.screens\r\n let dialogs = state.ovl.dialogs\r\n Object.keys(dialogs).forEach((f) => {\r\n Object.keys(dialogs[f].instance).forEach((instance) => {\r\n dialogs[f].instance[instance].closing = false\r\n dialogs[f].instance[instance].visible = false\r\n })\r\n })\r\n\r\n Object.keys(screens).forEach((f: SYSScreen) => {\r\n Object.keys(screens[f].instance).forEach((instance) => {\r\n screens[f].instance[instance].visible = false\r\n screens[f].instance[instance].closing = false\r\n screens[f].instance[instance].disabled = false\r\n })\r\n })\r\n let persistedDialogs = persistedState.ovl.dialogs\r\n let persistedDialogsClone = JSON.parse(\r\n JSON.stringify(persistedState.ovl.dialogs)\r\n )\r\n Object.keys(persistedDialogs).forEach((f) => {\r\n Object.keys(persistedDialogs[f].instance).forEach((instance) => {\r\n persistedDialogs[f].instance[instance].visible = false\r\n persistedDialogs[f].instance[instance].closing = false\r\n })\r\n })\r\n\r\n let visibleScreen: SYSScreen\r\n let visibleScreenInstance: string\r\n let persistedScreens = persistedState.ovl.screens.screens\r\n Object.keys(persistedScreens).some((s: SYSScreen) => {\r\n return Object.keys(persistedScreens[s].instance).some((instance) => {\r\n if (persistedScreens[s].instance[instance].visible) {\r\n visibleScreen = s\r\n visibleScreenInstance = instance\r\n return true\r\n }\r\n })\r\n })\r\n // reset screenContainer\r\n // we always need a rerender of the container and the containing screen\r\n // test timeport effort saveuserstate, reload page rehydrate then reload efforts -> we had double efforts and the following line i a part of that fix\r\n currentScreenAndDialog.screens = []\r\n // 09.08.2024, knp: Tables create dynamic data[id] -> ids for every row in rebuild\r\n // those are different from the one saved in peristedstate\r\n // thats why we need to reset all the tables\r\n\r\n Object.keys(SYSConfig.app.tableDefIds).forEach((tid) => {\r\n // rebuild SYSConfig for all dynamically added tabledef ids\r\n // usecase BAR Activities\r\n let datadef0 = SYSConfig.app.tableDefIds[tid]\r\n let datadef = datadef0.getData(state)\r\n Object.keys(datadef.tableDef).forEach((td) => {\r\n if (!SYSConfig.app.tableDefIds[td]) {\r\n SYSConfig.app.tableDefIds[td] = datadef0\r\n }\r\n })\r\n })\r\n\r\n // await Promise.all(\r\n // Object.keys(SYSConfig.app.tableDefIds).map((tableDefId) => {\r\n // let tb = TableGet(tableDefId)\r\n // if (tb.def.initialised) {\r\n // return tb.init({ resetStrategy: { ClearData: true } })\r\n // }\r\n // })\r\n // )\r\n\r\n // 09.08.2024, knp: We need Merge here because elsewise we will loose reactivity (proxy references need to stay)\r\n MergeDeep(state, persistedState)\r\n\r\n let fn = ovl.getActions().app.global?.hooks?.[HookAppAfterRehydrate]\r\n if (fn) {\r\n await fn(ovl.getActions())\r\n }\r\n\r\n // setVisibleValidation for forms\r\n let formsState = state.ovl.forms\r\n\r\n Object.keys(formsState).forEach((formtype) => {\r\n let formsInstanceState = formsState[formtype]\r\n Object.keys(formsInstanceState).forEach((formId) => {\r\n let formState = formsState[formtype][formId]\r\n setVisibleValidation(formState, 0)\r\n })\r\n })\r\n\r\n setTimeout(async () => {\r\n SnackAdd(\"Rehydrate App...\", \"BusyIndicator\", 6000)\r\n\r\n if (visibleScreen) {\r\n state.ovl.uiState.appIsScreenNavigateInRehydrating = true\r\n if (persistedScreens[visibleScreen].callNavigateInHookOnRehydrate) {\r\n let hooks = ovl.getActions().app.screens[visibleScreen].hooks\r\n if (hooks?.[HookScreenNavigateIn]) {\r\n await hooks[HookScreenNavigateIn]({\r\n navDirection: \"Forward\",\r\n screen: visibleScreen,\r\n instance: visibleScreenInstance,\r\n })\r\n }\r\n }\r\n state.ovl.uiState.appIsScreenNavigateInRehydrating = false\r\n\r\n handleScreenVisible(visibleScreen, true, visibleScreenInstance)\r\n }\r\n\r\n // now recreate dialogs in zIndex Order\r\n setTimeout(async () => {\r\n let res: DialogsState[] = []\r\n Object.keys(persistedDialogsClone).forEach((f) =>\r\n Object.keys(persistedDialogsClone[f].instance).forEach(\r\n (instance) => {\r\n if (\r\n persistedDialogsClone[f].instance[instance].visible &&\r\n !persistedDialogsClone[f].instance[instance].closing\r\n ) {\r\n res.push(persistedDialogsClone[f].instance[instance])\r\n }\r\n }\r\n )\r\n )\r\n res.sort((a, b) => a.zIndex - b.zIndex)\r\n for (let i = 0; i < res.length; i++) {\r\n let f = res[i]\r\n AddGlobalReactor(\r\n [`ovl.dialogs.${f.dialog}.instance.${f.instance}.visible`],\r\n _handleDialogVisible\r\n )\r\n\r\n _setDialogVisible(\r\n true,\r\n state.ovl.dialogs[f.dialog].instance[f.instance]\r\n )\r\n await new Promise((resolve) => setTimeout(resolve, 400))\r\n }\r\n }, 0)\r\n }, 500)\r\n state.ovl.app.ready = true\r\n // use always current offline state\r\n state.ovl.app.offline = offlineState\r\n\r\n return true\r\n }\r\n } catch (e) {\r\n console.error(\"Persisted Offlinedata could not be restored: \")\r\n console.error(e)\r\n return false\r\n }\r\n }\r\n}\r\n\r\nfunction isObject(item) {\r\n return item && typeof item === \"object\" && !Array.isArray(item)\r\n}\r\n\r\n/**\r\n * Deep merge two objects.\r\n * @param target\r\n * @param ...sources\r\n */\r\nexport function MergeDeep(target, ...sources) {\r\n if (!sources.length) return target\r\n const source = sources.shift()\r\n\r\n if (isObject(target) && isObject(source)) {\r\n for (const key in source) {\r\n if (isObject(source[key])) {\r\n if (!target[key]) Object.assign(target, { [key]: {} })\r\n MergeDeep(target[key], source[key])\r\n } else {\r\n Object.assign(target, { [key]: source[key] })\r\n }\r\n }\r\n }\r\n\r\n return MergeDeep(target, ...sources)\r\n}\r\n\r\nexport const Rehydrate = async (\r\n actions: SYSActions,\r\n id?: string,\r\n fn?: (state: SYSState) => {},\r\n contents?: string\r\n): Promise => {\r\n try {\r\n if (\r\n await actions.ovl.internal._RehydrateApp({\r\n storeId: id,\r\n fn,\r\n contents,\r\n })\r\n ) {\r\n ovl.getState().ovl.uiState.appRehydrated = true\r\n return true\r\n }\r\n } catch (e) {\r\n console.log(\"Rehydrate Error:\")\r\n console.error(e)\r\n }\r\n return false\r\n}\r\n\r\nexport const _InitApp: SYSAction = async (_, { global }) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n // this clears caches and unregister sw\r\n if (window.location.search.toLowerCase().indexOf(\"ovlreset\") > -1) {\r\n logout()\r\n }\r\n\r\n history.scrollRestoration = \"manual\"\r\n history.pushState(null, null, document.URL)\r\n window.addEventListener(\"popstate\", async function (e) {\r\n if (!document.getElementById(\"ovl-dialog\")) {\r\n await ScreenNavigateBack()\r\n history.pushState(null, null, document.URL)\r\n }\r\n })\r\n\r\n // set correct api url\r\n\r\n try {\r\n let apiResolverHookFn = actions.app.global.hooks?.[HookAppUrlResolver]\r\n if (apiResolverHookFn) {\r\n let urlResolverToSet: HookAppUrlResolver_Type = {\r\n apiUrlToSet: undefined,\r\n wsUrlToSet: undefined,\r\n isDemoToSet: false,\r\n isTestingToSet: false,\r\n cleanUrlToSet: true,\r\n }\r\n apiResolverHookFn(urlResolverToSet)\r\n if (urlResolverToSet.apiUrlToSet) {\r\n if (!urlResolverToSet.apiUrlToSet.endsWith(\"/\")) {\r\n urlResolverToSet.apiUrlToSet += \"/\"\r\n }\r\n state.ovl.apiUrl = urlResolverToSet.apiUrlToSet\r\n }\r\n if (urlResolverToSet.wsUrlToSet) {\r\n if (!urlResolverToSet.wsUrlToSet.endsWith(\"/\")) {\r\n urlResolverToSet.wsUrlToSet += \"/\"\r\n }\r\n state.ovl.wsUrl = urlResolverToSet.wsUrlToSet\r\n } else {\r\n state.ovl.wsUrl = state.ovl.apiUrl.replace(\"http\", \"ws\")\r\n }\r\n state.ovl.uiState.isDemo = !!urlResolverToSet.isDemoToSet\r\n state.ovl.app.isPortalTestingMode = !!urlResolverToSet.isTestingToSet\r\n state.ovl.app.cleanUrl = !!urlResolverToSet.cleanUrlToSet\r\n // sets offline.api boolean\r\n await ApiOnlineCheck()\r\n }\r\n\r\n if (SYSConfig.offline.enabled) {\r\n // Update check checks if the client needs to be updated and also sets offline.site boolean\r\n await SiteUpdateCheck()\r\n if (state.ovl.app.offline.api || !state.ovl.apiUrl) {\r\n if (!(await Rehydrate(actions, undefined, undefined))) {\r\n alert(\r\n \"There is no api and a previous state could not be loaded from browser db!\"\r\n )\r\n window.location.reload()\r\n return\r\n } else {\r\n console.log(\"app rehydrated...\")\r\n }\r\n }\r\n }\r\n } catch {\r\n if (state.ovl.app.offline.api) {\r\n await setTimeout(() => {\r\n logout()\r\n }, 10000)\r\n }\r\n }\r\n let customInitFn = actions.app.global?.hooks?.HookAppInit\r\n if (customInitFn) {\r\n await customInitFn()\r\n }\r\n if (!SYSConfig.translation.useLocal && !state.ovl.uiState.appRehydrated) {\r\n let sessionBase = await sessionStore.get(\"base\")\r\n let lang = sessionBase?.Language\r\n\r\n await actions.ovl.internal._SetLanguage({\r\n language: lang,\r\n // if there is no login used at all (OttoRohr, TimePortal KaltAG, always get all translations)\r\n startup:\r\n actions.app.features?.[\"SYSLogin\"]?.hooks?.[\"HookSYSLoginSuccess\"] !==\r\n undefined,\r\n })\r\n }\r\n}\r\n\r\nexport const SiteUpdateCheck = async () => {\r\n if (SYSConfig.offline.enabled) {\r\n // lets try to get the version.js file named exactly after the version in state from site server\r\n // if it fails with a 404 that means we have network but the file couldn't be found because it has a different version in name\r\n // in that case we need to update\r\n // which in turn will clear all the serviceworker,indexeddb using the logout() function currently\r\n // a 404 because if not offline mode this means we have connection\r\n try {\r\n var headers = new Headers()\r\n headers.append(\"pragma\", \"no-cache\")\r\n headers.append(\"cache-control\", \"no-cache\")\r\n\r\n let fetchOptions = new Request(\r\n \"./ovlnocache/\" +\r\n SYSConfig._system.version.split(\".\").join(\"_\") +\r\n \".js\",\r\n {\r\n method: \"get\",\r\n headers,\r\n }\r\n )\r\n let response = await fetch(fetchOptions)\r\n\r\n ovl.getState().ovl.app.offline.site = false\r\n if (response.status === 404) {\r\n alert(\"Update needed!\")\r\n logout()\r\n\r\n // we need an update if we are in offline mode\r\n }\r\n } catch (e) {\r\n ovl.getState().ovl.app.offline.site = true\r\n }\r\n }\r\n}\r\n\r\nexport const ApiOnlineCheck = async () => {\r\n // lets try to access the api url\r\n // a 404 because if not offline mode this means we have connection\r\n try {\r\n let fetchOptions = new Request(ovl.getState().ovl.apiUrl, {\r\n method: \"post\",\r\n })\r\n let response = await fetch(fetchOptions)\r\n ovl.getState().ovl.app.offline.api = false\r\n } catch (e) {\r\n if (SYSConfig.offline.enabled) {\r\n console.info(\"ApiOnlineCheck failed. Proceed with offline Mode\")\r\n }\r\n ovl.getState().ovl.app.offline.api = true\r\n }\r\n}\r\n","import type { DialogsState } from \"./dialog/sysdialogbase\"\r\nimport type { SYSFormState } from \"./forms/actions\"\r\n\r\nimport type {\r\n DirectiveResult,\r\n SYSActions,\r\n SYSDialog,\r\n SYSForm,\r\n SYSScreen,\r\n SYSState,\r\n} from \"..\"\r\n\r\nimport { currentScreenAndDialog, render, TemplateResult } from \"..\"\r\n\r\nimport { ovl, SYSConfig } from \"..\"\r\nimport {\r\n disableBodyScroll,\r\n enableBodyScroll,\r\n hasOSReducedMotion,\r\n isMobile,\r\n} from \"../global/globals\"\r\n\r\nimport { screenFadedOutResolver } from \"../global/actions\"\r\nimport { actionTracking } from \"../tracker/proxyhandler\"\r\nimport {\r\n _RenderTracking,\r\n callbacks,\r\n disposeTrack,\r\n startTrack,\r\n stopTrack,\r\n} from \"../tracker/tracker\"\r\nimport { _setDialogVisible } from \"./forms/helper\"\r\nimport { ScreenCurrent, ScreenCurrentState } from \"./screenapi\"\r\n\r\ntype ScreensHistory = { screen: SYSScreen; instance: string }[]\r\n\r\nexport type _FocusState = {\r\n focusSet?: boolean\r\n focusWhenLeft?: string\r\n}\r\n\r\nexport type _ScreenState = {\r\n screen: SYSScreen\r\n instance?: string\r\n lastScrollTop?: number\r\n disabled?: boolean\r\n visible?: boolean\r\n closing?: boolean\r\n focus?: _FocusState\r\n}\r\n\r\nexport type ScreensState = {\r\n screens: {\r\n [key in SYSScreen]: {\r\n tag?: string\r\n noHistory?: boolean\r\n screenCloseBehaviour?: ScreenCloseBehaviour\r\n instance: { [key: string]: _ScreenState }\r\n }\r\n }\r\n nav: NavState\r\n}\r\n\r\nexport type NavState = {\r\n nextScreen: SYSScreen\r\n nextScreenInstance: string\r\n previousScreen: SYSScreen\r\n previousScreenInstance: string\r\n screenCounter: number\r\n dialogCounter: number\r\n screensHistory: ScreensHistory\r\n isNavigating: boolean\r\n}\r\nexport type ScreenCloseBehaviour = \"remove\" | \"ovl-hide\"\r\nlet _ovl: SYSState\r\nexport const setLastScrollPosition = (screens: typeof _ovl.ovl.screens) => {\r\n let currentScreen = screens.nav.previousScreen\r\n let currentScreenContext = screens.nav.previousScreenInstance\r\n if (currentScreen) {\r\n // get the first scrollable class of the doc\r\n let o = screens.screens[currentScreen].instance[currentScreenContext]\r\n\r\n let scrollable: HTMLElement\r\n if (isMobile()) {\r\n scrollable = document.querySelector(\".scrollableMobile\")\r\n } else {\r\n scrollable = document.querySelector(\".scrollable\")\r\n }\r\n //if (scrollable.tagName === \"BODY\") {\r\n if (!scrollable) {\r\n scrollable = document.documentElement\r\n }\r\n // }\r\n // and remember the scroll pos\r\n if (scrollable && scrollable.scrollTop) {\r\n //console.log(\"saveScroll:\", currentScreen, scrollable.scrollTop)\r\n o.lastScrollTop = scrollable.scrollTop\r\n } else {\r\n o.lastScrollTop = undefined\r\n }\r\n }\r\n}\r\n\r\nexport const scrollToLastPosition = (screens: typeof _ovl.ovl.screens) => {\r\n if (!screens.nav) {\r\n return\r\n }\r\n let currentScreenState = ScreenCurrentState()\r\n let screen = currentScreenState.screen\r\n let instance = currentScreenState.instance\r\n if (!screens.screens?.[screen]?.instance?.[instance]) {\r\n return\r\n }\r\n\r\n let lastScrollTop = screens.screens[screen].instance[instance].lastScrollTop\r\n //console.log(\"scrollTo:\", screen, lastScrollTop)\r\n\r\n if (lastScrollTop === undefined) {\r\n return\r\n }\r\n // set scroll to remembered pos\r\n let scrollable\r\n if (isMobile()) {\r\n scrollable = document.querySelector(\".scrollableMobile\")\r\n } else {\r\n scrollable = document.querySelector(\".scrollable\")\r\n }\r\n\r\n // if (scrollable.tagName === \"BODY\") {\r\n if (!scrollable) {\r\n scrollable = document.documentElement\r\n }\r\n //}\r\n\r\n if (scrollable) {\r\n if (!lastScrollTop) {\r\n lastScrollTop = 0\r\n }\r\n scrollable.scrollTo({\r\n top: lastScrollTop,\r\n left: 0,\r\n behavior: \"smooth\",\r\n })\r\n }\r\n}\r\n\r\nexport class SYSBaseElement extends HTMLElement {\r\n zIndex: number\r\n state: SYSState\r\n actions: SYSActions\r\n formType: SYSForm\r\n formId: string\r\n formState: SYSFormState\r\n screen: SYSScreen\r\n screenInstance: string\r\n screenState: _ScreenState\r\n closedCallbackFn: any\r\n dialog: SYSDialog\r\n dialogInstance: any\r\n isDialogHolder: boolean\r\n dialogState: DialogsState\r\n uiState: typeof _ovl.ovl.uiState\r\n reInitWhenCalledFromScreenEnterUnhide: boolean\r\n _initialised: boolean\r\n name: string\r\n _id: number = 0\r\n\r\n screenCloseBehaviour: ScreenCloseBehaviour\r\n\r\n updatedDebouncer: any\r\n\r\n firstUpdatedCalled: boolean\r\n\r\n handleAnimationStart = (e) => {\r\n if (e.animationName === \"fadeInScreen\") {\r\n scrollToLastPosition(this.state.ovl.screens)\r\n }\r\n }\r\n\r\n handleAnimationEnd = (e) => {\r\n if (e.animationName === \"fadeOutScreen\") {\r\n e.target.classList.remove(\"trackingBlock\")\r\n if (screenFadedOutResolver) {\r\n screenFadedOutResolver()\r\n }\r\n } else if (e.animationName === \"fadeInScreen\") {\r\n e.target.classList.remove(\"fadeInScreen\")\r\n } else if (e.animationName === \"fadeOutDialog\" && this.dialogState) {\r\n _setDialogVisible(false, this.dialogState)\r\n }\r\n }\r\n\r\n async getUI(): Promise<\r\n TemplateResult[] | TemplateResult | HTMLElement | DirectiveResult\r\n > {\r\n return undefined\r\n }\r\n async init(fromScreenEnterUnhide?: string): Promise {\r\n // use it for basic initialisiation\r\n // lets say to define screen or dialog\r\n // fromScreenEnterUnhide will be true if called when Screen was ovl-hide (ScreenBehaviour \"Hide\")\r\n }\r\n\r\n async afterRender() {\r\n // use it for customisation after every rerender\r\n }\r\n\r\n async updated() {\r\n // use it for customisation after every rerender and when dom is ready\r\n }\r\n\r\n async firstUpdated() {\r\n // use it for customisation after first rerender and when dom is ready (set focus eg.)\r\n // focus last focused element when reenter the screen\r\n // console.log(\"first Updated\", this.name)\r\n // let focusId\r\n // if (this.screenState) {\r\n // if (\r\n // !this.screenState.focus.focusSet &&\r\n // this.screenState.focus.focusWhenReEnter\r\n // ) {\r\n // focusId = this.screenState.focus.focusWhenReEnter\r\n // this.screenState.focus.focusSet = true\r\n // }\r\n // if (!this.screenState.focus.focusSet && !focusId) {\r\n // focusId = `ovlscreen_${this.screen}`\r\n // }\r\n // } else if (\r\n // this.isDialogHolder &&\r\n // this.dialogState &&\r\n // !this.dialogState.focus.focusSet\r\n // ) {\r\n // focusId = this.dialogState.focus.focusWhenReEnter\r\n // if (!focusId && this.dialogState.focus.forceElementIdToFocusAfterOpen) {\r\n // focusId = this.dialogState.focus.forceElementIdToFocusAfterOpen\r\n // this.dialogState.focus.forceElementIdToFocusAfterOpen = undefined\r\n // }\r\n // this.dialogState.focus.focusSet = true\r\n // if (!focusId) {\r\n // focusId = `ovl-dialog-${this.dialog}-${this.dialogInstance}`\r\n // }\r\n // }\r\n // if (focusId) {\r\n // FocusSet(focusId)\r\n // }\r\n }\r\n\r\n constructor() {\r\n super()\r\n this._id = new Date().getTime()\r\n this.name = `${this.localName}${this._id.toString()}`\r\n this.state = ovl.getState()\r\n this.actions = ovl.getActions()\r\n this.uiState = ovl.getState().ovl.uiState\r\n }\r\n\r\n async doRender() {\r\n if (!this.isConnected) {\r\n stopTrack()\r\n return\r\n }\r\n startTrack(this)\r\n if (SYSConfig._system.debugTracking) {\r\n console.log(\r\n \"render %c\" + `id: ${this.id}, name:${this.name}`,\r\n \"color:green\"\r\n )\r\n }\r\n //return await this.track(async () => {\r\n // some necessary trackings\r\n //resumeTracking()\r\n\r\n if (!this.isDialogHolder) {\r\n if (this.screenState) {\r\n this.screenState.visible\r\n this.screenState.disabled\r\n }\r\n if (this.dialogState) {\r\n this.dialogState.closing\r\n this.dialogState.visible\r\n if (this.dialogState.disabled) {\r\n if (!this.classList.contains(\"ovl-disabled\")) {\r\n this.classList.add(\"ovl-disabled\")\r\n }\r\n } else {\r\n if (this.classList.contains(\"ovl-disabled\")) {\r\n this.classList.remove(\"ovl-disabled\")\r\n }\r\n }\r\n }\r\n }\r\n // no need for screen or dialog rerendering if fading out\r\n if (\r\n (this.screen || this.dialog) &&\r\n this.classList.toString().indexOf(\"fadeOut\") > -1\r\n ) {\r\n //pauseTracking()\r\n stopTrack()\r\n return\r\n }\r\n\r\n // /necessary trackings\r\n //pauseTracking()\r\n\r\n let dialogVisible = false\r\n let screenVisible = false\r\n\r\n if (this.dialog) {\r\n // if (!this.isDialogHolder) {\r\n // this.id = \"ovldialog_\" + this.dialog\r\n // }\r\n if (this.dialogState.closing) {\r\n if (this.getElementsByClassName(\"fd-message-box\").length < 1) {\r\n //pauseTracking()\r\n stopTrack()\r\n return\r\n }\r\n\r\n this.doDialogOnCloseStuff()\r\n\r\n if (hasOSReducedMotion()) {\r\n _setDialogVisible(false, this.dialogState)\r\n } else {\r\n //if (!this.isDialogHolder) {\r\n this.fadeOut(\"fadeInDialog\", \"fadeOutDialog\")\r\n //}\r\n }\r\n //pauseTracking()\r\n stopTrack()\r\n return\r\n }\r\n dialogVisible = this.dialogState.visible\r\n } else if (this.screen) {\r\n screenVisible = this.screenState.visible\r\n }\r\n //resumeTracking()\r\n\r\n let isComponent = !this.screen && !this.dialog\r\n\r\n let res\r\n let isScreenAndVisible = screenVisible && this.screen\r\n let isDialogAndVisible = dialogVisible && this.dialog\r\n if (isScreenAndVisible || isDialogAndVisible) {\r\n if (this.screen) {\r\n if (this.screenState.disabled) {\r\n if (!this.classList.contains(\"ovl-disabled\")) {\r\n this.classList.add(\"ovl-disabled\")\r\n }\r\n } else {\r\n if (this.classList.contains(\"ovl-disabled\")) {\r\n this.classList.remove(\"ovl-disabled\")\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (isComponent || isScreenAndVisible || isDialogAndVisible) {\r\n actionTracking.lastActionName = `Component(${actionTracking.lastActionName}): ${this.id}`\r\n startTrack(this)\r\n res = await this.getUI()\r\n stopTrack()\r\n\r\n if (res) {\r\n if (this.dialog) {\r\n if (!this.isDialogHolder) {\r\n disableBodyScroll()\r\n }\r\n }\r\n let startTime\r\n let endTime\r\n startTime = new Date().getTime()\r\n await render(res, this)\r\n endTime = new Date().getTime()\r\n if (SYSConfig._system.debugTracking) {\r\n console.log(\r\n \"render %c\" +\r\n `id: ${this.id}, name:${this.name}, time elapsed MS:${\r\n endTime - startTime\r\n }`,\r\n \"color:green\"\r\n )\r\n }\r\n // \"new\" approach do afterrender only if smth was rendered\r\n // needs some long term testing and can then be removed (the flag)\r\n if (SYSConfig._system.suppressAfterRenderIfGetUIEmpty) {\r\n await this.doAfterRender()\r\n }\r\n } else {\r\n await render(undefined, this)\r\n }\r\n }\r\n\r\n // \"old\" approach do afterrender even there was nothing rendered\r\n if (!SYSConfig._system.suppressAfterRenderIfGetUIEmpty) {\r\n await this.doAfterRender()\r\n }\r\n\r\n //pauseTracking()\r\n }\r\n\r\n doAfterRender = async () => {\r\n if (this.isConnected) {\r\n await this.afterRender()\r\n if (this.updatedDebouncer) {\r\n clearTimeout(this.updatedDebouncer)\r\n //this.updatedDebouncer = null\r\n }\r\n this.updatedDebouncer = setTimeout(async () => {\r\n if (this.isConnected) {\r\n if (!this.firstUpdatedCalled) {\r\n this.firstUpdatedCalled = true\r\n await this.firstUpdated()\r\n }\r\n await this.updated()\r\n }\r\n }, 150)\r\n }\r\n }\r\n\r\n doDialogOnCloseStuff() {\r\n enableBodyScroll()\r\n }\r\n\r\n fadeOut(fadeInClass: string, fadeOutClass: string) {\r\n let el: any = this\r\n if (this.dialog) {\r\n el = this.getElementsByClassName(\"fd-message-box\")[0]\r\n }\r\n if (el.classList.contains(fadeInClass)) {\r\n el.classList.remove(fadeInClass)\r\n }\r\n if (!el.classList.contains(\"ovl-disabled\")) {\r\n el.classList.add(\"ovl-disabled\")\r\n }\r\n if (!el.classList.contains(fadeOutClass)) {\r\n el.classList.add(fadeOutClass)\r\n }\r\n }\r\n\r\n fadeIn(fadeInClass: string, fadeOutClass: string) {\r\n let el: any = this\r\n if (el.classList.contains(fadeOutClass)) {\r\n el.classList.remove(fadeOutClass)\r\n }\r\n if (!el.classList.contains(fadeInClass)) {\r\n el.classList.add(fadeInClass)\r\n }\r\n }\r\n\r\n async connectedCallback() {\r\n _RenderTracking.pauseTracking = true\r\n if (this.screen) {\r\n this.screenState =\r\n this.state.ovl.screens.screens[this.screen].instance[\r\n this.screenInstance\r\n ]\r\n this.screenCloseBehaviour =\r\n this.state.ovl.screens.screens[this.screen].screenCloseBehaviour\r\n }\r\n\r\n if (this.dialog && !this.dialogInstance) {\r\n this.dialogInstance = this.dialog\r\n }\r\n\r\n if (this.dialog) {\r\n this.dialogState =\r\n this.state.ovl.dialogs[this.dialog].instance[this.dialogInstance]\r\n // if (!this.dialogState.zIndex) {\r\n // let dlgsCount = Object.keys(currentScreenAndDialog.dialogs).length\r\n // this.dialogState.zIndex = 6 + dlgsCount\r\n // }\r\n this.zIndex = this.dialogState.zIndex\r\n }\r\n\r\n if (SYSConfig._system.debugTracking) {\r\n console.log(\r\n \"init %c\" + `id: ${this.id}, name:${this.name}`,\r\n \"color:green\"\r\n )\r\n }\r\n this.classList.add(\"ovl-comp\")\r\n\r\n if (!(await this.init())) {\r\n await this.doRender()\r\n }\r\n this._initialised = true\r\n if (\r\n this.reInitWhenCalledFromScreenEnterUnhide &&\r\n !this.classList.contains(\"ovl-reinitwhenreenter\")\r\n ) {\r\n this.classList.add(\"ovl-reinitwhenreenter\")\r\n }\r\n if (this.screen || this.dialog) {\r\n if (!this.isDialogHolder) {\r\n this.addEventListener(\"animationend\", this.handleAnimationEnd)\r\n this.addEventListener(\"animationstart\", this.handleAnimationStart)\r\n }\r\n }\r\n }\r\n\r\n async disconnectedCallback() {\r\n this.removeEventListener(\"animationend\", this.handleAnimationEnd)\r\n this.removeEventListener(\"animationstart\", this.handleAnimationStart)\r\n\r\n //pauseTracking()\r\n disposeTrack(this)\r\n if (SYSConfig._system.debugTracking) {\r\n console.log(\r\n \"disconnect %c\" + `id: ${this.id}, name:${this.name}`,\r\n \"color:green\"\r\n )\r\n }\r\n if (this.dialogState) {\r\n if (this.closedCallbackFn) {\r\n this.closedCallbackFn()\r\n this.closedCallbackFn = null\r\n }\r\n }\r\n }\r\n}\r\n","import { html, ifDefined, SYSTableDefIds, TemplateResult } from \"../../\"\r\nimport type {\r\n _TableGroupColumnsToSetType,\r\n HookTableGroupHeadersFooters_Type,\r\n HookViewRowClass_Type,\r\n} from \"../../global/hooks\"\r\nimport {\r\n HookTableGroupFooters,\r\n HookTableGroupHeaders,\r\n HookViewRowClass,\r\n} from \"../../global/hooks\"\r\n\r\nimport type { SYSFormState } from \"../forms/actions\"\r\nimport { FormHasVisibleSummaryErrors } from \"../forms/formapi\"\r\n\r\nimport { SYSBaseElement } from \"../sysbaseelement\"\r\nimport { _GetAlign } from \"./helpers\"\r\nimport type { NavProps } from \"./rowcontrol\"\r\nimport {\r\n EditRowDef,\r\n EditRowSaveCancelDef,\r\n GroupBreakType,\r\n OvlSysColumn,\r\n SelectedEditRow,\r\n SelectedRow,\r\n SelectedViewRow,\r\n SYSTableData,\r\n SYSTableDef,\r\n ViewRowClassType,\r\n} from \"./table\"\r\nimport { TableRebuild } from \"./tableapi\"\r\nexport let _HookTableGroupDefId: SYSTableDefIds\r\nexport type GroupHeaderFooterBreaksValueType = \"columns\" | \"custom\"\r\n\r\nexport type TableRowDef = {\r\n data: SYSTableData\r\n selected: SelectedRow\r\n tableDef: SYSTableDef\r\n processesToTrackForRowFnHintDisplay: any\r\n thHeaderEnd: {}\r\n key: string\r\n index: number\r\n intersectionObserver: IntersectionObserver\r\n tableGroupHeaderBreak: {\r\n isBreak?: boolean\r\n isFirstRow?: boolean\r\n isLastRow: boolean\r\n groups?: { [key: string]: GroupBreakType }\r\n groupAccessStrings?: string[]\r\n }\r\n tableGroupFooterBreak: {\r\n isBreak?: boolean\r\n isFirstRow?: boolean\r\n isLastRow: boolean\r\n groups?: { [key: string]: GroupBreakType }\r\n groupAccessStrings?: string[]\r\n }\r\n}\r\n\r\nexport type TableRowDataDef = {\r\n row: {}\r\n tableDef: SYSTableDef\r\n key: string\r\n thHeaderEnd: {}\r\n intersectionObserver: IntersectionObserver\r\n processesToTrackForRowFnHintDisplay: any\r\n}\r\n\r\nexport class SYSTableRowWrapper extends SYSBaseElement {\r\n props: any\r\n row: TableRowDef\r\n columnsVisible: {}\r\n classToSet: string\r\n\r\n async init() {\r\n this.row = this.props()\r\n await super.init()\r\n }\r\n\r\n getTemplate(\r\n type: GroupHeaderFooterBreaksValueType,\r\n columnsToSet?: _TableGroupColumnsToSetType\r\n ):\r\n | {\r\n cssClassToSet: string\r\n _type: GroupHeaderFooterBreaksValueType\r\n valueToSet: _TableGroupColumnsToSetType\r\n }\r\n | {\r\n cssClassToSet: string\r\n _type: GroupHeaderFooterBreaksValueType\r\n valueToSet: TemplateResult\r\n } {\r\n if (type === \"columns\") {\r\n return { cssClassToSet: \"\", _type: type, valueToSet: columnsToSet }\r\n } else {\r\n return {\r\n cssClassToSet: \"\",\r\n _type: type,\r\n valueToSet: undefined,\r\n }\r\n }\r\n }\r\n\r\n async getUI() {\r\n let def = this.row.tableDef\r\n let key = this.row.key\r\n let data = this.row.data\r\n let rows = data.data\r\n let row = rows[key]\r\n if (!row) {\r\n return null\r\n }\r\n let colSysState = data.data[key].OvlSysState as OvlSysColumn\r\n let editSelected = colSysState.editRow\r\n let selected = this.row.selected\r\n\r\n /* leave those read to track breaking correctly */\r\n /* */\r\n this.row.tableGroupHeaderBreak?.isBreak\r\n this.row.tableGroupFooterBreak?.isBreak\r\n /* */\r\n\r\n let nav\r\n if (selected) {\r\n if (selected.showNav) {\r\n nav = html`\r\n {\r\n return {\r\n tableDef: def,\r\n data: data,\r\n key: key,\r\n }\r\n }}\r\n >\r\n \r\n `\r\n }\r\n }\r\n\r\n //let inlineEditClass = \"\"\r\n let selectedClass = \"\"\r\n if (editSelected) {\r\n // also use the selected bg if an row is editet\r\n if (editSelected.selected) {\r\n //inlineEditClass = \"ovl-row-inlineedit\"\r\n selectedClass = \"ovl-row-selected\"\r\n }\r\n }\r\n\r\n if (selected) {\r\n if (selected.selected) {\r\n selectedClass = \"ovl-row-selected\"\r\n }\r\n }\r\n let rowClass = \"\"\r\n let rowTooltipMsg\r\n let draggable\r\n let fn = this.actions.app.features[def.feature]\r\n let fnName = HookViewRowClass\r\n // also display offline save errors in rowstatus\r\n if (data.offline && data.offline.errors[key]) {\r\n let msgSet = data.offline.errors[key]\r\n if (!rowTooltipMsg) {\r\n rowTooltipMsg = \"\"\r\n }\r\n rowClass = \"ovl-row-offline--error\"\r\n msgSet.forEach((m) => {\r\n rowTooltipMsg += \" \" + m\r\n })\r\n } else {\r\n if (fn?.hooks?.[fnName]) {\r\n let status: ViewRowClassType = await fn.hooks[fnName](<\r\n HookViewRowClass_Type\r\n >{\r\n rowKey: key,\r\n tableDef: this.row.tableDef,\r\n tableData: data,\r\n row: data.data[key],\r\n })\r\n if (status) {\r\n rowClass = status.className\r\n rowTooltipMsg = status.tooltip\r\n if (!rowTooltipMsg) {\r\n rowTooltipMsg = undefined\r\n }\r\n draggable = status.draggable === true ? true : undefined\r\n }\r\n }\r\n }\r\n\r\n let lastRow =\r\n key === def.uiState.lastRowKey\r\n ? `__lastRow ${def.uiState.tableFilterClass}`\r\n : \"\"\r\n\r\n this.classToSet = `fd-table__body ovl-tableview-row ${selectedClass} ${rowClass} ${lastRow}`\r\n let validationSummary\r\n if (editSelected && editSelected.selected) {\r\n if (def.options.edit.editType === \"inline\") {\r\n let editRowSC = html`\r\n {\r\n return {\r\n tableDef: def,\r\n row: row,\r\n data: data,\r\n key: key,\r\n }\r\n }}\r\n >\r\n \r\n `\r\n let formState: SYSFormState =\r\n this.state.ovl.forms[def.uiState.formType][\r\n `${def.id}_${this.row.key}`\r\n ]\r\n if (formState) {\r\n if (FormHasVisibleSummaryErrors(formState)) {\r\n validationSummary = html` {\r\n return {\r\n formState,\r\n columnsCount:\r\n def.uiState.columnsRenderingState.visibleInTable.length,\r\n }\r\n }}\r\n >`\r\n } else if (def.options.edit.reserveSpaceForInlineValidationSummary) {\r\n validationSummary = html`\r\n \r\n `\r\n }\r\n }\r\n\r\n return Promise.resolve(html`\r\n {\r\n return {\r\n tableDef: def,\r\n data: data,\r\n row: row,\r\n key: key,\r\n mode: editSelected.mode,\r\n }\r\n }}\r\n >\r\n \r\n ${validationSummary} ${editRowSC}\r\n `)\r\n }\r\n }\r\n\r\n let tableGroupHeaders\r\n let tableGroupFooters\r\n\r\n if (!def.uiState.rebuild.needsRefresh && !def.uiState.currentlyAddingKey) {\r\n let groupHeaderBreak = this.row.tableGroupHeaderBreak\r\n let groupFooterBreak = this.row.tableGroupFooterBreak\r\n let index = this.row.index\r\n let isHeader =\r\n groupHeaderBreak?.isBreak && fn?.hooks?.[HookTableGroupHeaders]\r\n let isFooter =\r\n groupFooterBreak?.isBreak && fn?.hooks?.[HookTableGroupFooters]\r\n let dataFilteredAndSorted = def.uiState.dataFilteredAndSorted\r\n if (isHeader || isFooter) {\r\n _HookTableGroupDefId = def.id\r\n let rowKey = this.row.key\r\n let currentRow = data.data[this.row.key]\r\n let nextRowKey\r\n let previousRowKey\r\n if (index + 1 < dataFilteredAndSorted.length) {\r\n nextRowKey = dataFilteredAndSorted[index + 1]\r\n }\r\n if (index - 1 > -1) {\r\n previousRowKey = dataFilteredAndSorted[index - 1]\r\n }\r\n\r\n if (isHeader) {\r\n let tableGroupHeadersFootersParams = <\r\n HookTableGroupHeadersFooters_Type\r\n >{\r\n def,\r\n data,\r\n\r\n grouping: {\r\n groups: groupHeaderBreak.groups,\r\n fullGroupAccessStrings: groupHeaderBreak.groupAccessStrings,\r\n visibleColumns: def.uiState.columnsRenderingState.visibleInTable,\r\n },\r\n allGrouping: def.uiState.tableGroupHeaderBreaks,\r\n row: currentRow,\r\n previousRowKey,\r\n nextRowKey,\r\n rowKey: this.row.key,\r\n isFirstRow: groupHeaderBreak.isFirstRow,\r\n isLastRow: groupHeaderBreak.isLastRow,\r\n results: [],\r\n getTemplate: (type: GroupHeaderFooterBreaksValueType) =>\r\n this.getTemplate(\r\n type,\r\n JSON.parse(\r\n JSON.stringify(def.uiState.groupHeaderFooterResultToSet)\r\n )\r\n ),\r\n }\r\n\r\n fn.hooks[HookTableGroupHeaders](tableGroupHeadersFootersParams)\r\n tableGroupHeaders = this.getHeaderFooterTemplate(\r\n def,\r\n tableGroupHeadersFootersParams.results,\r\n \"Header\"\r\n )\r\n }\r\n\r\n if (isFooter) {\r\n // // create a corretly ordered groupValues Array which could be used for totals functionality inside hook\r\n // let groupValues = def.options.tableGroupAggregates.groups.map((g) => {\r\n // return groups[g.groupCode].groupValue\r\n // })\r\n let tableGroupHeadersFootersParams = <\r\n HookTableGroupHeadersFooters_Type\r\n >{\r\n def,\r\n data,\r\n grouping: {\r\n groups: groupFooterBreak.groups,\r\n fullGroupAccessStrings: groupFooterBreak.groupAccessStrings,\r\n visibleColumns: def.uiState.columnsRenderingState.visibleInTable,\r\n },\r\n allGrouping: def.uiState.tableGroupHeaderBreaks,\r\n row: currentRow,\r\n previousRowKey,\r\n nextRowKey,\r\n rowKey,\r\n isFirstRow: groupFooterBreak.isFirstRow,\r\n isLastRow: groupFooterBreak.isLastRow,\r\n results: [],\r\n getTemplate: (type: GroupHeaderFooterBreaksValueType) =>\r\n this.getTemplate(\r\n type,\r\n JSON.parse(\r\n JSON.stringify(def.uiState.groupHeaderFooterResultToSet)\r\n )\r\n ),\r\n }\r\n fn.hooks[HookTableGroupFooters](tableGroupHeadersFootersParams)\r\n tableGroupFooters = this.getHeaderFooterTemplate(\r\n def,\r\n tableGroupHeadersFootersParams.results,\r\n \"Footer\"\r\n )\r\n }\r\n }\r\n }\r\n return html`\r\n ${tableGroupHeaders}\r\n {\r\n return {\r\n row: row,\r\n key: key,\r\n tableDef: def,\r\n thHeaderEnd: this.row.thHeaderEnd,\r\n intersectionObserver: this.row.intersectionObserver,\r\n processesToTrackForRowFnHintDisplay:\r\n this.row.processesToTrackForRowFnHintDisplay,\r\n }\r\n }}\r\n >\r\n \r\n ${nav} ${tableGroupFooters}\r\n `\r\n }\r\n async afterRender() {\r\n if (this.classToSet) {\r\n this.className = this.classToSet\r\n }\r\n }\r\n\r\n // function which gets the resulToSet info rom TableGroupHeaderFooter Hooks and returns an array of Header or Footers (TemplateResult)\r\n getHeaderFooterTemplate(\r\n def: SYSTableDef,\r\n results: any[],\r\n typ: \"Header\" | \"Footer\"\r\n ): TemplateResult[] {\r\n if (!results) {\r\n return undefined\r\n }\r\n let res: TemplateResult[] = []\r\n let colCount = 0\r\n results.forEach((result) => {\r\n // for now only cover columns Type\r\n if (result._type !== \"columns\") {\r\n throw new Error(\r\n \"SYS TableGroupHeaderFooter: Only columns Type supported so far...@Todo\"\r\n )\r\n }\r\n let cols = Object.keys(result.valueToSet).filter(\r\n (f) => result.valueToSet[f].value !== undefined\r\n )\r\n colCount = cols.length\r\n let classList: string[] = []\r\n classList.push(\"ovltg\")\r\n classList.push(`__${typ}`)\r\n classList.push(`__${result._type}`)\r\n classList.push(result.cssClassToSet)\r\n let row\r\n switch (result._type) {\r\n case \"columns\":\r\n let tds: TemplateResult[] = []\r\n let i = 0\r\n while (i < def.uiState.columnsRenderingState.visibleInTable.length) {\r\n let v = def.uiState.columnsRenderingState.visibleInTable[i]\r\n let cssForTd = result.valueToSet[v].cssClass\r\n if (!cssForTd) {\r\n cssForTd = \"\"\r\n }\r\n let colSpan = result.valueToSet[v].colSpan\r\n if (\r\n i === 0 &&\r\n colCount === 1 &&\r\n colSpan === undefined &&\r\n result.valueToSet[v].value !== undefined\r\n ) {\r\n colSpan =\r\n def.uiState.columnsRenderingState.visibleInTable.length - i\r\n //def.uiState.columnsRenderingState.visibleInTable.indexOf(v)\r\n }\r\n if (colSpan === undefined) {\r\n colSpan = 1\r\n }\r\n i = i + colSpan\r\n tds.push(html`\r\n ${result.valueToSet[v].value}\r\n `)\r\n }\r\n\r\n row = html`\r\n ${tds}\r\n `\r\n res.push(row)\r\n break\r\n }\r\n })\r\n\r\n // // display the refresh button as well here (aggregates, groups are invalid after any changes)\r\n\r\n // if (\r\n // res.length > 0 &&\r\n // def.uiState.needsRefresh &&\r\n // def.features.showRefreshButton === \"TableNavAndGroupHeadersGroupFooters\"\r\n // ) {\r\n // const handleRefreshClick = (e: Event) => {\r\n // e.stopPropagation()\r\n // e.preventDefault()\r\n // TableRebuild(def.id, { showProcess: true })\r\n // }\r\n\r\n // let td = html`\r\n // handleRefreshClick(e)}\r\n // class=\"fd-button\"\r\n // title=\"Ansicht aktualisieren\"\r\n // >\r\n // \r\n // \r\n // `\r\n // let row = html`\r\n // ${td}\r\n // `\r\n // if (typ === \"Header\") {\r\n // res.push(row)\r\n // } else {\r\n // res.unshift(row)\r\n // }\r\n // }\r\n\r\n return res\r\n }\r\n}\r\n","import { ovl, SYSTableDefIds } from \"../../../..\"\r\nimport { postRequest } from \"../../../../effects\"\r\nimport { FeatureInfo } from \"../../../../global/globalapi\"\r\nimport { isMobile } from \"../../../../global/globals\"\r\nimport { _ResetFilters, _ResetSort } from \"../../helpers\"\r\nimport {\r\n SYSTableDef,\r\n TableAttributeFilter,\r\n TableColumnFilter,\r\n TableCustomFilter,\r\n TableGet,\r\n} from \"../../tableapi\"\r\n\r\nexport const _GetFilterSettingsCardCodes = async () => {\r\n let state = ovl.getState()\r\n let defId = state.ovl.libState.tableSettings.filterSort.currentTableDefId\r\n let res = await postRequest(\r\n `${state.ovl.apiUrl}tablesettings/lookups/cardcode`,\r\n defId\r\n )\r\n state.ovl.libState.tableSettings.filterSort.lookups.CardCode = res.data.data\r\n}\r\n\r\nexport const _GetFilterSettingsCntctCodes = async () => {\r\n let state = ovl.getState()\r\n let defId = state.ovl.libState.tableSettings.filterSort.currentTableDefId\r\n let res = await postRequest(\r\n `${state.ovl.apiUrl}tablesettings/lookups/u_cntctcode`,\r\n defId\r\n )\r\n state.ovl.libState.tableSettings.filterSort.lookups.U_CntctCode =\r\n res.data.data\r\n}\r\n\r\nexport const _FilterChangedComparedToDefault = (def: SYSTableDef) => {\r\n let current = JSON.stringify(_GetCurrentFilters(def))\r\n let _default = JSON.stringify(_GetDefaultFilters(def))\r\n return current !== _default\r\n}\r\n\r\nexport const _SortChangedComparedToDefault = (def: SYSTableDef) => {\r\n return (\r\n JSON.stringify(_GetCurrentSorts(def)) !==\r\n JSON.stringify(_GetDefaultSorts(def))\r\n )\r\n}\r\n\r\nexport const _SetCurrentActiveTableSettingsFilter = async (\r\n key: string,\r\n tableDefId: SYSTableDefIds\r\n) => {\r\n try {\r\n let tableDef = TableGet(tableDefId)\r\n let val\r\n let desc\r\n let def = tableDef.def\r\n await _ResetFilters(def)\r\n _ResetSort(def)\r\n let uiState = def.uiState\r\n if (key) {\r\n let settingsTable = TableGet(\"SYSTableSettings_FilterSort\", {\r\n byIdValue: key,\r\n })\r\n let sTable = settingsTable.rows[settingsTable.getKeys()[0]]\r\n val = sTable[\"U_FilterSortSettings\"]\r\n desc = sTable[\"U_Desc\"]\r\n }\r\n\r\n if (val) {\r\n let persistableFilterSortSettings = JSON.parse(val)\r\n if (persistableFilterSortSettings.columnFilters) {\r\n Object.keys(persistableFilterSortSettings.columnFilters).forEach(\r\n async (k) => {\r\n if (\r\n !(await TableColumnFilter(\r\n def.id,\r\n k,\r\n persistableFilterSortSettings.columnFilters[k].list,\r\n {\r\n exclusive:\r\n persistableFilterSortSettings.columnFilters[k].exclusive,\r\n _innerEvent: true,\r\n }\r\n ))\r\n ) {\r\n return\r\n }\r\n }\r\n )\r\n }\r\n if (persistableFilterSortSettings.rangeFilters) {\r\n Object.keys(persistableFilterSortSettings.rangeFilters).forEach((k) => {\r\n if (uiState.filter.columns[k]) {\r\n uiState.filter.columns[k].rangeFilter =\r\n persistableFilterSortSettings.rangeFilters[k]\r\n }\r\n })\r\n }\r\n\r\n if (persistableFilterSortSettings.customFilters) {\r\n Object.keys(persistableFilterSortSettings.customFilters).forEach(\r\n async (k) => {\r\n if (\r\n !(await TableCustomFilter(\r\n def.id,\r\n k,\r\n persistableFilterSortSettings.customFilters[k],\r\n { _innerEvent: true }\r\n ))\r\n ) {\r\n return\r\n }\r\n }\r\n )\r\n }\r\n\r\n if (persistableFilterSortSettings.attributeFilters) {\r\n let filterAttributes = persistableFilterSortSettings.attributeFilters\r\n let filterAttributesInitial = def.options.initial_rowAttributes\r\n await Promise.all(\r\n Object.keys(filterAttributesInitial).map(async (defKey) =>\r\n Object.keys(filterAttributesInitial[defKey].attributes)\r\n .concat(\r\n Object.keys(\r\n filterAttributes[defKey]?.attributes\r\n ? filterAttributes[defKey].attributes\r\n : {}\r\n )\r\n )\r\n .map(async (attributeKey) => {\r\n let val = !!filterAttributes[defKey].attributes?.[attributeKey]\r\n if (\r\n !(await TableAttributeFilter(\r\n def.id,\r\n defKey,\r\n attributeKey,\r\n val,\r\n {\r\n _innerEvent: true,\r\n }\r\n ))\r\n ) {\r\n return\r\n }\r\n })\r\n )\r\n )\r\n }\r\n\r\n if (persistableFilterSortSettings.tableFilter) {\r\n if (persistableFilterSortSettings.tableFilter.value) {\r\n uiState.filter.filter.value =\r\n persistableFilterSortSettings.tableFilter.value\r\n }\r\n // ignore showSelected for now. Its not that easy. We need to save the ids of all selected and then transform them back to selected as needed\r\n if (\r\n persistableFilterSortSettings.tableFilter.showSelected !== undefined\r\n ) {\r\n uiState.filter.filter.showSelected =\r\n persistableFilterSortSettings.tableFilter.showSelected\r\n }\r\n }\r\n\r\n if (persistableFilterSortSettings.tableSort) {\r\n if (def.columns[persistableFilterSortSettings.tableSort[0].field]) {\r\n uiState.sort.sort = persistableFilterSortSettings.tableSort[0]\r\n }\r\n }\r\n\r\n if (persistableFilterSortSettings.customSort === undefined) {\r\n persistableFilterSortSettings.customSort = \"\"\r\n }\r\n if (\r\n !persistableFilterSortSettings.customSort ||\r\n def.options.initial_sortCustom.sorts[\r\n persistableFilterSortSettings.customSort\r\n ]\r\n ) {\r\n uiState.sort.sortCustom.selected =\r\n persistableFilterSortSettings.customSort\r\n }\r\n }\r\n uiState.currentSelectedFilterSortDesc = desc\r\n uiState.currentSelectedFilterSortValue = val\r\n uiState.currentSelectedFilterSort = key\r\n } catch (e) {\r\n console.error(e)\r\n }\r\n}\r\n\r\nexport const _GetCurrentActiveTableSettingsFilterSortJsonString = (\r\n tableDefId: SYSTableDefIds,\r\n ignoreSort: boolean = false\r\n) => {\r\n let persistableFilterSortSettings = _GetCurrentActiveTableSettingsFilterSort(\r\n tableDefId,\r\n ignoreSort\r\n )\r\n return JSON.stringify(persistableFilterSortSettings)\r\n}\r\n\r\nexport const _GetCurrentActiveTableSettingsFilterSort = (\r\n tableDefId: SYSTableDefIds,\r\n ignoreSort: boolean = false\r\n) => {\r\n let def = TableGet(tableDefId).def\r\n let {\r\n columnFilters,\r\n rangeFilters,\r\n customFilters,\r\n attributeFilters,\r\n tableFilter,\r\n } = _GetCurrentFilters(def)\r\n\r\n // optimize save format\r\n if (Object.keys(customFilters).length === 0) {\r\n customFilters = undefined\r\n }\r\n if (Object.keys(attributeFilters).length === 0) {\r\n attributeFilters = undefined\r\n }\r\n\r\n if (Object.keys(columnFilters).length === 0) {\r\n columnFilters = undefined\r\n }\r\n if (Object.keys(rangeFilters).length === 0) {\r\n rangeFilters = undefined\r\n }\r\n\r\n let { customSort, tableSort } = _GetCurrentSorts(def)\r\n if (ignoreSort) {\r\n customSort = undefined\r\n tableSort = undefined\r\n }\r\n let persistableFilterSortSettings = {\r\n version: 1,\r\n ts: new Date().toISOString(),\r\n columnFilters,\r\n rangeFilters,\r\n customFilters,\r\n attributeFilters,\r\n tableFilter,\r\n customSort,\r\n tableSort,\r\n }\r\n return persistableFilterSortSettings\r\n}\r\n\r\nconst _GetCurrentSorts = (def: SYSTableDef) => {\r\n let uiState = def.uiState\r\n let customSort = uiState.sort.sortCustom.selected\r\n if (customSort === \"\") {\r\n customSort = undefined\r\n }\r\n let tableSort = undefined\r\n if (!customSort) {\r\n tableSort = [uiState.sort.sort]\r\n }\r\n return { customSort, tableSort }\r\n}\r\n\r\nconst _GetDefaultSorts = (def: SYSTableDef) => {\r\n let options = def.options\r\n let customSort = options.initial_sortCustom.selected\r\n if (customSort === \"\") {\r\n customSort = undefined\r\n }\r\n let tableSort = undefined\r\n if (!customSort) {\r\n tableSort = [\r\n {\r\n direction: options.initial_sort.direction,\r\n field: options.initial_sort.field,\r\n useValue: options.initial_sort.useValue,\r\n },\r\n ]\r\n }\r\n return { customSort, tableSort }\r\n}\r\n\r\nconst _GetCurrentFilters = (def: SYSTableDef) => {\r\n let uiState = def.uiState\r\n let columns = uiState.filter.columns\r\n let allCustomFilters = uiState.filter.filterCustom\r\n let columnFilters = Object.keys(columns)\r\n .filter(\r\n (f) => columns[f].columnFilter && columns[f].columnFilter.type !== \"none\"\r\n )\r\n .reduce((val, m) => {\r\n val[m] = {\r\n type: columns[m].columnFilter.type,\r\n list: columns[m].columnFilter.list,\r\n exclusive: columns[m].columnFilter.exclusive,\r\n }\r\n return val\r\n }, {})\r\n\r\n let rangeFilters = Object.keys(columns)\r\n .filter(\r\n (f) =>\r\n columns[f].rangeFilter?.selected !== undefined &&\r\n columns[f].rangeFilter?.selected !== \"none\"\r\n )\r\n .reduce((val, m) => {\r\n val[m] = columns[m].rangeFilter\r\n return val\r\n }, {})\r\n\r\n let customFilters = Object.keys(allCustomFilters).reduce((val, m) => {\r\n val[m] = allCustomFilters[m].active\r\n return val\r\n }, {})\r\n\r\n let tableFilter = {}\r\n if (uiState.filter.filter.value) {\r\n tableFilter[\"value\"] = uiState.filter.filter.value\r\n //tableFilter[\"showSelected\"] = uiState.filter.filter.showSelected\r\n }\r\n // ignore for now see explanation in _Set...\r\n if (uiState.filter.filter.showSelected) {\r\n tableFilter[\"showSelected\"] = uiState.filter.filter.showSelected\r\n }\r\n let filterAttributes = uiState.filter.filterAttributes\r\n let attributeFilters = Object.keys(filterAttributes)\r\n .filter(\r\n (defKey) => Object.keys(filterAttributes[defKey].attributes).length > 0\r\n )\r\n .reduce((val, defKey) => {\r\n val[defKey] = { attributes: filterAttributes[defKey].attributes }\r\n return val\r\n }, {})\r\n return {\r\n columnFilters,\r\n rangeFilters,\r\n customFilters,\r\n attributeFilters,\r\n tableFilter,\r\n }\r\n}\r\n\r\nconst _GetDefaultFilters = (def: SYSTableDef) => {\r\n let columns = def.columns\r\n let allCustomFilters = def.options.initial_filterCustom\r\n let columnFilters = Object.keys(columns)\r\n .filter(\r\n (f) =>\r\n columns[f].filter.columnFilter &&\r\n columns[f].filter.columnFilter.type !== \"none\"\r\n )\r\n .reduce((val, m) => {\r\n val[m] = {\r\n type: columns[m].filter.columnFilter.type,\r\n list: columns[m].filter.columnFilter.list,\r\n exclusive: columns[m].filter.columnFilter.exclusive,\r\n }\r\n return val\r\n }, {})\r\n\r\n let rangeFilters = Object.keys(columns)\r\n .filter(\r\n (f) =>\r\n columns[f].filter.rangeFilter?.selected !== undefined &&\r\n columns[f].filter.rangeFilter?.selected !== \"none\"\r\n )\r\n .reduce((val, m) => {\r\n val[m] = columns[m].filter.rangeFilter\r\n return val\r\n }, {})\r\n\r\n let customFilters = Object.keys(allCustomFilters).reduce((val, m) => {\r\n val[m] = allCustomFilters[m].active\r\n return val\r\n }, {})\r\n\r\n let filterAttributes = def.options.initial_rowAttributes\r\n let attributeFilters = Object.keys(filterAttributes)\r\n .filter(\r\n (defKey) => Object.keys(filterAttributes[defKey].attributes).length > 0\r\n )\r\n .reduce((val, defKey) => {\r\n val[defKey] = { attributes: filterAttributes[defKey].attributes }\r\n return val\r\n }, {})\r\n\r\n let tableFilter = {}\r\n if (def.options.initial_filter.value) {\r\n tableFilter[\"value\"] = def.options.initial_filter.value\r\n }\r\n if (def.options.initial_filter.showSelected) {\r\n tableFilter[\"showSelected\"] = def.options.initial_filter.showSelected\r\n }\r\n\r\n return {\r\n columnFilters,\r\n rangeFilters,\r\n customFilters,\r\n attributeFilters,\r\n tableFilter,\r\n }\r\n}\r\n\r\nexport const _FilterSortChanged = (\r\n tableDefId: SYSTableDefIds,\r\n ignoreSort: boolean = false\r\n) => {\r\n let tableDef = TableGet(tableDefId)\r\n let val\r\n if (tableDef.def.uiState.currentSelectedFilterSort) {\r\n val = tableDef.def.uiState.currentSelectedFilterSortValue\r\n } else {\r\n return false\r\n }\r\n let selected\r\n if (val) {\r\n let valParsed = JSON.parse(val)\r\n // make sure to delete timestamp...\r\n delete valParsed.ts\r\n if (ignoreSort) {\r\n valParsed.customSort = undefined\r\n valParsed.tableSort = undefined\r\n }\r\n selected = JSON.stringify(valParsed)\r\n }\r\n let currentParsed = _GetCurrentActiveTableSettingsFilterSort(\r\n tableDefId,\r\n ignoreSort\r\n )\r\n\r\n // as well delete timestamp here\r\n delete currentParsed.ts\r\n let current = JSON.stringify(currentParsed)\r\n //console.log(current !== selected, current, selected)\r\n\r\n return current !== selected\r\n}\r\nexport type _FilterSortPermission = {\r\n read: boolean\r\n own: boolean\r\n company: boolean\r\n\r\n all: boolean\r\n\r\n write: boolean\r\n extended: boolean\r\n}\r\n\r\nexport const _GetFilterSortPermission = (\r\n tableDefId: string\r\n): _FilterSortPermission => {\r\n let featureRead = FeatureInfo(\"SYSTableSettingsReadOnlyFilterSort\")\r\n let featureOwn = FeatureInfo(\"SYSTableSettingsSaveFilterSortOwn\")\r\n let featureCompany = FeatureInfo(\"SYSTableSettingsSaveFilterSortCompany\")\r\n let featureAll = FeatureInfo(\"SYSTableSettingsSaveFilterSortAll\")\r\n\r\n let read = `${featureRead?.Text1},`.indexOf(`${tableDefId},`) > -1\r\n let own = `${featureOwn?.Text1},`.indexOf(`${tableDefId},`) > -1\r\n let company = `${featureCompany?.Text1},`.indexOf(`${tableDefId},`) > -1\r\n let all = `${featureAll?.Text1},`.indexOf(`${tableDefId},`) > -1\r\n let extended =\r\n (company && featureCompany?.Text2 === \"Y\") ||\r\n (all && featureAll?.Text2 === \"Y\")\r\n\r\n return {\r\n all,\r\n company,\r\n own,\r\n read,\r\n write: all || company || own,\r\n extended,\r\n }\r\n}\r\n","import { html, SYSAction, SYSState, SYSTableDefIds } from \"../../../../../src\"\r\nimport { SortGet } from \"../../../../../src/global/globalapi\"\r\nimport {\r\n HookFieldGetList_ReturnType,\r\n HookFieldGetList_Type,\r\n HookFieldGetValueRender_ReturnType,\r\n HookFieldGetValueRender_Type,\r\n HookFormAdd_Type,\r\n HookFormChanged_Type,\r\n HookFormInit_ReturnType,\r\n HookFormInit_Type,\r\n HookFormValidate_Type,\r\n HookTableAfterDelete_Type,\r\n HookTableAfterSave_Type,\r\n HookTableBeforeSave_ReturnType,\r\n HookTableBeforeSave_Type,\r\n HookTableClicked_Type,\r\n HookTableCustomSort_ReturnType,\r\n HookTableCustomSort_Type,\r\n HookTableFn,\r\n HookTableFn_Type,\r\n HookTableRowFnCan_Type,\r\n HookTableSetColumnVisibility_Type,\r\n} from \"../../../../../src/global/hooks\"\r\nimport {\r\n FieldList,\r\n FieldSetFocus,\r\n FieldSetState,\r\n FieldSetVal,\r\n FieldVal,\r\n SYSField,\r\n} from \"../../../../../src/library/forms/fieldapi\"\r\nimport { FormGet, SYSFormState } from \"../../../../../src/library/forms/formapi\"\r\nimport {\r\n _GetFilterSortDifferentiator,\r\n GetRowDisplayValue,\r\n} from \"../../../../../src/library/table/helpers\"\r\nimport {\r\n TableCellVal,\r\n TableGet,\r\n TableRebuild,\r\n} from \"../../../../../src/library/table/tableapi\"\r\nimport { filterSortStore } from \"../../../../offlinestorage\"\r\nimport { T } from \"../../../../textapi\"\r\n\r\nimport {\r\n _BaseTableContextForColumnFilter,\r\n _SetFilter,\r\n} from \"./columnfilter/helpers\"\r\nimport { SYSTableSettings_ColumnFilter } from \"./columnfilter/tabledef\"\r\nimport {\r\n SYSTableSettings_FilterSort,\r\n SYSTableSettings_FilterSortSelect,\r\n} from \"./filtersort/tabledef\"\r\nimport { _HeaderMenuFilter_Type } from \"./formdef\"\r\nimport {\r\n _GetFilterSettingsCardCodes,\r\n _GetFilterSettingsCntctCodes,\r\n _GetFilterSortPermission,\r\n} from \"./helpers\"\r\n\r\nconst HookTableBeforeSave: SYSAction<\r\n HookTableBeforeSave_Type,\r\n HookTableBeforeSave_ReturnType\r\n> = (value, { global }) => {\r\n let state = global.getState()\r\n if (value.formState.tableDefId.startsWith(\"SYSTableSettings_FilterSort\")) {\r\n let settingsToSave =\r\n state.ovl.libState.tableSettings.filterSort.currentFilterSortSettings\r\n if (settingsToSave) {\r\n value.changedFields[\"U_FilterSortSettings\"] = settingsToSave\r\n }\r\n let differentiator = _GetFilterSortDifferentiator(\r\n (\r\n state.ovl.libState.tableSettings.filterSort.currentTableDefId\r\n )\r\n )\r\n value.changedFields[\"U_Differentiator\"] = differentiator\r\n }\r\n return { resolve: \"ForceSaveAndContinue\" }\r\n}\r\n\r\nconst HookTableAfterDelete: SYSAction<\r\n HookTableAfterDelete_Type\r\n> = async (value, { global }) => {\r\n let state = global.getState()\r\n let filterSort = state.ovl.libState.tableSettings.filterSort\r\n let table = TableGet(filterSort.currentTableDefId)\r\n if (value.deletedRow.Code === table.def.uiState.currentSelectedFilterSort) {\r\n let formState = FormGet(\"SYSHeaderMenuFilter\", {\r\n instance: filterSort.fieldToUpdate.formId,\r\n })\r\n FieldSetVal(formState.fields[\"HeaderMenuSelectPersistedFilterSort\"], \"\")\r\n }\r\n}\r\n\r\nconst HookTableAfterSave: SYSAction = async (\r\n value,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n if (value.formState.tableDefId === \"SYSTableSettings_FilterSort\") {\r\n let filterSort = state.ovl.libState.tableSettings.filterSort\r\n\r\n // we also need to update the selected filtersettings value as persisted in indexed db\r\n let table = TableGet(filterSort.currentTableDefId)\r\n table.def.uiState.currentSelectedFilterSortValue =\r\n filterSort.currentFilterSortSettings\r\n let differentiator = _GetFilterSortDifferentiator(table.def.id)\r\n\r\n table.def.uiState.currentSelectedFilterSortDesc =\r\n value.res.data[0][\"U_Desc\"]\r\n let valToUpdate = await filterSortStore.get(\r\n `${state.ovl.user.userCode.toString()}_${table.def.id}_${differentiator}`\r\n )\r\n if (valToUpdate) {\r\n valToUpdate.selectedValue = filterSort.currentFilterSortSettings\r\n valToUpdate.selectedDesc = table.def.uiState.currentSelectedFilterSortDesc\r\n await filterSortStore.set(\r\n `${state.ovl.user.userCode.toString()}_${\r\n table.def.id\r\n }_${differentiator}`,\r\n valToUpdate\r\n )\r\n }\r\n let formState = FormGet(\"SYSHeaderMenuFilter\", {\r\n instance: filterSort.fieldToUpdate.formId,\r\n })\r\n await FieldSetVal(\r\n formState.fields[\"HeaderMenuSelectPersistedFilterSort\"],\r\n value.res.data[0][\"Code\"] /*, {debounce:100}*/\r\n )\r\n }\r\n}\r\n\r\nconst HookField_Code_GetValueRender: SYSAction<\r\n HookFieldGetValueRender_Type,\r\n HookFieldGetValueRender_ReturnType\r\n> = (value, { global }) => {\r\n let state = global.getState()\r\n InitBaseTable(state)\r\n let val\r\n // if (_BaseTableContextForColumnFilter.isCalculated) {\r\n // val = value.row[\"Code\"]\r\n // if (val === undefined) {\r\n // val = null\r\n // }\r\n // } else {\r\n val = GetRowDisplayValue(\r\n _BaseTableContextForColumnFilter.tableDef,\r\n _BaseTableContextForColumnFilter.columnKey,\r\n _BaseTableContextForColumnFilter.rows[value.row.Key],\r\n value.row.Key,\r\n \"ColumnFilter\",\r\n true\r\n )\r\n //}\r\n let resHtml\r\n if (typeof val === \"string\" || val === null) {\r\n resHtml = html`\r\n \r\n ${val === \"\"\r\n ? T(\"SYSFilterEmpty\")\r\n : val === null\r\n ? T(\"SYSFilterNull\")\r\n : val}\r\n \r\n `\r\n } else {\r\n resHtml = html`\r\n ${val}\r\n `\r\n }\r\n\r\n return {\r\n res: resHtml,\r\n valueRaw: _BaseTableContextForColumnFilter.isList ? val : value.row.Code,\r\n }\r\n}\r\n\r\nconst HookField_Free1_GetValueRender: SYSAction<\r\n HookFieldGetValueRender_Type,\r\n HookFieldGetValueRender_ReturnType\r\n> = (value, { global }) => {\r\n let state = global.getState()\r\n InitBaseTable(state)\r\n let val = GetRowDisplayValue(\r\n _BaseTableContextForColumnFilter.tableDef,\r\n _BaseTableContextForColumnFilter.additionalColumnKey,\r\n _BaseTableContextForColumnFilter.rows[value.row.Key],\r\n value.row.Key,\r\n \"ColumnFilter\",\r\n true\r\n )\r\n\r\n return {\r\n res: val,\r\n valueRaw: value.row.Free1,\r\n }\r\n}\r\n\r\nconst InitBaseTable = (state: SYSState) => {\r\n if (!_BaseTableContextForColumnFilter.tableDef) {\r\n let baseTable = TableGet(\r\n state.ovl.libState.tableSettings.columnFilter.defId\r\n )\r\n _BaseTableContextForColumnFilter.tableDef = baseTable.def\r\n _BaseTableContextForColumnFilter.rows = baseTable.rows\r\n _BaseTableContextForColumnFilter.columnKey =\r\n state.ovl.libState.tableSettings.columnFilter.columnKey\r\n _BaseTableContextForColumnFilter.additionalColumnKey =\r\n state.ovl.libState.tableSettings.columnFilter.additionalColumnKey\r\n\r\n _BaseTableContextForColumnFilter.isList =\r\n _BaseTableContextForColumnFilter.tableDef.columns[\r\n _BaseTableContextForColumnFilter.columnKey\r\n ].list !== undefined\r\n\r\n _BaseTableContextForColumnFilter.isCalculated =\r\n _BaseTableContextForColumnFilter.tableDef.columns[\r\n _BaseTableContextForColumnFilter.columnKey\r\n ].schema?.isCalculatedColumn === true\r\n }\r\n}\r\n\r\nconst HookTableClicked: SYSAction = async (value) => {\r\n if (\r\n value.rowKey &&\r\n value.columnKey === \"Code\" &&\r\n value.linkType === \"OvlHook\"\r\n ) {\r\n let row = TableGet(value.defId).rows[\r\n value.rowKey\r\n ]\r\n //Link was clicked\r\n await _SetFilter(false, row[\"Code\"])\r\n value.executionToSet.selectionLogic = \"Ignore\"\r\n }\r\n}\r\n\r\nconst HookTableCustom_OriginalSort_Sort: SYSAction<\r\n HookTableCustomSort_Type,\r\n HookTableCustomSort_ReturnType\r\n> = (value, { global }) => {\r\n let state = global.getState()\r\n return value.data[value.a].OriginalSort - value.data[value.b].OriginalSort\r\n}\r\n\r\nconst HookField_HeaderMenuRangeFilterType_GetList: SYSAction<\r\n HookFieldGetList_Type,\r\n HookFieldGetList_ReturnType\r\n> = (value, { global }) => {\r\n let state = global.getState()\r\n return {\r\n data: {\r\n none: {\r\n Val: \"none\",\r\n Desc: T(\"SYSFilterAll\"),\r\n },\r\n equal: { Val: \"equal\", Desc: \"=\" },\r\n greaterThanOrEqual: {\r\n Val: \"greaterThanOrEqual\",\r\n Desc: \">=\",\r\n },\r\n lessThanOrEqual: {\r\n Val: \"lessThanOrEqual\",\r\n Desc: \"<=\",\r\n },\r\n },\r\n lookupDef: {\r\n Val: { type: \"text\" },\r\n Desc: { type: \"text\" },\r\n },\r\n }\r\n}\r\n\r\nconst HookFormValidate: SYSAction = async (\r\n value,\r\n { global }\r\n) => {\r\n let actions = global.getActions()\r\n if (value.formState.formType === \"SYSHeaderMenuFilter\") {\r\n if (\r\n value.fieldKey === \"HeaderMenuRangeFilterValue\" ||\r\n value.fieldKey === \"HeaderMenuRangeFilterType\"\r\n ) {\r\n if (\r\n FieldVal(value.formState.fields[\"HeaderMenuRangeFilterType\"]) !== \"none\"\r\n ) {\r\n value.validatorUse(\"Mandatory\", {\r\n validation: { displayType: \"OnlyOutline\" },\r\n })\r\n }\r\n }\r\n\r\n if (\r\n FieldVal(value.formState.fields[\"HeaderMenuRangeFilterType\"]) ===\r\n \"greaterThanOrEqual\"\r\n ) {\r\n let val = FieldVal(value.formState.fields[\"HeaderMenuRangeFilterValue\"], {\r\n mode: \"Converted\",\r\n })\r\n let val2 = FieldVal(\r\n value.formState.fields[\"HeaderMenuRangeFilterValue2\"],\r\n {\r\n mode: \"Converted\",\r\n }\r\n )\r\n\r\n let cond = !val2 || val <= val2\r\n //console.log(val, val2, cond)\r\n if (!cond) {\r\n value.validationsAdd(\"SYSValidatorValue2SmallerThanValue1\", {\r\n fields: [\r\n value.formState.fields[\"HeaderMenuRangeFilterValue2\"],\r\n value.formState.fields[\"HeaderMenuRangeFilterValue\"],\r\n ],\r\n })\r\n }\r\n }\r\n } else if (\r\n value.formState.tableDefId.startsWith(\"SYSTableSettings_FilterSort\")\r\n ) {\r\n // if CanBeUsedBy === User then a user needs to be selected\r\n if (value.fieldKey === \"U_CntctCode\" || value.fieldKey === \"CanBeUsedBy\") {\r\n if (FieldVal(value.fields[\"CanBeUsedBy\"]) === \"@@SYSUser\") {\r\n value.validatorUse(\"Mandatory\", { field: value.fields[\"U_CntctCode\"] })\r\n }\r\n }\r\n }\r\n // call parents formValidate Hook\r\n // so user can make additional Validation for Range Filter Fields\r\n let tableDef = TableGet(value.formState.tableDefId)\r\n let feature = tableDef.def.feature\r\n if (feature !== value.formState.feature) {\r\n if (actions.app.features?.[feature]?.hooks?.[\"HookFormValidate\"]) {\r\n await actions.app.features[tableDef.def.feature].hooks[\r\n \"HookFormValidate\"\r\n ](value)\r\n }\r\n }\r\n}\r\n\r\nconst HookTableSetColumnVisibility: SYSAction<\r\n HookTableSetColumnVisibility_Type\r\n> = (value, { global }) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n if (value.def.id.startsWith(\"SYSTableSettings_FilterSort\")) {\r\n let p = _GetFilterSortPermission(\r\n state.ovl.libState.tableSettings.filterSort.currentTableDefId\r\n )\r\n if (!p.extended) {\r\n value.columnsVisibilityToSet.U_CntctCode = \"Edit\"\r\n }\r\n }\r\n}\r\n\r\nconst HookFormChanged: SYSAction = async (\r\n value,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n if (value.formState.formType === \"SYSHeaderMenuFilter\") {\r\n if (\r\n value.changedField.field.fieldKey === \"HeaderMenuRangeFilterType\" &&\r\n value.changedField.validValueChanged &&\r\n !value.changedField.fromInit\r\n ) {\r\n FieldSetFocus(value.fields[\"HeaderMenuRangeFilterValue\"])\r\n }\r\n HeaderMenuFilterFieldsSetState(value.formState)\r\n if (value.changedField && value.changedField.validValueChanged) {\r\n let tableDef\r\n if (value.formState.formId === \"1\") {\r\n tableDef = TableGet(state.ovl.libState.tableRowHeaderMenu.tableDefId1)\r\n } else {\r\n tableDef = TableGet(state.ovl.libState.tableRowHeaderMenu.tableDefId2)\r\n }\r\n\r\n if (\r\n value.changedField.field.fieldKey ===\r\n \"HeaderMenuSelectPersistedFilterSort\"\r\n ) {\r\n let def = tableDef.def\r\n let currentColumn = def.uiState.headerSelected\r\n let key =\r\n value.formState.fields[\"HeaderMenuSelectPersistedFilterSort\"]\r\n .convertedValue\r\n await actions.ovl.internal._TableSelectFilterSort({\r\n key,\r\n defId: def.id,\r\n instance: value.formState.formId,\r\n })\r\n let colDef = def.uiState.filter.columns[currentColumn]\r\n if (colDef.rangeFilter) {\r\n await FieldSetVal(\r\n value.formState.fields[\"HeaderMenuRangeFilterType\"],\r\n colDef.rangeFilter.selected,\r\n { ignoreValueChanged: true }\r\n )\r\n await FieldSetVal(\r\n value.formState.fields[\"HeaderMenuRangeFilterValue\"],\r\n colDef.rangeFilter.val,\r\n { ignoreValueChanged: true }\r\n )\r\n\r\n await FieldSetVal(\r\n value.formState.fields[\"HeaderMenuRangeFilterValue2\"],\r\n colDef.rangeFilter.val2,\r\n { ignoreValueChanged: true }\r\n )\r\n }\r\n HeaderMenuFilterFieldsSetState(value.formState)\r\n } else {\r\n let key =\r\n value.formState.fields[\"HeaderMenuRangeFilterType\"].convertedValue\r\n let val =\r\n value.formState.fields[\"HeaderMenuRangeFilterValue\"].convertedValue\r\n let val2\r\n if (key === \"greaterThanOrEqual\") {\r\n val2 =\r\n value.formState.fields[\"HeaderMenuRangeFilterValue2\"].convertedValue\r\n }\r\n let tableFn =\r\n actions.app.features[tableDef.def.feature]?.hooks?.[HookTableFn]\r\n if (tableFn) {\r\n if (\r\n await tableFn({\r\n FnType: \"ColumnRangeFilter\",\r\n before: true,\r\n id: tableDef.def.uiState.headerSelected,\r\n val1: key,\r\n val2: `${val},${val2 !== undefined ? val2 : \"\"}`,\r\n })\r\n ) {\r\n return false\r\n }\r\n }\r\n\r\n actions.ovl.internal._TableSelectColumnRangeFilter({\r\n key,\r\n value: val,\r\n value2: val2,\r\n def: tableDef.def,\r\n })\r\n\r\n await TableRebuild(tableDef.def.id, { showProcess: true })\r\n\r\n if (tableFn) {\r\n await tableFn({\r\n FnType: \"ColumnRangeFilter\",\r\n before: false,\r\n id: tableDef.def.uiState.headerSelected,\r\n val1: key,\r\n val2: `${val},${val2 !== undefined ? val2 : \"\"}`,\r\n })\r\n }\r\n }\r\n }\r\n } else if (\r\n value.formState.tableDefId.startsWith(\"SYSTableSettings_FilterSort\")\r\n ) {\r\n if (value.changedField.fieldKey === \"CanBeUsedBy\") {\r\n FieldSetState(\r\n value.fields[\"U_CntctCode\"],\r\n value.changedField.newValue === \"@@SYSUser\",\r\n { forceValueWhenInactive: null }\r\n )\r\n if (\r\n value.changedField.isValid &&\r\n value.changedField.newValue === \"@@SYSUser\" &&\r\n FieldVal(value.fields[\"U_CntctCode\"]) === null\r\n ) {\r\n await FieldSetVal(value.fields[\"U_CntctCode\"], state.ovl.user.userCode)\r\n }\r\n }\r\n }\r\n}\r\nexport const HeaderMenuFilterFieldsSetState = (formState: SYSFormState) => {\r\n if (formState === undefined) {\r\n return\r\n }\r\n let filterType = FieldVal(formState.fields[\"HeaderMenuRangeFilterType\"], {\r\n mode: \"Converted\",\r\n })\r\n let tableDef = TableGet(formState.tableDefId)\r\n let def = tableDef.def\r\n let selectedColumn = def.uiState.headerSelected\r\n if (!selectedColumn) {\r\n return\r\n }\r\n let advancedFilter = def.uiState.filter.columns[selectedColumn].columnFilter\r\n let isValidColumnFilterForRange = !(\r\n advancedFilter &&\r\n !advancedFilter.exclusive &&\r\n advancedFilter.list &&\r\n advancedFilter.list.length === 1\r\n )\r\n\r\n FieldSetState(\r\n formState.fields[\"HeaderMenuRangeFilterType\"],\r\n isValidColumnFilterForRange,\r\n {\r\n mode: \"visible/readonly\",\r\n }\r\n )\r\n\r\n FieldSetState(\r\n formState.fields[\"HeaderMenuRangeFilterValue\"],\r\n filterType !== \"none\" && isValidColumnFilterForRange,\r\n {\r\n mode: \"visible/readonly\",\r\n }\r\n )\r\n FieldSetState(\r\n formState.fields[\"HeaderMenuRangeFilterValue2\"],\r\n filterType === \"greaterThanOrEqual\" && isValidColumnFilterForRange,\r\n {\r\n mode: \"visible/readonly\",\r\n }\r\n )\r\n}\r\n\r\nconst HookFormAdd: SYSAction = (value, { global }) => {\r\n let state = global.getState()\r\n if (value.tableDef.id === \"SYSTableSettings_FilterSort\") {\r\n value.newRow[\"CanBeUsedBy\"] = \"@@SYSUser\"\r\n value.newRow[\"U_CntctCode\"] = state.ovl.user.userCode\r\n }\r\n}\r\n\r\nconst HookFormInit: SYSAction<\r\n HookFormInit_Type,\r\n Promise\r\n> = async (value, { global }) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n let toRemove: string[] = []\r\n if (value.formState.formType === \"SYSHeaderMenuFilter\") {\r\n let tableDef = TableGet(\r\n state.ovl.libState.tableRowHeaderMenu[\r\n `tableDefId${value.formState.formId}`\r\n ]\r\n )\r\n let def = tableDef.def\r\n\r\n let p = _GetFilterSortPermission(def.id)\r\n let selectedColumn = def.uiState.headerSelected\r\n let fields: { [key in keyof _HeaderMenuFilter_Type]: SYSField } =\r\n value.formState.fields\r\n\r\n if (!def.columns[selectedColumn].filter.rangeFilter) {\r\n toRemove.push(fields.HeaderMenuRangeFilterValue.fieldKey)\r\n toRemove.push(fields.HeaderMenuRangeFilterValue2.fieldKey)\r\n toRemove.push(fields.HeaderMenuRangeFilterType.fieldKey)\r\n }\r\n if (!p.read && !p.write) {\r\n //console.log(\"set headermenuselectfilter irrelevenat in init\")\r\n toRemove.push(fields.HeaderMenuSelectPersistedFilterSort.fieldKey)\r\n }\r\n } else if (\r\n value.formState.tableDefId.startsWith(\"SYSTableSettings_FilterSort\")\r\n ) {\r\n let p = _GetFilterSortPermission(value.formState.row[\"U_TableDefId\"])\r\n\r\n let fields: { [key in keyof SYSTableSettings_FilterSort]: SYSField } =\r\n value.formState.fields\r\n\r\n if (!p.company && !p.all) {\r\n toRemove.push(fields.CanBeUsedBy.fieldKey)\r\n } else {\r\n await _GetFilterSettingsCardCodes()\r\n }\r\n if (\r\n !p.extended //||\r\n // FieldVal(value.formState.fields[\"CanBeUsedBy\"]) !== \"@@SYSUser\"\r\n ) {\r\n toRemove.push(fields.U_CntctCode.fieldKey)\r\n } else {\r\n await _GetFilterSettingsCntctCodes()\r\n }\r\n // if (value.formState.tableDataMode === \"Add\") {\r\n // FieldSetVal(value.formState.fields[\"CanBeUsedBy\"], \"@@SYSUser\")\r\n // }\r\n }\r\n return { fieldsToRemove: toRemove }\r\n}\r\n\r\nconst HookField_HeaderMenuSelectPersistedFilterSort_GetList: SYSAction<\r\n HookFieldGetList_Type,\r\n HookFieldGetList_ReturnType\r\n> = (value, { global }) => {\r\n let state = global.getState()\r\n let baseTable = TableGet(\r\n (\r\n state.ovl.libState.tableSettings.filterSort.currentTableDefId\r\n )\r\n )\r\n let differentiator = baseTable.def.uiState._lastFilterSortDifferentiator\r\n let table = TableGet(\"SYSTableSettings_FilterSort\")\r\n\r\n let p = _GetFilterSortPermission(value.formState.tableDefId)\r\n let presetAll\r\n let presetCompany\r\n if (!(p.all || p.company)) {\r\n presetAll = T(\"SYSFilterSortPresetAll\")\r\n presetCompany = T(\"SYSFilterSortPresetCompany\")\r\n }\r\n let rows: {\r\n [key: string]: { [key in keyof SYSTableSettings_FilterSortSelect]: any }\r\n } = table.rows\r\n\r\n let keys\r\n // if (value.needsFullList) {\r\n keys = table.getKeys({ byKeys: \"StaticFiltered\" })\r\n // .filter(\r\n // (f) =>\r\n // differentiator === undefined ||\r\n // table.rows[f].U_Differentiator === differentiator\r\n // )\r\n\r\n // } else {\r\n // keys = table.getKeys({\r\n // byIdValue:\r\n // value.formState.fields[\"HeaderMenuSelectPersistedFilterSort\"]\r\n // .convertedValue,\r\n // })\r\n //}\r\n\r\n let userCode = state.ovl.user.userCode\r\n let userCompanyName = state.ovl.user.cardName\r\n keys = keys.sort((s1, s2) => {\r\n let a = table.rows[s1]\r\n let b = table.rows[s2]\r\n //1st all own\r\n let ownA = a.CanBeUsedBy === \"@@SYSUser\" && a.U_CntctCode === userCode\r\n let ownB = b.CanBeUsedBy === \"@@SYSUser\" && b.U_CntctCode === userCode\r\n let res = SortGet(ownB, ownA)\r\n if (res === 0) {\r\n res = SortGet(a.CanBeUsedBy === \"@@SYSAll\", b.CanBeUsedBy === \"@@SYSAll\")\r\n\r\n if (res === 0) {\r\n //then all from the same company\r\n ownA =\r\n a.CardName === userCompanyName ||\r\n a.UserCompanyName === userCompanyName\r\n ownB =\r\n b.CardName === userCompanyName ||\r\n b.UserCompanyName === userCompanyName\r\n res = SortGet(ownB, ownA)\r\n if (res === 0) {\r\n // then by companyname\r\n let valA = `${\r\n a.UserCompanyName ? a.UserCompanyName : a.CardName ? a.CardName : \"\"\r\n }`\r\n let valB = `${\r\n b.UserCompanyName ? b.UserCompanyName : b.CardName ? b.CardName : \"\"\r\n }`\r\n res = SortGet(valA, valB)\r\n if (res === 0) {\r\n // then by description\r\n res = SortGet(a.U_Desc, b.U_Desc)\r\n }\r\n }\r\n }\r\n }\r\n\r\n return res\r\n })\r\n\r\n let data = keys.reduce(\r\n (val, m, i) => {\r\n let Desc = \"\"\r\n switch (rows[m].CanBeUsedBy) {\r\n case \"@@SYSUser\":\r\n if (rows[m].UserCompanyName && rows[m].U_CntctCode !== userCode) {\r\n Desc = `${rows[m].UserCompanyName}${T(\r\n \"SYSFilterSortCompanyUserDelimiter\"\r\n )}${rows[m].UserName}${T(\"SYSFilterSortSetDelimiter\")}${\r\n rows[m].U_Desc\r\n }`\r\n } else {\r\n Desc = `${T(\"SYSFilterSortSetOwn\")}${T(\r\n \"SYSFilterSortSetDelimiter\"\r\n )}${rows[m].U_Desc}`\r\n }\r\n break\r\n case \"@@SYSAll\":\r\n Desc = `${presetAll ? presetAll : T(\"SYSFilterSortSetAll\")}${T(\r\n \"SYSFilterSortSetDelimiter\"\r\n )}${rows[m].U_Desc}`\r\n break\r\n default:\r\n Desc = `${presetCompany ? presetCompany : rows[m].CardName}${T(\r\n \"SYSFilterSortSetDelimiter\"\r\n )}${rows[m].U_Desc}`\r\n\r\n break\r\n }\r\n\r\n let d = { Val: rows[m].Code, Desc }\r\n val[rows[m].Code] = d\r\n return val\r\n },\r\n { \"\": { Val: \"\", Desc: T(\"SYSFilterSortSetDefault\") } }\r\n )\r\n\r\n return {\r\n data,\r\n lookupDef: {\r\n Desc: { translationKey: \"SYSTableSettingsFilterSelect\", type: \"text\" },\r\n },\r\n }\r\n}\r\nconst HookField_CanBeUsedBy_GetList: SYSAction<\r\n HookFieldGetList_Type,\r\n HookFieldGetList_ReturnType\r\n> = (value, { global }) => {\r\n let state = global.getState()\r\n let p = _GetFilterSortPermission(\r\n state.ovl.libState.tableSettings.filterSort.currentTableDefId\r\n )\r\n let data = {}\r\n data[\"@@SYSUser\"] = { Desc: T(\"SYSLoginUser\") }\r\n if (!value.formState || p?.all) {\r\n data[\"@@SYSAll\"] = { Desc: T(\"SYSFilterAll\") }\r\n }\r\n let lookups = state.ovl.libState.tableSettings.filterSort.lookups.CardCode\r\n if (lookups && lookups.length > 0) {\r\n data = lookups.reduce((val, l) => {\r\n val[l.CardCode] = { Desc: l.CardName }\r\n return val\r\n }, data)\r\n }\r\n return {\r\n data,\r\n }\r\n}\r\n\r\nconst HookField_U_CntctCode_GetList: SYSAction<\r\n HookFieldGetList_Type,\r\n HookFieldGetList_ReturnType\r\n> = (value, { global }) => {\r\n let state = global.getState()\r\n let lookups = state.ovl.libState.tableSettings.filterSort.lookups.U_CntctCode\r\n let data = {}\r\n if (lookups && lookups.length > 0) {\r\n data = lookups.reduce((val, l) => {\r\n val[l.CntctCode] = { Val: l.CntctCode, Desc: l.Name }\r\n return val\r\n }, data)\r\n }\r\n return {\r\n data,\r\n sortFn: (a, b) => SortGet(a.Desc, b.Desc),\r\n }\r\n}\r\n\r\nconst HookField_U_CntctCode_GetValueRender: SYSAction<\r\n HookFieldGetValueRender_Type,\r\n HookFieldGetValueRender_ReturnType\r\n> = (value) => {\r\n let val = \"---\"\r\n if (value.row.CanBeUsedBy === \"@@SYSUser\") {\r\n val = TableCellVal(value.tableDef.id, value.rowKey, value.columnKey, {\r\n useDisplayValue: true,\r\n })\r\n }\r\n return {\r\n res: val,\r\n }\r\n}\r\n\r\nconst HookTableRowFnCan: SYSAction<\r\n HookTableRowFnCan_Type\r\n> = async (value, { global }) => {\r\n let state = global.getState()\r\n if (value.tableDef.id === \"SYSTableSettings_ColumnFilter\") {\r\n return\r\n }\r\n\r\n let p = _GetFilterSortPermission(\r\n state.ovl.libState.tableSettings.filterSort.currentTableDefId\r\n )\r\n\r\n let isValid = value.row.U_CntctCode === state.ovl.user.userCode\r\n if (!isValid) {\r\n isValid = p.company && value.row.CanBeUsedBy === state.ovl.user.cardCode\r\n }\r\n if (!isValid) {\r\n isValid = p.all && value.row.CanBeUsedBy === \"@@SYSAll\"\r\n }\r\n if (!isValid) {\r\n isValid =\r\n (p.all && p.extended) ||\r\n (p.company && value.row.CanBeUsedBy === \"@@SYSUser\" && p.extended)\r\n }\r\n if (!isValid) {\r\n value.set([\"OvlEdit\", \"OvlDelete\"], { visibility: \"Disabled\" })\r\n }\r\n}\r\n\r\nexport let hooks = {\r\n HookTableBeforeSave,\r\n HookTableAfterDelete,\r\n HookTableAfterSave,\r\n HookField_Code_GetValueRender,\r\n HookField_Free1_GetValueRender,\r\n HookTableClicked,\r\n HookTableCustom_OriginalSort_Sort,\r\n HookField_HeaderMenuRangeFilterType_GetList,\r\n HookFormValidate,\r\n HookTableSetColumnVisibility,\r\n HookFormChanged,\r\n HookFormAdd,\r\n HookFormInit,\r\n HookField_HeaderMenuSelectPersistedFilterSort_GetList,\r\n HookField_CanBeUsedBy_GetList,\r\n HookField_U_CntctCode_GetList,\r\n HookField_U_CntctCode_GetValueRender,\r\n HookTableRowFnCan,\r\n}\r\n","import { ovl } from \"../../../../../../src\"\r\nimport { DialogClose } from \"../../../../../../src/library/dialog/dialogapi\"\r\nimport { FormGet } from \"../../../../../../src/library/forms/formapi\"\r\nimport {\r\n SYSTableDef,\r\n TableColumnFilter,\r\n TableGet,\r\n TableRebuild,\r\n} from \"../../../../../../src/library/table/tableapi\"\r\nimport { HeaderMenuFilterFieldsSetState } from \"../../../../../../src/library/table/tablerowheadermenu/tablesettings/hookactions\"\r\nimport { SYSTableSettings_ColumnFilter } from \"./tabledef\"\r\n\r\n// used for fast value retrieve in GetValue Hook\r\nlet _BaseTableContextForColumnFilter = {\r\n tableDef: undefined,\r\n rows: undefined,\r\n columnKey: \"\",\r\n additionalColumnKey: \"\",\r\n isList: false,\r\n isCalculated: false,\r\n}\r\n\r\nexport const _SetFilter = async (exclusive: boolean, filterVal = undefined) => {\r\n let list: any[] = []\r\n\r\n if (filterVal !== undefined) {\r\n list = [filterVal]\r\n } else {\r\n let filtered = TableGet(\r\n \"SYSTableSettings_ColumnFilter\",\r\n { byKeys: \"Selected\" }\r\n )\r\n let filteredKeys = filtered.getKeys()\r\n filteredKeys.forEach((k) => {\r\n let code = filtered.rows[k].Code\r\n list.push(code)\r\n })\r\n }\r\n let tableDef = TableGet(\r\n ovl.getState().ovl.libState.tableSettings.columnFilter.defId\r\n )\r\n let columnKey =\r\n ovl.getState().ovl.libState.tableSettings.columnFilter.columnKey\r\n if (\r\n await TableColumnFilter(tableDef.def.id, columnKey, list, {\r\n exclusive,\r\n _innerEvent: true,\r\n })\r\n ) {\r\n await TableRebuild(tableDef.def.id, { showProcess: true })\r\n HeaderMenuFilterFieldsSetState(\r\n FormGet(\"SYSHeaderMenuFilter\", { instance: \"1\" }).formState\r\n )\r\n }\r\n DialogClose(\"SYSTableSettings_ColumnFilter\")\r\n}\r\n\r\nexport { _BaseTableContextForColumnFilter }\r\n","import type {\r\n SYSColumnDef,\r\n SYSTableDef,\r\n} from \"../../../../../../src/library/table/tableapi\"\r\n\r\nexport type SYSTableSettings_ColumnFilter = {\r\n // we need a Differentiator here for TableSettings. Thats why we just include TableDefId\r\n TableDefId?: string\r\n // Key = Base row key from base TableDef row\r\n Key?: string\r\n /*Selected?: boolean*/\r\n Code?: string\r\n Free1?: string\r\n Count?: number\r\n OriginalSort?: number\r\n}\r\n\r\nlet columns: { [key in keyof SYSTableSettings_ColumnFilter]: SYSColumnDef } = {\r\n // Selected: {\r\n // sortable: true,\r\n // ui: {\r\n // labelTranslationKey: \"SYSTableSettingsColFilterSelected\",\r\n // visibility: \"Table\",\r\n // },\r\n // },\r\n Code: {\r\n sortable: true,\r\n type: \"text\",\r\n ui: {\r\n visibility: \"Table\",\r\n align: \"left\",\r\n labelTranslationKey: \"SYSTableSettingsColFilterCode\",\r\n },\r\n },\r\n Free1: {\r\n sortable: true,\r\n type: \"text\",\r\n ui: {\r\n visibility: \"None\",\r\n labelTranslationKey: \"SYSTableSettingsColFilterAdditionalColumn\",\r\n },\r\n },\r\n Count: {\r\n sortable: true,\r\n type: \"int\",\r\n ui: {\r\n labelTranslationKey: \"SYSTableSettingsColFilterCount\",\r\n visibility: \"Table\",\r\n },\r\n },\r\n}\r\n\r\nexport let tblTableSettings_ColumnFilter: SYSTableDef = {\r\n id: \"SYSTableSettings_ColumnFilter\",\r\n feature: \"SYSTableSettings\",\r\n options: {\r\n filterSortSettings: {\r\n staticFilterKey: \"TableDefId\",\r\n },\r\n navType: \"custom\",\r\n initial_paging: { page: 0, pageSize: 200 },\r\n initial_sortCustom: {\r\n selected: \"\",\r\n sorts: {\r\n OriginalSort: {\r\n showInTitle: false,\r\n translationKey: \"SYSTableSettingsOriginalSort\",\r\n },\r\n },\r\n },\r\n initial_filter: {\r\n static: { TableDefId: \"\" },\r\n },\r\n },\r\n database: {\r\n dataIdField: \"Code\",\r\n },\r\n features: {\r\n showFooterButtons: false,\r\n autoCloseButtonIfInsideDialog: true,\r\n page: true,\r\n headerMenu: true,\r\n multiSelect: true,\r\n },\r\n columns,\r\n}\r\n","import {\r\n html,\r\n ovl,\r\n SYSConfig,\r\n SYSForm,\r\n SYSTableDefIds,\r\n TemplateResult,\r\n} from \"../..\"\r\nimport { Data } from \"../../dataapi\"\r\nimport { _HasPermission } from \"../../global/globals\"\r\nimport {\r\n HookFormAfterCancel,\r\n HookFormAfterCancel_Type,\r\n HookFormBeforeCancel,\r\n HookFormBeforeCancel_ReturnType,\r\n HookFormBeforeCancel_Type,\r\n HookTableColumnFn,\r\n HookTableColumnFn_Type,\r\n HookTableFn,\r\n HookTableFn_Type,\r\n HookTablePrepareFn,\r\n HookTablePrepareFn_ReturnType,\r\n HookTablePrepareFn_Type,\r\n HookTableSchemaAssign,\r\n HookTableSchemaAssign_Type,\r\n TableRowFnProcessFeedback_Type,\r\n TableRowFnProcessRawFeedback_Type,\r\n} from \"../../global/hooks\"\r\nimport { T } from \"../../textapi\"\r\nimport { DialogClose, DialogOkCancel, DialogOpen } from \"../dialog/dialogapi\"\r\nimport { InitFormType } from \"../forms/actions\"\r\n\r\nimport { SYSField, SYSFormState } from \"../forms/fieldapi\"\r\nimport { FormIsDirty, FormRemove } from \"../forms/formapi\"\r\nimport { Schema } from \"../forms/sysformelement\"\r\n\r\nimport {\r\n _LocalDataSyncType,\r\n _TableEditSaveResultsType,\r\n _TableEditSaveRowsHelper,\r\n FileUploadContainer,\r\n TableInitResetStrategy,\r\n TableInitType,\r\n TableRefreshType,\r\n} from \"./actions\"\r\nimport {\r\n _GetFieldList,\r\n _TableFilterFn,\r\n getFormFieldsFromColumns,\r\n getListValue,\r\n GetRowDisplayValue,\r\n GetRowRawValue,\r\n GetTableKeys,\r\n} from \"./helpers\"\r\nimport { _HookTableGroupDefId } from \"./rowwrapper\"\r\n\r\nimport {\r\n _SelectionClippingType,\r\n _TableGetGroupInitAggregateResult,\r\n _TableGroupAggregateResultType,\r\n ControlType,\r\n OvlSysColumn,\r\n SelectRowDefOptions,\r\n SortDirection,\r\n StaticFilter,\r\n SYSTableData,\r\n SYSTableDef,\r\n} from \"./table\"\r\nimport { _BaseTableContextForColumnFilter } from \"./tablerowheadermenu/tablesettings/columnfilter/helpers\"\r\nimport {\r\n SYSTableSettings_ColumnFilter,\r\n tblTableSettings_ColumnFilter,\r\n} from \"./tablerowheadermenu/tablesettings/columnfilter/tabledef\"\r\n\r\nexport type _RefreshTableOptions = {\r\n showSnack?: boolean\r\n localData?: any[]\r\n\r\n staticFilter?: {}\r\n serverFilter?: {}\r\n customFilter?: { [key: string]: { active: boolean } }\r\n fetchData?: boolean\r\n resetStrategy?: TableInitResetStrategy\r\n forceFilterKeys?: _GetTableOptions\r\n forceFilterContextTitle?: string\r\n doNotRebuild?: boolean\r\n\r\n // override localDataSync if default not applicable:\r\n // default:\r\n // if localData and tabledef has an endpont => refresh\r\n // all other cases => removeclientdata\r\n // logic for removeclientdata:\r\n // check clientdata filtered the same way as serverresult (staticFilter & serverFilter)\r\n // if clientdata doesn't contain serverdata remove clientdata\r\n // if there is no filter at all just all data gets checked\r\n localDataSync?: _LocalDataSyncType\r\n}\r\n\r\nexport type _InitTableOptions = {\r\n resetStrategy?: TableInitResetStrategy\r\n staticFilter?: StaticFilter\r\n forceInit?: boolean\r\n}\r\n\r\nexport type _AddRowToTableOptions = {\r\n useDefaultSnack?: boolean\r\n files?: FileUploadContainer[]\r\n multi?: { isFirst: boolean; isLast: boolean }\r\n ignoreNeedsRefresh?: boolean\r\n // if ou need to update the primary key, we need the originalId\r\n originalIdIfUpdate?: any\r\n}\r\n\r\nexport const TableFnCanAdd = async (\r\n defId: SYSTableDefIds\r\n): Promise => {\r\n // use hook to check if Table has Add Fn\r\n // usecase BAR: GENAttachments drag and drop when no\r\n let tb = TableGet(defId)\r\n let def = tb.def\r\n if (def.features.add && _HasPermission(def.permission, \"A\")) {\r\n // def.feature maybe not set because table not initialised. we then just use def.id as default init does.\r\n let customFnHook =\r\n ovl.getActions().app.features?.[def.feature ? def.feature : def.id]\r\n ?.hooks?.[HookTablePrepareFn]\r\n let customFnHookResult: HookTablePrepareFn_ReturnType\r\n if (customFnHook) {\r\n customFnHookResult = await customFnHook({\r\n data: tb.dataDef,\r\n def,\r\n values: undefined,\r\n mode: \"HeaderMenu\",\r\n type: \"Table\",\r\n columnKey: undefined,\r\n })\r\n }\r\n\r\n return (\r\n customFnHookResult === undefined ||\r\n customFnHookResult?.[\"OvlAdd\"]?.visibility === \"Visible\"\r\n )\r\n } else {\r\n return false\r\n }\r\n}\r\n\r\nexport const TableRefresh = async (\r\n defId: SYSTableDefIds,\r\n options?: _RefreshTableOptions\r\n): Promise<_TableGetReturnType> => {\r\n let state = ovl.getState()\r\n if (state.ovl.uiState.appIsScreenNavigateInRehydrating) {\r\n return TableGet(defId)\r\n }\r\n\r\n let data = SYSConfig.app.tableDefIds[defId].getData(state)\r\n let localData = options?.localData\r\n\r\n let refresh: TableRefreshType = {\r\n ignoreRefreshedMessageSnack: options?.showSnack === false,\r\n data,\r\n defId,\r\n forceServerDataRefresh: !options || options.fetchData !== false,\r\n localData,\r\n // provide serverfilter if you would like to refresh data (deleted rows will not be deleted in client)\r\n serverFilter: options?.serverFilter,\r\n // staticfilter is important to manage vies like SalesOrder -> SalesOrder Lines where would have the DocEntry as static filter in Document Lines View\r\n // a staticFilter automatically deletes rows on the client if it was deleted by other user\r\n staticFilter: options?.staticFilter,\r\n customFilter: options?.customFilter,\r\n forceFilterKeys: options?.forceFilterKeys,\r\n forceFilterContextTitle: options?.forceFilterContextTitle,\r\n doNotRebuild: options?.doNotRebuild,\r\n localDataSync: options?.localDataSync,\r\n }\r\n\r\n // if (options?.resetStrategy && (options.resetStrategy.ClearDataView || options.resetStrategy.Columns)) {\r\n // TableInit(defId, { resetStrategy: options.resetStrategy })\r\n // } else {\r\n\r\n //@maybe instead of tablerebuild when using staticfilter\r\n // do a clearviewdata inside init in one step\r\n\r\n if (options?.resetStrategy) {\r\n await TableInit(defId, {\r\n resetStrategy: options.resetStrategy,\r\n staticFilter: options?.staticFilter,\r\n })\r\n }\r\n await ovl.getActions().ovl.table._TableRefresh(refresh)\r\n return TableGet(defId)\r\n}\r\ntype _TableRebuildOptions = {\r\n showProcess?: boolean\r\n staticFilter?: any\r\n doNotPersistFilterSort?: boolean\r\n\r\n forceFilterKeys?: _GetTableOptions\r\n forceFilterContextTitle?: string\r\n selectionClipping?: _SelectionClippingType\r\n}\r\nexport const TableRebuild = async (\r\n defId: SYSTableDefIds,\r\n options?: _TableRebuildOptions\r\n): Promise<_TableGetReturnType> => {\r\n if (ovl.getState().ovl.uiState.appIsScreenNavigateInRehydrating) {\r\n return TableGet(defId)\r\n }\r\n\r\n await ovl.getActions().ovl.table._TableRebuild({\r\n defId,\r\n data: SYSConfig.app.tableDefIds[defId].getData(ovl.getState()),\r\n showProcess: options?.showProcess,\r\n staticFilter: options?.staticFilter,\r\n doNotPersistFilterSort: options?.doNotPersistFilterSort,\r\n\r\n forceFilterKeys: options?.forceFilterKeys,\r\n forceFilterContextTitle: options?.forceFilterContextTitle,\r\n selectionClipping: options?.selectionClipping,\r\n })\r\n return TableGet(defId)\r\n}\r\n\r\nexport type _GetTableOptions = {\r\n byKeys?:\r\n | \"StaticFiltered\"\r\n | \"Visible\"\r\n | \"All\"\r\n | \"Selected\"\r\n | \"SelectedTimeAsc\"\r\n | \"SelectedTimeDesc\"\r\n byIdValue?: any\r\n byCustomFilter?: (row: T, key: string) => boolean\r\n byCustomFilterInVisible?: (row: T, key: string) => boolean\r\n byFilter?: { [key: string]: any }\r\n byKey?: string\r\n onlyUseTheseKeys?: any[]\r\n}\r\n\r\nexport type _FormStateGetForRowKeyOptions = {\r\n onlyIfInEditMode?: boolean\r\n}\r\n\r\nexport type _TableGetReturnType = {\r\n dataDef: SYSTableData\r\n def: SYSTableDef\r\n getKeys: (currentoptions?: _GetTableOptions) => string[]\r\n rows: { [key: string]: T }\r\n formStateGetForRowKey: (\r\n rowkey: string,\r\n options?: _FormStateGetForRowKeyOptions\r\n ) => SYSFormState\r\n formStateInitForRowKey: (rowkey: string) => Promise\r\n formEditRow: (\r\n key: string,\r\n options?: _TableFormEditRowOptions\r\n ) => Promise\r\n formRemoveRowFormState: (rowKey: string) => void\r\n init: (options?: _InitTableOptions) => Promise<_TableGetReturnType>\r\n schemaGet: () => Promise<{ [key: string]: Schema }>\r\n refresh: (options?: _RefreshTableOptions) => void\r\n rebuild: (options?: _TableRebuildOptions) => void\r\n staticFilterSetEntry: (\r\n filterKey: string,\r\n filterValue: any\r\n ) => { [key in keyof T]: any }\r\n staticFilterRemoveEntry: (filterKey: string) => { [key in keyof T]: any }\r\n staticFilterGet: () => { [key in keyof T]: any }\r\n staticFilterReset: () => { [key in keyof T]: any }\r\n saveRow: (\r\n row: {},\r\n options?: _AddRowToTableOptions\r\n ) => Promise<{ newId: any; rowKey: string }>\r\n removeRowFromData: (key: string) => void\r\n columnFilterGet: (columnKey: string) => { list: any[]; exclusive: boolean }\r\n}\r\n\r\nexport const TableGet = (\r\n defId: SYSTableDefIds,\r\n options?: _GetTableOptions\r\n): _TableGetReturnType => {\r\n // takes into account staticfilter\r\n if (!options) {\r\n options = {}\r\n }\r\n let state = ovl.getState()\r\n let dataDef: SYSTableData = SYSConfig.app.tableDefIds[defId].getData(state)\r\n let def = dataDef.tableDef[defId]\r\n\r\n return {\r\n dataDef,\r\n getKeys: (currentoptions?: _GetTableOptions) => {\r\n let opt = options\r\n if (currentoptions) {\r\n opt = currentoptions\r\n }\r\n return GetTableKeys(def, dataDef, opt)\r\n },\r\n rows: dataDef.data,\r\n def: dataDef.tableDef[defId],\r\n formStateGetForRowKey: (\r\n rowkey: string,\r\n options?: _FormStateGetForRowKeyOptions\r\n ) => TableFormStateGetForRowKey(defId, rowkey, options),\r\n formStateInitForRowKey: async (rowkey: string) =>\r\n await TableFormStateInitForRowKey(defId, rowkey),\r\n formEditRow: async (rowkey: string, options?: _TableFormEditRowOptions) =>\r\n await TableFormEditRow(defId, rowkey, options),\r\n formRemoveRowFormState: (rowkey: string) => {\r\n let formType: SYSForm = \"SYSTableRowEdit\"\r\n let formid = `${def.id}_${rowkey}`\r\n FormRemove(formType, formid)\r\n },\r\n init: async (options?: _InitTableOptions) =>\r\n await TableInit(defId, options),\r\n schemaGet: async () => await TableSchemaGet(defId),\r\n rebuild: async (options?: _TableRebuildOptions) =>\r\n await TableRebuild(defId, options),\r\n refresh: async (options?: TableRefreshType) =>\r\n await TableRefresh(defId, options),\r\n staticFilterSetEntry: (filterKey: string, filterValue: any) => {\r\n return TableStaticFilterSetEntry(defId, filterKey, filterValue)\r\n },\r\n staticFilterRemoveEntry: (filterKey: string) => {\r\n return TableStaticFilterRemoveEntry(defId, filterKey)\r\n },\r\n staticFilterReset: () => {\r\n return TableStaticFilterReset(defId)\r\n },\r\n staticFilterGet: () => {\r\n return TableStaticFilterGet(defId)\r\n },\r\n saveRow: async (row: {}, options: _AddRowToTableOptions) => {\r\n return await TableSaveRow(defId, row, options)\r\n },\r\n columnFilterGet: (columnKey: string) => {\r\n return TableColumnFilterGet(defId, columnKey)\r\n },\r\n\r\n removeRowFromData: (key: string) => {\r\n TableRemoveRowFromData(defId, key)\r\n },\r\n }\r\n}\r\n\r\nexport const TableColumnList = (\r\n tableDefId: SYSTableDefIds,\r\n columnKey: string\r\n) => {\r\n return _GetFieldList(undefined, columnKey, undefined, tableDefId)\r\n}\r\n\r\nexport const TableColumnFilterGet = (\r\n defId: SYSTableDefIds,\r\n columnKey: keyof RowType\r\n): { list: any[]; exclusive: boolean } => {\r\n let def = TableGet(defId).def\r\n let filter = JSON.parse(\r\n JSON.stringify(def.uiState.filter.columns[columnKey].columnFilter)\r\n )\r\n return { list: filter.list, exclusive: filter.exclusive }\r\n}\r\n\r\nexport type _TableColumnFilterOptionsType = {\r\n exclusive?: boolean\r\n rebuild?: boolean\r\n _innerEvent?: boolean\r\n}\r\n\r\nexport const TableColumnFilter = async (\r\n defId: SYSTableDefIds,\r\n columnKey: string,\r\n list: any[],\r\n options?: _TableColumnFilterOptionsType\r\n): Promise => {\r\n if (list === undefined) {\r\n list = []\r\n }\r\n let def = TableGet(defId).def\r\n if (\r\n !def.uiState.filter.columns[columnKey] ||\r\n !def.uiState.filter.columns[columnKey].columnFilter\r\n ) {\r\n console.error(`SYS Error: columnfilter column ${columnKey} not found`)\r\n return false\r\n }\r\n let tableFn = ovl.getActions().app.features[def.feature]?.hooks?.[HookTableFn]\r\n if (tableFn) {\r\n if (\r\n await tableFn({\r\n FnType: \"ColumnFilter\",\r\n before: true,\r\n id: columnKey,\r\n selection: list,\r\n val1: options?.exclusive === true,\r\n innerEvent: options?._innerEvent === true,\r\n })\r\n ) {\r\n return false\r\n }\r\n }\r\n await ovl.getActions().ovl.internal._TableSelectColumnFilter({\r\n list,\r\n columnKey,\r\n def,\r\n exclusive: options?.exclusive === true,\r\n })\r\n\r\n if (tableFn) {\r\n await tableFn({\r\n FnType: \"ColumnFilter\",\r\n before: false,\r\n id: columnKey,\r\n selection: list,\r\n val1: options?.exclusive === true,\r\n innerEvent: options?._innerEvent === true,\r\n })\r\n }\r\n\r\n if (options?.rebuild) {\r\n if (columnFilterRebuildDebounce) {\r\n clearTimeout(columnFilterRebuildDebounce)\r\n }\r\n columnFilterRebuildDebounce = setTimeout(async () => {\r\n await TableRebuild(defId)\r\n }, 50)\r\n }\r\n\r\n return true\r\n}\r\nlet columnFilterRebuildDebounce: any\r\nexport const TableCustomFilter = async (\r\n defId: SYSTableDefIds,\r\n key: string,\r\n active: boolean,\r\n options?: { _innerEvent?: boolean }\r\n): Promise => {\r\n let dataDef: SYSTableData = SYSConfig.app.tableDefIds[defId].getData(\r\n ovl.getState()\r\n )\r\n let def = dataDef.tableDef[defId]\r\n\r\n if (!def.uiState.filter.filterCustom[key]) {\r\n console.warn(`SYS Warning: customfilter ${key} not found anymore`)\r\n return true\r\n }\r\n // if (def.uiState.filter.filterCustom[key].active === active) {\r\n // return false\r\n // }\r\n let tableFn = ovl.getActions().app.features[def.feature]?.hooks?.[HookTableFn]\r\n if (tableFn) {\r\n if (\r\n await tableFn({\r\n FnType: \"CustomFilter\",\r\n before: true,\r\n innerEvent: options?._innerEvent === true,\r\n id: key,\r\n val1: active,\r\n })\r\n ) {\r\n return false\r\n }\r\n }\r\n await ovl.getActions().ovl.internal._TableSelectCustomFilter({\r\n id: key,\r\n def,\r\n active,\r\n })\r\n if (tableFn) {\r\n await tableFn({\r\n FnType: \"CustomFilter\",\r\n before: false,\r\n innerEvent: options?._innerEvent === true,\r\n id: key,\r\n val1: active,\r\n })\r\n }\r\n return true\r\n}\r\nexport const TableAttributeFilter = async (\r\n defId: SYSTableDefIds,\r\n attributeDefKey: string,\r\n attributeKey: string,\r\n active: boolean,\r\n options?: { _innerEvent?: boolean }\r\n): Promise => {\r\n let dataDef: SYSTableData = SYSConfig.app.tableDefIds[defId].getData(\r\n ovl.getState()\r\n )\r\n let def = dataDef.tableDef[defId]\r\n if (!def.uiState.filter.filterAttributes[attributeDefKey]) {\r\n console.warn(\r\n `SYS Warning: attributefilter ${attributeDefKey} not found anymore`\r\n )\r\n return true\r\n }\r\n // if (def.uiState.filter.filterCustom[key].active === active) {\r\n // return false\r\n // }\r\n let tableFn = ovl.getActions().app.features[def.feature]?.hooks?.[HookTableFn]\r\n if (tableFn) {\r\n if (\r\n await tableFn({\r\n FnType: \"AttributeFilter\",\r\n before: true,\r\n innerEvent: options?._innerEvent === true,\r\n id: attributeDefKey,\r\n val1: attributeKey,\r\n val2: active,\r\n })\r\n ) {\r\n return false\r\n }\r\n }\r\n await ovl.getActions().ovl.internal._TableSelectAttributeFilter({\r\n active,\r\n attributeDefKey,\r\n attributeKey,\r\n def,\r\n })\r\n if (tableFn) {\r\n await tableFn({\r\n FnType: \"AttributeFilter\",\r\n before: false,\r\n innerEvent: options?._innerEvent === true,\r\n id: attributeDefKey,\r\n val1: attributeKey,\r\n val2: active,\r\n })\r\n }\r\n return true\r\n}\r\n\r\nexport type _TableFilterSelectedOptionsType = { _innerEvent: boolean }\r\nexport const TableFilterSelected = async (\r\n defId: SYSTableDefIds,\r\n options?: _TableFilterSelectedOptionsType\r\n): Promise => {\r\n let dataDef: SYSTableData = SYSConfig.app.tableDefIds[defId].getData(\r\n ovl.getState()\r\n )\r\n let def = dataDef.tableDef[defId]\r\n let tableFn = ovl.getActions().app.features[def.feature]?.hooks?.[HookTableFn]\r\n if (tableFn) {\r\n if (\r\n await tableFn({\r\n FnType: \"FilterSelected\",\r\n before: true,\r\n innerEvent: options?._innerEvent === true,\r\n })\r\n ) {\r\n return false\r\n }\r\n }\r\n ovl.getActions().ovl.internal._TableFilterSelected({ def, data: dataDef })\r\n if (tableFn) {\r\n await tableFn({\r\n FnType: \"FilterSelected\",\r\n before: false,\r\n innerEvent: options?._innerEvent === true,\r\n })\r\n }\r\n return true\r\n}\r\n\r\nexport type _CustomSortTableOptionsType = {\r\n key: string\r\n}\r\n\r\nexport const TableCustomSort = async (\r\n defId: SYSTableDefIds,\r\n options: _CustomSortTableOptionsType\r\n): Promise => {\r\n let dataDef: SYSTableData = SYSConfig.app.tableDefIds[defId].getData(\r\n ovl.getState()\r\n )\r\n let def = dataDef.tableDef[defId]\r\n let tableFn = ovl.getActions().app.features[def.feature]?.hooks?.[HookTableFn]\r\n if (tableFn) {\r\n if (\r\n await tableFn({\r\n FnType: \"CustomSort\",\r\n before: true,\r\n id: options.key,\r\n })\r\n ) {\r\n return false\r\n }\r\n }\r\n let sortCustom = def.uiState.sort.sortCustom\r\n\r\n if (sortCustom.selected === options.key) {\r\n return true\r\n }\r\n\r\n ovl.getActions().ovl.internal._TableSelectCustomSort({\r\n id: options.key,\r\n def,\r\n })\r\n TableRebuild(defId, { showProcess: true })\r\n\r\n if (tableFn) {\r\n await tableFn({\r\n FnType: \"CustomSort\",\r\n before: false,\r\n id: options.key,\r\n })\r\n }\r\n return true\r\n}\r\n\r\nexport type _SelectAllTableOptionsType = {\r\n select: boolean\r\n}\r\n\r\nexport const TableSelectAll = async (\r\n defId: SYSTableDefIds,\r\n options: _SelectAllTableOptionsType\r\n): Promise => {\r\n let dataDef: SYSTableData = SYSConfig.app.tableDefIds[defId].getData(\r\n ovl.getState()\r\n )\r\n let def = dataDef.tableDef[defId]\r\n let tableFn = ovl.getActions().app.features[def.feature]?.hooks?.[HookTableFn]\r\n if (tableFn) {\r\n if (\r\n await tableFn({\r\n FnType: \"SelectAll\",\r\n before: true,\r\n val1: options.select,\r\n })\r\n ) {\r\n return false\r\n }\r\n }\r\n\r\n ovl.getActions().ovl.internal._TableSelectAll({\r\n tableDefId: def.id,\r\n select: options.select,\r\n })\r\n\r\n if (tableFn) {\r\n await tableFn({\r\n FnType: \"SelectAll\",\r\n before: false,\r\n val1: options.select,\r\n })\r\n }\r\n return true\r\n}\r\n\r\nexport type ColumnFnTableOptionsType = {\r\n key: string\r\n Selection?: boolean\r\n _innerEvent?: boolean\r\n}\r\n\r\nexport const TableCustomColumnFn = async (\r\n defId: SYSTableDefIds,\r\n options: ColumnFnTableOptionsType\r\n): Promise => {\r\n let dataDef: SYSTableData = SYSConfig.app.tableDefIds[defId].getData(\r\n ovl.getState()\r\n )\r\n let def = dataDef.tableDef[defId]\r\n let hooks = ovl.getActions().app.features[def.feature]?.hooks\r\n let tableFn = hooks?.[HookTableFn]\r\n if (tableFn) {\r\n if (\r\n await tableFn({\r\n FnType: \"CustomColumnFunction\",\r\n before: true,\r\n id: options.key,\r\n selection: options.Selection,\r\n innerEvent: options._innerEvent === true,\r\n })\r\n ) {\r\n return false\r\n }\r\n }\r\n\r\n if (!options.Selection) {\r\n let fnName = HookTableColumnFn\r\n if (hooks[fnName]) {\r\n hooks[fnName]({\r\n columnKey: def.uiState.headerSelected,\r\n fnKey: options.key,\r\n def,\r\n data: dataDef,\r\n innerEvent: options._innerEvent,\r\n })\r\n } else {\r\n console.error(`ovl error: ColumnFnHook ${fnName} not found`)\r\n }\r\n //@@todo, check use case for MultipleCustomColumnFunction?\r\n // looks like for now its not used\r\n // and it seems not be handled for columnfunctions but only row functions inside _TableMultipleCustomFuncion Action\r\n } else {\r\n ovl.getActions().ovl.internal._TableMultipleCustomFunction({\r\n def,\r\n data: dataDef,\r\n customFnId: options.key,\r\n })\r\n }\r\n if (tableFn) {\r\n await tableFn({\r\n FnType: \"CustomColumnFunction\",\r\n before: false,\r\n id: options.key,\r\n selection: options.Selection,\r\n innerEvent: options._innerEvent === true,\r\n })\r\n }\r\n return true\r\n}\r\n\r\nexport type _FilterTableOptionsType = {\r\n filterValue: string\r\n}\r\n\r\nexport const TableFilter = async (\r\n defId: SYSTableDefIds,\r\n options: _FilterTableOptionsType\r\n): Promise => {\r\n let dataDef: SYSTableData = SYSConfig.app.tableDefIds[defId].getData(\r\n ovl.getState()\r\n )\r\n let def = dataDef.tableDef[defId]\r\n let tableFn = ovl.getActions().app.features[def.feature]?.hooks?.[HookTableFn]\r\n if (tableFn) {\r\n if (\r\n await tableFn({\r\n FnType: \"Filter\",\r\n before: true,\r\n id: options.filterValue,\r\n })\r\n ) {\r\n return false\r\n }\r\n }\r\n ovl.getActions().ovl.table._TableFilter({\r\n def,\r\n data: dataDef,\r\n value: options.filterValue,\r\n })\r\n if (tableFn) {\r\n await tableFn({\r\n FnType: \"Filter\",\r\n before: false,\r\n id: options.filterValue,\r\n })\r\n }\r\n return true\r\n}\r\n\r\nexport type _ColumnSortTableOptions = {\r\n columnKey: string\r\n sortByRawValue?: boolean\r\n sortOrder?: SortDirection\r\n}\r\n\r\nexport const TableColumnSort = async (\r\n defId: SYSTableDefIds,\r\n options: _ColumnSortTableOptions\r\n): Promise => {\r\n let dataDef: SYSTableData = SYSConfig.app.tableDefIds[defId].getData(\r\n ovl.getState()\r\n )\r\n if (options.sortByRawValue === undefined) {\r\n options.sortByRawValue = false\r\n }\r\n if (options.sortOrder === undefined) {\r\n options.sortOrder = \"asc\"\r\n }\r\n\r\n let def = dataDef.tableDef[defId]\r\n let tableFn = ovl.getActions().app.features[def.feature]?.hooks?.[HookTableFn]\r\n if (tableFn) {\r\n if (\r\n await tableFn({\r\n FnType: \"ColumnSort\",\r\n before: true,\r\n id: options.columnKey,\r\n val1: options.sortOrder,\r\n val2: options.sortByRawValue,\r\n })\r\n ) {\r\n return false\r\n }\r\n }\r\n ovl.getActions().ovl.table._TableSort({\r\n def,\r\n data: dataDef,\r\n key: options.columnKey,\r\n useValue: options.sortByRawValue,\r\n ascending: options.sortOrder === \"asc\",\r\n })\r\n TableRebuild(defId, { showProcess: true })\r\n if (tableFn) {\r\n await tableFn({\r\n FnType: \"ColumnSort\",\r\n before: false,\r\n id: options.columnKey,\r\n val1: options.sortOrder,\r\n val2: options.sortByRawValue,\r\n })\r\n }\r\n return true\r\n}\r\n\r\nexport const TableInit = async (\r\n defId: SYSTableDefIds,\r\n options?: _InitTableOptions\r\n): Promise<_TableGetReturnType> => {\r\n if (ovl.getState().ovl.uiState.appIsScreenNavigateInRehydrating) {\r\n return TableGet(defId)\r\n }\r\n\r\n let dataDef = SYSConfig.app.tableDefIds[defId].getData(ovl.getState())\r\n let def = dataDef.tableDef[defId]\r\n if (options?.forceInit) {\r\n def.initialised = false\r\n }\r\n let init: TableInitType = {\r\n data: dataDef,\r\n defId,\r\n resetStrategy: options?.resetStrategy,\r\n staticFilter: options?.staticFilter,\r\n }\r\n\r\n await ovl.getActions().ovl.table._TableInit(init)\r\n return TableGet(defId)\r\n}\r\n\r\nexport type TableFormElementType = {\r\n mode: { byStaticFilter?: { [key: string]: any }; byKey?: any }\r\n tableDefId: SYSTableDefIds\r\n formId: string\r\n options?: { saveOnDisconnect?: boolean }\r\n}\r\n\r\nexport const TableRowFnExecute = async (\r\n tableDefId: SYSTableDefIds,\r\n fnKey: string,\r\n keysToProcess: string[]\r\n) => {\r\n let tb = TableGet(tableDefId)\r\n await ovl.getActions().ovl.internal._TableMultipleCustomFunction({\r\n def: tb.def,\r\n data: tb.dataDef,\r\n customFnId: fnKey,\r\n customSelection: keysToProcess,\r\n })\r\n}\r\n\r\nexport const TableRowFnAddFeedback = (\r\n tableDefId: SYSTableDefIds,\r\n fnKey: string,\r\n feedback: TableRowFnProcessRawFeedback_Type\r\n) => {\r\n let tb = TableGet(tableDefId)\r\n let key = feedback.id\r\n if (!tb.rows[key]) {\r\n key = tb.dataDef.index[key]\r\n }\r\n let ovlSysState = tb.rows[key][\"OvlSysState\"] as OvlSysColumn\r\n\r\n let now = new Date().getTime()\r\n ovlSysState.lastFeedbackTS = now\r\n ovlSysState.fnFeedback[fnKey] = {\r\n ts: now,\r\n type: feedback.type,\r\n code: feedback.code,\r\n fnId: fnKey,\r\n id: key,\r\n text: feedback.text,\r\n }\r\n}\r\n\r\nexport type _TableEditSaveRowOptionsType = {\r\n useDefaultSnack?: boolean\r\n}\r\nexport const TableEditSaveRow = async (\r\n formState: SYSFormState,\r\n options?: _TableEditSaveRowOptionsType\r\n): Promise<_TableEditSaveResultsType> => {\r\n let tableDef = TableGet(formState.tableDefId)\r\n let res = await _TableEditSaveRowsHelper(\r\n [formState.tableRowKey],\r\n tableDef.def,\r\n tableDef.dataDef,\r\n formState,\r\n ovl.getState(),\r\n ovl.getActions(),\r\n undefined,\r\n {},\r\n !options?.useDefaultSnack\r\n )\r\n if (\r\n formState.tableDataMode === \"Add\" &&\r\n res.results.filter(\r\n (f) => f.key === formState.tableRowKey && f.type === \"error\"\r\n ).length === 0\r\n ) {\r\n formState.tableDataMode = \"Update\"\r\n tableDef.dataDef.data[formState.tableRowKey].OvlSysState.editRow.mode =\r\n undefined\r\n }\r\n return res\r\n}\r\n\r\nexport const TableSaveRow = async (\r\n defId: SYSTableDefIds,\r\n rowToSave: {},\r\n\r\n options?: _AddRowToTableOptions\r\n): Promise<{ newId: any; rowKey: string }> => {\r\n let data = SYSConfig.app.tableDefIds[defId].getData(ovl.getState())\r\n return await ovl.getActions().ovl.table._TableDirectSaveRow({\r\n data,\r\n defId,\r\n rowToSave,\r\n noSnack: !options?.useDefaultSnack,\r\n files: options?.files,\r\n multi: options?.multi,\r\n ignoreNeedsRefresh: options?.ignoreNeedsRefresh,\r\n originalIdIfUpdate: options?.originalIdIfUpdate,\r\n })\r\n}\r\n\r\nexport const _TableDefSelectRow = async (\r\n tableDef: SYSTableDef,\r\n dataDef: SYSTableData,\r\n key: string,\r\n options?: SelectRowDefOptions\r\n) => {\r\n ovl.getActions().ovl.table._TableSelectRow({\r\n def: tableDef,\r\n dataDef,\r\n key,\r\n options,\r\n })\r\n}\r\nexport const TableSelectRow = (\r\n tableDefId: SYSTableDefIds,\r\n key: string,\r\n options?: SelectRowDefOptions\r\n) => {\r\n let tableDef = TableGet(tableDefId)\r\n return _TableDefSelectRow(tableDef.def, tableDef.dataDef, key, options)\r\n}\r\n\r\nexport type _EditTableRowOptions = {\r\n key?: any\r\n}\r\n\r\nexport type _TableFormEditRowOptions = {\r\n forceInline?: boolean\r\n}\r\n\r\nexport const TableFormEditRow = async (\r\n defId: SYSTableDefIds,\r\n key?: any,\r\n options?: _TableFormEditRowOptions\r\n) => {\r\n let data: SYSTableData = SYSConfig.app.tableDefIds[defId].getData(\r\n ovl.getState()\r\n )\r\n if (key === undefined) {\r\n key = Object.keys(data.data)[0]\r\n }\r\n\r\n return (\r\n (await ovl.getActions().ovl.table._TableEditRow({\r\n data,\r\n def: data.tableDef[defId],\r\n key,\r\n // always when we call editform from api we need a bigform\r\n // because we cannot be sure if the user is on the table or called it from somewhere where table is not visible\r\n forceBigForm: !options?.forceInline,\r\n }))\r\n )\r\n}\r\n\r\nexport const TableFormStateGetForRowKey = (\r\n defId: SYSTableDefIds,\r\n key?: any,\r\n options?: _FormStateGetForRowKeyOptions\r\n): SYSFormState => {\r\n let tb = TableGet(defId)\r\n let def = tb.def\r\n let data = tb.dataDef\r\n if (key === undefined) {\r\n key = tb.getKeys()[0]\r\n }\r\n let instanceId = `${def.id}_${key}`\r\n let formsState = ovl.getState().ovl.forms.SYSTableRowEdit\r\n let colSysState = data.data[key].OvlSysState as OvlSysColumn\r\n if (formsState[instanceId]) {\r\n if (options?.onlyIfInEditMode) {\r\n if (colSysState.editRow.selected) {\r\n return formsState[instanceId]\r\n }\r\n } else {\r\n return formsState[instanceId]\r\n }\r\n }\r\n}\r\n\r\nexport const TableFormStateInitForRowKey = async (\r\n defId: SYSTableDefIds,\r\n key?: any\r\n): Promise => {\r\n let tb = TableGet(defId)\r\n let def = tb.def\r\n let data = tb.dataDef\r\n if (key === undefined) {\r\n key = tb.getKeys()[0]\r\n }\r\n let instanceId = `${def.id}_${key}`\r\n let isInline = tb.def.options.edit?.editType === \"inline\"\r\n let formFields = getFormFieldsFromColumns(def, tb.rows[key], isInline)\r\n\r\n let initForm: InitFormType = {\r\n tableRowKey: key,\r\n fields: formFields,\r\n formType: \"SYSTableRowEdit\",\r\n formId: instanceId,\r\n feature: def.feature,\r\n schema: data.schema,\r\n forceKeepFormStateOnCancel: def.options.forceKeepFormStateOnCancel,\r\n doFormChangedForEveryFieldInInit:\r\n def.options.edit.doFormChangedForEveryFieldInInit,\r\n forceOverwrite: false,\r\n tableDefId: def.id,\r\n tableDataMode: \"Update\",\r\n isInline,\r\n row: tb.rows[key],\r\n initialFocusFieldKey: undefined,\r\n useAlignRight: def.options.controlsRendering.useAlignRight,\r\n }\r\n let formState = await ovl.getActions().ovl.form._InitForm(initForm)\r\n return formState\r\n}\r\n\r\nexport type _TableEditRowOptionsType = {\r\n formType: SYSForm\r\n formId: any\r\n}\r\n\r\nexport type _TableAddRowReturnType = {\r\n newRow: { [key in keyof RowType]: any }\r\n key: string\r\n fieldKeyToFocus?: keyof RowType\r\n}\r\n\r\nexport const TableFormAddRow = async (defId: SYSTableDefIds) => {\r\n let data: SYSTableData = SYSConfig.app.tableDefIds[defId].getData(\r\n ovl.getState()\r\n )\r\n\r\n let def = data.tableDef[defId]\r\n\r\n let addRes = await ovl.getActions().ovl.table._TableAddRow({\r\n data,\r\n def,\r\n })\r\n\r\n return (\r\n (await ovl.getActions().ovl.table._TableEditRow({\r\n data,\r\n def: data.tableDef[defId],\r\n key: addRes.key,\r\n }))\r\n )\r\n}\r\n\r\nexport type _CellValueOptionsType = {\r\n useDisplayValue?: boolean\r\n lookupColumnKey?: string\r\n rowKeyMode?: \"id\" | \"key\"\r\n}\r\n\r\nexport type _SetCellValueOptionsType = {\r\n rowKeyMode?: \"id\" | \"key\"\r\n}\r\n\r\nexport const TableSetCellVal = (\r\n tableDefId: SYSTableDefIds,\r\n rowKey: any,\r\n columnKey: keyof RowType,\r\n value: any,\r\n options?: _SetCellValueOptionsType\r\n): any => {\r\n let rowKeyMode = options?.rowKeyMode\r\n if (!rowKeyMode) {\r\n rowKeyMode = \"key\"\r\n }\r\n let data: SYSTableData = SYSConfig.app.tableDefIds[tableDefId].getData(\r\n ovl.getState()\r\n )\r\n data.data[rowKeyMode === \"id\" ? data.index[rowKey] : rowKey][columnKey] =\r\n value\r\n}\r\n\r\nexport const TableCellVal = (\r\n tableDefId: SYSTableDefIds,\r\n rowKey: any,\r\n columnKey: keyof RowType,\r\n options?: _CellValueOptionsType\r\n): any => {\r\n let val\r\n\r\n let rowKeyMode = options?.rowKeyMode\r\n if (!rowKeyMode) {\r\n rowKeyMode = \"key\"\r\n }\r\n\r\n let data: SYSTableData = SYSConfig.app.tableDefIds[tableDefId].getData(\r\n ovl.getState()\r\n )\r\n\r\n let key = rowKeyMode === \"id\" ? data.index[rowKey] : rowKey\r\n val = data.data[key]?.[columnKey]\r\n let columnDef = data.tableDef[tableDefId].columns[columnKey]\r\n let isCalculatedColumn = columnDef.schema?.isCalculatedColumn\r\n if (!isCalculatedColumn && val === undefined) {\r\n return null\r\n }\r\n let useDisplayValue = options?.useDisplayValue\r\n\r\n let feature = data.tableDef[tableDefId].feature\r\n let lookupColumnKey = options?.lookupColumnKey\r\n\r\n if (!columnDef) {\r\n return val\r\n } else if (useDisplayValue) {\r\n return GetRowDisplayValue(\r\n data.tableDef[tableDefId],\r\n columnKey,\r\n data.data[rowKey],\r\n rowKey,\r\n \"Table\"\r\n )\r\n } else {\r\n if (!options?.lookupColumnKey || !columnDef.list) {\r\n if (isCalculatedColumn) {\r\n val = GetRowRawValue(\r\n data.tableDef[tableDefId],\r\n columnKey,\r\n data.data[rowKey],\r\n rowKey\r\n )\r\n }\r\n return val\r\n }\r\n return getListValue(\r\n columnKey,\r\n val,\r\n feature,\r\n columnDef.list,\r\n undefined,\r\n lookupColumnKey\r\n )\r\n }\r\n}\r\n\r\nexport const TableRemoveRowFromData = (\r\n defId: SYSTableDefIds,\r\n key: string,\r\n multi?: { isFirst: boolean; isLast: boolean }\r\n) => {\r\n let data: SYSTableData = SYSConfig.app.tableDefIds[defId].getData(\r\n ovl.getState()\r\n )\r\n\r\n let def = data.tableDef[defId]\r\n ovl.getActions().ovl.internal._TableDeleteRowFromData({\r\n data: data,\r\n def,\r\n key,\r\n })\r\n\r\n // if (!multi || multi.isLast) {\r\n // if (\r\n // def.uiState.needsRefresh &&\r\n // (def.features.autoRebuild === \"AfterModifyOrDelete\" ||\r\n // def.features.autoRebuild === \"AfterModifyOrDeleteOrAdd\")\r\n // ) {\r\n // TableRebuild(def.id)\r\n // }\r\n // }\r\n // def.uiState.rebuild\r\n}\r\n\r\nexport type _CancelTableRowOptions = {\r\n formState?: SYSFormState\r\n promptIfDirty?: boolean\r\n}\r\n\r\nexport const _TableFormCloseEditRow = async (\r\n defId: SYSTableDefIds,\r\n key: string,\r\n options?: _CancelTableRowOptions\r\n) => {\r\n let data: SYSTableData = SYSConfig.app.tableDefIds[defId].getData(\r\n ovl.getState()\r\n )\r\n\r\n if (options?.formState) {\r\n let fn =\r\n ovl.getActions().app.features[options.formState.feature]?.hooks?.[\r\n HookFormBeforeCancel\r\n ]\r\n if (fn) {\r\n let hookRes: HookFormBeforeCancel_ReturnType = await fn(<\r\n HookFormBeforeCancel_Type\r\n >{\r\n formState: options.formState,\r\n })\r\n if (hookRes.resolve === \"Cancel\") {\r\n return\r\n }\r\n }\r\n if (options?.promptIfDirty) {\r\n if (FormIsDirty(options.formState)) {\r\n if ((await DialogOkCancel(T(\"SYSCancelForm\"))) === 2) {\r\n return\r\n }\r\n }\r\n }\r\n fn =\r\n ovl.getActions().app.features[options.formState.feature]?.hooks?.[\r\n HookFormAfterCancel\r\n ]\r\n if (fn) {\r\n await fn({\r\n formState: options.formState,\r\n })\r\n }\r\n\r\n DialogClose(\"SYSTableRowEdit\", { instance: `${defId}_${key}` })\r\n\r\n if (!options?.formState.forceKeepFormStateOnCancel) {\r\n setTimeout(() => {\r\n ovl.getActions().ovl.form._RemoveForm(options.formState)\r\n }, 200)\r\n }\r\n }\r\n let ovlSysState = data.data[key].OvlSysState as OvlSysColumn\r\n let rowState = ovlSysState.rowState\r\n if (rowState) {\r\n let isAdd = rowState.state === \"Add\"\r\n if (isAdd) {\r\n ovl.getActions().ovl.internal._TableDeleteRowFromData({\r\n key,\r\n def: data.tableDef[defId],\r\n data,\r\n })\r\n // // remove any save error feedback\r\n // delete ovlSysState.fnFeedback[\"OvlSaveRow\"]\r\n }\r\n }\r\n\r\n // this simply manages the edit sysOvlState\r\n ovl.getActions().ovl.table._TableEditClose({\r\n key,\r\n tableDef: data.tableDef[defId],\r\n data,\r\n })\r\n}\r\n\r\nexport type _SortTableByOptions = {\r\n order?: SortDirection\r\n isCustom?: boolean\r\n showProcess?: boolean\r\n useValue?: boolean\r\n}\r\n\r\nexport const TableGetTotalResult = (\r\n aggregateCode: string = undefined,\r\n tableDefId: SYSTableDefIds = undefined\r\n): _TableGroupAggregateResultType => {\r\n if (tableDefId === undefined) {\r\n tableDefId = _HookTableGroupDefId\r\n }\r\n if (aggregateCode === undefined) {\r\n aggregateCode = \"@@SYSTotal\"\r\n }\r\n return TableGetGroupValueTotalResult(\r\n aggregateCode,\r\n \"@@SYSTotal\",\r\n undefined,\r\n tableDefId\r\n )\r\n}\r\n\r\nexport const TableGetGroupTotalResult = (\r\n aggregateCode: string | undefined = undefined,\r\n groupCode: string | undefined = undefined,\r\n tableDefId: SYSTableDefIds = undefined\r\n): _TableGroupAggregateResultType => {\r\n if (tableDefId === undefined) {\r\n tableDefId = _HookTableGroupDefId\r\n }\r\n if (aggregateCode === undefined) {\r\n aggregateCode = \"@@SYSTotal\"\r\n }\r\n if (groupCode === undefined) {\r\n groupCode = \"@@SYSTotal\"\r\n }\r\n return TableGetGroupValueTotalResult(\r\n aggregateCode,\r\n \"@@SYSTotal\",\r\n undefined,\r\n tableDefId\r\n )\r\n}\r\n\r\nexport const TableGetGroupValueTotalResult = (\r\n aggregateCode: string | undefined,\r\n groupCode: string,\r\n groupValue: string,\r\n tableDefId: SYSTableDefIds = undefined\r\n): _TableGroupAggregateResultType => {\r\n if (tableDefId === undefined) {\r\n tableDefId = _HookTableGroupDefId\r\n }\r\n\r\n let tableDef: SYSTableDef = undefined\r\n tableDef = TableGet(tableDefId).dataDef.tableDef[tableDefId]\r\n let initresult = _TableGetGroupInitAggregateResult()\r\n\r\n if (tableDef.uiState.rebuild.needsRefresh) {\r\n return initresult\r\n }\r\n\r\n let tableGroupResults = tableDef.uiState.tableGroupResults\r\n\r\n if (aggregateCode === undefined) {\r\n aggregateCode = \"@@SYSTotal\"\r\n }\r\n\r\n if (!tableGroupResults[aggregateCode]) {\r\n // if the aggregate is not ready just return initresult\r\n return initresult\r\n }\r\n\r\n if (!tableGroupResults[aggregateCode][groupCode]) {\r\n // if the aggregate is not ready just return initresult\r\n return initresult\r\n }\r\n\r\n if (groupValue === undefined) {\r\n let results: _TableGroupAggregateResultType[] = []\r\n Object.keys(tableGroupResults[aggregateCode][groupCode]).forEach(\r\n (groupValue) => {\r\n results.push(tableGroupResults[aggregateCode][groupCode][groupValue])\r\n }\r\n )\r\n return results.reduce((val, result) => {\r\n let isString = typeof val.Sum === \"string\"\r\n if (val.Sum === undefined) {\r\n if (isString) {\r\n val.Sum = \"\"\r\n } else {\r\n val.Sum = 0\r\n }\r\n }\r\n val.Sum += result.Sum\r\n val.Count += result.Count\r\n if (result.Min < val.Min || val.Min === undefined) {\r\n val.Min = result.Min\r\n }\r\n if (result.Max > val.Max || val.Max === undefined) {\r\n val.Max = result.Max\r\n }\r\n if (!isString) {\r\n val.Avg = (val.Avg + result.Avg) / 2\r\n }\r\n return val\r\n }, initresult)\r\n } else {\r\n if (!tableGroupResults[aggregateCode][groupCode][groupValue]) {\r\n return initresult\r\n }\r\n return tableGroupResults[aggregateCode][groupCode][groupValue]\r\n }\r\n}\r\nexport const TableGetGroupResult = (\r\n aggregateCode: string | undefined,\r\n groupValue: string | string[],\r\n tableDefId: SYSTableDefIds = undefined\r\n): _TableGroupAggregateResultType => {\r\n if (tableDefId === undefined) {\r\n tableDefId = _HookTableGroupDefId\r\n }\r\n let tableDef: SYSTableDef = undefined\r\n tableDef = TableGet(tableDefId).dataDef.tableDef[tableDefId]\r\n let initresult = _TableGetGroupInitAggregateResult()\r\n if (tableDef.uiState.rebuild.needsRefresh) {\r\n return initresult\r\n }\r\n let tableGroupResults = tableDef.uiState.tableGroupResults\r\n if (aggregateCode === undefined) {\r\n aggregateCode = \"@@SYSTotal\"\r\n }\r\n if (!tableGroupResults[aggregateCode]) {\r\n // if the aggregate is not ready just return initresult\r\n return initresult\r\n }\r\n\r\n //now we have table defined\r\n\r\n //@@todo if a string of the group array in between is like \"@@SYSAll\" (or event the group as submitted is \"@@SYSAll\" then return array of results (user needs then to reduce (eg. sum) em all up)\r\n\r\n let groupLength = 2\r\n let groupValueKey\r\n let aggregateGroupKeys = tableDef.options.tableGroupAggregates.groups\r\n if (typeof groupValue === \"string\") {\r\n groupValueKey = `1${groupValue}`\r\n } else {\r\n groupValue = JSON.parse(JSON.stringify(groupValue))\r\n groupValue.unshift(\"1\")\r\n groupLength = groupValue.length\r\n groupValueKey = \"\".concat(...groupValue)\r\n }\r\n let groupKey = \"\"\r\n\r\n for (let z = 0; z < groupLength; z++) {\r\n let groupCode = aggregateGroupKeys[z].groupCode\r\n groupKey = `${groupKey}${groupCode}`\r\n }\r\n\r\n // it can be that the aggregate is initalised but no rows and therefore no groups are calculated\r\n if (!tableGroupResults[aggregateCode][groupKey]) {\r\n return initresult\r\n }\r\n if (!tableGroupResults[aggregateCode][groupKey][groupValueKey]) {\r\n return initresult\r\n }\r\n return tableGroupResults[aggregateCode][groupKey][groupValueKey]\r\n}\r\n\r\nexport type { SYSColumnDef, SYSTableDef } from \"../../library/table/table\"\r\nexport const TableStaticFilterGet = (\r\n tableDefId: SYSTableDefIds\r\n): { [key in keyof T]: any } => {\r\n return <{ [key in keyof T]: any }>(\r\n TableGet(tableDefId).def.uiState?.filter?.filter?.static\r\n )\r\n}\r\n\r\nexport const TableStaticFilterSetEntry = (\r\n tableDefId: SYSTableDefIds,\r\n filterKey: string,\r\n filterValue: any\r\n): { [key in keyof T]: any } => {\r\n let staticFilter = TableGet(tableDefId).def.uiState?.filter?.filter?.static\r\n staticFilter[filterKey] = filterValue\r\n return <{ [key in keyof T]: any }>staticFilter\r\n}\r\n\r\nexport const TableStaticFilterRemoveEntry = (\r\n tableDefId: SYSTableDefIds,\r\n filterKey: string\r\n): { [key in keyof T]: any } => {\r\n let staticFilter = TableGet(tableDefId).def.uiState?.filter?.filter?.static\r\n delete staticFilter[filterKey]\r\n return <{ [key in keyof T]: any }>staticFilter\r\n}\r\n\r\nexport const TableStaticFilterReset = (\r\n tableDefId: SYSTableDefIds\r\n): { [key in keyof T]: any } => {\r\n let table = TableGet(tableDefId)\r\n let staticFilter = table.def.uiState.filter.filter.static\r\n staticFilter = JSON.parse(\r\n JSON.stringify(table.def.options.initial_filter.static)\r\n )\r\n return <{ [key in keyof T]: any }>staticFilter\r\n}\r\n\r\nexport const TableFormGetControl = (\r\n field: SYSField,\r\n controlTypeFromTableDefId?: SYSTableDef,\r\n useControlType?: ControlType\r\n): TemplateResult => {\r\n let controlType: ControlType\r\n if (useControlType) {\r\n controlType = useControlType\r\n } else if (controlTypeFromTableDefId) {\r\n controlType = controlTypeFromTableDefId.columns[field.fieldKey].control\r\n } else {\r\n throw Error(\r\n \"ovl TableFormGetControl needs either: tableDefId or controltype param...\"\r\n )\r\n }\r\n let uiItem\r\n switch (controlType) {\r\n case \"text\":\r\n uiItem = html`\r\n field}>\r\n \r\n `\r\n break\r\n\r\n case \"date\":\r\n uiItem = html`\r\n field}>\r\n \r\n `\r\n break\r\n\r\n case \"time\":\r\n uiItem = html`\r\n field}>\r\n \r\n `\r\n break\r\n case \"datetime\":\r\n uiItem = html`\r\n field}\r\n >\r\n \r\n `\r\n break\r\n\r\n case \"textarea\":\r\n uiItem = html`\r\n field}>\r\n \r\n `\r\n break\r\n\r\n case \"list\":\r\n {\r\n uiItem = html`\r\n field}>\r\n \r\n `\r\n }\r\n break\r\n case \"option\":\r\n {\r\n uiItem = html` field}> `\r\n }\r\n break\r\n\r\n case \"asset\":\r\n {\r\n uiItem = html`\r\n field}> \r\n `\r\n }\r\n break\r\n\r\n case \"checkbox\":\r\n {\r\n uiItem = html`\r\n field}>\r\n \r\n `\r\n }\r\n break\r\n }\r\n return uiItem\r\n}\r\nexport const TableSchemaGet = async (\r\n defId: SYSTableDefIds\r\n): Promise<{ [key in keyof RowType]: Schema }> => {\r\n let table = TableGet(defId)\r\n let def = table.def\r\n if (\r\n (def.database?.useSchema === undefined || def.database.useSchema) &&\r\n table.dataDef.schema === undefined\r\n ) {\r\n try {\r\n // do it in a try catch if an endpoint is not prepared for that...\r\n table.dataDef.schema = (\r\n await Data(def.server.endpoint + \"/get\", {\r\n justSchema: true,\r\n getSchema: true,\r\n filter: {},\r\n data: {},\r\n })\r\n ).data.schema\r\n } catch (e) {\r\n // set it to empty so it doesn't retry all the time\r\n table.dataDef.schema = {}\r\n console.error(e)\r\n }\r\n\r\n let fn =\r\n ovl.getActions().app.features?.[def.feature]?.hooks?.[\r\n HookTableSchemaAssign\r\n ]\r\n if (fn) {\r\n if (table.dataDef.schema === undefined) {\r\n // we need a ref\r\n table.dataDef.schema = {}\r\n }\r\n await fn({\r\n tableDefId: defId,\r\n schemaToSet: table.dataDef.schema,\r\n })\r\n if (Object.keys(table.dataDef.schema).length < 1) {\r\n table.dataDef.schema = null\r\n }\r\n }\r\n\r\n if (table.dataDef.schema === undefined) {\r\n // endpoint does not provide schema\r\n // mark is a s null so it doesn't get retrieved anymore\r\n table.dataDef.schema = null\r\n }\r\n }\r\n return <{ [key in keyof RowType]: Schema }>table.dataDef.schema\r\n}\r\n\r\nexport const TableOpenColumnFilter = async (\r\n defId: SYSTableDefIds,\r\n columnKey: string,\r\n options?: { allowExclusive?: boolean }\r\n) => {\r\n let state = ovl.getState()\r\n state.ovl.libState.tableSettings.columnFilter = {\r\n columnKey,\r\n additionalColumnKey: \"\",\r\n defId,\r\n allowExclusive: options?.allowExclusive,\r\n }\r\n\r\n let table = TableGet(defId)\r\n // this needs to be set to undefined because its used as a cache and undefined resets it\r\n _BaseTableContextForColumnFilter.tableDef = undefined\r\n tblTableSettings_ColumnFilter.columns[\"Code\"].type =\r\n table.def.columns[columnKey].type\r\n // tblTableSettings_ColumnFilter.columns[\"Code\"].ui.labelTranslationKey =\r\n // this.tableDef.def.columns[this.columnKey].ui.labelTranslationKey\r\n tblTableSettings_ColumnFilter.columns[\"Free1\"].ui.visibility = \"None\"\r\n\r\n let filter = table.def.uiState.filter.columns[columnKey].columnFilter\r\n\r\n let additionalColumn = filter.additionalColumn\r\n if (additionalColumn) {\r\n state.ovl.libState.tableSettings.columnFilter.additionalColumnKey =\r\n additionalColumn\r\n tblTableSettings_ColumnFilter.columns[\"Free1\"].type =\r\n table.def.columns[additionalColumn].type\r\n tblTableSettings_ColumnFilter.columns[\"Free1\"].ui.visibility = \"Table\"\r\n // tblTableSettings_ColumnFilter.columns[\"Free1\"].ui.labelTranslationKey =\r\n // this.tableDef.def.columns[additionalColumn].ui.labelTranslationKey\r\n }\r\n\r\n //create filter source data\r\n let rows = table.rows\r\n let sort = 0\r\n let nullHandling = table.def.columns[columnKey].nullHandling.enabled\r\n\r\n let keys = _TableFilterFn({ def: table.def, data: table.dataDef }, columnKey)\r\n\r\n //let isCaluclated = table.def.columns[columnKey].schema?.isCalculatedColumn\r\n\r\n // add selected to keys\r\n let localData0 = keys.reduce(\r\n (val: { [key: string]: SYSTableSettings_ColumnFilter }, k) => {\r\n let code\r\n //if (isCaluclated) {\r\n code = GetRowRawValue(table.def, columnKey, rows[k], k, \"ColumnFilter\")\r\n // } else {\r\n // code = rows[k][columnKey]\r\n // }\r\n if (!nullHandling && code === null) {\r\n code = \"\"\r\n }\r\n if (val[code]) {\r\n val[code].Count++\r\n } else {\r\n sort++\r\n val[code] = {\r\n TableDefId: defId,\r\n Key: k,\r\n Code: code,\r\n Free1: additionalColumn ? rows[k][additionalColumn] : null,\r\n /*Selected: false,*/\r\n Count: 1,\r\n OriginalSort: sort,\r\n }\r\n }\r\n return val\r\n },\r\n {}\r\n )\r\n // make sure selected are always in list\r\n if (filter.list) {\r\n filter.list.forEach((k) => {\r\n if (rows[k] === undefined || localData0[k]) {\r\n return\r\n }\r\n let foundKey\r\n Object.keys(rows).some((f) => {\r\n let val = rows[f][columnKey]\r\n if (val === k || (!nullHandling && k === \"\" && val === null)) {\r\n foundKey = f\r\n }\r\n })\r\n\r\n localData0[k] = {\r\n TableDefId: defId,\r\n Key: foundKey,\r\n Code: k,\r\n Free1: additionalColumn ? rows[k][additionalColumn] : null,\r\n /*Selected: false,*/\r\n Count: 0,\r\n OriginalSort: 0,\r\n }\r\n })\r\n }\r\n\r\n let localData = Object.keys(localData0).map((k) => localData0[k])\r\n await TableRefresh(\"SYSTableSettings_ColumnFilter\", {\r\n localData,\r\n staticFilter: { TableDefId: defId },\r\n resetStrategy: { Selection: true },\r\n showSnack: false,\r\n })\r\n\r\n let td = TableGet(\r\n \"SYSTableSettings_ColumnFilter\"\r\n )\r\n // now set all the selected to true\r\n if (filter.list) {\r\n filter.list.forEach((k) => {\r\n /*localData0[k].Selected = true*/\r\n let localKey = td.getKeys({ byIdValue: k })[0]\r\n if (localKey !== undefined) {\r\n TableSelectRow(\"SYSTableSettings_ColumnFilter\", localKey, {\r\n mode: \"Select\",\r\n })\r\n }\r\n })\r\n }\r\n\r\n DialogOpen(\"SYSTableSettings_ColumnFilter\")\r\n}\r\n","let mostPreferedLanguage = globalThis.navigator.languages[0]\r\nif (mostPreferedLanguage === \"de\") {\r\n if ((1.1).toString().indexOf(\".\") > -1) {\r\n mostPreferedLanguage = \"de-ch\"\r\n }\r\n}\r\nif (mostPreferedLanguage.indexOf(\"-\") < 0) {\r\n mostPreferedLanguage = mostPreferedLanguage + \"-\" + mostPreferedLanguage\r\n}\r\nlet timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone\r\n\r\nconst date = new Date()\r\nconst formatter = new Intl.DateTimeFormat(mostPreferedLanguage, {\r\n day: \"numeric\",\r\n month: \"numeric\",\r\n})\r\nconst formattedParts = formatter.formatToParts(date)\r\nconst dayFirst = formattedParts[0].type === \"day\"\r\n\r\nexport let displayFormats = {\r\n dateSpecifics: { dayFirst },\r\n mostPreferedLanguage,\r\n decimal: {\r\n default: new Intl.NumberFormat(mostPreferedLanguage, {\r\n minimumFractionDigits: 2,\r\n maximumFractionDigits: 2,\r\n }),\r\n _4Digits: new Intl.NumberFormat(mostPreferedLanguage, {\r\n minimumFractionDigits: 4,\r\n maximumFractionDigits: 4,\r\n }),\r\n _3Digits: new Intl.NumberFormat(mostPreferedLanguage, {\r\n minimumFractionDigits: 3,\r\n maximumFractionDigits: 3,\r\n }),\r\n _0Digits: new Intl.NumberFormat(mostPreferedLanguage, {\r\n minimumFractionDigits: 0,\r\n maximumFractionDigits: 0,\r\n }),\r\n },\r\n int: {\r\n default: new Intl.NumberFormat(mostPreferedLanguage, {\r\n minimumIntegerDigits: 1,\r\n useGrouping: false,\r\n minimumFractionDigits: 0,\r\n }),\r\n _16DigitsInteger: new Intl.NumberFormat(mostPreferedLanguage, {\r\n minimumIntegerDigits: 4,\r\n useGrouping: false,\r\n minimumFractionDigits: 0,\r\n }),\r\n _8DigitsInteger: new Intl.NumberFormat(mostPreferedLanguage, {\r\n minimumIntegerDigits: 4,\r\n useGrouping: false,\r\n minimumFractionDigits: 0,\r\n }),\r\n _6DigitsInteger: new Intl.NumberFormat(mostPreferedLanguage, {\r\n minimumIntegerDigits: 4,\r\n useGrouping: false,\r\n minimumFractionDigits: 0,\r\n }),\r\n _5DigitsInteger: new Intl.NumberFormat(mostPreferedLanguage, {\r\n minimumIntegerDigits: 4,\r\n useGrouping: false,\r\n minimumFractionDigits: 0,\r\n }),\r\n _4DigitsInteger: new Intl.NumberFormat(mostPreferedLanguage, {\r\n minimumIntegerDigits: 4,\r\n useGrouping: false,\r\n minimumFractionDigits: 0,\r\n }),\r\n _3DigitsInteger: new Intl.NumberFormat(mostPreferedLanguage, {\r\n minimumIntegerDigits: 3,\r\n useGrouping: false,\r\n minimumFractionDigits: 0,\r\n }),\r\n _2DigitsInteger: new Intl.NumberFormat(mostPreferedLanguage, {\r\n minimumIntegerDigits: 2,\r\n useGrouping: false,\r\n minimumFractionDigits: 0,\r\n }),\r\n },\r\n\r\n date: {\r\n default: new Intl.DateTimeFormat(mostPreferedLanguage, {\r\n day: \"2-digit\",\r\n month: \"2-digit\",\r\n year: \"numeric\",\r\n }),\r\n _2DigitsYear: new Intl.DateTimeFormat(mostPreferedLanguage, {\r\n day: \"2-digit\",\r\n month: \"2-digit\",\r\n year: \"2-digit\",\r\n }),\r\n _4DigitsYear: new Intl.DateTimeFormat(mostPreferedLanguage, {\r\n day: \"2-digit\",\r\n month: \"2-digit\",\r\n year: \"numeric\",\r\n }),\r\n defaultTimestamp: new Intl.DateTimeFormat(mostPreferedLanguage, {\r\n day: \"2-digit\",\r\n month: \"2-digit\",\r\n year: \"2-digit\",\r\n hour: \"numeric\",\r\n minute: \"numeric\",\r\n second: \"numeric\",\r\n hour12: false,\r\n }),\r\n\r\n timestampWithoutSecond: new Intl.DateTimeFormat(mostPreferedLanguage, {\r\n day: \"2-digit\",\r\n month: \"2-digit\",\r\n year: \"2-digit\",\r\n hour: \"numeric\",\r\n minute: \"numeric\",\r\n hour12: false,\r\n }),\r\n },\r\n}\r\n","import {\r\n html,\r\n ovl,\r\n SYSConfig,\r\n SYSDialog,\r\n SYSFeature,\r\n SYSFeatures,\r\n SYSPermissions,\r\n SYSScreen,\r\n SYSState,\r\n TemplateResult,\r\n} from \"../\"\r\n\r\nimport type { FieldFormat } from \"../library/forms/sysformelement\"\r\nimport { _TableRowError } from \"../library/table/actions\"\r\nimport { TableSaveRow } from \"../library/table/tableapi\"\r\nimport { stateStore } from \"../offlinestorage\"\r\nimport type { PermissionSettings, SYSPermissionModifiers } from \"../state\"\r\nimport { _RenderTracking } from \"../tracker/tracker\"\r\nimport { Rehydrate } from \"./actions\"\r\nimport { displayFormats } from \"./displayformats\"\r\nimport { PermissionHas, SessionUpdate } from \"./globalapi\"\r\nimport { HookAppFileOpen, HookAppSaveState } from \"./hooks\"\r\n\r\n// we need those because Object keys are always strings and we want sometimes to have null as key\r\n// mind the space. it makes sure they are at the the top of the list if sorted\r\n//export const SYSNullKey = \"@@SYSNull\"\r\n\r\n// we need those because Object keys are always strings and we want sometimes to have null as key\r\n// mind the space. it makes sure they are at the the top of the list if sorted\r\n//export const SYSNullKey = \"@@SYSNull\"\r\nexport { _customElementList, displayFormats as DisplayFormats }\r\n\r\nexport let _globals = { lastValidFocusId: \"\", previousValidFocusId: \"\" }\r\n\r\n//export let modalDialog: GlobalModalDialogState = { text: undefined }\r\nexport let translationData = {}\r\n\r\nexport type SYSCustomElementListEntry = {\r\n tagName: string\r\n comp: any\r\n screen?: SYSScreen\r\n dialog?: SYSDialog\r\n}\r\nlet _customElementList: SYSCustomElementListEntry[] = []\r\nexport let _registerComponents = { _customElementList }\r\nexport const OvlAddComponent = (tagName: string, comp: any) => {\r\n _registerComponents._customElementList.push({ tagName, comp })\r\n}\r\nexport const OvlAddScreen = (comp: any, screen: SYSScreen) => {\r\n let tagName = `scn-${screen.toLowerCase()}`\r\n _registerComponents._customElementList.push({ tagName, comp, screen })\r\n}\r\n\r\nexport const OvlAddDialog = (comp: any, dialog: SYSDialog) => {\r\n let tagName = `dlg-${dialog.toLowerCase()}`\r\n _registerComponents._customElementList.push({\r\n tagName,\r\n comp,\r\n screen: undefined,\r\n dialog,\r\n })\r\n}\r\n\r\n// we keep in those a shortcut to ovl.getState().ovl.language...\r\n// to simplify tracking\r\nexport let languageRef\r\n\r\ntype GlobalModalDialogState = {\r\n text: string | TemplateResult\r\n}\r\n\r\nexport const _HasPermission = (\r\n permission: SYSPermissions,\r\n modifier?: SYSPermissionModifiers\r\n) => {\r\n let user = ovl.getState().ovl.user\r\n if (!permission /*|| user.role === \"Admin\"*/) {\r\n return true\r\n }\r\n\r\n let permissions = user.permissions\r\n if (!permissions) {\r\n // for compatibility reasons\r\n return true\r\n }\r\n\r\n // admin should always be able to access users/userroles/roles\r\n if (user.role === \"Admin\") {\r\n if (\r\n (permission === \"SYSUA\" || permission === \"SYSCA\") &&\r\n (!modifier || modifier === \"R\")\r\n ) {\r\n return true\r\n } else if (permission === \"SYSUR\" || permission === \"SYSRA\") {\r\n return true\r\n }\r\n }\r\n\r\n if (!permissions[permission]) {\r\n return false\r\n }\r\n if (!modifier) {\r\n return true\r\n }\r\n return !!permissions[permission].modifiers[modifier]\r\n}\r\n\r\nexport const _GetPermissionSettings = (\r\n permission: SYSPermissions\r\n): PermissionSettings => {\r\n let user = ovl.getState().ovl.user\r\n let permissions = user.permissions\r\n\r\n if (!permissions) {\r\n // for compatibility reasons\r\n return undefined\r\n }\r\n if (!permissions[permission]) {\r\n return undefined\r\n }\r\n\r\n return permissions[permission]\r\n}\r\n\r\nexport const getLocalTimestampString = (nd: Date): string => {\r\n var tzoffset = nd.getTimezoneOffset() * 60000 //offset in milliseconds\r\n return new Date(nd.getTime() - tzoffset).toISOString().slice(0, -1)\r\n}\r\n\r\nexport const getDateISOString = (date: Date): string => {\r\n return (\r\n date.getFullYear().toString() +\r\n \"-\" +\r\n (date.getMonth() + 1).toString().padStart(2, \"0\") +\r\n \"-\" +\r\n date.getDate().toString().padStart(2, \"0\") +\r\n \"T00:00:00\"\r\n )\r\n}\r\nexport const getOnlyDateISOString = (date: Date): string => {\r\n return (\r\n date.getFullYear().toString() +\r\n \"-\" +\r\n (date.getMonth() + 1).toString().padStart(2, \"0\") +\r\n \"-\" +\r\n date.getDate().toString().padStart(2, \"0\")\r\n )\r\n}\r\n\r\nexport const getOnlyDate = (date: Date): Date => {\r\n return new Date(date.getFullYear(), date.getMonth(), date.getDate())\r\n}\r\n\r\n//@ts-ignore\r\nlet SYSTimestamp = 0\r\nexport let SYSSaveState = { SYSTimestamp }\r\nlet uuidCounter = 0\r\nexport const SYSSeqId = () => {\r\n let appId = SYSConfig._system.appId\r\n let ticks = new Date().getTime().toString().padStart(19, \"0\")\r\n let userId = ovl.getState().ovl.user.userCode\r\n let userIdS = (userId !== undefined ? userId.toString() : \"\").padStart(6, \"0\")\r\n if (uuidCounter > 9999) {\r\n uuidCounter = 0\r\n }\r\n let counter = uuidCounter.toString().padStart(4, \"0\")\r\n uuidCounter++\r\n return `1${appId}${ticks}${userIdS}${counter}`\r\n}\r\n\r\nexport function isTouch() {\r\n return \"ontouchstart\" in window\r\n}\r\n\r\nlet _isMobile = undefined\r\nexport function isMobile() {\r\n if (_isMobile === undefined) {\r\n var check = false\r\n ;(function (a) {\r\n if (\r\n /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(\r\n a\r\n ) ||\r\n /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(\r\n a.substr(0, 4)\r\n )\r\n )\r\n check = true\r\n //@ts-ignore\r\n })(navigator.userAgent || navigator.vendor || window.opera)\r\n _isMobile = check\r\n }\r\n return _isMobile\r\n}\r\n\r\nlet _isIOS = undefined\r\ndeclare var window: any\r\nexport function isIOS() {\r\n if (_isIOS === undefined) {\r\n _isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream\r\n }\r\n return _isIOS\r\n}\r\n\r\nlet _isSafari = undefined\r\n\r\nexport const isSafari = () => {\r\n if (_isSafari === undefined) {\r\n _isSafari =\r\n navigator.userAgent.indexOf(\"Safari\") != -1 &&\r\n navigator.userAgent.indexOf(\"Chrome\") == -1\r\n }\r\n return _isSafari\r\n}\r\n\r\nlet _isFirefox = undefined\r\nexport const isFirefox = () => {\r\n if (_isFirefox === undefined) {\r\n _isFirefox = navigator.userAgent.toLowerCase().indexOf(\"firefox\") > -1\r\n }\r\n return _isFirefox\r\n}\r\n\r\nlet _hasOSReducedMotion\r\nexport function hasOSReducedMotion() {\r\n if (_hasOSReducedMotion === undefined) {\r\n const query = \"(prefers-reduced-motion: reduce)\"\r\n _hasOSReducedMotion = window.matchMedia(query).matches\r\n }\r\n return _hasOSReducedMotion\r\n}\r\n\r\nexport const getDateValue = (value: any, format?: FieldFormat) => {\r\n if (!value) {\r\n return \"\"\r\n }\r\n let fmt\r\n if (format) {\r\n switch (format) {\r\n case \"timestampWithoutSecond\":\r\n fmt = displayFormats.date.timestampWithoutSecond\r\n break\r\n\r\n case \"timestamp\":\r\n fmt = displayFormats.date.defaultTimestamp\r\n break\r\n case \"2digitsYear\":\r\n fmt = displayFormats.date._2DigitsYear\r\n break\r\n case \"4digitsYear\":\r\n fmt = displayFormats.date._4DigitsYear\r\n break\r\n }\r\n }\r\n if (!fmt) {\r\n if (isMobile()) {\r\n fmt = displayFormats.date._2DigitsYear\r\n } else {\r\n fmt = displayFormats.date.default\r\n }\r\n }\r\n let res\r\n if (typeof value.getMonth !== \"function\") {\r\n let dval = new Date(value)\r\n // value = value.split(\"/\").join(\"-\")\r\n // let dvals = value.split(\"-\")\r\n // let dval = new Date(\r\n // parseInt(dvals[0]),\r\n // parseInt(dvals[1]) - 1,\r\n // parseInt(dvals[2])\r\n // )\r\n\r\n res = fmt.format(dval)\r\n } else {\r\n res = fmt.format(value)\r\n }\r\n if (\r\n SYSConfig.global?.removeCommaFromTimestamp &&\r\n (format === \"timestampWithoutSecond\" || format === \"timestamp\")\r\n ) {\r\n let sdf = res.split(\",\")\r\n if (sdf.length === 2) {\r\n res = `${sdf[0]} ${sdf[1]}`\r\n }\r\n }\r\n return res\r\n}\r\nexport const getDecimalValue = (value: number, format?: FieldFormat) => {\r\n if (value === null || value === undefined) {\r\n return \"\"\r\n }\r\n let fmt = displayFormats.decimal.default\r\n\r\n if (format) {\r\n switch (format) {\r\n case \"4digits\":\r\n fmt = displayFormats.decimal._4Digits\r\n break\r\n case \"3digits\":\r\n fmt = displayFormats.decimal._3Digits\r\n break\r\n case \"0digits\":\r\n fmt = displayFormats.decimal._0Digits\r\n break\r\n }\r\n }\r\n return fmt.format(value)\r\n}\r\n\r\nexport const getIntegerValue = (value: number, format?: FieldFormat) => {\r\n if (value === null || value === undefined) {\r\n return \"\"\r\n }\r\n let fmt = displayFormats.int.default\r\n if (format) {\r\n switch (format) {\r\n case \"2digitsInteger\":\r\n fmt = displayFormats.int._2DigitsInteger\r\n break\r\n case \"3digitsInteger\":\r\n fmt = displayFormats.int._3DigitsInteger\r\n break\r\n case \"4digitsInteger\":\r\n fmt = displayFormats.int._4DigitsInteger\r\n break\r\n case \"5digitsInteger\":\r\n fmt = displayFormats.int._5DigitsInteger\r\n break\r\n case \"6digitsInteger\":\r\n fmt = displayFormats.int._6DigitsInteger\r\n break\r\n case \"8digitsInteger\":\r\n fmt = displayFormats.int._8DigitsInteger\r\n break\r\n case \"16digitsInteger\":\r\n fmt = displayFormats.int._16DigitsInteger\r\n break\r\n }\r\n }\r\n return fmt.format(value)\r\n}\r\n\r\n// convienience function for date values\r\nexport let D = (date: string) => {\r\n return getDateValue(date)\r\n}\r\nexport let D2 = (date: string) => {\r\n return getDateValue(date, \"2digitsYear\")\r\n}\r\n\r\nexport let TS1 = (date: string) => {\r\n return getDateValue(date, \"timestamp\")\r\n}\r\n\r\nexport let TS2 = (date: string) => {\r\n return getDateValue(date, \"timestampWithoutSecond\")\r\n}\r\n\r\n// convienience function for decimal values\r\nexport let N = (decimal: number) => {\r\n return getDecimalValue(decimal)\r\n}\r\n\r\nexport let N0 = (decimal: number) => {\r\n return getDecimalValue(decimal, \"0digits\")\r\n}\r\n\r\n// convienience function for decimal values\r\nexport let N4 = (decimal: number) => {\r\n return getDecimalValue(decimal, \"4digits\")\r\n}\r\n\r\nexport let I2 = (int: number) => {\r\n return getIntegerValue(int, \"2digitsInteger\")\r\n}\r\nexport let I3 = (int: number) => {\r\n return getIntegerValue(int, \"3digitsInteger\")\r\n}\r\nexport let I4 = (int: number) => {\r\n return getIntegerValue(int, \"4digitsInteger\")\r\n}\r\n\r\n// export const addGlobalPersistEventListeners = () => {\r\n// document.addEventListener(\"visibilitychange\", visibilityChange)\r\n// document.addEventListener(\"focusout\", (e) => focusOut(e))\r\n// }\r\n\r\n// export const focusOut = async (event) => {\r\n// if (SYSConfig.offline.enabled) {\r\n// if (!event.relatedTarget) {\r\n// await saveState(false, \"FocusOut\")\r\n// }\r\n// }\r\n// }\r\n\r\nexport const stringifyReplacer = (key, value) =>\r\n typeof value === \"undefined\" ? null : value\r\n\r\n// export const visibilityChange = async (event) => {\r\n// if (SYSConfig.offline.enabled) {\r\n// // console.log(document.visibilityState)\r\n// // fires when user switches tabs, apps, goes to homescreen, etc.\r\n// //@ts-ignore\r\n// if (\r\n// document.visibilityState === \"hidden\" ||\r\n// //@ts-ignore\r\n// document.visibilityState === \"unloaded\"\r\n// ) {\r\n// if (isIOS()) {\r\n// saveState(false, \"Visibility\")\r\n// } else {\r\n// await saveState(false, \"Visibility\")\r\n// }\r\n// }\r\n// }\r\n// if (isIOS() && document.visibilityState === \"visible\") {\r\n// // rehydrate state here on ios. eg. switching from standalone app to a downloaded doc and back needs to rehydrate on ios (not on android,chrome)\r\n// SnackAdd(\"REHYYYYDRAAATE\")\r\n// await ovl.getActions().ovl.internal._RehydrateApp()\r\n// }\r\n// }\r\n\r\nexport type UIContextType = {\r\n feature: string\r\n formType: string\r\n formId: any\r\n screen: string\r\n screenInstance: string\r\n}\r\n\r\nexport const rehydrateUserStateFromFile = async () => {\r\n const [fileHandle] = await window.showOpenFilePicker()\r\n\r\n const file = await fileHandle.getFile()\r\n const contents = await file.text()\r\n await Rehydrate(ovl.getActions(), undefined, undefined, contents)\r\n}\r\n\r\nexport const rehydrateUserState = async (\r\n id?: string,\r\n fn?: (state: SYSState) => {}\r\n) => {\r\n if (id === undefined) {\r\n id = \"\"\r\n }\r\n await Rehydrate(ovl.getActions(), id, fn)\r\n}\r\n\r\nexport const saveUserState = (id?: string) => {\r\n if (id === undefined) {\r\n id = \"\"\r\n }\r\n saveState(\"User\", id)\r\n}\r\n\r\nexport const saveState = async (reason: string, testId?: string) => {\r\n if (\r\n testId !== undefined ||\r\n (SYSConfig.offline.enabled && !logoutAndClearFlag)\r\n ) {\r\n //@ts-ignore\r\n\r\n let stateStoreId = SYSConfig._system.statePersistVersion.toString()\r\n if (testId !== undefined) {\r\n stateStoreId = `${stateStoreId}_User_${testId}`\r\n }\r\n console.log(\"save state to: \" + stateStoreId)\r\n // let refstate = ovl.getState()\r\n let newObj: SYSState = JSON.parse(\r\n JSON.stringify(ovl.getState()),\r\n stringifyReplacer\r\n )\r\n newObj.ovl.uiState.stateSavedReason = reason\r\n newObj.ovl.app.ready = false\r\n let dialogsState = newObj.ovl.dialogs\r\n Object.keys(dialogsState).forEach((f) => {\r\n Object.keys(dialogsState[f].instance).forEach((instance) => {\r\n if (dialogsState[f].instance[instance].visible) {\r\n if (\r\n dialogsState[f].instance?.[instance]?.modal === true ||\r\n dialogsState[f].rehydratable === false\r\n ) {\r\n dialogsState[f].instance[instance].visible = false\r\n }\r\n }\r\n })\r\n })\r\n // // clear out all processs isntances\r\n // let processState = newObj.ovl.longRunningProcessTracker\r\n // Object.keys(newObj.ovl.longRunningProcessTracker).forEach((k) => {\r\n // newObj.ovl.longRunningProcessTracker[k].instance = {}\r\n // })\r\n\r\n if (ovl.getActions().app.global.hooks?.[HookAppSaveState]) {\r\n ovl.getActions().app.global.hooks?.[HookAppSaveState](newObj)\r\n }\r\n return stateStore.set(stateStoreId, newObj)\r\n }\r\n}\r\nexport let logoutAndClearFlag = false\r\nexport let gotoFileFlag = false\r\n\r\nexport function IsComplexType(value) {\r\n return (\r\n (typeof value === \"object\" && value !== null) || typeof value === \"function\"\r\n )\r\n}\r\n\r\nexport const logout = async () => {\r\n //ovl.getActions().ovl.indicator.SetIndicatorOpen()\r\n if (SYSConfig.offline.enabled) {\r\n logoutAndClearFlag = true\r\n try {\r\n // 1. unregister sw\r\n let regs = await navigator.serviceWorker.getRegistrations()\r\n if (regs) {\r\n await Promise.all(regs.map(async (reg) => await reg.unregister()))\r\n }\r\n // // 2. get rid of any indexeddb state\r\n // await stateStore.clear()\r\n\r\n // 3. get rid of any cached static assets\r\n // this is no more necessary since serviceworker iutsel deletes the cache\r\n let cacheKeys = await caches.keys()\r\n await Promise.all(\r\n cacheKeys.map(async (cacheName) => await caches.delete(cacheName))\r\n )\r\n } catch (e) {}\r\n }\r\n\r\n await SessionUpdate(\"Token\", undefined)\r\n location.reload()\r\n //window.location.search = window.location.search.replace(\"ovlreset\", \"\")\r\n}\r\n\r\nexport const toggleDebugTracking = () => {\r\n if (SYSConfig._system.debugTracking) {\r\n SYSConfig._system.debugTracking = false\r\n console.log(\"Disabled Debug Tracking\")\r\n } else {\r\n SYSConfig._system.debugTracking = true\r\n console.log(\"Enabled Debug Tracking\")\r\n }\r\n}\r\n\r\nexport const logState = (logProxy: boolean) => {\r\n console.log(\"ovl state:\")\r\n if (logProxy) {\r\n console.log(ovl.getState())\r\n } else {\r\n console.log(JSON.parse(JSON.stringify(ovl.getState()), stringifyReplacer))\r\n }\r\n}\r\n\r\nexport const logRenderTracking = () => {\r\n console.log(\"ovl renderTracking:\")\r\n console.log(_RenderTracking)\r\n}\r\n\r\nexport const logFormValidationErrors = () => {\r\n console.log(\"todo...ovl forms having validation errors:\")\r\n // let forms = ovl.getState().ovl.forms\r\n // let res = []\r\n // Object.keys(forms).forEach((f) => {\r\n // let formInstance = forms[f]\r\n // Object.keys(formInstance).forEach((fi) => {\r\n // let formState: SYSFormState = forms[f][fi]\r\n\r\n // let fieldValidation = Object.keys(formState.fields)\r\n // .filter((f) => formState.fields[f].validationResult.length > 0)\r\n // .map((m) => {\r\n // let res: any = {}\r\n // res[formState.fields[m].fieldKey] = formState.fields[m]\r\n // res[\"errors\"] = formState.fields[m].validationResult\r\n // return res\r\n // })\r\n // if (formState.validationResult.visibleErrors.length > 0) {\r\n // res.push({\r\n // formtype: formState.formType,\r\n // formId: formState.formId,\r\n // formErrors: formState.validationResult.visibleErrors,\r\n // fieldErrors: fieldValidation,\r\n // })\r\n // }\r\n // })\r\n // })\r\n // console.log(JSON.parse(JSON.stringify(res, stringifyReplacer)))\r\n}\r\n\r\nexport const logActions = () => {\r\n console.log(\"ovl actions:\")\r\n console.log(ovl.getActions())\r\n}\r\n\r\nexport let focusIdNotFound = undefined\r\nexport const _SetFocus = (\r\n id: string,\r\n forceSelect?: boolean,\r\n preventScroll?: boolean\r\n): boolean => {\r\n let el: any = document.getElementById(id)\r\n if (document.activeElement === el) {\r\n return\r\n }\r\n if (el) {\r\n focusIdNotFound = undefined\r\n el.focus({\r\n preventScroll: preventScroll === true,\r\n })\r\n if (el.value) {\r\n if (el.setSelectionRange) {\r\n let val = el.value\r\n try {\r\n el.setSelectionRange(val.length, val.length)\r\n } catch {}\r\n }\r\n if (\r\n forceSelect === true ||\r\n (forceSelect === undefined &&\r\n el.classList.contains(\"ovl-focusselected\"))\r\n ) {\r\n try {\r\n el.select()\r\n } catch {}\r\n }\r\n }\r\n el = null\r\n return true\r\n } else {\r\n focusIdNotFound = id\r\n }\r\n return false\r\n}\r\n\r\nexport const _ShowFile = async (\r\n blob: any,\r\n mimeType: string = undefined,\r\n feature: SYSFeature = undefined,\r\n fileName: string = undefined,\r\n responseHeaders: any = undefined\r\n) => {\r\n if (responseHeaders) {\r\n if (!fileName) {\r\n // if no fileName provided get it from the contentdsipositionheader\r\n\r\n try {\r\n fileName = responseHeaders\r\n .get(\"content-disposition\")\r\n .split(\";\")[1]\r\n .split(\"=\")[1]\r\n .replace('\"', \"\")\r\n .replace('\"', \"\")\r\n } catch {}\r\n if (!mimeType) {\r\n mimeType = responseHeaders.get[\"content-type\"]\r\n }\r\n }\r\n }\r\n let fileOpenHook = ovl.getActions().app.global?.hooks?.[HookAppFileOpen]\r\n if (fileOpenHook) {\r\n await fileOpenHook({\r\n blob,\r\n mimeType,\r\n feature,\r\n fileName,\r\n responseHeaders,\r\n })\r\n } else {\r\n console.error(\"ovl config: HookAppFileOpen not defined\")\r\n // //@ts-ignore\r\n // window.URL = window.URL || window.webkitURL\r\n\r\n // let anchor = document.createElement(\"a\")\r\n // anchor.href = window.URL.createObjectURL(blob)\r\n\r\n // anchor.textContent = \"dummy\"\r\n // anchor.style.display = \"none\"\r\n // anchor.target = \"_blank\"\r\n // document.body.appendChild(anchor)\r\n // gotoFileFlag = true\r\n // anchor.click()\r\n // gotoFileFlag = false\r\n\r\n // if (anchor.download) {\r\n // SnackAdd(T(\"SYSFileDownloadFinished\"), \"Success\")\r\n // }\r\n // setTimeout(() => {\r\n // document.body.removeChild(anchor)\r\n // }, 3000)\r\n }\r\n}\r\n\r\nlet TCache = new Map()\r\nexport const ResetT = () => {\r\n TCache = new Map()\r\n}\r\nlet autoAdded = new Set()\r\nexport const T = (\r\n key: string,\r\n reps?: any[] | any,\r\n returnIfNotFound?: \"Key\" | \"Empty\"\r\n): any => {\r\n if (reps === undefined) {\r\n reps = []\r\n } else if (!Array.isArray(reps)) {\r\n reps = [reps]\r\n }\r\n reps = reps.map((m) => (m === undefined ? \"\" : m))\r\n if (SYSConfig.translation?.showOnlyKeys) {\r\n return `${key} ${reps.join(\",\")}`\r\n }\r\n try {\r\n if (key === undefined) {\r\n return undefined\r\n }\r\n reps.forEach((rep, i) => {\r\n if (rep !== undefined) {\r\n if (typeof rep !== \"string\") {\r\n if (rep === null) {\r\n reps[i] = \"\"\r\n }\r\n // else {\r\n // reps[i] = rep.toString()\r\n // }\r\n }\r\n }\r\n })\r\n\r\n let cacheKey = key\r\n if (reps) {\r\n cacheKey += reps.join()\r\n }\r\n let cacheRes = TCache.get(cacheKey)\r\n if (cacheRes !== undefined) {\r\n // make sure it gets always tracked...\r\n ovl.getState().ovl.language.translations[key]\r\n return cacheRes\r\n }\r\n\r\n // 1st pass\r\n let res = _T(key, reps, returnIfNotFound)\r\n // 2nd pass for links and eventually DataPoints {V.} later\r\n let tres = _SecondPassPlaceholders(res)\r\n\r\n if (tres.length > 0) {\r\n TCache.set(cacheKey, tres)\r\n return tres\r\n }\r\n\r\n return res\r\n } catch (e) {\r\n return e.toString().replace('\"Error:', \"\")\r\n }\r\n}\r\n\r\nconst _SecondPassPlaceholders = (res: string) => {\r\n let templates: TemplateResult[] = []\r\n if (res.indexOf(\"{L.\") > -1 || res.indexOf(\"{V.\") > -1) {\r\n // we need to return html templates for this because it contains V. or L. - Codes\r\n // just work through the res string from left to right and build up an array of Templates\r\n let startCharPos = 0\r\n\r\n while (true) {\r\n let endCharPos = res.indexOf(\"{\", startCharPos)\r\n if (endCharPos < 0) {\r\n break\r\n }\r\n templates.push(html`${res.substring(startCharPos, endCharPos)}`)\r\n startCharPos = endCharPos + 1\r\n endCharPos = res.indexOf(\"}\", startCharPos)\r\n let dynamicPart = res.substring(startCharPos, endCharPos)\r\n\r\n if (dynamicPart.startsWith(\"L.\")) {\r\n let key = dynamicPart.substring(2)\r\n let link = key.split(\"@@Ovl\")\r\n let link1 = link[0]\r\n let linkDesc = link1\r\n if (link.length > 1) {\r\n linkDesc = link[1]\r\n }\r\n let linkTemplate = html`${linkDesc}`\r\n templates.push(html`${linkTemplate}`)\r\n } else if (dynamicPart.startsWith(\"V.\")) {\r\n let key = dynamicPart.substring(2)\r\n templates.push(html`${resolvePath(ovl.getState(), key)}`)\r\n }\r\n startCharPos = endCharPos + 1\r\n }\r\n }\r\n return templates\r\n}\r\n\r\nconst _T = (\r\n key: string,\r\n reps?: string[],\r\n returnIfNotFound?: \"Key\" | \"Empty\"\r\n): any => {\r\n if (!languageRef) {\r\n languageRef = ovl.getState().ovl.language\r\n }\r\n // for tracking\r\n // because when used cached T we still need tracking\r\n languageRef.translations\r\n languageRef.language\r\n\r\n // check for mobile key and use translation for mobile users to get shorter translations if applicable (key_M)\r\n if (isMobile()) {\r\n let mobileKey = key + \"_M\"\r\n if (languageRef.translations[mobileKey] !== undefined) {\r\n key = mobileKey\r\n }\r\n }\r\n let cacheKey = key\r\n if (reps) {\r\n cacheKey += reps.join()\r\n }\r\n let cacheRes = TCache.get(cacheKey)\r\n if (cacheRes !== undefined) {\r\n return cacheRes\r\n }\r\n let str = languageRef.translations[key]\r\n if (str === undefined || str === null) {\r\n if (returnIfNotFound === \"Empty\") {\r\n return \"\"\r\n } else if (returnIfNotFound === \"Key\") {\r\n return key\r\n }\r\n\r\n console.log(`SYS Warning: Translation Key ${key} not found!`)\r\n if (\r\n SYSConfig._system.isDev &&\r\n SYSConfig._system.autoAddMissingTranslationsInDevMode &&\r\n !ovl.getState().ovl.app.offline.api &&\r\n ovl.getState().ovl.app.ready &&\r\n PermissionHas(\"SYSTR\", \"A\")\r\n ) {\r\n // some logic to check with part of the key should go in group and which to code\r\n // (the texts need to be adjusted then anyway)\r\n let possibleGroupKeys = Object.keys(ovl.getActions().app.features)\r\n let foundKeys = possibleGroupKeys.filter((f) => key.indexOf(f) > -1)\r\n let group = \"\"\r\n let code = \"\"\r\n if (foundKeys.length > 0) {\r\n let startIndex = key.indexOf(foundKeys[0])\r\n let endIndex = startIndex + foundKeys[0].length\r\n group = key.substring(0, endIndex)\r\n code = key.replace(group, \"\")\r\n if (!code) {\r\n group = key.substring(0, endIndex / 2)\r\n code = key.replace(group, \"\")\r\n }\r\n } else {\r\n let res = _splitCamelCaseWithAbbreviations(key)\r\n if (res.length > 5) {\r\n let to = Math.floor(key.length / 2)\r\n group = key.substring(0, to)\r\n code = key.substring(to, key.length)\r\n } else {\r\n if (res.length > 3) {\r\n group = res[0]\r\n res.splice(0, 1)\r\n group = group + res[0]\r\n res.splice(0, 1)\r\n } else {\r\n group = res[0]\r\n res.splice(0, 1)\r\n }\r\n\r\n code = res.join(\"\")\r\n }\r\n }\r\n if (code && group && !autoAdded.has(`${group}${code}`)) {\r\n autoAdded.add(`${group}${code}`)\r\n let row = { U_TransGroup: group, U_TransCode: code }\r\n ovl.getState().ovl.language.availableTranslations.forEach((l) => {\r\n row[`U_${l}`] = `SYSAutoAdded_${code}`\r\n })\r\n setTimeout(async () => {\r\n //@ts-ignore\r\n try {\r\n await TableSaveRow(\"SYSTranslation\", row)\r\n } catch (error) {\r\n let err: _TableRowError = error\r\n // in this context its always add\r\n // so just remove the row in client\r\n err.handled(true)\r\n }\r\n }, 0)\r\n }\r\n }\r\n return key\r\n }\r\n if (str.split(\"{\").length !== str.split(\"}\").length) {\r\n return str + \" invalid{}\"\r\n }\r\n let hashRes = new Set()\r\n try {\r\n str\r\n .split(\"{\")\r\n .filter((f) => f.indexOf(\"}\") > -1)\r\n .map((m) => m.substring(0, m.indexOf(\"}\")))\r\n .forEach((s) => {\r\n hashRes.add(s)\r\n })\r\n hashRes.forEach((s: string) => {\r\n let key: string = \"\"\r\n if (s.startsWith(\"T.\")) {\r\n // its a translation itself eg. {T.AppMandatoryHint}\r\n key = s.substring(2)\r\n //console.log(\"found translation key: \" + key)\r\n str = str.split(\"{\" + s + \"}\").join(_T(key, reps))\r\n } /* skip V and L, they are handled in second pass */ else if (\r\n s.startsWith(\"L.\") ||\r\n s.startsWith(\"V.\")\r\n ) {\r\n } else {\r\n // needs to be a {0}, or {1}, ....\r\n // so use the replaces array parameter\r\n let idx = parseInt(s)\r\n if (!isNaN(idx)) {\r\n let rep = \"\"\r\n if (reps && idx < reps.length) {\r\n rep = reps[idx]\r\n }\r\n str = str.split(\"{\" + s + \"}\").join(rep)\r\n }\r\n }\r\n })\r\n TCache.set(cacheKey, str)\r\n return str\r\n //}\r\n } catch (e) {\r\n console.error(e)\r\n throw Error(`\"${e} in translation string: ${str}`)\r\n }\r\n}\r\n\r\nfunction _splitCamelCaseWithAbbreviations(s) {\r\n return s.split(/([A-Z][a-z]+)/).filter(function (e) {\r\n return e\r\n })\r\n}\r\n\r\nexport const enableBodyScroll = (force?: boolean) => {\r\n let el = document.getElementsByTagName(\"body\")[0]\r\n if (el.scrollHeight > window.innerHeight || force) {\r\n if (isMobile()) {\r\n el.classList.remove(\"ovl-body-noscroll-mobile\")\r\n } else {\r\n el.classList.remove(\"ovl-body-noscroll\")\r\n }\r\n\r\n el.classList.add(\"ovl-body-scroll\")\r\n }\r\n}\r\n\r\nexport const disableBodyScroll = (force?: boolean) => {\r\n let el = document.getElementsByTagName(\"body\")[0]\r\n\r\n if (el.scrollHeight > window.innerHeight || force) {\r\n el.classList.remove(\"ovl-body-scroll\")\r\n\r\n if (isMobile()) {\r\n el.classList.add(\"ovl-body-noscroll-mobile\")\r\n } else {\r\n el.classList.add(\"ovl-body-noscroll\")\r\n }\r\n }\r\n}\r\n\r\nexport const resolvePath = (object, path, defaultValue?) => {\r\n return path.split(\".\").reduce((o, p) => (o ? o[p] : defaultValue), object)\r\n}\r\n\r\nexport type Translation = {\r\n [key: string]: string\r\n}\r\n\r\nexport const _SetFeatureInfo = (\r\n userId: number,\r\n feature: SYSFeatures,\r\n Text1: string,\r\n Text2: string,\r\n Text3: string,\r\n Json1: string,\r\n Val1: number,\r\n Val2: number\r\n) => {\r\n let usersstate = ovl.getState().ovl.users\r\n if (!usersstate[userId]) {\r\n //@ts-ignore\r\n usersstate[userId] = { features: {} }\r\n }\r\n let userfeaturestate = usersstate[userId].features\r\n userfeaturestate[feature] = {\r\n Code: feature,\r\n Text1,\r\n Text2,\r\n Text3,\r\n Json1,\r\n Val1,\r\n Val2,\r\n RoleDesc: \"\",\r\n }\r\n}\r\n\r\nexport const _DeleteFeatureInfo = (userId: number, feature: SYSFeatures) => {\r\n let usersstate = ovl.getState().ovl.users\r\n if (usersstate[userId]?.features?.[feature] !== undefined) {\r\n delete usersstate[userId]?.features?.[feature]\r\n }\r\n}\r\n","import type {\r\n DirectiveResult,\r\n SYSFeatures,\r\n SYSLongRunningProcess,\r\n TemplateResult,\r\n} from \"../../\"\r\nimport {\r\n SYSFormValidationValidators,\r\n html,\r\n ifDefined,\r\n repeat,\r\n unsafeHTML,\r\n} from \"../../\"\r\nimport { T, getDateValue, isMobile } from \"../../global/globals\"\r\nimport {\r\n HookFieldGetLabelRender,\r\n HookTHGroupGetLabelRender,\r\n HookTHGroupGetLabelRender_ReturnType,\r\n HookTHGroupGetLabelRender_Type,\r\n HookTableClicked,\r\n // HookTableCustomFilterDescription,\r\n // HookTableCustomFilterDescription_ReturnType,\r\n // HookTableCustomFilterDescription_Type,\r\n HookTableCustomTitle,\r\n HookTableDragDrop,\r\n HookTableDragDrop_Type,\r\n HookTablePrepareFn,\r\n HookTableRenderingAfterRender,\r\n HookTableRenderingFirstUpdated,\r\n HookTableRenderingUpdated,\r\n HookViewHeaderCellClass,\r\n} from \"../../global/hooks\"\r\n\r\nimport type {\r\n HookFieldGetLabelRender_Type,\r\n HookFieldGetList_ReturnType,\r\n HookTableClicked_Type,\r\n HookTableCustomTitle_Type,\r\n HookTablePrepareFn_ReturnType,\r\n HookTablePrepareFn_Type,\r\n HookTableRenderingAfterRender_Type,\r\n HookTableRenderingFirstUpdated_Type,\r\n HookTableRenderingUpdated_Type,\r\n HookViewHeaderCellClass_ReturnType,\r\n HookViewHeaderCellClass_Type,\r\n RowFnConfirmContentFieldsReset_Type,\r\n ServerData_ChangedType,\r\n TableRowFnProcessFeedbackFull_Type,\r\n TableRowFnProcessRawFeedbackSummaryCount_Type,\r\n _HookTableClickedExecutionToSetType,\r\n _TableGroupColumnsToSetType,\r\n} from \"../../global/hooks\"\r\n\r\nimport type {\r\n SYSDialog,\r\n SYSEditor,\r\n SYSFeature,\r\n SYSPermissions,\r\n SYSTableDefIds,\r\n} from \"../../index\"\r\nimport { SYSConfig } from \"../../index\"\r\n\r\nimport type { ListState } from \"../forms/controls/listcontrol\"\r\nimport type {\r\n DataType,\r\n FieldFormat,\r\n FieldSchema,\r\n LookupColumnDef,\r\n SYSFormField,\r\n Schema,\r\n _ClientConversion,\r\n} from \"../forms/sysformelement\"\r\nimport { SYSBaseElement } from \"../sysbaseelement\"\r\nimport {\r\n CachedRendererData,\r\n GetRendererFn,\r\n GetRowDisplayValue,\r\n _GetAlign,\r\n _GetFilterSortDifferentiator,\r\n _GetFilterSortMainDifferentiator,\r\n _GetTableDialogTitle,\r\n rowControlActionsHandler,\r\n} from \"./helpers\"\r\n\r\nimport { Data } from \"../../dataapi\"\r\nimport type { SYSPermissionModifiers } from \"../../state\"\r\nimport { DialogCurrent, DialogOk } from \"../dialog/dialogapi\"\r\nimport { DialogType } from \"../dialog/sysdialogbase\"\r\nimport { ScreenCurrentState } from \"../screenapi\"\r\nimport { TableInitResetStrategy } from \"./actions\"\r\nimport type { NavDef } from \"./navcontrol\"\r\nimport type { TableRowDef } from \"./rowwrapper\"\r\nimport { _TableDefSelectRow, TableGet, TableSelectRow } from \"./tableapi\"\r\nimport { _FilterSortChanged } from \"./tablerowheadermenu/tablesettings/helpers\"\r\nimport { AppDefTableDefId } from \"../../config\"\r\n\r\nexport type DragDropEventType = \"dragover\" | \"dragstart\" | \"drop\"\r\n\r\nexport type RowState = \"Add\" | \"Update\" | \"Ok\"\r\n\r\nexport type SaveMode = \"add\" | \"update\"\r\n\r\nexport type DisplayMode =\r\n | \"Table\"\r\n | \"ColumnFilter\"\r\n | \"Detailview\"\r\n | \"Editor\"\r\n | \"DialogTitle\"\r\n | \"HeaderMenu\"\r\nexport type EditDisplayMode = \"Edit\" | \"EditInline\"\r\n\r\nexport type RowFunctionResultToSet = {\r\n // input = id from db table... returns rowKey\r\n setSuccess?: (\r\n id: string,\r\n text?: string | TemplateResult | DirectiveResult,\r\n code?: string,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) => string\r\n setWarning?: (\r\n id: string,\r\n text?: string | TemplateResult | DirectiveResult,\r\n code?: string,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) => string\r\n setInformation?: (\r\n id: string,\r\n text?: string | TemplateResult | DirectiveResult,\r\n code?: string,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) => string\r\n\r\n setError?: (\r\n id: string,\r\n text?: string | TemplateResult | DirectiveResult,\r\n code?: string,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) => string\r\n setFromResult?: (\r\n result: TableRowFnProcessFeedbackFull_Type\r\n ) => Promise\r\n}\r\n\r\nexport type SortDirection = \"asc\" | \"desc\"\r\n\r\nexport type SYSTableData = {\r\n data?: { [key: string]: T }\r\n hasMoreDataOnServer?: boolean\r\n schema?: { [key: string]: Schema }\r\n checkForOtherModification?: boolean\r\n clientConversion?: _ClientConversion\r\n tableDef: { [key: string]: SYSTableDef }\r\n timestamp?: number\r\n offline?: {\r\n addedKeys: { [key: string]: number }\r\n updatedKeys: { [key: string]: { columns: {}; timestamp: number } }\r\n deletedKeys: {}\r\n errors: {}\r\n offlineHandlerInProcess: boolean\r\n }\r\n offlineSeq?: number\r\n index?: {}\r\n lookups?: { [key in string]: ListDefinition }\r\n // to place random data in the same call as TableRefresh(..)\r\n ext?: any\r\n}\r\n\r\nexport type TableDataAndDef = {\r\n def: SYSTableDef\r\n data: SYSTableData\r\n}\r\n\r\nexport type TableProps = {\r\n def: SYSTableDef\r\n data: SYSTableData\r\n}\r\n\r\nexport type ViewRowClassType = {\r\n className?: string\r\n tooltip?: string\r\n draggable?: boolean\r\n}\r\n\r\nexport type StaticFilter = {\r\n [key: string]: any\r\n}\r\n\r\nexport type _TableGroupAggregateResultType = {\r\n Sum: any\r\n Count: number\r\n Min: any\r\n Max: any\r\n Avg: number\r\n LastRowKey: string\r\n}\r\n\r\nexport const _TableGetGroupInitAggregateResult =\r\n (): _TableGroupAggregateResultType => {\r\n return {\r\n Count: 0,\r\n Sum: undefined,\r\n Min: undefined,\r\n Max: undefined,\r\n Avg: 0,\r\n LastRowKey: undefined,\r\n }\r\n }\r\n\r\nexport const _TableGroupCalcAggregate = (\r\n currentResult: _TableGroupAggregateResultType,\r\n currentVal: any,\r\n rowKey: string\r\n): _TableGroupAggregateResultType => {\r\n let isString = typeof currentVal === \"string\"\r\n let count = currentResult.Count + 1\r\n\r\n if (currentResult.Sum === undefined) {\r\n if (isString) {\r\n currentResult.Sum = \"\"\r\n } else {\r\n currentResult.Sum = 0\r\n }\r\n }\r\n let sum = currentResult.Sum + currentVal\r\n let min\r\n if (currentVal < currentResult.Min || currentResult.Min === undefined) {\r\n min = currentVal\r\n }\r\n let max\r\n if (currentVal > currentResult.Max || currentResult.Max === undefined) {\r\n max = currentVal\r\n }\r\n let avg\r\n if (!isString) {\r\n avg = sum / count\r\n }\r\n return {\r\n Count: count,\r\n Sum: sum,\r\n Min: min,\r\n Max: max,\r\n Avg: avg,\r\n LastRowKey: rowKey,\r\n }\r\n}\r\n\r\nexport type RowFnTrackingInterval =\r\n | \"None\"\r\n | \"Every2Secs\"\r\n | \"Every5Secs\"\r\n | \"Every10Secs\"\r\n | \"Every20Secs\"\r\n\r\nexport type RowControlAction = {\r\n mode?: \"Hidden\" | \"Row\" | \"Table\"\r\n\r\n visibleOnColumns?: string[] | \"All\"\r\n\r\n fnKey?: string\r\n translationKey?: string\r\n icon?: string\r\n visualGroup?: string\r\n process?: \"None\" | SYSLongRunningProcess\r\n trackData?: RowFnTrackingInterval\r\n prompt?: {\r\n // OnlyWhenConfirmHookFound = Usecase OvlCopy (Normally no prompt but there should be the possibility to cancel a copy)\r\n type?: \"None\" | \"WhenMulti\" | \"Always\" | \"WhenMultiOrHookResult\"\r\n connectedForm?: {\r\n formFields: { [key: string]: SYSFormField }\r\n fieldsResetType: RowFnConfirmContentFieldsReset_Type\r\n }\r\n }\r\n endpoint?: {\r\n url: string\r\n }\r\n blocking?: {\r\n group: \"edit\" | \"view\"\r\n serverBlock?: boolean\r\n }\r\n handleFeedback?: boolean\r\n summary?: \"None\" | \"Snack\" | \"DialogAlways\" | \"DialogIfMultiple\"\r\n whenMultiple?: {\r\n callForEveryRow: boolean\r\n optionalPositionTranslationCode?: string\r\n grouped?: {\r\n byColumn: string\r\n }\r\n }\r\n permission?: SYSPermissions\r\n permissionModifier?: SYSPermissionModifiers\r\n role?: SYSFeatures\r\n}\r\n\r\nexport type OvlSysColumn = {\r\n editRow?: SelectedEditRow\r\n rowState?: {\r\n state: RowState\r\n originalId: any\r\n lastChangeBelongsToTableDefId: string\r\n }\r\n fnFeedback?: { [key: string]: TableRowFnProcessFeedbackFull_Type }\r\n lastFeedbackTS?: number\r\n}\r\n\r\nexport type ColumnAction = {\r\n fnKey: string\r\n translationKey?: string\r\n icon?: string\r\n rowFnProcess?: string\r\n}\r\n\r\nexport type SelectedRow = {\r\n selected: boolean\r\n count: number\r\n showNav: boolean\r\n}\r\n\r\nexport type EditMode = \"edit\" | \"copy\" | \"add\"\r\n\r\nexport type SelectedEditRow = {\r\n selected: boolean\r\n mode: EditMode\r\n // when duplicating contains the source key\r\n fromKey?: string\r\n}\r\n\r\nexport type SelectedViewRow = {\r\n selected: boolean\r\n}\r\n\r\nexport type TableRowDetailViewMode = \"None\" | \"Enabled\" | \"EnabledOnlyMobile\"\r\n\r\n// a group is just a key followed by a Result object (Which should be type casted by the user because we can save SumX,AvgY, ... on it)\r\n// to setup calculations we need a HookTableGroup_%_Aggregate Hook defined which does the calc\r\n// the result gets saved in result where key is the Expression Value\r\n// for every key there is expected to be a HookTableGroup_%_Expression Hook which determines the Value and lastValue and see if it changes\r\n// it also sets a Key Object so we can quickly check on every row which Group was changed\r\n// depending if there are hooks HookTableGroup_%_HeaderDisplay resp. a HookTableGroup_%_FooterDisplay a sep Summary row can be displayed\r\n\r\nexport type GroupBreakType = {\r\n groupValue: string\r\n}\r\n\r\ntype TableGroupAggregate = {\r\n disabled?: boolean\r\n // objects of array because we could add more features in aggregates like (e.g. NeedsSum, NeedsMin to optimize calc time)\r\n // and in the groups maybe a enabled true/false\r\n aggregates?: { aggregateCode: string }[]\r\n groups?: { groupCode: string; respectInSort?: \"ForceGroup\" }[]\r\n\r\n onlyApplyWhenColumnSortStartsWith?: string[]\r\n onlyApplyWhenCustomSort?: string[]\r\n}\r\n\r\nexport type _ColumnFnDefType = {\r\n // dynamically displays menuentry in headerform\r\n\r\n // each group will hav its own \r\n ${this.offeringToolAdminState.activeTab === \"target\"\r\n ? html` \r\n \"QUTOffering\"}\r\n >\r\n \r\n `\r\n : null}\r\n ${this.offeringToolAdminState.activeTab === \"actual\"\r\n ? html` \r\n \"QUTOfferingActual\"}\r\n >\r\n \r\n `\r\n : null}\r\n \r\n ${calcOrders}\r\n \r\n \r\n `\r\n }\r\n}\r\n","import type { SYSTableDefIds } from \"../../../../../../../_ovlclient/src\"\r\nimport { html } from \"../../../../../../../_ovlclient/src\"\r\nimport { DialogOpen } from \"../../../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport { FormHandlingType } from \"../../../../../../../_ovlclient/src/library/dialog/sysdialogbase\"\r\nimport { FieldVal } from \"../../../../../../../_ovlclient/src/library/forms/fieldapi\"\r\nimport {\r\n FormGet,\r\n FormInit,\r\n FormIsValid,\r\n} from \"../../../../../../../_ovlclient/src/library/forms/formapi\"\r\nimport { SYSBaseElement } from \"../../../../../../../_ovlclient/src/library/sysbaseelement\"\r\nimport { TableGet } from \"../../../../../../../_ovlclient/src/library/table/tableapi\"\r\nimport { T } from \"../../../../../../../_ovlclient/src/textapi\"\r\nimport { BPFilterFields } from \"../../../components/bpfilter/formdef\"\r\nimport { EditLocked, OpenTableUploadEdit } from \"./helpers\"\r\n\r\nexport class ScreenOfferingAdminCut extends SYSBaseElement {\r\n offeringToolState: typeof this.state.app.features.QUTOffering\r\n\r\n async init() {\r\n this.offeringToolState = this.state.app.features.QUTOffering\r\n await super.init()\r\n }\r\n openAdminUpload = async () => {\r\n // if opened from here its always a new table\r\n // still we need to contact server for the schema\r\n let tb = TableGet(\"QUTOfferingPos\")\r\n await tb.refresh({\r\n localData: [],\r\n staticFilter: { U_DocEntry: -1 },\r\n resetStrategy: { ClearData: true },\r\n })\r\n await FormInit(\r\n \"SYSEdit\",\r\n {\r\n SYSEdit_Commission: {\r\n type: \"text\",\r\n schema: { nullable: false },\r\n ui: { labelTranslationKey: \"GENCommission\" },\r\n },\r\n CardCode: {\r\n type: \"text\",\r\n value: FieldVal(FormGet(\"QUTBPFilter\").fields[\"CardCode\"]),\r\n ui: { visible: \"false\", fillSpaceIfNotVisible: false },\r\n },\r\n CntctCode: {\r\n type: \"text\",\r\n list: {\r\n displayField: \"CntctName\",\r\n valueField: \"CntctCode\",\r\n displayValueField: false,\r\n mode: \"List\",\r\n serverEndpoint: \"offering/bp_contacts\",\r\n onlyRefreshFromServerIfOlderThanMs: 10000,\r\n tryGetLookupFromServerInFormInitIfNotFound: true,\r\n },\r\n schema: { nullable: false },\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingCntctName\",\r\n },\r\n },\r\n },\r\n {\r\n feature: \"QUTOfferingPos\",\r\n formId: \"QUTOfferingPos\",\r\n forceOverwrite: true,\r\n }\r\n )\r\n this.state.app.features.QUTOffering.cutListDirty = false\r\n this.state.app.features.QUTOffering.cutFileName = \"\"\r\n DialogOpen(\"QUTOfferingPos\")\r\n }\r\n\r\n async getUI() {\r\n let uploadDisabled = EditLocked()\r\n let uploadHtml = html`\r\n
\r\n await this.openAdminUpload()}\r\n id=\"asset_browse_button1\"\r\n class=\"fd-button\"\r\n aria-label=\"file auswählen\"\r\n >\r\n ${T(\"QUTOfferingOfferingNewOffer\")}\r\n \r\n \r\n
\r\n `\r\n BPFilterFields.CardCode.value = this.state.ovl.user.cardCode\r\n return html`\r\n
\r\n
\r\n
\r\n

\r\n ${T(\"QUTOfferingOfferingAdminCut\")}\r\n

\r\n
\r\n
\r\n

\r\n ${T(\"QUTOfferingOfferingAdminSelectCustomer\")}\r\n

\r\n {\r\n formType: \"QUTBPFilter\",\r\n autoInit: true,\r\n creation: {\r\n autoInitFormFields: BPFilterFields,\r\n },\r\n }}\r\n >\r\n ${uploadHtml}\r\n
\r\n
\r\n\r\n
\r\n \"QUTOffering\"}\r\n >\r\n \r\n
\r\n
\r\n `\r\n }\r\n}\r\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,i=t.trustedTypes,s=i?i.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,e=\"$lit$\",h=`lit$${(Math.random()+\"\").slice(9)}$`,o=\"?\"+h,n=`<${o}>`,r=document,l=()=>r.createComment(\"\"),c=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,a=Array.isArray,u=t=>a(t)||\"function\"==typeof t?.[Symbol.iterator],d=\"[ \\t\\n\\f\\r]\",f=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\\\s\"'>=/]+)(${d}*=${d}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),p=/'/g,g=/\"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),w=Symbol.for(\"lit-noChange\"),T=Symbol.for(\"lit-nothing\"),A=new WeakMap,E=r.createTreeWalker(r,129);function C(t,i){if(!Array.isArray(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==s?s.createHTML(i):i}const P=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?\"\":\"\",c=f;for(let i=0;i\"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'\"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith(\"/>\")?\" \":\"\";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x)}return[C(t,l+(t[s]||\"\")+(2===i?\"\":\"\")),o]};class V{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=P(t,s);if(this.el=V.createElement(f,n),E.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=E.nextNode())&&d.length0){r.textContent=i?i.emptyScript:\"\";for(let i=0;i2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=T}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=N(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==w,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new M(i.insertBefore(l(),t),t,void 0,s??{})}return h._$AI(t),h};export{z as _$LH,x as html,w as noChange,T as nothing,j as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","import { TemplateResult, html } from \"lit-html\"\r\n\r\nimport { DialogParts, SYSBaseDialog } from \"./sysdialogbase\"\r\nimport { DialogClose, DialogHolderParams } from \"./dialogapi\"\r\nimport { SYSBaseElement, SYSDialog } from \"../../index\"\r\nimport { DialogGetParts } from \"./sysdialogholder\"\r\nimport { SYSDialogBase } from \"./sysdialog2base\"\r\n\r\nexport const DialogGet = async (\r\n dialogComp: SYSBaseElement,\r\n dialogParts: DialogGetParts\r\n): Promise => {\r\n if (!dialogParts.instance) {\r\n dialogParts.instance = dialogComp.dialogInstance\r\n }\r\n const defaultKeyHandler = (e: KeyboardEvent) => {\r\n if (e.key === \"Escape\") {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n if (dialogParts.closeOnDismiss) {\r\n DialogClose(dialogComp.dialog, { instance: dialogParts.instance })\r\n } else if (dialogParts.dismissedCallbackFn) {\r\n dialogParts.dismissedCallbackFn()\r\n }\r\n }\r\n }\r\n\r\n // now put together the template\r\n\r\n let handleTopLevelClick = (e: Event) => {\r\n //e.stopImmediatePropagation()\r\n e.stopPropagation()\r\n //e.preventDefault()\r\n if (dialogParts.emptySpaceClickHandlerFn) {\r\n dialogParts.emptySpaceClickHandlerFn(e)\r\n }\r\n }\r\n ;(dialogComp).dialogHolderParams = {\r\n dialogParts: dialogParts,\r\n dialogType: dialogComp.dialog,\r\n instance: dialogParts.instance,\r\n }\r\n let handleDismiss = (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n if (dialogParts.closeOnDismiss) {\r\n DialogClose(dialogComp.dialog, { instance: dialogParts.instance })\r\n } else if (dialogParts.dismissedCallbackFn) {\r\n dialogParts.dismissedCallbackFn()\r\n }\r\n }\r\n let keyHandler = defaultKeyHandler\r\n if (dialogParts.keyHandlerFn) {\r\n keyHandler = dialogParts.keyHandlerFn\r\n }\r\n\r\n let fullheader\r\n\r\n let dtitle\r\n if (dialogParts.title) {\r\n dtitle = await dialogParts.title()\r\n }\r\n let dheader\r\n if (dialogParts.header) {\r\n dheader = await dialogParts.header()\r\n }\r\n\r\n if (dheader || dtitle) {\r\n let title\r\n if (dtitle) {\r\n title = html`\r\n
\r\n

${dtitle}

\r\n
\r\n `\r\n }\r\n let header\r\n if (dheader) {\r\n title = html`
${dheader}
`\r\n }\r\n let iconname: string = `message-${dialogParts.type}`\r\n switch (dialogParts.type) {\r\n case \"confirmation\":\r\n iconname = \"question-mark\"\r\n }\r\n\r\n fullheader = html`\r\n
\r\n
\r\n ${header} ${title}\r\n
\r\n
\r\n `\r\n }\r\n let body\r\n\r\n let dbody = await dialogParts.body()\r\n\r\n if (dbody) {\r\n body = html`
\r\n ${dbody}\r\n
`\r\n }\r\n\r\n let footer\r\n let dfooter = await dialogParts.footer()\r\n if (dfooter) {\r\n footer = html`\r\n
${dfooter}
\r\n `\r\n }\r\n let customClass = \"\"\r\n if (dialogParts.customClass) {\r\n customClass = dialogParts.customClass()\r\n }\r\n let typeClass = \"\"\r\n if (dialogParts.type) {\r\n typeClass = \"fd-message-box--\" + dialogParts.type\r\n }\r\n\r\n typeClass = `${typeClass} ovl_dlg_z_index_${dialogComp.zIndex}`\r\n\r\n return html` {\r\n if (e.which === 1) handleDismiss(e)\r\n }}\r\n >\r\n {\r\n if (e.which === 1) {\r\n e.stopPropagation()\r\n }\r\n }}\r\n @click=${handleTopLevelClick}\r\n @keyup=${keyHandler}\r\n id=${`ovl-dialog-${dialogComp.dialog}-${dialogParts.instance}`}\r\n >\r\n ${fullheader} ${body} ${footer}\r\n \r\n `\r\n}\r\n","import {\r\n currentScreenAndDialog,\r\n SYSBaseElement,\r\n SYSDialog,\r\n TemplateResult,\r\n} from \"../..\"\r\nimport { FocusSet } from \"../../global/globalapi\"\r\nimport type { DialogType } from \"./sysdialogbase\"\r\nimport { SYSBaseDialog } from \"./sysdialogbase\"\r\n\r\nexport type DialogGetParts = {\r\n header?: () =>\r\n | TemplateResult\r\n | TemplateResult[]\r\n | Promise\r\n | Promise\r\n title?: () => any\r\n body?: () =>\r\n | TemplateResult\r\n | TemplateResult[]\r\n | Promise\r\n | Promise\r\n footer?: () =>\r\n | TemplateResult\r\n | TemplateResult[]\r\n | Promise\r\n | Promise\r\n keyHandlerFn?: any\r\n closedCallbackFn?: any\r\n dismissedCallbackFn?: any\r\n closeOnDismiss?: boolean\r\n emptySpaceClickHandlerFn?: any\r\n updatedHandlerFn?: any\r\n afterRenderHandlerFn?: any\r\n type?: DialogType\r\n instance?: any\r\n customClass?: () => string\r\n}\r\n\r\nexport type _DialogHolderParams = {\r\n dialogParts: DialogGetParts\r\n dialogType: SYSDialog\r\n instance?: any\r\n}\r\nexport class SYSDialogBase extends SYSBaseElement {\r\n dialogHolderParams: _DialogHolderParams\r\n async updated() {\r\n if (this.dialogHolderParams.dialogParts.updatedHandlerFn) {\r\n this.dialogHolderParams.dialogParts.updatedHandlerFn()\r\n }\r\n let dialog = currentScreenAndDialog.dialogFocusSet.dialog\r\n let instance = currentScreenAndDialog.dialogFocusSet.instance\r\n if (dialog && dialog === this.dialog && instance === this.dialogInstance) {\r\n currentScreenAndDialog.dialogFocusSet.dialog = undefined\r\n let id = `ovl-dialog-${dialog}-${instance}`\r\n FocusSet(id, {\r\n ignoreIfAlreadySetOnScreenOrDialog: true,\r\n })\r\n }\r\n await super.updated()\r\n }\r\n\r\n async afterRender() {\r\n if (this.dialogHolderParams.dialogParts.afterRenderHandlerFn) {\r\n await this.dialogHolderParams.dialogParts.afterRenderHandlerFn()\r\n }\r\n await super.afterRender()\r\n }\r\n}\r\n","import {\r\n SYSTableDefIds,\r\n html,\r\n ovl,\r\n} from \"../../../../../../../../../_ovlclient/src\"\r\nimport { Data } from \"../../../../../../../../../_ovlclient/src/dataapi\"\r\nimport { FileGet } from \"../../../../../../../../../_ovlclient/src/global/globalapi\"\r\nimport {\r\n DialogClose,\r\n DialogOkCancel,\r\n} from \"../../../../../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport { DialogGet } from \"../../../../../../../../../_ovlclient/src/library/dialog/helpers\"\r\nimport { SYSDialogBase } from \"../../../../../../../../../_ovlclient/src/library/dialog/sysdialog2base\"\r\nimport { SYSBaseDialog } from \"../../../../../../../../../_ovlclient/src/library/dialog/sysdialogbase\"\r\nimport { DialogGetParts } from \"../../../../../../../../../_ovlclient/src/library/dialog/sysdialogholder\"\r\nimport {\r\n FieldSetFocus,\r\n FieldSetVal,\r\n FieldVal,\r\n} from \"../../../../../../../../../_ovlclient/src/library/forms/fieldapi\"\r\nimport {\r\n FormGet,\r\n FormIsValid,\r\n FormRemove,\r\n} from \"../../../../../../../../../_ovlclient/src/library/forms/formapi\"\r\nimport {\r\n ProcessEnd,\r\n ProcessIsRunning,\r\n ProcessStart,\r\n} from \"../../../../../../../../../_ovlclient/src/library/longrunningprocesstracker/processapi\"\r\nimport { ScreenCurrent } from \"../../../../../../../../../_ovlclient/src/library/screenapi\"\r\nimport { _GetOvlSysColDefault } from \"../../../../../../../../../_ovlclient/src/library/table/actions\"\r\nimport { OvlSysColumn } from \"../../../../../../../../../_ovlclient/src/library/table/table\"\r\nimport { TableGet } from \"../../../../../../../../../_ovlclient/src/library/table/tableapi\"\r\nimport { T } from \"../../../../../../../../../_ovlclient/src/textapi\"\r\nimport { OfferingMainRefresh } from \"../../../../../screens/qutoffering/offering/helpers\"\r\n\r\nexport class CompDialogQUTOfferingPos extends SYSDialogBase {\r\n async getUI() {\r\n let tb = TableGet(\"QUTOfferingPos\")\r\n let rowsCount = tb.def.uiState.rowsCount\r\n let commissionValid = FormIsValid(\r\n FormGet(\"SYSEdit\", { instance: \"QUTOfferingPos\" }).formState\r\n )\r\n\r\n let currentEditsCount = Object.keys(tb.rows).filter(\r\n (f) => (tb.rows[f].OvlSysState as OvlSysColumn).editRow.selected\r\n ).length\r\n\r\n let isNew = ScreenCurrent() !== \"QUTOfferingDetails\"\r\n let cntct\r\n if (ScreenCurrent() === \"QUTOfferingAdminCut\") {\r\n cntct = html`\r\n FormGet(\"SYSEdit\", { instance: \"QUTOfferingPos\" }).fields[\r\n \"CntctCode\"\r\n ]}\r\n >`\r\n }\r\n\r\n let dialogParts: DialogGetParts = {\r\n dismissedCallbackFn: () => {\r\n return\r\n },\r\n title: () => html`
\r\n
Zuschnitt: Positionen
\r\n   \r\n {\r\n e.preventDefault()\r\n FileGet({\r\n cat: \"OfferingToolDocPDF\",\r\n id1: \"CUT\",\r\n })\r\n }}\r\n >\r\n \r\n ${T(\"QUTOfferingOfferingManual\")}\r\n \r\n
`,\r\n body: () => html`\r\n FormGet(\"SYSEdit\", { instance: \"QUTOfferingPos\" }).fields[\r\n \"SYSEdit_Commission\"\r\n ]}\r\n >\r\n ${cntct}\r\n \"QUTOfferingPos\"}\r\n >\r\n `,\r\n footer: () => {\r\n let startOfferDisabled =\r\n ProcessIsRunning(\"GENRefreshData\") ||\r\n !commissionValid ||\r\n rowsCount < 1 ||\r\n currentEditsCount > 0\r\n\r\n let createOrApplyButton\r\n if (isNew) {\r\n createOrApplyButton = html`\r\n {\r\n try {\r\n ProcessStart(\"GENRefreshData\")\r\n let positions0 = JSON.parse(JSON.stringify(tb.rows))\r\n // convert posid to string to match the backend initcutoffer endpoint type\r\n let positions = []\r\n Object.keys(positions0).forEach((k) => {\r\n positions0[k].U_PosId = positions0[k].U_PosId.toString()\r\n positions.push(positions0[k])\r\n })\r\n let commission = FieldVal(\r\n FormGet(\"SYSEdit\", {\r\n instance: \"QUTOfferingPos\",\r\n }).fields[\"SYSEdit_Commission\"]\r\n )\r\n let cntctCode\r\n let cardCode\r\n if (ScreenCurrent() === \"QUTOfferingAdminCut\") {\r\n cntctCode = FieldVal(\r\n FormGet(\"SYSEdit\", {\r\n instance: \"QUTOfferingPos\",\r\n }).fields[\"CntctCode\"]\r\n )\r\n cardCode = FieldVal(\r\n FormGet(\"QUTBPFilter\").fields[\"CardCode\"]\r\n )\r\n }\r\n var res = await Data(\"offeringpos/initcutoffer\", {\r\n positions,\r\n commission,\r\n cntctCode,\r\n cardCode,\r\n fileName: this.state.app.features.QUTOffering.cutFileName,\r\n })\r\n let docEntry = res.data\r\n\r\n if (docEntry) {\r\n await OfferingMainRefresh(\r\n ovl.getState(),\r\n\r\n docEntry,\r\n ScreenCurrent()\r\n )\r\n\r\n Data(\"offering/recalc\", { docEntry })\r\n DialogClose(\"QUTOfferingPos\")\r\n }\r\n } finally {\r\n ProcessEnd(\"GENRefreshData\")\r\n }\r\n }}\r\n id=\"start_offer\"\r\n class=\"fd-button\"\r\n >\r\n ${T(\"QUTOfferingPosStartOffer\")}\r\n \r\n \r\n `\r\n } else {\r\n // we are in \"Apply Mode\"\r\n createOrApplyButton = html`\r\n {\r\n if (tb.staticFilterGet()[\"U_DocEntry\"] === -1) {\r\n ProcessStart(\"GENRefreshData\")\r\n try {\r\n let docEntry =\r\n TableGet(\"QUTOffering\").rows[\r\n this.state.app.features.QUTOffering.selectedOfferKey\r\n ][\"DocEntry\"]\r\n\r\n // it was a excel loaded freshly\r\n // we need to bulk update the pos on the server\r\n let positions0 = JSON.parse(JSON.stringify(tb.rows))\r\n // convert posid to string to match the backend initcutoffer endpoint type\r\n let positions = []\r\n Object.keys(positions0).forEach((k) => {\r\n positions0[k].U_PosId = positions0[k].U_PosId.toString()\r\n\r\n positions0[k].U_DocEntry = docEntry\r\n positions.push(positions0[k])\r\n })\r\n let commission = FieldVal(\r\n FormGet(\"SYSEdit\", {\r\n instance: \"QUTOfferingPos\",\r\n }).fields[\"SYSEdit_Commission\"]\r\n )\r\n let cntctCode\r\n let cardCode\r\n if (ScreenCurrent() === \"QUTOfferingAdminCut\") {\r\n cntctCode = FieldVal(\r\n FormGet(\"SYSEdit\", {\r\n instance: \"QUTOfferingPos\",\r\n }).fields[\"CntctCode\"]\r\n )\r\n cardCode = FieldVal(\r\n FormGet(\"QUTBPFilter\").fields[\"CardCode\"]\r\n )\r\n }\r\n await Data(\"offeringpos/initcutoffer\", {\r\n positions,\r\n commission,\r\n cntctCode,\r\n cardCode,\r\n fileName: this.state.app.features.QUTOffering.cutFileName,\r\n docEntry,\r\n })\r\n } finally {\r\n ProcessEnd(\"GENRefreshData\")\r\n }\r\n }\r\n\r\n this.state.app.features.QUTOffering.detailsChanged =\r\n this.state.app.features.QUTOffering.selectedOfferKey\r\n this.state.app.features.QUTOffering.cutPositionsChanged = true\r\n TableGet(\"QUTOfferingMaterial\").init({\r\n resetStrategy: { ClearData: true },\r\n })\r\n DialogClose(\"QUTOfferingPos\")\r\n }}\r\n id=\"start_offer\"\r\n class=\"fd-button\"\r\n >\r\n ${T(\"QUTOfferingPosApplyPos\")}\r\n \r\n \r\n `\r\n }\r\n\r\n return html`\r\n {\r\n return {\r\n defId: \"QUTOfferingPos\",\r\n }\r\n }}\r\n >\r\n    \r\n {\r\n FileGet({\r\n cat: \"OfferingPosCutTemplate\",\r\n })\r\n }}\r\n id=\"dl_template\"\r\n class=\"fd-button\"\r\n >\r\n ${T(\"QUTOfferingPosDownloadTemplate\")}\r\n \r\n \r\n\r\n    \r\n {\r\n if (\r\n TableGet(\"QUTOfferingPos\").def.uiState.rowsCount > 0 &&\r\n (await DialogOkCancel(T(\"QUTOfferingPosLoadFromExcel\"))) === 2\r\n ) {\r\n return\r\n }\r\n let browseFileEl = (\r\n document.getElementById(\"offering-newfile\")\r\n )\r\n let acceptExtensions = \".xlsx\"\r\n browseFileEl.setAttribute(\"accept\", acceptExtensions)\r\n browseFileEl.value = \"\"\r\n browseFileEl.click()\r\n }}\r\n id=\"asset_browse_button1\"\r\n class=\"fd-button\"\r\n aria-label=\"file auswählen\"\r\n >\r\n ${T(\"QUTOfferingPosUpload\")}\r\n \r\n \r\n\r\n \r\n {\r\n ProcessStart(\"GENRefreshData\")\r\n try {\r\n var formData = new FormData()\r\n formData.append(\"File\", e.target.files[0])\r\n let res = await Data(\"offeringpos/uploadpos\", formData, {\r\n isFormData: true,\r\n })\r\n FieldSetVal(\r\n FormGet(\"SYSEdit\", { instance: \"QUTOfferingPos\" }).fields[\r\n \"SYSEdit_Commission\"\r\n ],\r\n res.data.commission\r\n )\r\n this.state.app.features.QUTOffering.cutFileName =\r\n res.data.fileName\r\n await tb.refresh({\r\n localData: res.data.res.map((r) => {\r\n r.U_DocEntry = -1\r\n return r\r\n }),\r\n staticFilter: { U_DocEntry: -1 },\r\n resetStrategy: { ClearData: true },\r\n })\r\n let allFormStates = await Promise.all(\r\n tb.getKeys().map((k) => {\r\n return tb.formStateInitForRowKey(k)\r\n })\r\n )\r\n\r\n await Promise.all(\r\n allFormStates.map(async (formState) => {\r\n if (!FormIsValid(formState)) {\r\n return tb.formEditRow(formState.tableRowKey, {\r\n forceInline: true,\r\n })\r\n } else {\r\n // we are not interested in the formstate so just remove it\r\n tb.formRemoveRowFormState(formState.tableRowKey)\r\n }\r\n })\r\n )\r\n this.state.app.features.QUTOffering.cutListDirty = true\r\n } finally {\r\n ProcessEnd(\"GENRefreshData\")\r\n }\r\n }}\r\n }\r\n type=\"file\"\r\n />\r\n     ${createOrApplyButton}    \r\n {\r\n if (\r\n !this.state.app.features.QUTOffering.cutListDirty ||\r\n (await DialogOkCancel(\r\n T(\"QUTOfferingPosCloseDialogConfirm\")\r\n )) === 1\r\n ) {\r\n DialogClose(this.dialog)\r\n }\r\n }}\r\n id=\"ovl_row_save_cancel${this.id}\"\r\n title=\"${T(\"SYSCancel\")}\"\r\n class=\"fd-button fd-button--negative\"\r\n >\r\n \r\n \r\n `\r\n },\r\n }\r\n return await DialogGet(this, dialogParts)\r\n }\r\n async firstUpdated() {\r\n FieldSetFocus(\r\n FormGet(\"SYSEdit\", {\r\n instance: \"QUTOfferingPos\",\r\n }).fields[\"SYSEdit_Commission\"]\r\n )\r\n }\r\n}\r\n","import { html, SYSBaseElement } from \"../../../../../../../_ovlclient/src\"\r\nimport { TableFormEditRow } from \"../../../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nimport { T } from \"../../../../../../../_ovlclient/src/textapi\"\r\nimport { GetCadAttribute } from \"./helpers\"\r\n\r\nexport type SettingsFormState = {}\r\n\r\nexport class CompOfferingSettings extends SYSBaseElement {\r\n async getUI() {\r\n let handleEdit = () => {\r\n TableFormEditRow(\r\n \"QUTOfferingSettings\",\r\n Object.keys(\r\n this.state.app.global.QUT.tables.QUTOfferingSettings.data\r\n )[0]\r\n )\r\n }\r\n let userSettings = this.state.app.global.GEN.user\r\n\r\n return html`\r\n
\r\n
\r\n
\r\n
\r\n

\r\n ${T(\"QUTOfferingOfferingSettings\")}\r\n

\r\n
\r\n
\r\n\r\n
\r\n ${T(\"QUTOfferingOfferingCadHint\", [\r\n GetCadAttribute(),\r\n userSettings.offeringCadVal,\r\n ])}\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n `\r\n }\r\n}\r\n","import {\r\n OvlAddComponent,\r\n OvlAddDialog,\r\n OvlAddScreen,\r\n} from \"../../../../../../_ovlclient/src/global/globals\"\r\nimport { ScreenOfferingDetails } from \"../../screens/qutoffering/offering/details/offeringdetails\"\r\nimport { ScreenOffering } from \"../../screens/qutoffering/offering/offering\"\r\nimport { ScreenOfferingAdmin } from \"../../screens/qutoffering/offering/offeringadmin\"\r\nimport { ScreenOfferingAdminCut } from \"../../screens/qutoffering/offering/offeringadmincut\"\r\nimport { CompDialogQUTOfferingPos } from \"./offering/cut/poslist/poslist\"\r\nimport { CompOfferingSettings } from \"./offeringsettings/offeringsettings\"\r\n\r\nexport const QUTOffering_Init = () => {\r\n OvlAddComponent(\"comp-offeringsettings\", CompOfferingSettings)\r\n OvlAddDialog(CompDialogQUTOfferingPos, \"QUTOfferingPos\")\r\n OvlAddScreen(ScreenOffering, \"QUTOffering\")\r\n OvlAddScreen(ScreenOfferingAdmin, \"QUTOfferingAdmin\")\r\n OvlAddScreen(ScreenOfferingAdminCut, \"QUTOfferingAdminCut\")\r\n OvlAddScreen(ScreenOfferingDetails, \"QUTOfferingDetails\")\r\n}\r\n","import { html, SYSBaseElement } from \"../../../../../../_ovlclient/src\"\r\nimport type { SYSTableDefIds } from \"../../../../../../_ovlclient/src\"\r\nimport { T } from \"../../../../../../_ovlclient/src/textapi\"\r\nexport class ScreenSymbolPC extends SYSBaseElement {\r\n async getUI() {\r\n return html`\r\n
\r\n
\r\n
\r\n

${T(\"SPCSymbolPCAdmin\")}

\r\n
\r\n
\r\n\r\n \r\n \"SPCSymbolPC\"}\r\n >\r\n \r\n
\r\n \r\n `\r\n }\r\n}\r\n","import {\r\n html,\r\n SYSBaseElement,\r\n unsafeHTML,\r\n} from \"../../../../../../_ovlclient/src\"\r\nimport type { SYSTableDefIds } from \"../../../../../../_ovlclient/src\"\r\nimport { FileGet } from \"../../../../../../_ovlclient/src/global/globalapi\"\r\nimport { TableFormAddRow } from \"../../../../../../_ovlclient/src/library/table/tableapi\"\r\nimport { T } from \"../../../../../../_ovlclient/src/textapi\"\r\nexport class ScreenSymbolPCEndUser extends SYSBaseElement {\r\n accepted: boolean\r\n async getUI() {\r\n let filesDL\r\n if (this.accepted) {\r\n filesDL = html` {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n await FileGet({\r\n cat: \"SPCSymbolPCInstaller\",\r\n })\r\n }}\r\n href=\"#\"\r\n class=\"fd-link fd-link--emphasized\"\r\n tabindex=\"0\"\r\n >${T(\"SPCSymbolPCUserDownloadInstallerTitle\")}\r\n     \r\n {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n await FileGet({\r\n cat: \"SPCSymbolPCEditor\",\r\n })\r\n }}\r\n href=\"#\"\r\n class=\"fd-link fd-link--emphasized\"\r\n tabindex=\"0\"\r\n >${T(\"SPCSymbolPCUserDownloadEditorTitle\")}`\r\n }\r\n return html`\r\n
\r\n
\r\n
\r\n

\r\n ${T(\"SPCSymbolPCUserTitle\")}\r\n

\r\n
\r\n
\r\n\r\n \r\n {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n await FileGet({\r\n cat: \"SPCSymbolPCManualPDF\",\r\n desc: `kpik_manual_${this.state.ovl.session.Language.toLowerCase()}.pdf`,\r\n })\r\n }}\r\n >${T(\"SPCSymbolPCUserDownloadManualTitle\")}\r\n\r\n ${unsafeHTML(T(\"SPCSymbolPCUserHintImportantBeforeDownload\"))}\r\n\r\n
\r\n {\r\n if (!this.accepted) {\r\n this.accepted = !this.accepted\r\n this.doRender()\r\n } else {\r\n e.preventDefault()\r\n }\r\n }}\r\n />\r\n \r\n
\r\n
\r\n ${filesDL}\r\n
\r\n
\r\n \"SPCSymbolPCEndUser\"}\r\n >\r\n \r\n
\r\n \r\n `\r\n }\r\n}\r\n\r\n// Drucker hinzufügen Funktionalität für Enduser. Vorerst deaktiviert da Kalt AG im Prozess den Drucker schon hinzufügt\r\n/* {\r\n e.preventDefault()\r\n await TableFormAddRow(\"SPCSymbolPCEndUser\")\r\n }}\r\n href=\"#\"\r\n class=\"fd-link fd-link--emphasized\"\r\n tabindex=\"0\"\r\n >${T(\"SPCSymbolPCUserAddPrinter\")}\r\n*/\r\n","import { OvlAddScreen } from \"../../../../../../_ovlclient/src/global/globals\"\r\nimport { ScreenSymbolPC } from \"../../screens/spcsymbolpc/symbolpc\"\r\nimport { ScreenSymbolPCEndUser } from \"../../screens/spcsymbolpcenduser/symbolpcenduser\"\r\n\r\nexport const SPCSymbolPC_Init = () => {\r\n OvlAddScreen(ScreenSymbolPC, \"SPCSymbolPC\")\r\n OvlAddScreen(ScreenSymbolPCEndUser, \"SPCSymbolPCEndUser\")\r\n}\r\n","import { html, SYSBaseElement } from \"../../../../_ovlclient/src\"\r\nimport type { SYSTableDefIds } from \"../../../../_ovlclient/src\"\r\nimport { T } from \"../../../../_ovlclient/src/textapi\"\r\n\r\nexport class ScreenSYSAudit extends SYSBaseElement {\r\n async getUI() {\r\n return html`\r\n
\r\n \r\n \"SYSAudit\"}\r\n >\r\n \r\n
\r\n \r\n `\r\n }\r\n}\r\n","import { OvlAddScreen } from \"../../../_ovlclient/src/global/globals\"\r\nimport { ScreenSYSAudit } from \"./screens/audit\"\r\n\r\nexport const SYSAudit_Init = () => {\r\n OvlAddScreen(ScreenSYSAudit, \"SYSAudit\")\r\n}\r\n","import { html } from \"lit-html\"\r\nimport { DialogGet } from \"./helpers\"\r\nimport { SYSDialogBase } from \"./sysdialog2base\"\r\nimport { DialogGetParts } from \"./sysdialogholder\"\r\nimport { FieldVal, SYSField } from \"../forms/fieldapi\"\r\nimport { SYSFormState } from \"../forms/formapi\"\r\nimport { SYSTableData } from \"../table/table\"\r\nimport { TableGet } from \"../table/tableapi\"\r\nimport { DialogClose, DialogOkCancel } from \"./dialogapi\"\r\nimport { FormBodyRenderer } from \"../table/helpers\"\r\nimport { SYSState } from \"../..\"\r\nimport { T } from \"../../textapi\"\r\nimport { SYSOkCancelDeleteFooterType } from \"../forms/controls/parts/okcanceldeletefooter\"\r\nimport {\r\n HookFormEditorCancel,\r\n HookFormEditorDelete,\r\n HookFormEditorSave,\r\n} from \"../../global/hooks\"\r\n\r\nexport class SYSEditorDialogBase extends SYSDialogBase {\r\n sourceField: SYSField\r\n parentForm: SYSFormState\r\n parentTableDef: SYSTableData\r\n\r\n saveHook: any\r\n deleteHook: any\r\n cancelHook: any\r\n\r\n async init() {\r\n this.formId = this.dialogInstance\r\n this.formState = this.state.ovl.forms[this.formType][this.formId]\r\n this.parentForm =\r\n this.state.ovl.forms[this.formState.parent.formType][\r\n this.formState.parent.formId\r\n ]\r\n this.sourceField = this.parentForm.fields[this.formState.parent.fieldKey]\r\n if (this.parentForm.tableDefId) {\r\n this.parentTableDef = TableGet(this.parentForm.tableDefId).dataDef\r\n }\r\n let fn = this.actions.app.features[this.formState.feature]\r\n if (fn) {\r\n this.saveHook =\r\n fn?.hooks[\r\n HookFormEditorSave.replace(\"{subFeature}\", this.formState.subFeature)\r\n ]\r\n if (!this.saveHook) {\r\n throw Error(`ovl editor ${this.dialog}: HookFormEditorSave not found`)\r\n }\r\n this.deleteHook =\r\n fn?.hooks[\r\n HookFormEditorDelete.replace(\r\n \"{subFeature}\",\r\n this.formState.subFeature\r\n )\r\n ]\r\n this.cancelHook =\r\n fn?.hooks[\r\n HookFormEditorCancel.replace(\r\n \"{subFeature}\",\r\n this.formState.subFeature\r\n )\r\n ]\r\n }\r\n }\r\n close() {\r\n DialogClose(this.dialog, {\r\n instance: this.formId,\r\n })\r\n }\r\n\r\n async getUI() {\r\n let dialogParts: DialogGetParts = {\r\n dismissedCallbackFn: () => {\r\n return\r\n },\r\n title: () => {\r\n // check for specific feature (=baseFeature+dialogid) text and priorize it\r\n //`${feature}${parentField.editor.id}${parentField.fieldKey}\r\n let prefix = this.sourceField.editor.translationPrefix\r\n if (!prefix) {\r\n prefix = \"\"\r\n }\r\n \r\n let transKey = `${this.formState.feature}${prefix}${this.formState.subFeature}${this.sourceField.fieldKey}`\r\n if (!this.state.ovl.language.translations[transKey]) {\r\n transKey = `${this.formState.feature}${prefix}${this.formState.subFeature}`\r\n if (!this.state.ovl.language.translations[transKey]) {\r\n transKey = `${this.formState.subFeature}${prefix}`\r\n if (!this.state.ovl.language.translations[transKey]) {\r\n transKey = `${this.formState.subFeature}`\r\n }\r\n }\r\n }\r\n return T(transKey)\r\n },\r\n body: () => this.getBody(),\r\n footer: () => {\r\n let handleSave = async () => {\r\n let res = await this.saveHook({\r\n formState: this.formState,\r\n parentField: this.sourceField,\r\n })\r\n if (res?.cancel !== true) {\r\n this.close()\r\n }\r\n }\r\n let handleDelete = async () => {\r\n let res = await this.deleteHook({\r\n formState: this.formState,\r\n parentField: this.sourceField,\r\n })\r\n if (res?.cancel !== true) {\r\n this.close()\r\n }\r\n }\r\n\r\n let handleCancel = async () => {\r\n if (!this.cancelHook) {\r\n if (\r\n !this.formState.dirty ||\r\n (await DialogOkCancel(T(\"SYSCancel\"))) === 1\r\n ) {\r\n this.close()\r\n }\r\n } else {\r\n let res = await this.cancelHook({\r\n formState: this.formState,\r\n parentField: this.sourceField,\r\n })\r\n if (res?.cancel !== true) {\r\n this.close()\r\n }\r\n }\r\n }\r\n return html` {\r\n return {\r\n cancelFn: handleCancel,\r\n formState: this.formState,\r\n okFn: handleSave,\r\n deleteFn: this.deleteHook ? handleDelete : undefined,\r\n dialog: this.dialog,\r\n }\r\n }}\r\n >`\r\n },\r\n }\r\n return await DialogGet(this, dialogParts)\r\n }\r\n async getBody() {\r\n // use the default form renderer (same as bigform renderer)\r\n // so all control types are supported (editor on editor needs testing)\r\n // this will also respect FormBody Hooks\r\n\r\n let res = FormBodyRenderer(\r\n this.formState,\r\n {\r\n feature: this.formState.feature,\r\n columns: this.formState.fields,\r\n options: { edit: { groups: this.sourceField._state.groupState } },\r\n },\r\n this.parentForm.row,\r\n this.parentTableDef?.data,\r\n this.parentForm.tableRowKey\r\n )\r\n\r\n return res\r\n }\r\n async firstUpdated() {}\r\n}\r\n","import { SYSEditorDialogBase } from \"../../../src/library/dialog/editorbase\"\r\n\r\nexport class SYSEditorAsset extends SYSEditorDialogBase {\r\n browseFileEl: HTMLInputElement\r\n async init() {\r\n this.formType = \"SYSEditorAsset\"\r\n\r\n await super.init()\r\n }\r\n async disconnectedCallback() {\r\n await super.disconnectedCallback()\r\n }\r\n}\r\n","import { OvlAddDialog } from \"../../../../_ovlclient/src/global/globals\"\r\nimport { SYSEditorAsset } from \"./assetconfig\"\r\n\r\nexport const SYSEditorAsset_Init = () => {\r\n OvlAddDialog(SYSEditorAsset, \"SYSEditorAsset\")\r\n}\r\n","import { html, ovl, SYSFormElement } from \"../../../../_ovlclient/src\"\r\nimport type { DialogHolderParams } from \"../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport {\r\n FieldIsFocused,\r\n FieldIsValid,\r\n FieldIsValidSelective,\r\n} from \"../../../../_ovlclient/src/library/forms/fieldapi\"\r\nimport {\r\n FormIsLocked,\r\n FormIsValid,\r\n} from \"../../../../_ovlclient/src/library/forms/formapi\"\r\nimport { ProcessIsRunning } from \"../../../../_ovlclient/src/library/longrunningprocesstracker/processapi\"\r\n\r\nimport { T } from \"../../../../_ovlclient/src/textapi\"\r\nimport { isIOS } from \"../../../src/global/globals\"\r\nimport { SnackAdd } from \"../../../src/library/snackapi\"\r\nimport { SYSLogin } from \"./allactions\"\r\n\r\nexport type LoginFormState = {}\r\n\r\nexport type FieldId = \"pw\" | \"user\"\r\n\r\nexport class DialogSYSLoginForm extends SYSFormElement {\r\n loginActions: typeof SYSLogin\r\n\r\n async init() {\r\n this.loginActions = (this.actions.app.features).SYSLogin\r\n this.formType = \"SYSLogin\"\r\n await super.init()\r\n }\r\n getBody = () => {\r\n let fields = this.formState.fields\r\n let userField = fields[\"user\"]\r\n let pwField = fields[\"pw\"]\r\n let pwBox = html`\r\n
\r\n pwField}> \r\n
\r\n `\r\n\r\n let hideForgotPassword = \"ovl-hideControl\"\r\n if (\r\n !ProcessIsRunning(\"SYSLoginLogin\") &&\r\n FieldIsValidSelective(userField, {\r\n ignoreValidationKeys: [\"SYSLoginValidationInvalidPassword\"],\r\n })\r\n ) {\r\n hideForgotPassword = \"\"\r\n }\r\n\r\n let handleForgotPw = (e: Event) => {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n this.loginActions.actions.ForgotPw(this.formState)\r\n }\r\n\r\n return html`\r\n
\r\n
\r\n userField}> \r\n
\r\n ${pwBox}\r\n this.formState}\r\n >\r\n ${T(\"SYSLoginForgotPassword\")}\r\n \r\n `\r\n }\r\n getFooter = () => {\r\n let handleLogin = async () => {\r\n await this.loginActions.actions.Login({\r\n formState: this.formState,\r\n })\r\n }\r\n return html`\r\n ${T(\"SYSLoginLogin\")}\r\n `\r\n }\r\n\r\n async getUI() {\r\n let handleKey = async (e: KeyboardEvent) => {\r\n if ((e.target).tagName !== \"A\" && e.key == \"Enter\") {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n document.getElementById(\"ovlloginbutton\").focus()\r\n await this.loginActions.actions.Login({\r\n formState: this.formState,\r\n })\r\n }\r\n }\r\n let dialogHolderParams: DialogHolderParams\r\n\r\n dialogHolderParams = {\r\n dialogParts: {\r\n title: () => T(\"SYSLoginPleaseLogin\"),\r\n body: () => this.getBody(),\r\n footer: () => this.getFooter(),\r\n keyHandlerFn: handleKey,\r\n },\r\n\r\n dialogType: \"SYSLogin\",\r\n }\r\n return html``\r\n }\r\n async connectedCallback() {\r\n this.addEventListener(\"animationstart\", this.animationStart)\r\n await super.connectedCallback()\r\n }\r\n animationStart(e: AnimationEvent) {\r\n if (e.animationName === \"onAutoFillStart\") {\r\n if (!FormIsLocked(this.formState)) {\r\n //@ts-ignore\r\n document.getElementById(\"ovlloginbutton\").disabled = false\r\n }\r\n this.removeEventListener(\"animationstart\", this.animationStart)\r\n }\r\n }\r\n}\r\n","import { OvlAddDialog } from \"../../../_ovlclient/src/global/globals\"\r\nimport { DialogSYSLoginForm } from \"./features/loginform\"\r\n\r\nexport const SYSLogin_Init = () => {\r\n OvlAddDialog(DialogSYSLoginForm, \"SYSLogin\")\r\n}\r\n","export type HookSYSLoginSuccess_Type = {\r\n isRelogin: boolean\r\n}\r\nexport const HookSYSLoginSuccess = \"HookSYSLoginSuccess\"\r\n","import { ovl } from \"../../../../_ovlclient/src\"\r\nimport { LanguageSet } from \"../../../../_ovlclient/src/global/globalapi\"\r\nimport {\r\n _SetFeatureInfo,\r\n hasOSReducedMotion,\r\n} from \"../../../../_ovlclient/src/global/globals\"\r\n\r\nimport { HookSYSLoginSuccess, HookSYSLoginSuccess_Type } from \"./hooks\"\r\n\r\nexport const InitStateFromLogin = async (res: any) => {\r\n let state = ovl.getState()\r\n // to quickly fadeOut dialog after login success\r\n //we cannot close the dialog here because it awaits a promise which would be resolved then to early\r\n let el = document.getElementById(\"ovldialog_SYSLogin_SYSLogin\")\r\n if (el) {\r\n if (hasOSReducedMotion()) {\r\n el.classList.add(\"ovl-hide\")\r\n } else {\r\n el.classList.add(\"fadeOutScreen\")\r\n }\r\n }\r\n //\r\n\r\n state.ovl.user.role = res.data.user.role\r\n state.ovl.user.permissions = res.data.user.permissions\r\n state.ovl.user.userCode = res.data.user.userCode\r\n if (state.ovl.users === undefined) {\r\n state.ovl.users = {}\r\n }\r\n state.ovl.users[state.ovl.user.userCode] = {\r\n features: res.data.user.features,\r\n }\r\n\r\n let isRelogin = !!state.ovl.app.clientId\r\n state.ovl.app.clientId = res.data.user.clientId\r\n\r\n if (res.data.allUsersRoles) {\r\n res.data.allUsersRoles.forEach((ur) => {\r\n _SetFeatureInfo(\r\n ur.CntctCode,\r\n ur.Code,\r\n ur.Text1,\r\n ur.Text2,\r\n ur.Text3,\r\n ur.Json1,\r\n ur.Val1,\r\n ur.Val2\r\n )\r\n })\r\n }\r\n state.ovl.user.userId = res.data.user.userId\r\n state.ovl.user.email = res.data.user.userEmail\r\n state.ovl.user.cardCode = res.data.user.cardCode\r\n state.ovl.user.cardName = res.data.user.cardName\r\n state.ovl.user.firstName = res.data.user.firstName\r\n state.ovl.user.lastName = res.data.user.lastName\r\n state.ovl.user.isActor = res.data.user.isActor\r\n\r\n // this will load the remaining translations if not already loaded\r\n if (!state.ovl.language.translationComplete) {\r\n let lang = res.data.user.language\r\n if (!lang) {\r\n lang = state.ovl.session?.Language\r\n }\r\n await LanguageSet(lang)\r\n }\r\n\r\n // call HookSYSLoginSuccess\r\n //@ts-ignore (we need this ignore for login less apps (otto rohr))\r\n let fn = ovl.getActions().app.features.SYSLogin.hooks[HookSYSLoginSuccess]\r\n await fn({ isRelogin })\r\n}\r\n","import { ovl } from \"../../../../_ovlclient/src\"\r\nimport { Data } from \"../../../../_ovlclient/src/dataapi\"\r\nimport { DialogModal } from \"../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport { SYSFormField } from \"../../../../_ovlclient/src/library/forms/fieldapi\"\r\nimport { FormInit } from \"../../../../_ovlclient/src/library/forms/formapi\"\r\nimport { InitStateFromLogin } from \"./helpers\"\r\n\r\nexport const LoginStart = async () => {\r\n let state = ovl.getState()\r\n let fields: { [key: string]: SYSFormField } = {\r\n user: {\r\n value: \"\",\r\n ui: {\r\n labelTranslationKey: \"SYSLoginUser\",\r\n autocomplete: \"username\",\r\n },\r\n },\r\n pw: {\r\n value: \"\",\r\n ui: {\r\n labelTranslationKey: \"SYSLoginPassword\",\r\n autocomplete: \"current-password\",\r\n isPassword: true,\r\n },\r\n },\r\n }\r\n\r\n await FormInit(\"SYSLogin\", fields)\r\n //if (SYSConfig?.fetch?.authMode === \"cookie\") {\r\n let res = await Data(\r\n \"users/authenticate2\",\r\n { tz: Intl.DateTimeFormat().resolvedOptions().timeZone },\r\n { isAuthCheck: true }\r\n )\r\n // 401 will be handled by relogin loop\r\n // if 200 everything fine...\r\n if (res && res.status === 200) {\r\n await InitStateFromLogin(res)\r\n }\r\n //} else {\r\n if (!state.ovl.session.Token) {\r\n await DialogModal(\"SYSLogin\")\r\n }\r\n}\r\n","import { SYSBaseElement, html } from \"../../../../_ovlclient/src\"\r\nimport { ScreenNavigateBack } from \"../../../../_ovlclient/src/library/screenapi\"\r\nimport { T } from \"../../../../_ovlclient/src/textapi\"\r\n\r\nexport class CompSYSBackButton extends SYSBaseElement {\r\n async getUI() {\r\n const handleBack = (e: Event) => {\r\n ScreenNavigateBack()\r\n }\r\n if (this.state.ovl.screens.nav.screensHistory.length > 1) {\r\n return html`\r\n \r\n
\r\n \r\n `\r\n } else {\r\n return null\r\n }\r\n }\r\n}\r\n","import { TemplateResult } from \"lit-html\"\r\nimport { SYSShellbarMenuIds } from \"./parts/shellbar\"\r\nimport { DirectiveResult } from \"lit-html/directive.js\"\r\n\r\nexport type HookSYSShellbarDisplayHint_Type = {\r\n mode: \"left\" | \"right\"\r\n}\r\nexport type HookSYSShellbarDisplayHint_ReturnType = {\r\n res: TemplateResult | TemplateResult[] | DirectiveResult\r\n}\r\n\r\nexport const HookSYSShellbarDisplayHint = \"HookSYSShellbarDisplayHint\"\r\n\r\nexport type HookSYSShellbarCustomBackButton_ReturnType = {\r\n res: TemplateResult | TemplateResult[] | DirectiveResult\r\n}\r\n\r\nexport const HookSYSShellbarCustomBackButton = \"HookSYSShellbarCustomBackButton\"\r\n\r\nexport type SYSShellbarLanguagesGetType = {\r\n lang: string\r\n pic: any\r\n}\r\n\r\nexport type SYSShellbarMenuGetType = {\r\n icon?: string\r\n description: string\r\n type?: \"entry\" | \"separator\"\r\n handler?: any\r\n}\r\n\r\nexport type HookSYSShellbarLanguages_Type = {\r\n availableLanguages: string[]\r\n result: { items: SYSShellbarLanguagesGetType[] }\r\n}\r\n\r\nexport const HookSYSShellbarLanguages = \"HookSYSShellbarLanguages\"\r\n\r\nexport type HookSYSShellbarMenu_Type = {\r\n menuId: SYSShellbarMenuIds\r\n result: { items: SYSShellbarMenuGetType[]; resultIcon: string }\r\n}\r\nexport const HookSYSShellbarMenu = \"HookSYSShellbarMenu\"\r\n\r\nexport const HookSYSShellbarTitle = \"HookSYSShellbarTitle\"\r\n\r\nexport const HookSYSShellbarLogo = \"HookSYSShellbarLogo\"\r\n","import { SYSBaseElement } from \"../../../src\"\r\nimport {\r\n HookSYSShellbarDisplayHint,\r\n HookSYSShellbarDisplayHint_ReturnType,\r\n HookSYSShellbarDisplayHint_Type,\r\n} from \"../hooks\"\r\n\r\nexport class CompSYSShellbarHint extends SYSBaseElement {\r\n mode: \"left\" | \"right\"\r\n async init() {\r\n this.classList.add(\"fd-has-type-2\")\r\n this.classList.add(\"fd-has-color-action-2\")\r\n await super.init()\r\n }\r\n async getUI() {\r\n if (!this.state.ovl.app.ready) {\r\n return undefined\r\n }\r\n let fn =\r\n this.actions.app.features?.SYSShellbar?.hooks?.[\r\n HookSYSShellbarDisplayHint\r\n ]\r\n if (fn) {\r\n let res: HookSYSShellbarDisplayHint_ReturnType =\r\n await this.actions.app.features?.SYSShellbar?.hooks?.[\r\n HookSYSShellbarDisplayHint\r\n ]({ mode: this.mode } as HookSYSShellbarDisplayHint_Type)\r\n return res?.res\r\n } else {\r\n return undefined\r\n }\r\n }\r\n}\r\n","import { SYSBaseElement, SYSConfig, html } from \"../../../../_ovlclient/src\"\r\nimport {\r\n ProcessIsRunning,\r\n ProcessIsServerAccessRunning,\r\n} from \"../../../../_ovlclient/src/library/longrunningprocesstracker/processapi\"\r\nimport {\r\n ScreenCurrent,\r\n ScreenRefresh,\r\n} from \"../../../../_ovlclient/src/library/screenapi\"\r\nimport { T } from \"../../../../_ovlclient/src/textapi\"\r\n\r\nexport class CompSYSRefreshButton extends SYSBaseElement {\r\n async getUI() {\r\n let screen = ScreenCurrent()\r\n let refreshIsRunning = ProcessIsServerAccessRunning()\r\n const handleRefresh = async (e: Event) => {\r\n if (!refreshIsRunning) {\r\n //call the screens refresh action if any\r\n await ScreenRefresh(screen, { triggeredFromRefreshMenu: true })\r\n }\r\n }\r\n\r\n let buttonInactive = refreshIsRunning ? \"ovl-disabled\" : \"\"\r\n\r\n let refresh\r\n let offline\r\n if (SYSConfig.offline.enabled && this.state.ovl.app.offline.api) {\r\n let offlineIndicatorText = T(\"SYSOfflineIndicator\", undefined, \"Empty\")\r\n if (!offlineIndicatorText) {\r\n offlineIndicatorText = \"OFF\"\r\n }\r\n offline = html`${offlineIndicatorText}`\r\n }\r\n if (refreshIsRunning) {\r\n refresh = html`\r\n \r\n `\r\n } else if (this.actions.app.screens[screen]?.hooks?.HookScreenRefresh) {\r\n refresh = html`\r\n
\r\n `\r\n }\r\n\r\n return html` ${refresh} ${offline} `\r\n }\r\n}\r\n","import { TemplateResult, html, ovl } from \"../../../_ovlclient/src\"\r\nimport { isMobile, _globals, T } from \"../../../_ovlclient/src/global/globals\"\r\nimport {\r\n HookFieldValidationTextDisplay_ReturnType,\r\n HookFormSummaryValidationTextDisplay_ReturnType,\r\n} from \"../../../_ovlclient/src/global/hooks\"\r\nimport {\r\n SYSField,\r\n SYSFormState,\r\n} from \"../../../_ovlclient/src/library/forms/actions\"\r\nimport {\r\n ValidateResultError,\r\n ValidateResultVisibleSummaryError,\r\n} from \"../../src/library/forms/validators\"\r\nimport { ValidationGetTranslation } from \"../../src/library/forms/validatorsapi\"\r\n\r\nexport const HandleOvlFocusIn = (e: Event) => {\r\n let focusId\r\n let target: HTMLElement = e.target\r\n if (target?.id) {\r\n focusId = target.id\r\n } else {\r\n return\r\n }\r\n if (focusId && !target.classList.contains(\"ovl-ignoreautofocus\")) {\r\n // sets focus id which could be used in focus restore when switching screens/dialogs\r\n _globals.previousValidFocusId = _globals.lastValidFocusId\r\n _globals.lastValidFocusId = focusId\r\n }\r\n let el = document.getElementById(focusId)\r\n if (el && el.classList.contains(\"ovl-focusselected\")) {\r\n try {\r\n //@ts-ignore\r\n el.select()\r\n } catch {}\r\n }\r\n}\r\n\r\nexport const AppShellGet = (): TemplateResult => {\r\n // focusin remembers last focus when switching screens.\r\n // we don't want to remember focuses inside the shellbar itself\r\n // dont forget to add to your custom mainShell even when not using shellbar\r\n let ovlState = ovl.getState().ovl\r\n let appState = ovlState.app\r\n let scrollable = \"scrollable\"\r\n if (isMobile()) {\r\n scrollable = \"scrollableMobile\"\r\n }\r\n let appMainClass = \"\"\r\n if (appState.offline.api) {\r\n appMainClass = \"ovl-offline \"\r\n }\r\n if (appState.ready) {\r\n appMainClass = `${appMainClass} ovl-ready `\r\n }\r\n if (ovlState.uiState.isDemo) {\r\n appMainClass = `${appMainClass} ovl-test `\r\n }\r\n\r\n return html`\r\n {\r\n HandleOvlFocusIn(e)\r\n }}\r\n >\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n `\r\n}\r\n\r\n//default impl if no hook is found\r\nexport const FieldValidationTextGet = (\r\n field: SYSField,\r\n visibleErrors: ValidateResultError[]\r\n): HookFieldValidationTextDisplay_ReturnType => {\r\n // don't rely on f.visible here because this gets set in setVisibleValidation hich is debounced for good reason...\r\n let res = visibleErrors.map((m, resIndex) => {\r\n let sep\r\n if (resIndex > 0) {\r\n sep = html`, `\r\n }\r\n return html`${sep}${T(m.translationKey, m.translationReps)}`\r\n })\r\n return { res }\r\n}\r\n\r\n//default impl if no hook is found\r\nexport const FormSummaryValidationTextGet = (\r\n formState: SYSFormState\r\n): HookFormSummaryValidationTextDisplay_ReturnType => {\r\n let tabErrors = formState.validationResult[formState._state._activeEditTab]\r\n var relevantErrors = tabErrors.fieldErrors.concat(\r\n Object.keys(tabErrors.validationKeyErrors)\r\n .map((m) => tabErrors.validationKeyErrors[m])\r\n .concat(\r\n Object.keys(tabErrors.summaryErrors).map(\r\n (m) => tabErrors.summaryErrors[m]\r\n )\r\n )\r\n )\r\n\r\n if (relevantErrors.length === 0) {\r\n return { res: undefined }\r\n }\r\n return {\r\n res: relevantErrors.map((m, resIndex) => {\r\n let sep\r\n if (resIndex > 0) {\r\n sep = html`, `\r\n }\r\n return html`${sep}${ValidationGetTranslation(\r\n formState,\r\n m.translationKey,\r\n m.translationReps,\r\n m.involvedFieldKeys\r\n )}`\r\n }),\r\n }\r\n}\r\n","import {\r\n SYSBaseElement,\r\n TemplateResult,\r\n html,\r\n} from \"../../../../_ovlclient/src\"\r\nimport { isMobile } from \"../../../../_ovlclient/src/global/globals\"\r\nimport { T } from \"../../../../_ovlclient/src/textapi\"\r\nimport { SYSConfig } from \"../../../src\"\r\nimport {\r\n Logout,\r\n LanguageSet,\r\n PortalTestingModeSet,\r\n PermissionHas,\r\n FeatureInfo,\r\n PopupClose,\r\n PopupShow,\r\n PopupCurrent,\r\n} from \"../../../../_ovlclient/src/global/globalapi\"\r\nimport { ScreenNavigateTo } from \"../../../../_ovlclient/src/library/screenapi\"\r\nimport {\r\n HookSYSShellbarTitle,\r\n HookSYSShellbarLanguages,\r\n HookSYSShellbarLogo,\r\n HookSYSShellbarMenu,\r\n HookSYSShellbarCustomBackButton,\r\n} from \"../hooks\"\r\nimport type {\r\n HookSYSShellbarLanguages_Type,\r\n HookSYSShellbarMenu_Type,\r\n SYSShellbarLanguagesGetType,\r\n SYSShellbarMenuGetType,\r\n} from \"../hooks\"\r\nimport { AppShellGet } from \"../../sysdefaulthtmlsnippets01\"\r\n\r\nexport type SYSShellbarMenuIds = \"Menu1\" | \"Menu2\" | \"User\"\r\n\r\nexport class CompSYSShellbar extends SYSBaseElement {\r\n async connectedCallback() {\r\n await super.connectedCallback()\r\n const handleTopLevelClick = (e: Event) => {\r\n PopupClose()\r\n e.stopPropagation()\r\n }\r\n window.addEventListener(\"click\", handleTopLevelClick)\r\n }\r\n\r\n handleMenuClick = (e: Event, menuId: SYSShellbarMenuIds) => {\r\n PopupShow(menuId)\r\n e.stopPropagation()\r\n }\r\n\r\n handleLanguage = async (e: Event, lang) => {\r\n await LanguageSet(lang)\r\n }\r\n\r\n handlePortalTestingMode = async (e: Event) => {\r\n PortalTestingModeSet(!this.state.ovl.app.isPortalTestingMode)\r\n }\r\n\r\n handleLogout = (e: Event) => {\r\n Logout()\r\n }\r\n\r\n getMenuPartHtml = (m: SYSShellbarMenuGetType): TemplateResult => {\r\n let res\r\n if (m.type === \"separator\") {\r\n res = html` \r\n ${m.description}`\r\n } else {\r\n res = html` {\r\n if (e.key === \"Enter\") {\r\n m.handler(e)\r\n PopupClose()\r\n }\r\n }}\r\n >\r\n \r\n \r\n ${m.description}\r\n \r\n `\r\n }\r\n return res\r\n }\r\n\r\n getMenuContainerHtml = (\r\n menuId: SYSShellbarMenuIds,\r\n menus,\r\n icon: string,\r\n iconText: string\r\n ): TemplateResult => {\r\n let iconOrText\r\n if (icon) {\r\n iconOrText = html``\r\n } else {\r\n iconOrText = iconText\r\n }\r\n return html`
\r\n
\r\n
\r\n this.handleMenuClick(e, menuId)}\r\n aria-controls=\"DD35G276${menuId}\"\r\n aria-expanded=\"${PopupCurrent() === menuId}\"\r\n aria-haspopup=\"true\"\r\n >\r\n ${iconOrText}\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n `\r\n }\r\n\r\n async getUI() {\r\n let fn = this.actions.app.features?.SYSShellbar?.hooks\r\n let devHint\r\n if (SYSConfig._system.isDev) {\r\n devHint = html`
`\r\n }\r\n let demoHint\r\n if (this.state.ovl.uiState.isDemo) {\r\n demoHint = html`
`\r\n }\r\n let portalTestingHint\r\n if (this.state.ovl.app.isPortalTestingMode) {\r\n portalTestingHint = html``\r\n } else {\r\n portalTestingHint = html``\r\n }\r\n\r\n let hints = html`
\r\n ${devHint}${demoHint}${portalTestingHint}\r\n
`\r\n let logo\r\n\r\n if (fn?.[HookSYSShellbarLogo]) {\r\n logo = fn[HookSYSShellbarLogo]()\r\n }\r\n\r\n let appTitle\r\n let menu1\r\n let menu2\r\n let userMenu\r\n let sysRefreshButton\r\n if (this.state.ovl.app.ready) {\r\n sysRefreshButton = html`\r\n \r\n `\r\n\r\n if (fn?.[HookSYSShellbarTitle]) {\r\n appTitle = fn?.[HookSYSShellbarTitle]()\r\n } else {\r\n appTitle = T(\"SYSAppTitle\")\r\n }\r\n if (fn?.[HookSYSShellbarMenu]) {\r\n //######## User Menu ###########\r\n let items: SYSShellbarMenuGetType[] = []\r\n let result = { items, resultIcon: \"\" }\r\n fn[HookSYSShellbarMenu]({\r\n menuId: \"User\",\r\n result,\r\n } as HookSYSShellbarMenu_Type)\r\n\r\n let languageSelector\r\n // if there is more than 1 available languages display language selector\r\n let availableLanguages = this.state.ovl.language.availableTranslations\r\n if (availableLanguages.length > 1) {\r\n if (fn?.[HookSYSShellbarLanguages]) {\r\n let langresults: SYSShellbarLanguagesGetType[] = []\r\n fn[HookSYSShellbarLanguages]({\r\n availableLanguages,\r\n result: { items: langresults },\r\n } as HookSYSShellbarLanguages_Type)\r\n let languageItems = langresults.map((m) => {\r\n let part\r\n if (m.pic) {\r\n part = html` this.handleLanguage(e, m.lang)}\r\n class=\"ovl-language-icon\"\r\n src=${m.pic}\r\n width=\"20\"\r\n height=\"16\"\r\n />`\r\n } else {\r\n part = html` this.handleLanguage(e, m.lang)}\r\n >${m.lang}`\r\n }\r\n return part\r\n })\r\n languageSelector = html`\r\n
  • \r\n \r\n \r\n \r\n ${languageItems}\r\n \r\n \r\n
  • \r\n `\r\n }\r\n }\r\n\r\n result.items.push({\r\n description: T(\"SYSLoginLogout\"),\r\n icon: \"sap-icon--visits\",\r\n handler: this.handleLogout,\r\n })\r\n\r\n if (this.state.ovl.features.SYSShellbar.config.showAdminMenuPart) {\r\n // push admin menus to userMenu end\r\n let adminResults: SYSShellbarMenuGetType[] = []\r\n if (PermissionHas(\"SYSTR\")) {\r\n adminResults.push({\r\n icon: \"sap-icon--table-view\",\r\n description: T(\"SYSTranslationTitle\"),\r\n handler: (e) => {\r\n ScreenNavigateTo(\"SYSTranslation\")\r\n },\r\n })\r\n }\r\n if (PermissionHas(\"SYSAU\")) {\r\n adminResults.push({\r\n icon: \"sap-icon--history\",\r\n description: T(\"SYSAuditTitle\"),\r\n handler: (e) => {\r\n ScreenNavigateTo(\"SYSAudit\")\r\n },\r\n })\r\n }\r\n\r\n if (\r\n this.state.ovl.user.role === \"Admin\" ||\r\n FeatureInfo(\"SYSPortalTesting\")\r\n ) {\r\n let portalTestingModeMenuText = this.state.ovl.app\r\n .isPortalTestingMode\r\n ? \"Disable Testingmode\"\r\n : \"Enable Testingmode\"\r\n adminResults.push({\r\n description: portalTestingModeMenuText,\r\n icon: `sap-icon--${\r\n this.state.ovl.app.isPortalTestingMode\r\n ? \"sound-off\"\r\n : \"sound-loud\"\r\n }`,\r\n handler: this.handlePortalTestingMode,\r\n })\r\n }\r\n if (adminResults.length > 0) {\r\n adminResults.unshift({ description: \"Admin\", type: \"separator\" })\r\n result.items = result.items.concat(adminResults)\r\n }\r\n }\r\n result.items.push({\r\n description: `${T(\"SYSVersion\")}: ${SYSConfig._system.version} ${\r\n isMobile() ? \"M\" : \"\"\r\n }`,\r\n icon: \"sap-icon--hint\",\r\n })\r\n if (result.items.length > 0) {\r\n let icon\r\n let userInitials\r\n let userState = this.state.ovl.user\r\n userInitials =\r\n (userState?.firstName\r\n ? userState.firstName.substring(0, 1).toUpperCase()\r\n : \"\") +\r\n (userState?.lastName\r\n ? userState.lastName.substring(0, 1).toUpperCase()\r\n : \"\")\r\n if (!userInitials) {\r\n userInitials = userState.email\r\n if (userInitials) {\r\n userInitials = userInitials.substring(0, 2).toUpperCase()\r\n }\r\n }\r\n if (!userInitials) {\r\n icon = \"sap-icon--role\"\r\n } else {\r\n if (this.state.ovl.user.isActor) {\r\n userInitials = `(${userInitials})`\r\n }\r\n }\r\n\r\n userMenu = this.getMenuContainerHtml(\r\n \"User\",\r\n [languageSelector].concat(\r\n result.items.map((k) => this.getMenuPartHtml(k))\r\n ),\r\n icon,\r\n userInitials\r\n )\r\n }\r\n\r\n // ############ Menu1\r\n items = []\r\n result = { items, resultIcon: \"\" }\r\n fn[HookSYSShellbarMenu]({\r\n menuId: \"Menu1\",\r\n result,\r\n } as HookSYSShellbarMenu_Type)\r\n\r\n if (result.items.length > 0) {\r\n menu1 = this.getMenuContainerHtml(\r\n \"Menu1\",\r\n\r\n result.items.map((k) => this.getMenuPartHtml(k)),\r\n result.resultIcon,\r\n \"\"\r\n )\r\n }\r\n\r\n // ############ Menu2\r\n items = []\r\n result = { items, resultIcon: \"\" }\r\n fn[HookSYSShellbarMenu]({\r\n menuId: \"Menu2\",\r\n result,\r\n } as HookSYSShellbarMenu_Type)\r\n\r\n if (result.items.length > 0) {\r\n menu2 = this.getMenuContainerHtml(\r\n \"Menu2\",\r\n\r\n result.items.map((k) => this.getMenuPartHtml(k)),\r\n result.resultIcon,\r\n \"\"\r\n )\r\n }\r\n }\r\n }\r\n let backButton\r\n\r\n backButton = html`\r\n \r\n \r\n `\r\n if (fn?.[HookSYSShellbarCustomBackButton]) {\r\n backButton = html`\r\n ${fn[HookSYSShellbarCustomBackButton]().res}\r\n `\r\n }\r\n let shell = html`\r\n ${backButton}\r\n \r\n
    \r\n \r\n
    \r\n
    ${sysRefreshButton}
    \r\n ${userMenu} ${menu2} ${menu1}\r\n \r\n `\r\n\r\n let resHtml = html`\r\n
    \r\n
    {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n if (SYSConfig.init.initalScreen) {\r\n ScreenNavigateTo(SYSConfig.init.initalScreen)\r\n }\r\n }}>\r\n \r\n ${appTitle}\r\n   \r\n \r\n   \r\n ${hints}\r\n\r\n
    \r\n ${shell}\r\n
    \r\n \r\n ${AppShellGet()}\r\n \r\n `\r\n return resHtml\r\n }\r\n}\r\n","import { OvlAddComponent } from \"../../../_ovlclient/src/global/globals\"\r\nimport { CompSYSBackButton } from \"./parts/backbutton\"\r\nimport { CompSYSShellbarHint } from \"./parts/hint\"\r\nimport { CompSYSRefreshButton } from \"./parts/refresh\"\r\nimport { CompSYSShellbar } from \"./parts/shellbar\"\r\n\r\nexport const SYSShellbar_Init = () => {\r\n OvlAddComponent(\"comp-sysshellbar\", CompSYSShellbar)\r\n OvlAddComponent(\"comp-sysbackbutton\", CompSYSBackButton)\r\n OvlAddComponent(\"comp-sysshellbarhint\", CompSYSShellbarHint)\r\n OvlAddComponent(\"comp-sysrefreshbutton\", CompSYSRefreshButton)\r\n}\r\n","import { html, SYSBaseElement } from \"../../../../_ovlclient/src\"\r\nimport { T } from \"../../../../_ovlclient/src/global/globals\"\r\nimport type { SYSTableDefIds } from \"../../../../_ovlclient/src\"\r\n\r\nexport class ScreenSYSTranslation extends SYSBaseElement {\r\n async getUI() {\r\n return html`\r\n
    \r\n
    \r\n \"SYSTranslation\"}\r\n >\r\n \r\n
    \r\n
    \r\n `\r\n }\r\n}\r\n","import { OvlAddScreen } from \"../../../_ovlclient/src/global/globals\"\r\nimport { ScreenSYSTranslation } from \"./screens/translation\"\r\n\r\nexport const SYSTranslation_Init = () => {\r\n OvlAddScreen(ScreenSYSTranslation, \"SYSTranslation\")\r\n}\r\n","import { html, SYSBaseElement } from \"../../../../../_ovlclient/src\"\r\nimport type { SYSTableDefIds } from \"../../../../../_ovlclient/src\"\r\nimport { DialogClose } from \"../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport type { DialogHolderParams } from \"../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport { T } from \"../../../../../_ovlclient/src/textapi\"\r\nimport { NavDef } from \"../../../../../_ovlclient/src/library/table/navcontrol\"\r\n\r\nexport class DialogSYSUserAdministrationCompany extends SYSBaseElement {\r\n async init() {\r\n this.dialog = \"SYSUserAdministration_Company\"\r\n await super.init()\r\n }\r\n async getUI() {\r\n let dialogHolderParams: DialogHolderParams\r\n dialogHolderParams = {\r\n dialogParts: {\r\n dismissedCallbackFn: () => {\r\n DialogClose(this.dialog)\r\n },\r\n title: () => T(\"SYSUserAdministrationCompanyTitle\"),\r\n body: () => html` \"SYSUserAdministration_Company\"}\r\n >\r\n `,\r\n footer: () => html` {\r\n return {\r\n defId: \"SYSUserAdministration_Company\",\r\n } as NavDef\r\n }}\r\n >`,\r\n },\r\n dialogType: this.dialog,\r\n }\r\n return html``\r\n }\r\n}\r\n","import { SYSBaseElement, html } from \"../../../../_ovlclient/src\"\r\nimport { PermissionHas } from \"../../../../_ovlclient/src/global/globalapi\"\r\nimport { DialogOpen } from \"../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport { TableRefresh } from \"../../../../_ovlclient/src/library/table/tableapi\"\r\nimport { T } from \"../../../../_ovlclient/src/textapi\"\r\n\r\nexport class CompSYSUserAdministrationSettings extends SYSBaseElement {\r\n handleUserAdministrationUser = async (e: Event) => {\r\n await TableRefresh(\"SYSUserAdministration_Role\", { showSnack: false })\r\n await TableRefresh(\"SYSUserAdministration_User\", { showSnack: true })\r\n DialogOpen(\"SYSUserAdministration_User\")\r\n }\r\n handleUserAdministrationCompany = async (e: Event) => {\r\n await TableRefresh(\"SYSUserAdministration_Company\", { showSnack: true })\r\n DialogOpen(\"SYSUserAdministration_Company\")\r\n }\r\n\r\n handleUserAdministrationRole = async (e: Event) => {\r\n await TableRefresh(\"SYSUserAdministration_Role\", { showSnack: true })\r\n DialogOpen(\"SYSUserAdministration_Role\")\r\n }\r\n\r\n async getUI() {\r\n if (this.state.ovl.user.isActor) {\r\n return null\r\n }\r\n let userAdministration\r\n let roles\r\n let users\r\n let companies\r\n if (PermissionHas(\"SYSRA\")) {\r\n roles = html`\r\n this.handleUserAdministrationRole(e)}\r\n >\r\n ${T(\"SYSUserAdministrationRoleTitle\")}
    \r\n \r\n \r\n `\r\n }\r\n if (PermissionHas(\"SYSUA\")) {\r\n users = html`\r\n this.handleUserAdministrationUser(e)}\r\n >\r\n ${T(\"SYSUserAdministrationUserTitle\")}\r\n \r\n \r\n `\r\n }\r\n if (PermissionHas(\"SYSCA\")) {\r\n companies = html`\r\n this.handleUserAdministrationCompany(e)}\r\n >\r\n ${T(\"SYSUserAdministrationCompanyTitle\")}\r\n \r\n \r\n `\r\n }\r\n\r\n if (roles !== undefined || users !== undefined || companies !== undefined) {\r\n userAdministration = html`
    \r\n
    \r\n
    \r\n

    \r\n ${T(\"SYSUserAdministrationTitle\")}\r\n

    \r\n
    \r\n
    \r\n\r\n
    \r\n
    \r\n ${users} ${roles} ${companies}\r\n
    \r\n
    \r\n
    `\r\n }\r\n return userAdministration\r\n }\r\n}\r\n","import { TableRefresh } from \"../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport const RefreshResultingPermission = (cntctCode: number) => {\r\n TableRefresh(\"SYSUserAdministration_ResultingPermission\", {\r\n serverFilter: {\r\n RoleCode: \"@@SYSGetResultingRole\",\r\n Permission: cntctCode,\r\n },\r\n resetStrategy: { ClearData: true },\r\n })\r\n}\r\n","import { html, SYSBaseElement } from \"../../../../../_ovlclient/src\"\r\nimport type { SYSTableDefIds } from \"../../../../../_ovlclient/src\"\r\nimport { DialogClose } from \"../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport type { DialogHolderParams } from \"../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport { T } from \"../../../../../_ovlclient/src/textapi\"\r\nimport { TableGet } from \"../../../../../_ovlclient/src/library/table/tableapi\"\r\nimport { RefreshResultingPermission } from \"../helpers\"\r\nimport { UserAdministration_UserRoleType } from \"../userrole/tabledef\"\r\nimport { UserAdministration_RoleType } from \"../role/tabledef\"\r\nimport { NavDef } from \"../../../../../_ovlclient/src/library/table/navcontrol\"\r\n\r\nexport class DialogSYSUserAdministrationPermission extends SYSBaseElement {\r\n async init() {\r\n this.dialog = \"SYSUserAdministration_Permission\"\r\n await super.init()\r\n }\r\n async getUI() {\r\n let selectedRoleTable = TableGet(\r\n \"SYSUserAdministration_Role\",\r\n { byKeys: \"Selected\" }\r\n )\r\n let selectedRole = selectedRoleTable.rows[selectedRoleTable.getKeys()[0]]\r\n let role = selectedRole.Code\r\n\r\n let dialogHolderParams: DialogHolderParams\r\n dialogHolderParams = {\r\n dialogParts: {\r\n closedCallbackFn: () => {\r\n let userRoleTable = TableGet(\r\n \"SYSUserAdministration_UserRole\",\r\n { byKeys: \"Selected\" }\r\n )\r\n if (userRoleTable.getKeys().length > 0) {\r\n let selectedUserCode =\r\n userRoleTable.rows[userRoleTable.getKeys()[0]].U_CntctCode\r\n RefreshResultingPermission(selectedUserCode)\r\n }\r\n },\r\n dismissedCallbackFn: () => {\r\n DialogClose(this.dialog)\r\n },\r\n title: () =>\r\n html`

    \r\n ${T(\"SYSUserAdministrationPermissionTitle\")} ${role}\r\n

    `,\r\n\r\n body: () =>\r\n html` `,\r\n footer: () => html` {\r\n return {\r\n defId: \"SYSUserAdministration_Permission\",\r\n } as NavDef\r\n }}\r\n >`,\r\n },\r\n dialogType: this.dialog,\r\n }\r\n return html``\r\n }\r\n}\r\n","import { html, SYSTableDefIds } from \"../../../../../_ovlclient/src\"\r\nimport { T } from \"../../../../../_ovlclient/src/textapi\"\r\nimport { SYSBaseElement } from \"../../../../../_ovlclient/src/library/sysbaseelement\"\r\n\r\nexport class CompSYSUserAdministrationPermission extends SYSBaseElement {\r\n async getUI() {\r\n return html`\r\n \"SYSUserAdministration_Permission\"}\r\n >\r\n \r\n `\r\n }\r\n}\r\n","import { html, SYSBaseElement } from \"../../../../../_ovlclient/src\"\r\nimport type { SYSTableDefIds } from \"../../../../../_ovlclient/src\"\r\nimport { DialogClose } from \"../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport type { DialogHolderParams } from \"../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport { T } from \"../../../../../_ovlclient/src/textapi\"\r\nimport { NavDef } from \"../../../../../_ovlclient/src/library/table/navcontrol\"\r\n\r\nexport class DialogSYSUserAdministrationRole extends SYSBaseElement {\r\n async init() {\r\n this.dialog = \"SYSUserAdministration_Role\"\r\n await super.init()\r\n }\r\n async getUI() {\r\n let dialogHolderParams: DialogHolderParams\r\n dialogHolderParams = {\r\n dialogParts: {\r\n dismissedCallbackFn: () => {\r\n DialogClose(this.dialog)\r\n },\r\n title: () => T(\"SYSUserAdministrationRoleTitle\"),\r\n body: () => html` \"SYSUserAdministration_Role\"}\r\n >\r\n `,\r\n footer: () => html` {\r\n return {\r\n defId: \"SYSUserAdministration_Role\",\r\n } as NavDef\r\n }}\r\n >`,\r\n },\r\n dialogType: this.dialog,\r\n }\r\n return html``\r\n }\r\n}\r\n","import { html, SYSBaseElement } from \"../../../../../_ovlclient/src\"\r\nimport type { SYSTableDefIds } from \"../../../../../_ovlclient/src\"\r\nimport { DialogClose } from \"../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport type { DialogHolderParams } from \"../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport { T } from \"../../../../../_ovlclient/src/textapi\"\r\nimport { NavDef } from \"../../../../../_ovlclient/src/library/table/navcontrol\"\r\n\r\nexport class DialogUserAdministrationUser extends SYSBaseElement {\r\n async init() {\r\n this.dialog = \"SYSUserAdministration_User\"\r\n await super.init()\r\n }\r\n async getUI() {\r\n let dialogHolderParams: DialogHolderParams\r\n dialogHolderParams = {\r\n dialogParts: {\r\n dismissedCallbackFn: () => {\r\n DialogClose(this.dialog)\r\n },\r\n body: () => html` \"SYSUserAdministration_User\"}\r\n >\r\n `,\r\n footer: () => html` {\r\n return {\r\n defId: \"SYSUserAdministration_User\",\r\n } as NavDef\r\n }}\r\n >`,\r\n },\r\n dialogType: this.dialog,\r\n }\r\n return html``\r\n }\r\n}\r\n","import {\r\n html,\r\n SYSBaseElement,\r\n TemplateResult,\r\n} from \"../../../../../_ovlclient/src\"\r\nimport type { SYSTableDefIds } from \"../../../../../_ovlclient/src\"\r\nimport {\r\n DialogClose,\r\n DialogCurrent,\r\n DialogCurrentState,\r\n DialogOpen,\r\n} from \"../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport type { DialogHolderParams } from \"../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport { T } from \"../../../../../_ovlclient/src/textapi\"\r\nimport {\r\n TableGet,\r\n TableRefresh,\r\n} from \"../../../../../_ovlclient/src/library/table/tableapi\"\r\nimport { UserAdministration_UserType } from \"../user/tabledef\"\r\nimport { PermissionHas } from \"../../../../../_ovlclient/src/global/globalapi\"\r\nimport { NavDef } from \"../../../../../_ovlclient/src/library/table/navcontrol\"\r\n\r\nexport class DialogSYSUserAdministrationUserRole extends SYSBaseElement {\r\n async init() {\r\n this.dialog = \"SYSUserAdministration_UserRole\"\r\n await super.init()\r\n }\r\n async getUI() {\r\n let selectedUserTable = TableGet(\r\n \"SYSUserAdministration_User\",\r\n { byKeys: \"Selected\" }\r\n )\r\n let selectedUser = selectedUserTable.rows[selectedUserTable.getKeys()[0]]\r\n let firstName = selectedUser.FirstName\r\n let lastName = selectedUser.LastName\r\n let userId = selectedUser.U_PrtUserId\r\n let dialogHolderParams: DialogHolderParams\r\n let buttonTransferRole = html`
    `\r\n if (PermissionHas(\"SYSUR\", \"M\")) {\r\n buttonTransferRole = html` {\r\n await TableRefresh(\"SYSUserAdministration_UserRoleTransfer\", {\r\n resetStrategy: { Selection: true },\r\n })\r\n DialogOpen(\"SYSUserAdministration_UserRoleTransfer\")\r\n }}\r\n >\r\n ${T(\"SYSUserAdministrationUserRoleTransfer\")}\r\n \r\n `\r\n }\r\n\r\n dialogHolderParams = {\r\n dialogParts: {\r\n dismissedCallbackFn: () => {\r\n DialogClose(this.dialog)\r\n },\r\n title: () =>\r\n html`
    \r\n

    \r\n ${T(\"SYSUserAdministrationUserRoleTitle\")} ${firstName}\r\n ${lastName} (${userId})\r\n

    \r\n
    \r\n ${buttonTransferRole}\r\n
    `,\r\n\r\n body: () => {\r\n let resultingPermissionsTable\r\n let permissionsOverview\r\n if (DialogCurrent() !== \"SYSUserAdministration_Permission\") {\r\n let cds = this.dialogState\r\n if (cds.data === undefined) {\r\n cds.data = {\r\n expanded: false,\r\n }\r\n }\r\n resultingPermissionsTable = html`\r\n \"SYSUserAdministration_ResultingPermission\"}\r\n >\r\n `\r\n permissionsOverview = html`
    \r\n
    \r\n
    \r\n {\r\n cds.data.expanded = !cds.data.expanded\r\n }}\r\n class=\"fd-button fd-button--transparent fd-panel__button\"\r\n aria-expanded=\"${cds.data.expanded}\"\r\n aria-haspopup=\"true\"\r\n aria-label=\"expand/collapse panel\"\r\n aria-controls=\"fghqwe321\"\r\n >\r\n \r\n \r\n
    \r\n
    \r\n ${T(\"SYSUserAdministrationResultingPermissionsTitle\")}\r\n
    \r\n
    \r\n \r\n
    \r\n ${resultingPermissionsTable}\r\n
    \r\n
    \r\n `\r\n }\r\n\r\n return html` \"SYSUserAdministration_UserRole\"}\r\n >\r\n \r\n ${permissionsOverview} `\r\n },\r\n footer: () => html` {\r\n return {\r\n defId: \"SYSUserAdministration_UserRole\",\r\n } as NavDef\r\n }}\r\n >`,\r\n },\r\n dialogType: this.dialog,\r\n }\r\n\r\n return html``\r\n }\r\n}\r\n","import type { SYSTableDefIds } from \"../../../../../_ovlclient/src\"\r\nimport { html, SYSBaseElement } from \"../../../../../_ovlclient/src\"\r\nimport { Data } from \"../../../../../_ovlclient/src/dataapi\"\r\nimport type { DialogHolderParams } from \"../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport {\r\n DialogClose,\r\n DialogOkCancel,\r\n} from \"../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport {\r\n ProcessEnd,\r\n ProcessStart,\r\n} from \"../../../../../_ovlclient/src/library/longrunningprocesstracker/processapi\"\r\nimport { NavDef } from \"../../../../../_ovlclient/src/library/table/navcontrol\"\r\nimport { TableGet } from \"../../../../../_ovlclient/src/library/table/tableapi\"\r\nimport { T } from \"../../../../../_ovlclient/src/textapi\"\r\nimport { UserAdministration_UserType } from \"../user/tabledef\"\r\n\r\nexport class DialogSYSUserAdministrationUserRoleTransfer extends SYSBaseElement {\r\n async init() {\r\n this.dialog = \"SYSUserAdministration_UserRoleTransfer\"\r\n await super.init()\r\n }\r\n async handleSave() {\r\n let sync = false\r\n\r\n let selectedUserTable = TableGet(\r\n \"SYSUserAdministration_User\",\r\n { byKeys: \"Selected\" }\r\n )\r\n let fromUserId =\r\n selectedUserTable.rows[selectedUserTable.getKeys()[0]].CntctCode\r\n let fromUserName = `${\r\n selectedUserTable.rows[selectedUserTable.getKeys()[0]].FirstName\r\n } ${selectedUserTable.rows[selectedUserTable.getKeys()[0]].LastName}`\r\n\r\n let selectedTargetUserTable = TableGet(\r\n \"SYSUserAdministration_UserRoleTransfer\",\r\n { byKeys: \"Selected\" }\r\n )\r\n let toUserIds = selectedTargetUserTable\r\n .getKeys()\r\n .map((k) => selectedTargetUserTable.rows[k].CntctCode)\r\n if (\r\n (await DialogOkCancel(\r\n T(\"SYSUserAdministrationUserRoleTransferDoConfirm\", [\r\n fromUserName,\r\n toUserIds.length,\r\n ])\r\n )) === 2\r\n ) {\r\n return\r\n }\r\n\r\n if (\r\n (await DialogOkCancel(\r\n T(\"SYSUserAdministrationUserRoleTransferSyncConfirm\", [\r\n fromUserName,\r\n toUserIds.length,\r\n ]),\r\n {\r\n okText: \"SYSYes\",\r\n cancelText: \"SYSNo\",\r\n }\r\n )) === 1\r\n ) {\r\n sync = true\r\n }\r\n try {\r\n ProcessStart(\"SYSUserAdministrationUserRoleDoTransfer\", {\r\n lock: { dialog: \"SYSUserAdministration_UserRoleTransfer\" },\r\n })\r\n\r\n let res = await Data(\"useradministration/transferroles\", {\r\n fromUserId,\r\n toUserIds,\r\n sync,\r\n })\r\n DialogClose(\"SYSUserAdministration_UserRoleTransfer\")\r\n } finally {\r\n ProcessEnd(\"SYSUserAdministrationUserRoleDoTransfer\")\r\n }\r\n }\r\n async getUI() {\r\n let dialogHolderParams: DialogHolderParams\r\n\r\n dialogHolderParams = {\r\n dialogParts: {\r\n dismissedCallbackFn: () => {\r\n DialogClose(this.dialog)\r\n },\r\n title: () => {\r\n let selectedUserTable = TableGet(\r\n \"SYSUserAdministration_User\",\r\n { byKeys: \"Selected\" }\r\n )\r\n let fromUserName = `${\r\n selectedUserTable.rows[selectedUserTable.getKeys()[0]].FirstName\r\n } ${selectedUserTable.rows[selectedUserTable.getKeys()[0]].LastName}`\r\n return T(\"SYSUserAdministrationUserRoleTransferTitle\", [fromUserName])\r\n },\r\n body: () => html`\r\n \"SYSUserAdministration_UserRoleTransfer\"}\r\n >\r\n `,\r\n footer: async () => {\r\n return html` {\r\n await this.handleSave()\r\n }}\r\n class=\"fd-button fd-button--positive\"\r\n ?disabled=${TableGet(\"SYSUserAdministration_UserRoleTransfer\", {\r\n byKeys: \"Selected\",\r\n }).getKeys().length === 0}\r\n >\r\n \r\n \r\n {\r\n return {\r\n defId: \"SYSUserAdministration_UserRoleTransfer\",\r\n } as NavDef\r\n }}\r\n >`\r\n },\r\n },\r\n dialogType: this.dialog,\r\n }\r\n return html``\r\n }\r\n}\r\n","import { PermissionHas } from \"../../../_ovlclient/src/global/globalapi\"\r\nimport {\r\n OvlAddComponent,\r\n OvlAddDialog,\r\n} from \"../../../_ovlclient/src/global/globals\"\r\nimport { DialogSYSUserAdministrationCompany } from \"./features/company/company\"\r\nimport { CompSYSUserAdministrationSettings } from \"./parts/settings\"\r\nimport { DialogSYSUserAdministrationPermission } from \"./features/permission/dialogpermission\"\r\nimport { CompSYSUserAdministrationPermission } from \"./features/permission/permission\"\r\nimport { DialogSYSUserAdministrationRole } from \"./features/role/role\"\r\nimport { DialogUserAdministrationUser } from \"./features/user/user\"\r\nimport { DialogSYSUserAdministrationUserRole } from \"./features/userrole/userrole\"\r\nimport { DialogSYSUserAdministrationUserRoleTransfer } from \"./features/userroletransfer/userroletransfer\"\r\nexport const SYSUserAdministration_Init = () => {\r\n if (PermissionHas(\"SYSUA\") || PermissionHas(\"SYSRA\")) {\r\n OvlAddDialog(DialogUserAdministrationUser, \"SYSUserAdministration_User\")\r\n OvlAddDialog(\r\n DialogSYSUserAdministrationUserRoleTransfer,\r\n \"SYSUserAdministration_UserRoleTransfer\"\r\n )\r\n OvlAddDialog(\r\n DialogSYSUserAdministrationCompany,\r\n \"SYSUserAdministration_Company\"\r\n )\r\n OvlAddDialog(DialogSYSUserAdministrationRole, \"SYSUserAdministration_Role\")\r\n OvlAddDialog(\r\n DialogSYSUserAdministrationUserRole,\r\n \"SYSUserAdministration_UserRole\"\r\n )\r\n OvlAddDialog(\r\n DialogSYSUserAdministrationPermission,\r\n \"SYSUserAdministration_Permission\"\r\n )\r\n OvlAddComponent(\r\n \"comp-sysuseradministrationpermission\",\r\n CompSYSUserAdministrationPermission\r\n )\r\n OvlAddComponent(\r\n \"comp-sysuseradministrationsettings\",\r\n CompSYSUserAdministrationSettings\r\n )\r\n }\r\n}\r\n","import { html, SYSFormElement } from \"../../../../../_ovlclient/src\"\r\n\r\nimport {\r\n FormIsLocked,\r\n FormIsValid,\r\n} from \"../../../../../_ovlclient/src/library/forms/formapi\"\r\n\r\nimport { T } from \"../../../../../_ovlclient/src/textapi\"\r\nimport { isTracking } from \"../../../../src/tracker/tracker\"\r\nimport { SYSUserSettingsPassword } from \"../features/allactions\"\r\nexport class CompSYSUserSettingsPasswordForm extends SYSFormElement {\r\n userSettingsPasswordActions: typeof SYSUserSettingsPassword\r\n async init() {\r\n this.userSettingsPasswordActions = ((\r\n this.actions.app.features\r\n )).SYSUserSettingsPassword\r\n this.formType = \"SYSUserSettingsPassword\"\r\n await super.init()\r\n }\r\n async getUI() {\r\n let handleSave = async (e) => {\r\n e.preventDefault()\r\n await this.userSettingsPasswordActions.actions.SaveSettings(\r\n this.formState\r\n )\r\n }\r\n\r\n // this is just a helper fn to get typed ids\r\n\r\n let fields = this.formState.fields\r\n let pwField = fields[\"pw\"]\r\n let pw1Field = fields[\"pw1\"]\r\n let pw2Field = fields[\"pw2\"]\r\n\r\n return html`\r\n
    \r\n
    \r\n
    \r\n
    \r\n

    \r\n ${T(\"SYSUserSettingsChangePw\")}\r\n

    \r\n
    \r\n
    \r\n\r\n
    \r\n
    \r\n
    \r\n pwField} }}> \r\n
    \r\n
    \r\n pw1Field} }}> \r\n
    \r\n
    \r\n pw2Field} }}> \r\n
    \r\n
    \r\n this.formState}\r\n >\r\n
    \r\n \r\n
    \r\n await handleSave(e)}\r\n class=\"fd-button\"\r\n >\r\n ${T(\"SYSUserSettingsChangePw\")}\r\n \r\n
    \r\n
    \r\n \r\n
    \r\n `\r\n }\r\n}\r\n","import { OvlAddComponent } from \"../../../../_ovlclient/src/global/globals\"\r\nimport { CompSYSUserSettingsPasswordForm } from \"./parts/passwordsettingsform\"\r\n\r\nexport const SYSUserSettingsPassword_Init = () => {\r\n OvlAddComponent(\r\n \"comp-sysusersettingspasswordform\",\r\n CompSYSUserSettingsPasswordForm\r\n )\r\n}\r\n","import type { SYSTableDefIds } from \"../../../../../../../../_ovlclient/src\"\r\nimport { html, SYSBaseElement } from \"../../../../../../../../_ovlclient/src\"\r\nimport { Data } from \"../../../../../../../../_ovlclient/src/dataapi\"\r\nimport type { DialogHolderParams } from \"../../../../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport {\r\n DialogClose,\r\n DialogOkCancel,\r\n} from \"../../../../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport {\r\n ProcessEnd,\r\n ProcessStart,\r\n} from \"../../../../../../../../_ovlclient/src/library/longrunningprocesstracker/processapi\"\r\nimport { NavDef } from \"../../../../../../../../_ovlclient/src/library/table/navcontrol\"\r\nimport {\r\n TableGet,\r\n TableRefresh,\r\n} from \"../../../../../../../../_ovlclient/src/library/table/tableapi\"\r\nimport { T } from \"../../../../../../../../_ovlclient/src/textapi\"\r\n\r\nexport class DialogPKGPackagingSplit extends SYSBaseElement {\r\n async init() {\r\n this.dialog = \"PKGPackagingSplit\"\r\n await super.init()\r\n }\r\n async handleSave() {\r\n let sync = false\r\n\r\n let selectedTable = TableGet(\"PKGPackagingSplit\", { byKeys: \"Selected\" })\r\n\r\n let keys = selectedTable.getKeys()\r\n let count = keys.length\r\n let row = selectedTable.rows[keys[0]]\r\n let paket = row[\"U_Unit\"]\r\n let paket1 = `${paket}.1`\r\n let paket2 = `${paket}.2`\r\n if (\r\n (await DialogOkCancel(\r\n T(\"PKGPackagingPackagingSplitConfirm\", [count, paket2, paket, paket1])\r\n )) === 2\r\n ) {\r\n return\r\n }\r\n try {\r\n ProcessStart(\"PKGPackagingPackagingSplit\", {\r\n lock: { dialog: \"PKGPackagingSplit\" },\r\n snack: { customTextReplacements: [paket] },\r\n })\r\n\r\n let selectedCodes: string[] = selectedTable\r\n .getKeys()\r\n .map((m) => selectedTable.rows[m][\"Code\"])\r\n\r\n let res = await Data(\"packaging/split/split\", selectedCodes)\r\n\r\n TableRefresh(\"PKGPackaging\", {\r\n serverFilter: { U_OrderDocEntry: res.data.docEntry },\r\n })\r\n DialogClose(\"PKGPackagingSplit\")\r\n } finally {\r\n ProcessEnd(\"PKGPackagingPackagingSplit\")\r\n }\r\n }\r\n async getUI() {\r\n let dialogHolderParams: DialogHolderParams\r\n\r\n dialogHolderParams = {\r\n dialogParts: {\r\n dismissedCallbackFn: () => {\r\n DialogClose(this.dialog)\r\n },\r\n title: () => {\r\n let selectedUserTable = TableGet(\"PKGPackaging\", {\r\n byKeys: \"Selected\",\r\n })\r\n return T(\r\n \"PKGPackagingPackagingSplit\",\r\n selectedUserTable.rows[selectedUserTable.getKeys()[0]].U_Unit\r\n )\r\n },\r\n body: () => html` \"PKGPackagingSplit\"}\r\n >\r\n `,\r\n footer: async () => {\r\n let tb = TableGet(\"PKGPackagingSplit\", {\r\n byKeys: \"Selected\",\r\n })\r\n let selectedCount = tb.getKeys().length\r\n let allCount = tb.getKeys({ byKeys: \"Visible\" }).length\r\n return html` {\r\n await this.handleSave()\r\n }}\r\n class=\"fd-button fd-button--positive\"\r\n ?disabled=${selectedCount === 0 || selectedCount === allCount}\r\n >\r\n \r\n \r\n\r\n {\r\n return {\r\n defId: \"PKGPackagingSplit\",\r\n } as NavDef\r\n }}\r\n >`\r\n },\r\n },\r\n dialogType: this.dialog,\r\n }\r\n return html``\r\n }\r\n}\r\n","import { SYSBaseElement, html } from \"../../../../../../../_ovlclient/src\"\r\n\r\nimport { T } from \"../../../../../../../_ovlclient/src/global/globals\"\r\n\r\nexport class ScreenPackaging extends SYSBaseElement {\r\n async getUI() {\r\n let filterHint\r\n if (\r\n this.state.app.global.PKG.tables.PKGPackaging.tableDef.PKGPackaging\r\n .uiState.filter.filterCustom[\"NotFinished\"].active\r\n ) {\r\n filterHint = `(${T(\"PKGPackagingPackagingFilterNotFinished\")})`\r\n } else {\r\n filterHint = \"(Alle)\"\r\n }\r\n return html`\r\n
    \r\n
    \r\n
    \r\n

    \r\n ${T(\"PKGPackagingPackagingForCustomer\", [\r\n this.state.app.screens.PKGPackagingCustomerChooser.customerInfo\r\n .cardCode,\r\n this.state.app.screens.PKGPackagingCustomerChooser.customerInfo\r\n .cardName,\r\n ])}\r\n ${filterHint}\r\n

    \r\n
    \r\n
    \r\n\r\n
    \r\n \"PKGPackaging\"}\r\n >\r\n \r\n
    \r\n
    \r\n `\r\n }\r\n}\r\n","import { html, SYSBaseElement } from \"../../../../../../../_ovlclient/src\"\r\nimport { ScreenNavigateTo } from \"../../../../../../../_ovlclient/src/library/screenapi\"\r\nimport { T } from \"../../../../../../../_ovlclient/src/global/globals\"\r\n\r\nimport { TableRefresh } from \"../../../../../../../_ovlclient/src/library/table/tableapi\"\r\nimport { SortGet } from \"../../../../../../../_ovlclient/src/global/globalapi\"\r\n\r\nexport class ScreenPackagingCustomerChooser extends SYSBaseElement {\r\n customerInformation: {}\r\n async getUI() {\r\n let allDataState = this.state.app.global.PKG.tables.PKGPackaging.data\r\n this.customerInformation = Object.keys(allDataState).reduce((val, k) => {\r\n if (!val[allDataState[k].CardCode]) {\r\n val[allDataState[k].CardCode] = {\r\n cardName: allDataState[k].CardName,\r\n orders: {},\r\n }\r\n }\r\n if (!val[allDataState[k].CardCode].orders[allDataState[k].DocNum]) {\r\n val[allDataState[k].CardCode].orders[allDataState[k].DocNum] = {\r\n posCount: 0,\r\n }\r\n }\r\n val[allDataState[k].CardCode].orders[allDataState[k].DocNum].posCount++\r\n return val\r\n }, {})\r\n let customerInformationSortedKeys = Object.keys(\r\n this.customerInformation\r\n ).sort((a, b) =>\r\n SortGet(\r\n this.customerInformation[a].cardName,\r\n this.customerInformation[b].cardName\r\n )\r\n )\r\n const handleClick = async (cardCode: string) => {\r\n this.state.app.screens.PKGPackagingCustomerChooser.customerInfo.cardCode =\r\n cardCode\r\n this.state.app.screens.PKGPackagingCustomerChooser.customerInfo.cardName =\r\n this.customerInformation[cardCode].cardName\r\n\r\n await TableRefresh(\"PKGPackaging\", {\r\n staticFilter: { CardCode: cardCode },\r\n fetchData: false,\r\n resetStrategy: { Filter: true, Sort: true, Selection: true },\r\n })\r\n ScreenNavigateTo(\"PKGPackaging\")\r\n }\r\n return html`\r\n
    \r\n
    \r\n
    \r\n

    \r\n ${T(\"PKGPackagingPackagingCustomerChooser\")}\r\n

    \r\n
    \r\n
    \r\n
    \r\n ${customerInformationSortedKeys.map(\r\n (m) => html`
    \r\n handleClick(m)}\r\n >\r\n
    \r\n
    \r\n
    \r\n ${this.customerInformation[m].cardName}\r\n
    \r\n ${Object.keys(this.customerInformation[m].orders)\r\n .length}\r\n
    \r\n
    \r\n \r\n
    `\r\n )}\r\n
    \r\n
    \r\n `\r\n }\r\n}\r\n","import {\r\n OvlAddScreen,\r\n OvlAddDialog,\r\n} from \"../../../../../../_ovlclient/src/global/globals\"\r\nimport { DialogPKGPackagingSplit } from \"../../features/pkgpackaging/packaging/packagingsplit/packagingsplit\"\r\nimport { ScreenPackaging } from \"./packaging/packaging\"\r\nimport { ScreenPackagingCustomerChooser } from \"./packagingcustomerchooser/packagingcustomerchooser\"\r\n\r\nexport const PKGPackaging_Init = () => {\r\n OvlAddScreen(ScreenPackagingCustomerChooser, \"PKGPackagingCustomerChooser\")\r\n OvlAddScreen(ScreenPackaging, \"PKGPackaging\")\r\n OvlAddDialog(DialogPKGPackagingSplit, \"PKGPackagingSplit\")\r\n}\r\n","import { SYSBaseElement, html } from \"../../../../../../_ovlclient/src\"\r\nimport { FileGet } from \"../../../../../../_ovlclient/src/global/globalapi\"\r\nimport { FileType } from \"../filelist/filelist\"\r\n\r\nexport type DownloadPopup = {\r\n activePopupKey: string\r\n docNum: string\r\n documentScreensState: any\r\n documentDetailsState: any\r\n\r\n popupId: string\r\n type: string\r\n}\r\n\r\nexport class CompDownloadPopup extends SYSBaseElement {\r\n props: any\r\n popupState: DownloadPopup\r\n async init() {\r\n this.popupState = this.props()\r\n await super.init()\r\n }\r\n\r\n handleFile(e: Event, fileName: string, fileType: FileType, docNum: string) {\r\n e.preventDefault()\r\n this.actions.app.global.actions.TogglePDFPopup({\r\n key: this.popupState.popupId,\r\n obj: this.popupState.documentScreensState,\r\n })\r\n let data = { cat: fileType, id1: fileName, id2: docNum, ext: \"\" }\r\n FileGet(data)\r\n }\r\n async getUI() {\r\n const handlePDFPopup = (e: Event) => {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n //@ts-ignore\r\n if (!e.target.disabled) {\r\n let id = e.target\r\n //@ts-ignore\r\n .getAttribute(\"aria-controls\")\r\n .replace(this.popupState.popupId, \"\")\r\n if (this.popupState.activePopupKey === id) {\r\n id = \"\"\r\n }\r\n this.actions.app.global.actions.TogglePDFPopup({\r\n key: id,\r\n obj: this.popupState.documentScreensState,\r\n })\r\n }\r\n }\r\n\r\n let files: File[]\r\n if (this.popupState.type === \"Order\") {\r\n files =\r\n this.popupState.documentDetailsState[this.popupState.docNum].steps[\r\n \"step2\"\r\n ].attachments.files\r\n } else {\r\n files =\r\n this.popupState.documentDetailsState[this.popupState.docNum].attachments\r\n .files\r\n }\r\n\r\n return html`
    \r\n
    \r\n \r\n \r\n \r\n
    \r\n m.type === \"Order\").length === 0)}\r\n id=${this.popupState.popupId + this.popupState.docNum}\r\n >\r\n \r\n
    \r\n `\r\n }\r\n}\r\n","import { SYSBaseElement, html } from \"../../../../../../_ovlclient/src\"\r\n\r\nimport { T } from \"../../../../../../_ovlclient/src/textapi\"\r\nimport { FileGet } from \"../../../../../../_ovlclient/src/global/globalapi\"\r\n\r\nexport type FileList = {\r\n files: File[]\r\n}\r\n\r\nexport type FileType =\r\n | \"MainAttachment\"\r\n | \"PartnerAttachment\"\r\n | \"Order\"\r\n | \"OrderAttachment\"\r\n | \"StepConfirmation\"\r\n | \"StepAVOR\"\r\n | \"StepProduction\"\r\n | \"StepDelivery\"\r\n | \"Quotation\"\r\n | \"Invoice\"\r\n | \"DPInvoice\"\r\n | \"Test\"\r\n\r\nexport type File = {\r\n type: FileType\r\n fileName: string\r\n}\r\n\r\ntype PopupState = {\r\n activeFilePopup: string\r\n}\r\nexport type TogglePDFPopupState = {\r\n key: string\r\n obj: PopupState\r\n}\r\n\r\nexport class CompFileList extends SYSBaseElement {\r\n props: any\r\n fileData: { fileList: File[]; title: string }\r\n // init() {\r\n // }\r\n handleFile(e: Event, fileName: string, fileType: FileType) {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n let docNum =\r\n this.state.app.screens.DATOrder.orderDetailFormState.selectedOrder\r\n FileGet({\r\n ext: \"\",\r\n id1: fileName,\r\n cat: fileType,\r\n id2: docNum,\r\n })\r\n }\r\n\r\n async getUI() {\r\n this.fileData = this.props(this.state)\r\n let title\r\n if (!this.fileData.title) {\r\n title = T(\"GENFileName\")\r\n } else {\r\n title = this.fileData.title\r\n }\r\n\r\n if (!this.fileData.fileList) {\r\n return null\r\n }\r\n return html`\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${this.fileData.fileList.map((f) => {\r\n if (f.type === \"MainAttachment\") {\r\n let endNames = f.fileName.split(\".\")\r\n let toCheck = endNames[endNames.length - 2]\r\n let toCheckEnd = toCheck.substring(toCheck.length - 3)\r\n if (\r\n !(\r\n this.state.ovl.session.Language.toLowerCase() ===\r\n toCheckEnd.substring(1).toLowerCase() ||\r\n toCheckEnd.indexOf(\"_\") < 0\r\n )\r\n ) {\r\n return html``\r\n }\r\n }\r\n\r\n return html`\r\n \r\n \r\n \r\n `\r\n })}\r\n \r\n
    ${title}
    \r\n {\r\n this.handleFile(e, f.fileName, f.type)\r\n }}\r\n class=\"fd-link fd-has-font-weight-semi\"\r\n >${f.fileName}\r\n
    \r\n `\r\n }\r\n}\r\n","/*!\n * Chart.js v4.0.1\n * https://www.chartjs.org\n * (c) 2022 Chart.js Contributors\n * Released under the MIT License\n */\n/**\n * @namespace Chart.helpers\n */ /**\n * An empty function that can be used, for example, for optional callback.\n */ function noop() {\n/* noop */ }\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */ const uid = (()=>{\n let id = 0;\n return ()=>id++;\n})();\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function isNullOrUndef(value) {\n return value === null || typeof value === 'undefined';\n}\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */ function isArray(value) {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function isObject(value) {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */ function isNumberFinite(value) {\n return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */ function finiteOrDefault(value, defaultValue) {\n return isNumberFinite(value) ? value : defaultValue;\n}\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */ function valueOrDefault(value, defaultValue) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\nconst toPercentage = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 : +value / dimension;\nconst toDimension = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 * dimension : +value;\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */ function callback(fn, args, thisArg) {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\nfunction each(loopable, fn, thisArg, reverse) {\n let i, len, keys;\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for(i = len - 1; i >= 0; i--){\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for(i = 0; i < len; i++){\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for(i = 0; i < len; i++){\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */ function _elementsEqual(a0, a1) {\n let i, ilen, v0, v1;\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n for(i = 0, ilen = a0.length; i < ilen; ++i){\n v0 = a0[i];\n v1 = a1[i];\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n return true;\n}\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */ function clone$1(source) {\n if (isArray(source)) {\n return source.map(clone$1);\n }\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n for(; k < klen; ++k){\n target[keys[k]] = clone$1(source[keys[k]]);\n }\n return target;\n }\n return source;\n}\nfunction isValidKey(key) {\n return [\n '__proto__',\n 'prototype',\n 'constructor'\n ].indexOf(key) === -1;\n}\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */ function _merger(key, target, source, options) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n merge(tval, sval, options);\n } else {\n target[key] = clone$1(sval);\n }\n}\nfunction merge(target, source, options) {\n const sources = isArray(source) ? source : [\n source\n ];\n const ilen = sources.length;\n if (!isObject(target)) {\n return target;\n }\n options = options || {};\n const merger = options.merger || _merger;\n let current;\n for(let i = 0; i < ilen; ++i){\n current = sources[i];\n if (!isObject(current)) {\n continue;\n }\n const keys = Object.keys(current);\n for(let k = 0, klen = keys.length; k < klen; ++k){\n merger(keys[k], target, current, options);\n }\n }\n return target;\n}\nfunction mergeIf(target, source) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return merge(target, source, {\n merger: _mergerIf\n });\n}\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */ function _mergerIf(key, target, source) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone$1(sval);\n }\n}\n/**\n * @private\n */ function _deprecated(scope, value, previous, current) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous + '\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n '': (v)=>v,\n // default resolvers\n x: (o)=>o.x,\n y: (o)=>o.y\n};\n/**\n * @private\n */ function _splitKey(key) {\n const parts = key.split('.');\n const keys = [];\n let tmp = '';\n for (const part of parts){\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\nfunction _getKeyResolver(key) {\n const keys = _splitKey(key);\n return (obj)=>{\n for (const k of keys){\n if (k === '') {\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\nfunction resolveObjectKey(obj, key) {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\n/**\n * @private\n */ function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nconst defined = (value)=>typeof value !== 'undefined';\nconst isFunction = (value)=>typeof value === 'function';\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nconst setsEqual = (a, b)=>{\n if (a.size !== b.size) {\n return false;\n }\n for (const item of a){\n if (!b.has(item)) {\n return false;\n }\n }\n return true;\n};\n/**\n * @param e - The event\n * @private\n */ function _isClickEvent(e) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */ const PI = Math.PI;\nconst TAU = 2 * PI;\nconst PITAU = TAU + PI;\nconst INFINITY = Number.POSITIVE_INFINITY;\nconst RAD_PER_DEG = PI / 180;\nconst HALF_PI = PI / 2;\nconst QUARTER_PI = PI / 4;\nconst TWO_THIRDS_PI = PI * 2 / 3;\nconst log10 = Math.log10;\nconst sign = Math.sign;\nfunction almostEquals(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n}\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */ function niceNum(range) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */ function _factorize(value) {\n const result = [];\n const sqrt = Math.sqrt(value);\n let i;\n for(i = 1; i < sqrt; i++){\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) {\n result.push(sqrt);\n }\n result.sort((a, b)=>a - b).pop();\n return result;\n}\nfunction isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction almostWhole(x, epsilon) {\n const rounded = Math.round(x);\n return rounded - epsilon <= x && rounded + epsilon >= x;\n}\n/**\n * @private\n */ function _setMinAndMaxByKey(array, target, property) {\n let i, ilen, value;\n for(i = 0, ilen = array.length; i < ilen; i++){\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\nfunction toRadians(degrees) {\n return degrees * (PI / 180);\n}\nfunction toDegrees(radians) {\n return radians * (180 / PI);\n}\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */ function _decimalPlaces(x) {\n if (!isNumberFinite(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while(Math.round(x * e) / e !== x){\n e *= 10;\n p++;\n }\n return p;\n}\n// Gets the angle from vertical upright to the point about a centre.\nfunction getAngleFromPoint(centrePoint, anglePoint) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n if (angle < -0.5 * PI) {\n angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\nfunction distanceBetweenPoints(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */ function _angleDiff(a, b) {\n return (a - b + PITAU) % TAU - PI;\n}\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */ function _normalizeAngle(a) {\n return (a % TAU + TAU) % TAU;\n}\n/**\n * @private\n */ function _angleBetween(angle, start, end, sameAngleIsFullCircle) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle;\n}\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */ function _limitValue(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n/**\n * @param {number} value\n * @private\n */ function _int16Range(value) {\n return _limitValue(value, -32768, 32767);\n}\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */ function _isBetween(value, start, end, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n\nfunction _lookup(table, value, cmp) {\n cmp = cmp || ((index)=>table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid;\n while(hi - lo > 1){\n mid = lo + hi >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return {\n lo,\n hi\n };\n}\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */ const _lookupByKey = (table, key, value, last)=>_lookup(table, value, last ? (index)=>{\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n } : (index)=>table[index][key] < value);\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */ const _rlookupByKey = (table, key, value)=>_lookup(table, value, (index)=>table[index][key] >= value);\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */ function _filterBetween(values, min, max) {\n let start = 0;\n let end = values.length;\n while(start < end && values[start] < min){\n start++;\n }\n while(end > start && values[end - 1] > max){\n end--;\n }\n return start > 0 || end < values.length ? values.slice(start, end) : values;\n}\nconst arrayEvents = [\n 'push',\n 'pop',\n 'shift',\n 'splice',\n 'unshift'\n];\nfunction listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [\n listener\n ]\n }\n });\n arrayEvents.forEach((key)=>{\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value (...args) {\n const res = base.apply(this, args);\n array._chartjs.listeners.forEach((object)=>{\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n return res;\n }\n });\n });\n}\nfunction unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n if (listeners.length > 0) {\n return;\n }\n arrayEvents.forEach((key)=>{\n delete array[key];\n });\n delete array._chartjs;\n}\n/**\n * @param items\n */ function _arrayUnique(items) {\n const set = new Set();\n let i, ilen;\n for(i = 0, ilen = items.length; i < ilen; ++i){\n set.add(items[i]);\n }\n if (set.size === ilen) {\n return items;\n }\n return Array.from(set);\n}\n\nfunction fontString(pixelSize, fontStyle, fontFamily) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n/**\n* Request animation polyfill\n*/ const requestAnimFrame = function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}();\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */ function throttled(fn, thisArg) {\n let ticking = false;\n return function(...args) {\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, ()=>{\n ticking = false;\n fn.apply(thisArg, args);\n });\n }\n };\n}\n/**\n * Debounces calling `fn` for `delay` ms\n */ function debounce(fn, delay) {\n let timeout;\n return function(...args) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */ const _toLeftRightCenter = (align)=>align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */ const _alignStartEnd = (align, start, end)=>align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */ const _textX = (align, left, right, rtl)=>{\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n/**\n * Return start and count of visible points.\n * @private\n */ function _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) {\n const pointCount = points.length;\n let start = 0;\n let count = pointCount;\n if (meta._sorted) {\n const { iScale , _parsed } = meta;\n const axis = iScale.axis;\n const { min , max , minDefined , maxDefined } = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(Math.min(// @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, min).lo, // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo), 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(// @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1, // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1), start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n return {\n start,\n count\n };\n}\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */ function _scaleRangesChanged(meta) {\n const { xScale , yScale , _scaleRanges } = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n\nconst atEdge = (t)=>t === 0 || t === 1;\nconst elasticIn = (t, s, p)=>-(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t, s, p)=>Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */ const effects = {\n linear: (t)=>t,\n easeInQuad: (t)=>t * t,\n easeOutQuad: (t)=>-t * (t - 2),\n easeInOutQuad: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1),\n easeInCubic: (t)=>t * t * t,\n easeOutCubic: (t)=>(t -= 1) * t * t + 1,\n easeInOutCubic: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2),\n easeInQuart: (t)=>t * t * t * t,\n easeOutQuart: (t)=>-((t -= 1) * t * t * t - 1),\n easeInOutQuart: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2),\n easeInQuint: (t)=>t * t * t * t * t,\n easeOutQuint: (t)=>(t -= 1) * t * t * t * t + 1,\n easeInOutQuint: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2),\n easeInSine: (t)=>-Math.cos(t * HALF_PI) + 1,\n easeOutSine: (t)=>Math.sin(t * HALF_PI),\n easeInOutSine: (t)=>-0.5 * (Math.cos(PI * t) - 1),\n easeInExpo: (t)=>t === 0 ? 0 : Math.pow(2, 10 * (t - 1)),\n easeOutExpo: (t)=>t === 1 ? 1 : -Math.pow(2, -10 * t) + 1,\n easeInOutExpo: (t)=>atEdge(t) ? t : t < 0.5 ? 0.5 * Math.pow(2, 10 * (t * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n easeInCirc: (t)=>t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1),\n easeOutCirc: (t)=>Math.sqrt(1 - (t -= 1) * t),\n easeInOutCirc: (t)=>(t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n easeInElastic: (t)=>atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n easeOutElastic: (t)=>atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n easeInOutElastic (t) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t : t < 0.5 ? 0.5 * elasticIn(t * 2, s, p) : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n easeInBack (t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n easeOutBack (t) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n easeInOutBack (t) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);\n },\n easeInBounce: (t)=>1 - effects.easeOutBounce(1 - t),\n easeOutBounce (t) {\n const m = 7.5625;\n const d = 2.75;\n if (t < 1 / d) {\n return m * t * t;\n }\n if (t < 2 / d) {\n return m * (t -= 1.5 / d) * t + 0.75;\n }\n if (t < 2.5 / d) {\n return m * (t -= 2.25 / d) * t + 0.9375;\n }\n return m * (t -= 2.625 / d) * t + 0.984375;\n },\n easeInOutBounce: (t)=>t < 0.5 ? effects.easeInBounce(t * 2) * 0.5 : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5\n};\nvar effects$1 = effects;\n\n/*!\n * @kurkle/color v0.2.1\n * https://github.com/kurkle/color#readme\n * (c) 2022 Jukka Kurkela\n * Released under the MIT License\n */\nfunction round(v) {\n return v + 0.5 | 0;\n}\nconst lim = (v, l, h) => Math.max(Math.min(v, h), l);\nfunction p2b(v) {\n return lim(round(v * 2.55), 0, 255);\n}\nfunction n2b(v) {\n return lim(round(v * 255), 0, 255);\n}\nfunction b2n(v) {\n return lim(round(v / 2.55) / 100, 0, 1);\n}\nfunction n2p(v) {\n return lim(round(v * 100), 0, 100);\n}\nconst map$1 = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15};\nconst hex = [...'0123456789ABCDEF'];\nconst h1 = b => hex[b & 0xF];\nconst h2 = b => hex[(b & 0xF0) >> 4] + hex[b & 0xF];\nconst eq = b => ((b & 0xF0) >> 4) === (b & 0xF);\nconst isShort = v => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);\nfunction hexParse(str) {\n var len = str.length;\n var ret;\n if (str[0] === '#') {\n if (len === 4 || len === 5) {\n ret = {\n r: 255 & map$1[str[1]] * 17,\n g: 255 & map$1[str[2]] * 17,\n b: 255 & map$1[str[3]] * 17,\n a: len === 5 ? map$1[str[4]] * 17 : 255\n };\n } else if (len === 7 || len === 9) {\n ret = {\n r: map$1[str[1]] << 4 | map$1[str[2]],\n g: map$1[str[3]] << 4 | map$1[str[4]],\n b: map$1[str[5]] << 4 | map$1[str[6]],\n a: len === 9 ? (map$1[str[7]] << 4 | map$1[str[8]]) : 255\n };\n }\n }\n return ret;\n}\nconst alpha = (a, f) => a < 255 ? f(a) : '';\nfunction hexString(v) {\n var f = isShort(v) ? h1 : h2;\n return v\n ? '#' + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f)\n : undefined;\n}\nconst HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction hsl2rgbn(h, s, l) {\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [f(0), f(8), f(4)];\n}\nfunction hsv2rgbn(h, s, v) {\n const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n return [f(5), f(3), f(1)];\n}\nfunction hwb2rgbn(h, w, b) {\n const rgb = hsl2rgbn(h, 1, 0.5);\n let i;\n if (w + b > 1) {\n i = 1 / (w + b);\n w *= i;\n b *= i;\n }\n for (i = 0; i < 3; i++) {\n rgb[i] *= 1 - w - b;\n rgb[i] += w;\n }\n return rgb;\n}\nfunction hueValue(r, g, b, d, max) {\n if (r === max) {\n return ((g - b) / d) + (g < b ? 6 : 0);\n }\n if (g === max) {\n return (b - r) / d + 2;\n }\n return (r - g) / d + 4;\n}\nfunction rgb2hsl(v) {\n const range = 255;\n const r = v.r / range;\n const g = v.g / range;\n const b = v.b / range;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s, d;\n if (max !== min) {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = hueValue(r, g, b, d, max);\n h = h * 60 + 0.5;\n }\n return [h | 0, s || 0, l];\n}\nfunction calln(f, a, b, c) {\n return (\n Array.isArray(a)\n ? f(a[0], a[1], a[2])\n : f(a, b, c)\n ).map(n2b);\n}\nfunction hsl2rgb(h, s, l) {\n return calln(hsl2rgbn, h, s, l);\n}\nfunction hwb2rgb(h, w, b) {\n return calln(hwb2rgbn, h, w, b);\n}\nfunction hsv2rgb(h, s, v) {\n return calln(hsv2rgbn, h, s, v);\n}\nfunction hue(h) {\n return (h % 360 + 360) % 360;\n}\nfunction hueParse(str) {\n const m = HUE_RE.exec(str);\n let a = 255;\n let v;\n if (!m) {\n return;\n }\n if (m[5] !== v) {\n a = m[6] ? p2b(+m[5]) : n2b(+m[5]);\n }\n const h = hue(+m[2]);\n const p1 = +m[3] / 100;\n const p2 = +m[4] / 100;\n if (m[1] === 'hwb') {\n v = hwb2rgb(h, p1, p2);\n } else if (m[1] === 'hsv') {\n v = hsv2rgb(h, p1, p2);\n } else {\n v = hsl2rgb(h, p1, p2);\n }\n return {\n r: v[0],\n g: v[1],\n b: v[2],\n a: a\n };\n}\nfunction rotate(v, deg) {\n var h = rgb2hsl(v);\n h[0] = hue(h[0] + deg);\n h = hsl2rgb(h);\n v.r = h[0];\n v.g = h[1];\n v.b = h[2];\n}\nfunction hslString(v) {\n if (!v) {\n return;\n }\n const a = rgb2hsl(v);\n const h = a[0];\n const s = n2p(a[1]);\n const l = n2p(a[2]);\n return v.a < 255\n ? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`\n : `hsl(${h}, ${s}%, ${l}%)`;\n}\nconst map = {\n x: 'dark',\n Z: 'light',\n Y: 're',\n X: 'blu',\n W: 'gr',\n V: 'medium',\n U: 'slate',\n A: 'ee',\n T: 'ol',\n S: 'or',\n B: 'ra',\n C: 'lateg',\n D: 'ights',\n R: 'in',\n Q: 'turquois',\n E: 'hi',\n P: 'ro',\n O: 'al',\n N: 'le',\n M: 'de',\n L: 'yello',\n F: 'en',\n K: 'ch',\n G: 'arks',\n H: 'ea',\n I: 'ightg',\n J: 'wh'\n};\nconst names$1 = {\n OiceXe: 'f0f8ff',\n antiquewEte: 'faebd7',\n aqua: 'ffff',\n aquamarRe: '7fffd4',\n azuY: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '0',\n blanKedOmond: 'ffebcd',\n Xe: 'ff',\n XeviTet: '8a2be2',\n bPwn: 'a52a2a',\n burlywood: 'deb887',\n caMtXe: '5f9ea0',\n KartYuse: '7fff00',\n KocTate: 'd2691e',\n cSO: 'ff7f50',\n cSnflowerXe: '6495ed',\n cSnsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: 'ffff',\n xXe: '8b',\n xcyan: '8b8b',\n xgTMnPd: 'b8860b',\n xWay: 'a9a9a9',\n xgYF: '6400',\n xgYy: 'a9a9a9',\n xkhaki: 'bdb76b',\n xmagFta: '8b008b',\n xTivegYF: '556b2f',\n xSange: 'ff8c00',\n xScEd: '9932cc',\n xYd: '8b0000',\n xsOmon: 'e9967a',\n xsHgYF: '8fbc8f',\n xUXe: '483d8b',\n xUWay: '2f4f4f',\n xUgYy: '2f4f4f',\n xQe: 'ced1',\n xviTet: '9400d3',\n dAppRk: 'ff1493',\n dApskyXe: 'bfff',\n dimWay: '696969',\n dimgYy: '696969',\n dodgerXe: '1e90ff',\n fiYbrick: 'b22222',\n flSOwEte: 'fffaf0',\n foYstWAn: '228b22',\n fuKsia: 'ff00ff',\n gaRsbSo: 'dcdcdc',\n ghostwEte: 'f8f8ff',\n gTd: 'ffd700',\n gTMnPd: 'daa520',\n Way: '808080',\n gYF: '8000',\n gYFLw: 'adff2f',\n gYy: '808080',\n honeyMw: 'f0fff0',\n hotpRk: 'ff69b4',\n RdianYd: 'cd5c5c',\n Rdigo: '4b0082',\n ivSy: 'fffff0',\n khaki: 'f0e68c',\n lavFMr: 'e6e6fa',\n lavFMrXsh: 'fff0f5',\n lawngYF: '7cfc00',\n NmoncEffon: 'fffacd',\n ZXe: 'add8e6',\n ZcSO: 'f08080',\n Zcyan: 'e0ffff',\n ZgTMnPdLw: 'fafad2',\n ZWay: 'd3d3d3',\n ZgYF: '90ee90',\n ZgYy: 'd3d3d3',\n ZpRk: 'ffb6c1',\n ZsOmon: 'ffa07a',\n ZsHgYF: '20b2aa',\n ZskyXe: '87cefa',\n ZUWay: '778899',\n ZUgYy: '778899',\n ZstAlXe: 'b0c4de',\n ZLw: 'ffffe0',\n lime: 'ff00',\n limegYF: '32cd32',\n lRF: 'faf0e6',\n magFta: 'ff00ff',\n maPon: '800000',\n VaquamarRe: '66cdaa',\n VXe: 'cd',\n VScEd: 'ba55d3',\n VpurpN: '9370db',\n VsHgYF: '3cb371',\n VUXe: '7b68ee',\n VsprRggYF: 'fa9a',\n VQe: '48d1cc',\n VviTetYd: 'c71585',\n midnightXe: '191970',\n mRtcYam: 'f5fffa',\n mistyPse: 'ffe4e1',\n moccasR: 'ffe4b5',\n navajowEte: 'ffdead',\n navy: '80',\n Tdlace: 'fdf5e6',\n Tive: '808000',\n TivedBb: '6b8e23',\n Sange: 'ffa500',\n SangeYd: 'ff4500',\n ScEd: 'da70d6',\n pOegTMnPd: 'eee8aa',\n pOegYF: '98fb98',\n pOeQe: 'afeeee',\n pOeviTetYd: 'db7093',\n papayawEp: 'ffefd5',\n pHKpuff: 'ffdab9',\n peru: 'cd853f',\n pRk: 'ffc0cb',\n plum: 'dda0dd',\n powMrXe: 'b0e0e6',\n purpN: '800080',\n YbeccapurpN: '663399',\n Yd: 'ff0000',\n Psybrown: 'bc8f8f',\n PyOXe: '4169e1',\n saddNbPwn: '8b4513',\n sOmon: 'fa8072',\n sandybPwn: 'f4a460',\n sHgYF: '2e8b57',\n sHshell: 'fff5ee',\n siFna: 'a0522d',\n silver: 'c0c0c0',\n skyXe: '87ceeb',\n UXe: '6a5acd',\n UWay: '708090',\n UgYy: '708090',\n snow: 'fffafa',\n sprRggYF: 'ff7f',\n stAlXe: '4682b4',\n tan: 'd2b48c',\n teO: '8080',\n tEstN: 'd8bfd8',\n tomato: 'ff6347',\n Qe: '40e0d0',\n viTet: 'ee82ee',\n JHt: 'f5deb3',\n wEte: 'ffffff',\n wEtesmoke: 'f5f5f5',\n Lw: 'ffff00',\n LwgYF: '9acd32'\n};\nfunction unpack() {\n const unpacked = {};\n const keys = Object.keys(names$1);\n const tkeys = Object.keys(map);\n let i, j, k, ok, nk;\n for (i = 0; i < keys.length; i++) {\n ok = nk = keys[i];\n for (j = 0; j < tkeys.length; j++) {\n k = tkeys[j];\n nk = nk.replace(k, map[k]);\n }\n k = parseInt(names$1[ok], 16);\n unpacked[nk] = [k >> 16 & 0xFF, k >> 8 & 0xFF, k & 0xFF];\n }\n return unpacked;\n}\nlet names;\nfunction nameParse(str) {\n if (!names) {\n names = unpack();\n names.transparent = [0, 0, 0, 0];\n }\n const a = names[str.toLowerCase()];\n return a && {\n r: a[0],\n g: a[1],\n b: a[2],\n a: a.length === 4 ? a[3] : 255\n };\n}\nconst RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction rgbParse(str) {\n const m = RGB_RE.exec(str);\n let a = 255;\n let r, g, b;\n if (!m) {\n return;\n }\n if (m[7] !== r) {\n const v = +m[7];\n a = m[8] ? p2b(v) : lim(v * 255, 0, 255);\n }\n r = +m[1];\n g = +m[3];\n b = +m[5];\n r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255));\n g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255));\n b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255));\n return {\n r: r,\n g: g,\n b: b,\n a: a\n };\n}\nfunction rgbString(v) {\n return v && (\n v.a < 255\n ? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`\n : `rgb(${v.r}, ${v.g}, ${v.b})`\n );\n}\nconst to = v => v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst from = v => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction interpolate(rgb1, rgb2, t) {\n const r = from(b2n(rgb1.r));\n const g = from(b2n(rgb1.g));\n const b = from(b2n(rgb1.b));\n return {\n r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))),\n g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))),\n b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))),\n a: rgb1.a + t * (rgb2.a - rgb1.a)\n };\n}\nfunction modHSL(v, i, ratio) {\n if (v) {\n let tmp = rgb2hsl(v);\n tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n tmp = hsl2rgb(tmp);\n v.r = tmp[0];\n v.g = tmp[1];\n v.b = tmp[2];\n }\n}\nfunction clone(v, proto) {\n return v ? Object.assign(proto || {}, v) : v;\n}\nfunction fromObject(input) {\n var v = {r: 0, g: 0, b: 0, a: 255};\n if (Array.isArray(input)) {\n if (input.length >= 3) {\n v = {r: input[0], g: input[1], b: input[2], a: 255};\n if (input.length > 3) {\n v.a = n2b(input[3]);\n }\n }\n } else {\n v = clone(input, {r: 0, g: 0, b: 0, a: 1});\n v.a = n2b(v.a);\n }\n return v;\n}\nfunction functionParse(str) {\n if (str.charAt(0) === 'r') {\n return rgbParse(str);\n }\n return hueParse(str);\n}\nclass Color {\n constructor(input) {\n if (input instanceof Color) {\n return input;\n }\n const type = typeof input;\n let v;\n if (type === 'object') {\n v = fromObject(input);\n } else if (type === 'string') {\n v = hexParse(input) || nameParse(input) || functionParse(input);\n }\n this._rgb = v;\n this._valid = !!v;\n }\n get valid() {\n return this._valid;\n }\n get rgb() {\n var v = clone(this._rgb);\n if (v) {\n v.a = b2n(v.a);\n }\n return v;\n }\n set rgb(obj) {\n this._rgb = fromObject(obj);\n }\n rgbString() {\n return this._valid ? rgbString(this._rgb) : undefined;\n }\n hexString() {\n return this._valid ? hexString(this._rgb) : undefined;\n }\n hslString() {\n return this._valid ? hslString(this._rgb) : undefined;\n }\n mix(color, weight) {\n if (color) {\n const c1 = this.rgb;\n const c2 = color.rgb;\n let w2;\n const p = weight === w2 ? 0.5 : weight;\n const w = 2 * p - 1;\n const a = c1.a - c2.a;\n const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n w2 = 1 - w1;\n c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n c1.a = p * c1.a + (1 - p) * c2.a;\n this.rgb = c1;\n }\n return this;\n }\n interpolate(color, t) {\n if (color) {\n this._rgb = interpolate(this._rgb, color._rgb, t);\n }\n return this;\n }\n clone() {\n return new Color(this.rgb);\n }\n alpha(a) {\n this._rgb.a = n2b(a);\n return this;\n }\n clearer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 - ratio;\n return this;\n }\n greyscale() {\n const rgb = this._rgb;\n const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n rgb.r = rgb.g = rgb.b = val;\n return this;\n }\n opaquer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 + ratio;\n return this;\n }\n negate() {\n const v = this._rgb;\n v.r = 255 - v.r;\n v.g = 255 - v.g;\n v.b = 255 - v.b;\n return this;\n }\n lighten(ratio) {\n modHSL(this._rgb, 2, ratio);\n return this;\n }\n darken(ratio) {\n modHSL(this._rgb, 2, -ratio);\n return this;\n }\n saturate(ratio) {\n modHSL(this._rgb, 1, ratio);\n return this;\n }\n desaturate(ratio) {\n modHSL(this._rgb, 1, -ratio);\n return this;\n }\n rotate(deg) {\n rotate(this._rgb, deg);\n return this;\n }\n}\nfunction index_esm(input) {\n return new Color(input);\n}\n\nfunction isPatternOrGradient(value) {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n return false;\n}\nfunction color(value) {\n return isPatternOrGradient(value) ? value : index_esm(value);\n}\nfunction getHoverColor(value) {\n return isPatternOrGradient(value) ? value : index_esm(value).saturate(0.5).darken(0.1).hexString();\n}\n\nconst numbers = [\n 'x',\n 'y',\n 'borderWidth',\n 'radius',\n 'tension'\n];\nconst colors = [\n 'color',\n 'borderColor',\n 'backgroundColor'\n];\nfunction applyAnimationsDefaults(defaults) {\n defaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined\n });\n defaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name)=>name !== 'onProgress' && name !== 'onComplete' && name !== 'fn'\n });\n defaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n }\n });\n defaults.describe('animations', {\n _fallback: 'animation'\n });\n defaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0\n }\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: (v)=>v | 0\n }\n }\n }\n });\n}\n\nfunction applyLayoutsDefaults(defaults) {\n defaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\n\nconst intlCache = new Map();\nfunction getNumberFormat(locale, options) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\nfunction formatNumber(num, locale, options) {\n return getNumberFormat(locale, options).format(num);\n}\n\nconst formatters = {\n values (value) {\n return isArray(value) ? (value) : '' + value;\n },\n numeric (tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue;\n if (ticks.length > 1) {\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n delta = calculateDelta(tickValue, ticks);\n }\n const logDelta = log10(Math.abs(delta));\n const numDecimal = Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n const options = {\n notation,\n minimumFractionDigits: numDecimal,\n maximumFractionDigits: numDecimal\n };\n Object.assign(options, this.options.ticks.format);\n return formatNumber(tickValue, locale, options);\n },\n logarithmic (tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = ticks[index].significand || tickValue / Math.pow(10, Math.floor(log10(tickValue)));\n if ([\n 1,\n 2,\n 3,\n 5,\n 10,\n 15\n ].includes(remain) || index > 0.8 * ticks.length) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n};\nfunction calculateDelta(tickValue, ticks) {\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\n var Ticks = {\n formatters\n};\n\nfunction applyScaleDefaults(defaults) {\n defaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n bounds: 'ticks',\n grace: 0,\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options)=>options.lineWidth,\n tickColor: (_ctx, options)=>options.color,\n offset: false\n },\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n title: {\n display: false,\n text: '',\n padding: {\n top: 4,\n bottom: 4\n }\n },\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2\n }\n });\n defaults.route('scale.ticks', 'color', '', 'color');\n defaults.route('scale.grid', 'color', '', 'borderColor');\n defaults.route('scale.border', 'color', '', 'borderColor');\n defaults.route('scale.title', 'color', '', 'color');\n defaults.describe('scale', {\n _fallback: false,\n _scriptable: (name)=>!name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name)=>name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash'\n });\n defaults.describe('scales', {\n _fallback: 'scale'\n });\n defaults.describe('scale.ticks', {\n _scriptable: (name)=>name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name)=>name !== 'backdropPadding'\n });\n}\n\nconst overrides = Object.create(null);\nconst descriptors = Object.create(null);\n function getScope$1(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for(let i = 0, n = keys.length; i < n; ++i){\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope$1(root, scope), values);\n }\n return merge(getScope$1(root, ''), scope);\n}\n class Defaults {\n constructor(_descriptors, _appliers){\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context)=>context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options)=>getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options)=>getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options)=>getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n set(scope, values) {\n return set(this, scope, values);\n }\n get(scope) {\n return getScope$1(this, scope);\n }\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n override(scope, values) {\n return set(overrides, scope, values);\n }\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope$1(this, scope);\n const targetScopeObject = getScope$1(this, targetScope);\n const privateName = '_' + name;\n Object.defineProperties(scopeObject, {\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n [name]: {\n enumerable: true,\n get () {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set (value) {\n this[privateName] = value;\n }\n }\n });\n }\n apply(appliers) {\n appliers.forEach((apply)=>apply(this));\n }\n}\nvar defaults = /* #__PURE__ */ new Defaults({\n _scriptable: (name)=>!name.startsWith('on'),\n _indexable: (name)=>name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false\n }\n}, [\n applyAnimationsDefaults,\n applyLayoutsDefaults,\n applyScaleDefaults\n]);\n\nfunction toFontString(font) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n return (font.style ? font.style + ' ' : '') + (font.weight ? font.weight + ' ' : '') + font.size + 'px ' + font.family;\n}\n function _measureText(ctx, data, gc, longest, string) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\n function _longestText(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n ctx.save();\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i, j, jlen, thing, nestedThing;\n for(i = 0; i < ilen; i++){\n thing = arrayOfThings[i];\n if (thing !== undefined && thing !== null && isArray(thing) !== true) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n for(j = 0, jlen = thing.length; j < jlen; j++){\n nestedThing = thing[j];\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n ctx.restore();\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for(i = 0; i < gcLen; i++){\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\n function _alignPixel(chart, pixel, width) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n function clearCanvas(canvas, ctx) {\n ctx = ctx || canvas.getContext('2d');\n ctx.save();\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\nfunction drawPoint(ctx, options, x, y) {\n drawPointLegend(ctx, options, x, y, null);\n}\nfunction drawPointLegend(ctx, options, x, y, w) {\n let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n ctx.beginPath();\n switch(style){\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n case 'rectRot':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n case 'cross':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'star':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += QUARTER_PI;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n }\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\n function _isPointInArea(point, area, margin) {\n margin = margin || 0.5;\n return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;\n}\nfunction clipArea(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\nfunction unclipArea(ctx) {\n ctx.restore();\n}\n function _steppedLineTo(ctx, previous, target, flip, mode) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\n function _bezierCurveTo(ctx, previous, target, flip) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n ctx.bezierCurveTo(flip ? previous.cp1x : previous.cp2x, flip ? previous.cp1y : previous.cp2y, flip ? target.cp2x : target.cp1x, flip ? target.cp2y : target.cp1y, target.x, target.y);\n}\n function renderText(ctx, text, x, y, font, opts = {}) {\n const lines = isArray(text) ? text : [\n text\n ];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i, line;\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n for(i = 0; i < lines.length; ++i){\n line = lines[i];\n if (opts.backdrop) {\n drawBackdrop(ctx, opts.backdrop);\n }\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n y += font.lineHeight;\n }\n ctx.restore();\n}\nfunction setRenderOpts(ctx, opts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\nfunction decorateText(ctx, x, y, line, opts) {\n if (opts.strikethrough || opts.underline) {\n const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\nfunction drawBackdrop(ctx, opts) {\n const oldColor = ctx.fillStyle;\n ctx.fillStyle = opts.color;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n function addRoundedRectPath(ctx, rect) {\n const { x , y , w , h , radius } = rect;\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, -HALF_PI, PI, true);\n ctx.lineTo(x, y + h - radius.bottomLeft);\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n ctx.lineTo(x + w, y + radius.topRight);\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n ctx.lineTo(x + radius.topLeft, y);\n}\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n/**\n * @alias Chart.helpers.options\n * @namespace\n */ /**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */ function toLineHeight(value, size) {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n value = +matches[2];\n switch(matches[3]){\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n }\n return size * value;\n}\nconst numberOrZero = (v)=>+v || 0;\nfunction _readValueToProps(value, props) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value) ? objProps ? (prop)=>valueOrDefault(value[prop], value[props[prop]]) : (prop)=>value[prop] : ()=>value;\n for (const prop of keys){\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */ function toTRBL(value) {\n return _readValueToProps(value, {\n top: 'y',\n right: 'x',\n bottom: 'y',\n left: 'x'\n });\n}\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */ function toTRBLCorners(value) {\n return _readValueToProps(value, [\n 'topLeft',\n 'topRight',\n 'bottomLeft',\n 'bottomRight'\n ]);\n}\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */ function toPadding(value) {\n const obj = toTRBL(value);\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n return obj;\n}\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */ function toFont(options, fallback) {\n options = options || {};\n fallback = fallback || defaults.font;\n let size = valueOrDefault(options.size, fallback.size);\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n font.string = toFontString(font);\n return font;\n}\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */ function resolve(inputs, context, index, info) {\n let cacheable = true;\n let i, ilen, value;\n for(i = 0, ilen = inputs.length; i < ilen; ++i){\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */ function _addGrace(minmax, grace, beginAtZero) {\n const { min , max } = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value, add)=>beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\n/**\n * Create a context inheriting parentContext\n * @param parentContext\n * @param context\n * @returns\n */ function createContext(parentContext, context) {\n return Object.assign(Object.create(parentContext), context);\n}\n\nfunction _createResolver(scopes, prefixes = [\n ''\n], rootScopes = scopes, fallback, getTarget = ()=>scopes[0]) {\n if (!defined(fallback)) {\n fallback = _resolve('_fallback', scopes);\n }\n const cache = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: rootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope)=>_createResolver([\n scope,\n ...scopes\n ], prefixes, rootScopes, fallback)\n };\n return new Proxy(cache, {\n deleteProperty (target, prop) {\n delete target[prop];\n delete target._keys;\n delete scopes[0][prop];\n return true;\n },\n get (target, prop) {\n return _cached(target, prop, ()=>_resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n getOwnPropertyDescriptor (target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n getPrototypeOf () {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n has (target, prop) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n ownKeys (target) {\n return getKeysFromAllScopes(target);\n },\n set (target, prop, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value;\n delete target._keys;\n return true;\n }\n });\n}\n function _attachContext(proxy, context, subProxy, descriptorDefaults) {\n const cache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx)=>_attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope)=>_attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n deleteProperty (target, prop) {\n delete target[prop];\n delete proxy[prop];\n return true;\n },\n get (target, prop, receiver) {\n return _cached(target, prop, ()=>_resolveWithContext(target, prop, receiver));\n },\n getOwnPropertyDescriptor (target, prop) {\n return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? {\n enumerable: true,\n configurable: true\n } : undefined : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n getPrototypeOf () {\n return Reflect.getPrototypeOf(proxy);\n },\n has (target, prop) {\n return Reflect.has(proxy, prop);\n },\n ownKeys () {\n return Reflect.ownKeys(proxy);\n },\n set (target, prop, value) {\n proxy[prop] = value;\n delete target[prop];\n return true;\n }\n });\n}\n function _descriptors(proxy, defaults = {\n scriptable: true,\n indexable: true\n}) {\n const { _scriptable =defaults.scriptable , _indexable =defaults.indexable , _allKeys =defaults.allKeys } = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : ()=>_scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : ()=>_indexable\n };\n}\nconst readKey = (prefix, name)=>prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop, value)=>isObject(value) && prop !== 'adapters' && (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction _cached(target, prop, resolve) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) {\n return target[prop];\n }\n const value = resolve();\n target[prop] = value;\n return value;\n}\nfunction _resolveWithContext(target, prop, receiver) {\n const { _proxy , _context , _subProxy , _descriptors: descriptors } = target;\n let value = _proxy[prop];\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\nfunction _resolveScriptable(prop, value, target, receiver) {\n const { _proxy , _context , _subProxy , _stack } = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n value = value(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\nfunction _resolveArray(prop, value, target, isIndexable) {\n const { _proxy , _context , _subProxy , _descriptors: descriptors } = target;\n if (defined(_context.index) && isIndexable(prop)) {\n value = value[_context.index % value.length];\n } else if (isObject(value[0])) {\n const arr = value;\n const scopes = _proxy._scopes.filter((s)=>s !== arr);\n value = [];\n for (const item of arr){\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\nfunction resolveFallback(fallback, prop, value) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\nconst getScope = (key, parent)=>key === true ? parent : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\nfunction addScopes(set, parentScopes, key, parentFallback, value) {\n for (const parent of parentScopes){\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (defined(fallback) && fallback !== key && fallback !== parentFallback) {\n return fallback;\n }\n } else if (scope === false && defined(parentFallback) && key !== parentFallback) {\n return null;\n }\n }\n return false;\n}\nfunction createSubResolver(parentScopes, resolver, prop, value) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [\n ...parentScopes,\n ...rootScopes\n ];\n const set = new Set();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (defined(fallback) && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [\n ''\n ], rootScopes, fallback, ()=>subGetTarget(resolver, prop, value));\n}\nfunction addScopesFromKey(set, allScopes, key, fallback, item) {\n while(key){\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\nfunction subGetTarget(resolver, prop, value) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n return value;\n }\n return target || {};\n}\nfunction _resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n let value;\n for (const prefix of prefixes){\n value = _resolve(readKey(prefix, prop), scopes);\n if (defined(value)) {\n return needsSubResolver(prop, value) ? createSubResolver(scopes, proxy, prop, value) : value;\n }\n }\n}\nfunction _resolve(key, scopes) {\n for (const scope of scopes){\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (defined(value)) {\n return value;\n }\n }\n}\nfunction getKeysFromAllScopes(target) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\nfunction resolveKeysFromAllScopes(scopes) {\n const set = new Set();\n for (const scope of scopes){\n for (const key of Object.keys(scope).filter((k)=>!k.startsWith('_'))){\n set.add(key);\n }\n }\n return Array.from(set);\n}\nfunction _parseObjectDataRadialScale(meta, data, start, count) {\n const { iScale } = meta;\n const { key ='r' } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n\nconst EPSILON = Number.EPSILON || 1e-14;\nconst getPoint = (points, i)=>i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis)=>indexAxis === 'x' ? 'y' : 'x';\nfunction splineCurve(firstPoint, middlePoint, afterPoint, t) {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n // This function must also respect \"skipped\" points\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n/**\n * Adjust tangents to ensure monotonic properties\n */ function monotoneAdjust(points, deltaK, mK) {\n const pointsLen = points.length;\n let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(let i = 0; i < pointsLen - 1; ++i){\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\nfunction monotoneCompute(points, mK, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(let i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */ function splineCurveMonotone(points, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK = Array(pointsLen).fill(0);\n const mK = Array(pointsLen);\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : sign(deltaK[i - 1]) !== sign(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n monotoneAdjust(points, deltaK, mK);\n monotoneCompute(points, mK, indexAxis);\n}\nfunction capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n}\nfunction capBezierPoints(points, area) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for(i = 0, ilen = points.length; i < ilen; ++i){\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n/**\n * @private\n */ function _updateBezierControlPoints(points, options, area, loop, indexAxis) {\n let i, ilen, point, controlPoints;\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) {\n points = points.filter((pt)=>!pt.skip);\n }\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for(i = 0, ilen = points.length; i < ilen; ++i){\n point = points[i];\n controlPoints = splineCurve(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension);\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import(\"../core/core.controller\").default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */ /**\n * @private\n */ function _isDomSupported() {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n/**\n * @private\n */ function _getParentNode(domNode) {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = parent.host;\n }\n return parent;\n}\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */ function parseMaxStyle(styleValue, node, parentProperty) {\n let valueInPixels;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n return valueInPixels;\n}\nconst getComputedStyle = (element)=>element.ownerDocument.defaultView.getComputedStyle(element, null);\nfunction getStyle(el, property) {\n return getComputedStyle(el).getPropertyValue(property);\n}\nconst positions = [\n 'top',\n 'right',\n 'bottom',\n 'left'\n];\nfunction getPositionedStyle(styles, style, suffix) {\n const result = {};\n suffix = suffix ? '-' + suffix : '';\n for(let i = 0; i < 4; i++){\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\nconst useOffsetPos = (x, y, target)=>(x > 0 || y > 0) && (!target || !target.shadowRoot);\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */ function getCanvasPosition(e, canvas) {\n const touches = e.touches;\n const source = touches && touches.length ? touches[0] : e;\n const { offsetX , offsetY } = source;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {\n x,\n y,\n box\n };\n}\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */ function getRelativePosition(event, chart) {\n if ('native' in event) {\n return event;\n }\n const { canvas , currentDevicePixelRatio } = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const { x , y , box } = getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n let { width , height } = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\nfunction getContainerSize(canvas, width, height) {\n let maxWidth, maxHeight;\n if (width === undefined || height === undefined) {\n const container = _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\nconst round1 = (v)=>Math.round(v * 10) / 10;\n// eslint-disable-next-line complexity\nfunction getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let { width , height } = containerSize;\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = round1(width / 2);\n }\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = round1(Math.floor(height * aspectRatio));\n }\n return {\n width,\n height\n };\n}\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */ function retinaScale(chart, forceRatio, forceStyle) {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n chart.height = deviceHeight / pixelRatio;\n chart.width = deviceWidth / pixelRatio;\n const canvas = chart.canvas;\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */ const supportsEventListenerOptions = function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive () {\n passiveSupported = true;\n return false;\n }\n };\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}();\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */ function readUsedSize(element, property) {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n\n/**\n * @private\n */ function _pointInLine(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n/**\n * @private\n */ function _steppedInterpolation(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y : mode === 'after' ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y\n };\n}\n/**\n * @private\n */ function _bezierInterpolation(p1, p2, t, mode) {\n const cp1 = {\n x: p1.cp2x,\n y: p1.cp2y\n };\n const cp2 = {\n x: p2.cp1x,\n y: p2.cp1y\n };\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n\nconst getRightToLeftAdapter = function(rectX, width) {\n return {\n x (x) {\n return rectX + rectX + width - x;\n },\n setWidth (w) {\n width = w;\n },\n textAlign (align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus (x, value) {\n return x - value;\n },\n leftForLtr (x, itemWidth) {\n return x - itemWidth;\n }\n };\n};\nconst getLeftToRightAdapter = function() {\n return {\n x (x) {\n return x;\n },\n setWidth (w) {},\n textAlign (align) {\n return align;\n },\n xPlus (x, value) {\n return x + value;\n },\n leftForLtr (x, _itemWidth) {\n return x;\n }\n };\n};\nfunction getRtlAdapter(rtl, rectX, width) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\nfunction overrideTextDirection(ctx, direction) {\n let style, original;\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction'), \n ];\n style.setProperty('direction', direction, 'important');\n ctx.prevTextDirection = original;\n }\n}\nfunction restoreTextDirection(ctx, original) {\n if (original !== undefined) {\n delete ctx.prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle\n };\n }\n return {\n between: _isBetween,\n compare: (a, b)=>a - b,\n normalize: (x)=>x\n };\n}\nfunction normalizeSegment({ start , end , count , loop , style }) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\nfunction getSegment(segment, points, bounds) {\n const { property , start: startBound , end: endBound } = bounds;\n const { between , normalize } = propertyFn(property);\n const count = points.length;\n let { start , end , loop } = segment;\n let i, ilen;\n if (loop) {\n start += count;\n end += count;\n for(i = 0, ilen = count; i < ilen; ++i){\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n if (end < start) {\n end += count;\n }\n return {\n start,\n end,\n loop,\n style: segment.style\n };\n}\n function _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [\n segment\n ];\n }\n const { property , start: startBound , end: endBound } = bounds;\n const count = points.length;\n const { compare , between , normalize } = propertyFn(property);\n const { start , end , loop , style } = getSegment(segment, points, bounds);\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n const startIsBefore = ()=>between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = ()=>compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = ()=>inside || startIsBefore();\n const shouldStop = ()=>!inside || endIsBefore();\n for(let i = start, prev = start; i <= end; ++i){\n point = points[i % count];\n if (point.skip) {\n continue;\n }\n value = normalize(point[property]);\n if (value === prevValue) {\n continue;\n }\n inside = between(value, startBound, endBound);\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({\n start: subStart,\n end: i,\n loop,\n count,\n style\n }));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n if (subStart !== null) {\n result.push(normalizeSegment({\n start: subStart,\n end,\n loop,\n count,\n style\n }));\n }\n return result;\n}\n function _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n for(let i = 0; i < segments.length; i++){\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\n function findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n if (loop && !spanGaps) {\n while(start < count && !points[start].skip){\n start++;\n }\n }\n while(start < count && points[start].skip){\n start++;\n }\n start %= count;\n if (loop) {\n end += start;\n }\n while(end > start && points[end % count].skip){\n end--;\n }\n end %= count;\n return {\n start,\n end\n };\n}\n function solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n for(end = start + 1; end <= max; ++end){\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({\n start: start % count,\n end: (end - 1) % count,\n loop\n });\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n if (last !== null) {\n result.push({\n start: start % count,\n end: last % count,\n loop\n });\n }\n return result;\n}\n function _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n if (!count) {\n return [];\n }\n const loop = !!line._loop;\n const { start , end } = findStartAndEnd(points, count, loop, spanGaps);\n if (spanGaps === true) {\n return splitByStyles(line, [\n {\n start,\n end,\n loop\n }\n ], points, segmentOptions);\n }\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n function splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\n function doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const { _datasetIndex: datasetIndex , options: { spanGaps } } = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n s += count;\n while(points[s % count].skip){\n s -= dir;\n }\n while(points[e % count].skip){\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({\n start: s % count,\n end: e % count,\n loop: l,\n style: st\n });\n prevStyle = st;\n start = e % count;\n }\n }\n for (const segment of segments){\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for(i = start + 1; i <= segment.end; i++){\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n return result;\n}\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\nfunction styleChanged(style, prevStyle) {\n return prevStyle && JSON.stringify(style) !== JSON.stringify(prevStyle);\n}\n\nexport { unclipArea as $, _rlookupByKey as A, _lookupByKey as B, _isPointInArea as C, getAngleFromPoint as D, toPadding as E, each as F, getMaximumSize as G, HALF_PI as H, _getParentNode as I, readUsedSize as J, supportsEventListenerOptions as K, throttled as L, _isDomSupported as M, _factorize as N, finiteOrDefault as O, PI as P, callback as Q, _addGrace as R, _limitValue as S, TAU as T, toDegrees as U, _measureText as V, _int16Range as W, _alignPixel as X, clipArea as Y, renderText as Z, _arrayUnique as _, resolve as a, fontString as a$, toFont as a0, _toLeftRightCenter as a1, _alignStartEnd as a2, overrides as a3, merge as a4, _capitalize as a5, descriptors as a6, isFunction as a7, _attachContext as a8, _createResolver as a9, overrideTextDirection as aA, _textX as aB, restoreTextDirection as aC, drawPointLegend as aD, distanceBetweenPoints as aE, noop as aF, _setMinAndMaxByKey as aG, niceNum as aH, almostWhole as aI, almostEquals as aJ, _decimalPlaces as aK, Ticks as aL, log10 as aM, _longestText as aN, _filterBetween as aO, _lookup as aP, isPatternOrGradient as aQ, getHoverColor as aR, clone$1 as aS, _merger as aT, _mergerIf as aU, _deprecated as aV, _splitKey as aW, toFontString as aX, splineCurve as aY, splineCurveMonotone as aZ, getStyle as a_, _descriptors as aa, mergeIf as ab, uid as ac, debounce as ad, retinaScale as ae, clearCanvas as af, setsEqual as ag, _elementsEqual as ah, _isClickEvent as ai, _isBetween as aj, _readValueToProps as ak, _updateBezierControlPoints as al, _computeSegments as am, _boundSegments as an, _steppedInterpolation as ao, _bezierInterpolation as ap, _pointInLine as aq, _steppedLineTo as ar, _bezierCurveTo as as, drawPoint as at, addRoundedRectPath as au, toTRBL as av, toTRBLCorners as aw, _boundSegment as ax, _normalizeAngle as ay, getRtlAdapter as az, isArray as b, toLineHeight as b0, PITAU as b1, INFINITY as b2, RAD_PER_DEG as b3, QUARTER_PI as b4, TWO_THIRDS_PI as b5, _angleDiff as b6, color as c, defaults as d, effects$1 as e, resolveObjectKey as f, isNumberFinite as g, defined as h, isObject as i, createContext as j, isNullOrUndef as k, listenArrayEvents as l, toPercentage as m, toDimension as n, formatNumber as o, _angleBetween as p, _getStartAndCountOfVisiblePoints as q, requestAnimFrame as r, sign as s, toRadians as t, unlistenArrayEvents as u, valueOrDefault as v, _scaleRangesChanged as w, isNumber as x, _parseObjectDataRadialScale as y, getRelativePosition as z };\n//# sourceMappingURL=helpers.segment.js.map\n","/*!\n * Chart.js v4.0.1\n * https://www.chartjs.org\n * (c) 2022 Chart.js Contributors\n * Released under the MIT License\n */\nimport { r as requestAnimFrame, a as resolve, e as effects, c as color, i as isObject, d as defaults, b as isArray, v as valueOrDefault, u as unlistenArrayEvents, l as listenArrayEvents, f as resolveObjectKey, g as isNumberFinite, h as defined, s as sign, j as createContext, k as isNullOrUndef, _ as _arrayUnique, t as toRadians, T as TAU, m as toPercentage, n as toDimension, o as formatNumber, p as _angleBetween, H as HALF_PI, P as PI, q as _getStartAndCountOfVisiblePoints, w as _scaleRangesChanged, x as isNumber, y as _parseObjectDataRadialScale, z as getRelativePosition, A as _rlookupByKey, B as _lookupByKey, C as _isPointInArea, D as getAngleFromPoint, E as toPadding, F as each, G as getMaximumSize, I as _getParentNode, J as readUsedSize, K as supportsEventListenerOptions, L as throttled, M as _isDomSupported, N as _factorize, O as finiteOrDefault, Q as callback, R as _addGrace, S as _limitValue, U as toDegrees, V as _measureText, W as _int16Range, X as _alignPixel, Y as clipArea, Z as renderText, $ as unclipArea, a0 as toFont, a1 as _toLeftRightCenter, a2 as _alignStartEnd, a3 as overrides, a4 as merge, a5 as _capitalize, a6 as descriptors, a7 as isFunction, a8 as _attachContext, a9 as _createResolver, aa as _descriptors, ab as mergeIf, ac as uid, ad as debounce, ae as retinaScale, af as clearCanvas, ag as setsEqual, ah as _elementsEqual, ai as _isClickEvent, aj as _isBetween, ak as _readValueToProps, al as _updateBezierControlPoints, am as _computeSegments, an as _boundSegments, ao as _steppedInterpolation, ap as _bezierInterpolation, aq as _pointInLine, ar as _steppedLineTo, as as _bezierCurveTo, at as drawPoint, au as addRoundedRectPath, av as toTRBL, aw as toTRBLCorners, ax as _boundSegment, ay as _normalizeAngle, az as getRtlAdapter, aA as overrideTextDirection, aB as _textX, aC as restoreTextDirection, aD as drawPointLegend, aE as distanceBetweenPoints, aF as noop, aG as _setMinAndMaxByKey, aH as niceNum, aI as almostWhole, aJ as almostEquals, aK as _decimalPlaces, aL as Ticks, aM as log10, aN as _longestText, aO as _filterBetween, aP as _lookup } from './chunks/helpers.segment.js';\nexport { aL as Ticks, d as defaults } from './chunks/helpers.segment.js';\n\nclass Animator {\n constructor(){\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n callbacks.forEach((fn)=>fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n this._request = requestAnimFrame.call(window, ()=>{\n this._update();\n this._request = null;\n if (this._running) {\n this._refresh();\n }\n });\n }\n _update(date = Date.now()) {\n let remaining = 0;\n this._charts.forEach((anims, chart)=>{\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n for(; i >= 0; --i){\n item = items[i];\n if (item._active) {\n if (item._total > anims.duration) {\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n remaining += items.length;\n });\n this._lastDate = date;\n if (remaining === 0) {\n this._running = false;\n }\n }\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur)=>Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n for(; i >= 0; --i){\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\nvar animator = /* #__PURE__ */ new Animator();\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean (from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n color (from, to, factor) {\n const c0 = color(from || transparent);\n const c1 = c0.valid && color(to || transparent);\n return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to;\n },\n number (from, to, factor) {\n return from + (to - from) * factor;\n }\n};\nclass Animation {\n constructor(cfg, target, prop, to){\n const currentValue = target[prop];\n to = resolve([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n const from = resolve([\n cfg.from,\n currentValue,\n to\n ]);\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n active() {\n return this._active;\n }\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n this._from = resolve([\n cfg.from,\n currentValue,\n to\n ]);\n }\n }\n cancel() {\n if (this._active) {\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n this._active = from !== to && (loop || elapsed < duration);\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n factor = elapsed / duration % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n this._target[prop] = this._fn(from, to, factor);\n }\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej)=>{\n promises.push({\n res,\n rej\n });\n });\n }\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for(let i = 0; i < promises.length; i++){\n promises[i][method]();\n }\n }\n}\n\nclass Animations {\n constructor(chart, config){\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n const animationOptions = Object.keys(defaults.animation);\n const animatedProps = this._properties;\n Object.getOwnPropertyNames(config).forEach((key)=>{\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions){\n resolved[option] = cfg[option];\n }\n (isArray(cfg.properties) && cfg.properties || [\n key\n ]).forEach((prop)=>{\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n awaitAll(target.options.$animations, newOptions).then(()=>{\n target.options = newOptions;\n }, ()=>{\n });\n }\n return animations;\n }\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n for(i = props.length - 1; i >= 0; --i){\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n if (animation) {\n if (cfg && animation.active()) {\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n target[prop] = value;\n continue;\n }\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n update(target, values) {\n if (this._properties.size === 0) {\n Object.assign(target, values);\n return;\n }\n const animations = this._createAnimations(target, values);\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}function awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for(let i = 0; i < keys.length; i++){\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n return Promise.all(running);\n}\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n target.options = options = Object.assign({}, options, {\n $shared: false,\n $animations: {}\n });\n }\n return options;\n}\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\nfunction toClip(value) {\n let t, r, b, l;\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n keys.push(metasets[i].index);\n }\n return keys;\n}\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n if (value === null) {\n return;\n }\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isNumberFinite(otherValue) && (singleMode || value === 0 || sign(value) === sign(otherValue))) {\n value += otherValue;\n }\n }\n return value;\n}\nfunction convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || stacked === undefined && meta.stack !== undefined;\n}\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction getUserBounds(scale) {\n const { min , max , minDefined , maxDefined } = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()){\n const value = stack[meta.index];\n if (positive && value > 0 || !positive && value < 0) {\n return meta.index;\n }\n }\n return null;\n}\nfunction updateStacks(controller, parsed) {\n const { chart , _cachedMeta: meta } = controller;\n const stacks = chart._stacks || (chart._stacks = {});\n const { iScale , vScale , index: datasetIndex } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n for(let i = 0; i < ilen; ++i){\n const item = parsed[i];\n const { [iAxis]: index , [vAxis]: value } = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n }\n}\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter((key)=>scales[key].axis === axis).shift();\n}\nfunction createDatasetContext(parent, index) {\n return createContext(parent, {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n });\n}\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\nfunction clearStacks(meta, items) {\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n items = items || meta._parsed;\n for (const parsed of items){\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n }\n}\nconst isDirectUpdateMode = (mode)=>mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared)=>shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart)=>canStack && !meta.hidden && meta._stacked && {\n keys: getSortedDatasetIndices(chart, true),\n values: null\n };\nclass DatasetController {\n static defaults = {};\n static datasetElementType = null;\n static dataElementType = null;\n constructor(chart, datasetIndex){\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n this.initialize();\n }\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n console.warn(\"Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options\");\n }\n }\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n const chooseId = (axis, x, y, r)=>axis === 'x' ? x : axis === 'r' ? r : y;\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale ? meta.vScale : meta.iScale;\n }\n reset() {\n this._update('reset');\n }\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n if (isObject(data)) {\n this._data = convertObjectDataToArray(data);\n } else if (_data !== data) {\n if (_data) {\n unlistenArrayEvents(_data, this);\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n addElements() {\n const meta = this._cachedMeta;\n this._dataCheck();\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n this._dataCheck();\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n this._resyncElements(resetNewElements);\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n }\n }\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n parse(start, count) {\n const { _cachedMeta: meta , _data: data } = this;\n const { iScale , _stacked } = meta;\n const iAxis = iScale.axis;\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n const isNotInOrderComparedToPrev = ()=>cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];\n for(i = 0; i < count; ++i){\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n parsePrimitiveData(meta, data, start, count) {\n const { iScale , vScale } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const { xScale , yScale } = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const { xScale , yScale } = meta;\n const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]\n };\n return applyStack(stack, value, meta.index, {\n mode\n });\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n const { min: otherMin , max: otherMax } = getUserBounds(otherScale);\n let i, parsed;\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n for(i = 0; i < ilen; ++i){\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n break;\n }\n }\n if (sorted) {\n for(i = ilen - 1; i >= 0; --i){\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n for(i = 0, ilen = parsed.length; i < ilen; ++i){\n value = parsed[i][scale.axis];\n if (isNumberFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n getMaxOverflow() {\n return false;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n update(mode) {}\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || elements.length - start;\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n for(i = start; i < start + count; ++i){\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n for(i = 0; i < active.length; ++i){\n active[i].draw(ctx, area);\n }\n }\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index || 0, mode);\n }\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context || (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context || (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [\n `${elementType}Hover`,\n 'hover',\n elementType,\n ''\n ] : [\n elementType,\n ''\n ];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n const context = ()=>this.getContext(index, active);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n if (values.$shared) {\n values.$shared = sharing;\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n return values;\n }\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions;\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {\n sharedOptions,\n includeOptions\n };\n }\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n options: !active && this.getSharedOptions(options) || options\n });\n }\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n for (const [method, arg1, arg2] of this._syncList){\n this[method](arg1, arg2);\n }\n this._syncList = [];\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n if (count) {\n this.parse(0, count);\n }\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n const move = (arr)=>{\n arr.length += count;\n for(i = arr.length - 1; i >= end; i--){\n arr[i] = arr[i - count];\n }\n };\n move(data);\n for(i = start; i < end; ++i){\n data[i] = new this.dataElementType();\n }\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n updateElements(element, start, count, mode) {}\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([\n this.index,\n ...args\n ]);\n }\n _onDataPush() {\n const count = arguments.length;\n this._sync([\n '_insertElements',\n this.getDataset().data.length - count,\n count\n ]);\n }\n _onDataPop() {\n this._sync([\n '_removeElements',\n this._cachedMeta.data.length - 1,\n 1\n ]);\n }\n _onDataShift() {\n this._sync([\n '_removeElements',\n 0,\n 1\n ]);\n }\n _onDataSplice(start, count) {\n if (count) {\n this._sync([\n '_removeElements',\n start,\n count\n ]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync([\n '_insertElements',\n start,\n newCount\n ]);\n }\n }\n _onDataUnshift() {\n this._sync([\n '_insertElements',\n 0,\n arguments.length\n ]);\n }\n}\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n for(let i = 0, ilen = visibleMetas.length; i < ilen; i++){\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b)=>a - b));\n }\n return scale._cache.$bar;\n}\n function computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = ()=>{\n if (curr === 32767 || curr === -32768) {\n return;\n }\n if (defined(prev)) {\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n for(i = 0, ilen = values.length; i < ilen; ++i){\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n prev = undefined;\n for(i = 0, ilen = scale.ticks.length; i < ilen; ++i){\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n return min;\n}\n function computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n size = thickness * stackCount;\n ratio = 1;\n }\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - size / 2\n };\n}\n function computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n if (prev === null) {\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n if (next === null) {\n next = curr + curr - prev;\n }\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n item[vScale.axis] = barEnd;\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n for(i = start, ilen = start + count; i < ilen; ++i){\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {\n start,\n end,\n reverse,\n top,\n bottom\n };\n}\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n if (edge === true) {\n properties.borderSkipped = {\n top: true,\n right: true,\n bottom: true,\n left: true\n };\n return;\n }\n const { start , end , reverse , top , bottom } = borderProps(properties);\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\nfunction setInflateAmount(properties, { inflateAmount }, ratio) {\n properties.inflateAmount = inflateAmount === 'auto' ? ratio === 1 ? 0.33 : 0 : inflateAmount;\n}\nclass BarController extends DatasetController {\n static id = 'bar';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'base',\n 'width',\n 'height'\n ]\n }\n }\n };\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true\n }\n }\n };\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseObjectData(meta, data, start, count) {\n const { iScale , vScale } = meta;\n const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for(i = start, ilen = start + count; i < ilen; ++i){\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n getMaxOverflow() {\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const { iScale , vScale } = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom) ? '[' + custom.start + ', ' + custom.end + ']' : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const { index , _cachedMeta: { vScale } } = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n for(let i = start; i < start + count; i++){\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {\n base,\n head: base\n } : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || index === stack._top || index === stack._bottom,\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n _getStacks(last, dataIndex) {\n const { iScale } = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta)=>meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const skipNull = (meta)=>{\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n for (const meta of metasets){\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === undefined && meta.stack === undefined) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n if (!stacks.length) {\n stacks.push(undefined);\n }\n return stacks;\n }\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = name !== undefined ? stacks.indexOf(name) : -1;\n return index === -1 ? stacks.length - 1 : index;\n }\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n for(i = 0, ilen = meta.data.length; i < ilen; ++i){\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n _calculateBarValuePixels(index) {\n const { _cachedMeta: { vScale , _stacked } , options: { base: baseValue , minBarLength } } = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n if (length !== value) {\n start = length - value;\n length = value;\n }\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n head = base;\n }\n size = head - base;\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n }\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex' ? computeFlexCategoryTraits(index, ruler, options, stackCount) : computeFitCategoryTraits(index, ruler, options, stackCount);\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + range.chunk * stackIndex + range.chunk / 2;\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n for(; i < ilen; ++i){\n if (this.getParsed(i)[vScale.axis] !== null) {\n rects[i].draw(this._ctx);\n }\n }\n }\n}\n\nclass BubbleController extends DatasetController {\n static id = 'bubble';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'borderWidth',\n 'radius'\n ]\n }\n }\n };\n static overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i){\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale , yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n update(mode) {\n const points = this._cachedMeta.data;\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale } = this._cachedMeta;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n if (reset) {\n properties.options.radius = 0;\n }\n }\n this.updateElement(point, i, properties, mode);\n }\n }\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n if (values.$shared) {\n values = Object.assign({}, values, {\n $shared: false\n });\n }\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n return values;\n }\n}\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {\n ratioX,\n ratioY,\n offsetX,\n offsetY\n };\n}\nclass DoughnutController extends DatasetController {\n static id = 'doughnut';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'circumference',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'startAngle',\n 'x',\n 'y',\n 'offset',\n 'borderWidth',\n 'spacing'\n ]\n }\n },\n cutout: '50%',\n rotation: 0,\n circumference: 360,\n radius: '100%',\n spacing: 0,\n indexAxis: 'r'\n };\n static descriptors = {\n _scriptable: (name)=>name !== 'spacing',\n _indexable: (name)=>name !== 'spacing'\n };\n static overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle , color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n };\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n linkScales() {}\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i)=>+data[i];\n if (isObject(data[start])) {\n const { key ='value' } = this._parsing;\n getter = (i)=>+resolveObjectKey(data[i], key);\n }\n let i, ilen;\n for(i = start, ilen = start + count; i < ilen; ++i){\n meta._parsed[i] = getter(i);\n }\n }\n }\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n for(let i = 0; i < this.chart.data.datasets.length; ++i){\n if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n return {\n rotation: min,\n circumference: max - min\n };\n }\n update(mode) {\n const chart = this.chart;\n const { chartArea } = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n const { circumference , rotation } = this._getRotationExtents();\n const { ratioX , ratioY , offsetX , offsetY } = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n meta.total = this.calculateTotal();\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n for(i = 0; i < start; ++i){\n startAngle += this._circumference(i, reset);\n }\n for(i = start; i < start + count; ++i){\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n this.updateElement(arc, i, properties, mode);\n }\n }\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n for(i = 0; i < metaData.length; i++){\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n return total;\n }\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n return {\n label: labels[index] || '',\n value\n };\n }\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n if (!arcs) {\n for(i = 0, ilen = chart.data.datasets.length; i < ilen; ++i){\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n if (!arcs) {\n return 0;\n }\n for(i = 0, ilen = arcs.length; i < ilen; ++i){\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n getMaxOffset(arcs) {\n let max = 0;\n for(let i = 0, ilen = arcs.length; i < ilen; ++i){\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n for(let i = 0; i < datasetIndex; ++i){\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n return ringWeightOffset;\n }\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\n\nclass LineController extends DatasetController {\n static id = 'line';\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n showLine: true,\n spanGaps: false\n };\n static overrides = {\n scales: {\n _index_: {\n type: 'category'\n },\n _value_: {\n type: 'linear'\n }\n }\n };\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { dataset: line , data: points = [] , _dataset } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n this.updateElements(points, start, count, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale , _stacked , _dataset } = this._cachedMeta;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps , segment } = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = 0; i < pointsCount; ++i){\n const point = points[i];\n const properties = directUpdate ? point : {};\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n const parsed = this.getParsed(i);\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n\nclass PolarAreaController extends DatasetController {\n static id = 'polarArea';\n static defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ]\n }\n },\n indexAxis: 'r',\n startAngle: 0\n };\n static overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle , color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n };\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n return {\n label: labels[index] || '',\n value\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const arcs = this._cachedMeta.data;\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n meta.data.forEach((element, index)=>{\n const parsed = this.getParsed(index).r;\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n return range;\n }\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n this.outerRadius = outerRadius - radiusLength * this.index;\n this.innerRadius = this.outerRadius - radiusLength;\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n const defaultAngle = 360 / this.countVisibleElements();\n for(i = 0; i < start; ++i){\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for(i = start; i < start + count; i++){\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n this.updateElement(arc, i, properties, mode);\n }\n }\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n meta.data.forEach((element, index)=>{\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n return count;\n }\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index) ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle) : 0;\n }\n}\n\nclass PieController extends DoughnutController {\n static id = 'pie';\n static defaults = {\n cutout: 0,\n rotation: 0,\n circumference: 360,\n radius: '100%'\n };\n}\n\nclass RadarController extends DatasetController {\n static id = 'radar';\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n }\n };\n static overrides = {\n aspectRatio: 1,\n scales: {\n r: {\n type: 'radialLinear'\n }\n }\n };\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n line.points = points;\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n this.updateElement(line, undefined, properties, mode);\n }\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n\nclass ScatterController extends DatasetController {\n static id = 'scatter';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n };\n static overrides = {\n interaction: {\n mode: 'point'\n },\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale , yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + ')'\n };\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { data: points = [] } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n if (this.options.showLine) {\n const { dataset: line , _dataset } = meta;\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n }\n this.updateElements(points, start, count, mode);\n }\n addElements() {\n const { showLine } = this.options;\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = this.chart.registry.getElement('line');\n }\n super.addElements();\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale , _stacked , _dataset } = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps , segment } = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = start; i < start + count; ++i){\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n if (!this.options.showLine) {\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i){\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n\nvar controllers = /*#__PURE__*/Object.freeze({\n__proto__: null,\nBarController: BarController,\nBubbleController: BubbleController,\nDoughnutController: DoughnutController,\nLineController: LineController,\nPolarAreaController: PolarAreaController,\nPieController: PieController,\nRadarController: RadarController,\nScatterController: ScatterController\n});\n\n/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */ function abstract() {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */ class DateAdapterBase {\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */ static override(members) {\n Object.assign(DateAdapterBase.prototype, members);\n }\n constructor(options){\n this.options = options || {};\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n formats() {\n return abstract();\n }\n parse() {\n return abstract();\n }\n format() {\n return abstract();\n }\n add() {\n return abstract();\n }\n diff() {\n return abstract();\n }\n startOf() {\n return abstract();\n }\n endOf() {\n return abstract();\n }\n}\nvar adapters = {\n _date: DateAdapterBase\n};\n\nfunction binarySearch(metaset, axis, value, intersect) {\n const { controller , data , _sorted } = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {\n lo: start.lo,\n hi: end.hi\n };\n }\n }\n }\n return {\n lo: 0,\n hi: data.length - 1\n };\n}\n function evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for(let i = 0, ilen = metasets.length; i < ilen; ++i){\n const { index , data } = metasets[i];\n const { lo , hi } = binarySearch(metasets[i], axis, value, intersect);\n for(let j = lo; j <= hi; ++j){\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\n function getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\n function getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n };\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\n function getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n function evaluationFunc(element, datasetIndex, index) {\n const { startAngle , endAngle } = element.getProps([\n 'startAngle',\n 'endAngle'\n ], useFinalPosition);\n const { angle } = getAngleFromPoint(element, {\n x: position.x,\n y: position.y\n });\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [\n {\n element,\n datasetIndex,\n index\n }\n ];\n minDistance = distance;\n } else if (distance === minDistance) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n function getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n return axis === 'r' && !intersect ? getNearestRadialItems(chart, position, axis, useFinalPosition) : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n function getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index)=>{\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\n var Interaction = {\n evaluateInteractionItems,\n modes: {\n index (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n if (!items.length) {\n return [];\n }\n chart.getSortedVisibleDatasetMetas().forEach((meta)=>{\n const index = items[0].index;\n const element = meta.data[index];\n if (element && !element.skip) {\n elements.push({\n element,\n datasetIndex: meta.index,\n index\n });\n }\n });\n return elements;\n },\n dataset (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for(let i = 0; i < data.length; ++i){\n items.push({\n element: data[i],\n datasetIndex,\n index: i\n });\n }\n }\n return items;\n },\n point (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n nearest (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n x (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n y (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n\nconst STATIC_POSITIONS = [\n 'left',\n 'top',\n 'right',\n 'bottom'\n];\nfunction filterByPosition(array, position) {\n return array.filter((v)=>v.pos === position);\n}\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter((v)=>STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b)=>{\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;\n });\n}\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n for(i = 0, ilen = (boxes || []).length; i < ilen; ++i){\n box = boxes[i];\n ({ position: pos , options: { stack , stackWeight =1 } } = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && pos + stack,\n stackWeight\n });\n }\n return layoutBoxes;\n}\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts){\n const { stack , pos , stackWeight } = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {\n count: 0,\n placed: 0,\n weight: 0,\n size: 0\n });\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\n function setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const { vBoxMaxWidth , hBoxMaxHeight } = params;\n let i, ilen, layout;\n for(i = 0, ilen = layouts.length; i < ilen; ++i){\n layout = layouts[i];\n const { fullSize } = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter((wrap)=>wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction updateDims(chartArea, params, layout, stacks) {\n const { pos , box } = layout;\n const maxPadding = chartArea.maxPadding;\n if (!isObject(pos)) {\n if (layout.size) {\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {\n size: 0,\n count: 1\n };\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n return layout.horizontal ? {\n same: widthChanged,\n other: heightChanged\n } : {\n same: heightChanged,\n other: widthChanged\n };\n}\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n function marginForPositions(positions) {\n const margin = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n };\n positions.forEach((pos)=>{\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n return horizontal ? marginForPositions([\n 'left',\n 'right'\n ]) : marginForPositions([\n 'top',\n 'bottom'\n ]);\n}\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n for(i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i){\n layout = boxes[i];\n box = layout.box;\n box.update(layout.width || chartArea.w, layout.height || chartArea.h, getMargins(layout.horizontal, chartArea));\n const { same , other } = updateDims(chartArea, params, layout, stacks);\n refit |= same && refitBoxes.length;\n changed = changed || other;\n if (!box.fullSize) {\n refitBoxes.push(layout);\n }\n }\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let { x , y } = chartArea;\n for (const layout of boxes){\n const box = layout.box;\n const stack = stacks[layout.stack] || {\n count: 1,\n placed: 0,\n weight: 1\n };\n const weight = layout.stackWeight / stack.weight || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height1 = chartArea.h * weight;\n const width1 = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width1, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width1, height1);\n }\n stack.start = x;\n stack.placed += height1;\n x = box.right;\n }\n }\n chartArea.x = x;\n chartArea.y = y;\n}\nvar layouts = {\n addBox (chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n item._layers = item._layers || function() {\n return [\n {\n z: 0,\n draw (chartArea) {\n item.draw(chartArea);\n }\n }\n ];\n };\n chart.boxes.push(item);\n },\n removeBox (chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n configure (chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n update (chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n each(chart.boxes, (box)=>{\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap)=>wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n handleMaxPadding(chartArea);\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w\n };\n each(boxes.chartArea, (layout)=>{\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n });\n });\n }\n};\n\nclass BasePlatform {\n acquireContext(canvas, aspectRatio) {}\n releaseContext(context) {\n return false;\n }\n addEventListener(chart, type, listener) {}\n removeEventListener(chart, type, listener) {}\n getDevicePixelRatio() {\n return 1;\n }\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n isAttached(canvas) {\n return true;\n }\n updateConfig(config) {\n }\n}\n\nclass BasicPlatform extends BasePlatform {\n acquireContext(item) {\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n\nconst EXPANDO_KEY = '$chartjs';\n const EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\nconst isNullOrEmpty = (value)=>value === null || value === '';\n function initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n style.display = style.display || 'block';\n style.boxSizing = style.boxSizing || 'border-box';\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n return canvas;\n}\nconst eventListenerOptions = supportsEventListenerOptions ? {\n passive: true\n} : false;\nfunction addListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n}\nfunction removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const { x , y } = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null\n };\n}\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList){\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart)=>{\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height)=>{\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n listener();\n }\n }, window);\n const observer = new ResizeObserver((entries)=>{\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n return observer;\n}\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event)=>{\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart);\n addListener(canvas, type, proxy);\n return proxy;\n}\n class DomPlatform extends BasePlatform {\n acquireContext(canvas, aspectRatio) {\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n if (context && context.canvas === canvas) {\n initCanvas(canvas, aspectRatio);\n return context;\n }\n return null;\n }\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n const initial = canvas[EXPANDO_KEY].initial;\n [\n 'height',\n 'width'\n ].forEach((prop)=>{\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n const style = initial.style || {};\n Object.keys(style).forEach((key)=>{\n canvas.style[key] = style[key];\n });\n canvas.width = canvas.width;\n delete canvas[EXPANDO_KEY];\n return true;\n }\n addEventListener(chart, type, listener) {\n this.removeEventListener(chart, type);\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n if (!proxy) {\n return;\n }\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n isAttached(canvas) {\n const container = _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n\nfunction _detectPlatform(canvas) {\n if (!_isDomSupported() || typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nclass Element {\n static defaults = {};\n static defaultRoutes = undefined;\n active = false;\n tooltipPosition(useFinalPosition) {\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return {\n x,\n y\n };\n }\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n getProps(props, final) {\n const anims = this.$animations;\n if (!final || !anims) {\n // let's not create an object, if not needed\n return this;\n }\n const ret = {};\n props.forEach((prop)=>{\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n });\n return ret;\n }\n}\n\nfunction autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for(i = 0, ilen = numMajorIndices - 1; i < ilen; i++){\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\n function calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n const factors = _factorize(evenMajorSpacing);\n for(let i = 0, ilen = factors.length - 1; i < ilen; i++){\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\n function getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\n function skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n spacing = Math.ceil(spacing);\n for(i = 0; i < ticks.length; i++){\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\n function skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n next = start;\n while(next < 0){\n count++;\n next = Math.round(start + count * spacing);\n }\n for(i = Math.max(start, 0); i < end; i++){\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\n function getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n if (len < 2) {\n return false;\n }\n for(diff = arr[0], i = 1; i < len; ++i){\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n\nconst reverseAlign = (align)=>align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset)=>edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\n function sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n for(; i < len; i += increment){\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\n function getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6;\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\n function garbageCollect(caches, length) {\n each(caches, (cache)=>{\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for(i = 0; i < gcLen; ++i){\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\n function getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\n function getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n return lines * font.lineHeight + padding.height;\n}\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\nfunction titleAlign(align, position, reverse) {\n let ret = _toLeftRightCenter(align);\n if (reverse && position !== 'right' || !reverse && position === 'right') {\n ret = reverseAlign(ret);\n }\n return ret;\n}\nfunction titleArgs(scale, offset, position, align) {\n const { top , left , bottom , right , chart } = scale;\n const { chartArea , scales } = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID1 = Object.keys(position)[0];\n const value1 = position[positionAxisID1];\n titleX = scales[positionAxisID1].getPixelForValue(value1) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {\n titleX,\n titleY,\n maxWidth,\n rotation\n };\n}\nclass Scale extends Element {\n constructor(cfg){\n super();\n this.id = cfg.id;\n this.type = cfg.type;\n this.options = undefined;\n this.ctx = cfg.ctx;\n this.chart = cfg.chart;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n this.maxWidth = undefined;\n this.maxHeight = undefined;\n this.paddingTop = undefined;\n this.paddingBottom = undefined;\n this.paddingLeft = undefined;\n this.paddingRight = undefined;\n this.axis = undefined;\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n this.ticks = [];\n this._gridLineItems = null;\n this._labelItems = null;\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n this._startPixel = undefined;\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n init(options) {\n this.options = options.setContext(this.getContext());\n this.axis = options.axis;\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n parse(raw, index) {\n return raw;\n }\n getUserBounds() {\n let { _userMin , _userMax , _suggestedMin , _suggestedMax } = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isNumberFinite(_userMin),\n maxDefined: isNumberFinite(_userMax)\n };\n }\n getMinMax(canStack) {\n let { min , max , minDefined , maxDefined } = this.getUserBounds();\n let range;\n if (minDefined && maxDefined) {\n return {\n min,\n max\n };\n }\n const metas = this.getMatchingVisibleMetas();\n for(let i = 0, ilen = metas.length; i < ilen; ++i){\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n getTicks() {\n return this.ticks;\n }\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n beforeUpdate() {\n callback(this.options.beforeUpdate, [\n this\n ]);\n }\n update(maxWidth, maxHeight, margins) {\n const { beginAtZero , grace , ticks: tickOpts } = this.options;\n const sampleSize = tickOpts.sampleSize;\n this.beforeUpdate();\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n this.beforeBuildTicks();\n this.ticks = this.buildTicks() || [];\n this.afterBuildTicks();\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n this.configure();\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation();\n this.afterCalculateLabelRotation();\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n if (samplingEnabled) {\n this._convertTicksToLabels(this.ticks);\n }\n this.beforeFit();\n this.fit();\n this.afterFit();\n this.afterUpdate();\n }\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n afterUpdate() {\n callback(this.options.afterUpdate, [\n this\n ]);\n }\n beforeSetDimensions() {\n callback(this.options.beforeSetDimensions, [\n this\n ]);\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = 0;\n this.bottom = this.height;\n }\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n callback(this.options.afterSetDimensions, [\n this\n ]);\n }\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n callback(this.options[name], [\n this\n ]);\n }\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n beforeTickToLabelConversion() {\n callback(this.options.beforeTickToLabelConversion, [\n this\n ]);\n }\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n tick = ticks[i];\n tick.label = callback(tickOpts.callback, [\n tick.value,\n i,\n ticks\n ], this);\n }\n }\n afterTickToLabelConversion() {\n callback(this.options.afterTickToLabelConversion, [\n this\n ]);\n }\n beforeCalculateLabelRotation() {\n callback(this.options.beforeCalculateLabelRotation, [\n this\n ]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = this.ticks.length;\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid) - tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)), Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n callback(this.options.afterCalculateLabelRotation, [\n this\n ]);\n }\n afterAutoSkip() {}\n beforeFit() {\n callback(this.options.beforeFit, [\n this\n ]);\n }\n fit() {\n const minSize = {\n width: 0,\n height: 0\n };\n const { chart , options: { ticks: tickOpts , title: titleOpts , grid: gridOpts } } = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight;\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n if (tickOpts.display && this.ticks.length) {\n const { first , last , widest , highest } = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n if (isHorizontal) {\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n this._handleMargins();\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n _calculatePadding(first, last, sin, cos) {\n const { ticks: { align , padding } , position } = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n afterFit() {\n callback(this.options.afterFit, [\n this\n ]);\n }\n isHorizontal() {\n const { axis , position } = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n isFullSize() {\n return this.options.fullSize;\n }\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n this.generateTickLabels(ticks);\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n this.afterTickToLabelConversion();\n }\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length);\n }\n return labelSizes;\n }\n _computeLabelSizes(ticks, length) {\n const { ctx , _longestTextCache: caches } = this;\n const widths = [];\n const heights = [];\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n for(i = 0; i < length; ++i){\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {\n data: {},\n gc: []\n };\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n for(j = 0, jlen = label.length; j < jlen; ++j){\n nestedLabel = label[j];\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n const valueAt = (idx)=>({\n width: widths[idx] || 0,\n height: heights[idx] || 0\n });\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights\n };\n }\n getLabelForValue(value) {\n return value;\n }\n getPixelForValue(value, index) {\n return NaN;\n }\n getValueForPixel(pixel) {}\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n getBaseValue() {\n const { min , max } = this;\n return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0;\n }\n getContext(index) {\n const ticks = this.ticks || [];\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context || (tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context || (this.$context = createScaleContext(this.chart.getContext(), this));\n }\n _tickSize() {\n const optionTicks = this.options.ticks;\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin;\n }\n _isVisible() {\n const display = this.options.display;\n if (display !== 'auto') {\n return !!display;\n }\n return this.getMatchingVisibleMetas().length > 0;\n }\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const { grid , position , border } = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID1 = Object.keys(position)[0];\n const value1 = position[positionAxisID1];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID1].getPixelForValue(value1));\n }\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for(i = 0; i < ticksLength; i += step){\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n lineValue = getPixelForGridLine(this, i, offset);\n if (lineValue === undefined) {\n continue;\n }\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset\n });\n }\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n return items;\n }\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const { position , ticks: optionTicks } = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const { align , crossAlign , padding , mirror } = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret1 = this._getYAxisLabelAlignment(tl);\n textAlign = ret1.textAlign;\n x = ret1.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = (chartArea.left + chartArea.right) / 2 - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID1 = Object.keys(position)[0];\n const value1 = position[positionAxisID1];\n x = this.chart.scales[positionAxisID1].getPixelForValue(value1);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n const labelSizes = this._getLabelSizes();\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n label = tick.label;\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n if (isHorizontal) {\n x = pixel;\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n x += lineHeight / 2 * Math.sin(rotation);\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n let backdrop;\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n switch(textBaseline){\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n }\n switch(textAlign){\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n }\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n color: optsAtIndex.backdropColor\n };\n }\n items.push({\n rotation,\n label,\n font,\n color,\n strokeColor,\n strokeWidth,\n textOffset,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [\n x,\n y\n ],\n backdrop\n });\n }\n return items;\n }\n _getXAxisLabelAlignment() {\n const { position , ticks } = this.options;\n const rotation = -toRadians(this.labelRotation);\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n let align = 'center';\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n return align;\n }\n _getYAxisLabelAlignment(tl) {\n const { position , ticks: { crossAlign , mirror , padding } } = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n let textAlign;\n let x;\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= widest / 2;\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= widest / 2;\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n return {\n textAlign,\n x\n };\n }\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n const chart = this.chart;\n const position = this.options.position;\n if (position === 'left' || position === 'right') {\n return {\n top: 0,\n left: this.left,\n bottom: chart.height,\n right: this.right\n };\n }\n if (position === 'top' || position === 'bottom') {\n return {\n top: this.top,\n left: 0,\n bottom: this.bottom,\n right: chart.width\n };\n }\n }\n drawBackground() {\n const { ctx , options: { backgroundColor } , left , top , width , height } = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex((t)=>t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n const drawLine = (p1, p2, style)=>{\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n if (grid.display) {\n for(i = 0, ilen = items.length; i < ilen; ++i){\n const item = items[i];\n if (grid.drawOnChartArea) {\n drawLine({\n x: item.x1,\n y: item.y1\n }, {\n x: item.x2,\n y: item.y2\n }, item);\n }\n if (grid.drawTicks) {\n drawLine({\n x: item.tx1,\n y: item.ty1\n }, {\n x: item.tx2,\n y: item.ty2\n }, {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n });\n }\n }\n }\n }\n drawBorder() {\n const { chart , ctx , options: { border , grid } } = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.restore();\n }\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n if (!optionTicks.display) {\n return;\n }\n const ctx = this.ctx;\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n let i, ilen;\n for(i = 0, ilen = items.length; i < ilen; ++i){\n const item = items[i];\n const tickFont = item.font;\n const label = item.label;\n let y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, item);\n }\n if (area) {\n unclipArea(ctx);\n }\n }\n drawTitle() {\n const { ctx , options: { position , title , reverse } } = this;\n if (!title.display) {\n return;\n }\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n const { titleX , titleY , maxWidth , rotation } = titleArgs(this, offset, position, align);\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [\n titleX,\n titleY\n ]\n });\n }\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n const bz = valueOrDefault(opts.border && opts.border.z, 0);\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n return [\n {\n z: tz,\n draw: (chartArea)=>{\n this.draw(chartArea);\n }\n }\n ];\n }\n return [\n {\n z: gz,\n draw: (chartArea)=>{\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n },\n {\n z: bz,\n draw: ()=>{\n this.drawBorder();\n }\n },\n {\n z: tz,\n draw: (chartArea)=>{\n this.drawLabels(chartArea);\n }\n }\n ];\n }\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n\nclass TypedRegistry {\n constructor(type, scope, override){\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n if (isIChartComponent(proto)) {\n parentScope = this.register(proto);\n }\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n if (id in items) {\n return scope;\n }\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n return scope;\n }\n get(id) {\n return this.items[id];\n }\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n if (id in items) {\n delete items[id];\n }\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}function registerDefaults(item, scope, parentScope) {\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n defaults.set(scope, itemDefaults);\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach((property)=>{\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [\n scope\n ].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n\nclass Registry {\n constructor(){\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n this._typedRegistries = [\n this.controllers,\n this.scales,\n this.elements\n ];\n }\n add(...args) {\n this._each('register', args);\n }\n remove(...args) {\n this._each('unregister', args);\n }\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n _each(method, args, typedRegistry) {\n [\n ...args\n ].forEach((arg)=>{\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) {\n this._exec(method, reg, arg);\n } else {\n each(arg, (item)=>{\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n callback(component['before' + camelMethod], [], component);\n registry[method](component);\n callback(component['after' + camelMethod], [], component);\n }\n _getRegistryForType(type) {\n for(let i = 0; i < this._typedRegistries.length; i++){\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n return this.plugins;\n }\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n}\nvar registry = /* #__PURE__ */ new Registry();\n\nclass PluginService {\n constructor(){\n this._init = [];\n }\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors){\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [\n chart,\n args,\n descriptor.options\n ];\n if (callback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n return true;\n }\n invalidate() {\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n const descriptors = this._cache = this._createDescriptors(chart);\n this._notifyStateChanges(chart);\n return descriptors;\n }\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n} function allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for(let i = 0; i < keys.length; i++){\n plugins.push(registry.getPlugin(keys[i]));\n }\n const local = config.plugins || [];\n for(let i1 = 0; i1 < local.length; i1++){\n const plugin = local[i1];\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n return {\n plugins,\n localIds\n };\n}\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\nfunction createDescriptors(chart, { plugins , localIds }, options, all) {\n const result = [];\n const context = chart.getContext();\n for (const plugin of plugins){\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {\n plugin,\n local: localIds[id]\n }, opts, context)\n });\n }\n return result;\n}\nfunction pluginOpts(config, { plugin , local }, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [\n ''\n ], {\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n\nfunction getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\nfunction determineAxis(id, scaleOptions) {\n if (id === 'x' || id === 'y' || id === 'r') {\n return id;\n }\n id = scaleOptions.axis || axisFromPosition(scaleOptions.position) || id.length > 1 && determineAxis(id[0].toLowerCase(), scaleOptions);\n if (id) {\n return id;\n }\n throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`);\n}\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {\n scales: {}\n };\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const scales = Object.create(null);\n Object.keys(configScales).forEach((id)=>{\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = mergeIf(Object.create(null), [\n {\n axis\n },\n scaleConf,\n defaultScaleOptions[axis],\n defaultScaleOptions[defaultId]\n ]);\n });\n config.data.datasets.forEach((dataset)=>{\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach((defaultID)=>{\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [\n {\n axis\n },\n configScales[id],\n defaultScaleOptions[defaultID]\n ]);\n });\n });\n Object.keys(scales).forEach((key)=>{\n const scale = scales[key];\n mergeIf(scale, [\n defaults.scales[scale.type],\n defaults.scale\n ]);\n });\n return scales;\n}\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n initOptions(config);\n return config;\n}\nconst keyCache = new Map();\nconst keysCached = new Set();\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\nconst addIfFound = (set, obj, key)=>{\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\nclass Config {\n constructor(config){\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n get platform() {\n return this._config.platform;\n }\n get type() {\n return this._config.type;\n }\n set type(type) {\n this._config.type = type;\n }\n get data() {\n return this._config.data;\n }\n set data(data) {\n this._config.data = initData(data);\n }\n get options() {\n return this._config.options;\n }\n set options(options) {\n this._config.options = options;\n }\n get plugins() {\n return this._config.plugins;\n }\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType, ()=>[\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`, ()=>[\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`,\n ],\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`, ()=>[\n [\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]\n ]);\n }\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`, ()=>[\n [\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || [],\n ]\n ]);\n }\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n getOptionScopes(mainScope, keyLists, resetCache) {\n const { options , type } = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n const scopes = new Set();\n keyLists.forEach((keys)=>{\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach((key)=>addIfFound(scopes, mainScope, key));\n }\n keys.forEach((key)=>addIfFound(scopes, options, key));\n keys.forEach((key)=>addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach((key)=>addIfFound(scopes, defaults, key));\n keys.forEach((key)=>addIfFound(scopes, descriptors, key));\n });\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n chartOptionScopes() {\n const { options , type } = this;\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {},\n {\n type\n },\n defaults,\n descriptors\n ];\n }\n resolveNamedOptions(scopes, names, context, prefixes = [\n ''\n ]) {\n const result = {\n $shared: true\n };\n const { resolver , subPrefixes } = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n for (const prop of names){\n result[prop] = options[prop];\n }\n return result;\n }\n createResolver(scopes, context, prefixes = [\n ''\n ], descriptorDefaults) {\n const { resolver } = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context) ? _attachContext(resolver, context, undefined, descriptorDefaults) : resolver;\n }\n}function getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter((p)=>!p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\nconst hasFunction = (value)=>isObject(value) && Object.getOwnPropertyNames(value).reduce((acc, key)=>acc || isFunction(value[key]), false);\nfunction needContext(proxy, names) {\n const { isScriptable , isIndexable } = _descriptors(proxy);\n for (const prop of names){\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if (scriptable && (isFunction(value) || hasFunction(value)) || indexable && isArray(value)) {\n return true;\n }\n }\n return false;\n}\n\nvar version = \"4.0.1\";\n\nconst KNOWN_POSITIONS = [\n 'top',\n 'bottom',\n 'left',\n 'right',\n 'chartArea'\n];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x';\n}\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1];\n };\n}\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n chart.notifyPlugins('afterRender');\n callback(animationOptions && animationOptions.onComplete, [\n context\n ], chart);\n}\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callback(animationOptions && animationOptions.onProgress, [\n context\n ], chart);\n}\n function getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n item = item[0];\n }\n if (item && item.canvas) {\n item = item.canvas;\n }\n return item;\n}\nconst instances = {};\nconst getChart = (key)=>{\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c)=>c.canvas === canvas).pop();\n};\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys){\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\n function determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\nfunction getDatasetArea(meta) {\n const { xScale , yScale } = meta;\n if (xScale && yScale) {\n return {\n left: xScale.left,\n right: xScale.right,\n top: yScale.top,\n bottom: yScale.bottom\n };\n }\n}\nclass Chart {\n static defaults = defaults;\n static instances = instances;\n static overrides = overrides;\n static registry = registry;\n static version = version;\n static getChart = getChart;\n static register(...items) {\n registry.add(...items);\n invalidatePlugins();\n }\n static unregister(...items) {\n registry.remove(...items);\n invalidatePlugins();\n }\n constructor(item, userConfig){\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new Error('Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' + ' must be destroyed before the canvas with ID \\'' + existingChart.canvas.id + '\\' can be reused.');\n }\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce((mode)=>this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n instances[this.id] = this;\n if (!context || !canvas) {\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n get aspectRatio() {\n const { options: { aspectRatio , maintainAspectRatio } , width , height , _aspectRatio } = this;\n if (!isNullOrUndef(aspectRatio)) {\n return aspectRatio;\n }\n if (maintainAspectRatio && _aspectRatio) {\n return _aspectRatio;\n }\n return height ? width / height : null;\n }\n get data() {\n return this.config.data;\n }\n set data(data) {\n this.config.data = data;\n }\n get options() {\n return this._options;\n }\n set options(options) {\n this.config.options = options;\n }\n get registry() {\n return registry;\n }\n _initialize() {\n this.notifyPlugins('beforeInit');\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n this.bindEvents();\n this.notifyPlugins('afterInit');\n return this;\n }\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n stop() {\n animator.stop(this);\n return this;\n }\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {\n width,\n height\n };\n }\n }\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n this.notifyPlugins('resize', {\n size: newSize\n });\n callback(options.onResize, [\n this,\n newSize\n ], this);\n if (this.attached) {\n if (this._doResize(mode)) {\n this.render();\n }\n }\n }\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n each(scalesOptions, (axisOptions, axisID)=>{\n axisOptions.id = axisID;\n });\n }\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id)=>{\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n if (scaleOpts) {\n items = items.concat(Object.keys(scaleOpts).map((id)=>{\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n }));\n }\n each(items, (item)=>{\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n scale.init(scaleOptions, options);\n });\n each(updated, (hasUpdated, id)=>{\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n each(scales, (scale)=>{\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n metasets.sort((a, b)=>a.index - b.index);\n if (numMeta > numData) {\n for(let i = numData; i < numMeta; ++i){\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n _removeUnreferencedMetasets() {\n const { _metasets: metasets , data: { datasets } } = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index)=>{\n if (datasets.filter((x)=>x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n this._removeUnreferencedMetasets();\n for(i = 0, ilen = datasets.length; i < ilen; i++){\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const { datasetElementType , dataElementType } = defaults.datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n this._updateMetasets();\n return newControllers;\n }\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex)=>{\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n update(mode) {\n const config = this.config;\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n this._plugins.invalidate();\n if (this.notifyPlugins('beforeUpdate', {\n mode,\n cancelable: true\n }) === false) {\n return;\n }\n const newControllers = this.buildOrUpdateControllers();\n this.notifyPlugins('beforeElementsUpdate');\n let minPadding = 0;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; i++){\n const { controller } = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n if (!animsDisabled) {\n each(newControllers, (controller)=>{\n controller.reset();\n });\n }\n this._updateDatasets(mode);\n this.notifyPlugins('afterUpdate', {\n mode\n });\n this._layers.sort(compare2Level('z', '_idx'));\n const { _active , _lastEvent } = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n this.render();\n }\n _updateScales() {\n each(this.scales, (scale)=>{\n layouts.removeBox(this, scale);\n });\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n this.unbindEvents();\n this.bindEvents();\n }\n }\n _updateHiddenIndices() {\n const { _hiddenIndices } = this;\n const changes = this._getUniformDataChanges() || [];\n for (const { method , start , count } of changes){\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx)=>new Set(_dataChanges.filter((c)=>c[0] === idx).map((c, i)=>i + ',' + c.splice(1).join(',')));\n const changeSet = makeSet(0);\n for(let i = 1; i < datasetCount; i++){\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet).map((c)=>c.split(',')).map((a)=>({\n method: a[1],\n start: +a[2],\n count: +a[3]\n }));\n }\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {\n cancelable: true\n }) === false) {\n return;\n }\n layouts.update(this, this.width, this.height, minPadding);\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n this._layers = [];\n each(this.boxes, (box)=>{\n if (noArea && box.position === 'chartArea') {\n return;\n }\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n this._layers.forEach((item, index)=>{\n item._idx = index;\n });\n this.notifyPlugins('afterLayout');\n }\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {\n mode,\n cancelable: true\n }) === false) {\n return;\n }\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this.getDatasetMeta(i).controller.configure();\n }\n for(let i1 = 0, ilen1 = this.data.datasets.length; i1 < ilen1; ++i1){\n this._updateDataset(i1, isFunction(mode) ? mode({\n datasetIndex: i1\n }) : mode);\n }\n this.notifyPlugins('afterDatasetsUpdate', {\n mode\n });\n }\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {\n meta,\n index,\n mode,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n meta.controller._update(mode);\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n render() {\n if (this.notifyPlugins('beforeRender', {\n cancelable: true\n }) === false) {\n return;\n }\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({\n chart: this\n });\n }\n }\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const { width , height } = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n if (this.notifyPlugins('beforeDraw', {\n cancelable: true\n }) === false) {\n return;\n }\n const layers = this._layers;\n for(i = 0; i < layers.length && layers[i].z <= 0; ++i){\n layers[i].draw(this.chartArea);\n }\n this._drawDatasets();\n for(; i < layers.length; ++i){\n layers[i].draw(this.chartArea);\n }\n this.notifyPlugins('afterDraw');\n }\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n return result;\n }\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {\n cancelable: true\n }) === false) {\n return;\n }\n const metasets = this.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n this._drawDataset(metasets[i]);\n }\n this.notifyPlugins('afterDatasetsDraw');\n }\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = getDatasetArea(meta) || this.chartArea;\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n meta.controller.draw();\n if (useClip) {\n unclipArea(ctx);\n }\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n return [];\n }\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter((x)=>x && x._dataset === dataset).pop();\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n return meta;\n }\n getContext() {\n return this.$context || (this.$context = createContext(null, {\n chart: this,\n type: 'chart'\n }));\n }\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n const meta = this.getDatasetMeta(datasetIndex);\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n anims.update(meta, {\n visible\n });\n this.update((ctx)=>ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n for(i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this._destroyDatasetMeta(i);\n }\n }\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const { canvas , ctx } = this;\n this._stop();\n this.config.clearCache();\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n delete instances[this.id];\n this.notifyPlugins('afterDestroy');\n }\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const listener = (e, x, y)=>{\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n each(this.options.events, (type)=>_add(type, listener));\n }\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener)=>{\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n const listener = (width, height)=>{\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n let detached;\n const attached = ()=>{\n _remove('attach', attached);\n this.attached = true;\n this.resize();\n _add('resize', listener);\n _add('detach', detached);\n };\n detached = ()=>{\n this.attached = false;\n _remove('resize', listener);\n this._stop();\n this._resize(0, 0);\n _add('attach', attached);\n };\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n unbindEvents() {\n each(this._listeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n each(this._responsiveListeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({ datasetIndex , index })=>{\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n if (changed) {\n this._active = active;\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter((p)=>p.plugin.id === pluginId).length === 1;\n }\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin)=>(plugin.options.events || this.options.events).includes(e.native.type);\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n const changed = this._handleEvent(e, replay, args.inChartArea);\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n if (changed || args.changed) {\n this.render();\n }\n return this;\n }\n _handleEvent(e, replay, inChartArea) {\n const { _active: lastActive = [] , options } = this;\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n if (inChartArea) {\n this._lastEvent = null;\n callback(options.onHover, [\n e,\n active,\n this\n ], this);\n if (isClick) {\n callback(options.onClick, [\n e,\n active,\n this\n ], this);\n }\n }\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n this._lastEvent = lastEvent;\n return changed;\n }\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\nfunction invalidatePlugins() {\n return each(Chart.instances, (chart)=>chart._plugins.invalidate());\n}\nvar Chart$1 = Chart;\n\nfunction clipArc(ctx, element, endAngle) {\n const { startAngle , pixelMargin , x , y , outerRadius , innerRadius } = element;\n let angleMargin = pixelMargin / outerRadius;\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, [\n 'outerStart',\n 'outerEnd',\n 'innerStart',\n 'innerEnd'\n ]);\n}\n/**\n * Parse border radius from the provided options\n */ function parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val)=>{\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit)\n };\n}\n/**\n * Convert (r, 𝜃) to (x, y)\n */ function rThetaToXY(r, theta, x, y) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta)\n };\n}\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */ function pathArc(ctx, element, offset, spacing, end, circular) {\n const { x , y , startAngle: start , pixelMargin , innerRadius: innerR } = element;\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n let spacingOffset = 0;\n const alpha = end - start;\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? alpha * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const { outerStart , outerEnd , innerStart , innerEnd } = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n ctx.beginPath();\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n // The line from point 3 to point 4\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter1 = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter1.x, pCenter1.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2;\n ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true);\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter2 = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter2.x, pCenter2.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n // The line from point 7 to point 8\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter3 = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter3.x, pCenter3.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n ctx.closePath();\n}\nfunction drawArc(ctx, element, offset, spacing, circular) {\n const { fullCircles , startAngle , circumference } = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i){\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\nfunction drawBorder(ctx, element, offset, spacing, circular) {\n const { fullCircles , startAngle , circumference , options } = element;\n const { borderWidth , borderJoinStyle } = options;\n const inner = options.borderAlign === 'inner';\n if (!borderWidth) {\n return;\n }\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i){\n ctx.stroke();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n if (!fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\nclass ArcElement extends Element {\n static id = 'arc';\n static defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(chartX, chartY, useFinalPosition) {\n const point = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n const { angle , distance } = getAngleFromPoint(point, {\n x: chartX,\n y: chartY\n });\n const { startAngle , endAngle , innerRadius , outerRadius , circumference } = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = this.options.spacing / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n return betweenAngles && withinRadius;\n }\n getCenterPoint(useFinalPosition) {\n const { x , y , startAngle , endAngle , innerRadius , outerRadius } = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference', \n ], useFinalPosition);\n const { offset , spacing } = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n tooltipPosition(useFinalPosition) {\n return this.getCenterPoint(useFinalPosition);\n }\n draw(ctx) {\n const { options , circumference } = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = options.borderAlign === 'inner' ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n ctx.save();\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n const radiusOffset = offset * fix;\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, circular);\n ctx.restore();\n }\n}\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\nfunction getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n return lineTo;\n}\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const { start: paramsStart = 0 , end: paramsEnd = count - 1 } = params;\n const { start: segmentStart , end: segmentEnd } = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\n function pathSegment(ctx, line, segment, params) {\n const { points , options } = line;\n const { count , start , loop , ilen } = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n let { move =true , reverse } = params || {};\n let i, point, prev;\n for(i = 0; i <= ilen; ++i){\n point = points[(start + (reverse ? ilen - i : i)) % count];\n if (point.skip) {\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n prev = point;\n }\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n return !!loop;\n}\n function fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const { count , start , ilen } = pathVars(points, segment, params);\n const { move =true , reverse } = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n const pointIndex = (index)=>(start + (reverse ? ilen - index : index)) % count;\n const drawX = ()=>{\n if (minY !== maxY) {\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n ctx.lineTo(avgX, lastY);\n }\n };\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n for(i = 0; i <= ilen; ++i){\n point = points[pointIndex(i)];\n if (point.skip) {\n continue;\n }\n const x = point.x;\n const y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n ctx.lineTo(x, y);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n lastY = y;\n }\n drawX();\n}\n function _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\n function _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n return _pointInLine;\n}\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\nfunction strokePathDirect(ctx, line, start, count) {\n const { segments , options } = line;\n const segmentMethod = _getSegmentMethod(line);\n for (const segment of segments){\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {\n start,\n end: start + count - 1\n })) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\nconst usePath2D = typeof Path2D === 'function';\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\nclass LineElement extends Element {\n static id = 'line';\n static defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n static descriptors = {\n _scriptable: true,\n _indexable: (name)=>name !== 'borderDash' && name !== 'fill'\n };\n constructor(cfg){\n super();\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n get points() {\n return this._points;\n }\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {\n property,\n start: value,\n end: value\n });\n if (!segments.length) {\n return;\n }\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for(i = 0, ilen = segments.length; i < ilen; ++i){\n const { start , end } = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n start = start || 0;\n count = count || this.points.length - start;\n for (const segment of segments){\n loop &= segmentMethod(ctx, this, segment, {\n start,\n end: start + count - 1\n });\n }\n return !!loop;\n }\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n if (points.length && options.borderWidth) {\n ctx.save();\n draw(ctx, this, start, count);\n ctx.restore();\n }\n if (this.animated) {\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\n\nfunction inRange$1(el, pos, axis, useFinalPosition) {\n const options = el.options;\n const { [axis]: value } = el.getProps([\n axis\n ], useFinalPosition);\n return Math.abs(pos - value) < options.radius + options.hitRadius;\n}\nclass PointElement extends Element {\n static id = 'point';\n /**\n * @type {any}\n */ static defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n };\n /**\n * @type {any}\n */ static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n const options = this.options;\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange$1(this, mouseX, 'x', useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange$1(this, mouseY, 'y', useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return {\n x,\n y\n };\n }\n size(options) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n draw(ctx, area) {\n const options = this.options;\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n}\n\nfunction getBarBounds(bar, useFinalPosition) {\n const { x , y , base , width , height } = bar.getProps([\n 'x',\n 'y',\n 'base',\n 'width',\n 'height'\n ], useFinalPosition);\n let left, right, top, bottom, half;\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n return {\n left,\n top,\n right,\n bottom\n };\n}\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\nfunction parseBorderRadius(bar, maxW, maxH) {\n const { enableBorderRadius } = bar.getProps([\n 'enableBorderRadius'\n ]);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n const enableBorder = enableBorderRadius || isObject(value);\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))\n }\n }\n };\n}\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n return bounds && (skipX || _isBetween(x, bounds.left, bounds.right)) && (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n function addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\nclass BarElement extends Element {\n static id = 'bar';\n static defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n draw(ctx) {\n const { inflateAmount , options: { borderColor , backgroundColor } } = this;\n const { inner , outer } = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n ctx.save();\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x , y , base , horizontal } = this.getProps([\n 'x',\n 'y',\n 'base',\n 'horizontal'\n ], useFinalPosition);\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\n\nvar elements = /*#__PURE__*/Object.freeze({\n__proto__: null,\nArcElement: ArcElement,\nLineElement: LineElement,\nPointElement: PointElement,\nBarElement: BarElement\n});\n\nconst BORDER_COLORS = [\n 'rgb(54, 162, 235)',\n 'rgb(255, 99, 132)',\n 'rgb(255, 159, 64)',\n 'rgb(255, 205, 86)',\n 'rgb(75, 192, 192)',\n 'rgb(153, 102, 255)',\n 'rgb(201, 203, 207)' // grey\n];\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map((color)=>color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\nfunction getBorderColor(i) {\n return BORDER_COLORS[i % BORDER_COLORS.length];\n}\nfunction getBackgroundColor(i) {\n return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\nfunction createDefaultDatasetColorizer() {\n return (dataset, i)=>{\n dataset.borderColor = getBorderColor(i);\n dataset.backgroundColor = getBackgroundColor(i);\n };\n}\nfunction createDoughnutDatasetColorizer() {\n let i = 0;\n return (dataset)=>{\n dataset.backgroundColor = dataset.data.map(()=>getBorderColor(i++));\n };\n}\nfunction createPolarAreaDatasetColorizer() {\n let i = 0;\n return (dataset)=>{\n dataset.backgroundColor = dataset.data.map(()=>getBackgroundColor(i++));\n };\n}\nfunction getColorizer(type) {\n if (type === 'doughnut' || type === 'pie') {\n return createDoughnutDatasetColorizer();\n } else if (type === 'polarArea') {\n return createPolarAreaDatasetColorizer();\n }\n return createDefaultDatasetColorizer();\n}\nfunction containsColorsDefinitions(descriptors) {\n let k;\n for(k in descriptors){\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n return true;\n }\n }\n return false;\n}\nvar plugin_colors = {\n id: 'colors',\n defaults: {\n enabled: true\n },\n beforeLayout (chart, _args, options) {\n if (!options.enabled) {\n return;\n }\n const { type , options: { elements } , data: { datasets } } = chart.config;\n if (containsColorsDefinitions(datasets) || elements && containsColorsDefinitions(elements)) {\n return;\n }\n const colorizer = getColorizer(type);\n datasets.forEach(colorizer);\n }\n};\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n const samples = options.samples || availableWidth;\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n const decimated = [];\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n decimated[sampledIndex++] = data[a];\n for(i = 0; i < samples - 2; i++){\n let avgX = 0;\n let avgY = 0;\n let j;\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n for(j = avgRangeStart; j < avgRangeEnd; j++){\n avgX += data[j].x;\n avgY += data[j].y;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const { x: pointAx , y: pointAy } = data[a];\n maxArea = area = -1;\n for(j = rangeOffs; j < rangeTo; j++){\n area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy));\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n decimated[sampledIndex++] = data[endIndex];\n return decimated;\n}\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n for(i = start; i < start + count; ++i){\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n const lastIndex = i - 1;\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n if (i > 0 && lastIndex !== startIndex) {\n decimated.push(data[lastIndex]);\n }\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n return decimated;\n}\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {\n value: data\n });\n }\n}\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset)=>{\n cleanDecimatedDataset(dataset);\n });\n}\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n let start = 0;\n let count;\n const { iScale } = meta;\n const { min , max , minDefined , maxDefined } = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n return {\n start,\n count\n };\n}\nvar plugin_decimation = {\n id: 'decimation',\n defaults: {\n algorithm: 'min-max',\n enabled: false\n },\n beforeElementsUpdate: (chart, args, options)=>{\n if (!options.enabled) {\n cleanDecimatedData(chart);\n return;\n }\n const availableWidth = chart.width;\n chart.data.datasets.forEach((dataset, datasetIndex)=>{\n const { _data , indexAxis } = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n if (resolve([\n indexAxis,\n chart.options.indexAxis\n ]) === 'y') {\n return;\n }\n if (!meta.controller.supportsDecimation) {\n return;\n }\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n return;\n }\n if (chart.options.parsing) {\n return;\n }\n let { start , count } = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n cleanDecimatedDataset(dataset);\n return;\n }\n if (isNullOrUndef(_data)) {\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n let decimated;\n switch(options.algorithm){\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n dataset._decimated = decimated;\n });\n },\n destroy (chart) {\n cleanDecimatedData(chart);\n }\n};\n\nfunction _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n for (const segment of segments){\n let { start , end } = segment;\n end = _findSegmentEnd(start, end, points);\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n if (!target.segments) {\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n const targetSegments = _boundSegments(target, bounds);\n for (const tgt of targetSegments){\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n for (const fillSource of fillSources){\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\nfunction _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {\n property,\n start,\n end\n };\n}\nfunction _pointsFromSegments(boundary, line) {\n const { x =null , y =null } = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({ start , end })=>{\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({\n x: first.x,\n y\n });\n points.push({\n x: last.x,\n y\n });\n } else if (x !== null) {\n points.push({\n x,\n y: first.y\n });\n points.push({\n x,\n y: last.y\n });\n }\n });\n return points;\n}\nfunction _findSegmentEnd(start, end, points) {\n for(; end > start; end--){\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n\nfunction _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n if (isArray(boundary)) {\n _loop = true;\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n return points.length ? new LineElement({\n points,\n options: {\n tension: 0\n },\n _loop,\n _fullLoop: _loop\n }) : null;\n}\nfunction _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n\nfunction _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [\n index\n ];\n let target;\n if (!propagate) {\n return fill;\n }\n while(fill !== false && visited.indexOf(fill) === -1){\n if (!isNumberFinite(fill)) {\n return fill;\n }\n target = sources[fill];\n if (!target) {\n return false;\n }\n if (target.visible) {\n return fill;\n }\n visited.push(fill);\n fill = target.fill;\n }\n return false;\n}\n function _decodeFill(line, index, count) {\n const fill = parseFillOption(line);\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n let target = parseFloat(fill);\n if (isNumberFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n return [\n 'origin',\n 'start',\n 'end',\n 'stack',\n 'shape'\n ].indexOf(fill) >= 0 && fill;\n}\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n return target;\n}\n function _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\n function _getTargetValue(fill, scale, startValue) {\n let value;\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\n function parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n if (fill === false || fill === null) {\n return false;\n }\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n\nfunction _buildStackLine(source) {\n const { scale , index , line } = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({\n x: null,\n y: scale.bottom\n }, line));\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n for(let j = segment.start; j <= segment.end; j++){\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({\n points,\n options: {}\n });\n}\n function getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n for(let i = 0; i < metas.length; i++){\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\n function addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for(let j = 0; j < linesBelow.length; j++){\n const line = linesBelow[j];\n const { first , last , point } = findPoint(line, sourcePoint, 'x');\n if (!point || first && last) {\n continue;\n }\n if (first) {\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n break;\n }\n }\n }\n points.push(...postponed);\n}\n function findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {\n first,\n last,\n point\n };\n}\n\nclass simpleArc {\n constructor(opts){\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n pathSegment(ctx, bounds, opts) {\n const { x , y , radius } = this;\n bounds = bounds || {\n start: 0,\n end: TAU\n };\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n interpolate(point) {\n const { x , y , radius } = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n\nfunction _getTarget(source) {\n const { chart , fill , line } = source;\n if (isNumberFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n if (fill === 'shape') {\n return true;\n }\n const boundary = computeBoundary(source);\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n return _createBoundaryLine(boundary, line);\n}\n function getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\nfunction computeLinearBoundary(source) {\n const { scale ={} , fill } = source;\n const pixel = _getTargetPixel(fill, scale);\n if (isNumberFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n return null;\n}\nfunction computeCircularBoundary(source) {\n const { scale , fill } = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n for(let i = 0; i < length; ++i){\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\nfunction _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const { line , scale , axis } = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const { above =color , below =color } = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {\n line,\n target,\n above,\n below,\n area,\n scale,\n axis\n });\n unclipArea(ctx);\n }\n}\nfunction doFill(ctx, cfg) {\n const { line , target , above , below , area , scale } = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n ctx.save();\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {\n line,\n target,\n color: above,\n scale,\n property\n });\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {\n line,\n target,\n color: below,\n scale,\n property\n });\n ctx.restore();\n}\nfunction clipVertical(ctx, target, clipY) {\n const { segments , points } = target;\n let first = true;\n let lineLoop = false;\n ctx.beginPath();\n for (const segment of segments){\n const { start , end } = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {\n move: lineLoop\n });\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\nfunction fill(ctx, cfg) {\n const { line , target , property , color , scale } = cfg;\n const segments = _segments(line, target, property);\n for (const { source: src , target: tgt , start , end } of segments){\n const { style: { backgroundColor =color } = {} } = src;\n const notShape = target !== true;\n ctx.save();\n ctx.fillStyle = backgroundColor;\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n ctx.beginPath();\n const lineLoop = !!line.pathSegment(ctx, src);\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n const targetLoop = !!target.pathSegment(ctx, tgt, {\n move: lineLoop,\n reverse: true\n });\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n ctx.restore();\n }\n}\nfunction clipBounds(ctx, scale, bounds) {\n const { top , bottom } = scale.chart.chartArea;\n const { property , start , end } = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\nvar index = {\n id: 'filler',\n afterDatasetsUpdate (chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n for(i = 0; i < count; ++i){\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line\n };\n }\n meta.$filler = source;\n sources.push(source);\n }\n for(i = 0; i < count; ++i){\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n beforeDraw (chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n beforeDatasetsDraw (chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n const metasets = chart.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n beforeDatasetDraw (chart, args, options) {\n const source = args.meta.$filler;\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n\nconst getBoxSize = (labelOpts, fontSize)=>{\n let { boxHeight =fontSize , boxWidth =fontSize } = labelOpts;\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\nconst itemsEqual = (a, b)=>a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nclass Legend extends Element {\n constructor(config){\n super();\n this._added = false;\n this.legendHitBoxes = [];\n this._hoveredItem = null;\n this.doughnutMode = false;\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = callback(labelOpts.generateLabels, [\n this.chart\n ], this) || [];\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item)=>labelOpts.filter(item, this.chart.data));\n }\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b)=>labelOpts.sort(a, b, this.chart.data));\n }\n if (this.options.reverse) {\n legendItems.reverse();\n }\n this.legendItems = legendItems;\n }\n fit() {\n const { options , ctx } = this;\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const { boxWidth , itemHeight } = getBoxSize(labelOpts, fontSize);\n let width, height;\n ctx.font = labelFont.string;\n if (this.isHorizontal()) {\n width = this.maxWidth;\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight;\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const { ctx , maxWidth , options: { labels: { padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const lineWidths = this.lineWidths = [\n 0\n ];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i)=>{\n const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n hitboxes[i] = {\n left: 0,\n top,\n row,\n width: itemWidth,\n height: itemHeight\n };\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n return totalHeight;\n }\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const { ctx , maxHeight , options: { labels: { padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n let left = 0;\n let col = 0;\n this.legendItems.forEach((legendItem, i)=>{\n const { itemWidth , itemHeight } = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n hitboxes[i] = {\n left,\n top: currentColHeight,\n col,\n width: itemWidth,\n height: itemHeight\n };\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n totalWidth += currentColWidth;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n return totalWidth;\n }\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const { legendHitBoxes: hitboxes , options: { align , labels: { padding } , rtl } } = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes){\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox1 of hitboxes){\n if (hitbox1.col !== col) {\n col = hitbox1.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox1.top = top;\n hitbox1.left += this.left + padding;\n hitbox1.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox1.left), hitbox1.width);\n top += hitbox1.height + padding;\n }\n }\n }\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n this._draw();\n unclipArea(ctx);\n }\n }\n _draw() {\n const { options: opts , columnSizes , lineWidths , ctx } = this;\n const { align , labels: labelOpts } = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const { padding } = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n this.drawTitle();\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n const { boxWidth , boxHeight , itemHeight } = getBoxSize(labelOpts, fontSize);\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n ctx.save();\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n if (labelOpts.usePointStyle) {\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n ctx.beginPath();\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n ctx.restore();\n };\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n overrideTextDirection(this.ctx, opts.textDirection);\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i)=>{\n ctx.strokeStyle = legendItem.fontColor;\n ctx.fillStyle = legendItem.fontColor;\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n rtlHelper.setWidth(this.width);\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n const realX = rtlHelper.x(x);\n drawLegendBox(realX, y, legendItem);\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n fillText(rtlHelper.x(x), y, legendItem);\n if (isHorizontal) {\n cursor.x += width + padding;\n } else if (typeof legendItem.text !== 'string') {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight);\n } else {\n cursor.y += lineHeight;\n }\n });\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n if (!titleOpts.display) {\n return;\n }\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n let left = this.left;\n let maxWidth = this.width;\n if (this.isHorizontal()) {\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n const maxHeight = this.columnSizes.reduce((acc, size)=>Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n const x = _alignStartEnd(position, left, left + maxWidth);\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n if (_isBetween(x, this.left, this.right) && _isBetween(y, this.top, this.bottom)) {\n lh = this.legendHitBoxes;\n for(i = 0; i < lh.length; ++i){\n hitBox = lh[i];\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width) && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n return this.legendItems[i];\n }\n }\n }\n return null;\n }\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n callback(opts.onLeave, [\n e,\n previous,\n this\n ], this);\n }\n this._hoveredItem = hoveredItem;\n if (hoveredItem && !sameItem) {\n callback(opts.onHover, [\n e,\n hoveredItem,\n this\n ], this);\n }\n } else if (hoveredItem) {\n callback(opts.onClick, [\n e,\n hoveredItem,\n this\n ], this);\n }\n }\n}\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {\n itemWidth,\n itemHeight\n };\n}\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== 'string') {\n legendItemText = legendItemText.reduce((a, b)=>a.length > b.length ? a : b);\n }\n return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width;\n}\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== 'string') {\n itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n }\n return itemHeight;\n}\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length + 0.5 : 0;\n return fontLineHeight * labelHeight;\n}\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\nvar plugin_legend = {\n id: 'legend',\n _element: Legend,\n start (chart, _args, options) {\n const legend = chart.legend = new Legend({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n stop (chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n beforeUpdate (chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n afterUpdate (chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n afterEvent (chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n onClick (e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n onHover: null,\n onLeave: null,\n labels: {\n color: (ctx)=>ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n generateLabels (chart) {\n const datasets = chart.data.datasets;\n const { labels: { usePointStyle , pointStyle , textAlign , color , useBorderRadius , borderRadius } } = chart.legend.options;\n return chart._getSortedDatasetMetas().map((meta)=>{\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n title: {\n color: (ctx)=>ctx.chart.options.color,\n display: false,\n position: 'center',\n text: ''\n }\n },\n descriptors: {\n _scriptable: (name)=>!name.startsWith('on'),\n labels: {\n _scriptable: (name)=>![\n 'generateLabels',\n 'filter',\n 'sort'\n ].includes(name)\n }\n }\n};\n\nclass Title extends Element {\n constructor(config){\n super();\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight) {\n const opts = this.options;\n this.left = 0;\n this.top = 0;\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n _drawArgs(offset) {\n const { top , left , bottom , right , options } = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {\n titleX,\n titleY,\n maxWidth,\n rotation\n };\n }\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n if (!opts.display) {\n return;\n }\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const { titleX , titleY , maxWidth , rotation } = this._drawArgs(offset);\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [\n titleX,\n titleY\n ]\n });\n }\n}\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\nvar plugin_title = {\n id: 'title',\n _element: Title,\n start (chart, _args, options) {\n createTitle(chart, options);\n },\n stop (chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n beforeUpdate (chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold'\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\n\nconst map = new WeakMap();\nvar plugin_subtitle = {\n id: 'subtitle',\n start (chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n stop (chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n beforeUpdate (chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal'\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\n\nconst positioners = {\n average (items) {\n if (!items.length) {\n return false;\n }\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n return {\n x: x / count,\n y: y / count\n };\n },\n nearest (items, eventPosition) {\n if (!items.length) {\n return false;\n }\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n return {\n x,\n y\n };\n }\n};\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n return base;\n}\n function splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\n function createTooltipItem(chart, item) {\n const { element , datasetIndex , index } = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const { label , value } = controller.getLabelAndValue(index);\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\n function getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const { body , footer , title } = tooltip;\n const { boxWidth , boxHeight } = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n let combinedBodyLength = body.reduce((count, bodyItem)=>count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;\n }\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n ctx.save();\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;\n each(body, (bodyItem)=>{\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n widthPadding = 0;\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n ctx.restore();\n width += padding.width;\n return {\n width,\n height\n };\n}\nfunction determineYAlign(chart, size) {\n const { y , height } = size;\n if (y < height / 2) {\n return 'top';\n } else if (y > chart.height - height / 2) {\n return 'bottom';\n }\n return 'center';\n}\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const { x , width } = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\nfunction determineXAlign(chart, options, size, yAlign) {\n const { x , width } = size;\n const { width: chartWidth , chartArea: { left , right } } = chart;\n let xAlign = 'center';\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n return xAlign;\n}\n function determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\nfunction alignX(size, xAlign) {\n let { x , width } = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= width / 2;\n }\n return x;\n}\nfunction alignY(size, yAlign, paddingAndSize) {\n let { y , height } = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= height / 2;\n }\n return y;\n}\n function getBackgroundPoint(options, size, alignment, chart) {\n const { caretSize , caretPadding , cornerRadius } = options;\n const { xAlign , yAlign } = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius);\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n return align === 'center' ? tooltip.x + tooltip.width / 2 : align === 'right' ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;\n}\n function getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\nconst defaultCallbacks = {\n beforeTitle: noop,\n title (tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n return '';\n },\n afterTitle: noop,\n beforeBody: noop,\n beforeLabel: noop,\n label (tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n let label = tooltipItem.dataset.label || '';\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0\n };\n },\n labelTextColor () {\n return this.options.bodyColor;\n },\n labelPointStyle (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation\n };\n },\n afterLabel: noop,\n afterBody: noop,\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n};\n function invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n if (typeof result === 'undefined') {\n return defaultCallbacks[name].call(ctx, arg);\n }\n return result;\n}\nclass Tooltip extends Element {\n static positioners = positioners;\n constructor(config){\n super();\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n if (cached) {\n return cached;\n }\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n return animations;\n }\n getContext() {\n return this.$context || (this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n getTitle(context, options) {\n const { callbacks } = options;\n const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n return lines;\n }\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems));\n }\n getBody(tooltipItems, options) {\n const { callbacks } = options;\n const bodyItems = [];\n each(tooltipItems, (context)=>{\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n bodyItems.push(bodyItem);\n });\n return bodyItems;\n }\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems));\n }\n getFooter(tooltipItems, options) {\n const { callbacks } = options;\n const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n return lines;\n }\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n for(i = 0, len = active.length; i < len; ++i){\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array)=>options.filter(element, index, array, data));\n }\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b)=>options.itemSort(a, b, data));\n }\n each(tooltipItems, (context)=>{\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n });\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n if (changed && options.external) {\n options.external.call(this, {\n chart: this.chart,\n tooltip: this,\n replay\n });\n }\n }\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n getCaretPosition(tooltipPoint, size, options) {\n const { xAlign , yAlign } = this;\n const { caretSize , cornerRadius } = options;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius);\n const { x: ptX , y: ptY } = tooltipPoint;\n const { width , height } = size;\n let x1, x2, x3, y1, y2, y3;\n if (yAlign === 'center') {\n y2 = ptY + height / 2;\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {\n x1,\n x2,\n x3,\n y1,\n y2,\n y3\n };\n }\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.titleAlign, options);\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing;\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing;\n }\n }\n }\n }\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColors = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const { boxHeight , boxWidth , boxPadding } = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2,\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n ctx.strokeStyle = labelColors.borderColor;\n ctx.fillStyle = labelColors.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n ctx.lineWidth = isObject(labelColors.borderWidth) ? Math.max(...Object.values(labelColors.borderWidth)) : labelColors.borderWidth || 1;\n ctx.strokeStyle = labelColors.borderColor;\n ctx.setLineDash(labelColors.borderDash || []);\n ctx.lineDashOffset = labelColors.borderDashOffset || 0;\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth - boxPadding);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - boxPadding - 2);\n const borderRadius = toTRBLCorners(labelColors.borderRadius);\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = labelColors.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n ctx.fillStyle = labelColors.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n ctx.fillStyle = this.labelTextColors[i];\n }\n drawBody(pt, ctx, options) {\n const { body } = this;\n const { bodySpacing , bodyAlign , displayColors , boxHeight , boxWidth , boxPadding } = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right' ? bodyAlign === 'center' ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;\n for(i = 0, ilen = body.length; i < ilen; ++i){\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n lines = bodyItem.lines;\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n for(j = 0, jlen = lines.length; j < jlen; ++j){\n fillLineOfText(lines[j]);\n bodyLineHeight = bodyFont.lineHeight;\n }\n each(bodyItem.after, fillLineOfText);\n }\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing;\n }\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n footerFont = toFont(options.footerFont);\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n drawBackground(pt, ctx, tooltipSize, options) {\n const { xAlign , yAlign } = this;\n const { x , y } = pt;\n const { width , height } = tooltipSize;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(options.cornerRadius);\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n _willRender() {\n return !!this.opacity;\n }\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n if (!opacity) {\n return;\n }\n this._updateAnimationTarget(options);\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n const padding = toPadding(options.padding);\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n this.drawBackground(pt, ctx, tooltipSize, options);\n overrideTextDirection(ctx, options.textDirection);\n pt.y += padding.top;\n this.drawTitle(pt, ctx, options);\n this.drawBody(pt, ctx, options);\n this.drawFooter(pt, ctx, options);\n restoreTextDirection(ctx, options.textDirection);\n ctx.restore();\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({ datasetIndex , index })=>{\n const meta = this.chart.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n const positionChanged = this._positionChanged(active, e);\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n if (changed) {\n this._active = active;\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n this.update(true, replay);\n }\n }\n return changed;\n }\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n if (options.reverse) {\n active.reverse();\n }\n return active;\n }\n _positionChanged(active, e) {\n const { caretX , caretY , options } = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\nvar plugin_tooltip = {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n afterInit (chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({\n chart,\n options\n });\n }\n },\n beforeUpdate (chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n reset (chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n afterDraw (chart) {\n const tooltip = chart.tooltip;\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n if (chart.notifyPlugins('beforeTooltipDraw', {\n ...args,\n cancelable: true\n }) === false) {\n return;\n }\n tooltip.draw(chart.ctx);\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n afterEvent (chart, args) {\n if (chart.tooltip) {\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n args.changed = true;\n }\n }\n },\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold'\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {},\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold'\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts)=>opts.bodyFont.size,\n boxWidth: (ctx, opts)=>opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart'\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'width',\n 'height',\n 'caretX',\n 'caretY'\n ]\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: defaultCallbacks\n },\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n descriptors: {\n _scriptable: (name)=>name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n additionalOptionScopes: [\n 'interaction'\n ]\n};\n\nvar plugins = /*#__PURE__*/Object.freeze({\n__proto__: null,\nColors: plugin_colors,\nDecimation: plugin_decimation,\nFiller: index,\nLegend: plugin_legend,\nSubTitle: plugin_subtitle,\nTitle: plugin_title,\nTooltip: plugin_tooltip\n});\n\nconst addIfString = (labels, raw, index, addedLabels)=>{\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({\n index,\n label: raw\n });\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\nconst validIndex = (index, max)=>index === null ? null : _limitValue(Math.round(index), 0, max);\nfunction _getLabelForValue(value) {\n const labels = this.getLabels();\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n}\nclass CategoryScale extends Scale {\n static id = 'category';\n static defaults = {\n ticks: {\n callback: _getLabelForValue\n }\n };\n constructor(cfg){\n super(cfg);\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const { index , label } of added){\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n determineDataLimits() {\n const { minDefined , maxDefined } = this.getUserBounds();\n let { min , max } = this.getMinMax(true);\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1);\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n for(let value = min; value <= max; value++){\n ticks.push({\n value\n });\n }\n return ticks;\n }\n getLabelForValue(value) {\n return _getLabelForValue.call(this, value);\n }\n configure() {\n super.configure();\n if (!this.isHorizontal()) {\n this._reversePixels = !this._reversePixels;\n }\n }\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n getBasePixel() {\n return this.bottom;\n }\n}\n\nfunction generateTicks$1(generationOptions, dataRange) {\n const ticks = [];\n const MIN_SPACING = 1e-14;\n const { bounds , step , min , max , precision , count , maxTicks , maxDigits , includeBounds } = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const { min: rmin , max: rmax } = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [\n {\n value: rmin\n },\n {\n value: rmax\n }\n ];\n }\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n if (!isNullOrUndef(precision)) {\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n numSpaces = (niceMax - niceMin) / spacing;\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n const decimalPlaces = Math.max(_decimalPlaces(spacing), _decimalPlaces(niceMin));\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({\n value: min\n });\n if (niceMin < min) {\n j++;\n }\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n for(; j < numSpaces; ++j){\n ticks.push({\n value: Math.round((niceMin + j * spacing) * factor) / factor\n });\n }\n if (maxDefined && includeBounds && niceMax !== max) {\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({\n value: max\n });\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({\n value: niceMax\n });\n }\n return ticks;\n}\nfunction relativeLabelSize(value, minSpacing, { horizontal , minRotation }) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\nclass LinearScaleBase extends Scale {\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._endValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n return +raw;\n }\n handleTickRangeOptions() {\n const { beginAtZero } = this.options;\n const { minDefined , maxDefined } = this.getUserBounds();\n let { min , max } = this;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n setMax(max + offset);\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n getTickLimit() {\n const tickOpts = this.options.ticks;\n let { maxTicksLimit , stepSize } = tickOpts;\n let maxTicks;\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n return maxTicks;\n }\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks$1(numericGeneratorOptions, dataRange);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n super.configure();\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n\nclass LinearScale extends LinearScaleBase {\n static id = 'linear';\n static defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n };\n determineDataLimits() {\n const { min , max } = this.getMinMax(true);\n this.min = isNumberFinite(min) ? min : 0;\n this.max = isNumberFinite(max) ? max : 1;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n\nconst log10Floor = (v)=>Math.floor(log10(v));\nconst changeExponent = (v, m)=>Math.pow(10, log10Floor(v) + m);\nfunction isMajor(tickVal) {\n const remain = tickVal / Math.pow(10, log10Floor(tickVal));\n return remain === 1;\n}\nfunction steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\nfunction startExp(min, max) {\n const range = max - min;\n let rangeExp = log10Floor(range);\n while(steps(min, max, rangeExp) > 10){\n rangeExp++;\n }\n while(steps(min, max, rangeExp) < 10){\n rangeExp--;\n }\n return Math.min(rangeExp, log10Floor(min));\n}\n function generateTicks(generationOptions, { min , max }) {\n min = finiteOrDefault(generationOptions.min, min);\n const ticks = [];\n const minExp = log10Floor(min);\n let exp = startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while(value < max){\n ticks.push({\n value,\n major: isMajor(value),\n significand\n });\n if (significand >= 10) {\n significand = significand < 15 ? 15 : 20;\n } else {\n significand++;\n }\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = finiteOrDefault(generationOptions.max, value);\n ticks.push({\n value: lastTick,\n major: isMajor(lastTick),\n significand\n });\n return ticks;\n}\nclass LogarithmicScale extends Scale {\n static id = 'logarithmic';\n static defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n };\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [\n raw,\n index\n ]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isNumberFinite(value) && value > 0 ? value : null;\n }\n determineDataLimits() {\n const { min , max } = this.getMinMax(true);\n this.min = isNumberFinite(min) ? Math.max(0, min) : null;\n this.max = isNumberFinite(max) ? Math.max(0, max) : null;\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n if (this._zero && this.min !== this._suggestedMin && !isNumberFinite(this._userMin)) {\n this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n }\n this.handleTickRangeOptions();\n }\n handleTickRangeOptions() {\n const { minDefined , maxDefined } = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (min === max) {\n if (min <= 0) {\n setMin(1);\n setMax(10);\n } else {\n setMin(changeExponent(min, -1));\n setMax(changeExponent(max, +1));\n }\n }\n if (min <= 0) {\n setMin(changeExponent(max, -1));\n }\n if (max <= 0) {\n setMax(changeExponent(min, +1));\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const opts = this.options;\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n getLabelForValue(value) {\n return value === undefined ? '0' : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n configure() {\n const start = this.min;\n super.configure();\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min ? 0 : (log10(value) - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [\n label\n ];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - size / 2,\n end: pos + size / 2\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n return {\n start: pos,\n end: pos + size\n };\n}\n function fitWithPointLabels(scale) {\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n for(let i = 0; i < valueCount; i++){\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b);\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const extra = getTickBackdropHeight(opts) / 2;\n const outerDistance = scale.drawingArea;\n const additionalAngle = opts.pointLabels.centerPointLabels ? PI / valueCount : 0;\n for(let i = 0; i < valueCount; i++){\n const pointLabelPosition = scale.getPointPosition(i, outerDistance + extra + padding[i], additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const size = labelSizes[i];\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n items.push({\n x: pointLabelPosition.x,\n y,\n textAlign,\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n });\n }\n return items;\n}\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n return 'right';\n}\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= w / 2;\n }\n return x;\n}\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= h / 2;\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\nfunction drawPointLabels(scale, labelCount) {\n const { ctx , options: { pointLabels } } = scale;\n for(let i = labelCount - 1; i >= 0; i--){\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n const plFont = toFont(optsAtIndex.font);\n const { x , y , textAlign , left , top , right , bottom } = scale._pointLabelItems[i];\n const { backdropColor } = optsAtIndex;\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(optsAtIndex.borderRadius);\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillStyle = backdropColor;\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n renderText(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n });\n }\n}\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const { ctx } = scale;\n if (circular) {\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n for(let i = 1; i < labelCount; i++){\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n const { color , lineWidth } = gridLineOpts;\n if (!circular && !labelCount || !color || !lineWidth || radius < 0) {\n return;\n }\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\nclass RadialLinearScale extends LinearScaleBase {\n static id = 'radialLinear';\n static defaults = {\n display: true,\n animate: true,\n position: 'chartArea',\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n grid: {\n circular: false\n },\n startAngle: 0,\n ticks: {\n showLabelBackdrop: true,\n callback: Ticks.formatters.numeric\n },\n pointLabels: {\n backdropColor: undefined,\n backdropPadding: 2,\n display: true,\n font: {\n size: 10\n },\n callback (label) {\n return label;\n },\n padding: 5,\n centerPointLabels: false\n }\n };\n static defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n };\n static descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n };\n constructor(cfg){\n super(cfg);\n this.xCenter = undefined;\n this.yCenter = undefined;\n this.drawingArea = undefined;\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n setDimensions() {\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n determineDataLimits() {\n const { min , max } = this.getMinMax(false);\n this.min = isNumberFinite(min) && !isNaN(min) ? min : 0;\n this.max = isNumberFinite(max) && !isNaN(max) ? max : 0;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n this._pointLabels = this.getLabels().map((value, index)=>{\n const label = callback(this.options.pointLabels.callback, [\n value,\n index\n ], this);\n return label || label === 0 ? label : '';\n }).filter((v, i)=>this.chart.getDataVisibility(i));\n }\n fit() {\n const opts = this.options;\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n getPointLabelPosition(index) {\n const { left , top , right , bottom } = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom\n };\n }\n drawBackground() {\n const { backgroundColor , grid: { circular } } = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const { angleLines , grid , border } = opts;\n const labelCount = this._pointLabels.length;\n let i, offset, position;\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n if (grid.display) {\n this.ticks.forEach((tick, index)=>{\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n }\n if (angleLines.display) {\n ctx.save();\n for(i = labelCount - 1; i >= 0; i--){\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const { color , lineWidth } = optsAtIndex;\n if (!lineWidth || !color) {\n continue;\n }\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n ctx.restore();\n }\n }\n drawBorder() {}\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n if (!tickOpts.display) {\n return;\n }\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n this.ticks.forEach((tick, index)=>{\n if (index === 0 && !opts.reverse) {\n return;\n }\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height);\n }\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color\n });\n });\n ctx.restore();\n }\n drawTitle() {}\n}\n\nconst INTERVALS = {\n millisecond: {\n common: true,\n size: 1,\n steps: 1000\n },\n second: {\n common: true,\n size: 1000,\n steps: 60\n },\n minute: {\n common: true,\n size: 60000,\n steps: 60\n },\n hour: {\n common: true,\n size: 3600000,\n steps: 24\n },\n day: {\n common: true,\n size: 86400000,\n steps: 30\n },\n week: {\n common: false,\n size: 604800000,\n steps: 4\n },\n month: {\n common: true,\n size: 2.628e9,\n steps: 12\n },\n quarter: {\n common: false,\n size: 7.884e9,\n steps: 4\n },\n year: {\n common: true,\n size: 3.154e10\n }\n};\n const UNITS = /* #__PURE__ */ Object.keys(INTERVALS);\n function sorter(a, b) {\n return a - b;\n}\n function parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n const adapter = scale._adapter;\n const { parser , round , isoWeekday } = scale._parseOpts;\n let value = input;\n if (typeof parser === 'function') {\n value = parser(value);\n }\n if (!isNumberFinite(value)) {\n value = typeof parser === 'string' ? adapter.parse(value, (parser)) : adapter.parse(value);\n }\n if (value === null) {\n return null;\n }\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, 'isoWeek', isoWeekday) : adapter.startOf(value, round);\n }\n return +value;\n}\n function determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n for(let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i){\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n return UNITS[ilen - 1];\n}\n function determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for(let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--){\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n function determineMajorUnit(unit) {\n for(let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i){\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\n function addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const { lo , hi } = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\n function setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n for(major = first; major <= last; major = +adapter.add(major, 1, majorUnit)){\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\n function ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n const map = {};\n const ilen = values.length;\n let i, value;\n for(i = 0; i < ilen; ++i){\n value = values[i];\n map[value] = i;\n ticks.push({\n value,\n major: false\n });\n }\n return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\nclass TimeScale extends Scale {\n static id = 'time';\n static defaults = {\n bounds: 'data',\n adapters: {},\n time: {\n parser: false,\n unit: false,\n round: false,\n isoWeekday: false,\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n source: 'auto',\n callback: false,\n major: {\n enabled: false\n }\n }\n };\n constructor(props){\n super(props);\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n this._unit = 'day';\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n adapter.init(opts);\n mergeIf(time.displayFormats, adapter.formats());\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n super.init(scaleOpts);\n this._normalized = opts.normalized;\n }\n parse(raw, index) {\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n let { min , max , minDefined , maxDefined } = this.getUserBounds();\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n if (!minDefined || !maxDefined) {\n _applyBounds(this._getLabelBounds());\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n min = isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {\n min,\n max\n };\n }\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n const min = this.min;\n const max = this.max;\n const ticks = _filterBetween(timestamps, min, max);\n this._unit = timeOpts.unit || (tickOpts.autoSkip ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n if (options.reverse) {\n ticks.reverse();\n }\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n afterAutoSkip() {\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map((tick)=>+tick.value));\n }\n }\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n this._offsets = {\n start,\n end,\n factor: 1 / (start + 1 + end)\n };\n }\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for(time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++){\n addTick(ticks, time, timestamps);\n }\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n return Object.keys(ticks).sort((a, b)=>a - b).map((x)=>+x);\n }\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n if (formatter) {\n return callback(formatter, [\n time,\n index,\n ticks\n ], this);\n }\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n generateTickLabels(ticks) {\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n return {\n w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,\n h: tickLabelWidth * sinRotation + tickFontSize * cosRotation\n };\n }\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [\n exampleTime\n ], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const metas = this.getMatchingVisibleMetas();\n if (this._normalized && metas.length) {\n return this._cache.data = metas[0].controller.getAllParsedValues(this);\n }\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n return this._cache.data = this.normalize(timestamps);\n }\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const labels = this.getLabels();\n for(i = 0, ilen = labels.length; i < ilen; ++i){\n timestamps.push(parse(this, labels[i]));\n }\n return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);\n }\n normalize(values) {\n return _arrayUnique(values.sort(sorter));\n }\n}\n\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({ lo , hi } = _lookupByKey(table, 'pos', val));\n }\n ({ pos: prevSource , time: prevTarget } = table[lo]);\n ({ pos: nextSource , time: nextTarget } = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({ lo , hi } = _lookupByKey(table, 'time', val));\n }\n ({ time: prevSource , pos: prevTarget } = table[lo]);\n ({ time: nextSource , pos: nextTarget } = table[hi]);\n }\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nclass TimeSeriesScale extends TimeScale {\n static id = 'timeseries';\n static defaults = TimeScale.defaults;\n constructor(props){\n super(props);\n this._table = [];\n this._minPos = undefined;\n this._tableRange = undefined;\n }\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n buildLookupTable(timestamps) {\n const { min , max } = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n for(i = 0, ilen = timestamps.length; i < ilen; ++i){\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n if (items.length < 2) {\n return [\n {\n time: min,\n pos: 0\n },\n {\n time: max,\n pos: 1\n }\n ];\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({\n time: curr,\n pos: i / (ilen - 1)\n });\n }\n }\n return table;\n }\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n if (timestamps.length) {\n return timestamps;\n }\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n return timestamps;\n }\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\nvar TimeSeriesScale$1 = TimeSeriesScale;\n\nvar scales = /*#__PURE__*/Object.freeze({\n__proto__: null,\nCategoryScale: CategoryScale,\nLinearScale: LinearScale,\nLogarithmicScale: LogarithmicScale,\nRadialLinearScale: RadialLinearScale,\nTimeScale: TimeScale,\nTimeSeriesScale: TimeSeriesScale$1\n});\n\nconst registerables = [\n controllers,\n elements,\n plugins,\n scales, \n];\n\nexport { Animation, Animations, ArcElement, BarController, BarElement, BasePlatform, BasicPlatform, BubbleController, CategoryScale, Chart$1 as Chart, plugin_colors as Colors, DatasetController, plugin_decimation as Decimation, DomPlatform, DoughnutController, Element, index as Filler, Interaction, plugin_legend as Legend, LineController, LineElement, LinearScale, LogarithmicScale, PieController, PointElement, PolarAreaController, RadarController, RadialLinearScale, Scale, ScatterController, plugin_subtitle as SubTitle, TimeScale, TimeSeriesScale$1 as TimeSeriesScale, plugin_title as Title, plugin_tooltip as Tooltip, adapters as _adapters, _detectPlatform, animator, controllers, elements, layouts, plugins, registerables, registry, scales };\n//# sourceMappingURL=chart.js.map\n","import { SYSBaseElement, html } from \"../../../../../../_ovlclient/src\"\r\nimport {\r\n T,\r\n stringifyReplacer,\r\n} from \"../../../../../../_ovlclient/src/global/globals\"\r\nimport {\r\n Chart,\r\n // ArcElement,\r\n // LineElement,\r\n BarElement,\r\n // PointElement,\r\n BarController,\r\n // BubbleController,\r\n // DoughnutController,\r\n // LineController,\r\n // PieController,\r\n // PolarAreaController,\r\n // RadarController,\r\n // ScatterController,\r\n CategoryScale,\r\n LinearScale,\r\n // LogarithmicScale,\r\n // RadialLinearScale,\r\n // TimeScale,\r\n // TimeSeriesScale,\r\n Decimation,\r\n Filler,\r\n Legend,\r\n Title,\r\n Tooltip,\r\n SubTitle,\r\n} from \"chart.js\"\r\n\r\nChart.register(\r\n // ArcElement,\r\n // LineElement,\r\n BarElement,\r\n // PointElement,\r\n BarController,\r\n // BubbleController,\r\n // DoughnutController,\r\n // LineController,\r\n // PieController,\r\n // PolarAreaController,\r\n // RadarController,\r\n // ScatterController,\r\n CategoryScale,\r\n LinearScale,\r\n // LogarithmicScale,\r\n // RadialLinearScale,\r\n // TimeScale,\r\n // TimeSeriesScale,\r\n Decimation,\r\n Filler,\r\n Legend,\r\n Title,\r\n Tooltip,\r\n SubTitle\r\n)\r\n\r\n//var myChart = new Chart(ctx, {...});\r\n\r\nexport type DoubleBarChartState = {\r\n labels_ext: number[]\r\n labels: number[]\r\n values_1: number[]\r\n values_2: number[]\r\n}\r\n\r\nexport class CompSummaryChart extends SYSBaseElement {\r\n chart: any\r\n async getUI() {\r\n return html`\r\n
    \r\n \r\n
    \r\n `\r\n }\r\n getData() {\r\n return {\r\n labels: this.state.app.global.GEN.chartData.labels.map(\r\n (m, i) =>\r\n T(\"SYSMonth\" + m.toString()) +\r\n \" \" +\r\n this.state.app.global.GEN.chartData.labels_ext[i].toString()\r\n ),\r\n datasets: [\r\n {\r\n label: T(\"GENCurrentYear\"),\r\n data: JSON.parse(\r\n JSON.stringify(\r\n this.state.app.global.GEN.chartData.values_1,\r\n stringifyReplacer\r\n )\r\n ),\r\n //@ts-ignore\r\n backgroundColor: \"rgba(255, 0, 0, 0.5)\",\r\n //@ts-ignore\r\n borderColor: \"rgb(255, 0, 0)\",\r\n borderWidth: 1,\r\n },\r\n {\r\n label: T(\"GENLastYear\"),\r\n data: JSON.parse(\r\n JSON.stringify(\r\n this.state.app.global.GEN.chartData.values_2,\r\n stringifyReplacer\r\n )\r\n ),\r\n //@ts-ignore\r\n backgroundColor: \"rgba(54, 162, 235,0.5)\",\r\n //@ts-ignore\r\n borderColor: \"rgb(54, 162, 235)\",\r\n borderWidth: 1,\r\n },\r\n ],\r\n }\r\n }\r\n async disconnectedCallback() {\r\n await super.disconnectedCallback()\r\n if (this.chart) {\r\n this.chart.destroy()\r\n }\r\n }\r\n\r\n async afterRender() {\r\n if (!this.chart) {\r\n //@ts-ignore\r\n var ctx = document.getElementById(\"canvas\").getContext(\"2d\")\r\n //@ts-ignore\r\n this.chart = new Chart(ctx, {\r\n type: \"bar\",\r\n\r\n data: this.getData(),\r\n options: {\r\n maintainAspectRatio: false,\r\n scales: {\r\n y: {\r\n ticks: {\r\n beginAtZero: true,\r\n stepSize: 1,\r\n },\r\n },\r\n },\r\n\r\n plugins: {\r\n title: {\r\n display: true,\r\n text: T(\"GENChartOrderQtyTitle\"),\r\n position: \"left\",\r\n },\r\n },\r\n },\r\n })\r\n } else {\r\n this.chart.data = this.getData()\r\n this.chart.update()\r\n }\r\n }\r\n}\r\n","import { SYSBaseElement, html } from \"../../../../../../../_ovlclient/src\"\r\n\r\nimport { T } from \"../../../../../../../_ovlclient/src/global/globals\"\r\nimport type { SYSState } from \"../../../../../../../_ovlclient/src\"\r\n\r\nexport type DashboardState = {}\r\n\r\nexport class CompDashboard extends SYSBaseElement {\r\n async getUI() {\r\n if (!this.state.ovl.app.ready) {\r\n return\r\n }\r\n let partner = this.state.app.global.DAT.partner\r\n return html`\r\n
    \r\n
    \r\n
    \r\n
    \r\n

    \r\n ${T(\"GENWelcome\", [\r\n this.state.ovl.user.firstName,\r\n this.state.ovl.user.lastName,\r\n this.state.ovl.user.cardName,\r\n ])}\r\n

    \r\n
    \r\n
    \r\n
    \r\n\r\n
    \r\n {\r\n return {\r\n fileList: s.app.global.DAT.partner.mainAttachments.files,\r\n title: T(\"GENMainAttachmentTitle\"),\r\n }\r\n }}\r\n >\r\n
    \r\n\r\n \r\n {\r\n return {\r\n fileList: s.app.global.DAT.partner.partnerAttachments.files,\r\n title: T(\"GENPartnerAttachmentTitle\"),\r\n }\r\n }}\r\n >\r\n \r\n
    \r\n\r\n
    \r\n
    \r\n
    \r\n

    \r\n ${T(\"GENContactSalesTitle\")}\r\n

    \r\n
    \r\n
    \r\n
    \r\n \r\n

    \r\n ${partner.salesContact.firstName}\r\n ${partner.salesContact.lastName}\r\n

    \r\n

    \r\n ${partner.salesContact.phone}\r\n

    \r\n

    \r\n ${partner.salesContact.email}\r\n

    \r\n
    \r\n
    \r\n\r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n `\r\n }\r\n}\r\n","import {\r\n OvlAddComponent,\r\n OvlAddScreen,\r\n} from \"../../../../../../../_ovlclient/src/global/globals\"\r\nimport { CompDownloadPopup } from \"../../../parts/downloadpopup/downloadpopup\"\r\nimport { CompFileList } from \"../../../parts/filelist/filelist\"\r\nimport { CompSummaryChart } from \"../../../parts/summarychart/summarychart\"\r\nimport { CompDashboard } from \"./dashboard\"\r\n\r\nexport const GENDashboard_Init = () => {\r\n OvlAddComponent(\"comp-summarychart\", CompSummaryChart)\r\n OvlAddComponent(\"comp-filelist\", CompFileList)\r\n OvlAddComponent(\"comp-downloadpopup\", CompDownloadPopup)\r\n OvlAddScreen(CompDashboard, \"GENDashboard\")\r\n}\r\n","import { html } from \"../../../../../../../_ovlclient/src\"\r\nimport {\r\n FeatureInfo,\r\n PermissionHas,\r\n} from \"../../../../../../../_ovlclient/src/global/globalapi\"\r\nimport { T } from \"../../../../../../../_ovlclient/src/global/globals\"\r\nimport { DialogOpen } from \"../../../../../../../_ovlclient/src/library/dialog/dialogapi\"\r\n\r\nimport { SYSBaseElement } from \"../../../../../../../_ovlclient/src/library/sysbaseelement\"\r\nimport { TableRefresh } from \"../../../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport class CompSettings extends SYSBaseElement {\r\n handleUserAdministrationUser = async (e: Event) => {\r\n await TableRefresh(\"SYSUserAdministration_Role\")\r\n await TableRefresh(\"SYSUserAdministration_User\")\r\n DialogOpen(\"SYSUserAdministration_User\")\r\n }\r\n handleUserAdministrationCompany = async (e: Event) => {\r\n await TableRefresh(\"SYSUserAdministration_Company\")\r\n DialogOpen(\"SYSUserAdministration_Company\")\r\n }\r\n\r\n handleUserAdministrationRole = async (e: Event) => {\r\n await TableRefresh(\"SYSUserAdministration_Role\")\r\n DialogOpen(\"SYSUserAdministration_Role\")\r\n }\r\n\r\n async getUI() {\r\n let offeringSettings\r\n if (FeatureInfo(\"QUTOfferingTool\") || FeatureInfo(\"QUTOfferingToolAdmin\")) {\r\n offeringSettings = html``\r\n }\r\n\r\n return html`\r\n
    \r\n

    \r\n ${T(\"GENUserSettingsTitle\")} ${this.state.ovl.user.firstName}\r\n ${this.state.ovl.user.lastName} (${this.state.ovl.user.userId})\r\n

    \r\n\r\n \r\n ${offeringSettings}\r\n \r\n `\r\n }\r\n}\r\n","import { OvlAddScreen } from \"../../../../../../../_ovlclient/src/global/globals\"\r\nimport { CompSettings } from \"./settingsscreen\"\r\n\r\nexport const GENSettings_Init = () => {\r\n OvlAddScreen(CompSettings, \"GENSettings\")\r\n}\r\n","import { Data } from \"../../../../../_ovlclient/src/dataapi\"\r\nimport { PermissionHas } from \"../../../../../_ovlclient/src/global/globalapi\"\r\nimport {\r\n HookAppFileOpen_Type,\r\n HookAppUrlResolver_Type,\r\n HookFormValidatorsDefaults_Type,\r\n} from \"../../../../../_ovlclient/src/global/hooks\"\r\nimport {\r\n HookAppRouting_Type,\r\n SYSAction,\r\n SYSScreen,\r\n} from \"../../../../../_ovlclient/src/index\"\r\nimport {\r\n ScreenNavigateTo,\r\n ScreenCurrent,\r\n} from \"../../../../../_ovlclient/src/library/screenapi\"\r\nimport { GENBPFilter_Init } from \"../components/bpfilter/compdef\"\r\nimport { GENImagePopup_Init } from \"../components/imagepopup/compdef\"\r\nimport { DATDocuments_Init } from \"../features/datdocuments/compdef\"\r\nimport { QUTOffering_Init } from \"../features/qutoffering/compdef\"\r\nimport { SPCSymbolPC_Init } from \"../features/spcsymbolpc/compdef\"\r\nimport { SYSAudit_Init } from \"../../../../../_ovlclient/ovlsyscomponents/sysaudit01/compdef\"\r\nimport { SYSEditorAsset_Init } from \"../../../../../_ovlclient/ovlsyscomponents/syseditors/sysassetconfig01/compdef\"\r\nimport { SYSLogin_Init } from \"../../../../../_ovlclient/ovlsyscomponents/syslogin01/compdef\"\r\n\r\nimport { LoginStart } from \"../../../../../_ovlclient/ovlsyscomponents/syslogin01/features/sysloginapi\"\r\nimport { SYSShellbar_Init } from \"../../../../../_ovlclient/ovlsyscomponents/sysshellbar01/compdef\"\r\nimport { SYSTranslation_Init } from \"../../../../../_ovlclient/ovlsyscomponents/systranslation01/compdef\"\r\nimport { SYSUserAdministration_Init } from \"../../../../../_ovlclient/ovlsyscomponents/sysuseradministration01/compdef\"\r\nimport { SYSUserSettingsPassword_Init } from \"../../../../../_ovlclient/ovlsyscomponents/sysusersettings01/password/compdef\"\r\nimport { PKGPackaging_Init } from \"../screens/pkgpackaging/compdef\"\r\nimport { GENDashboard_Init } from \"../screens/gen/dashboard/compdef\"\r\nimport { GENSettings_Init } from \"../screens/gen/settings/compdef\"\r\n\r\nconst HookAppInit: SYSAction = async (_) => {\r\n SYSLogin_Init()\r\n SYSShellbar_Init()\r\n //await globalThis.OvlRehydrateUserState(\"1\")\r\n // actions.ovl.internal.SetLanguage(\"DE\")\r\n // return\r\n}\r\n\r\nconst HookAppReady: SYSAction = async (_, { global }) => {\r\n await LoginStart()\r\n}\r\n\r\nconst HookHandleAdditionalLanguageResult: SYSAction = async (\r\n value,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n state.app.global.GEN.pics = {\r\n salesContact: value.salesPic,\r\n }\r\n if (!state.app.global.DAT.partner) {\r\n //@ts-ignore\r\n state.app.global.DAT.partner = {}\r\n }\r\n\r\n state.app.global.DAT.partner.salesContact = value.sales\r\n}\r\n\r\nconst HookAppFileOpen: SYSAction = async (value) => {\r\n let anchor = document.createElement(\"a\")\r\n anchor.href = window.URL.createObjectURL(value.blob)\r\n anchor.target = \"_blank\"\r\n // currently my prefered approach in all browsers...(without setting download it will directly open up and eventually gives a popup error and an uuid as the filename)\r\n anchor.download = value.fileName\r\n document.body.appendChild(anchor)\r\n anchor.click()\r\n setTimeout(() => {\r\n document.body.removeChild(anchor)\r\n }, 3000)\r\n}\r\n\r\nconst HookAppUrlResolver: SYSAction = (value) => {\r\n let currentUrl = window.location.hostname\r\n let currentPort = window.location.port\r\n if (currentUrl.indexOf(\"test\") > -1 || currentUrl.indexOf(\"itflies\") > -1) {\r\n value.isDemoToSet = true\r\n }\r\n if (currentUrl.indexOf(\"itfprtdev\") > -1) {\r\n value.isDemoToSet = true\r\n value.apiUrlToSet = `http://${currentUrl}:1233/api/`\r\n } else {\r\n value.apiUrlToSet = `https://${currentUrl}:${currentPort}/api/`\r\n }\r\n}\r\n\r\nconst HookAppStateReady: SYSAction = async (_, { global }) => {\r\n SYSEditorAsset_Init()\r\n GENBPFilter_Init()\r\n if (PermissionHas(\"SYSAU\")) {\r\n SYSAudit_Init()\r\n }\r\n if (PermissionHas(\"SYSTR\")) {\r\n SYSTranslation_Init()\r\n }\r\n //SYSPortalSettings_Init()\r\n SYSUserSettingsPassword_Init()\r\n if (\r\n PermissionHas(\"SYSUA\") ||\r\n PermissionHas(\"SYSCA\") ||\r\n PermissionHas(\"SYSUR\") ||\r\n PermissionHas(\"SYSRA\")\r\n ) {\r\n SYSUserAdministration_Init()\r\n }\r\n GENDashboard_Init()\r\n GENSettings_Init()\r\n DATDocuments_Init()\r\n QUTOffering_Init()\r\n GENImagePopup_Init()\r\n PKGPackaging_Init()\r\n SPCSymbolPC_Init()\r\n}\r\n\r\nconst HookAppRouting: SYSAction = async (\r\n value,\r\n { global }\r\n) => {\r\n let urlParams = value.urlParams\r\n let state = global.getState()\r\n let screen: SYSScreen = urlParams.get(\"s\")\r\n let orderNum = urlParams.get(\"o\")\r\n\r\n if (orderNum) {\r\n state.app.screens.DATOrder.orderDetailFormState.selectedOrder = orderNum\r\n }\r\n state.app.screens.DATOrder.orderDetailFormState.selectedOrder\r\n if (screen) {\r\n await ScreenNavigateTo(screen)\r\n }\r\n}\r\n\r\nconst HookFormValidatorsDefaults: SYSAction<\r\n HookFormValidatorsDefaults_Type\r\n> = async (value, { global }) => {\r\n if (value.formState.tableDefId === \"QUTOfferingPos\") {\r\n value.defaultsToSet.displayType = \"OnlyOutline\"\r\n value.defaultsToSet.summaryGroup = \"ValidationKey\"\r\n value.defaultsToSet.summaryDisplayType = \"WhenTouched\"\r\n }\r\n}\r\n\r\nexport let hooks = {\r\n HookAppReady,\r\n HookAppStateReady,\r\n HookAppInit,\r\n HookAppFileOpen,\r\n HookAppUrlResolver,\r\n HookAppRouting,\r\n HookHandleAdditionalLanguageResult,\r\n HookFormValidatorsDefaults,\r\n}\r\n","import { SYSAction, SYSScreen } from \"../../../../../_ovlclient/src\"\r\nimport { Data } from \"../../../../../_ovlclient/src/dataapi\"\r\nimport { MergeDeep } from \"../../../../../_ovlclient/src/global/actions\"\r\nimport {\r\n ProcessStart,\r\n ProcessEnd,\r\n} from \"../../../../../_ovlclient/src/library/longrunningprocesstracker/processapi\"\r\nimport { TogglePDFPopupState } from \"../parts/filelist/filelist\"\r\n\r\nconst TogglePDFPopup: SYSAction = (value) => {\r\n if (value.obj.activeFilePopup === value.key) {\r\n value.obj.activeFilePopup = \"\"\r\n } else {\r\n value.obj.activeFilePopup = value.key\r\n }\r\n}\r\n\r\nconst HandleRefresh: SYSAction<{\r\n screen: SYSScreen\r\n context: any\r\n}> = async ({ screen, context }, { global }) => {\r\n let actions = global.getActions()\r\n //call the screens refresh action if any\r\n await actions.app.screens[screen].hooks[\"HookScreenRefresh\"](context)\r\n}\r\n\r\nconst HandleDataRefresh: SYSAction = async (_, { global }) => {\r\n ProcessStart(\"GENRefreshData\")\r\n try {\r\n // 1st get global data to be refreshed\r\n let state = global.getState()\r\n let res = await Data(\"data/getdata\")\r\n if (!res.data) {\r\n return\r\n }\r\n if (!state.app.global.DAT.partner) {\r\n //@ts-ignore\r\n state.app.global.DAT.partner = {}\r\n //@ts-ignore\r\n }\r\n state.app.global.GEN.lookups.weekAndDate = res.data.weekAndDateLookup\r\n state.app.global.DAT.partner.mainAttachments = res.data.mainAttachments\r\n state.app.global.DAT.partner.partnerAttachments =\r\n res.data.partnerAttachments\r\n state.app.global.GEN.chartData = res.data.chartData\r\n if (!state.app.screens.DATQuotation.quotationDetail) {\r\n state.app.screens.DATQuotation.quotationDetail = {\r\n quotations: res.data.quotationDetail,\r\n }\r\n } else {\r\n MergeDeep(state.app.screens.DATQuotation.quotationDetail, {\r\n quotations: res.data.quotationDetail,\r\n })\r\n }\r\n if (!state.app.screens.DATOrder.orderDetail) {\r\n state.app.screens.DATOrder.orderDetail = { orders: res.data.orderDetail }\r\n } else {\r\n MergeDeep(state.app.screens.DATOrder.orderDetail, {\r\n orders: res.data.orderDetail,\r\n })\r\n }\r\n if (!state.app.screens.DATInvoice.invoiceDetail) {\r\n state.app.screens.DATInvoice.invoiceDetail = {\r\n invoices: res.data.invoiceDetail,\r\n }\r\n } else {\r\n MergeDeep(state.app.screens.DATInvoice.invoiceDetail, {\r\n invoices: res.data.invoiceDetail,\r\n })\r\n }\r\n if (!state.app.screens.DATInvoice.dpInvoiceDetail) {\r\n state.app.screens.DATInvoice.dpInvoiceDetail = {\r\n dpInvoices: res.data.dpInvoiceDetail,\r\n }\r\n } else {\r\n MergeDeep(state.app.screens.DATInvoice.dpInvoiceDetail, {\r\n dpInvoices: res.data.dpInvoiceDetail,\r\n })\r\n }\r\n } finally {\r\n ProcessEnd(\"GENRefreshData\")\r\n }\r\n}\r\n\r\nexport let actions = { TogglePDFPopup, HandleRefresh, HandleDataRefresh }\r\n","import { actions, hooks } from \"../global/allactions\"\r\nexport let global = { hooks, actions }\r\n","import { features } from \"./features\"\r\nimport { screens } from \"./screens\"\r\nimport { global } from \"./global\"\r\nexport let appActions = { features, screens, global }\r\n","let imagePopup = \"\"\r\nexport let GENImagePopup = { imagePopup }\r\n","type FeedbackType = \"OrderPositive\" | \"OrderNegative\" | \"DeliveryDate\"\r\n\r\ntype FeedbackFormState = {\r\n title: string\r\n type: FeedbackType\r\n cardCode: string\r\n orderNum: string\r\n refNum: string\r\n orderDate: string\r\n orderDeliveryDate: string\r\n message: string\r\n dirty: boolean\r\n}\r\n\r\nexport type FieldId = \"msg\"\r\n\r\nexport let DATFeedback: FeedbackFormState = {\r\n cardCode: undefined,\r\n dirty: undefined,\r\n message: undefined,\r\n orderDate: undefined,\r\n orderDeliveryDate: undefined,\r\n orderNum: undefined,\r\n refNum: undefined,\r\n title: undefined,\r\n type: undefined,\r\n}\r\n","let selectedPaket = \"\"\r\n\r\nexport let DATSearchPaket = { selectedPaket }\r\n","import type { HookFieldGetList_ReturnType } from \"../../../../../../../_ovlclient/src/global/hooks\"\r\nimport type { LookupsType } from \"../../../../../../../_ovlclient/src/library/table/table\"\r\nimport type { OfferingStatus } from \"../../../screens/qutoffering/offering/helpers\"\r\n\r\nexport type OfferingCalcOrderRow = {\r\n DocEntry: number\r\n DocNum: number\r\n Comments: string\r\n DocStatus: string\r\n DocDueDate: string\r\n ActualOffers: number[]\r\n TargetOffers: number[]\r\n TargetSummaryPos: number\r\n TargetSummaryQuantity: number\r\n TargetSummaryM3: number\r\n TargetSummaryM1: number\r\n ActualSummaryPos: number\r\n ActualSummaryQuantity: number\r\n ActualSummaryM3: number\r\n ActualSummaryM1: number\r\n}\r\n\r\nexport type OfferingTool = {\r\n offerMainType: \"CAD\" | \"CUT\"\r\n lastProgressStatus: OfferingStatus\r\n selectedOfferKey: any\r\n adminResumeDocEntry: number\r\n selectedOfferType: string\r\n lookups: LookupsType\r\n detailsChanged: string\r\n cutPositionsChanged: boolean\r\n cutFileName: string\r\n cutListDirty: boolean\r\n detailsMaterialChanged: boolean\r\n detailsTransportChanged: boolean\r\n detailsCostChanged: boolean\r\n imageLoaded: string\r\n adminSalesCalcResult: OfferingCalcOrderRow[]\r\n}\r\n\r\nlet lookups = {\r\n U_ItemCode: {\r\n data: {},\r\n lookupDef: {},\r\n },\r\n}\r\n\r\nexport let QUTOffering: OfferingTool = {\r\n offerMainType: undefined,\r\n lastProgressStatus: undefined,\r\n selectedOfferKey: undefined,\r\n adminResumeDocEntry: undefined,\r\n selectedOfferType: undefined,\r\n lookups,\r\n detailsChanged: undefined,\r\n detailsMaterialChanged: false,\r\n cutPositionsChanged: false,\r\n cutFileName: \"\",\r\n cutListDirty: false,\r\n detailsTransportChanged: false,\r\n detailsCostChanged: false,\r\n imageLoaded: \"\",\r\n adminSalesCalcResult: undefined,\r\n}\r\n","import { GENImagePopup } from \"../components/imagepopup/state\"\r\nimport { DATFeedback } from \"../features/datdocuments/feedback/state\"\r\nimport { DATSearchPaket } from \"../features/datdocuments/searchpaket/state\"\r\nimport { QUTOffering } from \"../features/qutoffering/offering/state\"\r\n\r\nexport let features = {\r\n GENImagePopup,\r\n DATFeedback,\r\n DATSearchPaket,\r\n QUTOffering,\r\n}\r\n","import type { FileList } from \"../../../parts/filelist/filelist\"\r\n\r\ntype OrderOverviewState = {\r\n activeFilePopup: string\r\n}\r\n\r\ntype OrderDetailState = {\r\n orders: { [key: string]: OrderDetail }\r\n}\r\n\r\ntype OrderDetail = {\r\n cardCode: string\r\n cardName: string\r\n docDate: string\r\n deliveryDate: string\r\n orderType: \"own\" | \"channel\"\r\n refNum: string\r\n docEntry: number\r\n steps: {\r\n step1: {\r\n attachments: FileList\r\n date: string\r\n }\r\n step2: {\r\n attachments: FileList\r\n date: string\r\n }\r\n step3: {\r\n attachments: FileList\r\n date: string\r\n }\r\n step4: {\r\n attachments: FileList\r\n date: string\r\n }\r\n }\r\n attachments: FileList\r\n}\r\ntype OrderDetailFormState = {\r\n selectedOrder: string\r\n}\r\n\r\nlet orderOverview: OrderOverviewState = {\r\n activeFilePopup: \"\",\r\n}\r\n\r\nlet orderDetailFormState: OrderDetailFormState = {\r\n selectedOrder: \"\",\r\n}\r\nlet orderDetail: OrderDetailState\r\n\r\nexport let DATOrder = {\r\n orderOverview,\r\n orderDetail,\r\n orderDetailFormState,\r\n}\r\n","import type { FileList } from \"../../../parts/filelist/filelist\"\r\n\r\ntype QuotationOverviewState = {\r\n activeFilePopup: string\r\n}\r\n\r\ntype QuotationStatus = \"Open\" | \"Closed\" | \"Canceled\"\r\n\r\ntype QuotationDetailState = {\r\n quotations: { [key: string]: QuotationDetail }\r\n}\r\n\r\ntype QuotationDetail = {\r\n cardCode: string\r\n cardName: string\r\n docDate: string\r\n refNum: string\r\n status: QuotationStatus\r\n attachments: FileList\r\n}\r\n\r\nlet quotationOverview: QuotationOverviewState = {\r\n activeFilePopup: \"\",\r\n}\r\nlet quotationDetail: QuotationDetailState\r\n\r\nexport let DATQuotation = { quotationOverview, quotationDetail }\r\n","import type { FileList } from \"../../../parts/filelist/filelist\"\r\ntype InvoiceOverviewState = {\r\n activeFilePopup: string\r\n}\r\n\r\ntype InvoiceDetailState = {\r\n invoices: { [key: string]: InvoiceDetail }\r\n}\r\n\r\ntype DPInvoiceDetailState = {\r\n dpInvoices: { [key: string]: DPInvoiceDetail }\r\n}\r\n\r\ntype InvoiceDetail = {\r\n cardCode: string\r\n cardName: string\r\n docDate: string\r\n docDueDate: string\r\n refNum: string\r\n paidRate: number\r\n attachments: FileList\r\n}\r\n\r\ntype DPInvoiceDetail = {\r\n cardCode: string\r\n cardName: string\r\n docDate: string\r\n docDueDate: string\r\n refNum: string\r\n paidRate: number\r\n attachments: FileList\r\n}\r\n\r\nlet invoiceOverview: InvoiceOverviewState = {\r\n activeFilePopup: \"\",\r\n}\r\n\r\nlet dpInvoiceDetail: DPInvoiceDetailState\r\nlet invoiceDetail: InvoiceDetailState\r\n\r\nexport let DATInvoice = { dpInvoiceDetail, invoiceDetail, invoiceOverview }\r\n","let customerInfo = { cardCode: \"\", cardName: \"\" }\r\nexport let PKGPackagingCustomerChooser = { customerInfo }\r\n","export let QUTOffering = { activeTab: \"target\" }\r\n","import { DATOrder } from \"../screens/datdocuments/order/state\"\r\nimport { DATQuotation } from \"../screens/datdocuments/quotation/state\"\r\nimport { DATInvoice } from \"../screens/datdocuments/invoice/state\"\r\nimport { PKGPackagingCustomerChooser } from \"../screens/pkgpackaging/packagingcustomerchooser/state\"\r\nimport { QUTOffering } from \"../screens/qutoffering/offering/state\"\r\nexport let screens = {\r\n DATInvoice,\r\n DATOrder,\r\n DATQuotation,\r\n\r\n PKGPackagingCustomerChooser,\r\n\r\n QUTOffering,\r\n}\r\n","import type { SYSTableDef } from \"../../../../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport let tblPackagingSplit: SYSTableDef = {\r\n id: \"PKGPackagingSplit\",\r\n database: {\r\n dataIdField: \"Code\",\r\n dbInsertMode: \"Manual\",\r\n },\r\n server: {\r\n endpoint: \"packaging/split\",\r\n },\r\n options: {\r\n initial_paging: { page: 0, pageSize: 200 },\r\n edit: { editType: \"inline\" },\r\n initial_sort: { field: \"U_PartId\", direction: \"asc\" },\r\n navType: \"custom\",\r\n filterSortSettings: { doNotPersist: true },\r\n },\r\n\r\n features: {\r\n filter: true,\r\n multiSelect: true,\r\n autoCloseButtonIfInsideDialog: true,\r\n },\r\n\r\n columns: {\r\n U_Profile: {\r\n filter: { columnFilter: { type: \"none\" } },\r\n ui: {\r\n labelTranslationKey: \"PKGPackagingPackagingSplitU_Profile\",\r\n },\r\n },\r\n U_PartId: {\r\n ui: {\r\n labelTranslationKey: \"PKGPackagingPackagingSplitU_PartId\",\r\n },\r\n },\r\n U_ReqQuantity: {\r\n ui: {\r\n labelTranslationKey: \"PKGPackagingPackagingSplitU_ReqQuantity\",\r\n },\r\n },\r\n QS: {\r\n ui: {\r\n labelTranslationKey: \"PKGPackagingPackagingSplitQS\",\r\n },\r\n },\r\n U_SK: {\r\n ui: {\r\n labelTranslationKey: \"PKGPackagingPackagingSplitU_SK\",\r\n },\r\n },\r\n },\r\n}\r\n","import type { SYSTableDef } from \"../../../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport let tblPackaging: SYSTableDef = {\r\n id: \"PKGPackaging\",\r\n feature: \"PKGPackaging\",\r\n database: {\r\n dataIdField: \"Code\",\r\n dbInsertMode: \"Manual\",\r\n },\r\n server: {\r\n endpoint: \"packaging\",\r\n },\r\n options: {\r\n initial_paging: { page: 0, pageSize: 200 },\r\n edit: { editType: \"inline\" },\r\n initial_sort: { field: \"DocNum\", direction: \"asc\" },\r\n initial_filterCustom: {\r\n NotFinished: {\r\n active: true,\r\n translationKey: \"PKGPackagingPackagingFilterNotFinished\",\r\n showInTitle: false,\r\n },\r\n },\r\n customRowActions: {\r\n PrintLabel: {\r\n icon: \"sap-icon--print\",\r\n translationKey: \"PKGPackagingPackagingPrintLabel\",\r\n },\r\n OpenSplit: {\r\n icon: \"sap-icon--split\",\r\n translationKey: \"PKGPackagingPackagingSplit\",\r\n },\r\n UnSplit: {\r\n icon: \"sap-icon--combine\",\r\n translationKey: \"PKGPackagingPackagingUnSplit\",\r\n },\r\n },\r\n },\r\n\r\n features: {\r\n page: true,\r\n edit: true,\r\n filter: true,\r\n },\r\n\r\n columns: {\r\n DocNum: {\r\n sortable: true,\r\n\r\n ui: {\r\n readonly: true,\r\n labelTranslationKey: \"PKGPackagingPackagingDocNum\",\r\n },\r\n filter: { columnFilter: { type: \"none\" } },\r\n },\r\n DocComments: {\r\n ui: {\r\n readonly: true,\r\n labelTranslationKey: \"PKGPackagingPackagingOrderComments\",\r\n },\r\n },\r\n U_Unit: {\r\n sortable: true,\r\n\r\n ui: {\r\n readonly: true,\r\n labelTranslationKey: \"PKGPackagingPackagingUnit\",\r\n },\r\n },\r\n U_WrapHeight: {\r\n type: \"int\",\r\n ui: { labelTranslationKey: \"PKGPackagingPackagingWrapHeight\" },\r\n },\r\n U_WrapWidth: {\r\n type: \"int\",\r\n ui: { labelTranslationKey: \"PKGPackagingPackagingWrapWidth\" },\r\n },\r\n U_WrapLength: {\r\n type: \"int\",\r\n ui: { labelTranslationKey: \"PKGPackagingPackagingWrapLength\" },\r\n },\r\n },\r\n}\r\n","import {\r\n SYSColumnDef,\r\n SYSTableDef,\r\n} from \"../../../../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport type AdminColumnsType = {\r\n CardCode?: string\r\n OfferType?: \"Target\" | \"Actual\"\r\n CntctCode?: number\r\n FileType?: \"bvx\" | \"3d\"\r\n U_PrtOfferingCadAttr?: string\r\n PrtOfferingCadUserField?: string\r\n U_PrtOfferingCadVal?: string\r\n File?: any\r\n}\r\n\r\nlet AdminUploadColumns: {\r\n [key in keyof AdminColumnsType]: SYSColumnDef\r\n} = {\r\n CardCode: { ui: { fillSpaceIfNotVisible: false } },\r\n OfferType: {\r\n list: {\r\n displayField: \"OfferTypeName\",\r\n valueField: \"OfferType\",\r\n mode: \"Option\",\r\n },\r\n ui: {\r\n option: { inline: true },\r\n labelTranslationKey: \"QUTOfferingColOfferingAdminOfferType\",\r\n },\r\n },\r\n CntctCode: {\r\n type: \"text\",\r\n list: {\r\n displayField: \"CntctName\",\r\n valueField: \"CntctCode\",\r\n displayValueField: false,\r\n mode: \"List\",\r\n serverEndpoint: \"offering/bp_contacts\",\r\n onlyRefreshFromServerIfOlderThanMs: 10000,\r\n tryGetLookupFromServerInFormInitIfNotFound: true,\r\n },\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingCntctName\",\r\n },\r\n },\r\n FileType: {\r\n type: \"text\",\r\n list: {\r\n displayField: \"FileType\",\r\n valueField: \"FileType\",\r\n mode: \"Option\",\r\n },\r\n ui: {\r\n option: { inline: true },\r\n labelTranslationKey: \"QUTOfferingOfferingAdminFileType\",\r\n },\r\n },\r\n\r\n U_PrtOfferingCadAttr: {\r\n ui: { labelTranslationKey: \"QUTOfferingOfferingCadAttr\" },\r\n list: {\r\n displayField: \"CadAttr\",\r\n valueField: \"CadAttr\",\r\n },\r\n },\r\n PrtOfferingCadUserField: {\r\n type: \"int\",\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingOfferingCadUserField\",\r\n },\r\n },\r\n U_PrtOfferingCadVal: {\r\n ui: { labelTranslationKey: \"QUTOfferingOfferingCadVal\" },\r\n },\r\n File: {\r\n type: \"asset\",\r\n },\r\n}\r\n\r\nexport let tblAdminUpload: SYSTableDef = {\r\n id: \"QUTOfferingAdminUpload\",\r\n\r\n database: { dataIdField: \"CardCode\" },\r\n features: {\r\n add: true,\r\n edit: true,\r\n focusToFirstEditableField: true,\r\n },\r\n options: { edit: { doNotDisplayDefaultDialogTitle: true } },\r\n columns: AdminUploadColumns,\r\n}\r\n","import type { SYSTableDef } from \"../../../../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport type Costs = {\r\n Id: string\r\n ItemCode: string\r\n ItemType: string\r\n DocEntry: number\r\n CostDescription: string\r\n CostCost: number\r\n Quantity: number\r\n}\r\n\r\nexport type Transport = {\r\n DocEntry: number\r\n TransportDescription: string\r\n TransportCost: number\r\n TransportType: string\r\n ZipCode: string\r\n City: string\r\n Street: string\r\n StreetNo: string\r\n}\r\n\r\nexport type Material = {\r\n Order: number\r\n LineNum: number\r\n DocEntry: number\r\n ItemCode: string\r\n ItemName: string\r\n Skl: string\r\n Length: number\r\n Width: number\r\n Height: number\r\n Quantity: number\r\n M3: number\r\n Price: number\r\n LineTotal: number\r\n}\r\n\r\nexport type TblCostsColumn = keyof Costs\r\nexport type TblCosts = {\r\n [key: string]: Costs\r\n}\r\n\r\nexport type TblMaterialColumn = keyof Material\r\nexport type TblMaterial = {\r\n [key: string]: Material\r\n}\r\n\r\nexport type TblTransportColumn = keyof Transport\r\nexport type TblTransport = {\r\n [key: string]: Transport\r\n}\r\n\r\nexport let tblOfferingMaterial: SYSTableDef = {\r\n id: \"QUTOfferingMaterial\",\r\n feature: \"QUTOfferingDetails\",\r\n database: {\r\n dataIdField: \"LineNum\",\r\n dbInsertMode: \"Manual\",\r\n },\r\n server: {\r\n endpoint: \"offering/offeringmaterial\",\r\n },\r\n features: {\r\n edit: true,\r\n focusToFirstEditableField: false,\r\n headerMenu: false,\r\n },\r\n options: {\r\n edit: {\r\n editType: \"big\",\r\n customCaption: {\r\n editTranslationKey: \"QUTOfferingOfferingMaterialEditTitle\",\r\n },\r\n },\r\n initial_sort: { field: \"Order\", direction: \"asc\" },\r\n },\r\n columns: {\r\n MaterialDescription: {\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingMaterialDescription\",\r\n visibility: \"TableView\",\r\n },\r\n },\r\n Skl: {\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingMaterialSkl\",\r\n readonly: true,\r\n },\r\n },\r\n\r\n Quantity: {\r\n type: \"int\",\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingMaterialQuantity\",\r\n align: \"right\",\r\n visibility: \"TableView\",\r\n },\r\n },\r\n M3: {\r\n type: \"decimal\",\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingMaterialM3\",\r\n align: \"right\",\r\n format: \"3digits\",\r\n visibility: \"TableView\",\r\n },\r\n },\r\n ItemCode: {\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingMaterialItemCode\",\r\n visibility: \"Edit\",\r\n },\r\n list: {\r\n valueField: \"ItemCode\",\r\n displayField: \"ItemName\",\r\n acceptOnlyListValues: true,\r\n displayValueField: false,\r\n },\r\n schema: { nullable: false },\r\n },\r\n },\r\n}\r\n\r\nexport let tblOfferingTransport: SYSTableDef = {\r\n id: \"QUTOfferingTransport\",\r\n feature: \"QUTOfferingDetails\",\r\n database: {\r\n dataIdField: \"DocEntry\",\r\n dbInsertMode: \"Manual\",\r\n },\r\n server: {\r\n endpoint: \"offering/offeringtransport\",\r\n },\r\n options: {\r\n edit: {\r\n editType: \"big\",\r\n customCaption: {\r\n editTranslationKey: \"QUTOfferingOfferingTransportEditTitle\",\r\n },\r\n },\r\n controlsRendering: {\r\n fillSpaceIfNotVisible: false,\r\n },\r\n },\r\n features: {\r\n edit: true,\r\n headerMenu: false,\r\n },\r\n\r\n columns: {\r\n TransportDescription: {\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingTransportDescription\",\r\n visibility: \"TableView\",\r\n },\r\n },\r\n TransportCost: {\r\n type: \"decimal\",\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingTransportCost\",\r\n align: \"right\",\r\n visibility: \"TableView\",\r\n },\r\n },\r\n TransportType: {\r\n type: \"text\",\r\n list: {\r\n valueField: \"TransportType\",\r\n displayField: \"TransportTypeDescription\",\r\n displayValueField: false,\r\n },\r\n schema: { nullable: false },\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingTransportType\",\r\n\r\n visibility: \"Edit\",\r\n },\r\n },\r\n ZipCode: {\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingTransportZipCode\",\r\n visibility: \"Edit\",\r\n },\r\n },\r\n City: {\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingTransportCity\",\r\n visibility: \"Edit\",\r\n },\r\n },\r\n Street: {\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingTransportStreet\",\r\n visibility: \"Edit\",\r\n },\r\n },\r\n\r\n ZipCodeC: {\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingTransportZipCode\",\r\n visibility: \"Edit\",\r\n\r\n readonly: true,\r\n },\r\n },\r\n CityC: {\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingTransportCity\",\r\n visibility: \"Edit\",\r\n\r\n readonly: true,\r\n },\r\n },\r\n StreetC: {\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingTransportStreet\",\r\n visibility: \"Edit\",\r\n\r\n readonly: true,\r\n },\r\n },\r\n },\r\n}\r\n\r\nexport let tblOfferingCosts: SYSTableDef = {\r\n id: \"QUTOfferingCosts\",\r\n feature: \"QUTOfferingDetails\",\r\n\r\n database: {\r\n dataIdField: \"Id\",\r\n dbInsertMode: \"Manual\",\r\n },\r\n server: {\r\n endpoint: \"offering/offeringcosts\",\r\n },\r\n options: {\r\n controlsRendering: { fillSpaceIfNotVisible: false },\r\n initial_sort: { field: \"ItemType\", direction: \"asc\" },\r\n },\r\n features: {\r\n edit: true,\r\n headerMenu: false,\r\n },\r\n columns: {\r\n CostDescription: {\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingCostsDescription\",\r\n readonly: true,\r\n },\r\n },\r\n Quantity: {\r\n type: \"decimal\",\r\n ui: {\r\n selectIfFocused: true,\r\n labelTranslationKey: \"QUTOfferingColOfferingCostsQuantity\",\r\n align: \"right\",\r\n displayEmptyIfValue: 0.0,\r\n },\r\n },\r\n CostCost: {\r\n type: \"decimal\",\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingCostsCost\",\r\n align: \"right\",\r\n },\r\n },\r\n },\r\n}\r\n","import type { SYSTableDef } from \"../../../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport type Offering = {\r\n DocEntry: number\r\n DocNum: number\r\n Comments: string\r\n DocDate: string\r\n U_ITF_PRT_FileName: string\r\n //Del Date\r\n U_COR_LI_1: string\r\n DocTotal: number\r\n U_ITF_PRT_OfferStatus: string\r\n U_ITF_PRT_OfferError: string\r\n U_ITF_PRT_OfferEmailInfo: string\r\n U_ITF_PRT_OfferByAdmin?: string\r\n U_ITF_PRT_OfferType?: string\r\n U_ITF_PRT_OfferMainType?: \"CAD\" | \"CUT\"\r\n CntctName?: string\r\n}\r\n\r\nexport type TblOfferingColumn = keyof Offering\r\n\r\nexport type TblOffering = {\r\n [key: string]: Offering\r\n}\r\n\r\nexport let tblOffering: SYSTableDef = {\r\n id: \"QUTOffering\",\r\n /*title: { entityTitle: { tableDialogTitleDoNotDisplayId: true } },*/\r\n feature: \"QUTOffering\",\r\n database: {\r\n dataIdField: \"DocEntry\",\r\n dbInsertMode: \"Manual\",\r\n },\r\n server: {\r\n endpoint: \"offering\",\r\n },\r\n features: {\r\n focusToFirstEditableField: false,\r\n edit: true,\r\n delete: true,\r\n filter: true,\r\n },\r\n\r\n options: {\r\n controlsRendering: { fillSpaceIfNotVisible: false },\r\n initial_sort: { field: \"DocNum\", direction: \"desc\" },\r\n initial_filterCustom: {\r\n AlreadyLinked: { showInTitle: false, active: false },\r\n },\r\n edit: {\r\n editType: \"big\",\r\n },\r\n customRowActions: {\r\n GotoDetail: {\r\n icon: \"sap-icon--activities\",\r\n translationKey: \"QUTOfferingOfferingGotoDetail\",\r\n },\r\n Resume: {\r\n icon: \"sap-icon--accidental-leave\",\r\n translationKey: \"QUTOfferingOfferingResume\",\r\n },\r\n EmailNotification: {\r\n icon: \"sap-icon--email\",\r\n translationKey: \"QUTOfferingOfferingEmailNotificationOn\",\r\n },\r\n AdminCutOfferExport: {\r\n icon: \"sap-icon--machine\",\r\n translationKey: \"QUTOfferingPosAdminCutOfferExport\",\r\n },\r\n AdminCutOfferPurchaseExport: {\r\n icon: \"sap-icon--create-form\",\r\n translationKey: \"QUTOfferingPosAdminCutOfferPurchaseExport\",\r\n },\r\n },\r\n },\r\n\r\n columns: {\r\n DocEntry: {\r\n sortable: true,\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingDocNum\",\r\n align: \"left\",\r\n visibility: \"TableView\",\r\n },\r\n },\r\n\r\n CntctName: {\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingCntctName\",\r\n visibility: \"TableView\",\r\n },\r\n },\r\n\r\n Comments: {\r\n ui: { labelTranslationKey: \"QUTOfferingColOfferingComments\" },\r\n },\r\n\r\n DocDate: {\r\n type: \"date\",\r\n sortable: true,\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingDocDate\",\r\n visibility: \"TableView\",\r\n },\r\n },\r\n\r\n U_ITF_PRT_FileName: {\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingFileName\",\r\n visibility: \"TableView\",\r\n },\r\n },\r\n\r\n U_COR_LI_1: {\r\n type: \"date\",\r\n sortable: true,\r\n list: {\r\n displayField: \"WeekNr\",\r\n valueField: \"MidDate\",\r\n acceptOnlyListValues: true,\r\n displayValueField: false,\r\n },\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingDelDate\",\r\n sortByValue: true,\r\n },\r\n },\r\n U_ITF_PRT_OfferByAdmin: {\r\n type: \"text\",\r\n control: \"checkbox\",\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingColOfferingByAdmin\",\r\n checkedValue: \"Y\",\r\n visibility: \"Edit\",\r\n },\r\n },\r\n U_ITF_PRT_OfferType: {\r\n list: {\r\n displayField: \"OfferTypeName\",\r\n valueField: \"OfferType\",\r\n mode: \"Option\",\r\n },\r\n ui: {\r\n option: { inline: true },\r\n visibility: \"Edit\",\r\n labelTranslationKey: \"QUTOfferingColOfferingAdminOfferType\",\r\n },\r\n },\r\n\r\n DocTotal: {\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingOfferingColTotal\",\r\n visibility: \"TableView\",\r\n align: \"right\",\r\n },\r\n },\r\n },\r\n}\r\n","import type { SYSTableDef } from \"../../../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport let tblOfferingSettingsDef: SYSTableDef = {\r\n id: \"QUTOfferingSettings\",\r\n\r\n options: {\r\n edit: {\r\n customCaption: { editTranslationKey: \"QUTOfferingOfferingSettings\" },\r\n },\r\n },\r\n feature: \"QUTOfferingSettings\",\r\n server: {\r\n endpoint: \"offering/settings\",\r\n },\r\n database: {\r\n dataIdField: \"CntctCode\",\r\n dbInsertMode: \"Manual\",\r\n },\r\n columns: {\r\n U_PrtOfferingCadAttr: {\r\n ui: { labelTranslationKey: \"QUTOfferingOfferingCadAttr\" },\r\n list: {\r\n displayField: \"CadAttr\",\r\n valueField: \"CadAttr\",\r\n },\r\n schema: { nullable: false },\r\n },\r\n PrtOfferingCadUserField: {\r\n type: \"int\",\r\n ui: {\r\n labelTranslationKey: \"QUTOfferingOfferingCadUserField\",\r\n align: \"center\",\r\n },\r\n },\r\n U_PrtOfferingCadVal: {\r\n ui: { labelTranslationKey: \"QUTOfferingOfferingCadVal\" },\r\n schema: { maxLength: 50 },\r\n },\r\n },\r\n}\r\n","import type { SYSTableDef } from \"../../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport let tblSymbolPC: SYSTableDef = {\r\n id: \"SPCSymbolPC\",\r\n permission: \"SPCSP\",\r\n database: {\r\n dataIdField: \"Code\",\r\n dbInsertMode: \"UDTAutoGUIDBoth\",\r\n },\r\n server: {\r\n endpoint: \"symbolpc\",\r\n },\r\n options: {\r\n initial_sort: { field: \"U_Customer\", direction: \"asc\" },\r\n initial_paging: { page: 0, pageSize: 200 },\r\n labelAndColumnTitleHandling: { translationPrefix: \"SPCSymbolPCCol\" },\r\n },\r\n\r\n features: {\r\n page: true,\r\n showFooterButtons: true,\r\n add: true,\r\n edit: true,\r\n delete: true,\r\n },\r\n columns: {\r\n U_CardCode: {\r\n sortable: true,\r\n list: {\r\n lookupDefKey: \"OCRD\",\r\n valueField: \"CardCode\",\r\n displayField: \"Name\",\r\n serverEndpoint: \"data/lookups/cardcode\",\r\n },\r\n ui: { displayEmptyIfValue: \"---\" },\r\n schema: { nullable: false },\r\n },\r\n U_DescAdmin: {\r\n sortable: true,\r\n },\r\n U_Desc: {\r\n sortable: true,\r\n ui: { alwaysReadOnly: true },\r\n },\r\n U_Id: {\r\n ui: { alwaysReadOnly: true },\r\n },\r\n U_LastChecked: {\r\n type: \"date\",\r\n sortable: true,\r\n ui: {\r\n format: \"timestamp\",\r\n visibility: \"Table\",\r\n },\r\n },\r\n\r\n U_ValidTo: {\r\n type: \"date\",\r\n sortable: true,\r\n ui: {\r\n useBrowserDatePicker: true,\r\n },\r\n },\r\n },\r\n}\r\n","import type { SYSTableDef } from \"../../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport let tblSymbolPCEndUser: SYSTableDef = {\r\n id: \"SPCSymbolPCEndUser\",\r\n feature: \"SPCSymbolPC\",\r\n permission: \"SPCSP\",\r\n database: {\r\n dataIdField: \"Code\",\r\n dbInsertMode: \"UDTAutoGUIDBoth\",\r\n },\r\n server: {\r\n endpoint: \"symbolpc\",\r\n },\r\n title: { translationKey: \"SPCSymbolPCUserPrintersTableTitle\" },\r\n options: {\r\n initial_filter: { static: { U_CardCode: null } },\r\n initial_sort: { field: \"U_Desc\", direction: \"asc\" },\r\n initial_paging: { page: 0, pageSize: 200 },\r\n labelAndColumnTitleHandling: { translationPrefix: \"SPCSymbolPCCol\" },\r\n },\r\n\r\n features: {\r\n headerMenu: false,\r\n add: false,\r\n edit: true,\r\n },\r\n columns: {\r\n U_Id: {\r\n ui: { alwaysReadOnly: true },\r\n },\r\n U_Desc: {\r\n sortable: true,\r\n },\r\n U_ValidTo: {\r\n type: \"date\",\r\n sortable: true,\r\n ui: {\r\n alwaysReadOnly: true,\r\n },\r\n },\r\n },\r\n}\r\n","import { FieldSchema } from \"../../../../../../../../../_ovlclient/src/library/forms/sysformelement\"\r\nimport {\r\n SYSColumnDef,\r\n SYSTableDef,\r\n} from \"../../../../../../../../../_ovlclient/src/library/table/table\"\r\n\r\nexport type OfferingPos = {\r\n U_PosId?: number\r\n U_SKL?: string\r\n U_Width?: number\r\n U_Height?: number\r\n U_Length?: number\r\n U_Error?: string\r\n U_PosGroupDesc?: string\r\n U_DocEntry?: number\r\n U_Quantity?: number\r\n}\r\n\r\nexport type TblOfferingColumn = keyof OfferingPos\r\n\r\nexport type TblOfferingPos = {\r\n [key: string]: OfferingPos\r\n}\r\nlet mandatorySchema: FieldSchema = {\r\n nullable: false,\r\n nullValidatorOptions: { resetContext: \"ValueChanged\" },\r\n}\r\n\r\nlet columns: { [key in keyof OfferingPos]: SYSColumnDef } = {\r\n U_PosId: {\r\n // we set explicitly to int because schema would be string...\r\n type: \"int\",\r\n sortable: true,\r\n schema: mandatorySchema,\r\n },\r\n U_Quantity: { sortable: true, schema: mandatorySchema },\r\n U_Width: { sortable: true, schema: mandatorySchema },\r\n U_Height: { sortable: true, schema: mandatorySchema },\r\n U_Length: { sortable: true, schema: mandatorySchema },\r\n U_SKL: {\r\n sortable: true,\r\n list: { displayField: \"Code\", valueField: \"Code\" },\r\n schema: mandatorySchema,\r\n },\r\n U_PosGroupDesc: { sortable: true, ui: {} },\r\n}\r\nexport let tblOfferingPos: SYSTableDef = {\r\n id: \"QUTOfferingPos\",\r\n\r\n database: {\r\n dbInsertMode: \"UDTAutoGUID\",\r\n },\r\n server: {\r\n endpoint: \"offeringpos\",\r\n },\r\n columns,\r\n features: {\r\n focusToFirstEditableField: true,\r\n edit: true,\r\n add: true,\r\n delete: true,\r\n filter: true,\r\n page: true,\r\n showFooterButtons: true,\r\n\r\n autoRebuild: \"AfterModifyOrDeleteOrAdd\",\r\n },\r\n options: {\r\n tableGroupAggregates: {\r\n aggregates: [{ aggregateCode: \"m3\" }, { aggregateCode: \"stk\" }],\r\n disabled: false,\r\n },\r\n\r\n navType: \"custom\",\r\n labelAndColumnTitleHandling: { translationPrefix: \"QUTOfferingPosCol\" },\r\n controlsRendering: { fillSpaceIfNotVisible: false },\r\n initial_sort: { field: \"U_PosId\", direction: \"asc\" },\r\n edit: {\r\n editType: \"inline\",\r\n noCancelOnEditFormIfFormStateWasInvalidWhenOpened: true,\r\n reserveSpaceForInlineValidationSummary: true,\r\n },\r\n },\r\n}\r\n","import type { LookupColumnDef } from \"../../../../../_ovlclient/src/library/forms/sysformelement\"\r\nimport {\r\n ListDefinition,\r\n SYSTableDef,\r\n} from \"../../../../../_ovlclient/src/library/table/table\"\r\nimport type { FileList } from \"../parts/filelist/filelist\"\r\n\r\nimport { tblSearchPaket } from \"../features/datdocuments/searchpaket/tabledef\"\r\nimport { tblPackagingSplit } from \"../features/pkgpackaging/packaging/packagingsplit/tabledef\"\r\nimport { tblPackaging } from \"../features/pkgpackaging/packaging/tabledef\"\r\nimport { tblAdminUpload } from \"../features/qutoffering/offering/adminupload/tabledef\"\r\nimport {\r\n tblOfferingCosts,\r\n tblOfferingMaterial,\r\n tblOfferingTransport,\r\n} from \"../features/qutoffering/offering/details/tabledefs\"\r\nimport { tblOffering } from \"../features/qutoffering/offering/tabledef\"\r\nimport { tblOfferingSettingsDef } from \"../features/qutoffering/offeringsettings/tabledef\"\r\nimport { tblSymbolPC } from \"../features/spcsymbolpc/tabledef\"\r\nimport { tblSymbolPCEndUser } from \"../features/spcsymbolpc/tabledefenduser\"\r\nimport { tblOfferingPos } from \"../features/qutoffering/offering/cut/poslist/tabledef\"\r\nimport { SortGet } from \"../../../../../_ovlclient/src/global/globalapi\"\r\n\r\nexport type Language = \"DE\" | \"FR\"\r\n\r\nexport type PicsState = {\r\n salesContact: string\r\n}\r\n\r\nexport type PartnerState = {\r\n mainAttachments: FileList\r\n partnerAttachments: FileList\r\n salesContact: {\r\n id: string\r\n firstName: string\r\n lastName: string\r\n phone: string\r\n email: string\r\n }\r\n}\r\n\r\ntype Role = \"User\" | \"Admin\"\r\n\r\ntype User = {\r\n offeringCadAttr: string\r\n offeringCadUserField: number\r\n offeringCadVal: string\r\n offeringDummyMaterialItemCode: string\r\n}\r\n\r\nlet chartData\r\n\r\nlet partner: PartnerState\r\nlet pics: PicsState = {\r\n salesContact: \"\",\r\n}\r\n\r\nlet weekAndDate: ListDefinition\r\n\r\ntype RawB1LookupType = {\r\n TableId: string\r\n FieldId: string\r\n Key: string\r\n Value: string\r\n}\r\n\r\nlet b1Lookups: Array = []\r\n\r\nlet user: User = {\r\n offeringCadAttr: undefined,\r\n offeringCadUserField: undefined,\r\n offeringCadVal: undefined,\r\n offeringDummyMaterialItemCode: undefined,\r\n}\r\n\r\nlet tblOfferingActual: SYSTableDef = JSON.parse(JSON.stringify(tblOffering))\r\ntblOfferingActual.id = \"QUTOfferingActual\"\r\n\r\nlet GEN = {\r\n user,\r\n chartData,\r\n pics,\r\n lookups: {\r\n weekAndDate,\r\n OCRD: {\r\n data: {},\r\n lookupDef: {\r\n CardCode: {\r\n mapToColumn: \"U_CardCode\",\r\n type: \"text\",\r\n translationKey: \"SYSUserAdministrationColCardCode\",\r\n },\r\n Name: {\r\n type: \"text\",\r\n translationKey: \"SYSUserAdministrationColCardName\",\r\n },\r\n },\r\n },\r\n },\r\n lists: { b1Lookups },\r\n}\r\n\r\nlet SPC = {\r\n tables: {\r\n SPCSymbolPC: {\r\n tableDef: {\r\n SPCSymbolPC: tblSymbolPC,\r\n SPCSymbolPCEndUser: tblSymbolPCEndUser,\r\n },\r\n },\r\n },\r\n}\r\n\r\nlet PKG = {\r\n tables: {\r\n PKGPackaging: {\r\n data: undefined,\r\n tableDef: {\r\n PKGPackaging: tblPackaging,\r\n },\r\n },\r\n PKGPackagingSplit: {\r\n tableDef: {\r\n PKGPackagingSplit: tblPackagingSplit,\r\n },\r\n },\r\n },\r\n}\r\n\r\nlet DAT = {\r\n tables: {\r\n DATSearchPaket: {\r\n data: undefined,\r\n tableDef: {\r\n DATSearchPaket: tblSearchPaket,\r\n },\r\n },\r\n },\r\n partner,\r\n}\r\nlet QUT = {\r\n offering: {\r\n offeringSawCutSize: 0,\r\n offeringInitialCutSize: 0,\r\n },\r\n lookups: {\r\n CntctCode: {\r\n data: {},\r\n lookupDef: {\r\n CntctCode: { type: \"int\" },\r\n CntctName: { type: \"text\" },\r\n CardCode: { type: \"text\" },\r\n },\r\n },\r\n U_ImportSKL: {\r\n data: {},\r\n lookupDef: {\r\n Code: { type: \"text\" },\r\n },\r\n },\r\n },\r\n tables: {\r\n QUTOffering: {\r\n data: undefined,\r\n index: undefined,\r\n tableDef: {\r\n QUTOffering: tblOffering,\r\n QUTOfferingActual: tblOfferingActual,\r\n },\r\n },\r\n QUTOfferingPos: {\r\n data: undefined,\r\n index: undefined,\r\n tableDef: {\r\n QUTOfferingPos: tblOfferingPos,\r\n },\r\n },\r\n\r\n QUTOfferingCosts: {\r\n data: undefined,\r\n tableDef: {\r\n QUTOfferingCosts: tblOfferingCosts,\r\n },\r\n },\r\n QUTOfferingMaterial: {\r\n data: undefined,\r\n tableDef: {\r\n QUTOfferingMaterial: tblOfferingMaterial,\r\n },\r\n },\r\n QUTOfferingTransport: {\r\n data: undefined,\r\n tableDef: {\r\n QUTOfferingTransport: tblOfferingTransport,\r\n },\r\n },\r\n QUTOfferingSettings: {\r\n data: undefined,\r\n tableDef: {\r\n QUTOfferingSettings: tblOfferingSettingsDef,\r\n },\r\n },\r\n QUTOfferingAdminUpload: {\r\n tableDef: {\r\n QUTOfferingAdminUpload: tblAdminUpload,\r\n },\r\n },\r\n },\r\n}\r\n\r\nexport let global = {\r\n DAT,\r\n SPC,\r\n PKG,\r\n QUT,\r\n GEN,\r\n}\r\n","import { features } from \"./features\"\r\nimport { screens } from \"./screens\"\r\nimport { global } from \"./global\"\r\nexport let appState = { features, screens, global }\r\n","import type { SYSState } from \"../../../../_ovlclient/src\"\r\nimport type {\r\n AppDefDialog,\r\n AppDefPermission,\r\n AppDefScreen,\r\n AppDefTableDefId,\r\n SYSConfigType,\r\n} from \"../../../../_ovlclient/src/config\"\r\nimport { isIOS } from \"../../../../_ovlclient/src/global/globals\"\r\n\r\nimport { ProcessSnackType } from \"../../../../_ovlclient/src/library/longrunningprocesstracker/longrunningprocesstracker\"\r\nimport { appActions } from \"./appactions\"\r\nexport { appState } from \"./appstate\"\r\nexport { appActions }\r\n\r\nexport let app = {\r\n features: {\r\n SYSTableSettingsSaveFilterSortAll: {},\r\n SYSTableSettingsSaveFilterSortCompany: {},\r\n SYSTableSettingsSaveFilterSortOwn: {},\r\n SYSTableSettingsReadOnlyFilterSort: {},\r\n DATSalesOrders: {},\r\n DATQuotations: {},\r\n DATInvoices: {},\r\n QUTOfferingTool: {},\r\n QUTOfferingToolAdmin: {},\r\n PKGPackaging: {},\r\n PKGPackagingSplit: {},\r\n SPCSymbolPCEndUser: {},\r\n SPCSymbolPC: {},\r\n },\r\n permissions: {\r\n /* Data */\r\n DATDA: { useModifiers: false },\r\n /* Packaging */\r\n PKGPK: { useModifiers: false },\r\n /* SymbolPC */\r\n SPCSP: { useModifiers: true },\r\n //Search Paket\r\n SPKSP: { useModifiers: false },\r\n //Offering\r\n QUTOF: { useModifiers: true },\r\n },\r\n\r\n dialogs: {\r\n GENImagePopup: {},\r\n PKGPackagingSplit: {},\r\n SYSTableSettings_AdvancedFilter: {},\r\n QUTOfferingPos: {},\r\n },\r\n longRunningProcess: {\r\n QUTOfferingPosProductionExport: {\r\n snack: { type: \"BusyIndicator\" },\r\n },\r\n GENRefreshData: { snack: { type: \"BusyIndicator\" } },\r\n GENSaveFeedback: { snack: { type: \"BusyIndicator\" } },\r\n GENSaveSettings: { snack: { type: \"BusyIndicator\" } },\r\n PKGPackagingPackagingPrintLabel: {\r\n snack: { type: \"BusyIndicator\" },\r\n },\r\n PKGPackagingPackagingSplit: {\r\n snack: { type: \"BusyIndicator\" },\r\n },\r\n PKGPackagingPackagingUnSplit: {\r\n snack: { type: \"BusyIndicator\" },\r\n },\r\n\r\n OfferingStatus: {},\r\n QUTOfferingOfferingEmailNotification: {},\r\n QUTOfferingOfferingPDFDownloading: {\r\n snack: { type: \"BusyIndicator\" },\r\n },\r\n GENNewOfferUpload: {\r\n snack: { type: \"BusyIndicator\" },\r\n },\r\n QUTOfferingRecalcStatus: { lockScreen: true },\r\n\r\n QUTOfferingOfferingAcceptOfferSnack: {\r\n snack: { type: \"BusyIndicator\" },\r\n },\r\n },\r\n forms: {\r\n DATFeedback: {},\r\n DATSearchPaket: {},\r\n QUTOfferingSettings: {},\r\n QUTBPFilter: {},\r\n QUTAdminUploadForm: {},\r\n },\r\n tableDefIds: {\r\n DATSearchPaket: {\r\n getData: (state: SYSState) => state.app.global.DAT.tables.DATSearchPaket,\r\n },\r\n\r\n PKGPackaging: {\r\n getData: (state: SYSState) => state.app.global.PKG.tables.PKGPackaging,\r\n },\r\n\r\n PKGPackagingSplit: {\r\n getData: (state: SYSState) =>\r\n state.app.global.PKG.tables.PKGPackagingSplit,\r\n },\r\n\r\n SPCSymbolPC: {\r\n getData: (state: SYSState) => state.app.global.SPC.tables.SPCSymbolPC,\r\n },\r\n SPCSymbolPCEndUser: {\r\n getData: (state: SYSState) => state.app.global.SPC.tables.SPCSymbolPC,\r\n },\r\n QUTOffering: {\r\n getData: (state: SYSState) => state.app.global.QUT.tables.QUTOffering,\r\n },\r\n QUTOfferingActual: {\r\n getData: (state: SYSState) => state.app.global.QUT.tables.QUTOffering,\r\n },\r\n\r\n //currently used for offering type \"CUT\" and the user uploadable and editable poslist\r\n QUTOfferingPos: {\r\n getData: (state: SYSState) => state.app.global.QUT.tables.QUTOfferingPos,\r\n },\r\n\r\n QUTOfferingSettings: {\r\n getData: (state: SYSState) =>\r\n state.app.global.QUT.tables.QUTOfferingSettings,\r\n },\r\n QUTOfferingCosts: {\r\n getData: (state: SYSState) =>\r\n state.app.global.QUT.tables.QUTOfferingCosts,\r\n },\r\n QUTOfferingMaterial: {\r\n getData: (state: SYSState) =>\r\n state.app.global.QUT.tables.QUTOfferingMaterial,\r\n },\r\n QUTOfferingTransport: {\r\n getData: (state: SYSState) =>\r\n state.app.global.QUT.tables.QUTOfferingTransport,\r\n },\r\n QUTOfferingAdminUpload: {\r\n getData: (state: SYSState) =>\r\n state.app.global.QUT.tables.QUTOfferingAdminUpload,\r\n },\r\n },\r\n\r\n languages: { DE: {}, FR: {} },\r\n screens: {\r\n GENDashboard: {},\r\n GENSettings: {},\r\n DATQuotation: {},\r\n DATOrder: {},\r\n DATInvoice: {},\r\n DATOrderdetail: {},\r\n DATFeedback: {},\r\n DATSearchPaket: {},\r\n PKGPackaging: {},\r\n PKGPackagingCustomerChooser: {},\r\n QUTOffering: {},\r\n QUTOfferingAdmin: {},\r\n QUTOfferingAdminCut: {},\r\n QUTOfferingDetails: {},\r\n SPCSymbolPC: {},\r\n SPCSymbolPCEndUser: {},\r\n },\r\n customValidators: {},\r\n editors: {},\r\n}\r\nexport let SYSConfig: SYSConfigType = {\r\n _system: {\r\n debugTracking: false,\r\n version: \"2.10.2502051\",\r\n isDev: false,\r\n autoAddMissingTranslationsInDevMode: true,\r\n showSaveOrigin: true,\r\n statePersistVersion: 1,\r\n defaultDateTimeControlSubmitType: \"UTC\",\r\n suppressAfterRenderIfGetUIEmpty: true,\r\n fieldValConvertedValueIfInvalid: true,\r\n appId: \"001\",\r\n },\r\n init: { initalScreen: \"GENDashboard\" },\r\n app,\r\n\r\n formDefaults: {\r\n showErrorWhileTyping: false,\r\n },\r\n fetch: {\r\n authMode: \"cookie\",\r\n timeout: 5000,\r\n useCompressed: true,\r\n },\r\n global: {\r\n stickyHeaderEnabled: (state: SYSState) => {\r\n return !isIOS()\r\n },\r\n },\r\n}\r\n","import type { SYSState } from \"../../../../_ovlclient/src\"\r\nimport { html, SYSConfig, render } from \"../../../../_ovlclient/src\"\r\nexport let startRender = async (state: SYSState) => {\r\n console.log(\r\n `itflies kalt ag portal ${SYSConfig._system.version} is initialised and is starting...`\r\n )\r\n\r\n await render(\r\n html` `,\r\n document.getElementById(\"app\")\r\n )\r\n}\r\n","import { SYSBaseElement } from \"../sysbaseelement\"\r\nimport { DirectiveResult, TemplateResult, html } from \"../../\"\r\nimport { isMobile } from \"../../global/globals\"\r\n\r\nexport type SnackType =\r\n | \"Information\"\r\n | \"Warning\"\r\n | \"Success\"\r\n | \"Error\"\r\n | \"BusyIndicator\"\r\n | \"none\"\r\n\r\nexport let SnackId = { id: 0 }\r\n\r\nconst nrOfSnacks = 3\r\n\r\nexport type SnackState = {\r\n text: string | DirectiveResult | TemplateResult\r\n type: SnackType\r\n durationMs?: number\r\n id?: number\r\n status?: \"queued\" | \"running\"\r\n key?: string\r\n}\r\n\r\nexport type SnackAddState = {\r\n text: string | DirectiveResult | TemplateResult\r\n type: SnackType\r\n durationMs?: number\r\n key?: string\r\n}\r\n\r\nexport const RemoveSnack = (div) => {\r\n if (div) {\r\n div.classList.remove(\"fadeInSnack\")\r\n div.classList.add(\"fadeOutSnack\")\r\n }\r\n}\r\n\r\nexport class SYSSnack extends SYSBaseElement {\r\n async init() {\r\n this.addEventListener(\"animationend\", this.handleAnimationEnd)\r\n await super.init()\r\n }\r\n\r\n handleAnimationEnd = (e) => {\r\n let id = e.target.id\r\n\r\n if (e.animationName === \"fadeInSnack\") {\r\n e.target.classList.remove(\"fadeInSnack\")\r\n } else if (e.animationName === \"fadeOutSnack\") {\r\n let parent = e.target.parentElement\r\n\r\n parent.removeChild(e.target)\r\n this.actions.ovl.internal._ClearSnack({ id, el: parent })\r\n }\r\n }\r\n\r\n async getUI() {\r\n // this render just defines the slots...\r\n // all other handling is in the ...Snack - Actions\r\n let res = []\r\n for (let z = 0; z < nrOfSnacks; z++) {\r\n res.push(html`
    `)\r\n }\r\n\r\n let width = \"\"\r\n return html`\r\n
    ${res.map((m) => m)}
    \r\n `\r\n }\r\n}\r\n","import { RemoveSnack as StartRemoveSnack, SnackId } from \"./snack\"\r\nimport type { SnackAddState, SnackType } from \"./snack\"\r\n\r\nimport type { SYSAction } from \"../../\"\r\nimport { html, render, unsafeHTML } from \"../../\"\r\nimport type { TemplateResult } from \"../../\"\r\n\r\nexport const _RemoveSnack: SYSAction = (value, { global }) => {\r\n let state = global.getState()\r\n // if not already got added just remove from state (there are max. 3 snacks display so it could be that its not even displayed)\r\n let key = \"ovlsnack\" + value.replaceAll(\".\", \"_\").replaceAll(\",\", \"_\")\r\n if (\r\n state.ovl.libState.snacks[key] &&\r\n state.ovl.libState.snacks[key].status === \"queued\"\r\n ) {\r\n delete state.ovl.libState.snacks[key]\r\n return\r\n }\r\n let el = document.querySelector(`#${key}:not(.fadeOutSnack)`)\r\n // problem it removes the one with animation fadeout, it should use the one without\r\n\r\n if (!el) {\r\n el = document.querySelector(`#${key}`)\r\n }\r\n StartRemoveSnack(el)\r\n}\r\n\r\nexport const _ClearSnack: SYSAction<{ id: string; el: any }> = (\r\n value,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n delete state.ovl.libState.snacks[\r\n value.id.replaceAll(\".\", \"_\").replaceAll(\",\", \"_\")\r\n ]\r\n\r\n let el = value.el\r\n if (el) {\r\n let parent = el\r\n // parent.removeChild(el)\r\n do {\r\n //@ts-ignore\r\n let parent2 = parent.previousElementSibling\r\n if (!parent2) {\r\n break\r\n }\r\n let parentFirstChild = parent2.firstElementChild\r\n if (\r\n !parentFirstChild ||\r\n parentFirstChild.classList.contains(\"fadeInSnack\") ||\r\n parentFirstChild.classList.contains(\"fadeOutSnack\")\r\n ) {\r\n break\r\n }\r\n\r\n parent.appendChild(parentFirstChild)\r\n parent = parent2\r\n } while (true)\r\n actions.ovl.internal._PlaceSnack()\r\n }\r\n}\r\n\r\nexport type ReplaceSnackContentType = {\r\n content: string | TemplateResult\r\n key: string\r\n}\r\n\r\nexport const _ReplaceSnackContent: SYSAction = (\r\n content,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n let ovlContentEl = document.getElementById(\r\n `ovlsnack${content.key.replaceAll(\".\", \"_\").replaceAll(\",\", \"_\")}content`\r\n )\r\n\r\n let text = content.content\r\n if (typeof text === \"string\") {\r\n text = text.replace(/\\r?\\n/, \"
    \")\r\n }\r\n //@ts-ignore\r\n ovlContentEl.innerHTML = text\r\n}\r\n\r\nexport const _PlaceSnack: SYSAction = (_, { global }) => {\r\n let state = global.getState()\r\n let ovlSnackEl = document.getElementById(\"ovlsnack\")\r\n let wait = 0\r\n ovlSnackEl = document.getElementById(\"ovlsnack\")\r\n if (!ovlSnackEl) {\r\n return\r\n }\r\n let snacks = state.ovl.libState.snacks\r\n if (snacks) {\r\n Object.keys(snacks)\r\n .filter((f) => snacks[f].status === \"queued\")\r\n .sort((a, b) => snacks[a].id - snacks[b].id)\r\n .forEach((k) => {\r\n //if (filteredAndSortedSnacks.length > 0) {\r\n let snackToAdd = snacks[k]\r\n let lastOccupiedSlot = 0\r\n let lastFreeSlot = 0\r\n let lastFreeSlotEl\r\n let firstFreeSlotEl\r\n let parentEl = ovlSnackEl.lastElementChild\r\n let z = 0\r\n do {\r\n let slotEl = parentEl.firstElementChild\r\n if (slotEl) {\r\n lastOccupiedSlot = z\r\n } else {\r\n lastFreeSlot = z\r\n lastFreeSlotEl = parentEl\r\n if (!firstFreeSlotEl) {\r\n firstFreeSlotEl = parentEl\r\n }\r\n }\r\n parentEl = parentEl.previousElementSibling\r\n z++\r\n } while (parentEl)\r\n if (lastOccupiedSlot === 0 || lastOccupiedSlot < lastFreeSlot) {\r\n if (lastOccupiedSlot === 0) {\r\n lastFreeSlotEl = firstFreeSlotEl\r\n }\r\n\r\n snackToAdd.status = \"running\"\r\n let snackType\r\n let busyIndicator\r\n if (snackToAdd.type === \"BusyIndicator\") {\r\n snackType = \"Information\".toLowerCase() as SnackType\r\n busyIndicator = html`\r\n
    \r\n
    \r\n
    \r\n `\r\n }\r\n\r\n snackType = snackToAdd.type.toLowerCase()\r\n let div = document.createElement(\"div\")\r\n div.id = k\r\n div.setAttribute(\"role\", \"alert\")\r\n if (typeof snackToAdd.text === \"string\") {\r\n snackToAdd.text = unsafeHTML(snackToAdd.text)\r\n }\r\n let content = html`
    ${snackToAdd.text}
    `\r\n let tpl\r\n if (busyIndicator) {\r\n tpl = html`${content}     ${busyIndicator}`\r\n } else {\r\n tpl = html`${content}`\r\n }\r\n render(tpl, div)\r\n div.classList.add(\"fd-message-strip\")\r\n div.classList.add(\"ovl-snack\")\r\n let type = \"fd-message-strip--\" + snackType\r\n div.classList.add(type)\r\n div.classList.add(\"fadeInSnack\")\r\n lastFreeSlotEl.appendChild(div)\r\n if (snackToAdd.durationMs != 999999) {\r\n setTimeout((e) => {\r\n StartRemoveSnack(div)\r\n }, snackToAdd.durationMs)\r\n }\r\n }\r\n })\r\n }\r\n //}, wait)\r\n}\r\n\r\nexport const _AddSnack: SYSAction = (value, { global }) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n // don't stack unecessary fire and forget notifications when tab is not active...\r\n if (!value.key && document.hidden) {\r\n return\r\n }\r\n let id = SnackId.id++\r\n let key = value.key\r\n if (!key) {\r\n key = \"ovlsnack\" + id.toString()\r\n }\r\n if (!key.startsWith(\"ovlsnack\")) {\r\n key = \"ovlsnack\" + key\r\n }\r\n key = key.replaceAll(\".\", \"_\").replaceAll(\",\", \"_\")\r\n let duration = value.durationMs\r\n if (!duration) {\r\n duration = 4000\r\n }\r\n\r\n let text = value.text\r\n if (typeof text === \"string\") {\r\n text = text.replace(/\\r?\\n/, \"
    \")\r\n }\r\n\r\n if (!state.ovl.libState.snacks[key]) {\r\n state.ovl.libState.snacks[key] = {\r\n text,\r\n type: value.type,\r\n durationMs: duration,\r\n status: \"queued\",\r\n id,\r\n key,\r\n }\r\n actions.ovl.internal._PlaceSnack()\r\n }\r\n}\r\n\r\n// removed in favour of ProcessIsRunning...\r\n// export const SnackTrackedIsRunning = (key: string) => {\r\n// return !!ovl.getState().ovl.libState.snacks[`ovlsnack${key}`]\r\n// }\r\n","import {\r\n SYSFeature,\r\n unsafeHTML,\r\n type DirectiveResult,\r\n type SYSAction,\r\n type SYSActions,\r\n type SYSDialog,\r\n type SYSLongRunningProcess,\r\n type SYSScreen,\r\n type SYSState,\r\n type SYSTableDefIds,\r\n type TemplateResult,\r\n} from \"../..\"\r\nimport { T } from \"../../global/globals\"\r\nimport {\r\n HookTableRowFnResultExecution,\r\n HookTableRowFnResultExecution_Type,\r\n HookTableServerBeforeMergeRow,\r\n HookTableServerData,\r\n HookTableServerData_Type,\r\n ServerData_ChangedType,\r\n TableRowFnProcessFeedback_Type,\r\n TableRowFnProcessFeedbackFull_Type,\r\n TableRowFnProcessRawFeedbackSummaryCount_Type,\r\n} from \"../../global/hooks\"\r\nimport { DialogOk } from \"../dialog/dialogapi\"\r\nimport { DialogType } from \"../dialog/sysdialogbase\"\r\nimport type { SYSFormState } from \"../forms/actions\"\r\nimport { ScreenCurrentState } from \"../screenapi\"\r\nimport type { SnackType } from \"../snack/snack\"\r\nimport { SnackAdd, SnackTrackedAdd, SnackTrackedRemove } from \"../snackapi\"\r\nimport { _TableRefreshDataFromServerHelper } from \"../table/actions\"\r\nimport {\r\n _AddRowToDisplayedArray,\r\n _DoRebuildAndFixPage,\r\n _DoServerDataConversionSyncAndBuildUpRebuildAndChangedInfo,\r\n _GetTableDialogTitle,\r\n _MergeRowHookParamsType,\r\n DoRefreshLookups,\r\n} from \"../table/helpers\"\r\nimport { OvlSysColumn } from \"../table/table\"\r\nimport {\r\n SYSTableDef,\r\n TableGet,\r\n TableRemoveRowFromData,\r\n} from \"../table/tableapi\"\r\nimport { ProcessEnd, ProcessIsRunning } from \"./processapi\"\r\n\r\nexport type LongRunningProcessState = {\r\n isRunning: boolean\r\n id: string\r\n lockedFormType?: { formType: string; formId: string }[]\r\n lockedDialog?: SYSDialog\r\n lockedDialogInstance?: any\r\n lockedScreen?: SYSScreen\r\n lockedScreenInstance?: string\r\n processType?: string\r\n instanceId?: string\r\n tableFn?: {\r\n // lockedTableKeys contains the locked keys\r\n // means when a result returns it will be unlocked by removed from here\r\n // originally selectedKeys\r\n lockedTableKeys?: {}\r\n selectedKeys?: {}\r\n fnName?: string\r\n fnId?: string\r\n tableDefId?: SYSTableDefIds\r\n\r\n rowKey?: string\r\n }\r\n ts?: number\r\n hasTrackedSnack: boolean\r\n refCounter: number\r\n currentFeedback: { [key: string]: TableRowFnProcessFeedbackFull_Type }\r\n}\r\n\r\nexport type ProcessSnackType = {\r\n type?: SnackType\r\n fireAndForgetSnackDuration?: number\r\n text?: string\r\n alternativeTranslationKey?: string\r\n customTextReplacements?: string[]\r\n}\r\n\r\ntype ProcessLockDef = {\r\n formState?: SYSFormState | SYSFormState[]\r\n dialog?: SYSDialog\r\n dialogInstance?: any\r\n screen?: SYSScreen\r\n screenInstance?: string\r\n}\r\n\r\nexport const _LongRunningProcessStart: SYSAction<\r\n {\r\n processType: SYSLongRunningProcess\r\n instance?: string\r\n snack?: ProcessSnackType\r\n lock?: ProcessLockDef\r\n isRefresh?: boolean\r\n // provide the locked tableKeys as Object wo we can quickly can check the keys\r\n tableFn?: {\r\n rowKey: string\r\n lockedTableKeys?: {}\r\n fnName?: string\r\n fnId: string\r\n tableDefId: SYSTableDefIds\r\n }\r\n },\r\n _ProcessReturnType\r\n> = (value, { global }) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n return LongRunningProcessStartHelper(\r\n actions,\r\n state,\r\n value.processType,\r\n value.instance,\r\n value.snack,\r\n value.lock,\r\n value.isRefresh,\r\n value.tableFn\r\n )\r\n}\r\n\r\nexport type _ProcessReturnType = {\r\n currentFeedback: { [key: string]: TableRowFnProcessFeedback_Type }\r\n trackedSnackId: string\r\n tableFn: {\r\n // lockedTableKeys contains the locked keys\r\n // means when a result returns it will be unlocked by removed from here\r\n // originally selectedKeys\r\n lockedTableKeys?: {}\r\n selectedKeys?: {}\r\n fnName?: string\r\n fnId?: string\r\n tableDefId?: SYSTableDefIds\r\n rowKey?: string\r\n }\r\n\r\n process: SYSLongRunningProcess\r\n instance: string\r\n // we can deliver a success but still have a optional warning\r\n setSuccess: (\r\n id: string,\r\n text?: string | TemplateResult | DirectiveResult,\r\n code?: string,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) => void\r\n setInformation: (\r\n id: string,\r\n text?: string | TemplateResult | DirectiveResult,\r\n code?: string,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) => void\r\n\r\n setWarning: (\r\n id: string,\r\n text?: string | TemplateResult | DirectiveResult,\r\n code?: string,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) => void\r\n setError: (\r\n id: string,\r\n text?: string | TemplateResult | DirectiveResult,\r\n code?: string,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) => void\r\n setFromResult: (result: TableRowFnProcessFeedbackFull_Type) => void\r\n showSummary: (\r\n summaryType: \"Snack\" | \"DialogIfMultiple\" | \"DialogAlways\",\r\n positionText?: string\r\n ) => void\r\n stop: () => void\r\n}\r\n\r\nconst LongRunningProcessStartHelper = (\r\n actions: SYSActions,\r\n state: SYSState,\r\n processType: SYSLongRunningProcess,\r\n instance?: string,\r\n snack?: ProcessSnackType,\r\n lock?: ProcessLockDef,\r\n isRefresh?: boolean,\r\n tableFn?: {\r\n rowKey: string\r\n lockedTableKeys?: {}\r\n fnName?: string\r\n fnId: string\r\n tableDefId: SYSTableDefIds\r\n }\r\n): _ProcessReturnType => {\r\n let allProcessesState = state.ovl.longRunningProcessTracker\r\n\r\n // delete processstate from non running instances that has no feedback and are older than x minutes\r\n // they are tracked and recreated\r\n // to avoid unecessary object creation remove them\r\n let ts = new Date().getTime()\r\n Object.keys(allProcessesState).forEach((process) => {\r\n let instance = allProcessesState[process].instance\r\n let instancesToDelete = Object.keys(instance)\r\n .filter(\r\n (instanceKey) =>\r\n // some old SYSModal instance SYSModal as well type should not be affected\r\n instanceKey !== process &&\r\n // not running\r\n !instance[instanceKey].isRunning &&\r\n // not started for 5 minutes\r\n instance[instanceKey].ts - ts > 1000 * 60 * 5 &&\r\n // if there are feedbacks don't delete\r\n Object.keys(instance[instanceKey].feedback).length === 0\r\n )\r\n .map((k) => k)\r\n instancesToDelete.forEach((f) => {\r\n delete allProcessesState[process].instance[f]\r\n })\r\n })\r\n\r\n if (!instance) {\r\n instance = processType\r\n }\r\n let processMainState = allProcessesState[processType]\r\n\r\n if (!processMainState) {\r\n return\r\n }\r\n if (!snack && !processMainState.snackFixedByAppDef) {\r\n processMainState.snack = undefined\r\n }\r\n\r\n if (isRefresh !== undefined) {\r\n processMainState.isRefresh = isRefresh\r\n }\r\n\r\n if (!snack) {\r\n let snackReplacements = snack?.customTextReplacements\r\n snack = processMainState.snack\r\n if (snackReplacements) {\r\n snack.customTextReplacements = snackReplacements\r\n }\r\n } else if (snack.type === \"none\") {\r\n snack = undefined\r\n }\r\n if (snack && !snack.type) {\r\n snack.type = \"Information\"\r\n }\r\n\r\n let lockScreen = processMainState.lockScreen\r\n\r\n if (!lock?.screen && lockScreen) {\r\n let currentScreenState = ScreenCurrentState()\r\n let currentScreen = currentScreenState.screen\r\n let currentScreenInstance = currentScreenState.instance\r\n if (!lock) {\r\n lock = { screen: currentScreen, screenInstance: currentScreenInstance }\r\n } else {\r\n lock.screen = currentScreen\r\n lock.screenInstance = currentScreenInstance\r\n }\r\n }\r\n let hasSnack = !!snack\r\n let hasTrackedSnack =\r\n hasSnack && snack.fireAndForgetSnackDuration === undefined\r\n let id = `${processType}_${instance}`\r\n let instanceState =\r\n state.ovl.longRunningProcessTracker[processType][\"instance\"][instance]\r\n\r\n //_RenderTracking.forceTracking = true\r\n if (!instanceState) {\r\n state.ovl.longRunningProcessTracker[processType][\"instance\"][instance] = {\r\n isRunning: true,\r\n id,\r\n hasTrackedSnack,\r\n refCounter: 0,\r\n\r\n currentFeedback: {},\r\n\r\n tableFn: {},\r\n processType,\r\n instanceId: instance,\r\n }\r\n }\r\n\r\n //_RenderTracking.forceTracking = false\r\n instanceState =\r\n state.ovl.longRunningProcessTracker[processType][\"instance\"][instance]\r\n if (tableFn) {\r\n instanceState.tableFn.fnId = tableFn.fnId\r\n instanceState.tableFn.fnName = tableFn.fnName\r\n instanceState.tableFn.lockedTableKeys = tableFn.lockedTableKeys\r\n instanceState.tableFn.selectedKeys = JSON.parse(\r\n JSON.stringify(tableFn.lockedTableKeys)\r\n )\r\n instanceState.tableFn.tableDefId = tableFn.tableDefId\r\n instanceState.tableFn.rowKey = tableFn.rowKey\r\n }\r\n instanceState.processType = processType\r\n instanceState.instanceId = instance\r\n instanceState.ts = new Date().getTime()\r\n\r\n instanceState.isRunning = true\r\n // currentFeedback should reset on each start\r\n instanceState.currentFeedback = {}\r\n instanceState.id = id\r\n if (!instanceState.hasTrackedSnack) {\r\n instanceState.hasTrackedSnack = hasTrackedSnack\r\n }\r\n if (isNaN(instanceState.refCounter)) {\r\n instanceState.refCounter = 0\r\n }\r\n // don't delete feedback... we would like to see errors and warnings as long as the id was not executed successfully or somehow dismissed (todo by the user)\r\n // for process summary errors count etc we can use the currentFeedback\r\n //instanceState.feedback = {}\r\n instanceState.refCounter++\r\n\r\n let lockedScreen\r\n let lockedFormState\r\n let lockedDialog\r\n\r\n if (lock) {\r\n if (Array.isArray(lock.formState)) {\r\n lockedFormState = lock.formState.map((m) => {\r\n m.locked = true\r\n return {\r\n formType: m.formType,\r\n formId: m.formId,\r\n }\r\n })\r\n } else if (lock.formState) {\r\n lock.formState.locked = true\r\n lockedFormState = [\r\n {\r\n formType: (lock.formState).formType,\r\n formId: (lock.formState).formId,\r\n },\r\n ]\r\n }\r\n lockedDialog = lock.dialog\r\n let lockedDialogInstance = lock.dialogInstance\r\n\r\n if (lockedDialog) {\r\n actions.ovl.dialog._DialogSetLock({\r\n dialog: lockedDialog,\r\n locked: true,\r\n instance: lockedDialogInstance,\r\n })\r\n }\r\n\r\n if (lock.screen) {\r\n actions.ovl.screen._ScreenSetLock({\r\n screen: lock.screen,\r\n locked: true,\r\n instance: lock.screenInstance,\r\n })\r\n }\r\n // let instanceState =\r\n // state.ovl.longRunningProcessTracker[processType][\"instance\"][instance]\r\n\r\n instanceState.lockedFormType = lockedFormState\r\n instanceState.lockedDialog = lockedDialog\r\n instanceState.lockedDialogInstance = lockedDialogInstance\r\n instanceState.lockedScreen = lock.screen\r\n instanceState.lockedScreenInstance = lock.screenInstance\r\n }\r\n const setOnRelatedProcessesHelper = (\r\n id: string,\r\n type: \"error\" | \"warning\" | \"success\" | \"information\" | \"remove\",\r\n text: string | TemplateResult | DirectiveResult,\r\n code: string,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type,\r\n defId?: SYSTableDefIds\r\n ) => {\r\n if (cnt === undefined) {\r\n cnt = \"cis\"\r\n }\r\n let ts = new Date().getTime()\r\n\r\n // todo: is it necessary to still check for Multi and Instance and all HasFeatureThatStartsWith\r\n // because now it gets looped twice and rowfeedback ovlsyststae can be set once...\r\n // because fnFeedback on the process is just for the summary right?\r\n // and this we should get out from process which started all (instanceState)\r\n\r\n if (instanceState.tableFn?.lockedTableKeys) {\r\n let tb = TableGet(instanceState.tableFn.tableDefId)\r\n\r\n let ovlSysState = tb.rows[id]?.OvlSysState as OvlSysColumn\r\n\r\n if (type !== \"remove\") {\r\n if (ovlSysState) {\r\n // save feedback to sysstaterow\r\n // (improves perf for rendering row)\r\n ovlSysState.fnFeedback[instanceState.tableFn.fnId] = {\r\n type,\r\n text,\r\n code,\r\n cnt,\r\n ts,\r\n defId,\r\n }\r\n let lvl = parseInt(tb.def.options.feedback.level.split(\":\")[0])\r\n if (\r\n lvl !== 0 &&\r\n (lvl >= 4 ||\r\n (lvl === 3 && type !== \"success\") ||\r\n (lvl === 2 && type !== \"success\" && type !== \"warning\") ||\r\n (lvl === 1 && type === \"error\"))\r\n ) {\r\n ovlSysState.lastFeedbackTS = ts\r\n // we need to set the rebuild needsRefresh here if we sort by feedback\r\n Object.keys(tb.dataDef.tableDef)\r\n .filter(\r\n (f) =>\r\n (tb.dataDef.tableDef[f]).initialised &&\r\n !(tb.dataDef.tableDef[f]).uiState.rebuild\r\n .needsRefresh &&\r\n (tb.dataDef.tableDef[f]).uiState.sort?.byFeedback\r\n )\r\n .forEach((tdk) => {\r\n let td: SYSTableDef = tb.dataDef.tableDef[tdk]\r\n td.uiState.rebuild.needsRefresh = true\r\n })\r\n }\r\n }\r\n } else {\r\n if (ovlSysState?.fnFeedback) {\r\n delete ovlSysState.fnFeedback[instanceState.tableFn.fnId]\r\n }\r\n }\r\n instanceState.currentFeedback[id] = { type, text, code, ts, cnt }\r\n delete instanceState.tableFn.lockedTableKeys[id]\r\n }\r\n }\r\n let executionHookFn\r\n let hookTableRowFnResultExecution: HookTableRowFnResultExecution_Type\r\n if (tableFn) {\r\n let tb = TableGet(tableFn.tableDefId)\r\n let def = tb.def\r\n executionHookFn =\r\n actions.app.features[`${def.feature}`]?.hooks[\r\n HookTableRowFnResultExecution\r\n ]\r\n\r\n if (executionHookFn) {\r\n let data = tb.dataDef\r\n hookTableRowFnResultExecution = {\r\n currentResult: undefined,\r\n mode: \"start\",\r\n executionContextToSet: {\r\n custom: {},\r\n doNotExecuteSystemAfterResultHandler: false,\r\n doNotSetFeedbackOnProcess: false,\r\n },\r\n fnKey: tableFn.fnId,\r\n fnName: tableFn.fnName,\r\n data,\r\n def,\r\n currentFeedback: instanceState.currentFeedback,\r\n }\r\n }\r\n }\r\n let res: _ProcessReturnType = {\r\n currentFeedback: instanceState.currentFeedback,\r\n instance,\r\n process: processType,\r\n trackedSnackId: undefined,\r\n tableFn: instanceState.tableFn,\r\n setSuccess: (\r\n id: string,\r\n text?: string,\r\n code?: string,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) => {\r\n setOnRelatedProcessesHelper(\r\n id,\r\n \"success\",\r\n text,\r\n code,\r\n cnt,\r\n instanceState.tableFn.tableDefId\r\n )\r\n },\r\n setInformation: (\r\n id: string,\r\n text?: string,\r\n code?: string,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) => {\r\n setOnRelatedProcessesHelper(\r\n id,\r\n \"information\",\r\n text,\r\n code,\r\n cnt,\r\n instanceState.tableFn.tableDefId\r\n )\r\n },\r\n setWarning: (\r\n id: string,\r\n text?: string,\r\n code?: string,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) => {\r\n setOnRelatedProcessesHelper(\r\n id,\r\n \"warning\",\r\n text,\r\n code,\r\n cnt,\r\n instanceState.tableFn.tableDefId\r\n )\r\n },\r\n setError: (\r\n id: string,\r\n text?: string,\r\n code?: string,\r\n cnt?: TableRowFnProcessRawFeedbackSummaryCount_Type\r\n ) => {\r\n setOnRelatedProcessesHelper(\r\n id,\r\n \"error\",\r\n text,\r\n code,\r\n cnt,\r\n instanceState.tableFn.tableDefId\r\n )\r\n },\r\n setFromResult: async (result: TableRowFnProcessFeedbackFull_Type) => {\r\n if (executionHookFn) {\r\n hookTableRowFnResultExecution.currentResult = result\r\n hookTableRowFnResultExecution.mode = \"beforeResultHandler\"\r\n await executionHookFn(hookTableRowFnResultExecution)\r\n }\r\n if (\r\n !executionHookFn ||\r\n !hookTableRowFnResultExecution.executionContextToSet\r\n .doNotExecuteSystemAfterResultHandler\r\n ) {\r\n if (result.fieldsRes) {\r\n let tb = TableGet(instanceState.tableFn.tableDefId)\r\n DoRefreshLookups(actions, tb.def, [result.fieldsRes], undefined)\r\n // Object.keys(result.fieldsRes).forEach((k) => {\r\n // there could be any result.id sent back from backend (eg. activities externalsend notifications changes as well other activities from that contact)\r\n let changed: ServerData_ChangedType\r\n let returnedKeys: Map = new Map<\r\n string,\r\n ServerData_ChangedType\r\n >()\r\n if (tb.rows[result.id] !== undefined) {\r\n let mergeRowHookParams: _MergeRowHookParamsType\r\n let mergeFn =\r\n actions.app.features[tb.def.feature]?.hooks?.[\r\n HookTableServerBeforeMergeRow\r\n ]\r\n if (mergeFn) {\r\n mergeRowHookParams = {\r\n defId: tb.def.id,\r\n fn: mergeFn,\r\n tableData: tb.dataDef,\r\n }\r\n }\r\n changed =\r\n _DoServerDataConversionSyncAndBuildUpRebuildAndChangedInfo(\r\n result.id,\r\n tb.dataDef.clientConversion,\r\n result.fieldsRes,\r\n\r\n tb.rows[result.id],\r\n tb.def.uiState.rebuild,\r\n false,\r\n mergeRowHookParams,\r\n tb.dataDef.checkForOtherModification\r\n )\r\n }\r\n //})\r\n // we also need to call refreshRow hook\r\n if (Object.keys(changed.columns).length > 0) {\r\n returnedKeys.set(result.id, changed)\r\n _DoRebuildAndFixPage(tb.def)\r\n let tableServerDataFnName = HookTableServerData\r\n let tableServerDataFn =\r\n actions.app.features[`${tb.def.feature}`]?.hooks[\r\n tableServerDataFnName\r\n ]\r\n if (tableServerDataFn) {\r\n await tableServerDataFn({\r\n more: false,\r\n ext: {},\r\n type: \"RefreshRow\",\r\n tableData: tb.dataDef,\r\n tableDefId: tb.def.id,\r\n returnedKeys,\r\n })\r\n }\r\n }\r\n }\r\n\r\n if (result.tableRefreshData) {\r\n let tb = TableGet(instanceState.tableFn.tableDefId)\r\n let res = {\r\n data: { data: [result.tableRefreshData] },\r\n }\r\n await _TableRefreshDataFromServerHelper(\r\n res,\r\n tb.def,\r\n tb.dataDef,\r\n \"Refresh\"\r\n )\r\n\r\n if (!tb.rows[result.id]) {\r\n let key = tb.dataDef.index[result.id]\r\n if (tb.def.features.autoRebuild !== \"AfterModifyOrDeleteOrAdd\") {\r\n // if there is no autorebuild add the new ones according top/bottom setting\r\n _AddRowToDisplayedArray(tb.def, key)\r\n }\r\n // was a new one so set rowKey now\r\n result.id = key\r\n // and also make sure there is a process\r\n // this will create a multi process but that should be fine\r\n let processType =\r\n tb.def.options.customRowActions[result.fnId].process\r\n let instanceId = `${tb.def.id}_OvlSep_${result.fnId}_OvlSep_Multi`\r\n // trick to create the basic state if it not exists\r\n ProcessIsRunning(processType, instanceId)\r\n // add the relevant tableFn props to state\r\n let processInstanceState = (\r\n state.ovl.longRunningProcessTracker[processType].instance[\r\n instanceId\r\n ]\r\n )\r\n if (!processInstanceState.tableFn.fnId) {\r\n processInstanceState.tableFn.fnId = result.fnId\r\n processInstanceState.tableFn.tableDefId = tb.def.id\r\n processInstanceState.tableFn.rowKey = undefined\r\n }\r\n }\r\n }\r\n //@ts-ignore\r\n if (result.type === \"remove\") {\r\n TableRemoveRowFromData(\r\n instanceState.tableFn.tableDefId,\r\n result.id,\r\n {\r\n isFirst: false,\r\n isLast: false,\r\n } /* isFirst, isLast is jsut a workaround because TableRemoveRow doesnt auto rebuild) */\r\n )\r\n }\r\n }\r\n if (executionHookFn) {\r\n hookTableRowFnResultExecution.mode = \"afterResultHandler\"\r\n await executionHookFn(hookTableRowFnResultExecution)\r\n }\r\n if (\r\n !executionHookFn ||\r\n !hookTableRowFnResultExecution.executionContextToSet\r\n .doNotSetFeedbackOnProcess\r\n ) {\r\n setOnRelatedProcessesHelper(\r\n result.id,\r\n result.type,\r\n result.text,\r\n result.code,\r\n result.cnt,\r\n instanceState.tableFn.tableDefId\r\n )\r\n }\r\n },\r\n showSummary: (\r\n summaryType: \"Snack\" | \"DialogIfMultiple\" | \"DialogAlways\",\r\n positionText: string\r\n ) => {\r\n let selectedKeys = instanceState.tableFn?.selectedKeys\r\n if (!selectedKeys) {\r\n return\r\n }\r\n let selectedKeysCount = Object.keys(selectedKeys).length\r\n let fromAPI = selectedKeysCount < 1\r\n let isSingle = selectedKeysCount === 1\r\n // let isMultiple = selectedKeysCount > 1\r\n\r\n let feedback = instanceState.currentFeedback\r\n let successKeys = Object.keys(feedback).filter(\r\n (k) => feedback[k].type === \"success\" && feedback[k].cnt === \"cis\"\r\n )\r\n\r\n let warningKeys = Object.keys(feedback).filter(\r\n (k) => feedback[k].type === \"warning\" && feedback[k].cnt === \"cis\"\r\n )\r\n let errorKeys = Object.keys(feedback).filter(\r\n (k) => feedback[k].type === \"error\" && feedback[k].cnt === \"cis\"\r\n )\r\n let feedbackCount =\r\n warningKeys.length + errorKeys.length + successKeys.length\r\n if (feedbackCount < 2) {\r\n // directly snack out error/warning or display simple success\r\n let hint: any = \"\"\r\n let snackType: SnackType = \"Success\"\r\n let snackDuration = 4000\r\n\r\n if (errorKeys.length > 0) {\r\n snackType = \"Error\"\r\n if (\r\n feedback[errorKeys[0]].code &&\r\n \"OvlServerOffline,OvlResourceForbidden,\".indexOf(\r\n feedback[errorKeys[0]].code\r\n ) > -1\r\n ) {\r\n // we don't need to spit out \"Offline\" or \"ResourceForbidden\" - Snack. This was already done by the underlying fetch impl resp. not necessary\r\n return\r\n }\r\n hint = feedback[errorKeys[0]].text\r\n snackDuration = 8000\r\n } else if (warningKeys.length > 0) {\r\n snackType = \"Warning\"\r\n hint = feedback[warningKeys[0]].text\r\n snackDuration = 8000\r\n }\r\n if (hint) {\r\n hint = `: ${hint}`\r\n }\r\n if (summaryType === \"Snack\" || summaryType === \"DialogIfMultiple\") {\r\n SnackAdd(\r\n T(\"SYSTableRowFnProcessRowFnSummarySingle\", [\r\n instanceState.tableFn.fnName,\r\n hint,\r\n ]),\r\n snackType,\r\n snackDuration\r\n )\r\n } else {\r\n let tb = TableGet(instanceState.tableFn.tableDefId)\r\n let title\r\n if (fromAPI) {\r\n title = instanceState.tableFn.fnName\r\n } else {\r\n title = _GetTableDialogTitle(\r\n tb.def,\r\n instanceState.tableFn.fnName,\r\n selectedKeysCount,\r\n tb.dataDef.data,\r\n undefined,\r\n true\r\n )\r\n }\r\n DialogOk(\r\n T(\"SYSTableRowFnProcessRowFnSummarySingle\", [\r\n instanceState.tableFn.fnName,\r\n hint,\r\n ]),\r\n {\r\n type: snackType.toLowerCase(),\r\n title,\r\n instance: instanceState.instanceId,\r\n }\r\n )\r\n }\r\n return\r\n }\r\n\r\n let snackType: SnackType = \"Success\"\r\n\r\n if (warningKeys.length || errorKeys.length) {\r\n snackType = \"Warning\"\r\n }\r\n let showDetails = snackType === \"Warning\" || feedbackCount > 1\r\n\r\n let summarySubType = \"WithCount\"\r\n if (fromAPI || (isSingle && showDetails)) {\r\n summarySubType = \"WithDetails\"\r\n } else if (showDetails) {\r\n summarySubType = \"WithCountAndDetails\"\r\n }\r\n\r\n let summaryTranslationKey = `${processType}RowFnSummary${summarySubType}`\r\n if (!state.ovl.language.translations[summaryTranslationKey]) {\r\n summaryTranslationKey = `SYSTableRowFnProcessRowFnSummary${summarySubType}`\r\n }\r\n\r\n if (summaryType === \"Snack\") {\r\n let snackText = unsafeHTML(\r\n T(summaryTranslationKey, [\r\n instanceState.tableFn.fnName,\r\n positionText,\r\n selectedKeysCount,\r\n successKeys.length,\r\n warningKeys.length,\r\n errorKeys.length,\r\n ])\r\n )\r\n SnackAdd(snackText, snackType, 15000)\r\n } else if (summaryType.startsWith(\"Dialog\")) {\r\n let tb = TableGet(instanceState.tableFn.tableDefId)\r\n let title\r\n if (fromAPI) {\r\n title = instanceState.tableFn.fnName\r\n } else {\r\n title = _GetTableDialogTitle(\r\n tb.def,\r\n instanceState.tableFn.fnName,\r\n selectedKeysCount,\r\n tb.dataDef.data,\r\n undefined,\r\n true\r\n )\r\n }\r\n DialogOk(\r\n unsafeHTML(\r\n T(summaryTranslationKey, [\r\n instanceState.tableFn.fnName,\r\n positionText,\r\n selectedKeysCount,\r\n successKeys.length,\r\n warningKeys.length,\r\n errorKeys.length,\r\n ])\r\n ),\r\n {\r\n type: snackType.toLowerCase(),\r\n title,\r\n instance: instanceState.instanceId,\r\n }\r\n )\r\n }\r\n },\r\n stop: () => {\r\n if (executionHookFn) {\r\n hookTableRowFnResultExecution.mode = \"end\"\r\n hookTableRowFnResultExecution.currentResult = undefined\r\n\r\n executionHookFn(hookTableRowFnResultExecution)\r\n }\r\n ProcessEnd(processType, instance)\r\n },\r\n }\r\n //console.log(\"Start Process: \", processType, instance)\r\n if (hasSnack) {\r\n let text = snack.text\r\n if (!text) {\r\n let replacements = [T(instance, undefined, \"Key\")]\r\n if (\r\n snack.customTextReplacements &&\r\n snack.customTextReplacements.length > 0\r\n ) {\r\n replacements = snack.customTextReplacements\r\n }\r\n\r\n let alternativeTranslationCode = snack.alternativeTranslationKey\r\n if (alternativeTranslationCode) {\r\n text = T(alternativeTranslationCode, replacements)\r\n } else {\r\n text = T(processType, replacements)\r\n }\r\n }\r\n if (hasTrackedSnack) {\r\n res.trackedSnackId = SnackTrackedAdd(text, snack.type, id)\r\n } else {\r\n SnackAdd(text, snack.type, snack.fireAndForgetSnackDuration)\r\n }\r\n }\r\n\r\n if (executionHookFn) {\r\n executionHookFn(hookTableRowFnResultExecution)\r\n }\r\n\r\n return res\r\n}\r\n\r\nexport const _LongRunningProcessEnd: SYSAction<{\r\n processType: SYSLongRunningProcess\r\n instance?: string\r\n}> = (value, { global }) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n let processState = state.ovl.longRunningProcessTracker[value.processType]\r\n if (processState) {\r\n let instance = value.instance\r\n if (!instance) {\r\n instance = value.processType\r\n }\r\n let instanceState = processState[\"instance\"][instance]\r\n\r\n if (instanceState && instanceState.isRunning) {\r\n if (instanceState.hasTrackedSnack) {\r\n SnackTrackedRemove(instanceState.id)\r\n }\r\n if (instanceState.lockedDialog) {\r\n actions.ovl.dialog._DialogSetLock({\r\n dialog: instanceState.lockedDialog,\r\n locked: false,\r\n instance: instanceState.lockedDialogInstance,\r\n })\r\n }\r\n if (instanceState.lockedScreen) {\r\n actions.ovl.screen._ScreenSetLock({\r\n screen: instanceState.lockedScreen,\r\n locked: false,\r\n instance: instanceState.lockedScreenInstance,\r\n })\r\n }\r\n\r\n if (instanceState.lockedFormType) {\r\n let allFormState = state.ovl.forms\r\n instanceState.lockedFormType.forEach((f) => {\r\n if (allFormState[f.formType] && allFormState[f.formType][f.formId]) {\r\n allFormState[f.formType][f.formId].locked = false\r\n }\r\n })\r\n }\r\n instanceState.refCounter--\r\n\r\n if (instanceState.refCounter < 1) {\r\n instanceState.isRunning = false\r\n }\r\n }\r\n }\r\n}\r\n","import type {\r\n DirectiveResult,\r\n SYSAction,\r\n SYSDialog,\r\n SYSForm,\r\n SYSState,\r\n TemplateResult,\r\n UnsafeHTMLDirective,\r\n} from \"../../\"\r\nimport { currentScreenAndDialog, SYSConfig } from \"../../\"\r\nimport { T } from \"../../textapi\"\r\n\r\nimport { HookDialogClose, HookDialogClose_Type } from \"../../global/hooks\"\r\nimport { _handleDialogVisible } from \"../../helpers\"\r\n\r\nimport { AddGlobalReactor } from \"../../tracker/reactor\"\r\n\r\nimport type { OpenModalDialogState, ResultType } from \"./dialog\"\r\n\r\nimport type {\r\n DialogsState,\r\n DialogType,\r\n FormHandlingType,\r\n} from \"./sysdialogbase\"\r\n\r\nimport { _setDialogVisible } from \"../forms/helper\"\r\nimport { FormInit } from \"../forms/formapi\"\r\n\r\nexport type OpenDialogOptions = {\r\n dialogType: SYSDialog\r\n formsHandling?: FormHandlingType[]\r\n modal?: boolean\r\n data?: any\r\n instance?: any\r\n}\r\nexport const _DialogClose: SYSAction<\r\n | SYSDialog\r\n | {\r\n dialog: SYSDialog\r\n forceElementIdToFocusAfterClose?: string\r\n resolveValue?: any\r\n instance?: any\r\n }\r\n> = async (value, { global }) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n let dlgState: DialogsState\r\n let resolveValue\r\n\r\n let dialog\r\n\r\n if (typeof value === \"string\") {\r\n dialog = value\r\n dlgState = state.ovl.dialogs[value].instance[value]\r\n if (!dlgState.visible) {\r\n return\r\n }\r\n } else {\r\n if (value.resolveValue) {\r\n resolveValue = value.resolveValue\r\n }\r\n\r\n dialog = value.dialog\r\n if (!value.instance) {\r\n value.instance = dialog\r\n }\r\n dlgState = state.ovl.dialogs[value.dialog].instance[value.instance]\r\n // dlgState.forceElementIdToFocusAfterClose =\r\n // value.forceElementIdToFocusAfterClose\r\n }\r\n if (!dlgState?.visible) {\r\n return\r\n }\r\n if (dlgState.closing) {\r\n return\r\n }\r\n let fnName = HookDialogClose\r\n let fn = actions.app.global.hooks?.[fnName]\r\n if (fn) {\r\n if (!(await fn({ dialog, dialogState: dlgState }))) {\r\n return\r\n }\r\n }\r\n // // also set class for fadeout directly in dom\r\n // // maybe refactor to reactor and remove the parts in baselement which are also doing this\r\n // // its good to have it here because css animations are in parallel to long running actions (stichwort: headermenu sorting click)\r\n // let el = document.querySelector(\"ovl-dialogholder .fd-message-box\")\r\n // el.classList.add(\"fadeOutDialog\")\r\n dlgState.closing = true\r\n if (dlgState.modal && dlgState.resolver) {\r\n for (let r = 0; r < dlgState.resolver.length; r++) {\r\n dlgState.resolver[r](resolveValue)\r\n }\r\n\r\n dlgState.resolver = []\r\n }\r\n}\r\n\r\nexport const _DialogSetLock: SYSAction<{\r\n dialog: SYSDialog\r\n locked: boolean\r\n instance?: any\r\n}> = (value, { global }) => {\r\n let state = global.getState()\r\n if (!value.instance) {\r\n value.instance = value.dialog\r\n }\r\n if (state.ovl.dialogs[value.dialog].instance[value.instance]) {\r\n state.ovl.dialogs[value.dialog].instance[value.instance].disabled =\r\n value.locked\r\n }\r\n}\r\n\r\nexport const _DialogOpen: SYSAction> = async (\r\n value,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n return await DialogOpenHelper(value, state)\r\n}\r\n\r\nconst DialogOpenHelper = async (value: OpenDialogOptions, state: SYSState) => {\r\n if (!value.instance) {\r\n value.instance = value.dialogType\r\n }\r\n\r\n let dlgState = state.ovl.dialogs[value.dialogType]\r\n if (!dlgState.instance[value.instance]) {\r\n dlgState.instance[value.instance] = {\r\n visible: false,\r\n closing: false,\r\n focus: {\r\n focusSet: false,\r\n focusWhenLeft: undefined,\r\n },\r\n zIndex: Object.keys(currentScreenAndDialog.dialogs).length + 6,\r\n formsHandling: value.formsHandling,\r\n dialog: value.dialogType,\r\n instance: value.instance,\r\n resolver: [],\r\n }\r\n }\r\n\r\n if (value.formsHandling) {\r\n await Promise.all(\r\n value.formsHandling\r\n .filter((f) => f.creation)\r\n .map((m) => {\r\n if (m.creation.autoInitFormFields === undefined) {\r\n m.creation.autoInitFormFields = {}\r\n }\r\n return FormInit(m.formType, m.creation.autoInitFormFields, {\r\n formId: m.formId,\r\n parentFieldKey: m.creation.parentFieldKey,\r\n parentFormType: m.creation.parentFormType,\r\n parentFormId: m.creation.parentFormId,\r\n })\r\n })\r\n )\r\n }\r\n\r\n AddGlobalReactor(\r\n [`ovl.dialogs.${value.dialogType}.instance.${value.instance}.visible`],\r\n _handleDialogVisible\r\n )\r\n let instance = dlgState.instance[value.instance]\r\n if (instance.visible && !instance.closing) {\r\n if (value.modal && instance.resolver.length > 0) {\r\n return new Promise((resolve, reject) => {\r\n instance.resolver.push(resolve)\r\n })\r\n }\r\n return\r\n }\r\n // sanitize formsHandling..If there is no formId given use formType\r\n if (value.formsHandling) {\r\n value.formsHandling.forEach((f) => {\r\n if (!f.formId) {\r\n f.formId = f.formType\r\n }\r\n })\r\n instance.formsHandling = value.formsHandling\r\n if (instance.formsHandling && !instance.mainFormId) {\r\n // if there was not giveen a formId explicitly for the main form of the dialog\r\n // but there was give am formsHandling... use formId from the first form in the array\r\n instance.mainFormId = instance.formsHandling[0].formId\r\n }\r\n }\r\n instance.modal = value.modal\r\n instance.data = value.data\r\n instance.closing = false\r\n _setDialogVisible(true, instance)\r\n //}, wait)\r\n let p\r\n if (value.modal) {\r\n p = new Promise((resolve, reject) => {\r\n instance.resolver.push(resolve)\r\n })\r\n } else {\r\n p = Promise.resolve(true)\r\n }\r\n return p\r\n}\r\n\r\nexport const _ModalDialogOpen: SYSAction = async (\r\n value,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n if (!value.instance) {\r\n value.instance = \"SYSModal\"\r\n }\r\n state.ovl.libState.dialog[value.instance] = {\r\n type: value.type,\r\n customClass: value.customClass,\r\n title: value.title,\r\n default: value.default,\r\n instance: value.instance,\r\n cancelText: undefined,\r\n okText: undefined,\r\n result: undefined,\r\n text: undefined,\r\n connectedForm: value.connectedForm,\r\n }\r\n let dlgState = state.ovl.libState.dialog[value.instance]\r\n if (value.cancel !== \"NoButton\") {\r\n dlgState.cancelText = state.ovl.language.translations[value.cancel]\r\n if (!dlgState.cancelText) {\r\n dlgState.cancelText = value.cancel\r\n }\r\n } else {\r\n dlgState.cancelText = \"\"\r\n }\r\n if (value.ok !== \"NoButton\") {\r\n dlgState.okText = state.ovl.language.translations[value.ok]\r\n if (!dlgState.okText) {\r\n dlgState.okText = value.ok\r\n }\r\n } else {\r\n dlgState.okText = \"\"\r\n }\r\n\r\n if (value.freeButton1) {\r\n dlgState.freeButton1Text =\r\n state.ovl.language.translations[value.freeButton1]\r\n if (!dlgState.freeButton1Text) {\r\n dlgState.freeButton1Text = value.freeButton1\r\n }\r\n }\r\n\r\n dlgState.text = value.text\r\n dlgState.result = undefined\r\n // let forceElementIdToFocusAfterOpen = \"ovldialogcancel\"\r\n // if (dlgState.default == 1) {\r\n // forceElementIdToFocusAfterOpen = \"ovldialogok\"\r\n // }\r\n\r\n let formsHandling: FormHandlingType[]\r\n\r\n if (dlgState.connectedForm) {\r\n formsHandling = [\r\n {\r\n formType: dlgState.connectedForm.formType,\r\n formId: dlgState.connectedForm.formId,\r\n isConnectedToDialog: true,\r\n },\r\n ]\r\n }\r\n\r\n await actions.ovl.dialog._DialogOpen({\r\n dialogType: \"SYSModal\",\r\n instance: value.instance,\r\n //forceElementIdToFocusAfterOpen,\r\n modal: true,\r\n formsHandling,\r\n })\r\n}\r\n\r\ntype OkCancelDialog = {\r\n text: string | TemplateResult | UnsafeHTMLDirective\r\n default: ResultType\r\n type?: DialogType\r\n customClass?: string\r\n title?: string | TemplateResult | UnsafeHTMLDirective | DirectiveResult\r\n okText?: string\r\n cancelText?: string\r\n freeButton1Text?: string\r\n instance?: any\r\n connectedForm?: { formType: string; formId: string }\r\n}\r\ntype OkDialog = {\r\n text: string | TemplateResult | UnsafeHTMLDirective | DirectiveResult\r\n type?: DialogType\r\n customClass?: string\r\n title?: string | TemplateResult | UnsafeHTMLDirective | DirectiveResult\r\n okText?: string\r\n instance?: any\r\n connectedForm?: { formType: string; formId: string }\r\n}\r\nexport const _OkCancelDialog: SYSAction = async (\r\n value,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n let type: DialogType = \"confirmation\"\r\n if (value.type) {\r\n type = value.type\r\n }\r\n let title\r\n\r\n if (value.title) {\r\n title = value.title\r\n } else {\r\n if (SYSConfig.global?.defaultDialogTitle) {\r\n title = T(SYSConfig.global?.defaultDialogTitle)\r\n } else {\r\n title = T(\"SYSAppTitle\")\r\n }\r\n }\r\n let customClass = \"\"\r\n if (value.customClass) {\r\n customClass = value.customClass\r\n }\r\n\r\n await actions.ovl.dialog._ModalDialogOpen({\r\n title,\r\n customClass,\r\n type,\r\n cancel: value.cancelText || \"SYSCancel\",\r\n ok: value.okText || \"SYSOk\",\r\n freeButton1: value.freeButton1Text,\r\n text: value.text,\r\n default: value.default,\r\n instance: value.instance,\r\n connectedForm: value.connectedForm,\r\n })\r\n}\r\n\r\nexport const _OkDialog: SYSAction = async (value, { global }) => {\r\n let actions = global.getActions()\r\n let type: DialogType = \"information\"\r\n if (value.type) {\r\n type = value.type\r\n }\r\n let customClass = \"\"\r\n if (value.customClass) {\r\n customClass = value.customClass\r\n }\r\n\r\n let title = T(\"SYSAppTitle\")\r\n if (SYSConfig.global?.defaultDialogTitle) {\r\n title = T(SYSConfig.global?.defaultDialogTitle)\r\n }\r\n if (value.title) {\r\n title = value.title\r\n }\r\n\r\n await actions.ovl.dialog._ModalDialogOpen({\r\n title,\r\n customClass,\r\n type,\r\n cancel: \"NoButton\",\r\n ok: value.okText || \"SYSOk\",\r\n text: value.text,\r\n default: 1,\r\n instance: value.instance,\r\n })\r\n}\r\n","import {\r\n _InitForm,\r\n _ChangeField,\r\n //_SetFieldDirty,\r\n _SetFieldTouched,\r\n _WatchField,\r\n _FocusField,\r\n _ResetForm,\r\n _RemoveForm,\r\n _SetFormUndirty,\r\n _SetFormDirty,\r\n _ValidateDataType,\r\n _ValidateSchema,\r\n _ValidateList,\r\n _FillListControl,\r\n} from \"./library/forms/actions\"\r\n\r\nimport {\r\n _Navigate,\r\n _Logout,\r\n _InitApp,\r\n _RehydrateApp,\r\n _GetFile,\r\n _SetPortalTestingMode,\r\n _SetLanguage,\r\n _SetLastScrollPosition,\r\n} from \"./global/actions\"\r\n\r\nimport {\r\n _AddSnack,\r\n _RemoveSnack,\r\n _PlaceSnack,\r\n _ClearSnack,\r\n _ReplaceSnackContent,\r\n} from \"./library/snack/actions\"\r\n\r\nimport {\r\n _LongRunningProcessEnd,\r\n _LongRunningProcessStart,\r\n} from \"./library/longrunningprocesstracker/longrunningprocesstracker\"\r\n\r\nimport {\r\n _ModalDialogOpen,\r\n _OkDialog,\r\n _OkCancelDialog,\r\n _DialogOpen,\r\n _DialogClose,\r\n _DialogSetLock,\r\n} from \"./library/dialog/actions\"\r\nlet dialog = {\r\n _DialogOpen,\r\n\r\n _DialogClose,\r\n _DialogSetLock,\r\n _ModalDialogOpen,\r\n _OkDialog,\r\n _OkCancelDialog,\r\n}\r\n\r\nlet form = {\r\n _InitForm,\r\n _ResetForm,\r\n\r\n _RemoveForm,\r\n _ChangeField,\r\n}\r\n\r\nimport {\r\n _DialogChanged,\r\n _DialogDefaultChanged,\r\n _TableRefresh,\r\n _TableInit,\r\n _TableRebuild,\r\n _TableSelectRow,\r\n _TableSelectHeader,\r\n _TableSort,\r\n _TableFilter,\r\n _TableFilterSelected,\r\n _TableSetPage,\r\n _TableDeleteRow,\r\n _TableCopyRow,\r\n _TableEditRow,\r\n _TableSelectEndRow,\r\n _OpenTableRowHeaderMenu,\r\n _TableSelectAll,\r\n _TableEditSaveRow,\r\n _TableDirectSaveRow,\r\n _TableEditClose,\r\n _TableMoreRow,\r\n _TableViewRow,\r\n _TableCloseViewRow,\r\n _TableAddRow,\r\n _TableDeleteRowFromData,\r\n _TableMultipleEditRow,\r\n _TableMultipleCustomFunction,\r\n _TableRefreshDataFromServer,\r\n _TableSelectCustomSort,\r\n _TableSelectFilterSort,\r\n _TableSelectCustomFilter,\r\n _TableSelectAttributeFilter,\r\n _TableSelectColumnFilter,\r\n _TableSelectColumnRangeFilter,\r\n _TableSetViewTab,\r\n _TableOfflineRetryDeleteRow,\r\n _TableOfflineRetrySaveRow,\r\n _TableOfflineHandler,\r\n} from \"./library/actions\"\r\nimport { SYSAction, SYSScreen } from \".\"\r\nimport { ScreenCurrentState } from \"./library/screenapi\"\r\n\r\nlet navigation = { _Navigate }\r\n\r\n//let indicator = { SetIndicatorOpen, SetIndicatorClose }\r\n\r\nlet table = {\r\n _TableRefresh,\r\n _TableInit,\r\n _TableRebuild,\r\n _TableSelectRow,\r\n _TableEditRow,\r\n\r\n _OpenTableRowHeaderMenu,\r\n _TableDeleteRow,\r\n _TableEditClose,\r\n\r\n _TableRefreshDataFromServer,\r\n _TableSort,\r\n _TableFilter,\r\n\r\n _TableAddRow,\r\n _TableDirectSaveRow,\r\n _TableSetViewTab,\r\n}\r\n\r\nlet internal = {\r\n _SetLastScrollPosition,\r\n _PlaceSnack,\r\n _ClearSnack,\r\n _AddSnack,\r\n _RemoveSnack,\r\n _ReplaceSnackContent,\r\n _DialogChanged,\r\n //DialogClosed,\r\n _DialogDefaultChanged,\r\n _TableSelectHeader,\r\n _TableFilterSelected,\r\n _TableSetPage,\r\n _TableCopyRow,\r\n _TableDeleteRow,\r\n _TableAddRow,\r\n _TableEditRow,\r\n _TableSelectEndRow,\r\n _TableSelectAll,\r\n _TableEditSaveRow,\r\n _TableDirectSaveRow,\r\n _TableMoreRow,\r\n _TableViewRow,\r\n _TableCloseViewRow,\r\n _TableDeleteRowFromData,\r\n\r\n //_TableMultipleCopyRow,\r\n _TableMultipleEditRow,\r\n _TableMultipleCustomFunction,\r\n _TableSelectCustomSort,\r\n _TableSelectFilterSort,\r\n _TableSelectCustomFilter,\r\n _TableSelectAttributeFilter,\r\n _TableSelectColumnFilter,\r\n _TableSelectColumnRangeFilter,\r\n _TableOfflineRetryDeleteRow,\r\n _TableOfflineRetrySaveRow,\r\n _TableOfflineHandler,\r\n _InitApp,\r\n _RehydrateApp,\r\n _GetFile,\r\n\r\n _SetLanguage,\r\n _SetPortalTestingMode,\r\n\r\n _ChangeField,\r\n //SetField,\r\n _WatchField,\r\n _FocusField,\r\n _SetFieldTouched,\r\n //SetFormValid,\r\n _ValidateDataType,\r\n _SetFormUndirty,\r\n _SetFormDirty,\r\n //_SetFieldDirty,\r\n _ValidateSchema,\r\n _ValidateList,\r\n _FillListControl,\r\n _LongRunningProcessEnd,\r\n _LongRunningProcessStart,\r\n}\r\nconst _ScreenSetLock: SYSAction<{\r\n screen: SYSScreen\r\n locked: boolean\r\n instance: string\r\n}> = (value, { global }) => {\r\n let state = global.getState()\r\n let instance = value.instance\r\n if (instance === undefined) {\r\n instance = value.screen\r\n }\r\n state.ovl.screens.screens[value.screen].instance[instance].disabled =\r\n value.locked\r\n}\r\nlet screen = { _ScreenSetLock }\r\nlet user = { _Logout }\r\nexport let ovlActions = {\r\n /*indicator,*/ navigation,\r\n internal,\r\n dialog,\r\n screen,\r\n form,\r\n table,\r\n user,\r\n}\r\n","import { SYSEditorAsset } from \"../ovlsyscomponents/syseditors/sysassetconfig01/assetconfig\"\r\nimport { SYSEditorForm } from \"../ovlsyscomponents/syseditors/syseditorform/config\"\r\nimport { AppDefProcess, AppDefScreen } from \"./config\"\r\n\r\nexport let baseScreens = {\r\n SYSAudit: {},\r\n SYSTranslation: {},\r\n}\r\n\r\nexport let baseEditors = {\r\n SYSEditorAsset: {},\r\n SYSEditorForm: {},\r\n}\r\n\r\nexport let baseDialogs = {\r\n SYSTableSettings_ColumnFilter: {},\r\n SYSTableSettings_FilterSort: {},\r\n SYSLogin: {},\r\n SYSPortalSettings: {},\r\n SYSUserAdministration_User: {},\r\n SYSUserAdministration_Company: {},\r\n SYSUserAdministration_Role: {},\r\n SYSUserAdministration_UserRole: {},\r\n SYSUserAdministration_Permission: {},\r\n SYSUserAdministration_UserRoleTransfer: {},\r\n SYSTableSettings_AdvancedFilter: {},\r\n SYSModal: {},\r\n SYSTableHeaderMenu: {},\r\n\r\n SYSHitListDialog: { rehydratable: false },\r\n SYSTableRowDetailView: {},\r\n SYSTableRowEdit: {},\r\n SYSEditorAsset: { rehydratable: false },\r\n}\r\n\r\nexport let baseForms = {\r\n SYSTableRowEdit: {},\r\n SYSEditorAsset: {},\r\n SYSHeaderMenuFilter: {},\r\n SYSLogin: {},\r\n SYSPortalSettings: {},\r\n SYSUserSettingsPassword: {},\r\n\r\n // multi purpose edit form\r\n SYSEdit: {},\r\n}\r\n\r\nexport let baseLongRunningProcess = {\r\n SYSUserAdministrationUserRoleDoTransfer: {\r\n snack: { type: \"BusyIndicator\" },\r\n },\r\n\r\n SYSUserSettingsSave: { snack: { type: \"BusyIndicator\" } },\r\n\r\n SYSLoginLogin: { snack: { type: \"BusyIndicator\" } },\r\n SYSUserSettingsSaveSettings: {},\r\n\r\n SYSTableRefresh: { isRefresh: true },\r\n SYSTableRebuild: {},\r\n SYSSaveRow: { lockScreen: true },\r\n\r\n SYSSave: {\r\n snack: {\r\n type: \"BusyIndicator\",\r\n alternativeTranslationKey: \"SYSTableRowFnSave\",\r\n },\r\n lockScreen: true,\r\n },\r\n\r\n SYSFileUpload: {},\r\n SYSGetLookupData: {},\r\n SYSTableRowFnProcess: {\r\n snack: { type: \"BusyIndicator\" },\r\n },\r\n SYSFileGet: { snack: { type: \"BusyIndicator\" } },\r\n}\r\n","import { SYSField } from \"./library/forms/actions\"\r\nimport { ValidatorOptions } from \"./library/forms/validators\"\r\nimport { T } from \"./textapi\"\r\n\r\nexport const validatorsValidation = {\r\n Email: {},\r\n EmailList: {},\r\n Mandatory: {},\r\n MandatoryAllowEmptyString: {},\r\n MandatoryCheck: {},\r\n ExactLength: {},\r\n IntegerRange: {},\r\n MinLength: {},\r\n MaxLength: {},\r\n NotBeforeToday: {},\r\n NotLaterThanDaysFromToday: {},\r\n Regex: {},\r\n}\r\n\r\nconst ensureOptionsVal = (field: SYSField, options: ValidatorOptions): any => {\r\n if (options?.val === undefined) {\r\n throw Error(`Validator needs options.val: ${field.fieldKey}`)\r\n }\r\n return options.val\r\n}\r\nexport type ValidatorFnType = (\r\n field: SYSField,\r\n options: ValidatorOptions\r\n) => boolean\r\n\r\nexport const SYSValidatorsFunctions: {\r\n [key in keyof typeof validatorsValidation]: ValidatorFnType\r\n} = {\r\n Email: (field: SYSField, options: ValidatorOptions) => {\r\n if (!field.value) {\r\n return false\r\n }\r\n return field.value && !validateEmail(field.value)\r\n },\r\n\r\n EmailList: (field: SYSField, options: ValidatorOptions) => {\r\n if (!field.value) {\r\n return false\r\n }\r\n let sep = options?.val\r\n if (!sep) {\r\n sep = \";\"\r\n }\r\n if (field.value.trim() === sep) {\r\n return true\r\n }\r\n return field.value && !validateEmail(field.value, sep)\r\n },\r\n\r\n Mandatory: (field: SYSField, options: ValidatorOptions) => {\r\n let val = field.list ? field.convertedValue : field.value\r\n return val === null || val === \"\"\r\n },\r\n\r\n MandatoryAllowEmptyString: (field: SYSField, options: ValidatorOptions) => {\r\n let val = field.list ? field.convertedValue : field.value\r\n return val === null\r\n },\r\n\r\n MandatoryCheck: (field: SYSField, options: ValidatorOptions) => {\r\n let val = field.convertedValue\r\n\r\n return val !== field.ui.checkedValue\r\n },\r\n\r\n ExactLength: (field: SYSField, options: ValidatorOptions) => {\r\n let val = ensureOptionsVal(field, options)\r\n if (field.value && field.value.length !== parseInt(val)) {\r\n // that means we get like \"Can be max {1} characters\". and to know the {1} we need the additinalTranslationReps set here...\r\n options.validation.translationReps.push(val)\r\n return true\r\n }\r\n },\r\n\r\n IntegerRange: (field: SYSField, options: ValidatorOptions) => {\r\n let val = ensureOptionsVal(field, options)\r\n if (\r\n field.value &&\r\n (parseInt(field.value) < val.min || parseInt(field.value) > val.max)\r\n ) {\r\n options.validation.translationReps.push(val.min)\r\n options.validation.translationReps.push(val.max)\r\n\r\n return true\r\n }\r\n },\r\n\r\n MinLength: (field: SYSField, options: ValidatorOptions) => {\r\n let val = ensureOptionsVal(field, options)\r\n if (!field.value || field.value.length < parseInt(val)) {\r\n // that means we get like \"Can be max {1} characters\". and to know the {1} we need the additinalTranslationReps set here...\r\n options.validation.translationReps.push(val)\r\n return true\r\n }\r\n },\r\n MaxLength: (field: SYSField, options: ValidatorOptions) => {\r\n let val = ensureOptionsVal(field, options)\r\n if (field.value && field.value.length > parseInt(val)) {\r\n // that means we get like \"Can be max {1} characters\". and to know the {1} we need the additinalTranslationReps set here...\r\n options.validation.translationReps.push(val)\r\n return true\r\n }\r\n },\r\n\r\n NotBeforeToday: (field: SYSField, options: ValidatorOptions) => {\r\n if (field.type !== \"date\") {\r\n throw Error(\r\n `Validator NotBeforeToday works only on date fields...Field: ${field.fieldKey}`\r\n )\r\n }\r\n let dVal = new Date(field.convertedValue)\r\n let refDVal = new Date()\r\n refDVal.setHours(0, 0, 0, 0)\r\n if (dVal.getTime() < refDVal.getTime()) {\r\n return true\r\n }\r\n },\r\n NotLaterThanDaysFromToday: (field: SYSField, options: ValidatorOptions) => {\r\n if (field.type !== \"date\") {\r\n throw Error(\r\n `Validator NotLaterThanDaysFromToday works only on date fields...Field: ${field.fieldKey}`\r\n )\r\n }\r\n let val = ensureOptionsVal(field, options)\r\n let dVal = new Date(field.convertedValue)\r\n let refDVal = new Date()\r\n refDVal.setDate(refDVal.getDate() + val)\r\n if (dVal.getTime() > refDVal.getTime()) {\r\n options.validation.translationReps.push(val)\r\n return true\r\n }\r\n },\r\n Regex: (field: SYSField, options: ValidatorOptions) => {\r\n if (field.type !== \"text\") {\r\n throw Error(\r\n `Validator Regex works only on text fields...Field: ${field.fieldKey}`\r\n )\r\n }\r\n let val = ensureOptionsVal(field, options)\r\n let r = new RegExp(val.val)\r\n if (!r.test(field.value)) {\r\n options.validation.translationReps.push(T(val.msg))\r\n return true\r\n }\r\n },\r\n}\r\nfunction validateEmail(email, separator: string = undefined) {\r\n var re =\r\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\r\n\r\n if (separator) {\r\n var emailList: string[] = email.split(separator)\r\n\r\n return !emailList.some((s) => {\r\n return !(s.trim() === \"\" || re.test(String(s.trim()).toLowerCase()))\r\n })\r\n } else {\r\n return re.test(String(email.trim()).toLowerCase())\r\n }\r\n}\r\n","import type { SYSTableDefIds } from \"../../../../../../src\"\r\nimport { html, SYSBaseElement } from \"../../../../../../src\"\r\nimport type { DialogHolderParams } from \"../../../../../../src/library/dialog/dialogapi\"\r\nimport { DialogClose } from \"../../../../../../src/library/dialog/dialogapi\"\r\nimport { FormGet } from \"../../../../../../src/library/forms/formapi\"\r\nimport { NavDef } from \"../../../../../../src/library/table/navcontrol\"\r\nimport { _ColumnColumnFilter } from \"../../../../../../src/library/table/table\"\r\nimport {\r\n SYSColumnDef,\r\n TableColumnFilter,\r\n TableGet,\r\n _TableGetReturnType,\r\n TableRebuild,\r\n} from \"../../../../../../src/library/table/tableapi\"\r\nimport { HeaderMenuFilterFieldsSetState } from \"../../../../../../src/library/table/tablerowheadermenu/tablesettings/hookactions\"\r\nimport { T } from \"../../../../../../src/textapi\"\r\nimport { _SetFilter } from \"./helpers\"\r\nimport { SYSTableSettings_ColumnFilter } from \"./tabledef\"\r\n\r\nexport class SYSTableSettingsColumnFilterDialog extends SYSBaseElement {\r\n defId: SYSTableDefIds\r\n columnKey: string\r\n columnDef: SYSColumnDef\r\n tableDef: _TableGetReturnType\r\n filter: _ColumnColumnFilter\r\n async resetFilter() {\r\n if (\r\n await TableColumnFilter(\r\n this.state.ovl.libState.tableSettings.columnFilter.defId,\r\n this.columnKey,\r\n [],\r\n {\r\n exclusive: false,\r\n _innerEvent: true,\r\n }\r\n )\r\n ) {\r\n await TableRebuild(\r\n this.state.ovl.libState.tableSettings.columnFilter.defId,\r\n { showProcess: true }\r\n )\r\n HeaderMenuFilterFieldsSetState(\r\n FormGet(\"SYSHeaderMenuFilter\", { instance: \"1\" }).formState\r\n )\r\n }\r\n DialogClose(\"SYSTableSettings_ColumnFilter\")\r\n }\r\n async init() {\r\n this.dialog = \"SYSTableSettings_ColumnFilter\"\r\n this.defId = \"SYSTableSettings_ColumnFilter\"\r\n this.tableDef = TableGet(this.defId)\r\n let filterTableDef = TableGet(\r\n this.state.ovl.libState.tableSettings.columnFilter.defId\r\n )\r\n this.columnKey =\r\n this.state.ovl.libState.tableSettings.columnFilter.columnKey\r\n this.columnDef = filterTableDef.def.columns[this.columnKey]\r\n this.filter = JSON.parse(\r\n JSON.stringify(\r\n filterTableDef.def.uiState.filter.columns[this.columnKey].columnFilter\r\n )\r\n )\r\n await super.init()\r\n }\r\n async getUI() {\r\n let dialogHolderParams: DialogHolderParams\r\n dialogHolderParams = {\r\n dialogParts: {\r\n dismissedCallbackFn: () => {\r\n DialogClose(this.dialog)\r\n },\r\n\r\n body: () => html` \"SYSTableSettings_ColumnFilter\"}\r\n >\r\n `,\r\n footer: async () => {\r\n let filter = this.filter\r\n let hasSelected =\r\n this.tableDef.getKeys({ byKeys: \"Selected\" }).length > 0\r\n\r\n let setFilterButton = html` await _SetFilter(this.filter.exclusive)}\r\n class=\"fd-button\"\r\n ?disabled=${!hasSelected}\r\n >\r\n \r\n `\r\n\r\n let clearFilterButton = html` await this.resetFilter()}\r\n class=\"fd-button\"\r\n ?disabled=${filter.type === \"none\"}\r\n >\r\n \r\n `\r\n\r\n let exklCheck\r\n if (\r\n this.state.ovl.libState.tableSettings.columnFilter.allowExclusive\r\n ) {\r\n exklCheck = html`\r\n \r\n {\r\n filter.exclusive = !filter.exclusive\r\n }}\r\n />\r\n \r\n \r\n `\r\n }\r\n\r\n return html`${exklCheck}\r\n \r\n ${setFilterButton}\r\n \r\n ${clearFilterButton}\r\n \r\n {\r\n return {\r\n defId: \"SYSTableSettings_ColumnFilter\",\r\n } as NavDef\r\n }}\r\n >`\r\n },\r\n },\r\n dialogType: this.dialog,\r\n }\r\n return html``\r\n }\r\n}\r\n","import { html } from \"lit-html\"\r\nimport type { SYSTableDefIds } from \"../../../../..\"\r\nimport { T } from \"../../../../../textapi\"\r\nimport type { DialogHolderParams } from \"../../../../dialog/dialogapi\"\r\nimport { DialogIsOpen, DialogClose } from \"../../../../dialog/dialogapi\"\r\nimport { SYSBaseElement } from \"../../../../sysbaseelement\"\r\nimport type { NavDef } from \"../../../navcontrol\"\r\nimport {\r\n _GetFilterSettingsCardCodes,\r\n _GetFilterSettingsCntctCodes,\r\n} from \"../helpers\"\r\n\r\nexport class SYSTableSettingsFilterSortDialog extends SYSBaseElement {\r\n instance: any\r\n async init() {\r\n this.dialog = \"SYSTableSettings_FilterSort\"\r\n this.instance = DialogIsOpen(\"SYSTableHeaderMenu\", \"1\") ? \"2\" : \"1\"\r\n await _GetFilterSettingsCardCodes()\r\n await _GetFilterSettingsCntctCodes()\r\n await super.init()\r\n }\r\n async getUI() {\r\n let tableId = \"SYSTableSettings_FilterSort\"\r\n let dialogHolderParams: DialogHolderParams\r\n dialogHolderParams = {\r\n dialogParts: {\r\n dismissedCallbackFn: () => {\r\n DialogClose(this.dialog, { instance: this.dialogInstance })\r\n },\r\n title: () => T(\"SYSTableSettingsFilterSortSettings\"),\r\n body: () => html` tableId}\r\n >\r\n `,\r\n footer: () => html` {\r\n return {\r\n defId: tableId,\r\n } as NavDef\r\n }}\r\n >`,\r\n },\r\n dialogType: this.dialog,\r\n }\r\n return html``\r\n }\r\n}\r\n","import type {\r\n DirectiveResult,\r\n SYSForm,\r\n TemplateResult,\r\n UnsafeHTMLDirective,\r\n} from \"../../\"\r\nimport { html } from \"../../\"\r\nimport { SYSBaseElement } from \"../sysbaseelement\"\r\n\r\nexport type DialogChangedParam = {\r\n dialogState: ModalDialogState\r\n result: ResultType\r\n}\r\nexport type _DialogOkType = \"SYSOk\" | \"SYSYes\" | \"NoButton\" | string\r\nexport type _DialogCancelType = \"SYSCancel\" | \"SYSNo\" | \"NoButton\" | string\r\n\r\nexport type ResultType = undefined | 1 | 2 | 3\r\n\r\nexport type OpenModalDialogState = {\r\n title: string | TemplateResult | UnsafeHTMLDirective | DirectiveResult\r\n customClass: string\r\n type: DialogType\r\n text: string | TemplateResult | UnsafeHTMLDirective | DirectiveResult\r\n ok: _DialogOkType\r\n cancel: _DialogCancelType\r\n freeButton1?: string\r\n default: ResultType\r\n instance?: any\r\n connectedForm?: { formType: string; formId: string }\r\n}\r\nexport type ModalDialogState = {\r\n title: string | TemplateResult | UnsafeHTMLDirective | DirectiveResult\r\n customClass: string\r\n type: DialogType\r\n text: string | TemplateResult | UnsafeHTMLDirective | DirectiveResult\r\n okText: string\r\n cancelText: string\r\n freeButton1Text?: string\r\n result: ResultType\r\n default: ResultType\r\n instance?: any\r\n connectedForm?: { formType: string; formId: string }\r\n}\r\n\r\nimport { SYSFormField } from \"../forms/fieldapi\"\r\nimport { DialogType } from \"./sysdialogbase\"\r\nimport { _DialogHolderParams } from \"./sysdialogholder\"\r\nimport { FormIsDirty, FormIsValid, FormReset } from \"../forms/formapi\"\r\nimport { T } from \"../../textapi\"\r\nimport { DialogResult } from \"../actions\"\r\nimport { DialogOkCancel } from \"./dialogapi\"\r\n\r\nexport class SYSDialog extends SYSBaseElement {\r\n modaldialog: ModalDialogState\r\n\r\n constructor() {\r\n super()\r\n this.dialog = \"SYSModal\"\r\n }\r\n async init() {\r\n this.modaldialog = this.state.ovl.libState.dialog[this.dialogInstance]\r\n await super.init()\r\n }\r\n\r\n handleResult(result: ResultType) {\r\n this.actions.ovl.internal._DialogChanged({\r\n dialogState: this.modaldialog,\r\n result: result,\r\n })\r\n }\r\n\r\n handleOkClick = () => {\r\n this.actions.ovl.internal._DialogChanged({\r\n dialogState: this.modaldialog,\r\n\r\n result: 1,\r\n })\r\n }\r\n\r\n handleCancelClick = async () => {\r\n if (this.formState) {\r\n if (FormIsDirty(this.formState)) {\r\n if (\r\n (await DialogOkCancel(T(\"SYSCancelForm\"), {\r\n instance: \"CancelForm\",\r\n cancelText: \"SYSNo\",\r\n })) === 1\r\n ) {\r\n FormReset(this.formState)\r\n }\r\n }\r\n }\r\n\r\n this.actions.ovl.internal._DialogChanged({\r\n dialogState: this.modaldialog,\r\n result: 2,\r\n })\r\n }\r\n\r\n handleFreeButton1Click = () => {\r\n this.actions.ovl.internal._DialogChanged({\r\n dialogState: this.modaldialog,\r\n result: 3,\r\n })\r\n }\r\n\r\n handleDefault(def: ResultType) {\r\n if (\r\n (def == 1 && this.modaldialog.okText == \"\") ||\r\n (def == 2 && this.modaldialog.cancelText == \"\") ||\r\n (def == 2 && this.modaldialog.freeButton1Text == \"\")\r\n ) {\r\n return\r\n }\r\n this.actions.ovl.internal._DialogDefaultChanged({\r\n default: def,\r\n instance: this.dialogInstance,\r\n })\r\n }\r\n\r\n keyHandler = (e: KeyboardEvent) => {\r\n //@ts-ignore\r\n if (\"ovl-dialog,ovldialogok,ovldialogcancel\".indexOf(e.target.id) < 0) {\r\n return\r\n }\r\n\r\n e.preventDefault()\r\n e.stopPropagation()\r\n\r\n if (e.key == \"Enter\") {\r\n if (this.modaldialog.default == 1) {\r\n this.handleResult(1)\r\n } else if (this.modaldialog.default == 2) {\r\n this.handleResult(2)\r\n } else {\r\n this.handleResult(3)\r\n }\r\n // } else if (e.key == \"ArrowRight\") {\r\n // if (this.modaldialog.default == 1) {\r\n // this.handleDefault(2)\r\n // }\r\n // } else if (e.key == \"ArrowLeft\") {\r\n // if (this.modaldialog.default == 2) {\r\n // this.handleDefault(1)\r\n // }\r\n // } else if (e.key == \"Tab\") {\r\n // if (this.modaldialog.default == 2) {\r\n // this.handleDefault(1)\r\n // } else {\r\n // this.handleDefault(2)\r\n // }\r\n } else if (e.key === \"Escape\") {\r\n if (this.modaldialog.cancelText !== \"NoButton\") {\r\n this.handleDefault(2)\r\n setTimeout(() => {\r\n this.handleResult(2)\r\n }, 100)\r\n } else {\r\n this.handleResult(1)\r\n }\r\n }\r\n }\r\n getBody = () => {\r\n this.modaldialog = this.state.ovl.libState.dialog[this.dialogInstance]\r\n let lines\r\n let text = this.modaldialog.text\r\n if (typeof text === \"string\") {\r\n lines = text.split(/\\r?\\n/)\r\n return lines.map((e) => html` ${e}
    `)\r\n } else {\r\n lines = text\r\n }\r\n return lines\r\n }\r\n getFooter = () => {\r\n this.modaldialog = this.state.ovl.libState.dialog[this.dialogInstance]\r\n let okButton = null\r\n let cancelButton = null\r\n let freeButton1 = null\r\n if (this.modaldialog.okText) {\r\n let disabled = this.formState && !FormIsValid(this.formState)\r\n okButton = html`
    \r\n \r\n ${this.modaldialog.okText}\r\n \r\n
    `\r\n }\r\n\r\n if (this.modaldialog.cancelText) {\r\n cancelButton = html`\r\n
    \r\n \r\n ${this.modaldialog.cancelText}\r\n \r\n
    \r\n `\r\n }\r\n\r\n if (this.modaldialog.freeButton1Text) {\r\n freeButton1 = html`\r\n
    \r\n \r\n ${this.modaldialog.freeButton1Text}\r\n \r\n
    \r\n `\r\n }\r\n\r\n return html`${okButton} ${cancelButton} ${freeButton1}`\r\n }\r\n\r\n async getUI() {\r\n this.modaldialog = this.state.ovl.libState.dialog[this.dialogInstance]\r\n let dependsOn = this.dialogState.visible\r\n if (!dependsOn) {\r\n return null\r\n }\r\n let dialogHolderParams: _DialogHolderParams\r\n // tracking needs to be recorded on the hiolder object\r\n // thats why we use functions here to get the templates\r\n // to make it look nicer i even used methods for the different parts\r\n\r\n dialogHolderParams = {\r\n dialogParts: {\r\n title: () => {\r\n this.modaldialog = this.state.ovl.libState.dialog[this.dialogInstance]\r\n return this.modaldialog.title\r\n },\r\n body: async () => await this.getBody(),\r\n footer: () => this.getFooter(),\r\n keyHandlerFn: this.keyHandler,\r\n dismissedCallbackFn: this.handleCancelClick,\r\n type: this.modaldialog.type,\r\n customClass: () => this.modaldialog.customClass,\r\n },\r\n\r\n dialogType: this.dialogState.dialog,\r\n instance: this.dialogState.instance,\r\n }\r\n return html``\r\n }\r\n}\r\n","import type { SYSForm, TemplateResult, SYSDialog } from \"../..\"\r\nimport { html } from \"../..\"\r\n\r\nimport { SYSFormField } from \"../forms/fieldapi\"\r\nimport { _FocusState, SYSBaseElement } from \"../sysbaseelement\"\r\nimport { DialogClose } from \"./dialogapi\"\r\n\r\nexport type FormHandlingType = {\r\n formType: SYSForm\r\n formId?: any\r\n removeFormStateWhenClose?: boolean\r\n\r\n // set it true if you would like to have this.formState set inside a dialog\r\n isConnectedToDialog?: boolean\r\n creation?: {\r\n autoInitFormFields?: { [key: string]: SYSFormField }\r\n parentFormType?: SYSForm\r\n parentFormId?: any\r\n parentFieldKey?: string\r\n }\r\n}\r\n\r\nexport type DialogsState = {\r\n visible: boolean\r\n closing: boolean\r\n disabled?: boolean\r\n mainFormId?: string\r\n resolver?: any[]\r\n\r\n resolveValue?: any\r\n modal?: boolean\r\n zIndex: number\r\n data?: any\r\n formsHandling: FormHandlingType[]\r\n focus?: _FocusState\r\n //forceElementIdToFocusAfterClose?: string\r\n dialog: SYSDialog\r\n instance: any\r\n}\r\n\r\nexport type DialogType =\r\n | \"confirmation\"\r\n | \"error\"\r\n | \"success\"\r\n | \"warning\"\r\n | \"information\"\r\n\r\nexport type DialogParts = {\r\n header?:\r\n | TemplateResult\r\n | TemplateResult[]\r\n | Promise\r\n | Promise\r\n title?: string\r\n body?:\r\n | TemplateResult\r\n | TemplateResult[]\r\n | Promise\r\n | Promise\r\n footer?:\r\n | TemplateResult\r\n | TemplateResult[]\r\n | Promise\r\n | Promise\r\n customClass?: string\r\n keyHandlerFn?: any\r\n dismissHandlerFn?: any\r\n closeOnDismiss?: boolean\r\n emptySpaceClickHandlerFn?: any\r\n closedCallbackFn?: any\r\n type?: DialogType\r\n instance?: any\r\n}\r\n\r\nexport class SYSBaseDialog extends SYSBaseElement {\r\n //closedCallbackFn: any\r\n dismissCallbackFn: any\r\n scrollingDisabled: boolean\r\n\r\n constructor() {\r\n super()\r\n }\r\n\r\n getDialogTemplate = (\r\n dialogParts: DialogParts\r\n ): TemplateResult | Promise => {\r\n if (!this.closedCallbackFn && dialogParts.closedCallbackFn) {\r\n this.closedCallbackFn = dialogParts.closedCallbackFn\r\n }\r\n const defaultKeyHandler = (e: KeyboardEvent) => {\r\n if (e.key === \"Escape\") {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n if (dialogParts.closeOnDismiss) {\r\n DialogClose(this.dialog, { instance: this.dialogInstance })\r\n } else if (dialogParts.dismissHandlerFn) {\r\n dialogParts.dismissHandlerFn()\r\n }\r\n }\r\n }\r\n\r\n // now put together the template\r\n\r\n let handleTopLevelClick = (e: Event) => {\r\n //e.stopImmediatePropagation()\r\n e.stopPropagation()\r\n //e.preventDefault()\r\n if (dialogParts.emptySpaceClickHandlerFn) {\r\n dialogParts.emptySpaceClickHandlerFn(e)\r\n }\r\n }\r\n\r\n let handleDismiss = (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n if (dialogParts.closeOnDismiss) {\r\n DialogClose(this.dialog, { instance: this.dialogInstance })\r\n } else if (dialogParts.dismissHandlerFn) {\r\n dialogParts.dismissHandlerFn()\r\n }\r\n }\r\n let keyHandler = defaultKeyHandler\r\n if (dialogParts.keyHandlerFn) {\r\n keyHandler = dialogParts.keyHandlerFn\r\n }\r\n\r\n let fullheader\r\n if (dialogParts.header || dialogParts.title) {\r\n let title\r\n if (dialogParts.title) {\r\n title = html`\r\n
    \r\n

    ${dialogParts.title}

    \r\n
    \r\n `\r\n }\r\n let header\r\n if (dialogParts.header) {\r\n title = html`
    ${dialogParts.header}
    `\r\n }\r\n let iconname: string = `message-${dialogParts.type}`\r\n switch (dialogParts.type) {\r\n case \"confirmation\":\r\n iconname = \"question-mark\"\r\n }\r\n\r\n fullheader = html`\r\n
    \r\n
    \r\n ${header} ${title}\r\n
    \r\n
    \r\n `\r\n }\r\n let body\r\n if (dialogParts.body) {\r\n body = html`
    \r\n ${dialogParts.body}\r\n
    `\r\n }\r\n\r\n let footer\r\n if (dialogParts.footer) {\r\n footer = html`\r\n
    ${dialogParts.footer}
    \r\n `\r\n }\r\n let customClass = \"\"\r\n if (dialogParts.customClass) {\r\n customClass = dialogParts.customClass\r\n }\r\n let typeClass = \"\"\r\n if (dialogParts.type) {\r\n typeClass = \"fd-message-box--\" + dialogParts.type\r\n }\r\n\r\n typeClass = `${typeClass} ovl_dlg_z_index_${this.zIndex}`\r\n return html` {\r\n if (e.which === 1) handleDismiss(e)\r\n }}\r\n >\r\n {\r\n if (e.which === 1) {\r\n e.stopPropagation()\r\n }\r\n }}\r\n @click=${handleTopLevelClick}\r\n @keyup=${keyHandler}\r\n id=${`ovl-dialog-${this.dialog}-${this.dialogInstance}`}\r\n >\r\n ${fullheader} ${body} ${footer}\r\n \r\n `\r\n }\r\n async firstUpdated() {\r\n super.firstUpdated()\r\n }\r\n}\r\n","import { currentScreenAndDialog, SYSDialog, TemplateResult } from \"../..\"\r\nimport { FocusSet } from \"../../global/globalapi\"\r\nimport type { DialogType } from \"./sysdialogbase\"\r\nimport { SYSBaseDialog } from \"./sysdialogbase\"\r\n\r\nexport type DialogGetParts = {\r\n header?: () =>\r\n | TemplateResult\r\n | TemplateResult[]\r\n | Promise\r\n | Promise\r\n title?: () => any\r\n body?: () =>\r\n | TemplateResult\r\n | TemplateResult[]\r\n | Promise\r\n | Promise\r\n footer?: () =>\r\n | TemplateResult\r\n | TemplateResult[]\r\n | Promise\r\n | Promise\r\n keyHandlerFn?: any\r\n closedCallbackFn?: any\r\n dismissedCallbackFn?: any\r\n closeOnDismiss?: boolean\r\n emptySpaceClickHandlerFn?: any\r\n updatedHandlerFn?: any\r\n afterRenderHandlerFn?: any\r\n type?: DialogType\r\n instance?: any\r\n customClass?: () => string\r\n}\r\n\r\nexport type _DialogHolderParams = {\r\n dialogParts: DialogGetParts\r\n dialogType: SYSDialog\r\n instance?: any\r\n}\r\nexport class SYSDialogHolder extends SYSBaseDialog {\r\n dialogHolderParams: _DialogHolderParams\r\n async updated() {\r\n if (this.dialogHolderParams.dialogParts.updatedHandlerFn) {\r\n this.dialogHolderParams.dialogParts.updatedHandlerFn()\r\n }\r\n let dialog = currentScreenAndDialog.dialogFocusSet.dialog\r\n let instance = currentScreenAndDialog.dialogFocusSet.instance\r\n if (dialog && dialog === this.dialog && instance === this.dialogInstance) {\r\n currentScreenAndDialog.dialogFocusSet.dialog = undefined\r\n let id = `ovl-dialog-${dialog}-${instance}`\r\n FocusSet(id, {\r\n ignoreIfAlreadySetOnScreenOrDialog: true,\r\n })\r\n }\r\n await super.updated()\r\n }\r\n\r\n async afterRender() {\r\n if (this.dialogHolderParams.dialogParts.afterRenderHandlerFn) {\r\n await this.dialogHolderParams.dialogParts.afterRenderHandlerFn()\r\n }\r\n await super.afterRender()\r\n }\r\n\r\n async getUI() {\r\n let d = this.dialogHolderParams.dialogParts\r\n let res = this.getDialogTemplate({\r\n title: d.title ? d.title() : undefined,\r\n body: d.body ? await d.body() : undefined,\r\n header: d.header ? await d.header() : undefined,\r\n footer: d.footer ? await d.footer() : undefined,\r\n customClass: d.customClass ? d.customClass() : undefined,\r\n type: d.type ? d.type : undefined,\r\n keyHandlerFn: d.keyHandlerFn,\r\n closeOnDismiss: d.closeOnDismiss,\r\n dismissHandlerFn: d.dismissedCallbackFn,\r\n emptySpaceClickHandlerFn: d.emptySpaceClickHandlerFn,\r\n closedCallbackFn: d.closedCallbackFn,\r\n })\r\n return res\r\n }\r\n async connectedCallback() {\r\n this.isDialogHolder = true\r\n this.dialog = this.dialogHolderParams.dialogType\r\n this.dialogInstance = this.dialogHolderParams.instance\r\n ? this.dialogHolderParams.instance\r\n : this.dialogHolderParams.dialogType\r\n\r\n await super.connectedCallback()\r\n // if (!this.dialogState.zIndex) {\r\n // let dlgsCount = Object.keys(currentScreenAndDialog.dialogs).length\r\n // this.dialogState.zIndex = 6 + dlgsCount\r\n // }\r\n // this.zIndex = this.dialogState.zIndex\r\n }\r\n async disconnectedCallback() {\r\n this.dialogHolderParams = null\r\n await super.disconnectedCallback()\r\n }\r\n}\r\n","import { SYSBaseElement } from \"../../sysbaseelement\"\r\nimport type { CellClass } from \"../../table/row\"\r\nimport type { SYSField, SYSFormState } from \"../actions\"\r\n//import type { SYSFileDropEventData } from \"../sysformelement\"\r\nimport { _SetFocus } from \"../../../global/globals\"\r\nimport { DialogOpen } from \"../../dialog/dialogapi\"\r\nimport { _GetAlign, GetRowDisplayValue } from \"../../table/helpers\"\r\nimport { FormEditorInit } from \"../formapi\"\r\nimport { TemplateResult } from \"lit-html\"\r\nimport { FieldIsDirty, FieldIsValid, FieldSetVal } from \"../fieldapi\"\r\nimport {\r\n HookFieldGetValueRender,\r\n HookFieldGetValueRender_ReturnType,\r\n HookFieldGetValueRender_Type,\r\n} from \"../../../global/hooks\"\r\nimport { SYSTableDef } from \"../../table/table\"\r\nimport { TableGet } from \"../../table/tableapi\"\r\nimport { GetRowFromFormState } from \"./helpers\"\r\n\r\nexport class SYSControlBase extends SYSBaseElement {\r\n props: any\r\n field: SYSField\r\n inputElement: any\r\n valueRenderHookFn: any\r\n tableDef: SYSTableDef\r\n\r\n customInfo: {\r\n customRowClassName: string\r\n customRowTooltip: string\r\n customRowClassContainerName: string\r\n }\r\n focusable: boolean\r\n wasFocusedWhenDisabled: boolean\r\n\r\n async handleEditorEnter(e: KeyboardEvent) {\r\n if (e.key === \"Enter\") {\r\n this.handleEditor(e)\r\n }\r\n }\r\n\r\n async handleEditor(e: Event) {\r\n if (this.field.editor) {\r\n if (!this.field.ui.alwaysReadOnly && !this.field.ui.readonly) {\r\n e.preventDefault()\r\n let editorFormState = await FormEditorInit(\r\n this.field.editor.id,\r\n // fields will be filled with HookFormProvideFields\r\n {},\r\n this.formState,\r\n this.field.fieldKey\r\n )\r\n if (editorFormState === undefined) {\r\n // there is smth wrong or it was canceled by the user\r\n return\r\n }\r\n DialogOpen(this.field.editor.id, {\r\n instance: editorFormState.formId,\r\n formsHandling: [\r\n {\r\n formType: this.field.editor.id,\r\n formId: editorFormState.formId,\r\n removeFormStateWhenClose: true,\r\n },\r\n ],\r\n })\r\n }\r\n }\r\n }\r\n\r\n getCustomInfo(customRowCell: CellClass) {\r\n let key = this.field.fieldKey\r\n let customRowClassName = \"\"\r\n let customRowTooltip\r\n let customRowClassContainerName = \"\"\r\n if (customRowCell?.[key]) {\r\n if (customRowCell[key].className) {\r\n customRowClassName = customRowCell[key].className\r\n customRowClassContainerName = customRowClassName + \"Container\"\r\n }\r\n customRowTooltip = customRowCell[key].tooltip\r\n }\r\n return { customRowClassName, customRowTooltip, customRowClassContainerName }\r\n }\r\n\r\n getOutlineValidationHint() {\r\n if (this.field.inactive) {\r\n return \"\"\r\n }\r\n let outlineValidationHint = \"\"\r\n let allValidation = this.field.validationResult.System.concat(\r\n this.field.validationResult.Validate\r\n ).concat(this.field.validationResult.ValueChanged)\r\n if (allValidation.length > 0) {\r\n outlineValidationHint = \"is-warning\"\r\n if (this.field.watched && !this.field.hasFocus) {\r\n outlineValidationHint = \"is-error\"\r\n }\r\n }\r\n return outlineValidationHint\r\n }\r\n\r\n getContainerClass(type: string, customRowClassName) {\r\n if (customRowClassName === undefined) {\r\n customRowClassName = \"\"\r\n }\r\n return `fd-form-item ovl-formcontrol-container ovl-container-${type} ovl-container__${this.field.fieldKey} ${customRowClassName}`\r\n }\r\n\r\n getInputClass(type: string, customRowClassName, ignoreOutline?: boolean) {\r\n let field = this.field\r\n let outlineClass = \"\"\r\n if (!ignoreOutline) {\r\n outlineClass = this.getOutlineValidationHint()\r\n }\r\n\r\n let align = \"\"\r\n if (field.ui?.align) {\r\n align = _GetAlign(field.ui.align)\r\n }\r\n\r\n let focusable = \"\"\r\n\r\n if (this.focusable) {\r\n focusable = `ovl-focusable ${\r\n field.ui.selectIfFocused === true ? \"ovl-focusselected\" : \"\"\r\n }`\r\n }\r\n\r\n return `${align} ${outlineClass} ${customRowClassName} ${focusable} ${this.getEditorClass()} ovl-formcontrol-input ovl-value-${type} ovl-value__${\r\n field.fieldKey\r\n } ${!this.focusable ? \"ovl-disabled\" : \"\"}`\r\n }\r\n\r\n getEditorClass() {\r\n if (!this.field.editor) {\r\n return \"\"\r\n }\r\n return `ovl-editor ovl-editor__${this.field.editor.id.toString()}`\r\n }\r\n\r\n getReadOnly() {\r\n return (\r\n !!this.field.ui.readonly ||\r\n this.field.editor ||\r\n this.formState.locked ||\r\n this.field.ui.visible === \"fadeOut\"\r\n )\r\n }\r\n\r\n getHookValue(): any {\r\n if (this.valueRenderHookFn) {\r\n let res = GetRowDisplayValue(\r\n this.tableDef,\r\n this.field.fieldKey,\r\n GetRowFromFormState(this.formState),\r\n this.formState.tableRowKey,\r\n \"Editor\",\r\n false,\r\n this.valueRenderHookFn\r\n )\r\n return res\r\n }\r\n }\r\n\r\n // handleFormFileDragOver(e: DragEvent) {\r\n // // dragover needs to be canceled. elsewise drop will not work as expected\r\n // // but just do this for file transfers so other future drag and drop stuff shouldn't be affected\r\n // if (e.dataTransfer.types.filter((f) => f === \"Files\").length > 0) {\r\n // e.stopPropagation()\r\n // e.preventDefault()\r\n // }\r\n // }\r\n\r\n // handleFormFileDrop(e) {\r\n // if (e.dataTransfer.files.length < 1) {\r\n // return\r\n // }\r\n\r\n // let dropEventData: SYSFileDropEventData = {\r\n // dragEvent: e,\r\n // formState: this.formState,\r\n // field: this.field,\r\n // }\r\n // const event = new CustomEvent(\"ovlformfiledrop\", {\r\n // detail: dropEventData,\r\n // bubbles: true,\r\n // cancelable: true,\r\n // })\r\n\r\n // this.dispatchEvent(event)\r\n // }\r\n\r\n handleAnimationEnd = (e) => {\r\n if (e.animationName === \"fadeOutControl\") {\r\n this.classList.remove(\"fadeOutControl\")\r\n this.classList.add(\"ovl-hideControl\")\r\n this.field._state.closing = false\r\n this.field._state.visible = false\r\n }\r\n if (e.animationName === \"fadeInControl\") {\r\n this.classList.remove(\"fadeInControl\")\r\n this.field._state.closing = false\r\n this.field._state.visible = true\r\n }\r\n }\r\n async init() {\r\n if (!this.props) {\r\n return\r\n }\r\n this.field = this.props(this.state)\r\n this.formState =\r\n this.state.ovl.forms[this.field.formType][this.field.formId]\r\n // this.addEventListener(\"drop\", (e) => this.handleFormFileDrop(e))\r\n // this.addEventListener(\"dragover\", (e) => this.handleFormFileDragOver(e))\r\n this.addEventListener(\"keydown\", (e) => this.handleEditorEnter(e))\r\n if (this.field.editor && this.field.editor.id !== \"SYSEditorAsset\") {\r\n // Assets Click neeeds to be registered sep. because elsewise it interferes with the click send to input file\r\n this.addEventListener(\"click\", (e) => this.handleEditor(e))\r\n }\r\n this.valueRenderHookFn =\r\n this.actions.app.features?.[this.formState.feature]?.hooks?.[\r\n HookFieldGetValueRender.replace(\r\n \"{subFeature}\",\r\n this.formState.subFeature\r\n ).replace(\"{fieldKey}\", this.field.fieldKey)\r\n ]\r\n if (this.formState.tableDefId) {\r\n this.tableDef = TableGet(this.formState.tableDefId).def\r\n }\r\n await super.init()\r\n }\r\n InitControl() {\r\n if (!this.props) {\r\n return\r\n }\r\n this.field = this.props(this.state)\r\n\r\n if (\r\n !this.field._state.visible &&\r\n this.field.ui.visible !== \"fadeIn\" &&\r\n !this.field.ui.fillSpaceIfNotVisible\r\n ) {\r\n return false\r\n }\r\n\r\n // setTimeout(async () => {\r\n // if (!this.field) {\r\n // return\r\n // }\r\n // let autoFillChk = document.getElementById(\r\n // `${this.field.formType}_${this.field.formId}_${this.field.fieldKey}`\r\n // )\r\n // if (autoFillChk) {\r\n // if (!FieldIsDirty(this.field)) {\r\n // let val = autoFillChk.value\r\n // let fieldVal = this.field.convertedValue\r\n\r\n // // if the field is valid. bute there\r\n // if (val && !fieldVal) {\r\n // console.log(\r\n // \"autofill detected... setValue\",\r\n // this.field.fieldKey,\r\n // val,\r\n // fieldVal\r\n // )\r\n // await FieldSetVal(this.field, val)\r\n // }\r\n // }\r\n // }\r\n // }, 300)\r\n\r\n this.customInfo = this.getCustomInfo(this.formState._state._viewRowCell)\r\n\r\n if (this.customInfo.customRowTooltip) {\r\n this.setAttribute(\"title\", this.customInfo.customRowTooltip)\r\n } else {\r\n this.removeAttribute(\"title\")\r\n }\r\n\r\n if (this.field.ui.readonly) {\r\n this.classList.add(\"ovl-disabled__cursor-not-allowed\")\r\n } else {\r\n this.classList.remove(\"ovl-disabled__cursor-not-allowed\")\r\n }\r\n\r\n if (!this.field._state.visible && this.field.ui.visible !== \"fadeIn\") {\r\n this.classList.add(\"ovl-hideControl\")\r\n }\r\n this.id = \"ovl_\" + this.field.id\r\n\r\n this.focusable = !(\r\n this.field.ui.readonly ||\r\n this.formState.locked ||\r\n this.field.ui.visible === \"false\" ||\r\n this.field.ui.visible.indexOf(\"fadeOut\") > -1\r\n )\r\n\r\n if (\r\n !this.focusable &&\r\n this.inputElement &&\r\n this.inputElement.id === document.activeElement?.id\r\n ) {\r\n this.wasFocusedWhenDisabled = true\r\n }\r\n if (this.focusable && this.wasFocusedWhenDisabled) {\r\n this.wasFocusedWhenDisabled = false\r\n setTimeout(() => {\r\n if (this.inputElement?.id) {\r\n _SetFocus(this.inputElement.id)\r\n }\r\n }, 0)\r\n }\r\n }\r\n\r\n // this is needed because other methods still allow to tab into the control\r\n async connectedCallback() {\r\n await super.connectedCallback()\r\n this.setAttribute(\"title\", \"\")\r\n this.addEventListener(\"animationend\", this.handleAnimationEnd)\r\n //this.field = this.formState.fields[this.field.fieldKey]\r\n\r\n //this.addEventListener(\"animationstart\", this.handleAnimationStart, true)\r\n }\r\n async disconnectedCallback() {\r\n //make sure if the control was set to visible/not visible using fadeX\r\n // that the visible state gets set even if the animation didn't finish\r\n if (this.field) {\r\n if (this.field.ui.visible === \"fadeOut\" && this.field._state.visible) {\r\n this.field._state.visible = false\r\n } else if (\r\n this.field.ui.visible === \"fadeIn\" &&\r\n !this.field._state.visible\r\n ) {\r\n this.field._state.visible = true\r\n }\r\n }\r\n this.removeEventListener(\"animationend\", this.handleAnimationEnd)\r\n // this.removeEventListener(\"drop\", (e) => this.handleFormFileDrop(e))\r\n // this.removeEventListener(\"dragover\", (e) => this.handleFormFileDragOver(e))\r\n\r\n this.removeEventListener(\"click\", (e) => this.handleEditor(e))\r\n this.removeEventListener(\"keyup\", (e) => this.handleEditorEnter(e))\r\n this.field = null\r\n this.props = null\r\n this.customInfo = null\r\n this.inputElement = null\r\n\r\n await super.disconnectedCallback()\r\n }\r\n // async firstUpdated() {\r\n // // check if it has autocomplete\r\n // // if control is autocomplete control and it has the autocomplete css mark and there was no setvalue for a given period\r\n // // auto issue setvalue with current control value\r\n // if (this.field.ui.autocomplete && !this.field._state.valueWasSet)\r\n // }\r\n async afterRender() {\r\n if (this.classList.contains(\"ovl-hideControl\")) {\r\n if (\"false,fadeOut\".indexOf(this.field.ui.visible) < 0) {\r\n this.classList.remove(\"ovl-hideControl\")\r\n }\r\n }\r\n }\r\n}\r\n","import { html, SYSConfig } from \"../../../\"\r\nimport { T } from \"../../../textapi\"\r\n\r\nimport type { SYSFormState } from \"../actions\"\r\nimport { FieldSetVal } from \"../fieldapi\"\r\nimport { _setFieldFocus } from \"../helper\"\r\n\r\nimport { SYSControlBase } from \"./syscontrolbase\"\r\n\r\nexport class SYSEditorAsset extends SYSControlBase {\r\n async getUI() {\r\n super.InitControl()\r\n let field = this.field\r\n // /* needed for tracking... */\r\n // field.value\r\n let formState: SYSFormState =\r\n this.state.ovl.forms[field.formType][field.formId]\r\n if (!formState) {\r\n return\r\n }\r\n let displayValue\r\n\r\n let nullClicker = html``\r\n let isNullInput = \"\"\r\n if (field.nullHandling.enabled && field.convertedValue !== null) {\r\n isNullInput = \"ovl-null-input\"\r\n nullClicker = html`\r\n {\r\n e.stopPropagation()\r\n FieldSetVal(field, null, { watched: true })\r\n field._state._files = undefined\r\n }}\r\n >
    \r\n `\r\n }\r\n\r\n if (this.valueRenderHookFn) {\r\n displayValue = this.getHookValue()\r\n } else {\r\n if (\r\n SYSConfig.global.assetValueDisplay === \"ExtractFileNameAndExtension\"\r\n ) {\r\n if (field.value) {\r\n let valueAsObject = JSON.parse(field.value)\r\n if (Array.isArray(valueAsObject)) {\r\n valueAsObject = valueAsObject[0]\r\n }\r\n if (valueAsObject.val) {\r\n displayValue = `${valueAsObject.val}.${valueAsObject.ext}`\r\n }\r\n }\r\n } else {\r\n displayValue = field.value\r\n }\r\n }\r\n\r\n return html`\r\n \r\n this.handleEditor(e)}\r\n @focusout=${() => {\r\n this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value: this.field.value,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n _setFieldFocus(this.field, false)\r\n }}\r\n @focus=${() => _setFieldFocus(this.field, true)}\r\n class=\"fd-input ovledit-value ${this.getInputClass(\r\n \"asset\",\r\n\r\n this.customInfo.customRowClassName\r\n )}\"\r\n >\r\n ${displayValue} ${nullClicker}\r\n \r\n\r\n this.field}> \r\n this.field}>\r\n \r\n this.field}>\r\n \r\n \r\n `\r\n }\r\n}\r\n","import { html, ifDefined } from \"../../../\"\r\nimport { _setFieldFocus } from \"../helper\"\r\nimport { _focusOutHelper } from \"./helpers\"\r\nimport { SYSControlBase } from \"./syscontrolbase\"\r\n\r\nexport class SYSCheckbox extends SYSControlBase {\r\n async handleChange(e: Event) {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n\r\n let field = this.field\r\n let val: string | boolean = field.value\r\n\r\n if (val === field.ui.checkedValue) {\r\n if (typeof field.ui.checkedValue === \"string\") {\r\n val = field.ui.uncheckedValue\r\n } else {\r\n val = false\r\n }\r\n } else {\r\n if (typeof field.ui.checkedValue === \"string\") {\r\n val = field.ui.checkedValue\r\n } else {\r\n val = true\r\n }\r\n }\r\n await this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value: val,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n }\r\n\r\n async getUI() {\r\n let visible = super.InitControl()\r\n if (visible === false) {\r\n return undefined\r\n }\r\n let field = this.field\r\n return html`\r\n \r\n this.field}> \r\n
    \r\n await this.handleChange(e)}\r\n @focusout=${(e) => _focusOutHelper(e, this.field)}\r\n @focus=${() => _setFieldFocus(field, true)}\r\n autocomplete=\"off\"\r\n class=\"fd-checkbox\r\n ${this.getInputClass(\"checkbox\", this.customInfo.customRowClassName)}\"\r\n type=\"checkbox\"\r\n id=\"${field.id}\"\r\n ?checked=${field.value === field.ui.checkedValue}\r\n ?disabled=${this.getReadOnly()}\r\n />\r\n \r\n \r\n
    \r\n this.field}>\r\n \r\n this.field}>\r\n \r\n \r\n `\r\n }\r\n async afterRender() {\r\n this.inputElement = document.getElementById(this.field.id)\r\n //this.inputElement.value = this.field.value\r\n if (this.inputElement) {\r\n this.inputElement.checked =\r\n this.field.value === this.field.ui.checkedValue\r\n }\r\n\r\n await super.afterRender()\r\n }\r\n}\r\n","import { html, ifDefined } from \"../../../\"\r\nimport {\r\n getDateISOString,\r\n getDateValue,\r\n getOnlyDateISOString,\r\n isFirefox,\r\n isIOS,\r\n isMobile,\r\n isSafari,\r\n} from \"../../../global/globals\"\r\n\r\nimport { _setFieldFocus } from \"../helper\"\r\nimport { _focusOutHelper } from \"./helpers\"\r\nimport { SYSControlBase } from \"./syscontrolbase\"\r\n\r\nexport class SYSDate extends SYSControlBase {\r\n inputPickerElement: any\r\n async init() {\r\n if (isMobile() && !isIOS()) {\r\n this.addEventListener(\"input\", (e) => this.handleInput(e))\r\n }\r\n if (!(isMobile() && !isIOS())) {\r\n this.addEventListener(\"change\", (e) => this.handleChange(e))\r\n }\r\n await super.init()\r\n }\r\n\r\n // for mobile the picker always delivers: yyyy-mm-dd in the e.target.value\r\n //\r\n\r\n setInputElementValueFromDatePicker(pickerVal: string) {\r\n let value = pickerVal\r\n if (pickerVal) {\r\n let dvals = pickerVal.split(\"-\")\r\n let dval = new Date(\r\n parseInt(dvals[0]),\r\n parseInt(dvals[1]) - 1,\r\n parseInt(dvals[2])\r\n )\r\n let onlyDateIsoString = getOnlyDateISOString(dval)\r\n let value = getDateValue(onlyDateIsoString)\r\n }\r\n let isInnerEvent = false\r\n this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value,\r\n isInnerEvent,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n }\r\n\r\n handleInput(e: Event) {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n //@ts-ignore\r\n let pickerVal = e.target.value\r\n this.setInputElementValueFromDatePicker(pickerVal)\r\n }\r\n handleChange(e: Event) {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n let isInnerEvent = true\r\n\r\n //@ts-ignore\r\n if (e.target.id == \"picker\" + this.field.id) {\r\n //@ts-ignore\r\n let pickerVal = e.target.value\r\n //@ts-ignore\r\n if (!pickerVal || pickerVal.length < 10) {\r\n this.inputElement.value = \"\"\r\n } else {\r\n let dval = new Date(pickerVal)\r\n this.inputElement.value = getDateValue(getDateISOString(dval))\r\n }\r\n // workaround to remove focus after picker select\r\n // that ensures validationhint display after selecting directly\r\n // its all about validationhintdisplay\r\n this.field.hasFocus = false\r\n }\r\n\r\n isInnerEvent = false\r\n\r\n this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value: this.inputElement.value,\r\n isInnerEvent,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n //@ts-ignore\r\n if (e.target.id === this.field.id) {\r\n this.updatePickerElement()\r\n }\r\n }\r\n\r\n handleFocus() {\r\n _setFieldFocus(this.field, true)\r\n }\r\n\r\n handleFocusOut(e) {\r\n if (!(e.relatedTarget && e.relatedTarget.id === \"picker\" + this.field.id)) {\r\n _focusOutHelper(e, this.field)\r\n }\r\n }\r\n ignorePickerTextField(e: KeyboardEvent) {\r\n if (!isMobile()) {\r\n this.inputElement.focus()\r\n }\r\n }\r\n\r\n keyUp(e: KeyboardEvent) {\r\n // 24.01.24 was causing that quickly entered values were swallowed\r\n // -> uncommented\r\n // // workaround to set focus after it was to false in picker select\r\n // // its all about validationhintdisplay\r\n // _setFieldFocus(this.field, true)\r\n // this.actions.ovl.form._ChangeField({\r\n // fieldKey: this.field.fieldKey,\r\n // formState: this.formState,\r\n // value: this.inputElement.value,\r\n // isInnerEvent: true,\r\n // watched: true,\r\n // })\r\n }\r\n\r\n updatePickerElement() {\r\n if (this.inputPickerElement) {\r\n if (this.field.convertedValue) {\r\n let dval = new Date(this.field.convertedValue)\r\n if (!isNaN(dval.getDate())) {\r\n this.inputPickerElement.value = getDateISOString(dval).replace(\r\n \"T00:00:00\",\r\n \"\"\r\n )\r\n } else {\r\n this.inputPickerElement.value = \"\"\r\n }\r\n } else {\r\n this.inputPickerElement.value = \"\"\r\n }\r\n }\r\n }\r\n async getUI() {\r\n let visible = super.InitControl()\r\n if (visible === false) {\r\n return undefined\r\n }\r\n let field = this.field\r\n let readonly = this.getReadOnly()\r\n let type: \"date\" | \"text\" = \"text\"\r\n let browserDatePicker\r\n let browserDatePickerButton\r\n let browserDatePickerClass = \"ovl-input-date\"\r\n if (isMobile()) {\r\n type = \"date\"\r\n } else if (field.ui.useBrowserDatePicker && !isSafari() && !readonly) {\r\n browserDatePickerClass = \"ovl-input-datepickertarget\"\r\n browserDatePicker = html`\r\n this.ignorePickerTextField(e)}\r\n @click=${(e) => this.ignorePickerTextField(e)}\r\n id=\"picker${field.id}\"\r\n ?readonly=${readonly}\r\n ?required=${isFirefox()}\r\n value=\"${field.convertedValue\r\n ? field.convertedValue.replace(\"T00:00:00\", \"\")\r\n : \"\"}\"\r\n />\r\n `\r\n // if (isFirefox()) {\r\n // browserDatePickerButton = html`
    `\r\n // }\r\n }\r\n //this.displayValue = getDateValue(field.convertedValue, field.ui.format)\r\n let fieldValue = field.value\r\n\r\n if (type === \"date\") {\r\n if (!fieldValue) {\r\n fieldValue = \"\"\r\n }\r\n if (field.convertedValue) {\r\n let dval = new Date(field.convertedValue)\r\n fieldValue = getDateISOString(dval).replace(\"T00:00:00\", \"\")\r\n }\r\n }\r\n\r\n return html`\r\n \r\n this.field}> \r\n \r\n {\r\n if (isIOS()) {\r\n this.handleChange(e)\r\n }\r\n }}\r\n @focus=${() => this.handleFocus()}\r\n @focusout=${(e) => this.handleFocusOut(e)}\r\n @keyup=${(e) => this.keyUp(e)}\r\n autocomplete=\"${field.ui.autocomplete}\"\r\n name=\"${field.ui.autocomplete !== \"off\"\r\n ? field.ui.autocomplete\r\n : this.field.fieldKey}\"\r\n class=\"fd-input ${browserDatePickerClass} ${this.getInputClass(\r\n \"date\",\r\n\r\n this.customInfo.customRowClassName,\r\n true\r\n )}\"\r\n type=\"${type}\"\r\n id=\"${field.id}\"\r\n value=\"${fieldValue}\"\r\n spellcheck=\"false\"\r\n ?readonly=\"${readonly}\"\r\n />\r\n\r\n ${browserDatePicker} ${browserDatePickerButton}\r\n \r\n
    \r\n this.field}>\r\n \r\n this.field}>\r\n \r\n \r\n `\r\n }\r\n async afterRender() {\r\n // // place picker under date with picker on the right just visible\r\n this.inputElement = document.getElementById(this.field.id)\r\n if (\r\n this.inputElement &&\r\n (this.inputElement.type !== \"date\" || isMobile())\r\n ) {\r\n if (this.field.convertedValue) {\r\n if (isMobile()) {\r\n this.inputElement.defaultValue = \"\"\r\n this.inputElement.value = getDateISOString(\r\n new Date(this.field.convertedValue)\r\n ).replace(\"T00:00:00\", \"\")\r\n } else {\r\n this.inputElement.value = this.field.value\r\n if (!this.field.value) {\r\n this.updatePickerElement()\r\n }\r\n }\r\n }\r\n }\r\n if (this.inputPickerElement === undefined) {\r\n this.inputPickerElement = document.getElementById(\r\n \"picker\" + this.field.id\r\n )\r\n this.updatePickerElement()\r\n }\r\n await super.afterRender()\r\n }\r\n async disconnectedCallback() {\r\n if (!isIOS()) {\r\n if (isMobile()) {\r\n this.removeEventListener(\"input\", (e) => this.handleInput(e))\r\n } else {\r\n this.removeEventListener(\"change\", (e) => this.handleChange(e))\r\n }\r\n }\r\n await super.disconnectedCallback()\r\n }\r\n}\r\n","import { html } from \"../../..\"\r\nimport { FocusSet } from \"../../../global/globalapi\"\r\nimport { _setFieldFocus } from \"../helper\"\r\nimport { _focusOutHelper } from \"./helpers\"\r\nimport { SYSControlBase } from \"./syscontrolbase\"\r\n\r\nexport class SYSDateTime extends SYSControlBase {\r\n // change is important for eg. autofilled form inputs\r\n handleChange(e: Event) {\r\n this.field._state.valueChangedHandled = true\r\n this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value: this.inputElement.value,\r\n isInnerEvent: false,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n }\r\n async getUI() {\r\n let visible = super.InitControl()\r\n if (visible === false) {\r\n return undefined\r\n }\r\n\r\n let field = this.field\r\n let readonly = this.getReadOnly()\r\n return html`\r\n \r\n this.field}> \r\n {\r\n if (!field._state.valueChangedHandled) {\r\n this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value: this.inputElement.value,\r\n isInnerEvent: false,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n }\r\n\r\n _focusOutHelper(e, this.field)\r\n }}\r\n @focus=${() => {\r\n _setFieldFocus(this.field, true)\r\n }}\r\n @change=${(e) => this.handleChange(e)}\r\n @click=${(e) => FocusSet(field.id)}\r\n ?readonly=${readonly}\r\n class=${`ovl-formcontrol-value fd-input __inpfocbox ${this.getInputClass(\r\n \"textbox\",\r\n this.customInfo.customRowClassName\r\n )}`}\r\n type=\"datetime-local\"\r\n id=${field.id}\r\n value=${field.value}\r\n />\r\n this.field}>\r\n \r\n this.field}>\r\n \r\n \r\n `\r\n }\r\n async afterRender() {\r\n this.inputElement = document.getElementById(this.field.id)\r\n // don't set if focus (in editing) because safari has troubles with it (cursor jumping)\r\n if (this.inputElement) {\r\n this.inputElement.value = this.field.value\r\n }\r\n await super.afterRender()\r\n }\r\n async disconnectedCallback() {\r\n this.inputElement = null\r\n await super.disconnectedCallback()\r\n }\r\n}\r\n","import { html } from \"../../../\"\r\nimport { FormSummaryValidationTextGet } from \"../../../../ovlsyscomponents/sysdefaulthtmlsnippets01\"\r\nimport {\r\n HookFormSummaryValidationTextDisplay,\r\n HookFormSummaryValidationTextDisplay_ReturnType,\r\n} from \"../../../global/hooks\"\r\nimport { SYSBaseElement } from \"../../sysbaseelement\"\r\nimport { FormHasVisibleSummaryErrors } from \"../formapi\"\r\nimport { FormValidationDisplayType } from \"../validators\"\r\n\r\nexport class SYSFormValidationHint extends SYSBaseElement {\r\n props: any\r\n formValidationSummaryTextDisplayHook: any\r\n\r\n async init() {\r\n this.formState = this.props(this.state)\r\n this.formValidationSummaryTextDisplayHook =\r\n this.actions.app.global.hooks?.[\r\n HookFormSummaryValidationTextDisplay.replace(\r\n \"{subFeature}\",\r\n this.formState.subFeature\r\n )\r\n ]\r\n await super.init()\r\n }\r\n async getUI() {\r\n // if (this.formState.locked || !FormHasVisibleSummaryErrors(this.formState)) {\r\n // return html``\r\n // }\r\n let msgs\r\n let hookRes: HookFormSummaryValidationTextDisplay_ReturnType\r\n if (this.formValidationSummaryTextDisplayHook) {\r\n hookRes = this.formValidationSummaryTextDisplayHook({\r\n formState: this.formState,\r\n })\r\n if (hookRes === undefined) {\r\n return null\r\n }\r\n msgs = hookRes.res\r\n }\r\n\r\n if (hookRes == undefined || hookRes?.resolve === \"UseDefault\") {\r\n msgs = FormSummaryValidationTextGet(this.formState).res\r\n }\r\n if (msgs === undefined) {\r\n return null\r\n }\r\n return html`\r\n \r\n ${msgs}\r\n \r\n `\r\n }\r\n}\r\n","import { _GetFieldList, getDisplayValue } from \"../../table/helpers\"\r\nimport {\r\n FieldIsFocused,\r\n FieldIsValid,\r\n FieldListModeType,\r\n FieldSetVal,\r\n SYSField,\r\n} from \"../fieldapi\"\r\nimport {\r\n _FieldListBustCache,\r\n _setFieldFocus,\r\n _setFieldTouched,\r\n _setFieldWatched,\r\n} from \"../helper\"\r\nimport { FilterHitList, GetRowFromFormState } from \"./helpers\"\r\nimport { SYSControlBase } from \"./syscontrolbase\"\r\n\r\nimport { disableBodyScroll, enableBodyScroll } from \"../../../global/globals\"\r\nimport type { HookFieldGetList_ReturnType } from \"../../../global/hooks\"\r\nimport { HookFieldGetList } from \"../../../global/hooks\"\r\nimport { ProcessIsRunning } from \"../../longrunningprocesstracker/processapi\"\r\n\r\nimport { html, ifDefined, SYSForm, TemplateResult } from \"../../..\"\r\nimport { DialogClose, DialogIsOpen, DialogOpen } from \"../../dialog/dialogapi\"\r\nimport { FormGet } from \"../formapi\"\r\n\r\nimport { FocusSet } from \"../../../global/globalapi\"\r\nimport { OptionsValidateResultError } from \"../validators\"\r\n\r\nexport type ListControlPart = \"Search\" | \"LocalList\" | \"Input\" | \"Other\"\r\n\r\nexport type ListState = {\r\n serverEndpoint?: string\r\n\r\n lookupDefKey?: string\r\n displayField?: string\r\n valueField: string\r\n displayValueField?: boolean\r\n\r\n refreshMode?: FieldListModeType\r\n\r\n showCachedHitsWhileTyping?: boolean\r\n\r\n acceptOnlyListValues?: boolean\r\n\r\n //introduced because we sometimes don't want a filter when allowing all input and clicking on listpopup button (casic qorquickorder positionen preisauswahl)\r\n acceptNotOnlyListValuesIgnoreFilter?: boolean\r\n\r\n acceptOnlyListValuesValidatorOptions?: OptionsValidateResultError\r\n //acceptEmpty?: boolean\r\n tryGetLookupFromServerInFormInitIfNotFound?: boolean\r\n tryGetLookupFromServerInFormInitIfNotFoundIgnoreValues?: \"None\" | any[]\r\n /*autoRefreshFromServerAlwaysInInit?: boolean*/\r\n mode?: \"List\" | \"Select\" | \"Option\"\r\n selectOnly?: boolean\r\n filterValue?: any\r\n\r\n onlyRefreshFromServerIfOlderThanMs?: number\r\n showRefreshFromServerSnack?: boolean\r\n _state?: {\r\n lastRefreshTimestamp?: number\r\n needsRefresh: boolean\r\n lastPostParams: string\r\n //needsListValidationOnFirstDisplay?: boolean\r\n }\r\n}\r\n\r\nconst _debounce = 40\r\nexport class SYSListControl extends SYSControlBase {\r\n localList: TemplateResult\r\n localListState: typeof this.state.ovl.libState.localHitListState\r\n hitListDialogBody: TemplateResult\r\n hitListDialogFooter: TemplateResult\r\n directHit: { value: any; description: any }\r\n listPopupDebouncer: any\r\n debouncer: any\r\n wasKey: boolean\r\n\r\n async init() {\r\n this.localListState = this.state.ovl.libState.localHitListState\r\n this.directHit = {\r\n value: undefined,\r\n description: undefined,\r\n }\r\n await super.init()\r\n _FieldListBustCache(this.field)\r\n }\r\n\r\n handleCancel = (e: Event) => {\r\n this.actions.ovl.dialog._DialogClose(\"SYSHitListDialog\")\r\n }\r\n\r\n async handleListPopupHelper(e: Event) {\r\n let explicit = true\r\n if (\r\n !this.field.list.acceptOnlyListValues &&\r\n !this.field.list.acceptNotOnlyListValuesIgnoreFilter\r\n ) {\r\n explicit = false\r\n this.field.list.filterValue = this.inputElement.value\r\n }\r\n await this.handleListPopup(e, explicit)\r\n }\r\n\r\n async handleListPopup(e: Event, explicit: boolean = false) {\r\n if (this.listPopupDebouncer) {\r\n clearTimeout(this.listPopupDebouncer)\r\n }\r\n this.listPopupDebouncer = setTimeout(async () => {\r\n if (DialogIsOpen(\"SYSHitListDialog\")) {\r\n return\r\n }\r\n\r\n if (e) {\r\n e.stopPropagation()\r\n }\r\n this.forceCloseLocalHitList()\r\n\r\n let filterValue = \"\"\r\n\r\n if (!explicit) {\r\n filterValue = this.field.list.filterValue\r\n } else {\r\n this.field.list.filterValue = \"\"\r\n }\r\n if (\r\n this.field.list.mode !== \"Select\" &&\r\n this.field.list.mode !== \"Option\" &&\r\n this.field.list.serverEndpoint &&\r\n !ProcessIsRunning(\"SYSGetLookupData\")\r\n ) {\r\n await this.actions.ovl.internal._FillListControl({\r\n list: this.field.list,\r\n filterValue,\r\n columnKey: this.field.fieldKey,\r\n row: GetRowFromFormState(this.formState),\r\n feature: this.formState.feature,\r\n formState: this.formState,\r\n })\r\n let filterRes = FilterHitList(\r\n this.field.list,\r\n filterValue,\r\n this.formState,\r\n this.field.fieldKey,\r\n undefined,\r\n true\r\n )\r\n if (!explicit && filterRes.directValue !== undefined) {\r\n this.selectedCallback(filterRes.directValue)\r\n return\r\n }\r\n }\r\n\r\n this.state.ovl.libState.hitListDialogState = {\r\n fieldKey: this.field.fieldKey,\r\n formType: this.field.formType,\r\n formId: this.field.formId,\r\n selectedCallback: this.selectedCallback,\r\n }\r\n DialogOpen(\"SYSHitListDialog\")\r\n }, _debounce + 100)\r\n }\r\n\r\n selectedCallback = async (selectedKey: string) => {\r\n let field = this.field\r\n await DialogClose(\"SYSHitListDialog\")\r\n if (selectedKey === \"@@ovlcanceled\") {\r\n FocusSet(this.inputElement.id)\r\n return\r\n } else {\r\n let dataList: HookFieldGetList_ReturnType = _GetFieldList(\r\n this.actions.app.features[this.formState.feature].hooks[\r\n HookFieldGetList.replace(\r\n \"{subFeature}\",\r\n this.formState.subFeature\r\n ).replace(\"{fieldKey}\", field.fieldKey)\r\n ],\r\n field.fieldKey,\r\n this.formState,\r\n this.formState?.tableDefId\r\n )\r\n let writeBackValue\r\n if (dataList.data[selectedKey][field.list.valueField] !== undefined) {\r\n writeBackValue = dataList.data[selectedKey][field.list.valueField]\r\n } else {\r\n writeBackValue = selectedKey\r\n }\r\n await FieldSetVal(this.field, writeBackValue, {\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n }\r\n this.forceCloseLocalHitList()\r\n }\r\n\r\n handleGotFocusSearch(e: Event) {\r\n this.forceCloseLocalHitList()\r\n // if (this.field.list.mode !== \"Select\") {\r\n _setFieldFocus(this.field, true)\r\n // }\r\n }\r\n\r\n handleFocus(e: Event) {\r\n e.stopPropagation()\r\n _setFieldFocus(this.field, true)\r\n\r\n if (this.localList) {\r\n this.forceCloseLocalHitList()\r\n }\r\n }\r\n\r\n async FieldSetValueAndCheckFocus(\r\n field: SYSField,\r\n value,\r\n setWatched: boolean = false\r\n ) {\r\n await FieldSetVal(field, value, {\r\n watched: setWatched === true ? true : undefined,\r\n noRetrigger: true,\r\n })\r\n // if value gets forced here and there is eg. a valuechanged hook which sets focus to different field\r\n // then we need to reset fieldfocus and close eventually list\r\n if (\r\n document.activeElement &&\r\n document.activeElement.id.indexOf(field.id) < 0\r\n ) {\r\n _setFieldFocus(field, false)\r\n this.forceCloseLocalHitList()\r\n }\r\n }\r\n async handleFocusOut(e: Event) {\r\n // in focus out following things need to be checked:\r\n // - did the user enter a value (field needs to be touched) that should be used to filter the list? -> open popup filtered\r\n // - did the user enter a value (field needs to be touched) that doesn't exist and we are in select mode (no db lookup) -> open popup not filtered\r\n // - did the user enter a value (field needs to be touched) which is unique and we are in select mode -> directly use that value\r\n // - did the user leave the field (well the formcontrol div to be exact) without having it touched -> do nothing\r\n\r\n // if popup opens depends on List Validator. if the list is invalid popup opens elsewise not\r\n\r\n // to check if we are operating inside the formcontrol div we need to do a few checks.\r\n // this code is tested on ios safari and chrome android as well\r\n // there we have some keys on the keyboard like \"go on to next field\" which does not open the popup but thats fine\r\n\r\n //@ts-ignore\r\n let toControlId = e.relatedTarget ? e.relatedTarget.id : \"\"\r\n let toControlType: ListControlPart\r\n if (toControlId.indexOf(\"ovlhl_\") > -1) {\r\n toControlType = \"LocalList\"\r\n } else if (toControlId.indexOf(\"search\") > -1) {\r\n toControlType = \"Search\"\r\n } else if (toControlId !== \"\") {\r\n toControlType = \"Input\"\r\n } else {\r\n toControlType = \"Other\"\r\n }\r\n\r\n let field = this.field\r\n let movedOut = false\r\n\r\n if (toControlType === \"Other\" || !toControlId.endsWith(field.id)) {\r\n movedOut = true\r\n }\r\n\r\n //do nothing if user just navigated into locallist or from locallist into current input or into list dialog\r\n if (\r\n toControlType === \"LocalList\" ||\r\n (!movedOut && toControlType === \"Input\") ||\r\n DialogIsOpen(\"SYSHitListDialog\")\r\n ) {\r\n return\r\n }\r\n\r\n // if moving away then close locallist and set focus false\r\n if (movedOut) {\r\n if (field.touched) {\r\n if (await this.wasDirectSelectHit()) {\r\n this.forceCloseLocalHitList()\r\n _setFieldFocus(field, false)\r\n\r\n return\r\n }\r\n await FieldSetVal(field, field.value, { noRetrigger: true })\r\n }\r\n this.forceCloseLocalHitList()\r\n\r\n _setFieldFocus(field, false)\r\n return\r\n }\r\n\r\n if (field.touched) {\r\n let valueToWriteBack = field.value\r\n if (await this.wasDirectSelectHit()) {\r\n return\r\n }\r\n await this.FieldSetValueAndCheckFocus(field, valueToWriteBack)\r\n if (field.list.acceptOnlyListValues) {\r\n if (\r\n this.field.validationResult.System.filter(\r\n (f) => f.translationKey === \"SYSValidatorListValue\"\r\n ).length > 0\r\n ) {\r\n this.field.list.filterValue = this.inputElement.value\r\n this.handleListPopup(e, false)\r\n }\r\n }\r\n }\r\n }\r\n wasDirectSelectHit = async () => {\r\n let field = this.field\r\n let valueToWriteBack = field.value\r\n if (this.directHit.value !== undefined) {\r\n if (this.field.list.mode === \"Select\" && valueToWriteBack) {\r\n if (\r\n this.field.list.acceptOnlyListValues ||\r\n valueToWriteBack ===\r\n this.directHit\r\n .value /* because of Test FrmList 04 ... Entering should result in Db Null */ ||\r\n valueToWriteBack === this.directHit.description\r\n ) {\r\n /* because of Test FrmList 04 ... Entering should result in Db Null */\r\n if (valueToWriteBack === this.directHit.description) {\r\n valueToWriteBack = this.directHit.value\r\n } else {\r\n valueToWriteBack = this.directHit.value\r\n }\r\n this.directHit.value = undefined\r\n await this.FieldSetValueAndCheckFocus(field, valueToWriteBack, true)\r\n return true\r\n }\r\n }\r\n }\r\n return false\r\n }\r\n handleSearchKeyUp(e: KeyboardEvent) {\r\n if (e.key === \"ArrowDown\" || e.key === \"Enter\") {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n this.handleListPopupHelper(e)\r\n }\r\n }\r\n\r\n async handleInput(e: InputEvent) {\r\n let field = this.field\r\n let filterValue = this.inputElement.value\r\n\r\n await this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value: filterValue,\r\n isInnerEvent: true,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n _setFieldTouched(field, true)\r\n if (filterValue === \"\") {\r\n this.forceCloseLocalHitList()\r\n return\r\n }\r\n\r\n disableBodyScroll(true)\r\n if (field.list.showCachedHitsWhileTyping && !field.list.selectOnly) {\r\n //let hl = document.getElementById(\"ovl-hitlist\")\r\n field.list.filterValue = this.inputElement.value\r\n this.openLocalHitList()\r\n }\r\n }\r\n\r\n async handleKey(e: KeyboardEvent) {\r\n if (!e.key) {\r\n return\r\n }\r\n\r\n switch (e.key) {\r\n case \"ArrowDown\":\r\n if (!this.field.list.showCachedHitsWhileTyping) {\r\n this.handleListPopup(e, false)\r\n } else {\r\n if (!this.localList) {\r\n this.field.list.filterValue = \"\"\r\n this.openLocalHitList()\r\n }\r\n setTimeout(() => {\r\n if (this.localList) {\r\n // just focus inline list first value if there\r\n let focusEl = (\r\n document.getElementsByClassName(\"ovl-hitlist-row\")[0]\r\n )\r\n if (focusEl) {\r\n focusEl.focus()\r\n }\r\n }\r\n }, 100)\r\n }\r\n break\r\n case \"Escape\":\r\n this.forceCloseLocalHitList()\r\n return\r\n }\r\n }\r\n async getUI() {\r\n let visible = super.InitControl()\r\n if (visible === false) {\r\n return undefined\r\n }\r\n\r\n if (!this.field) {\r\n return\r\n }\r\n let field = this.field\r\n // read this one so we can force rerenders by toggling it...\r\n field.list.filterValue\r\n let displayValue = field.value\r\n if (!(FieldIsFocused(field) && field.touched)) {\r\n let formState = FormGet(field.formType, {\r\n instance: field.formId,\r\n }).formState\r\n\r\n if (formState && FieldIsValid(field)) {\r\n displayValue = getDisplayValue(\r\n field.fieldKey,\r\n { list: field.list, type: field.type, ui: field.ui },\r\n field.convertedValue,\r\n formState.feature,\r\n formState,\r\n formState?.tableDefId,\r\n field.list.displayField\r\n )\r\n }\r\n }\r\n if (displayValue === undefined) {\r\n displayValue = \"\"\r\n }\r\n let readOnly = this.getReadOnly()\r\n\r\n let icon = \"search\"\r\n if (field.list.mode === \"Select\") {\r\n icon = \"arrow-bottom\"\r\n }\r\n\r\n let control\r\n if (!field.list.selectOnly) {\r\n if (typeof displayValue === \"object\") {\r\n displayValue = field.convertedValue\r\n }\r\n control = html`\r\n this.handleKey(e)}\r\n @input=${(e) => this.handleInput(e)}\r\n @focus=${(e) => this.handleFocus(e)}\r\n ?readonly=${readOnly}\r\n />\r\n `\r\n } else {\r\n control = html` {\r\n // left mouse button?\r\n if (e.which === 1) {\r\n //_setFieldWatched(field, true)\r\n this.handleListPopupHelper(e)\r\n }\r\n }}\r\n @focus=${(e) => this.handleFocus(e)}\r\n placeholder=${ifDefined(\r\n this.field.ui.infoValue ? this.field.ui.infoValue : undefined\r\n )}\r\n tabindex=\"-1\"\r\n class=${`${this.getEditorClass()} fd-input fd-input-group__input ovl-cursor-pointer ovl-formcontrol-selectdisplay ovl-value__${\r\n field.fieldKey\r\n } ${readOnly ? \"ovl-disabled\" : \"ovl-focusable\"} ${\r\n field.ui.selectIfFocused === true ? \"ovl-focusselected\" : \"\"\r\n }`}\r\n id=${field.id}\r\n value=${displayValue}\r\n .value=${displayValue}\r\n >\r\n ${displayValue}\r\n `\r\n }\r\n\r\n return html`\r\n
    \r\n {\r\n await this.handleFocusOut(e)\r\n }}\r\n class=${`ovl-formcontrol-container ovl-container-listbox ovl-container__${\r\n field.fieldKey\r\n } ${this.getEditorClass()} ${\r\n this.customInfo.customRowClassContainerName\r\n }`}\r\n >\r\n this.field}> \r\n \r\n ${control}\r\n {\r\n if (e.which === 1) {\r\n this.handleListPopupHelper(e)\r\n }\r\n }}\r\n @keydown=${(e) => this.handleSearchKeyUp(e)}\r\n @focus=${(e) => this.handleGotFocusSearch(e)}\r\n id=${`search${field.id}`}\r\n class=${`${this.getEditorClass()} fd-input-group__addon sap-icon--${icon} ovl-formcontrol-input ovl-formcontrol-searchbutton ovl-formcontrol-searchbutton__${\r\n field.fieldKey\r\n } ${\r\n readOnly || ProcessIsRunning(\"SYSGetLookupData\")\r\n ? \"ovl-disabled\"\r\n : \"\"\r\n }`}\r\n role=\"presentation\"\r\n >\r\n
    \r\n\r\n ${this.localList}\r\n this.field}>\r\n \r\n this.field}>\r\n \r\n \r\n \r\n `\r\n }\r\n async afterRender() {\r\n this.inputElement = document.getElementById(this.field.id)\r\n await super.afterRender()\r\n }\r\n\r\n openLocalHitList() {\r\n let field = this.field\r\n this.localListState.open = true\r\n this.localList = html`\r\n {\r\n let listData: HookFieldGetList_ReturnType = _GetFieldList(\r\n this.actions.app.features[this.formState.feature].hooks[\r\n HookFieldGetList.replace(\r\n \"{subFeature}\",\r\n this.formState.subFeature\r\n ).replace(\"{fieldKey}\", field.fieldKey)\r\n ],\r\n field.fieldKey,\r\n this.formState,\r\n this.formState?.tableDefId,\r\n true,\r\n false\r\n )\r\n return {\r\n selectedFieldKey: undefined,\r\n fieldId: field.id,\r\n list: field.list,\r\n listData,\r\n\r\n filteredKeys: undefined,\r\n type: \"inline\",\r\n animation: true,\r\n selectedCallback: this.selectedCallback,\r\n field,\r\n directHit: this.directHit,\r\n }\r\n }}\r\n >\r\n `\r\n this.doRender()\r\n }\r\n\r\n forceCloseLocalHitList() {\r\n if (this.localList) {\r\n this.localList = null\r\n this.localListState.open = false\r\n\r\n // this forces a rerender\r\n this.doRender()\r\n\r\n enableBodyScroll()\r\n }\r\n }\r\n async disconnectedCallback() {\r\n if (this.debouncer) {\r\n clearTimeout(this.debouncer)\r\n this.debouncer = null\r\n }\r\n if (this.updatedDebouncer) {\r\n clearTimeout(this.updatedDebouncer)\r\n this.updatedDebouncer = null\r\n }\r\n this.localList = null\r\n this.localListState.open = false\r\n this.selectedCallback = null\r\n await super.disconnectedCallback()\r\n }\r\n}\r\n","import { html, ifDefined, unsafeHTML } from \"../../..\"\r\nimport type { HookFieldGetList_ReturnType } from \"../../../global/hooks\"\r\nimport { HookFieldGetList } from \"../../../global/hooks\"\r\n\r\nimport { _GetFieldList, getDisplayValue } from \"../../table/helpers\"\r\nimport { _setFieldFocus } from \"../helper\"\r\n\r\nimport { _focusOutHelper } from \"./helpers\"\r\nimport { SYSControlBase } from \"./syscontrolbase\"\r\n\r\nexport class SYSOption extends SYSControlBase {\r\n checkedElement: any\r\n handleChange(e: Event, value: any) {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n }\r\n async getUI() {\r\n let visible = super.InitControl()\r\n if (visible === false) {\r\n return undefined\r\n }\r\n\r\n let field = this.field\r\n\r\n let list = field.list\r\n let listFn = HookFieldGetList.replace(\r\n \"{subFeature}\",\r\n this.formState.subFeature\r\n ).replace(\"{fieldKey}\", field.fieldKey)\r\n\r\n let listData: HookFieldGetList_ReturnType = _GetFieldList(\r\n this.actions.app.features[this.formState.feature].hooks[listFn],\r\n field.fieldKey,\r\n this.formState,\r\n this.formState?.tableDefId,\r\n /* cachebust = true, because we do not have a trigger like in lists (there it gets busted eg. when user clicks on select button) \r\n . if one day it needs caching please reintroduce the timely cache but just for option list type (like 100ms)*/\r\n true\r\n ).data\r\n\r\n let inline = \"\"\r\n if (field.ui.option && field.ui.option.inline) {\r\n inline = \"fd-form-group--inline\"\r\n }\r\n\r\n return html`\r\n \r\n this.field}> \r\n\r\n _focusOutHelper(e, this.field)}\r\n >\r\n ${Object.keys(listData).map((rowKey) => {\r\n let val = getDisplayValue(\r\n field.fieldKey,\r\n { list: field.list, type: field.type, ui: field.ui },\r\n rowKey,\r\n this.formState.feature,\r\n this.formState,\r\n this.formState?.tableDefId,\r\n field.list.displayField\r\n ) //listData[rowKey][list.displayField]\r\n let id = `${field.id}${rowKey}`\r\n let checked =\r\n field.convertedValue === listData[rowKey][list.valueField]\r\n let readOnly = this.getReadOnly()\r\n return html`\r\n e.stopPropagation()}\r\n @focus=${() => _setFieldFocus(field, true)}\r\n @change=${(e) =>\r\n this.handleChange(e, listData[rowKey][list.valueField])}\r\n @focusout=${(e) => _setFieldFocus(field, false)}\r\n ?disabled=${readOnly}\r\n />\r\n \r\n ${unsafeHTML(val)}\r\n \r\n `\r\n })}\r\n \r\n\r\n this.field}>\r\n \r\n this.field}>\r\n \r\n \r\n `\r\n }\r\n // async afterRender() {\r\n // if (this.checkedElement) {\r\n // document.getElementById(this.checkedElement).checked = true\r\n // this.checkedElement = undefined\r\n // }\r\n // }\r\n}\r\n","import { html } from \"../../../../\"\r\nimport { SYSBaseElement } from \"../../../sysbaseelement\"\r\nimport type { SYSField } from \"../../actions\"\r\nimport { GetRowFromFormState, GetValueFromCustomFunction } from \"../helpers\"\r\n\r\nexport class SYSCustomValueHint extends SYSBaseElement {\r\n field: SYSField\r\n props: any\r\n\r\n async getUI() {\r\n let customValue\r\n this.field = this.props()\r\n this.field._state.visible\r\n let field = this.field\r\n if (\r\n field.hasFocus &&\r\n field.touched &&\r\n !field.ui.displayValueHintWhileTyping\r\n ) {\r\n return\r\n }\r\n let align = \"\"\r\n if (field.ui?.align) {\r\n align = field.ui.align\r\n }\r\n let formState = this.state.ovl.forms[field.formType][field.formId]\r\n if (!formState) {\r\n return null\r\n }\r\n\r\n customValue = GetValueFromCustomFunction(\r\n GetRowFromFormState(formState),\r\n field,\r\n formState,\r\n align,\r\n this.state\r\n )\r\n if (!customValue || customValue.length === 0) {\r\n return\r\n }\r\n // } else {\r\n // return html`
    `\r\n // }\r\n\r\n return html`\r\n \r\n ${customValue}\r\n \r\n `\r\n }\r\n}\r\n","import { html, ifDefined } from \"../../../../\"\r\nimport { SYSBaseElement } from \"../../../sysbaseelement\"\r\nimport { GetFieldLabel } from \"../helpers\"\r\n\r\nimport type { SYSField, SYSFormState } from \"../../actions\"\r\n\r\nexport class SYSControlLabel extends SYSBaseElement {\r\n field: SYSField\r\n props: any\r\n\r\n async init() {\r\n this.field = this.props()\r\n this.formState = (\r\n this.state.ovl.forms[this.field.formType][this.field.formId]\r\n )\r\n\r\n await super.init()\r\n }\r\n async getUI() {\r\n let formState = this.formState\r\n if (!formState) {\r\n return null\r\n }\r\n let field = formState.fields[this.field.fieldKey]\r\n if (field.ui.noLabel) {\r\n return null\r\n }\r\n let customHeaderCell\r\n if (formState._state._viewHeaderCell) {\r\n customHeaderCell = formState._state._viewHeaderCell[field.fieldKey]\r\n }\r\n let caption = \"\"\r\n if (field.ui.labelCaption) {\r\n caption = field.ui.labelCaption\r\n }\r\n let align = \"\"\r\n if (field.ui?.align) {\r\n align = `ovl-inputlabelalign-${field.ui.align}`\r\n }\r\n\r\n let customHeaderClassName = \"\"\r\n let customHeaderTooltip\r\n if (customHeaderCell) {\r\n customHeaderClassName = customHeaderCell.className\r\n customHeaderTooltip = customHeaderCell.tooltip\r\n }\r\n\r\n caption = GetFieldLabel(field, formState.feature, caption)\r\n //let formState: FormState = state.ovl.forms[field.formType][field.formId]\r\n\r\n let allValidation = field.validationResult.System.concat(\r\n field.validationResult.Validate\r\n ).concat(field.validationResult.ValueChanged)\r\n\r\n let hint =\r\n field.watched &&\r\n allValidation.filter((f) => f.translationKey.indexOf(\"Mandatory\") > -1)\r\n .length > 0\r\n ? \"fd-form-label--required\"\r\n : \"\"\r\n return html`\r\n ${caption}\r\n `\r\n }\r\n}\r\n","import { SYSConfig, html } from \"../../../../\"\r\nimport { FieldValidationTextGet } from \"../../../../../ovlsyscomponents/sysdefaulthtmlsnippets01\"\r\nimport {\r\n HookFieldValidationTextDisplay,\r\n HookFieldValidationTextDisplay_ReturnType,\r\n} from \"../../../../global/hooks\"\r\nimport { _RenderTracking } from \"../../../../tracker/tracker\"\r\n\r\nimport { SYSBaseElement } from \"../../../sysbaseelement\"\r\nimport type { SYSField } from \"../../actions\"\r\n\r\nexport class SYSValidationHint extends SYSBaseElement {\r\n field: SYSField\r\n props: any\r\n hookFieldValidationText: any\r\n async init() {\r\n this.field = this.props()\r\n this.hookFieldValidationText =\r\n this.actions.app.global.hooks?.[\r\n HookFieldValidationTextDisplay.replace(\r\n \"{subFeature}\",\r\n this.state.ovl.forms[this.field.formType][this.field.formId]\r\n .subFeature\r\n )\r\n ]\r\n await super.init()\r\n }\r\n async getUI() {\r\n let field = this.field\r\n // access visible is important if the underlying field got changed\r\n // usecase KaltAG LieferungWerkadresse -> Change to PLZ, -> Plz gets showed and has error. But when left this control doesn't show a hint\r\n // and accessing .visible fixes that\r\n // -> needs revisit after current tracking changes (05.24), maybe not necessary anymore\r\n\r\n field._state.visible\r\n let res\r\n let hasAlways\r\n let visibleErrors = field.validationResult.System.concat(\r\n field.validationResult.Validate\r\n )\r\n .concat(field.validationResult.ValueChanged)\r\n .filter((f) => {\r\n let isAlways = f.displayType === \"Always\"\r\n if (isAlways) {\r\n hasAlways = true\r\n }\r\n return isAlways || (f.displayType === \"WhenTouched\" && field.watched)\r\n })\r\n let hookRes: HookFieldValidationTextDisplay_ReturnType\r\n if (this.hookFieldValidationText) {\r\n let formState = this.state.ovl.forms[field.formType][field.formId]\r\n hookRes = this.hookFieldValidationText({\r\n field,\r\n formState,\r\n visibleErrors,\r\n })\r\n }\r\n if (hookRes === undefined || hookRes.resolve === \"UseDefault\") {\r\n res = FieldValidationTextGet(field, visibleErrors).res\r\n } else {\r\n res = hookRes.res\r\n }\r\n let hideclass = \"\"\r\n if (\r\n (field.hasFocus &&\r\n !hasAlways &&\r\n !SYSConfig.formDefaults.showErrorWhileTyping) ||\r\n field.inactive ||\r\n res.length === 0\r\n ) {\r\n hideclass = \"ovl-hideControl\"\r\n }\r\n return html`\r\n \r\n ${res}\r\n \r\n `\r\n }\r\n}\r\n","import { html } from \"../../../../\"\r\nimport { FocusSet } from \"../../../../global/globalapi\"\r\nimport { stringifyReplacer, T } from \"../../../../global/globals\"\r\nimport { _RenderTracking } from \"../../../../tracker/tracker\"\r\nimport { DialogIsOpen } from \"../../../dialog/dialogapi\"\r\nimport { SYSBaseElement } from \"../../../sysbaseelement\"\r\nimport { GetDisplayValueByType } from \"../../../table/helpers\"\r\nimport type { ListDefinition } from \"../../../table/table\"\r\nimport type { SYSField } from \"../../actions\"\r\nimport { DataType } from \"../../sysformelement\"\r\nimport { FilterHitList } from \"../helpers\"\r\nimport type { ListState } from \"../listcontrol\"\r\n\r\nexport type HitListState = {\r\n selectedFieldKey: string\r\n fieldId: string\r\n list: ListState\r\n listData: ListDefinition\r\n filterValue: string\r\n filteredKeys: string[]\r\n type: \"inline\" | \"overlay\"\r\n animation: boolean\r\n selectedCallback?: any\r\n // following fields are only used from inline mode\r\n field?: SYSField\r\n directHit?: { value: any; description: any }\r\n}\r\n\r\nexport class SYSHitList extends SYSBaseElement {\r\n props: any\r\n controlState: HitListState\r\n focusSet: boolean\r\n maxRow: number\r\n\r\n async init() {\r\n this.focusSet = false\r\n this.controlState = this.props(this.state)\r\n // read this one so its a dependency and we can force rerender by toggling it\r\n await super.init()\r\n }\r\n\r\n handleKeyDown(e: KeyboardEvent, rowKey: string) {\r\n if (e.key === \"Enter\") {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n this.controlState.selectedCallback(rowKey)\r\n //this.click()\r\n } else if (e.key === \"ArrowUp\" || (e.key === \"Tab\" && e.shiftKey)) {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n\r\n let previousEl = document.getElementById(\r\n //@ts-ignore\r\n e.target.id\r\n ).previousElementSibling\r\n if (previousEl) {\r\n //@ts-ignore\r\n previousEl.focus()\r\n } else {\r\n if (this.controlState.type === \"inline\") {\r\n this.controlState.selectedCallback(\"@@ovlcanceled\")\r\n }\r\n }\r\n } else if (e.key === \"ArrowDown\" || e.key === \"Tab\") {\r\n let dialogOpen = DialogIsOpen(\"SYSHitListDialog\")\r\n e.stopPropagation()\r\n if (!dialogOpen) {\r\n e.preventDefault()\r\n }\r\n //@ts-ignore\r\n let nextEl = document.getElementById(e.target.id).nextElementSibling\r\n\r\n if (nextEl) {\r\n e.preventDefault()\r\n //@ts-ignore\r\n nextEl.focus()\r\n } else {\r\n if (dialogOpen) {\r\n return\r\n }\r\n }\r\n }\r\n if (e.key === \"Tab\") {\r\n e.preventDefault()\r\n }\r\n }\r\n\r\n handleClick(e: Event, key: string) {\r\n //@ts-ignore\r\n this.controlState.selectedCallback(key)\r\n }\r\n\r\n handleMainKeyDown(e: KeyboardEvent) {\r\n e.stopPropagation()\r\n if (e.key === \"Escape\") {\r\n //if (this.controlState.type === \"overlay\") {\r\n this.controlState.selectedCallback(\"@@ovlcanceled\")\r\n //this.click()\r\n // } else {\r\n // this.controlState.selectedCallback(\"@@ovlescape\")\r\n //}\r\n }\r\n }\r\n\r\n async getUI() {\r\n let rowNr = 0\r\n let list = this.controlState.list\r\n let listData = this.controlState.listData\r\n let filterValue = list.filterValue\r\n let filteredKeys = this.controlState.filteredKeys\r\n\r\n let filterRes\r\n if (!filteredKeys) {\r\n let field = this.controlState.field\r\n let formState = this.state.ovl.forms[field.formType][field.formId]\r\n filterRes = FilterHitList(\r\n list,\r\n filterValue,\r\n formState,\r\n\r\n field.fieldKey,\r\n 10,\r\n false,\r\n this.controlState.type\r\n )\r\n\r\n filteredKeys = filterRes.filteredKeys\r\n this.controlState.directHit.value = filterRes.directValue\r\n this.controlState.directHit.description = filterRes.directDescription\r\n }\r\n\r\n if (filteredKeys.length === 0) {\r\n return null\r\n //filteredKeys = Object.keys(FieldCurrentList(this.controlState.field).data)\r\n }\r\n let animation = \"\"\r\n if (this.controlState.animation) {\r\n animation = \"animated fadeIn faster\"\r\n }\r\n let lookupTypes = listData.lookupDef\r\n if (!lookupTypes) {\r\n // get the types from the data and assume its text\r\n let keys = Object.keys(listData.data)\r\n if (keys.length > 0) {\r\n lookupTypes = Object.keys(listData.data[keys[0]]).reduce((val, k) => {\r\n val[k] = { type: \"text\" }\r\n return val\r\n }, {})\r\n }\r\n }\r\n // check if we should remove the valueField from the displayed list\r\n if (\r\n Object.keys(lookupTypes).length > 1 &&\r\n list.displayValueField !== undefined &&\r\n list.displayValueField === false\r\n ) {\r\n // we have to clone it in order to remove an entry...its proxified thats why\r\n lookupTypes = JSON.parse(JSON.stringify(lookupTypes), stringifyReplacer)\r\n delete lookupTypes[list.valueField]\r\n }\r\n\r\n // if they lookupTypes contains an order property sort by that\r\n // thats just in case serialisation and deserialisation doesn't keep order (which it does in my current tests with .NET6 Json.TEXT and Chrome at least)\r\n\r\n let lookupTypesKeys = Object.keys(lookupTypes) /*.filter(\r\n (f) =>\r\n lookupTypes[f].ignoreForSearch !== true &&\r\n lookupTypes[f].type !== \"html\"\r\n )*/\r\n\r\n if (lookupTypesKeys.some((f) => lookupTypes[f].order !== undefined)) {\r\n lookupTypesKeys = lookupTypesKeys.sort(\r\n (s1, s2) => (lookupTypes[s1].order, lookupTypes[s2].order)\r\n )\r\n }\r\n\r\n let thead\r\n if (this.controlState.type === \"overlay\") {\r\n if (\r\n lookupTypesKeys.length > 0 &&\r\n lookupTypesKeys.filter((f) => lookupTypes[f].translationKey).length > 0\r\n ) {\r\n thead = html`\r\n \r\n \r\n ${lookupTypesKeys.map((k) => {\r\n if (!lookupTypes[k].translationKey) {\r\n return html`
    `\r\n }\r\n let caption = \"\"\r\n if (lookupTypes[k].translationKey) {\r\n caption = T(lookupTypes[k].translationKey)\r\n } else {\r\n caption = k\r\n }\r\n\r\n return html`\r\n \r\n ${caption}\r\n \r\n `\r\n })}\r\n \r\n \r\n `\r\n } else {\r\n thead = html`\r\n \r\n `\r\n }\r\n }\r\n // it needs to be excact if we also accept non list values.\r\n // Elsewise if there is Option \"A\" and the user enters \"a\", \"A\" eventually will be selected whereas the user really wanted \"a\"\r\n let exact = false\r\n if (\r\n this.controlState.field &&\r\n this.controlState.field.list?.acceptOnlyListValues === false\r\n ) {\r\n exact = true\r\n }\r\n return html`\r\n this.handleMainKeyDown(e)}\r\n >\r\n \r\n ${thead}\r\n \r\n ${filteredKeys.map((rowKey) => {\r\n let row = listData.data[rowKey]\r\n rowNr++\r\n this.maxRow = rowNr\r\n return html`\r\n this.handleClick(e, rowKey)}\r\n id=${`${this.controlState.fieldId}${\r\n this.controlState.type\r\n }ovlhl_${CSS.escape(rowKey)}`}\r\n tabindex=\"0\"\r\n class=\"fd-table__row ovl-hitlist-row fd-table__row--hoverable\"\r\n @keydown=${(e) => this.handleKeyDown(e, rowKey)}\r\n >\r\n ${lookupTypesKeys.map((c) => {\r\n let rawVal = row[c]\r\n let val = rawVal\r\n let filterHit = false\r\n if (typeof rawVal !== \"object\") {\r\n val = GetDisplayValueByType(\r\n undefined,\r\n lookupTypes[c].type,\r\n rawVal\r\n )\r\n if (typeof val !== \"string\") {\r\n val = val.toString()\r\n }\r\n // let val = getDisplayValue(\r\n // c,\r\n // { type: lookupTypes[c].type, ui: {} },\r\n // row[c],\r\n // undefined\r\n // )\r\n\r\n if (c !== undefined) {\r\n let leftPart = \"\"\r\n let rightPart = \"\"\r\n // mark hits\r\n if (filterValue) {\r\n let _val = val\r\n let _filterValue = filterValue\r\n if (!exact) {\r\n _val = _val.toLowerCase()\r\n _filterValue = _filterValue.toLowerCase()\r\n }\r\n let i = _val.indexOf(_filterValue)\r\n if (i > -1) {\r\n leftPart = val.substring(0, i)\r\n rightPart = val.substring(i + filterValue.length)\r\n val = val.substring(i, i + filterValue.length)\r\n filterHit = true\r\n return html`\r\n \r\n `\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (!filterHit) {\r\n return html``\r\n }\r\n })}\r\n \r\n `\r\n })}\r\n \r\n
    \r\n ${leftPart}${val}${rightPart}\r\n ${val}
    \r\n \r\n `\r\n }\r\n async updated() {\r\n if (this.controlState.type !== \"inline\" && !this.focusSet) {\r\n this.focusSet = true\r\n let el\r\n if (\r\n this.controlState.list.mode !== \"Option\" &&\r\n this.controlState.selectedFieldKey !== undefined\r\n ) {\r\n el = document.getElementById(\r\n this.controlState.fieldId +\r\n this.controlState.type +\r\n \"ovlhl_\" +\r\n CSS.escape(this.controlState.selectedFieldKey)\r\n )\r\n }\r\n\r\n if (!el) {\r\n el = document.getElementsByClassName(\"ovl-hitlist-row\")[0]\r\n }\r\n FocusSet(el.id)\r\n }\r\n }\r\n}\r\n","import { html } from \"../../../../../\"\r\nimport { T } from \"../../../../../global/globals\"\r\nimport { HookFieldGetList } from \"../../../../../global/hooks\"\r\nimport type {\r\n HookFieldGetList_ReturnType,\r\n HookFieldGetList_Type,\r\n} from \"../../../../../global/hooks\"\r\nimport type { HitListDialogStateType } from \"../../../../../state\"\r\nimport type { _DialogHolderParams } from \"../../../../dialog/sysdialogholder\"\r\n\r\nimport { SYSBaseElement } from \"../../../../sysbaseelement\"\r\nimport { SnackAdd } from \"../../../../snackapi\"\r\nimport { _GetFieldList } from \"../../../../table/helpers\"\r\nimport type { SYSField, SYSFormState } from \"../../../actions\"\r\nimport { FilterHitList } from \"../../helpers\"\r\nimport { FieldIsValid } from \"../../../fieldapi\"\r\nimport { _setDialogVisible } from \"../../../helper\"\r\n\r\nlet lastNoEntriesMsg = 0\r\nexport class SYSHitListDialog extends SYSBaseElement {\r\n hitListDialogState: HitListDialogStateType\r\n\r\n field: SYSField\r\n\r\n async init() {\r\n this.hitListDialogState = this.state.ovl.libState.hitListDialogState\r\n this.formState =\r\n this.state.ovl.forms[this.hitListDialogState.formType][\r\n this.hitListDialogState.formId\r\n ]\r\n this.field = this.formState.fields[this.hitListDialogState.fieldKey]\r\n await super.init()\r\n }\r\n\r\n async getUI() {\r\n let formState = this.formState\r\n let field = this.field\r\n let filterValue = field.list.filterValue\r\n\r\n let filteredKeys = FilterHitList(\r\n field.list,\r\n filterValue,\r\n formState,\r\n field.fieldKey,\r\n undefined,\r\n true,\r\n \"overlay\"\r\n ).filteredKeys\r\n if (filteredKeys.length < 1) {\r\n setTimeout(() => {\r\n let instance =\r\n this.state.ovl.dialogs.SYSHitListDialog.instance[\"SYSHitListDialog\"]\r\n if (instance) {\r\n _setDialogVisible(false, instance)\r\n }\r\n let ts = new Date().getTime()\r\n if (ts - lastNoEntriesMsg > 2000) {\r\n lastNoEntriesMsg = ts\r\n SnackAdd(T(\"SYSNoMatchingEntriesFound\"), \"Warning\", 3000)\r\n document.getElementById(this.field.id).focus()\r\n }\r\n }, 0)\r\n return\r\n }\r\n let body = html`\r\n {\r\n let listData = _GetFieldList(\r\n this.actions.app.features[formState.feature].hooks[\r\n HookFieldGetList.replace(\r\n \"{subFeature}\",\r\n formState.subFeature\r\n ).replace(\"{fieldKey}\", field.fieldKey)\r\n ],\r\n field.fieldKey,\r\n formState,\r\n formState?.tableDefId,\r\n undefined,\r\n false\r\n )\r\n\r\n return {\r\n fieldId: field.id,\r\n list: field.list,\r\n listData,\r\n filterValue,\r\n filteredKeys,\r\n type: \"overlay\",\r\n selectedFieldKey: field.convertedValue,\r\n selectedCallback: this.hitListDialogState.selectedCallback,\r\n }\r\n }}\r\n >\r\n `\r\n\r\n let footer = html`\r\n \r\n this.hitListDialogState.selectedCallback(\"@@ovlcanceled\")}\r\n title=\"Abbrechen\"\r\n class=\"fd-button fd-button--negative\"\r\n >\r\n \r\n \r\n `\r\n\r\n let dialogHolderParams: _DialogHolderParams\r\n dialogHolderParams = {\r\n dialogParts: {\r\n customClass: () =>\r\n this.formState.tableDefId ? `__${this.formState.tableDefId}` : \"\",\r\n footer: () => footer,\r\n body: () => body,\r\n dismissedCallbackFn: (e) =>\r\n this.hitListDialogState.selectedCallback(\"@@ovlcanceled\"),\r\n },\r\n\r\n dialogType: \"SYSHitListDialog\",\r\n }\r\n return html``\r\n }\r\n async disconnectedCallback() {\r\n if (this.hitListDialogState?.selectedCallback) {\r\n this.hitListDialogState.selectedCallback = null\r\n }\r\n this.hitListDialogState = null\r\n await super.disconnectedCallback()\r\n }\r\n}\r\n","import { html } from \"../../../../\"\r\nimport type { SYSDialog } from \"../../../../index\"\r\nimport { T } from \"../../../../global/globals\"\r\nimport { SYSBaseElement } from \"../../../sysbaseelement\"\r\nimport type { SYSFormState } from \"../../actions\"\r\nimport { FormIsLocked, FormIsValid } from \"../../formapi\"\r\n\r\nexport type SYSOkCancelDeleteFooterType = {\r\n formState: SYSFormState\r\n okFn: (e: Event) => void\r\n cancelFn: (e: Event) => void\r\n deleteFn: (e: Event) => void\r\n dialog: SYSDialog\r\n dialogInstance?: any\r\n}\r\n\r\nexport class SYSOkCancelDeleteFooter extends SYSBaseElement {\r\n props: any\r\n controlState: SYSOkCancelDeleteFooterType\r\n async init() {\r\n this.controlState = this.props(this.state)\r\n if (!this.controlState.dialogInstance) {\r\n this.controlState.dialogInstance = this.controlState.dialog\r\n }\r\n this.formState = this.controlState.formState\r\n await super.init()\r\n }\r\n\r\n async getUI() {\r\n let accept\r\n let acceptClass = \"fd-button ovl-disabled\"\r\n let cancel\r\n let cancelClass = \"fd-button ovl-disabled\"\r\n let deleteBtnDisabled = false\r\n let dlg = this.controlState.dialog\r\n let dlgInstance = this.controlState.dialogInstance\r\n if (\r\n !this.formState.locked &&\r\n !(\r\n dlg &&\r\n (this.state.ovl.dialogs[dlg].instance[dlgInstance]?.disabled ||\r\n this.state.ovl.dialogs[dlg].instance[dlgInstance]?.closing)\r\n )\r\n ) {\r\n if (FormIsValid(this.formState)) {\r\n accept = html``\r\n acceptClass = \"fd-button fd-button--positive\"\r\n }\r\n if (\r\n !this.formState._state\r\n ._noCancelOnEditFormIfFormStateWasInvalidWhenOpened\r\n ) {\r\n cancel = html``\r\n cancelClass = \"fd-button fd-button--negative\"\r\n }\r\n }\r\n\r\n let deleteButton\r\n if (this.controlState.deleteFn) {\r\n deleteButton = html`
    \r\n {\r\n // we need to check FormIsLocked beacause if it gets touched on mobile it needs to do that (usecase b&k ggn tab out or click)\r\n\r\n if (!FormIsLocked(this.formState)) this.controlState.deleteFn(e)\r\n }}\r\n title=\"${T(\"SYSDelete\")}\"\r\n class=\"fd-button fd-button--negative\"\r\n >\r\n \r\n `\r\n }\r\n\r\n return html`\r\n {\r\n // we need to check FormIsLocked beacause if it gets touched on mobile it needs to do that (usecase b&k ggn tab out or click)\r\n\r\n if (!FormIsLocked(this.formState) && FormIsValid(this.formState))\r\n this.controlState.okFn(e)\r\n }}\r\n title=\"${T(\"SYSTableRowFnSave\")}\"\r\n class=\"${acceptClass}\"\r\n >\r\n ${accept}\r\n \r\n ${deleteButton}\r\n
    \r\n {\r\n if (!e.target.classList.contains(\"ovl-disabled\")) {\r\n if (!FormIsLocked(this.formState)) {\r\n await this.controlState.cancelFn(e)\r\n }\r\n }\r\n }}\r\n title=\"${T(\"SYSCancel\")}\"\r\n class=${cancelClass}\r\n >\r\n ${cancel}\r\n \r\n `\r\n }\r\n async disconnectedCallback() {\r\n this.controlState.cancelFn = null\r\n this.controlState.deleteFn = null\r\n this.controlState.okFn = null\r\n await super.disconnectedCallback()\r\n }\r\n}\r\n","import { html, ifDefined } from \"../../..\"\r\nimport { T } from \"../../../textapi\"\r\nimport { FieldIsDirty, FieldSetForceChange, FieldSetVal } from \"../fieldapi\"\r\n\r\nimport { _setFieldFocus } from \"../helper\"\r\nimport { _focusOutHelper } from \"./helpers\"\r\nimport { SYSControlBase } from \"./syscontrolbase\"\r\n\r\nexport class SYSTextArea extends SYSControlBase {\r\n async handleInput(e: KeyboardEvent) {\r\n this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value: this.inputElement.value,\r\n isInnerEvent: true,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n }\r\n // change is important for eg. autofilled form inputs\r\n handleChange(e: Event) {\r\n this.field._state.valueChangedHandled = true\r\n this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value: this.inputElement.value,\r\n isInnerEvent: false,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n }\r\n\r\n async getUI() {\r\n let visible = super.InitControl()\r\n if (visible === false) {\r\n return undefined\r\n }\r\n\r\n let field = this.field\r\n let readonly = this.getReadOnly()\r\n\r\n let nullClicker = html``\r\n let isNullInput = \"\"\r\n if (field.nullHandling.enabled && field.convertedValue !== null) {\r\n isNullInput = \"ovl-null-input\"\r\n nullClicker = html`\r\n FieldSetVal(field, null, { watched: true })}\r\n >
    \r\n `\r\n }\r\n\r\n return html`\r\n \r\n this.field}> \r\n
    \r\n this.handleInput(e)}\r\n @change=${(e) => this.handleChange(e)}\r\n @focusout=${(e) => {\r\n // see explanation on textbox. it should be the same there\r\n if (\r\n (!field._state.valueChangedHandled &&\r\n field._state.valueAfterGotFocus !== field.value) ||\r\n !field.previousValid\r\n ) {\r\n this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value: this.inputElement.value,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n }\r\n _focusOutHelper(e, this.field)\r\n }}\r\n @focus=${() => {\r\n this.field._state.valueAfterGotFocus = field.value\r\n this.field._state.valueChangedHandled = false\r\n _setFieldFocus(this.field, true)\r\n }}\r\n class=${`fd-textarea __inpfocbox ${this.getInputClass(\r\n \"textarea\",\r\n\r\n this.customInfo.customRowClassName\r\n )}`}\r\n id=${field.id}\r\n spellcheck=${`${field.ui.useSpellcheck ? \"true\" : \"false\"}`}\r\n ?readonly=${readonly}\r\n >\r\n ${nullClicker}\r\n
    \r\n\r\n this.field}>\r\n \r\n this.field}>\r\n \r\n \r\n `\r\n }\r\n async afterRender() {\r\n this.inputElement = document.getElementById(this.field.id)\r\n if (this.inputElement) {\r\n this.inputElement.value = this.field.value\r\n }\r\n await super.afterRender()\r\n }\r\n}\r\n","import { html, ifDefined } from \"../../..\"\r\nimport { isIOS, T } from \"../../../global/globals\"\r\nimport { SnackAdd } from \"../../snackapi\"\r\nimport { FieldSetVal } from \"../fieldapi\"\r\nimport { _setFieldFocus } from \"../helper\"\r\nimport { _focusOutHelper } from \"./helpers\"\r\nimport { SYSControlBase } from \"./syscontrolbase\"\r\n\r\nexport class SYSTextbox extends SYSControlBase {\r\n // change is important for eg. autofilled form inputs\r\n handleChange(e: Event) {\r\n this.field._state.valueChangedHandled = true\r\n this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value: this.inputElement.value,\r\n isInnerEvent: false,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n }\r\n\r\n async handleInput(e: KeyboardEvent) {\r\n // we need to manually set dirty here\r\n // because change event foes not work when achanging from \"\" to null\r\n\r\n this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value: this.inputElement.value,\r\n isInnerEvent: true,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n }\r\n\r\n async getUI() {\r\n let visible = super.InitControl()\r\n if (visible === false) {\r\n return undefined\r\n }\r\n let field = this.field\r\n let readonly = this.getReadOnly()\r\n let pattern\r\n let inputMode: any = \"text\"\r\n if (field.type === \"decimal\") {\r\n inputMode = \"decimal\"\r\n if (isIOS()) {\r\n pattern = \"\\\\d*\"\r\n }\r\n } else if (field.type === \"int\") {\r\n inputMode = \"numeric\"\r\n if (isIOS()) {\r\n pattern = \"[0-9]*\"\r\n }\r\n }\r\n let type = \"text\"\r\n if (field.ui && field.ui.isPassword) {\r\n type = \"password\"\r\n }\r\n // this shouldn't be necessary\r\n // if (isIOS() && (field.type === \"decimal\" || field.type === \"int\")) {\r\n // console.log(\"Set to number\")\r\n // type = \"number\"\r\n // }\r\n\r\n let nullClicker = html``\r\n let isNullInput = \"\"\r\n if (field.nullHandling.enabled && field.convertedValue !== null) {\r\n isNullInput = \"ovl-null-input\"\r\n nullClicker = html`\r\n {\r\n e.stopPropagation()\r\n FieldSetVal(field, null, { watched: true })\r\n }}\r\n >\r\n `\r\n }\r\n\r\n let value = this.getHookValue()\r\n if (!field.editor) {\r\n value = html`\r\n {\r\n // because change event does not work when changing from \"\" to null\r\n // but if a changed was already fired before we set the handled to true so it doesn't fire again\r\n // but we should also call (fire) changefield if the field was not valid before.\r\n // because it could be set with Context \"Validate\" by a ValueChanged hook.\r\n // (it could run into the FormChanged Hook clearing validations which it shouldn't)\r\n if (\r\n (!field._state.valueChangedHandled &&\r\n field._state.valueAfterGotFocus !== field.value) ||\r\n !field.previousValid\r\n ) {\r\n this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value: this.inputElement.value,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n }\r\n _focusOutHelper(e, this.field)\r\n }}\r\n @focus=${() => {\r\n this.field._state.valueAfterGotFocus = field.value\r\n this.field._state.valueChangedHandled = false\r\n _setFieldFocus(this.field, true)\r\n }}\r\n placeholder=${ifDefined(\r\n this.field.ui.infoValue ? this.field.ui.infoValue : undefined\r\n )}\r\n @input=${(e) => this.handleInput(e)}\r\n @change=${(e) => this.handleChange(e)}\r\n autocomplete=${field.ui.autocomplete}\r\n name=\"${field.ui.autocomplete !== \"off\"\r\n ? field.ui.autocomplete\r\n : this.field.fieldKey}\"\r\n spellcheck=${field.ui.useSpellcheck ? \"true\" : \"false\"}\r\n inputmode=${inputMode}\r\n pattern=${ifDefined(pattern)}\r\n ?readonly=${readonly}\r\n class=${`fd-input __inpfocbox ${this.getInputClass(\r\n \"textbox\",\r\n\r\n this.customInfo.customRowClassName\r\n )}`}\r\n type=${type}\r\n id=${field.id}\r\n value=${field.value}\r\n />\r\n `\r\n } else {\r\n value = html` {\r\n _focusOutHelper(e, this.field)\r\n }}\r\n @focus=${() => {\r\n _setFieldFocus(this.field, true)\r\n }}\r\n id=${field.id}\r\n ?readonly=${readonly}\r\n tabindex=\"0\"\r\n class=${`fd-input ovledit-value __inpfocbox ${this.getInputClass(\r\n \"textbox\",\r\n\r\n this.customInfo.customRowClassName\r\n )}`}\r\n >\r\n ${value}\r\n `\r\n }\r\n\r\n return html`\r\n \r\n this.field}> \r\n
    \r\n ${value} ${nullClicker}\r\n
    \r\n\r\n this.field}>\r\n \r\n this.field}>\r\n \r\n \r\n `\r\n }\r\n async afterRender() {\r\n this.inputElement = document.getElementById(this.field.id)\r\n if (!isIOS() && this.inputElement) {\r\n this.inputElement.value = this.field.value\r\n }\r\n await super.afterRender()\r\n }\r\n async disconnectedCallback() {\r\n this.inputElement = null\r\n await super.disconnectedCallback()\r\n }\r\n}\r\n","import { html, ifDefined } from \"../../../\"\r\nimport { SYSControlBase } from \"./syscontrolbase\"\r\nimport { isMobile } from \"../../../global/globals\"\r\nimport { _setFieldFocus } from \"../helper\"\r\nimport { _focusOutHelper } from \"./helpers\"\r\n\r\nexport class SYSTime extends SYSControlBase {\r\n async init() {\r\n if (isMobile()) {\r\n this.addEventListener(\"input\", this.handleChange)\r\n } else {\r\n this.addEventListener(\"change\", this.handleChange)\r\n }\r\n await super.init()\r\n }\r\n\r\n handleChange(e: Event) {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n this.actions.ovl.form._ChangeField({\r\n fieldKey: this.field.fieldKey,\r\n formState: this.formState,\r\n value: this.inputElement.value,\r\n watched: true,\r\n noRetrigger: true,\r\n })\r\n }\r\n async getUI() {\r\n let visible = super.InitControl()\r\n if (visible === false) {\r\n return undefined\r\n }\r\n\r\n let field = this.field\r\n let readonly = this.getReadOnly()\r\n type TimeBoxType = \"text\" | \"time\"\r\n let type: TimeBoxType = \"text\"\r\n if (isMobile()) {\r\n type = \"time\"\r\n }\r\n return html`\r\n \r\n this.field}> \r\n\r\n _focusOutHelper(e, this.field)}\r\n @focus=${() => _setFieldFocus(this.field, true)}\r\n autocomplete=\"off\"\r\n spellcheck=\"false\"\r\n class=${`ovl-formcontrol-value fd-input __inpfocbox ${this.getInputClass(\r\n \"time\",\r\n\r\n this.customInfo.customRowClassName\r\n )}`}\r\n type=${type}\r\n id=${field.id}\r\n value=${field.value}\r\n ?readonly=${readonly}\r\n />\r\n \r\n this.field}>\r\n \r\n this.field}>\r\n \r\n `\r\n }\r\n async afterRender() {\r\n this.inputElement = document.getElementById(this.field.id)\r\n if (this.inputElement) {\r\n this.inputElement.value = this.field.value\r\n }\r\n await super.afterRender()\r\n }\r\n async disconnectedCallback() {\r\n if (isMobile()) {\r\n this.removeEventListener(\"input\", this.handleChange)\r\n } else {\r\n this.removeEventListener(\"change\", this.handleChange)\r\n }\r\n await super.disconnectedCallback()\r\n }\r\n}\r\n","import { html, TemplateResult } from \"lit-html\"\r\nimport { currentScreenAndDialog, repeat } from \"../../..\"\r\nimport {\r\n HookDialogActivate,\r\n HookDialogActivate_Type,\r\n} from \"../../../global/hooks\"\r\nimport { DialogsState } from \"../../dialog/sysdialogbase\"\r\nimport { SYSBaseElement } from \"../../sysbaseelement\"\r\n\r\nexport class SYSDialogContainer extends SYSBaseElement {\r\n async getUI() {\r\n this.state.ovl.screens.nav.dialogCounter\r\n let dialogKeys = Object.keys(currentScreenAndDialog.dialogs)\r\n let res = await repeat(\r\n dialogKeys,\r\n (k) => k,\r\n (k) => {\r\n if (k === dialogKeys[dialogKeys.length - 1]) {\r\n // call the Dialog Activate Hook\r\n let dialogAndInstance = k.split(\"@@Ovl\")\r\n let dialog = dialogAndInstance[0]\r\n let instance = dialogAndInstance[1]\r\n let dialogState: DialogsState =\r\n this.state.ovl.dialogs[dialog].instance[instance]\r\n let fnName = HookDialogActivate\r\n let fn = this.actions.app.global.hooks?.[fnName]\r\n if (fn) {\r\n fn({\r\n dialog: k,\r\n dialogState,\r\n dialogInstance: instance,\r\n })\r\n }\r\n }\r\n return html`${currentScreenAndDialog.dialogs[k]}`\r\n }\r\n )\r\n\r\n //resumeTracking()\r\n return res\r\n }\r\n}\r\n","import { html, TemplateResult } from \"lit-html\"\r\nimport { currentScreenAndDialog } from \"../../..\"\r\nimport { SYSBaseElement } from \"../../sysbaseelement\"\r\nimport { startTrack } from \"../../../tracker/tracker\"\r\n\r\nexport class SYSScreenContainer extends SYSBaseElement {\r\n async getUI() {\r\n startTrack(this)\r\n this.state.ovl.screens.nav.screenCounter\r\n return currentScreenAndDialog.screens.map((r) => {\r\n return html`${r}`\r\n })\r\n }\r\n}\r\n","import {\r\n DirectiveResult,\r\n SYSLongRunningProcess,\r\n TemplateResult,\r\n html,\r\n ifDefined,\r\n render,\r\n unsafeHTML,\r\n} from \"../../\"\r\nimport { FeatureInfo } from \"../../global/globalapi\"\r\nimport { _HasPermission, isMobile, T } from \"../../global/globals\"\r\nimport {\r\n HookTablePrepareFn,\r\n HookTableFn,\r\n HookTableRowAttributesGetAttributes,\r\n HookTableRowAttributeGetProperties,\r\n HookTableRowAttributesGetAllAttributes,\r\n HookTableRowFnCan,\r\n HookFieldGetLabelRender,\r\n} from \"../../global/hooks\"\r\n\r\nimport type {\r\n FormFnCan_Visibility,\r\n HookTablePrepareFn_ReturnType,\r\n HookTablePrepareFn_Type,\r\n HookTableFn_Type,\r\n HookTableRowAttributesGetAttributes_Type,\r\n HookTableRowAttributeGetProperties_Type,\r\n HookTableRowAttributeGetProperties_ReturnType,\r\n HookTableRowAttributesGetAllAttributes_Type,\r\n HookTableRowAttributesGetAttributes_ReturnType,\r\n HookTableRowFnCan_Type,\r\n HookFieldGetLabelRender_Type,\r\n} from \"../../global/hooks\"\r\n\r\nimport { DialogClose } from \"../dialog/dialogapi\"\r\nimport type { _DialogHolderParams } from \"../dialog/sysdialogholder\"\r\nimport { ProcessIsRunning } from \"../longrunningprocesstracker/processapi\"\r\nimport { SYSBaseElement } from \"../sysbaseelement\"\r\nimport {\r\n _GetEntityNameMulti,\r\n _GetRowFnToSet,\r\n _RowFnCanToSet,\r\n _TableFilterFn,\r\n _tableRowFnSetHelper,\r\n GetRendererFn,\r\n} from \"./helpers\"\r\nimport type { NavDef } from \"./navcontrol\"\r\nimport {\r\n DisplayMode,\r\n cachedRendererFn,\r\n type ColumnAction,\r\n type ColumnFilter,\r\n type OvlSysColumn,\r\n type TableDataAndDef,\r\n type _ColumnFnDefType,\r\n} from \"./table\"\r\nimport {\r\n TableAttributeFilter,\r\n TableColumnSort,\r\n TableCustomColumnFn,\r\n TableCustomFilter,\r\n TableCustomSort,\r\n TableFilter,\r\n TableFilterSelected,\r\n TableGet,\r\n TableRebuild,\r\n TableRowFnExecute,\r\n TableSelectAll,\r\n} from \"./tableapi\"\r\nimport { columnFilter } from \"./tablerowheadermenu/tablesettings/columnfilter/state\"\r\nimport { _GetFilterSortPermission } from \"./tablerowheadermenu/tablesettings/helpers\"\r\n\r\nexport type HeaderMenuDef = {\r\n def: TableDataAndDef\r\n instance: string\r\n}\r\n\r\ntype _columnAction = ColumnAction & {\r\n visualGroup: string\r\n}\r\n\r\nexport class SYSTableHeaderMenu extends SYSBaseElement {\r\n props: any\r\n headerMenu: HeaderMenuDef\r\n //lastTemplateResult: TemplateResult\r\n filterDef: ColumnFilter\r\n tableFnHook: any\r\n hooksFn: any\r\n selectedColumn: string\r\n\r\n handleTableFnHook = (tableFnParam: HookTableFn_Type): boolean => {\r\n if (this.tableFnHook) {\r\n return this.tableFnHook(tableFnParam)\r\n } else {\r\n return true\r\n }\r\n }\r\n\r\n handleSortClick = async (e: Event, key: string, ascending: boolean) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n\r\n await TableColumnSort(this.headerMenu.def.def.id, {\r\n columnKey: key,\r\n sortByRawValue: this.headerMenu.def.def.columns[key].ui.sortByValue,\r\n sortOrder: ascending ? \"asc\" : \"desc\",\r\n })\r\n }\r\n\r\n closeHeaderMenu = () => {\r\n DialogClose(\"SYSTableHeaderMenu\", { instance: this.headerMenu.instance })\r\n }\r\n\r\n handleFilterSetClick = async (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n\r\n //@ts-ignore\r\n let val: string = e.target.parentElement.previousElementSibling.value\r\n await TableFilter(this.headerMenu.def.def.id, { filterValue: val })\r\n }\r\n\r\n handleFilterChange = async (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n\r\n //@ts-ignore\r\n let val: string = e.target.value\r\n if (this.headerMenu.def.def.options.initial_filter.trimValue) {\r\n val = val.trim()\r\n //@ts-ignore\r\n e.target.value = val\r\n }\r\n await TableFilter(this.headerMenu.def.def.id, { filterValue: val })\r\n }\r\n\r\n handleFilterUnSetClick = async (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n\r\n await TableFilter(this.headerMenu.def.def.id, { filterValue: \"\" })\r\n }\r\n\r\n handleFilterSelectedClick = async (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n await TableFilterSelected(this.headerMenu.def.def.id)\r\n }\r\n\r\n handleCustomColumnFunctionClick = async (e: Event, key: string) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n\r\n await TableCustomColumnFn(this.headerMenu.def.def.id, {\r\n key,\r\n _innerEvent: true,\r\n })\r\n }\r\n\r\n handleCustomSelectedClick = async (\r\n e: Event,\r\n key: string,\r\n validKeys: string[]\r\n ) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n this.closeHeaderMenu()\r\n this.actions.ovl.internal._TableMultipleCustomFunction({\r\n customFnId: key,\r\n def: this.headerMenu.def.def,\r\n data: this.headerMenu.def.data,\r\n validKeys,\r\n })\r\n }\r\n\r\n handleFilterTextEnter = async (e: KeyboardEvent) => {\r\n //@ts-ignore\r\n if (e.key === \"Enter\") {\r\n // @ts-ignore\r\n let val = e.target.value\r\n\r\n await TableFilter(this.headerMenu.def.def.id, { filterValue: val })\r\n }\r\n }\r\n\r\n handleSortByFeedbackClick = async (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n this.headerMenu.def.def.uiState.sort.byFeedback =\r\n !!!this.headerMenu.def.def.uiState.sort.byFeedback\r\n TableRebuild(this.headerMenu.def.def.id, { showProcess: true })\r\n }\r\n\r\n handleAddRowClick = async (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n let addRow = await this.actions.ovl.table._TableAddRow({\r\n data: this.headerMenu.def.data,\r\n def: this.headerMenu.def.def,\r\n })\r\n await this.actions.ovl.table._TableEditRow({\r\n data: this.headerMenu.def.data,\r\n def: this.headerMenu.def.def,\r\n key: addRow.key,\r\n initialFocusFieldKey: addRow.fieldKeyToFocus,\r\n })\r\n this.closeHeaderMenu()\r\n }\r\n\r\n handleSelectAllClick = async (e: Event, select: boolean) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n await TableSelectAll(this.headerMenu.def.def.id, { select })\r\n }\r\n\r\n handleCloseHeaderMenu = (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n this.closeHeaderMenu()\r\n }\r\n\r\n handleDelete = async (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n this.closeHeaderMenu()\r\n this.actions.ovl.internal._TableMultipleCustomFunction({\r\n def: this.headerMenu.def.def,\r\n data: this.headerMenu.def.data,\r\n customFnId: \"OvlDelete\",\r\n })\r\n }\r\n\r\n // handleCopy = async (e: Event) => {\r\n // e.stopPropagation()\r\n // e.preventDefault()\r\n // this.closeHeaderMenu()\r\n // this.actions.ovl.internal._TableMultipleCopyRow({\r\n // def: this.headerMenu.def.def,\r\n // data: this.headerMenu.def.data,\r\n // })\r\n // }\r\n\r\n handleEdit = async (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n this.closeHeaderMenu()\r\n this.actions.ovl.internal._TableMultipleEditRow({\r\n def: this.headerMenu.def.def,\r\n data: this.headerMenu.def.data,\r\n })\r\n }\r\n handleRefreshTableClick = (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n this.closeHeaderMenu()\r\n TableRebuild(this.headerMenu.def.def.id, { showProcess: true })\r\n }\r\n\r\n handleCustomSortClick = async (e: Event, key: string) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n e.stopImmediatePropagation()\r\n\r\n await TableCustomSort(this.headerMenu.def.def.id, { key })\r\n }\r\n\r\n handleCustomFilterClick = async (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n\r\n //@ts-ignore\r\n let id = e.target.id.split(\"_\")[1]\r\n if (!id) {\r\n //@ts-ignore\r\n id = e.target.parentElement.id.split(\"_\")[1]\r\n }\r\n if (\r\n await TableCustomFilter(\r\n this.headerMenu.def.def.id,\r\n id,\r\n !this.headerMenu.def.def.uiState.filter.filterCustom[id].active,\r\n { _innerEvent: true }\r\n )\r\n ) {\r\n await TableRebuild(this.headerMenu.def.def.id, { showProcess: true })\r\n }\r\n }\r\n\r\n handleAttributesFilterClick = async (\r\n e: Event,\r\n defKey: string,\r\n attributeKey: string\r\n ) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n if (\r\n await TableAttributeFilter(\r\n this.headerMenu.def.def.id,\r\n defKey,\r\n attributeKey,\r\n !this.headerMenu.def.def.uiState.filter.filterAttributes?.[defKey]\r\n ?.attributes?.[attributeKey],\r\n\r\n { _innerEvent: true }\r\n )\r\n ) {\r\n await TableRebuild(this.headerMenu.def.def.id, { showProcess: true })\r\n }\r\n }\r\n\r\n async init() {\r\n this.headerMenu = this.props()\r\n\r\n if (this.actions.app.features[this.headerMenu.def.def.feature]) {\r\n this.tableFnHook =\r\n this.actions.app.features[this.headerMenu.def.def.feature].hooks[\r\n HookTableFn\r\n ]\r\n this.hooksFn =\r\n this.actions.app.features[this.headerMenu.def.def.feature].hooks\r\n }\r\n this.selectedColumn = this.headerMenu.def.def.uiState.headerSelected\r\n await super.init()\r\n }\r\n getBody = async () => {\r\n // await new Promise((r) => setTimeout(r, 2000))\r\n // return html`Lala`\r\n\r\n let def = this.headerMenu.def.def\r\n let columns = def.columns\r\n let selectedColumn = this.selectedColumn\r\n let selectedFunctions\r\n let ascendingDisabled = \"\"\r\n let descendingDisabled = \"\"\r\n let filterSortPermissions = _GetFilterSortPermission(def.id)\r\n\r\n let customFnHook =\r\n this.actions.app.features?.[def.feature]?.hooks?.[HookTablePrepareFn]\r\n let customFnHookResult: HookTablePrepareFn_ReturnType\r\n\r\n let headerMenuFilter\r\n if (\r\n def.uiState.filter.columns?.[selectedColumn]?.columnFilter ||\r\n def.columns[selectedColumn]?.filter.rangeFilter\r\n ) {\r\n headerMenuFilter = html``\r\n }\r\n\r\n if (\r\n selectedColumn === def.uiState.sort.sort.field &&\r\n !def.uiState.sort.sortCustom.selected\r\n ) {\r\n if (def.uiState.sort.sort.direction === \"asc\") {\r\n ascendingDisabled = \"ovl-menu-disabled\"\r\n }\r\n if (def.uiState.sort.sort.direction === \"desc\") {\r\n descendingDisabled = \"ovl-menu-disabled\"\r\n }\r\n }\r\n let table = TableGet(this.headerMenu.def.def.id)\r\n let selectedKeys = table.getKeys({ byKeys: \"Selected\" })\r\n let selectedCount = selectedKeys.length\r\n\r\n let columnFunctions\r\n let customColumnSelectedFunctions\r\n if (this.selectedColumn !== \"\") {\r\n let sortingFunctions\r\n if (columns[this.selectedColumn].sortable) {\r\n sortingFunctions = html`\r\n \r\n {\r\n if (!ascendingDisabled) {\r\n this.handleSortClick(e, this.selectedColumn, true)\r\n }\r\n }}\r\n >\r\n \r\n ${T(\"SYSTableSortAscending\")}
    \r\n \r\n \r\n {\r\n if (!descendingDisabled) {\r\n this.handleSortClick(e, this.selectedColumn, false)\r\n }\r\n }}\r\n >\r\n \r\n ${T(\"SYSTableSortDescending\")}\r\n \r\n `\r\n }\r\n\r\n // only use those which re not dependend on selected rows\r\n\r\n let customColumnFunctions = await this.getColumnFunctionHtml(\r\n def.options.customColumnActions,\r\n selectedColumn,\r\n customFnHook,\r\n selectedCount > 0,\r\n false,\r\n def.id\r\n )\r\n customColumnSelectedFunctions = await this.getColumnFunctionHtml(\r\n def.options.customColumnActions,\r\n selectedColumn,\r\n customFnHook,\r\n selectedCount > 0,\r\n true,\r\n def.id\r\n )\r\n let resultingColumnCaption\r\n let columncaption\r\n\r\n if (sortingFunctions || customColumnFunctions || headerMenuFilter) {\r\n let column = columns[this.selectedColumn]\r\n // if tranlsationPrefix then use prefix plus key\r\n if (column.ui && column.ui.labelTranslationKey) {\r\n columncaption = T(column.ui.labelTranslationKey)\r\n } else if (\r\n def.options.labelAndColumnTitleHandling?.translationPrefix !==\r\n undefined\r\n ) {\r\n columncaption = T(\r\n `${def.options.labelAndColumnTitleHandling.translationPrefix}${this.selectedColumn}`\r\n )\r\n }\r\n if (!columncaption) {\r\n columncaption = this.selectedColumn\r\n }\r\n resultingColumnCaption = columncaption\r\n // check for custom header renderer\r\n let rendererFn = GetRendererFn(\r\n def.feature,\r\n cachedRendererFn,\r\n HookFieldGetLabelRender.replace(\"{subFeature}\", \"\"),\r\n this.selectedColumn\r\n )\r\n\r\n if (rendererFn) {\r\n let rendererRes = rendererFn({\r\n columnKey: this.selectedColumn,\r\n caption: columncaption,\r\n align: undefined,\r\n displayMode: \"HeaderMenu\",\r\n })\r\n if (rendererRes?.res) {\r\n columncaption = rendererRes.res\r\n // lil hack to get the html for headermenu label with icon and whatever html display\r\n if (typeof columncaption === \"object\") {\r\n const container = document.createElement(\"div\")\r\n render(html`${columncaption}`, container)\r\n resultingColumnCaption = container.innerHTML\r\n } else {\r\n resultingColumnCaption = rendererRes.res\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (headerMenuFilter || sortingFunctions || customColumnFunctions) {\r\n columnFunctions = html`\r\n
    \r\n ${unsafeHTML(\r\n T(\r\n \"SYSHeaderMenuSelectedColumnFunctionsTitle\",\r\n resultingColumnCaption\r\n )\r\n )}\r\n
    \r\n \r\n ${headerMenuFilter}\r\n \r\n \r\n ${sortingFunctions}\r\n \r\n ${customColumnFunctions}\r\n
    \r\n
    \r\n `\r\n }\r\n }\r\n\r\n if (def.features.multiSelect) {\r\n if (selectedCount > 0) {\r\n let filterSelectedRows\r\n if (def.features.multiFilter) {\r\n if (\r\n !def.uiState.filter.filter.showSelected &&\r\n selectedCount !== def.uiState.rowsCount\r\n ) {\r\n filterSelectedRows = html`\r\n
  • \r\n this.handleFilterSelectedClick(e)}\r\n >\r\n \r\n ${T(\"SYSHeaderMenuEnableFilterSelectedRows\")}\r\n
  • \r\n `\r\n } else if (def.uiState.filter.filter.showSelected) {\r\n filterSelectedRows = html`\r\n
  • \r\n this.handleFilterSelectedClick(e)}\r\n >\r\n \r\n ${T(\"SYSHeaderMenuDisableFilterFilterSelectedRows\")}\r\n
  • \r\n `\r\n }\r\n }\r\n\r\n // custom fns are also capable to be used in selection\r\n let customFns = def.options.customRowActions\r\n\r\n let rowControlActionsTemplate: _RowFnCanToSet = _GetRowFnToSet(def)\r\n let fnToValidKeys = {}\r\n let fn = this.actions.app.features[def.feature]\r\n let functionName = HookTableRowFnCan\r\n // do the rowFn Validation for every row and save an optimized fn to validKeys result which can be handed over to multiplefn\r\n let data = this.headerMenu.def.data\r\n let rowControlActionsDistinct: _RowFnCanToSet = JSON.parse(\r\n JSON.stringify(rowControlActionsTemplate)\r\n )\r\n let first = true\r\n for (let z = 0; z < selectedKeys.length; z++) {\r\n let key = selectedKeys[z]\r\n let rowControlActions: _RowFnCanToSet = JSON.parse(\r\n JSON.stringify(rowControlActionsTemplate)\r\n )\r\n if (fn?.hooks?.[functionName]) {\r\n await fn.hooks[functionName]({\r\n _functionsToSet: rowControlActions,\r\n rowKey: key,\r\n tableDef: def,\r\n tableData: data,\r\n row: data.data[key],\r\n set: (fnKey: string | string[], options: {}) => {\r\n _tableRowFnSetHelper(fnKey, options, rowControlActions)\r\n },\r\n } as HookTableRowFnCan_Type)\r\n }\r\n\r\n Object.keys(rowControlActions)\r\n .filter(\r\n (f) =>\r\n // todo: undefined may be removed. it's here form some older compatibility where this hook was called and when returned undefined was ok\r\n rowControlActions[f].visibility === undefined ||\r\n rowControlActions[f].visibility === \"Visible\"\r\n )\r\n .filter((f) => {\r\n if (first) {\r\n rowControlActionsDistinct[f] = rowControlActions[f]\r\n // if they differentiate by hook rowfncan properties they are not valid for rowfn\r\n // eg. in klt we can toggle if an quotation should be enabled for email\r\n // it has different icons to visualise that\r\n // so they should not be executed together\r\n return true\r\n }\r\n if (\r\n JSON.stringify(rowControlActionsDistinct[f]) !==\r\n JSON.stringify(rowControlActions[f])\r\n ) {\r\n return false\r\n }\r\n return true\r\n })\r\n .reduce((val, k) => {\r\n if (!val[k]) {\r\n val[k] = []\r\n }\r\n val[k].push(key)\r\n return val\r\n }, fnToValidKeys)\r\n first = false\r\n }\r\n console.log(rowControlActionsDistinct)\r\n let atLeastOneMultiProcessRunning\r\n let groups = Object.keys(customFns)\r\n .filter((f) => fnToValidKeys[f])\r\n .reduce((val, k) => {\r\n if (!atLeastOneMultiProcessRunning) {\r\n atLeastOneMultiProcessRunning =\r\n customFns[k].process !== \"None\" &&\r\n ProcessIsRunning(\r\n customFns[k].process,\r\n `${def.id}_OvlSep_${k}_OvlSep_Multi`\r\n )\r\n }\r\n\r\n if (customFns[k].whenMultiple) {\r\n val[customFns[k].visualGroup] = true\r\n }\r\n return val\r\n }, {})\r\n let customSelectedRowFunctions = Object.keys(groups).map((m) => {\r\n return html` \r\n ${Object.keys(customFns)\r\n .filter(\r\n (k) =>\r\n customFns[k].mode.indexOf(\"Row\") > -1 &&\r\n fnToValidKeys[k] &&\r\n customFns[k].whenMultiple &&\r\n customFns[k].visualGroup === m\r\n )\r\n .map((k) => {\r\n let customFn = customFns[k]\r\n let translationKey = customFn.translationKey\r\n let multiTranslationKey = `${translationKey}Multi`\r\n if (this.state.ovl.language.translations[multiTranslationKey]) {\r\n translationKey = multiTranslationKey\r\n }\r\n let fnMultipleName = T(translationKey)\r\n\r\n if (!fnMultipleName) {\r\n fnMultipleName = k\r\n }\r\n let icon = \"fd-list__icon sap-icon--wrench\"\r\n if (rowControlActionsDistinct[k].icon !== undefined) {\r\n icon = \"fd-list__icon \" + rowControlActionsDistinct[k].icon\r\n } else if (customFn.icon) {\r\n icon = \"fd-list__icon \" + customFn.icon\r\n }\r\n\r\n let customClass = \"\"\r\n if (rowControlActionsDistinct[k].customClass !== undefined) {\r\n customClass = rowControlActionsDistinct[k].customClass\r\n }\r\n return html`\r\n \r\n {\r\n if (!atLeastOneMultiProcessRunning) {\r\n this.handleCustomSelectedClick(e, k, fnToValidKeys[k])\r\n } else {\r\n e.preventDefault()\r\n }\r\n }}\r\n >\r\n \r\n ${fnMultipleName}\r\n \r\n `\r\n })}\r\n `\r\n })\r\n if (\r\n customSelectedRowFunctions.length > 0 ||\r\n filterSelectedRows ||\r\n customColumnSelectedFunctions\r\n ) {\r\n selectedFunctions = html`\r\n
    \r\n
    \r\n ${unsafeHTML(\r\n T(\"SYSHeaderMenuSelectedRowsFunctionsTitle\", [\r\n T(\r\n _GetEntityNameMulti(\r\n def.title.entityTitle.entityNameTranslationKey\r\n )\r\n ),\r\n selectedCount,\r\n ])\r\n )}\r\n \r\n ${filterSelectedRows}\r\n \r\n ${customColumnSelectedFunctions} ${customSelectedRowFunctions}\r\n
    \r\n
    \r\n `\r\n }\r\n }\r\n }\r\n let customSort\r\n let sortCustom = def.uiState.sort.sortCustom\r\n let sortCustomSorts = sortCustom.sorts\r\n let sortCustomKeys = Object.keys(sortCustomSorts)\r\n\r\n let values = sortCustomKeys\r\n .filter(\r\n (f) =>\r\n sortCustomSorts[f].translationKey &&\r\n (sortCustomSorts[f].displayOnlyInColumnKeys === undefined ||\r\n sortCustomSorts[f].displayOnlyInColumnKeys.indexOf(selectedColumn) >\r\n -1)\r\n )\r\n .reduce((val, f) => {\r\n val[f] = { description: T(sortCustomSorts[f].translationKey) }\r\n return val\r\n }, {})\r\n\r\n if (customFnHook) {\r\n customFnHookResult = await customFnHook({\r\n data: this.headerMenu.def.data,\r\n def,\r\n values,\r\n mode: \"HeaderMenu\",\r\n type: \"Sort\",\r\n columnKey: selectedColumn,\r\n })\r\n }\r\n if (sortCustomKeys.length > 0) {\r\n let groups = sortCustomKeys.reduce((val, k) => {\r\n if (sortCustomSorts[k].translationKey !== undefined) {\r\n val[sortCustomSorts[k].visualGroup] = true\r\n }\r\n return val\r\n }, {})\r\n let options = Object.keys(groups).map((m) => {\r\n return html` \r\n ${sortCustomKeys\r\n .filter(\r\n (f) =>\r\n sortCustomSorts[f].translationKey !== undefined &&\r\n sortCustomSorts[f].visualGroup === m &&\r\n (sortCustomSorts[f].displayOnlyInColumnKeys === undefined ||\r\n sortCustomSorts[f].displayOnlyInColumnKeys.indexOf(\r\n selectedColumn\r\n ) > -1)\r\n )\r\n .map((k) => {\r\n if (sortCustomSorts[k].translationKey !== undefined) {\r\n let display = customFnHookResult?.[k]?.res\r\n if (!display) {\r\n display = html`
    \r\n ${values[k].description === undefined\r\n ? k\r\n : values[k].description}\r\n
    `\r\n }\r\n let icon = undefined\r\n if (customFnHookResult?.[k]?.icon) {\r\n icon = html``\r\n }\r\n\r\n let ovlDisableClass =\r\n customFnHookResult?.[k]?.visibility === \"Disabled\"\r\n ? \"ovl-menu-disabled\"\r\n : undefined\r\n let ovlHideClass =\r\n customFnHookResult?.[k]?.visibility === \"NotVisible\"\r\n ? \"ovl-hide\"\r\n : undefined\r\n\r\n return html`\r\n \r\n \r\n {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n if (!ovlDisableClass) {\r\n await this.handleCustomSortClick(e, k)\r\n }\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n ${icon}\r\n
    ${display}
    \r\n \r\n \r\n `\r\n }\r\n })}\r\n `\r\n })\r\n\r\n customSort = html`\r\n
    \r\n ${T(\"SYSHeaderMenuCustomSortTitle\")}\r\n
    ${options}
    \r\n
    \r\n `\r\n }\r\n\r\n let customFilter\r\n let filterCustom = def.uiState.filter.filterCustom\r\n\r\n let filterCustomKeys = Object.keys(filterCustom)\r\n\r\n if (filterCustomKeys.length > 0) {\r\n // create the customFn value for the customFn hook\r\n let values = filterCustomKeys\r\n .filter(\r\n (f) =>\r\n def.options.initial_filterCustom[f].translationKey &&\r\n (!def.options.initial_filterCustom[f]\r\n .displayOnlyInInvolvedColumnKeys ||\r\n def.options.initial_filterCustom[f].involvedColumnKeys ===\r\n undefined ||\r\n def.options.initial_filterCustom[f].involvedColumnKeys[\r\n selectedColumn\r\n ])\r\n )\r\n .reduce((val, f) => {\r\n val[f] = {\r\n description: T(def.options.initial_filterCustom[f].translationKey),\r\n }\r\n return val\r\n }, {})\r\n\r\n if (customFnHook) {\r\n customFnHookResult = await customFnHook({\r\n data: this.headerMenu.def.data,\r\n def,\r\n values,\r\n mode: \"HeaderMenu\",\r\n type: \"Filter\",\r\n })\r\n }\r\n let filterCustomMap = new Map()\r\n filterCustomKeys\r\n .filter(\r\n (f) =>\r\n !def.options.initial_filterCustom[f]\r\n .displayOnlyInInvolvedColumnKeys ||\r\n def.options.initial_filterCustom[f].involvedColumnKeys ===\r\n undefined ||\r\n def.options.initial_filterCustom[f].involvedColumnKeys[\r\n selectedColumn\r\n ]\r\n )\r\n .forEach((f) => {\r\n let filterCustomInit = def.options.initial_filterCustom[f]\r\n let groupVal = filterCustomInit.group\r\n if (filterCustomInit.group === undefined) {\r\n groupVal = 9999999\r\n }\r\n if (!filterCustomMap.has(groupVal)) {\r\n filterCustomMap.set(groupVal, [])\r\n }\r\n filterCustomMap.get(groupVal).push(f)\r\n })\r\n let filterCustomMapKeysArray = Array.from(filterCustomMap.keys())\r\n let groups = filterCustomKeys.reduce((val, k) => {\r\n val[def.options.initial_filterCustom[k].visualGroup] = true\r\n return val\r\n }, {})\r\n let options = Object.keys(groups).map((mm) => {\r\n return html`
    \r\n ${filterCustomMapKeysArray\r\n .sort()\r\n .filter(\r\n (f) =>\r\n filterCustomMap\r\n .get(f)\r\n .filter(\r\n (ff) =>\r\n def.options.initial_filterCustom[ff].visualGroup === mm\r\n ).length > 0\r\n )\r\n .map((m) => {\r\n return html`\r\n ${filterCustomMap\r\n .get(m)\r\n .filter(\r\n (ff) =>\r\n def.options.initial_filterCustom[ff].visualGroup === mm\r\n )\r\n .map((k) => {\r\n let checkOrRadio =\r\n m === 9999999 ? \"fd-checkbox\" : \"fd-radio\"\r\n let filterCustomInit = def.options.initial_filterCustom[k]\r\n if (filterCustomInit.translationKey !== undefined) {\r\n let icon\r\n if (customFnHookResult?.[k]?.icon) {\r\n icon = html``\r\n }\r\n\r\n let display = customFnHookResult?.[k]?.res\r\n\r\n if (!display) {\r\n display = html` \r\n ${values[k].description === undefined\r\n ? k\r\n : values[k].description}\r\n
    `\r\n }\r\n let ovlDisableClass =\r\n customFnHookResult?.[k]?.visibility === \"Disabled\"\r\n ? \"ovl-disabled\"\r\n : undefined\r\n let ovlHideClass =\r\n customFnHookResult?.[k]?.visibility === \"NotVisible\"\r\n ? \"ovl-hide\"\r\n : undefined\r\n return html`\r\n \r\n \r\n {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n if (!ovlDisableClass) {\r\n this.handleCustomFilterClick(e)\r\n }\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n ${icon}\r\n
    ${display}
    \r\n \r\n \r\n `\r\n }\r\n })}\r\n `\r\n })}\r\n `\r\n })\r\n\r\n customFilter = html`\r\n
    \r\n ${T(\"SYSHeaderMenuCustomFilterTitle\")}\r\n
    ${options}
    \r\n
    \r\n `\r\n }\r\n\r\n let rowAttributes\r\n let rowAttributesDef = def.options.initial_rowAttributes\r\n let rowAttributesDefKeys = Object.keys(rowAttributesDef)\r\n if (rowAttributesDefKeys.length > 0) {\r\n let getAttributesFn =\r\n this.actions.app.features[def.feature]?.hooks?.[\r\n HookTableRowAttributesGetAllAttributes\r\n ]\r\n if (!getAttributesFn) {\r\n throw Error(\r\n `Ovl feature:${def.feature}, no ${HookTableRowAttributesGetAllAttributes} hook found`\r\n )\r\n }\r\n\r\n let getAttributeRowAttributesFn =\r\n this.actions.app.features[def.feature]?.hooks?.[\r\n HookTableRowAttributesGetAttributes\r\n ]\r\n if (!getAttributeRowAttributesFn) {\r\n throw Error(\r\n `Ovl feature:${def.feature}, no ${HookTableRowAttributesGetAttributes} hook found`\r\n )\r\n }\r\n\r\n let getAttributePropertiesFn =\r\n this.actions.app.features[def.feature]?.hooks?.[\r\n HookTableRowAttributeGetProperties\r\n ]\r\n\r\n rowAttributesDefKeys.filter(\r\n (f) =>\r\n !rowAttributesDef[f].displayOnlyInInvolvedColumnKeys ||\r\n rowAttributesDef[f].involvedColumnKeys === undefined ||\r\n rowAttributesDef[f].involvedColumnKeys[selectedColumn]\r\n )\r\n let attributesFilterState = def.uiState.filter.filterAttributes\r\n let options = html`${rowAttributesDefKeys.map((defKey) => {\r\n let attributeFnRes = getAttributesFn({\r\n rowAttributeDefKey: defKey,\r\n defId: def.id,\r\n } as HookTableRowAttributesGetAllAttributes_Type)\r\n if (attributeFnRes === undefined || attributeFnRes === null) {\r\n return undefined\r\n }\r\n let attributeKeys: string[]\r\n if (Array.isArray(attributeFnRes.allAttributes)) {\r\n attributeKeys = attributeFnRes.allAttributes\r\n } else {\r\n attributeKeys = Object.keys(attributeFnRes.allAttributes)\r\n }\r\n\r\n let title = rowAttributesDef[defKey].translationKey\r\n ? T(rowAttributesDef[defKey].translationKey)\r\n : defKey\r\n\r\n title = html`
    ${title}
    `\r\n let allAttributesWithCount\r\n let useAttributeCount = !!rowAttributesDef[defKey].useCount\r\n if (useAttributeCount) {\r\n //loop through all filtered rows and get count adn prepare an attributeKey.Count object map\r\n\r\n let keys = _TableFilterFn({\r\n def: table.def,\r\n data: table.dataDef,\r\n })\r\n\r\n allAttributesWithCount = attributeKeys.reduce((val, k) => {\r\n val[k] = 0\r\n return val\r\n }, {})\r\n //attributeKeys.forEach((attributeKey) => {\r\n keys.forEach((rowKey) => {\r\n let rowAttributes: HookTableRowAttributesGetAttributes_ReturnType =\r\n getAttributeRowAttributesFn({\r\n defId: def.id,\r\n rowAttributeDefKey: defKey,\r\n row: table.dataDef.data[rowKey],\r\n } as HookTableRowAttributesGetAttributes_Type)\r\n let rowAttributesArray: string[] = []\r\n if (rowAttributes !== undefined) {\r\n if (Array.isArray(rowAttributes)) {\r\n rowAttributesArray = rowAttributes\r\n } else {\r\n rowAttributesArray = Object.keys(rowAttributes)\r\n }\r\n }\r\n rowAttributesArray.forEach((k) => {\r\n allAttributesWithCount[k]++\r\n })\r\n })\r\n //})\r\n }\r\n\r\n return html`${title}\r\n \r\n ${attributeKeys.map((attributeKey) => {\r\n let getPropertiesRes: HookTableRowAttributeGetProperties_ReturnType\r\n if (getAttributePropertiesFn) {\r\n getPropertiesRes = <\r\n HookTableRowAttributeGetProperties_ReturnType\r\n >getAttributePropertiesFn({\r\n defId: def.id,\r\n rowAttributeDefKey: defKey,\r\n rowAttributeKey: attributeKey,\r\n mode: \"HeaderMenu\",\r\n } as HookTableRowAttributeGetProperties_Type)\r\n }\r\n\r\n let icon\r\n if (getPropertiesRes?.icon) {\r\n icon = html``\r\n }\r\n\r\n let display = getPropertiesRes?.res\r\n\r\n if (!display) {\r\n display =\r\n attributeKey +\r\n (useAttributeCount\r\n ? ` (${allAttributesWithCount[attributeKey].toString()})`\r\n : \"\")\r\n }\r\n display = html`
    \r\n ${display}\r\n
    `\r\n let ovlDisableClass =\r\n getPropertiesRes?.visibility === \"Disabled\"\r\n ? \"ovl-disabled\"\r\n : undefined\r\n let ovlHideClass =\r\n getPropertiesRes?.visibility === \"NotVisible\"\r\n ? \"ovl-hide\"\r\n : undefined\r\n return html`\r\n \r\n \r\n {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n if (!ovlDisableClass) {\r\n this.handleAttributesFilterClick(\r\n e,\r\n defKey,\r\n attributeKey\r\n )\r\n }\r\n }}\r\n >\r\n \r\n \r\n \r\n ${icon}\r\n
    ${display}
    \r\n \r\n \r\n `\r\n })}\r\n `\r\n })}`\r\n\r\n if (customFilter) {\r\n rowAttributes = html`
    \r\n ${options}\r\n
    `\r\n } else {\r\n rowAttributes = html`\r\n
    \r\n ${T(\"SYSHeaderMenuAttributesFilterTitle\")}\r\n
    ${options}
    \r\n
    \r\n `\r\n }\r\n }\r\n\r\n let selectionFunctions\r\n\r\n if (def.features.multiSelect) {\r\n let unselectAll\r\n if (selectedCount > 0) {\r\n unselectAll = html`\r\n
  • \r\n this.handleSelectAllClick(e, false)}\r\n href=\"#\"\r\n class=\"fd-list__link\"\r\n >\r\n \r\n ${T(\"SYSHeaderMenuUnselectAllRows\")}\r\n
  • \r\n `\r\n }\r\n let selectAll\r\n if (selectedCount !== def.uiState.rowsCount) {\r\n selectAll = html` \r\n this.handleSelectAllClick(e, true)}\r\n href=\"#\"\r\n class=\"fd-list__link\"\r\n >\r\n \r\n ${T(\r\n \"SYSHeaderMenuSelectAllRows\",\r\n T(\r\n _GetEntityNameMulti(\r\n def.title.entityTitle.entityNameTranslationKey\r\n )\r\n )\r\n )}
    \r\n `\r\n }\r\n\r\n selectionFunctions = html` ${selectAll} ${unselectAll} `\r\n }\r\n\r\n let addRow\r\n\r\n if (def.features.add && _HasPermission(def.permission, \"A\")) {\r\n // let values = {\r\n // Add: {\r\n // description: `${T(\r\n // def.title.entityTitle.entityNameTranslationKey\r\n // )}: ${T(\"SYSAdd\")}`,\r\n // },\r\n // }\r\n\r\n if (customFnHook) {\r\n customFnHookResult = await customFnHook({\r\n data: this.headerMenu.def.data,\r\n def,\r\n values: undefined,\r\n mode: \"HeaderMenu\",\r\n type: \"Table\",\r\n columnKey: undefined,\r\n })\r\n }\r\n\r\n let visibility: FormFnCan_Visibility = \"Visible\"\r\n let icon = \"sap-icon--add\"\r\n let disabled = \"\"\r\n let title = `${T(def.title.entityTitle.entityNameTranslationKey)}: ${T(\r\n \"SYSAdd\"\r\n )}`\r\n let description: any = title\r\n\r\n if (customFnHookResult?.OvlAdd) {\r\n if (customFnHookResult.OvlAdd.icon) {\r\n icon = customFnHookResult.OvlAdd.icon\r\n }\r\n if (customFnHookResult.OvlAdd.tooltip) {\r\n title = customFnHookResult.OvlAdd.tooltip\r\n }\r\n if (customFnHookResult.OvlAdd.res) {\r\n description = customFnHookResult.OvlAdd.res\r\n }\r\n\r\n if (customFnHookResult.OvlAdd.visibility) {\r\n visibility = customFnHookResult.OvlAdd.visibility\r\n }\r\n if (visibility === \"Disabled\") {\r\n disabled = \"ovl-menu-disabled\"\r\n }\r\n }\r\n if (visibility !== \"NotVisible\") {\r\n addRow = html`\r\n \r\n await this.handleAddRowClick(e)}\r\n href=\"#\"\r\n class=${`fd-list__link ${disabled}`}\r\n >\r\n \r\n ${description}
    \r\n \r\n `\r\n }\r\n }\r\n\r\n let refresh = null\r\n if (this.headerMenu.def.def.uiState.rebuild.needsRefresh === true) {\r\n refresh = html`\r\n \r\n this.handleRefreshTableClick(e)}\r\n href=\"#\"\r\n class=\"fd-list__link\"\r\n >\r\n \r\n ${T(\"SYSHeaderMenuRefreshView\")}\r\n \r\n `\r\n }\r\n\r\n let filterRows\r\n\r\n if (def.features.filter) {\r\n filterRows = html`\r\n
  • \r\n    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
  • \r\n `\r\n }\r\n\r\n let tableInfo\r\n if (isMobile()) {\r\n tableInfo = html`
  • \r\n \r\n ${this.getTableInfo()} \r\n
  • `\r\n }\r\n\r\n let sortByFeedback\r\n let data = this.headerMenu.def.data.data\r\n let feedbackLevel = parseInt(def.options.feedback.level.split(\":\")[0])\r\n if (feedbackLevel > 0) {\r\n if (\r\n Object.keys(data).some(\r\n (k) => {\r\n let feedback = (data[k].OvlSysState as OvlSysColumn).fnFeedback\r\n return Object.keys(feedback).some(\r\n (k) =>\r\n (k && feedbackLevel > 3) ||\r\n (k === \"error\" && feedbackLevel >= 1) ||\r\n (k === \"warning\" && feedbackLevel >= 2) ||\r\n (k === \"information\" && feedbackLevel >= 3)\r\n )\r\n }\r\n\r\n //(data[k].OvlSysState as OvlSysColumn).lastFeedbackTS\r\n )\r\n ) {\r\n let description = T(\"SYSHeaderMenuFeedbackSortTitle\")\r\n //let disabled = def.uiState.sort.byFeedback ? \"ovl-menu-disabled\" : \"\"\r\n sortByFeedback = html`\r\n \r\n \r\n

    \r\n\r\n

    ...

    \r\n
    \r\n  \r\n
    this.handleSortByFeedbackClick(e)}>\r\n \r\n \r\n
    \r\n\r\n ${description}\r\n \r\n `\r\n }\r\n }\r\n\r\n let tableFunctions\r\n if (filterRows || selectionFunctions || addRow || refresh) {\r\n tableFunctions = html`\r\n
    \r\n ${unsafeHTML(T(\"SYSHeaderMenuTableFunctionsTitle\"))}\r\n
    \r\n \r\n ${sortByFeedback} ${filterRows} ${selectionFunctions} ${addRow}\r\n ${refresh}\r\n \r\n
    \r\n
    \r\n `\r\n }\r\n\r\n let filterSortSettings\r\n\r\n // for now there is now favorites in the second instance (we would need to keep 2 filtersettingstables again...)\r\n if (\r\n this.headerMenu.instance === \"1\" &&\r\n (filterSortPermissions.read || filterSortPermissions.write)\r\n ) {\r\n filterSortSettings = html`\r\n \r\n `\r\n }\r\n return html`\r\n
    \r\n
    \r\n ${columnFunctions} ${customSort} ${customFilter} ${rowAttributes}\r\n ${selectedFunctions} ${tableFunctions} ${filterSortSettings}\r\n ${tableInfo}\r\n
    \r\n
    \r\n `\r\n }\r\n\r\n async getColumnFunctionHtml(\r\n customColumnFnsDef: { [key: string]: _ColumnFnDefType },\r\n selectedColumn: string,\r\n customFnHook,\r\n hasSelected?: boolean,\r\n onlySelected?: boolean,\r\n rowFnDefId?: string\r\n ) {\r\n let customColumnFns = this.getColDefs(\r\n customColumnFnsDef[selectedColumn],\r\n hasSelected,\r\n onlySelected\r\n )\r\n\r\n if (!customColumnFns) {\r\n customColumnFns = []\r\n }\r\n let allRes = this.getColDefs(\r\n customColumnFnsDef[\"All\"],\r\n hasSelected,\r\n onlySelected\r\n )\r\n if (allRes !== undefined) {\r\n customColumnFns = customColumnFns.concat(allRes)\r\n }\r\n let atLeastOneMultiProcessRunning = false\r\n if (!onlySelected) {\r\n // now add as well the rowFns which are declared as \"Table\"\r\n let rowFnDef = this.headerMenu.def.def.options.customRowActions\r\n let rowFnAsTable = Object.keys(rowFnDef)\r\n .filter(\r\n (f) =>\r\n (rowFnDef[f].mode === \"Table\" &&\r\n rowFnDef[f].visibleOnColumns === \"All\") ||\r\n rowFnDef[f].visibleOnColumns.indexOf(selectedColumn) > -1\r\n )\r\n .map((m) => {\r\n if (atLeastOneMultiProcessRunning === false) {\r\n if (rowFnDef[m].process && rowFnDef[m].process !== \"None\") {\r\n atLeastOneMultiProcessRunning = ProcessIsRunning(\r\n rowFnDef[m].process,\r\n `${rowFnDefId}_OvlSep_${rowFnDef[m].fnKey}_OvlSep_Multi`\r\n )\r\n }\r\n }\r\n\r\n let colFn: _columnAction = {\r\n fnKey: rowFnDef[m].fnKey,\r\n icon: rowFnDef[m].icon,\r\n translationKey: rowFnDef[m].translationKey,\r\n visualGroup: rowFnDef[m].visualGroup,\r\n rowFnProcess: rowFnDef[m].process,\r\n }\r\n return colFn\r\n })\r\n\r\n if (rowFnAsTable !== undefined) {\r\n customColumnFns = customColumnFns.concat(rowFnAsTable)\r\n }\r\n }\r\n\r\n if (!customColumnFns || customColumnFns.length === 0) {\r\n return undefined\r\n }\r\n let groups = {}\r\n let values = customColumnFns\r\n //.filter((f) => customColumnFns[f].translationKey)\r\n .reduce((val, f) => {\r\n val[f.fnKey] = {\r\n description: f.translationKey ? T(f.translationKey) : \"\",\r\n }\r\n let grp = f.visualGroup\r\n if (!groups[grp]) {\r\n groups[grp] = true\r\n }\r\n return val\r\n }, {})\r\n\r\n let customFnHookResult\r\n if (customFnHook) {\r\n customFnHookResult = await customFnHook({\r\n data: this.headerMenu.def.data,\r\n def: this.headerMenu.def.def,\r\n values,\r\n mode: \"HeaderMenu\",\r\n type: \"Column\",\r\n columnKey: selectedColumn,\r\n })\r\n }\r\n\r\n // let columnFn = \"__columnfn\"\r\n // if (onlySelected) {\r\n // columnFn = \"__selectedfn\"\r\n // }\r\n\r\n return Object.keys(groups).map((g) => {\r\n return html`\r\n ${customColumnFns\r\n .filter((f) => f.visualGroup === g)\r\n .map((k) => {\r\n //if (customColumnFns[k].translationKey !== undefined) {\r\n let display = customFnHookResult?.[k.fnKey]?.res\r\n if (!display) {\r\n display = values[k.fnKey].description\r\n }\r\n if (!display) {\r\n display = k.fnKey\r\n }\r\n let icon = undefined\r\n if (customFnHookResult?.[k.fnKey]?.icon) {\r\n icon = html``\r\n } else if (k.icon) {\r\n icon = html``\r\n }\r\n let ovlDisableClass =\r\n (atLeastOneMultiProcessRunning && k.rowFnProcess) ||\r\n customFnHookResult?.[k.fnKey]?.visibility === \"Disabled\"\r\n ? \"ovl-menu-disabled\"\r\n : undefined\r\n let ovlHideClass =\r\n customFnHookResult?.[k.fnKey]?.visibility === \"NotVisible\"\r\n ? \"ovl-hide\"\r\n : undefined\r\n\r\n return html`\r\n \r\n {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n if (!ovlDisableClass) {\r\n if (!k.rowFnProcess) {\r\n await this.handleCustomColumnFunctionClick(e, k.fnKey)\r\n } else {\r\n this.closeHeaderMenu()\r\n await TableRowFnExecute(\r\n this.headerMenu.def.def.id,\r\n k.fnKey,\r\n []\r\n )\r\n }\r\n }\r\n }}\r\n class=\"fd-list__link ${ovlDisableClass} \"\r\n >\r\n ${icon}\r\n ${display}\r\n \r\n `\r\n //}\r\n })}\r\n `\r\n })\r\n }\r\n\r\n getColDefs(\r\n colDefs: _ColumnFnDefType,\r\n hasSelected: boolean,\r\n onlySelected: boolean\r\n ): _columnAction[] {\r\n if (!colDefs) {\r\n return undefined\r\n }\r\n let colActions = []\r\n colDefs\r\n .filter(\r\n (f) =>\r\n ((!onlySelected && !f.onlyWhenRowsSelected) ||\r\n (f.onlyWhenRowsSelected && hasSelected && onlySelected)) &&\r\n (!f.permission ||\r\n _HasPermission(f.permission, f.permissionModifier)) &&\r\n (!f.role || FeatureInfo(f.role))\r\n )\r\n .forEach((colDef) => {\r\n colDef.fns.forEach((m) => {\r\n colActions.push({\r\n fnKey: m.fnKey,\r\n translationKey: m.translationKey,\r\n icon: m.icon,\r\n visualGroup: colDef.visualGroup,\r\n })\r\n })\r\n })\r\n return colActions\r\n }\r\n\r\n getFooter() {\r\n let def = this.headerMenu.def.def\r\n let navcontrol = html`\r\n {\r\n return {\r\n defId: def.id,\r\n type: \"header\",\r\n } as NavDef\r\n }}\r\n >\r\n `\r\n\r\n let tableInfo\r\n if (!isMobile()) {\r\n tableInfo = this.getTableInfo()\r\n }\r\n return html` ${tableInfo} ${navcontrol}\r\n this.handleCloseHeaderMenu(e)}\"\r\n class=\"fd-button fd-button--positive ovl-table-navbuttons ovl-margin-corr2\"\r\n >\r\n \r\n `\r\n }\r\n\r\n getTableInfo() {\r\n let moreHint = this.headerMenu.def.data.hasMoreDataOnServer\r\n ? T(\"SYSTableHasMoreDataOnServerHint\")\r\n : \"\"\r\n let rowsCount = this.headerMenu.def.def.uiState.rowsCount //this.headerMenu.def.data.addRows\r\n if (!isMobile()) {\r\n return html`
    \r\n ${unsafeHTML(T(\"SYSHeaderMenuRowsHint\", [rowsCount, moreHint]))}\r\n
    `\r\n }\r\n return html`${unsafeHTML(\r\n T(\"SYSHeaderMenuRowsHint\", [rowsCount, moreHint])\r\n )}`\r\n }\r\n\r\n async getUI() {\r\n let dialogHolderParams: _DialogHolderParams\r\n // tracking needs to be recorded on the holder object\r\n // thats why we use functions here to get the templates\r\n // to make it look nicer i even used methods for the different parts\r\n dialogHolderParams = {\r\n dialogParts: {\r\n footer: () => this.getFooter(),\r\n body: async () => await this.getBody(),\r\n dismissedCallbackFn: () => {\r\n this.actions.ovl.internal._TableSelectHeader({\r\n def: this.headerMenu.def.def,\r\n data: this.headerMenu.def.data,\r\n key: \"\",\r\n })\r\n DialogClose(\"SYSTableHeaderMenu\", {\r\n instance: this.headerMenu.instance,\r\n })\r\n },\r\n customClass: () => {\r\n let def = this.headerMenu.def.def\r\n return `ovl-table-${def.id} ovl-tableheadermenu ovl-tableheadermenu-${def.id}`\r\n },\r\n },\r\n\r\n dialogType: \"SYSTableHeaderMenu\",\r\n instance: this.headerMenu.instance,\r\n }\r\n\r\n return html``\r\n }\r\n}\r\n","import { SYSTableDefIds, html } from \"../../\"\r\nimport { T, _HasPermission } from \"../../global/globals\"\r\nimport { HookTablePrepareFn } from \"../../global/hooks\"\r\nimport { SYSBaseElement } from \"../sysbaseelement\"\r\nimport type { TableDataAndDef } from \"./table\"\r\nimport { TableGet, TableRebuild } from \"./tableapi\"\r\n\r\nimport type {\r\n FormFnCan_Visibility,\r\n HookTablePrepareFn_ReturnType,\r\n HookTablePrepareFn_Type,\r\n} from \"../../global/hooks\"\r\n\r\nimport type { SYSDialog } from \"../..\"\r\nimport { DialogClose, DialogIsOpen } from \"../dialog/dialogapi\"\r\nimport {\r\n ProcessEnd,\r\n ProcessIsRunning,\r\n ProcessStart,\r\n} from \"../longrunningprocesstracker/processapi\"\r\nimport {\r\n _FilterChangedComparedToDefault,\r\n _SortChangedComparedToDefault,\r\n} from \"./tablerowheadermenu/tablesettings/helpers\"\r\nimport { _ResetFilters, _ResetSort } from \"./helpers\"\r\nimport { StartScreenUpdate } from \"../../tracker/proxyhandler\"\r\n\r\ntype NavType = \"header\" | \"row\"\r\n\r\nexport type NavDef = {\r\n defId: SYSTableDefIds\r\n type: NavType\r\n}\r\n\r\nexport class SYSTableNavControl extends SYSBaseElement {\r\n props: any\r\n nav: NavDef\r\n tableData: TableDataAndDef\r\n oldDefId: string\r\n\r\n handleFilterDefaultClick = async (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n await _ResetFilters(this.tableData.def)\r\n await TableRebuild(this.tableData.def.id, { showProcess: true })\r\n }\r\n\r\n handleSortDefaultClick = async (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n _ResetSort(this.tableData.def)\r\n await TableRebuild(this.tableData.def.id, { showProcess: true })\r\n }\r\n\r\n handleSetPageClick = (e: Event, page: number) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n ProcessStart(\"SYSTableRebuild\", {\r\n snack: { type: \"BusyIndicator\" },\r\n instance: this.tableData.def.id,\r\n })\r\n StartScreenUpdate(0)\r\n setTimeout(() => {\r\n try {\r\n this.actions.ovl.internal._TableSetPage({\r\n paging: this.tableData.def.uiState.paging,\r\n page: page,\r\n })\r\n } finally {\r\n ProcessEnd(\"SYSTableRebuild\", this.tableData.def.id)\r\n }\r\n }, 0)\r\n }\r\n\r\n handleMoreTableOptionsClick = (e: Event) => {\r\n let def = this.tableData.def\r\n this.actions.ovl.internal._TableMoreRow({\r\n def,\r\n data: this.tableData.data,\r\n key: def.uiState.firstVisibleColumn,\r\n })\r\n }\r\n\r\n handleAddRowClick = async (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n // if (this.nav.type === \"header\") {\r\n // this.actions.ovl.internal._TableSelectHeader({\r\n // def: this.tableData.def,\r\n // data: this.tableData.data,\r\n // key: \"\",\r\n // })\r\n if (DialogIsOpen(\"SYSTableHeaderMenu\", \"2\")) {\r\n DialogClose(\"SYSTableHeaderMenu\", { instance: \"2\" })\r\n } else {\r\n DialogClose(\"SYSTableHeaderMenu\", { instance: \"1\" })\r\n }\r\n // }\r\n let addRes = await this.actions.ovl.table._TableAddRow({\r\n data: this.tableData.data,\r\n def: this.tableData.def,\r\n })\r\n await this.actions.ovl.table._TableEditRow({\r\n data: this.tableData.data,\r\n def: this.tableData.def,\r\n key: addRes.key,\r\n initialFocusFieldKey: addRes.fieldKeyToFocus,\r\n })\r\n }\r\n\r\n handleRefreshClick = (e: Event) => {\r\n e.stopPropagation()\r\n e.preventDefault()\r\n TableRebuild(this.tableData.def.id, { showProcess: true })\r\n }\r\n\r\n handleSourceData() {\r\n let oldNavType = this.nav?.type\r\n this.nav = this.props(this.state)\r\n let defId = this.nav.defId\r\n if (typeof defId === \"object\") {\r\n //@ts-ignore\r\n defId = defId.defId\r\n this.nav = { defId, type: undefined }\r\n }\r\n if (oldNavType) {\r\n this.nav.type = oldNavType\r\n }\r\n if (this.oldDefId !== this.nav.defId) {\r\n this.oldDefId = this.nav.defId\r\n if (!this.nav.type) {\r\n this.nav.type = \"row\"\r\n }\r\n let tb = TableGet(this.nav.defId)\r\n this.tableData = { def: tb.def, data: tb.dataDef }\r\n }\r\n }\r\n\r\n async init() {\r\n this.handleSourceData()\r\n await super.init()\r\n }\r\n async getUI() {\r\n this.handleSourceData()\r\n let navbuttonsclass = \"ovl-table-navbuttons\"\r\n let tableDef = this.tableData.def\r\n let feature = tableDef.features\r\n let customFnHook =\r\n this.actions.app.features?.[tableDef.feature]?.hooks?.[HookTablePrepareFn]\r\n let customFnHookResult: HookTablePrepareFn_ReturnType\r\n\r\n let filterDefaultButton = null\r\n if (\r\n (_FilterChangedComparedToDefault(tableDef) ||\r\n tableDef.uiState.filter.filter.forcedFilterKeys) &&\r\n (this.nav.type === \"header\" || feature.showFooterButtons)\r\n ) {\r\n let filterClearTooltip = T(\"SYSFilterReset\")\r\n filterDefaultButton = html`\r\n this.handleFilterDefaultClick(e)}\"\r\n class=\"fd-button ${navbuttonsclass} __filteractive\"\r\n >\r\n \r\n \r\n `\r\n }\r\n\r\n let sortDefaultButton = null\r\n if (\r\n _SortChangedComparedToDefault(tableDef) &&\r\n (this.nav.type === \"header\" || feature.showFooterButtons)\r\n ) {\r\n let sortClearTooltip = T(\"SYSSortReset\")\r\n sortDefaultButton = html`\r\n this.handleSortDefaultClick(e)}\"\r\n class=\"fd-button ${navbuttonsclass} \"\r\n >\r\n \r\n \r\n `\r\n }\r\n\r\n let refresh = null\r\n if (\r\n this.nav.type === \"row\" &&\r\n feature.showRefreshButton.indexOf(\"TableNav\") > -1 &&\r\n this.tableData.def.uiState.rebuild.needsRefresh === true &&\r\n feature.showFooterButtons\r\n ) {\r\n refresh = html`\r\n this.handleRefreshClick(e)}\r\n class=\"fd-button ${navbuttonsclass} \"\r\n title=\"${T(\"SYSTableRebuild\")}\"\r\n >\r\n \r\n \r\n `\r\n }\r\n\r\n let add\r\n if (\r\n _HasPermission(tableDef.permission, \"A\") &&\r\n feature.add &&\r\n (this.nav.type === \"header\" ||\r\n (this.nav.type === \"row\" && feature.showFooterButtons))\r\n ) {\r\n let values = {\r\n Add: {\r\n description: `${T(\r\n tableDef.title.entityTitle.entityNameTranslationKey\r\n )}: ${T(\"SYSAdd\")}`,\r\n },\r\n }\r\n\r\n if (customFnHook) {\r\n customFnHookResult = customFnHook({\r\n data: this.tableData.data,\r\n def: tableDef,\r\n values,\r\n mode: \"HeaderMenu\",\r\n type: \"Table\",\r\n columnKey: undefined,\r\n })\r\n }\r\n\r\n let visibility: FormFnCan_Visibility = \"Visible\"\r\n let icon = \"sap-icon--add\"\r\n let disabled = false\r\n let tooltip = `${T(\r\n this.tableData.def.title.entityTitle.entityNameTranslationKey\r\n )}: ${T(\"SYSAdd\")}`\r\n if (customFnHookResult?.OvlAdd) {\r\n if (customFnHookResult.OvlAdd.icon) {\r\n icon = customFnHookResult.OvlAdd.icon\r\n }\r\n if (customFnHookResult.OvlAdd.visibility) {\r\n visibility = customFnHookResult.OvlAdd.visibility\r\n }\r\n if (visibility === \"Disabled\") {\r\n disabled = true\r\n }\r\n }\r\n if (visibility !== \"NotVisible\") {\r\n add = html`\r\n this.handleAddRowClick(e)}\r\n class=\"fd-button ${navbuttonsclass}\"\r\n id=\"ovl_nav_add${this._id}\"\r\n title=\"${tooltip}\"\r\n ?disabled=${disabled}\r\n >\r\n \r\n \r\n `\r\n }\r\n }\r\n let more = null\r\n if (\r\n this.nav.type === \"row\" &&\r\n feature.showFooterButtons &&\r\n feature.showMoreButton &&\r\n (feature.filter || feature.multiSelect) &&\r\n feature.headerMenu\r\n ) {\r\n more = html`\r\n this.handleMoreTableOptionsClick(e)}\"\r\n class=\"fd-button ${navbuttonsclass} \"\r\n id=\"ovl_nav_more${this._id}\"\r\n >\r\n \r\n \r\n `\r\n }\r\n\r\n let tablenav\r\n\r\n let paging = this.tableData.def.uiState.paging\r\n let dataFilteredAndSorted = this.tableData.def.uiState.dataFilteredAndSorted\r\n if (feature.page) {\r\n //console.log(this.tableData.def.id)\r\n let rebuildInProcess = ProcessIsRunning(\r\n \"SYSTableRebuild\",\r\n this.tableData.def.id\r\n )\r\n let count = dataFilteredAndSorted.length\r\n if (count > paging.pageSize) {\r\n let pages = Math.ceil(count / paging.pageSize)\r\n tablenav = html`\r\n \r\n this.handleSetPageClick(e, 0)}\r\n class=${`fd-button ${navbuttonsclass}`}\r\n >\r\n \r\n \r\n this.handleSetPageClick(e, paging.page - 1)}\r\n class=${`fd-button ${navbuttonsclass}`}\r\n >\r\n \r\n \r\n \r\n ${paging.page + 1}/${pages}\r\n \r\n this.handleSetPageClick(e, paging.page + 1)}\r\n ?disabled=${paging.page + 1 === pages || rebuildInProcess}\r\n class=${`fd-button ${navbuttonsclass}`}\r\n >\r\n \r\n \r\n this.handleSetPageClick(e, pages - 1)}\r\n ?disabled=${paging.page + 1 === pages ||\r\n pages === 1 ||\r\n rebuildInProcess}\r\n class=${`fd-button ${navbuttonsclass}`}\r\n >\r\n \r\n \r\n \r\n `\r\n }\r\n }\r\n let autoCloseButtonIfInDialog\r\n\r\n if (\r\n this.nav.type === \"row\" &&\r\n tableDef.features.autoCloseButtonIfInsideDialog\r\n ) {\r\n let dialogEl = (this.closest(\".ovl-dialog\"))\r\n if (dialogEl) {\r\n //@ts-ignore\r\n let ids = dialogEl.id.split(\"-\")\r\n let dialogType = ids[2]\r\n let dialogInstance = ids[3]\r\n autoCloseButtonIfInDialog = html` \r\n DialogClose(dialogType, { instance: dialogInstance })}\"\r\n title=\"${T(\"SYSCloseDialog\")}\"\r\n class=\"fd-button fd-button--positive ovl-margin-corr2\"\r\n >\r\n \r\n `\r\n }\r\n }\r\n return html` ${tablenav} ${filterDefaultButton} ${sortDefaultButton} ${add}\r\n ${refresh} ${more} ${autoCloseButtonIfInDialog}`\r\n }\r\n}\r\n","import { html, ifDefined } from \"../../\"\r\n\r\nimport type {\r\n HookViewRowCellClass_ReturnType,\r\n HookViewRowCellClass_Type,\r\n} from \"../../global/hooks\"\r\nimport { HookViewRowCellClass } from \"../../global/hooks\"\r\n\r\nimport { SYSBaseElement } from \"../sysbaseelement\"\r\nimport type { CachedRendererData } from \"./helpers\"\r\nimport { _GetAlign, GetRowDisplayValue } from \"./helpers\"\r\nimport type { TableRowDataDef } from \"./rowwrapper\"\r\nimport type { DisplayMode, OvlSysColumn } from \"./table\"\r\n\r\nexport type CellClass = {\r\n className?: string\r\n tooltip?: string\r\n draggable?: boolean\r\n}\r\n\r\nexport let cachedRendererFn: Map = new Map<\r\n string,\r\n CachedRendererData\r\n>()\r\nexport class SYSTableRow extends SYSBaseElement {\r\n props: any\r\n row: TableRowDataDef\r\n hasLazyImage: boolean\r\n async init() {\r\n this.row = this.props()\r\n await super.init()\r\n }\r\n async afterRender() {\r\n if (this.hasLazyImage) {\r\n let lazyImages = this.querySelectorAll(\".ovl-lazy-image\")\r\n lazyImages.forEach((element) => {\r\n this.row.intersectionObserver.observe(element)\r\n })\r\n }\r\n }\r\n async getUI() {\r\n let row = this.row.row\r\n let def = this.row.tableDef\r\n\r\n let feedback\r\n let feedbackLevel = def.options.feedback.level\r\n if (feedbackLevel !== \"0:none\") {\r\n let ovlSysState = row[\"OvlSysState\"] as OvlSysColumn\r\n let fnFeedback = ovlSysState.fnFeedback\r\n let feedBackErrorCount = 0\r\n let feedBackWarningCount = 0\r\n let feedBackInformationCount = 0\r\n let feedBackSuccessCount = 0\r\n Object.keys(fnFeedback).forEach((fnKey) => {\r\n switch (fnFeedback[fnKey].type) {\r\n case \"error\":\r\n feedBackErrorCount++\r\n break\r\n case \"information\":\r\n feedBackInformationCount++\r\n break\r\n case \"success\":\r\n feedBackSuccessCount++\r\n break\r\n case \"warning\":\r\n feedBackWarningCount++\r\n break\r\n }\r\n })\r\n let feedbackLevelInt = parseInt(feedbackLevel.split(\":\")[0])\r\n let btnid = `ovlfeedbackbtn_${this.row.tableDef.id}_${this.row.key}`\r\n if (\r\n feedbackLevelInt >= 3 &&\r\n feedBackInformationCount > 0 &&\r\n feedBackSuccessCount >= 0 &&\r\n feedBackErrorCount === 0 &&\r\n feedBackWarningCount === 0\r\n ) {\r\n // if there is only information and maybe a success we display information icon\r\n feedback = html`\r\n \r\n `\r\n } else if (\r\n feedbackLevelInt > 3 &&\r\n feedBackSuccessCount > 0 &&\r\n feedBackErrorCount === 0 &&\r\n feedBackInformationCount === 0 &&\r\n feedBackWarningCount === 0\r\n ) {\r\n // if there is only success we display success icon\r\n feedback = html`\r\n \r\n `\r\n } else if (\r\n feedbackLevelInt >= 2 &&\r\n feedBackWarningCount > 0 &&\r\n feedBackErrorCount === 0\r\n ) {\r\n // if we have warnings and no errors display warning icon\r\n feedback = html`\r\n \r\n `\r\n } else if (feedbackLevelInt >= 1 && feedBackErrorCount > 0) {\r\n // if we have errors display error icon\r\n feedback = html`\r\n \r\n `\r\n }\r\n }\r\n\r\n if (def.uiState.currentlyAddingKey === this.row.key) {\r\n return html``\r\n }\r\n let columns = def.columns\r\n\r\n let visibleColumns = def.uiState.columnsRenderingState.visibleInTable\r\n\r\n // see if we can gbet custom class names for the row columns\r\n // eg. to color a cell\r\n // this will also be used for detailview, differentiating by param isDetail\r\n let customRowCellClasses: HookViewRowCellClass_ReturnType\r\n let functionName = HookViewRowCellClass.replace(\"{subFeature}\", \"\")\r\n let fn = this.actions.app.features[def.feature]\r\n if (fn?.hooks?.[functionName]) {\r\n customRowCellClasses = fn.hooks[functionName]({\r\n columns: def.columns,\r\n row,\r\n rowKey: this.row.key,\r\n displayMode: \"Table\",\r\n feature: def.feature,\r\n tableDefId: def.id,\r\n def,\r\n })\r\n }\r\n let isFirstCol = true\r\n return html`\r\n ${visibleColumns.map((k) => {\r\n let rowFnFeedbackHint\r\n if (isFirstCol && feedback) {\r\n rowFnFeedbackHint = feedback\r\n }\r\n isFirstCol = false\r\n\r\n let customRowCellClass: string = \"\"\r\n let draggable =\r\n customRowCellClasses?.[k]?.draggable === true ? true : undefined\r\n let tooltip = customRowCellClasses?.[k]?.tooltip\r\n if (!tooltip) {\r\n tooltip = undefined\r\n }\r\n if (customRowCellClasses?.[k]?.className) {\r\n customRowCellClass = customRowCellClasses[k].className\r\n }\r\n\r\n let col = columns[k]\r\n let rowPart = GetRowDisplayValue(\r\n def,\r\n k,\r\n this.row.row,\r\n this.row.key,\r\n \"Table\"\r\n )\r\n\r\n let tdclass = \"\"\r\n if (col.ui.expandTableCellOnClick) {\r\n tdclass = \"ovl-expand-onclick\"\r\n }\r\n\r\n // needs to be ignored to get css white-space: line-wrap work correctly\r\n // prettier-ignore\r\n return html`\r\n
    ${rowPart}${rowFnFeedbackHint}
    \r\n `\r\n })}\r\n `\r\n }\r\n}\r\n","import { html, render } from \"../../\"\r\nimport { isTouch } from \"../../global/globals\"\r\nimport { SYSBaseElement } from \"../sysbaseelement\"\r\nimport { SnackAdd } from \"../snackapi\"\r\nimport { createDynamicRowFunctions, rowControlActionsHandler } from \"./helpers\"\r\nimport type { OvlSysColumn, SYSTableData, SYSTableDef } from \"./table\"\r\nimport { _RenderTracking } from \"../../tracker/tracker\"\r\n\r\nexport type NavProps = {\r\n tableDef: SYSTableDef\r\n data: SYSTableData\r\n key: string\r\n}\r\n\r\nexport type RowControlAllAction = {\r\n name: string\r\n icon: string\r\n disabled: boolean\r\n custom: boolean\r\n}\r\n\r\nexport class SYSTableRowControl extends SYSBaseElement {\r\n props: any\r\n nav: NavProps\r\n\r\n async init() {\r\n this.nav = this.props()\r\n await super.init()\r\n }\r\n\r\n async getUI() {\r\n let key = this.nav.key\r\n let def = this.nav.tableDef\r\n let row = this.nav.data.data\r\n\r\n if (\r\n !row[key] ||\r\n (row[key].OvlSysState as OvlSysColumn).rowState.state === \"Add\"\r\n ) {\r\n return null\r\n }\r\n // put together a dynamic list of actions\r\n // consisting of \"default\" deit/copy/delete ones and the ones from state custom\r\n let comp = _RenderTracking.currentComponent\r\n let rowControlActions = await createDynamicRowFunctions(\r\n def,\r\n this.nav.data,\r\n key,\r\n false\r\n )\r\n let rowControlButtons\r\n _RenderTracking.currentComponent = comp\r\n let rowActions = Object.keys(rowControlActions).filter(\r\n (f) => rowControlActions[f].visibility !== \"NotVisible\"\r\n )\r\n let rowActionsCount = rowActions.length\r\n\r\n rowControlButtons = rowActions.map((k, i) => {\r\n let button = rowControlActions[k]\r\n let border = \"ovl-middlebutton\"\r\n if (i === 0) {\r\n border = \"ovl-firstbutton\"\r\n } else if (i === rowActionsCount - 1) {\r\n border = \"ovl-lastbutton\"\r\n }\r\n let buttonDisabled = button.visibility === \"Disabled\"\r\n\r\n return html`\r\n \r\n \r\n \r\n `\r\n })\r\n\r\n if (rowControlButtons.length === 0) {\r\n return null\r\n }\r\n return html`\r\n \r\n \r\n ${rowControlButtons}\r\n \r\n \r\n `\r\n }\r\n}\r\n","import { html, ifDefined } from \"../../\"\r\n\r\nimport { isMobile } from \"../../global/globals\"\r\nimport type {\r\n HookFormCustomControlRender_Type,\r\n HookViewRowCellClass_ReturnType,\r\n HookViewRowCellClass_Type,\r\n} from \"../../global/hooks\"\r\nimport {\r\n HookFormCustomControlRender,\r\n HookViewRowCellClass,\r\n} from \"../../global/hooks\"\r\n\r\nimport { SYSFormElement } from \"../../library/forms/sysformelement\"\r\nimport {\r\n CachedRendererData,\r\n GetRendererFn,\r\n GetRowDisplayValue,\r\n _GetAlign,\r\n} from \"./helpers\"\r\nimport type { DisplayMode, EditRowDef } from \"./table\"\r\nimport { _TableFormCloseEditRow } from \"./tableapi\"\r\n\r\nlet cachedRendererFn: Map = new Map<\r\n string,\r\n CachedRendererData\r\n>()\r\n\r\nexport class SYSTableRowForm extends SYSFormElement {\r\n props: any\r\n rowData: EditRowDef\r\n focusInit: boolean\r\n async init() {\r\n this.focusInit = false\r\n this.rowData = this.props()\r\n this.formType = \"SYSTableRowEdit\"\r\n this.formId = `${this.rowData.tableDef.id}_${this.rowData.key}`\r\n await super.init()\r\n }\r\n\r\n async connectedCallback() {\r\n this.addEventListener(\"keydown\", this.handleKeyDown)\r\n await super.connectedCallback()\r\n }\r\n\r\n async disconnectedCallback() {\r\n this.removeEventListener(\"keydown\", this.handleKeyDown)\r\n await super.disconnectedCallback()\r\n }\r\n\r\n handleKeyDown = async (e: KeyboardEvent) => {\r\n if (e.key === \"Escape\") {\r\n _TableFormCloseEditRow(this.rowData.tableDef.id, this.rowData.key, {\r\n formState: this.formState,\r\n promptIfDirty: true,\r\n })\r\n }\r\n }\r\n\r\n // handleClick = async (e) => {\r\n // let searchDataCol = e.target\r\n // let key\r\n\r\n // while (searchDataCol) {\r\n // if (searchDataCol.getAttribute(\"data-col\")) {\r\n // key = searchDataCol.getAttribute(\"data-col\")\r\n // break\r\n // }\r\n // searchDataCol = searchDataCol.parentNode\r\n // }\r\n\r\n // if (key) {\r\n // let def = this.rowData.tableDef\r\n // let functionName = HookFieldRowCellSelectedHandler.replace(\r\n // \"{subFeature}\",\r\n // this.formState.subFeature\r\n // ).replace(\"{fieldKey}\", key)\r\n // let fn = this.actions.app.features[def.feature]\r\n // if (fn?.hooks?.[functionName]) {\r\n // if (\r\n // !(await fn.hooks[functionName]({\r\n // e,\r\n // def,\r\n // data: this.rowData.data,\r\n // rowKey: this.rowData.key,\r\n // displayMode: \"EditInline\",\r\n // formState: this.formState,\r\n // row: this.rowData.row,\r\n // }))\r\n // ) {\r\n // return\r\n // }\r\n // }\r\n // }\r\n // }\r\n\r\n async getUI() {\r\n let def = this.rowData.tableDef\r\n let fields = this.formState.fields\r\n\r\n let customRowCellClasses: HookViewRowCellClass_ReturnType\r\n let functionName = HookViewRowCellClass.replace(\r\n \"{subFeature}\",\r\n this.formState.subFeature\r\n )\r\n let fn = this.actions.app.features[def.feature]\r\n if (fn?.hooks?.[functionName]) {\r\n customRowCellClasses = fn.hooks[functionName]({\r\n columns: def.columns,\r\n row: this.rowData.row,\r\n rowKey: this.rowData.key,\r\n isMobile: isMobile(),\r\n displayMode: \"EditInline\",\r\n feature: def.feature,\r\n tableDefId: def.id,\r\n def,\r\n })\r\n }\r\n let columns = def.columns\r\n //let firstEditable = false\r\n return html`\r\n ${Object.keys(columns).map((k) => {\r\n let customRowCellClass: string = \"\"\r\n let draggable =\r\n customRowCellClasses?.[k]?.draggable === true ? true : undefined\r\n let tooltip = customRowCellClasses?.[k]?.tooltip\r\n if (!tooltip) {\r\n tooltip = undefined\r\n }\r\n if (customRowCellClasses?.[k]?.className) {\r\n customRowCellClass = customRowCellClasses[k].className\r\n }\r\n\r\n let col = columns[k]\r\n let uiItem\r\n\r\n let rendererFn = GetRendererFn(\r\n def.feature,\r\n cachedRendererFn,\r\n HookFormCustomControlRender.replace(\r\n \"{subFeature}\",\r\n this.formState.subFeature\r\n ),\r\n k\r\n )\r\n\r\n let id = this.rowData.key + \"ovlRFNFocus_\" + k\r\n\r\n let colRenderState = def.uiState.columnsRenderingState.columns\r\n let columnsVisible = def.uiState.columnsRenderingState.visibleInTable\r\n let isVisibleEdit = colRenderState[k].visibility.indexOf(\"Edit\") > -1\r\n let align = \"\"\r\n if (!isVisibleEdit && !(columnsVisible.indexOf(k) > -1)) {\r\n return null\r\n } else if (!isVisibleEdit && columnsVisible.indexOf(k) > -1) {\r\n uiItem = \"\"\r\n } else if (rendererFn) {\r\n uiItem = rendererFn({\r\n field: fields[k],\r\n formState: this.formState,\r\n id,\r\n })\r\n // } else if (col.ui.readonly) {\r\n // uiItem = GetRowDisplayValue(\r\n // def,\r\n // k,\r\n // this.rowData.row,\r\n // this.rowData.key,\r\n // \"Table\"\r\n // )\r\n // align = _GetAlign(col.ui.align)\r\n } else {\r\n switch (col.control) {\r\n case \"text\":\r\n uiItem = html`\r\n fields[k]}>\r\n \r\n `\r\n break\r\n case \"date\":\r\n uiItem = html`\r\n fields[k]}>\r\n \r\n `\r\n break\r\n\r\n case \"time\":\r\n uiItem = html`\r\n fields[k]}>\r\n \r\n `\r\n break\r\n\r\n case \"textarea\":\r\n uiItem = html`\r\n fields[k]}>\r\n \r\n `\r\n break\r\n case \"list\":\r\n {\r\n uiItem = html`\r\n fields[k]}\r\n >\r\n \r\n `\r\n }\r\n break\r\n case \"asset\":\r\n {\r\n uiItem = html`\r\n fields[k]}>\r\n \r\n `\r\n }\r\n break\r\n\r\n case \"checkbox\":\r\n {\r\n uiItem = html`\r\n fields[k]}\r\n >\r\n \r\n `\r\n }\r\n break\r\n }\r\n }\r\n\r\n return html`\r\n \r\n ${uiItem}\r\n \r\n `\r\n })}\r\n `\r\n }\r\n}\r\n","import type { SYSState } from \"../..\"\r\nimport { html } from \"../../\"\r\nimport { T } from \"../../global/globals\"\r\nimport type {\r\n HookFormAfterCancel_Type,\r\n HookFormBeforeCancel_ReturnType,\r\n HookFormBeforeCancel_Type,\r\n HookFormGetCaptionRender_Type,\r\n} from \"../../global/hooks\"\r\nimport {\r\n HookFormAfterCancel,\r\n HookFormBeforeCancel,\r\n HookFormGetCaptionRender,\r\n} from \"../../global/hooks\"\r\nimport { DialogResult } from \"../actions\"\r\nimport type { _DialogHolderParams } from \"../dialog/sysdialogholder\"\r\nimport type { SYSOkCancelDeleteFooterType } from \"../forms/controls/parts/okcanceldeletefooter\"\r\nimport { FormIsDirty, FormRemove, FormSave } from \"../forms/formapi\"\r\nimport { SYSFormElement } from \"../forms/sysformelement\"\r\n\r\nimport type { CachedRendererData } from \"./helpers\"\r\nimport { _GetTableDialogTitle, FormBodyRenderer } from \"./helpers\"\r\nimport type { EditRowDef, OvlSysColumn } from \"./table\"\r\nimport { _TableFormCloseEditRow } from \"./tableapi\"\r\n\r\nlet cachedRendererFn: Map = new Map<\r\n string,\r\n CachedRendererData\r\n>()\r\nexport class SYSTableRowFormBig extends SYSFormElement {\r\n props: any\r\n rowData: EditRowDef\r\n fn: any\r\n async init() {\r\n this.rowData = this.props()\r\n this.formType = \"SYSTableRowEdit\"\r\n this.formId = `${this.rowData.tableDef.id}_${this.rowData.key}`\r\n this.fn = this.actions.app.features[this.rowData.tableDef.feature]?.hooks\r\n await super.init()\r\n }\r\n\r\n cancelFn = async () => {\r\n await _TableFormCloseEditRow(this.rowData.tableDef.id, this.rowData.key, {\r\n formState: this.formState,\r\n promptIfDirty: true,\r\n })\r\n }\r\n\r\n handleCancel = async () => {\r\n this.cancelFn()\r\n }\r\n\r\n getBody = () => {\r\n return FormBodyRenderer(\r\n this.formState,\r\n this.rowData.tableDef,\r\n this.rowData.row,\r\n this.rowData.data,\r\n this.rowData.key\r\n )\r\n }\r\n getHeader() {\r\n let def = this.rowData.tableDef\r\n // lets see if we have a custom caption renderer\r\n\r\n let captionFunctionName = HookFormGetCaptionRender.replace(\r\n \"{subFeature}\",\r\n this.formState.subFeature\r\n )\r\n\r\n let ovlSysState = this.rowData.data.data[this.rowData.key]\r\n .OvlSysState as OvlSysColumn\r\n let rowEditMode\r\n if (ovlSysState) {\r\n rowEditMode = ovlSysState.editRow.mode\r\n }\r\n let captionContent\r\n let captionTranslated\r\n if (this.fn?.[captionFunctionName]) {\r\n captionContent = this.fn[captionFunctionName](<\r\n HookFormGetCaptionRender_Type\r\n >{\r\n rowKey: this.rowData.key,\r\n formState: this.formState,\r\n mode: this.rowData.mode,\r\n tableDefId: def.id,\r\n row: this.rowData.row,\r\n })\r\n } else {\r\n if (def.options.edit.customCaption && rowEditMode) {\r\n let tKey =\r\n def.options.edit.customCaption[rowEditMode + \"TranslationKey\"]\r\n if (!tKey) {\r\n tKey = def.options.edit.customCaption[\"translationKey\"]\r\n }\r\n if (tKey) {\r\n captionTranslated = T(tKey)\r\n }\r\n }\r\n\r\n captionContent = captionTranslated\r\n }\r\n if (\r\n !captionContent &&\r\n rowEditMode &&\r\n !def.options.edit.doNotDisplayDefaultDialogTitle\r\n ) {\r\n // now we go for the default tabledialogtitle\r\n let fnName\r\n if (rowEditMode !== \"add\") {\r\n fnName = T(\r\n `SYSTableRowFn${\r\n rowEditMode.charAt(0).toUpperCase() + rowEditMode.slice(1)\r\n }`\r\n )\r\n }\r\n let rowKey = this.rowData.key\r\n if (rowEditMode === \"copy\") {\r\n rowKey = ovlSysState.editRow.fromKey\r\n } else if (rowEditMode === \"add\") {\r\n rowKey = undefined\r\n fnName = T(\"SYSAdd\")\r\n }\r\n captionContent = _GetTableDialogTitle(\r\n def,\r\n fnName,\r\n 1,\r\n this.rowData.data.data,\r\n rowKey\r\n )\r\n }\r\n if (captionContent) {\r\n return html`\r\n
    \r\n
    ${captionContent}
    \r\n
    \r\n `\r\n }\r\n }\r\n getFooter() {\r\n let handleSave = async () => {\r\n FormSave(this.formState)\r\n }\r\n\r\n return html`\r\n {\r\n return {\r\n cancelFn: this.cancelFn,\r\n formState: this.formState,\r\n okFn: handleSave,\r\n deleteFn: undefined,\r\n dialog: \"SYSTableRowEdit\",\r\n }\r\n }}\r\n >\r\n `\r\n }\r\n async getUI() {\r\n let dialogHolderParams: _DialogHolderParams\r\n dialogHolderParams = {\r\n dialogParts: {\r\n header: () => this.getHeader(),\r\n body: () => this.getBody(),\r\n footer: () => this.getFooter(),\r\n\r\n //closedCallbackFn: this.closeEdit,\r\n customClass: () => {\r\n let def = this.rowData.tableDef\r\n return `ovl-table-${def.id} ovl-editform ovl-bigeditform ovl-editform-${def.id}`\r\n },\r\n dismissedCallbackFn: () => {\r\n if (this.formState && !this.formState.locked) {\r\n this.cancelFn()\r\n }\r\n },\r\n keyHandlerFn: (e) => {\r\n if (e.key === \"Escape\") {\r\n e.stopPropagation()\r\n if (!(this.formState && FormIsDirty(this.formState))) {\r\n this.cancelFn()\r\n }\r\n }\r\n },\r\n },\r\n\r\n dialogType: this.rowData.DialogType,\r\n instance: `${this.rowData.tableDef.id}_${this.rowData.key}`,\r\n }\r\n return html``\r\n }\r\n}\r\n","import { html } from \"../../\"\r\nimport { T } from \"../../global/globals\"\r\nimport { SYSBaseElement } from \"../sysbaseelement\"\r\nimport type { EditRowSaveCancelDef } from \"./table\"\r\n\r\nimport { FormIsValid, FormSave } from \"../forms/formapi\"\r\nimport { _TableFormCloseEditRow } from \"./tableapi\"\r\n\r\n//import { dialogAfterClose } from \"../dialog/actions\"\r\n\r\nexport class SYSTableRowSaveCancel extends SYSBaseElement {\r\n props: any\r\n rowData: EditRowSaveCancelDef\r\n\r\n async init() {\r\n this.rowData = this.props()\r\n this.formState =\r\n this.state.ovl.forms[\"SYSTableRowEdit\"][\r\n `${this.rowData.tableDef.id}_${this.rowData.key}`\r\n ]\r\n await super.init()\r\n }\r\n async getUI() {\r\n let handleSave = async () => {\r\n FormSave(this.formState)\r\n }\r\n\r\n let handleCancel = async (e: Event) => {\r\n /* @ts-ignore */\r\n if (e.target.classList.contains(\"ovl-disabled\")) {\r\n return\r\n }\r\n _TableFormCloseEditRow(\r\n this.formState.tableDefId,\r\n this.formState.tableRowKey,\r\n {\r\n formState: this.formState,\r\n promptIfDirty: true,\r\n }\r\n )\r\n }\r\n\r\n let acceptEnabled = \"fd-button fd-button--positive\"\r\n let acceptEnabledIcon\r\n\r\n let declineEnabled = \"fd-button fd-button--negative\"\r\n let declineEnabledIcon\r\n\r\n let formValid = FormIsValid(this.formState)\r\n\r\n if (\r\n this.formState._state._noCancelOnEditFormIfFormStateWasInvalidWhenOpened\r\n ) {\r\n declineEnabled = \"fd-button ovl-disabled\"\r\n } else {\r\n declineEnabledIcon = html``\r\n }\r\n\r\n if (!formValid) {\r\n acceptEnabled = \"fd-button ovl-disabled\"\r\n } else {\r\n acceptEnabledIcon = html``\r\n }\r\n\r\n return html`\r\n \r\n \r\n \r\n ${acceptEnabledIcon}\r\n \r\n\r\n {\r\n if (e.which === 1) handleCancel(e)\r\n }}\r\n @click=${(e) => handleCancel(e)}\r\n id=\"ovl_row_save_cancel${this.id}\"\r\n title=\"${T(\"SYSCancel\")}\"\r\n class=\"fd-button fd-button--negative ${declineEnabled} ovl-rowformsavecancel3\"\r\n >\r\n ${declineEnabledIcon}\r\n \r\n \r\n \r\n `\r\n }\r\n}\r\n","import { html } from \"../../\"\r\nimport type { SYSFormState } from \"../forms/actions\"\r\nimport { SYSBaseElement } from \"../sysbaseelement\"\r\n\r\nexport type CellClass = {\r\n className?: string\r\n tooltip?: string\r\n}\r\n\r\nexport class SYSTableValidationSummaryRow extends SYSBaseElement {\r\n props: any\r\n row: { formState: SYSFormState; columnsCount: number }\r\n async init() {\r\n this.row = this.props()\r\n await super.init()\r\n }\r\n async getUI() {\r\n return html`\r\n \r\n this.row.formState}>\r\n \r\n \r\n `\r\n }\r\n}\r\n","import { html, SYSConfig } from \"../../../\"\r\nimport { _TableRowEditFormType } from \"../../../state\"\r\nimport { _setDialogVisible } from \"../../forms/helper\"\r\nimport { SYSBaseElement } from \"../../sysbaseelement\"\r\n\r\nimport type { EditMode, EditRowDef, SYSTableData, SYSTableDef } from \"../table\"\r\n\r\nexport class SYSTableRowEditFormDialog extends SYSBaseElement {\r\n def: SYSTableDef\r\n data: SYSTableData\r\n key: string\r\n editMode: EditMode\r\n async init() {\r\n let tableRowEditState: _TableRowEditFormType = this.dialogState.data\r\n this.data = SYSConfig.app.tableDefIds[tableRowEditState.tableDefId].getData(\r\n this.state\r\n )\r\n this.def = this.data.tableDef[tableRowEditState.tableDefId]\r\n this.key = tableRowEditState.key\r\n this.editMode = tableRowEditState.editMode\r\n\r\n if (this.editMode !== \"add\") {\r\n if (this.data.data[this.key] === undefined) {\r\n throw new Error(\r\n `Error OpenTableRowEdit: TableDefId: ${tableRowEditState.tableDefId} Key ${this.key} not found in data`\r\n )\r\n }\r\n }\r\n if (!tableRowEditState.formInitialised) {\r\n switch (this.editMode) {\r\n case \"edit\":\r\n await this.actions.ovl.table._TableEditRow({\r\n data: this.data,\r\n def: this.def,\r\n key: this.key,\r\n })\r\n break\r\n case \"add\":\r\n let addRes = await this.actions.ovl.table._TableAddRow({\r\n data: this.data,\r\n def: this.def,\r\n })\r\n this.key = addRes.key\r\n await this.actions.ovl.table._TableEditRow({\r\n data: this.data,\r\n def: this.def,\r\n key: this.key,\r\n initialFocusFieldKey: addRes.fieldKeyToFocus,\r\n })\r\n\r\n break\r\n case \"copy\":\r\n let copyRes = await this.actions.ovl.internal._TableCopyRow({\r\n data: this.data,\r\n def: this.def,\r\n key: this.key,\r\n })\r\n this.key = copyRes.key\r\n await this.actions.ovl.table._TableEditRow({\r\n data: this.data,\r\n def: this.def,\r\n key: this.key,\r\n initialFocusFieldKey: copyRes.fieldKeyToFocus,\r\n })\r\n\r\n break\r\n }\r\n }\r\n\r\n await super.init()\r\n }\r\n\r\n async getUI() {\r\n if (!this.dialogState.data) {\r\n return null\r\n }\r\n if (!this.def || !this.def.initialised) {\r\n _setDialogVisible(false, this.dialogState)\r\n throw new Error(\r\n \"please initialise underlying table first and make sure you open this dialog using OpenTableRowEditxxx - Actions\"\r\n )\r\n }\r\n let row = this.data.data[this.key]\r\n // if (this.editMode != \"edit\") {\r\n // this.key = this.def.uiState.currentlyAddingKey\r\n // }\r\n\r\n return html`\r\n {\r\n return {\r\n tableDef: this.def,\r\n data: this.data,\r\n row: row,\r\n key: this.key,\r\n mode: this.editMode,\r\n DialogType: \"SYSTableRowEdit\",\r\n }\r\n }}\r\n >\r\n \r\n `\r\n }\r\n}\r\n","import { html, SYSBaseElement, SYSTableDefIds } from \"../../../../..\"\r\nimport { TableGet } from \"../../../tableapi\"\r\n\r\nexport class SYSHeaderMenuFilter extends SYSBaseElement {\r\n defId: SYSTableDefIds\r\n instance: string\r\n columnKey: string\r\n async getUI() {\r\n let tableDef = TableGet(this.defId)\r\n let column = tableDef.def.columns[this.columnKey]\r\n let hasRangeFilter = column.filter.rangeFilter !== undefined\r\n let hasColumnFilter = column.filter.columnFilter !== undefined\r\n if (!hasRangeFilter && !hasColumnFilter) {\r\n return undefined\r\n }\r\n let rangeFilter\r\n if (hasRangeFilter) {\r\n rangeFilter = html``\r\n }\r\n let columnFilter\r\n if (hasColumnFilter) {\r\n columnFilter = html``\r\n }\r\n\r\n return html`
    \r\n \r\n
    ${columnFilter}${rangeFilter}
    \r\n
    `\r\n }\r\n}\r\n","import { html } from \"../../../../..\"\r\nimport { FieldIsVisible } from \"../../../../forms/fieldapi\"\r\nimport { SYSFormElement } from \"../../../../forms/sysformelement\"\r\nimport { TableGet } from \"../../../tableapi\"\r\n\r\nexport class SYSHeaderMenuRangeFilter extends SYSFormElement {\r\n instance: string\r\n async init() {\r\n this.formType = \"SYSHeaderMenuFilter\"\r\n this.formId = this.instance\r\n await super.init()\r\n }\r\n async getUI() {\r\n let filterTypeField = this.formState.fields[\"HeaderMenuRangeFilterType\"]\r\n\r\n if (!FieldIsVisible(filterTypeField)) {\r\n return undefined\r\n }\r\n\r\n let valueField = this.formState.fields[\"HeaderMenuRangeFilterValue\"]\r\n let value2Field = this.formState.fields[\"HeaderMenuRangeFilterValue2\"]\r\n let filterType\r\n let value\r\n let value2\r\n if (FieldIsVisible(filterTypeField)) {\r\n let tableDef = TableGet(\r\n this.state.ovl.libState.tableRowHeaderMenu.tableDefId1\r\n )\r\n let def = tableDef.def\r\n filterType = html` filterTypeField}\r\n >`\r\n switch (valueField.type) {\r\n case \"int\":\r\n case \"decimal\":\r\n case \"text\":\r\n value = html` valueField}>`\r\n value2 = html` value2Field}>`\r\n break\r\n case \"date\":\r\n value = html` valueField}>`\r\n value2 = html` value2Field}>`\r\n break\r\n case \"datetime\":\r\n value = html` valueField}\r\n >`\r\n value2 = html` value2Field}\r\n >`\r\n break\r\n\r\n case \"time\":\r\n value = html` valueField}>`\r\n value2 = html` value2Field}>`\r\n break\r\n }\r\n value2 = html`
    <=
    \r\n ${value2}`\r\n }\r\n return html`\r\n
    \r\n ${filterType}\r\n
    ${value}${value2}
    \r\n
    \r\n `\r\n }\r\n}\r\n","import { html, SYSBaseElement, SYSTableDefIds } from \"../../../../..\"\r\nimport { T } from \"../../../../../textapi\"\r\nimport { SYSTableSettings_ColumnFilter } from \"../columnfilter/tabledef\"\r\n\r\nimport { GetRowDisplayValue, GetRowRawValue } from \"../../../helpers\"\r\nimport { _ColumnColumnFilter } from \"../../../table\"\r\nimport {\r\n SYSTableDef,\r\n TableColumnFilter,\r\n TableGet,\r\n _TableGetReturnType,\r\n TableOpenColumnFilter,\r\n TableRebuild,\r\n} from \"../../../tableapi\"\r\nimport { FormGet } from \"../../../../forms/formapi\"\r\nimport { HeaderMenuFilterFieldsSetState } from \"../hookactions\"\r\n\r\nexport class SYSHeaderMenuColumnFilter extends SYSBaseElement {\r\n defId: SYSTableDefIds\r\n columnKey: string\r\n tableDef: _TableGetReturnType\r\n filter: _ColumnColumnFilter\r\n baseRows: {}\r\n baseDef: SYSTableDef\r\n\r\n getDisplayValue() {\r\n if (this.filter.type === \"none\") {\r\n return T(\"SYSFilterAll\")\r\n }\r\n let list = []\r\n let nullHandling = this.baseDef.columns[this.columnKey].nullHandling.enabled\r\n // let isCalculated =\r\n // this.baseDef.columns[this.columnKey].schema?.isCalculatedColumn\r\n if (this.filter.list) {\r\n this.filter.list.slice(0, 100).forEach((k) => {\r\n let foundRowKey = undefined\r\n Object.keys(this.baseRows).some((s) => {\r\n let val\r\n // if (isCalculated) {\r\n val = GetRowRawValue(\r\n this.baseDef,\r\n this.columnKey,\r\n this.baseRows[s],\r\n s,\r\n \"ColumnFilter\"\r\n )\r\n // } else {\r\n // val = this.baseRows[s][this.columnKey]\r\n // }\r\n\r\n if (val === k || (!nullHandling && k === \"\" && val === null)) {\r\n foundRowKey = s\r\n return true\r\n }\r\n })\r\n if (foundRowKey !== undefined) {\r\n let val = GetRowDisplayValue(\r\n this.baseDef,\r\n this.columnKey,\r\n this.baseRows[foundRowKey],\r\n foundRowKey,\r\n \"ColumnFilter\"\r\n )\r\n\r\n if (val === null) {\r\n list.push(T(\"SYSFilterNull\"))\r\n return\r\n }\r\n if (val === \"\") {\r\n list.push(T(\"SYSFilterEmpty\"))\r\n return\r\n }\r\n\r\n list.push(val)\r\n }\r\n })\r\n }\r\n\r\n return html`${this.filter.exclusive\r\n ? T(\"SYSFilterExclusive\") + \": \"\r\n : \"\"}${list.map((m, i) => html`${m}${i < list.length - 1 ? \", \" : \"\"}`)}`\r\n }\r\n\r\n async openAdvancedColumnFilter() {\r\n await TableOpenColumnFilter(this.defId, this.columnKey, {\r\n allowExclusive: true,\r\n })\r\n }\r\n async init() {\r\n this.tableDef = TableGet(this.defId)\r\n let baseTable = TableGet(this.defId)\r\n this.baseDef = baseTable.def\r\n this.baseRows = baseTable.rows\r\n await super.init()\r\n }\r\n async getUI() {\r\n this.filter =\r\n this.tableDef.def.uiState.filter.columns[this.columnKey].columnFilter\r\n\r\n let clearFilterButton = html` {\r\n if (\r\n await TableColumnFilter(this.tableDef.def.id, this.columnKey, [], {\r\n exclusive: false,\r\n _innerEvent: true,\r\n })\r\n ) {\r\n await TableRebuild(this.tableDef.def.id, { showProcess: true })\r\n HeaderMenuFilterFieldsSetState(\r\n FormGet(\"SYSHeaderMenuFilter\", { instance: \"1\" }).formState\r\n )\r\n }\r\n }}\r\n class=\"fd-button\"\r\n ?disabled=${this.filter.type === \"none\"}\r\n >\r\n \r\n `\r\n\r\n this.filter =\r\n this.tableDef.def.uiState.filter.columns[this.columnKey].columnFilter\r\n return html`
    \r\n {\r\n await this.openAdvancedColumnFilter()\r\n }}\r\n readonly\r\n >\r\n ${this.getDisplayValue()}\r\n
    \r\n\r\n {\r\n await this.openAdvancedColumnFilter()\r\n }}\r\n >\r\n \r\n \r\n ${clearFilterButton}\r\n `\r\n }\r\n}\r\n","import { html, SYSTableDefIds } from \"../../../../..\"\r\nimport { T } from \"../../../../../textapi\"\r\nimport { DialogOpen } from \"../../../../dialog/dialogapi\"\r\nimport {\r\n FieldForceChange,\r\n FieldIsVisible,\r\n FieldVal,\r\n SYSField,\r\n} from \"../../../../forms/fieldapi\"\r\nimport { FormIsValid } from \"../../../../forms/formapi\"\r\nimport { SYSFormElement } from \"../../../../forms/sysformelement\"\r\nimport {\r\n SYSTableDef,\r\n TableFormAddRow,\r\n TableFormEditRow,\r\n TableGet,\r\n} from \"../../../tableapi\"\r\nimport {\r\n _FilterSortChanged,\r\n _GetCurrentActiveTableSettingsFilterSortJsonString,\r\n _GetFilterSortPermission,\r\n} from \"../../tablesettings/helpers\"\r\n\r\nexport class SYSHeaderMenuFilterSortSettings extends SYSFormElement {\r\n tableDefId: SYSTableDefIds\r\n tableDef: SYSTableDef\r\n instance: string\r\n async init() {\r\n this.formType = \"SYSHeaderMenuFilter\"\r\n this.formId = this.instance\r\n this.tableDef = TableGet(this.tableDefId).def\r\n this.formIgnoreAutomaticFocusSet = true\r\n await super.init()\r\n }\r\n\r\n tagForUpdate(field: SYSField) {\r\n let filterSort = this.state.ovl.libState.tableSettings.filterSort\r\n filterSort.fieldToUpdate.formType = this.formType\r\n filterSort.fieldToUpdate.formId = this.formId\r\n filterSort.fieldToUpdate.fieldKey = field.fieldKey\r\n filterSort.currentFilterSortSettings =\r\n _GetCurrentActiveTableSettingsFilterSortJsonString(this.tableDefId)\r\n }\r\n\r\n async getUI() {\r\n let field = this.formState.fields[\"HeaderMenuSelectPersistedFilterSort\"]\r\n let filterSortPermissions = _GetFilterSortPermission(this.tableDefId)\r\n let chkTable = TableGet(\"SYSTableSettings_FilterSort\")\r\n if (!FieldIsVisible(field)) {\r\n return undefined\r\n }\r\n let val = FieldVal(field, { mode: \"Converted\" })\r\n let formIsValid = FormIsValid(this.formState)\r\n let editButtons\r\n let hasForcedFilter = !!TableGet(this.tableDefId).def.uiState.filter.filter\r\n .forcedFilterKeys\r\n let hasFilterSortChanges = \"\"\r\n if (_FilterSortChanged(this.tableDefId) || hasForcedFilter) {\r\n hasFilterSortChanges = \"fd-button--attention is-selected\"\r\n }\r\n let editButton\r\n let addButton\r\n let settingsButton\r\n\r\n let undoButton = html`\r\n {\r\n chkTable.def.uiState.filter.filter.forcedFilterKeys = undefined\r\n FieldForceChange(field)\r\n }}\r\n >\r\n \r\n \r\n `\r\n if (filterSortPermissions.write) {\r\n let addEnabled = formIsValid && !!val\r\n let editEnabled = false\r\n if (addEnabled) {\r\n let forCardCode =\r\n chkTable.rows[chkTable.getKeys({ byIdValue: val })[0]][\"CanBeUsedBy\"]\r\n editEnabled =\r\n filterSortPermissions.all ||\r\n forCardCode === null ||\r\n forCardCode === \"@@SYSUser\" ||\r\n (filterSortPermissions.company &&\r\n forCardCode === this.state.ovl.user.cardCode)\r\n }\r\n let moreEnabled =\r\n chkTable.getKeys({ byKeys: \"StaticFiltered\" }).length > 0\r\n\r\n editButton = html`\r\n {\r\n let table = TableGet(\r\n \"SYSTableSettings_FilterSort\",\r\n {\r\n byIdValue: val,\r\n }\r\n )\r\n // we need to remember the field\r\n // because if user changes name it should be directly reflected in this formstate as well\r\n\r\n this.tagForUpdate(field)\r\n\r\n await TableFormEditRow(\r\n \"SYSTableSettings_FilterSort\",\r\n table.getKeys()[0]\r\n )\r\n }}\r\n >\r\n \r\n \r\n `\r\n\r\n addButton = html`\r\n {\r\n this.tagForUpdate(field)\r\n await TableFormAddRow(\"SYSTableSettings_FilterSort\")\r\n }}\r\n >\r\n \r\n \r\n `\r\n\r\n settingsButton = html`\r\n {\r\n this.tagForUpdate(field)\r\n await DialogOpen(\"SYSTableSettings_FilterSort\")\r\n }}\r\n >\r\n \r\n \r\n `\r\n }\r\n if (!this.state.ovl.libState.localHitListState.open) {\r\n editButtons = html`\r\n ${undoButton} ${editButton} ${addButton} ${settingsButton}\r\n `\r\n }\r\n\r\n let list\r\n list = html` field}>`\r\n let res\r\n\r\n res = html`\r\n
    ${list} ${editButtons}
    \r\n `\r\n\r\n return html`
  • \r\n \r\n ${res}\r\n
  • `\r\n }\r\n}\r\n","import { html, SYSConfig } from \"../../..\"\r\nimport { SYSBaseElement } from \"../../sysbaseelement\"\r\nimport type { HeaderMenuDef } from \"../headermenu\"\r\nimport type { SYSTableData, SYSTableDef } from \"../table\"\r\n\r\nexport class SYSTableRowHeaderMenuDialog extends SYSBaseElement {\r\n def: SYSTableDef\r\n data: SYSTableData\r\n instance: string\r\n async init() {\r\n this.instance = this.dialogInstance\r\n let tableRowHeaderMenuState = this.state.ovl.libState.tableRowHeaderMenu\r\n let defId = tableRowHeaderMenuState[`tableDefId${this.instance}`]\r\n this.data = SYSConfig.app.tableDefIds[defId].getData(this.state)\r\n this.def = this.data.tableDef[defId]\r\n await super.init()\r\n }\r\n\r\n async getUI() {\r\n return html`\r\n {\r\n return {\r\n def: { data: this.data, def: this.def },\r\n instance: this.instance,\r\n }\r\n }}\r\n >\r\n `\r\n }\r\n}\r\n","import { SYSTableSettingsColumnFilterDialog } from \"./library/table/tablerowheadermenu/tablesettings/columnfilter/columnfilter\"\r\nimport { SYSTableSettingsFilterSortDialog } from \"./library/table/tablerowheadermenu/tablesettings/filtersort/tabledialog\"\r\nimport { OvlAddComponent, OvlAddDialog } from \"./global/globals\"\r\nimport { SYSDialog } from \"./library/dialog/dialog\"\r\nimport { SYSDialogHolder } from \"./library/dialog/sysdialogholder\"\r\nimport { SYSEditorAsset } from \"./library/forms/controls/asset\"\r\n\r\nimport { SYSCheckbox } from \"./library/forms/controls/checkbox\"\r\nimport { SYSDate } from \"./library/forms/controls/date\"\r\nimport { SYSDateTime } from \"./library/forms/controls/datetime\"\r\nimport { SYSFormValidationHint } from \"./library/forms/controls/formvalidationhint\"\r\nimport { SYSListControl } from \"./library/forms/controls/listcontrol\"\r\nimport { SYSOption } from \"./library/forms/controls/option\"\r\nimport { SYSCustomValueHint } from \"./library/forms/controls/parts/controlcustomvaluehint\"\r\nimport { SYSControlLabel } from \"./library/forms/controls/parts/controllabel\"\r\nimport { SYSValidationHint } from \"./library/forms/controls/parts/controlvalidationhint\"\r\nimport { SYSHitList } from \"./library/forms/controls/parts/hitlist\"\r\nimport { SYSHitListDialog } from \"./library/forms/controls/parts/hitlistdialog/hitlistdialog\"\r\nimport { SYSOkCancelDeleteFooter } from \"./library/forms/controls/parts/okcanceldeletefooter\"\r\nimport { SYSTextArea } from \"./library/forms/controls/textarea\"\r\nimport { SYSTextbox } from \"./library/forms/controls/textbox\"\r\nimport { SYSTime } from \"./library/forms/controls/time\"\r\nimport { SYSSnack } from \"./library/snack/snack\"\r\nimport { SYSDialogContainer } from \"./library/specialcontainers/dialogcontainer/dialogcontainter\"\r\nimport { SYSScreenContainer } from \"./library/specialcontainers/screencontainer/screencontainter\"\r\nimport { SYSTableHeaderMenu } from \"./library/table/headermenu\"\r\n\r\nimport { SYSTableNavControl } from \"./library/table/navcontrol\"\r\nimport { SYSTableRow } from \"./library/table/row\"\r\nimport { SYSTableRowControl } from \"./library/table/rowcontrol\"\r\nimport { SYSTableRowForm } from \"./library/table/rowform\"\r\nimport { SYSTableRowFormBig } from \"./library/table/rowformbig\"\r\nimport { SYSTableRowSaveCancel } from \"./library/table/rowformsavecancel\"\r\nimport { SYSTableValidationSummaryRow } from \"./library/table/rowvalidationsummary\"\r\nimport { SYSTableRowWrapper } from \"./library/table/rowwrapper\"\r\nimport { SYSTableHeader } from \"./library/table/table\"\r\n/*import { SYSTableRowTableRowDetailView } from \"./library/table/tablerowdetailview/tablerowdetailview\"*/\r\nimport { SYSTableRowEditFormDialog } from \"./library/table/tableroweditformdialog/tableroweditformdialog\"\r\nimport { SYSHeaderMenuFilter } from \"./library/table/tablerowheadermenu/tablesettings/filter/filter\"\r\nimport { SYSHeaderMenuRangeFilter } from \"./library/table/tablerowheadermenu/tablesettings/filter/rangefilter\"\r\nimport { SYSHeaderMenuColumnFilter } from \"./library/table/tablerowheadermenu/tablesettings/filter/columnfilter\"\r\n\r\nimport { SYSHeaderMenuFilterSortSettings } from \"./library/table/tablerowheadermenu/tablesettings/filtersortsettings/filtersortsettings\"\r\nimport { SYSTableRowHeaderMenuDialog } from \"./library/table/tablerowheadermenu/tablerowheadermenu\"\r\n\r\n// don't forget to add the display block in css - file\r\nexport const defineElements = () => {\r\n OvlAddComponent(\"ovl-screencontainer\", SYSScreenContainer)\r\n OvlAddComponent(\"ovl-dialogcontainer\", SYSDialogContainer)\r\n OvlAddComponent(\"ovl-trowcontrol\", SYSTableRowControl)\r\n OvlAddComponent(\"ovl-tnavcontrol\", SYSTableNavControl)\r\n //AddSYSComponent(\"ovl-tableview\", SYSTableViewControl)\r\n OvlAddComponent(\"ovl-table\", SYSTableHeader)\r\n OvlAddComponent(\"ovl-trow\", SYSTableRow)\r\n OvlAddComponent(\"ovl-trowvs\", SYSTableValidationSummaryRow)\r\n OvlAddComponent(\"ovl-trg\", SYSTableRowWrapper)\r\n OvlAddComponent(\"ovl-trowform\", SYSTableRowForm)\r\n OvlAddComponent(\"ovl-trowformb\", SYSTableRowFormBig)\r\n /*OvlAddComponent(\"ovl-trowdetailview\", SYSTableRowTableRowDetailView)*/\r\n OvlAddComponent(\"ovl-trowsc\", SYSTableRowSaveCancel)\r\n OvlAddComponent(\"ovl-textarea\", SYSTextArea)\r\n OvlAddComponent(\"ovl-textbox\", SYSTextbox)\r\n OvlAddComponent(\"ovl-asset\", SYSEditorAsset)\r\n OvlAddComponent(\"ovl-checkbox\", SYSCheckbox)\r\n OvlAddComponent(\"ovl-listcontrol\", SYSListControl)\r\n OvlAddComponent(\"ovl-option\", SYSOption)\r\n OvlAddComponent(\"ovl-hitlist\", SYSHitList)\r\n OvlAddComponent(\"ovl-timebox\", SYSTime)\r\n OvlAddComponent(\"ovl-datebox\", SYSDate)\r\n OvlAddComponent(\"ovl-datetimebox\", SYSDateTime)\r\n OvlAddComponent(\"ovl-dialogholder\", SYSDialogHolder)\r\n OvlAddComponent(\"ovl-snack\", SYSSnack)\r\n OvlAddComponent(\"ovl-controlcustomhint\", SYSCustomValueHint)\r\n OvlAddComponent(\"ovl-controlvalidationhint\", SYSValidationHint)\r\n OvlAddComponent(\"ovl-formvalidationhint\", SYSFormValidationHint)\r\n OvlAddComponent(\"ovl-controllabel\", SYSControlLabel)\r\n OvlAddComponent(\"ovl-tableheadermenu\", SYSTableHeaderMenu)\r\n OvlAddComponent(\"ovl-okcanceldeletefooter\", SYSOkCancelDeleteFooter)\r\n OvlAddComponent(\"ovl-headermenufilter\", SYSHeaderMenuFilter)\r\n OvlAddComponent(\"ovl-headermenurangefilter\", SYSHeaderMenuRangeFilter)\r\n OvlAddComponent(\"ovl-headermenucolumnfilter\", SYSHeaderMenuColumnFilter)\r\n OvlAddComponent(\r\n \"ovl-headermenufiltersortsettings\",\r\n SYSHeaderMenuFilterSortSettings\r\n )\r\n\r\n OvlAddDialog(\r\n SYSTableSettingsColumnFilterDialog,\r\n \"SYSTableSettings_ColumnFilter\"\r\n )\r\n\r\n OvlAddDialog(SYSTableSettingsFilterSortDialog, \"SYSTableSettings_FilterSort\")\r\n\r\n OvlAddDialog(SYSDialog, \"SYSModal\")\r\n OvlAddDialog(SYSTableRowEditFormDialog, \"SYSTableRowEdit\")\r\n OvlAddDialog(SYSHitListDialog, \"SYSHitListDialog\")\r\n OvlAddDialog(SYSTableRowHeaderMenuDialog, \"SYSTableHeaderMenu\")\r\n}\r\n","import type { SYSActions } from \"./\"\r\nimport { SYSConfig, ovl } from \"./\"\r\nimport { SYSValidatorsFunctions } from \"./appdefformvalidation\"\r\nimport { AppDefPermission } from \"./config\"\r\n\r\nimport { _registerComponents } from \"./global/globals\"\r\nimport { handleScreenVisible } from \"./helpers\"\r\nimport { validatorsFunctions } from \"./library/forms/helper\"\r\nimport type { _ScreenState } from \"./library/sysbaseelement\"\r\nimport { hooks } from \"./library/table/tablerowheadermenu/tablesettings/allactions\"\r\nlet SYSTableSettings = { hooks }\r\n\r\nimport { defineElements } from \"./registercomponents\"\r\nimport { actionTracking } from \"./tracker/proxyhandler\"\r\n\r\nconst interceptorAsyncFn = (beforeFn, afterFn, originalFn, key) => {\r\n return async (value) => {\r\n let execution = {\r\n handled: false,\r\n currentRes: undefined,\r\n canceled: false,\r\n cancel: function () {\r\n this.canceled = true\r\n this.handled = true\r\n },\r\n data: {},\r\n }\r\n try {\r\n actionTracking.actionRunning = true\r\n actionTracking.canceled = false\r\n let res\r\n if (beforeFn) {\r\n actionTracking.lastActionName = `${key}_Before`\r\n res = await beforeFn(value, {\r\n execution,\r\n global: {\r\n getState: () => ovl.getState(),\r\n getActions: () => ovl.getActions(),\r\n },\r\n })\r\n }\r\n if (originalFn && !execution.handled) {\r\n actionTracking.lastActionName = key\r\n let res2 = await originalFn(value, {\r\n execution,\r\n global: {\r\n getState: () => ovl.getState(),\r\n getActions: () => ovl.getActions(),\r\n },\r\n })\r\n if (res !== undefined) {\r\n res = Object.assign(res, res2)\r\n } else {\r\n res = res2\r\n }\r\n }\r\n if (afterFn && !execution.handled) {\r\n actionTracking.lastActionName = `${key}_After`\r\n execution.currentRes = res\r\n let res3 = await afterFn(value, {\r\n execution,\r\n global: {\r\n getState: () => ovl.getState(),\r\n getActions: () => ovl.getActions(),\r\n },\r\n })\r\n if (res !== undefined) {\r\n res = Object.assign(res, res3)\r\n } else {\r\n res = res3\r\n }\r\n }\r\n return res\r\n } finally {\r\n actionTracking.canceled = execution.canceled\r\n actionTracking.actionRunning = false\r\n }\r\n }\r\n}\r\n\r\nconst interceptorFn = (beforeFn, afterFn, originalFn, key) => {\r\n return (value) => {\r\n let execution = {\r\n handled: false,\r\n currentRes: undefined,\r\n canceled: false,\r\n cancel: () => {\r\n //@ts-ignore\r\n this.canceled = true\r\n //@ts-ignore\r\n this.handled = true\r\n },\r\n data: {},\r\n }\r\n try {\r\n actionTracking.actionRunning = true\r\n actionTracking.canceled = false\r\n let res\r\n if (beforeFn) {\r\n actionTracking.lastActionName = `${key}_Before`\r\n res = beforeFn(value, {\r\n execution,\r\n global: {\r\n getState: () => ovl.getState(),\r\n getActions: () => ovl.getActions(),\r\n },\r\n })\r\n }\r\n if (originalFn && !execution.handled) {\r\n actionTracking.lastActionName = key\r\n let res2 = originalFn(value, {\r\n execution,\r\n global: {\r\n getState: () => ovl.getState(),\r\n getActions: () => ovl.getActions(),\r\n },\r\n })\r\n if (res !== undefined) {\r\n res = Object.assign(res, res2)\r\n } else {\r\n res = res2\r\n }\r\n }\r\n if (afterFn && !execution.handled) {\r\n actionTracking.lastActionName = `${key}_After`\r\n execution.currentRes = res\r\n let res3 = afterFn(value, {\r\n execution,\r\n global: {\r\n getState: () => ovl.getState(),\r\n getActions: () => ovl.getActions(),\r\n },\r\n })\r\n if (res !== undefined) {\r\n res = Object.assign(res, res3)\r\n } else {\r\n res = res3\r\n }\r\n }\r\n return res\r\n } finally {\r\n actionTracking.canceled = execution.canceled\r\n actionTracking.actionRunning = false\r\n }\r\n }\r\n}\r\n\r\nconst injectActions = (obj) =>\r\n Object.keys(obj).forEach((item) => {\r\n if (typeof obj[item] === \"function\") {\r\n // check if there are \"Before\" Actions without Main Action then switch it to Main Action\r\n let chk = item.toString()\r\n if (chk.endsWith(\"_Before\")) {\r\n let chk2 = chk.substring(0, chk.length - 7)\r\n if (!obj[chk2]) {\r\n // there is a Before Fn but no Main Fn\r\n // so make the BeforeFn the Main Function\r\n obj[chk2] = obj[item]\r\n delete obj[item]\r\n item = chk2\r\n }\r\n } else if (chk.endsWith(\"_After\")) {\r\n let chk2 = chk.substring(0, chk.length - 6)\r\n if (!obj[chk2]) {\r\n // there is a After Fn but no Main Fn\r\n // so make the AfterFn the Main Function\r\n obj[chk2] = obj[item]\r\n delete obj[item]\r\n item = chk2\r\n }\r\n }\r\n\r\n injectFn(obj, item)\r\n } else if (typeof obj[item] === \"object\") {\r\n injectActions(obj[item])\r\n }\r\n })\r\n\r\nexport const injectFn = (obj, item) => {\r\n let fnname = item.toString()\r\n if (fnname.endsWith(\"_Before\") || fnname.endsWith(\"_After\")) {\r\n return\r\n }\r\n let isAsync = obj[item].toString().startsWith(\"async\")\r\n let beforeFn = undefined\r\n let afterFn = undefined\r\n\r\n if (obj[`${item}_Before`]) {\r\n beforeFn = obj[`${item}_Before`]\r\n }\r\n if (obj[`${item}_After`]) {\r\n afterFn = obj[`${item}_After`]\r\n }\r\n\r\n if (isAsync) {\r\n obj[item] = interceptorAsyncFn(beforeFn, afterFn, obj[item], item)\r\n } else {\r\n obj[item] = interceptorFn(beforeFn, afterFn, obj[item], item)\r\n }\r\n}\r\n\r\n// prepare screens state\r\n//@ts-ignore\r\nexport const init = (\r\n appState,\r\n appActions,\r\n appScreens,\r\n appDialogs,\r\n appLongRunningProcess,\r\n\r\n ovlState,\r\n ovlActions,\r\n\r\n baseScreens,\r\n baseDialogs,\r\n baseLongRunningProcess,\r\n forms,\r\n baseForms,\r\n appEditors,\r\n baseEditors,\r\n appValidators,\r\n sysComponentsActions\r\n) => {\r\n // sanitize SYSConfig\r\n if (SYSConfig.offline === undefined) {\r\n SYSConfig.offline = { enabled: false }\r\n }\r\n if (SYSConfig.translation === undefined) {\r\n SYSConfig.translation = { useLocal: false, showOnlyKeys: false }\r\n }\r\n if (SYSConfig.fetch === undefined) {\r\n SYSConfig.fetch = {}\r\n }\r\n SYSConfig.app.tableDefIds[\"SYSTableSettings_FilterSort\"] = {\r\n getData: (state) =>\r\n state.ovl.features.SYSTableSettings.tables.SYSTableSettings_FilterSort,\r\n }\r\n SYSConfig.app.tableDefIds[\"SYSTableSettings_ColumnFilter\"] = {\r\n getData: (state) =>\r\n state.ovl.features.SYSTableSettings.tables.SYSTableSettings_ColumnFilter,\r\n }\r\n\r\n SYSConfig.app.tableDefIds[\"SYSTranslation\"] = {\r\n getData: (state) => state.ovl.features.SYSTranslation.tables.SYSTranslation,\r\n }\r\n\r\n SYSConfig.app.tableDefIds[\"SYSPortalSettings\"] = {\r\n getData: (state) =>\r\n state.ovl.features.SYSPortalSettings.tables.SYSPortalSettings,\r\n }\r\n\r\n SYSConfig.app.tableDefIds[\"SYSAudit\"] = {\r\n getData: (state) => state.ovl.features.SYSAudit.tables.SYSAudit,\r\n }\r\n\r\n SYSConfig.app.tableDefIds[\"SYSUserAdministration_User\"] = {\r\n getData: (state) =>\r\n state.ovl.features.SYSUserAdministration.tables\r\n .SYSUserAdministration_User,\r\n }\r\n\r\n SYSConfig.app.tableDefIds[\"SYSUserAdministration_UserRoleTransfer\"] = {\r\n getData: (state) =>\r\n state.ovl.features.SYSUserAdministration.tables\r\n .SYSUserAdministration_User,\r\n }\r\n\r\n SYSConfig.app.tableDefIds[\"SYSUserAdministration_Role\"] = {\r\n getData: (state) =>\r\n state.ovl.features.SYSUserAdministration.tables\r\n .SYSUserAdministration_Role,\r\n }\r\n\r\n SYSConfig.app.tableDefIds[\"SYSUserAdministration_Permission\"] = {\r\n getData: (state) =>\r\n state.ovl.features.SYSUserAdministration.tables\r\n .SYSUserAdministration_Permission,\r\n }\r\n\r\n SYSConfig.app.tableDefIds[\"SYSUserAdministration_ResultingPermission\"] = {\r\n getData: (state) =>\r\n state.ovl.features.SYSUserAdministration.tables\r\n .SYSUserAdministration_Permission,\r\n }\r\n\r\n SYSConfig.app.tableDefIds[\"SYSUserAdministration_UserRole\"] = {\r\n getData: (state) =>\r\n state.ovl.features.SYSUserAdministration.tables\r\n .SYSUserAdministration_UserRole,\r\n }\r\n\r\n SYSConfig.app.tableDefIds[\"SYSUserAdministration_Company\"] = {\r\n getData: (state) =>\r\n state.ovl.features.SYSUserAdministration.tables\r\n .SYSUserAdministration_Company,\r\n }\r\n\r\n /* Permission Administration */\r\n ;(SYSConfig.app.permissions[\"SYSPA\"] = {\r\n useModifiers: false,\r\n }),\r\n /* User Administration */\r\n (SYSConfig.app.permissions[\"SYSUA\"] = {\r\n useModifiers: true,\r\n }),\r\n /* Role Administration */\r\n (SYSConfig.app.permissions[\"SYSRA\"] = {\r\n useModifiers: true,\r\n }),\r\n /* Company Administration */\r\n (SYSConfig.app.permissions[\"SYSCA\"] = {\r\n useModifiers: true,\r\n }),\r\n /* User Role Administration */\r\n (SYSConfig.app.permissions[\"SYSUR\"] = {\r\n useModifiers: true,\r\n }),\r\n /* Audit */\r\n (SYSConfig.app.permissions[\"SYSAU\"] = {\r\n useModifiers: false,\r\n }),\r\n /* Translation */\r\n (SYSConfig.app.permissions[\"SYSTR\"] = {\r\n useModifiers: true,\r\n }),\r\n /* TableSettings */\r\n (SYSConfig.app.permissions[\"SYSTS\"] = {\r\n useModifiers: true,\r\n }),\r\n /* PortalSettings */\r\n (SYSConfig.app.permissions[\"SYSST\"] = {\r\n useModifiers: true,\r\n })\r\n\r\n if (!SYSConfig._system.appId) {\r\n SYSConfig._system.appId = \"01\"\r\n }\r\n\r\n // make sure its always 3 digits\r\n SYSConfig._system.appId = SYSConfig._system.appId.padStart(2, \"0\")\r\n\r\n let _state: any = { ovl: ovlState, app: appState }\r\n _state.ovl.screens.screens = {}\r\n\r\n Object.keys(appValidators).forEach((k) => {\r\n validatorsFunctions[k] = { type: \"Custom\" }\r\n // let defaults: ValidatorOptions = appValidators[k]\r\n // if (defaults === undefined) {\r\n // defaults = { validation: { displayType: \"WhenTouched\" } }\r\n // }\r\n // validationDefaults.validators[k] = defaults\r\n })\r\n\r\n Object.keys(SYSValidatorsFunctions).forEach((k) => {\r\n validatorsFunctions[k] = { fn: SYSValidatorsFunctions[k], type: \"SYS\" }\r\n })\r\n\r\n Object.keys(appScreens).forEach((k) => {\r\n _state.ovl.screens.screens[k] = {\r\n screenCloseBehaviour: appScreens[k].screenCloseBehaviour,\r\n noHistory: appScreens[k].noHistory,\r\n callNavigateInHookOnRehydrate:\r\n appScreens[k].callNavigateInHookOnRehydrate,\r\n instance: {},\r\n }\r\n })\r\n\r\n Object.keys(baseScreens).forEach((k) => {\r\n _state.ovl.screens.screens[k] = {\r\n screenCloseBehaviour: baseScreens[k].screenCloseBehaviour,\r\n noHistory: baseScreens[k].noHistory,\r\n instance: {},\r\n }\r\n })\r\n\r\n _state.ovl.forms = {}\r\n\r\n Object.keys(forms)\r\n .concat(Object.keys(baseForms))\r\n .concat(Object.keys(baseEditors))\r\n .concat(Object.keys(appEditors))\r\n .forEach((k) => {\r\n _state.ovl.forms[k] = {}\r\n })\r\n\r\n // prepare dialogs state\r\n _state.ovl.dialogs = {}\r\n Object.keys(appDialogs)\r\n .concat(Object.keys(baseDialogs))\r\n .concat(Object.keys(baseEditors))\r\n .concat(Object.keys(appEditors))\r\n .forEach((k) => {\r\n _state.ovl.dialogs[k] = {\r\n rehydratable:\r\n appDialogs[k]?.rehydratable === undefined ||\r\n appDialogs[k]?.rehydratable === true,\r\n instance: {},\r\n }\r\n })\r\n\r\n // prepare longRunningProcess state\r\n _state.ovl.longRunningProcessTracker = {}\r\n Object.keys(baseLongRunningProcess)\r\n .concat()\r\n //.concat(Object.keys(baseLongRunningProcess))\r\n .forEach((k) => {\r\n _state.ovl.longRunningProcessTracker[k] = {\r\n snack: baseLongRunningProcess[k].snack,\r\n snackFixedByAppDef: !!baseLongRunningProcess[k].snack,\r\n lockScreen: baseLongRunningProcess[k].lockScreen,\r\n instance: {},\r\n isRefresh: baseLongRunningProcess[k].isRefresh,\r\n }\r\n // we already need an default instance here elsewise ProcessIsRunning will not track rendercomp correctly\r\n _state.ovl.longRunningProcessTracker[k].instance[k] = { isRunning: false }\r\n })\r\n\r\n Object.keys(appLongRunningProcess)\r\n //.concat(Object.keys(appLongRunningProcess))\r\n .forEach((k) => {\r\n _state.ovl.longRunningProcessTracker[k] = {\r\n snack: appLongRunningProcess[k].snack,\r\n snackFixedByAppDef: !!appLongRunningProcess[k].snack,\r\n lockScreen: appLongRunningProcess[k].lockScreen,\r\n instance: {},\r\n isRefresh: appLongRunningProcess[k].isRefresh,\r\n }\r\n // we already need an default instance here elsewise ProcessIsRunning will not track rendercomp correctly\r\n _state.ovl.longRunningProcessTracker[k].instance[k] = { isRunning: false }\r\n })\r\n\r\n Object.keys(appActions.features).forEach((f) => {\r\n if (!appActions.features[f].hooks) {\r\n appActions.features[f].hooks = {}\r\n }\r\n if (!appActions.features[f].actions) {\r\n appActions.features[f].actions = {}\r\n }\r\n })\r\n\r\n Object.keys(SYSConfig.app.screens).forEach((f) => {\r\n if (!appActions.screens[f]) {\r\n appActions.screens[f] = { hooks: {}, actions: {} }\r\n } else {\r\n if (!appActions.screens[f].hooks) {\r\n appActions.screens[f].hooks = {}\r\n }\r\n if (!appActions.screens[f].actions) {\r\n appActions.screens[f].actions = {}\r\n }\r\n }\r\n })\r\n\r\n sysComponentsActions.features.SYSTableSettings = SYSTableSettings\r\n // if there are syscomponentFeatures with same key as appFeatures merge em\r\n Object.keys(sysComponentsActions.features).forEach((s) => {\r\n if (appActions.features[s]) {\r\n appActions.features[s].hooks = Object.assign(\r\n appActions.features[s].hooks,\r\n sysComponentsActions.features[s].hooks\r\n )\r\n appActions.features[s].actions = Object.assign(\r\n appActions.features[s].actions,\r\n sysComponentsActions.features[s].actions\r\n )\r\n } else {\r\n appActions.features[s] = sysComponentsActions.features[s]\r\n }\r\n })\r\n //same for screens\r\n Object.keys(sysComponentsActions.screens).forEach((s) => {\r\n if (appActions.screens[s]) {\r\n appActions.screens[s].hooks = Object.assign(\r\n appActions.screens[s].hooks,\r\n sysComponentsActions.screens[s].hooks\r\n )\r\n appActions.screens[s].actions = Object.assign(\r\n appActions.screens[s].actions,\r\n sysComponentsActions.screens[s].actions\r\n )\r\n } else {\r\n appActions.screens[s] = sysComponentsActions.screens[s]\r\n }\r\n })\r\n\r\n let _actions: any = {}\r\n _actions.ovl = ovlActions\r\n _actions.app = appActions\r\n // find the functions in actions and inject our own action caller\r\n injectActions(_actions)\r\n\r\n return {\r\n state: _state,\r\n actions: _actions,\r\n }\r\n}\r\n\r\nexport const defineSYSElements = () => {\r\n defineElements()\r\n}\r\n\r\nexport const registerElements = () => {\r\n let screenState = ovl.getState().ovl.screens.screens\r\n let dialogState = ovl.getState().ovl.dialogs\r\n //sheet.innerHTML =\r\n _registerComponents._customElementList.forEach((m, i) => {\r\n try {\r\n customElements.define(m.tagName, m.comp)\r\n if (m.screen) {\r\n // also register it as a screen\r\n screenState[m.screen].tag = m.tagName\r\n } else if (m.dialog) {\r\n // also register it as a dialog\r\n dialogState[m.dialog].tag = m.tagName\r\n }\r\n } catch (err) {\r\n console.error(`error registering ${m.tagName}: ${err}`)\r\n }\r\n })\r\n\r\n _registerComponents._customElementList = []\r\n}\r\n\r\n// export const addDefaultReactors = () => {\r\n// let screensState = ovl.getState().ovl.screens.screens\r\n// Object.keys(screensState).forEach((screenKey) => {\r\n// AddGlobalReactor(\r\n// [`ovl.screens.screens.${screenKey}.visible`],\r\n// handleScreenVisible\r\n// )\r\n// })\r\n// }\r\n","import type {\r\n SYSColumnDef,\r\n SYSTableDef,\r\n} from \"../../../../../library/table/tableapi\"\r\n\r\nexport type SYSTableSettings_FilterSort = {\r\n Code?: string\r\n U_Desc?: string\r\n // CanBeUsedBy will be a list: User/Company A/Company B/.../All\r\n // whereas User means is just valid for the USer, Company A _> its valid for all Users of Company A, All -> valid for all Users\r\n CanBeUsedBy?: string\r\n U_FilterSortSettings?: string\r\n U_CntctCode?: number\r\n}\r\n\r\nexport type SYSTableSettings_FilterSortSelect = {\r\n Code?: string\r\n CardName?: string\r\n U_Desc?: string\r\n // CanBeUsedBy will be a list: User/Company A/Company B/.../All\r\n // whereas User means is just valid for the USer, Company A _> its valid for all Users of Company A, All -> valid for all Users\r\n CanBeUsedBy?: \"@@SYSAll\" | \"@@SYSUser\" | string\r\n UserCompanyName?: string\r\n UserName?: string\r\n U_CntctCode?: number\r\n}\r\n\r\nlet columns: { [key in keyof SYSTableSettings_FilterSort]: SYSColumnDef } = {\r\n U_Desc: {\r\n sortable: true,\r\n ui: { labelTranslationKey: \"SYSTableSettingsFilterSortColName\" },\r\n schema: { nullable: false },\r\n },\r\n\r\n CanBeUsedBy: {\r\n filter: { columnFilter: { type: \"none\" } },\r\n schema: { nullable: false },\r\n sortable: true,\r\n ui: { labelTranslationKey: \"SYSTableSettingsFilterSortColCanBeUsedBy\" },\r\n list: {\r\n valueField: \"Val\",\r\n displayField: \"Desc\",\r\n },\r\n },\r\n\r\n U_CntctCode: {\r\n filter: { columnFilter: { type: \"none\" } },\r\n sortable: true,\r\n\r\n type: \"int\",\r\n list: {\r\n valueField: \"Val\",\r\n displayField: \"Desc\",\r\n displayValueField: false,\r\n },\r\n ui: { labelTranslationKey: \"SYSTableSettingsFilterSortColU_CntctCode\" },\r\n },\r\n}\r\n\r\nexport let tblTableSettings_FilterSort: SYSTableDef = {\r\n feature: \"SYSTableSettings\",\r\n id: \"SYSTableSettings_FilterSort\",\r\n database: {\r\n dataIdField: \"Code\",\r\n dbInsertMode: \"AutoGUID\",\r\n },\r\n server: {\r\n endpoint: \"tablesettings/filtersort\",\r\n },\r\n options: {\r\n navType: \"custom\",\r\n initial_sort: { field: \"Name\", direction: \"asc\" },\r\n },\r\n features: {\r\n showFooterButtons: true,\r\n\r\n delete: true,\r\n edit: true,\r\n autoCloseButtonIfInsideDialog: true,\r\n },\r\n columns,\r\n}\r\n","import { SYSTableDefIds } from \"../../../../../../src\"\r\nlet defId: SYSTableDefIds = undefined\r\nlet columnKey = \"\"\r\nlet additionalColumnKey = \"\"\r\nlet allowExclusive = true\r\n\r\nexport let columnFilter = {\r\n defId,\r\n columnKey,\r\n additionalColumnKey,\r\n allowExclusive,\r\n}\r\n","import { SYSTableDefIds } from \"../../../..\"\r\nimport { columnFilter } from \"./columnfilter/state\"\r\nlet tableDefIdPerDialog: { [key: string]: SYSTableDefIds } = {}\r\nlet filterSort = {\r\n fieldToUpdate: {\r\n formType: \"\",\r\n formId: \"\",\r\n fieldKey: \"\",\r\n },\r\n currentFilterSortSettings: \"\",\r\n currentTableDefId: \"\",\r\n tableDefIdPerDialog,\r\n // these are simple array result lookups which will be used in list type getlist and reduced to nice form\r\n // they will only contain valid data (acoording permissions)\r\n lookups: {\r\n CardCode: undefined,\r\n U_CntctCode: undefined,\r\n },\r\n}\r\nexport let SYSTableSettingsState = { filterSort, columnFilter }\r\n","import type { SYSTableDef } from \"../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport let tblAudit: SYSTableDef = {\r\n id: \"SYSAudit\",\r\n title: { show: true, translationKey: \"SYSAuditTitle\" },\r\n feature: undefined,\r\n database: {\r\n dataIdField: \"Id\",\r\n },\r\n server: {\r\n endpoint: \"audit\",\r\n },\r\n options: {\r\n initial_sort: { field: \"Date\", direction: \"desc\" },\r\n initial_paging: { page: 0, pageSize: 200 },\r\n },\r\n\r\n features: {\r\n detailView: \"EnabledOnlyMobile\",\r\n page: true,\r\n showFooterButtons: true,\r\n filter: true,\r\n },\r\n columns: {\r\n Date: {\r\n type: \"datetime\",\r\n ui: { format: \"timestamp\" },\r\n sortable: true,\r\n filter: { rangeFilter: { selected: \"none\" } },\r\n },\r\n U_UserCode: {\r\n sortable: true,\r\n filter: { columnFilter: { type: \"none\" } },\r\n },\r\n U_User: {\r\n sortable: true,\r\n filter: { columnFilter: { type: \"none\" } },\r\n },\r\n U_Role: {\r\n sortable: true,\r\n filter: { columnFilter: { type: \"none\" } },\r\n },\r\n\r\n U_Operation: {\r\n sortable: true,\r\n filter: { columnFilter: { type: \"none\" } },\r\n },\r\n\r\n U_IDField: {\r\n sortable: true,\r\n },\r\n U_IDValue: {\r\n sortable: true,\r\n },\r\n U_TableName: {\r\n sortable: true,\r\n filter: { columnFilter: { type: \"none\" } },\r\n },\r\n U_Payload: { ui: { expandTableCellOnClick: true } },\r\n },\r\n}\r\n","import { SYSTableDef } from \"../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport type TranslationType = {\r\n U_TransCode: string\r\n U_TransGroup: string\r\n}\r\n\r\nexport type TblTranslationColumn = keyof TranslationType\r\n\r\nexport type TblTranslation = {\r\n [key: string]: TranslationType\r\n}\r\n\r\nexport let tblTranslation: SYSTableDef = {\r\n id: \"SYSTranslation\",\r\n title: { show: true, translationKey: \"SYSTranslationTitle\" },\r\n feature: \"SYSTranslation\",\r\n permission: \"SYSTR\",\r\n database: {\r\n dataIdField: \"Id\",\r\n dbInsertMode: \"AutoIdentity\",\r\n },\r\n server: {\r\n endpoint: \"translation\",\r\n },\r\n\r\n features: {\r\n add: true,\r\n edit: true,\r\n delete: true,\r\n copy: true,\r\n headerMenu: true,\r\n showFooterButtons: true,\r\n multiSelect: true,\r\n multiDelete: true,\r\n multiEdit: true,\r\n multiCopy: true,\r\n filter: true,\r\n multiFilter: true,\r\n },\r\n options: {\r\n initial_sortCustom: {\r\n selected: \"Main\",\r\n sorts: {\r\n Main: {\r\n translationKey: \"SYSTranslationMainSort\",\r\n showInTitle: false,\r\n },\r\n },\r\n },\r\n },\r\n\r\n columns: {\r\n U_TransGroup: {\r\n ui: {\r\n labelTranslationKey: \"SYSTranslationColGroup\",\r\n thGroupTranslationKey: \"SYSTranslationGroupColIdentification\",\r\n },\r\n sortable: true,\r\n filter: {\r\n columnFilter: { type: \"none\" },\r\n },\r\n schema: { nullable: false },\r\n },\r\n U_TransCode: {\r\n ui: {\r\n labelTranslationKey: \"SYSTranslationColCode\",\r\n thGroupTranslationKey: \"SYSTranslationGroupColIdentification\",\r\n },\r\n sortable: true,\r\n schema: { nullable: false },\r\n },\r\n },\r\n}\r\n","import type {\r\n SYSColumnDef,\r\n SYSTableDef,\r\n} from \"../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport type UserAdministration_CompanyType = {\r\n CardCode: string\r\n CardName: string\r\n}\r\n\r\nlet columns: { [key in keyof UserAdministration_CompanyType]: SYSColumnDef } = {\r\n CardCode: {\r\n sortable: true,\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColCardCode\" },\r\n },\r\n CardName: {\r\n sortable: true,\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColCardName\" },\r\n },\r\n}\r\n\r\nexport let tblUserAdministration_Company: SYSTableDef = {\r\n id: \"SYSUserAdministration_Company\",\r\n permission: \"SYSCA\",\r\n feature: \"SYSUserAdministration\",\r\n database: {\r\n dataIdField: \"CardCode\",\r\n dbInsertMode: \"Manual\",\r\n },\r\n server: {\r\n endpoint: \"useradministration/company\",\r\n },\r\n\r\n options: {\r\n navType: \"custom\",\r\n initial_sort: { field: \"CardName\", direction: \"asc\" },\r\n initial_paging: { page: 0, pageSize: 200 },\r\n },\r\n\r\n features: {\r\n add: true,\r\n delete: true,\r\n edit: true,\r\n page: true,\r\n showFooterButtons: true,\r\n autoCloseButtonIfInsideDialog: true,\r\n filter: true,\r\n },\r\n columns,\r\n}\r\n","import {\r\n SYSColumnDef,\r\n SYSTableDef,\r\n} from \"../../../../../_ovlclient/src/library/table/tableapi\"\r\nexport type UserAdministration_PermissionType = {\r\n RoleCode?: string\r\n Permission?: string\r\n HasPermission?: boolean\r\n PermissionDesc?: string\r\n Read?: boolean\r\n Modify?: boolean\r\n Add?: boolean\r\n Delete?: boolean\r\n}\r\n\r\nlet columns: {\r\n [key in keyof UserAdministration_PermissionType]: SYSColumnDef\r\n} = {\r\n Permission: {\r\n ui: {\r\n noLabel: true,\r\n visibility: \"Table\",\r\n },\r\n sortable: true,\r\n },\r\n\r\n PermissionDesc: {\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationPermissionColDesc\",\r\n readonly: true,\r\n },\r\n sortable: true,\r\n },\r\n\r\n HasPermission: {\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationPermissionColHasPermission\",\r\n },\r\n sortable: true,\r\n control: \"checkbox\",\r\n },\r\n\r\n Read: {\r\n groups: { group: 1 },\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationPermissionColRead\",\r\n },\r\n control: \"checkbox\",\r\n },\r\n Modify: {\r\n groups: { group: 1 },\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationPermissionColModify\",\r\n },\r\n control: \"checkbox\",\r\n },\r\n Add: {\r\n groups: { group: 1 },\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationPermissionColAdd\",\r\n },\r\n control: \"checkbox\",\r\n },\r\n Delete: {\r\n groups: { group: 1 },\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationPermissionColDelete\",\r\n },\r\n control: \"checkbox\",\r\n },\r\n}\r\n\r\nexport let tblUserAdministration_Permission: SYSTableDef = {\r\n id: \"SYSUserAdministration_Permission\",\r\n feature: \"SYSUserAdministration\",\r\n permission: \"SYSRA\",\r\n database: {\r\n dataIdField: \"Permission\",\r\n dbInsertMode: \"Manual\",\r\n },\r\n server: {\r\n endpoint: \"userpermission\",\r\n },\r\n features: {\r\n headerMenu:false,\r\n focusToFirstEditableField: true,\r\n edit: true,\r\n autoCloseButtonIfInsideDialog: true,\r\n },\r\n options: {\r\n navType: \"custom\",\r\n initial_sort: { field: \"PermissionDesc\", direction: \"asc\" },\r\n edit: {\r\n groups: {\r\n 1: {\r\n className: \"editgroup_modifiers\",\r\n translationKey: \"SYSUserAdministrationPermissionEditGroupModifiers\",\r\n },\r\n },\r\n },\r\n controlsRendering: { fillSpaceIfNotVisible: false },\r\n },\r\n\r\n columns,\r\n}\r\nlet resultingPermission: SYSTableDef = JSON.parse(\r\n JSON.stringify(tblUserAdministration_Permission)\r\n)\r\nresultingPermission.features.add = false\r\nresultingPermission.features.edit = false\r\nresultingPermission.features.delete = false\r\nresultingPermission.features.showFooterButtons = false\r\nresultingPermission.features.headerMenu = false\r\n\r\nexport let tblUserAdministration_ResultingPermission: SYSTableDef =\r\n resultingPermission\r\n","import type {\r\n SYSColumnDef,\r\n SYSTableDef,\r\n} from \"../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport type UserAdministration_RoleType = {\r\n Code: string\r\n U_PrtPermissions?: string\r\n U_RoleDesc?: string\r\n Grp?: string\r\n U_Val1?: number\r\n U_Val2?: number\r\n U_Text1?: string\r\n U_Text2?: string\r\n U_Text3?: string\r\n U_Json1?: string\r\n}\r\n\r\nlet columns: { [key in keyof UserAdministration_RoleType]: SYSColumnDef } = {\r\n Grp: {\r\n sortable: true,\r\n filter: { columnFilter: { type: \"none\" } },\r\n schema: { isCalculatedColumn: true },\r\n ui: { visibility: \"Table\" },\r\n },\r\n\r\n Code: {\r\n sortable: true,\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColRole\" },\r\n },\r\n U_RoleDesc: {\r\n control: \"textarea\",\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColRoleDesc\" },\r\n },\r\n U_Json1: {\r\n control: \"textarea\",\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationColRoleJson1\",\r\n align: \"center\",\r\n },\r\n },\r\n\r\n U_Val1: {\r\n type: \"decimal\",\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationColRoleVal1\",\r\n },\r\n },\r\n U_Val2: {\r\n type: \"decimal\",\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationColRoleVal2\",\r\n },\r\n },\r\n U_Text1: {\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationColRoleText1\",\r\n align: \"center\",\r\n },\r\n },\r\n U_Text2: {\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationColRoleText2\",\r\n align: \"center\",\r\n },\r\n },\r\n U_Text3: {\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationColRoleText3\",\r\n align: \"center\",\r\n },\r\n },\r\n}\r\n\r\nexport let tblUserAdministration_Role: SYSTableDef = {\r\n id: \"SYSUserAdministration_Role\",\r\n permission: \"SYSRA\",\r\n feature: \"SYSUserAdministration\",\r\n database: {\r\n dataIdField: \"Code\",\r\n dbInsertMode: \"Manual\",\r\n useSchema: true,\r\n },\r\n server: {\r\n endpoint: \"useradministration/role\",\r\n },\r\n options: {\r\n navType: \"custom\",\r\n initial_rowAttributes: {\r\n SYSPermissions: {\r\n translationKey: \"SYSUserAdministrationPermissionTitle\",\r\n useCount: true,\r\n },\r\n },\r\n initial_sort: { field: \"Code\", direction: \"asc\" },\r\n initial_paging: { page: 0, pageSize: 200 },\r\n customRowActions: {\r\n HandleRolePermission: {\r\n icon: \"sap-icon--permission\",\r\n translationKey: \"SYSUserAdministrationHandleRolePermission\",\r\n permission: \"SYSRA\",\r\n },\r\n },\r\n },\r\n features: {\r\n page: true,\r\n showFooterButtons: true,\r\n add: true,\r\n delete: true,\r\n edit: true,\r\n autoCloseButtonIfInsideDialog: true,\r\n autoRebuild: \"AfterModifyOrDelete\",\r\n },\r\n columns,\r\n}\r\n","import type {\r\n SYSColumnDef,\r\n SYSTableDef,\r\n} from \"../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport type UserAdministration_UserType = {\r\n CntctCode?: number\r\n FirstName: string\r\n LastName: string\r\n E_MailL: string\r\n CardCode: string\r\n U_PrtUserId: string\r\n Active?: string\r\n}\r\n\r\nlet columns: { [key in keyof UserAdministration_UserType]: SYSColumnDef } = {\r\n FirstName: {\r\n sortable: true,\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColFirstName\" },\r\n },\r\n LastName: {\r\n sortable: true,\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColLastName\" },\r\n },\r\n E_MailL: {\r\n sortable: true,\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColEmail\" },\r\n },\r\n U_PrtUserId: {\r\n sortable: true,\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColUserId\" },\r\n },\r\n CardCode: {\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColCardName\" },\r\n sortable: true,\r\n filter: {\r\n columnFilter: { type: \"none\" },\r\n },\r\n list: {\r\n displayField: \"CardName\",\r\n valueField: \"CardCode\",\r\n lookupDefKey: \"CardCode\",\r\n displayValueField: true,\r\n serverEndpoint: \"useradministration/lookups/cardcode\",\r\n },\r\n schema: { nullable: false },\r\n },\r\n\r\n Active: {\r\n control: \"checkbox\",\r\n filter: { columnFilter: { type: \"none\" } },\r\n ui: {\r\n checkedValue: \"Y\",\r\n labelTranslationKey: \"SYSUserAdministrationColUserActive\",\r\n },\r\n },\r\n}\r\n\r\nexport let tblUserAdministration_User: SYSTableDef = {\r\n id: \"SYSUserAdministration_User\",\r\n permission: \"SYSUA\",\r\n feature: \"SYSUserAdministration\",\r\n database: {\r\n dataIdField: \"CntctCode\",\r\n dbInsertMode: \"AutoIdentity\",\r\n },\r\n server: {\r\n endpoint: \"useradministration/user\",\r\n },\r\n title: { show: true, translationKey: \"SYSUserAdministrationUserTitle\" },\r\n options: {\r\n navType: \"custom\",\r\n initial_sort: { field: \"FirstName\", direction: \"asc\" },\r\n // initial_sortCustom: {\r\n // selected: \"Test\",\r\n // sorts: { Test: { showInTitle: true, translationKey: \"Sort Test Title\" } },\r\n // },\r\n // initial_filterCustom: {\r\n // Test: { showInTitle: true, active: false, translationKey: \"Test Filter\" },\r\n // },\r\n initial_paging: { page: 0, pageSize: 200 },\r\n customRowActions: {\r\n AssignRoles: {\r\n translationKey: \"SYSUserAdministrationAssignRoles\",\r\n icon: \"sap-icon--role\",\r\n },\r\n },\r\n },\r\n\r\n features: {\r\n add: true,\r\n edit: true,\r\n delete: true,\r\n focusToFirstEditableField: true,\r\n page: true,\r\n showFooterButtons: true,\r\n autoCloseButtonIfInsideDialog: true,\r\n filter: true,\r\n },\r\n columns,\r\n}\r\n","import type {\r\n SYSColumnDef,\r\n SYSTableDef,\r\n} from \"../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport type UserAdministration_UserRoleType = {\r\n Id?: number\r\n U_CntctCode?: number\r\n Grp?: string\r\n U_RoleCode?: string\r\n U_RoleDesc?: string\r\n U_Val1?: number\r\n U_Val2?: number\r\n U_Text1?: string\r\n U_Text2?: string\r\n U_Text3?: string\r\n U_Json1?: string\r\n Role_U_Val1?: number\r\n Role_U_Val2?: number\r\n Role_U_Text1?: string\r\n Role_U_Text2?: string\r\n Role_U_Text3?: string\r\n Role_U_Json1?: string\r\n}\r\n\r\nlet columns: { [key in keyof UserAdministration_UserRoleType]: SYSColumnDef } =\r\n {\r\n Grp: {\r\n sortable: true,\r\n filter: { columnFilter: { type: \"none\" } },\r\n schema: { isCalculatedColumn: true },\r\n ui: { visibility: \"Table\" },\r\n },\r\n U_RoleCode: {\r\n sortable: true,\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColRole\" },\r\n list: {\r\n displayField: \"U_RoleCode\",\r\n valueField: \"U_RoleCode\",\r\n displayValueField: true,\r\n },\r\n },\r\n U_RoleDesc: {\r\n control: \"textarea\",\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationColRoleDesc\",\r\n visibility: \"Table_Edit_View\",\r\n readonly: true,\r\n },\r\n },\r\n U_Json1: {\r\n control: \"textarea\",\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationColRoleJson1\",\r\n align: \"center\",\r\n },\r\n },\r\n\r\n U_Val1: {\r\n type: \"decimal\",\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationColRoleVal1\",\r\n },\r\n },\r\n U_Val2: {\r\n type: \"decimal\",\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationColRoleVal2\",\r\n },\r\n },\r\n U_Text1: {\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationColRoleText1\",\r\n align: \"center\",\r\n },\r\n },\r\n U_Text2: {\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationColRoleText2\",\r\n align: \"center\",\r\n },\r\n },\r\n U_Text3: {\r\n ui: {\r\n labelTranslationKey: \"SYSUserAdministrationColRoleText3\",\r\n align: \"center\",\r\n },\r\n },\r\n }\r\n\r\nexport let tblUserAdministration_UserRole: SYSTableDef = {\r\n id: \"SYSUserAdministration_UserRole\",\r\n feature: \"SYSUserAdministration\",\r\n permission: \"SYSUR\",\r\n database: {\r\n dataIdField: \"Id\",\r\n dbInsertMode: \"AutoIdentity\",\r\n },\r\n\r\n server: {\r\n endpoint: \"useradministration/userrole\",\r\n },\r\n options: {\r\n navType: \"custom\",\r\n initial_sortCustom: {\r\n selected: \"RoleMain\",\r\n sorts: {\r\n RoleMain: {\r\n showInTitle: false,\r\n translationKey: \"SYSUserAdministrationRoleMainSort\",\r\n },\r\n },\r\n },\r\n initial_paging: { page: 0, pageSize: 200 },\r\n customRowActions: {\r\n HandleRolePermission: {\r\n icon: \"sap-icon--permission\",\r\n translationKey: \"SYSUserAdministrationHandleRolePermission\",\r\n permission: \"SYSPA\",\r\n },\r\n },\r\n },\r\n features: {\r\n autoCloseButtonIfInsideDialog: true,\r\n page: true,\r\n showFooterButtons: true,\r\n add: true,\r\n delete: true,\r\n edit: true,\r\n },\r\n columns,\r\n}\r\n","import type {\r\n SYSColumnDef,\r\n SYSTableDef,\r\n} from \"../../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport type UserAdministration_UserType = {\r\n CntctCode?: number\r\n FirstName: string\r\n LastName: string\r\n E_MailL: string\r\n CardCode: string\r\n U_PrtUserId: string\r\n Active?: string\r\n}\r\n\r\nlet columns: { [key in keyof UserAdministration_UserType]: SYSColumnDef } = {\r\n FirstName: {\r\n sortable: true,\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColFirstName\" },\r\n },\r\n LastName: {\r\n sortable: true,\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColLastName\" },\r\n },\r\n E_MailL: {\r\n sortable: true,\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColEmail\" },\r\n },\r\n U_PrtUserId: {\r\n sortable: true,\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColUserId\" },\r\n },\r\n CardCode: {\r\n ui: { labelTranslationKey: \"SYSUserAdministrationColCardName\" },\r\n sortable: true,\r\n filter: { columnFilter: { type: \"none\" } },\r\n list: {\r\n displayField: \"CardName\",\r\n valueField: \"CardCode\",\r\n displayValueField: true,\r\n\r\n showCachedHitsWhileTyping: true,\r\n serverEndpoint: \"useradministration/lookups/cardcode\",\r\n },\r\n schema: { nullable: false },\r\n },\r\n Active: {\r\n control: \"checkbox\",\r\n ui: {\r\n checkedValue: \"Y\",\r\n labelTranslationKey: \"SYSUserAdministrationColUserActive\",\r\n },\r\n },\r\n}\r\n\r\nexport let tblUserAdministration_UserRoleTransfer: SYSTableDef = {\r\n id: \"SYSUserAdministration_UserRoleTransfer\",\r\n permission: \"SYSUA\",\r\n feature: \"SYSUserAdministration\",\r\n database: {\r\n dataIdField: \"CntctCode\",\r\n dbInsertMode: \"AutoIdentity\",\r\n },\r\n server: {\r\n endpoint: \"useradministration/user\",\r\n },\r\n\r\n options: {\r\n navType: \"custom\",\r\n initial_sort: { field: \"FirstName\", direction: \"asc\" },\r\n initial_paging: { page: 0, pageSize: 200 },\r\n initial_filterCustom: {\r\n ValidUsers: {\r\n showInTitle: false,\r\n active: true,\r\n },\r\n },\r\n },\r\n\r\n features: {\r\n autoCloseButtonIfInsideDialog: true,\r\n focusToFirstEditableField: true,\r\n page: true,\r\n showFooterButtons: true,\r\n filter: true,\r\n multiSelect: true,\r\n },\r\n columns,\r\n}\r\n","import type {\r\n SYSColumnDef,\r\n SYSTableDef,\r\n} from \"../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nexport type SYSPortalSettingsType = {}\r\n\r\nlet columns: { [key in keyof SYSPortalSettingsType]: SYSColumnDef } = {}\r\n\r\nexport let tblSYSPortalSettings: SYSTableDef = {\r\n id: \"SYSPortalSettings\",\r\n permission: \"SYSST\",\r\n database: {\r\n dbInsertMode: \"AutoIdentity\",\r\n dataIdField: \"Id\",\r\n },\r\n server: {\r\n endpoint: \"portalsettings\",\r\n },\r\n features: {\r\n add: false,\r\n delete: false,\r\n edit: true,\r\n focusToFirstEditableField: true,\r\n headerMenu: false,\r\n autoCloseButtonIfInsideDialog: true,\r\n },\r\n columns,\r\n}\r\n","import { FeatureInfoType } from \"./global/globalapi\"\r\nimport type { Translation } from \"./global/globals\"\r\nimport type {\r\n SYSDialog,\r\n SYSLongRunningProcess,\r\n SYSPermissions,\r\n SYSFeatures,\r\n SYSTableDefIds,\r\n SYSSessionEntries,\r\n} from \"./index\"\r\nimport type { ModalDialogState } from \"./library/dialog/dialog\"\r\nimport type { DialogsState } from \"./library/dialog/sysdialogbase\"\r\nimport type { FormsState } from \"./library/forms/actions\"\r\nimport type {\r\n LongRunningProcessState,\r\n ProcessSnackType,\r\n} from \"./library/longrunningprocesstracker/longrunningprocesstracker\"\r\nimport type { ScreensState } from \"./library/sysbaseelement\"\r\nimport type { SnackState } from \"./library/snack/snack\"\r\nimport type { EditMode } from \"./library/table/table\"\r\nimport { tblTableSettings_ColumnFilter } from \"./library/table/tablerowheadermenu/tablesettings/columnfilter/tabledef\"\r\nimport { tblTableSettings_FilterSort } from \"./library/table/tablerowheadermenu/tablesettings/filtersort/tabledef\"\r\n\r\nimport { SYSTableSettingsState } from \"./library/table/tablerowheadermenu/tablesettings/state\"\r\nimport { tblAudit } from \"../ovlsyscomponents/sysaudit01/features/tabledef\"\r\nimport { tblTranslation } from \"../ovlsyscomponents/systranslation01/features/tabledef\"\r\nimport { tblUserAdministration_Company } from \"../ovlsyscomponents/sysuseradministration01/features/company/tabledef\"\r\nimport {\r\n tblUserAdministration_Permission,\r\n tblUserAdministration_ResultingPermission,\r\n} from \"../ovlsyscomponents/sysuseradministration01/features/permission/tabledef\"\r\nimport { tblUserAdministration_Role } from \"../ovlsyscomponents/sysuseradministration01/features/role/tabledef\"\r\nimport { tblUserAdministration_User } from \"../ovlsyscomponents/sysuseradministration01/features/user/tabledef\"\r\nimport { tblUserAdministration_UserRole } from \"../ovlsyscomponents/sysuseradministration01/features/userrole/tabledef\"\r\nimport { tblUserAdministration_UserRoleTransfer } from \"../ovlsyscomponents/sysuseradministration01/features/userroletransfer/tabledef\"\r\nimport { LookupColumnDef } from \"./library/forms/sysformelement\"\r\nimport { tblSYSPortalSettings } from \"../ovlsyscomponents/sysportalsettings01/features/tabledef\"\r\n\r\nlet forms: FormsState = undefined\r\n\r\nlet snacks: { [key: string]: SnackState } = {}\r\n\r\n//@ts-ignore\r\nlet dialog: { [key: string]: ModalDialogState } = {}\r\n\r\nlet translations: Translation = {}\r\nlet apiUrl = \"\"\r\nlet wsUrl = \"\"\r\n\r\nlet screens: ScreensState = {\r\n // screens prop will be prepared from script\r\n screens: undefined,\r\n nav: {\r\n nextScreen: undefined,\r\n nextScreenInstance: undefined,\r\n previousScreen: undefined,\r\n previousScreenInstance: undefined,\r\n screenCounter: 0,\r\n dialogCounter: 0,\r\n screensHistory: [],\r\n isNavigating: false,\r\n },\r\n}\r\n\r\nexport type SYSPermissionModifiers = \"A\" | \"M\" | \"D\" | \"R\"\r\n\r\nexport type PermissionSettings = {\r\n modifiers: { [key in SYSPermissionModifiers]: {} }\r\n}\r\n\r\nexport type Permissions = { [key in SYSPermissions]: PermissionSettings }\r\n\r\ntype User = {\r\n // there is only User or Admin for the MainContextUser\r\n // Of course there is fine grained Role management built in but thats handled at a different level\r\n role: \"User\" | \"Admin\"\r\n userCode: number\r\n userId: string\r\n permissions: Permissions\r\n isActor: boolean\r\n isSuperUser: boolean\r\n email: string\r\n cardCode: string\r\n cardName: string\r\n firstName: string\r\n lastName: string\r\n}\r\n\r\ntype Users = {\r\n [key: number]: {\r\n features: { [key in SYSFeatures]: FeatureInfoType }\r\n }\r\n}\r\nlet users: Users = undefined\r\n\r\nlet session: { [key in SYSSessionEntries]: any } = {\r\n Language: undefined,\r\n Token: undefined,\r\n}\r\nlet user: User = {\r\n // its 0 because there are auth mechanisms which don't set userCode but ovl is relying on it (search eg. for userCode.toString)\r\n userCode: 0,\r\n userId: undefined,\r\n role: undefined,\r\n isActor: false,\r\n isSuperUser: false,\r\n permissions: undefined,\r\n email: undefined,\r\n\r\n cardCode: undefined,\r\n cardName: undefined,\r\n firstName: undefined,\r\n lastName: undefined,\r\n}\r\n\r\nlet language = {\r\n translations,\r\n availableTranslations: [],\r\n translationComplete: false,\r\n translationFallbackLanguage: \"DE\",\r\n}\r\n\r\nlet uiState = {\r\n isDemo: false,\r\n stateSavedReason: \"\",\r\n appRehydrated: false,\r\n appIsScreenNavigateInRehydrating: false,\r\n currentPopupId: \"\",\r\n}\r\n\r\ntype tableRowHeaderMenuType = {\r\n tableDefId1: SYSTableDefIds\r\n tableDefId2: SYSTableDefIds\r\n}\r\n\r\nlet tableRowHeaderMenu: tableRowHeaderMenuType = {\r\n // we have two ids because we could have SYSHeaderMenu open twice (Ussecase AdvancedColumnFilter)\r\n tableDefId1: undefined,\r\n tableDefId2: undefined,\r\n}\r\n\r\nexport type _TableRowEditFormType = {\r\n tableDefId: SYSTableDefIds\r\n key: any\r\n editMode: EditMode\r\n formInitialised: boolean\r\n}\r\n\r\n// let tableRowEditForm: tableRowEditFormType = {\r\n// tableDefId: undefined,\r\n// key: undefined,\r\n// editMode: undefined,\r\n// formInitialised: false,\r\n// }\r\nexport type HitListDialogStateType = {\r\n formType: string\r\n formId: string\r\n fieldKey: string\r\n selectedCallback: any\r\n}\r\n\r\nlet hitListDialogState: HitListDialogStateType = {\r\n formType: undefined,\r\n formId: undefined,\r\n fieldKey: undefined,\r\n selectedCallback: undefined,\r\n}\r\nlet localHitListState = { open: false }\r\n\r\nlet features = {\r\n SYSShellbar: {\r\n config: { showAdminMenuPart: true },\r\n },\r\n SYSTranslation: {\r\n tables: {\r\n SYSTranslation: {\r\n tableDef: {\r\n SYSTranslation: tblTranslation,\r\n },\r\n },\r\n },\r\n },\r\n SYSAudit: {\r\n tables: {\r\n SYSAudit: {\r\n tableDef: {\r\n SYSAudit: tblAudit,\r\n },\r\n },\r\n },\r\n },\r\n SYSPortalSettings: {\r\n tables: {\r\n SYSPortalSettings: {\r\n tableDef: {\r\n SYSPortalSettings: tblSYSPortalSettings,\r\n },\r\n },\r\n },\r\n },\r\n SYSUserAdministration: {\r\n tables: {\r\n SYSUserAdministration_Role: {\r\n data: undefined,\r\n tableDef: {\r\n SYSUserAdministration_Role: tblUserAdministration_Role,\r\n },\r\n },\r\n\r\n SYSUserAdministration_User: {\r\n tableDef: {\r\n SYSUserAdministration_User: tblUserAdministration_User,\r\n SYSUserAdministration_UserRoleTransfer:\r\n tblUserAdministration_UserRoleTransfer,\r\n },\r\n },\r\n SYSUserAdministration_UserRole: {\r\n tableDef: {\r\n SYSUserAdministration_UserRole: tblUserAdministration_UserRole,\r\n },\r\n },\r\n SYSUserAdministration_Permission: {\r\n tableDef: {\r\n SYSUserAdministration_Permission: tblUserAdministration_Permission,\r\n SYSUserAdministration_ResultingPermission:\r\n tblUserAdministration_ResultingPermission,\r\n },\r\n },\r\n\r\n SYSUserAdministration_Company: {\r\n tableDef: {\r\n SYSUserAdministration_Company: tblUserAdministration_Company,\r\n },\r\n },\r\n },\r\n lookups: {\r\n CardCode: {\r\n data: {},\r\n lookupDef: {\r\n CardCode: {\r\n type: \"text\",\r\n translationKey: \"SYSUserAdministrationColCardCode\",\r\n isKey: true,\r\n },\r\n CardName: {\r\n type: \"text\",\r\n translationKey: \"SYSUserAdministrationColCardName\",\r\n },\r\n },\r\n },\r\n RoleCode: {\r\n data: {},\r\n lookupDef: {\r\n U_RoleCode: {\r\n type: \"text\",\r\n translationKey: \"SYSUserAdministrationColRole\",\r\n },\r\n U_RoleDesc: {\r\n type: \"text\",\r\n translationKey: \"SYSUserAdministrationColRoleDesc\",\r\n },\r\n Role_U_Val1: {\r\n type: \"text\",\r\n translationKey: \"SYSUserAdministrationColRoleVal1\",\r\n },\r\n Role_U_Val2: {\r\n type: \"text\",\r\n translationKey: \"SYSUserAdministrationColRoleVal2\",\r\n },\r\n Role_U_Text1: {\r\n type: \"text\",\r\n translationKey: \"SYSUserAdministrationColRoleText1\",\r\n },\r\n Role_U_Text2: {\r\n type: \"text\",\r\n translationKey: \"SYSUserAdministrationColRoleText2\",\r\n },\r\n Role_U_Text3: {\r\n type: \"text\",\r\n translationKey: \"SYSUserAdministrationColRoleText3\",\r\n },\r\n Role_U_Json1: {\r\n type: \"text\",\r\n translationKey: \"SYSUserAdministrationColRoleJson1\",\r\n },\r\n },\r\n },\r\n },\r\n },\r\n\r\n SYSTableSettings: {\r\n tables: {\r\n SYSTableSettings_FilterSort: {\r\n data: {},\r\n schema: {},\r\n index: {},\r\n tableDef: {\r\n SYSTableSettings_FilterSort: tblTableSettings_FilterSort,\r\n },\r\n },\r\n\r\n SYSTableSettings_ColumnFilter: {\r\n data: {},\r\n schema: {},\r\n index: {},\r\n tableDef: {\r\n SYSTableSettings_ColumnFilter: tblTableSettings_ColumnFilter,\r\n },\r\n },\r\n },\r\n },\r\n}\r\n\r\nlet libState = {\r\n dialog,\r\n snacks,\r\n\r\n tableRowHeaderMenu,\r\n hitListDialogState,\r\n localHitListState,\r\n tableSettings: SYSTableSettingsState,\r\n}\r\n\r\nlet app = {\r\n offline: { site: false, api: false },\r\n discCacheVersion: Date.now(),\r\n isPortalTestingMode: false,\r\n cleanUrl: true,\r\n testingEmail: \"\",\r\n pwRegex: \"\",\r\n backendType: \"\",\r\n ready: false,\r\n urlQueryString: undefined,\r\n clientId: undefined,\r\n}\r\n\r\nlet dialogs: {\r\n [key in SYSDialog]?: {\r\n tag: string\r\n rehydratable: boolean\r\n instance: { [key: string]: DialogsState }\r\n }\r\n} = {}\r\nlet longRunningProcessTracker: {\r\n [key in SYSLongRunningProcess]?: {\r\n snack: ProcessSnackType\r\n snackFixedByAppDef: boolean\r\n lockScreen: boolean\r\n instance: { [key in string]: LongRunningProcessState }\r\n isRefresh: boolean\r\n }\r\n} = {}\r\n\r\n//let reactorPaths: string[] = []\r\n\r\nexport let ovlState = {\r\n app,\r\n user,\r\n session,\r\n users,\r\n language,\r\n uiState,\r\n apiUrl,\r\n wsUrl,\r\n features,\r\n libState,\r\n screens,\r\n forms,\r\n dialogs,\r\n longRunningProcessTracker,\r\n //reactorPaths,\r\n}\r\n","import type { SYSAction } from \"../../../../_ovlclient/src\"\r\nimport type {\r\n HookFieldGetValueRender_ReturnType,\r\n HookFieldGetValueRender_Type,\r\n HookTableInit_Type,\r\n} from \"../../../../_ovlclient/src/global/hooks\"\r\n\r\nconst HookField_U_Timestamp_GetValueRender: SYSAction<\r\n HookFieldGetValueRender_Type,\r\n HookFieldGetValueRender_ReturnType\r\n> = (value) => {\r\n let timestamp = value.row[\"U_Timestamp\"]\r\n let dt = new Date(timestamp)\r\n let tval = dt.toLocaleTimeString()\r\n return {\r\n res: tval,\r\n valueRaw: tval,\r\n }\r\n}\r\n\r\nconst HookTableInit: SYSAction = (value, { global }) => {\r\n if (value.context !== \"before\") {\r\n return\r\n }\r\n if (value.tableDef.id === \"SYSAudit\") {\r\n let state = global.getState()\r\n if (state.ovl.app.backendType === \"SAP\") {\r\n value.tableDef.database.dataIdField = \"Code\"\r\n value.tableDef.database.dbInsertMode = \"UDTAutoGUIDBoth\"\r\n }\r\n }\r\n}\r\n\r\nexport let hooks = { HookField_U_Timestamp_GetValueRender, HookTableInit }\r\n","import { hooks } from \"./hookactions\"\r\nexport let SYSAudit = { hooks }\r\n","import type { SYSAction } from \"../../../../_ovlclient/src\"\r\nimport type { HookFormValidate_Type } from \"../../../../_ovlclient/src/global/hooks\"\r\n\r\nimport { FieldId } from \"./loginform\"\r\n\r\nconst HookFormValidate: SYSAction = (value) => {\r\n let field = value.field\r\n\r\n switch (field.fieldKey) {\r\n case \"pw\":\r\n value.validatorUse(\"Mandatory\")\r\n break\r\n case \"user\":\r\n if (value.validatorUse(\"Mandatory\")) {\r\n value.validatorUse(\"MinLength\", { val: 3 })\r\n }\r\n break\r\n }\r\n}\r\n\r\nexport let hooks = { HookFormValidate }\r\n","import { SYSAction, SYSConfig } from \"../../../../_ovlclient/src\"\r\nimport {\r\n DialogClose,\r\n DialogOkCancel,\r\n DialogSetLock,\r\n} from \"../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport type { SYSFormState } from \"../../../../_ovlclient/src/library/forms/fieldapi\"\r\nimport {\r\n FieldReset,\r\n FieldSetVal,\r\n FieldVal,\r\n} from \"../../../../_ovlclient/src/library/forms/fieldapi\"\r\n\r\nimport { Data } from \"../../../../_ovlclient/src/dataapi\"\r\n\r\nimport {\r\n ProcessEnd,\r\n ProcessStart,\r\n} from \"../../../../_ovlclient/src/library/longrunningprocesstracker/processapi\"\r\nimport { SnackAdd } from \"../../../../_ovlclient/src/library/snackapi\"\r\nimport { T } from \"../../../../_ovlclient/src/textapi\"\r\nimport { InitStateFromLogin } from \"./helpers\"\r\nimport { ValidationsAdd } from \"../../../src/library/forms/validatorsapi\"\r\nimport { isFirefox, isIOS } from \"../../../src/global/globals\"\r\nimport { FormReset } from \"../../../src/library/forms/formapi\"\r\n\r\nconst Login: SYSAction<{\r\n formState?: SYSFormState\r\n}> = async (value, { global }) => {\r\n let user\r\n let pw\r\n let formState: SYSFormState\r\n let userField\r\n let pwField\r\n\r\n ProcessStart(\"SYSLoginLogin\", {\r\n lock: { dialog: \"SYSLogin\", formState },\r\n })\r\n try {\r\n let formState = value.formState\r\n\r\n userField = formState.fields[\"user\"]\r\n pwField = formState.fields[\"pw\"]\r\n\r\n if (isIOS() || isFirefox()) {\r\n // somehow on ios we don't get the password field value when automatically inserted\r\n // this is a workaround to force the autofilled password value into the field state\r\n let pwElement = document.getElementById(pwField.id)\r\n if (pwElement.value && !pwField.convertedValue) {\r\n await FieldSetVal(pwField, pwElement.value, {\r\n ignoreCustomValidation: true,\r\n ignoreValueChanged: true,\r\n })\r\n }\r\n let userElement = document.getElementById(userField.id)\r\n if (userElement.value && !userField.convertedValue) {\r\n await FieldSetVal(userField, userElement.value, {\r\n ignoreCustomValidation: true,\r\n ignoreValueChanged: true,\r\n })\r\n }\r\n }\r\n\r\n user = FieldVal(userField)\r\n pw = FieldVal(pwField)\r\n let state = global.getState()\r\n let res\r\n try {\r\n res = await Data(\"users/authenticate\", {\r\n user,\r\n password: pw,\r\n language: state.ovl.session.Language,\r\n clientId: state.ovl.app.clientId,\r\n tz: Intl.DateTimeFormat().resolvedOptions().timeZone,\r\n useCookie: SYSConfig.fetch.authMode === \"cookie\",\r\n useCompressed: SYSConfig.fetch?.useCompressed === true,\r\n })\r\n } catch (res) {\r\n if (res.type && res.type === \"InvalidCredentials\") {\r\n ValidationsAdd(\r\n [pwField, userField],\r\n \"SYSLoginValidationInvalidPassword\",\r\n \"Validate\",\r\n {\r\n setFocus: true,\r\n validation: {\r\n summaryDisplayType: \"Always\",\r\n },\r\n }\r\n )\r\n }\r\n return\r\n }\r\n\r\n await InitStateFromLogin(res)\r\n // important! close dialog after initstate because it's awaited in the bootstrap init process\r\n await DialogClose(\"SYSLogin\")\r\n FormReset(formState)\r\n } finally {\r\n ProcessEnd(\"SYSLoginLogin\")\r\n }\r\n}\r\n\r\nconst ForgotPw: SYSAction = async (value, { global }) => {\r\n if (\r\n (await DialogOkCancel(T(\"SYSLoginForgotPasswordConfirm\"), {\r\n defaultButton: 2,\r\n })) === 1\r\n ) {\r\n DialogSetLock(\"SYSLogin\", true)\r\n try {\r\n let res\r\n let user = FieldVal(value.fields[\"user\"])\r\n let state = global.getState()\r\n res = await Data(\"users/requestresetpw\", {\r\n user,\r\n langCode: state.ovl.session.Language,\r\n apiUrl: state.ovl.apiUrl,\r\n })\r\n SnackAdd(T(\"SYSLoginForgotPasswordMsg\"), \"Information\", 20000)\r\n } finally {\r\n DialogSetLock(\"SYSLogin\", false)\r\n }\r\n }\r\n}\r\n\r\nexport let actions = { Login, ForgotPw }\r\n","import { hooks } from \"./hookactions\"\r\nimport { actions } from \"./actions\"\r\nexport let SYSLogin = { hooks, actions }\r\n","import { ovl, SYSAction } from \"../../../../_ovlclient/src\"\r\nimport { LanguageSet } from \"../../../../_ovlclient/src/global/globalapi\"\r\nimport type {\r\n HookTableAfterDelete_Type,\r\n HookTableAfterSave_Type,\r\n HookTableCustomSort_ReturnType,\r\n HookTableCustomSort_Type,\r\n HookTableInit_Type,\r\n HookTableSaveError_Type,\r\n} from \"../../../../_ovlclient/src/global/hooks\"\r\n\r\nimport { SYSColumnDef } from \"../../../../_ovlclient/src/library/table/tableapi\"\r\nimport { ValidationsAdd } from \"../../../src/library/forms/validatorsapi\"\r\nimport { SnackAdd } from \"../../../src/library/snackapi\"\r\nimport type { TranslationType } from \"./tabledef\"\r\n\r\nconst HookTableInit: SYSAction = (value, { global }) => {\r\n if (value.context !== \"before\") {\r\n return\r\n }\r\n if (value.tableDef.id === \"SYSTranslation\") {\r\n let state = global.getState()\r\n if (state.ovl.app.backendType === \"SAP\") {\r\n value.tableDef.database.dataIdField = \"Code\"\r\n value.tableDef.database.dbInsertMode = \"UDTAutoGUIDBoth\"\r\n }\r\n\r\n let colTemplate: SYSColumnDef = {\r\n order: 30,\r\n ui: {\r\n labelTranslationKey: \"SYSTranslationColXX\",\r\n thGroupTranslationKey: \"SYSTranslationGroupColTranslations\",\r\n },\r\n sortable: true,\r\n control: \"textarea\",\r\n nullHandling: { enabled: true },\r\n }\r\n let languageState = state.ovl.language\r\n let cols = languageState.availableTranslations.reduce((val, m) => {\r\n let col: SYSColumnDef = JSON.parse(JSON.stringify(colTemplate))\r\n col.ui.labelTranslationKey = `SYSTranslationCol${m}`\r\n col.nullHandling = {\r\n enabled: m !== languageState.translationFallbackLanguage,\r\n }\r\n val[`U_${m}`] = col\r\n return val\r\n }, {})\r\n value.tableDef.columns = Object.assign(value.tableDef.columns, cols)\r\n }\r\n}\r\n\r\nconst HookTableSaveError: SYSAction = (value) => {\r\n /* \r\n /* Keep it here for testing\r\n We handle any issues the OfflineHandler encounters while saving\r\n By returning \"Handled\" we signalize that OfflineHandler does not need\r\n To take further actions (Populating offline.error)\r\n */\r\n if (value.isOfflineRetry) {\r\n SnackAdd(`Offline Save Error: ${value.rowFnResult.text}`, \"Error\")\r\n return { resolve: \"Handled\" }\r\n }\r\n /**/\r\n if (value.rowFnResult.code === \"UniqueKeyViolation\") {\r\n // Integrity Error\r\n // In this case most probably because Group and Code are not unique\r\n\r\n ValidationsAdd(\r\n [\r\n value.formState.fields[\"U_TransGroup\"],\r\n value.formState.fields[\"U_TransCode\"],\r\n ],\r\n \"SYSTranslationTextNotUnique\",\r\n \"Validate\",\r\n { validation: { summaryGroup: \"ValidationKey\" }, setFocus: true }\r\n )\r\n }\r\n}\r\nconst HookTableCustom_Main_Sort: SYSAction<\r\n HookTableCustomSort_Type,\r\n HookTableCustomSort_ReturnType\r\n> = (value) => {\r\n let valA = value.data[value.a].U_TransGroup\r\n let valB = value.data[value.b].U_TransGroup\r\n if (valA > valB) {\r\n return 1\r\n } else if (valA < valB) {\r\n return -1\r\n } else {\r\n let valA = value.data[value.a].U_TransCode\r\n let valB = value.data[value.b].U_TransCode\r\n if (valA > valB) {\r\n return 1\r\n } else if (valA < valB) {\r\n return -1\r\n } else {\r\n return 0\r\n }\r\n }\r\n}\r\n\r\nconst HookTableAfterSave: SYSAction = async (_) => {\r\n await debouncedLanguageSet()\r\n}\r\n\r\nconst HookTableAfterDelete: SYSAction = async (\r\n _\r\n) => {\r\n await debouncedLanguageSet()\r\n}\r\n\r\nlet debouncedLanguageSetTimer\r\nconst debouncedLanguageSet = async () => {\r\n if (debouncedLanguageSetTimer) {\r\n clearTimeout(debouncedLanguageSetTimer)\r\n }\r\n debouncedLanguageSetTimer = await setTimeout(async () => {\r\n await LanguageSet(ovl.getState().ovl.session.Language)\r\n }, 2000)\r\n}\r\n\r\nexport let hooks = {\r\n HookTableAfterDelete,\r\n HookTableAfterSave,\r\n HookTableCustom_Main_Sort,\r\n HookTableSaveError,\r\n HookTableInit,\r\n}\r\n","import { hooks } from \"./hookactions\"\r\nexport let SYSTranslation = { hooks }\r\n","import {\r\n html,\r\n SYSAction,\r\n SYSConfig,\r\n SYSFeatures,\r\n SYSPermissions,\r\n SYSState,\r\n} from \"../../../../_ovlclient/src\"\r\nimport { AppDefPermission } from \"../../../../_ovlclient/src/config\"\r\nimport {\r\n FeatureGet,\r\n SortGet,\r\n} from \"../../../../_ovlclient/src/global/globalapi\"\r\nimport {\r\n _DeleteFeatureInfo,\r\n _SetFeatureInfo,\r\n} from \"../../../../_ovlclient/src/global/globals\"\r\nimport {\r\n HookTableInit_Type,\r\n HookTableRowAttributeGetProperties_ReturnType,\r\n HookTableRowAttributeGetProperties_Type,\r\n HookTableRowAttributesGetAllAttributes_ReturnType,\r\n HookTableRowAttributesGetAllAttributes_Type,\r\n HookTableRowAttributesGetAttributes_ReturnType,\r\n HookTableRowAttributesGetAttributes_Type,\r\n type HookFieldGetList_ReturnType,\r\n type HookFieldGetList_Type,\r\n type HookFieldGetValueRender_ReturnType,\r\n type HookFieldGetValueRender_Type,\r\n type HookFormChanged_Type,\r\n type HookFormInit_ReturnType,\r\n type HookFormInit_Type,\r\n type HookFormValidate_Type,\r\n type HookLookupsRefresh_ReturnType,\r\n type HookLookupsRefresh_Type,\r\n type HookTableAfterDelete_Type,\r\n type HookTableAfterSave_Type,\r\n type HookTableCustomFilter_ReturnType,\r\n type HookTableCustomFilter_Type,\r\n type HookTableCustomSort_ReturnType,\r\n type HookTableCustomSort_Type,\r\n type HookTableRowFn_Type,\r\n} from \"../../../../_ovlclient/src/global/hooks\"\r\nimport { DialogOpen } from \"../../../../_ovlclient/src/library/dialog/dialogapi\"\r\nimport {\r\n FieldSetVal,\r\n FieldVal,\r\n} from \"../../../../_ovlclient/src/library/forms/fieldapi\"\r\nimport {\r\n FormSetGroupState,\r\n SYSFormState,\r\n} from \"../../../../_ovlclient/src/library/forms/formapi\"\r\n\r\nimport {\r\n TableCellVal,\r\n TableGet,\r\n TableRefresh,\r\n TableSelectRow,\r\n} from \"../../../../_ovlclient/src/library/table/tableapi\"\r\nimport { T } from \"../../../../_ovlclient/src/textapi\"\r\nimport { RefreshResultingPermission } from \"./helpers\"\r\nimport { UserAdministration_PermissionType } from \"./permission/tabledef\"\r\nimport { UserAdministration_RoleType } from \"./role/tabledef\"\r\nimport { UserAdministration_UserType } from \"./user/tabledef\"\r\nimport { UserAdministration_UserRoleType } from \"./userrole/tabledef\"\r\n\r\nconst HookTableRowAttributesGetAttributes: SYSAction<\r\n HookTableRowAttributesGetAttributes_Type,\r\n HookTableRowAttributesGetAttributes_ReturnType\r\n> = (value) => {\r\n if (value.defId === \"SYSUserAdministration_User\") {\r\n let type = value.rowAttributeDefKey.substring(\r\n value.rowAttributeDefKey.length - 3,\r\n value.rowAttributeDefKey.length\r\n )\r\n let roles: string[] = value.row[\"Roles\"]\r\n return roles.filter((f) => f.startsWith(type))\r\n } else if (value.defId === \"SYSUserAdministration_Role\") {\r\n let permissions: string = value.row[\"U_PrtPermissions\"]\r\n if (permissions === null || permissions === undefined) {\r\n return undefined\r\n }\r\n let type = value.rowAttributeDefKey.substring(\r\n value.rowAttributeDefKey.length - 3,\r\n value.rowAttributeDefKey.length\r\n )\r\n return Object.keys(JSON.parse(permissions)).filter((f) =>\r\n f.startsWith(type)\r\n )\r\n }\r\n}\r\n\r\nconst HookTableRowAttributeGetProperties: SYSAction<\r\n HookTableRowAttributeGetProperties_Type,\r\n HookTableRowAttributeGetProperties_ReturnType\r\n> = (value) => {\r\n if (value.defId === \"SYSUserAdministration_User\") {\r\n let roleTable = TableGet(\"SYSUserAdministration_Role\")\r\n let found = roleTable.getKeys({ byIdValue: value.rowAttributeKey })\r\n return { tooltip: roleTable.rows[found[0]][\"U_RoleDesc\"] }\r\n } else if (value.defId === \"SYSUserAdministration_Role\") {\r\n return {\r\n tooltip: T(`SYSUserAdministrationPermission${value.rowAttributeKey}`),\r\n }\r\n }\r\n}\r\n\r\nconst HookTableRowAttributesGetAllAttributes: SYSAction<\r\n HookTableRowAttributesGetAllAttributes_Type,\r\n HookTableRowAttributesGetAllAttributes_ReturnType\r\n> = (value) => {\r\n if (value.defId === \"SYSUserAdministration_User\") {\r\n let type = value.rowAttributeDefKey.substring(\r\n value.rowAttributeDefKey.length - 3,\r\n value.rowAttributeDefKey.length\r\n )\r\n let tb = TableGet(\"SYSUserAdministration_Role\")\r\n return {\r\n allAttributes: Object.keys(tb.rows)\r\n .filter((f) => tb.rows[f].Code.startsWith(type))\r\n .map((m) => tb.rows[m].Code),\r\n }\r\n } else if (value.defId === \"SYSUserAdministration_Role\") {\r\n let tb = TableGet(\"SYSUserAdministration_Role\")\r\n let allAttributesSet = new Set()\r\n let type = value.rowAttributeDefKey.substring(\r\n value.rowAttributeDefKey.length - 3,\r\n value.rowAttributeDefKey.length\r\n )\r\n Object.keys(tb.rows)\r\n .filter((f) => tb.rows[f].U_PrtPermissions)\r\n .forEach((f) => {\r\n Object.keys(JSON.parse(tb.rows[f].U_PrtPermissions))\r\n .filter((f) => f.startsWith(type))\r\n .forEach((k) => {\r\n allAttributesSet.add(k)\r\n })\r\n })\r\n return { allAttributes: Array.from(allAttributesSet).sort() }\r\n }\r\n}\r\n\r\nconst HookField_CardCode_GetList: SYSAction<\r\n HookFieldGetList_Type,\r\n HookFieldGetList_ReturnType\r\n> = (value, { global }) => {\r\n let state = global.getState()\r\n return state.ovl.features.SYSUserAdministration.lookups.CardCode\r\n}\r\n\r\nconst HookField_Grp_GetValueRender: SYSAction<\r\n HookFieldGetValueRender_Type,\r\n HookFieldGetValueRender_ReturnType\r\n> = (value) => {\r\n return {\r\n res: (value.row[\"U_RoleCode\"] !== undefined\r\n ? value.row[\"U_RoleCode\"]\r\n : value.row[\"Code\"]\r\n ).substring(0, 3),\r\n }\r\n}\r\n\r\nconst HookField_U_RoleCode_GetList: SYSAction<\r\n HookFieldGetList_Type,\r\n HookFieldGetList_ReturnType\r\n> = (value, { global }) => {\r\n let state = global.getState()\r\n // return all not already assigned roles\r\n let data\r\n let allData = GetRoleDataLookup(state)\r\n let allDataKeys = Object.keys(allData)\r\n let tableData = TableGet(\r\n \"SYSUserAdministration_UserRole\"\r\n )\r\n let lookupDef =\r\n state.ovl.features.SYSUserAdministration.lookups.RoleCode.lookupDef\r\n let currentId: any = -1\r\n let idField = \"Id\"\r\n if (state.ovl.app.backendType === \"SAP\") {\r\n idField = \"Code\"\r\n }\r\n if (value.formState) {\r\n currentId = value.formState.row[idField]\r\n }\r\n\r\n // make sure SYSRoleAdmin is not even in the list for regular users\r\n let hasSYSRoleAdmin =\r\n FeatureGet(\"SYSRoleAdmin\").Found() || state.ovl.user.role === \"Admin\"\r\n data = allDataKeys\r\n .filter((k) => hasSYSRoleAdmin || allData[k].U_RoleCode !== \"SYSRoleAdmin\")\r\n .filter(\r\n (k) =>\r\n !tableData\r\n .getKeys()\r\n .some(\r\n (s) =>\r\n tableData.rows[s][idField] !== currentId &&\r\n tableData.rows[s].U_RoleCode === k\r\n )\r\n )\r\n .reduce((val, k) => {\r\n val[k] = allData[k]\r\n return val\r\n }, {})\r\n return { data, lookupDef }\r\n}\r\nconst GetRoleDataLookup = (state: SYSState) => {\r\n let roleData =\r\n state.ovl.features.SYSUserAdministration.tables.SYSUserAdministration_Role\r\n .data\r\n return Object.keys(roleData).reduce((val, k) => {\r\n let row = roleData[k]\r\n val[row.Code] = {\r\n U_RoleCode: row.Code,\r\n U_RoleDesc: row.U_RoleDesc,\r\n Role_U_Val1: row.U_Val1,\r\n Role_U_Val2: row.U_Val2,\r\n Role_U_Text1: row.U_Text1,\r\n Role_U_Text2: row.U_Text2,\r\n Role_U_Text3: row.U_Text3,\r\n Role_U_Json1: row.U_Json1,\r\n }\r\n return val\r\n }, {})\r\n}\r\n\r\nconst AssignUserRoleInfoValues = (\r\n formState: SYSFormState,\r\n row: UserAdministration_RoleType\r\n) => {\r\n // set info val1,val2,text1,text2 values coming from role\r\n if (formState.fields[\"U_Val1\"]) {\r\n formState.fields[\"U_Val1\"].ui.infoValue = row[\"Role_U_Val1\"]\r\n }\r\n if (formState.fields[\"U_Val2\"]) {\r\n formState.fields[\"U_Val2\"].ui.infoValue = row[\"Role_U_Val2\"]\r\n }\r\n if (formState.fields[\"U_Text1\"]) {\r\n formState.fields[\"U_Text1\"].ui.infoValue = row[\"Role_U_Text1\"]\r\n }\r\n if (formState.fields[\"U_Text2\"]) {\r\n formState.fields[\"U_Text2\"].ui.infoValue = row[\"Role_U_Text2\"]\r\n }\r\n if (formState.fields[\"U_Text3\"]) {\r\n formState.fields[\"U_Text3\"].ui.infoValue = row[\"Role_U_Text3\"]\r\n }\r\n if (formState.fields[\"U_Json1\"]) {\r\n formState.fields[\"U_Json1\"].ui.infoValue = row[\"Role_U_Json1\"]\r\n }\r\n}\r\n\r\n// const HookTableCustomTitle: SYSAction<\r\n// HookTableCustomTitle_Type,\r\n// HookTableCustomTitle_ReturnType\r\n// > = (value, { global }) => {\r\n// }\r\n\r\nconst HookLookupsRefresh: SYSAction<\r\n HookLookupsRefresh_Type,\r\n HookLookupsRefresh_ReturnType\r\n> = (value, { global }) => {\r\n let state = global.getState()\r\n if (value.tableDefId === \"SYSUserAdministration_User\") {\r\n return {\r\n CardCode: state.ovl.features.SYSUserAdministration.lookups.CardCode,\r\n }\r\n } else if (value.tableDefId === \"SYSUserAdministration_UserRole\") {\r\n return {\r\n U_RoleCode: state.ovl.features.SYSUserAdministration.lookups.RoleCode,\r\n }\r\n }\r\n}\r\n\r\nconst HookTableRowFn: SYSAction<\r\n HookTableRowFn_Type<\r\n UserAdministration_PermissionType & UserAdministration_UserType\r\n >\r\n> = async (value) => {\r\n switch (value.fnKey) {\r\n case \"AssignRoles\":\r\n await TableRefresh(\"SYSUserAdministration_UserRole\", {\r\n staticFilter: { U_CntctCode: value.row.CntctCode },\r\n showSnack: false,\r\n })\r\n await TableRefresh(\"SYSUserAdministration_ResultingPermission\", {\r\n serverFilter: {\r\n RoleCode: \"@@SYSGetResultingRole\",\r\n Permission: value.row.CntctCode,\r\n },\r\n resetStrategy: { ClearData: true },\r\n })\r\n\r\n DialogOpen(\"SYSUserAdministration_UserRole\")\r\n break\r\n case \"HandleRolePermission\":\r\n // prepare all the permissions\r\n // by using the defaults in appdef and enrich/overwrite them with the one from the role\r\n // and create a table out of it so it can be used with regular tableforms\r\n if (value.def.id === \"SYSUserAdministration_UserRole\") {\r\n // if started from userrole initialise role and select role\r\n await TableRefresh(\"SYSUserAdministration_Role\", {\r\n serverFilter: { Code: value.row[\"U_RoleCode\"] },\r\n showSnack: false,\r\n })\r\n let roleTable = TableGet(\r\n \"SYSUserAdministration_Role\",\r\n { byIdValue: value.row[\"U_RoleCode\"] }\r\n )\r\n TableSelectRow(\"SYSUserAdministration_Role\", roleTable.getKeys()[0], {\r\n mode: \"Select\",\r\n })\r\n }\r\n\r\n let roleTable = TableGet(\r\n \"SYSUserAdministration_Role\",\r\n { byKeys: \"Selected\" }\r\n )\r\n let selectedRoleCode = roleTable.rows[roleTable.getKeys()[0]].Code\r\n let permissionData: UserAdministration_PermissionType[] = []\r\n let rolePermissions = JSON.parse(\r\n roleTable.rows[roleTable.getKeys()[0]].U_PrtPermissions\r\n )\r\n let preconfiguredPermissions: {\r\n [key in SYSPermissions]: AppDefPermission\r\n } = SYSConfig.app.permissions\r\n let i = 0\r\n Object.keys(preconfiguredPermissions).forEach((f) => {\r\n let templatePermission: AppDefPermission = preconfiguredPermissions[f]\r\n permissionData.push({})\r\n permissionData[i].RoleCode = selectedRoleCode\r\n permissionData[i].Read = false\r\n permissionData[i].Modify = false\r\n permissionData[i].Add = false\r\n permissionData[i].Delete = false\r\n permissionData[i].Permission = f\r\n permissionData[i].HasPermission = false\r\n // now see if there is a userpermission for this permission\r\n if (rolePermissions) {\r\n Object.keys(rolePermissions).forEach((f2: SYSPermissions) => {\r\n if (f2 === f) {\r\n let userPermission = rolePermissions[f2]\r\n permissionData[i].HasPermission = true\r\n\r\n permissionData[i].Read = !!userPermission.modifiers.R\r\n permissionData[i].Modify = !!userPermission.modifiers.M\r\n permissionData[i].Add = !!userPermission.modifiers.A\r\n permissionData[i].Delete = !!userPermission.modifiers.D\r\n }\r\n })\r\n }\r\n i++\r\n })\r\n\r\n await TableRefresh(\"SYSUserAdministration_Permission\", {\r\n localData: permissionData,\r\n staticFilter: { RoleCode: selectedRoleCode },\r\n })\r\n\r\n DialogOpen(\"SYSUserAdministration_Permission\")\r\n }\r\n}\r\n\r\nconst HookField_PermissionDesc_GetValueRender: SYSAction<\r\n HookFieldGetValueRender_Type,\r\n HookFieldGetValueRender_ReturnType\r\n> = (value) => {\r\n return { res: T(`SYSUserAdministrationPermission${value.row.Permission}`) }\r\n}\r\n\r\nconst HookFormInit: SYSAction = async (value) => {\r\n let formState = value.formState\r\n let notRelevantFields: string[] = []\r\n let notRelevantGroups: string[] = []\r\n\r\n if (formState.tableDefId === \"SYSUserAdministration_Permission\") {\r\n let fields = formState.fields\r\n\r\n let permissionVal = TableCellVal(\r\n \"SYSUserAdministration_Permission\",\r\n value.formState.tableRowKey,\r\n \"Permission\"\r\n )\r\n let def: AppDefPermission = SYSConfig.app.permissions[permissionVal]\r\n\r\n let permissionDescField = fields[\"PermissionDesc\"]\r\n permissionDescField.value = T(\r\n `SYSUserAdministrationPermission${permissionVal}`\r\n )\r\n if (!def.useModifiers) {\r\n notRelevantGroups.push(\"1\")\r\n }\r\n\r\n return {\r\n fieldsToRemove: notRelevantFields,\r\n groupsToRemove: notRelevantGroups,\r\n }\r\n } else if (value.formState.tableDefId === \"SYSUserAdministration_UserRole\") {\r\n AssignUserRoleInfoValues(value.formState, value.formState.row)\r\n }\r\n}\r\n\r\nconst HookFormValidate: SYSAction = (value) => {\r\n if (value.formState.tableDefId === \"SYSUserAdministration_User\") {\r\n if (value.field.fieldKey === \"E_MailL\") {\r\n value.validatorUse(\"EmailList\")\r\n }\r\n }\r\n}\r\n\r\nconst HookFormChanged: SYSAction = (\r\n value,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n if (value.formState.tableDefId === \"SYSUserAdministration_Permission\") {\r\n let formState = value.formState\r\n let hasPermission = FieldVal(formState.fields.HasPermission)\r\n\r\n FormSetGroupState(formState, 1, hasPermission, {\r\n mode: \"visible/readonly\",\r\n })\r\n } else if (value.formState.tableDefId === \"SYSUserAdministration_UserRole\") {\r\n if (\r\n value.changedField.validValueChanged &&\r\n value.changedField.fieldKey === \"U_RoleCode\"\r\n ) {\r\n let lookupData = GetRoleDataLookup(state)\r\n FieldSetVal(\r\n value.fields[\"U_RoleDesc\"],\r\n lookupData[value.changedField.newValue][\"U_RoleDesc\"]\r\n )\r\n FieldSetVal(value.fields[\"U_Val1\"], null)\r\n FieldSetVal(value.fields[\"U_Val2\"], null)\r\n FieldSetVal(value.fields[\"U_Text1\"], null)\r\n FieldSetVal(value.fields[\"U_Text2\"], null)\r\n FieldSetVal(value.fields[\"U_Text3\"], null)\r\n\r\n AssignUserRoleInfoValues(\r\n value.formState,\r\n lookupData[value.changedField.newValue]\r\n )\r\n }\r\n }\r\n}\r\n\r\nconst HookTableCustom_RoleMain_Sort: SYSAction<\r\n HookTableCustomSort_Type,\r\n HookTableCustomSort_ReturnType\r\n> = (value) => {\r\n let res\r\n res = SortGet(\r\n value.data[value.a].U_RoleCode.startsWith(\"Feature\"),\r\n value.data[value.b].U_RoleCode.startsWith(\"Feature\")\r\n )\r\n if (res === 0) {\r\n res = SortGet(\r\n value.data[value.a].U_RoleCode,\r\n value.data[value.b].U_RoleCode\r\n )\r\n }\r\n return res\r\n}\r\n\r\n// const HookField_U_RoleCode_GetEditHint: SYSAction<\r\n// HookFieldGetEditHint_Type,\r\n// HookFieldGetEditHint_ReturnType\r\n// > = (value) => {\r\n// let openRolesDialogButton\r\n// if (PermissionHas(\"SYSRA\")) {\r\n// openRolesDialogButton = html` {\r\n// e.stopPropagation()\r\n// e.preventDefault()\r\n// DialogClose(\"SYSTableRowEdit\")\r\n// await TableRefresh(\"SYSUserAdministration_Role\")\r\n// DialogOpen(\"SYSUserAdministration_Role\")\r\n// }}\r\n// class=\"fd-link\"\r\n// >\r\n// ${T(\"SYSUserAdministrationUserRoleOpenRoleHint\")}\r\n// `\r\n// }\r\n// return openRolesDialogButton\r\n// }\r\n\r\nconst HookTableAfterSave: SYSAction = async (\r\n value\r\n) => {\r\n if (value.formState.tableDefId === \"SYSUserAdministration_Permission\") {\r\n let roleTable = TableGet(\r\n \"SYSUserAdministration_Role\",\r\n { byKeys: \"Selected\" }\r\n )\r\n let selectedRoleCode = roleTable.rows[roleTable.getKeys()[0]].Code\r\n // also update underlying role table\r\n TableRefresh(\"SYSUserAdministration_Role\", {\r\n serverFilter: { Code: selectedRoleCode },\r\n })\r\n } else if (value.formState.tableDefId === \"SYSUserAdministration_UserRole\") {\r\n // Keep local Featureinfo in sync (they get loaded initially on login)\r\n let f = value.res.data[0]\r\n _SetFeatureInfo(\r\n f.U_CntctCode,\r\n f.U_RoleCode,\r\n f.U_Text1 ? f.U_Text1 : f.Role_U_Text1,\r\n f.U_Text2 ? f.U_Text2 : f.Role_U_Text2,\r\n f.U_Text3 ? f.U_Text3 : f.Role_U_Text3,\r\n f.U_Json1 ? f.U_Json1 : f.Role_U_Json1,\r\n f.U_Val1 ? f.U_Val1 : f.Role_U_Val1,\r\n f.U_Val2 ? f.U_Val2 : f.Role_U_Val2\r\n )\r\n TableRefresh(\"SYSUserAdministration_User\", {\r\n serverFilter: { CntctCode: f.U_CntctCode },\r\n })\r\n RefreshResultingPermission(f.U_CntctCode)\r\n } else if (value.formState.tableDefId === \"SYSUserAdministration_Role\") {\r\n let userRoleTable = TableGet(\r\n \"SYSUserAdministration_UserRole\",\r\n { byKeys: \"Selected\" }\r\n )\r\n if (userRoleTable.getKeys().length > 0) {\r\n let selectedRoleCode =\r\n userRoleTable.rows[userRoleTable.getKeys()[0]].U_RoleCode\r\n\r\n let userTable = TableGet(\r\n \"SYSUserAdministration_User\",\r\n { byKeys: \"Selected\" }\r\n )\r\n if (userTable.getKeys().length > 0) {\r\n let selectedUser = userTable.rows[userTable.getKeys()[0]].CntctCode\r\n TableRefresh(\"SYSUserAdministration_UserRole\", {\r\n serverFilter: {\r\n U_CntctCode: selectedUser,\r\n U_RoleCode: selectedRoleCode,\r\n },\r\n })\r\n }\r\n }\r\n }\r\n}\r\n\r\nconst HookTableAfterDelete: SYSAction = async (\r\n value\r\n) => {\r\n if (value.def.id === \"SYSUserAdministration_UserRole\") {\r\n let deletedRow: UserAdministration_UserRoleType = value.deletedRow\r\n // Keep local Featureinfo in sync\r\n _DeleteFeatureInfo(\r\n deletedRow.U_CntctCode,\r\n deletedRow.U_RoleCode\r\n )\r\n\r\n RefreshResultingPermission(deletedRow.U_CntctCode)\r\n // also refresh users because eg. when we remove prssales role the prs fileds will be deleted\r\n TableRefresh(\"SYSUserAdministration_User\", {\r\n serverFilter: {\r\n CntctCode: deletedRow.U_CntctCode,\r\n },\r\n })\r\n }\r\n}\r\n\r\nconst HookField_U_Val1_GetValueRender: SYSAction<\r\n HookFieldGetValueRender_Type,\r\n HookFieldGetValueRender_ReturnType\r\n> = (value) => {\r\n if (value.tableDef.id === \"SYSUserAdministration_UserRole\") {\r\n let res\r\n let val\r\n if (value.row.U_Val1 === null) {\r\n val = value.row.Role_U_Val1\r\n res = html`${val}`\r\n } else {\r\n val = value.row.U_Val1\r\n res = html`${val}`\r\n }\r\n return { res, valueRaw: val }\r\n }\r\n}\r\nconst HookField_U_Val2_GetValueRender: SYSAction<\r\n HookFieldGetValueRender_Type,\r\n HookFieldGetValueRender_ReturnType\r\n> = (value) => {\r\n if (value.tableDef.id === \"SYSUserAdministration_UserRole\") {\r\n let res\r\n let val\r\n if (value.row.U_Val2 === null) {\r\n val = value.row.Role_U_Val2\r\n res = html`${val}`\r\n } else {\r\n val = value.row.U_Val2\r\n res = html`${val}`\r\n }\r\n return { res, valueRaw: val }\r\n }\r\n}\r\n\r\nconst HookField_U_Text1_GetValueRender: SYSAction<\r\n HookFieldGetValueRender_Type,\r\n HookFieldGetValueRender_ReturnType\r\n> = (value) => {\r\n if (value.tableDef.id === \"SYSUserAdministration_UserRole\") {\r\n let res\r\n let val\r\n if (!value.row.U_Text1) {\r\n val = value.row.Role_U_Text1\r\n res = html`${val}`\r\n } else {\r\n val = value.row.U_Text1\r\n res = html`${val}`\r\n }\r\n return { res, valueRaw: val }\r\n }\r\n}\r\nconst HookField_U_Text2_GetValueRender: SYSAction<\r\n HookFieldGetValueRender_Type,\r\n HookFieldGetValueRender_ReturnType\r\n> = (value) => {\r\n if (value.tableDef.id === \"SYSUserAdministration_UserRole\") {\r\n let res\r\n let val\r\n if (!value.row.U_Text2) {\r\n val = value.row.Role_U_Text2\r\n res = html`${val}`\r\n } else {\r\n val = value.row.U_Text2\r\n res = html`${val}`\r\n }\r\n return { res, valueRaw: val }\r\n }\r\n}\r\n\r\nconst HookField_U_Text3_GetValueRender: SYSAction<\r\n HookFieldGetValueRender_Type,\r\n HookFieldGetValueRender_ReturnType\r\n> = (value) => {\r\n if (value.tableDef.id === \"SYSUserAdministration_UserRole\") {\r\n let res\r\n let val\r\n if (!value.row.U_Text3) {\r\n val = value.row.Role_U_Text3\r\n res = html`${val}`\r\n } else {\r\n val = value.row.U_Text3\r\n res = html`${val}`\r\n }\r\n return { res, valueRaw: val }\r\n }\r\n}\r\n\r\nconst HookField_U_Json1_GetValueRender: SYSAction<\r\n HookFieldGetValueRender_Type,\r\n HookFieldGetValueRender_ReturnType\r\n> = (value) => {\r\n if (value.tableDef.id === \"SYSUserAdministration_UserRole\") {\r\n let res\r\n let val\r\n if (!value.row.U_Json1) {\r\n val = value.row.Role_U_Json1\r\n res = html`${val}`\r\n } else {\r\n val = value.row.U_Json1\r\n res = html`${val}`\r\n }\r\n return { res, valueRaw: val }\r\n }\r\n}\r\nconst HookTableCustom_ValidUsers_Filter: SYSAction<\r\n HookTableCustomFilter_Type,\r\n HookTableCustomFilter_ReturnType\r\n> = (value) => {\r\n let table = TableGet(\r\n \"SYSUserAdministration_User\",\r\n {\r\n byKeys: \"Selected\",\r\n }\r\n )\r\n let selectedUserId = table.rows[table.getKeys()[0]].CntctCode\r\n return value.row.CntctCode !== selectedUserId\r\n}\r\n\r\nconst HookTableInit: SYSAction = (value, { global }) => {\r\n if (value.context !== \"before\") {\r\n return\r\n }\r\n if (\r\n value.tableDef.id === \"SYSUserAdministration_User\" ||\r\n value.tableDef.id === \"SYSUserAdministration_Role\"\r\n ) {\r\n let state = global.getState()\r\n // setup Roles Attributes Filter now that everything should be ready\r\n let initial_rowAttributes = {}\r\n let validFeaturesGrp = Object.keys(SYSConfig.app.features).reduce(\r\n (val, k) => {\r\n val[k.substring(0, 3)] = true\r\n return val\r\n },\r\n {}\r\n )\r\n let grpMainKeys = Object.keys(validFeaturesGrp)\r\n grpMainKeys.forEach((grpKey) => {\r\n grpKey = `Grp${grpKey}`\r\n if (!initial_rowAttributes[grpKey]) {\r\n initial_rowAttributes[grpKey] = {\r\n useCount: true,\r\n showInTitle: true,\r\n translationKey: `SYSFeature${grpKey}`,\r\n }\r\n }\r\n })\r\n value.tableDef.options.initial_rowAttributes = initial_rowAttributes\r\n }\r\n if (\r\n value.tableDef.id === \"SYSUserAdministration_UserRole\" ||\r\n value.tableDef.id === \"SYSUserAdministration_UserRoleTransfer\"\r\n ) {\r\n let state = global.getState()\r\n if (state.ovl.app.backendType === \"SAP\") {\r\n value.tableDef.database.dataIdField = \"Code\"\r\n value.tableDef.database.dbInsertMode = \"UDTAutoGUIDBoth\"\r\n }\r\n }\r\n}\r\n\r\nexport let hooks = {\r\n HookTableInit,\r\n HookTableRowAttributesGetAttributes,\r\n HookTableRowAttributesGetAllAttributes,\r\n HookTableRowAttributeGetProperties,\r\n HookField_CardCode_GetList,\r\n HookField_U_RoleCode_GetList,\r\n HookLookupsRefresh,\r\n HookTableRowFn,\r\n HookField_PermissionDesc_GetValueRender,\r\n HookField_Grp_GetValueRender,\r\n HookFormInit,\r\n HookFormValidate,\r\n HookFormChanged,\r\n HookTableCustom_RoleMain_Sort,\r\n // HookField_U_RoleCode_GetEditHint,\r\n HookTableAfterSave,\r\n HookTableAfterDelete,\r\n HookField_U_Val1_GetValueRender,\r\n HookField_U_Val2_GetValueRender,\r\n HookField_U_Text1_GetValueRender,\r\n HookField_U_Text2_GetValueRender,\r\n HookField_U_Text3_GetValueRender,\r\n HookField_U_Json1_GetValueRender,\r\n HookTableCustom_ValidUsers_Filter,\r\n\r\n // HookTableCustom_Test_Filter,\r\n // HookTableCustom_Test_Sort,\r\n}\r\n","import { hooks } from \"./hookactions\"\r\nexport let SYSUserAdministration = { hooks }\r\n","import { SYSAction } from \"../../../../../_ovlclient/src\"\r\nimport {\r\n HookFormAutoInit_Type,\r\n HookFormValidate_Type,\r\n} from \"../../../../../_ovlclient/src/global/hooks\"\r\n\r\nimport {\r\n FieldCurrentVal,\r\n FieldIsValid,\r\n SYSField,\r\n SYSFormField,\r\n} from \"../../../../../_ovlclient/src/library/forms/fieldapi\"\r\nimport { ValidationsAdd } from \"../../../../src/library/forms/validatorsapi\"\r\n\r\nimport { isTracking } from \"../../../../src/tracker/tracker\"\r\n\r\nconst HookFormAutoInit: SYSAction = (\r\n value,\r\n { global }\r\n) => {\r\n let fields: { [key: string]: SYSFormField } = {\r\n pw: {\r\n value: \"\",\r\n ui: { labelTranslationKey: \"SYSLoginPassword\", isPassword: true },\r\n },\r\n pw1: {\r\n value: \"\",\r\n ui: {\r\n labelTranslationKey: \"SYSUserSettingsPasswordNew\",\r\n isPassword: true,\r\n },\r\n },\r\n pw2: {\r\n value: \"\",\r\n ui: {\r\n labelTranslationKey: \"SYSUserSettingsPasswordNewConfirmation\",\r\n isPassword: true,\r\n },\r\n },\r\n }\r\n value.toSet.fieldsToSet = fields\r\n}\r\n\r\nconst HookFormValidate: SYSAction = (\r\n value,\r\n { global }\r\n) => {\r\n let state = global.getState()\r\n switch (value.field.fieldKey) {\r\n case \"pw\":\r\n value.validatorUse(\"Mandatory\")\r\n break\r\n case \"pw1\":\r\n if (\r\n value.validatorUse(\"Regex\", {\r\n val: {\r\n val: state.ovl.app.pwRegex,\r\n msg: \"SYSPasswordPolicy\",\r\n },\r\n }) &&\r\n FieldIsValid(value.formState.fields.pw2)\r\n ) {\r\n pwFieldsTheSame(value.field, value.formState.fields.pw2)\r\n }\r\n\r\n break\r\n case \"pw2\":\r\n if (\r\n value.validatorUse(\"Regex\", {\r\n val: {\r\n val: state.ovl.app.pwRegex,\r\n msg: \"SYSPasswordPolicy\",\r\n },\r\n }) &&\r\n FieldIsValid(value.formState.fields.pw1)\r\n ) {\r\n pwFieldsTheSame(value.field, value.formState.fields.pw1)\r\n }\r\n break\r\n }\r\n}\r\n\r\nconst pwFieldsTheSame = (field: SYSField, fieldToCompare: SYSField) => {\r\n if (FieldCurrentVal(field) !== FieldCurrentVal(fieldToCompare)) {\r\n ValidationsAdd(\r\n [field, fieldToCompare],\r\n\r\n \"SYSUserSettingsValidationNewPasswordConfirmation\",\r\n \"Validate\",\r\n {\r\n validation: {\r\n displayType: \"OnlyOutline\",\r\n summaryGroup: \"ValidationKey\",\r\n },\r\n }\r\n )\r\n }\r\n}\r\n\r\nexport let hooks = { HookFormValidate, HookFormAutoInit }\r\n","import type { SYSAction } from \"../../../../../_ovlclient/src\"\r\nimport { Data } from \"../../../../../_ovlclient/src/dataapi\"\r\nimport type { SYSFormState } from \"../../../../../_ovlclient/src/library/forms/fieldapi\"\r\nimport { FormReset } from \"../../../../../_ovlclient/src/library/forms/formapi\"\r\n\r\nimport {\r\n ProcessEnd,\r\n ProcessStart,\r\n} from \"../../../../../_ovlclient/src/library/longrunningprocesstracker/processapi\"\r\nimport { SnackAdd } from \"../../../../../_ovlclient/src/library/snackapi\"\r\nimport { T } from \"../../../../../_ovlclient/src/textapi\"\r\nimport { ValidationsAdd } from \"../../../../src/library/forms/validatorsapi\"\r\n\r\nconst SaveSettings: SYSAction = async (value, { global }) => {\r\n let state = global.getState()\r\n let pw = value.fields[\"pw\"].value\r\n let pw1 = value.fields[\"pw1\"].value\r\n let res\r\n ProcessStart(\"SYSUserSettingsSave\", {\r\n lock: { formState: value },\r\n snack: { type: \"none\" },\r\n })\r\n try {\r\n res = await Data(\"users/changepw\", {\r\n password: pw,\r\n passwordNew: pw1,\r\n language: state.ovl.session.Language,\r\n })\r\n\r\n SnackAdd(T(\"SYSLoginPasswordChangedSuccess\"), \"Success\")\r\n FormReset(value)\r\n } catch (res) {\r\n // most probably the password is wrong\r\n if (res.type && res.type === \"InvalidCredentials\") {\r\n ValidationsAdd(\r\n value.fields[\"pw\"],\r\n \"SYSLoginValidationInvalidPassword\",\r\n \"Validate\",\r\n {\r\n setFocus: true,\r\n }\r\n )\r\n }\r\n return\r\n } finally {\r\n ProcessEnd(\"SYSUserSettingsSave\")\r\n }\r\n}\r\nexport let actions = { SaveSettings }\r\n","import { hooks } from \"./hookactions\"\r\nimport { actions } from \"./actions\"\r\nexport let SYSUserSettingsPassword = { hooks, actions }\r\n","import { SYSAudit } from \"../../ovlsyscomponents/sysaudit01/features/allactions\"\r\nimport { SYSLogin } from \"../../ovlsyscomponents/syslogin01/features/allactions\"\r\nimport { SYSTranslation } from \"../../ovlsyscomponents/systranslation01/features/allactions\"\r\nimport { SYSUserAdministration } from \"../../ovlsyscomponents/sysuseradministration01/features/allactions\"\r\nimport { SYSUserSettingsPassword } from \"../../ovlsyscomponents/sysusersettings01/password/features/allactions\"\r\n\r\nexport let features = {\r\n SYSAudit,\r\n SYSLogin,\r\n SYSTranslation,\r\n SYSUserSettingsPassword,\r\n SYSUserAdministration,\r\n}\r\n","import type { SYSAction } from \"../../../../_ovlclient/src\"\r\nimport { TableRefresh } from \"../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nconst HookScreenRefresh: SYSAction = async (_) => {\r\n await TableRefresh(\"SYSTranslation\")\r\n}\r\n\r\nconst HookScreenNavigateIn: SYSAction = async (_, { global }) => {\r\n await TableRefresh(\"SYSTranslation\")\r\n}\r\n\r\nexport let SYSTranslation = {\r\n hooks: { HookScreenNavigateIn, HookScreenRefresh },\r\n}\r\n","import type { SYSAction, SYSTableDefIds } from \"../../../../_ovlclient/src\"\r\nimport { TableRefresh } from \"../../../../_ovlclient/src/library/table/tableapi\"\r\n\r\nconst HookScreenRefresh: SYSAction = async (_, { global }) => {\r\n let state = global.getState()\r\n let actions = global.getActions()\r\n await TableRefresh(\"SYSAudit\")\r\n}\r\n\r\nconst HookScreenNavigateIn = async (_, { state, actions }) => {\r\n await TableRefresh(\"SYSAudit\")\r\n}\r\n\r\nexport let SYSAudit = { hooks: { HookScreenNavigateIn, HookScreenRefresh } }\r\n","import { SYSTranslation } from \"../../ovlsyscomponents/systranslation01/screens/allactions\"\r\nimport { SYSAudit } from \"../../ovlsyscomponents/sysaudit01/screens/allactions\"\r\n\r\nexport let screens = {\r\n SYSTranslation,\r\n SYSAudit,\r\n}\r\n","import { features } from \"./features\"\r\nimport { screens } from \"./screens\"\r\nexport let sysComponentsActions = { features, screens }\r\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n","import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n","import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{D:t}=o,i=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,n={HTML:1,SVG:2},e=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,l=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,d=o=>o?._$litDirective$,f=o=>void 0===o.strings,s=()=>document.createComment(\"\"),r=(o,i,n)=>{const e=o._$AA.parentNode,l=void 0===i?o._$AB:i._$AA;if(void 0===n){const i=e.insertBefore(s(),l),c=e.insertBefore(s(),l);n=new t(i,c,o,o.options)}else{const t=n._$AB.nextSibling,i=n._$AM,c=i!==o;if(c){let t;n._$AQ?.(o),n._$AM=o,void 0!==n._$AP&&(t=o._$AU)!==i._$AU&&n._$AP(t)}if(t!==l||c){let o=n._$AA;for(;o!==t;){const t=o.nextSibling;e.insertBefore(o,l),o=t}}}return n},v=(o,t,i=o)=>(o._$AI(t,i),o),u={},m=(o,t=u)=>o._$AH=t,p=o=>o._$AH,h=o=>{o._$AP?.(!1,!0);let t=o._$AA;const i=o._$AB.nextSibling;for(;t!==i;){const o=t.nextSibling;t.remove(),t=o}},j=o=>{o._$AR()};export{n as TemplateResultType,j as clearPart,p as getCommittedValue,d as getDirectiveClass,r as insertPart,l as isCompiledTemplateResult,c as isDirectiveResult,i as isPrimitive,f as isSingleExpression,e as isTemplateResult,h as removePart,v as setChildPartValue,m as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n","import{noChange as e}from\"../lit-html.js\";import{directive as s,Directive as t,PartType as r}from\"../directive.js\";import{getCommittedValue as l,setChildPartValue as o,insertPart as i,removePart as n,setCommittedValue as f}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=s(class extends t{constructor(e){if(super(e),e.type!==r.CHILD)throw Error(\"repeat() can only be used in text expressions\")}ht(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.ht(e,s,t).values}update(s,[t,r,c]){const d=l(s),{values:p,keys:a}=this.ht(t,r,c);if(!Array.isArray(d))return this.dt=a,p;const h=this.dt??=[],v=[];let m,y,x=0,j=d.length-1,k=0,w=p.length-1;for(;x<=j&&k<=w;)if(null===d[x])x++;else if(null===d[j])j--;else if(h[x]===a[k])v[k]=o(d[x],p[k]),x++,k++;else if(h[j]===a[w])v[w]=o(d[j],p[w]),j--,w--;else if(h[x]===a[w])v[w]=o(d[x],p[w]),i(s,v[w+1],d[x]),x++,w--;else if(h[j]===a[k])v[k]=o(d[j],p[k]),i(s,d[x],d[j]),j--,k++;else if(void 0===m&&(m=u(a,k,w),y=u(h,x,j)),m.has(h[x]))if(m.has(h[j])){const e=y.get(a[k]),t=void 0!==e?d[e]:null;if(null===t){const e=i(s,d[x]);o(e,p[k]),v[k]=e}else v[k]=o(t,p[k]),i(s,d[x],t),d[e]=null;k++}else n(d[j]),j--;else n(d[x]),x++;for(;k<=w;){const e=i(s,v[w+1]);o(e,p[k]),v[k++]=e}for(;x<=j;){const e=d[x++];null!==e&&n(e)}return this.dt=a,f(s,v),e}});export{c as repeat};\n//# sourceMappingURL=repeat.js.map\n","import{nothing as t,noChange as i}from\"../lit-html.js\";import{Directive as r,PartType as s,directive as n}from\"../directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends r{constructor(i){if(super(i),this.et=t,i.type!==s.CHILD)throw Error(this.constructor.directiveName+\"() can only be used in child bindings\")}render(r){if(r===t||null==r)return this.vt=void 0,this.et=r;if(r===i)return r;if(\"string\"!=typeof r)throw Error(this.constructor.directiveName+\"() called with a non-string value\");if(r===this.et)return this.vt;this.et=r;const s=[r];return s.raw=s,this.vt={_$litType$:this.constructor.resultType,strings:s,values:[]}}}e.directiveName=\"unsafeHTML\",e.resultType=1;const o=n(e);export{e as UnsafeHTMLDirective,o as unsafeHTML};\n//# sourceMappingURL=unsafe-html.js.map\n","// \r\nexport { SYSFormElement } from \"./library/forms/sysformelement\"\r\nexport { SYSBaseElement } from \"./library/sysbaseelement\"\r\n\r\nimport { SYSConfig, app, appState } from \"../../_dev/client/app/src/appdef\"\r\n\r\ntype SYSAppDialogs =\r\n | keyof typeof app.dialogs\r\n | keyof typeof app.editors\r\n | keyof typeof baseEditors\r\n\r\ntype SYSAppForms =\r\n | keyof typeof app.forms\r\n | keyof typeof app.editors\r\n | keyof typeof baseEditors\r\n\r\ntype SYSAppTableDefIds = keyof typeof app.tableDefIds\r\n\r\nexport type CustomValidatorsType = keyof typeof app.customValidators\r\n\r\ntype SYSAppEditors = keyof typeof app.editors\r\ntype SYSAppScreens = keyof typeof app.screens\r\n\r\ntype SYSAppPermissions =\r\n | \"SYSPA\"\r\n | \"SYSUA\"\r\n | \"SYSRA\"\r\n | \"SYSCA\"\r\n | \"SYSUR\"\r\n | \"SYSAU\"\r\n | \"SYSTR\"\r\n | \"SYSTS\"\r\n | \"SYSST\"\r\n | keyof typeof app.permissions\r\ntype SYSAppFeatures =\r\n | \"SYSUserAdmin\"\r\n | \"SYSRoleAdmin\"\r\n | \"SYSUserRoleAdmin\"\r\n | \"SYSCompanyAdmin\"\r\n | keyof typeof app.features\r\ntype SYSAppLongRunningProcess = keyof typeof app.longRunningProcess\r\ntype SYSFormValidationValidators =\r\n | keyof typeof validatorsValidation\r\n | keyof typeof app.customValidators\r\n\r\nexport { SYSConfig }\r\n\r\nimport { startRender } from \"../../_dev/client/app/src\"\r\nimport { appActions } from \"../../_dev/client/app/src/appdef\"\r\nimport { ovlActions } from \"./actions\"\r\nexport type SYSAppFeature = keyof typeof appActions.features\r\n\r\nimport { validatorsValidation } from \"./appdefformvalidation\"\r\nimport {\r\n baseDialogs,\r\n baseEditors,\r\n baseForms,\r\n baseLongRunningProcess,\r\n baseScreens,\r\n} from \"./baseobjects\"\r\nimport {\r\n _registerComponents,\r\n logActions,\r\n logFormValidationErrors,\r\n logRenderTracking,\r\n logState,\r\n rehydrateUserState,\r\n rehydrateUserStateFromFile,\r\n saveUserState,\r\n toggleDebugTracking,\r\n} from \"./global/globals\"\r\nimport { HookAppRouting, HookAppStateReady } from \"./global/hooks\"\r\nimport { ScreenCurrent, ScreenNavigateTo } from \"./library/screenapi\"\r\nimport type { SYSTableData } from \"./library/table/table\"\r\nimport { sessionStore } from \"./offlinestorage\"\r\nimport {\r\n /*addDefaultReactors,*/\r\n defineSYSElements,\r\n init,\r\n registerElements,\r\n} from \"./prepare\"\r\nimport { ovlState } from \"./state\"\r\nimport { sysComponentsActions } from \"./syscomponentsactions\"\r\nimport { StartScreenUpdate, createDeepProxy } from \"./tracker/proxyhandler\"\r\nimport { logTrackingList, testReactorsPaths } from \"./tracker/tracker\"\r\n\r\nexport type { SYSFormValidationValidators }\r\n//IE won't work\r\n//@ts-ignore\r\nif (window.document.documentMode) {\r\n alert(\"Internet Explorer not supported. Upgrade to Edge Browser\")\r\n window.location.href = \"https://www.microsoft.com/de-de/edge\"\r\n}\r\n\r\n// some global vars which help debugging as well in live environment in Desktop Browsers (F12)\r\nglobalThis.OvlLogActions = logActions\r\nglobalThis.OvlLogState = logState\r\nglobalThis.OvlLogRenderTracking = logRenderTracking\r\nglobalThis.OvlToggleDebugTracking = toggleDebugTracking\r\nglobalThis.OvlLogTrackingList = logTrackingList\r\nglobalThis.OvlTestReactorsPaths = testReactorsPaths\r\nglobalThis.OvlSaveUserState = saveUserState\r\nglobalThis.OvlRehydrateUserState = rehydrateUserState\r\nglobalThis.OvlRehydrateUserStateFromFile = rehydrateUserStateFromFile\r\nglobalThis.OvlLogFormValidationErrors = logFormValidationErrors\r\nglobalThis.OvlConfig = SYSConfig\r\n\r\nexport type SYSState = {\r\n ovl: typeof ovlState\r\n app: typeof appState\r\n}\r\n\r\nexport type SYSActions = {\r\n ovl: typeof ovlActions\r\n app: typeof appActions\r\n}\r\nexport type SYSHelpers = {\r\n tablesGetData: {\r\n [key in SYSAppTableDefIds]: (state: SYSState) => SYSTableData\r\n }\r\n}\r\nexport type HookAppRouting_Type = {\r\n fromInit: boolean\r\n urlParams: URLSearchParams\r\n}\r\n\r\nexport const ovl: {\r\n getState: () => SYSState\r\n getActions: () => SYSActions\r\n} = {\r\n getState: () => _ovl.state,\r\n getActions: () => _ovl.actions,\r\n}\r\n\r\nlet _ovl: {\r\n state: SYSState\r\n actions: SYSActions\r\n} = init(\r\n appState,\r\n appActions,\r\n SYSConfig.app.screens,\r\n SYSConfig.app.dialogs,\r\n SYSConfig.app.longRunningProcess,\r\n ovlState,\r\n ovlActions,\r\n baseScreens,\r\n baseDialogs,\r\n baseLongRunningProcess,\r\n SYSConfig.app.forms,\r\n baseForms,\r\n SYSConfig.app.editors,\r\n baseEditors,\r\n app.customValidators,\r\n sysComponentsActions\r\n)\r\ndefineSYSElements()\r\nglobalThis.Ovl = _ovl\r\n\r\nexport let currentScreenAndDialog = {\r\n screens: [],\r\n dialogs: {},\r\n dialogFocusSet: { dialog: \"\", instance: \"\" },\r\n}\r\nsetTimeout(async () => {\r\n try {\r\n await ovl.getActions().ovl.internal._InitApp()\r\n } catch (e) {\r\n console.log(e)\r\n let message = \"Ovl Initialisation Error\"\r\n if (e.message) {\r\n message = `${message}: ${e.message}`\r\n }\r\n document.getElementById(\"app\").innerHTML = message\r\n return\r\n }\r\n let state = (_ovl.state = createDeepProxy(ovl.getState()))\r\n\r\n let bodyEl = document.getElementsByTagName(\"body\")[0]\r\n if (state.ovl.uiState.isDemo) {\r\n bodyEl.classList.add(\"ovl-isdemo\")\r\n }\r\n if (!SYSConfig.fetch.authMode) {\r\n SYSConfig.fetch.authMode = \"token\"\r\n }\r\n if (!SYSConfig._system.defaultDateTimeControlSubmitType) {\r\n SYSConfig._system.defaultDateTimeControlSubmitType = \"UTC\"\r\n }\r\n if (_registerComponents._customElementList.length > 0) {\r\n registerElements()\r\n }\r\n\r\n // update ovl.state.session with persisted value\r\n\r\n let persistedSessionObj = await sessionStore.get(\"base\")\r\n if (persistedSessionObj !== undefined) {\r\n Object.keys(persistedSessionObj).forEach((key) => {\r\n state.ovl.session[key] = persistedSessionObj[key]\r\n })\r\n }\r\n\r\n await startRender(state)\r\n StartScreenUpdate(0)\r\n //addDefaultReactors()\r\n if (state.ovl.uiState.appRehydrated) {\r\n let stateReadyFn = ovl.getActions().app.global?.hooks?.[HookAppStateReady]\r\n if (stateReadyFn) {\r\n await stateReadyFn()\r\n if (_registerComponents._customElementList.length > 0) {\r\n registerElements()\r\n }\r\n state.ovl.app.ready = true\r\n let routeFn = ovl.getActions().app.global?.hooks?.[HookAppRouting]\r\n if (routeFn) {\r\n await routeFn({\r\n fromInit: true,\r\n urlParams: new URLSearchParams(state.ovl.app.urlQueryString),\r\n } as HookAppRouting_Type)\r\n }\r\n }\r\n } else {\r\n setTimeout(async () => {\r\n const queryString = window.location.search\r\n const urlParams = new URLSearchParams(queryString)\r\n state.ovl.app.urlQueryString = queryString\r\n if (_registerComponents._customElementList.length > 0) {\r\n registerElements()\r\n }\r\n let readyFn = ovl.getActions().app.global?.hooks?.HookAppReady\r\n if (readyFn) {\r\n await readyFn()\r\n }\r\n if (state.ovl.app.cleanUrl) {\r\n window.history.replaceState({}, document.title, \"/\")\r\n }\r\n\r\n let stateReadyFn = ovl.getActions().app.global?.hooks?.[HookAppStateReady]\r\n if (stateReadyFn) {\r\n await stateReadyFn()\r\n if (_registerComponents._customElementList.length > 0) {\r\n registerElements()\r\n }\r\n }\r\n state.ovl.app.ready = true\r\n let routeFn = ovl.getActions().app.global?.hooks?.[HookAppRouting]\r\n if (routeFn) {\r\n await routeFn({\r\n fromInit: true,\r\n urlParams: new URLSearchParams(state.ovl.app.urlQueryString),\r\n } as HookAppRouting_Type)\r\n }\r\n if (!ScreenCurrent() && SYSConfig.init?.initalScreen) {\r\n await ScreenNavigateTo(SYSConfig.init.initalScreen)\r\n }\r\n }, 0)\r\n }\r\n}, 0)\r\n\r\nexport type SYSSessionEntries = \"Language\" | \"Token\"\r\n\r\nexport type SYSForm = SYSAppForms | keyof typeof baseForms\r\nexport type SYSDialog = SYSAppDialogs | keyof typeof baseDialogs\r\nexport type SYSEditor = SYSAppEditors | keyof typeof baseEditors\r\nexport type SYSLongRunningProcess =\r\n | SYSAppLongRunningProcess\r\n | keyof typeof baseLongRunningProcess\r\nexport type SYSTableDefIds =\r\n | SYSAppTableDefIds\r\n | \"SYSPortalSettings\"\r\n | \"SYSTranslation\"\r\n | \"SYSAudit\"\r\n | \"SYSUserAdministration_User\"\r\n | \"SYSUserAdministration_UserRoleTransfer\"\r\n | \"SYSUserAdministration_Role\"\r\n | \"SYSUserAdministration_Permission\"\r\n | \"SYSUserAdministration_ResultingPermission\"\r\n | \"SYSUserAdministration_UserRole\"\r\n | \"SYSUserAdministration_Company\"\r\n | \"SYSTableSettings_FilterSort\"\r\n | \"SYSTableSettings_ColumnFilter\"\r\n\r\nexport type SYSFeature =\r\n | SYSAppFeature\r\n | keyof typeof sysComponentsActions.features\r\n | \"SYSTableSettings\"\r\nexport type SYSScreen =\r\n | SYSAppScreens\r\n | keyof typeof sysComponentsActions.screens\r\n | keyof typeof baseScreens\r\nexport type SYSPermissions = SYSAppPermissions\r\nexport type SYSFeatures = \"SYSPortalTesting\" | SYSAppFeatures\r\n\r\ntype SYSActionContext = {\r\n global: { getState: () => SYSState; getActions: () => SYSActions }\r\n context: { getState: () => SYSState; getActions: () => SYSActions }\r\n execution?: {\r\n handled: boolean\r\n currentRes: any\r\n // use data to hand over data from before to main action or to after action\r\n // like when the user selects an option in the before which is also relevant for the following actions\r\n\r\n data: any\r\n cancel: () => void\r\n }\r\n}\r\n\r\nexport { html, render } from \"lit-html\"\r\nexport type { TemplateResult } from \"lit-html\"\r\nexport { directive } from \"lit-html/directive.js\"\r\nexport type { DirectiveResult } from \"lit-html/directive.js\"\r\nexport { ifDefined } from \"lit-html/directives/if-defined.js\"\r\nexport { repeat } from \"lit-html/directives/repeat.js\"\r\nexport {\r\n UnsafeHTMLDirective,\r\n unsafeHTML,\r\n} from \"lit-html/directives/unsafe-html.js\"\r\n\r\nexport type SYSAction = (\r\n value?: T,\r\n context?: SYSActionContext\r\n) => R\r\n"],"names":["SnackTrackedReplaceContent","content","ovl","SnackAdd","text","type","durationMs","SnackTrackedAdd","key","SYSSeqId","SnackTrackedRemove","postRequest","url","data","isBlob","noSnack","customTimeoutMs","authCookieCheck","ovlFetch","getRequest","lastAppNoServerConnectionTimestamp","lastAppReloginTimestamp","FetchException","message","method","isFormData","isAuthCheck","res","snackMessage","snackMessageType","reqOptions","timer","state","isApiAccess","token","headers","contentType","user","SYSConfig","stringifyReplacer","GetUrlWithParams","timeOutMs","controller","signal","req","itfprttoken","SessionUpdate","itfprtsession","sessionObj","k","res0","checkAllArrayPropertiesForCompressedAndUncompress","now","T","DialogModal","nfurl","DialogOk","Logout","msg","err","noServerConnectionMsg","obj","_uncompressAndMassageServerData","serverData","colIndexToColName","row","newRow","colVal","colName","UrlCreator","urlWithParams","Data","endpoint","options","expectBlob","ignoreSnack","HookFormSummaryValidationTextDisplay","HookFormValidatorsCustom","HookFormValidatorsDefaults","HookFieldValidationTextDisplay","HookAppUrlResolver","HookAppFileOpen","HookAppStateReady","HookAppRouting","HookAppAfterRehydrate","HookAppSaveState","HookTableInit","HookTableSchemaAssign","HookTableDragDrop","HookDialogClose","HookDialogActivate","HookScreenNavigateIn","HookScreenNavigateOut","HookTableFn","HookFormInit","HookFormRemove","HookFormChanged","HookFormRenderingAfterRender","HookFormRenderingFirstUpdated","HookFormRenderingUpdated","HookTableRenderingAfterRender","HookTableRenderingFirstUpdated","HookTableRenderingUpdated","HookFormDirtyChanged","HookFormIsDirty","HookFormIsValid","HookFormValidate","HookFormAdd","HookTableRowFnResultExecution","HookTableRowFn","HookTableRowFnConfirm","HookTableRowFnCan","HookTablePrepareFn","HookTableCustomFilter","HookTableCustomSort","HookTableColumnFn","HookFieldGetList","HookFormFieldsInit","HookFormAutoInit","HookFormEditorInit","HookFormEditorSave","HookFormEditorDelete","HookFormEditorCancel","HookTableFilterSortSettingsDifferentiator","HookLookupsRefresh","HookLookupRowRefreshed","HookFieldLookupPostRefresh","HookTableSetColumnVisibility","HookFieldGetValueRender","HookFieldGetEditHint","HookTHGroupGetLabelRender","HookFieldGetLabelRender","HookFormGetBodyRender","HookFormGetCaptionRender","HookFormCustomControlRender","HookViewRowClass","HookViewRowCellClass","HookViewHeaderCellClass","HookTableServerBeforeMergeRow","HookTableServerData","HookTableCustomTitle","HookTableRowAttributesGetAttributes","HookTableRowAttributesGetAllAttributes","HookTableRowAttributeGetProperties","HookTableClicked","HookTableBeforeDelete","HookFormBeforeCancel","HookFormAfterCancel","HookTableBeforeSave","HookTableSaveError","HookTableAfterSave","HookTableDeleteError","HookTableRowsAfterRebuild","HookTableAfterDelete","HookTableGroupValue","HookTableGroupSortValue","HookTableGroupCalcValue","HookTableGroupHeaders","HookTableGroupFooters","ProcessRunningChangeSnack","processType","snack","instance","processState","processInstanceState","hasTrackedSnack","id","snackId","ProcessStart","lock","ProcessEnd","ProcessIsServerAccessRunning","procState","f","s","ProcessIsRunning","instanceState","isRunning","_a","ScreenRefresh","screen","screensFunctions","screenCurrentState","ScreenCurrentState","context","ScreenCurrent","nav","ScreenState","_b","ScreenNavigateTo","ScreenNavigateBack","nextScreen","ValidationsAdd","fields","translationKey","resetContext","formState","validation","_enrichValidation","_addValidation","ValidationGetTranslation","translationReps","involvedFieldKeys","allPlaceholders","m","tres","ValidatorCheck","field","validator","val","_callValidator","_validationsAdd","_validatorUse","validatorsFunctions","group","ValidationsRemove","validationkey","_removeValidation","needsSetVisibleValidation","formsState","setVisibleValidation","_setFormValid","v","setFocus","FieldSetFocus","debounce","_setVisibleValidation","_setFieldValid","allValidation","summaryFieldKeysAllWatched","fieldKey","r","tabErrors","rr","allWatchedPerKey","watchedLength","allWatchedEntry","_checkFormValid","_getFormValid","setFormDirty","newDirty","fn","hookFormDirtyChanged","HasVisibleSummaryErrors","getFormFields","schema","formFields","instanceId","formType","feature","subFeature","mode","defId","fillSpaceIfEmptyField","_c","_d","_e","IsComplexType","formFieldsInitHook","value","dt","t","offsetTime","getDisplayValue","ui","SetTranslatedLabel","columnKey","caption","def","TableGet","_setDialogVisible","visible","dialogState","_setFieldReadonly","readOnly","_setFieldInactive","inactive","animate","focus","calledFromGroup","forceValueWhenInactive","forceValue","keepValidation","clearList","forceFocus","selectIfFocusSet","noRetrigger","FieldSetVal","_setFieldWatched","_clearFieldList","wasActive","validated","_ValidateField","_setFieldVisibility","functionName","lookupsState","_setFieldTouched","touched","watched","_setFieldFocus","el","_resetValidationForContext","_field","indexesToDelete","i","_FieldListBustCache","cacheKey","_GetFieldListCacheKey","_cachedFieldLists","FieldValidate","FormGet","FieldSetState","active","FieldReset","clearValue","FieldForceChange","FieldVal","fieldSetValDebounce","wasInit","_fieldSetVal","getDateISOString","getDateValue","FieldIsValid","FieldIsValidSelective","FieldIsFocused","FieldIsVisible","FieldIsVisibleOrFillsSpace","FieldIsDirty","forceSelect","FocusSet","FieldForceSave","FieldCurrentVal","useDisplayValue","lookupColumnKey","getListValue","FieldCurrentList","_GetFieldList","FieldList","listDataState","forceClear","KeyValueListFromServerFn","GetRowFromFormState","_focusOutHelper","list","filterValue","formId","isInnerEvent","forceNoSnack","notFullList","uiContext","postData","fieldId","listdata","ignoreRefreshLogic","fnParam","localListState","ignoreNulls","keyColumns","keyColumn","mandatoryColumns","firstRow","c","FilterHitList","top","forceCacheBust","hitLength","dataList","directValue","directDescription","resForSelectIfEmpty","directKeyHits","exact","lookupTypes","checkRow","found","checkVal","typ","getDecimalValue","idx","a","b","sres","refVal","_GetListValue","displayField","listValue","fieldKeys","rowKeys","cachedValueRendererFn","cachedRendererFn","GetValueFromCustomFunction","align","rendererFn","GetRendererFn","getColumnDefsFromFormState","GetFieldLabel","labelRender","reactors","RemoveGlobalReactor","paths","AddGlobalReactor","cb","debounceMS","p","exist","handleReactor","path","reactorvalues","retValue","reactor","callbacks","_RenderTracking","startTrack","stopTrack","disposeTrack","pathsSet","pathsCallbackSet","logTrackingList","testReactorsPaths","resolvePath","isTracking","addTrackedPath","currentComp","compPaths","cachedListFn","_GetAlign","_GetColumnInTableVisibility","validColumn","isMobile","cachedListKey","listFn","col","tableDefId","format","isHtmlType","_f","GetDisplayValueByType","fnKey","getIntegerValue","customRendering","GetRowRawValue","rowKey","displayMode","customRendererResult","GetRowDisplayValue","ignoreRenderBarrier","rowPart","deleteTableRow","tableDataAndDef","tableGroupHeaderBreaks","tableGroupFooterBreaks","tableGroupResults","index","rowId","_GetEntityNameMulti","entityTranslationKey","multiEntityTranslationKey","_GetTableDialogTitle","actionName","count","rows","ignoreId","selectionText","idTranslation","idColumnTranslationKey","translationPrefix","entityName","multiTranslationKey","initTableState","onlyColumns","wasInitialised","kk","_g","initialSort","sortDef","uiState","features","customRowActions","custom","hidden","_HasPermission","FeatureInfo","dataFetching","columns","hasEditableColumns","order","_i","_h","_TableSetColumnVisibility","_TableRefreshServerData","actions","forceServerDataRefresh","localData","serverFilter","localDataSync","_EnrichColumnsFromSchema","TableSortFn","restable","validSortGroupsFn","fnName","sortfield","isList","colDef","lang","customSortFn","sortCustom","renderSortfieldValueFn","ascending","useValue","sortByFeedback","groupValA","groupValB","SortGet","valB","valA","renderVal","_TableFilterFn","calledFromColumnFilterId","originalColumns","staticFilter","filterKeys","rowState","f2","filterCustom","customFilterFn","hasCustomFilter","selectedRow","visibleColumns","columnFilterColumns","hasColumnFilter","rangeFilterColumns","hasRangeFilters","columnId","column","val2","valToCompare","getOnlyDateISOString","filter","nullHandling","filterAttributes","getAttributesFn","defKey","attributesToCheckFor","cnt","rowAttributes","isArray","attributeKey","renderValueFns","dispValue","getFormFieldsFromColumns","noLabel","_GetRowFnToSet","fnNameId","_DoRowFnProcessRunningCheck","rowControlActions","singleFnId","hasEditBlock","hasViewBlock","alreadyDisabled","process","instanceKey","createDynamicRowFunctions","isTableRowDetailView","comp","_tableRowFnSetHelper","functionsToSet","_showTableRowFnConfirm","systemValidationContent","systemConfirmContent","customConfirmContent","title","connectedForm","DialogOkCancel","html","_GetFnResultToSet","res2","code","rowControlActionsHandler","isCustom","customFns","fnResultToSet","connectedFormBehaviour","customFunctionName","customFunction","customFnDef","connectedConfirmFormState","trackStatusIntervall","clientId","validKeys","_RowFnConfirmFormHelper","_handleRowFnTracking","_handleRowFnEndpointData","_handleRowFnConfirmFieldsReset","_DoRebuildAndFixPage","selectedKeys","noPromptDependentFromHookResult","connectedFormState","confirmContentFn","formIdKey","FormInit","cancelPrompt","toSet","FormBodyRenderer","hookDef","cachedRendererKey","cachedRenderer","fromInit","columnsVisible","DoRefreshLookups","allColumnKeys","keyToOvlL_Columns","colKey","keyAndRest","lookupKey","isV2Mode","lookups","lookupsKeys","lookupMainDef","lookupDef","colsToDelete","resultRow","idValue","lookupData","refreshed","keyToOvl","mappedDataToLookupColumnKeys","lookupColKey","matchingDataColumnKey","dataColKey","keyColumnSearch","dataKeyColumn","lookupsData","keyVal","mappedDataColumnKey","_value","_ResetFilters","clear","TableColumnFilter","TableCustomFilter","filterAttributesInitial","TableAttributeFilter","DialogIsOpen","fromColumnHeaderColumn","rangeFilterState","_ResetSort","GetTableKeys","dataDef","onlyUseTheseKeys","resKeys","opt","keys","selected","_GetFilterSortDifferentiator","filterSortStoreDifferentiator","_GetFilterSortMainDifferentiator","formHookFns","formValidationHint","FormHasVisibleSummaryErrors","hookFormBodyRender","getBodyHookRes","groupedColumns","g","groupsState","formStateGroupsState","editGroupClassName","editGroupLabelClassName","editGroupFieldsClassName","groupLabel","columnRenderingState","valid","visibility","uiItem","TableFormGetControl","feedback","form","errorCount","warningCount","resetFields","FormReset","selectedObjects","trackingPromise","ids","formValues","files","withFiles","TableStaticFilterGet","formData","z","sendres","error","trackType","resolve","reject","intervallMS","interValRunning","status","hint","_AddRowToDisplayedArray","tb","currentDefId","rowChanges","tdKey","td","rebuildTracking","deletedKeys","deleted","hasAggregates","deletedInside","dk","tk","added","updated","currentData","paging","pages","allCount","changedKeys","ck","dfk","TableRebuild","_DoServerDataConversionSyncAndBuildUpRebuildAndChangedInfo","clientConversion","serverRow","currentRow","rebuild","isAdd","mergeRowHookParams","checkForOtherModifications","changedColumns","changed","otherModified","setToNullIf","setToValueIfNull","modifiedColumnList","_FillListControl","global","actionTracking","cumulatedPathsFromProxify","createDeepProxy","target","preproxy","makeHandler","receiver","pathToTrack","ownKeys","proxify","pathToTrackParent","dotpath","startScreenUpdate","rres","StartScreenUpdate","unproxy","debouncedScreenUpdate","doScreenUpdates","trackingBlock","currentScreenAndDialog","componentsRendered","pathsIgnoredBecauseInScreenTransition","cbs","_ResetForm","_RemoveForm","forms","_SetFormUndirty","e","_SetFormDirty","_SetFieldTouched","_ValidateDataType","hardValueSet","entry","timehelper","parts","newDate","vals","dayFirst","DisplayFormats","cDate","cDay","cMonth","cYear","day","month","year","resp","dval","toIsoString","parsedVal","pval","valToParse","splits","fixed","asInt","valLeftInt","valRightInt","splitter","valueCorrected","date","tzo","dif","pad","num","_ValidateSchema","_ValidateList","ignoreCustomValidation","forceValidation","systemValidationCount","hookFormValidate","fieldToUse","_InitForm","parentField","formInstanceList","formStateCreated","TableSchemaGet","editorInitHookName","editorInitHook","editorInit","prefix","transKey","autoInitHook","autoInit","parent","validatorDefaultHook","formInitHook","initRes","newSituationObject","newSituation","groupKey","defColumns","_j","endpointListFields","existingList","checkValue","isValid","validValueChanged","changedParams","hookFormChanged","_k","validationKey","_l","setRowCellInformation","FormIsValid","_FocusField","hasFocus","_WatchField","resolveFn","hookViewRowCellClass","viewRowCellParams","hookViewHeaderCellClass","viewHeaderCellParams","_ChangeField","_watched","newValForChanged","oldValForChanged","oldValidValue","newValid","oldDirty","initForm","FormEditorInit","parentFormState","parentFieldKey","FormSave","tableDef","result","DialogClose","FormRemove","ovlSysState","TableRemoveRowFromData","FormSetGroupState","groupState","validFields","first","formIsValid","hookFormIsValid","validRes","FormIsDirty","hookFormIsDirty","dirtyRes","FormIsLocked","handleScreenVisible","screensState","screenState","screenEl","elsToInit","lastScreen","screenIndex","tabIndex","_globals","w","_handleDialogVisible","dialog","dialogsState","dialogEl","shellbars","currentDialog","formHandling","focusState","currentDialogStates","DialogCurrentState","instanceOfAny","object","constructors","idbProxyableTypes","cursorAdvanceMethods","getIdbProxyableTypes","getCursorAdvanceMethods","transactionDoneMap","transformCache","reverseTransformCache","promisifyRequest","request","promise","unlisten","success","wrap","cacheDonePromiseForTransaction","tx","done","complete","idbProxyTraps","prop","replaceTraps","callback","wrapFunction","func","args","unwrap","transformCachableValue","newValue","openDB","name","version","blocked","upgrade","blocking","terminated","openPromise","event","db","readMethods","writeMethods","cachedMethods","getMethod","targetFuncName","useIndex","isWrite","storeName","oldTraps","advanceMethodProps","methodMap","advanceResults","ittrProxiedCursorToOriginalProxy","cursorIteratorTraps","cachedFunc","iterate","cursor","proxiedCursor","isIteratorProp","_GetSYSStateStoreName","_GetSYSFilterSortStoreName","_GetSYSSessionStoreName","dbPromiseSYS","stateStore","filterSortStore","sessionStore","_SetLastScrollPosition","_","setLastScrollPosition","screenFadedOutResolver","_Navigate","navigateBack","currentScreenState","savedPreviousScreen","savedPreviousScreenContext","screenElement","navDirection","hooks","screenHookPromise","screenFadedOutPromise","hasOSReducedMotion","screenHookPromiseRes","isScreenDisabledByRunningProcess","processTracker","_SetPortalTestingMode","_SetLanguage","startup","ResetT","language","body","_Logout","logout","_GetFile","FileGetDefaultUrl","processOptions","_ShowFile","_RehydrateApp","persistedState","stateStoreId","offlineState","currentScreen","currentScreenInstance","screens","dialogs","persistedDialogs","persistedDialogsClone","visibleScreen","visibleScreenInstance","persistedScreens","tid","datadef0","datadef","MergeDeep","formtype","formsInstanceState","isObject","item","sources","source","Rehydrate","contents","_InitApp","apiResolverHookFn","urlResolverToSet","ApiOnlineCheck","SiteUpdateCheck","customInitFn","sessionBase","fetchOptions","response","currentScreenContext","o","scrollable","scrollToLastPosition","lastScrollTop","SYSBaseElement","__publicField","fromScreenEnterUnhide","dialogVisible","screenVisible","isComponent","isScreenAndVisible","isDialogAndVisible","disableBodyScroll","startTime","endTime","render","enableBodyScroll","fadeInClass","fadeOutClass","_HookTableGroupDefId","SYSTableRowWrapper","columnsToSet","editSelected","selectedClass","rowClass","rowTooltipMsg","draggable","msgSet","lastRow","validationSummary","editRowSC","tableGroupHeaders","tableGroupFooters","groupHeaderBreak","groupFooterBreak","isHeader","isFooter","dataFilteredAndSorted","nextRowKey","previousRowKey","tableGroupHeadersFootersParams","ifDefined","results","colCount","classList","tds","cssForTd","colSpan","_GetFilterSettingsCardCodes","_GetFilterSettingsCntctCodes","_FilterChangedComparedToDefault","current","_GetCurrentFilters","_default","_GetDefaultFilters","_SortChangedComparedToDefault","_GetCurrentSorts","_GetDefaultSorts","_SetCurrentActiveTableSettingsFilter","desc","settingsTable","sTable","persistableFilterSortSettings","_GetCurrentActiveTableSettingsFilterSortJsonString","ignoreSort","_GetCurrentActiveTableSettingsFilterSort","columnFilters","rangeFilters","customFilters","attributeFilters","tableFilter","customSort","tableSort","allCustomFilters","_FilterSortChanged","valParsed","currentParsed","_GetFilterSortPermission","featureRead","featureOwn","featureCompany","featureAll","read","own","company","all","extended","settingsToSave","differentiator","filterSort","table","valToUpdate","HookField_Code_GetValueRender","InitBaseTable","_BaseTableContextForColumnFilter","resHtml","HookField_Free1_GetValueRender","baseTable","_SetFilter","HookTableCustom_OriginalSort_Sort","HookField_HeaderMenuRangeFilterType_GetList","HeaderMenuFilterFieldsSetState","currentColumn","tableFn","filterType","selectedColumn","advancedFilter","isValidColumnFilterForRange","toRemove","HookField_HeaderMenuSelectPersistedFilterSort_GetList","presetAll","presetCompany","userCode","userCompanyName","s1","s2","ownA","ownB","Desc","d","HookField_CanBeUsedBy_GetList","l","HookField_U_CntctCode_GetList","HookField_U_CntctCode_GetValueRender","TableCellVal","exclusive","filterVal","filtered","tblTableSettings_ColumnFilter","TableRefresh","refresh","TableInit","currentoptions","rowkey","TableFormStateGetForRowKey","TableFormStateInitForRowKey","TableFormEditRow","formid","filterKey","TableStaticFilterSetEntry","TableStaticFilterRemoveEntry","TableStaticFilterReset","TableSaveRow","TableColumnFilterGet","columnFilterRebuildDebounce","attributeDefKey","TableFilterSelected","TableCustomSort","TableSelectAll","TableCustomColumnFn","TableFilter","TableColumnSort","init","TableRowFnExecute","keysToProcess","rowToSave","_TableDefSelectRow","TableSelectRow","colSysState","isInline","TableFormAddRow","addRes","rowKeyMode","columnDef","isCalculatedColumn","multi","_TableFormCloseEditRow","TableGetTotalResult","aggregateCode","TableGetGroupValueTotalResult","groupCode","groupValue","initresult","_TableGetGroupInitAggregateResult","isString","controlTypeFromTableDefId","useControlType","controlType","TableOpenColumnFilter","additionalColumn","sort","localData0","foundKey","localKey","DialogOpen","mostPreferedLanguage","formatter","formattedParts","displayFormats","_customElementList","_registerComponents","OvlAddComponent","tagName","OvlAddScreen","OvlAddDialog","languageRef","permission","modifier","permissions","uuidCounter","appId","ticks","userId","userIdS","counter","_isMobile","check","_isIOS","isIOS","_isSafari","isSafari","_isFirefox","isFirefox","_hasOSReducedMotion","fmt","sdf","D","N","decimal","N0","rehydrateUserStateFromFile","fileHandle","rehydrateUserState","saveUserState","saveState","reason","testId","logoutAndClearFlag","newObj","regs","reg","cacheKeys","cacheName","toggleDebugTracking","logState","logProxy","logRenderTracking","logFormValidationErrors","logActions","_SetFocus","preventScroll","blob","mimeType","fileName","responseHeaders","fileOpenHook","TCache","autoAdded","reps","returnIfNotFound","rep","cacheRes","_T","_SecondPassPlaceholders","templates","startCharPos","endCharPos","dynamicPart","link","linkDesc","linkTemplate","mobileKey","str","PermissionHas","foundKeys","endIndex","_splitCamelCaseWithAbbreviations","to","hashRes","force","defaultValue","_SetFeatureInfo","Text1","Text2","Text3","Json1","Val1","Val2","usersstate","userfeaturestate","_DeleteFeatureInfo","_TableGroupCalcAggregate","currentResult","currentVal","sum","min","max","avg","SYSTableHeader","currentModifiers","currentNode","linkHandledByOvl","linkHandledBySystem","zz","executionToSet","mainDifferentiator","entries","observer","params","urlCreator","toremove","eventType","DialogCurrent","validRow","expandClick","targetId","dialogType","details","ts","feedbackMsg","unsafeHTML","node","dataAndSchema","columnsCount","processesToTrackForRowFnHintDisplay","customHeaderCellClasses","stickyTableHeader","groupHeaderRow","thHeaderEnd","thGroups","colspan","thGroup","oldK","headerPart","headerRow","uiStateFilterColumn","filterCustomInit","sortdirection","sortdirectionTitle","hasCustomSort","cellBgColor","filterAttributesInit","customHeaderCellClass","tooltip","colStyle","rowNavTop","rowNavBottom","dataRows","filteredRowsCount","dataAndAddRows","doNotRender","delKeys","repeat","titleText","titleTemplate","hasSelectedFilterChanged","titleTranslationKey","customFnHook","customFnHookResult","sortText","tooltipSort","values","filteractive","filterTextAndTooltipArray","filterText","icon","filterTextArray","filterAttributeInitDef","filterAttributeDef","filterAttributeKeys","tooltipAttributes","filterAttributeArray","filterAttributeText","filterAttributeTemplate","filterTemplate","sortTemplate","setTemplate","setText","markInvalid","delim","titleAsTemplate","_m","titleFromHook","tableBottom","_HeaderMenuFilterFields","_TableSetPage","pageDef","_TableFilterSelected","_TableSelectHeader","_TableSort","_TableFilter","_TableSelectAll","selectedRows","_TableSetViewTab","_TableSelectRow","selectRow","selRows","sel","multiselect","currentIdx","closestIdx","_TableRefreshDataFromServer","getSchema","onlyServerFilter","_TableRefreshDataFromServerHelper","idfield","keysFromServer","validLocalDataKeys","localKeys","localKeysToId","keysArrayFromServer","rowSysState","hasServerData","deleteStaticFilterColumn","deleteFilterColumn","allFilterKeys","k2","returnedKeys","mergeFn","dataKey","_GetOvlSysColDefault","sd","_TableInit","dataAndState","rs","_TableRefresh","promises","ignoreRefreshedMessageSnack","refreshedBecauseOfAge","refreshServerDataIfOlderThan","_TableRebuild","appDefProcess","filterSortPermissions","filterSortSetFromIndexedDB","filterSortPerStaticFilter","currentFilter","newFilter","currentSelected","filterSortTable","aggregateHookFn","expressionHookFn","tableGroupCodes","isValidForCurrentSort","arrLength","fieldArr","aggregateKey","tableGroupCalc","selectedFilterSort","resTableLength","kBefore","staticFilterKeys","isLastRow","groupValChanged","groupCodes","groupValues","currentValue","newResult","currentMultiResult","newMultiResult","nrOfPages","selectionClipping","visibleKeys","afterRebuildFn","_TableOfflineRetrySaveRow","_TableEditSaveRowsHelper","_TableDirectSaveRow","newId","_TableRowError","removeRow","_TableEditSaveRow","EditSaveRowOfflineHelper","newData","rowid","addedKeys","updatedKeys","isOfflineRetry","ignoreNeedsRefresh","processInstanceKey","hasFormState","originatingBatchKey","hasAtLeastOneServerSaved","resFiles","kdx","rowFnResultAdded","backendDecidedToMakeAnUpdateInsteadOfAdd","rowFnResult","rowVal","beforeSaveRowFnName","resData","needToSave","savedLocally","saveLocallyMode","changedRow","customData","processSnack","beforeSaveRes","rowId2","destRow","dataFormatCheck","fixedData","hasFiles","resDataCheck","serverRowFnResult","tkey","existingKey","afterSaveFnName","tableServerDataFnName","resFile","_TableOfflineHandler","operations","errors","deletedKeysKeys","OfflineHandlerErrorHelper","addedKeysKeys","updatedKeysKeys","addAndUpdateSequence","resKey","_TableSelectCustomSort","_TableSelectColumnRangeFilter","_TableSelectFilterSort","_TableSelectColumnFilter","_TableSelectAttributeFilter","filterState","_TableSelectCustomFilter","_TableEditClose","editRow","lastFocus","startIndex","elToFocus","_OpenTableRowHeaderMenu","standalonestate","selectedHeader","canTableSettingsFilterSort","colInitialDef","headerMenuFilterFields","colType","staticFilterWhenDialogActivated","filterSortTableDef","_TableSelectEndRow","_TableEditRow","editType","currentDialogs","_TableMoreRow","_TableViewRow","_TableCloseViewRow","_TableCopyRow","_TableAddRow","newKey","addResult","columnFilter","addFnName","_TableOfflineRetryDeleteRow","DeleteRowOfflineHelper","isOfflineKey","_TableDeleteRow","deletedRow","beforeDeleteResult","afterDeleteFnName","hookErr","cidx","newkey","elementToFocus","deleteErrorFnName","_TableMultipleEditRow","validateAndPromptResult","ValidateAndPrompt","_TableMultipleCustomFunction","fromTableFn","usePrompt","callForEveryRow","hintTranslationKey","multiHint","customFnId","optionalPositionTranslationCode","groupedByColumn","fnc","functionsToSetTemplate","groups","countHint","confirmRes","_TableDeleteRowFromData","_DialogChanged","dialogResolver","_DialogDefaultChanged","DialogResult","dialogToIgnore","DialogSetLock","LanguageSet","langCode","PortalTestingModeSet","isTest","FeatureGet","featureState","textIndex","json","dialogInstance","focusStates","FileGet","dataToUrlParams","PopupShow","popupId","PopupClose","PopupCurrent","currentObj","lastFormFocusSetTS","SYSFormElement","depth","formTypeForAutoInitHook","fieldsToSet","formIdToSet","_o","_n","_r","_q","_p","_u","_t","_s","ftu","focusEl","foundFields","HookSYSLoginSuccess","userState","offeringGlobalState","userdata","SYSLogin","logo","flagDE","flagFR","HookSYSShellbarMenu","getCutQualitiesLookup","cutQualities","lookupState","HookSYSShellbarLanguages","pic","HookSYSShellbarLogo","SYSShellbar","SaveFeedback","PreparePositiveFeedback","PrepareNegativeFeedback","PrepareDeliveryDateFeedback","SelectOrder","DATFeedback","partId","changedField","elToScrollTo","HookField_MobileDesc_GetValueRender","HookField_Search_GetEditHint","HookField_Search_GetList","searchpaket","DATSearchPaket","HookTableCustom_NotFinished_Filter","set","unit","unitBeforeSplit","checkTable","PKGPackaging","OfferingMainRefresh","docEntry","justRefreshColumns","isOfferAdmin","cardCodeValid","cardCode","bpFilterForm","cardCodeField","offerMainType","notRelevant","ReShowOfferingInProgressSnack","GetUnfinishedDocEntry","GetDeliveryTimeHint","midDate","isEdit","deliveryTimeHint","weekAndDateData","deliveryTimeHints","EditLocked","selectedKey","baseTableKeys","OpenTableUploadEdit","resumeDocEntry","sourceTable","SelectOfferFile","file","fileFormData","cadUserField","cadAttr","cadVal","offerType","cntctCode","offeringToolState","id1","id2","existingEntry","id4","BrowseOfferFile","browseFileEl","acceptExtensions","HookField_CardCode_GetList","cardCodeLookupState","QUTBPFilter","ResetDetailChanges","offering","OfferingDetailsRefresh","lookupdata","SetSettingsForm","convertedValue","GetCadAttribute","HookField_U_PrtOfferingCadAttr_GetList","userSettings","SYSEditorAssetDefaultFields","SYSEditorAssetFileGetNameAndExtension","extension","descValWithoutExtension","fileExt","SYSEditorAssetSerializeFromFormState","resVal","ext","cat","chk0","SYSEditorAssetDeserializeToFormFields","assetFieldValue","assetFieldRes","assetDef","baseFieldValue","fileArray","categoryField","valueFieldHtml","fileExtFieldHtml","descFieldHtml","descField","chk0FieldHtml","chk0Field","uploadHtml","assetAllowUpload","fileNames","validExtensions","categoryHtml","fileNameWithoutExtension","fileExtension","EditorDefaultHooks_SYSEditorAsset","SubFeatureHooksFromDefaultHooks","offeringSettingssHookActions","settingsValidate","HookField_CntctCode_GetList","dataState","HookField_OfferType_GetList","HookField_FileType_GetList","HookField_File_GetValueRender","cadAttrVal","is3d","HookFormSYSEditorAssetInit","execution","parentFileType","HookField_U_ITF_PRT_OfferType_GetList","OfferAdminUploadHooks","weekState","currentField","HookField_U_COR_LI_1_GetList","HookField_U_COR_LI_1_GetValueRender","HookField_U_COR_LI_1_GetEditHint","HookField_DocEntry_GetValueRender","handleClick","GotoDetailHelper","CanDetailHelper","HookField_DocTotal_GetValueRender","docTotal","noPartsErr","errorMsg","debounceSuccessAndReset","offeringProgress","offeringState","offeringTable","snackStarted","clearError","setStatus","snackKey","setStatusParam","statusChanged","doNotShowInThisScreen","displayStatus","ShowOfferingProgress","LinkSalesCalc","offerEntry","unLink","updatedSalesCalc","indexToUpdate","QUTOffering","globalOfferingState","width","height","tmp","y","interpolateValue","unique","posIdToCheck","maxCutPoints","xValue","x0","x1","y0","y1","posField","lastlastRow","HookField_U_SKL_GetList","HookTableGroup_m3_CalcValue","template","colToSet","HookTableGroup_stk_CalcValue","adminuploadHooks","QUTOfferingPos","QUTOfferingAdminUpload","itemCode","itemName","skl","rowToCheck","changedFields","HookField_ItemCode_GetList","HookField_TransportType_GetList","isValidSwissPLZ","plz","plzNum","HookField_TransportCost_GetValueRender","total","HookField_CostCost_GetValueRender","HookField_Price_GetValueRender","HookField_LineTotal_GetValueRender","HookField_MaterialDescription_GetValueRender","isDummyClass","HookField_CostDescription_GetValueRender","HookField_TransportDescription_GetValueRender","deliveryText","QUTOfferingDetails","QUTOfferingSettings","getRandomId","HookField_U_CardCode_GetList","selectedVal","HookField_U_Id_GetValueRender","rnd","SPCSymbolPC","HookScreenRefresh","DATOrder","DATQuotation","searchPaketFields","tblSearchPaket","PKGPackagingCustomerChooser","QUTOfferingAdminCut","QUTOfferingAdmin","Reupload","SPCSymbolPCEndUser","CompBPFilter","GENBPFilter_Init","CompImagePopup","dialogHolderParams","GENImagePopup_Init","CompFeedbackForm","msgField","handleOk","handleCancel","cancel","CompDPInvoiceOverview","fileType","docNum","handleRemoveAllPDFPopup","detailCount","bgColor","dueDate","downloadPopup","CompInvoiceOverview","CompOrderDetail","channelExtension","CompOrderDetailLayout","generalData","CompOrderFeedback","handlePositiveFeedback","handleNegativeFeedback","handleDeliveryDateFeedback","deliveryFeedback","CompOrderOverview","channelGroupHeaderDisplayed","orders","channelGroupHeader","CompOrderTimeLine","CompQuotationOverview","statusColors","ScreenSearchPaket","formField","search","searchPaket","DATDocuments_Init","ScreenOfferingDetails","materialRes","transportRes","materialDef","materialKeys","material","catKey","transportDef","transportKeys","transport","costDef","costData","manualSurchargeItems","materialTreatmentItems","editable","editLocked","costs","costsData","costsDef","costsTotalNum","costsTotal","transportData","transportTotal","transportTotalNum","materialData","materialTotal","materialTotalNum","totalNum","deliveryTimeHintDesc","deliveryTimeHintValue","img","adminOfferInfo","cadOfferType","reuploadOrNewPositionsButton","ScreenOffering","handleEdit","uploadDisabled","isCAD","add","manual","instantOffer","howToVideo","offeringOverview","BPFilterFields","ScreenOfferingAdmin","allOfferTab","errorDisplay","comments","isInProgress","progressBar","calcOrders","sortedCalcOrderRows","ScreenOfferingAdminCut","h","n","u","$","x","A","E","C","P","V","H","I","R","S","M","L","Z","j","DialogGet","dialogComp","dialogParts","defaultKeyHandler","handleTopLevelClick","handleDismiss","keyHandler","fullheader","dtitle","dheader","header","iconname","dbody","footer","dfooter","customClass","typeClass","SYSDialogBase","CompDialogQUTOfferingPos","rowsCount","commissionValid","currentEditsCount","isNew","cntct","startOfferDisabled","createOrApplyButton","positions0","positions","commission","allFormStates","CompOfferingSettings","QUTOffering_Init","ScreenSymbolPC","ScreenSymbolPCEndUser","filesDL","SPCSymbolPC_Init","ScreenSYSAudit","SYSAudit_Init","SYSEditorDialogBase","handleSave","handleDelete","SYSEditorAsset_Init","SYSEditorAsset","DialogSYSLoginForm","userField","pwField","pwBox","hideForgotPassword","handleKey","SYSLogin_Init","InitStateFromLogin","isRelogin","ur","LoginStart","CompSYSBackButton","handleBack","HookSYSShellbarDisplayHint","HookSYSShellbarCustomBackButton","HookSYSShellbarTitle","CompSYSShellbarHint","CompSYSRefreshButton","refreshIsRunning","handleRefresh","buttonInactive","offline","offlineIndicatorText","HandleOvlFocusIn","focusId","AppShellGet","ovlState","appState","appMainClass","FieldValidationTextGet","visibleErrors","resIndex","sep","FormSummaryValidationTextGet","relevantErrors","CompSYSShellbar","menuId","menus","iconText","iconOrText","devHint","demoHint","portalTestingHint","hints","appTitle","menu1","menu2","userMenu","sysRefreshButton","items","languageSelector","availableLanguages","langresults","languageItems","part","adminResults","portalTestingModeMenuText","userInitials","backButton","shell","SYSShellbar_Init","ScreenSYSTranslation","SYSTranslation_Init","DialogSYSUserAdministrationCompany","CompSYSUserAdministrationSettings","userAdministration","roles","users","companies","RefreshResultingPermission","DialogSYSUserAdministrationPermission","selectedRoleTable","role","userRoleTable","selectedUserCode","CompSYSUserAdministrationPermission","DialogSYSUserAdministrationRole","DialogUserAdministrationUser","DialogSYSUserAdministrationUserRole","selectedUserTable","selectedUser","firstName","lastName","buttonTransferRole","resultingPermissionsTable","permissionsOverview","cds","DialogSYSUserAdministrationUserRoleTransfer","sync","fromUserId","fromUserName","selectedTargetUserTable","toUserIds","SYSUserAdministration_Init","CompSYSUserSettingsPasswordForm","pw1Field","pw2Field","SYSUserSettingsPassword_Init","DialogPKGPackagingSplit","selectedTable","paket","paket1","paket2","selectedCodes","selectedCount","ScreenPackaging","filterHint","ScreenPackagingCustomerChooser","allDataState","customerInformationSortedKeys","PKGPackaging_Init","CompDownloadPopup","handlePDFPopup","CompFileList","endNames","toCheck","toCheckEnd","noop","uid","isNullOrUndef","isNumberFinite","finiteOrDefault","valueOrDefault","toDimension","dimension","thisArg","each","loopable","reverse","len","_elementsEqual","a0","a1","ilen","v0","v1","clone$1","klen","isValidKey","_merger","tval","sval","merge","merger","mergeIf","_mergerIf","keyResolvers","_splitKey","_getKeyResolver","resolveObjectKey","_capitalize","defined","isFunction","setsEqual","_isClickEvent","PI","TAU","PITAU","INFINITY","RAD_PER_DEG","HALF_PI","QUARTER_PI","TWO_THIRDS_PI","log10","sign","almostEquals","epsilon","niceNum","range","roundedRange","niceRange","fraction","_factorize","sqrt","isNumber","almostWhole","rounded","_setMinAndMaxByKey","array","property","toRadians","degrees","toDegrees","radians","_decimalPlaces","getAngleFromPoint","centrePoint","anglePoint","distanceFromXCenter","distanceFromYCenter","radialDistanceFromCenter","angle","distanceBetweenPoints","pt1","pt2","_angleDiff","_normalizeAngle","_angleBetween","start","end","sameAngleIsFullCircle","angleToStart","angleToEnd","startToAngle","endToAngle","_limitValue","_int16Range","_isBetween","_lookup","cmp","hi","lo","mid","_lookupByKey","last","ti","_rlookupByKey","_filterBetween","arrayEvents","listenArrayEvents","listener","base","unlistenArrayEvents","stub","listeners","_arrayUnique","requestAnimFrame","throttled","ticking","delay","timeout","_toLeftRightCenter","_alignStartEnd","_textX","left","right","rtl","atEdge","elasticIn","elasticOut","effects","effects$1","round","lim","p2b","n2b","b2n","n2p","map$1","hex","h1","h2","eq","isShort","hexParse","ret","alpha","hexString","HUE_RE","hsl2rgbn","hsv2rgbn","hwb2rgbn","rgb","hueValue","rgb2hsl","calln","hsl2rgb","hwb2rgb","hsv2rgb","hue","hueParse","p1","p2","rotate","deg","hslString","map","names$1","unpack","unpacked","tkeys","ok","nk","names","nameParse","RGB_RE","rgbParse","rgbString","from","interpolate","rgb1","rgb2","modHSL","ratio","clone","proto","fromObject","input","functionParse","Color","color","weight","c1","c2","w2","w1","index_esm","isPatternOrGradient","getHoverColor","numbers","colors","applyAnimationsDefaults","defaults","applyLayoutsDefaults","intlCache","getNumberFormat","locale","formatNumber","formatters","tickValue","notation","delta","maxTick","calculateDelta","logDelta","numDecimal","remain","Ticks","applyScaleDefaults","_ctx","overrides","descriptors","getScope$1","root","scope","Defaults","_descriptors","_appliers","ctx","targetScope","targetName","scopeObject","targetScopeObject","privateName","local","appliers","apply","toFontString","font","_measureText","gc","longest","string","textWidth","_longestText","arrayOfThings","cache","jlen","thing","nestedThing","gcLen","_alignPixel","chart","pixel","devicePixelRatio","halfWidth","clearCanvas","canvas","drawPoint","drawPointLegend","xOffset","yOffset","size","cornerRadius","xOffsetW","yOffsetW","style","rotation","radius","rad","_isPointInArea","point","area","margin","clipArea","unclipArea","_steppedLineTo","previous","flip","midpoint","_bezierCurveTo","renderText","opts","lines","stroke","line","setRenderOpts","drawBackdrop","decorateText","metrics","bottom","yDecoration","oldColor","addRoundedRectPath","rect","LINE_HEIGHT","FONT_STYLE","toLineHeight","matches","numberOrZero","_readValueToProps","props","objProps","toTRBL","toTRBLCorners","toPadding","toFont","fallback","inputs","info","cacheable","_addGrace","minmax","grace","beginAtZero","change","keepZero","createContext","parentContext","_createResolver","scopes","prefixes","rootScopes","getTarget","_resolve","_cached","_resolveWithPrefixes","getKeysFromAllScopes","storage","_attachContext","proxy","subProxy","descriptorDefaults","_resolveWithContext","_scriptable","_indexable","_allKeys","readKey","needsSubResolver","_proxy","_context","_subProxy","_resolveScriptable","_resolveArray","_stack","createSubResolver","isIndexable","arr","resolver","resolveFallback","getScope","addScopes","parentScopes","parentFallback","allScopes","addScopesFromKey","subGetTarget","resolveKeysFromAllScopes","EPSILON","getPoint","points","getValueAxis","indexAxis","splineCurve","firstPoint","middlePoint","afterPoint","next","d01","d12","s01","s12","fa","fb","monotoneAdjust","deltaK","mK","pointsLen","alphaK","betaK","tauK","squaredMagnitude","pointCurrent","pointAfter","monotoneCompute","valueAxis","pointBefore","iPixel","vPixel","splineCurveMonotone","slopeDelta","capControlPoint","pt","capBezierPoints","inArea","inAreaPrev","inAreaNext","_updateBezierControlPoints","loop","controlPoints","prev","_isDomSupported","_getParentNode","domNode","parseMaxStyle","styleValue","parentProperty","valueInPixels","getComputedStyle","element","getStyle","getPositionedStyle","styles","suffix","pos","useOffsetPos","getCanvasPosition","touches","offsetX","offsetY","box","getRelativePosition","currentDevicePixelRatio","borderBox","paddings","borders","getContainerSize","maxWidth","maxHeight","container","containerStyle","containerBorder","containerPadding","round1","getMaximumSize","bbWidth","bbHeight","aspectRatio","margins","containerSize","retinaScale","forceRatio","forceStyle","pixelRatio","deviceHeight","deviceWidth","supportsEventListenerOptions","passiveSupported","readUsedSize","_pointInLine","_steppedInterpolation","_bezierInterpolation","cp1","cp2","getRightToLeftAdapter","rectX","itemWidth","getLeftToRightAdapter","_itemWidth","getRtlAdapter","overrideTextDirection","direction","original","restoreTextDirection","propertyFn","normalizeSegment","getSegment","segment","bounds","startBound","endBound","between","normalize","_boundSegment","compare","inside","subStart","prevValue","startIsBefore","endIsBefore","shouldStart","shouldStop","_boundSegments","segments","sub","findStartAndEnd","spanGaps","solidSegments","cur","_computeSegments","segmentOptions","splitByStyles","completeLoop","doSplitByStyles","chartContext","baseStyle","readStyle","datasetIndex","prevStyle","addStyle","st","dir","styleChanged","Animator","anims","numSteps","remaining","draw","charts","acc","animator","transparent","interpolators","factor","c0","Animation","cfg","elapsed","duration","rej","resolved","Animations","config","animationOptions","animatedProps","option","newOptions","resolveTargetOptions","animations","awaitAll","running","animation","properties","anim","scaleClip","scale","allowedOverflow","defaultClip","xScale","yScale","toClip","getSortedDatasetIndices","filterVisible","metasets","applyStack","stack","dsIndex","singleMode","otherValue","convertObjectDataToArray","adata","isStacked","meta","stacked","getStackKey","indexScale","valueScale","getUserBounds","minDefined","maxDefined","getOrCreateStack","stacks","stackKey","indexValue","subStack","getLastIndexInStack","vScale","positive","updateStacks","parsed","iScale","iAxis","vAxis","itemStacks","getFirstScaleId","axis","scales","createDatasetContext","createDataContext","clearStacks","isDirectUpdateMode","cloneIfNotShared","cached","shared","createStack","canStack","DatasetController","dataset","chooseId","xid","yid","rid","iid","vid","scaleID","_data","resetNewElements","stackChanged","oldStacked","scopeKeys","_stacked","sorted","isNotInOrderComparedToPrev","labels","singleScale","xAxisKey","yAxisKey","parsedValue","_parsed","otherScale","otherMin","otherMax","_skip","elements","drawActiveElementsOnTop","elementType","sharing","transition","sharedOptions","firstOpts","previouslySharedOptions","includeOptions","arg1","arg2","numMeta","numData","move","removed","newCount","getAllScaleValues","visibleMetas","computeMinSampleSize","curr","updateMinAndPrev","computeFitCategoryTraits","ruler","stackCount","thickness","computeFlexCategoryTraits","pixels","percent","parseFloatBar","startValue","endValue","barStart","barEnd","parseValue","parseArrayOrPrimitive","isFloatBar","barSign","actualBase","borderProps","setBorderSkipped","edge","parseEdge","swap","startEnd","orig","v2","setInflateAmount","inflateAmount","BarController","iAxisKey","vAxisKey","bars","reset","horizontal","vpixels","ipixels","dataIndex","skipNull","barThickness","baseValue","minBarLength","floating","length","head","startPixel","endPixel","halfGrid","maxBarThickness","center","stackIndex","rects","abstract","DateAdapterBase","members","adapters","binarySearch","metaset","intersect","_sorted","lookupMethod","evaluateInteractionItems","position","handler","getDistanceMetricForAxis","useX","useY","deltaX","deltaY","getIntersectItems","useFinalPosition","includeInvisible","getNearestRadialItems","evaluationFunc","startAngle","endAngle","getNearestCartesianItems","distanceMetric","minDistance","inRange","distance","getNearestItems","getAxisItems","rangeMethod","intersectsItem","Interaction","STATIC_POSITIONS","filterByPosition","filterDynamicPositionByAxis","sortByWeight","wrapBoxes","boxes","layoutBoxes","stackWeight","buildStacks","layouts","setLayoutDims","vBoxMaxWidth","hBoxMaxHeight","layout","fullSize","buildLayoutBoxes","centerHorizontal","centerVertical","getCombinedMax","maxPadding","chartArea","updateMaxPadding","boxPadding","updateDims","newWidth","newHeight","widthChanged","heightChanged","handleMaxPadding","updatePos","getMargins","marginForPositions","fitBoxes","refitBoxes","refit","same","other","setBoxDims","placeBoxes","userPadding","height1","width1","layoutItem","minPadding","padding","availableWidth","availableHeight","verticalBoxes","horizontalBoxes","visibleVerticalBoxCount","BasePlatform","BasicPlatform","EXPANDO_KEY","EVENT_TYPES","isNullOrEmpty","initCanvas","renderHeight","renderWidth","displayWidth","displayHeight","eventListenerOptions","addListener","removeListener","fromNativeEvent","nodeListContains","nodeList","createAttachObserver","trigger","createDetachObserver","drpListeningCharts","oldDevicePixelRatio","onWindowResize","dpr","resize","listenDevicePixelRatioChanges","unlistenDevicePixelRatioChanges","createResizeObserver","releaseObserver","createProxyAndListen","DomPlatform","initial","proxies","_detectPlatform","Element","final","autoSkip","tickOpts","determinedMaxTicks","determineMaxTicks","ticksLimit","majorIndices","getMajorIndices","numMajorIndices","newTicks","skipMajors","spacing","calculateSpacing","avgMajorSpacing","skip","offset","tickLength","maxScale","maxChart","evenMajorSpacing","getEvenSpacing","factors","majorStart","majorEnd","diff","reverseAlign","offsetFromEdge","sample","numItems","increment","getPixelForGridLine","offsetGridLines","validIndex","lineValue","garbageCollect","caches","getTickMarkLength","getTitleHeight","createScaleContext","createTickContext","tick","titleAlign","titleArgs","titleX","titleY","positionAxisID","positionAxisID1","value1","Scale","raw","_userMin","_userMax","_suggestedMin","_suggestedMax","metas","sampleSize","samplingEnabled","reversePixels","numTicks","minRotation","maxRotation","labelRotation","tickWidth","maxLabelDiagonal","labelSizes","maxLabelWidth","maxLabelHeight","minSize","titleOpts","gridOpts","display","isHorizontal","titleHeight","widest","highest","tickPadding","angleRadians","cos","sin","labelHeight","labelWidth","isRotated","labelsBelowTicks","offsetLeft","offsetRight","paddingLeft","paddingRight","paddingTop","paddingBottom","widths","heights","widestLabelSize","highestLabelSize","label","tickFont","fontString","lineHeight","nestedLabel","valueAt","optionTicks","rot","grid","border","ticksLength","tl","borderOpts","axisWidth","axisHalfWidth","alignBorderValue","borderValue","alignedLineValue","tx1","ty1","tx2","ty2","x2","y2","limit","step","optsAtIndex","optsAtIndexBorder","lineWidth","lineColor","borderDash","borderDashOffset","tickColor","tickBorderDash","tickBorderDashOffset","crossAlign","mirror","tickAndPadding","hTickAndPadding","textAlign","lineCount","textOffset","textBaseline","ret1","halfCount","strokeColor","strokeWidth","tickTextAlign","backdrop","labelPadding","backgroundColor","drawLine","lastLineWidth","tz","gz","bz","axisID","fontSize","TypedRegistry","override","parentScope","isIChartComponent","registerDefaults","itemDefaults","routeDefaults","routes","propertyParts","sourceName","sourceScope","Registry","typedRegistry","arg","itemReg","registry","component","camelMethod","PluginService","hook","descriptor","plugin","plugins","allPlugins","createDescriptors","previousDescriptors","localIds","i1","getOpts","pluginOpts","getIndexAxis","datasetDefaults","getAxisFromDefaultScaleID","getDefaultScaleIDFromAxis","axisFromPosition","determineAxis","scaleOptions","mergeScaleConfig","chartDefaults","configScales","chartIndexAxis","scaleConf","defaultId","defaultScaleOptions","defaultID","initOptions","initData","initConfig","keyCache","keysCached","cachedKeys","generate","addIfFound","Config","datasetType","mainScope","resetCache","_scopeCache","keyLists","subPrefixes","getResolver","needContext","subResolver","resolverCache","hasFunction","isScriptable","scriptable","indexable","KNOWN_POSITIONS","positionIsHorizontal","compare2Level","l1","l2","onAnimationsComplete","onAnimationProgress","getCanvas","instances","getChart","moveNumericKeys","intKey","determineLastEvent","lastEvent","inChartArea","isClick","getDatasetArea","Chart","invalidatePlugins","userConfig","initialCanvas","existingChart","maintainAspectRatio","_aspectRatio","newSize","newRatio","scalesOptions","axisOptions","scaleOpts","isRadial","scaleType","scaleClass","hasUpdated","datasets","newControllers","ControllerClass","datasetElementType","dataElementType","animsDisabled","_active","_lastEvent","existingEvents","newEvents","_hiddenIndices","changes","_dataChanges","datasetCount","makeSet","changeSet","noArea","ilen1","layers","clip","useClip","platform","_add","_remove","detached","attached","enabled","activeElements","lastActive","pluginId","replay","hoverOptions","deactivated","activated","eventFilter","Chart$1","setStyle","lineTo","getLineMethod","pathVars","paramsStart","paramsEnd","segmentStart","segmentEnd","outside","pathSegment","lineMethod","fastPathSegment","avgX","countX","prevX","minY","maxY","lastY","pointIndex","drawX","truncX","_getSegmentMethod","_getInterpolationMethod","strokePathWithCache","strokePathDirect","segmentMethod","usePath2D","LineElement","_interpolate","interpolated","getBarBounds","bar","half","skipOrLimit","parseBorderWidth","maxW","maxH","parseBorderRadius","enableBorderRadius","maxR","enableBorder","boundingRects","skipX","skipY","hasRadius","addNormalRectPath","inflateRect","amount","refRect","BarElement","borderColor","inner","outer","addRectPath","mouseX","mouseY","lttbDecimation","samples","decimated","bucketWidth","sampledIndex","maxAreaPoint","maxArea","nextA","avgY","avgRangeStart","avgRangeEnd","avgRangeLength","rangeOffs","rangeTo","pointAx","pointAy","minMaxDecimation","minIndex","maxIndex","xMin","dx","lastIndex","intermediateIndex1","intermediateIndex2","cleanDecimatedDataset","cleanDecimatedData","getStartAndCountOfVisiblePointsSimplified","pointCount","plugin_decimation","xAxis","threshold","_segments","tpoints","_findSegmentEnd","_getBounds","targetSegments","tgt","subBounds","fillSources","fillSource","_getEdge","_pointsFromSegments","boundary","linePoints","_createBoundaryLine","_loop","_shouldApplyFill","_resolveTarget","propagate","fill","visited","_decodeFill","parseFillOption","decodeTargetIndex","firstCh","_getTargetPixel","_getTargetValue","fillOption","_buildStackLine","sourcePoints","linesBelow","getLinesBelow","addPointsBelow","below","sourcePoint","postponed","findPoint","pointValue","firstValue","lastValue","simpleArc","_getTarget","getLineByIndex","computeBoundary","computeCircularBoundary","computeLinearBoundary","_drawfill","lineOpts","above","doFill","clipVertical","clipY","lineLoop","lastPoint","src","notShape","clipBounds","interpolatedLineTo","targetLoop","interpolatedPoint","_args","getBoxSize","labelOpts","boxHeight","boxWidth","itemsEqual","Legend","legendItems","labelFont","itemHeight","hitboxes","lineWidths","totalHeight","legendItem","_itemHeight","columnSizes","heightLimit","totalWidth","currentColWidth","currentColHeight","calculateItemSize","rtlHelper","hitbox","hitbox1","defaultColor","halfFontSize","drawLegendBox","drawOptions","centerX","centerY","yBoxTop","xBoxLeft","borderRadius","fillText","realX","fontLineHeight","calculateLegendItemHeight","titleFont","titlePadding","topPaddingPlusHalfFontSize","hitBox","lh","isListened","hoveredItem","sameItem","calculateItemWidth","calculateItemHeight","legendItemText","plugin_legend","legend","ci","usePointStyle","pointStyle","useBorderRadius","borderWidth","Title","textSize","fontOpts","createTitle","plugin_title","titleBlock","plugin_subtitle","positioners","eventPosition","nearestElement","tp","pushOrConcat","toPush","splitNewlines","createTooltipItem","getTooltipSize","bodyFont","footerFont","titleLineCount","footerLineCount","bodyLineItemCount","combinedBodyLength","bodyItem","bodyLineHeight","widthPadding","maxLineWidth","determineYAlign","doesNotFitWithAlign","xAlign","caret","determineXAlign","yAlign","chartWidth","determineAlignment","alignX","alignY","paddingAndSize","getBackgroundPoint","alignment","caretSize","caretPadding","topLeft","topRight","bottomLeft","bottomRight","getAlignedX","getBeforeAfterBodyLines","createTooltipContext","tooltipItems","overrideCallbacks","defaultCallbacks","labelCount","tooltipItem","invokeCallbackWithFallback","Tooltip","beforeTitle","afterTitle","bodyItems","scoped","beforeFooter","afterFooter","labelColors","labelPointStyles","labelTextColors","positionAndSize","backgroundPoint","tooltipPoint","caretPosition","ptX","ptY","x3","y3","titleSpacing","labelPointStyle","colorX","rtlColorX","yOffSet","colorY","outerX","innerX","bodySpacing","bodyAlign","displayColors","xLinePadding","fillLineOfText","bodyAlignForCalculation","textColor","tooltipSize","animX","animY","opacity","hasTooltipContent","positionChanged","caretX","caretY","plugin_tooltip","addIfString","addedLabels","findOrAddLabel","_getLabelForValue","CategoryScale","generateTicks$1","generationOptions","dataRange","precision","maxTicks","maxDigits","includeBounds","maxSpaces","rmin","rmax","countDefined","minSpacing","niceMin","niceMax","numSpaces","decimalPlaces","relativeLabelSize","LinearScaleBase","setMin","setMax","minSign","maxSign","maxTicksLimit","stepSize","numericGeneratorOptions","LinearScale","log10Floor","changeExponent","isMajor","tickVal","steps","rangeExp","rangeStep","startExp","generateTicks","minExp","exp","significand","lastTick","LogarithmicScale","getTickBackdropHeight","measureLabelSize","determineLimits","fitWithPointLabels","limits","valueCount","pointLabelOpts","additionalAngle","pointPosition","plFont","hLimits","vLimits","updateLimits","buildPointLabelItems","extra","outerDistance","pointLabelPosition","yForAngle","getTextAlignForAngle","leftForTextAlign","drawPointLabels","pointLabels","backdropColor","backdropLeft","backdropTop","backdropWidth","backdropHeight","pathRadiusLine","circular","drawRadiusLine","gridLineOpts","createPointLabelContext","RadialLinearScale","leftMovement","rightMovement","topMovement","bottomMovement","angleMultiplier","scalingFactor","scaledDistance","pointLabel","distanceFromCenter","angleLines","INTERVALS","UNITS","sorter","parse","adapter","parser","isoWeekday","determineUnitForAutoTicks","minUnit","capacity","interval","determineUnitForFormatting","determineMajorUnit","addTick","time","timestamps","timestamp","setMajorTicks","majorUnit","major","ticksFromTimestamps","TimeScale","_applyBounds","timeOpts","minor","weekday","hasWeekday","formats","minorFormat","majorFormat","offsets","ticksOpts","tickLabelWidth","cosRotation","sinRotation","tickFontSize","exampleTime","exampleLabel","prevSource","nextSource","prevTarget","nextTarget","span","TimeSeriesScale","Decimation","Filler","SubTitle","CompSummaryChart","CompDashboard","partner","GENDashboard_Init","CompSettings","offeringSettings","GENSettings_Init","HookAppInit","HookAppReady","HookHandleAdditionalLanguageResult","anchor","currentUrl","currentPort","urlParams","orderNum","TogglePDFPopup","HandleRefresh","HandleDataRefresh","appActions","imagePopup","GENImagePopup","selectedPaket","orderOverview","orderDetailFormState","orderDetail","quotationOverview","quotationDetail","invoiceOverview","dpInvoiceDetail","invoiceDetail","DATInvoice","customerInfo","tblPackagingSplit","tblPackaging","AdminUploadColumns","tblAdminUpload","tblOfferingMaterial","tblOfferingTransport","tblOfferingCosts","tblOffering","tblOfferingSettingsDef","tblSymbolPC","tblSymbolPCEndUser","mandatorySchema","tblOfferingPos","chartData","pics","weekAndDate","b1Lookups","tblOfferingActual","GEN","SPC","PKG","DAT","QUT","app","startRender","SnackId","nrOfSnacks","RemoveSnack","div","SYSSnack","_RemoveSnack","StartRemoveSnack","_ClearSnack","parent2","parentFirstChild","_ReplaceSnackContent","ovlContentEl","_PlaceSnack","ovlSnackEl","snacks","snackToAdd","lastOccupiedSlot","lastFreeSlot","lastFreeSlotEl","firstFreeSlotEl","parentEl","snackType","busyIndicator","tpl","_AddSnack","_LongRunningProcessStart","LongRunningProcessStartHelper","isRefresh","allProcessesState","processMainState","snackReplacements","lockScreen","hasSnack","lockedFormState","lockedDialog","lockedDialogInstance","setOnRelatedProcessesHelper","lvl","tdk","executionHookFn","hookTableRowFnResultExecution","tableServerDataFn","summaryType","positionText","selectedKeysCount","fromAPI","isSingle","successKeys","warningKeys","errorKeys","feedbackCount","snackDuration","showDetails","summarySubType","summaryTranslationKey","snackText","replacements","alternativeTranslationCode","_LongRunningProcessEnd","allFormState","_DialogClose","dlgState","resolveValue","_DialogSetLock","_DialogOpen","DialogOpenHelper","_ModalDialogOpen","formsHandling","_OkCancelDialog","_OkDialog","navigation","internal","_ScreenSetLock","ovlActions","baseScreens","baseEditors","baseDialogs","baseForms","baseLongRunningProcess","ensureOptionsVal","SYSValidatorsFunctions","validateEmail","dVal","refDVal","email","separator","re","emailList","SYSTableSettingsColumnFilterDialog","filterTableDef","hasSelected","setFilterButton","clearFilterButton","exklCheck","SYSTableSettingsFilterSortDialog","tableId","SYSDialog","okButton","cancelButton","freeButton1","disabled","SYSBaseDialog","SYSDialogHolder","SYSControlBase","editorFormState","customRowCell","customRowClassName","customRowTooltip","customRowClassContainerName","outlineValidationHint","ignoreOutline","outlineClass","focusable","displayValue","nullClicker","isNullInput","valueAsObject","SYSCheckbox","SYSDate","pickerVal","dvals","onlyDateIsoString","readonly","browserDatePicker","browserDatePickerButton","browserDatePickerClass","fieldValue","SYSDateTime","SYSFormValidationHint","msgs","hookRes","_debounce","SYSListControl","writeBackValue","valueToWriteBack","explicit","filterRes","setWatched","toControlId","toControlType","movedOut","control","listData","SYSOption","inline","checked","SYSCustomValueHint","customValue","SYSControlLabel","customHeaderCell","customHeaderClassName","customHeaderTooltip","SYSValidationHint","hasAlways","isAlways","hideclass","SYSHitList","previousEl","dialogOpen","nextEl","rowNr","filteredKeys","lookupTypesKeys","thead","rawVal","filterHit","leftPart","rightPart","_val","_filterValue","lastNoEntriesMsg","SYSHitListDialog","SYSOkCancelDeleteFooter","accept","acceptClass","cancelClass","deleteBtnDisabled","dlg","dlgInstance","deleteButton","SYSTextArea","SYSTextbox","pattern","inputMode","SYSTime","SYSDialogContainer","dialogKeys","dialogAndInstance","SYSScreenContainer","SYSTableHeaderMenu","tableFnParam","addRow","select","selectedFunctions","ascendingDisabled","descendingDisabled","headerMenuFilter","columnFunctions","customColumnSelectedFunctions","sortingFunctions","customColumnFunctions","resultingColumnCaption","columncaption","rendererRes","filterSelectedRows","rowControlActionsTemplate","fnToValidKeys","rowControlActionsDistinct","atLeastOneMultiProcessRunning","customSelectedRowFunctions","customFn","fnMultipleName","sortCustomSorts","sortCustomKeys","ovlDisableClass","ovlHideClass","customFilter","filterCustomKeys","filterCustomMap","groupVal","filterCustomMapKeysArray","mm","ff","checkOrRadio","rowAttributesDef","rowAttributesDefKeys","getAttributeRowAttributesFn","getAttributePropertiesFn","attributesFilterState","attributeFnRes","attributeKeys","allAttributesWithCount","useAttributeCount","rowAttributesArray","getPropertiesRes","selectionFunctions","unselectAll","selectAll","description","filterRows","tableInfo","feedbackLevel","tableFunctions","filterSortSettings","customColumnFnsDef","onlySelected","rowFnDefId","customColumnFns","allRes","rowFnDef","rowFnAsTable","grp","colDefs","colActions","navcontrol","moreHint","SYSTableNavControl","page","oldNavType","navbuttonsclass","filterDefaultButton","filterClearTooltip","sortDefaultButton","sortClearTooltip","more","tablenav","rebuildInProcess","autoCloseButtonIfInDialog","SYSTableRow","fnFeedback","feedBackErrorCount","feedBackWarningCount","feedBackInformationCount","feedBackSuccessCount","feedbackLevelInt","btnid","customRowCellClasses","isFirstCol","rowFnFeedbackHint","customRowCellClass","tdclass","SYSTableRowControl","rowControlButtons","rowActions","rowActionsCount","button","buttonDisabled","SYSTableRowForm","colRenderState","isVisibleEdit","SYSTableRowFormBig","captionFunctionName","rowEditMode","captionContent","captionTranslated","tKey","SYSTableRowSaveCancel","acceptEnabled","acceptEnabledIcon","declineEnabled","declineEnabledIcon","formValid","SYSTableValidationSummaryRow","SYSTableRowEditFormDialog","tableRowEditState","copyRes","SYSHeaderMenuFilter","hasRangeFilter","rangeFilter","SYSHeaderMenuRangeFilter","filterTypeField","valueField","value2Field","value2","SYSHeaderMenuColumnFilter","foundRowKey","SYSHeaderMenuFilterSortSettings","chkTable","editButtons","hasForcedFilter","hasFilterSortChanges","editButton","addButton","settingsButton","undoButton","addEnabled","editEnabled","forCardCode","moreEnabled","SYSTableRowHeaderMenuDialog","defineElements","SYSTableSettings","interceptorAsyncFn","beforeFn","afterFn","originalFn","res3","interceptorFn","injectActions","chk","chk2","injectFn","fnname","isAsync","appScreens","appDialogs","appLongRunningProcess","appEditors","appValidators","sysComponentsActions","_state","_actions","defineSYSElements","registerElements","tblTableSettings_FilterSort","additionalColumnKey","allowExclusive","tableDefIdPerDialog","SYSTableSettingsState","tblAudit","tblTranslation","tblUserAdministration_Company","tblUserAdministration_Permission","resultingPermission","tblUserAdministration_ResultingPermission","tblUserAdministration_Role","tblUserAdministration_User","tblUserAdministration_UserRole","tblUserAdministration_UserRoleTransfer","tblSYSPortalSettings","translations","apiUrl","wsUrl","session","tableRowHeaderMenu","hitListDialogState","localHitListState","libState","longRunningProcessTracker","HookField_U_Timestamp_GetValueRender","SYSAudit","Login","pw","pwElement","userElement","ForgotPw","colTemplate","languageState","cols","HookTableCustom_Main_Sort","debouncedLanguageSet","debouncedLanguageSetTimer","SYSTranslation","roleTable","allAttributesSet","HookField_Grp_GetValueRender","HookField_U_RoleCode_GetList","allData","GetRoleDataLookup","allDataKeys","tableData","currentId","idField","hasSYSRoleAdmin","roleData","AssignUserRoleInfoValues","selectedRoleCode","permissionData","rolePermissions","preconfiguredPermissions","userPermission","HookField_PermissionDesc_GetValueRender","notRelevantFields","notRelevantGroups","permissionVal","permissionDescField","hasPermission","HookTableCustom_RoleMain_Sort","userTable","HookField_U_Val1_GetValueRender","HookField_U_Val2_GetValueRender","HookField_U_Text1_GetValueRender","HookField_U_Text2_GetValueRender","HookField_U_Text3_GetValueRender","HookField_U_Json1_GetValueRender","HookTableCustom_ValidUsers_Filter","selectedUserId","initial_rowAttributes","validFeaturesGrp","grpKey","SYSUserAdministration","pwFieldsTheSame","fieldToCompare","SaveSettings","pw1","SYSUserSettingsPassword","_ovl","bodyEl","persistedSessionObj","stateReadyFn","routeFn","queryString","readyFn"],"mappings":"k3BAKa,MAAAA,GACXC,GACG,CACHC,EAAI,WAAW,EAAE,IAAI,SAAS,qBAAqBD,CAAO,CAC5D,EAEaE,GAAW,CACtBC,EACAC,EAAkB,cAClBC,EAAqB,MAClB,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