{"id":18645646,"url":"https://github.com/fliplet/fliplet-widget-list-repeater","last_synced_at":"2025-09-06T20:40:37.482Z","repository":{"id":71615020,"uuid":"518157732","full_name":"Fliplet/fliplet-widget-list-repeater","owner":"Fliplet","description":"Fliplet Repeated List Widget","archived":false,"fork":false,"pushed_at":"2025-08-27T06:50:39.000Z","size":326,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-27T15:44:46.051Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/Fliplet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2022-07-26T17:33:03.000Z","updated_at":"2025-08-11T11:59:12.000Z","dependencies_parsed_at":"2024-04-03T12:43:00.907Z","dependency_job_id":"e7c14266-cb50-4ef1-9fd2-bb803f3ea153","html_url":"https://github.com/Fliplet/fliplet-widget-list-repeater","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/Fliplet/fliplet-widget-list-repeater","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fliplet%2Ffliplet-widget-list-repeater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fliplet%2Ffliplet-widget-list-repeater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fliplet%2Ffliplet-widget-list-repeater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fliplet%2Ffliplet-widget-list-repeater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fliplet","download_url":"https://codeload.github.com/Fliplet/fliplet-widget-list-repeater/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fliplet%2Ffliplet-widget-list-repeater/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273961510,"owners_count":25198597,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-11-07T06:16:43.970Z","updated_at":"2025-09-06T20:40:37.461Z","avatar_url":"https://github.com/Fliplet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fliplet Data list widget\n\n## Development\n\nThis widget is meant to be used with the Fliplet platform.\n\nRun for local development with the [`fliplet-cli`](https://github.com/Fliplet/fliplet-cli):\n\n```\n$ npm install\n$ npm run watch\n```\n\nYou can also manually build the source code with `npm run build`\n\nThen, keep the watcher running and on a new tab run the following command:\n\n```\n$ fliplet run\n```\n\n---\n# JS APIs\n\nThe following JS APIs are available in a screen once a **Data list** component is dropped into the screen.\n\n## Retrieve an instance\n\nSince you can have many data list components in a screen, we provide a handy function to grab a specific instance by its name or the first one available in the page when no input parameter is given.\n\n### `Fliplet.ListRepeater.get()`\n\nRetrieves the first or a specific Single data record instance.\n\n```js\n// Get the first repeater instance\nFliplet.ListRepeater.get()\n  .then(function (repeater) {\n    // Use repeater object to perform various actions\n  });\n\n// Get the first repeater instance named 'foo'\nFliplet.ListRepeater.get('foo')\n  .then(function (repeater) {\n    // Use repeater object to perform various actions\n  });\n```\n\nThe `container` instance variable above is a `Vue` compatible instance with the following properties available:\n\n- `direction`: `vertical` or `horizontal`\n- `rows`: `Array` from the parent context\n- `el`: DOM Element\n- `template`: the list row template\n\n---\n\n## Retrieve all instances\n\nUse the `getAll` method of the namespace to get all instances at once:\n\n```js\nFliplet.ListRepeater.getAll().then(function (repeaters) {\n  // Use repeaters\n});\n```\n\n---\n\n## Hooks\n\n### repeaterDataRetrieved\n\nUse the `repeaterDataRetrieved` hook to mutate data after it's been retrieved from the Data Source JS APIs:\n\n```js\nFliplet.Hooks.on('repeaterDataRetrieved', function(options) {\n  // options contains \"container\" and \"data\"\n\n  // e.g. mutate the data array/object before it's rendered\n  options.data.push({ Name: 'John' });\n\n  // Return a promise if this callback should be async.\n});\n```\n\n---\n\n### repeaterBeforeRetrieveData\n\nUse the `repeaterBeforeRetrieveData` hook to mutate data before it gets sent to the Data Source JS APIs for querying:\n\n```js\nFliplet.Hooks.on('repeaterBeforeRetrieveData', function(options) {\n  // options contains \"instance\" and \"data\"\n\n  // e.g. mutate the data\n  options.data.where = {\n    Office: 'London';\n  };\n\n  // change limit\n  options.data.limit = 10;\n\n  // Return a promise if this callback should be async.\n});\n```\n\n### repeaterDataRetrieveError\n\nUse the `repeaterDataRetrieveError` hook to handle errors when retrieving data from the Data Source JS APIs:\n\n```js\nFliplet.Hooks.on('repeaterDataRetrieveError', function(result) {\n  // result contains \"instance\" and \"error\"\n  // e.g. show an alert\n});\n```\n\n---\n\n## Add infinite scroll to a list\n\nHere's a simple example on how you can add infinite scroll to a list using a Data container and a list repeater with a limit set up to 10 entries per page.\n\nThe following code will load the next page of the dataset when the user is approaching the end of the screen:\n\n```js\n// Attach a jQuery event on window scroll\n$(window).on('scroll', _.throttle(updatePosition, 200));\n\nfunction updatePosition() {\n  // Check if the user is approaching the end of the screen (200px from the bottom)\n  if ($(window).scrollTop() + $(window).height() \u003e= ($(document).height() - 200)) {\n    loadMore();\n  }\n}\n\n// Function to load the next page of the dataset\nfunction loadMore() {\n  Fliplet.ListRepeater.get().then(function (repeater) {\n    // Move to the next page of the dataset and keep existing entries in the cursor\n    repeater.rows.next().update({ keepExisting: true });\n  });\n}\n```\n\nOn the other hand, if you're paginating a list (e.g. moving the cursor between pages), you may need to manually refresh the data list:\n\n```js\nFliplet.ListRepeater.get().then(function (repeater) {\n  // Move to the next page of the dataset\n  repeater.rows.next().update();\n\n  // Force the repeater to redraw the list\n  repeater.$forceUpdate();\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffliplet%2Ffliplet-widget-list-repeater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffliplet%2Ffliplet-widget-list-repeater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffliplet%2Ffliplet-widget-list-repeater/lists"}