fix(omim/slider): support input event

This commit is contained in:
dntzhang 2020-05-26 08:54:43 +08:00
parent 01ee7c9ae1
commit 7b7afeef2c
5 changed files with 113 additions and 81 deletions

View File

@ -67,7 +67,7 @@ export default class ColorPicker extends WeElement<Props> {
width: StringConstructor;
};
installed(): void;
setColor(color: any): any;
setColor(color: any): boolean;
render(props: any): JSX.Element;
}
export {};

View File

@ -96,10 +96,10 @@ return /******/ (function(modules) { // webpackBootstrap
/************************************************************************/
/******/ ({
/***/ "./node_modules/@material/animation/util.js":
/*!**************************************************!*\
!*** ./node_modules/@material/animation/util.js ***!
\**************************************************/
/***/ "./node_modules/_@material_animation@1.0.0@@material/animation/util.js":
/*!*****************************************************************************!*\
!*** ./node_modules/_@material_animation@1.0.0@@material/animation/util.js ***!
\*****************************************************************************/
/*! exports provided: getCorrectPropertyName, getCorrectEventName */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
@ -190,18 +190,18 @@ function getCorrectEventName(windowObj, eventType) {
/***/ }),
/***/ "./node_modules/@material/base/component.js":
/*!**************************************************!*\
!*** ./node_modules/@material/base/component.js ***!
\**************************************************/
/***/ "./node_modules/_@material_base@1.0.0@@material/base/component.js":
/*!************************************************************************!*\
!*** ./node_modules/_@material_base@1.0.0@@material/base/component.js ***!
\************************************************************************/
/*! exports provided: MDCComponent, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCComponent", function() { return MDCComponent; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _foundation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation */ "./node_modules/@material/base/foundation.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
/* harmony import */ var _foundation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation */ "./node_modules/_@material_base@1.0.0@@material/base/foundation.js");
/**
* @license
* Copyright 2016 Google Inc.
@ -307,10 +307,10 @@ var MDCComponent = /** @class */ (function () {
/***/ }),
/***/ "./node_modules/@material/base/foundation.js":
/*!***************************************************!*\
!*** ./node_modules/@material/base/foundation.js ***!
\***************************************************/
/***/ "./node_modules/_@material_base@1.0.0@@material/base/foundation.js":
/*!*************************************************************************!*\
!*** ./node_modules/_@material_base@1.0.0@@material/base/foundation.js ***!
\*************************************************************************/
/*! exports provided: MDCFoundation, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
@ -396,20 +396,20 @@ var MDCFoundation = /** @class */ (function () {
/***/ }),
/***/ "./node_modules/@material/slider/component.js":
/*!****************************************************!*\
!*** ./node_modules/@material/slider/component.js ***!
\****************************************************/
/***/ "./node_modules/_@material_slider@1.1.0@@material/slider/component.js":
/*!****************************************************************************!*\
!*** ./node_modules/_@material_slider@1.1.0@@material/slider/component.js ***!
\****************************************************************************/
/*! exports provided: MDCSlider */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSlider", function() { return MDCSlider; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _material_base_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @material/base/component */ "./node_modules/@material/base/component.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants */ "./node_modules/@material/slider/constants.js");
/* harmony import */ var _foundation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation */ "./node_modules/@material/slider/foundation.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
/* harmony import */ var _material_base_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @material/base/component */ "./node_modules/_@material_base@1.0.0@@material/base/component.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants */ "./node_modules/_@material_slider@1.1.0@@material/slider/constants.js");
/* harmony import */ var _foundation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation */ "./node_modules/_@material_slider@1.1.0@@material/slider/foundation.js");
/**
* @license
* Copyright 2017 Google Inc.
@ -600,10 +600,10 @@ var MDCSlider = /** @class */ (function (_super) {
/***/ }),
/***/ "./node_modules/@material/slider/constants.js":
/*!****************************************************!*\
!*** ./node_modules/@material/slider/constants.js ***!
\****************************************************/
/***/ "./node_modules/_@material_slider@1.1.0@@material/slider/constants.js":
/*!****************************************************************************!*\
!*** ./node_modules/_@material_slider@1.1.0@@material/slider/constants.js ***!
\****************************************************************************/
/*! exports provided: cssClasses, strings, numbers */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
@ -665,20 +665,20 @@ var numbers = {
/***/ }),
/***/ "./node_modules/@material/slider/foundation.js":
/*!*****************************************************!*\
!*** ./node_modules/@material/slider/foundation.js ***!
\*****************************************************/
/***/ "./node_modules/_@material_slider@1.1.0@@material/slider/foundation.js":
/*!*****************************************************************************!*\
!*** ./node_modules/_@material_slider@1.1.0@@material/slider/foundation.js ***!
\*****************************************************************************/
/*! exports provided: MDCSliderFoundation, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSliderFoundation", function() { return MDCSliderFoundation; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _material_animation_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @material/animation/util */ "./node_modules/@material/animation/util.js");
/* harmony import */ var _material_base_foundation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @material/base/foundation */ "./node_modules/@material/base/foundation.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./node_modules/@material/slider/constants.js");
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
/* harmony import */ var _material_animation_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @material/animation/util */ "./node_modules/_@material_animation@1.0.0@@material/animation/util.js");
/* harmony import */ var _material_base_foundation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @material/base/foundation */ "./node_modules/_@material_base@1.0.0@@material/base/foundation.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./node_modules/_@material_slider@1.1.0@@material/slider/constants.js");
/**
* @license
* Copyright 2017 Google Inc.
@ -1175,19 +1175,19 @@ var MDCSliderFoundation = /** @class */ (function (_super) {
/***/ }),
/***/ "./node_modules/@material/slider/index.js":
/*!************************************************!*\
!*** ./node_modules/@material/slider/index.js ***!
\************************************************/
/***/ "./node_modules/_@material_slider@1.1.0@@material/slider/index.js":
/*!************************************************************************!*\
!*** ./node_modules/_@material_slider@1.1.0@@material/slider/index.js ***!
\************************************************************************/
/*! exports provided: MDCSlider, MDCSliderFoundation */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./component */ "./node_modules/@material/slider/component.js");
/* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./component */ "./node_modules/_@material_slider@1.1.0@@material/slider/component.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MDCSlider", function() { return _component__WEBPACK_IMPORTED_MODULE_0__["MDCSlider"]; });
/* harmony import */ var _foundation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation */ "./node_modules/@material/slider/foundation.js");
/* harmony import */ var _foundation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation */ "./node_modules/_@material_slider@1.1.0@@material/slider/foundation.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MDCSliderFoundation", function() { return _foundation__WEBPACK_IMPORTED_MODULE_1__["MDCSliderFoundation"]; });
/**
@ -1218,14 +1218,14 @@ __webpack_require__.r(__webpack_exports__);
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/dist/cjs.js?!./src/slider/index.scss":
/*!********************************************************************************************************************************************!*\
!*** ./node_modules/css-loader!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/slider/index.scss ***!
\********************************************************************************************************************************************/
/***/ "./node_modules/_css-loader@1.0.1@css-loader/index.js!./node_modules/_resolve-url-loader@3.1.1@resolve-url-loader/index.js!./node_modules/_sass-loader@7.3.1@sass-loader/dist/cjs.js?!./src/slider/index.scss":
/*!***********************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/_css-loader@1.0.1@css-loader!./node_modules/_resolve-url-loader@3.1.1@resolve-url-loader!./node_modules/_sass-loader@7.3.1@sass-loader/dist/cjs.js??ref--4-3!./src/slider/index.scss ***!
\***********************************************************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(/*! ../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false);
exports = module.exports = __webpack_require__(/*! ../../node_modules/_css-loader@1.0.1@css-loader/lib/css-base.js */ "./node_modules/_css-loader@1.0.1@css-loader/lib/css-base.js")(false);
// imports
@ -1237,10 +1237,10 @@ exports.push([module.i, "@keyframes mdc-slider-emphasize {\n 0% {\n animatio
/***/ }),
/***/ "./node_modules/css-loader/lib/css-base.js":
/*!*************************************************!*\
!*** ./node_modules/css-loader/lib/css-base.js ***!
\*************************************************/
/***/ "./node_modules/_css-loader@1.0.1@css-loader/lib/css-base.js":
/*!*******************************************************************!*\
!*** ./node_modules/_css-loader@1.0.1@css-loader/lib/css-base.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
@ -1324,11 +1324,11 @@ function toComment(sourceMap) {
/***/ }),
/***/ "./node_modules/tslib/tslib.es6.js":
/*!*****************************************!*\
!*** ./node_modules/tslib/tslib.es6.js ***!
\*****************************************/
/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
/***/ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js":
/*!*******************************************************!*\
!*** ./node_modules/_tslib@1.13.0@tslib/tslib.es6.js ***!
\*******************************************************/
/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@ -1341,6 +1341,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__createBinding", function() { return __createBinding; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
@ -1353,19 +1354,21 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; });
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
Copyright (c) Microsoft Corporation.
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */
@ -1421,10 +1424,11 @@ function __metadata(metadataKey, metadataValue) {
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
@ -1457,19 +1461,25 @@ function __generator(thisArg, body) {
}
}
function __createBinding(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}
function __exportStar(m, exports) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
}
function __values(o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
return {
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
@ -1549,6 +1559,21 @@ function __importStar(mod) {
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
function __classPrivateFieldGet(receiver, privateMap) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to get private field on non-instance");
}
return privateMap.get(receiver);
}
function __classPrivateFieldSet(receiver, privateMap, value) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to set private field on non-instance");
}
privateMap.set(receiver, value);
return value;
}
/***/ }),
@ -1561,7 +1586,7 @@ function __importDefault(mod) {
/***/ (function(module, exports, __webpack_require__) {
var result = __webpack_require__(/*! !../../node_modules/css-loader!../../node_modules/resolve-url-loader!../../node_modules/sass-loader/dist/cjs.js??ref--4-3!./index.scss */ "./node_modules/css-loader/index.js!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/dist/cjs.js?!./src/slider/index.scss");
var result = __webpack_require__(/*! !../../node_modules/_css-loader@1.0.1@css-loader!../../node_modules/_resolve-url-loader@3.1.1@resolve-url-loader!../../node_modules/_sass-loader@7.3.1@sass-loader/dist/cjs.js??ref--4-3!./index.scss */ "./node_modules/_css-loader@1.0.1@css-loader/index.js!./node_modules/_resolve-url-loader@3.1.1@resolve-url-loader/index.js!./node_modules/_sass-loader@7.3.1@sass-loader/dist/cjs.js?!./src/slider/index.scss");
if (typeof result === "string") {
module.exports = result;
@ -1614,7 +1639,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
Object.defineProperty(exports, "__esModule", { value: true });
var omi_1 = __webpack_require__(/*! omi */ "omi");
var css = __webpack_require__(/*! ./index.scss */ "./src/slider/index.scss");
var slider_1 = __webpack_require__(/*! @material/slider */ "./node_modules/@material/slider/index.js");
var slider_1 = __webpack_require__(/*! @material/slider */ "./node_modules/_@material_slider@1.1.0@@material/slider/index.js");
//@ts-ignore
__webpack_require__(/*! ../theme.ts */ "./src/theme.ts");
var Slider = /** @class */ (function (_super) {
@ -1628,6 +1653,9 @@ var Slider = /** @class */ (function (_super) {
slider.listen('MDCSlider:change', function () {
_this.fire('change', { value: slider.value });
});
slider.listen('MDCSlider:input', function () {
_this.fire('input', { value: slider.value });
});
};
Slider.prototype.render = function (props) {
var count = (props.max - props.min) / props.step;

File diff suppressed because one or more lines are too long

View File

@ -42,6 +42,10 @@ export default class Slider extends WeElement<Props>{
slider.listen('MDCSlider:change', () => {
this.fire('change', { value: slider.value })
});
slider.listen('MDCSlider:input', () => {
this.fire('input', { value: slider.value })
});
}
render(props) {

View File

@ -16,17 +16,17 @@ export default class Table extends WeElement<Props> {
_changeHandlerTd: (e: any, item: any) => void;
beforeRender(): void;
_getCheckedState(): {
'indeterminate': boolean;
'unchecked'?: undefined;
'checked'?: undefined;
indeterminate: boolean;
unchecked?: undefined;
checked?: undefined;
} | {
'unchecked': boolean;
'indeterminate'?: undefined;
'checked'?: undefined;
unchecked: boolean;
indeterminate?: undefined;
checked?: undefined;
} | {
'checked': boolean;
'indeterminate'?: undefined;
'unchecked'?: undefined;
checked: boolean;
indeterminate?: undefined;
unchecked?: undefined;
};
render(props: any): JSX.Element;
}