{duration: 0.2, delay: 0.4, timing: 'ease-in'}
[/ja]\n * @param {Function} [options.callback]\n * [en]Function to execute after the dialog has been revealed.[/en]\n * [ja]ダイアログが表示され終わった時に呼び出されるコールバックを指定します。[/ja]\n * @description\n * [en]Show the alert dialog.[/en]\n * [ja]ダイアログを表示します。[/ja]\n * @return {Promise}\n * [en]A `Promise` object that resolves to the displayed element.[/en]\n * [ja]表示される要素を解決する`Promise`オブジェクトを返します。[/ja]\n */\n\n /**\n * @method hide\n * @signature hide([options])\n * @param {Object} [options]\n * [en]Parameter object.[/en]\n * [ja]オプションを指定するオブジェクト。[/ja]\n * @param {String} [options.animation]\n * [en]Animation name. Available animations are `\"fade\"` and `\"none\"`.[/en]\n * [ja]アニメーション名を指定します。\"fade\", \"none\"のいずれかを指定します。[/ja]\n * @param {String} [options.animationOptions]\n * [en]Specify the animation's duration, delay and timing. E.g. {duration: 0.2, delay: 0.4, timing: 'ease-in'}
[/en]\n * [ja]アニメーション時のduration, delay, timingを指定します。e.g. {duration: 0.2, delay: 0.4, timing: 'ease-in'}
[/ja]\n * @param {Function} [options.callback]\n * [en]Function to execute after the dialog has been hidden.[/en]\n * [ja]このダイアログが閉じた時に呼び出されるコールバックを指定します。[/ja]\n * @description\n * [en]Hide the alert dialog.[/en]\n * [ja]ダイアログを閉じます。[/ja]\n * @return {Promise}\n * [en]Resolves to the hidden element[/en]\n * [ja]隠れた要素を解決する`Promise`オブジェクトを返します。[/ja]\n */\n\n /**\n * @property visible\n * @readonly\n * @type {Boolean}\n * @description\n * [en]Whether the dialog is visible or not.[/en]\n * [ja]要素が見える場合に`true`。[/ja]\n */\n\n /**\n * @property onDeviceBackButton\n * @type {Object}\n * @description\n * [en]Back-button handler.[/en]\n * [ja]バックボタンハンドラ。[/ja]\n */\n\n /**\n * @param {String} name\n * @param {DialogAnimator} Animator\n */\n static registerAnimator(name, Animator) {\n if (!(Animator.prototype instanceof AlertDialogAnimator)) {\n util.throwAnimator('AlertDialog');\n }\n _animatorDict[name] = Animator;\n }\n\n static get animators() {\n return _animatorDict;\n }\n\n static get AlertDialogAnimator() {\n return AlertDialogAnimator;\n }\n}\n\nonsElements.AlertDialog = AlertDialogElement;\ncustomElements.define('ons-alert-dialog', AlertDialogElement);\n","/*\nCopyright 2013-2015 ASIAL CORPORATION\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n*/\n\nimport onsElements from '../ons/elements';\nimport BaseButtonElement from './base/base-button';\n\n/**\n * @element ons-alert-dialog-button\n * @modifier material\n * [en]Material Design alert-dialog button.[/en]\n * [ja]マテリアルデザインのボタンを表示します。[/ja]\n * @description\n * [en][/en]\n * [ja][/ja]\n * @seealso ons-alert-dialog\n * [en]The `Some content
\n *Promise
object as an argument. The carousel will not scroll back until the promise has been resolved or rejected.[/en]\n * [ja]この関数はPromiseオブジェクトを引数として受け取ります。渡したPromiseオブジェクトがresolveされるかrejectされるまで、カルーセルはスクロールバックしません。[/ja]\n */\n\n /**\n * @attribute direction\n * @type {String}\n * @description\n * [en]The direction of the carousel. Can be either \"horizontal\" or \"vertical\". Default is \"horizontal\".[/en]\n * [ja]カルーセルの方向を指定します。\"horizontal\"か\"vertical\"を指定できます。\"horizontal\"がデフォルト値です。[/ja]\n */\n\n /**\n * @attribute fullscreen\n * @description\n * [en]If this attribute is set the carousel will cover the whole screen.[/en]\n * [ja]この属性があると、absoluteポジションを使ってカルーセルが自動的に画面いっぱいに広がります。[/ja]\n */\n\n /**\n * @attribute overscrollable\n * @description\n * [en]If this attribute is set the carousel will be scrollable over the edge. It will bounce back when released.[/en]\n * [ja]この属性がある時、タッチやドラッグで端までスクロールした時に、バウンドするような効果が当たります。[/ja]\n */\n\n /**\n * @attribute centered\n * @description\n * [en]If this attribute is set the carousel then the selected item will be in the center of the carousel instead of the beginning. Useful only when the items are smaller than the carousel. [/en]\n * [ja]この属性がある時、選んでいるons-carousel-itemはカルーセルの真ん中へ行きます。項目がカルーセルよりも小さい場合にのみ、これは便利です。[/ja]\n */\n\n /**\n * @attribute item-width\n * @type {String}\n * @description\n * [en]ons-carousel-item's width. Only works when the direction is set to \"horizontal\".[/en]\n * [ja]ons-carousel-itemの幅を指定します。この属性は、direction属性に\"horizontal\"を指定した時のみ有効になります。[/ja]\n */\n\n /**\n * @attribute item-height\n * @type {String}\n * @description\n * [en]ons-carousel-item's height. Only works when the direction is set to \"vertical\".[/en]\n * [ja]ons-carousel-itemの高さを指定します。この属性は、direction属性に\"vertical\"を指定した時のみ有効になります。[/ja]\n */\n\n /**\n * @attribute auto-scroll\n * @description\n * [en]If this attribute is set the carousel will be automatically scrolled to the closest item border when released.[/en]\n * [ja]この属性がある時、一番近いcarousel-itemの境界まで自動的にスクロールするようになります。[/ja]\n */\n\n /**\n * @attribute auto-scroll-ratio\n * @type {Number}\n * @description\n * [en]A number between 0.0 and 1.0 that specifies how much the user must drag the carousel in order for it to auto scroll to the next item.[/en]\n * [ja]0.0から1.0までの値を指定します。カルーセルの要素をどれぐらいの割合までドラッグすると次の要素に自動的にスクロールするかを指定します。[/ja]\n */\n\n /**\n * @attribute swipeable\n * @description\n * [en]If this attribute is set the carousel can be scrolled by drag or swipe.[/en]\n * [ja]この属性がある時、カルーセルをスワイプやドラッグで移動できるようになります。[/ja]\n */\n\n /**\n * @attribute disabled\n * @description\n * [en]If this attribute is set the carousel is disabled.[/en]\n * [ja]この属性がある時、dragやtouchやswipeを受け付けなくなります。[/ja]\n */\n\n /**\n * @attribute initial-index\n * @initonly\n * @default 0\n * @type {Number}\n * @description\n * [en]Specify the index of the ons-carousel-item to show initially. Default is 0.[/en]\n * [ja]最初に表示するons-carousel-itemを0始まりのインデックスで指定します。デフォルト値は 0 です。[/ja]\n */\n\n /**\n * @attribute auto-refresh\n * @description\n * [en]When this attribute is set the carousel will automatically refresh when the number of child nodes change.[/en]\n * [ja]この属性がある時、子要素の数が変わるとカルーセルは自動的に更新されるようになります。[/ja]\n */\n\n /**\n * @attribute animation\n * @type {String}\n * @description\n * [en]If this attribute is set to `\"none\"` the transitions will not be animated.[/en]\n * [ja][/ja]\n */\n\n /**\n * @attribute animation-options\n * @type {Expression}\n * @description\n * [en]Specify the animation's duration, timing and delay with an object literal. E.g. `{duration: 0.2, delay: 1, timing: 'ease-in'}`.[/en]\n * [ja]アニメーション時のduration, timing, delayをオブジェクトリテラルで指定します。例:{duration: 0.2, delay: 1, timing: 'ease-in'}[/ja]\n */\n\n constructor() {\n super();\n\n contentReady(this, () => this._compile());\n }\n\n _compile() {\n const target = this.children[0] && this.children[0].tagName !== 'ONS-CAROUSEL-ITEM' && this.children[0] || document.createElement('div');\n if (!target.parentNode) {\n while (this.firstChild) {\n target.appendChild(this.firstChild);\n }\n this.appendChild(target);\n }\n\n !this.children[1] && this.appendChild(document.createElement('div'));\n\n this.appendChild = this.appendChild.bind(target);\n this.insertBefore = this.insertBefore.bind(target);\n }\n\n connectedCallback() {\n if (!this._swiper) {\n this._swiper = new Swiper({\n getElement: () => this,\n getInitialIndex: () => this.getAttribute('initial-index'),\n getAutoScrollRatio: () => this.autoScrollRatio,\n isVertical: () => this.vertical,\n isOverScrollable: () => this.overscrollable,\n isCentered: () => this.centered,\n isAutoScrollable: () => this.autoScroll,\n itemSize: this.itemSize,\n overScrollHook: this._onOverScroll.bind(this),\n preChangeHook: this._onChange.bind(this, 'prechange'),\n postChangeHook: this._onChange.bind(this, 'postchange'),\n refreshHook: this._onRefresh.bind(this),\n scrollHook: (...args) => this._onSwipe && this._onSwipe(...args)\n });\n\n contentReady(this, () => this._swiper.init({\n swipeable: this.hasAttribute('swipeable'),\n autoRefresh: this.hasAttribute('auto-refresh')\n }));\n }\n }\n\n disconnectedCallback() {\n if (this._swiper && this._swiper.initialized) {\n this._swiper.dispose();\n this._swiper = null;\n }\n }\n\n static get observedAttributes() {\n return ['swipeable', 'auto-refresh', 'direction', 'item-height', 'item-width'];\n }\n\n attributeChangedCallback(name, last, current) {\n if (!this._swiper) {\n return;\n }\n\n switch (name) {\n case 'swipeable':\n this._swiper.updateSwipeable(this.hasAttribute('swipeable'));\n break;\n case 'auto-refresh':\n this._swiper.updateAutoRefresh(this.hasAttribute('auto-refresh'));\n break;\n case 'item-height':\n this.vertical && this._swiper.updateItemSize(this.itemSize);\n break;\n case 'item-width':\n this.vertical || this._swiper.updateItemSize(this.itemSize);\n break;\n case 'direction':\n this._swiper.refresh();\n }\n }\n\n _show() {\n this._swiper.show();\n }\n\n _hide() {\n this._swiper.hide();\n }\n\n _onOverScroll({ direction, killOverScroll }) {\n let waitForAction = false;\n util.triggerElementEvent(this, 'overscroll', {\n carousel: this,\n activeIndex: this.getActiveIndex(),\n direction,\n waitToReturn: promise => {\n waitForAction = true;\n promise.then(killOverScroll);\n }\n });\n\n return waitForAction;\n }\n\n _onChange(eventName, { activeIndex, lastActiveIndex }) {\n util.triggerElementEvent(this, eventName, { carousel: this, activeIndex, lastActiveIndex });\n }\n\n _onRefresh() {\n util.triggerElementEvent(this, 'refresh', { carousel: this });\n }\n\n /**\n * @method setActiveIndex\n * @signature setActiveIndex(index, [options])\n * @param {Number} index\n * [en]The index that the carousel should be set to.[/en]\n * [ja]carousel要素のインデックスを指定します。[/ja]\n * @param {Object} [options]\n * [en]Parameter object.[/en]\n * [ja][/ja]\n * @param {Function} [options.callback]\n * [en]A function that will be called after the animation is finished.[/en]\n * [ja][/ja]\n * @param {String} [options.animation]\n * [en]If this attribute is set to `\"none\"` the transitions will not be animated.[/en]\n * [ja][/ja]\n * @param {Object} [options.animationOptions]\n * [en]An object that can be used to specify duration, delay and timing function of the animation.[/en]\n * [ja][/ja]\n * @description\n * [en]Specify the index of the `This is a dialog!
\n *