@progressive-development/pd-spa-helper 0.2.3 → 0.2.5

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.
@@ -33,7 +33,7 @@ export declare abstract class PdSpaHelper extends PdSpaHelper_base {
33
33
  */
34
34
  _user: unknown | undefined;
35
35
  _profile: any | undefined;
36
- _loadingState?: LoadingState;
36
+ _loadingState: LoadingState[];
37
37
  /**
38
38
  * Properties needed for the router.
39
39
  */
@@ -109,6 +109,7 @@ export class PdSpaHelper extends router(navigator(LitElement)) {
109
109
  this.functionsController = new ServiceCallController(this);
110
110
  // not used at the moment
111
111
  this.title = 'Hey there';
112
+ this._loadingState = [];
112
113
  /**
113
114
  * Properties needed for the router.
114
115
  */
@@ -223,7 +224,7 @@ export class PdSpaHelper extends router(navigator(LitElement)) {
223
224
 
224
225
  <main class="${this._getMainClass(hideTeaser, pageConf)}">
225
226
 
226
- ${this._loadingState ? html `<pd-loading-state .loadingState="${this._loadingState}"></pd-loading-state>` : ''}
227
+ ${this._loadingState.map(ls => html `<pd-loading-state .loadingState="${ls}"></pd-loading-state>`)}
227
228
 
228
229
  <app-main active-route=${this.route}
229
230
  @init-menu-sections="${this._initMenuSections}"
@@ -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;AAM7C,OAAO,6CAA6C,CAAC;AACrD,OAAO,+CAA+C,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEpE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,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 { Subscription } from 'rxjs';\n\nimport { FirebaseApp } from 'firebase/app';\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, pdStore } 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 { getLoadingSelector } from './store/spa-app-selector.js';\nimport { setRouteElement } from './store/spa-app-effects.js';\nimport { APP_CONF_EVENT, LoadingState } from './model/spa-model.js';\nimport { loginSucess } from './store/spa-app-actions.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 app:FirebaseApp | undefined;\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: () => new Promise((resolve, reject) => {\n resolve(isAuthenticatedImpl());\n }),\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 console.log(\"Start init for config: \", config);\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 // add login route if set in config\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\n // generate routes from navigation config\n navigationConfig = config.navigationConfigParam;\n transformedRoutes = transformRoutes(); \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\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 protected abstract _appConfiguration: any;\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?: LoadingState;\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 // subscription for loading-state selector\n _subscription?: Subscription; \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 setRouteElement(this);\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 connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(APP_CONF_EVENT, this._setConfInDetail);\n this._subscription = pdStore().select(getLoadingSelector)\n .subscribe((loadingState) => {\n console.log(\"Loading State: \", loadingState);\n this._loadingState = loadingState;\n });\n }\n\n disconnectedCallback(): void {\n this.removeEventListener(APP_CONF_EVENT, this._setConfInDetail);\n this._subscription?.unsubscribe();\n super.disconnectedCallback();\n }\n\n _setConfInDetail(event: Event) {\n const {detail} = event as CustomEvent;\n if (detail) {\n detail.appConf = {\n ...this._appConfiguration\n };\n } \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 pdStore().dispatch(loginSucess());\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}"]}
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;AAM7C,OAAO,6CAA6C,CAAC;AACrD,OAAO,+CAA+C,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,mBAAmB,EAAE,kBAAkB,EA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ourcesContent":["import { html, LitElement, css, CSSResultGroup, TemplateResult, unsafeCSS } from 'lit';\nimport { router, navigator } from 'lit-element-router';\nimport { property } from 'lit/decorators.js';\n\nimport { Subscription } from 'rxjs';\n\nimport { FirebaseApp } from 'firebase/app';\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, pdStore } 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 { getLoadingSelector } from './store/spa-app-selector.js';\nimport { setRouteElement } from './store/spa-app-effects.js';\nimport { APP_CONF_EVENT, LoadingState } from './model/spa-model.js';\nimport { loginSucess } from './store/spa-app-actions.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 app:FirebaseApp | undefined;\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: () => new Promise((resolve, reject) => {\n resolve(isAuthenticatedImpl());\n }),\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 console.log(\"Start init for config: \", config);\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 // add login route if set in config\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\n // generate routes from navigation config\n navigationConfig = config.navigationConfigParam;\n transformedRoutes = transformRoutes(); \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\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 protected abstract _appConfiguration: any;\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: LoadingState[] = [];\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 // subscription for loading-state selector\n _subscription?: Subscription; \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 setRouteElement(this);\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 connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(APP_CONF_EVENT, this._setConfInDetail);\n this._subscription = pdStore().select(getLoadingSelector)\n .subscribe((loadingState) => {\n console.log(\"Loading State: \", loadingState);\n this._loadingState = loadingState;\n });\n }\n\n disconnectedCallback(): void {\n this.removeEventListener(APP_CONF_EVENT, this._setConfInDetail);\n this._subscription?.unsubscribe();\n super.disconnectedCallback();\n }\n\n _setConfInDetail(event: Event) {\n const {detail} = event as CustomEvent;\n if (detail) {\n detail.appConf = {\n ...this._appConfiguration\n };\n } \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 pdStore().dispatch(loginSucess());\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.map(ls => html`<pd-loading-state .loadingState=\"${ls}\"></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,7 +1,14 @@
1
1
  export declare const APP_CONF_EVENT = "get-app-conf";
2
+ export interface LoadingSubTask {
3
+ actionKey: string;
4
+ completed: boolean;
5
+ loadingTxt: string;
6
+ }
2
7
  export interface LoadingState {
3
8
  isLoading: boolean;
9
+ actionKey: string;
4
10
  modal?: boolean;
5
11
  smallBackground?: boolean;
6
12
  loadingTxt?: string;
13
+ subTask?: LoadingSubTask[];
7
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"spa-model.js","sourceRoot":"","sources":["../../../src/model/spa-model.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC","sourcesContent":["export const APP_CONF_EVENT = \"get-app-conf\";\n\nexport interface LoadingState {\n isLoading: boolean,\n modal?: boolean,\n smallBackground?: boolean,\n loadingTxt?: string\n}"]}
1
+ {"version":3,"file":"spa-model.js","sourceRoot":"","sources":["../../../src/model/spa-model.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC","sourcesContent":["export const APP_CONF_EVENT = \"get-app-conf\";\n\nexport interface LoadingSubTask {\n actionKey: string\n completed: boolean,\n loadingTxt: string, \n}\n\nexport interface LoadingState {\n isLoading: boolean,\n actionKey: string\n modal?: boolean,\n smallBackground?: boolean,\n loadingTxt?: string,\n subTask?: LoadingSubTask[],\n}\n\n"]}
@@ -1,4 +1,4 @@
1
- import { LoadingState } from '../model/spa-model.js';
1
+ import { LoadingState, LoadingSubTask } from '../model/spa-model.js';
2
2
  export declare const initIndexDBSucess: (() => {
3
3
  type: "SPA_INIT_INDEX_DB_SUCCESS";
4
4
  }) & {
@@ -23,10 +23,30 @@ export declare const updateInternetOffline: ((payload: boolean) => {
23
23
  }) & {
24
24
  type: "SPA_APP_UPDATE_INTERNET_OFFLINE";
25
25
  };
26
- export declare const loadingStateChange: ((payload: LoadingState) => {
26
+ export declare const addLoadingState: ((payload: LoadingState) => {
27
27
  payload: LoadingState;
28
28
  } & {
29
- type: "SPA_APP_LOADING_STATE_CHANGE";
29
+ type: "SPA_APP_ADD_LOADING";
30
30
  }) & {
31
- type: "SPA_APP_LOADING_STATE_CHANGE";
31
+ type: "SPA_APP_ADD_LOADING";
32
+ };
33
+ export declare const changeSubTask: ((payload: {
34
+ loadingActionId: string;
35
+ newTaskState: LoadingSubTask;
36
+ }) => {
37
+ payload: {
38
+ loadingActionId: string;
39
+ newTaskState: LoadingSubTask;
40
+ };
41
+ } & {
42
+ type: "SPA_APP_CHANGE_SUB_LOADING";
43
+ }) & {
44
+ type: "SPA_APP_CHANGE_SUB_LOADING";
45
+ };
46
+ export declare const removeLoadingState: ((payload: string) => {
47
+ payload: string;
48
+ } & {
49
+ type: "SPA_APP_REMOVE_LOADING";
50
+ }) & {
51
+ type: "SPA_APP_REMOVE_LOADING";
32
52
  };
@@ -3,5 +3,7 @@ export const initIndexDBSucess = action('SPA_INIT_INDEX_DB_SUCCESS');
3
3
  export const loginSucess = action('SPA_LOGIN_SUCCESS');
4
4
  export const routeAction = action('SPA_APP_ROUTE', payload());
5
5
  export const updateInternetOffline = action('SPA_APP_UPDATE_INTERNET_OFFLINE', payload());
6
- export const loadingStateChange = action('SPA_APP_LOADING_STATE_CHANGE', payload());
6
+ export const addLoadingState = action('SPA_APP_ADD_LOADING', payload());
7
+ export const changeSubTask = action('SPA_APP_CHANGE_SUB_LOADING', payload());
8
+ export const removeLoadingState = action('SPA_APP_REMOVE_LOADING', payload());
7
9
  //# sourceMappingURL=spa-app-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spa-app-actions.js","sourceRoot":"","sources":["../../../src/store/spa-app-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAEvD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,eAAe,EAAE,OAAO,EAAU,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,iCAAiC,EAAE,OAAO,EAAW,CAAC,CAAC;AAEnG,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,8BAA8B,EAAE,OAAO,EAAgB,CAAC,CAAC","sourcesContent":["import { action, payload } from 'ts-action';\nimport { LoadingState } from '../model/spa-model.js';\n\nexport const initIndexDBSucess = action('SPA_INIT_INDEX_DB_SUCCESS');\nexport const loginSucess = action('SPA_LOGIN_SUCCESS');\n\nexport const routeAction = action('SPA_APP_ROUTE', payload<string>());\n\nexport const updateInternetOffline = action('SPA_APP_UPDATE_INTERNET_OFFLINE', payload<boolean>());\n\nexport const loadingStateChange = action('SPA_APP_LOADING_STATE_CHANGE', payload<LoadingState>());"]}
1
+ {"version":3,"file":"spa-app-actions.js","sourceRoot":"","sources":["../../../src/store/spa-app-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAEvD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,eAAe,EAAE,OAAO,EAAU,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,iCAAiC,EAAE,OAAO,EAAW,CAAC,CAAC;AAEnG,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,qBAAqB,EAAE,OAAO,EAAgB,CAAC,CAAC;AACtF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,4BAA4B,EAAE,OAAO,EAGrE,CAAC,CAAC;AACN,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,wBAAwB,EAAE,OAAO,EAAU,CAAC,CAAC","sourcesContent":["import { action, payload } from 'ts-action';\nimport { LoadingState, LoadingSubTask } from '../model/spa-model.js';\n\nexport const initIndexDBSucess = action('SPA_INIT_INDEX_DB_SUCCESS');\nexport const loginSucess = action('SPA_LOGIN_SUCCESS');\n\nexport const routeAction = action('SPA_APP_ROUTE', payload<string>());\n\nexport const updateInternetOffline = action('SPA_APP_UPDATE_INTERNET_OFFLINE', payload<boolean>());\n\nexport const addLoadingState = action('SPA_APP_ADD_LOADING', payload<LoadingState>());\nexport const changeSubTask = action('SPA_APP_CHANGE_SUB_LOADING', payload<{\n loadingActionId: string,\n newTaskState: LoadingSubTask\n}>());\nexport const removeLoadingState = action('SPA_APP_REMOVE_LOADING', payload<string>());"]}
@@ -6,6 +6,7 @@ let routeElement;
6
6
  export const setRouteElement = (param) => {
7
7
  routeElement = param;
8
8
  };
9
+ // remove loading task if all sub tasks done
9
10
  export const appRouteEffect = createEffect(actions$.pipe(ofType(routeAction), tap((action) => {
10
11
  if (!routeElement) {
11
12
  console.error("No route element set for appRouteEffect");
@@ -1 +1 @@
1
- {"version":3,"file":"spa-app-effects.js","sourceRoot":"","sources":["../../../src/store/spa-app-effects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,IAAI,YAAyB,CAAC;AAE9B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAkB,EAAE,EAAE;IACpD,YAAY,GAAG,KAAK,CAAC;AACvB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CACxC,QAAQ,CAAC,IAAI,CACX,MAAM,CAAC,WAAW,CAAC,EACnB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;IACb,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;KAC1D;SAAM;QACL,YAAY,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,aAAa,EAAE;YACxD,MAAM,EAAE,EAAC,KAAK,EAAE,MAAM,CAAC,OAAO,EAAC;YAC/B,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC,CAAC;KACL;AACH,CAAC,CAAC,CACH,EAAE;IACD,QAAQ,EAAE,KAAK;CAChB,CACF,CAAC","sourcesContent":["import { actions$, createEffect } from 'mini-rx-store';\n\nimport { tap } from 'rxjs/operators';\n\nimport { ofType } from 'ts-action-operators';\n\nimport { routeAction } from './spa-app-actions.js';\n\n\nlet routeElement: HTMLElement;\n\nexport const setRouteElement = (param: HTMLElement) => {\n routeElement = param;\n}\n\nexport const appRouteEffect = createEffect(\n actions$.pipe(\n ofType(routeAction),\n tap((action) => {\n if (!routeElement) {\n console.error(\"No route element set for appRouteEffect\");\n } else { \n routeElement.dispatchEvent(new CustomEvent('route-event', {\n detail: {route: action.payload},\n bubbles: true,\n composed: true\n })); \n }\n })\n ), {\n dispatch: false\n }\n);\n"]}
1
+ {"version":3,"file":"spa-app-effects.js","sourceRoot":"","sources":["../../../src/store/spa-app-effects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,IAAI,YAAyB,CAAC;AAE9B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAkB,EAAE,EAAE;IACpD,YAAY,GAAG,KAAK,CAAC;AACvB,CAAC,CAAA;AAED,4CAA4C;AAG5C,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CACxC,QAAQ,CAAC,IAAI,CACX,MAAM,CAAC,WAAW,CAAC,EACnB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;IACb,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;KAC1D;SAAM;QACL,YAAY,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,aAAa,EAAE;YACxD,MAAM,EAAE,EAAC,KAAK,EAAE,MAAM,CAAC,OAAO,EAAC;YAC/B,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC,CAAC;KACL;AACH,CAAC,CAAC,CACH,EAAE;IACD,QAAQ,EAAE,KAAK;CAChB,CACF,CAAC","sourcesContent":["import { actions$, createEffect } from 'mini-rx-store';\n\nimport { tap } from 'rxjs/operators';\n\nimport { ofType } from 'ts-action-operators';\n\nimport { routeAction } from './spa-app-actions.js';\n\n\nlet routeElement: HTMLElement;\n\nexport const setRouteElement = (param: HTMLElement) => {\n routeElement = param;\n}\n\n// remove loading task if all sub tasks done\n\n\nexport const appRouteEffect = createEffect(\n actions$.pipe(\n ofType(routeAction),\n tap((action) => {\n if (!routeElement) {\n console.error(\"No route element set for appRouteEffect\");\n } else { \n routeElement.dispatchEvent(new CustomEvent('route-event', {\n detail: {route: action.payload},\n bubbles: true,\n composed: true\n })); \n }\n })\n ), {\n dispatch: false\n }\n);\n"]}
@@ -1,7 +1,7 @@
1
1
  import { LoadingState } from '../model/spa-model.js';
2
2
  export interface SpaAppState {
3
3
  offline?: boolean;
4
- loadingState?: LoadingState;
4
+ loadingState: LoadingState[];
5
5
  lastRoutes?: any[];
6
6
  initIndexDB?: boolean;
7
7
  userLogin?: boolean;
@@ -1,18 +1,38 @@
1
1
  import { on, reducer } from 'ts-action';
2
- import { initIndexDBSucess, loadingStateChange, loginSucess, routeAction, updateInternetOffline } from './spa-app-actions.js';
3
- const initialState = {};
2
+ import { initIndexDBSucess, addLoadingState, loginSucess, routeAction, updateInternetOffline, removeLoadingState, changeSubTask } from './spa-app-actions.js';
3
+ const initialState = {
4
+ loadingState: [],
5
+ };
4
6
  export const spaAppReducer = reducer(initialState, on(updateInternetOffline, (state, { payload }) => ({
5
7
  ...state,
6
8
  offline: payload
7
- })), on(loadingStateChange, (state, { payload }) => ({
9
+ })), on(addLoadingState, (state, { payload }) => ({
8
10
  ...state,
9
- loadingState: payload ? {
10
- isLoading: payload.isLoading,
11
- smallBackground: payload.smallBackground,
12
- modal: payload.modal,
13
- txt: payload.loadingTxt,
14
- } : undefined
15
- })), on(routeAction, (state, { payload }) => ({
11
+ loadingState: [
12
+ ...(state.loadingState),
13
+ payload
14
+ ]
15
+ })), on(changeSubTask, (state, { payload }) => ({
16
+ ...state,
17
+ loadingState: state.loadingState.map(ls => {
18
+ var _a;
19
+ if (ls.actionKey === payload.loadingActionId) {
20
+ // change new sub task in sub task list
21
+ return {
22
+ ...ls,
23
+ subTask: (_a = ls.subTask) === null || _a === void 0 ? void 0 : _a.map(subLs => subLs.actionKey
24
+ === payload.newTaskState.actionKey ? payload.newTaskState : subLs),
25
+ };
26
+ }
27
+ return ls;
28
+ })
29
+ })), on(removeLoadingState, (state, { payload }) => {
30
+ var _a;
31
+ return ({
32
+ ...state,
33
+ loadingState: (_a = state.loadingState) === null || _a === void 0 ? void 0 : _a.filter(a => a.actionKey !== payload)
34
+ });
35
+ }), on(routeAction, (state, { payload }) => ({
16
36
  ...state,
17
37
  lastRoutes: [
18
38
  ...(state.lastRoutes || []),
@@ -1 +1 @@
1
- {"version":3,"file":"spa-app-reducer.js","sourceRoot":"","sources":["../../../src/store/spa-app-reducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,WAAW,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAW9H,MAAM,YAAY,GAAgB,EAEjC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAClC,YAAY,EAEZ,EAAE,CAAE,qBAAqB,EAAE,CAAC,KAAK,EAAE,EAAC,OAAO,EAAC,EAAE,EAAE,CAAE,CAChD;IACE,GAAG,KAAK;IACR,OAAO,EAAE,OAAO;CACjB,CACF,CAAC,EAEF,EAAE,CAAC,kBAAkB,EAAE,CAAC,KAAK,EAAE,EAAC,OAAO,EAAC,EAAE,EAAE,CAAC,CAC3C;IACE,GAAG,KAAK;IACR,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;QACtB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,GAAG,EAAE,OAAO,CAAC,UAAU;KACxB,CAAC,CAAC,CAAC,SAAS;CACd,CACF,CAAC,EAEF,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,EAAC,OAAO,EAAC,EAAE,EAAE,CAAC,CACpC;IACE,GAAG,KAAK;IACR,UAAU,EAAE;QACV,GAAG,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC;QAC3B,OAAO;KACR;CACF,CACF,CAAC,EAEF,EAAE,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAC/B;IACE,GAAG,KAAK;IACR,WAAW,EAAE,IAAI;CAClB,CACF,CAAC,EAEF,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CACzB;IACE,GAAG,KAAK;IACR,SAAS,EAAE,IAAI;CAChB,CACF,CAAC,CAEH,CAAC","sourcesContent":["import { on, reducer } from 'ts-action';\n\nimport { initIndexDBSucess, loadingStateChange, loginSucess, routeAction, updateInternetOffline } from './spa-app-actions.js';\nimport { LoadingState } from '../model/spa-model.js';\n\nexport interface SpaAppState {\n offline?: boolean,\n loadingState?: LoadingState;\n lastRoutes?: any[];\n initIndexDB?: boolean;\n userLogin?: boolean;\n}\n\nconst initialState: SpaAppState = { \n \n};\n\nexport const spaAppReducer = reducer(\n initialState,\n\n on (updateInternetOffline, (state, {payload}) => (\n {\n ...state,\n offline: payload\n }\n )), \n \n on(loadingStateChange, (state, {payload}) => (\n {\n ...state,\n loadingState: payload ? {\n isLoading: payload.isLoading,\n smallBackground: payload.smallBackground,\n modal: payload.modal,\n txt: payload.loadingTxt,\n } : undefined\n }\n )),\n\n on(routeAction, (state, {payload}) => (\n {\n ...state,\n lastRoutes: [\n ...(state.lastRoutes || []),\n payload\n ]\n }\n )),\n\n on(initIndexDBSucess, (state) => (\n {\n ...state,\n initIndexDB: true,\n }\n )),\n\n on(loginSucess, (state) => (\n {\n ...state,\n userLogin: true,\n }\n )),\n\n);"]}
1
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rE,CAAA;SACF;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;CACH,CACF,CAAC,EAEF,EAAE,CAAC,kBAAkB,EAAE,CAAC,KAAK,EAAE,EAAC,OAAO,EAAC,EAAE,EAAE;;IAAC,OAAA,CAC3C;QACE,GAAG,KAAK;QACR,YAAY,EAAE,MAAA,KAAK,CAAC,YAAY,0CAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,OAAO,CAAC;KACvE,CACF,CAAA;CAAA,CAAC,EAEF,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,EAAC,OAAO,EAAC,EAAE,EAAE,CAAC,CACpC;IACE,GAAG,KAAK;IACR,UAAU,EAAE;QACV,GAAG,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC;QAC3B,OAAO;KACR;CACF,CACF,CAAC,EAEF,EAAE,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAC/B;IACE,GAAG,KAAK;IACR,WAAW,EAAE,IAAI;CAClB,CACF,CAAC,EAEF,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CACzB;IACE,GAAG,KAAK;IACR,SAAS,EAAE,IAAI;CAChB,CACF,CAAC,CAEH,CAAC","sourcesContent":["import { on, reducer } from 'ts-action';\n\nimport { initIndexDBSucess, addLoadingState, loginSucess, routeAction, updateInternetOffline, removeLoadingState, changeSubTask } from './spa-app-actions.js';\nimport { LoadingState } from '../model/spa-model.js';\n\nexport interface SpaAppState {\n offline?: boolean,\n loadingState: LoadingState[];\n lastRoutes?: any[];\n initIndexDB?: boolean;\n userLogin?: boolean;\n}\n\nconst initialState: SpaAppState = { \n loadingState: [],\n};\n\nexport const spaAppReducer = reducer(\n initialState,\n\n on (updateInternetOffline, (state, {payload}) => (\n {\n ...state,\n offline: payload\n }\n )), \n \n on(addLoadingState, (state, {payload}) => (\n {\n ...state,\n loadingState: [\n ...(state.loadingState),\n payload\n ]\n }\n )),\n\n on(changeSubTask, (state, {payload}) => (\n {\n ...state,\n loadingState: state.loadingState.map(ls => {\n if (ls.actionKey === payload.loadingActionId) {\n // change new sub task in sub task list\n return {\n ...ls,\n subTask: ls.subTask?.map(subLs => subLs.actionKey \n === payload.newTaskState.actionKey ? payload.newTaskState : subLs),\n }\n }\n return ls;\n })\n }\n )),\n\n on(removeLoadingState, (state, {payload}) => (\n {\n ...state,\n loadingState: state.loadingState?.filter(a => a.actionKey !== payload)\n }\n )),\n\n on(routeAction, (state, {payload}) => (\n {\n ...state,\n lastRoutes: [\n ...(state.lastRoutes || []),\n payload\n ]\n }\n )),\n\n on(initIndexDBSucess, (state) => (\n {\n ...state,\n initIndexDB: true,\n }\n )),\n\n on(loginSucess, (state) => (\n {\n ...state,\n userLogin: true,\n }\n )),\n\n);"]}
@@ -1,4 +1,4 @@
1
- export declare const getLoadingSelector: import("mini-rx-store/lib/selector.js").Selector<object, import("../model/spa-model.js").LoadingState | undefined>;
1
+ export declare const getLoadingSelector: import("mini-rx-store/lib/selector.js").Selector<object, import("../model/spa-model.js").LoadingState[]>;
2
2
  export declare const getOfflineSelector: import("mini-rx-store/lib/selector.js").Selector<object, boolean>;
3
3
  export declare const getInitStatusSelector: import("mini-rx-store/lib/selector.js").Selector<object, {
4
4
  login: boolean | undefined;
@@ -24,3 +24,6 @@ export declare const NoModalState: Story;
24
24
  export declare const ModalState: Story;
25
25
  export declare const CustomTxtState: Story;
26
26
  export declare const BackgroundState: Story;
27
+ export declare const ModalBackgroundState: Story;
28
+ export declare const ModalWithBackgroundState: Story;
29
+ export declare const ModalStateWithSubTasks: Story;
@@ -6,7 +6,17 @@ const meta = {
6
6
  render: (args) => html `
7
7
  <pd-loading-state
8
8
  .loadingState="${args.loadingState}"
9
- ></pd-loading-state>
9
+ ></pd-loading-state>
10
+
11
+ ${args.doubleState ? html `
12
+ <pd-loading-state
13
+ .loadingState="${{
14
+ isLoading: true,
15
+ modal: true,
16
+ actionKey: ""
17
+ }}"
18
+ ></pd-loading-state>
19
+ ` : ''}
10
20
 
11
21
  <p>
12
22
  Hier steht noch sonst was an text.
@@ -69,4 +79,48 @@ export const BackgroundState = {
69
79
  }
70
80
  },
71
81
  };
82
+ export const ModalBackgroundState = {
83
+ args: {
84
+ loadingState: {
85
+ isLoading: true,
86
+ smallBackground: true,
87
+ modal: true,
88
+ }
89
+ },
90
+ };
91
+ export const ModalWithBackgroundState = {
92
+ args: {
93
+ loadingState: {
94
+ isLoading: true,
95
+ smallBackground: true,
96
+ },
97
+ doubleState: true
98
+ },
99
+ };
100
+ export const ModalStateWithSubTasks = {
101
+ args: {
102
+ loadingState: {
103
+ isLoading: true,
104
+ modal: true,
105
+ loadingTxt: "Sammelaufgabe wird erledigt",
106
+ subTask: [
107
+ {
108
+ actionKey: "",
109
+ completed: true,
110
+ loadingTxt: "SubTask 1"
111
+ },
112
+ {
113
+ actionKey: "",
114
+ completed: false,
115
+ loadingTxt: "SubTask 2"
116
+ },
117
+ {
118
+ actionKey: "",
119
+ completed: false,
120
+ loadingTxt: "SubTask 3"
121
+ },
122
+ ]
123
+ }
124
+ },
125
+ };
72
126
  //# sourceMappingURL=pd-loading-state.stories.js.map
@@ -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;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
+ {"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;;;MAGlC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAA;;uBAEN;QACf,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,EAAE;KACd;;OAEA,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;GAoBT;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,OAA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;oBACE,SAAS,EAAE,EAAE;oBACb,SAAS,EAAE,KAAK;oBAChB,UAAU,EAAE,WAAW;iBACxB;gBACD;oBACE,SAAS,EAAE,EAAE;oBACb,SAAS,EAAE,KAAK;oBAChB,UAAU,EAAE,WAAW;iBACxB;aACF;SACF;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 ${args.doubleState ? html`\n <pd-loading-state\n .loadingState=\"${{\n isLoading: true,\n modal: true,\n actionKey: \"\"\n }}\"\n ></pd-loading-state> \n ` : ''} \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\nexport const ModalBackgroundState: Story = {\n args: {\n loadingState: {\n isLoading: true,\n smallBackground: true,\n modal: true,\n }\n },\n};\n\nexport const ModalWithBackgroundState: Story = {\n args: {\n loadingState: {\n isLoading: true,\n smallBackground: true, \n },\n doubleState: true\n },\n};\n\nexport const ModalStateWithSubTasks: Story = {\n args: {\n loadingState: {\n isLoading: true,\n modal: true,\n loadingTxt: \"Sammelaufgabe wird erledigt\",\n subTask: [\n {\n actionKey: \"\",\n completed: true,\n loadingTxt: \"SubTask 1\"\n },\n {\n actionKey: \"\",\n completed: false,\n loadingTxt: \"SubTask 2\"\n },\n {\n actionKey: \"\",\n completed: false,\n loadingTxt: \"SubTask 3\"\n },\n ]\n }\n },\n};\n\n"]}
@@ -1,8 +1,9 @@
1
1
  import { LitElement, CSSResultGroup } from 'lit';
2
+ import '@progressive-development/pd-icon/pd-icon.js';
2
3
  import { LoadingState } from '../model/spa-model.js';
3
4
  export declare class PdLoadingState extends LitElement {
4
- loadingState: LoadingState;
5
+ loadingState?: LoadingState;
5
6
  static styles: CSSResultGroup;
6
- render(): import("lit").TemplateResult<1>;
7
- _renderContent(): import("lit").TemplateResult<1>;
7
+ render(): "" | import("lit").TemplateResult<1>;
8
+ _renderContent(): "" | import("lit").TemplateResult<1>;
8
9
  }
@@ -3,14 +3,12 @@ import { LitElement, html, css } from 'lit';
3
3
  import { customElement, property } from 'lit/decorators.js';
4
4
  import { msg } from '@lit/localize';
5
5
  import { classMap } from 'lit/directives/class-map.js';
6
+ import '@progressive-development/pd-icon/pd-icon.js';
6
7
  let PdLoadingState = class PdLoadingState extends LitElement {
7
- constructor() {
8
- super(...arguments);
9
- this.loadingState = {
10
- isLoading: false
11
- };
12
- }
13
8
  render() {
9
+ if (!this.loadingState) {
10
+ return '';
11
+ }
14
12
  return this.loadingState.modal ? html `
15
13
  <div id="modalId" class="modal">
16
14
  ${this._renderContent()}
@@ -18,6 +16,9 @@ let PdLoadingState = class PdLoadingState extends LitElement {
18
16
  ` : this._renderContent();
19
17
  }
20
18
  _renderContent() {
19
+ if (!this.loadingState) {
20
+ return '';
21
+ }
21
22
  return html `
22
23
  <div class="${classMap({
23
24
  content: !this.loadingState.smallBackground,
@@ -26,7 +27,21 @@ let PdLoadingState = class PdLoadingState extends LitElement {
26
27
  })}">
27
28
  <div class="${this.loadingState.smallBackground ? "background-loader" : "loader"}"></div>
28
29
  <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>
30
+ msg("Daten werden synchronisiert", { id: "spaH.loadingstate.syncState" }) : msg("Bitte warten, Daten werden geladen", { id: "spaH.loadingstate.pleaseWait" }))}
31
+ </p>
32
+ ${this.loadingState.subTask && this.loadingState.subTask.length > 0 ? html `
33
+ <ul class="sub-ul">
34
+ ${this.loadingState.subTask.map(task => html `
35
+ <li>
36
+ <div class="sub-row">
37
+ ${task.loadingTxt}
38
+ ${task.completed ? html `<pd-icon class="sub-icon completed" icon="checkBox" activeIcon></pd-icon>`
39
+ : html `<pd-icon class="sub-icon loading" icon="syncIcon" activeIcon></pd-icon>`}
40
+ </div>
41
+ </li>
42
+ `)}
43
+ </ul>
44
+ ` : ''}
30
45
  </div>
31
46
  `;
32
47
  }
@@ -78,7 +93,7 @@ PdLoadingState.styles = [
78
93
  bottom: 0em;
79
94
 
80
95
  padding: 1em;
81
- z-index: 101; /* Sit on top */
96
+ z-index: 600; /* Sit on top */
82
97
 
83
98
  display: flex;
84
99
  gap: 0.5em;
@@ -108,6 +123,34 @@ PdLoadingState.styles = [
108
123
  animation: spin 2s linear infinite;
109
124
  }
110
125
 
126
+ .sub-ul {
127
+ text-align: start;
128
+ }
129
+
130
+ .sub-row {
131
+ display: flex;
132
+ align-items: center;
133
+ justify-content: space-between;
134
+ padding-right: 10px;
135
+ }
136
+
137
+ .sub-icon {
138
+ --pd-icon-size: 1rem;
139
+ padding: 0;
140
+ vertical-align: baseline;
141
+ margin: 0 .25rem 0 0;
142
+ }
143
+
144
+ .completed {
145
+ --pd-icon-stroke-col-active: green;
146
+ --pd-icon-col-active: green;
147
+ }
148
+
149
+ .loading {
150
+ --pd-icon-stroke-col-active: orange;
151
+ --pd-icon-col-active: orange;
152
+ }
153
+
111
154
  @keyframes spin {
112
155
  0% {
113
156
  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;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAMhD,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;IAAvC;;QAGL,iBAAY,GAAiB;YAC3B,SAAS,EAAE,KAAK;SACjB,CAAC;IAkHJ,CAAC;IAtBC,MAAM;QACJ,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;;YAE7B,IAAI,CAAC,cAAc,EAAE;;OAE1B,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;IAC9B,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAA;oBACK,QAAQ,CAAC;YACnB,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe;YAC3C,kBAAkB,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,KAAK,IAAI,IAAI,IAAI,CAAC,YAAY,CAAC,eAAe,KAAK,IAAI;YAClG,oBAAoB,EAAE,IAAI,CAAC,YAAY,CAAC,eAAe,KAAK,IAAI;SACjE,CAAC;sBACY,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,QAAQ;aAC3E,IAAI,CAAC,YAAY,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;YACvE,GAAG,CAAC,6BAA6B,EAAE,EAAC,EAAE,EAAE,6BAA6B,EAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,oCAAoC,EAAE,EAAC,EAAE,EAAE,8BAA8B,EAAC,CAAC,CAAC;;KAE/J,CAAA;IACH,CAAC;;AA7GM,qBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqFF;CACgB,CAAC;AA5FpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC;oDAGxB;AALS,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAuH1B;SAvHY,cAAc","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\nimport {LoadingState} from '../model/spa-model.js';\n\n\n@customElement('pd-loading-state')\nexport class PdLoadingState extends LitElement {\n\n @property({ type: Object}) \n loadingState: LoadingState = {\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\"}))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;YACvE,GAAG,CAAC,6BAA6B,EAAE,EAAC,EAAE,EAAE,6BAA6B,EAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,oCAAoC,EAAE,EAAC,EAAE,EAAE,8BAA8B,EAAC,CAAC,CAAC;;UAE1J,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;;cAEpE,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAA;;;kBAGtC,IAAI,CAAC,UAAU;kBACf,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA,2EAA2E;YAChG,CAAC,CAAC,IAAI,CAAA,yEAAyE;;;aAGpF,CAAC;;SAEL,CAAC,CAAC,CAAC,EAAE;;KAET,CAAA;IACH,CAAC;;AA7JM,qBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiHF;CACgB,CAAC;AArHpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC;oDACE;AAHjB,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAoK1B;SApKY,cAAc","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\nimport '@progressive-development/pd-icon/pd-icon.js';\n\nimport {LoadingState} from '../model/spa-model.js';\n\n\n@customElement('pd-loading-state')\nexport class PdLoadingState extends LitElement {\n\n @property({ type: Object}) \n loadingState?: LoadingState;\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: 600; /* 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 .sub-ul {\n text-align: start;\n }\n\n .sub-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-right: 10px;\n }\n\n .sub-icon {\n --pd-icon-size: 1rem;\n padding: 0;\n vertical-align: baseline;\n margin: 0 .25rem 0 0;\n }\n\n .completed {\n --pd-icon-stroke-col-active: green;\n --pd-icon-col-active: green;\n }\n\n .loading {\n --pd-icon-stroke-col-active: orange;\n --pd-icon-col-active: orange;\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 if (!this.loadingState) {\n return '';\n }\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 if (!this.loadingState) {\n return '';\n }\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\"}))}\n </p>\n ${this.loadingState.subTask && this.loadingState.subTask.length > 0 ? html`\n <ul class=\"sub-ul\">\n ${this.loadingState.subTask.map(task => html`\n <li>\n <div class=\"sub-row\">\n ${task.loadingTxt}\n ${task.completed ? html`<pd-icon class=\"sub-icon completed\" icon=\"checkBox\" activeIcon></pd-icon>` \n : html`<pd-icon class=\"sub-icon loading\" icon=\"syncIcon\" activeIcon></pd-icon>`}\n </div>\n </li>\n `)}\n </ul>\n ` : ''}\n </div>\n `\n }\n\n}"]}