fix(): update to Stencil One 🎉🎊

This commit is contained in:
Manu MA
2019-06-19 21:33:50 +02:00
committed by GitHub
parent 7f1829eb21
commit b40f7d36d5
572 changed files with 14426 additions and 9916 deletions

View File

@ -1,6 +1,7 @@
import { Component, ComponentInterface, Element, Event, EventEmitter, Prop, QueueApi, Watch } from '@stencil/core';
import { Component, ComponentInterface, Element, Event, EventEmitter, Prop, QueueApi, Watch, h } from '@stencil/core';
import { Gesture, GestureDetail, Mode, PickerColumn } from '../../interface';
import { getIonMode } from '../../global/ionic-global';
import { Gesture, GestureDetail, PickerColumn } from '../../interface';
import { hapticSelectionChanged } from '../../utils/haptic';
import { clamp } from '../../utils/helpers';
@ -15,7 +16,6 @@ import { clamp } from '../../utils/helpers';
}
})
export class PickerColumnCmp implements ComponentInterface {
mode!: Mode;
private bounceFrom!: number;
private lastIndex?: number;
@ -53,7 +53,9 @@ export class PickerColumnCmp implements ComponentInterface {
let pickerRotateFactor = 0;
let pickerScaleFactor = 0.81;
if (this.mode === 'ios') {
const mode = getIonMode(this);
if (mode === 'ios') {
pickerRotateFactor = -0.46;
pickerScaleFactor = 1;
}
@ -73,7 +75,6 @@ export class PickerColumnCmp implements ComponentInterface {
this.gesture = (await import('../../utils/gesture')).createGesture({
el: this.el,
queue: this.queue,
gestureName: 'picker-swipe',
gesturePriority: 100,
threshold: 0,
@ -347,9 +348,10 @@ export class PickerColumnCmp implements ComponentInterface {
}
hostData() {
const mode = getIonMode(this);
return {
class: {
[`${this.mode}`]: true,
[`${mode}`]: true,
'picker-col': true,
'picker-opts-left': this.col.align === 'left',
'picker-opts-right': this.col.align === 'right'

View File

@ -8,8 +8,8 @@
<link href="../../../../../css/core.css" rel="stylesheet">
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet">
<script src="../../../../../scripts/testing/scripts.js"></script>
<script src="../../../../../dist/ionic.js"></script>
</head>
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script></head>
<body>
<ion-picker-controller></ion-picker-controller>
@ -26,7 +26,7 @@
'Chinchilla'
]
]
const multiColumnOptions = [
[
'Minified',
@ -43,7 +43,7 @@
'Artichoke'
]
]
async function openPicker(numColumns = 1, numOptions = 5, columnOptions = defaultColumnOptions) {
const picker = await pickerController.create({
columns: this.getColumns(numColumns, numOptions, columnOptions),
@ -56,14 +56,14 @@
text: 'Confirm',
handler: (value) => {
console.log(`Got Value ${value}`);
}
}
}
]
});
await picker.present();
}
function getColumns(numColumns, numOptions, columnOptions) {
let columns = [];
for (let i = 0; i < numColumns; i++) {
@ -72,10 +72,10 @@
options: this.getColumnOptions(i, numOptions, columnOptions)
});
}
return columns;
}
function getColumnOptions(columnIndex, numOptions, columnOptions) {
let options = [];
for (let i = 0; i < numOptions; i++) {
@ -84,7 +84,7 @@
value: i
})
}
return options;
}
</script>