@progressive-development/pd-spa-helper 0.1.156 → 0.1.158
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/PdSpaHelper.d.ts +3 -2
- package/dist/src/PdSpaHelper.js +3 -0
- package/dist/src/PdSpaHelper.js.map +1 -1
- package/dist/src/generated/locale-wrapper/de-wrapper.d.ts +4 -1
- package/dist/src/generated/locales/be.d.ts +4 -1
- package/dist/src/generated/locales/be.js +4 -1
- package/dist/src/generated/locales/be.js.map +1 -1
- package/dist/src/generated/locales/de.d.ts +4 -1
- package/dist/src/generated/locales/de.js +4 -1
- package/dist/src/generated/locales/de.js.map +1 -1
- package/dist/src/generated/locales/en.d.ts +4 -1
- package/dist/src/generated/locales/en.js +4 -1
- package/dist/src/generated/locales/en.js.map +1 -1
- package/dist/src/stories/pd-loading-state.stories.d.ts +1 -0
- package/dist/src/stories/pd-loading-state.stories.js +8 -0
- package/dist/src/stories/pd-loading-state.stories.js.map +1 -1
- package/dist/src/tmpown/pd-loading-state.d.ts +1 -0
- package/dist/src/tmpown/pd-loading-state.js +35 -3
- package/dist/src/tmpown/pd-loading-state.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/PdSpaHelper.ts +4 -0
- package/src/generated/locales/be.ts +2 -1
- package/src/generated/locales/de.ts +2 -1
- package/src/generated/locales/en.ts +2 -1
- package/src/stories/pd-loading-state.stories.ts +9 -0
- package/src/tmpown/pd-loading-state.ts +36 -3
- package/xliff/be.xlf +10 -1
- package/xliff/de.xlf +8 -1
- package/xliff/en.xlf +8 -1
|
@@ -32,6 +32,7 @@ export declare abstract class PdSpaHelper extends PdSpaHelper_base {
|
|
|
32
32
|
_profile: any | undefined;
|
|
33
33
|
_loadingState?: {
|
|
34
34
|
isLoading: boolean;
|
|
35
|
+
smallBackground?: boolean;
|
|
35
36
|
modal?: boolean;
|
|
36
37
|
loadingTxt?: string;
|
|
37
38
|
};
|
|
@@ -70,8 +71,8 @@ export declare abstract class PdSpaHelper extends PdSpaHelper_base {
|
|
|
70
71
|
activateLoginHandler(): void;
|
|
71
72
|
render(): TemplateResult<1>;
|
|
72
73
|
private _getMainClass;
|
|
73
|
-
_renderMenu(pageConfig: NavigationPage, hideTeaser: boolean):
|
|
74
|
-
_renderTopMenu(pageConfig: NavigationPage, hideTeaser: boolean):
|
|
74
|
+
_renderMenu(pageConfig: NavigationPage, hideTeaser: boolean): TemplateResult<1> | "";
|
|
75
|
+
_renderTopMenu(pageConfig: NavigationPage, hideTeaser: boolean): TemplateResult<1> | "";
|
|
75
76
|
_renderTeaser(): TemplateResult | string;
|
|
76
77
|
_renderFooter(): TemplateResult<1>;
|
|
77
78
|
/**
|
package/dist/src/PdSpaHelper.js
CHANGED
|
@@ -171,6 +171,9 @@ export class PdSpaHelper extends router(navigator(LitElement)) {
|
|
|
171
171
|
const callback = (user) => {
|
|
172
172
|
console.log("My callback user:", user);
|
|
173
173
|
this._user = user;
|
|
174
|
+
if (this._user) {
|
|
175
|
+
this._loginSuccess(new CustomEvent("login-success"));
|
|
176
|
+
}
|
|
174
177
|
};
|
|
175
178
|
authStateChangedImpl(callback);
|
|
176
179
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdSpaHelper.js","sourceRoot":"","sources":["../../src/PdSpaHelper.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAkC,SAAS,EAAE,MAAM,KAAK,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,6CAA6C,CAAC;AACrD,OAAO,+CAA+C,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D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AI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;gBAC/C,IAAI,EAAE,CAAC;gBACP,QAAQ,EAAE,QAAQ;aACnB,CAAC,CAAC;SACJ;IACH,CAAC;;AA9YM,kBAAM;AACX,sEAAsE;AACtE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAiDmB,SAAS,CAAC,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;GAyB/B,CAAC;AAzHpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACP;AAMpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;0CACb;AAG3B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;6CACd;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;kDAKtC;AAMF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAC/B;AAGX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACf;AAGZ;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAChB;AAMX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDACN;AAItB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;oDACP","sourcesContent":["import { html, LitElement, css, CSSResultGroup, TemplateResult, unsafeCSS } from 'lit';\nimport { router, navigator } from 'lit-element-router';\nimport { property } from 'lit/decorators.js';\n\nimport '@progressive-development/pd-page/pd-menu.js';\nimport '@progressive-development/pd-page/pd-footer.js';\n\nimport { ServiceCallController } from './service-call-controller2.js';\nimport { initializeStore } from './store/mini-rx.store.js';\n\nimport { authStateChangedImpl, initAppImpl, isAuthenticatedImpl, setServiceProvider } from './service-provider/service-provider-impl.js';\nimport { AppConfiguration, Footer, FunctionResult, MenuElement, NavigationConfig, NavigationPage } from './service-provider/service-provider-model.js';\n\nimport './router/AppMain.js';\nimport './defaultpage/default-login.js';\nimport './tmpown/pd-panel-viewer.js';\nimport './tmpown/pd-panel.js';\n// eslint-disable-next-line import/no-duplicates\nimport './tmpown/pd-toast.js';\nimport './tmpown/pd-loading-state.js';\n\n// TODO: How to solve this import problem?\n// eslint-disable-next-line import/no-duplicates\nimport { PdToast } from './tmpown/pd-toast.js';\n\n\n// Footer Text\nconst MADE_BY = {\n txt: \"made by PD Progressive Development\",\n email: \"info@progressive-development.com\"};\n\n// Visible time for time-limited toast\nconst TOAST_DURATION = 6000;\n\n\n/**\n * Transformed routes, generated during startInit.\n */\nlet transformedRoutes:Array<any>;\nlet navigationConfig:NavigationConfig;\n\n/**\n * Internal helper functions to generate route elemets for lit-router. \n */\nconst transformRoutes = () => {\n\n const transformAuthConfig = (withAuth:boolean) => \n withAuth ? \n {\n unauthenticated: {\n name: 'login',\n },\n authenticate: () => isAuthenticatedImpl(),\n } : undefined;\n\n let generatedRoutes:Array<any> = [];\n navigationConfig.pages.forEach(cfEntry => {\n const addAraay = cfEntry.pattern.map(routeMapPattern => (\n {\n name: cfEntry.name,\n pattern: routeMapPattern,\n authentication: transformAuthConfig(cfEntry.auth),\n }\n )); \n generatedRoutes = generatedRoutes.concat(addAraay);\n });\n \n // add not-found route\n generatedRoutes.push({\n name: 'not-found',\n pattern: '*',\n });\n\n return generatedRoutes;\n}\n\n\n/**\n * Init the firebase app and application services like\n * functions and firestore. Generate routes from navigationConfig.\n * \n * @param navigationConfig\n * @param firebaseConfig\n * @param functionsConfig\n */\nexport const startInit = (config: AppConfiguration) => {\n\n // set service provider\n setServiceProvider(config.serviceProvider);\n \n // init mini-rx store\n if (config.storeConfigParam) {\n initializeStore(config.storeConfigParam);\n }\n\n // init app\n initAppImpl(config);\n\n if (config.navigationConfigParam.includeLogin) {\n config.navigationConfigParam.pages.push({\n name: \"login\",\n menu: [\n {key: \"login\", name: \"Login\"}\n ],\n pattern: [\"login\"],\n auth: false\n });\n\n // init ready, trigger by even (if getAuth is called before, error is thrown) \n document.dispatchEvent(new CustomEvent(\"init-app-event\"));\n console.log(\"Init done, Event created\");\n }\n\n // generate routes from navigation config\n navigationConfig = config.navigationConfigParam;\n transformedRoutes = transformRoutes(); \n};\n\nconst TOP_MENU_HEIGHT = 50;\n\n/**\n * Abstract class for SPAs. Extend within the app main class.\n */\nexport abstract class PdSpaHelper extends router(navigator(LitElement)) {\n\n protected functionsController = new ServiceCallController(this);\n\n // not used at the moment\n @property({ type: String }) \n title = 'Hey there';\n\n /**\n * Properties needed for login/profile data.\n */\n @property({ type: Object, state: true }) \n _user: unknown | undefined;\n\n @property({ type: Object, state: true }) \n _profile: any | undefined;\n\n @property({ type: Object, state: true }) \n _loadingState?: {\n isLoading: boolean,\n modal?: boolean,\n loadingTxt?: string\n };\n \n /**\n * Properties needed for the router.\n */\n @property({ type: String, reflect: true }) \n route = \"\";\n\n @property({ type: Object }) \n params = {};\n\n @property({ type: Object }) \n query = {};\n\n /**\n * Indicates if the teaser should closed (depends on scroll position).\n */\n @property({ type: Boolean })\n _teaserClosed = false; \n\n\n @property({ type: String, state: true })\n abstract _selectedLocale: string;\n\n abstract _availableLocales: string[];\n\n protected _singleLocaleMenu: boolean = false;\n \n\n static styles = \n // Ref: Additional use classmap to add custom classes in concrete impl\n css`\n\n :host {\n display: flex;\n flex-flow: column;\n height: 100%;\n }\n\n header {\n flex-grow: 0;\n }\n\n main {\n flex-grow: 1;\n flex-basis: max-content;\n }\n\n footer {\n flex-grow: 0;\n }\n\n .default-header {\n width: 100%;\n position: fixed;\n top: 0;\n display: block;\n z-index: 99;\n }\n\n .default-teaser {\n --pd-panel-overflow: hidden;\n --pd-panel-height: var(--pd-teaser-height, 380px);\n --pd-panel-width: 100%; \n --pd-panel-border-radius: 0;\n --pd-panel-bg: var(--pd-default-col);\n --pd-panel-viewer-bg-col: var(--pd-default-col);\n }\n\n .default-menu { \n transition: background-color 2s;\n }\n\n .default-menu-withteaser { \n --pd-menu-bg-col: var(--pd-spa-menu-change-col, #AFC1D2);\n --pd-menu-font-col: var(--pd-spa-menu-change-font-col, #0A3A48);\n transition: background-color 2s;\n }\n\n .default-top-menu, .default-top-menu-withteaser { \n --pd-menu-height: ${unsafeCSS(TOP_MENU_HEIGHT)}px;\n --pd-menu-font-size: 0.8em; \n --pd-menu-shadow: 0;\n }\n\n .default-top-menu-withteaser { \n --pd-menu-bg-col: var(--pd-teaser-bg-col);\n }\n\n /* needed for pd-spa-padding-top, only for pages with teaser, check if refactor possible... */\n .default-main-padding {\n padding-top: calc(var(--pd-menu-height) + var(--pd-spa-padding-top, 120px)) ;\n transition: padding-top 2s;\n }\n\n .default-main {\n padding-top: calc(var(--pd-menu-height));\n transition: padding-top 2s;\n } \n\n .default-main-withteaser {\n padding-top: calc(var(--pd-menu-height) + var(--pd-teaser-height, 380px));\n transition: padding-top 2s;\n }\n\n ` as CSSResultGroup; \n\n constructor() {\n\n super(); \n\n const doSomething = (scrollPos:number) => {\n if (scrollPos <= 50) {\n this._teaserClosed = false;\n } else {\n this._teaserClosed = true;\n }\n };\n\n let ticking = false;\n document.addEventListener('scroll', () => {\n const lastKnownScrollPosition = window.scrollY;\n if (!ticking) {\n window.requestAnimationFrame(() => {\n doSomething(lastKnownScrollPosition);\n ticking = false;\n });\n ticking = true;\n }\n });\n\n // add login handler after init => else error is thrown\n // document.addEventListener(\"init-app-event\", this.activateLoginHandler.bind(this));\n document.addEventListener(\"init-app-event\", () => {\n console.log(\"Init event catched\");\n });\n if (navigationConfig.includeLogin) {\n this.activateLoginHandler();\n }\n\n // For common toast messages (not for callfunction toasts => handelt by own controller)\n this.addEventListener(\"toast-event\", this._createTemporaryToast);\n this.addEventListener(\"route-event\", this._handleMenuRouteEvent); \n }\n\n /**\n * Non reactive private property for the index db class.\n */\n // private _indexDBClient?: YoIndexDBClient|null; \n\n /**\n * Needed for the router.\n * Return all configured routes.\n */\n static get routes() {\n return transformedRoutes; \n }\n\n /**\n * Needed for the router.\n * Set route params to internal members.\n */\n router(route:string, params:Object, query:Object) {\n this.route = route;\n this.params = params;\n this.query = query;\n } \n\n\n /**\n * Call to activate onAuthState change with profile request callbacks.\n * Only implemented for firebase provider.\n */\n activateLoginHandler() {\n console.log(\"Activate Login Handler\"); \n const callback = (user: unknown) => {\n console.log(\"My callback user:\", user);\n this._user = user;\n };\n authStateChangedImpl(callback);\n }\n\n render() { \n const pageConf = navigationConfig.pages.filter(p => p.name === this.route)[0];\n const hideTeaser = this._teaserClosed || !pageConf?.withTeaser;\n return html`\n <header id=\"headerElementId\" class=\"default-header\">\n ${pageConf?.hideTopMenu ? '' : this._renderTopMenu(pageConf, hideTeaser)}\n ${hideTeaser ? '' : this._renderTeaser()}\n ${pageConf?.hideMenu ? '' : this._renderMenu(pageConf, hideTeaser)}\n </header> \n\n <main class=\"${this._getMainClass(hideTeaser, pageConf)}\">\n\n ${this._loadingState ? html`<pd-loading-state .loadingState=\"${this._loadingState}\"></pd-loading-state>` : ''}\n\n <app-main active-route=${this.route}\n @init-menu-sections=\"${this._initMenuSections}\"\n @login-success=\"${this._loginSuccess}\">\n ${this._renderRoutePages()}\n ${navigationConfig.includeLogin ? html`\n <default-login ?active=\"${this.route === \"login\"}\" route=\"login\"></default-login>` : ''}\n </app-main>\n </main>\n\n ${this.functionsController.render({\n complete: (result: FunctionResult) => this._renderSuccessResultInfo(result),\n initial: () => '',\n pending: () => this._renderPendingInfo(),\n error: (e: any) => this._renderErrorInfo(e),\n })}\n\n ${pageConf?.withFooter ? html`\n <footer class=\"default-footer\">\n ${this._renderFooter()}\n </footer>` : ''}\n `;\n } \n\n // eslint-disable-next-line class-methods-use-this\n private _getMainClass(hideTeaser: boolean, pageConf: NavigationPage): string {\n if (hideTeaser) { \n if (!pageConf) {\n return \"default-main\";\n }\n // eslint-disable-next-line no-nested-ternary\n return pageConf.mainClass ? pageConf.mainClass : (pageConf.withTeaser ? \"default-main-padding\" : \"default-main\");\n }\n return \"default-main-withteaser\";\n }\n\n _renderMenu(pageConfig:NavigationPage, hideTeaser:boolean) {\n const menuForPage = pageConfig ? (pageConfig.menu || []) : [];\n return menuForPage ? html`\n <pd-menu\n id=\"pdHelperMenuId\"\n class=\"${hideTeaser ? \"default-menu\" : \"default-menu-withteaser\"}\"\n @locale-change=\"${this._localeChange}\"\n selectedLocale=\"${this._selectedLocale}\"\n .locales=${this._singleLocaleMenu ? this._availableLocales : []}\n .menuItems=${menuForPage}\n .topMenuItems=${[]}\n activeRoute=\"${this.route}\"\n headerSize=\"${this._getHeaderSize(hideTeaser) + TOP_MENU_HEIGHT}\"\n >\n ${hideTeaser ? this._getAppLogo() : ''}\n </pd-menu>\n ` : '';\n } \n\n _renderTopMenu(pageConfig:NavigationPage, hideTeaser:boolean) {\n const topMenuForPage = pageConfig ? pageConfig.topMenuItems : undefined;\n return topMenuForPage ? html`\n <pd-menu \n id=\"pdHelperTopMenuId\"\n noBurgerMenu\n @locale-change=\"${this._localeChange}\"\n class=\"${hideTeaser ? \"default-top-menu\" : \"default-top-menu-withteaser\"}\" \n .locales=${this._availableLocales}\n selectedLocale=\"${this._selectedLocale}\"\n .topMenuItems=${topMenuForPage}\n activeRoute=\"${this.route}\"\n >\n </pd-menu>\n ` : '';\n }\n\n // eslint-disable-next-line class-methods-use-this\n _renderTeaser(): TemplateResult | string {\n const teaserContent = this._getTeaserContent();\n if (!teaserContent || teaserContent.length <= 0) {\n return '';\n }\n return html`\n <pd-panel-viewer class=\"default-teaser\" id=\"teaserPanelViewerId\" deltaCalc=\"4\">\n ${teaserContent.map(content => html`\n <pd-panel>\n ${content}\n </pd-panel>\n `)}\n </pd-panel-viewer>\n `;\n }\n\n _renderFooter() {\n const footer = this._getFooter();\n return html`\n <pd-footer \n class=\"default-footer\"\n .footerLinks=\"${footer.links}\"\n version=\"${footer.version}\" \n copyright=\"PD Progressive Developent UG\" \n .madeBy=\"${MADE_BY}\" \n @footer-link=\"${this._handleFooterRouteEvent}\">\n </pd-footer>\n `;\n }\n\n /**\n * Called when (any) cloud function call was finished. \n */\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n _renderSuccessResultInfo(result: FunctionResult) {\n return html`\n <pd-toast isSuccess duration=\"${TOAST_DURATION}\">\n ${this.functionsController.callDataPromise?.func.successTxt}\n </pd-toast>`;\n }\n\n /**\n * Called when (any) cloud function is currently running. \n */\n _renderPendingInfo() {\n return this.functionsController.callDataPromise?.func.fadeWindow ? html`\n <p>Überblende und lade ${this.functionsController.callDataPromise?.func.name}...</p>` \n : html`\n <pd-toast duration=\"-1\">\n ${this.functionsController.callDataPromise?.func.pendingTxt}\n </pd-toast>`; \n }\n\n /**\n * Called when (any) cloud function stopped with errors.\n */\n // eslint-disable-next-line class-methods-use-this\n _renderErrorInfo(error:any) {\n return html`\n <pd-toast isError duration=\"-1\">\n ${error}\n </pd-toast>`;\n }\n\n protected abstract _getTeaserContent(): Array<TemplateResult>;\n\n protected abstract _getFooter(): Footer;\n\n protected abstract _getAppLogo(): TemplateResult;\n\n protected abstract _renderRoutePages(): any; \n\n protected abstract _loginSuccess(e: CustomEvent): void;\n\n protected abstract _setLocale(locale:string): void;\n\n protected abstract _getHeaderSize(hideTeaser: boolean): number;\n\n _localeChange(e: CustomEvent): void {\n this._setLocale(e.detail)\n this._selectedLocale = e.detail; \n } \n \n // eslint-disable-next-line class-methods-use-this\n _handleMenuRouteEvent(e:any) {\n // test with el, to handel jumps also here, not used at the moment, same postion link problems...\n if (e.detail.el) {\n this._scrollToContent(e.detail.el);\n } else {\n PdSpaHelper._scrollToTop();\n this.navigate(e.detail.route);\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n _handleFooterRouteEvent(e: CustomEvent) { \n const {linkObj} = e.detail; \n if (linkObj.link) {\n PdSpaHelper._scrollToTop();\n this.navigate(linkObj.link); \n }\n if (linkObj.action ) { \n linkObj.action();\n }\n }\n \n // eslint-disable-next-line class-methods-use-this\n _initMenuSections(e:any) {\n // add link to configuration object\n const menRefConf = navigationConfig.pages.filter(p => p.name === e.detail.name)[0];\n if (menRefConf) { \n menRefConf.menu = menRefConf.menu?.map((menuElement:MenuElement, index:number) => ({\n ...menuElement,\n ref: e.detail.menuRefs[index]\n }));\n }\n }\n\n _createTemporaryToast(e: any) {\n \n // hide existing call function toast (old one still is visible for directly incoming errors)\n this.functionsController.clear();\n \n const tmpToast = new PdToast(); \n tmpToast.isError = e.detail.isError;\n tmpToast.isSuccess = e.detail.isSuccess;\n const slotContent = document.createTextNode(e.detail.txt);\n tmpToast.appendChild(slotContent) \n\n this.shadowRoot?.appendChild(tmpToast);\n tmpToast.duration = TOAST_DURATION;\n\n // set timeout to remove toast (one second later)\n setTimeout(() => {\n this.shadowRoot?.removeChild(tmpToast);\n }, TOAST_DURATION + 1000);\n }\n\n static _scrollToTop() {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth',\n });\n }\n\n // Test, not used at the moment, jump/menu problem...\n // eslint-disable-next-line class-methods-use-this\n _scrollToContent(el:HTMLElement) {\n if (el) {\n const rect = el.getBoundingClientRect();\n console.log(\"Rect: \", rect);\n console.log(\"Offset Top/Height: \", el.offsetTop, el.offsetHeight);\n window.scrollBy({\n top: rect.top - (this._teaserClosed ? 80 : 450),\n left: 0,\n behavior: 'smooth',\n });\n }\n }\n\n}"]}
|
|
1
|
+
{"version":3,"file":"PdSpaHelper.js","sourceRoot":"","sources":["../../src/PdSpaHelper.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAkC,SAAS,EAAE,MAAM,KAAK,CAAC;AACvF,OAAO,EAAE,MAAM,EA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;2CACf;AAGZ;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAChB;AAMX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDACN;AAItB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;oDACP","sourcesContent":["import { html, LitElement, css, CSSResultGroup, TemplateResult, unsafeCSS } from 'lit';\nimport { router, navigator } from 'lit-element-router';\nimport { property } from 'lit/decorators.js';\n\nimport '@progressive-development/pd-page/pd-menu.js';\nimport '@progressive-development/pd-page/pd-footer.js';\n\nimport { ServiceCallController } from './service-call-controller2.js';\nimport { initializeStore } from './store/mini-rx.store.js';\n\nimport { authStateChangedImpl, initAppImpl, isAuthenticatedImpl, setServiceProvider } from './service-provider/service-provider-impl.js';\nimport { AppConfiguration, Footer, FunctionResult, MenuElement, NavigationConfig, NavigationPage } from './service-provider/service-provider-model.js';\n\nimport './router/AppMain.js';\nimport './defaultpage/default-login.js';\nimport './tmpown/pd-panel-viewer.js';\nimport './tmpown/pd-panel.js';\n// eslint-disable-next-line import/no-duplicates\nimport './tmpown/pd-toast.js';\nimport './tmpown/pd-loading-state.js';\n\n// TODO: How to solve this import problem?\n// eslint-disable-next-line import/no-duplicates\nimport { PdToast } from './tmpown/pd-toast.js';\n\n\n// Footer Text\nconst MADE_BY = {\n txt: \"made by PD Progressive Development\",\n email: \"info@progressive-development.com\"};\n\n// Visible time for time-limited toast\nconst TOAST_DURATION = 6000;\n\n\n/**\n * Transformed routes, generated during startInit.\n */\nlet transformedRoutes:Array<any>;\nlet navigationConfig:NavigationConfig;\n\n/**\n * Internal helper functions to generate route elemets for lit-router. \n */\nconst transformRoutes = () => {\n\n const transformAuthConfig = (withAuth:boolean) => \n withAuth ? \n {\n unauthenticated: {\n name: 'login',\n },\n authenticate: () => isAuthenticatedImpl(),\n } : undefined;\n\n let generatedRoutes:Array<any> = [];\n navigationConfig.pages.forEach(cfEntry => {\n const addAraay = cfEntry.pattern.map(routeMapPattern => (\n {\n name: cfEntry.name,\n pattern: routeMapPattern,\n authentication: transformAuthConfig(cfEntry.auth),\n }\n )); \n generatedRoutes = generatedRoutes.concat(addAraay);\n });\n \n // add not-found route\n generatedRoutes.push({\n name: 'not-found',\n pattern: '*',\n });\n\n return generatedRoutes;\n}\n\n\n/**\n * Init the firebase app and application services like\n * functions and firestore. Generate routes from navigationConfig.\n * \n * @param navigationConfig\n * @param firebaseConfig\n * @param functionsConfig\n */\nexport const startInit = (config: AppConfiguration) => {\n\n // set service provider\n setServiceProvider(config.serviceProvider);\n \n // init mini-rx store\n if (config.storeConfigParam) {\n initializeStore(config.storeConfigParam);\n }\n\n // init app\n initAppImpl(config);\n\n if (config.navigationConfigParam.includeLogin) {\n config.navigationConfigParam.pages.push({\n name: \"login\",\n menu: [\n {key: \"login\", name: \"Login\"}\n ],\n pattern: [\"login\"],\n auth: false\n });\n\n // init ready, trigger by even (if getAuth is called before, error is thrown) \n document.dispatchEvent(new CustomEvent(\"init-app-event\"));\n console.log(\"Init done, Event created\");\n }\n\n // generate routes from navigation config\n navigationConfig = config.navigationConfigParam;\n transformedRoutes = transformRoutes(); \n};\n\nconst TOP_MENU_HEIGHT = 50;\n\n/**\n * Abstract class for SPAs. Extend within the app main class.\n */\nexport abstract class PdSpaHelper extends router(navigator(LitElement)) {\n\n protected functionsController = new ServiceCallController(this);\n\n // not used at the moment\n @property({ type: String }) \n title = 'Hey there';\n\n /**\n * Properties needed for login/profile data.\n */\n @property({ type: Object, state: true }) \n _user: unknown | undefined;\n\n @property({ type: Object, state: true }) \n _profile: any | undefined;\n\n @property({ type: Object, state: true }) \n _loadingState?: {\n isLoading: boolean,\n smallBackground?: boolean,\n modal?: boolean,\n loadingTxt?: string\n };\n \n /**\n * Properties needed for the router.\n */\n @property({ type: String, reflect: true }) \n route = \"\";\n\n @property({ type: Object }) \n params = {};\n\n @property({ type: Object }) \n query = {};\n\n /**\n * Indicates if the teaser should closed (depends on scroll position).\n */\n @property({ type: Boolean })\n _teaserClosed = false; \n\n\n @property({ type: String, state: true })\n abstract _selectedLocale: string;\n\n abstract _availableLocales: string[];\n\n protected _singleLocaleMenu: boolean = false;\n \n\n static styles = \n // Ref: Additional use classmap to add custom classes in concrete impl\n css`\n\n :host {\n display: flex;\n flex-flow: column;\n height: 100%;\n }\n\n header {\n flex-grow: 0;\n }\n\n main {\n flex-grow: 1;\n flex-basis: max-content;\n }\n\n footer {\n flex-grow: 0;\n }\n\n .default-header {\n width: 100%;\n position: fixed;\n top: 0;\n display: block;\n z-index: 99;\n }\n\n .default-teaser {\n --pd-panel-overflow: hidden;\n --pd-panel-height: var(--pd-teaser-height, 380px);\n --pd-panel-width: 100%; \n --pd-panel-border-radius: 0;\n --pd-panel-bg: var(--pd-default-col);\n --pd-panel-viewer-bg-col: var(--pd-default-col);\n }\n\n .default-menu { \n transition: background-color 2s;\n }\n\n .default-menu-withteaser { \n --pd-menu-bg-col: var(--pd-spa-menu-change-col, #AFC1D2);\n --pd-menu-font-col: var(--pd-spa-menu-change-font-col, #0A3A48);\n transition: background-color 2s;\n }\n\n .default-top-menu, .default-top-menu-withteaser { \n --pd-menu-height: ${unsafeCSS(TOP_MENU_HEIGHT)}px;\n --pd-menu-font-size: 0.8em; \n --pd-menu-shadow: 0;\n }\n\n .default-top-menu-withteaser { \n --pd-menu-bg-col: var(--pd-teaser-bg-col);\n }\n\n /* needed for pd-spa-padding-top, only for pages with teaser, check if refactor possible... */\n .default-main-padding {\n padding-top: calc(var(--pd-menu-height) + var(--pd-spa-padding-top, 120px)) ;\n transition: padding-top 2s;\n }\n\n .default-main {\n padding-top: calc(var(--pd-menu-height));\n transition: padding-top 2s;\n } \n\n .default-main-withteaser {\n padding-top: calc(var(--pd-menu-height) + var(--pd-teaser-height, 380px));\n transition: padding-top 2s;\n }\n\n ` as CSSResultGroup; \n\n constructor() {\n\n super(); \n\n const doSomething = (scrollPos:number) => {\n if (scrollPos <= 50) {\n this._teaserClosed = false;\n } else {\n this._teaserClosed = true;\n }\n };\n\n let ticking = false;\n document.addEventListener('scroll', () => {\n const lastKnownScrollPosition = window.scrollY;\n if (!ticking) {\n window.requestAnimationFrame(() => {\n doSomething(lastKnownScrollPosition);\n ticking = false;\n });\n ticking = true;\n }\n });\n\n // add login handler after init => else error is thrown\n // document.addEventListener(\"init-app-event\", this.activateLoginHandler.bind(this));\n document.addEventListener(\"init-app-event\", () => {\n console.log(\"Init event catched\");\n });\n if (navigationConfig.includeLogin) {\n this.activateLoginHandler();\n }\n\n // For common toast messages (not for callfunction toasts => handelt by own controller)\n this.addEventListener(\"toast-event\", this._createTemporaryToast);\n this.addEventListener(\"route-event\", this._handleMenuRouteEvent); \n }\n\n /**\n * Non reactive private property for the index db class.\n */\n // private _indexDBClient?: YoIndexDBClient|null; \n\n /**\n * Needed for the router.\n * Return all configured routes.\n */\n static get routes() {\n return transformedRoutes; \n }\n\n /**\n * Needed for the router.\n * Set route params to internal members.\n */\n router(route:string, params:Object, query:Object) {\n this.route = route;\n this.params = params;\n this.query = query;\n } \n\n\n /**\n * Call to activate onAuthState change with profile request callbacks.\n * Only implemented for firebase provider.\n */\n activateLoginHandler() {\n console.log(\"Activate Login Handler\"); \n const callback = (user: unknown) => {\n console.log(\"My callback user:\", user);\n this._user = user;\n if (this._user) {\n this._loginSuccess(new CustomEvent(\"login-success\"));\n }\n };\n authStateChangedImpl(callback);\n }\n\n render() { \n const pageConf = navigationConfig.pages.filter(p => p.name === this.route)[0];\n const hideTeaser = this._teaserClosed || !pageConf?.withTeaser;\n return html`\n <header id=\"headerElementId\" class=\"default-header\">\n ${pageConf?.hideTopMenu ? '' : this._renderTopMenu(pageConf, hideTeaser)}\n ${hideTeaser ? '' : this._renderTeaser()}\n ${pageConf?.hideMenu ? '' : this._renderMenu(pageConf, hideTeaser)}\n </header> \n\n <main class=\"${this._getMainClass(hideTeaser, pageConf)}\">\n\n ${this._loadingState ? html`<pd-loading-state .loadingState=\"${this._loadingState}\"></pd-loading-state>` : ''}\n\n <app-main active-route=${this.route}\n @init-menu-sections=\"${this._initMenuSections}\"\n @login-success=\"${this._loginSuccess}\">\n ${this._renderRoutePages()}\n ${navigationConfig.includeLogin ? html`\n <default-login ?active=\"${this.route === \"login\"}\" route=\"login\"></default-login>` : ''}\n </app-main>\n </main>\n\n ${this.functionsController.render({\n complete: (result: FunctionResult) => this._renderSuccessResultInfo(result),\n initial: () => '',\n pending: () => this._renderPendingInfo(),\n error: (e: any) => this._renderErrorInfo(e),\n })}\n\n ${pageConf?.withFooter ? html`\n <footer class=\"default-footer\">\n ${this._renderFooter()}\n </footer>` : ''}\n `;\n } \n\n // eslint-disable-next-line class-methods-use-this\n private _getMainClass(hideTeaser: boolean, pageConf: NavigationPage): string {\n if (hideTeaser) { \n if (!pageConf) {\n return \"default-main\";\n }\n // eslint-disable-next-line no-nested-ternary\n return pageConf.mainClass ? pageConf.mainClass : (pageConf.withTeaser ? \"default-main-padding\" : \"default-main\");\n }\n return \"default-main-withteaser\";\n }\n\n _renderMenu(pageConfig:NavigationPage, hideTeaser:boolean) {\n const menuForPage = pageConfig ? (pageConfig.menu || []) : [];\n return menuForPage ? html`\n <pd-menu\n id=\"pdHelperMenuId\"\n class=\"${hideTeaser ? \"default-menu\" : \"default-menu-withteaser\"}\"\n @locale-change=\"${this._localeChange}\"\n selectedLocale=\"${this._selectedLocale}\"\n .locales=${this._singleLocaleMenu ? this._availableLocales : []}\n .menuItems=${menuForPage}\n .topMenuItems=${[]}\n activeRoute=\"${this.route}\"\n headerSize=\"${this._getHeaderSize(hideTeaser) + TOP_MENU_HEIGHT}\"\n >\n ${hideTeaser ? this._getAppLogo() : ''}\n </pd-menu>\n ` : '';\n } \n\n _renderTopMenu(pageConfig:NavigationPage, hideTeaser:boolean) {\n const topMenuForPage = pageConfig ? pageConfig.topMenuItems : undefined;\n return topMenuForPage ? html`\n <pd-menu \n id=\"pdHelperTopMenuId\"\n noBurgerMenu\n @locale-change=\"${this._localeChange}\"\n class=\"${hideTeaser ? \"default-top-menu\" : \"default-top-menu-withteaser\"}\" \n .locales=${this._availableLocales}\n selectedLocale=\"${this._selectedLocale}\"\n .topMenuItems=${topMenuForPage}\n activeRoute=\"${this.route}\"\n >\n </pd-menu>\n ` : '';\n }\n\n // eslint-disable-next-line class-methods-use-this\n _renderTeaser(): TemplateResult | string {\n const teaserContent = this._getTeaserContent();\n if (!teaserContent || teaserContent.length <= 0) {\n return '';\n }\n return html`\n <pd-panel-viewer class=\"default-teaser\" id=\"teaserPanelViewerId\" deltaCalc=\"4\">\n ${teaserContent.map(content => html`\n <pd-panel>\n ${content}\n </pd-panel>\n `)}\n </pd-panel-viewer>\n `;\n }\n\n _renderFooter() {\n const footer = this._getFooter();\n return html`\n <pd-footer \n class=\"default-footer\"\n .footerLinks=\"${footer.links}\"\n version=\"${footer.version}\" \n copyright=\"PD Progressive Developent UG\" \n .madeBy=\"${MADE_BY}\" \n @footer-link=\"${this._handleFooterRouteEvent}\">\n </pd-footer>\n `;\n }\n\n /**\n * Called when (any) cloud function call was finished. \n */\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n _renderSuccessResultInfo(result: FunctionResult) {\n return html`\n <pd-toast isSuccess duration=\"${TOAST_DURATION}\">\n ${this.functionsController.callDataPromise?.func.successTxt}\n </pd-toast>`;\n }\n\n /**\n * Called when (any) cloud function is currently running. \n */\n _renderPendingInfo() {\n return this.functionsController.callDataPromise?.func.fadeWindow ? html`\n <p>Überblende und lade ${this.functionsController.callDataPromise?.func.name}...</p>` \n : html`\n <pd-toast duration=\"-1\">\n ${this.functionsController.callDataPromise?.func.pendingTxt}\n </pd-toast>`; \n }\n\n /**\n * Called when (any) cloud function stopped with errors.\n */\n // eslint-disable-next-line class-methods-use-this\n _renderErrorInfo(error:any) {\n return html`\n <pd-toast isError duration=\"-1\">\n ${error}\n </pd-toast>`;\n }\n\n protected abstract _getTeaserContent(): Array<TemplateResult>;\n\n protected abstract _getFooter(): Footer;\n\n protected abstract _getAppLogo(): TemplateResult;\n\n protected abstract _renderRoutePages(): any; \n\n protected abstract _loginSuccess(e: CustomEvent): void;\n\n protected abstract _setLocale(locale:string): void;\n\n protected abstract _getHeaderSize(hideTeaser: boolean): number;\n\n _localeChange(e: CustomEvent): void {\n this._setLocale(e.detail)\n this._selectedLocale = e.detail; \n } \n \n // eslint-disable-next-line class-methods-use-this\n _handleMenuRouteEvent(e:any) {\n // test with el, to handel jumps also here, not used at the moment, same postion link problems...\n if (e.detail.el) {\n this._scrollToContent(e.detail.el);\n } else {\n PdSpaHelper._scrollToTop();\n this.navigate(e.detail.route);\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n _handleFooterRouteEvent(e: CustomEvent) { \n const {linkObj} = e.detail; \n if (linkObj.link) {\n PdSpaHelper._scrollToTop();\n this.navigate(linkObj.link); \n }\n if (linkObj.action ) { \n linkObj.action();\n }\n }\n \n // eslint-disable-next-line class-methods-use-this\n _initMenuSections(e:any) {\n // add link to configuration object\n const menRefConf = navigationConfig.pages.filter(p => p.name === e.detail.name)[0];\n if (menRefConf) { \n menRefConf.menu = menRefConf.menu?.map((menuElement:MenuElement, index:number) => ({\n ...menuElement,\n ref: e.detail.menuRefs[index]\n }));\n }\n }\n\n _createTemporaryToast(e: any) {\n \n // hide existing call function toast (old one still is visible for directly incoming errors)\n this.functionsController.clear();\n \n const tmpToast = new PdToast(); \n tmpToast.isError = e.detail.isError;\n tmpToast.isSuccess = e.detail.isSuccess;\n const slotContent = document.createTextNode(e.detail.txt);\n tmpToast.appendChild(slotContent) \n\n this.shadowRoot?.appendChild(tmpToast);\n tmpToast.duration = TOAST_DURATION;\n\n // set timeout to remove toast (one second later)\n setTimeout(() => {\n this.shadowRoot?.removeChild(tmpToast);\n }, TOAST_DURATION + 1000);\n }\n\n static _scrollToTop() {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth',\n });\n }\n\n // Test, not used at the moment, jump/menu problem...\n // eslint-disable-next-line class-methods-use-this\n _scrollToContent(el:HTMLElement) {\n if (el) {\n const rect = el.getBoundingClientRect();\n console.log(\"Rect: \", rect);\n console.log(\"Offset Top/Height: \", el.offsetTop, el.offsetHeight);\n window.scrollBy({\n top: rect.top - (this._teaserClosed ? 80 : 450),\n left: 0,\n behavior: 'smooth',\n });\n }\n }\n\n}"]}
|
|
@@ -2,5 +2,8 @@
|
|
|
2
2
|
// Re-generate this file by running lit-localize
|
|
3
3
|
/* eslint-disable no-irregular-whitespace */
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
|
-
export const templates = {
|
|
5
|
+
export const templates = {
|
|
6
|
+
'spaH.loadingstate.pleaseWait': `Gegevens worden geladen`,
|
|
7
|
+
'spaH.loadingstate.syncState': `Gegevens worden gesynchroniseerd`,
|
|
8
|
+
};
|
|
6
9
|
//# sourceMappingURL=be.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"be.js","sourceRoot":"","sources":["../../../../src/generated/locales/be.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"be.js","sourceRoot":"","sources":["../../../../src/generated/locales/be.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,8BAA8B,EAAE,yBAAyB;IAC/D,6BAA6B,EAAE,kCAAkC;CAC5D,CAAC","sourcesContent":["\n // Do not modify this file by hand!\n // Re-generate this file by running lit-localize\n\n \n \n\n /* eslint-disable no-irregular-whitespace */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n\n export const templates = {\n 'spaH.loadingstate.pleaseWait': `Gegevens worden geladen`,\n'spaH.loadingstate.syncState': `Gegevens worden gesynchroniseerd`,\n };\n "]}
|
|
@@ -2,5 +2,8 @@
|
|
|
2
2
|
// Re-generate this file by running lit-localize
|
|
3
3
|
/* eslint-disable no-irregular-whitespace */
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
|
-
export const templates = {
|
|
5
|
+
export const templates = {
|
|
6
|
+
'spaH.loadingstate.syncState': `Daten werden synchronisiert`,
|
|
7
|
+
'spaH.loadingstate.pleaseWait': `Bitte warten, Daten werden geladen`,
|
|
8
|
+
};
|
|
6
9
|
//# sourceMappingURL=de.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"de.js","sourceRoot":"","sources":["../../../../src/generated/locales/de.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"de.js","sourceRoot":"","sources":["../../../../src/generated/locales/de.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,6BAA6B,EAAE,6BAA6B;IAClE,8BAA8B,EAAE,oCAAoC;CAC/D,CAAC","sourcesContent":["\n // Do not modify this file by hand!\n // Re-generate this file by running lit-localize\n\n \n \n\n /* eslint-disable no-irregular-whitespace */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n\n export const templates = {\n 'spaH.loadingstate.syncState': `Daten werden synchronisiert`,\n'spaH.loadingstate.pleaseWait': `Bitte warten, Daten werden geladen`,\n };\n "]}
|
|
@@ -2,5 +2,8 @@
|
|
|
2
2
|
// Re-generate this file by running lit-localize
|
|
3
3
|
/* eslint-disable no-irregular-whitespace */
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
|
-
export const templates = {
|
|
5
|
+
export const templates = {
|
|
6
|
+
'spaH.loadingstate.syncState': `Daten werden synchronisiert`,
|
|
7
|
+
'spaH.loadingstate.pleaseWait': `Bitte warten, Daten werden geladen`,
|
|
8
|
+
};
|
|
6
9
|
//# sourceMappingURL=en.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.js","sourceRoot":"","sources":["../../../../src/generated/locales/en.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"en.js","sourceRoot":"","sources":["../../../../src/generated/locales/en.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,6BAA6B,EAAE,6BAA6B;IAClE,8BAA8B,EAAE,oCAAoC;CAC/D,CAAC","sourcesContent":["\n // Do not modify this file by hand!\n // Re-generate this file by running lit-localize\n\n \n \n\n /* eslint-disable no-irregular-whitespace */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n\n export const templates = {\n 'spaH.loadingstate.syncState': `Daten werden synchronisiert`,\n'spaH.loadingstate.pleaseWait': `Bitte warten, Daten werden geladen`,\n };\n "]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pd-loading-state.stories.js","sourceRoot":"","sources":["../../../src/stories/pd-loading-state.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,OAAO,+BAA+B,CAAC;AAGvC,8GAA8G;AAC9G,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,4BAA4B;IACnC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;uBAED,IAAI,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;GAqBrC;IACD,QAAQ,EAAE;QACR,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;QACrC,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;QAC9B,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC;SACtC;KACF;CACa,CAAC;AAEjB,eAAe,IAAI,CAAC;AAIpB,uGAAuG;AACvG,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,IAAI,EAAE;QACJ,YAAY,EAAE;YACZ,SAAS,EAAE,IAAI;SAChB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE;QACJ,YAAY,EAAE;YACZ,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,IAAI;SACZ;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAU;IACnC,IAAI,EAAE;QACJ,YAAY,EAAE;YACZ,SAAS,EAAE,IAAI;YACf,UAAU,EAAE,2BAA2B;SACxC;KACF;CACF,CAAC","sourcesContent":["import { html } from 'lit';\nimport type { Meta, StoryObj } from '@storybook/web-components';\n\nimport '../tmpown/pd-loading-state.js';\n\n\n// More on how to set up stories at: https://storybook.js.org/docs/web-components/writing-stories/introduction\nconst meta = {\n title: 'PD Components/LoadingState', \n render: (args) => html`\n <pd-loading-state\n .loadingState=\"${args.loadingState}\"\n ></pd-loading-state>\n\n <p>\n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n </p>\n <p>\n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n </p>\n `,\n argTypes: {\n backgroundColor: { control: 'color' },\n onClick: { action: 'onClick' },\n size: {\n control: { type: 'select' },\n options: ['small', 'medium', 'large'],\n },\n },\n} satisfies Meta;\n\nexport default meta;\ntype Story = StoryObj;\n\n\n// More on writing stories with args: https://storybook.js.org/docs/web-components/writing-stories/args\nexport const NoModalState: Story = {\n args: {\n loadingState: {\n isLoading: true\n }\n },\n};\n\nexport const ModalState: Story = {\n args: {\n loadingState: {\n isLoading: true,\n modal: true\n }\n },\n};\n\nexport const CustomTxtState: Story = {\n args: {\n loadingState: {\n isLoading: true,\n loadingTxt: \"Hier steht was anderes...\"\n }\n },\n};\n\n"]}
|
|
1
|
+
{"version":3,"file":"pd-loading-state.stories.js","sourceRoot":"","sources":["../../../src/stories/pd-loading-state.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,OAAO,+BAA+B,CAAC;AAGvC,8GAA8G;AAC9G,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,4BAA4B;IACnC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;uBAED,IAAI,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;GAqBrC;IACD,QAAQ,EAAE;QACR,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;QACrC,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;QAC9B,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC;SACtC;KACF;CACa,CAAC;AAEjB,eAAe,IAAI,CAAC;AAIpB,uGAAuG;AACvG,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,IAAI,EAAE;QACJ,YAAY,EAAE;YACZ,SAAS,EAAE,IAAI;SAChB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE;QACJ,YAAY,EAAE;YACZ,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,IAAI;SACZ;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAU;IACnC,IAAI,EAAE;QACJ,YAAY,EAAE;YACZ,SAAS,EAAE,IAAI;YACf,UAAU,EAAE,2BAA2B;SACxC;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAU;IACpC,IAAI,EAAE;QACJ,YAAY,EAAE;YACZ,SAAS,EAAE,IAAI;YACf,eAAe,EAAE,IAAI;SACtB;KACF;CACF,CAAC","sourcesContent":["import { html } from 'lit';\nimport type { Meta, StoryObj } from '@storybook/web-components';\n\nimport '../tmpown/pd-loading-state.js';\n\n\n// More on how to set up stories at: https://storybook.js.org/docs/web-components/writing-stories/introduction\nconst meta = {\n title: 'PD Components/LoadingState', \n render: (args) => html`\n <pd-loading-state\n .loadingState=\"${args.loadingState}\"\n ></pd-loading-state>\n\n <p>\n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n </p>\n <p>\n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n Hier steht noch sonst was an text. \n </p>\n `,\n argTypes: {\n backgroundColor: { control: 'color' },\n onClick: { action: 'onClick' },\n size: {\n control: { type: 'select' },\n options: ['small', 'medium', 'large'],\n },\n },\n} satisfies Meta;\n\nexport default meta;\ntype Story = StoryObj;\n\n\n// More on writing stories with args: https://storybook.js.org/docs/web-components/writing-stories/args\nexport const NoModalState: Story = {\n args: {\n loadingState: {\n isLoading: true\n }\n },\n};\n\nexport const ModalState: Story = {\n args: {\n loadingState: {\n isLoading: true,\n modal: true\n }\n },\n};\n\nexport const CustomTxtState: Story = {\n args: {\n loadingState: {\n isLoading: true,\n loadingTxt: \"Hier steht was anderes...\"\n }\n },\n};\n\nexport const BackgroundState: Story = {\n args: {\n loadingState: {\n isLoading: true,\n smallBackground: true,\n }\n },\n};\n\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { LitElement, html, css } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { msg } from '@lit/localize';
|
|
5
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
6
|
let PdLoadingState = class PdLoadingState extends LitElement {
|
|
5
7
|
constructor() {
|
|
6
8
|
super(...arguments);
|
|
@@ -17,9 +19,14 @@ let PdLoadingState = class PdLoadingState extends LitElement {
|
|
|
17
19
|
}
|
|
18
20
|
_renderContent() {
|
|
19
21
|
return html `
|
|
20
|
-
<div class="
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
<div class="${classMap({
|
|
23
|
+
content: !this.loadingState.smallBackground,
|
|
24
|
+
"no-modal-content": this.loadingState.modal !== true && this.loadingState.smallBackground !== true,
|
|
25
|
+
"background-content": this.loadingState.smallBackground === true,
|
|
26
|
+
})}">
|
|
27
|
+
<div class="${this.loadingState.smallBackground ? "background-loader" : "loader"}"></div>
|
|
28
|
+
<p>${this.loadingState.loadingTxt || (this.loadingState.smallBackground ?
|
|
29
|
+
msg("Daten werden synchronisiert", { id: "spaH.loadingstate.syncState" }) : msg("Bitte warten, Daten werden geladen", { id: "spaH.loadingstate.pleaseWait" }))}</p>
|
|
23
30
|
</div>
|
|
24
31
|
`;
|
|
25
32
|
}
|
|
@@ -64,6 +71,22 @@ PdLoadingState.styles = [
|
|
|
64
71
|
z-index: 101; /* Sit on top */
|
|
65
72
|
}
|
|
66
73
|
|
|
74
|
+
.background-content {
|
|
75
|
+
|
|
76
|
+
position: fixed; /* Stay in place */
|
|
77
|
+
right: 0em;
|
|
78
|
+
bottom: 0em;
|
|
79
|
+
|
|
80
|
+
padding: 1em;
|
|
81
|
+
z-index: 101; /* Sit on top */
|
|
82
|
+
|
|
83
|
+
display: flex;
|
|
84
|
+
gap: 0.5em;
|
|
85
|
+
align-items: center;
|
|
86
|
+
|
|
87
|
+
background-color: white;
|
|
88
|
+
}
|
|
89
|
+
|
|
67
90
|
.loader {
|
|
68
91
|
border: 16px solid var(--pd-heating-service-loader, #0A3A48);
|
|
69
92
|
border-top: 16px solid var(--pd-heating-service-loader-run, #067394);
|
|
@@ -76,6 +99,15 @@ PdLoadingState.styles = [
|
|
|
76
99
|
margin-right: auto;
|
|
77
100
|
}
|
|
78
101
|
|
|
102
|
+
.background-loader {
|
|
103
|
+
border: 10px solid var(--pd-heating-service-loader, #0A3A48);
|
|
104
|
+
border-top: 10px solid var(--pd-heating-service-loader-run, #067394);
|
|
105
|
+
border-radius: 50%;
|
|
106
|
+
width: 10px;
|
|
107
|
+
height: 10px;
|
|
108
|
+
animation: spin 2s linear infinite;
|
|
109
|
+
}
|
|
110
|
+
|
|
79
111
|
@keyframes spin {
|
|
80
112
|
0% {
|
|
81
113
|
transform: rotate(0deg);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pd-loading-state.js","sourceRoot":"","sources":["../../../src/tmpown/pd-loading-state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"pd-loading-state.js","sourceRoot":"","sources":["../../../src/tmpown/pd-loading-state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAIhD,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;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","sourcesContent":["import { LitElement, html, css, CSSResultGroup } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { msg } from '@lit/localize';\nimport { classMap } from 'lit/directives/class-map.js';\n\n\n@customElement('pd-loading-state')\nexport class PdLoadingState extends LitElement {\n\n @property({ type: Object}) \n loadingState: {\n isLoading: boolean,\n modal?: boolean,\n smallBackground?: boolean,\n loadingTxt?: string\n } = {\n isLoading: false\n };\n\n\n static styles = [ \n css`\n :host {\n display: block;\n }\n\n /* The Modal (background) */\n .modal { \n position: fixed; /* Stay in place */ \n left: 0;\n top: 0;\n z-index: 500; /* Sit on top */\n\n display: flex;\n align-items: center;\n justify-content: center;\n \n width: 100%; /* Full width */\n height: 100%; /* Full height */ \n overflow: auto; /* Enable scroll if needed */\n /* RGBA Wert muss hier verwendet werden #AFC1D2 to rgba for opacity */\n background-color: var(--pd-popup-modal-bg-rgba, rgba(175, 193, 210, 0.8)); \n }\n\n /* Modal Content */\n .no-modal-content { \n position: fixed; /* Stay in place */ \n left: 50%; \n top: 50%; \n transform: translate(-50%, -50%); \n }\n\n .content {\n padding: 1em;\n text-align: center;\n background-color: var(--pd-loading-state-bg-col, #edf7fd);\n border: 2px solid var(--pd-loading-state-bg-col, var(--pd-default-col, #067394));\n z-index: 101; /* Sit on top */\n }\n\n .background-content {\n\n position: fixed; /* Stay in place */ \n right: 0em; \n bottom: 0em; \n\n padding: 1em; \n z-index: 101; /* Sit on top */\n\n display: flex;\n gap: 0.5em;\n align-items: center;\n\n background-color: white;\n }\n\n .loader { \n border: 16px solid var(--pd-heating-service-loader, #0A3A48);\n border-top: 16px solid var(--pd-heating-service-loader-run, #067394);\n border-radius: 50%;\n width: 30px;\n height: 30px;\n animation: spin 2s linear infinite;\n \n margin-left: auto;\n margin-right: auto;\n }\n\n .background-loader { \n border: 10px solid var(--pd-heating-service-loader, #0A3A48);\n border-top: 10px solid var(--pd-heating-service-loader-run, #067394);\n border-radius: 50%;\n width: 10px;\n height: 10px;\n animation: spin 2s linear infinite;\n }\n\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n\n `\n ] as CSSResultGroup; \n\n render() { \n return this.loadingState.modal ? html`\n <div id=\"modalId\" class=\"modal\">\n ${this._renderContent()}\n </div>\n ` : this._renderContent();\n }\n\n _renderContent() {\n return html`\n <div class=\"${classMap({\n content: !this.loadingState.smallBackground,\n \"no-modal-content\": this.loadingState.modal !== true && this.loadingState.smallBackground !== true,\n \"background-content\": this.loadingState.smallBackground === true,\n })}\">\n <div class=\"${this.loadingState.smallBackground ? \"background-loader\" : \"loader\"}\"></div>\n <p>${this.loadingState.loadingTxt || (this.loadingState.smallBackground ? \n msg(\"Daten werden synchronisiert\", {id: \"spaH.loadingstate.syncState\"}) : msg(\"Bitte warten, Daten werden geladen\", {id: \"spaH.loadingstate.pleaseWait\"}))}</p>\n </div>\n `\n }\n\n}"]}
|