{"id":15297071,"url":"https://github.com/radkick/jskick","last_synced_at":"2025-04-13T23:01:29.286Z","repository":{"id":57138600,"uuid":"116611844","full_name":"RADKick/jskick","owner":"RADKick","description":"jskick","archived":false,"fork":false,"pushed_at":"2021-01-21T22:14:20.000Z","size":1589,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T03:07:08.651Z","etag":null,"topics":["angular","angularjs","javascript-framework","rivetjs","tinybind"],"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/RADKick.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-08T00:59:37.000Z","updated_at":"2023-01-31T17:53:57.000Z","dependencies_parsed_at":"2022-09-03T13:42:45.169Z","dependency_job_id":null,"html_url":"https://github.com/RADKick/jskick","commit_stats":null,"previous_names":["radkick/kickjs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RADKick%2Fjskick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RADKick%2Fjskick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RADKick%2Fjskick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RADKick%2Fjskick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RADKick","download_url":"https://codeload.github.com/RADKick/jskick/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794565,"owners_count":21162614,"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":["angular","angularjs","javascript-framework","rivetjs","tinybind"],"created_at":"2024-09-30T19:14:57.762Z","updated_at":"2025-04-13T23:01:29.198Z","avatar_url":"https://github.com/RADKick.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kick\n\nKick is a very small javascript binding library, inspired by rivets, tinybind,  vue and knockout.js\nOriginal Size: 23 KB\nGZIP Size(compressed): 7.5 KB\n\n\njskick or kick is a variation of Rivets.js and tinybind, a lightweight data binding and templating system that facilitates building data-driven views. Inspired by many libraries like angular, react, angular-lite and vuejs. It is agnostic about every aspect of a front-end MV(C|VM|P) stack, making it easy to introduce it into your current workflow or to use it as part of your own custom front-end stack comprised of other libraries.\n\nIf you like short syntax, and symbols for binding html then you will love it.\n\nSee kick in action with the short syntax at https://stackblitz.com/edit/kick-js1\n\nSimple drag drop https://jsfiddle.net/riteshpahwa/ecn1fq6j/\n\nNot so simple drag drop http://jsfiddle.net/riteshpahwa/qym37hbf/119/\n\nToDo MVC with jskick, pay attention to the simple syntax https://stackblitz.com/edit/js-r5mnzv\n\nYou can also run examples (in examples folder) by installing npm i http-server\n\n\n\n## Install\n\n```bash\nnpm install jskick\n```\n\nUse in a script tag...\n\n```html\n\u003cscript src=\"node_modules/jskick/dist/kick.min.js\"\u003e\u003c/script\u003e\n```\n\n... or import using a bundler like webpack\n\n```javascript\nimport kick from 'jskick'\n```\n\n\n## Usage\n\n```html\n\t\t\u003csection id=\"auction\"\u003e\n\t\t\t\u003ch3\u003e{{ product.name }}\u003c/h3\u003e\n\t\t\t\u003cp\u003eCurrent bid: {{ currentBid | money }}\u003c/p\u003e\n\n\t\t\t\u003caside ?=\"timeLeft | lt 120\"\u003e\n\t\t\t\tHurry up! There is {{ timeLeft | time }} left.\n\t\t\t\u003c/aside\u003e\n\n\t\t\t\u003cbutton ^=\"hi(product.name)\" class=\"btn btn-primary\"\u003eSay Hi!\u003c/button\u003e \n\t\t\u003c/section\u003e\n```\n\n```javascript\nvar vm = {\n    currentBid: 250.51, \n    timeLeft: 100, \n    product: {name: 'iPhone'}, \n    hi: function(name) {alert('Kick said hi! your product is ' + name); } \n  };\n\n  kick.formatters.time = function(value){ \n      return value + ' minutes'; \n  }\n  kick.formatters.money = {\n    read: function(value) {\n        return '$' + (value / 100).toFixed(2)\n      },\n      publish: function(value) {\n        return Math.round(parseFloat(value) * 100)\n      }\n  }\n\n  kick.bind('#auction', vm);\n\n```\nView example at https://stackblitz.com/edit/jskick?file=index.html\n\nView ToDo MVC example at https://stackblitz.com/edit/jskick-todo?file=index.html\n\n### Quick Reference for bindings\n| Binder              | Example |\n|---|---|\n| ^ or ^click         |\u0026lt;a ^=\"userClicked()\"\u0026gt;Link\u0026lt;/a\u0026gt;|\n| ^^ or ^dblclick     |\u0026lt;a ^^=\"userDblClicked()\"\u0026gt;Link\u0026lt;/a\u0026gt;|\n| ^_ or ^contextmenu  |\u0026lt;a ^=\"userRightClicked()\"\u0026gt;Link\u0026lt;/a\u0026gt;|\n| ^otherevent         |\u0026lt;a ^mouseover=\"($event)\"\u0026gt;Link\u0026lt;/a\u0026gt;|\n| ^@ or ^change       |\u0026lt;input ^=\"userChanged()\" type=\"text\" @=\"model.property\"\u0026gt;\u0026lt;/input\u0026gt;|\n| ^+ or ^focus        |\u0026lt;input ^+=\"userFocused()\" type=\"text\" @=\"model.property\"\u0026gt;\u0026lt;/input\u0026gt;|\n| ^- or ^blur         |\u0026lt;input ^-=\"userBlurred()\" type=\"text\" @=\"model.property\"\u0026gt;\u0026lt;/input\u0026gt;|\n| @ or @value         |\u0026lt;input type=\"text\" @=\"model.property\"\u0026gt;\u0026lt;/input\u0026gt;)|\n| @x or @checked      |\u0026lt;input type=\"checkbox\" @x=\"model.isChecked\"\u0026gt;\u0026lt;/input\u0026gt;)|\n| @-x or @unchecked   |\u0026lt;input type=\"checkbox\" @-x=\"model.isUnchecked\"\u0026gt;\u0026lt;/input\u0026gt;)|\n| : or :text          |\u0026lt;div :=\"model.textProperty\"\u0026gt;\u0026lt;/div\u0026gt;|\n| :: or :html         |\u0026lt;div ::=\"model.htmlProperty\"\u0026gt;\u0026lt;/div\u0026gt;|\n| $ or :html          |\u0026lt;div $=\"model.htmlProperty\"\u0026gt;\u0026lt;/div\u0026gt;|\n| + or :show          |\u0026lt;div +=\"model.isVisible\"\u0026gt;\u0026lt;/div\u0026gt;|\n| - or :hide          |\u0026lt;div -=\"model.isHidden\"\u0026gt;\u0026lt;/div\u0026gt;|\n| ~ or :disabled      |\u0026lt;input type=\"text\" ~=\"model.isDisabled\"\u0026gt;\u0026lt;/input\u0026gt;|\n| -~ or :enabled      |\u0026lt;input type=\"text\" -~=\"model.isEnabled\"\u0026gt;\u0026lt;/input\u0026gt;|\n| ~~ or :enabled      |\u0026lt;input type=\"text\" ~~=\"model.isEnabled\"\u0026gt;\u0026lt;/input\u0026gt;|\n| **Foreach** || \n| *                   |\u0026lt;div *=\"item in items\"\u0026gt;\u0026lt;div :=\"item.title\"\u0026gt;\u0026lt;/div\u0026gt;\u0026lt;/div\u0026gt;|\n| *                   |\u0026lt;div *item=\"items\"\u0026gt;\u0026lt;div :=\"item.title\"\u0026gt;\u0026lt;/div\u0026gt;\u0026lt;/div\u0026gt;|\n| **Conditionals** || \n| ?                   |\u0026lt;div ?=\"model.ifTrue\"\u0026gt;Hello World!\u0026lt;/div\u0026gt;|\n| -?                  |\u0026lt;div -?=\"model.ifFalse\"\u0026gt;Hello World!\u0026lt;/div\u0026gt;|\n| **Classe** || \n| .                   |\u0026lt;div .bg-primary=\"model.hasBG\"\u0026gt;Hello World!\u0026lt;/div\u0026gt;|\n| -.                  |\u0026lt;div -.bg-primary=\"model.noBG\"\u0026gt;Hello World!\u0026lt;/div\u0026gt;|\n|**Style**|| \n| ..                  |\u0026lt;div ..font-size=\"model.fontSize\"\u0026gt;Added font size style\u0026lt;/div\u0026gt;|\n| -..                 |\u0026lt;div -..font-size=\"model.remFontSize\"\u0026gt;Removed Font size style\u0026lt;/div\u0026gt;|\n\n## Getting Started and Documentation\n\nDocumentation will be (is) available on the [homepage](http://radkick.github.io/jskick/). Learn by reading the [Guide](http://radkick.github.io/jskick/docs/guide/) and refer to the [Binder Reference](http://radkick.github.io/jskick/docs/reference/) to see what binders are available to you out-of-the-box.\n\n## Differences from Rivets.js / tinybind.js\n\n* Public interface\n  * Remove component feature -\u003e incomplete, untested code. Use web components libraries like SkateJs or LitElement\n  * Add not/negate formatter\n  * Remove unless and unchecked binders in favor of combining not/negate formatters with if/checked binders\n  * Remove computed feature - can be replaced by an identity formatter\n  * Add ability to customize input event through event-name attribute\n* Internal changes\n  * Written in ES6 instead of coffeescript\n  * Change how scope of iteration binder works. Instead of copying properties down to children, uses a prototype like approach\n    * Related: [486](https://github.com/mikeric/rivets/issues/486) [512](https://github.com/mikeric/rivets/issues/512) [417](https://github.com/mikeric/rivets/pull/417)\n    * More info in the [documentation](https://radkick.github.io/kick/docs/reference/#each-[item])\n  * Change name of rv-each index property from index to $index\n  * Change how to customize index name in each binder (using an attribute)\n    * Related: [551](https://github.com/mikeric/rivets/issues/551) [552](https://github.com/mikeric/rivets/pull/552)\n  * Do not bind publish, bind and unbind methods to binding instances\n  * Register default binder through fallbackBinder option instead of * binder\n  * Integrate sightglass into kick code base\n  * Remove view.select method\n  * Rename binding property args to arg and changed type from array to string\n  * All binders like :?^ (as it used to be rv-*) attributes are removed after binding\n  * Changes how observer is registered / notified. Instead of passing a function (sync), pass an object with a sync method\n\n\n## Building and Testing\n\nFirst install any development dependencies.\n\n```\n$ npm install\n```\n\n#### Building\n\nkick.js uses rollup as it's bundling / build tool. Run the following to compile the source into `dist/`.\n\n```\n$ npm run build\n```\n\n#### Testing\n\nkick.js uses [mocha](http://visionmedia.github.io/mocha/) as it's testing framework, alongside [should](https://github.com/visionmedia/should.js/) for expectations and [sinon](http://sinonjs.org/) for spies, stubs and mocks. Run the following to run the full test suite.\n\n```\n$ npm test\n```\n\n#### Building documentation\n\nThe documentation is built with [harp](http://harpjs.com/) which must be installed globally\n\n```\n$ cd docs\n$ harp compile _harp ./\n```\n\n\n## Contributing\n\n#### Bug Reporting\n\n1. Ensure the bug can be reproduced on the latest master.\n2. Open an issue on GitHub and include an isolated [JSFiddle](http://jsfiddle.net/) or [Stackblitz](https://stackblitz.com) demonstration of the bug. The more information you provide, the easier it will be to validate and fix.\n\n#### Pull Requests\n\n1. Fork the repository and create a topic branch.\n3. Make sure not to commit any changes under `dist/` as they will surely cause conflicts for others later. Files under `dist/` are only committed when a new build is released.\n4. Include tests that cover any changes or additions that you've made.\n5. Push your topic branch to your fork and submit a pull request. Include details about the changes as well as a reference to related issue(s).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradkick%2Fjskick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fradkick%2Fjskick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradkick%2Fjskick/lists"}