{"id":17948843,"url":"https://github.com/blikblum/wc-f7","last_synced_at":"2025-03-24T22:35:38.298Z","repository":{"id":34399307,"uuid":"178474162","full_name":"blikblum/wc-f7","owner":"blikblum","description":"Framework7 with Web Components ","archived":false,"fork":false,"pushed_at":"2023-04-30T18:55:38.000Z","size":5070,"stargazers_count":5,"open_issues_count":6,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-19T05:07:04.220Z","etag":null,"topics":["framework7","lit-element","skatejs","web-components"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blikblum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-29T20:52:54.000Z","updated_at":"2023-12-07T06:17:19.000Z","dependencies_parsed_at":"2024-10-29T09:52:44.382Z","dependency_job_id":null,"html_url":"https://github.com/blikblum/wc-f7","commit_stats":{"total_commits":50,"total_committers":3,"mean_commits":"16.666666666666668","dds":"0.42000000000000004","last_synced_commit":"ed3dcab48ae3d7dc09cad70a5047ce767a7fe738"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blikblum%2Fwc-f7","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blikblum%2Fwc-f7/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blikblum%2Fwc-f7/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blikblum%2Fwc-f7/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blikblum","download_url":"https://codeload.github.com/blikblum/wc-f7/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245366205,"owners_count":20603438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["framework7","lit-element","skatejs","web-components"],"created_at":"2024-10-29T09:10:19.789Z","updated_at":"2025-03-24T22:35:33.273Z","avatar_url":"https://github.com/blikblum.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wc-f7\n\nwc-f7 is a [Framework7](https://framework7.io/) setup that provides seamless integration with [Web Components](https://developer.mozilla.org/en-US/docs/Web/Web_Components)\n\n### Architecture\n\nwc-f7 extends Framework7 core modules replacing the router component loader with one that accepts a Web Component declaration (tag name or class constructor) instead of a Framework7 component model. As a side effect, vdom (Snabbdom) and parser/loader modules are not imported/bundled.\n\n### Features\n\n - Declares Framework7 pages as Web Components\n - Supports async rendering (e.g. [LitElement](https://lit-element.polymer-project.org/) / [SkateJS](https://github.com/skatejs/skatejs))\n - Bundle size smaller than Framework7 core\n - Supports component lifecycle hooks and page events\n - No hard dependency on a specific Framework7 version (any v4 version should work)\n\n\n### Caveats\n \n - Does not works with shadow dom, due to the Framework7 architecture\n - Only ES modules build is provided\n\n### Install\n\n    $ npm install wc-f7 framework7\n\n### Usage\n\nDefine component class\n\n```Javascript\nimport { LitElement, html } from 'lit-element'\n\n\nexport class IndexPage extends LitElement {\n  // page events are declared in static property $on\n  static get $on() {\n    return {\n      pageMounted: function(e, page) {\n        console.log('page mounted')\n      },\n      pageInit: function(e, page) {\n        console.log('page init', this.level)\n      } \n    }\n  }\n\n  get level() {\n    // $route, $router, $app, $f7, $theme properties are avaliable in instance \n    return +this.$route.params.level || 0\n  }\n\n  // disables shadow dom\n  createRenderRoot() {\n    return this\n  }\n\n  // lifecycle hooks must be declared with $ prefix\n  $created() {\n    console.log('$created', this.level)\n  }\n\n  $beforeMount() {\n    console.log('$beforeMount', this.level)\n  }\n\nrender() {\n    const level = this.level\n    const message = level ? 'Hello Again' : 'Hello World!'\n    return html`\n      \u003cdiv class=\"navbar\"\u003e\n        \u003cdiv class=\"navbar-inner\"\u003e\n          ${level\n            ? html`\n                \u003cdiv class=\"left\"\u003e\n                  \u003ca href=\"#\" class=\"link icon-only back\"\u003e\n                    \u003ci class=\"icon icon-back\"\u003e\u003c/i\u003e\n                  \u003c/a\u003e\n                \u003c/div\u003e\n              `\n            : ''}\n          \u003cdiv class=\"title\"\u003ePage - Level ${level}\u003c/div\u003e\n        \u003c/div\u003e\n      \u003c/div\u003e\n      \u003cdiv class=\"page-content\"\u003e\n        \u003cdiv class=\"block-title\"\u003e${message}\u003c/div\u003e\n        \u003cdiv class=\"list links-list\"\u003e\n          \u003cul\u003e\n            \u003cli\u003e\n              \u003ca href=\"/my-page/level/${level + 1}\" class=\"next-link\"\u003eNext Page\u003c/a\u003e\n            \u003c/li\u003e\n          \u003c/ul\u003e\n        \u003c/div\u003e\n      \u003c/div\u003e\n    `\n  }\n}\n\ncustomElements.define('index-page', IndexPage)\n```\n\nCreate the app and setup the route\n\n```Javascript\nimport Framework7 from 'wc-f7' // 'wc-f7/bundle' for all components bundled\nimport { IndexPage } from './index/index-page'\n\nconst app = new Framework7({\n  root: '#app',\n  routes: [\n    {\n      path: '/my-page/level/:level',\n      component: IndexPage // or 'index-page'\n    },\n  ],\n})\n\n```\n\nSee [examples](examples) folder for complete apps\n\n---\n\nCopyright © 2019 Luiz Américo Pereira Câmara","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblikblum%2Fwc-f7","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblikblum%2Fwc-f7","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblikblum%2Fwc-f7/lists"}