Skip to content

goqoo-on-kintone/kintone-spinner

Repository files navigation

kintone Spinner

A spinning activity indicator for kintone

Install

Direct attachment

Attach following file into kintone app setting

dist/kintone-spinner.min.js

CDN

Attach following URL into kintone app setting (Hosted by jsDelivr)

latest version

https://cdn.jsdelivr.net/npm/kintone-spinner

specific version

https://cdn.jsdelivr.net/npm/kintone-spinner@x.x.x

NPM

$ npm install --save kintone-spinner
 or
$ yarn add kintone-spinner
import Spinner from 'kintone-spinner'

Usage

kintone.events.on('app.record.index.show', event => {
  const spinner = new Spinner()
  document.body.appendChild(spinner.render())

  const button = document.createElement('button')
  button.innerText = 'Spin!'
  button.onclick = async () => {
    const seconds = Number(prompt('Please input seconds', 3))
    if (!seconds) {
      return
    }
    spinner.show()
    await new Promise(resolve => setTimeout(resolve, seconds * 1000))
    spinner.hide()
    alert('Finished!')
  }

  kintone.app.getHeaderMenuSpaceElement().appendChild(button)
})

result

Note

This library uses Spinner of kintone UI Component without React.
https://kintone.github.io/kintone-ui-component/Reference/Spinner/

About

A spinning activity indicator for kintone

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published