{"id":24362192,"url":"https://github.com/polymerelements/iron-range-behavior","last_synced_at":"2025-04-10T10:43:39.685Z","repository":{"id":30976879,"uuid":"34535132","full_name":"PolymerElements/iron-range-behavior","owner":"PolymerElements","description":"Managing a numeric value within a given range","archived":false,"fork":false,"pushed_at":"2023-10-16T14:02:54.000Z","size":237,"stargazers_count":8,"open_issues_count":7,"forks_count":16,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-05-09T10:09:33.138Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PolymerElements.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-24T18:34:39.000Z","updated_at":"2024-06-18T15:34:00.532Z","dependencies_parsed_at":"2024-06-18T15:33:52.179Z","dependency_job_id":"6472c2b9-7042-499b-9dd9-0aa3f52d21e2","html_url":"https://github.com/PolymerElements/iron-range-behavior","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-range-behavior","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-range-behavior/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-range-behavior/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-range-behavior/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolymerElements","download_url":"https://codeload.github.com/PolymerElements/iron-range-behavior/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248200310,"owners_count":21063873,"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":[],"created_at":"2025-01-18T22:50:21.552Z","updated_at":"2025-04-10T10:43:39.661Z","avatar_url":"https://github.com/PolymerElements.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Published on NPM](https://img.shields.io/npm/v/@polymer/iron-range-behavior.svg)](https://www.npmjs.com/package/@polymer/iron-range-behavior)\n[![Build status](https://travis-ci.org/PolymerElements/iron-range-behavior.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-range-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/@polymer/iron-range-behavior)\n\n## `IronRangeBehavior`\n\n`IronRangeBehavior` provides the behavior for something with a minimum to\nmaximum range.\n\nSee: [Documentation](https://www.webcomponents.org/element/@polymer/iron-range-behavior),\n  [Demo](https://www.webcomponents.org/element/@polymer/iron-range-behavior/demo/demo/index.html).\n\n## Usage\n\n### Installation\n\n```\nnpm install --save @polymer/iron-range-behavior\n```\n\n### In a Polymer 3 element\n\n```js\nimport {PolymerElement} from '@polymer/polymer/polymer-element.js';\nimport {mixinBehaviors} from '@polymer/polymer/lib/legacy/class.js';\nimport {html} from '@polymer/polymer/lib/utils/html-tag.js';\n\nimport {IronRangeBehavior} from '@polymer/iron-range-behavior/iron-range-behavior.js';\n\nclass SimpleRange extends mixinBehaviors(IronRangeBehavior, PolymerElement) {\n  static get template() {\n    return html`\n      \u003cstyle\u003e\n        :host {\n          display: inline-flex;\n          align-items: center;\n        }\n\n        :host \u003e * {\n          margin: 0.125em;\n        }\n\n        #barContainer {\n          display: inline-block;\n          position: relative;\n          border: 0.125em solid gray;\n          height: 1em;\n          width: 12em;\n        }\n\n        #bar {\n          position: absolute;\n          top: 0.125em;\n          bottom: 0.125em;\n          left: 0.125em;\n          background-color: blue;\n        }\n      \u003c/style\u003e\n\n      \u003cspan\u003e[[ratio]]%\u003c/span\u003e\n      \u003cdiv id=\"barContainer\"\u003e\u003cdiv id=\"bar\" style=\"width: {{ratio}}%;\"\u003e\u003c/div\u003e\u003c/div\u003e\n    `;\n  }\n}\n\ncustomElements.define('simple-range', SimpleRange);\n```\n\nThen, in your HTML:\n\n```html\n\u003csimple-range min=\"0\" max=\"200\" value=\"120\"\u003e\u003c/simple-range\u003e\n```\n\n## Contributing\n\nIf you want to send a PR to this element, here are the instructions for running\nthe tests and demo locally:\n\n### Installation\n\n```sh\ngit clone https://github.com/PolymerElements/iron-range-behavior\ncd iron-range-behavior\nnpm install\nnpm install -g polymer-cli\n```\n\n### Running the demo locally\n\n```sh\npolymer serve --npm\nopen http://127.0.0.1:\u003cport\u003e/demo/\n```\n\n### Running the tests\n\n```sh\npolymer test --npm\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Firon-range-behavior","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolymerelements%2Firon-range-behavior","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Firon-range-behavior/lists"}