diff --git a/packages/demo/.editorconfig b/packages/demo/.editorconfig new file mode 100644 index 000000000..16a029ac9 --- /dev/null +++ b/packages/demo/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Tab indentation +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/demo/.eslintignore b/packages/demo/.eslintignore new file mode 100644 index 000000000..0bf03dc20 --- /dev/null +++ b/packages/demo/.eslintignore @@ -0,0 +1,8 @@ +.idea/ +.vscode/ +.theia/ +.recore/ +build/ +.* +~* +node_modules diff --git a/packages/demo/.eslintrc b/packages/demo/.eslintrc new file mode 100644 index 000000000..db78d35d1 --- /dev/null +++ b/packages/demo/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/@recore/config/.eslintrc" +} diff --git a/packages/demo/.gitignore b/packages/demo/.gitignore new file mode 100644 index 000000000..5261403b4 --- /dev/null +++ b/packages/demo/.gitignore @@ -0,0 +1,40 @@ +node_modules/ +coverage/ +build/ +dist/ +.idea/ +.vscode/ +.theia/ +.recore/ +~* +package-lock.json + +# Packages # +############ +# it's better to unpack these files and commit the raw source +# git has its own built in compression methods +*.7z +*.dmg +*.gz +*.iso +*.jar +*.rar +*.tar +*.zip + +# Logs and databases # +###################### +*.log +*.sql +*.sqlite + +# OS generated files # +###################### +.DS_Store +.Trash* +*.swp +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db diff --git a/packages/demo/.prettierrc b/packages/demo/.prettierrc new file mode 100644 index 000000000..8748c5ed3 --- /dev/null +++ b/packages/demo/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": true, + "singleQuote": true, + "printWidth": 120, + "trailingComma": "all" +} diff --git a/packages/demo/README.md b/packages/demo/README.md new file mode 100644 index 000000000..c65f630e7 --- /dev/null +++ b/packages/demo/README.md @@ -0,0 +1,34 @@ +# demo + +A Recore application demo. + +## Recore 文档 + +https://yuque.antfin-inc.com/recore/docs + +## DEEP 物料站点 + +https://fusion.alibaba-inc.com/deep/ + +## 安装运行 + +```bash +# 安装依赖 +tnpm install + +# 启动调试 +npm start + +# 本地构建(一般来说不需要) +npm run build + +# 日常部署:将资源发布到日常 CDN +npm run deploy + +# 线上部署:将资源发布到线上 CDN +npm run deploy:online +``` + +## 项目发布 + +集团的前端项目发布全部收口到 def 工程研发平台,如果之前没有使用过,请先阅读此文档:https://yuque.antfin-inc.com/xux/docs/rmsztg diff --git a/packages/demo/abc.json b/packages/demo/abc.json new file mode 100644 index 000000000..cdeb3bd43 --- /dev/null +++ b/packages/demo/abc.json @@ -0,0 +1,12 @@ +{ + "name": "demo", + "assets": { + "type": "command", + "command": { + "cmd": [ + "tnpm ii", + "tnpm run cloud" + ] + } + } +} diff --git a/packages/demo/index.html b/packages/demo/index.html new file mode 100644 index 000000000..55245687e --- /dev/null +++ b/packages/demo/index.html @@ -0,0 +1,27 @@ + + + + + + demo + + + + + + + + + + + + + + + + + diff --git a/packages/demo/lowcode-renderer.js b/packages/demo/lowcode-renderer.js new file mode 100644 index 000000000..f2197e12b --- /dev/null +++ b/packages/demo/lowcode-renderer.js @@ -0,0 +1,192782 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ function hotDisposeChunk(chunkId) { +/******/ delete installedChunks[chunkId]; +/******/ } +/******/ var parentHotUpdateCallback = window["webpackHotUpdate"]; +/******/ window["webpackHotUpdate"] = // eslint-disable-next-line no-unused-vars +/******/ function webpackHotUpdateCallback(chunkId, moreModules) { +/******/ hotAddUpdateChunk(chunkId, moreModules); +/******/ if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules); +/******/ } ; +/******/ +/******/ // eslint-disable-next-line no-unused-vars +/******/ function hotDownloadUpdateChunk(chunkId) { +/******/ var script = document.createElement("script"); +/******/ script.charset = "utf-8"; +/******/ script.src = __webpack_require__.p + "" + chunkId + "." + hotCurrentHash + ".hot-update.js"; +/******/ if (null) script.crossOrigin = null; +/******/ document.head.appendChild(script); +/******/ } +/******/ +/******/ // eslint-disable-next-line no-unused-vars +/******/ function hotDownloadManifest(requestTimeout) { +/******/ requestTimeout = requestTimeout || 10000; +/******/ return new Promise(function(resolve, reject) { +/******/ if (typeof XMLHttpRequest === "undefined") { +/******/ return reject(new Error("No browser support")); +/******/ } +/******/ try { +/******/ var request = new XMLHttpRequest(); +/******/ var requestPath = __webpack_require__.p + "" + hotCurrentHash + ".hot-update.json"; +/******/ request.open("GET", requestPath, true); +/******/ request.timeout = requestTimeout; +/******/ request.send(null); +/******/ } catch (err) { +/******/ return reject(err); +/******/ } +/******/ request.onreadystatechange = function() { +/******/ if (request.readyState !== 4) return; +/******/ if (request.status === 0) { +/******/ // timeout +/******/ reject( +/******/ new Error("Manifest request to " + requestPath + " timed out.") +/******/ ); +/******/ } else if (request.status === 404) { +/******/ // no update available +/******/ resolve(); +/******/ } else if (request.status !== 200 && request.status !== 304) { +/******/ // other failure +/******/ reject(new Error("Manifest request to " + requestPath + " failed.")); +/******/ } else { +/******/ // success +/******/ try { +/******/ var update = JSON.parse(request.responseText); +/******/ } catch (e) { +/******/ reject(e); +/******/ return; +/******/ } +/******/ resolve(update); +/******/ } +/******/ }; +/******/ }); +/******/ } +/******/ +/******/ var hotApplyOnUpdate = true; +/******/ // eslint-disable-next-line no-unused-vars +/******/ var hotCurrentHash = "755cc43831c2f5e0544c"; +/******/ var hotRequestTimeout = 10000; +/******/ var hotCurrentModuleData = {}; +/******/ var hotCurrentChildModule; +/******/ // eslint-disable-next-line no-unused-vars +/******/ var hotCurrentParents = []; +/******/ // eslint-disable-next-line no-unused-vars +/******/ var hotCurrentParentsTemp = []; +/******/ +/******/ // eslint-disable-next-line no-unused-vars +/******/ function hotCreateRequire(moduleId) { +/******/ var me = installedModules[moduleId]; +/******/ if (!me) return __webpack_require__; +/******/ var fn = function(request) { +/******/ if (me.hot.active) { +/******/ if (installedModules[request]) { +/******/ if (installedModules[request].parents.indexOf(moduleId) === -1) { +/******/ installedModules[request].parents.push(moduleId); +/******/ } +/******/ } else { +/******/ hotCurrentParents = [moduleId]; +/******/ hotCurrentChildModule = request; +/******/ } +/******/ if (me.children.indexOf(request) === -1) { +/******/ me.children.push(request); +/******/ } +/******/ } else { +/******/ console.warn( +/******/ "[HMR] unexpected require(" + +/******/ request + +/******/ ") from disposed module " + +/******/ moduleId +/******/ ); +/******/ hotCurrentParents = []; +/******/ } +/******/ return __webpack_require__(request); +/******/ }; +/******/ var ObjectFactory = function ObjectFactory(name) { +/******/ return { +/******/ configurable: true, +/******/ enumerable: true, +/******/ get: function() { +/******/ return __webpack_require__[name]; +/******/ }, +/******/ set: function(value) { +/******/ __webpack_require__[name] = value; +/******/ } +/******/ }; +/******/ }; +/******/ for (var name in __webpack_require__) { +/******/ if ( +/******/ Object.prototype.hasOwnProperty.call(__webpack_require__, name) && +/******/ name !== "e" && +/******/ name !== "t" +/******/ ) { +/******/ Object.defineProperty(fn, name, ObjectFactory(name)); +/******/ } +/******/ } +/******/ fn.e = function(chunkId) { +/******/ if (hotStatus === "ready") hotSetStatus("prepare"); +/******/ hotChunksLoading++; +/******/ return __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) { +/******/ finishChunkLoading(); +/******/ throw err; +/******/ }); +/******/ +/******/ function finishChunkLoading() { +/******/ hotChunksLoading--; +/******/ if (hotStatus === "prepare") { +/******/ if (!hotWaitingFilesMap[chunkId]) { +/******/ hotEnsureUpdateChunk(chunkId); +/******/ } +/******/ if (hotChunksLoading === 0 && hotWaitingFiles === 0) { +/******/ hotUpdateDownloaded(); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ fn.t = function(value, mode) { +/******/ if (mode & 1) value = fn(value); +/******/ return __webpack_require__.t(value, mode & ~1); +/******/ }; +/******/ return fn; +/******/ } +/******/ +/******/ // eslint-disable-next-line no-unused-vars +/******/ function hotCreateModule(moduleId) { +/******/ var hot = { +/******/ // private stuff +/******/ _acceptedDependencies: {}, +/******/ _declinedDependencies: {}, +/******/ _selfAccepted: false, +/******/ _selfDeclined: false, +/******/ _disposeHandlers: [], +/******/ _main: hotCurrentChildModule !== moduleId, +/******/ +/******/ // Module API +/******/ active: true, +/******/ accept: function(dep, callback) { +/******/ if (dep === undefined) hot._selfAccepted = true; +/******/ else if (typeof dep === "function") hot._selfAccepted = dep; +/******/ else if (typeof dep === "object") +/******/ for (var i = 0; i < dep.length; i++) +/******/ hot._acceptedDependencies[dep[i]] = callback || function() {}; +/******/ else hot._acceptedDependencies[dep] = callback || function() {}; +/******/ }, +/******/ decline: function(dep) { +/******/ if (dep === undefined) hot._selfDeclined = true; +/******/ else if (typeof dep === "object") +/******/ for (var i = 0; i < dep.length; i++) +/******/ hot._declinedDependencies[dep[i]] = true; +/******/ else hot._declinedDependencies[dep] = true; +/******/ }, +/******/ dispose: function(callback) { +/******/ hot._disposeHandlers.push(callback); +/******/ }, +/******/ addDisposeHandler: function(callback) { +/******/ hot._disposeHandlers.push(callback); +/******/ }, +/******/ removeDisposeHandler: function(callback) { +/******/ var idx = hot._disposeHandlers.indexOf(callback); +/******/ if (idx >= 0) hot._disposeHandlers.splice(idx, 1); +/******/ }, +/******/ +/******/ // Management API +/******/ check: hotCheck, +/******/ apply: hotApply, +/******/ status: function(l) { +/******/ if (!l) return hotStatus; +/******/ hotStatusHandlers.push(l); +/******/ }, +/******/ addStatusHandler: function(l) { +/******/ hotStatusHandlers.push(l); +/******/ }, +/******/ removeStatusHandler: function(l) { +/******/ var idx = hotStatusHandlers.indexOf(l); +/******/ if (idx >= 0) hotStatusHandlers.splice(idx, 1); +/******/ }, +/******/ +/******/ //inherit from previous dispose call +/******/ data: hotCurrentModuleData[moduleId] +/******/ }; +/******/ hotCurrentChildModule = undefined; +/******/ return hot; +/******/ } +/******/ +/******/ var hotStatusHandlers = []; +/******/ var hotStatus = "idle"; +/******/ +/******/ function hotSetStatus(newStatus) { +/******/ hotStatus = newStatus; +/******/ for (var i = 0; i < hotStatusHandlers.length; i++) +/******/ hotStatusHandlers[i].call(null, newStatus); +/******/ } +/******/ +/******/ // while downloading +/******/ var hotWaitingFiles = 0; +/******/ var hotChunksLoading = 0; +/******/ var hotWaitingFilesMap = {}; +/******/ var hotRequestedFilesMap = {}; +/******/ var hotAvailableFilesMap = {}; +/******/ var hotDeferred; +/******/ +/******/ // The update info +/******/ var hotUpdate, hotUpdateNewHash; +/******/ +/******/ function toModuleId(id) { +/******/ var isNumber = +id + "" === id; +/******/ return isNumber ? +id : id; +/******/ } +/******/ +/******/ function hotCheck(apply) { +/******/ if (hotStatus !== "idle") { +/******/ throw new Error("check() is only allowed in idle status"); +/******/ } +/******/ hotApplyOnUpdate = apply; +/******/ hotSetStatus("check"); +/******/ return hotDownloadManifest(hotRequestTimeout).then(function(update) { +/******/ if (!update) { +/******/ hotSetStatus("idle"); +/******/ return null; +/******/ } +/******/ hotRequestedFilesMap = {}; +/******/ hotWaitingFilesMap = {}; +/******/ hotAvailableFilesMap = update.c; +/******/ hotUpdateNewHash = update.h; +/******/ +/******/ hotSetStatus("prepare"); +/******/ var promise = new Promise(function(resolve, reject) { +/******/ hotDeferred = { +/******/ resolve: resolve, +/******/ reject: reject +/******/ }; +/******/ }); +/******/ hotUpdate = {}; +/******/ var chunkId = "index"; +/******/ // eslint-disable-next-line no-lone-blocks +/******/ { +/******/ /*globals chunkId */ +/******/ hotEnsureUpdateChunk(chunkId); +/******/ } +/******/ if ( +/******/ hotStatus === "prepare" && +/******/ hotChunksLoading === 0 && +/******/ hotWaitingFiles === 0 +/******/ ) { +/******/ hotUpdateDownloaded(); +/******/ } +/******/ return promise; +/******/ }); +/******/ } +/******/ +/******/ // eslint-disable-next-line no-unused-vars +/******/ function hotAddUpdateChunk(chunkId, moreModules) { +/******/ if (!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId]) +/******/ return; +/******/ hotRequestedFilesMap[chunkId] = false; +/******/ for (var moduleId in moreModules) { +/******/ if (Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { +/******/ hotUpdate[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if (--hotWaitingFiles === 0 && hotChunksLoading === 0) { +/******/ hotUpdateDownloaded(); +/******/ } +/******/ } +/******/ +/******/ function hotEnsureUpdateChunk(chunkId) { +/******/ if (!hotAvailableFilesMap[chunkId]) { +/******/ hotWaitingFilesMap[chunkId] = true; +/******/ } else { +/******/ hotRequestedFilesMap[chunkId] = true; +/******/ hotWaitingFiles++; +/******/ hotDownloadUpdateChunk(chunkId); +/******/ } +/******/ } +/******/ +/******/ function hotUpdateDownloaded() { +/******/ hotSetStatus("ready"); +/******/ var deferred = hotDeferred; +/******/ hotDeferred = null; +/******/ if (!deferred) return; +/******/ if (hotApplyOnUpdate) { +/******/ // Wrap deferred object in Promise to mark it as a well-handled Promise to +/******/ // avoid triggering uncaught exception warning in Chrome. +/******/ // See https://bugs.chromium.org/p/chromium/issues/detail?id=465666 +/******/ Promise.resolve() +/******/ .then(function() { +/******/ return hotApply(hotApplyOnUpdate); +/******/ }) +/******/ .then( +/******/ function(result) { +/******/ deferred.resolve(result); +/******/ }, +/******/ function(err) { +/******/ deferred.reject(err); +/******/ } +/******/ ); +/******/ } else { +/******/ var outdatedModules = []; +/******/ for (var id in hotUpdate) { +/******/ if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { +/******/ outdatedModules.push(toModuleId(id)); +/******/ } +/******/ } +/******/ deferred.resolve(outdatedModules); +/******/ } +/******/ } +/******/ +/******/ function hotApply(options) { +/******/ if (hotStatus !== "ready") +/******/ throw new Error("apply() is only allowed in ready status"); +/******/ options = options || {}; +/******/ +/******/ var cb; +/******/ var i; +/******/ var j; +/******/ var module; +/******/ var moduleId; +/******/ +/******/ function getAffectedStuff(updateModuleId) { +/******/ var outdatedModules = [updateModuleId]; +/******/ var outdatedDependencies = {}; +/******/ +/******/ var queue = outdatedModules.slice().map(function(id) { +/******/ return { +/******/ chain: [id], +/******/ id: id +/******/ }; +/******/ }); +/******/ while (queue.length > 0) { +/******/ var queueItem = queue.pop(); +/******/ var moduleId = queueItem.id; +/******/ var chain = queueItem.chain; +/******/ module = installedModules[moduleId]; +/******/ if (!module || module.hot._selfAccepted) continue; +/******/ if (module.hot._selfDeclined) { +/******/ return { +/******/ type: "self-declined", +/******/ chain: chain, +/******/ moduleId: moduleId +/******/ }; +/******/ } +/******/ if (module.hot._main) { +/******/ return { +/******/ type: "unaccepted", +/******/ chain: chain, +/******/ moduleId: moduleId +/******/ }; +/******/ } +/******/ for (var i = 0; i < module.parents.length; i++) { +/******/ var parentId = module.parents[i]; +/******/ var parent = installedModules[parentId]; +/******/ if (!parent) continue; +/******/ if (parent.hot._declinedDependencies[moduleId]) { +/******/ return { +/******/ type: "declined", +/******/ chain: chain.concat([parentId]), +/******/ moduleId: moduleId, +/******/ parentId: parentId +/******/ }; +/******/ } +/******/ if (outdatedModules.indexOf(parentId) !== -1) continue; +/******/ if (parent.hot._acceptedDependencies[moduleId]) { +/******/ if (!outdatedDependencies[parentId]) +/******/ outdatedDependencies[parentId] = []; +/******/ addAllToSet(outdatedDependencies[parentId], [moduleId]); +/******/ continue; +/******/ } +/******/ delete outdatedDependencies[parentId]; +/******/ outdatedModules.push(parentId); +/******/ queue.push({ +/******/ chain: chain.concat([parentId]), +/******/ id: parentId +/******/ }); +/******/ } +/******/ } +/******/ +/******/ return { +/******/ type: "accepted", +/******/ moduleId: updateModuleId, +/******/ outdatedModules: outdatedModules, +/******/ outdatedDependencies: outdatedDependencies +/******/ }; +/******/ } +/******/ +/******/ function addAllToSet(a, b) { +/******/ for (var i = 0; i < b.length; i++) { +/******/ var item = b[i]; +/******/ if (a.indexOf(item) === -1) a.push(item); +/******/ } +/******/ } +/******/ +/******/ // at begin all updates modules are outdated +/******/ // the "outdated" status can propagate to parents if they don't accept the children +/******/ var outdatedDependencies = {}; +/******/ var outdatedModules = []; +/******/ var appliedUpdate = {}; +/******/ +/******/ var warnUnexpectedRequire = function warnUnexpectedRequire() { +/******/ console.warn( +/******/ "[HMR] unexpected require(" + result.moduleId + ") to disposed module" +/******/ ); +/******/ }; +/******/ +/******/ for (var id in hotUpdate) { +/******/ if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { +/******/ moduleId = toModuleId(id); +/******/ /** @type {TODO} */ +/******/ var result; +/******/ if (hotUpdate[id]) { +/******/ result = getAffectedStuff(moduleId); +/******/ } else { +/******/ result = { +/******/ type: "disposed", +/******/ moduleId: id +/******/ }; +/******/ } +/******/ /** @type {Error|false} */ +/******/ var abortError = false; +/******/ var doApply = false; +/******/ var doDispose = false; +/******/ var chainInfo = ""; +/******/ if (result.chain) { +/******/ chainInfo = "\nUpdate propagation: " + result.chain.join(" -> "); +/******/ } +/******/ switch (result.type) { +/******/ case "self-declined": +/******/ if (options.onDeclined) options.onDeclined(result); +/******/ if (!options.ignoreDeclined) +/******/ abortError = new Error( +/******/ "Aborted because of self decline: " + +/******/ result.moduleId + +/******/ chainInfo +/******/ ); +/******/ break; +/******/ case "declined": +/******/ if (options.onDeclined) options.onDeclined(result); +/******/ if (!options.ignoreDeclined) +/******/ abortError = new Error( +/******/ "Aborted because of declined dependency: " + +/******/ result.moduleId + +/******/ " in " + +/******/ result.parentId + +/******/ chainInfo +/******/ ); +/******/ break; +/******/ case "unaccepted": +/******/ if (options.onUnaccepted) options.onUnaccepted(result); +/******/ if (!options.ignoreUnaccepted) +/******/ abortError = new Error( +/******/ "Aborted because " + moduleId + " is not accepted" + chainInfo +/******/ ); +/******/ break; +/******/ case "accepted": +/******/ if (options.onAccepted) options.onAccepted(result); +/******/ doApply = true; +/******/ break; +/******/ case "disposed": +/******/ if (options.onDisposed) options.onDisposed(result); +/******/ doDispose = true; +/******/ break; +/******/ default: +/******/ throw new Error("Unexception type " + result.type); +/******/ } +/******/ if (abortError) { +/******/ hotSetStatus("abort"); +/******/ return Promise.reject(abortError); +/******/ } +/******/ if (doApply) { +/******/ appliedUpdate[moduleId] = hotUpdate[moduleId]; +/******/ addAllToSet(outdatedModules, result.outdatedModules); +/******/ for (moduleId in result.outdatedDependencies) { +/******/ if ( +/******/ Object.prototype.hasOwnProperty.call( +/******/ result.outdatedDependencies, +/******/ moduleId +/******/ ) +/******/ ) { +/******/ if (!outdatedDependencies[moduleId]) +/******/ outdatedDependencies[moduleId] = []; +/******/ addAllToSet( +/******/ outdatedDependencies[moduleId], +/******/ result.outdatedDependencies[moduleId] +/******/ ); +/******/ } +/******/ } +/******/ } +/******/ if (doDispose) { +/******/ addAllToSet(outdatedModules, [result.moduleId]); +/******/ appliedUpdate[moduleId] = warnUnexpectedRequire; +/******/ } +/******/ } +/******/ } +/******/ +/******/ // Store self accepted outdated modules to require them later by the module system +/******/ var outdatedSelfAcceptedModules = []; +/******/ for (i = 0; i < outdatedModules.length; i++) { +/******/ moduleId = outdatedModules[i]; +/******/ if ( +/******/ installedModules[moduleId] && +/******/ installedModules[moduleId].hot._selfAccepted +/******/ ) +/******/ outdatedSelfAcceptedModules.push({ +/******/ module: moduleId, +/******/ errorHandler: installedModules[moduleId].hot._selfAccepted +/******/ }); +/******/ } +/******/ +/******/ // Now in "dispose" phase +/******/ hotSetStatus("dispose"); +/******/ Object.keys(hotAvailableFilesMap).forEach(function(chunkId) { +/******/ if (hotAvailableFilesMap[chunkId] === false) { +/******/ hotDisposeChunk(chunkId); +/******/ } +/******/ }); +/******/ +/******/ var idx; +/******/ var queue = outdatedModules.slice(); +/******/ while (queue.length > 0) { +/******/ moduleId = queue.pop(); +/******/ module = installedModules[moduleId]; +/******/ if (!module) continue; +/******/ +/******/ var data = {}; +/******/ +/******/ // Call dispose handlers +/******/ var disposeHandlers = module.hot._disposeHandlers; +/******/ for (j = 0; j < disposeHandlers.length; j++) { +/******/ cb = disposeHandlers[j]; +/******/ cb(data); +/******/ } +/******/ hotCurrentModuleData[moduleId] = data; +/******/ +/******/ // disable module (this disables requires from this module) +/******/ module.hot.active = false; +/******/ +/******/ // remove module from cache +/******/ delete installedModules[moduleId]; +/******/ +/******/ // when disposing there is no need to call dispose handler +/******/ delete outdatedDependencies[moduleId]; +/******/ +/******/ // remove "parents" references from all children +/******/ for (j = 0; j < module.children.length; j++) { +/******/ var child = installedModules[module.children[j]]; +/******/ if (!child) continue; +/******/ idx = child.parents.indexOf(moduleId); +/******/ if (idx >= 0) { +/******/ child.parents.splice(idx, 1); +/******/ } +/******/ } +/******/ } +/******/ +/******/ // remove outdated dependency from module children +/******/ var dependency; +/******/ var moduleOutdatedDependencies; +/******/ for (moduleId in outdatedDependencies) { +/******/ if ( +/******/ Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) +/******/ ) { +/******/ module = installedModules[moduleId]; +/******/ if (module) { +/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId]; +/******/ for (j = 0; j < moduleOutdatedDependencies.length; j++) { +/******/ dependency = moduleOutdatedDependencies[j]; +/******/ idx = module.children.indexOf(dependency); +/******/ if (idx >= 0) module.children.splice(idx, 1); +/******/ } +/******/ } +/******/ } +/******/ } +/******/ +/******/ // Not in "apply" phase +/******/ hotSetStatus("apply"); +/******/ +/******/ hotCurrentHash = hotUpdateNewHash; +/******/ +/******/ // insert new code +/******/ for (moduleId in appliedUpdate) { +/******/ if (Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) { +/******/ modules[moduleId] = appliedUpdate[moduleId]; +/******/ } +/******/ } +/******/ +/******/ // call accept handlers +/******/ var error = null; +/******/ for (moduleId in outdatedDependencies) { +/******/ if ( +/******/ Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) +/******/ ) { +/******/ module = installedModules[moduleId]; +/******/ if (module) { +/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId]; +/******/ var callbacks = []; +/******/ for (i = 0; i < moduleOutdatedDependencies.length; i++) { +/******/ dependency = moduleOutdatedDependencies[i]; +/******/ cb = module.hot._acceptedDependencies[dependency]; +/******/ if (cb) { +/******/ if (callbacks.indexOf(cb) !== -1) continue; +/******/ callbacks.push(cb); +/******/ } +/******/ } +/******/ for (i = 0; i < callbacks.length; i++) { +/******/ cb = callbacks[i]; +/******/ try { +/******/ cb(moduleOutdatedDependencies); +/******/ } catch (err) { +/******/ if (options.onErrored) { +/******/ options.onErrored({ +/******/ type: "accept-errored", +/******/ moduleId: moduleId, +/******/ dependencyId: moduleOutdatedDependencies[i], +/******/ error: err +/******/ }); +/******/ } +/******/ if (!options.ignoreErrored) { +/******/ if (!error) error = err; +/******/ } +/******/ } +/******/ } +/******/ } +/******/ } +/******/ } +/******/ +/******/ // Load self accepted modules +/******/ for (i = 0; i < outdatedSelfAcceptedModules.length; i++) { +/******/ var item = outdatedSelfAcceptedModules[i]; +/******/ moduleId = item.module; +/******/ hotCurrentParents = [moduleId]; +/******/ try { +/******/ __webpack_require__(moduleId); +/******/ } catch (err) { +/******/ if (typeof item.errorHandler === "function") { +/******/ try { +/******/ item.errorHandler(err); +/******/ } catch (err2) { +/******/ if (options.onErrored) { +/******/ options.onErrored({ +/******/ type: "self-accept-error-handler-errored", +/******/ moduleId: moduleId, +/******/ error: err2, +/******/ originalError: err +/******/ }); +/******/ } +/******/ if (!options.ignoreErrored) { +/******/ if (!error) error = err2; +/******/ } +/******/ if (!error) error = err; +/******/ } +/******/ } else { +/******/ if (options.onErrored) { +/******/ options.onErrored({ +/******/ type: "self-accept-errored", +/******/ moduleId: moduleId, +/******/ error: err +/******/ }); +/******/ } +/******/ if (!options.ignoreErrored) { +/******/ if (!error) error = err; +/******/ } +/******/ } +/******/ } +/******/ } +/******/ +/******/ // handle errors in accept handlers and self accepted module load +/******/ if (error) { +/******/ hotSetStatus("fail"); +/******/ return Promise.reject(error); +/******/ } +/******/ +/******/ hotSetStatus("idle"); +/******/ return new Promise(function(resolve) { +/******/ resolve(outdatedModules); +/******/ }); +/******/ } +/******/ +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {}, +/******/ hot: hotCreateModule(moduleId), +/******/ parents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp), +/******/ children: [] +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/"; +/******/ +/******/ // __webpack_hash__ +/******/ __webpack_require__.h = function() { return hotCurrentHash; }; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return hotCreateRequire(1)(__webpack_require__.s = 1); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./node_modules/_@ali_b3-one@0.0.17@@ali/b3-one/lib/event.js": +/*!*******************************************************************!*\ + !*** ./node_modules/_@ali_b3-one@0.0.17@@ali/b3-one/lib/event.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.on = on; +exports.off = off; +/** + * utils for add and remove event listener + * @module event + * + */ + +/** + * add an event to a element + * @function on + * @param {Element} el - html element which need bind event + * @param {String} type - the type of event + * @param {Function} callback - the callback when the event trigger + * @param {Bealoon} useCapture - whether use capture, need addEventListener supported + */ +function on(el, type, callback, useCapture) { + if (el.addEventListener) { + el.addEventListener(type, callback, useCapture); + } else { + el.attachEvent('on' + type, function () { + callback.call(el); + }); + } +} + +/** + * remove the event from the element + * @function off + * @param {Element} el - html element which user need remove the event listener + * @param {String} type - the type of event + * @param {Function} callback - the callback function which user bind on the element + */ +function off(el, type, callback) { + if (el.removeEventListener) { + el.removeEventListener(type, callback); + } else { + el.detachEvent('on' + type, callback); + } +} + +/***/ }), + +/***/ "./node_modules/_@ali_b3-one@0.0.17@@ali/b3-one/lib/obj.js": +/*!*****************************************************************!*\ + !*** ./node_modules/_@ali_b3-one@0.0.17@@ali/b3-one/lib/obj.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.deepClone = exports.pick = exports.deepEqual = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /** + * uitls for object + * @module obj + */ + +exports.isEmpty = isEmpty; +exports.clone = clone; +exports.forEach = forEach; +exports.shallowEqual = shallowEqual; +exports.mix = mix; +exports.deepMix = deepMix; +exports.compare = compare; + +var _pick2 = __webpack_require__(/*! lodash/pick */ "./node_modules/_lodash@4.17.15@lodash/pick.js"); + +var _pick3 = _interopRequireDefault(_pick2); + +var _isEqual2 = __webpack_require__(/*! lodash/isEqual */ "./node_modules/_lodash@4.17.15@lodash/isEqual.js"); + +var _isEqual3 = _interopRequireDefault(_isEqual2); + +var _cloneDeep = __webpack_require__(/*! lodash/cloneDeep */ "./node_modules/_lodash@4.17.15@lodash/cloneDeep.js"); + +var _cloneDeep2 = _interopRequireDefault(_cloneDeep); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * ajdust whether the two input is deep equal(lodash:https://lodash.com/docs/4.17.10#isEqual). + * @param {any} objA - the first input need to compare + * @param {any} objB - the second input need to compare + * @returns {Boolean} + * + */ +var deepEqual = exports.deepEqual = _isEqual3.default; + +/** + * Creates an object composed of the picked object properties (lodash: https://lodash.com/docs/4.17.10#pick). + * @param {Object} [receiver={}] - the destination object + * @param {Array|Object} [suppliers=[]] - the source object or list of source objects + * @param {Boolean} [overwrite=true] - whether overwrite the properties that are aready exist in destination object. + * @returns {Object} + */ +var pick = exports.pick = _pick3.default; + +/** + * recursively clones value. (lodash: https://lodash.com/docs/4.17.10#cloneDeep). + * @param {Object} [receiver={}] - the origin object + * @returns {Object} + */ +var deepClone = exports.deepClone = _cloneDeep2.default; + +/** + * adjust whether the input is empty + * @param {any} obj - the input need to adjust + * @returns {Boolean} + * @example + * + */ +function isEmpty(obj) { + // null and undefined are "empty" + if (obj === null || obj === undefined) { + return true; + } + if (typeof obj === 'number' && isNaN(obj)) { + return true; + } + if (obj.length !== undefined) { + return obj.length === 0; + } + if (obj instanceof Date) { + return false; + } + if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object') { + return Object.keys(obj).length === 0; + } + return false; +} + +/** + * fast clone the input use JSON.parse and JSON.stringify + * @param {any} obj - the input need to clone + * @returns {any} + */ +function clone(obj) { + if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object') { + return obj; + } + return JSON.parse(JSON.stringify(obj)); +} + +/** + * provide an forEach api for traverse attributes in obj + * @param {Object} obj - the object need to traverse + * @param {any} fn - the callback function for the attribute + * @param {any} context - the context for the fn param + * @example + * + */ +function forEach(obj, fn, context) { + obj = obj || {}; + Object.keys(obj).forEach(function (key) { + return fn.call(context, obj[key], key); + }); +} + +/** + * ajdust whether the two input is shallow equal; + * @param {any} objA - the first input need to compare + * @param {any} objB - the second input need to compare + * @returns {Boolean} + * + */ +function shallowEqual(objA, objB) { + if (objA === objB) { + return true; + } + + if ((typeof objA === 'undefined' ? 'undefined' : _typeof(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : _typeof(objB)) !== 'object' || objB === null) { + return false; + } + + var keysA = Object.keys(objA); + if (keysA.length !== Object.keys(objB).length) { + return false; + } + + for (var i = 0, key; i < keysA.length; i++) { + key = keysA[i]; + if (!objB.hasOwnProperty(key) || objA[key] !== objB[key]) { + return false; + } + } + return true; +} + +/** + * Adds all own enumerable string keyed function properties of a list of source objects to the destination object. + * @param {Object} [receiver={}] - the destination object + * @param {Array|Object} [suppliers=[]] - the source object or list of source objects + * @param {Boolean} [overwrite=true] - whether overwrite the properties that are aready exist in destination object. + * @returns {Object} + * @example + * + */ +function mix() { + var receiver = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var suppliers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + + if ((typeof receiver === 'undefined' ? 'undefined' : _typeof(receiver)) !== 'object' || Array.isArray(receiver)) { + receiver = {}; + } + if ((typeof suppliers === 'undefined' ? 'undefined' : _typeof(suppliers)) !== 'object') { + return receiver; + } + suppliers = Array.isArray(suppliers) ? suppliers : [suppliers]; + suppliers.forEach(function (supplier) { + forEach(supplier, function (val, key) { + if (overwrite || receiver[key] === undefined) { + receiver[key] = val; + } + }); + }); + return receiver; +} + +/** + * Adds all own enumerable string keyed function properties of a list of source objects to the destination object, if the properties in source objects is object type do deep mix recursively. + * @param {Object} [receiver={}] - the destination object + * @param {Array|Object} [suppliers=[]] - the source object or list of source objects + * @param {Boolean} [overwrite=true] - whether overwrite the properties that are aready exist in destination object. + * @returns {Object} + * @example + * + */ +function deepMix() { + var receiver = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var suppliers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + + if ((typeof receiver === 'undefined' ? 'undefined' : _typeof(receiver)) !== 'object' || Array.isArray(receiver)) { + receiver = {}; + } + if ((typeof suppliers === 'undefined' ? 'undefined' : _typeof(suppliers)) !== 'object') { + return receiver; + } + suppliers = Array.isArray(suppliers) ? suppliers : [suppliers]; + + suppliers.forEach(function (supplier) { + forEach(supplier, function (val, key) { + if (overwrite || receiver[key] === undefined) { + receiver[key] = (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' && !Array.isArray(val) && val !== null ? deepMix(receiver[key], val, overwrite) : supplier[key]; + } + }); + }); + + return receiver; +} + +/** + * compare two input entity and return the diff between each of them. + * @param {*} obj - the first entity + * @param {*} nextObj - the secend entity + * @returns {Object} + * @example + * + */ +function compare() { + var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var nextObj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var compareObj = function compareObj() { + var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var nextObj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var res = { + add: {}, + update: {}, + remove: {}, + same: {} + }; + forEach(obj, function (val, key) { + if (nextObj[key] !== undefined) { + if (deepEqual(val, nextObj[key])) { + res.same[key] = val; + } else { + res.update[key] = { + origin: val, + next: nextObj[key] + }; + } + } else { + res.remove[key] = val; + } + }); + + forEach(nextObj, function (val, key) { + if (obj[key] === undefined && val !== undefined) { + res.add[key] = val; + } + }); + return res; + }; + + var transformArrayToObj = function transformArrayToObj(arr) { + var res = {}; + arr.forEach(function (item, idx) { + res[item.key || idx] = item; + }); + return res; + }; + if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' && (typeof nextObj === 'undefined' ? 'undefined' : _typeof(nextObj)) !== 'object') return { add: null, update: null, remove: null, same: null }; + if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object') return { + add: Array.isArray(nextObj) ? transformArrayToObj(nextObj) : nextObj, + update: null, + remove: null, + same: null + }; + if ((typeof nextObj === 'undefined' ? 'undefined' : _typeof(nextObj)) !== 'object') return { add: null, update: null, remove: Array.isArray(obj) ? transformArrayToObj(obj) : obj, same: null }; + + return compareObj(Array.isArray(obj) ? transformArrayToObj(obj) : obj, Array.isArray(nextObj) ? transformArrayToObj(nextObj) : nextObj); +} + +/***/ }), + +/***/ "./node_modules/_@ali_b3-one@0.0.17@@ali/b3-one/lib/url.js": +/*!*****************************************************************!*\ + !*** ./node_modules/_@ali_b3-one@0.0.17@@ali/b3-one/lib/url.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /** + * utils for url + * @module url + * + */ + +exports.parseUrl = parseUrl; +exports.parseSearch = parseSearch; +exports.serialize = serialize; +exports.buildUrl = buildUrl; + +var _obj = __webpack_require__(/*! ./obj */ "./node_modules/_@ali_b3-one@0.0.17@@ali/b3-one/lib/obj.js"); + +/** + * parse the url and get all info for the url + * @function parseUrl + * @param {String} [url=location.href] - the url need to parse + * @returns {Object} + * @example + * + */ +function parseUrl() { + var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : location.href; + + var a = document.createElement('a'); + a.href = url; + return { + url: url.split('#')[0], + host: a.host, + port: a.port, + protocol: a.protocol, + query: a.search, + hash: a.hash, + path: a.pashname, + params: formatParams(a.search.replace(/^\?/, '')) + }; +} + +/** + * parse the search string and get the query object + * @function parseSearch + * @param {String} search - the search string need to parse + * @returns {Object} + * @example + * + */ +function parseSearch() { + var search = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + + return formatParams(search.replace(/^\?/, '')); +} + +/** + * serialize an object to a url query string. + * @param {Object} obj - the object need to serialized. + * @returns {String} - the result of serialize. + * @example + * + */ +function serialize(obj) { + var rst = []; + (0, _obj.forEach)(obj, function (val, key) { + if (val === null || val === undefined || val === '') return; + if ((typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object') rst.push(key + '=' + encodeURIComponent(JSON.stringify(val)));else rst.push(key + '=' + encodeURIComponent(val)); + }); + return rst.join('&'); +} + +/** + * build a url with exist url and the extra params. + * @param {String} dataAPI - the exist url. + * @param {Object} params - the extra params. + * @example + * + * + * // output http://www.tmall.com?param=yoyo¶m1=hello¶m2=2 + */ +function buildUrl(dataAPI, params) { + var paramStr = serialize(params); + if (paramStr) { + return dataAPI.indexOf('?') > 0 ? dataAPI + '&' + paramStr : dataAPI + '?' + paramStr; + } + return dataAPI; +} + +function formatParams(str) { + if (!str) return {}; + var paramStr = str.split('&'); + var res = {}; + for (var i = 0; i < paramStr.length; i++) { + var regRes = paramStr[i].split('='); + if (regRes[0] && regRes[1]) { + res[regRes[0]] = decodeURIComponent(regRes[1]); + } + } + return res; +} + +/***/ }), + +/***/ "./node_modules/_@ali_bzb-request@2.5.2@@ali/bzb-request/lib/index.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@ali_bzb-request@2.5.2@@ali/bzb-request/lib/index.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __awaiter = (this && this.__awaiter) || function (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) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var axios_1 = __importDefault(__webpack_require__(/*! axios */ "./node_modules/_axios@0.19.2@axios/index.js")); +var qs_1 = __importDefault(__webpack_require__(/*! qs */ "./node_modules/_qs@6.7.0@qs/lib/index.js")); +var ENDPOINT = { + daily: 'cobweb.alibaba.net', + pre: 'pre-xiaoer.alibaba-inc.com', + beta: 'beta-xiaoer.alibaba-inc.com', + prod: 'xiaoer.alibaba-inc.com', + default: window.location.host, +}; +// 获取 CSRF TOKEN 信息 +function _getCSRFToken(env) { + if (env === void 0) { env = 'default'; } + return __awaiter(this, void 0, void 0, function () { + var csrfInfo, res; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + csrfInfo = {}; + return [4 /*yield*/, axios_1.default("//" + ENDPOINT[env] + "/cobweb/api/csrf", { + method: 'GET', + withCredentials: true, + })]; + case 1: + res = _a.sent(); + if (res && res.data && res.data.data) { + csrfInfo = res.data.data; + if (window.BZB && isFnExist(window.BZB.setToken)) { + window.BZB.setToken(csrfInfo.token); + } + } + return [2 /*return*/, csrfInfo]; + } + }); + }); +} +// axios 实例 +function axiosInstance(url, options) { + return __awaiter(this, void 0, void 0, function () { + var res; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default(url, options)]; + case 1: + res = _a.sent(); + if (options && options.debug) { + return [2 /*return*/, res]; + } + return [2 /*return*/, res.data]; + } + }); + }); +} +function isFnExist(fn) { + return fn && typeof fn === 'function'; +} +function request(url, opts, _raw) { + return __awaiter(this, void 0, void 0, function () { + var BZB, query, options, matchs, api, env, domain, data, CSRF, headerSuffix, opGroupId, opGroupTypes, page, csrf, res_1, res; + var _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + BZB = window.BZB || {}; + query = {}; + try { + query = qs_1.default.parse(window.location.search.slice(1)); + } + catch (error) { + } + // 如果 url 为空,opts 中有 url,则取出 + if (url && Object.prototype.toString.call(url) === '[object Object]') { + if (url.url) { + opts = url; + url = url.url; + } + } + options = __assign({ method: opts.method || 'GET', withCredentials: true, + // 使用 qs 做 stringfy,避免不符合 RFC 标准而被 tomcat 拦截 + paramsSerializer: function (params) { + return qs_1.default.stringify(params); + } }, opts); + // 如果开发者没有显示使用 raw 模式,则封装为网关统一格式的参数 + if (!_raw) { + // 请求网关api时,检测和补全api前缀 + url = url.trim(); + matchs = /(\/?cobweb)?(\/?api\/)?\/?([\w\.:]*.)/.exec(url); + api = matchs ? matchs[3] : url; + env = options.env || 'default'; + domain = ENDPOINT[env]; + url = "//" + domain + "/cobweb/api/" + api; + data = { + _bzb_format: 'json', + _bzb_data: options.data || {} + }; + if (query && query._target_server_ip) { + data._target_server_ip = query._target_server_ip; + } + if (['post', 'put'].indexOf(options.method.trim().toLowerCase()) !== -1) { + // POST PUT 请求赋值到 data + options.data = __assign(__assign({}, data), { _bzb_data: opts.data }); + } + else { + // 其他请求赋值到 params + options.params = __assign(__assign({}, data), { + // 支持开发者在 GET 模式下,也通过 data 参数传输 + _bzb_data: JSON.stringify(__assign(__assign({}, (opts.data || {})), opts.params)) }); + } + } + CSRF = { + token: (window.BZB && window.BZB.getToken) ? window.BZB.getToken() : '', + headerName: 'X-XSRF-TOKEN' + }; + headerSuffix = {}; + if (isFnExist(BZB.getAppCode)) { + headerSuffix['bzb-app-code'] = BZB.getAppCode(); + } + if (isFnExist(BZB.getOpGroupId) && isFnExist(BZB.getOpGroupTypes)) { + if (BZB.getOpGroupId()) { + opGroupId = BZB.getOpGroupId(); + opGroupTypes = BZB.getOpGroupTypes(opGroupId); + if (opGroupTypes && opGroupTypes.opEntityId) { + headerSuffix['bzb-op-entity-id'] = opGroupTypes.opEntityId; + } + if (opGroupTypes && opGroupTypes.sopFlowId) { + headerSuffix['bzb-sop-flow-id'] = opGroupTypes.sopFlowId; + } + } + } + if (isFnExist(BZB.getCurPageInfo)) { + page = BZB.getCurPageInfo(); + if (page && page.id) { + headerSuffix['bzb-page-id'] = page.id; + } + } + // 将 CSRF / suffix 信息组装至请求头 + options.headers = __assign(__assign(__assign({}, options.headers), headerSuffix), (_a = {}, _a[CSRF.headerName] = CSRF.token, _a)); + if (!(!CSRF || !CSRF.token || !options.headers[CSRF.headerName])) return [3 /*break*/, 3]; + return [4 /*yield*/, _getCSRFToken(opts.env)]; + case 1: + csrf = _b.sent(); + options.headers[csrf.headerName] = csrf.token; + return [4 /*yield*/, axiosInstance(url, options)]; + case 2: + res_1 = _b.sent(); + return [2 /*return*/, res_1]; + case 3: return [4 /*yield*/, axiosInstance(url, options)]; + case 4: + res = _b.sent(); + return [2 /*return*/, res]; + } + }); + }); +} +exports.default = request; +// fusion upload adapter +exports.upload = { + fusion: function (opts, env) { return __awaiter(void 0, void 0, void 0, function () { + var options, data, url, matchs, api, _env, domain, CSRF, csrf; + var _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + options = { + method: 'post', + withCredentials: true, + }; + data = new FormData(); + data.append(opts.filename, opts.file); + if (opts.data) { + Object.keys(opts.data).forEach(function (key) { return data.append(key, opts.data[key]); }); + } + options.data = data; + url = opts.action.trim(); + matchs = /(\/?cobweb)?(\/?api\/)?\/?([\w\.:]*.)/.exec(url); + api = matchs ? matchs[3] : url; + _env = env || opts.env || 'default'; + domain = ENDPOINT[_env]; + url = "//" + domain + "/cobweb/api/" + api; + CSRF = { + token: (window.BZB && window.BZB.getToken) ? window.BZB.getToken() : '', + headerName: 'X-XSRF-TOKEN' + }; + // 将 CSRF / suffix 信息组装至请求头 + options.headers = __assign(__assign({}, opts.headers), (_a = {}, _a[CSRF.headerName] = CSRF.token, _a)); + if (!(!CSRF || !CSRF.token || !options.headers[CSRF.headerName])) return [3 /*break*/, 2]; + return [4 /*yield*/, _getCSRFToken(_env)]; + case 1: + csrf = _b.sent(); + options.headers[csrf.headerName] = csrf.token; + _b.label = 2; + case 2: + options.onUploadProgress = function (progressEvent) { + if (progressEvent.total > 0) { + progressEvent.percent = Math.round((progressEvent.loaded * 100) / progressEvent.total); + } + if (opts.onProgress) { + opts.onProgress(progressEvent); + } + }; + return [2 /*return*/, axiosInstance(url, options) + .then(function (res) { + if (res && res.success) { + opts.onSuccess(res.data); + } + if (!res || !res.success) { + opts.onError(new Error(res.msg || 'Upload failed.')); + } + return res; + }) + .catch(function (e) { + opts.onError(e); + return e; + })]; + } + }); + }); } +}; + + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-a@1.0.0@@ali/iceluna-comp-a/lib/index.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-a@1.0.0@@ali/iceluna-comp-a/lib/index.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _package = _interopRequireDefault(__webpack_require__(/*! ../package.json */ "./node_modules/_@ali_iceluna-comp-a@1.0.0@@ali/iceluna-comp-a/package.json")); + +var AView = +/*#__PURE__*/ +function (_PureComponent) { + (0, _inherits2["default"])(AView, _PureComponent); + + function AView() { + (0, _classCallCheck2["default"])(this, AView); + return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(AView).apply(this, arguments)); + } + + (0, _createClass2["default"])(AView, [{ + key: "render", + value: function render() { + return _react["default"].createElement("a", this.props); + } + }]); + return AView; +}(_react.PureComponent); + +exports["default"] = AView; +(0, _defineProperty2["default"])(AView, "displayName", 'A'); +(0, _defineProperty2["default"])(AView, "version", _package["default"].version || '0.0.0'); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-a@1.0.0@@ali/iceluna-comp-a/package.json": +/*!**********************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-a@1.0.0@@ali/iceluna-comp-a/package.json ***! + \**********************************************************************************/ +/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, peerDependencies, publishConfig, devDependencies, __npminstall_done, _from, _resolved, default */ +/***/ (function(module) { + +module.exports = {"name":"@ali/iceluna-comp-a","version":"1.0.0","description":"链接","main":"lib/index.js","scripts":{"babel":"rm -rf lib && babel src -d lib --copy-files","prettier":"prettier --write \"./src/**/*.{js,jsx,ejs,less,css,scss,json}\" \"./demo/**/*.{js,jsx,ejs,less,css,scss,json}\"","build":"npm run babel","prepublish":"npm run prettier && npm run build"},"repository":{"type":"git","url":"git@gitlab.alibaba-inc.com:iceluna/iceluna-comp.git"},"keywords":["iceluna","comp"],"author":"xiayang.xy","license":"ISC","peerDependencies":{"prop-types":"^15.7.2","react":"^16.8.6","react-dom":"^16.8.6"},"publishConfig":{"registry":"http://registry.npm.alibaba-inc.com"},"devDependencies":{"prettier":"^1.18.2"},"__npminstall_done":"Tue Feb 18 2020 02:41:34 GMT+0800 (GMT+08:00)","_from":"@ali/iceluna-comp-a@1.0.0","_resolved":"https://registry.npm.alibaba-inc.com/@ali/iceluna-comp-a/download/@ali/iceluna-comp-a-1.0.0.tgz"}; + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-div@0.0.5@@ali/iceluna-comp-div/lib/index.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-div@0.0.5@@ali/iceluna-comp-div/lib/index.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var DivView = +/*#__PURE__*/ +function (_PureComponent) { + (0, _inherits2["default"])(DivView, _PureComponent); + + function DivView() { + (0, _classCallCheck2["default"])(this, DivView); + return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(DivView).apply(this, arguments)); + } + + (0, _createClass2["default"])(DivView, [{ + key: "render", + value: function render() { + return _react["default"].createElement("div", this.props); + } + }]); + return DivView; +}(_react.PureComponent); + +exports["default"] = DivView; + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-div@1.0.0@@ali/iceluna-comp-div/lib/index.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-div@1.0.0@@ali/iceluna-comp-div/lib/index.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _package = _interopRequireDefault(__webpack_require__(/*! ../package.json */ "./node_modules/_@ali_iceluna-comp-div@1.0.0@@ali/iceluna-comp-div/package.json")); + +var DivView = +/*#__PURE__*/ +function (_PureComponent) { + (0, _inherits2["default"])(DivView, _PureComponent); + + function DivView() { + (0, _classCallCheck2["default"])(this, DivView); + return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(DivView).apply(this, arguments)); + } + + (0, _createClass2["default"])(DivView, [{ + key: "render", + value: function render() { + return _react["default"].createElement("div", this.props); + } + }]); + return DivView; +}(_react.PureComponent); + +exports["default"] = DivView; +(0, _defineProperty2["default"])(DivView, "displayName", 'Div'); +(0, _defineProperty2["default"])(DivView, "version", _package["default"].version || '0.0.0'); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-div@1.0.0@@ali/iceluna-comp-div/package.json": +/*!**************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-div@1.0.0@@ali/iceluna-comp-div/package.json ***! + \**************************************************************************************/ +/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, peerDependencies, publishConfig, __npminstall_done, _from, _resolved, default */ +/***/ (function(module) { + +module.exports = {"name":"@ali/iceluna-comp-div","version":"1.0.0","description":"div","main":"lib/index.js","scripts":{"babel":"rm -rf lib && babel src -d lib --copy-files","prettier":"prettier --write \"./src/**/*.{js,jsx,ejs,less,css,scss,json}\" \"./demo/**/*.{js,jsx,ejs,less,css,scss,json}\"","build":"npm run babel","prepublish":"npm run prettier && npm run build"},"repository":{"type":"git","url":"git@gitlab.alibaba-inc.com:iceluna/iceluna-comp.git"},"keywords":["iceluna","comp"],"author":"xiayang.xy","license":"ISC","peerDependencies":{"prop-types":"^15.7.2","react":"^16.8.6","react-dom":"^16.8.6"},"publishConfig":{"registry":"http://registry.npm.alibaba-inc.com"},"__npminstall_done":"Tue Feb 18 2020 02:41:34 GMT+0800 (GMT+08:00)","_from":"@ali/iceluna-comp-div@1.0.0","_resolved":"https://registry.npm.alibaba-inc.com/@ali/iceluna-comp-div/download/@ali/iceluna-comp-div-1.0.0.tgz"}; + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-form@1.0.20@@ali/iceluna-comp-form/lib/index.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-form@1.0.20@@ali/iceluna-comp-form/lib/index.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _style = __webpack_require__(/*! @alife/next/lib/form/style.js */ "./node_modules/_@alife_next@1.19.13@@alife/next/lib/form/style.js"); + +var _form = _interopRequireDefault(__webpack_require__(/*! @alife/next/lib/form */ "./node_modules/_@alife_next@1.19.13@@alife/next/lib/form/index.js")); + +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/extends.js")); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/objectWithoutProperties.js")); + +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/typeof.js")); + +var _field = _interopRequireDefault(__webpack_require__(/*! @alife/next/lib/field */ "./node_modules/_@alife_next@1.19.13@@alife/next/lib/field/index.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/assertThisInitialized.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _utils = __webpack_require__(/*! @ali/iceluna-sdk/lib/utils */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +var _appContext = _interopRequireDefault(__webpack_require__(/*! @ali/iceluna-sdk/lib/context/appContext */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js")); + +var _package = _interopRequireDefault(__webpack_require__(/*! ../package.json */ "./node_modules/_@ali_iceluna-comp-form@1.0.20@@ali/iceluna-comp-form/package.json")); + +__webpack_require__(/*! ./index.scss */ "./node_modules/_@ali_iceluna-comp-form@1.0.20@@ali/iceluna-comp-form/lib/index.scss"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var FusionForm = +/*#__PURE__*/ +function (_PureComponent) { + (0, _inherits2["default"])(FusionForm, _PureComponent); + + function FusionForm(props, context) { + var _this; + + (0, _classCallCheck2["default"])(this, FusionForm); + _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(FusionForm).call(this, props, context)); + _this.field = props.__scope && props.__scope.field || new _field["default"](context && context.blockContext || (0, _assertThisInitialized2["default"])(_this)); + _this.field.options = _objectSpread({}, _this.field.options, { + parseName: true, + forceUpdate: true + }, props.fieldProps); // 表单初始值,参考field的内部实现 + + if (props.fieldProps && props.fieldProps.values) { + _this.field.values = _objectSpread({}, props.fieldProps.values); + } //改写field.validate方法 + + + var preValidate = _this.field.validate.bind(_this.field); + + var newValidate = function newValidate(callback) { + preValidate(function (errors, value) { + //过滤list类型带来的脏数据 + var newValue = value ? (0, _utils.clone)(value) : {}; + + _utils.jsonuri.walk(newValue, function (obj, key, parent) { + if (parent[key] === undefined || key === '' || key === '_key') delete parent[key]; + }); + + callback && callback(errors, newValue); + }); + }; + + _this.field.validate = newValidate; + return _this; + } + + (0, _createClass2["default"])(FusionForm, [{ + key: "reset", + value: function reset(e) { + e.preventDefault(); + this.field.reset(); + } + }, { + key: "submit", + value: function submit(e) { + var _this2 = this; + + // 调用父组件传递給子组件的函数,将子组件的表单值作为参数传递給父组件 + if (e) { + e.preventDefault(); + e.stopPropagation(); + } + + var onSubmit = this.props.onSubmit; + this.field.validate(function (errors, value) { + onSubmit && onSubmit(value, errors, _this2.field); + }); + } + }, { + key: "renderChilds", + value: function renderChilds(childrenNodes, transmitProps) { + var _this3 = this; + + return childrenNodes.map(function (item) { + if (Array.isArray(item)) { + return _this3.renderChilds(item, transmitProps); + } + + return _this3.renderItem(item, transmitProps); + }); + } + }, { + key: "renderItem", + value: function renderItem(item, transmitProps) { + if (item && (0, _typeof2["default"])(item) === 'object') { + if (item.type && item.type._typeMark === 'form_item') { + var tarProps = _objectSpread({}, transmitProps, {}, item.props); + + if (item.ref) tarProps.ref = item.ref; + if (item.key || item.key === 0) tarProps.key = item.key; + return _react["default"].createElement(item.type, tarProps); + } + + return item; + } + + return null; + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + children = _this$props.children, + colSpan = _this$props.colSpan, + labelWidth = _this$props.labelWidth, + labelCol = _this$props.labelCol, + wrapperCol = _this$props.wrapperCol, + fieldProps = _this$props.fieldProps, + onSubmit = _this$props.onSubmit, + otherProps = (0, _objectWithoutProperties2["default"])(_this$props, ["children", "colSpan", "labelWidth", "labelCol", "wrapperCol", "fieldProps", "onSubmit"]); //context透传的属性, 这些属性原生form只会透传直接子节点 + + var formProps = { + labelWidth: labelWidth, + labelCol: labelCol, + wrapperCol: wrapperCol, + responsive: otherProps.responsive, + labelAlign: otherProps.labelAlign, + labelTextAlign: otherProps.labelTextAlign + }; + var childrenNodes = children || null; //兼容处理响应式布局的问题 + + if (otherProps.responsive === true && childrenNodes && colSpan) { + if (!Array.isArray(childrenNodes)) childrenNodes = [children]; + childrenNodes = this.renderChilds(childrenNodes, { + colSpan: colSpan + }); + } + + return _react["default"].createElement(_appContext["default"].Provider, { + value: _objectSpread({}, this.context, { + field: this.field, + formProps: formProps + }) + }, _react["default"].createElement(_form["default"], (0, _extends2["default"])({}, otherProps, { + field: this.field, + onSubmit: this.submit.bind(this), + onReset: this.reset.bind(this) + }), childrenNodes)); + } + }]); + return FusionForm; +}(_react.PureComponent); + +exports["default"] = FusionForm; +(0, _defineProperty2["default"])(FusionForm, "displayName", 'Form'); +(0, _defineProperty2["default"])(FusionForm, "version", _package["default"].version || '0.0.0'); +(0, _defineProperty2["default"])(FusionForm, "propTypes", { + children: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].arrayOf(_propTypes["default"].element)]), + fieldProps: _propTypes["default"].object, + onSubmit: _propTypes["default"].func, + __scope: _propTypes["default"].object, + labelAlign: _propTypes["default"].string, + labelTextAlign: _propTypes["default"].string, + labelCol: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].object]), + wrapperCol: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].object]), + colSpan: _propTypes["default"].number, + //支持高阶业务组件透传属性 + labelWidth: _propTypes["default"].number, + //支持高阶业务组件透传属性, + responsive: _propTypes["default"].bool //支持高阶业务组件透传属性, + +}); +(0, _defineProperty2["default"])(FusionForm, "defaultProps", { + children: null, + fieldProps: {} +}); +(0, _defineProperty2["default"])(FusionForm, "contextType", _appContext["default"]); +(0, _defineProperty2["default"])(FusionForm, "generateScope", function (host) { + return { + field: new _field["default"](host) + }; +}); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-form@1.0.20@@ali/iceluna-comp-form/lib/index.scss": +/*!*******************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-form@1.0.20@@ali/iceluna-comp-form/lib/index.scss ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694894954 + var cssReload = __webpack_require__(/*! ../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-form@1.0.20@@ali/iceluna-comp-form/lib/item.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-form@1.0.20@@ali/iceluna-comp-form/lib/item.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/objectWithoutProperties.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/assertThisInitialized.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _style = __webpack_require__(/*! @alife/next/lib/form/style.js */ "./node_modules/_@alife_next@1.19.13@@alife/next/lib/form/style.js"); + +var _form = _interopRequireDefault(__webpack_require__(/*! @alife/next/lib/form */ "./node_modules/_@alife_next@1.19.13@@alife/next/lib/form/index.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _appContext = _interopRequireDefault(__webpack_require__(/*! @ali/iceluna-sdk/lib/context/appContext */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _package = _interopRequireDefault(__webpack_require__(/*! ../package.json */ "./node_modules/_@ali_iceluna-comp-form@1.0.20@@ali/iceluna-comp-form/package.json")); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var FormItem = _form["default"].Item; + +var FusionFormItem = +/*#__PURE__*/ +function (_PureComponent) { + (0, _inherits2["default"])(FusionFormItem, _PureComponent); + + //不可变动 + //for Grid next@1.19.5 + function FusionFormItem(props, context) { + var _this; + + (0, _classCallCheck2["default"])(this, FusionFormItem); + _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(FusionFormItem).call(this, props, context)); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "injectRef", function (ref) { + // fieldProps会生成一个ref,而渲染引擎给每一个组件也会设置生成一个ref, 均需要执行 + if (_this.children && _this.children.ref && typeof _this.children.ref === 'function') { + _this.children.ref(ref); + } + + if (_this.fieldProps && _this.fieldProps.ref && typeof _this.fieldProps.ref === 'function') { + _this.fieldProps.ref(ref); + } + }); + return _this; + } + + (0, _createClass2["default"])(FusionFormItem, [{ + key: "injectField", + value: function injectField() { + var children = this.children; + if (!children) return; + + var tarProps = _objectSpread({}, children.props, {}, this.fieldProps); + + if (children.ref) { + tarProps.ref = this.injectRef; + } + + if (children.key || children.key === 0) tarProps.key = children.key; + return _react["default"].createElement(children.type, tarProps); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + name = _this$props.name, + children = _this$props.children, + initValue = _this$props.initValue, + trigger = _this$props.trigger, + getValueFromEvent = _this$props.getValueFromEvent, + autoValidate = _this$props.autoValidate, + rules = _this$props.rules, + valueName = _this$props.valueName, + props = _this$props.props, + __scope = _this$props.__scope, + otherProps = (0, _objectWithoutProperties2["default"])(_this$props, ["name", "children", "initValue", "trigger", "getValueFromEvent", "autoValidate", "rules", "valueName", "props", "__scope"]); //获取透传的属性 + + var formProps = this.context.formProps || {}; + + var reOtherProps = _objectSpread({}, formProps, {}, otherProps); //特殊处理包装字段 + + + ['labelCol', 'wrapperCol'].map(function (key) { + var item = reOtherProps[key]; + if (item === undefined) return; + reOtherProps[key] = typeof item === 'number' ? { + span: item + } : item; + }); //特殊处理extra + + if (reOtherProps.extra) { + reOtherProps.extra = _react["default"].createElement("span", { + className: "next-form-item-extra" + }, reOtherProps.extra); + } + + var item = this.children = Array.isArray(children) ? children[0] || null : children; + + var itemProps = _objectSpread({}, props); + + var itemOnChange = item && item.props && item.props.onChange; + if (itemOnChange) itemProps.onChange = itemOnChange; + var field = this.context.field; + + if (field && item && item.type && name) { + var init = field.init, + getError = field.getError; //特殊处理checked相关组件valueName + + var tarValueName = valueName; + + if (['Config(Switch)', 'Config(Checkbox)', 'Config(Radio)'].includes(item.type.displayName)) { + tarValueName = 'checked'; + } //有错误信息,help内容优先展示错误信息 + + + if (getError(name)) reOtherProps.help = getError(name).join(', '); + this.fieldProps = _objectSpread({ + __parent: { + label: reOtherProps['data-label'], + //表单项透传的属性 + rules: rules + } + }, init(name, { + valueName: tarValueName, + initValue: initValue, + trigger: trigger, + rules: rules, + getValueFromEvent: getValueFromEvent, + autoValidate: autoValidate + }, itemProps)); + return _react["default"].createElement(FormItem, reOtherProps, this.injectField(), Array.isArray(children) && children.slice(1)); + } + + return _react["default"].createElement(FormItem, reOtherProps, children); + } + }]); + return FusionFormItem; +}(_react.PureComponent); + +exports["default"] = FusionFormItem; +(0, _defineProperty2["default"])(FusionFormItem, "displayName", 'LunaFusionFormItem'); +(0, _defineProperty2["default"])(FusionFormItem, "version", _package["default"].version || '0.0.0'); +(0, _defineProperty2["default"])(FusionFormItem, "_typeMark", 'form_item'); +(0, _defineProperty2["default"])(FusionFormItem, "propTypes", { + autoValidate: _propTypes["default"].bool, + children: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].arrayOf(_propTypes["default"].element)]), + label: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].element, _propTypes["default"].arrayOf(_propTypes["default"].element)]), + labelCol: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].object]), + initValue: _propTypes["default"].any, + getValueFromEvent: _propTypes["default"].func, + name: _propTypes["default"].string, + rules: _propTypes["default"].array, + trigger: _propTypes["default"].string, + valueName: _propTypes["default"].string, + wrapperCol: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].object]) +}); +(0, _defineProperty2["default"])(FusionFormItem, "contextType", _appContext["default"]); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-form@1.0.20@@ali/iceluna-comp-form/package.json": +/*!*****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-form@1.0.20@@ali/iceluna-comp-form/package.json ***! + \*****************************************************************************************/ +/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, peerDependencies, publishConfig, __npminstall_done, _from, _resolved, default */ +/***/ (function(module) { + +module.exports = {"name":"@ali/iceluna-comp-form","version":"1.0.20","description":"form","main":"lib/index.js","scripts":{"babel":"rm -rf lib && babel src -d lib --copy-files","prettier":"prettier --write \"./src/**/*.{js,jsx,ejs,less,css,scss,json}\" \"./demo/**/*.{js,jsx,ejs,less,css,scss,json}\"","build":"npm run babel","prepublish":"npm run prettier && npm run build"},"repository":{"type":"git","url":"git@gitlab.alibaba-inc.com:iceluna/iceluna-comp.git"},"keywords":["iceluna","comp"],"author":"xiayang.xy","license":"ISC","peerDependencies":{"@ali/iceluna-sdk":"^1.0.2","@alife/next":"^1.17.12","prop-types":"^15.7.2","react":"^16.8.6","react-dom":"^16.8.6"},"publishConfig":{"registry":"http://registry.npm.alibaba-inc.com"},"__npminstall_done":"Tue Feb 18 2020 02:41:34 GMT+0800 (GMT+08:00)","_from":"@ali/iceluna-comp-form@1.0.20","_resolved":"https://registry.npm.alibaba-inc.com/@ali/iceluna-comp-form/download/@ali/iceluna-comp-form-1.0.20.tgz"}; + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-html@1.0.0@@ali/iceluna-comp-html/lib/index.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-html@1.0.0@@ali/iceluna-comp-html/lib/index.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/extends.js")); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/objectWithoutProperties.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _package = _interopRequireDefault(__webpack_require__(/*! ../package.json */ "./node_modules/_@ali_iceluna-comp-html@1.0.0@@ali/iceluna-comp-html/package.json")); + +var HtmlView = +/*#__PURE__*/ +function (_PureComponent) { + (0, _inherits2["default"])(HtmlView, _PureComponent); + + function HtmlView() { + (0, _classCallCheck2["default"])(this, HtmlView); + return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(HtmlView).apply(this, arguments)); + } + + (0, _createClass2["default"])(HtmlView, [{ + key: "render", + value: function render() { + var _this$props = this.props, + html = _this$props.html, + restProps = (0, _objectWithoutProperties2["default"])(_this$props, ["html"]); + return _react["default"].createElement("div", (0, _extends2["default"])({}, restProps, { + dangerouslySetInnerHTML: { + __html: html + } + })); + } + }]); + return HtmlView; +}(_react.PureComponent); + +exports["default"] = HtmlView; +(0, _defineProperty2["default"])(HtmlView, "displayName", 'Html'); +(0, _defineProperty2["default"])(HtmlView, "verison", _package["default"].version || '0.0.0'); +(0, _defineProperty2["default"])(HtmlView, "propTypes", { + html: _propTypes["default"].string +}); +(0, _defineProperty2["default"])(HtmlView, "defaultProps", { + html: '' +}); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-html@1.0.0@@ali/iceluna-comp-html/package.json": +/*!****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-html@1.0.0@@ali/iceluna-comp-html/package.json ***! + \****************************************************************************************/ +/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, peerDependencies, publishConfig, __npminstall_done, _from, _resolved, default */ +/***/ (function(module) { + +module.exports = {"name":"@ali/iceluna-comp-html","version":"1.0.0","description":"html","main":"lib/index.js","scripts":{"babel":"rm -rf lib && babel src -d lib --copy-files","prettier":"prettier --write \"./src/**/*.{js,jsx,ejs,less,css,scss,json}\" \"./demo/**/*.{js,jsx,ejs,less,css,scss,json}\"","build":"npm run babel","prepublish":"npm run prettier && npm run build"},"repository":{"type":"git","url":"git@gitlab.alibaba-inc.com:iceluna/iceluna-comp.git"},"keywords":["iceluna","comp"],"author":"xiayang.xy","license":"ISC","peerDependencies":{"prop-types":"^15.7.2","react":"^16.8.6","react-dom":"^16.8.6"},"publishConfig":{"registry":"http://registry.npm.alibaba-inc.com"},"__npminstall_done":"Tue Feb 18 2020 02:41:34 GMT+0800 (GMT+08:00)","_from":"@ali/iceluna-comp-html@1.0.0","_resolved":"https://registry.npm.alibaba-inc.com/@ali/iceluna-comp-html/download/@ali/iceluna-comp-html-1.0.0.tgz"}; + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-image@1.0.0@@ali/iceluna-comp-image/lib/index.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-image@1.0.0@@ali/iceluna-comp-image/lib/index.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _package = _interopRequireDefault(__webpack_require__(/*! ../package.json */ "./node_modules/_@ali_iceluna-comp-image@1.0.0@@ali/iceluna-comp-image/package.json")); + +var ImageView = +/*#__PURE__*/ +function (_PureComponent) { + (0, _inherits2["default"])(ImageView, _PureComponent); + + function ImageView() { + (0, _classCallCheck2["default"])(this, ImageView); + return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(ImageView).apply(this, arguments)); + } + + (0, _createClass2["default"])(ImageView, [{ + key: "render", + value: function render() { + return _react["default"].createElement("img", this.props); + } + }]); + return ImageView; +}(_react.PureComponent); + +exports["default"] = ImageView; +(0, _defineProperty2["default"])(ImageView, "displayName", 'Image'); +(0, _defineProperty2["default"])(ImageView, "version", _package["default"].version || '0.0.0'); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-image@1.0.0@@ali/iceluna-comp-image/package.json": +/*!******************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-image@1.0.0@@ali/iceluna-comp-image/package.json ***! + \******************************************************************************************/ +/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, peerDependencies, publishConfig, __npminstall_done, _from, _resolved, default */ +/***/ (function(module) { + +module.exports = {"name":"@ali/iceluna-comp-image","version":"1.0.0","description":"图片","main":"lib/index.js","scripts":{"babel":"rm -rf lib && babel src -d lib --copy-files","prettier":"prettier --write \"./src/**/*.{js,jsx,ejs,less,css,scss,json}\" \"./demo/**/*.{js,jsx,ejs,less,css,scss,json}\"","build":"npm run babel","prepublish":"npm run prettier && npm run build"},"repository":{"type":"git","url":"git@gitlab.alibaba-inc.com:iceluna/iceluna-comp.git"},"keywords":["iceluna","comp"],"author":"xiayang.xy","license":"ISC","peerDependencies":{"prop-types":"^15.7.2","react":"^16.8.6","react-dom":"^16.8.6"},"publishConfig":{"registry":"http://registry.npm.alibaba-inc.com"},"__npminstall_done":"Tue Feb 18 2020 02:41:34 GMT+0800 (GMT+08:00)","_from":"@ali/iceluna-comp-image@1.0.0","_resolved":"https://registry.npm.alibaba-inc.com/@ali/iceluna-comp-image/download/@ali/iceluna-comp-image-1.0.0.tgz"}; + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-text@1.0.4@@ali/iceluna-comp-text/lib/index.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-text@1.0.4@@ali/iceluna-comp-text/lib/index.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/objectWithoutProperties.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _package = _interopRequireDefault(__webpack_require__(/*! ../package.json */ "./node_modules/_@ali_iceluna-comp-text@1.0.4@@ali/iceluna-comp-text/package.json")); + +var TextView = +/*#__PURE__*/ +function (_PureComponent) { + (0, _inherits2["default"])(TextView, _PureComponent); + + function TextView() { + (0, _classCallCheck2["default"])(this, TextView); + return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(TextView).apply(this, arguments)); + } + + (0, _createClass2["default"])(TextView, [{ + key: "render", + value: function render() { + var _this$props = this.props, + text = _this$props.text, + restProps = (0, _objectWithoutProperties2["default"])(_this$props, ["text"]); + var textNode = text; // 强制类型转换 + + try { + textNode = text.toString(); + } catch (e) { + textNode = ''; + } + + if (window.__ctx && window.__ctx.canvasAppHelper) { + textNode = textNode || 'Text'; + } + + return _react["default"].createElement("span", restProps, textNode); + } + }]); + return TextView; +}(_react.PureComponent); + +exports["default"] = TextView; +(0, _defineProperty2["default"])(TextView, "displayName", 'Text'); +(0, _defineProperty2["default"])(TextView, "version", _package["default"].version || '0.0.0'); +(0, _defineProperty2["default"])(TextView, "propTypes", { + text: _propTypes["default"].string +}); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-comp-text@1.0.4@@ali/iceluna-comp-text/package.json": +/*!****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-comp-text@1.0.4@@ali/iceluna-comp-text/package.json ***! + \****************************************************************************************/ +/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, peerDependencies, publishConfig, __npminstall_done, _from, _resolved, default */ +/***/ (function(module) { + +module.exports = {"name":"@ali/iceluna-comp-text","version":"1.0.4","description":"文案","main":"lib/index.js","scripts":{"babel":"rm -rf lib && babel src -d lib --copy-files","prettier":"prettier --write \"./src/**/*.{js,jsx,ejs,less,css,scss,json}\" \"./demo/**/*.{js,jsx,ejs,less,css,scss,json}\"","build":"npm run babel","prepublish":"npm run prettier && npm run build"},"repository":{"type":"git","url":"git@gitlab.alibaba-inc.com:iceluna/iceluna-comp.git"},"keywords":["iceluna","comp"],"author":"xiayang.xy","license":"ISC","peerDependencies":{"@ali/iceluna-sdk":"^1.0.2","prop-types":"^15.7.2","react":"^16.8.6","react-dom":"^16.8.6"},"publishConfig":{"registry":"http://registry.npm.alibaba-inc.com"},"__npminstall_done":"Tue Feb 18 2020 02:41:34 GMT+0800 (GMT+08:00)","_from":"@ali/iceluna-comp-text@1.0.4","_resolved":"https://registry.npm.alibaba-inc.com/@ali/iceluna-comp-text/download/@ali/iceluna-comp-text-1.0.4.tgz"}; + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/addon/index.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/addon/index.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/regenerator/index.js")); + +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/asyncToGenerator.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/assertThisInitialized.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _appContext = _interopRequireDefault(__webpack_require__(/*! ../../context/appContext */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js")); + +var _utils = __webpack_require__(/*! ../../utils */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var Addon = +/*#__PURE__*/ +function (_PureComponent) { + (0, _inherits2["default"])(Addon, _PureComponent); + + function Addon(props, context) { + var _this; + + (0, _classCallCheck2["default"])(this, Addon); + _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(Addon).call(this, props, context)); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "open", function () { + return true; + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "close", function () { + return true; + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "goldlog", function (goKey, params) { + var _ref = _this.props.config || {}, + addonKey = _ref.addonKey, + _ref$addonConfig = _ref.addonConfig, + addonConfig = _ref$addonConfig === void 0 ? {} : _ref$addonConfig; + + (0, _utils.goldlog)(goKey, _objectSpread({ + addonKey: addonKey, + "package": addonConfig["package"], + version: addonConfig.version + }, _this.appHelper.logParams, {}, params), 'addon'); + }); + + if ((0, _utils.isEmpty)(props.config) || !props.config.addonKey) { + console.warn('luna addon has wrong config'); + return (0, _possibleConstructorReturn2["default"])(_this); + } // 插件上下文中的appHelper使用IDE的appHelper + + + context.appHelper = window.__ctx && window.__ctx.appHelper || context.appHelper; + context.locale = props.locale; + context.messages = props.messages; // 注册插件 + + _this.appHelper = context.appHelper; + var locale = props.locale, + messages = props.messages; + _this.i18n = (0, _utils.generateI18n)(locale, messages); + _this.addonKey = props.config.addonKey; + _this.appHelper.addons = _this.appHelper.addons || {}; + _this.appHelper.addons[_this.addonKey] = (0, _assertThisInitialized2["default"])(_this); + return _this; + } + + (0, _createClass2["default"])(Addon, [{ + key: "componentWillUnmount", + value: function () { + var _componentWillUnmount = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee() { + var config; + return _regenerator["default"].wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + // 销毁插件 + config = this.props.config || {}; + + if (config && this.appHelper.addons) { + delete this.appHelper.addons[config.addonKey]; + } + + case 2: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + + function componentWillUnmount() { + return _componentWillUnmount.apply(this, arguments); + } + + return componentWillUnmount; + }() + }, { + key: "render", + value: function render() { + return null; + } + }, { + key: "utils", + get: function get() { + return this.appHelper.utils; + } + }, { + key: "constants", + get: function get() { + return this.appHelper.constants; + } + }, { + key: "history", + get: function get() { + return this.appHelper.history; + } + }, { + key: "location", + get: function get() { + return this.appHelper.location; + } + }]); + return Addon; +}(_react.PureComponent); + +exports["default"] = Addon; +(0, _defineProperty2["default"])(Addon, "displayName", 'lunaAddon'); +(0, _defineProperty2["default"])(Addon, "propTypes", { + config: _propTypes["default"].object, + locale: _propTypes["default"].string, + messages: _propTypes["default"].object +}); +(0, _defineProperty2["default"])(Addon, "defaultProps", { + config: {} +}); +(0, _defineProperty2["default"])(Addon, "contextType", _appContext["default"]); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/canvas/index.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/canvas/index.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/extends.js")); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/objectWithoutProperties.js")); + +var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/toConsumableArray.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/assertThisInitialized.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/_react-dom@16.12.0@react-dom/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js")); + +var _event = __webpack_require__(/*! @ali/b3-one/lib/event */ "./node_modules/_@ali_b3-one@0.0.17@@ali/b3-one/lib/event.js"); + +var _appHelper = _interopRequireDefault(__webpack_require__(/*! ../../utils/appHelper */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/appHelper.js")); + +var _schemaHelper = _interopRequireDefault(__webpack_require__(/*! ../../utils/schemaHelper */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/schemaHelper.js")); + +var _dndHelper = _interopRequireDefault(__webpack_require__(/*! ../../utils/dndHelper */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/dndHelper.js")); + +var _engine = _interopRequireDefault(__webpack_require__(/*! ../../engine */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/index.js")); + +var _compFactory = _interopRequireDefault(__webpack_require__(/*! ../../hoc/compFactory */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/hoc/compFactory.js")); + +var _utils = __webpack_require__(/*! ../../utils */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +__webpack_require__(/*! ./index.scss */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/canvas/index.scss"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var DESIGN_MODE = { + EXTEND: 'extend', + BORDER: 'border', + PREVIEW: 'preview' +}; +var DEFAULT_PLACEHOLDER = { + emptyImage: '//img.alicdn.com/tfs/TB1zpkUoUT1gK0jSZFhXXaAtVXa-620-430.png', + emptyText: '当前页面为空~\n请拖拽组件放入页面容器内吧!', + nullImage: '//img.alicdn.com/tfs/TB1m_oSoND1gK0jSZFsXXbldVXa-620-430.png', + nullText: '编辑内容不存在~!' +}; + +var Canvas = +/*#__PURE__*/ +function (_PureComponent) { + (0, _inherits2["default"])(Canvas, _PureComponent); + + function Canvas(_props) { + var _this; + + (0, _classCallCheck2["default"])(this, Canvas); + _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(Canvas).call(this, _props)); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleMaterialMove", function (_ref) { + var lunaKey = _ref.lunaKey, + targetKey = _ref.targetKey, + direction = _ref.direction; + var appHelper = _this.appHelper; + appHelper.schemaHelper.move(lunaKey, targetKey, direction); + appHelper.emit('behavior.record'); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleMaterialAdd", function (_ref2) { + var schema = _ref2.schema, + targetKey = _ref2.targetKey, + direction = _ref2.direction; + + if (!(0, _utils.isSchema)(schema)) { + throw new Error('物料schema结构异常,无法添加!'); + } + + var appHelper = _this.appHelper; + var addSchema = Array.isArray(schema) ? schema[0] : schema; // 对于没有设置文件名的容器组件,交给画布外层处理 + + if ((0, _utils.isFileSchema)(addSchema) && !addSchema.fileName) { + return appHelper.emit('onFileNameMaterial.add', { + schema: addSchema, + targetKey: targetKey, + direction: direction + }); + } + + var addKey = appHelper.schemaHelper.add(schema, targetKey, direction); + appHelper.emit('behavior.record'); + + _this.autoSelectComponent(addKey); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleMaterialRemove", function (lunaKey) { + var appHelper = _this.appHelper; + var schemaHelper = appHelper.schemaHelper; + var currCompSchema = schemaHelper.schemaMap[lunaKey]; // 获取当前删除物料的相邻物料 + + var nextCompSchema = _utils.jsonuri.get(schemaHelper.schema, currCompSchema.__ctx.lunaPath.replace(/\/(\d+)$/, function (res, idx) { + return "/".concat(parseInt(idx) + 1); + })); + + var activeKey = nextCompSchema && nextCompSchema.__ctx.lunaKey || currCompSchema.__ctx.parentKey; + appHelper.schemaHelper.remove(lunaKey); + appHelper.emit('behavior.record'); + + _this.autoSelectComponent(activeKey); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleMaterialMoveUp", function (lunaKey) { + var appHelper = _this.appHelper; + appHelper.schemaHelper && appHelper.schemaHelper.slide(lunaKey, 'up'); + appHelper.emit('behavior.record'); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleMaterialMoveDown", function (lunaKey) { + var appHelper = _this.appHelper; + appHelper.schemaHelper && appHelper.schemaHelper.slide(lunaKey, 'down'); + appHelper.emit('behavior.record'); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleMaterialCopy", function (lunaKey) { + var appHelper = _this.appHelper; + var addKey = appHelper.schemaHelper.copy(lunaKey); + appHelper.emit('behavior.record'); + + _this.autoSelectComponent(addKey); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleMaterialUpdate", function (_ref3) { + var lunaKey = _ref3.lunaKey, + props = _ref3.props, + propsKey = _ref3.propsKey; + var appHelper = _this.appHelper; + appHelper.schemaHelper.update(lunaKey, props); + appHelper.emit('behavior.record', { + lunaKey: lunaKey, + propsKey: propsKey + }); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleMaterialSelect", function (lunaKey, options) { + var appHelper = _this.appHelper; + if (appHelper.activeKey === lunaKey) return; + appHelper.set('activeKey', lunaKey); + appHelper.emit('material.select.change', lunaKey, options); + var preNode = document.querySelectorAll('[data-active=true]'); + if (preNode[0] && preNode[0].dataset.lunaKey === lunaKey) return; + (preNode || []).forEach(function (item) { + item.removeAttribute('data-active'); + item.removeAttribute('data-nochild'); + }); //判断是否容器组件且没有子元素 + + if (!lunaKey) { + window.parent.t = window.t = null; + return; + } + + var schema = appHelper.schemaHelper.schemaMap[lunaKey]; + if (!schema) return; + var componentInfo = appHelper.componentsMap[schema.componentName]; + var currentNode = document.querySelectorAll("[data-luna-key=".concat(lunaKey, "]")); + (currentNode || []).forEach(function (item) { + item.setAttribute('data-active', 'true'); + + if (componentInfo && componentInfo.isContainer && schema && (!schema.children || !schema.children.length)) { + item.setAttribute('data-nochild', 'true'); + } + }); // for debug + + var ctx = _this.appHelper.schemaHelper.compCtxMap[lunaKey]; + var ref = _this.appHelper.schemaHelper.compThisMap[lunaKey]; + var t = { + ctx: ctx, + schema: schema, + ref: ref + }; + t.__proto__ = ctx; + window.parent.t = window.t = t; + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleDesignModeChange", function (designMode) { + _this.appHelper.set('designMode', designMode); + + _this.forceUpdate(); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handlePreviewChange", function (isPreview) { + _this.appHelper.set('isPreview', isPreview); + + _this.forceUpdate(); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleUndoRedo", function (schema) { + _this.appHelper.schemaHelper.reset(schema); + + _this.autoSelectComponent(); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleSchemaReset", function (schema) { + _this.appHelper.schemaHelper.reset(schema); + + _this.appHelper.emit('behavior.record'); + + _this.autoSelectComponent(); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleReset", function () { + _this.updateCanvasStack(); + + _this.forceUpdate(); + + _this.updateStyle(); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleForceUpdate", function () { + _this.forceUpdate(); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleCanvasPush", function (_ref4) { + var schema = _ref4.schema, + lunaKey = _ref4.lunaKey, + name = _ref4.name; + var appHelper = _this.appHelper; + appHelper.emit('canvas.stack.beforePush'); + var canvasStack = _this.state.canvasStack; + var tempSchema = { + componentName: 'Temp', + fileName: 'temp', + props: {}, + children: (0, _utils.isJSSlot)(schema) ? schema.value : schema //兼容slot + + }; + var schemaHelper = new _schemaHelper["default"]((0, _utils.transformSchemaToPure)(tempSchema), _this.appHelper); + var schemaMap = _this.appHelper.schemaHelper.schemaMap || {}; + var compCtxMap = _this.appHelper.schemaHelper.compCtxMap || {}; + var currentComp = schemaMap[lunaKey]; + var undoRedoKey = "".concat(lunaKey, "_").concat(canvasStack.length); //若是第一层下钻需要先给最上层加上从appHelper中获取的undoRedoKey + + if (canvasStack.length === 1) { + canvasStack[0].undoRedoKey = _this.appHelper.undoRedoKey; + } + + var currentData = { + lunaKey: lunaKey, + lunaPath: currentComp.__ctx.lunaPath, + name: name, + schema: schema, + schemaHelper: schemaHelper, + ctx: compCtxMap[lunaKey], + undoRedoKey: undoRedoKey, + componentName: currentComp.componentName + }; + appHelper.set('schemaHelper', schemaHelper); + appHelper.undoRedoHelper && appHelper.undoRedoHelper.create(undoRedoKey, tempSchema); + appHelper.set('undoRedoKey', undoRedoKey); + appHelper.set('activeKey', null); + + _this.setState({ + canvasStack: [].concat((0, _toConsumableArray2["default"])(_this.state.canvasStack), [currentData]) + }, function () { + _this.appHelper.set('canvasStack', _this.state.canvasStack); + + _this.appHelper.emit('canvas.stack.afterPush', currentData, _this.state.canvasStack); + + _this.autoSelectComponent(); + }); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleCanvasPop", function () { + var canvasStack = _this.state.canvasStack; + + if (canvasStack.length > 1) { + _this.handleCanvasJump(null, true); + } + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleCanvasJump", function (idx, isPop) { + var canvasStack = _this.state.canvasStack; + var appHelper = _this.appHelper; + var preIdx = idx + 1; + + if (isPop) { + appHelper.emit('canvas.stack.beforePop'); + preIdx = canvasStack.length - 1; + idx = preIdx - 1; + } else { + appHelper.emit('canvas.stack.beforeJump'); + } + + if (idx < 0 || idx > canvasStack.length - 1) return; + var preData = canvasStack[preIdx]; + var currentData = canvasStack[idx]; + appHelper.set('schemaHelper', currentData.schemaHelper); + appHelper.set('undoRedoKey', currentData.undoRedoKey); + appHelper.undoRedoHelper && appHelper.undoRedoHelper["delete"](preData.undoRedoKey); + + _this.setState({ + canvasStack: canvasStack.slice(0, idx + 1) + }, function () { + appHelper.set('canvasStack', _this.state.canvasStack); + appHelper.schemaHelper.reset(appHelper.schemaHelper.schema); + appHelper.emit('behavior.record'); + appHelper.emit("canvas.stack.".concat(isPop ? 'afterPop' : 'afterJump'), preData, _this.state.canvasStack); + + _this.autoSelectComponent(preData.lunaKey); + }); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleCompGetCtx", function (schema, ctx) { + var lunaKey = schema && schema.__ctx && schema.__ctx.lunaKey; + if (!lunaKey) return; // console.log('+++++ getCtx', lunaKey, ctx); + + _this.appHelper.schemaHelper.compCtxMap[lunaKey] = ctx; // for debug + + if (_this.appHelper.activeKey && lunaKey === _this.appHelper.activeKey) { + var ref = _this.appHelper.schemaHelper.compThisMap[lunaKey]; + var t = { + ctx: ctx, + schema: schema, + ref: ref + }; + t.__proto__ = ctx; + window.parent.t = window.t = t; + } + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleCompGetRef", function (schema, ref, topLevel) { + var lunaKey = schema && schema.__ctx && schema.__ctx.lunaKey; + if (!lunaKey) return; // console.log('----- getRef', lunaKey, ref); + + var schemaHelper = _this.appHelper.schemaHelper; + schemaHelper.compThisMap[lunaKey] = ref; + + if (ref && !ref.__design) { + _this.updateDesignMode(ref, schema, topLevel); + + var didUpdate = ref.componentDidUpdate; + + ref.componentDidUpdate = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + didUpdate && didUpdate.apply(ref, args); + + _this.updateDesignMode(ref, schema, topLevel); + }; + + var willUnmount = ref.componentWillUnmount; + + ref.componentWillUnmount = function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + willUnmount && willUnmount.apply(ref, args); // console.log('----- destroy', lunaKey, ref); + + delete schemaHelper.compThisMap[lunaKey]; + delete schemaHelper.compCtxMap[lunaKey]; + }; + + ref.__design = true; + } + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleDnd", function (type, ev, schema) { + var lunaKey = schema && schema.__ctx && schema.__ctx.lunaKey; + var designMode = _this.appHelper.designMode; + if (!lunaKey || ![DESIGN_MODE.EXTEND, DESIGN_MODE.BORDER].includes(designMode)) return; + var dndHelper = _this.appHelper && _this.appHelper.dndHelper; + + if (dndHelper) { + dndHelper["handle".concat(type)](ev, lunaKey); + } + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "autoSelectComponent", function (lunaKey) { + var appHelper = _this.appHelper; // 若未指定需要选中的组件,且当前有选中的组件不做处理 + + if (appHelper.activeKey && !lunaKey) return; + + if (!lunaKey) { + // 若没有指定的组件,且当前又没有选中组件,默认选中顶部组件,如果是下钻编辑则默认选中第一个子组件 + var schema = appHelper.schemaHelper.schema; + + if (schema) { + if (schema.componentName === 'Temp') { + lunaKey = schema.children && schema.children[0] && schema.children[0].__ctx.lunaKey; + } else { + lunaKey = schema.__ctx.lunaKey; + } + } + } + + appHelper.emit('material.select', lunaKey); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "generateLowComps", function () { + var components = _this.props.components; + + var _ref5 = _this.canvasAppHelper || {}, + utils = _ref5.utils, + constants = _ref5.constants; + + var componentsMap = _this.appHelper.componentsMap || {}; + Object.keys(componentsMap).forEach(function (key) { + var comp = componentsMap[key]; // 对自定义组件做特殊处理 + + if (comp.version === '0.0.0' && comp.code) { + var schema = (0, _utils.parseObj)(comp.code); + + if ((0, _utils.isFileSchema)(schema) && schema.componentName === 'Component') { + components[comp.name] = (0, _compFactory["default"])(schema, components, componentsMap, { + utils: utils, + constants: constants + }); + } + } + }); + return components; + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "updateStyle", function () { + var entityInfo = _this.appHelper.entityInfo || {}; + var blockSchemaMap = _this.appHelper.schemaHelper && _this.appHelper.schemaHelper.blockSchemaMap || {}; + var componentsMap = _this.appHelper.componentsMap || {}; + var cssMap = {}; // 区块中的样式 + + Object.keys(blockSchemaMap).forEach(function (item) { + var schema = blockSchemaMap[item]; + cssMap[schema.fileName] = schema.css || schema.__ctx && schema.__ctx.css || ''; + }); // 低代码自定义组件中的样式 + + Object.keys(componentsMap).forEach(function (item) { + var comp = componentsMap[item]; // 对自定义组件做特殊处理 + + if (comp.version === '0.0.0' && comp.code && comp.css) { + cssMap[comp.name] = comp.css; + } + }); + cssMap.__global = entityInfo.css || ''; + if ((0, _utils.shallowEqual)(_this.cacheCssMap, cssMap)) return; + _this.cacheCssMap = cssMap; + var __global = cssMap.__global, + other = (0, _objectWithoutProperties2["default"])(cssMap, ["__global"]); + (0, _utils.addCssTag)('luna-canvas-style', "".concat(__global, "\n").concat(Object.keys(other || {}).map(function (item) { + return cssMap[item]; + }).join('\n'))); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "updateCanvasStack", function () { + var canvasStack = _this.state.canvasStack; + if (canvasStack.length < 2) return; + + for (var idx = canvasStack.length - 1; idx > 0; idx--) { + var currentData = canvasStack[idx]; + var lunaPath = currentData.lunaPath, + name = currentData.name, + schemaHelper = currentData.schemaHelper, + schema = currentData.schema; + var preData = canvasStack[idx - 1]; + var data = schemaHelper.getPureSchema().children; // 如果情况内容则删除属性 + + if ((0, _utils.isEmpty)(data)) { + _utils.jsonuri.rm(preData.schemaHelper.schema, name === 'children' ? "".concat(lunaPath, "/children") : "".concat(lunaPath, "/props/").concat(name.replace('.', '/'))); + + continue; + } + + if ((0, _utils.isJSSlot)(schema)) { + data = _objectSpread({}, schema, { + value: data + }); + } else if (name !== 'children') { + data = { + type: 'JSSlot', + value: data + }; + } + + _utils.jsonuri.set(preData.schemaHelper.schema, name === 'children' ? "".concat(lunaPath, "/children") : "".concat(lunaPath, "/props/").concat(name.replace('.', '/')), data); + } + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "updateDesignMode", function (ref, schema, topLevel) { + if (!ref || ref && ref.current === null || !schema.__ctx) return; + var appHelper = _this.appHelper; + var activeKey = appHelper.activeKey, + isPreview = appHelper.isPreview, + viewPortConfig = appHelper.viewPortConfig; + var designMode = isPreview ? 'preview' : appHelper.designMode; + + var node = _reactDom["default"].findDOMNode(ref.current || ref); + + if (!node || !node.getAttribute) return; // 渲染引擎可以通过设置__disableDesignMode属性的方式阻止组件的可视模式; + + var hasDesignMode = [DESIGN_MODE.EXTEND, DESIGN_MODE.BORDER].includes(designMode) && !ref.props.__disableDesignMode; + node.setAttribute('data-design-mode', designMode && hasDesignMode ? "luna-design-".concat(designMode) : ''); + + if (topLevel) { + node.setAttribute('top-container', true); + } + + var lunaKey = schema.__ctx.lunaKey; + var instanceName = schema.componentName + (top.window.__isDebug ? (lunaKey || '_').split('_')[1] : ''); + + switch (schema.componentName) { + case 'Page': + instanceName = '页面容器 ' + instanceName; + break; + + case 'Block': + instanceName = '区块容器 ' + instanceName; + break; + + case 'Component': + instanceName = '低代码组件容器 ' + instanceName; + break; + + case 'Addon': + instanceName = '插件容器 ' + instanceName; + break; + + case 'Temp': + instanceName = '下钻编辑器容器'; + } + + if (topLevel && viewPortConfig) { + node.style.transform = "scale(".concat(viewPortConfig.scale ? viewPortConfig.scale / 100 : 1, ")"); + } + + node.setAttribute('data-instance-name', instanceName); + node.setAttribute('data-luna-key', lunaKey); + node.setAttribute('data-luna-path', schema.__ctx.lunaPath); + + if (hasDesignMode) { + if (activeKey && activeKey === lunaKey) { + node.setAttribute('data-active', true); + } else { + node.removeAttribute('data-active'); + } // 点击 + + + if (!node.compEvent && schema.componentName !== 'Temp') { + node.compEvent = function (ev) { + ev.stopPropagation(); + appHelper.emit('material.select', lunaKey, { + isFromCanvas: true + }); + }; + + (0, _event.on)(node, 'mousedown', node.compEvent, false); + } // drag and drop + + + if (!node.draggableFlag) { + if (topLevel) { + node.ondragleave = function (ev) { + return _this.handleDnd('DragLeave', ev, schema); + }; + + node.ondrop = function (ev) { + return _this.handleDnd('Drop', ev, schema); + }; + } else { + node.setAttribute('draggable', 'true'); + + node.ondragstart = function (ev) { + return _this.handleDnd('DragStart', ev, schema); + }; + + node.ondragend = function (ev) { + return _this.handleDnd('DragEnd', ev, schema); + }; + } + + node.ondragover = function (ev) { + return _this.handleDnd('DragOver', ev, schema); + }; + + node.draggableFlag = true; + } + } else { + //点击 + if (node.compEvent) { + (0, _event.off)(node, 'mousedown', node.compEvent, false); + delete node.compEvent; + } //drag and drop + + + if (node.draggableFlag) { + node.removeAttribute('draggable'); + delete node.ondragstart; + delete node.ondragover; + delete node.ondragend; + delete node.ondragleave; + delete node.ondrop; + delete node.draggableFlag; + } + } + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderCanvasStack", function () { + var canvasStack = _this.state.canvasStack; + var _this$props = _this.props, + engine = _this$props.engine, + utils = _this$props.utils; + var lastIndex = canvasStack.length - 1; + var appHelper = _this.appHelper; + var canvasAppHelper = _this.canvasAppHelper; + var designMode = appHelper.isPreview ? 'preview' : appHelper.designMode; // 注入entityInfo中的内容 + + var entityInfo = appHelper.entityInfo || {}; + + if (entityInfo.utils) { + canvasAppHelper.set('utils', (0, _utils.generateUtils)(utils, (0, _utils.parseObj)(entityInfo.utils))); + } else { + canvasAppHelper.set('utils', utils); + } + + canvasAppHelper.set('constants', (0, _utils.parseObj)(entityInfo && entityInfo.constants || {})); + canvasAppHelper.set('history', appHelper.history); + canvasAppHelper.set('location', appHelper.location); + canvasAppHelper.set('match', appHelper.match); + canvasAppHelper.set('componentsMap', appHelper.componentsMap); + var Engine = engine; + return (canvasStack || []).map(function (item, idx) { + return _react["default"].createElement("div", { + className: (0, _classnames["default"])('engine-wrapper', designMode, item.schemaHelper.schema && item.schemaHelper.schema.props.style && { + 'fixed-width': item.schemaHelper.schema.props.style.width, + 'fixed-height': item.schemaHelper.schema.props.style.height + }), + key: "".concat(item.lunaKey, "_").concat(item.name) + }, _react["default"].createElement(Engine, { + schema: item.schemaHelper.schema, + __ctx: item.ctx, + designMode: designMode, + appHelper: canvasAppHelper, + components: canvasAppHelper.components, + componentsMap: appHelper.componentsMap, + suspended: idx !== lastIndex, + onCompGetCtx: _this.handleCompGetCtx, + onCompGetRef: _this.handleCompGetRef + })); + }); + }); + _this.appHelper = _props.appHelper || new _appHelper["default"](); + + if (!_this.appHelper.schemaHelper) { + _this.appHelper.set('schemaHelper', new _schemaHelper["default"](_props.initSchema || {}, _this.appHelper)); + } + + _this.appHelper.set('basicSchemaHelper', _this.appHelper.schemaHelper); + + if (!_this.appHelper.dndHelper) { + _this.appHelper.set('dndHelper', new _dndHelper["default"](_this.appHelper)); + } + + _this.appHelper.dndHelper.setCanvasWin(window); + + if (_this.appHelper.designMode === undefined) { + _this.appHelper.designMode = 'extend'; + } + + _this.canvasAppHelper = new _appHelper["default"](); + window.__ctx = { + appHelper: _this.appHelper, + canvasAppHelper: _this.canvasAppHelper, + components: _this.props.components + }; + window.goldlog = window.goldlog || window.parent.goldlog; + _this.state = { + canvasStack: [{ + lunaKey: 'root', + lunaPath: '', + name: 'root', + schemaHelper: _this.appHelper.schemaHelper, + schema: _this.appHelper.schemaHelper.get('schema') + }] + }; + + _this.appHelper.set('canvasStack', _this.state.canvasStack); + + return _this; + } + + (0, _createClass2["default"])(Canvas, [{ + key: "componentDidMount", + value: function componentDidMount() { + var appHelper = this.appHelper; + appHelper.batchOn(['behavior.undo', 'behavior.redo'], this.handleUndoRedo); + appHelper.on('schema.reset', this.handleSchemaReset); + appHelper.on('material.move', this.handleMaterialMove); + appHelper.on('material.add', this.handleMaterialAdd); + appHelper.on('material.remove', this.handleMaterialRemove); + appHelper.on('material.up', this.handleMaterialMoveUp); + appHelper.on('material.down', this.handleMaterialMoveDown); + appHelper.on('material.copy', this.handleMaterialCopy); + appHelper.on('material.update', this.handleMaterialUpdate); + appHelper.on('material.select', this.handleMaterialSelect); + appHelper.on('schemaHelper.schema.afterUpdate', this.handleReset); + appHelper.on('designMode.change', this.handleDesignModeChange); + appHelper.on('preview.change', this.handlePreviewChange); + appHelper.on('canvas.stack.push', this.handleCanvasPush); + appHelper.on('canvas.stack.pop', this.handleCanvasPop); + appHelper.on('canvas.stack.jump', this.handleCanvasJump); + appHelper.on('style.update', this.updateStyle); + appHelper.batchOn(['utils.update', 'constants.update', 'viewPort.update'], this.handleForceUpdate); + (0, _utils.registShortCuts)(this.props.shortCuts, this.appHelper); + this.appHelper.set('canvas', this); + this.props.onCreate(this.appHelper); + appHelper.emit('canvas.ready', this); + (0, _utils.goldlog)('EXP', { + action: 'appear' + }, 'canvas'); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + var appHelper = this.appHelper; + appHelper.batchOff(['behavior.undo', 'behavior.redo'], this.handleUndoRedo); + appHelper.on('schema.reset', this.handleSchemaReset); + appHelper.off('material.move', this.handleMaterialMove); + appHelper.off('material.add', this.handleMaterialAdd); + appHelper.off('material.remove', this.handleMaterialRemove); + appHelper.off('material.up', this.handleMaterialMoveUp); + appHelper.off('material.down', this.handleMaterialMoveDown); + appHelper.off('material.copy', this.handleMaterialCopy); + appHelper.off('material.update', this.handleMaterialUpdate); + appHelper.off('material.select', this.handleMaterialSelect); + appHelper.off('schemaHelper.schema.afterUpdate', this.handleReset); + appHelper.off('designMode.change', this.handleDesignModeChange); + appHelper.off('preview.change', this.handlePreviewChange); + appHelper.off('canvas.stack.push', this.handleCanvasPush); + appHelper.off('canvas.stack.pop', this.handleCanvasPop); + appHelper.off('canvas.stack.jump', this.handleCanvasJump); + appHelper.off('style.update', this.updateStyle); + appHelper.batchOff(['utils.update', 'constants.update', 'viewPort.update'], this.handleForceUpdate); + (0, _utils.unRegistShortCuts)(this.props.shortCuts); + } // 消息处理 + + }, { + key: "render", + value: function render() { + var canvasStack = this.state.canvasStack; + var lastIndex = canvasStack.length - 1; + var schema = canvasStack[lastIndex] && canvasStack[lastIndex].schemaHelper.schema; + var components = this.generateLowComps(); + this.canvasAppHelper.set('components', components); + var appHelper = this.appHelper; + var _appHelper$entityInfo = appHelper.entityInfo, + entityInfo = _appHelper$entityInfo === void 0 ? {} : _appHelper$entityInfo, + _appHelper$viewPortCo = appHelper.viewPortConfig, + viewPortConfig = _appHelper$viewPortCo === void 0 ? {} : _appHelper$viewPortCo, + _appHelper$canvasPlac = appHelper.canvasPlaceholder, + canvasPlaceholder = _appHelper$canvasPlac === void 0 ? {} : _appHelper$canvasPlac; + + var placeholder = _objectSpread({}, DEFAULT_PLACEHOLDER, {}, canvasPlaceholder); + + var layoutComp = entityInfo.layoutInfo && entityInfo.layoutInfo.name; + var layoutProps = entityInfo.layoutInfo && entityInfo.layoutInfo.realProps || {}; + var Layout = layoutComp && components[layoutComp]; + var hideLayout = viewPortConfig.hideLayout; + var isDrillDown = canvasStack && canvasStack.length > 1; + var isSchemaEmpty = (0, _utils.isSchema)(schema) && (0, _utils.isEmpty)(schema.children); + var isSchemaNull = schema === null; + var canvasStyle = {}; + + if (!isDrillDown) { + if (isSchemaEmpty) { + canvasStyle.backgroundImage = "url(".concat(placeholder.emptyImage, ")"); + } else if (isSchemaNull) { + canvasStyle.backgroundImage = "url(".concat(placeholder.nullImage, ")"); + } + } + + return _react["default"].createElement("div", { + className: (0, _classnames["default"])('luna-canvas-inner', { + empty: isSchemaEmpty, + "null": isSchemaNull, + 'drill-down': isDrillDown + }), + style: canvasStyle, + "data-placeholder-text": isSchemaEmpty ? placeholder.emptyText : isSchemaNull ? placeholder.nullText : '' + }, Layout && !hideLayout ? _react["default"].createElement(Layout, (0, _extends2["default"])({ + location: appHelper.location, + history: appHelper.history + }, layoutProps), this.renderCanvasStack()) : this.renderCanvasStack()); + } + }]); + return Canvas; +}(_react.PureComponent); + +exports["default"] = Canvas; +(0, _defineProperty2["default"])(Canvas, "displayName", 'Canvas'); +(0, _defineProperty2["default"])(Canvas, "propTypes", { + appHelper: _propTypes["default"].object, + components: _propTypes["default"].object, + engine: _propTypes["default"].element, + onCreate: _propTypes["default"].func, + initSchema: _propTypes["default"].object, + shortCuts: _propTypes["default"].array, + utils: _propTypes["default"].object +}); +(0, _defineProperty2["default"])(Canvas, "defaultProps", { + components: {}, + engine: _engine["default"], + onCreate: function onCreate() {}, + initSchema: {}, + shortCuts: [], + utils: {} +}); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/canvas/index.scss": +/*!******************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/canvas/index.scss ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694896363 + var cssReload = __webpack_require__(/*! ../../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/visualDom/index.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/visualDom/index.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +__webpack_require__(/*! ./index.scss */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/visualDom/index.scss"); + +var VisualDom = +/*#__PURE__*/ +function (_PureComponent) { + (0, _inherits2["default"])(VisualDom, _PureComponent); + + function VisualDom() { + (0, _classCallCheck2["default"])(this, VisualDom); + return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(VisualDom).apply(this, arguments)); + } + + (0, _createClass2["default"])(VisualDom, [{ + key: "render", + value: function render() { + var _this$props = this.props, + children = _this$props.children, + cell = _this$props.cell, + title = _this$props.title, + label = _this$props.label, + text = _this$props.text, + __componentName = _this$props.__componentName; + var mainContent = children; + + if (cell && typeof cell === 'function') { + mainContent = cell(); + } + + return _react["default"].createElement("div", { + className: "visual-dom" + }, _react["default"].createElement("div", { + className: "panel-container" + }, _react["default"].createElement("span", { + className: "title" + }, title || label || text || __componentName), _react["default"].createElement("div", { + className: "content" + }, mainContent))); + } + }]); + return VisualDom; +}(_react.PureComponent); + +exports["default"] = VisualDom; +(0, _defineProperty2["default"])(VisualDom, "displayName", 'VisualDom'); +(0, _defineProperty2["default"])(VisualDom, "propTypes", { + children: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].arrayOf(_propTypes["default"].element)]) +}); +(0, _defineProperty2["default"])(VisualDom, "defaultProps", { + children: null +}); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/visualDom/index.scss": +/*!*********************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/visualDom/index.scss ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694896668 + var cssReload = __webpack_require__(/*! ../../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _react = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); + +var context = window.__appContext = (0, _react.createContext)({}); +var _default = context; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/addonEngine.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/addonEngine.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/regenerator/index.js")); + +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/asyncToGenerator.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/assertThisInitialized.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/get.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var _appContext = _interopRequireDefault(__webpack_require__(/*! ../context/appContext */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js")); + +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js")); + +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/base.js")); + +var _utils = __webpack_require__(/*! ../utils */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var debug = (0, _debug["default"])('engine:addon'); + +var AddonEngine = +/*#__PURE__*/ +function (_BaseEngine) { + (0, _inherits2["default"])(AddonEngine, _BaseEngine); + (0, _createClass2["default"])(AddonEngine, null, [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(props, state) { + debug("comp.getDerivedStateFromProps"); + var func = props.__schema.lifeCycles && props.__schema.lifeCycles.getDerivedStateFromProps; + + if (func) { + return func(props, state); + } + + return null; + } + }]); + + function AddonEngine(props, context) { + var _this; + + (0, _classCallCheck2["default"])(this, AddonEngine); + _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(AddonEngine).call(this, props, context)); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "goldlog", function (goKey, params) { + var _ref = _this.props.config || {}, + addonKey = _ref.addonKey, + _ref$addonConfig = _ref.addonConfig, + addonConfig = _ref$addonConfig === void 0 ? {} : _ref$addonConfig; + + (0, _utils.goldlog)(goKey, _objectSpread({ + addonKey: addonKey, + "package": addonConfig["package"], + version: addonConfig.version + }, _this.appHelper.logParams, {}, params), 'addon'); + }); + + _this.__generateCtx({ + component: (0, _assertThisInitialized2["default"])(_this) + }); + + var schema = props.__schema || {}; + _this.state = _this.__parseData(schema.state || {}); + + if ((0, _utils.isEmpty)(props.config) || !props.config.addonKey) { + console.warn('luna addon has wrong config'); + _this.state.__hasError = true; + return (0, _possibleConstructorReturn2["default"])(_this); + } // 注册插件 + + + _this.addonKey = props.config.addonKey; + _this.appHelper.addons = _this.appHelper.addons || {}; + _this.appHelper.addons[_this.addonKey] = (0, _assertThisInitialized2["default"])(_this); + + _this.__initDataSource(props); + + _this.open = _this.open || function () {}; + + _this.close = _this.close || function () {}; + + _this.__setLifeCycleMethods('constructor', arguments); + + debug("addon.constructor - ".concat(schema.fileName)); + return _this; + } + + (0, _createClass2["default"])(AddonEngine, [{ + key: "getSnapshotBeforeUpdate", + value: function () { + var _getSnapshotBeforeUpdate = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee() { + var _args = arguments; + return _regenerator["default"].wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(AddonEngine.prototype), "getSnapshotBeforeUpdate", this).apply(this, _args); + debug("addon.getSnapshotBeforeUpdate - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + + function getSnapshotBeforeUpdate() { + return _getSnapshotBeforeUpdate.apply(this, arguments); + } + + return getSnapshotBeforeUpdate; + }() + }, { + key: "componentDidMount", + value: function () { + var _componentDidMount = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee2() { + var _args2 = arguments; + return _regenerator["default"].wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(AddonEngine.prototype), "componentDidMount", this).apply(this, _args2); + debug("addon.componentDidMount - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context2.stop(); + } + } + }, _callee2, this); + })); + + function componentDidMount() { + return _componentDidMount.apply(this, arguments); + } + + return componentDidMount; + }() + }, { + key: "componentDidUpdate", + value: function () { + var _componentDidUpdate = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee3() { + var _args3 = arguments; + return _regenerator["default"].wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(AddonEngine.prototype), "componentDidUpdate", this).apply(this, _args3); + debug("addon.componentDidUpdate - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context3.stop(); + } + } + }, _callee3, this); + })); + + function componentDidUpdate() { + return _componentDidUpdate.apply(this, arguments); + } + + return componentDidUpdate; + }() + }, { + key: "componentWillUnmount", + value: function () { + var _componentWillUnmount = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee4() { + var config, + _args4 = arguments; + return _regenerator["default"].wrap(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(AddonEngine.prototype), "componentWillUnmount", this).apply(this, _args4); // 注销插件 + + config = this.props.config || {}; + + if (config && this.appHelper.addons) { + delete this.appHelper.addons[config.addonKey]; + } + + debug("addon.componentWillUnmount - ".concat(this.props.__schema.fileName)); + + case 4: + case "end": + return _context4.stop(); + } + } + }, _callee4, this); + })); + + function componentWillUnmount() { + return _componentWillUnmount.apply(this, arguments); + } + + return componentWillUnmount; + }() + }, { + key: "componentDidCatch", + value: function () { + var _componentDidCatch = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee5(e) { + var _args5 = arguments; + return _regenerator["default"].wrap(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(AddonEngine.prototype), "componentDidCatch", this).apply(this, _args5); + debug("addon.componentDidCatch - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context5.stop(); + } + } + }, _callee5, this); + })); + + function componentDidCatch(_x) { + return _componentDidCatch.apply(this, arguments); + } + + return componentDidCatch; + }() + }, { + key: "render", + value: function render() { + var __schema = this.props.__schema; + + if (!(0, _utils.isSchema)(__schema, true) || __schema.componentName !== 'Addon') { + return '插件schema结构异常!'; + } + + debug("addon.render - ".concat(__schema.fileName)); + + this.__generateCtx({ + component: this + }); + + this.__render(); + + var _this$__parseData = this.__parseData(__schema.props), + id = _this$__parseData.id, + className = _this$__parseData.className, + style = _this$__parseData.style; + + return _react["default"].createElement("div", { + ref: this.__getRef, + className: (0, _classnames["default"])('luna-addon', (0, _utils.getFileCssName)(__schema.fileName), className, this.props.className), + id: this.props.id || id, + style: _objectSpread({}, style, {}, this.props.style) + }, _react["default"].createElement(_appContext["default"].Provider, { + value: _objectSpread({}, this.context, { + compContext: this, + blockContext: this + }) + }, this.__createDom())); + } + }, { + key: "utils", + get: function get() { + var _ref2 = this.context.config || {}, + _ref2$utils = _ref2.utils, + utils = _ref2$utils === void 0 ? {} : _ref2$utils; + + return _objectSpread({}, this.appHelper.utils, {}, utils); + } + }]); + return AddonEngine; +}(_base["default"]); + +exports["default"] = AddonEngine; +(0, _defineProperty2["default"])(AddonEngine, "dislayName", 'addon-engine'); +(0, _defineProperty2["default"])(AddonEngine, "propTypes", { + config: _propTypes["default"].object, + __schema: _propTypes["default"].object +}); +(0, _defineProperty2["default"])(AddonEngine, "defaultProps", { + config: {}, + __schema: {} +}); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/base.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/base.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/regenerator/index.js")); + +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/asyncToGenerator.js")); + +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/typeof.js")); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/objectWithoutProperties.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/assertThisInitialized.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var _icelunaCompDiv = _interopRequireDefault(__webpack_require__(/*! @ali/iceluna-comp-div */ "./node_modules/_@ali_iceluna-comp-div@0.0.5@@ali/iceluna-comp-div/lib/index.js")); + +var _visualDom = _interopRequireDefault(__webpack_require__(/*! ../comp/visualDom */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/visualDom/index.js")); + +var _appContext = _interopRequireDefault(__webpack_require__(/*! ../context/appContext */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js")); + +var _dataHelper = _interopRequireDefault(__webpack_require__(/*! ../utils/dataHelper */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/dataHelper.js")); + +var _utils = __webpack_require__(/*! ../utils */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var debug = (0, _debug["default"])('engine:base'); +var DESIGN_MODE = { + EXTEND: 'extend', + BORDER: 'border', + PREVIEW: 'preview' +}; +var OVERLAY_LIST = ['Dialog', 'Overlay', 'Animate', 'ConfigProvider']; +var scopeIdx = 0; + +var BaseEngine = +/*#__PURE__*/ +function (_PureComponent) { + (0, _inherits2["default"])(BaseEngine, _PureComponent); + + function BaseEngine(_props, context) { + var _this; + + (0, _classCallCheck2["default"])(this, BaseEngine); + _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(BaseEngine).call(this, _props, context)); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "reloadDataSource", function () { + return new Promise(function (resolve, reject) { + debug('reload data source'); + + if (!_this.__dataHelper) { + _this.__showPlaceholder = false; + return resolve(); + } + + _this.__dataHelper.getInitData().then(function (res) { + _this.__showPlaceholder = false; + + if ((0, _utils.isEmpty)(res)) { + _this.forceUpdate(); + + return resolve(); + } + + _this.setState(res, resolve); + })["catch"](function (err) { + if (_this.__showPlaceholder) { + _this.__showPlaceholder = false; + + _this.forceUpdate(); + } + + reject(err); + }); + }); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "__setLifeCycleMethods", function (method, args) { + var lifeCycleMethods = (0, _utils.getValue)(_this.props.__schema, 'lifeCycles', {}); + + if (lifeCycleMethods[method]) { + try { + return lifeCycleMethods[method].apply((0, _assertThisInitialized2["default"])(_this), args); + } catch (e) { + console.error("[".concat(_this.props.__schema.componentName, "]\u751F\u547D\u5468\u671F").concat(method, "\u51FA\u9519"), e); + } + } + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "__bindCustomMethods", function () { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props; + var __schema = props.__schema; + var customMethodsList = Object.keys(__schema.methods || {}) || []; + _this.__customMethodsList && _this.__customMethodsList.forEach(function (item) { + if (!customMethodsList.includes(item)) { + delete _this[item]; + } + }); + _this.__customMethodsList = customMethodsList; + (0, _utils.forEach)(__schema.methods, function (val, key) { + _this[key] = val.bind((0, _assertThisInitialized2["default"])(_this)); + }); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "__generateCtx", function (ctx) { + var _this$context = _this.context, + pageContext = _this$context.pageContext, + compContext = _this$context.compContext; + + var obj = _objectSpread({ + page: pageContext, + component: compContext + }, ctx); + + (0, _utils.forEach)(obj, function (val, key) { + _this[key] = val; + }); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "__parseData", function (data, ctx) { + var __ctx = _this.props.__ctx; + return (0, _utils.parseData)(data, ctx || __ctx || (0, _assertThisInitialized2["default"])(_this)); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "__initDataSource", function () { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props; + var schema = props.__schema || {}; + var appHelper = props.__appHelper; + var dataSource = schema && schema.dataSource || {}; + _this.__dataHelper = new _dataHelper["default"]((0, _assertThisInitialized2["default"])(_this), dataSource, appHelper, function (config) { + return _this.__parseData(config); + }); + _this.dataSourceMap = _this.__dataHelper.dataSourceMap; // 设置容器组件占位,若设置占位则在初始异步请求完成之前用loading占位且不渲染容器组件内部内容 + + _this.__showPlaceholder = _this.__parseData(schema.props && schema.props.autoLoading) && (dataSource.list || []).some(function (item) { + return !!_this.__parseData(item.isInit); + }); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "__render", function () { + var schema = _this.props.__schema; + + _this.__setLifeCycleMethods('render'); + + var engine = _this.context.engine; + + if (engine) { + engine.props.onCompGetCtx(schema, (0, _assertThisInitialized2["default"])(_this)); // 画布场景才需要每次渲染bind自定义方法 + + if (engine.props.designMode) { + _this.__bindCustomMethods(); + + _this.dataSourceMap = _this.__dataHelper && _this.__dataHelper.updateConfig(schema.dataSource); + } + } + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "__getRef", function (ref) { + _this.__ref = ref; + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "__createDom", function () { + var _this$props = _this.props, + __schema = _this$props.__schema, + __ctx = _this$props.__ctx, + _this$props$__compone = _this$props.__components, + __components = _this$props$__compone === void 0 ? {} : _this$props$__compone; + + var self = {}; + self.__proto__ = __ctx || (0, _assertThisInitialized2["default"])(_this); + return _this.__createVirtualDom(__schema.children, self, { + schema: __schema, + Comp: __components[__schema.componentName] + }); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "__createVirtualDom", function (schema, self, parentInfo, idx) { + if (!schema) return null; + + var _ref = _this.props || {}, + appHelper = _ref.__appHelper, + _ref$__components = _ref.__components, + components = _ref$__components === void 0 ? {} : _ref$__components, + _ref$__componentsMap = _ref.__componentsMap, + componentsMap = _ref$__componentsMap === void 0 ? {} : _ref$__componentsMap; + + var _ref2 = _this.context || {}, + engine = _ref2.engine; + + if ((0, _utils.isJSExpression)(schema)) { + return (0, _utils.parseExpression)(schema, self); + } + + if (typeof schema === 'string') return schema; + + if (typeof schema === 'number' || typeof schema === 'boolean') { + return schema.toString(); + } + + if (Array.isArray(schema)) { + if (schema.length === 1) return _this.__createVirtualDom(schema[0], self, parentInfo); + return schema.map(function (item, idx) { + return _this.__createVirtualDom(item, self, parentInfo, item && item.__ctx && item.__ctx.lunaKey ? '' : idx); + }); + } //解析占位组件 + + + if (schema.componentName === 'Flagment' && schema.children) { + var tarChildren = (0, _utils.isJSExpression)(schema.children) ? (0, _utils.parseExpression)(schema.children, self) : schema.children; + return _this.__createVirtualDom(tarChildren, self, parentInfo); + } + + if (schema.$$typeof) { + return schema; + } + + if (!(0, _utils.isSchema)(schema)) return null; + var Comp = components[schema.componentName] || _icelunaCompDiv["default"]; + + if (schema.loop !== undefined) { + return _this.__createLoopVirtualDom(_objectSpread({}, schema, { + loop: (0, _utils.parseData)(schema.loop, self) + }), self, parentInfo, idx); + } + + var condition = schema.condition === undefined ? true : (0, _utils.parseData)(schema.condition, self); + if (!condition) return null; + var scopeKey = ''; // 判断组件是否需要生成scope,且只生成一次,挂在this.__compScopes上 + + if (Comp.generateScope) { + var key = (0, _utils.parseExpression)(schema.props.key, self); + + if (key) { + // 如果组件自己设置key则使用组件自己的key + scopeKey = key; + } else if (!schema.__ctx) { + // 在生产环境schema没有__ctx上下文,需要手动生成一个lunaKey + schema.__ctx = { + lunaKey: "luna".concat(++scopeIdx) + }; + scopeKey = schema.__ctx.lunaKey; + } else { + // 需要判断循环的情况 + scopeKey = schema.__ctx.lunaKey + (idx !== undefined ? "_".concat(idx) : ''); + } + + if (!_this.__compScopes[scopeKey]) { + _this.__compScopes[scopeKey] = Comp.generateScope((0, _assertThisInitialized2["default"])(_this), schema); + } + } // 如果组件有设置scope,需要为组件生成一个新的scope上下文 + + + if (scopeKey && _this.__compScopes[scopeKey]) { + var compSelf = _objectSpread({}, _this.__compScopes[scopeKey]); + + compSelf.__proto__ = self; + self = compSelf; + } // 容器类组件的上下文通过props传递,避免context传递带来的嵌套问题 + + + var otherProps = (0, _utils.isFileSchema)(schema) ? { + __schema: schema, + __appHelper: appHelper, + __components: components, + __componentsMap: componentsMap + } : {}; + + if (engine && engine.props.designMode) { + otherProps.__designMode = engine.props.designMode; + } + + var componentInfo = componentsMap[schema.componentName] || {}; + + var props = _this.__parseProps(schema.props, self, '', { + schema: schema, + Comp: Comp, + componentInfo: _objectSpread({}, componentInfo, { + props: (0, _utils.transformArrayToMap)(componentInfo.props, 'name') + }) + }); // 对于可以获取到ref的组件做特殊处理 + + + if ((0, _utils.acceptsRef)(Comp)) { + otherProps.ref = function (ref) { + var refProps = props.ref; + + if (refProps && typeof refProps === 'string') { + _this[refProps] = ref; + } + + engine && engine.props.onCompGetRef(schema, ref); + }; + } // scope需要传入到组件上 + + + if (scopeKey && _this.__compScopes[scopeKey]) { + props.__scope = _this.__compScopes[scopeKey]; + } + + if (schema.__ctx && schema.__ctx.lunaKey) { + if (!(0, _utils.isFileSchema)(schema)) { + engine && engine.props.onCompGetCtx(schema, self); + } + + props.key = props.key || "".concat(schema.__ctx.lunaKey, "_").concat(schema.__ctx.idx || 0, "_").concat(idx !== undefined ? idx : ''); + } else if (typeof idx === 'number' && !props.key) { + props.key = idx; + } + + var renderComp = function renderComp(props) { + return _react["default"].createElement(Comp, props, !(0, _utils.isFileSchema)(schema) && !!schema.children && _this.__createVirtualDom((0, _utils.isJSExpression)(schema.children) ? (0, _utils.parseExpression)(schema.children, self) : schema.children, self, { + schema: schema, + Comp: Comp + }) || null); + }; //设计模式下的特殊处理 + + + if (engine && [DESIGN_MODE.EXTEND, DESIGN_MODE.BORDER].includes(engine.props.designMode)) { + //对于overlay,dialog等组件为了使其在设计模式下显示,外层需要增加一个div容器 + if (OVERLAY_LIST.includes(schema.componentName)) { + var ref = otherProps.ref, + overlayProps = (0, _objectWithoutProperties2["default"])(otherProps, ["ref"]); + return _react["default"].createElement(_icelunaCompDiv["default"], { + ref: ref, + __designMode: engine.props.designMode + }, renderComp(_objectSpread({}, props, {}, overlayProps))); + } // 虚拟dom显示 + + + if (componentInfo && componentInfo.parentRule) { + var parentList = componentInfo.parentRule.split(','); + var parentSchema = parentInfo.schema, + parentComp = parentInfo.Comp; + + if (!parentList.includes(parentSchema.componentName) || parentComp !== components[parentSchema.componentName]) { + props.__componentName = schema.componentName; + Comp = _visualDom["default"]; + } else { + // 若虚拟dom在正常的渲染上下文中,就不显示设计模式了 + props.__disableDesignMode = true; + } + } + } + + return renderComp(_objectSpread({}, props, {}, otherProps)); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "__createLoopVirtualDom", function (schema, self, parentInfo, idx) { + if ((0, _utils.isFileSchema)(schema)) { + console.warn('file type not support Loop'); + return null; + } + + if (!Array.isArray(schema.loop)) return null; + var itemArg = schema.loopArgs && schema.loopArgs[0] || 'item'; + var indexArg = schema.loopArgs && schema.loopArgs[1] || 'index'; + return schema.loop.map(function (item, i) { + var _loopSelf; + + var loopSelf = (_loopSelf = {}, (0, _defineProperty2["default"])(_loopSelf, itemArg, item), (0, _defineProperty2["default"])(_loopSelf, indexArg, i), _loopSelf); + loopSelf.__proto__ = self; + return _this.__createVirtualDom(_objectSpread({}, schema, { + loop: undefined + }), loopSelf, parentInfo, idx ? "".concat(idx, "_").concat(i) : i); + }); + }); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "__parseProps", function (props, self, path, info) { + var schema = info.schema, + Comp = info.Comp, + _info$componentInfo = info.componentInfo, + componentInfo = _info$componentInfo === void 0 ? {} : _info$componentInfo; + var propInfo = (0, _utils.getValue)(componentInfo.props, path); + var propType = propInfo && propInfo.extra && propInfo.extra.propType; + var ignoreParse = schema.__ignoreParse || []; + + var checkProps = function checkProps(value) { + if (!propType) return value; + return (0, _utils.checkPropTypes)(value, path, propType, componentInfo.name) ? value : undefined; + }; + + var parseReactNode = function parseReactNode(data, params) { + if ((0, _utils.isEmpty)(params)) { + return checkProps(_this.__createVirtualDom(data, self, { + schema: schema, + Comp: Comp + })); + } else { + return checkProps(function () { + var _arguments = arguments; + var args = {}; + + if (Array.isArray(params) && params.length) { + params.map(function (item, idx) { + if (typeof item === 'string') { + args[item] = _arguments[idx]; + } else if (item && (0, _typeof2["default"])(item) === 'object') { + args[item.name] = _arguments[idx]; + } + }); + } + + args.__proto__ = self; + return self.__createVirtualDom(data, args, { + schema: schema, + Comp: Comp + }); + }); + } + }; // 判断是否需要解析变量 + + + if (ignoreParse.some(function (item) { + if (item instanceof RegExp) { + return item.test(path); + } + + return item === path; + })) { + return checkProps(props); + } + + if ((0, _utils.isJSExpression)(props)) { + props = (0, _utils.parseExpression)(props.trim(), self); // 只有当变量解析出来为模型结构的时候才会继续解析 + + if (!(0, _utils.isSchema)(props) && !(0, _utils.isJSSlot)(props)) return checkProps(props); + } + + if ((0, _utils.isJSFunction)(props)) { + props = props.value; + } + + if ((0, _utils.isJSSlot)(props)) { + var _props2 = props, + params = _props2.params, + value = _props2.value; + if (!(0, _utils.isSchema)(value) || (0, _utils.isEmpty)(value)) return undefined; + return parseReactNode(value, params); + } // 兼容通过componentInfo判断的情况 + + + if ((0, _utils.isSchema)(props)) { + var isReactNodeFunction = !!(propInfo && propInfo.type === 'ReactNode' && propInfo.props && propInfo.props.type === 'function'); + var isMixinReactNodeFunction = !!(propInfo && propInfo.type === 'Mixin' && propInfo.props && propInfo.props.types && propInfo.props.types.indexOf('ReactNode') > -1 && propInfo.props.reactNodeProps && propInfo.props.reactNodeProps.type === 'function'); + return parseReactNode(props, isReactNodeFunction ? propInfo.props.params : isMixinReactNodeFunction ? propInfo.props.reactNodeProps.params : null); + } else if (Array.isArray(props)) { + return checkProps(props.map(function (item, idx) { + return _this.__parseProps(item, self, path ? "".concat(path, ".").concat(idx) : idx, info); + })); + } else if (typeof props === 'function') { + return checkProps(props.bind(self)); + } else if (props && (0, _typeof2["default"])(props) === 'object') { + if (props.$$typeof) return checkProps(props); + var res = {}; + (0, _utils.forEach)(props, function (val, key) { + if (key.startsWith('__')) { + res[key] = val; + return; + } + + res[key] = _this.__parseProps(val, self, path ? "".concat(path, ".").concat(key) : key, info); + }); + return checkProps(res); + } else if (typeof props === 'string') { + return checkProps(props.trim()); + } + + return checkProps(props); + }); + _this.appHelper = _props.__appHelper; + _this.__compScopes = {}; + var locale = _props.locale, + messages = _props.messages; + _this.i18n = (0, _utils.generateI18n)(locale, messages); + + _this.__bindCustomMethods(_props); + + return _this; + } + + (0, _createClass2["default"])(BaseEngine, [{ + key: "getSnapshotBeforeUpdate", + value: function () { + var _getSnapshotBeforeUpdate = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee() { + var _args = arguments; + return _regenerator["default"].wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + this.__setLifeCycleMethods('getSnapshotBeforeUpdate', _args); + + case 1: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + + function getSnapshotBeforeUpdate() { + return _getSnapshotBeforeUpdate.apply(this, arguments); + } + + return getSnapshotBeforeUpdate; + }() + }, { + key: "componentDidMount", + value: function () { + var _componentDidMount = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee2() { + var _args2 = arguments; + return _regenerator["default"].wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + this.reloadDataSource(); + + this.__setLifeCycleMethods('componentDidMount', _args2); + + case 2: + case "end": + return _context2.stop(); + } + } + }, _callee2, this); + })); + + function componentDidMount() { + return _componentDidMount.apply(this, arguments); + } + + return componentDidMount; + }() + }, { + key: "componentDidUpdate", + value: function () { + var _componentDidUpdate = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee3() { + var _args3 = arguments; + return _regenerator["default"].wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + this.__setLifeCycleMethods('componentDidUpdate', _args3); + + case 1: + case "end": + return _context3.stop(); + } + } + }, _callee3, this); + })); + + function componentDidUpdate() { + return _componentDidUpdate.apply(this, arguments); + } + + return componentDidUpdate; + }() + }, { + key: "componentWillUnmount", + value: function () { + var _componentWillUnmount = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee4() { + var _args4 = arguments; + return _regenerator["default"].wrap(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + this.__setLifeCycleMethods('componentWillUnmount', _args4); + + case 1: + case "end": + return _context4.stop(); + } + } + }, _callee4, this); + })); + + function componentWillUnmount() { + return _componentWillUnmount.apply(this, arguments); + } + + return componentWillUnmount; + }() + }, { + key: "componentDidCatch", + value: function () { + var _componentDidCatch = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee5(e) { + var _args5 = arguments; + return _regenerator["default"].wrap(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + this.__setLifeCycleMethods('componentDidCatch', _args5); + + console.warn(e); + + case 2: + case "end": + return _context5.stop(); + } + } + }, _callee5, this); + })); + + function componentDidCatch(_x) { + return _componentDidCatch.apply(this, arguments); + } + + return componentDidCatch; + }() + }, { + key: "render", + value: function render() { + return null; + } + }, { + key: "utils", + get: function get() { + return this.appHelper && this.appHelper.utils; + } + }, { + key: "constants", + get: function get() { + return this.appHelper && this.appHelper.constants; + } + }, { + key: "history", + get: function get() { + return this.appHelper && this.appHelper.history; + } + }, { + key: "location", + get: function get() { + return this.appHelper && this.appHelper.location; + } + }, { + key: "match", + get: function get() { + return this.appHelper && this.appHelper.match; + } + }]); + return BaseEngine; +}(_react.PureComponent); + +exports["default"] = BaseEngine; +(0, _defineProperty2["default"])(BaseEngine, "dislayName", 'base-engine'); +(0, _defineProperty2["default"])(BaseEngine, "propTypes", { + locale: _propTypes["default"].string, + messages: _propTypes["default"].object, + __appHelper: _propTypes["default"].object, + __components: _propTypes["default"].object, + __componentsMap: _propTypes["default"].object, + __ctx: _propTypes["default"].object, + __schema: _propTypes["default"].object +}); +(0, _defineProperty2["default"])(BaseEngine, "defaultProps", { + __schema: {} +}); +(0, _defineProperty2["default"])(BaseEngine, "contextType", _appContext["default"]); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/blockEngine.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/blockEngine.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/regenerator/index.js")); + +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/asyncToGenerator.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/get.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js")); + +var _loading = _interopRequireDefault(__webpack_require__(/*! @alifd/next/lib/loading */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/lib/loading/index.js")); + +__webpack_require__(/*! @alifd/next/lib/loading/style */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/lib/loading/style.js"); + +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/base.js")); + +var _appContext = _interopRequireDefault(__webpack_require__(/*! ../context/appContext */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js")); + +var _utils = __webpack_require__(/*! ../utils */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var debug = (0, _debug["default"])('engine:block'); + +var BlockEngine = +/*#__PURE__*/ +function (_BaseEngine) { + (0, _inherits2["default"])(BlockEngine, _BaseEngine); + (0, _createClass2["default"])(BlockEngine, null, [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(props, state) { + debug("block.getDerivedStateFromProps"); + var func = props.__schema.lifeCycles && props.__schema.lifeCycles.getDerivedStateFromProps; + + if (func) { + return func(props, state); + } + + return null; + } + }]); + + function BlockEngine(props, context) { + var _this; + + (0, _classCallCheck2["default"])(this, BlockEngine); + _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(BlockEngine).call(this, props, context)); + + _this.__generateCtx(); + + var schema = props.__schema || {}; + _this.state = _this.__parseData(schema.state || {}); + + _this.__initDataSource(props); + + _this.__setLifeCycleMethods('constructor', arguments); + + debug("block.constructor - ".concat(schema.fileName)); + return _this; + } + + (0, _createClass2["default"])(BlockEngine, [{ + key: "getSnapshotBeforeUpdate", + value: function () { + var _getSnapshotBeforeUpdate = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee() { + var _args = arguments; + return _regenerator["default"].wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(BlockEngine.prototype), "getSnapshotBeforeUpdate", this).apply(this, _args); + debug("block.getSnapshotBeforeUpdate - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + + function getSnapshotBeforeUpdate() { + return _getSnapshotBeforeUpdate.apply(this, arguments); + } + + return getSnapshotBeforeUpdate; + }() + }, { + key: "componentDidMount", + value: function () { + var _componentDidMount = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee2() { + var _args2 = arguments; + return _regenerator["default"].wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(BlockEngine.prototype), "componentDidMount", this).apply(this, _args2); + debug("block.componentDidMount - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context2.stop(); + } + } + }, _callee2, this); + })); + + function componentDidMount() { + return _componentDidMount.apply(this, arguments); + } + + return componentDidMount; + }() + }, { + key: "componentDidUpdate", + value: function () { + var _componentDidUpdate = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee3() { + var _args3 = arguments; + return _regenerator["default"].wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(BlockEngine.prototype), "componentDidUpdate", this).apply(this, _args3); + debug("block.componentDidUpdate - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context3.stop(); + } + } + }, _callee3, this); + })); + + function componentDidUpdate() { + return _componentDidUpdate.apply(this, arguments); + } + + return componentDidUpdate; + }() + }, { + key: "componentWillUnmount", + value: function () { + var _componentWillUnmount = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee4() { + var _args4 = arguments; + return _regenerator["default"].wrap(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(BlockEngine.prototype), "componentWillUnmount", this).apply(this, _args4); + debug("block.componentWillUnmount - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context4.stop(); + } + } + }, _callee4, this); + })); + + function componentWillUnmount() { + return _componentWillUnmount.apply(this, arguments); + } + + return componentWillUnmount; + }() + }, { + key: "componentDidCatch", + value: function () { + var _componentDidCatch = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee5() { + var _args5 = arguments; + return _regenerator["default"].wrap(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + _context5.next = 2; + return (0, _get2["default"])((0, _getPrototypeOf2["default"])(BlockEngine.prototype), "componentDidCatch", this).apply(this, _args5); + + case 2: + debug("block.componentDidCatch - ".concat(this.props.__schema.fileName)); + + case 3: + case "end": + return _context5.stop(); + } + } + }, _callee5, this); + })); + + function componentDidCatch() { + return _componentDidCatch.apply(this, arguments); + } + + return componentDidCatch; + }() + }, { + key: "render", + value: function render() { + var _this2 = this; + + var __schema = this.props.__schema; + + if (!(0, _utils.isSchema)(__schema, true) || __schema.componentName !== 'Block') { + return '区块schema结构异常!'; + } + + debug("block.render - ".concat(__schema.fileName)); + + this.__generateCtx(); + + this.__render(); + + var _this$__parseData = this.__parseData(__schema.props), + id = _this$__parseData.id, + className = _this$__parseData.className, + style = _this$__parseData.style, + autoLoading = _this$__parseData.autoLoading, + _this$__parseData$def = _this$__parseData.defaultHeight, + defaultHeight = _this$__parseData$def === void 0 ? 300 : _this$__parseData$def, + loading = _this$__parseData.loading; + + var renderContent = function renderContent() { + return _react["default"].createElement(_appContext["default"].Provider, { + value: _objectSpread({}, _this2.context, { + blockContext: _this2 + }) + }, _this2.__createDom()); + }; + + if (autoLoading || loading !== undefined) { + return _react["default"].createElement(_loading["default"], { + size: "medium", + visible: !!(this.__showPlaceholder || loading), + style: _objectSpread({ + height: this.__showPlaceholder ? defaultHeight : 'auto', + display: 'block' + }, style), + className: (0, _classnames["default"])('luna-block', (0, _utils.getFileCssName)(__schema.fileName), className, this.props.className), + id: id + }, !this.__showPlaceholder && renderContent()); + } + + return _react["default"].createElement("div", { + ref: this.__getRef, + className: (0, _classnames["default"])('luna-block', (0, _utils.getFileCssName)(__schema.fileName), className, this.props.className), + id: id, + style: style + }, renderContent()); + } + }]); + return BlockEngine; +}(_base["default"]); + +exports["default"] = BlockEngine; +(0, _defineProperty2["default"])(BlockEngine, "dislayName", 'block-engine'); +(0, _defineProperty2["default"])(BlockEngine, "propTypes", { + __schema: _propTypes["default"].object +}); +(0, _defineProperty2["default"])(BlockEngine, "defaultProps", { + __schema: {} +}); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/compEngine.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/compEngine.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/regenerator/index.js")); + +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/asyncToGenerator.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/assertThisInitialized.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/get.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js")); + +var _loading = _interopRequireDefault(__webpack_require__(/*! @alifd/next/lib/loading */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/lib/loading/index.js")); + +__webpack_require__(/*! @alifd/next/lib/loading/style */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/lib/loading/style.js"); + +var _appContext = _interopRequireDefault(__webpack_require__(/*! ../context/appContext */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js")); + +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/base.js")); + +var _utils = __webpack_require__(/*! ../utils */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var debug = (0, _debug["default"])('engine:comp'); + +var CompEngine = +/*#__PURE__*/ +function (_BaseEngine) { + (0, _inherits2["default"])(CompEngine, _BaseEngine); + (0, _createClass2["default"])(CompEngine, null, [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(props, state) { + debug("comp.getDerivedStateFromProps"); + var func = props.__schema.lifeCycles && props.__schema.lifeCycles.getDerivedStateFromProps; + + if (func) { + return func(props, state); + } + + return null; + } + }]); + + function CompEngine(props, context) { + var _this; + + (0, _classCallCheck2["default"])(this, CompEngine); + _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(CompEngine).call(this, props, context)); + + _this.__generateCtx({ + component: (0, _assertThisInitialized2["default"])(_this) + }); + + var schema = props.__schema || {}; + _this.state = _this.__parseData(schema.state || {}); + + _this.__initDataSource(props); + + _this.__setLifeCycleMethods('constructor', arguments); + + debug("comp.constructor - ".concat(schema.fileName)); + return _this; + } + + (0, _createClass2["default"])(CompEngine, [{ + key: "getSnapshotBeforeUpdate", + value: function () { + var _getSnapshotBeforeUpdate = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee() { + var _args = arguments; + return _regenerator["default"].wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(CompEngine.prototype), "getSnapshotBeforeUpdate", this).apply(this, _args); + debug("comp.getSnapshotBeforeUpdate - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + + function getSnapshotBeforeUpdate() { + return _getSnapshotBeforeUpdate.apply(this, arguments); + } + + return getSnapshotBeforeUpdate; + }() + }, { + key: "componentDidMount", + value: function () { + var _componentDidMount = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee2() { + var _args2 = arguments; + return _regenerator["default"].wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(CompEngine.prototype), "componentDidMount", this).apply(this, _args2); + debug("comp.componentDidMount - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context2.stop(); + } + } + }, _callee2, this); + })); + + function componentDidMount() { + return _componentDidMount.apply(this, arguments); + } + + return componentDidMount; + }() + }, { + key: "componentDidUpdate", + value: function () { + var _componentDidUpdate = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee3() { + var _args3 = arguments; + return _regenerator["default"].wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(CompEngine.prototype), "componentDidUpdate", this).apply(this, _args3); + debug("comp.componentDidUpdate - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context3.stop(); + } + } + }, _callee3, this); + })); + + function componentDidUpdate() { + return _componentDidUpdate.apply(this, arguments); + } + + return componentDidUpdate; + }() + }, { + key: "componentWillUnmount", + value: function () { + var _componentWillUnmount = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee4() { + var _args4 = arguments; + return _regenerator["default"].wrap(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(CompEngine.prototype), "componentWillUnmount", this).apply(this, _args4); + debug("comp.componentWillUnmount - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context4.stop(); + } + } + }, _callee4, this); + })); + + function componentWillUnmount() { + return _componentWillUnmount.apply(this, arguments); + } + + return componentWillUnmount; + }() + }, { + key: "componentDidCatch", + value: function () { + var _componentDidCatch = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee5(e) { + var _args5 = arguments; + return _regenerator["default"].wrap(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(CompEngine.prototype), "componentDidCatch", this).apply(this, _args5); + debug("comp.componentDidCatch - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context5.stop(); + } + } + }, _callee5, this); + })); + + function componentDidCatch(_x) { + return _componentDidCatch.apply(this, arguments); + } + + return componentDidCatch; + }() + }, { + key: "render", + value: function render() { + var _this2 = this; + + var __schema = this.props.__schema; + + if (!(0, _utils.isSchema)(__schema, true) || __schema.componentName !== 'Component') { + return '自定义组件schema结构异常!'; + } + + debug("comp.render - ".concat(__schema.fileName)); + + this.__generateCtx({ + component: this + }); + + this.__render(); + + var _this$__parseData = this.__parseData(__schema.props), + id = _this$__parseData.id, + className = _this$__parseData.className, + style = _this$__parseData.style, + noContainer = _this$__parseData.noContainer, + autoLoading = _this$__parseData.autoLoading, + _this$__parseData$def = _this$__parseData.defaultHeight, + defaultHeight = _this$__parseData$def === void 0 ? 300 : _this$__parseData$def, + loading = _this$__parseData.loading; + + var renderContent = function renderContent() { + return _react["default"].createElement(_appContext["default"].Provider, { + value: _objectSpread({}, _this2.context, { + compContext: _this2, + blockContext: _this2 + }) + }, _this2.__createDom()); + }; + + if (noContainer) { + return renderContent(); + } + + if (autoLoading || loading !== undefined) { + return _react["default"].createElement(_loading["default"], { + size: "medium", + visible: !!(this.__showPlaceholder || loading), + style: _objectSpread({ + height: this.__showPlaceholder ? defaultHeight : 'auto', + display: 'block' + }, style), + className: (0, _classnames["default"])('luna-comp', (0, _utils.getFileCssName)(__schema.fileName), className, this.props.className), + id: this.props.id || id + }, !this.__showPlaceholder && renderContent()); + } + + return _react["default"].createElement("div", { + ref: this.__getRef, + className: (0, _classnames["default"])('luna-comp', (0, _utils.getFileCssName)(__schema.fileName), className, this.props.className), + id: this.props.id || id, + style: _objectSpread({}, style, {}, this.props.style) + }, renderContent()); + } + }]); + return CompEngine; +}(_base["default"]); + +exports["default"] = CompEngine; +(0, _defineProperty2["default"])(CompEngine, "dislayName", 'comp-engine'); +(0, _defineProperty2["default"])(CompEngine, "propTypes", { + __schema: _propTypes["default"].object +}); +(0, _defineProperty2["default"])(CompEngine, "defaultProps", { + __schema: {} +}); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/index.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/index.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/extends.js")); + +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/regenerator/index.js")); + +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/asyncToGenerator.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/assertThisInitialized.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/_react-dom@16.12.0@react-dom/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var _appContext = _interopRequireDefault(__webpack_require__(/*! ../context/appContext */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js")); + +var _utils = __webpack_require__(/*! ../utils */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +var _pageEngine = _interopRequireDefault(__webpack_require__(/*! ./pageEngine */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/pageEngine.js")); + +var _compEngine = _interopRequireDefault(__webpack_require__(/*! ./compEngine */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/compEngine.js")); + +var _blockEngine = _interopRequireDefault(__webpack_require__(/*! ./blockEngine */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/blockEngine.js")); + +var _addonEngine = _interopRequireDefault(__webpack_require__(/*! ./addonEngine */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/addonEngine.js")); + +var _tempEngine = _interopRequireDefault(__webpack_require__(/*! ./tempEngine */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/tempEngine.js")); + +var _obj = __webpack_require__(/*! @ali/b3-one/lib/obj */ "./node_modules/_@ali_b3-one@0.0.17@@ali/b3-one/lib/obj.js"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +window.React = _react["default"]; +window.ReactDom = _reactDom["default"]; +var debug = (0, _debug["default"])('engine:entry'); +var ENGINE_COMPS = { + Page: _pageEngine["default"], + Component: _compEngine["default"], + Block: _blockEngine["default"], + Addon: _addonEngine["default"], + Temp: _tempEngine["default"] +}; + +var Engine = +/*#__PURE__*/ +function (_PureComponent) { + (0, _inherits2["default"])(Engine, _PureComponent); + + function Engine(props, context) { + var _this; + + (0, _classCallCheck2["default"])(this, Engine); + _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(Engine).call(this, props, context)); + (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "__getRef", function (ref) { + _this.__ref = ref; + + if (ref) { + _this.props.onCompGetRef(_this.props.schema, ref, true); + } + }); + _this.state = {}; + debug("entry.constructor - ".concat(props.schema && props.schema.componentName)); + return _this; + } + + (0, _createClass2["default"])(Engine, [{ + key: "componentDidMount", + value: function () { + var _componentDidMount = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee() { + return _regenerator["default"].wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + (0, _utils.goldlog)('EXP', { + action: 'appear', + value: !!this.props.designMode + }, 'engine'); + debug("entry.componentDidMount - ".concat(this.props.schema && this.props.schema.componentName)); + + case 2: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + + function componentDidMount() { + return _componentDidMount.apply(this, arguments); + } + + return componentDidMount; + }() + }, { + key: "componentDidUpdate", + value: function () { + var _componentDidUpdate = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee2() { + return _regenerator["default"].wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + debug("entry.componentDidUpdate - ".concat(this.props.schema && this.props.schema.componentName)); + + case 1: + case "end": + return _context2.stop(); + } + } + }, _callee2, this); + })); + + function componentDidUpdate() { + return _componentDidUpdate.apply(this, arguments); + } + + return componentDidUpdate; + }() + }, { + key: "componentWillUnmount", + value: function () { + var _componentWillUnmount = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee3() { + return _regenerator["default"].wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + debug("entry.componentWillUnmount - ".concat(this.props.schema && this.props.schema.componentName)); + + case 1: + case "end": + return _context3.stop(); + } + } + }, _callee3, this); + })); + + function componentWillUnmount() { + return _componentWillUnmount.apply(this, arguments); + } + + return componentWillUnmount; + }() + }, { + key: "componentDidCatch", + value: function () { + var _componentDidCatch = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee4(e) { + return _regenerator["default"].wrap(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + console.warn(e); + + case 1: + case "end": + return _context4.stop(); + } + } + }, _callee4); + })); + + function componentDidCatch(_x) { + return _componentDidCatch.apply(this, arguments); + } + + return componentDidCatch; + }() + }, { + key: "shouldComponentUpdate", + value: function shouldComponentUpdate(nextProps) { + return !nextProps.suspended; + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + schema = _this$props.schema, + designMode = _this$props.designMode, + appHelper = _this$props.appHelper, + components = _this$props.components, + componentsMap = _this$props.componentsMap; + + if ((0, _obj.isEmpty)(schema)) { + return null; + } + + if (!(0, _utils.isFileSchema)(schema)) { + return '模型结构异常'; + } + + debug('entry.render'); + + var allComponents = _objectSpread({}, ENGINE_COMPS, {}, components); + + var Comp = allComponents[schema.componentName]; + + if (Comp) { + return _react["default"].createElement(_appContext["default"].Provider, { + value: { + appHelper: appHelper, + components: allComponents, + componentsMap: componentsMap, + engine: this + } + }, _react["default"].createElement(Comp, (0, _extends2["default"])({ + key: schema.__ctx && "".concat(schema.__ctx.lunaKey, "_").concat(schema.__ctx.idx || '0'), + ref: this.__getRef, + __appHelper: appHelper, + __components: allComponents, + __componentsMap: componentsMap, + __schema: schema, + __designMode: designMode + }, this.props))); + } + + return null; + } + }]); + return Engine; +}(_react.PureComponent); + +exports["default"] = Engine; +(0, _defineProperty2["default"])(Engine, "dislayName", 'engine'); +(0, _defineProperty2["default"])(Engine, "propTypes", { + appHelper: _propTypes["default"].object, + components: _propTypes["default"].object, + componentsMap: _propTypes["default"].object, + designMode: _propTypes["default"].string, + suspended: _propTypes["default"].bool, + schema: _propTypes["default"].oneOfType([_propTypes["default"].array, _propTypes["default"].object]), + onCompGetRef: _propTypes["default"].func, + onCompGetCtx: _propTypes["default"].func +}); +(0, _defineProperty2["default"])(Engine, "defaultProps", { + appHelper: null, + components: {}, + componentsMap: {}, + designMode: '', + suspended: false, + schema: {}, + onCompGetRef: function onCompGetRef() {}, + onCompGetCtx: function onCompGetCtx() {} +}); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/pageEngine.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/pageEngine.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/regenerator/index.js")); + +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/asyncToGenerator.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/assertThisInitialized.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/get.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js")); + +var _loading = _interopRequireDefault(__webpack_require__(/*! @alifd/next/lib/loading */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/lib/loading/index.js")); + +__webpack_require__(/*! @alifd/next/lib/loading/style */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/lib/loading/style.js"); + +var _appContext = _interopRequireDefault(__webpack_require__(/*! ../context/appContext */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js")); + +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/base.js")); + +var _utils = __webpack_require__(/*! ../utils */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var debug = (0, _debug["default"])('engine:page'); + +var PageEngine = +/*#__PURE__*/ +function (_BaseEngine) { + (0, _inherits2["default"])(PageEngine, _BaseEngine); + (0, _createClass2["default"])(PageEngine, null, [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(props, state) { + debug("page.getDerivedStateFromProps"); + var func = props.__schema.lifeCycles && props.__schema.lifeCycles.getDerivedStateFromProps; + + if (func) { + return func(props, state); + } + + return null; + } + }]); + + function PageEngine(props, context) { + var _this; + + (0, _classCallCheck2["default"])(this, PageEngine); + _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(PageEngine).call(this, props, context)); + + _this.__generateCtx({ + page: (0, _assertThisInitialized2["default"])(_this) + }); + + var schema = props.__schema || {}; + _this.state = _this.__parseData(schema.state || {}); + + _this.__initDataSource(props); + + _this.__setLifeCycleMethods('constructor', arguments); + + debug("page.constructor - ".concat(schema.fileName)); + return _this; + } + + (0, _createClass2["default"])(PageEngine, [{ + key: "getSnapshotBeforeUpdate", + value: function () { + var _getSnapshotBeforeUpdate = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee() { + var _args = arguments; + return _regenerator["default"].wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(PageEngine.prototype), "getSnapshotBeforeUpdate", this).apply(this, _args); + debug("page.getSnapshotBeforeUpdate - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + + function getSnapshotBeforeUpdate() { + return _getSnapshotBeforeUpdate.apply(this, arguments); + } + + return getSnapshotBeforeUpdate; + }() + }, { + key: "componentDidMount", + value: function () { + var _componentDidMount = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee2() { + var _args2 = arguments; + return _regenerator["default"].wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(PageEngine.prototype), "componentDidMount", this).apply(this, _args2); + debug("page.componentDidMount - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context2.stop(); + } + } + }, _callee2, this); + })); + + function componentDidMount() { + return _componentDidMount.apply(this, arguments); + } + + return componentDidMount; + }() + }, { + key: "componentDidUpdate", + value: function () { + var _componentDidUpdate = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee3() { + var _args3 = arguments; + return _regenerator["default"].wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(PageEngine.prototype), "componentDidUpdate", this).apply(this, _args3); + debug("page.componentDidUpdate - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context3.stop(); + } + } + }, _callee3, this); + })); + + function componentDidUpdate() { + return _componentDidUpdate.apply(this, arguments); + } + + return componentDidUpdate; + }() + }, { + key: "componentWillUnmount", + value: function () { + var _componentWillUnmount = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee4() { + var _args4 = arguments; + return _regenerator["default"].wrap(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + (0, _get2["default"])((0, _getPrototypeOf2["default"])(PageEngine.prototype), "componentWillUnmount", this).apply(this, _args4); + debug("page.componentWillUnmount - ".concat(this.props.__schema.fileName)); + + case 2: + case "end": + return _context4.stop(); + } + } + }, _callee4, this); + })); + + function componentWillUnmount() { + return _componentWillUnmount.apply(this, arguments); + } + + return componentWillUnmount; + }() + }, { + key: "componentDidCatch", + value: function () { + var _componentDidCatch = (0, _asyncToGenerator2["default"])( + /*#__PURE__*/ + _regenerator["default"].mark(function _callee5() { + var _args5 = arguments; + return _regenerator["default"].wrap(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + _context5.next = 2; + return (0, _get2["default"])((0, _getPrototypeOf2["default"])(PageEngine.prototype), "componentDidCatch", this).apply(this, _args5); + + case 2: + debug("page.componentDidCatch - ".concat(this.props.__schema.fileName)); + + case 3: + case "end": + return _context5.stop(); + } + } + }, _callee5, this); + })); + + function componentDidCatch() { + return _componentDidCatch.apply(this, arguments); + } + + return componentDidCatch; + }() + }, { + key: "render", + value: function render() { + var _this2 = this; + + var __schema = this.props.__schema; + + if (!(0, _utils.isSchema)(__schema, true) || __schema.componentName !== 'Page') { + return '页面schema结构异常!'; + } + + debug("page.render - ".concat(__schema.fileName)); + + this.__generateCtx({ + page: this + }); + + this.__render(); + + var _this$__parseData = this.__parseData(__schema.props), + id = _this$__parseData.id, + className = _this$__parseData.className, + style = _this$__parseData.style, + autoLoading = _this$__parseData.autoLoading, + _this$__parseData$def = _this$__parseData.defaultHeight, + defaultHeight = _this$__parseData$def === void 0 ? 300 : _this$__parseData$def, + loading = _this$__parseData.loading; + + var renderContent = function renderContent() { + return _react["default"].createElement(_appContext["default"].Provider, { + value: _objectSpread({}, _this2.context, { + pageContext: _this2, + blockContext: _this2 + }) + }, _this2.__createDom()); + }; + + if (autoLoading || loading !== undefined) { + return _react["default"].createElement(_loading["default"], { + size: "medium", + visible: !!(this.__showPlaceholder || loading), + style: _objectSpread({ + height: this.__showPlaceholder ? defaultHeight : 'auto', + display: 'block' + }, style), + className: (0, _classnames["default"])('luna-page', (0, _utils.getFileCssName)(__schema.fileName), className, this.props.className), + id: id + }, !this.__showPlaceholder && renderContent()); + } + + return _react["default"].createElement("div", { + ref: this.__getRef, + className: (0, _classnames["default"])('luna-page', (0, _utils.getFileCssName)(__schema.fileName), className, this.props.className), + id: id, + style: style + }, renderContent()); + } + }]); + return PageEngine; +}(_base["default"]); + +exports["default"] = PageEngine; +(0, _defineProperty2["default"])(PageEngine, "dislayName", 'page-engine'); +(0, _defineProperty2["default"])(PageEngine, "propTypes", { + __schema: _propTypes["default"].object +}); +(0, _defineProperty2["default"])(PageEngine, "defaultProps", { + __schema: {} +}); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/tempEngine.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/tempEngine.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var _appContext = _interopRequireDefault(__webpack_require__(/*! ../context/appContext */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js")); + +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/base.js")); + +var _utils = __webpack_require__(/*! ../utils */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var debug = (0, _debug["default"])('engine:temp'); + +var TempEngine = +/*#__PURE__*/ +function (_BaseEngine) { + (0, _inherits2["default"])(TempEngine, _BaseEngine); + + function TempEngine(props, context) { + var _this; + + (0, _classCallCheck2["default"])(this, TempEngine); + _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(TempEngine).call(this, props, context)); + _this.state = {}; + _this.cacheSetState = {}; + debug("temp.constructor - ".concat(props.__schema.fileName)); + return _this; + } + + (0, _createClass2["default"])(TempEngine, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + var ctx = this.props.__ctx; + if (!ctx) return; + var setState = ctx.setState; + this.cacheSetState = setState; + + ctx.setState = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + setState.call.apply(setState, [ctx].concat(args)); + setTimeout(function () { + return _this2.forceUpdate(); + }, 0); + }; + + debug("temp.componentDidMount - ".concat(this.props.__schema.fileName)); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState, snapshot) { + debug("temp.componentDidUpdate - ".concat(this.props.__schema.fileName)); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + var ctx = this.props.__ctx; + if (!ctx || !this.cacheSetState) return; + ctx.setState = this.cacheSetState; + delete this.cacheSetState; + debug("temp.componentWillUnmount - ".concat(this.props.__schema.fileName)); + } + }, { + key: "componentDidCatch", + value: function componentDidCatch(e) { + console.warn(e); + debug("temp.componentDidCatch - ".concat(this.props.__schema.fileName)); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + __schema = _this$props.__schema, + __ctx = _this$props.__ctx; + + if (!(0, _utils.isSchema)(__schema, true) || __schema.componentName !== 'Temp') { + return '下钻编辑schema结构异常!'; + } + + debug("temp.render - ".concat(__schema.fileName)); + return _react["default"].createElement("div", { + ref: this.__getRef, + className: "luna-temp" + }, _react["default"].createElement(_appContext["default"].Provider, { + value: _objectSpread({}, this.context, {}, __ctx) + }, this.__createDom())); + } + }]); + return TempEngine; +}(_base["default"]); + +exports["default"] = TempEngine; +(0, _defineProperty2["default"])(TempEngine, "dislayName", 'temp-engine'); +(0, _defineProperty2["default"])(TempEngine, "propTypes", { + __ctx: _propTypes["default"].object, + __schema: _propTypes["default"].object +}); +(0, _defineProperty2["default"])(TempEngine, "defaultProps", { + __ctx: {}, + __schema: {} +}); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/hoc/addonFactory.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/hoc/addonFactory.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = addonFactory; + +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/extends.js")); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/objectWithoutProperties.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _addonEngine = _interopRequireDefault(__webpack_require__(/*! ../engine/addonEngine */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/addonEngine.js")); + +var _blockEngine = _interopRequireDefault(__webpack_require__(/*! ../engine/blockEngine */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/blockEngine.js")); + +var _appContext = _interopRequireDefault(__webpack_require__(/*! ../context/appContext */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js")); + +var _utils = __webpack_require__(/*! ../utils */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function addonFactory(schema) { + var components = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var componentsMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + + var LNAddonView = + /*#__PURE__*/ + function (_PureComponent) { + (0, _inherits2["default"])(LNAddonView, _PureComponent); + + function LNAddonView() { + (0, _classCallCheck2["default"])(this, LNAddonView); + return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(LNAddonView).apply(this, arguments)); + } + + (0, _createClass2["default"])(LNAddonView, [{ + key: "render", + value: function render() { + if (!schema || schema.componentName !== 'Addon' || !(0, _utils.isFileSchema)(schema)) { + console.warn('编辑器插件模型结构异常!'); + return null; + } + + var _this$props = this.props, + forwardedRef = _this$props.forwardedRef, + otherProps = (0, _objectWithoutProperties2["default"])(_this$props, ["forwardedRef"]); + + var props = _objectSpread({}, schema.defaultProps, {}, otherProps, { + __schema: schema, + ref: forwardedRef + }); + + return _react["default"].createElement(_appContext["default"].Provider, { + value: _objectSpread({}, this.context, { + appHelper: window.__ctx && window.__ctx.appHelper, + // 插件上下文中的appHelper使用IDE的appHelper + components: _objectSpread({}, components, { + Addon: _addonEngine["default"], + Block: _blockEngine["default"] + }), + componentsMap: componentsMap, + config: config, + locale: props.locale, + messages: props.messages + }) + }, _react["default"].createElement(_addonEngine["default"], (0, _extends2["default"])({}, props, { + __components: _objectSpread({}, components, { + Addon: _addonEngine["default"], + Block: _blockEngine["default"] + }), + __componentsMap: componentsMap, + __appHelper: window.__ctx && window.__ctx.appHelper + }))); + } + }]); + return LNAddonView; + }(_react.PureComponent); + + (0, _defineProperty2["default"])(LNAddonView, "dislayName", 'luna-addon-factory'); + (0, _defineProperty2["default"])(LNAddonView, "version", config.version || '0.0.0'); + (0, _defineProperty2["default"])(LNAddonView, "contextType", _appContext["default"]); + (0, _defineProperty2["default"])(LNAddonView, "propTypes", { + forwardedRef: _propTypes["default"].func + }); + + var ResComp = _react["default"].forwardRef(function (props, ref) { + return _react["default"].createElement(LNAddonView, (0, _extends2["default"])({}, props, { + forwardedRef: ref + })); + }); + + (0, _utils.forEach)(schema["static"], function (val, key) { + ResComp[key] = val; + }); + ResComp.version = config.version || '0.0.0'; + return ResComp; +} + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/hoc/compFactory.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/hoc/compFactory.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = compFactory; + +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/extends.js")); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/objectWithoutProperties.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _compEngine = _interopRequireDefault(__webpack_require__(/*! ../engine/compEngine */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/compEngine.js")); + +var _blockEngine = _interopRequireDefault(__webpack_require__(/*! ../engine/blockEngine */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/blockEngine.js")); + +var _appContext = _interopRequireDefault(__webpack_require__(/*! ../context/appContext */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js")); + +var _appHelper = _interopRequireDefault(__webpack_require__(/*! ../utils/appHelper */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/appHelper.js")); + +var _utils = __webpack_require__(/*! ../utils */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function compFactory(schema) { + var components = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var componentsMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + // 自定义组件需要有自己独立的appHelper + var appHelper = new _appHelper["default"](config); + + var LNCompView = + /*#__PURE__*/ + function (_PureComponent) { + (0, _inherits2["default"])(LNCompView, _PureComponent); + + function LNCompView() { + (0, _classCallCheck2["default"])(this, LNCompView); + return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(LNCompView).apply(this, arguments)); + } + + (0, _createClass2["default"])(LNCompView, [{ + key: "render", + value: function render() { + var _this = this; + + if (!schema || schema.componentName !== 'Component' || !(0, _utils.isFileSchema)(schema)) { + console.warn('自定义组件模型结构异常!'); + return null; + } + + var _this$props = this.props, + forwardedRef = _this$props.forwardedRef, + otherProps = (0, _objectWithoutProperties2["default"])(_this$props, ["forwardedRef"]); // 低代码组件透传应用上下文 + + var ctx = ['utils', 'constants', 'history', 'location']; + ctx.forEach(function (key) { + if (!appHelper[key] && _this.context && _this.context.appHelper && _this.context.appHelper[key]) { + appHelper.set(key, _this.context.appHelper[key]); + } + }); // 支持通过context透传国际化配置 + + var localeProps = {}; + var _this$context = this.context, + locale = _this$context.locale, + messages = _this$context.messages; + + if (locale && messages && messages[schema.fileName]) { + localeProps.locale = locale; + localeProps.messages = messages[schema.fileName]; + } + + var props = _objectSpread({}, schema.defaultProps, {}, localeProps, {}, otherProps, { + __schema: schema, + ref: forwardedRef + }); + + return _react["default"].createElement(_appContext["default"].Provider, { + value: _objectSpread({}, this.context) + }, _react["default"].createElement(_compEngine["default"], (0, _extends2["default"])({}, props, { + __appHelper: appHelper, + __components: _objectSpread({}, components, { + Component: _compEngine["default"], + Block: _blockEngine["default"] + }), + __componentsMap: componentsMap + }))); + } + }]); + return LNCompView; + }(_react.PureComponent); + + (0, _defineProperty2["default"])(LNCompView, "dislayName", 'luna-comp-factory'); + (0, _defineProperty2["default"])(LNCompView, "version", config.version || '0.0.0'); + (0, _defineProperty2["default"])(LNCompView, "contextType", _appContext["default"]); + (0, _defineProperty2["default"])(LNCompView, "propTypes", { + forwardedRef: _propTypes["default"].func + }); + + var ResComp = _react["default"].forwardRef(function (props, ref) { + return _react["default"].createElement(LNCompView, (0, _extends2["default"])({}, props, { + forwardedRef: ref + })); + }); + + (0, _utils.forEach)(schema["static"], function (val, key) { + ResComp[key] = val; + }); + ResComp.version = config.version || '0.0.0'; + return ResComp; +} + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/hoc/localeConfig.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/hoc/localeConfig.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = localeConfig; + +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/extends.js")); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/objectWithoutProperties.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js")); + +var _appContext = _interopRequireDefault(__webpack_require__(/*! ../context/appContext */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/context/appContext.js")); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function localeConfig(componentName, Component) { + var LNLocaleConfigView = + /*#__PURE__*/ + function (_PureComponent) { + (0, _inherits2["default"])(LNLocaleConfigView, _PureComponent); + + function LNLocaleConfigView() { + (0, _classCallCheck2["default"])(this, LNLocaleConfigView); + return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(LNLocaleConfigView).apply(this, arguments)); + } + + (0, _createClass2["default"])(LNLocaleConfigView, [{ + key: "render", + value: function render() { + var _this$props = this.props, + forwardedRef = _this$props.forwardedRef, + otherProps = (0, _objectWithoutProperties2["default"])(_this$props, ["forwardedRef"]); + var _this$context = this.context, + locale = _this$context.locale, + messages = _this$context.messages; + var localeProps = {}; + + if (locale && messages && messages[componentName]) { + localeProps.locale = locale; + localeProps.messages = messages[componentName]; + } + + var props = _objectSpread({}, localeProps, {}, otherProps, { + ref: forwardedRef + }); + + return _react["default"].createElement(Component, props); + } + }]); + return LNLocaleConfigView; + }(_react.PureComponent); + + (0, _defineProperty2["default"])(LNLocaleConfigView, "dislayName", 'luna-locale-config'); + (0, _defineProperty2["default"])(LNLocaleConfigView, "contextType", _appContext["default"]); + (0, _defineProperty2["default"])(LNLocaleConfigView, "propTypes", { + forwardedRef: _propTypes["default"].func + }); + return _react["default"].forwardRef(function (props, ref) { + return _react["default"].createElement(LNLocaleConfigView, (0, _extends2["default"])({}, props, { + forwardedRef: ref + })); + }); +} + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/index.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/index.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "Canvas", { + enumerable: true, + get: function get() { + return _canvas["default"]; + } +}); +Object.defineProperty(exports, "Addon", { + enumerable: true, + get: function get() { + return _addon["default"]; + } +}); +Object.defineProperty(exports, "Engine", { + enumerable: true, + get: function get() { + return _engine["default"]; + } +}); +Object.defineProperty(exports, "CompFactory", { + enumerable: true, + get: function get() { + return _compFactory["default"]; + } +}); +Object.defineProperty(exports, "AddonFatory", { + enumerable: true, + get: function get() { + return _addonFactory["default"]; + } +}); +Object.defineProperty(exports, "LocaleConfig", { + enumerable: true, + get: function get() { + return _localeConfig["default"]; + } +}); +Object.defineProperty(exports, "AppHelper", { + enumerable: true, + get: function get() { + return _appHelper["default"]; + } +}); +Object.defineProperty(exports, "DataHelper", { + enumerable: true, + get: function get() { + return _dataHelper["default"]; + } +}); +Object.defineProperty(exports, "DndHelper", { + enumerable: true, + get: function get() { + return _dndHelper["default"]; + } +}); +Object.defineProperty(exports, "SchemaHelper", { + enumerable: true, + get: function get() { + return _schemaHelper["default"]; + } +}); +Object.defineProperty(exports, "StorageHelper", { + enumerable: true, + get: function get() { + return _storageHelper["default"]; + } +}); +Object.defineProperty(exports, "UndoRedoHelper", { + enumerable: true, + get: function get() { + return _undoRedoHelper["default"]; + } +}); +Object.defineProperty(exports, "WSHelper", { + enumerable: true, + get: function get() { + return _wsHelper["default"]; + } +}); + +var _canvas = _interopRequireDefault(__webpack_require__(/*! ./comp/canvas */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/canvas/index.js")); + +var _addon = _interopRequireDefault(__webpack_require__(/*! ./comp/addon */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/comp/addon/index.js")); + +var _engine = _interopRequireDefault(__webpack_require__(/*! ./engine */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/engine/index.js")); + +var _compFactory = _interopRequireDefault(__webpack_require__(/*! ./hoc/compFactory */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/hoc/compFactory.js")); + +var _addonFactory = _interopRequireDefault(__webpack_require__(/*! ./hoc/addonFactory */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/hoc/addonFactory.js")); + +var _localeConfig = _interopRequireDefault(__webpack_require__(/*! ./hoc/localeConfig */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/hoc/localeConfig.js")); + +var _appHelper = _interopRequireDefault(__webpack_require__(/*! ./utils/appHelper */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/appHelper.js")); + +var _dataHelper = _interopRequireDefault(__webpack_require__(/*! ./utils/dataHelper */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/dataHelper.js")); + +var _dndHelper = _interopRequireDefault(__webpack_require__(/*! ./utils/dndHelper */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/dndHelper.js")); + +var _schemaHelper = _interopRequireDefault(__webpack_require__(/*! ./utils/schemaHelper */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/schemaHelper.js")); + +var _storageHelper = _interopRequireDefault(__webpack_require__(/*! ./utils/storageHelper */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/storageHelper.js")); + +var _undoRedoHelper = _interopRequireDefault(__webpack_require__(/*! ./utils/undoRedoHelper */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/undoRedoHelper.js")); + +var _wsHelper = _interopRequireDefault(__webpack_require__(/*! ./utils/wsHelper */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/wsHelper.js")); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/appHelper.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/appHelper.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/typeof.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/possibleConstructorReturn.js")); + +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/getPrototypeOf.js")); + +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/assertThisInitialized.js")); + +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/inherits.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _events = _interopRequireDefault(__webpack_require__(/*! events */ "./node_modules/_events@3.1.0@events/events.js")); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var instance = null; +var debug = (0, _debug["default"])('utils:appHelper'); +_events["default"].defaultMaxListeners = 100; + +var AppHelper = +/*#__PURE__*/ +function (_EventEmitter) { + (0, _inherits2["default"])(AppHelper, _EventEmitter); + + function AppHelper(config) { + var _this; + + (0, _classCallCheck2["default"])(this, AppHelper); + _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(AppHelper).call(this)); + instance = (0, _assertThisInitialized2["default"])(_this); + Object.assign((0, _assertThisInitialized2["default"])(_this), config); + return _this; + } + + (0, _createClass2["default"])(AppHelper, [{ + key: "get", + value: function get(key) { + return this[key]; + } + }, { + key: "set", + value: function set(key, val) { + var _this2 = this; + + if (typeof key === 'string') { + this[key] = val; + } else if ((0, _typeof2["default"])(key) === 'object') { + Object.keys(key).forEach(function (item) { + _this2[item] = key[item]; + }); + } + } + }, { + key: "batchOn", + value: function batchOn(events, lisenter) { + var _this3 = this; + + if (!Array.isArray(events)) return; + events.forEach(function (event) { + return _this3.on(event, lisenter); + }); + } + }, { + key: "batchOnce", + value: function batchOnce(events, lisenter) { + var _this4 = this; + + if (!Array.isArray(events)) return; + events.forEach(function (event) { + return _this4.once(event, lisenter); + }); + } + }, { + key: "batchOff", + value: function batchOff(events, lisenter) { + var _this5 = this; + + if (!Array.isArray(events)) return; + events.forEach(function (event) { + return _this5.off(event, lisenter); + }); + } + }]); + return AppHelper; +}(_events["default"]); + +exports["default"] = AppHelper; +(0, _defineProperty2["default"])(AppHelper, "getInstance", function () { + if (!instance) { + instance = new AppHelper(); + } + + return instance; +}); + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/dataHelper.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/dataHelper.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/objectWithoutProperties.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _index = __webpack_require__(/*! ./index */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +var _request = __webpack_require__(/*! ./request */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/request.js"); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var DS_STATUS = { + INIT: 'init', + LOADING: 'loading', + LOADED: 'loaded', + ERROR: 'error' +}; +var debug = (0, _debug["default"])('utils:dataHelper'); + +var DataHelper = +/*#__PURE__*/ +function () { + function DataHelper(comp) { + var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var appHelper = arguments.length > 2 ? arguments[2] : undefined; + var parser = arguments.length > 3 ? arguments[3] : undefined; + (0, _classCallCheck2["default"])(this, DataHelper); + this.host = comp; + this.config = config; + this.parser = parser; + this.ajaxList = config && config.list || []; + this.ajaxMap = (0, _index.transformArrayToMap)(this.ajaxList, 'id'); + this.dataSourceMap = this.generateDataSourceMap(); + this.appHelper = appHelper; + } // 重置config,dataSourceMap状态会被重置; + + + (0, _createClass2["default"])(DataHelper, [{ + key: "resetConfig", + value: function resetConfig() { + var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + this.config = config; + this.ajaxList = config && config.list || []; + this.ajaxMap = (0, _index.transformArrayToMap)(this.ajaxList, 'id'); + this.dataSourceMap = this.generateDataSourceMap(); + return this.dataSourceMap; + } // 更新config,只会更新配置,状态保存; + + }, { + key: "updateConfig", + value: function updateConfig() { + var _this = this; + + var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + this.config = config; + this.ajaxList = config && config.list || []; + var ajaxMap = (0, _index.transformArrayToMap)(this.ajaxList, 'id'); // 删除已经移除的接口 + + Object.keys(this.ajaxMap).forEach(function (key) { + if (!ajaxMap[key]) { + delete _this.dataSourceMap[key]; + } + }); + this.ajaxMap = ajaxMap; // 添加未加入到dataSourceMap中的接口 + + this.ajaxList.forEach(function (item) { + if (!_this.dataSourceMap[item.id]) { + _this.dataSourceMap[item.id] = { + status: DS_STATUS.INIT, + load: function load() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _this.getDataSource.apply(_this, [item.id].concat(args)); + } + }; + } + }); + return this.dataSourceMap; + } + }, { + key: "generateDataSourceMap", + value: function generateDataSourceMap() { + var _this2 = this; + + var res = {}; + this.ajaxList.forEach(function (item) { + res[item.id] = { + status: DS_STATUS.INIT, + load: function load() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return _this2.getDataSource.apply(_this2, [item.id].concat(args)); + } + }; + }); + return res; + } + }, { + key: "updateDataSourceMap", + value: function updateDataSourceMap(id, data, error) { + this.dataSourceMap[id].error = error ? error : undefined; + this.dataSourceMap[id].data = data; + this.dataSourceMap[id].status = error ? DS_STATUS.ERROR : DS_STATUS.LOADED; + } + }, { + key: "getInitData", + value: function getInitData() { + var _this3 = this; + + var initSyncData = this.parser(this.ajaxList).filter(function (item) { + if (item.isInit) { + _this3.dataSourceMap[item.id] === DS_STATUS.LOADING; + return true; + } + + return false; + }); + return this.asyncDataHandler(initSyncData).then(function (res) { + if (_this3.config.dataHandler) { + return _this3.config.dataHandler.call(_this3.host, res); + } + + return res; + }); + } + }, { + key: "getDataSource", + value: function getDataSource(id, params, otherOptions, callback) { + var req = this.parser(this.ajaxMap[id]); + var options = req.options || {}; + + if (typeof otherOptions === 'function') { + callback = otherOptions; + otherOptions = {}; + } + + var _ref = otherOptions || {}, + headers = _ref.headers, + otherProps = (0, _objectWithoutProperties2["default"])(_ref, ["headers"]); + + if (!req) { + console.warn("getDataSource API named ".concat(id, " not exist")); + return; + } + + return this.asyncDataHandler([_objectSpread({}, req, { + options: _objectSpread({}, options, { + params: _objectSpread({}, options.params, {}, params), + headers: _objectSpread({}, options.headers, {}, headers) + }, otherProps) + })]).then(function (res) { + callback && callback(res && res[id]); + return res && res[id]; + })["catch"](function (err) { + callback && callback(null, err); + return err; + }); + } + }, { + key: "asyncDataHandler", + value: function asyncDataHandler(asyncDataList) { + var _this4 = this; + + return new Promise(function (resolve, reject) { + var allReq = []; + var doserReq = []; + var doserList = []; + var beforeRequest = _this4.appHelper && _this4.appHelper.utils && _this4.appHelper.utils.beforeRequest; + var afterRequest = _this4.appHelper && _this4.appHelper.utils && _this4.appHelper.utils.afterRequest; + var csrfInput = document.getElementById('_csrf_token'); + + var _tb_token_ = csrfInput && csrfInput.value; + + asyncDataList.map(function (req) { + var id = req.id, + type = req.type, + options = req.options; + if (!id || !type) return; + + if (type === 'doServer') { + var _ref2 = options || {}, + uri = _ref2.uri, + params = _ref2.params; + + if (!uri) return; + doserList.push(id); + doserReq.push({ + name: uri, + "package": 'cms', + params: params + }); + } else { + allReq.push(req); + } + }); + + if (doserReq.length > 0) { + allReq.push({ + type: 'doServer', + options: { + uri: '/nrsService.do', + cors: true, + method: 'POST', + params: { + data: JSON.stringify(doserReq), + _tb_token_: _tb_token_ + } + } + }); + } + + if (allReq.length === 0) resolve({}); + var res = {}; + Promise.all(allReq.map(function (item) { + return new Promise(function (resolve) { + var type = item.type, + id = item.id, + dataHandler = item.dataHandler, + options = item.options; + + var doFetch = function doFetch(type, options) { + _this4.fetchOne(type, options).then(function (data) { + if (afterRequest) { + _this4.appHelper.utils.afterRequest(item, data, undefined, function (data, error) { + fetchHandler(data, error); + }); + } else { + fetchHandler(data, undefined); + } + })["catch"](function (err) { + if (afterRequest) { + // 必须要这么调用,否则beforeRequest中的this会丢失 + _this4.appHelper.utils.afterRequest(item, undefined, err, function (data, error) { + fetchHandler(data, error); + }); + } else { + fetchHandler(undefined, err); + } + }); + }; + + var fetchHandler = function fetchHandler(data, error) { + if (type === 'doServer') { + if (!Array.isArray(data)) { + data = [data]; + } + + doserList.forEach(function (id, idx) { + var req = _this4.ajaxMap[id]; + + if (req) { + res[id] = _this4.dataHandler(id, req.dataHandler, data && data[idx], error); + + _this4.updateDataSourceMap(id, res[id], error); + } + }); + } else { + res[id] = _this4.dataHandler(id, dataHandler, data, error); + + _this4.updateDataSourceMap(id, res[id], error); + } + + resolve(); + }; + + if (type === 'doServer') { + doserList.forEach(function (item) { + _this4.dataSourceMap[item].status = DS_STATUS.LOADING; + }); + } else { + _this4.dataSourceMap[id].status = DS_STATUS.LOADING; + } // 请求切片 + + + if (beforeRequest) { + // 必须要这么调用,否则beforeRequest中的this会丢失 + _this4.appHelper.utils.beforeRequest(item, (0, _index.clone)(options), function (options) { + return doFetch(type, options); + }); + } else { + doFetch(type, options); + } + }); + })).then(function () { + resolve(res); + })["catch"](function (e) { + reject(e); + }); + }); + } + }, { + key: "dataHandler", + value: function dataHandler(id, _dataHandler, data, error) { + if (!_dataHandler || typeof _dataHandler !== 'function') return data; + + try { + return _dataHandler.call(this.host, data, error); + } catch (e) { + console.warn('[' + id + ']单个请求数据处理函数运行出错', e); + return; + } + } + }, { + key: "fetchOne", + value: function fetchOne(type, options) { + var uri = options.uri, + _options$method = options.method, + method = _options$method === void 0 ? 'GET' : _options$method, + headers = options.headers, + params = options.params, + otherProps = (0, _objectWithoutProperties2["default"])(options, ["uri", "method", "headers", "params"]); + otherProps = otherProps || {}; + + switch (type) { + case 'mtop': + method && (otherProps.method = method); + return (0, _request.mtop)(uri, params, otherProps); + + case 'jsonp': + return (0, _request.jsonp)(uri, params, otherProps); + + case 'bzb': + return (0, _request.bzb)(uri, params, _objectSpread({ + method: method, + headers: headers + }, otherProps)); + + default: + method = method.toUpperCase(); + + if (method === 'GET') { + return (0, _request.get)(uri, params, headers, otherProps); + } else if (method === 'POST') { + return (0, _request.post)(uri, params, headers, otherProps); + } + + return (0, _request.request)(uri, method, params, headers, otherProps); + } + } + }]); + return DataHelper; +}(); + +exports["default"] = DataHelper; + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/dndHelper.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/dndHelper.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/typeof.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/_react-dom@16.12.0@react-dom/index.js")); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var _index = __webpack_require__(/*! ./index */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +var DICT = { + left: '左', + right: '右', + top: '上', + bottom: '下', + "in": '里' +}; +var TOP_COMPONENT = ['Page', 'Component', 'Temp']; // 顶端模块,不支持放置兄弟节点 + +var debug = (0, _debug["default"])('utils:dndHelper'); + +var DndHelper = +/*#__PURE__*/ +function () { + function DndHelper(appHelper) { + (0, _classCallCheck2["default"])(this, DndHelper); + this.appHelper = appHelper; + this.dragDom = null; + this.canvasEffectDom = null; + this.treeEffectDom = null; + this.containrDom = null; + this.sourceEntity = null; + this.tempEntity = null; + this.dragInfo = null; + this.canvasClearTimer = null; + this.treeClearTimer = null; + this.isDragging = false; + this.dragOverFunc = (0, _index.throttle)(this.dragOverFunc, 50); + } + + (0, _createClass2["default"])(DndHelper, [{ + key: "setCanvasWin", + value: function setCanvasWin(win) { + this.canvasWin = win; + + if (this.canvasEffectDom) { + this.canvasWin.document.body.appendChild(this.canvasEffectDom); + } + } + }, { + key: "emit", + value: function emit(msg) { + var _this$appHelper; + + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + this.appHelper && (_this$appHelper = this.appHelper).emit.apply(_this$appHelper, [msg].concat(args)); + } + }, { + key: "dragOverFunc", + value: function dragOverFunc(ev, schemaOrNode, isTree) { + if (!this.isDragging || !this.sourceEntity) return; + var entity = isTree ? this.getTreeEntity(schemaOrNode, ev) : { + target: ev.currentTarget, + schema: schemaOrNode + }; + if (this.sourceEntity.schema.__ctx && this.sourceEntity.schema.__ctx.lunaKey === entity.schema.__ctx.lunaKey) return; + var dragInfo = null; + + if (isTree) { + dragInfo = this.getTreeDragInfo(ev, entity); + } else { + dragInfo = this.getDragInfo(ev, entity); + } + + if (!dragInfo || (0, _index.deepEqual)(this.dragInfo, dragInfo)) return; + this.dragInfo = dragInfo; + this.tempEntity = dragInfo.entity; + this.clearEffect(isTree); + this.addEffect(isTree); + } + }, { + key: "changeCanvas", + value: function changeCanvas() { + debug('change canvas', this.sourceEntity, this.tempEntity); + if (!this.sourceEntity || !this.tempEntity) return; + + if (this.sourceEntity.isAdd) { + debug('add material', this.sourceEntity.schema, this.tempEntity.schema.__ctx.lunaKey, this.dragInfo.position); + this.emit('material.add', { + schema: this.sourceEntity.schema, + targetKey: this.tempEntity.schema.__ctx.lunaKey, + direction: this.dragInfo.position + }); + } else { + this.emit('material.move', { + lunaKey: this.sourceEntity.schema.__ctx.lunaKey, + targetKey: this.tempEntity.schema.__ctx.lunaKey, + direction: this.dragInfo.position + }); + } + } + }, { + key: "getTreeEntity", + value: function getTreeEntity(node, ev) { + if (!node) return; + var schemaHelper = this.appHelper.schemaHelper; + var lunaKey = node.props.eventKey; + var schema = schemaHelper.schemaMap[lunaKey]; + if (!schema) return; + var ref = schemaHelper.compThisMap[lunaKey]; + var currentTarget = ev.currentTarget; + return { + schema: schema, + target: ref && _reactDom["default"].findDOMNode(ref), + treeNodeTarget: currentTarget + }; + } + }, { + key: "getDragTagDom", + value: function getDragTagDom(tagName) { + if (!this.dragDom) { + var dragDom = document.createElement('div'); + dragDom.id = 'luna-drag-dom'; + dragDom.style.height = '24px'; + dragDom.style.position = 'absolute'; + dragDom.style.zIndex = 10000000; + dragDom.style.transform = 'translateY(-10000px)'; + dragDom.style.background = 'rgba(0, 0, 0, .5)'; + dragDom.style.lineHeight = '24px'; + dragDom.style.color = '#fff'; + dragDom.style.padding = '0px 10px'; + dragDom.style.display = 'inline-block'; + document.body.appendChild(dragDom); + this.dragDom = dragDom; + } + + this.dragDom.innerHTML = " ".concat(tagName); + return this.dragDom; + } + }, { + key: "getCanvasEffectDom", + value: function getCanvasEffectDom() { + if (!this.canvasWin) { + throw new Error('should set the canvasWin first'); + } + + if (this.canvasClearTimer) { + clearTimeout(this.canvasClearTimer); + this.canvasClearTimer = null; + } + + var position = this.dragInfo.position; + var canvasEffectDom = this.canvasEffectDom; + + if (!canvasEffectDom) { + canvasEffectDom = document.createElement('div'); + this.canvasWin.document.body.appendChild(canvasEffectDom); + this.canvasEffectDom = canvasEffectDom; + } + + canvasEffectDom.id = 'luna-canvas-effect'; + canvasEffectDom.innerHTML = "".concat(DICT[position], ""); + canvasEffectDom.className = position; + canvasEffectDom.style.display = 'block'; + return canvasEffectDom; + } + }, { + key: "getTreeEffectDom", + value: function getTreeEffectDom() { + if (this.treeClearTimer) { + clearTimeout(this.treeClearTimer); + this.treeClearTimer = null; + } + + var treeEffectDom = this.treeEffectDom; + + if (!treeEffectDom) { + treeEffectDom = document.createElement('div'); + this.treeEffectDom = treeEffectDom; + } + + treeEffectDom.id = 'luna-tree-effect'; + treeEffectDom.style.display = 'block'; + return treeEffectDom; + } + }, { + key: "getLunaContainerDom", + value: function getLunaContainerDom(target) { + if (!target) return null; + var parent = target.parentNode; + + while (parent && (!parent.dataset || !parent.dataset.lunaKey)) { + parent = parent.parentNode; + } + + return parent; + } + }, { + key: "clearCompTreeEffect", + value: function clearCompTreeEffect() { + var container = document.querySelector('.luna-comp-tree'); + if (!container) return; + var treeItems = container.querySelectorAll('.tree-item'); + (treeItems || []).forEach(function (item) { + var classList = item.classList; + + if (classList) { + classList.remove('top'); + classList.remove('in'); + classList.remove('bottom'); + classList.remove('tree-item'); + } + }); + } + }, { + key: "getDragInfo", + value: function getDragInfo(ev, entity) { + if (!this.sourceEntity || !entity) return null; + var _entity = entity, + target = _entity.target, + schema = _entity.schema; + var sourcePath = this.sourceEntity.schema.__ctx && this.sourceEntity.schema.__ctx.lunaPath; + var targetPath = schema.__ctx.lunaPath; + var sourceTarget = this.sourceEntity.target; + if (sourcePath === targetPath) return null; + if (targetPath && targetPath.startsWith(sourcePath)) return null; + var componentsMap = this.appHelper.get('componentsMap'); // if (!componentsMap || !componentsMap[schema.componentName]) return null; + + var isContainer = componentsMap[schema.componentName] && componentsMap[schema.componentName].isContainer || (0, _index.isFileSchema)(schema); //是否是容器组件 + + if (schema.children && (0, _typeof2["default"])(schema.children) !== 'object') { + //如果children是文本, 非模型结构,则非容器; + isContainer = false; + } + + var rect = target.getBoundingClientRect(); + var isSupportIn = isContainer && (!schema.children || schema.children && (0, _typeof2["default"])(schema.children) === 'object' && (0, _index.isEmpty)(schema.children)); + var sourceIsInline = sourceTarget && ['inline-block', 'inline'].includes(getComputedStyle(sourceTarget).display); + var isInline = ['inline-block', 'inline'].includes(getComputedStyle(target).display) && sourceIsInline; + var measure = isInline ? 'width' : 'height'; + var sn = 0; + var position = 'top'; + + if (isContainer) { + sn = isSupportIn ? rect[measure] * 0.25 : Math.min(rect[measure] * 0.5, 10); + } else { + sn = rect[measure] * 0.5; + } + + if (TOP_COMPONENT.includes(schema.componentName)) { + // 顶端组件,拖拽over时,只能放在其内部 + position = 'in'; + } else if (isInline && !isContainer) { + if (Math.abs(ev.clientX - rect.left) <= sn) { + position = 'left'; + } else if (Math.abs(ev.clientX - rect.right) <= sn) { + position = 'right'; + } + } else { + if (Math.abs(ev.clientY - rect.top) <= sn) { + position = 'top'; + } else if (Math.abs(ev.clientY - rect.bottom) <= sn) { + position = 'bottom'; + } else { + position = 'in'; + } + } // 判断是否是相邻元素, 往左|上拖 + + + var isPrevSibling = sourceTarget === target.nextElementSibling; + + if (isPrevSibling) { + if (position === 'right') position = 'left'; + + if (position === 'bottom') { + position = isContainer ? 'in' : 'top'; + } + } // 判断是否相邻元素,往右|下拖 + + + var isPostSibling = sourceTarget === target.previousElementSibling; + + if (isPostSibling) { + if (position === 'left') position = 'right'; + + if (position === 'top') { + position = isContainer ? 'in' : 'bottom'; + } + } //如果是容器组件,且包含有子组件,且是in状态,进行智能识别处理; + + + var subChildren = []; + + var getChildren = function getChildren(node) { + if (!node || !node.childNodes || node.childNodes.length === 0) return; + node.childNodes.forEach(function (child) { + if (child === sourceTarget) return; + + if (child && child.getAttribute && child.getAttribute('draggable')) { + var _isInline = ['inline', 'inline-block'].includes(getComputedStyle(child).display) && sourceIsInline; + + var _rect = child.getBoundingClientRect(); + + var l = Math.abs(ev.clientX - _rect.left); + var r = Math.abs(ev.clientX - _rect.right); + var t = Math.abs(ev.clientY - _rect.top); + var b = Math.abs(ev.clientY - _rect.bottom); + var minXDistance = Math.min(l, r); + var minYDistance = Math.min(t, b); + subChildren.push({ + lunaKey: child.dataset.lunaKey, + node: child, + minDistance: _isInline ? [minXDistance, minYDistance] : [minYDistance, minXDistance], + position: _isInline ? l > r ? 'right' : 'left' : b > t ? 'top' : 'bottom' + }); + } else { + getChildren(child); + } + }); + }; + + if (position === 'in' && isContainer && !isSupportIn) { + getChildren(target); + subChildren = subChildren.sort(function (a, b) { + if (a.minDistance[0] === b.minDistance[0]) { + return a.minDistance[1] - b.minDistance[1]; + } + + return a.minDistance[0] - b.minDistance[0]; + }); + var tempChild = subChildren[0]; + + if (tempChild) { + if (sourceTarget === tempChild.node.nextElementSibling && ['bottom', 'right'].includes(tempChild.position)) return null; + if (sourceTarget === tempChild.node.previousElementSibling && ['top', 'left'].includes(tempChild.position)) return null; + position = tempChild.position; + entity = { + target: tempChild.node, + schema: this.appHelper.schemaHelper.schemaMap[tempChild.lunaKey] + }; + } + } + + var containrDom = position === 'in' ? entity.target : this.getLunaContainerDom(entity.target); + + if (this.containrDom !== containrDom) { + if (this.containrDom) { + this.containrDom.style.outline = ''; + } + + this.containrDom = containrDom; + } + + if (this.containrDom) { + containrDom.style.outline = '1px solid #1aab11'; + } // debug('drag info:', position, isSupportIn, isContainer, entity); + + + return { + position: position, + isSupportIn: isSupportIn, + isContainer: isContainer, + entity: entity + }; + } + }, { + key: "getTreeDragInfo", + value: function getTreeDragInfo(ev, entity) { + if (!this.sourceEntity || !entity) return null; + var schema = entity.schema, + treeNodeTarget = entity.treeNodeTarget; + var sourcePath = this.sourceEntity.schema.__ctx && this.sourceEntity.schema.__ctx.lunaPath; + var targetPath = schema.__ctx.lunaPath; + if (sourcePath === targetPath) return null; + if (targetPath && targetPath.startsWith(sourcePath)) return null; + var componentsMap = this.appHelper.get('componentsMap'); // if (!componentsMap || !componentsMap[schema.componentName]) return null; + + var isContainer = componentsMap[schema.componentName] && componentsMap[schema.componentName].isContainer || (0, _index.isFileSchema)(schema); //是否是容器组件 + + if (schema.children && (0, _typeof2["default"])(schema.children) !== 'object') { + //如果children是文本, 非模型结构,则非容器; + isContainer = false; + } + + var rect = treeNodeTarget.getBoundingClientRect(); + var isSupportIn = isContainer && (!schema.children || schema.children && (0, _typeof2["default"])(schema.children) === 'object' && (0, _index.isEmpty)(schema.children)); + var sn = isContainer && isSupportIn ? rect.height * 0.25 : rect.height * 0.5; + var position = 'in'; + + if (Math.abs(ev.clientY - rect.top) <= sn) { + position = 'top'; + } else if (Math.abs(ev.clientY - rect.bottom) <= sn) { + position = 'bottom'; + } + + return { + position: position, + isSupportIn: isSupportIn, + isContainer: isContainer, + entity: entity + }; + } + }, { + key: "addEffect", + value: function addEffect(isTree) { + if (!this.tempEntity) return; + var position = this.dragInfo.position; + var _this$tempEntity = this.tempEntity, + target = _this$tempEntity.target, + treeNodeTarget = _this$tempEntity.treeNodeTarget; // this.clearCompTreeEffect(); + + if (isTree) { + //画父元素外框 + var status = true; + var node = treeNodeTarget.parentNode; + + while (status) { + if (node && node.parentNode) { + if (node.parentNode.tagName == 'LI' && node.parentNode.classList.contains('next-tree-node')) { + status = false; + + if (this.treeNodeTargetParent !== node.parentNode || position === 'in') { + this.treeNodeTargetParent && this.treeNodeTargetParent.classList.remove('selected'); + } + + this.treeNodeTargetParent = node.parentNode; + if (position !== 'in') this.treeNodeTargetParent.classList.add('selected'); + } else { + node = node.parentNode; + } + } else { + status = false; + } + } + + treeNodeTarget.appendChild(this.getTreeEffectDom()); + this.treeEffectDom.className = position; + } else { + var effectDom = this.getCanvasEffectDom(); + var rect = target.getBoundingClientRect(); + effectDom.style.left = (position === 'right' ? rect.right : rect.left) + 'px'; + effectDom.style.top = (position === 'bottom' ? rect.bottom : position === 'in' ? (rect.top + rect.bottom) / 2 : rect.top) + 'px'; + effectDom.style.height = ['top', 'in', 'bottom'].includes(position) ? '2px' : rect.height + 'px'; + effectDom.style.width = ['left', 'right'].includes(position) ? '2px' : rect.width + 'px'; + } + } + }, { + key: "clearCanvasEffect", + value: function clearCanvasEffect() { + if (this.canvasEffectDom) { + this.canvasEffectDom.style.display = 'none'; + } + + if (this.containrDom) { + this.containrDom.style.outline = ''; + } + } + }, { + key: "clearTreeEffect", + value: function clearTreeEffect() { + if (this.treeEffectDom) { + this.treeEffectDom.style.display = 'none'; + } + + if (this.treeNodeTargetParent) { + this.treeNodeTargetParent.classList.remove('selected'); + } + + var tempTarget = this.tempEntity && this.tempEntity.treeNodeTarget; + var classList = tempTarget && tempTarget.classList; + + if (classList) { + classList.remove('top'); + classList.remove('bottom'); + classList.remove('in'); + classList.remove('tree-item'); + } + } + }, { + key: "clearEffect", + value: function clearEffect(isTree) { + var _this = this; + + if (this.isDragging) { + // if (isTree) { + if (this.treeClearTimer) { + clearTimeout(this.treeClearTimer); + this.treeClearTimer = null; + } + + this.treeClearTimer = setTimeout(function () { + _this.clearTreeEffect(); + }, 300); // } else { + + if (this.canvasClearTimer) { + clearTimeout(this.canvasClearTimer); + this.canvasClearTimer = null; + } + + this.canvasClearTimer = setTimeout(function () { + _this.clearCanvasEffect(); + }, 300); // } + } else { + // if (isTree) { + this.clearTreeEffect(); // } else { + + this.clearCanvasEffect(); // } + } + } + }, { + key: "handleDragStart", + value: function handleDragStart(ev, lunaKey) { + ev.stopPropagation(); + var target = ev.currentTarget; + target.style.filter = 'blur(2px)'; + var schema = this.appHelper.schemaHelper.schemaMap[lunaKey]; + ev.dataTransfer.setDragImage(this.getDragTagDom(schema.componentName), 0, 0); + this.sourceEntity = { + target: target, + schema: schema + }; + this.isDragging = true; + } + }, { + key: "handleDragEnd", + value: function handleDragEnd(ev) { + ev.stopPropagation(); + ev.preventDefault(); + this.isDragging = false; + if (!this.sourceEntity) return; + + if (this.sourceEntity.target) { + this.sourceEntity.target.style.filter = ''; + } + + this.clearEffect(); + } + }, { + key: "handleDragOver", + value: function handleDragOver(ev, lunaKey) { + ev.preventDefault(); + ev.stopPropagation(); + this.isDragging = true; + var schema = this.appHelper.schemaHelper.schemaMap[lunaKey]; + this.dragOverFunc({ + clientX: ev.clientX, + clientY: ev.clientY, + currentTarget: ev.currentTarget + }, schema); + } + }, { + key: "handleDragLeave", + value: function handleDragLeave(ev) { + //避免移动到treeEffectDom上的抖动 + ev.stopPropagation(); + if (!this.tempEntity) return; + var rect = ev.target.getBoundingClientRect(); // 如果鼠标位置还在当前元素范围内则不认为是dragLeave + + if (ev.x >= rect.left && ev.x <= rect.right && ev.y >= rect.top && ev.y <= rect.bottom) return; + debug('canvas drag leave', ev); + this.clearEffect(); + this.dragInfo = null; + this.isDragging = false; + } + }, { + key: "handleDrop", + value: function handleDrop(ev) { + ev.stopPropagation(); + debug('drop+++++'); + this.isDragging = false; + this.changeCanvas(); + this.clearEffect(); + } + }, { + key: "handleTreeDragStart", + value: function handleTreeDragStart(ev) { + var event = ev.event, + node = ev.node; + event.stopPropagation(); + var lunaKey = node.props.eventKey; + var schema = this.appHelper.schemaHelper.schemaMap[lunaKey]; + if (!schema) return; + event.dataTransfer.setDragImage(this.getDragTagDom(schema.componentName), 0, 0); + this.sourceEntity = this.getTreeEntity(node, event); + + if (this.sourceEntity.target) { + this.sourceEntity.target.style.filter = 'blur(2px)'; + } + + this.isDragging = true; + } + }, { + key: "handleTreeDragEnd", + value: function handleTreeDragEnd(ev) { + var event = ev.event; + event.stopPropagation(); + event.preventDefault(); + this.isDragging = false; + if (!this.sourceEntity) return; + + if (this.sourceEntity.target) { + this.sourceEntity.target.style.filter = ''; + } + + this.clearEffect(true); + } + }, { + key: "handleTreeDragOver", + value: function handleTreeDragOver(ev) { + var event = ev.event, + node = ev.node; + event.preventDefault(); + event.stopPropagation(); + this.isDragging = true; + this.dragOverFunc({ + clientX: event.clientX, + clientY: event.clientY, + currentTarget: event.currentTarget.children[0] + }, node, true); + } + }, { + key: "handleTreeDragLeave", + value: function handleTreeDragLeave(ev) { + var event = ev.event; + event.stopPropagation(); + if (!this.tempEntity) return; //避免移动到treeEffectDom上的抖动 + + if (this.treeEffectDom && this.treeEffectDom.parentNode.parentNode === event.currentTarget) return; + debug('++++ drag leave tree', ev, this.isDragging); + this.clearEffect(true); + this.isDragging = false; + } + }, { + key: "handleTreeDrop", + value: function handleTreeDrop(ev) { + var event = ev.event; + event.stopPropagation(); + this.isDragging = false; + this.changeCanvas(); + this.clearEffect(true); + } + }, { + key: "handleResourceDragStart", + value: function handleResourceDragStart(ev, title, schema) { + ev.stopPropagation(); + ev.dataTransfer.setDragImage(this.getDragTagDom(title), -2, -2); + this.sourceEntity = { + isAdd: true, + schema: schema + }; + this.isDragging = true; + } + }]); + return DndHelper; +}(); + +exports["default"] = DndHelper; + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireWildcard.js"); + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isSchema = isSchema; +exports.isFileSchema = isFileSchema; +exports.inSameDomain = inSameDomain; +exports.getFileCssName = getFileCssName; +exports.isJSSlot = isJSSlot; +exports.isJSFunction = isJSFunction; +exports.isJSExpression = isJSExpression; +exports.wait = wait; +exports.curry = curry; +exports.getValue = getValue; +exports.parseObj = parseObj; +exports.fastClone = fastClone; +exports.fillObj = fillObj; +exports.toHump = toHump; +exports.toLine = toLine; +exports.getEnv = getEnv; +exports.generateI18n = generateI18n; +exports.acceptsRef = acceptsRef; +exports.goldlog = goldlog; +exports.generateUtils = generateUtils; +exports.setClipboardData = setClipboardData; +exports.getClipboardData = getClipboardData; +exports.transformToPromise = transformToPromise; +exports.moveArrayItem = moveArrayItem; +exports.transformArrayToMap = transformArrayToMap; +exports.checkPropTypes = checkPropTypes; +exports.transformSchemaToPure = transformSchemaToPure; +exports.transformSchemaToStandard = transformSchemaToStandard; +exports.addCssTag = addCssTag; +exports.registShortCuts = registShortCuts; +exports.unRegistShortCuts = unRegistShortCuts; +exports.parseData = parseData; +exports.parseExpression = parseExpression; +Object.defineProperty(exports, "get", { + enumerable: true, + get: function get() { + return _request.get; + } +}); +Object.defineProperty(exports, "post", { + enumerable: true, + get: function get() { + return _request.post; + } +}); +Object.defineProperty(exports, "jsonp", { + enumerable: true, + get: function get() { + return _request.jsonp; + } +}); +Object.defineProperty(exports, "mtop", { + enumerable: true, + get: function get() { + return _request.mtop; + } +}); +Object.defineProperty(exports, "request", { + enumerable: true, + get: function get() { + return _request.request; + } +}); +exports.jsonuri = exports.serialize = exports.debounce = exports.throttle = exports.isEmpty = exports.clone = exports.deepEqual = exports.pick = exports.moment = exports.shallowEqual = exports.forEach = exports.keymaster = void 0; + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/typeof.js")); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var _keymaster2 = _interopRequireDefault(__webpack_require__(/*! keymaster */ "./node_modules/_keymaster@1.6.2@keymaster/keymaster.js")); + +var _obj = __webpack_require__(/*! @ali/b3-one/lib/obj */ "./node_modules/_@ali_b3-one@0.0.17@@ali/b3-one/lib/obj.js"); + +var _url = __webpack_require__(/*! @ali/b3-one/lib/url */ "./node_modules/_@ali_b3-one@0.0.17@@ali/b3-one/lib/url.js"); + +var _moment2 = _interopRequireDefault(__webpack_require__(/*! moment */ "./node_modules/_moment@2.24.0@moment/moment.js")); + +__webpack_require__(/*! moment/locale/zh-cn */ "./node_modules/_moment@2.24.0@moment/locale/zh-cn.js"); + +var _package = _interopRequireDefault(__webpack_require__(/*! ../../package.json */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/package.json")); + +var _pick2 = _interopRequireDefault(__webpack_require__(/*! lodash/pick */ "./node_modules/_lodash@4.17.15@lodash/pick.js")); + +var _isEqualWith = _interopRequireDefault(__webpack_require__(/*! lodash/isEqualWith */ "./node_modules/_lodash@4.17.15@lodash/isEqualWith.js")); + +var _cloneDeep = _interopRequireDefault(__webpack_require__(/*! lodash/cloneDeep */ "./node_modules/_lodash@4.17.15@lodash/cloneDeep.js")); + +var _isEmpty2 = _interopRequireDefault(__webpack_require__(/*! lodash/isEmpty */ "./node_modules/_lodash@4.17.15@lodash/isEmpty.js")); + +var _throttle2 = _interopRequireDefault(__webpack_require__(/*! lodash/throttle */ "./node_modules/_lodash@4.17.15@lodash/throttle.js")); + +var _debounce2 = _interopRequireDefault(__webpack_require__(/*! lodash/debounce */ "./node_modules/_lodash@4.17.15@lodash/debounce.js")); + +var _serializeJavascript = _interopRequireDefault(__webpack_require__(/*! serialize-javascript */ "./node_modules/_serialize-javascript@1.9.1@serialize-javascript/index.js")); + +var _jsonuri = _interopRequireWildcard(__webpack_require__(/*! jsonuri */ "./node_modules/_jsonuri@2.2.4@jsonuri/dist/index.mjs")); + +var _request = __webpack_require__(/*! ./request */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/request.js"); + +var _intlMessageformat = _interopRequireDefault(__webpack_require__(/*! intl-messageformat */ "./node_modules/_intl-messageformat@7.8.4@intl-messageformat/lib/index.js")); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var keymaster = _keymaster2["default"]; +exports.keymaster = keymaster; +var forEach = _obj.forEach; +exports.forEach = forEach; +var shallowEqual = _obj.shallowEqual; //moment对象配置 + +exports.shallowEqual = shallowEqual; +var moment = _moment2["default"]; +exports.moment = moment; +moment.locale('zh-cn'); +window.sdkVersion = _package["default"].version; +var pick = _pick2["default"]; +exports.pick = pick; +var deepEqual = _isEqualWith["default"]; +exports.deepEqual = deepEqual; +var clone = _cloneDeep["default"]; +exports.clone = clone; +var isEmpty = _isEmpty2["default"]; +exports.isEmpty = isEmpty; +var throttle = _throttle2["default"]; +exports.throttle = throttle; +var debounce = _debounce2["default"]; +exports.debounce = debounce; +var serialize = _serializeJavascript["default"]; +exports.serialize = serialize; +var jsonuri = _jsonuri; +exports.jsonuri = jsonuri; + +var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/_react-is@16.12.0@react-is/index.js"); + +var ReactPropTypesSecret = __webpack_require__(/*! prop-types/lib/ReactPropTypesSecret */ "./node_modules/_prop-types@15.7.2@prop-types/lib/ReactPropTypesSecret.js"); + +var factoryWithTypeCheckers = __webpack_require__(/*! prop-types/factoryWithTypeCheckers */ "./node_modules/_prop-types@15.7.2@prop-types/factoryWithTypeCheckers.js"); + +var PropTypes2 = factoryWithTypeCheckers(ReactIs.isElement, true); +var EXPRESSION_TYPE = { + JSEXPRESSION: 'JSExpression', + JSFUNCTION: 'JSFunction', + JSSLOT: 'JSSlot' +}; +var EXPRESSION_REG = /^\{\{(\{.*\}|.*?)\}\}$/; +var hasSymbol = typeof Symbol === 'function' && Symbol['for']; +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol['for']('react.forward_ref') : 0xead0; +var debug = (0, _debug["default"])('utils:index'); +var ENV = { + TBE: 'TBE', + WEBIDE: 'WEB-IDE', + VSCODE: 'VSCODE', + WEB: 'WEB' +}; +/** + * @name isSchema + * @description 判断是否是模型结构 + */ + +function isSchema(schema, ignoreArr) { + if (isEmpty(schema)) return false; + if (!ignoreArr && Array.isArray(schema)) return schema.every(function (item) { + return isSchema(item); + }); + return !!(schema.componentName && schema.props && ((0, _typeof2["default"])(schema.props) === 'object' || isJSExpression(schema.props))); +} + +function isFileSchema(schema) { + if (isEmpty(schema)) return false; + return ['Page', 'Block', 'Component', 'Addon', 'Temp'].includes(schema.componentName); +} // 判断当前页面是否被嵌入到同域的页面中 + + +function inSameDomain() { + try { + return window.parent !== window && window.parent.location.host === window.location.host; + } catch (e) { + return false; + } +} + +function getFileCssName(fileName) { + if (!fileName) return; + var name = fileName.replace(/([A-Z])/g, '-$1').toLowerCase(); + return ('luna-' + name).split('-').filter(function (p) { + return !!p; + }).join('-'); +} + +function isJSSlot(obj) { + return obj && (0, _typeof2["default"])(obj) === 'object' && EXPRESSION_TYPE.JSSLOT === obj.type; +} + +function isJSFunction(obj) { + return obj && (0, _typeof2["default"])(obj) === 'object' && EXPRESSION_TYPE.JSFUNCTION === obj.type; +} + +function isJSExpression(obj) { + //兼容两种写法,有js构造表达式的情况 + var isJSExpressionObj = obj && (0, _typeof2["default"])(obj) === 'object' && EXPRESSION_TYPE.JSEXPRESSION === obj.type && typeof obj.value === 'string'; + var isJSExpressionStr = typeof obj === 'string' && EXPRESSION_REG.test(obj.trim()); + return isJSExpressionObj || isJSExpressionStr; +} +/** + * @name wait + * @description 等待函数 + */ + + +function wait(ms) { + return new Promise(function (resolve) { + return setTimeout(function () { + return resolve(true); + }, ms); + }); +} + +function curry(Comp) { + var hocs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + return hocs.reverse().reduce(function (pre, cur) { + return cur(pre); + }, Comp); +} + +function getValue(obj, path, defaultValue) { + if (isEmpty(obj) || (0, _typeof2["default"])(obj) !== 'object') return defaultValue; + var res = path.split('.').reduce(function (pre, cur) { + return pre && pre[cur]; + }, obj); + if (res === undefined) return defaultValue; + return res; +} + +function parseObj(schemaStr) { + if (typeof schemaStr !== 'string') return schemaStr; //默认调用顶层窗口的parseObj,保障new Function的window对象是顶层的window对象 + + try { + if (inSameDomain() && window.parent.__newFunc) { + return window.parent.__newFunc("return ".concat(schemaStr))(); + } + + return new Function("return ".concat(schemaStr))(); + } catch (err) { + return undefined; + } +} + +function fastClone(obj) { + return parseObj(serialize(obj, { + unsafe: true + })); +} // 更新obj的内容但不改变obj的指针 + + +function fillObj() { + var receiver = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + Object.keys(receiver).forEach(function (item) { + delete receiver[item]; + }); + + for (var _len = arguments.length, suppliers = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + suppliers[_key - 1] = arguments[_key]; + } + + Object.assign.apply(Object, [receiver].concat(suppliers)); + return receiver; +} // 中划线转驼峰 + + +function toHump(name) { + return name.replace(/\-(\w)/g, function (all, letter) { + return letter.toUpperCase(); + }); +} // 驼峰转中划线 + + +function toLine(name) { + return name.replace(/([A-Z])/g, '-$1').toLowerCase(); +} // 获取当前环境 + + +function getEnv() { + var userAgent = navigator.userAgent; + var isVscode = /Electron\//.test(userAgent); + if (isVscode) return ENV.VSCODE; + var isTheia = window.is_theia === true; + if (isTheia) return ENV.WEBIDE; + return ENV.WEB; +} +/** + * 用于构造国际化字符串处理函数 + * @param {*} locale 国际化标识,例如 zh-CN、en-US + * @param {*} messages 国际化语言包 + */ + + +function generateI18n() { + var locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'zh-CN'; + var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return function (key) { + var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + if (!messages || !messages[key]) return ''; + var formater = new _intlMessageformat["default"](messages[key], locale); + return formater.format(values); + }; +} +/** + * 判断当前组件是否能够设置ref + * @param {*} Comp 需要判断的组件 + */ + + +function acceptsRef(Comp) { + return Comp.$$typeof && Comp.$$typeof === REACT_FORWARD_REF_TYPE || Comp.prototype && Comp.prototype.isReactComponent; +} +/** + * 黄金令箭埋点 + * @param {String} goKey 为黄金令箭业务类型 + * @param {Object} params 参数 + * @param {String} logKey 属性串 + */ + + +function goldlog(goKey) { + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var logKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'other'; + window.goldlog && window.goldlog.record("/iceluna.core.".concat(logKey), goKey, (0, _url.serialize)(_objectSpread({ + sdkVersion: _package["default"].version, + env: getEnv() + }, params)), 'POST'); +} // utils为编辑器打包生成的utils文件内容,utilsConfig为数据库存放的utils配置 + + +function generateUtils(utils, utilsConfig) { + if (!Array.isArray(utilsConfig)) return _objectSpread({}, utils); + var res = {}; + utilsConfig.forEach(function (item) { + if (!item.name || !item.type || !item.content) return; + + if (item.type === 'function' && typeof item.content === 'function') { + res[item.name] = item.content; + } else if (item.type === 'npm' && utils[item.name]) { + res[item.name] = utils[item.name]; + } + }); + return res; +} // 复制到粘贴板 + + +function setClipboardData(str) { + return new Promise(function (resolve, reject) { + if (typeof str !== 'string') reject('不支持拷贝'); + + if (navigator.clipboard) { + navigator.clipboard.writeText(str).then(function () { + resolve(); + })["catch"](function (err) { + reject('复制失败,请重试!', err); + }); + } else { + var textArea = document.createElement('textarea'); + textArea.value = str; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + + try { + var successful = document.execCommand('copy'); + + if (successful) { + document.body.removeChild(textArea); + resolve(); + } + } catch (err) { + document.body.removeChild(textArea); + reject('复制失败,请重试!', err); + } + } + }); +} // 获取粘贴板数据 + + +function getClipboardData() { + return new Promise(function (resolve, reject) { + if (window.clipboardData) { + resolve(window.clipboardData.getData('text')); + } else if (navigator.clipboard) { + return navigator.clipboard.readText().then(function (res) { + resolve(res); + })["catch"](function (err) { + reject('粘贴板获取失败', err); + }); + } else { + reject('粘贴板获取失败'); + } + }); +} // 将函数返回结果转成promise形式,如果函数有返回值则根据返回值的bool类型判断是reject还是resolve,若函数无返回值默认执行resolve + + +function transformToPromise(input) { + if (input instanceof Promise) return input; + return new Promise(function (resolve, reject) { + if (input || input === undefined) { + resolve(); + } else { + reject(); + } + }); +} + +function moveArrayItem(arr, sourceIdx, distIdx, direction) { + if (!Array.isArray(arr) || sourceIdx === distIdx || sourceIdx < 0 || sourceIdx >= arr.length || distIdx < 0 || distIdx >= arr.length) return arr; + var item = arr[sourceIdx]; + + if (direction === 'after') { + arr.splice(distIdx + 1, 0, item); + } else { + arr.splice(distIdx, 0, item); + } + + if (sourceIdx < distIdx) { + arr.splice(sourceIdx, 1); + } else { + arr.splice(sourceIdx + 1, 1); + } + + return arr; +} + +function transformArrayToMap(arr, key) { + var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + if (isEmpty(arr) || !Array.isArray(arr)) return {}; + var res = {}; + arr.forEach(function (item) { + var curKey = item[key]; + if (item[key] === undefined) return; + if (res[curKey] && !overwrite) return; + res[curKey] = item; + }); + return res; +} + +function checkPropTypes(value, name, rule, componentName) { + if (typeof rule === 'string') { + rule = new Function("const PropTypes = arguments[0]; return ".concat(rule))(PropTypes2); + } + + if (!rule || typeof rule !== 'function') { + console.warn('checkPropTypes should have a function type rule argument'); + return true; + } + + var err = rule((0, _defineProperty2["default"])({}, name, value), name, componentName, 'prop', null, ReactPropTypesSecret); + + if (err) { + console.warn(err); + } + + return !err; +} + +function transformSchemaToPure(obj) { + var pureObj = function pureObj(obj) { + if (Array.isArray(obj)) { + return obj.map(function (item) { + return pureObj(item); + }); + } else if ((0, _typeof2["default"])(obj) === 'object') { + // 对于undefined及null直接返回 + if (!obj) return obj; + var res = {}; + forEach(obj, function (val, key) { + if (key.startsWith('__') && key !== '__ignoreParse') return; + res[key] = pureObj(val); + }); + return res; + } + + return obj; + }; + + return pureObj(obj); +} + +function transformSchemaToStandard(obj) { + var standardObj = function standardObj(obj) { + if (Array.isArray(obj)) { + return obj.map(function (item) { + return standardObj(item); + }); + } else if ((0, _typeof2["default"])(obj) === 'object') { + // 对于undefined及null直接返回 + if (!obj) return obj; + var res = {}; + forEach(obj, function (val, key) { + if (key.startsWith('__') && key !== '__ignoreParse') return; + + if (isSchema(val) && key !== 'children' && obj.type !== 'JSSlot') { + res[key] = { + type: 'JSSlot', + value: standardObj(val) + }; // table特殊处理 + + if (key === 'cell') { + res[key].params = ['value', 'index', 'record']; + } + } else { + res[key] = standardObj(val); + } + }); + return res; + } else if (typeof obj === 'function') { + return { + type: 'JSFunction', + value: obj.toString() + }; + } else if (typeof obj === 'string' && EXPRESSION_REG.test(obj.trim())) { + var regRes = obj.trim().match(EXPRESSION_REG); + return { + type: 'JSExpression', + value: regRes && regRes[1] || '' + }; + } + + return obj; + }; + + return standardObj(obj, false); +} + +function addCssTag(id, content) { + var styleTag = document.getElementById(id); + + if (styleTag) { + styleTag.innerHTML = content; + return; + } + + styleTag = document.createElement('style'); + styleTag.id = id; + styleTag["class"] = 'luna-style'; + styleTag.innerHTML = content; + document.head.appendChild(styleTag); +} // 注册快捷 + + +function registShortCuts(config, appHelper) { + var keyboardFilter = keymaster.filter = function (event) { + var eTarget = event.target || event.srcElement; + var tagName = eTarget.tagName; + var isInput = !!(tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA'); + var isContenteditable = !!eTarget.getAttribute('contenteditable'); + + if (isInput || isContenteditable) { + if (event.metaKey === true && [70, 83].includes(event.keyCode)) event.preventDefault(); //禁止触发chrome原生的页面保存或查找 + + return false; + } else { + return true; + } + }; + + var ideMessage = appHelper.utils && appHelper.utils.ideMessage; //复制 + + if (!document.copyListener) { + document.copyListener = function (e) { + if (!keyboardFilter(e) || appHelper.isCopying) return; + var schema = appHelper.schemaHelper && appHelper.schemaHelper.schemaMap[appHelper.activeKey]; + if (!schema || !isSchema(schema)) return; + appHelper.isCopying = true; + var schemaStr = serialize(transformSchemaToPure(schema), { + unsafe: true + }); + setClipboardData(schemaStr).then(function () { + ideMessage && ideMessage('success', '当前内容已复制到剪贴板,请使用快捷键Command+v进行粘贴'); + appHelper.emit('schema.copy', schemaStr, schema); + appHelper.isCopying = false; + })["catch"](function (errMsg) { + ideMessage && ideMessage('error', errMsg); + appHelper.isCopying = false; + }); + }; + + document.addEventListener('copy', document.copyListener); + + if (window.parent.vscode) { + keymaster('command+c', document.copyListener); + } + } //粘贴 + + + if (!document.pasteListener) { + var doPaste = function doPaste(e, text) { + if (!keyboardFilter(e) || appHelper.isPasting) return; + var schemaHelper = appHelper.schemaHelper; + var targetKey = appHelper.activeKey; + var direction = 'after'; + var topKey = schemaHelper.schema && schemaHelper.schema.__ctx && schemaHelper.schema.__ctx.lunaKey; + + if (!targetKey || topKey === targetKey) { + var _schemaHelper = appHelper.schemaHelper; + + var _topKey = _schemaHelper.schema && _schemaHelper.schema.__ctx && _schemaHelper.schema.__ctx.lunaKey; + + if (!_topKey) return; + targetKey = _topKey; + direction = 'in'; + } + + appHelper.isPasting = true; + var schema = parseObj(text); + + if (!isSchema(schema)) { + appHelper.emit('illegalSchema.paste', text); // ideMessage && ideMessage('error', '当前内容不是模型结构,不能粘贴进来!'); + + console.warn('paste schema illegal'); + appHelper.isPasting = false; + return; + } + + appHelper.emit('material.add', { + schema: schema, + targetKey: targetKey, + direction: direction + }); + appHelper.isPasting = false; + appHelper.emit('schema.paste', schema); + }; + + document.pasteListener = function (e) { + var clipboardData = e.clipboardData || window.clipboardData; + var text = clipboardData && clipboardData.getData('text'); + doPaste(e, text); + }; + + document.addEventListener('paste', document.pasteListener); + + if (window.parent.vscode) { + keymaster('command+v', function (e) { + var sendIDEMessage = window.parent.sendIDEMessage; + sendIDEMessage && sendIDEMessage({ + action: 'readClipboard' + }).then(function (text) { + doPaste(e, text); + })["catch"](function (err) { + console.warn(err); + }); + }); + } + } + + (config || []).forEach(function (item) { + keymaster(item.keyboard, function (ev) { + ev.preventDefault(); + item.handler(ev, appHelper, keymaster); + }); + }); +} // 取消注册快捷 + + +function unRegistShortCuts(config) { + (config || []).forEach(function (item) { + keymaster.unbind(item.keyboard); + }); + + if (window.parent.vscode) { + keymaster.unbind('command+c'); + keymaster.unbind('command+v'); + } + + if (document.copyListener) { + document.removeEventListener('copy', document.copyListener); + delete document.copyListener; + } + + if (document.pasteListener) { + document.removeEventListener('paste', document.pasteListener); + delete document.pasteListener; + } +} + +function parseData(schema, self) { + if (isJSExpression(schema)) { + return parseExpression(schema, self); + } else if (typeof schema === 'string') { + return schema.trim(); + } else if (Array.isArray(schema)) { + return schema.map(function (item) { + return parseData(item, self); + }); + } else if (typeof schema === 'function') { + return schema.bind(self); + } else if ((0, _typeof2["default"])(schema) === 'object') { + var res = {}; + forEach(schema, function (val, key) { + if (key.startsWith('__')) return; + res[key] = parseData(val, self); + }); + return res; + } + + return schema; +} +/*全匹配{{开头,}}结尾的变量表达式,或者对象类型JSExpression,且均不支持省略this */ + + +function parseExpression(str, self) { + try { + var contextArr = ['var __self = arguments[0]']; + contextArr.push('return '); + var tarStr; //向前兼容,支持标准协议新格式 + + if (typeof str === 'string') { + var regRes = str.trim().match(EXPRESSION_REG); + tarStr = regRes[1]; + } else { + tarStr = str.value || ''; + } + + tarStr = tarStr.replace(/this(\W|$)/g, function (a, b) { + return "__self".concat(b); + }); + tarStr = contextArr.join('\n') + tarStr; //默认调用顶层窗口的parseObj,保障new Function的window对象是顶层的window对象 + + if (inSameDomain() && window.parent.__newFunc) { + return window.parent.__newFunc(tarStr)(self); + } + + return new Function(tarStr)(self); + } catch (err) { + debug('parseExpression.error', err, str, self); + return undefined; + } +} + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/request.js": +/*!************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/request.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.get = get; +exports.post = post; +exports.request = request; +exports.jsonp = jsonp; +exports.mtop = mtop; +exports.bzb = bzb; + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +__webpack_require__(/*! whatwg-fetch */ "./node_modules/_whatwg-fetch@3.0.0@whatwg-fetch/fetch.js"); + +var _libMtop = _interopRequireDefault(__webpack_require__(/*! @ali/lib-mtop */ "./node_modules/_@ali_lib-mtop@2.5.7@@ali/lib-mtop/build/mtop.common.js")); + +var _fetchJsonp = _interopRequireDefault(__webpack_require__(/*! fetch-jsonp */ "./node_modules/_fetch-jsonp@1.1.3@fetch-jsonp/build/fetch-jsonp.js")); + +var _bzbRequest = _interopRequireDefault(__webpack_require__(/*! @ali/bzb-request */ "./node_modules/_@ali_bzb-request@2.5.2@@ali/bzb-request/lib/index.js")); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var _url = __webpack_require__(/*! @ali/b3-one/lib/url */ "./node_modules/_@ali_b3-one@0.0.17@@ali/b3-one/lib/url.js"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var debug = (0, _debug["default"])('utils:request'); + +function get(dataAPI) { + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var otherProps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + headers = _objectSpread({ + Accept: 'application/json' + }, headers); + dataAPI = (0, _url.buildUrl)(dataAPI, params); + return request(dataAPI, 'GET', null, headers, otherProps); +} + +function post(dataAPI) { + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var otherProps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + headers = _objectSpread({ + Accept: 'application/json', + 'Content-Type': 'application/x-www-form-urlencoded' + }, headers); + return request(dataAPI, 'POST', headers['Content-Type'].indexOf('application/json') > -1 ? JSON.stringify(params) : (0, _url.serialize)(params), headers, otherProps); +} + +function request(dataAPI) { + var method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GET'; + var data = arguments.length > 2 ? arguments[2] : undefined; + var headers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + var otherProps = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; + + switch (method) { + case 'PUT': + case 'DELETE': + headers = _objectSpread({ + Accept: 'application/json', + 'Content-Type': 'application/json' + }, headers); + data = JSON.stringify(data || {}); + break; + } + + return new Promise(function (resolve, reject) { + if (otherProps.timeout) { + setTimeout(function () { + reject(new Error('timeout')); + }, otherProps.timeout); + } + + fetch(dataAPI, _objectSpread({ + method: method, + credentials: 'include', + headers: headers, + body: data + }, otherProps)).then(function (response) { + switch (response.status) { + case 200: + case 201: + case 202: + return response.json(); + + case 204: + if (method === 'DELETE') { + return { + success: true + }; + } else { + return { + __success: false, + code: response.status + }; + } + + case 400: + case 401: + case 403: + case 404: + case 406: + case 410: + case 422: + case 500: + return response.json().then(function (res) { + return { + __success: false, + code: response.status, + data: res + }; + })["catch"](function () { + return { + __success: false, + code: response.status + }; + }); + } + + return null; + }).then(function (json) { + if (json && json.__success !== false) { + resolve(json); + } else { + delete json.__success; + reject(json); + } + })["catch"](function (err) { + reject(err); + }); + }); +} + +function jsonp(dataAPI) { + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var otherProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return new Promise(function (resolve, reject) { + otherProps = _objectSpread({ + timeout: 5000 + }, otherProps); + (0, _fetchJsonp["default"])((0, _url.buildUrl)(dataAPI, params), otherProps).then(function (response) { + return response.json(); + }).then(function (json) { + if (json) { + resolve(json); + } else { + reject(); + } + })["catch"](function (err) { + reject(err); + }); + }); +} + +function mtop(dataAPI, params) { + var otherProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + _libMtop["default"].config.subDomain = otherProps.subDomain || 'm'; + return _libMtop["default"].request({ + api: dataAPI, + v: '1.0', + data: params, + ecode: otherProps.ecode || 0, + type: otherProps.method || 'GET', + AntiFlood: true, + // 防刷 + timeout: otherProps.timeout || 20000 + }); +} + +function bzb(apiCode, params) { + var otherProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var urlInfo = (0, _url.parseUrl)(window.parent && window.parent.location.href); + var urlParams = urlInfo.params || {}; + otherProps.method = otherProps.method || 'GET'; + otherProps.env = urlParams._env || otherProps.env || 'prod'; + return (0, _bzbRequest["default"])(apiCode, _objectSpread({ + data: params + }, otherProps)); +} + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/schemaHelper.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/schemaHelper.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/typeof.js")); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/objectWithoutProperties.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _obj = __webpack_require__(/*! @ali/b3-one/lib/obj */ "./node_modules/_@ali_b3-one@0.0.17@@ali/b3-one/lib/obj.js"); + +var _index = __webpack_require__(/*! ./index */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var _compFactory = _interopRequireDefault(__webpack_require__(/*! ../hoc/compFactory */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/hoc/compFactory.js")); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var debug = (0, _debug["default"])('utils:schemaHelper'); +var keyIndex = 0; + +var SchemaHelper = +/*#__PURE__*/ +function () { + function SchemaHelper(schema, appHelper) { + (0, _classCallCheck2["default"])(this, SchemaHelper); + this.appHelper = appHelper; + this.reset(schema, true); + } + + (0, _createClass2["default"])(SchemaHelper, [{ + key: "reset", + value: function reset(schema, isInit) { + debug('start reset'); + this.emit('schemaHelper.schema.beforeReset'); + this.schemaMap = {}; + this.blockSchemaMap = {}; + this.compThisMap = {}; + this.blockTree = {}; + this.compTreeMap = {}; + this.compCtxMap = {}; + this.rebuild(schema, isInit); + this.emit('schemaHelper.schema.afterReset'); + } + }, { + key: "add", + value: function add(schema, targetKey, direction) { + var _this = this; + + this.emit('schemaHelper.material.beforeAdd'); + var targetSchema = this.schemaMap[targetKey]; + if ((0, _index.isEmpty)(schema) || !targetSchema) return; + var targetPath = targetSchema.__ctx.lunaPath; + + if (targetPath === '' && direction !== 'in') { + console.warn('add error'); + return; + } + + var newSchema = []; + + if (Array.isArray(schema)) { + newSchema = schema.filter(function (item) { + return (0, _index.isSchema)(item, true); + }); + } else if ((0, _index.isSchema)(schema)) { + newSchema = [schema]; + } else { + console.error('模型结构异常'); + return; + } + + if (direction === 'in') { + var targetNode = _index.jsonuri.get(this.schema, targetPath); + + targetNode.children = (targetNode.children || []).concat(newSchema); //jsonuri.set(this.schema, targetPath, targetNode); + } else { + direction = ['left', 'top'].includes(direction) ? 'before' : 'after'; + newSchema.reverse().forEach(function (item) { + _index.jsonuri.insert(_this.schema, targetPath, item, direction); + }); + } + + var addKey = "luna_".concat(keyIndex + 1); + this.rebuild(this.schema); + this.emit('schemaHelper.material.afterAdd', addKey); + return addKey; + } + }, { + key: "remove", + value: function remove(lunaKey) { + this.emit('schemaHelper.material.beforeRemove'); + var schema = this.schemaMap[lunaKey]; + if (!schema) return; + var lunaPath = schema.__ctx.lunaPath; + + if (lunaPath === '') { + console.warn('root node can not be removed'); + return; + } + + _index.jsonuri.rm(this.schema, lunaPath); + + delete this.schemaMap[lunaKey]; + delete this.blockSchemaMap[lunaKey]; + this.rebuild(this.schema); + this.emit('schemaHelper.material.afterRemove'); + } + }, { + key: "move", + value: function move(lunaKey, targetKey, direction) { + this.emit('schemaHelper.material.beforeMove'); + debug('start move'); + var schema = this.schemaMap[lunaKey]; + var targetSchema = this.schemaMap[targetKey]; + if (!schema || !targetSchema) return; + var lunaPath = schema.__ctx.lunaPath; + var targetPath = targetSchema.__ctx.lunaPath; + + if (lunaPath === '' || targetPath === '' && direction !== 'in') { + console.warn('move error'); + return; + } + + var res = /(.*)\/(\d+)$/.exec(lunaPath); + var prefix = res && res[1]; + var attr = res && res[2]; + + if (!prefix || !attr) { + console.warn('异常结构'); + return; + } + + var sourceIdx = parseInt(attr); + var reg = new RegExp("^".concat(prefix, "/(\\d+)$")); + var regRes = reg.exec(targetPath); + + var sourceParent = _index.jsonuri.get(this.schema, prefix); + + direction = direction === 'in' ? 'in' : ['left', 'top'].includes(direction) ? 'before' : 'after'; + + if (regRes && regRes[1] && direction !== 'in') { + var distIdx = parseInt(regRes[1]); + (0, _index.moveArrayItem)(sourceParent, sourceIdx, distIdx, direction); + } else { + if (direction === 'in') { + var targetNode = _index.jsonuri.get(this.schema, targetPath); + + targetNode.children = targetNode.children || []; + + if (Array.isArray(targetNode.children)) { + targetNode.children.push(schema); + } + + _index.jsonuri.set(this.schema, targetPath, targetNode); + } else { + _index.jsonuri.insert(this.schema, targetPath, schema, direction); + } + + sourceParent.splice(sourceIdx, 1); + } + + this.rebuild(this.schema); + this.emit('schemaHelper.material.afterMove'); + } //组件上移 下移 + // direction 取值 down/up + + }, { + key: "slide", + value: function slide(lunaKey, direction) { + var schema = this.schemaMap[lunaKey]; + if (!schema || !direction) return; + var lunaPath = schema.__ctx && schema.__ctx.lunaPath; + if (!lunaPath) return; + if (direction === 'up' && lunaPath.endsWith('/0')) return; + var targetPath = lunaPath.replace(/\/(\d+)$/, function (res, idx) { + return "/".concat(direction === 'down' ? parseInt(idx) + 1 : parseInt(idx) - 1); + }); + var targetSchema = this.getSchemaByPath(targetPath); + var targetKey = targetSchema && targetSchema.__ctx && targetSchema.__ctx.lunaKey; + if (!targetKey) return; + this.move(lunaKey, targetKey, direction === 'down' ? 'bottom' : 'top'); + } // 快速复制 + + }, { + key: "copy", + value: function copy(lunaKey) { + this.emit('schemaHelper.material.beforeCopy'); + var schema = this.schemaMap[lunaKey]; + if (!schema) return; + var newSchema = (0, _index.transformSchemaToPure)((0, _index.fastClone)(schema)); + delete newSchema.__ctx; + var addKey = this.add(newSchema, schema.__ctx.lunaKey, 'bottom'); + this.emit('schemaHelper.material.afterCopy', addKey); + return addKey; + } + }, { + key: "update", + value: function update(lunaKey, props) { + this.emit('schemaHelper.material.beforeUpdate'); + var schema = this.schemaMap[lunaKey]; + if (!schema) return; + var __state = props.__state, + __defaultProps = props.__defaultProps, + __fileName = props.__fileName, + __scss = props.__scss, + __loop = props.__loop, + __loopArgs = props.__loopArgs, + __condition = props.__condition, + __lifeCycles = props.__lifeCycles, + __methods = props.__methods, + __dataSource = props.__dataSource, + children = props.children, + otherProps = (0, _objectWithoutProperties2["default"])(props, ["__state", "__defaultProps", "__fileName", "__scss", "__loop", "__loopArgs", "__condition", "__lifeCycles", "__methods", "__dataSource", "children"]); + debug('update props', props); //自定义组件才处理defaultProps + + if (schema.componentName === 'Component' && '__defaultProps' in props) { + if (!__defaultProps || (0, _typeof2["default"])(__defaultProps) !== 'object' || (0, _index.isEmpty)(__defaultProps)) { + delete schema.defaultProps; + } else { + schema.defaultProps = __defaultProps; + } + + this.appHelper.components[schema.fileName.replace(/^\w/, function (a) { + return a.toUpperCase(); + })] = (0, _compFactory["default"])(schema); + } // 如果loop值没有设置有效值,则删除schema中这个的字段 + + + if ('__loop' in props) { + if (!__loop || (0, _index.isEmpty)(__loop)) { + delete schema.loop; + } else { + schema.loop = __loop; + } + } // 指定循环上下文变量名 + + + if ('__loopArgs' in props) { + if (__loopArgs === undefined || (0, _typeof2["default"])(__loopArgs) === 'object' && (0, _index.isEmpty)(__loopArgs) || !Array.isArray(__loopArgs) || __loopArgs.every(function (item) { + return !item; + })) { + delete schema.loopArgs; + } else { + schema.loopArgs = __loopArgs; + } + } // 判断条件 + + + if ('__condition' in props) { + if (__condition === undefined) { + delete schema.condition; + } else { + schema.condition = __condition; + } + } // 处理容器类组件需要考虑的字段 + + + if ((0, _index.isFileSchema)(schema)) { + // filename + if ('__fileName' in props) { + schema.fileName = __fileName; + } // state + + + if ('__state' in props) { + // 重走生命周期 + schema.__ctx && ++schema.__ctx.idx; + + if (!__state || (0, _typeof2["default"])(__state) !== 'object' || (0, _index.isEmpty)(__state)) { + delete schema.state; + } else { + schema.state = __state; + } + } // 生命周期 + + + if ('__lifeCycles' in props) { + if (!__lifeCycles || (0, _typeof2["default"])(__lifeCycles) !== 'object' || (0, _index.isEmpty)(__lifeCycles)) { + delete schema.lifeCycles; + } else { + schema.lifeCycles = __lifeCycles; + } + } // 自定义方法 + + + if ('__methods' in props) { + if (!__methods || (0, _typeof2["default"])(__methods) !== 'object' || (0, _index.isEmpty)(__methods)) { + delete schema.methods; + } else { + schema.methods = __methods; + } + } // 数据源设置 + + + if ('__dataSource' in props) { + if (this.needContainerReload(schema.dataSource, __dataSource)) { + schema.__ctx && ++schema.__ctx.idx; + } + + if (__dataSource === undefined || (0, _typeof2["default"])(__dataSource) === 'object' && (0, _index.isEmpty)(__dataSource)) { + delete schema.dataSource; + } else { + schema.dataSource = __dataSource; + } + } // 如果scss值没有设置有效值,则删除schema中这个的字段 + + + if ('__scss' in props) { + if (!__scss) { + delete schema.scss; + } else { + schema.scss = __scss; + } + } + } // 子组件 + + + if ('children' in props) { + if (children === undefined || (0, _typeof2["default"])(children) === 'object' && (0, _index.isEmpty)(children)) { + delete schema.children; + } else { + schema.children = children; + } + } + + schema.props = _objectSpread({}, schema.props, {}, otherProps); //过滤undefined属性 + + Object.keys(schema.props).map(function (key) { + if (schema.props[key] === undefined) { + delete schema.props[key]; + } + }); + this.rebuild(this.schema); + this.emit('schemaHelper.material.afterUpdate'); + } + }, { + key: "createSchema", + value: function createSchema(componentName, props, isContainer) { + var schema = { + componentName: componentName, + props: props || {}, + __ctx: { + lunaKey: ++this.lunaKey + } + }; + + if (isContainer) { + schema.children = []; + } + + return schema; + } + }, { + key: "rebuild", + value: function rebuild(schema, isInit) { + var _this2 = this; + + if (!(0, _index.isFileSchema)(schema)) { + debug('top schema should be a file type'); //对于null的schema特殊处理一下 + + if (schema === null) { + this.schema = schema; + this.emit("schemaHelper.schema.".concat(isInit ? 'afterInit' : 'afterUpdate')); + } + + return; + } + + this.blockTree = null; + this.compTreeMap = {}; + this.compTree = null; + this.schemaMap = {}; + this.blockSchemaMap = {}; + this.compCtxMap = {}; + + var buildSchema = function buildSchema(schema, parentBlockNode, parentCompNode) { + var path = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ''; + + if (Array.isArray(schema)) { + return schema.map(function (item, idx) { + return buildSchema(item, parentBlockNode, parentCompNode, "".concat(path, "/").concat(idx)); + }); + } else if ((0, _typeof2["default"])(schema) === 'object') { + // 对于undefined及null直接返回 + if (!schema) return schema; //JSFunction转函数 + + if ((0, _index.isJSFunction)(schema)) { + if (typeof schema.value === 'string') { + var tarFun = (0, _index.parseObj)(schema.value); + + if (typeof tarFun === 'function') { + return tarFun; + } + } else if (typeof schema.value === 'function') { + return schema.value; + } + + return schema; + } //如果是对象且是JSExpression + + + if ((0, _index.isJSExpression)(schema)) { + return '{{' + schema.value + '}}'; + } + + var res = {}; + + if ((0, _index.isSchema)(schema)) { + res.__ctx = schema.__ctx; + + if (!res.__ctx) { + var _lunaKey = "luna_".concat(++keyIndex); + + res.__ctx = { + idx: 0, + lunaKey: _lunaKey, + lunaPath: path, + parentKey: parentCompNode && parentCompNode.lunaKey, + blockKey: parentBlockNode && parentBlockNode.lunaKey + }; + } else { + res.__ctx.lunaPath = path; + } + + var label = schema.componentName + (schema.fileName ? '-' + schema.fileName : ''); + var lunaKey = res.__ctx && res.__ctx.lunaKey; + _this2.schemaMap[lunaKey] = res; + + if ((0, _index.isFileSchema)(schema)) { + _this2.blockSchemaMap[lunaKey] = res; + var blockNode = { + label: label, + lunaKey: lunaKey, + isFile: true, + children: [] + }; + _this2.compTreeMap[lunaKey] = blockNode; + var compNode = (0, _index.clone)(blockNode); + + if (parentBlockNode) { + parentBlockNode.children.push(blockNode); + } else { + _this2.blockTree = blockNode; + } + + parentBlockNode = blockNode; + + if (parentCompNode) { + parentCompNode.children.push(compNode); + } else { + _this2.compTree = compNode; + } + + parentCompNode = compNode; + } else { + var _compNode = { + label: label, + lunaKey: lunaKey, + children: [] + }; + parentCompNode.children.push(_compNode); + parentCompNode = _compNode; + } + } + + (0, _obj.forEach)(schema, function (val, key) { + if (key.startsWith('__')) { + res[key] = val; + } else { + res[key] = buildSchema(val, parentBlockNode, parentCompNode, "".concat(path, "/").concat(key)); + } + }); + return res; + } + + return schema; + }; + + this.emit("schemaHelper.schema.".concat(isInit ? 'beforeInit' : 'beforeUpdate')); + this.schema = buildSchema(schema); + this.emit("schemaHelper.schema.".concat(isInit ? 'afterInit' : 'afterUpdate')); + } + }, { + key: "needContainerReload", + value: function needContainerReload() { + var preData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var nextData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (typeof preData.dataHandler === 'function' && typeof nextData.dataHandler === 'function' && preData.dataHandler.toString() !== nextData.dataHandler.toString()) { + return true; + } else if (preData.dataHandler !== nextData.dataHandler) { + return true; + } + + return !(0, _index.deepEqual)((preData.list || []).filter(function (item) { + return item.isInit; + }), (nextData.list || []).filter(function (item) { + return item.isInit; + }), function (pre, next) { + if (typeof pre === 'function' && next === 'function') { + return pre.toString() === next.toString(); + } + }); + } + }, { + key: "emit", + value: function emit(msg) { + var _this$appHelper; + + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + this.appHelper && (_this$appHelper = this.appHelper).emit.apply(_this$appHelper, [msg].concat(args)); + } + }, { + key: "get", + value: function get(key) { + return this[key]; + } + }, { + key: "getSchemaByPath", + value: function getSchemaByPath(path) { + return _index.jsonuri.get(this.schema, path); + } + }, { + key: "getSchema", + value: function getSchema() { + return this.schema; + } + }, { + key: "getPureSchema", + value: function getPureSchema() { + return (0, _index.transformSchemaToPure)(this.schema); + } + }, { + key: "getPureSchemaStr", + value: function getPureSchemaStr() { + return (0, _index.serialize)(this.getPureSchema(), { + unsafe: true + }); + } + }, { + key: "getStandardSchema", + value: function getStandardSchema() { + return (0, _index.transformSchemaToStandard)(this.schema); + } + }, { + key: "getStandardSchemaStr", + value: function getStandardSchemaStr() { + return (0, _index.serialize)(this.getStandardSchema(), { + unsafe: true + }); + } + }]); + return SchemaHelper; +}(); + +exports["default"] = SchemaHelper; + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/storageHelper.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/storageHelper.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _localforage = _interopRequireDefault(__webpack_require__(/*! localforage */ "./node_modules/_localforage@1.7.3@localforage/dist/localforage.js")); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var _index = __webpack_require__(/*! ./index */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +var debug = (0, _debug["default"])('utils:storageHelper'); + +var StorageHelper = +/*#__PURE__*/ +function () { + function StorageHelper(name) { + (0, _classCallCheck2["default"])(this, StorageHelper); + this.store = _localforage["default"].createInstance(name); + } + + (0, _createClass2["default"])(StorageHelper, [{ + key: "getItem", + value: function getItem(key) { + if (!this.store) { + throw new Error('store instance not exist'); + } + + return this.store.getItem(key); + } + }, { + key: "setItem", + value: function setItem(key, value) { + if (!this.store) { + throw new Error('store instance not exist'); + } + + return this.store.setItem(key, value); + } + }, { + key: "removeItem", + value: function removeItem(key) { + if (!this.store) { + throw new Error('store instance not exist'); + } + + return this.store.removeItem(key); + } + }, { + key: "clear", + value: function clear() { + if (!this.store) { + throw new Error('store instance not exist'); + } + + return this.store.clear(); + } + }, { + key: "addHistory", + value: function addHistory(key, code) { + var _this = this; + + var limit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10; + return new Promise(function (resolve, reject) { + key = '__luna_history_' + key; + + _this.store.getItem(key).then(function (res) { + var codeStr = (0, _index.serialize)(code, { + unsafe: true + }); + + if (res && res[0] && res[0].code) { + if (codeStr === res[0].code) return; + } + + res = res || []; + var newId = 1; + + if (res && res[0] && res[0].id) { + newId = res[0].id + 1; + } + + res.unshift({ + id: newId, + time: +new Date(), + code: codeStr + }); + + _this.store.setItem(key, res.slice(0, limit)).then(function (res) { + resolve(res); + })["catch"](reject); + })["catch"](reject); + }); + } + }, { + key: "getHistory", + value: function getHistory(key) { + key = '__luna_history_' + key; + return this.store.getItem(key); + } + }, { + key: "clearHistory", + value: function clearHistory(key) { + key = '__luna_history_' + key; + this.store.removeItem(key); + } + }]); + return StorageHelper; +}(); + +exports["default"] = StorageHelper; + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/undoRedoHelper.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/undoRedoHelper.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var _index = __webpack_require__(/*! ./index */ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/index.js"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var DEFAULT_CONFIG = { + limit: 20 +}; +var debug = (0, _debug["default"])('utils:undoRedoHelper'); + +var UndoRedoHelper = +/*#__PURE__*/ +function () { + function UndoRedoHelper(config) { + (0, _classCallCheck2["default"])(this, UndoRedoHelper); + this.config = _objectSpread({}, DEFAULT_CONFIG, {}, config); + this.data = {}; + } + + (0, _createClass2["default"])(UndoRedoHelper, [{ + key: "create", + value: function create(key, value, forceCreate) { + if (!this.data[key] || forceCreate) { + this.data[key] = { + list: [(0, _index.fastClone)(value)], + idx: 0 + }; + } + + return this.data[key]; + } + }, { + key: "delete", + value: function _delete(key) { + delete this.data[key]; + } + }, { + key: "resetRecord", + value: function resetRecord(key, value) { + var data = this.data[key]; + if (!data || !data.list) return; + data.list = data.list.slice(0, data.idx + 1); + data.list[data.idx] = (0, _index.fastClone)(value); + } + }, { + key: "record", + value: function record(key, value) { + var data = this.data[key]; + var limit = this.config.limit; + if (!data || !data.list) return; + data.list = data.list.slice(0, data.idx + 1); + + if (data.list.length >= limit) { + data.list.shift(); + } + + data.list.push((0, _index.fastClone)(value)); + ++data.idx; + } + }, { + key: "undo", + value: function undo(key) { + var data = this.data[key]; + if (!data || !data.list) return null; //若没有前置操作,返回当前数据 + + if (data.idx <= 0) return data.list[data.idx]; + --data.idx; + return data.list[data.idx]; + } + }, { + key: "redo", + value: function redo(key) { + var data = this.data[key]; + if (!data || !data.list) return null; //若没有后续操作,返回当前数据 + + if (data.idx >= data.list.length - 1) return data.list[data.idx]; + ++data.idx; + return data.list[data.idx]; + } + }, { + key: "past", + value: function past(key) { + var data = this.data[key]; + if (!data || !data.list || data.idx <= 0) return null; + return data.list[data.idx - 1]; + } + }, { + key: "present", + value: function present(key) { + var data = this.data[key]; + if (!data || !data.list) return null; + return data.list[data.idx]; + } + }, { + key: "future", + value: function future(key) { + var data = this.data[key]; + if (!data || !data.list || data.idx >= data.list.length - 1) return null; + return data.list[data.idx + 1]; + } + }, { + key: "get", + value: function get(key) { + return { + past: this.past(key), + present: this.present(key), + future: this.future(key) + }; + } + }]); + return UndoRedoHelper; +}(); + +exports["default"] = UndoRedoHelper; + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/wsHelper.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/lib/utils/wsHelper.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _debug = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/_debug@4.1.1@debug/src/browser.js")); + +var _socket = _interopRequireDefault(__webpack_require__(/*! socket.io-client */ "./node_modules/_socket.io-client@2.3.0@socket.io-client/lib/index.js")); + +var _url = __webpack_require__(/*! @ali/b3-one/lib/url */ "./node_modules/_@ali_b3-one@0.0.17@@ali/b3-one/lib/url.js"); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +var debug = (0, _debug["default"])('utils:wsHelper'); + +var WSHelper = +/*#__PURE__*/ +function () { + function WSHelper(appHelper, namespace, options) { + (0, _classCallCheck2["default"])(this, WSHelper); + this.appHelper = appHelper; + this.ws = null; + this.init(namespace, options); + } + + (0, _createClass2["default"])(WSHelper, [{ + key: "init", + value: function init() { + var namespace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/'; + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (this.ws) { + this.close(); + } + + var urlInfo = (0, _url.parseUrl)(); + var ws = this.ws = (0, _socket["default"])(namespace, _objectSpread({ + reconnectionDelay: 3000, + transports: ['websocket'], + query: urlInfo.params + }, options)); + var appHelper = this.appHelper; + debug('ws.init'); + ws.on('connect', function (msg) { + appHelper.emit('wsHelper.connect.success', msg); + debug('ws.connect'); + }); + ws.on('error', function (msg) { + appHelper.emit('wsHelper.connect.error', msg); + debug('ws.error', msg); + }); + ws.on('disconnect', function (msg) { + appHelper.emit('wsHelper.connect.break', msg); + debug('ws.disconnect', msg); + }); + ws.on('reconnecting', function (msg) { + appHelper.emit('wsHelper.connect.retry', msg); + debug('ws.reconnecting', msg); + }); + ws.on('ping', function (msg) { + debug('ws.ping', msg); + }); + ws.on('pong', function (msg) { + debug('ws.pong', msg); + }); + ws.on('data', function (msg) { + appHelper.emit('wsHelper.data.receive', msg); + + if (msg.eventName) { + appHelper.emit("wsHelper.result.".concat(msg.eventName), msg); + } + + debug('ws.data', msg); + }); + } + }, { + key: "close", + value: function close() { + if (!this.ws) return; + this.ws.close(); + this.ws = null; + this.appHelper.emit('wsHelper.connect.close'); + } + }, { + key: "send", + value: function send(eventName) { + var _this = this; + + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + return new Promise(function (resolve, reject) { + try { + var _this$ws; + + _this.appHelper.emit('wsHelper.data.request', { + eventName: eventName, + params: args + }); + + _this.appHelper.once("wsHelper.result.".concat(eventName), resolve); + + _this.ws && (_this$ws = _this.ws).emit.apply(_this$ws, [eventName].concat(args)); + debug('ws.send', eventName); + } catch (err) { + console.error('websocket error:', err); + reject(err); + } + }); + } + }]); + return WSHelper; +}(); + +exports["default"] = WSHelper; + +/***/ }), + +/***/ "./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/package.json": +/*!****************************************************************************!*\ + !*** ./node_modules/_@ali_iceluna-sdk@1.0.4@@ali/iceluna-sdk/package.json ***! + \****************************************************************************/ +/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, dependencies, peerDependencies, devDependencies, publishConfig, __npminstall_done, _from, _resolved, default */ +/***/ (function(module) { + +module.exports = {"name":"@ali/iceluna-sdk","version":"1.0.4","description":"icelunaSDK","main":"lib/index.js","scripts":{"babel":"rm -rf lib && babel src -d lib --copy-files","prettier":"prettier --write \"./src/**/*.{js,jsx,ejs,less,css,scss,json}\" \"./demo/**/*.{js,jsx,ejs,less,css,scss,json}\"","build":"npm run babel","prepublish":"npm run prettier && npm run babel"},"repository":{"type":"git","url":"git@gitlab.alibaba-inc.com:iceluna/iceluna-SDK.git"},"keywords":["iceluna","SDK"],"author":"xiayang.xy","license":"ISC","dependencies":{"@ali/b3-one":"^0.0.17","@ali/bzb-request":"^2.3.3-beta","@ali/iceluna-comp-div":"^0.0.5","@ali/lib-mtop":"^2.5.1","@alifd/next":"^1.18.17","debug":"^4.1.1","events":"^3.0.0","fetch-jsonp":"^1.1.3","intl-messageformat":"^7.7.2","jsonuri":"^2.1.2","keymaster":"^1.6.2","localforage":"^1.7.3","lodash":"^4.17.11","moment":"^2.24.0","react-is":"^16.10.1","serialize-javascript":"^1.7.0","socket.io-client":"^2.2.0","whatwg-fetch":"^3.0.0"},"peerDependencies":{"react":"^16.8.6","react-dom":"^16.8.6","prop-types":"^15.7.2"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.4","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-decorators":"^7.0.0","@babel/plugin-syntax-dynamic-import":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/preset-env":"^7.4.4","@babel/preset-react":"^7.0.0","babel-eslint":"^9.0.0","eslint":"^4.15.0","eslint-config-airbnb":"^17.1.0","eslint-loader":"^1.9.0","eslint-plugin-react":"^7.12.4","prettier":"^1.12.1"},"publishConfig":{"registry":"http://registry.npm.alibaba-inc.com"},"__npminstall_done":"Tue Feb 18 2020 02:41:34 GMT+0800 (GMT+08:00)","_from":"@ali/iceluna-sdk@1.0.4","_resolved":"https://registry.npm.alibaba-inc.com/@ali/iceluna-sdk/download/@ali/iceluna-sdk-1.0.4.tgz"}; + +/***/ }), + +/***/ "./node_modules/_@ali_lib-mtop@2.5.7@@ali/lib-mtop/build/mtop.common.js": +/*!******************************************************************************!*\ + !*** ./node_modules/_@ali_lib-mtop@2.5.7@@ali/lib-mtop/build/mtop.common.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +(typeof window === 'undefined') && (window = {ctrl: {}, lib: {}});!window.ctrl && (window.ctrl = {});!window.lib && (window.lib = {});!function(a,b){function c(){var a={},b=new q(function(b,c){a.resolve=b,a.reject=c});return a.promise=b,a}function d(a,b){for(var c in b)void 0===a[c]&&(a[c]=b[c]);return a}function e(a){var b=document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]||document.firstElementChild||document;b.appendChild(a)}function f(a){var b=[];for(var c in a)a[c]&&b.push(c+"="+encodeURIComponent(a[c]));return b.join("&")}function g(a){try{return".com"!==a.substring(a.lastIndexOf("."))?(a.split(".")||[]).length<=3?a:a.split(".").slice(1).join("."):a.substring(a.lastIndexOf(".",a.lastIndexOf(".")-1)+1)}catch(b){return a.substring(a.lastIndexOf(".",a.lastIndexOf(".")-1)+1)}}function h(a){function b(a,b){return a<>>32-b}function c(a,b){var c,d,e,f,g;return e=2147483648&a,f=2147483648&b,c=1073741824&a,d=1073741824&b,g=(1073741823&a)+(1073741823&b),c&d?2147483648^g^e^f:c|d?1073741824&g?3221225472^g^e^f:1073741824^g^e^f:g^e^f}function d(a,b,c){return a&b|~a&c}function e(a,b,c){return a&c|b&~c}function f(a,b,c){return a^b^c}function g(a,b,c){return b^(a|~c)}function h(a,e,f,g,h,i,j){return a=c(a,c(c(d(e,f,g),h),j)),c(b(a,i),e)}function i(a,d,f,g,h,i,j){return a=c(a,c(c(e(d,f,g),h),j)),c(b(a,i),d)}function j(a,d,e,g,h,i,j){return a=c(a,c(c(f(d,e,g),h),j)),c(b(a,i),d)}function k(a,d,e,f,h,i,j){return a=c(a,c(c(g(d,e,f),h),j)),c(b(a,i),d)}function l(a){for(var b,c=a.length,d=c+8,e=(d-d%64)/64,f=16*(e+1),g=new Array(f-1),h=0,i=0;c>i;)b=(i-i%4)/4,h=i%4*8,g[b]=g[b]|a.charCodeAt(i)<>>29,g}function m(a){var b,c,d="",e="";for(c=0;3>=c;c++)b=a>>>8*c&255,e="0"+b.toString(16),d+=e.substr(e.length-2,2);return d}function n(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;cd?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b}var o,p,q,r,s,t,u,v,w,x=[],y=7,z=12,A=17,B=22,C=5,D=9,E=14,F=20,G=4,H=11,I=16,J=23,K=6,L=10,M=15,N=21;for(a=n(a),x=l(a),t=1732584193,u=4023233417,v=2562383102,w=271733878,o=0;of;f++){var g=Number(c[f]),h=Number(d[f]);if(g>h)return 1;if(h>g)return-1;if(!isNaN(g)&&isNaN(h))return 1;if(isNaN(g)&&!isNaN(h))return-1}return 0}function n(){var b=a.location.hostname;if(!b){var c=a.parent.location.hostname;c&&~c.indexOf("zebra.alibaba-inc.com")&&(b=c)}var d=["taobao.net","taobao.com","tmall.com","tmall.hk","alibaba-inc.com"],e=new RegExp("([^.]*?)\\.?((?:"+d.join(")|(?:").replace(/\./g,"\\.")+"))","i"),f=b.match(e)||[],g=f[2]||"taobao.com",h=f[1]||"m";"taobao.net"!==g||"x"!==h&&"waptest"!==h&&"daily"!==h?"taobao.net"===g&&"demo"===h?h="demo":"alibaba-inc.com"===g&&"zebra"===h?h="zebra":"waptest"!==h&&"wapa"!==h&&"m"!==h&&(h="m"):h="waptest";var i="h5api";"taobao.net"===g&&"waptest"===h&&(i="acs"),s.mainDomain=g,s.subDomain=h,s.prefix=i}function o(){var b=a.navigator.userAgent,c=b.match(/WindVane[\/\s]([\d\.\_]+)/);c&&(s.WindVaneVersion=c[1]);var d=b.match(/AliApp\(([^\/]+)\/([\d\.\_]+)\)/i);d&&(s.AliAppName=d[1],s.AliAppVersion=d[2]);var e=b.match(/AMapClient\/([\d\.\_]+)/i);e&&(s.AliAppName="AMAP",s.AliAppVersion=e[1])}function p(a){this.id=""+(new Date).getTime()+ ++y,this.params=d(a||{},{v:"*",data:{},type:"get",dataType:"jsonp"}),this.params.type=this.params.type.toLowerCase(),"object"==typeof this.params.data&&(this.params.data=JSON.stringify(this.params.data)),this.middlewares=t.slice(0)}var q=a.Promise,r=(q||{resolve:function(){return void 0}}).resolve();String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});var s={useJsonpResultType:!1,safariGoLogin:!0,useAlipayJSBridge:!1},t=[],u={ERROR:-1,SUCCESS:0,TOKEN_EXPIRED:1,SESSION_EXPIRED:2};n(),o();var v=/[Android|Adr]/.test(a.navigator.userAgent),w="AP"===s.AliAppName,x=w&&m(s.AliAppVersion,"10.1.2")>=0||"KB"===s.AliAppName&&m(s.AliAppVersion,"7.1.62")>=0||v&&"AMAP"===s.AliAppName&&m(s.AliAppVersion,"1.0.1")>=0,y=0,z="2.5.7";p.prototype.use=function(a){if(!a)throw new Error("middleware is undefined");return this.middlewares.push(a),this},p.prototype.__processRequestMethod=function(a){var b=this.params,c=this.options;"get"===b.type&&"jsonp"===b.dataType?c.getJSONP=!0:"get"===b.type&&"originaljsonp"===b.dataType?c.getOriginalJSONP=!0:"get"===b.type&&"json"===b.dataType?c.getJSON=!0:"post"===b.type&&(c.postJSON=!0),a()},p.prototype.__processRequestType=function(c){var d=this,e=this.params,f=this.options;if(s.H5Request===!0&&(f.H5Request=!0),s.WindVaneRequest===!0&&(f.WindVaneRequest=!0),f.H5Request===!1&&f.WindVaneRequest===!0){if(!x&&(!b.windvane||parseFloat(f.WindVaneVersion)<5.4))throw new Error("WINDVANE_NOT_FOUND::缺少WindVane环境");if(x&&!a.AlipayJSBridge)throw new Error("ALIPAY_NOT_READY::支付宝通道未准备好,支付宝请见 https://lark.alipay.com/mtbsdkdocs/mtopjssdkdocs/pucq6z")}else if(f.H5Request===!0)f.WindVaneRequest=!1;else if("undefined"==typeof f.WindVaneRequest&&"undefined"==typeof f.H5Request&&(b.windvane&&parseFloat(f.WindVaneVersion)>=5.4?(f.WindVaneRequest=!0,window.self!==window.top&&(f.H5Request=!0)):f.H5Request=!0,x)){if(f.WindVaneRequest=f.H5Request=void 0,a.AlipayJSBridge)if(i(e.data))f.WindVaneRequest=!0;else try{i(JSON.parse(e.data))?f.WindVaneRequest=!0:f.H5Request=!0}catch(g){f.H5Request=!0}else f.H5Request=!0;"AMAP"!==s.AliAppName||e.useNebulaJSbridgeWithAMAP||(f.WindVaneRequest=f.H5Request=void 0,f.H5Request=!0)}var h=a.navigator.userAgent.toLowerCase();return h.indexOf("youku")>-1&&f.mainDomain.indexOf("youku.com")<0&&(f.WindVaneRequest=!1,f.H5Request=!0),f.mainDomain.indexOf("youku.com")>-1&&h.indexOf("youku")<0&&(f.WindVaneRequest=!1,f.H5Request=!0),c?c().then(function(){var a=f.retJson.ret;if(a instanceof Array&&(a=a.join(",")),f.WindVaneRequest===!0&&x&&f.retJson.error||!a||a.indexOf("PARAM_PARSE_ERROR")>-1||a.indexOf("HY_FAILED")>-1||a.indexOf("HY_NO_HANDLER")>-1||a.indexOf("HY_CLOSED")>-1||a.indexOf("HY_EXCEPTION")>-1||a.indexOf("HY_NO_PERMISSION")>-1){if(!x||!isNaN(f.retJson.error)||-1!==f.retJson.error.indexOf("FAIL_SYS_ACCESS_DENIED"))return x&&i(e.data)&&(e.data=JSON.stringify(e.data)),s.H5Request=!0,d.__sequence([d.__processRequestType,d.__processToken,d.__processRequestUrl,d.middlewares,d.__processRequest]);"undefined"==typeof f.retJson.api&&"undefined"==typeof f.retJson.v&&(f.retJson.api=e.api,f.retJson.v=e.v,f.retJson.ret=[f.retJson.error+"::"+f.retJson.errorMessage],f.retJson.data={})}}):void 0};var A="_m_h5_c",B="_m_h5_tk",C="_m_h5_tk_enc";p.prototype.__getTokenFromAlipay=function(){var b=c(),d=this.options,e=(a.navigator.userAgent,!!location.protocol.match(/^https?\:$/));return d.useAlipayJSBridge===!0&&!e&&x&&a.AlipayJSBridge&&a.AlipayJSBridge.call?a.AlipayJSBridge.call("getMtopToken",function(a){a&&a.token&&(d.token=a.token),b.resolve()},function(){b.resolve()}):b.resolve(),b.promise},p.prototype.__getTokenFromCookie=function(){var a=this.options;return a.CDR&&k(A)?a.token=k(A).split(";")[0]:a.token=a.token||k(B),a.token&&(a.token=a.token.split("_")[0]),q.resolve()},p.prototype.__waitWKWebViewCookie=function(b){var c=this.options;c.waitWKWebViewCookieFn&&c.H5Request&&a.webkit&&a.webkit.messageHandlers?c.waitWKWebViewCookieFn(b):b()},p.prototype.__processToken=function(a){var b=this,c=this.options;this.params;return c.token&&delete c.token,c.WindVaneRequest!==!0?r.then(function(){return b.__getTokenFromAlipay()}).then(function(){return b.__getTokenFromCookie()}).then(a).then(function(){var a=c.retJson,d=a.ret;if(d instanceof Array&&(d=d.join(",")),d.indexOf("TOKEN_EMPTY")>-1||(c.CDR===!0||c.syncCookieMode===!0)&&d.indexOf("ILLEGAL_ACCESS")>-1||d.indexOf("TOKEN_EXOIRED")>-1){if(c.maxRetryTimes=c.maxRetryTimes||5,c.failTimes=c.failTimes||0,c.H5Request&&++c.failTimes0&&(l(A,c.pageDomain,"*"),l(B,c.mainDomain,c.subDomain),l(C,c.mainDomain,c.subDomain)),a.retType=u.TOKEN_EXPIRED}}):void a()},p.prototype.__processRequestUrl=function(b){var c=this.params,d=this.options;if(d.hostSetting&&d.hostSetting[a.location.hostname]){var e=d.hostSetting[a.location.hostname];e.prefix&&(d.prefix=e.prefix),e.subDomain&&(d.subDomain=e.subDomain),e.mainDomain&&(d.mainDomain=e.mainDomain)}if(d.H5Request===!0){var f="//"+(d.prefix?d.prefix+".":"")+(d.subDomain?d.subDomain+".":"")+d.mainDomain+"/h5/"+c.api.toLowerCase()+"/"+c.v.toLowerCase()+"/",g=c.appKey||("waptest"===d.subDomain?"4272":"12574478"),i=(new Date).getTime(),j=h(d.token+"&"+i+"&"+g+"&"+c.data),k={jsv:z,appKey:g,t:i,sign:j},l={data:c.data,ua:c.ua};Object.keys(c).forEach(function(a){"undefined"==typeof k[a]&&"undefined"==typeof l[a]&&"headers"!==a&&"ext_headers"!==a&&"ext_querys"!==a&&(k[a]=c[a])}),c.ext_querys&&Object.keys(c.ext_querys).forEach(function(a){k[a]=c.ext_querys[a]}),d.getJSONP?k.type="jsonp":d.getOriginalJSONP?k.type="originaljsonp":(d.getJSON||d.postJSON)&&(k.type="originaljson"),"undefined"!=typeof c.valueType&&("original"===c.valueType?d.getJSONP||d.getOriginalJSONP?k.type="originaljsonp":(d.getJSON||d.postJSON)&&(k.type="originaljson"):"string"===c.valueType&&(d.getJSONP||d.getOriginalJSONP?k.type="jsonp":(d.getJSON||d.postJSON)&&(k.type="json"))),d.useJsonpResultType===!0&&"originaljson"===k.type&&delete k.type,d.dangerouslySetProtocol&&(f=d.dangerouslySetProtocol+":"+f),d.querystring=k,d.postdata=l,d.path=f}b()},p.prototype.__processUnitPrefix=function(a){a()};var D=0;p.prototype.__requestJSONP=function(a){function b(a){if(k&&clearTimeout(k),l.parentNode&&l.parentNode.removeChild(l),"TIMEOUT"===a)window[j]=function(){window[j]=void 0;try{delete window[j]}catch(a){}};else{window[j]=void 0;try{delete window[j]}catch(b){}}}var d=c(),g=this.params,h=this.options,i=g.timeout||2e4,j="mtopjsonp"+(g.jsonpIncPrefix||"")+ ++D,k=setTimeout(function(){a(h.timeoutErrMsg||"TIMEOUT::接口超时"),b("TIMEOUT")},i);h.querystring.callback=j;var l=document.createElement("script");return l.src=h.path+"?"+f(h.querystring)+"&"+f(h.postdata),l.async=!0,l.onerror=function(){b("ABORT"),a(h.abortErrMsg||"ABORT::接口异常退出")},window[j]=function(){h.results=Array.prototype.slice.call(arguments),b(),d.resolve()},e(l),d.promise},p.prototype.__requestJSON=function(b){function d(a){l&&clearTimeout(l),"TIMEOUT"===a&&i.abort()}var e=c(),g=this.params,h=this.options,i=new a.XMLHttpRequest,j=g.timeout||2e4,l=setTimeout(function(){b(h.timeoutErrMsg||"TIMEOUT::接口超时"),d("TIMEOUT")},j);h.CDR&&k(A)&&(h.querystring.c=decodeURIComponent(k(A))),i.onreadystatechange=function(){if(4==i.readyState){var a,c,f=i.status;if(f>=200&&300>f||304==f){d(),a=i.responseText,c=i.getAllResponseHeaders()||"";try{a=/^\s*$/.test(a)?{}:JSON.parse(a),a.responseHeaders=c,h.results=[a],e.resolve()}catch(g){b("PARSE_JSON_ERROR::解析JSON失败")}}else d("ABORT"),b(h.abortErrMsg||"ABORT::接口异常退出")}};var m,n,o=h.path+"?"+f(h.querystring);h.getJSON?(m="GET",o+="&"+f(h.postdata)):h.postJSON&&(m="POST",n=f(h.postdata)),i.open(m,o,!0),i.withCredentials=!0,i.setRequestHeader("Accept","application/json"),i.setRequestHeader("Content-type","application/x-www-form-urlencoded");var p=g.ext_headers||g.headers;if(p)for(var q in p)i.setRequestHeader(q,p[q]);return i.send(n),e.promise},p.prototype.__requestWindVane=function(a){function d(a){g.results=[a],e.resolve()}var e=c(),f=this.params,g=this.options,h=f.data,i=f.api,j=f.v,k=g.postJSON?1:0,l=g.getJSON||g.postJSON||g.getOriginalJSONP?"originaljson":"";"undefined"!=typeof f.valueType&&("original"===f.valueType?l="originaljson":"string"===f.valueType&&(l="")),g.useJsonpResultType===!0&&(l="");var m,n,o="https"===location.protocol?1:0,p=f.isSec||0,q=f.sessionOption||"AutoLoginOnly",r=f.ecode||0,s=f.ext_headers||{},t=f.ext_querys||{};n="undefined"!=typeof f.timer?parseInt(f.timer):"undefined"!=typeof f.timeout?parseInt(f.timeout):2e4,m=2*n,f.needLogin===!0&&"undefined"==typeof f.sessionOption&&(q="AutoLoginAndManualLogin"),"undefined"!=typeof f.secType&&"undefined"==typeof f.isSec&&(p=f.secType);var u={api:i,v:j,post:String(k),type:l,isHttps:String(o),ecode:String(r),isSec:String(p),param:JSON.parse(h),timer:n,sessionOption:q,ext_headers:s,ext_querys:t};return f.ttid&&g.dangerouslySetWVTtid===!0&&(u.ttid=f.ttid),Object.assign&&f.dangerouslySetWindvaneParams&&Object.assign(u,f.dangerouslySetWindvaneParams),b.windvane.call("MtopWVPlugin","send",u,d,d,m),e.promise},p.prototype.__requestAlipay=function(b){function d(a){g.results=[a],e.resolve()}var e=c(),f=this.params,g=this.options,h={apiName:f.api,apiVersion:f.v,needEcodeSign:"1"===String(f.ecode),usePost:!!g.postJSON};return i(f.data)||(f.data=JSON.parse(f.data)),h.data=f.data,f.ttid&&g.dangerouslySetWVTtid===!0&&(h.ttid=f.ttid),(g.getJSON||g.postJSON||g.getOriginalJSONP)&&(h.type="originaljson"),"undefined"!=typeof f.valueType&&("original"===f.valueType?h.type="originaljson":"string"===f.valueType&&delete h.type),g.useJsonpResultType===!0&&delete h.type,Object.assign&&f.dangerouslySetAlipayParams&&Object.assign(h,f.dangerouslySetAlipayParams),a.AlipayJSBridge.call("mtop",h,d),e.promise},p.prototype.__processRequest=function(a,b){var c=this;return r.then(function(){var a=c.options;if(a.H5Request&&(a.getJSONP||a.getOriginalJSONP))return c.__requestJSONP(b);if(a.H5Request&&(a.getJSON||a.postJSON))return c.__requestJSON(b);if(a.WindVaneRequest)return x?c.__requestAlipay(b):c.__requestWindVane(b);throw new Error("UNEXCEPT_REQUEST::错误的请求类型")}).then(a).then(function(){var a=c.options,b=(c.params,a.results[0]),d=b&&b.ret||[];b.ret=d,d instanceof Array&&(d=d.join(","));var e=b.c;a.CDR&&e&&j(A,e,{domain:a.pageDomain,path:"/"}),d.indexOf("SUCCESS")>-1?b.retType=u.SUCCESS:b.retType=u.ERROR,a.retJson=b})},p.prototype.__sequence=function(a){function b(a){if(a instanceof Array)a.forEach(b);else{var g,h=c(),i=c();e.push(function(){return h=c(),g=a.call(d,function(a){return h.resolve(a),i.promise},function(a){return h.reject(a),i.promise}),g&&(g=g["catch"](function(a){h.reject(a)})),h.promise}),f.push(function(a){return i.resolve(a),g})}}var d=this,e=[],f=[];a.forEach(b);for(var g,h=r;g=e.shift();)h=h.then(g);for(;g=f.pop();)h=h.then(g);return h};var E=function(a){a()},F=function(a){a()};p.prototype.request=function(c){var e=this;if(this.options=d(c||{},s),!q){var f="当前浏览器不支持Promise,请在windows对象上挂载Promise对象";throw b.mtop={ERROR:f},new Error(f)}var h=q.resolve([E,F]).then(function(a){var b=a[0],c=a[1];return e.__sequence([b,e.__processRequestMethod,e.__processRequestType,e.__processToken,e.__processRequestUrl,e.middlewares,e.__processRequest,c])}).then(function(){var a=e.options.retJson;return a.retType!==u.SUCCESS?q.reject(a):e.options.successCallback?void e.options.successCallback(a):q.resolve(a)})["catch"](function(a){var c;return a instanceof Error?(console.error(a.stack),c={ret:[a.message],stack:[a.stack],retJson:u.ERROR}):c="string"==typeof a?{ret:[a],retJson:u.ERROR}:void 0!==a?a:e.options.retJson,b.mtop.errorListener&&b.mtop.errorListener({api:e.params.api,data:e.params.data,v:e.params.v,retJson:c}),e.options.failureCallback?void e.options.failureCallback(c):q.reject(c)});return this.__processRequestType(),e.options.H5Request&&(e.constructor.__firstProcessor||(e.constructor.__firstProcessor=h),E=function(a){e.constructor.__firstProcessor.then(a)["catch"](a)}),("get"===this.params.type&&"json"===this.params.dataType||"post"===this.params.type)&&(c.pageDomain=c.pageDomain||g(a.location.hostname),c.mainDomain!==c.pageDomain&&(c.maxRetryTimes=4,c.CDR=!0)),this.__requestProcessor=h,h},b.mtop=function(a){return new p(a)},b.mtop.request=function(a,b,c){var d={H5Request:a.H5Request,WindVaneRequest:a.WindVaneRequest,LoginRequest:a.LoginRequest,AntiCreep:a.AntiCreep,AntiFlood:a.AntiFlood,successCallback:b,failureCallback:c||b};return new p(a).request(d)},b.mtop.H5Request=function(a,b,c){var d={H5Request:!0,successCallback:b,failureCallback:c||b};return new p(a).request(d)},b.mtop.middlewares=t,b.mtop.config=s,b.mtop.RESPONSE_TYPE=u,b.mtop.CLASS=p}(window,window.lib||(window.lib={})),function(a,b){function c(a){return a.preventDefault(),!1}function d(a){var b=new RegExp("(?:^|;\\s*)"+a+"\\=([^;]+)(?:;\\s*|$)").exec(document.cookie);return b?b[1]:void 0}function e(b,d){var e=this,f=a.dpr||1,g=document.createElement("div"),h=document.documentElement.getBoundingClientRect(),i=Math.max(h.width,window.innerWidth)/f,j=Math.max(h.height,window.innerHeight)/f;g.style.cssText=["-webkit-transform:scale("+f+") translateZ(0)","-ms-transform:scale("+f+") translateZ(0)","transform:scale("+f+") translateZ(0)","-webkit-transform-origin:0 0","-ms-transform-origin:0 0","transform-origin:0 0","width:"+i+"px","height:"+j+"px","z-index:999999","position:"+(i>800?"fixed":"absolute"),"left:0","top:0px","background:"+(i>800?"rgba(0,0,0,.5)":"#FFF"),"display:none"].join(";");var k=document.createElement("div");k.style.cssText=["width:100%","height:52px","background:#EEE","line-height:52px","text-align:left","box-sizing:border-box","padding-left:20px","position:absolute","left:0","top:0","font-size:16px","font-weight:bold","color:#333"].join(";"),k.innerText=b;var l=document.createElement("a");l.style.cssText=["display:block","position:absolute","right:0","top:0","height:52px","line-height:52px","padding:0 20px","color:#999"].join(";"),l.innerText="关闭";var m=document.createElement("iframe");m.style.cssText=["width:100%","height:100%","border:0","overflow:hidden"].join(";"),i>800&&(k.style.cssText=["width:370px","height:52px","background:#EEE","line-height:52px","text-align:left","box-sizing:border-box","padding-left:20px","position:absolute","left:"+(i/2-185)+"px","top:40px","font-size:16px","font-weight:bold","color:#333"].join(";"),m.style.cssText=["position:absolute","top:92px","left:"+(i/2-185)+"px","width:370px","height:480px","border:0","background:#FFF","overflow:hidden"].join(";")),k.appendChild(l),g.appendChild(k),g.appendChild(m),g.className="J_MIDDLEWARE_FRAME_WIDGET",document.body.appendChild(g),m.src=d,l.addEventListener("click",function(){e.hide();var a=document.createEvent("HTMLEvents");a.initEvent("close",!1,!1),g.dispatchEvent(a)},!1),this.addEventListener=function(){g.addEventListener.apply(g,arguments)},this.removeEventListener=function(){g.removeEventListener.apply(g,arguments)},this.show=function(){document.addEventListener("touchmove",c,!1),g.style.display="block",window.scrollTo(0,0)},this.hide=function(){document.removeEventListener("touchmove",c),window.scrollTo(0,-h.top),g.parentNode&&g.parentNode.removeChild(g)}}function f(a){var c=this,d=this.options,e=this.params;return a().then(function(){var a=d.retJson,f=a.ret,g=navigator.userAgent.toLowerCase(),h=g.indexOf("safari")>-1&&g.indexOf("chrome")<0&&g.indexOf("qqbrowser")<0;if(f instanceof Array&&(f=f.join(",")),(f.indexOf("SESSION_EXPIRED")>-1||f.indexOf("SID_INVALID")>-1||f.indexOf("AUTH_REJECT")>-1||f.indexOf("NEED_LOGIN")>-1)&&(a.retType=l.SESSION_EXPIRED,!d.WindVaneRequest&&(k.LoginRequest===!0||d.LoginRequest===!0||e.needLogin===!0))){if(!b.login)throw new Error("LOGIN_NOT_FOUND::缺少lib.login");if(d.safariGoLogin!==!0||!h||"taobao.com"===d.pageDomain)return b.login.goLoginAsync().then(function(a){return c.__sequence([c.__processToken,c.__processRequestUrl,c.__processUnitPrefix,c.middlewares,c.__processRequest])})["catch"](function(a){throw"CANCEL"===a?new Error("LOGIN_CANCEL::用户取消登录"):new Error("LOGIN_FAILURE::用户登录失败")});b.login.goLogin()}})}function g(a){var b=this.options;this.params;return b.H5Request!==!0||k.AntiFlood!==!0&&b.AntiFlood!==!0?void a():a().then(function(){var a=b.retJson,c=a.ret;c instanceof Array&&(c=c.join(",")),c.indexOf("FAIL_SYS_USER_VALIDATE")>-1&&a.data.url&&(b.AntiFloodReferer?location.href=a.data.url.replace(/(http_referer=).+/,"$1"+b.AntiFloodReferer):location.href=a.data.url)})}function h(b){var c=this,f=this.options,g=this.params;return f.AntiCreep!==!1&&(f.AntiCreep=!0),g.forceAntiCreep!==!0&&f.H5Request!==!0||k.AntiCreep!==!0&&f.AntiCreep!==!0?void b():b().then(function(){var b=f.retJson,h=b.ret;if(h instanceof Array&&(h=h.join(",")),(h.indexOf("RGV587_ERROR::SM")>-1||h.indexOf("ASSIST_FLAG")>-1)&&b.data.url){var j="_m_h5_smt",k=d(j),l=!1;if(f.saveAntiCreepToken===!0&&k){k=JSON.parse(k);for(var m in k)g[m]&&(l=!0)}if(f.saveAntiCreepToken===!0&&k&&!l){for(var m in k)g[m]=k[m];return c.__sequence([c.__processToken,c.__processRequestUrl,c.__processUnitPrefix,c.middlewares,c.__processRequest])}return new i(function(d,h){function i(){m.removeEventListener("close",i),a.removeEventListener("message",k),h("USER_INPUT_CANCEL::用户取消输入")}function k(b){var e;try{e=JSON.parse(b.data)||{}}catch(l){}if(e&&"child"===e.type){m.removeEventListener("close",i),a.removeEventListener("message",k),m.hide();var n;try{n=JSON.parse(decodeURIComponent(e.content)),"string"==typeof n&&(n=JSON.parse(n));for(var o in n)g[o]=n[o];f.saveAntiCreepToken===!0?(document.cookie=j+"="+JSON.stringify(n)+";",a.location.reload()):c.__sequence([c.__processToken,c.__processRequestUrl,c.__processUnitPrefix,c.middlewares,c.__processRequest]).then(d)}catch(l){h("USER_INPUT_FAILURE::用户输入失败")}}}var l=b.data.url,m=new e("",l);m.addEventListener("close",i,!1),a.addEventListener("message",k,!1),m.show()})}})}if(!b||!b.mtop||b.mtop.ERROR)throw new Error("Mtop 初始化失败!");var i=a.Promise,j=b.mtop.CLASS,k=b.mtop.config,l=b.mtop.RESPONSE_TYPE;b.mtop.middlewares.push(f),b.mtop.loginRequest=function(a,b,c){var d={LoginRequest:!0,H5Request:!0,successCallback:b,failureCallback:c||b};return new j(a).request(d)},b.mtop.antiFloodRequest=function(a,b,c){var d={AntiFlood:!0,successCallback:b,failureCallback:c||b};return new j(a).request(d)},b.mtop.middlewares.push(g),b.mtop.antiCreepRequest=function(a,b,c){var d={AntiCreep:!0,successCallback:b,failureCallback:c||b};return new j(a).request(d)},b.mtop.middlewares.push(h)}(window,window.lib||(window.lib={}));;module.exports = window.lib['mtop']; + +/***/ }), + +/***/ "./node_modules/_@alifd_field@1.3.5@@alifd/field/lib/index.js": +/*!********************************************************************!*\ + !*** ./node_modules/_@alifd_field@1.3.5@@alifd/field/lib/index.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +__webpack_require__(/*! ./node_modules/_@alifd_field@1.3.5@@alifd/field/lib/style.js */ "./node_modules/_@alifd_field@1.3.5@@alifd/field/lib/style.js"); +"use strict"; + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/regenerator/index.js")); + +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/asyncToGenerator.js")); + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/extends.js")); + +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/slicedToArray.js")); + +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/classCallCheck.js")); + +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/createClass.js")); + +var _validate2 = _interopRequireDefault(__webpack_require__(/*! @alifd/validate */ "./node_modules/_@alifd_validate@1.1.5@@alifd/validate/lib/index.js")); + +var _utils = __webpack_require__(/*! ./utils */ "./node_modules/_@alifd_field@1.3.5@@alifd/field/lib/utils.js"); + +var initMeta = { + state: '', + valueName: 'value', + trigger: 'onChange' +}; + +var Field = +/*#__PURE__*/ +function () { + (0, _createClass2.default)(Field, null, [{ + key: "create", + value: function create(com) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return new this(com, options); + } + }, { + key: "getUseField", + value: function getUseField(_ref) { + var _this = this; + + var useState = _ref.useState, + useMemo = _ref.useMemo; + return function () { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var _useState = useState(), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + setState = _useState2[1]; + + var field = useMemo(function () { + return _this.create({ + setState: setState + }, options); + }, [setState]); + return field; + }; + } + }]); + + function Field(com) { + var _this2 = this; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + (0, _classCallCheck2.default)(this, Field); + + if (!com) { + (0, _utils.warning)('`this` is missing in `Field`, you should use like `new Field(this)`'); + } + + this.com = com; + this.fieldsMeta = {}; + this.cachedBind = {}; + this.instance = {}; // holds constructor values. Used for setting field defaults on init if no other value or initValue is passed. + // Also used caching values when using `parseName: true` before a field is initialized + + this.values = (0, _extends2.default)({}, options.values); + this.processErrorMessage = options.processErrorMessage; + this.afterValidateRerender = options.afterValidateRerender; + this.options = (0, _extends2.default)({ + parseName: false, + forceUpdate: false, + scrollToFirstError: true, + first: false, + onChange: function onChange() {}, + autoUnmount: true, + autoValidate: true + }, options); + ['init', 'getValue', 'getValues', 'setValue', 'setValues', 'getError', 'getErrors', 'setError', 'setErrors', 'validateCallback', 'validatePromise', 'getState', 'reset', 'resetToDefault', 'remove', 'spliceArray', 'addArrayValue', 'deleteArrayValue'].forEach(function (m) { + _this2[m] = _this2[m].bind(_this2); + }); + } + + (0, _createClass2.default)(Field, [{ + key: "setOptions", + value: function setOptions(options) { + (0, _extends2.default)(this.options, options); + } + /** + * Controlled Component + * @param {String} name + * @param {Object} fieldOption + * @returns {Object} {value, onChange} + */ + + }, { + key: "init", + value: function init(name) { + var _this3 = this; + + var fieldOption = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var rprops = arguments.length > 2 ? arguments[2] : undefined; + var initValue = fieldOption.initValue, + _fieldOption$valueNam = fieldOption.valueName, + valueName = _fieldOption$valueNam === void 0 ? 'value' : _fieldOption$valueNam, + _fieldOption$trigger = fieldOption.trigger, + trigger = _fieldOption$trigger === void 0 ? 'onChange' : _fieldOption$trigger, + _fieldOption$rules = fieldOption.rules, + rules = _fieldOption$rules === void 0 ? [] : _fieldOption$rules, + _fieldOption$props = fieldOption.props, + props = _fieldOption$props === void 0 ? {} : _fieldOption$props, + _fieldOption$getValue = fieldOption.getValueFromEvent, + getValueFromEvent = _fieldOption$getValue === void 0 ? null : _fieldOption$getValue, + _fieldOption$autoVali = fieldOption.autoValidate, + autoValidate = _fieldOption$autoVali === void 0 ? true : _fieldOption$autoVali; + var parseName = this.options.parseName; + var originalProps = (0, _extends2.default)({}, props, rprops); + var defaultValueName = "default".concat(valueName[0].toUpperCase()).concat(valueName.slice(1)); + var defaultValue; + + if (typeof initValue !== 'undefined') { + defaultValue = initValue; + } else if (typeof originalProps[defaultValueName] !== 'undefined') { + // here use typeof, in case of defaultValue={0} + defaultValue = originalProps[defaultValueName]; + } // get field from this.fieldsMeta or new one + + + var field = this._getInitMeta(name); + + (0, _extends2.default)(field, { + valueName: valueName, + initValue: defaultValue, + disabled: 'disabled' in originalProps ? originalProps.disabled : false, + getValueFromEvent: getValueFromEvent, + rules: Array.isArray(rules) ? rules : [rules], + ref: originalProps.ref + }); // Controlled Component, should always equal props.value + + if (valueName in originalProps) { + field.value = originalProps[valueName]; // When rerendering set the values from props.value + + if (parseName) { + this.values = (0, _utils.setIn)(this.values, name, field.value); + } else { + this.values[name] = field.value; + } + } + /** + * first init field (value not in field) + * should get field.value from this.values or defaultValue + */ + + + if (!('value' in field)) { + if (parseName) { + var cachedValue = (0, _utils.getIn)(this.values, name); + + if (typeof cachedValue !== 'undefined') { + field.value = cachedValue; + } else { + // save struct to this.values even defaultValue is undefiend + field.value = defaultValue; + this.values = (0, _utils.setIn)(this.values, name, field.value); + } + } else { + var _cachedValue = this.values[name]; + + if (typeof _cachedValue !== 'undefined') { + field.value = _cachedValue; + } else if (typeof defaultValue !== 'undefined') { + // should be same with parseName, but compatible with old versions + field.value = defaultValue; + this.values[name] = field.value; + } + } + } // Component props + + + var inputProps = (0, _defineProperty2.default)({ + 'data-meta': 'Field', + id: name, + ref: this._getCacheBind(name, "".concat(name, "__ref"), this._saveRef) + }, valueName, field.value); + var rulesMap = {}; + + if (this.options.autoValidate && autoValidate !== false) { + // trigger map + rulesMap = (0, _utils.mapValidateRules)(field.rules, trigger); // validate hook + + var _loop = function _loop(action) { + if (action === trigger) { + return "continue"; + } + + var actionRule = rulesMap[action]; + + inputProps[action] = function () { + _this3._validate(name, actionRule, action); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this3._callPropsEvent.apply(_this3, [action, originalProps].concat(args)); + + _this3._reRender(); + }; + }; + + for (var action in rulesMap) { + var _ret = _loop(action); + + if (_ret === "continue") continue; + } + } // onChange hack + + + inputProps[trigger] = function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + _this3._callOnChange.apply(_this3, [name, rulesMap[trigger], trigger].concat(args)); + + _this3._callPropsEvent.apply(_this3, [trigger, originalProps].concat(args)); + + _this3.options.onChange(name, field.value); + + _this3._reRender(); + }; + + delete originalProps[defaultValueName]; + return (0, _extends2.default)({}, originalProps, inputProps); + } + /** + * event on props + * props.onChange props.onBlur + */ + + }, { + key: "_callPropsEvent", + value: function _callPropsEvent(action, props) { + for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) { + args[_key3 - 2] = arguments[_key3]; + } + + action in props && typeof props[action] === 'function' && props[action].apply(props, args); + } + }, { + key: "_getInitMeta", + value: function _getInitMeta(name) { + if (!(name in this.fieldsMeta)) { + this.fieldsMeta[name] = (0, _extends2.default)({}, initMeta); + } + + return this.fieldsMeta[name]; + } + /** + * update field.value and validate + */ + + }, { + key: "_callOnChange", + value: function _callOnChange(name, rule, trigger) { + for (var _len4 = arguments.length, others = new Array(_len4 > 3 ? _len4 - 3 : 0), _key4 = 3; _key4 < _len4; _key4++) { + others[_key4 - 3] = arguments[_key4]; + } + + var e = others[0]; + + var field = this._get(name); + + if (!field) { + return; + } + + field.value = field.getValueFromEvent ? field.getValueFromEvent.apply(this, others) : (0, _utils.getValueFromEvent)(e); + + if (this.options.parseName) { + this.values = (0, _utils.setIn)(this.values, name, field.value); + } else { + this.values[name] = field.value; + } + + this._resetError(name); // validate while onChange + + + rule && this._validate(name, rule, trigger); + } + /** + * ref must always be the same function, or if not it will be triggerd every time. + * @param {String} name name of component + * @param {String} action key to find ref + * @param {Function} fn saveRef + */ + + }, { + key: "_getCacheBind", + value: function _getCacheBind(name, action, fn) { + var cache = this.cachedBind[name] = this.cachedBind[name] || {}; + + if (!cache[action]) { + cache[action] = fn.bind(this, name); + } + + return cache[action]; + } + }, { + key: "_setCache", + value: function _setCache(name, action, hander) { + var cache = this.cachedBind[name] = this.cachedBind[name] || {}; + cache[action] = hander; + } + }, { + key: "_getCache", + value: function _getCache(name, action) { + var cache = this.cachedBind[name] || {}; + return cache[action]; + } + /** + * NOTE: saveRef is async function. it will be called after render + * @param {String} name name of component + * @param {Function} component ref + */ + + }, { + key: "_saveRef", + value: function _saveRef(name, component) { + var key = "".concat(name, "_field"); + var autoUnmount = this.options.autoUnmount; + + if (!component && autoUnmount) { + // component with same name (eg: type ? :) + // while type changed, B will render before A unmount. so we should cached value for B + // step: render -> B mount -> 1. _saveRef(A, null) -> 2. _saveRef(B, ref) -> render + // 1. _saveRef(A, null) + var cache = this.fieldsMeta[name]; + cache && this._setCache(name, key, cache); // after destroy, delete data + + delete this.instance[name]; + this.remove(name); + return; + } // 2. _saveRef(B, ref) (eg: same name but different compoent may be here) + + + if (autoUnmount && !this.fieldsMeta[name] && this._getCache(name, key)) { + this.fieldsMeta[name] = this._getCache(name, key); + this.setValue(name, this.fieldsMeta[name] && this.fieldsMeta[name].value, false); + } // only one time here + + + var field = this._get(name); + + if (field) { + var ref = field.ref; + + if (ref) { + if (typeof ref === 'string') { + throw new Error("can not set string ref for ".concat(name)); + } + + ref(component); + } + + this.instance[name] = component; + } + } + /** + * validate one Component + * @param {String} name name of Component + * @param {Array} rule + * @param {String} trigger onChange/onBlur/onItemClick/... + */ + + }, { + key: "_validate", + value: function _validate(name, rule, trigger) { + var _this4 = this; + + var field = this._get(name); + + var value = field.value; + field.state = 'loading'; + + var validate = this._getCache(name, trigger); + + if (validate && typeof validate.abort === 'function') { + validate.abort(); + } + + validate = new _validate2.default((0, _defineProperty2.default)({}, name, rule)); + + this._setCache(name, trigger, validate); + + validate.validate((0, _defineProperty2.default)({}, name, value), function (errors) { + if (errors && errors.length) { + field.errors = (0, _utils.getErrorStrs)(errors, _this4.processErrorMessage); + field.state = 'error'; + } else { + field.errors = []; + field.state = 'success'; + } + + _this4._reRender(); + }); + } + }, { + key: "getValue", + value: function getValue(name) { + if (this.options.parseName) { + return (0, _utils.getIn)(this.values, name); + } + + return this.values[name]; + } + /** + * 1. get values by names. + * 2. If no names passed, return shallow copy of `field.values` + * @param {Array} names + */ + + }, { + key: "getValues", + value: function getValues(names) { + var _this5 = this; + + var allValues = {}; + + if (names && names.length) { + names.forEach(function (name) { + allValues[name] = _this5.getValue(name); + }); + } else { + (0, _extends2.default)(allValues, this.values); + } + + return allValues; + } + }, { + key: "setValue", + value: function setValue(name, value) { + var reRender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + + if (name in this.fieldsMeta) { + this.fieldsMeta[name].value = value; + } + + if (this.options.parseName) { + this.values = (0, _utils.setIn)(this.values, name, value); + } else { + this.values[name] = value; + } + + reRender && this._reRender(); + } + }, { + key: "setValues", + value: function setValues() { + var _this6 = this; + + var fieldsValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var reRender = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + if (!this.options.parseName) { + Object.keys(fieldsValue).forEach(function (name) { + _this6.setValue(name, fieldsValue[name], false); + }); + } else { + // NOTE: this is a shallow merge + // Ex. we have two values a.b.c=1 ; a.b.d=2, and use setValues({a:{b:{c:3}}}) , then because of shallow merge a.b.d will be lost, we will get only {a:{b:{c:3}}} + this.values = (0, _extends2.default)({}, this.values, fieldsValue); + var fields = this.getNames(); + fields.forEach(function (name) { + var value = (0, _utils.getIn)(_this6.values, name); + + if (value !== undefined) { + // copy over values that are in this.values + _this6.fieldsMeta[name].value = value; + } else { + // because of shallow merge + // if no value then copy values from fieldsMeta to keep initialized component data + _this6.values = (0, _utils.setIn)(_this6.values, name, _this6.fieldsMeta[name].value); + } + }); + } + + reRender && this._reRender(); + } + }, { + key: "setError", + value: function setError(name, errors) { + var err = Array.isArray(errors) ? errors : errors ? [errors] : []; + + if (name in this.fieldsMeta) { + this.fieldsMeta[name].errors = err; + } else { + this.fieldsMeta[name] = { + errors: err + }; + } + + if (this.fieldsMeta[name].errors && this.fieldsMeta[name].errors.length > 0) { + this.fieldsMeta[name].state = 'error'; + } else { + this.fieldsMeta[name].state = ''; + } + + this._reRender(); + } + }, { + key: "setErrors", + value: function setErrors() { + var _this7 = this; + + var fieldsErrors = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + Object.keys(fieldsErrors).forEach(function (name) { + _this7.setError(name, fieldsErrors[name]); + }); + } + }, { + key: "getError", + value: function getError(name) { + var field = this._get(name); + + if (field && field.errors && field.errors.length) { + return field.errors; + } + + return null; + } + }, { + key: "getErrors", + value: function getErrors(names) { + var _this8 = this; + + var fields = names || this.getNames(); + var allErrors = {}; + fields.forEach(function (f) { + allErrors[f] = _this8.getError(f); + }); + return allErrors; + } + }, { + key: "getState", + value: function getState(name) { + var field = this._get(name); + + if (field && field.state) { + return field.state; + } + + return ''; + } + /** + * Get errors using `getErrors` and format to match the structure of errors returned in field.validate + * @param {Array} fieldNames + * @return {Object || null} map of inputs and their errors + */ + + }, { + key: "formatGetErrors", + value: function formatGetErrors(fieldNames) { + var errors = this.getErrors(fieldNames); + var formattedErrors = null; + + for (var field in errors) { + if (errors.hasOwnProperty(field) && errors[field]) { + var errorsObj = errors[field]; + + if (!formattedErrors) { + formattedErrors = {}; + } + + formattedErrors[field] = { + errors: errorsObj + }; + } + } + + return formattedErrors; + } + /** + * validate by trigger + * @param {Array} ns names + * @param {Function} cb callback after validate + */ + + }, { + key: "validateCallback", + value: function validateCallback(ns, cb) { + var _this9 = this; + + var _getParams = (0, _utils.getParams)(ns, cb), + names = _getParams.names, + callback = _getParams.callback; + + var fieldNames = names || this.getNames(); + var descriptor = {}; + var values = {}; + var hasRule = false; + + for (var i = 0; i < fieldNames.length; i++) { + var name = fieldNames[i]; + + var field = this._get(name); + + if (!field) { + continue; + } + + if (field.rules && field.rules.length) { + descriptor[name] = field.rules; + values[name] = this.getValue(name); + hasRule = true; // clear error + + field.errors = []; + field.state = ''; + } + } + + if (!hasRule) { + var errors = this.formatGetErrors(fieldNames); + callback && callback(errors, this.getValues(names ? fieldNames : [])); + return; + } + + var validate = new _validate2.default(descriptor, { + first: this.options.first + }); + validate.validate(values, function (errors) { + var errorsGroup = null; + + if (errors && errors.length) { + errorsGroup = {}; + errors.forEach(function (e) { + var fieldName = e.field; + + if (!errorsGroup[fieldName]) { + errorsGroup[fieldName] = { + errors: [] + }; + } + + var fieldErrors = errorsGroup[fieldName].errors; + fieldErrors.push(e.message); + }); + } + + if (errorsGroup) { + // update error in every Field + Object.keys(errorsGroup).forEach(function (i) { + var field = _this9._get(i); + + field.errors = (0, _utils.getErrorStrs)(errorsGroup[i].errors, _this9.processErrorMessage); + field.state = 'error'; + }); + } + + var formattedGetErrors = _this9.formatGetErrors(fieldNames); + + if (formattedGetErrors) { + errorsGroup = (0, _extends2.default)({}, formattedGetErrors, errorsGroup); + } // update to success which has no error + + + for (var _i = 0; _i < fieldNames.length; _i++) { + var _name = fieldNames[_i]; + + var _field = _this9._get(_name); + + if (_field && _field.rules && !(errorsGroup && _name in errorsGroup)) { + _field.state = 'success'; + } + } // eslint-disable-next-line callback-return + + + callback && callback(errorsGroup, _this9.getValues(names ? fieldNames : [])); + + _this9._reRender(); + + if (typeof _this9.afterValidateRerender === 'function') { + _this9.afterValidateRerender({ + errorsGroup: errorsGroup, + options: _this9.options, + instance: _this9.instance + }); + } + }); + } + /** + * validate by trigger - Promise version + * NOTES: + * - `afterValidateRerender` is not called in `validatePromise`. The rerender is called just before this function + * returns a promise, so use the returned promise to call any after rerender logic. + * + * @param {Array} ns names + * @param {Function} cb (Optional) callback after validate, must return a promise or a value + * - ({errors, values}) => Promise({errors, values}) | {errors, values} + * @returns {Promise} - resolves with {errors, values} + */ + + }, { + key: "validatePromise", + value: function () { + var _validatePromise = (0, _asyncToGenerator2.default)( + /*#__PURE__*/ + _regenerator.default.mark(function _callee(ns, cb) { + var _getParams2, names, callback, fieldNames, descriptor, values, hasRule, i, name, field, _errors, validate, results, errors, errorsGroup, callbackResults; + + return _regenerator.default.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _getParams2 = (0, _utils.getParams)(ns, cb), names = _getParams2.names, callback = _getParams2.callback; + fieldNames = names || this.getNames(); + descriptor = {}; + values = {}; + hasRule = false; + i = 0; + + case 6: + if (!(i < fieldNames.length)) { + _context.next = 15; + break; + } + + name = fieldNames[i]; + field = this._get(name); + + if (field) { + _context.next = 11; + break; + } + + return _context.abrupt("continue", 12); + + case 11: + if (field.rules && field.rules.length) { + descriptor[name] = field.rules; + values[name] = this.getValue(name); + hasRule = true; // clear error + + field.errors = []; + field.state = ''; + } + + case 12: + i++; + _context.next = 6; + break; + + case 15: + if (hasRule) { + _context.next = 22; + break; + } + + _errors = this.formatGetErrors(fieldNames); + + if (!callback) { + _context.next = 21; + break; + } + + return _context.abrupt("return", callback({ + errors: _errors, + values: this.getValues(names ? fieldNames : []) + })); + + case 21: + return _context.abrupt("return", { + errors: _errors, + values: this.getValues(names ? fieldNames : []) + }); + + case 22: + validate = new _validate2.default(descriptor, { + first: this.options.first + }); + _context.next = 25; + return validate.validatePromise(values); + + case 25: + results = _context.sent; + errors = results && results.errors || []; + errorsGroup = this._getErrorsGroup({ + errors: errors, + fieldNames: fieldNames + }); + callbackResults = { + errors: errorsGroup, + values: this.getValues(names ? fieldNames : []) + }; + _context.prev = 29; + + if (!callback) { + _context.next = 34; + break; + } + + _context.next = 33; + return callback(callbackResults); + + case 33: + callbackResults = _context.sent; + + case 34: + _context.next = 39; + break; + + case 36: + _context.prev = 36; + _context.t0 = _context["catch"](29); + return _context.abrupt("return", _context.t0); + + case 39: + this._reRender(); + + return _context.abrupt("return", callbackResults); + + case 41: + case "end": + return _context.stop(); + } + } + }, _callee, this, [[29, 36]]); + })); + + function validatePromise(_x, _x2) { + return _validatePromise.apply(this, arguments); + } + + return validatePromise; + }() + }, { + key: "_getErrorsGroup", + value: function _getErrorsGroup(_ref3) { + var _this10 = this; + + var errors = _ref3.errors, + fieldNames = _ref3.fieldNames; + var errorsGroup = null; + + if (errors && errors.length) { + errorsGroup = {}; + errors.forEach(function (e) { + var fieldName = e.field; + + if (!errorsGroup[fieldName]) { + errorsGroup[fieldName] = { + errors: [] + }; + } + + var fieldErrors = errorsGroup[fieldName].errors; + fieldErrors.push(e.message); + }); + } + + if (errorsGroup) { + // update error in every Field + Object.keys(errorsGroup).forEach(function (i) { + var field = _this10._get(i); + + if (field) { + field.errors = (0, _utils.getErrorStrs)(errorsGroup[i].errors, _this10.processErrorMessage); + field.state = 'error'; + } + }); + } + + var formattedGetErrors = this.formatGetErrors(fieldNames); + + if (formattedGetErrors) { + errorsGroup = (0, _extends2.default)({}, formattedGetErrors, errorsGroup); + } // update to success which has no error + + + for (var i = 0; i < fieldNames.length; i++) { + var name = fieldNames[i]; + + var field = this._get(name); + + if (field && field.rules && !(errorsGroup && name in errorsGroup)) { + field.state = 'success'; + } + } + + return errorsGroup; + } + }, { + key: "_reset", + value: function _reset(ns, backToDefault) { + var _this11 = this; + + if (typeof ns === 'string') { + ns = [ns]; + } + + var changed = false; + var names = ns || Object.keys(this.fieldsMeta); + + if (!ns) { + this.values = {}; + } + + names.forEach(function (name) { + var field = _this11._get(name); + + if (field) { + changed = true; + field.value = backToDefault ? field.initValue : undefined; + field.state = ''; + delete field.errors; + delete field.rules; + delete field.rulesMap; + + if (_this11.options.parseName) { + _this11.values = (0, _utils.setIn)(_this11.values, name, field.value); + } else { + _this11.values[name] = field.value; + } + } + }); + + if (changed) { + this._reRender(); + } + } + }, { + key: "reset", + value: function reset(ns) { + this._reset(ns, false); + } + }, { + key: "resetToDefault", + value: function resetToDefault(ns) { + this._reset(ns, true); + } + }, { + key: "getNames", + value: function getNames() { + var fieldsMeta = this.fieldsMeta; + return Object.keys(fieldsMeta).filter(function () { + return true; + }); + } + }, { + key: "remove", + value: function remove(ns) { + var _this12 = this; + + if (typeof ns === 'string') { + ns = [ns]; + } + + if (!ns) { + this.values = {}; + } + + var names = ns || Object.keys(this.fieldsMeta); + names.forEach(function (name) { + if (name in _this12.fieldsMeta) { + delete _this12.fieldsMeta[name]; + } + + if (_this12.options.parseName) { + _this12.values = (0, _utils.deleteIn)(_this12.values, name); + } else { + delete _this12.values[name]; + } + }); + } + }, { + key: "addArrayValue", + value: function addArrayValue(key, index) { + for (var _len5 = arguments.length, argv = new Array(_len5 > 2 ? _len5 - 2 : 0), _key5 = 2; _key5 < _len5; _key5++) { + argv[_key5 - 2] = arguments[_key5]; + } + + return this._spliceArrayValue.apply(this, [key, index, 0].concat(argv)); + } + }, { + key: "deleteArrayValue", + value: function deleteArrayValue(key, index) { + var howmany = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; + return this._spliceArrayValue(key, index, howmany); + } + /** + * splice array + * @param {String} key + * @param {Number} startIndex + * @param {Number} howmany + * @param {*} value + */ + + }, { + key: "_spliceArrayValue", + value: function _spliceArrayValue(key, index, howmany) { + var _this13 = this; + + for (var _len6 = arguments.length, argv = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) { + argv[_key6 - 3] = arguments[_key6]; + } + + var argc = argv.length; + var offset = howmany - argc; + var startIndex = index + howmany; + /** + * case 1: names=['key.0', 'key.1'], should delete 'key.1' + * case 2: names=['key.0.name', 'key.0.email', 'key.1.name', 'key.1.email'], should delete 'key.1.name', 'key.1.email' + */ + + var listMap = {}; + var keyReg = new RegExp("^(".concat(key, ".)(\\d+)")); + var replaceArgv = []; + var names = this.getNames(); + names.forEach(function (n) { + var ret = keyReg.exec(n); + + if (ret) { + var idx = parseInt(ret[2]); + + if (idx >= startIndex) { + var l = listMap[idx]; + var item = { + from: n, + to: n.replace(keyReg, function (match, p1) { + return "".concat(p1).concat(idx - offset); + }) + }; + + if (!l) { + listMap[idx] = [item]; + } else { + l.push(item); + } + } + + if (offset <= 0 && idx >= index && idx < index + argc) { + replaceArgv.push(n); + } + } + }); + var idxList = Object.keys(listMap).map(function (i) { + return { + index: Number(i), + list: listMap[i] + }; + }).sort(function (a, b) { + return offset > 0 ? a.index - b.index : b.index - a.index; + }); // should be continuous array + + if (idxList.length > 0) { + idxList.forEach(function (l) { + var list = l.list; + list.forEach(function (i) { + _this13.fieldsMeta[i.to] = _this13.fieldsMeta[i.from]; + }); + }); + + if (offset > 0) { + var removeList = idxList.slice(idxList.length - offset, idxList.length); + removeList.forEach(function (item) { + item.list.forEach(function (i) { + delete _this13.fieldsMeta[i.from]; + }); + }); + } else { + // will get from this.values while rerender + replaceArgv.forEach(function (i) { + delete _this13.fieldsMeta[i]; + }); + } + } + + var p = this.getValue(key); + + if (p) { + p.splice.apply(p, [index, howmany].concat(argv)); + } + + this._reRender(); + } + /** + * splice in a Array [deprecated] + * @param {String} keyMatch like name.{index} + * @param {Number} startIndex index + */ + + }, { + key: "spliceArray", + value: function spliceArray(keyMatch, startIndex, howmany) { + var _this14 = this; + + if (keyMatch.match(/{index}$/) === -1) { + (0, _utils.warning)('key should match /{index}$/'); + return; + } // regex to match field names in the same target array + + + var reg = keyMatch.replace('{index}', '(\\d+)'); + var keyReg = new RegExp("^".concat(reg)); + var listMap = {}; + /** + * keyMatch='key.{index}' + * case 1: names=['key.0', 'key.1'], should delete 'key.1' + * case 2: names=['key.0.name', 'key.0.email', 'key.1.name', 'key.1.email'], should delete 'key.1.name', 'key.1.email' + */ + + var names = this.getNames(); + names.forEach(function (n) { + // is name in the target array? + var ret = keyReg.exec(n); + + if (ret) { + var index = parseInt(ret[1]); + + if (index > startIndex) { + var l = listMap[index]; + var item = { + from: n, + to: "".concat(keyMatch.replace('{index}', index - 1)).concat(n.replace(ret[0], '')) + }; + + if (!l) { + listMap[index] = [item]; + } else { + l.push(item); + } + } + } + }); + var idxList = Object.keys(listMap).map(function (i) { + return { + index: Number(i), + list: listMap[i] + }; + }).sort(function (a, b) { + return a.index < b.index; + }); // should be continuous array + + if (idxList.length > 0 && idxList[0].index === startIndex + 1) { + idxList.forEach(function (l) { + var list = l.list; + list.forEach(function (i) { + var v = _this14.getValue(i.from); // get index value + + + _this14.setValue(i.to, v, false); // set value to index - 1 + + }); + }); + var lastIdxList = idxList[idxList.length - 1]; + lastIdxList.list.forEach(function (i) { + _this14.remove(i.from); + }); + var parentName = keyMatch.replace('.{index}', ''); + parentName = parentName.replace('[{index}]', ''); + var parent = this.getValue(parentName); + + if (parent) { + // if parseName=true then parent is an Array object but does not know an element was removed + // this manually decrements the array length + parent.length--; + } + } + } + }, { + key: "_resetError", + value: function _resetError(name) { + var field = this._get(name); + + delete field.errors; //清空错误 + + field.state = ''; + } //trigger rerender + + }, { + key: "_reRender", + value: function _reRender() { + if (this.com) { + if (!this.options.forceUpdate && this.com.setState) { + this.com.setState({}); + } else if (this.com.forceUpdate) { + this.com.forceUpdate(); //forceUpdate 对性能有较大的影响,成指数上升 + } + } + } + }, { + key: "_get", + value: function _get(name) { + return name in this.fieldsMeta ? this.fieldsMeta[name] : null; + } + }]); + return Field; +}(); + +var _default = Field; +exports.default = _default; + +/***/ }), + +/***/ "./node_modules/_@alifd_field@1.3.5@@alifd/field/lib/main.scss": +/*!*********************************************************************!*\ + !*** ./node_modules/_@alifd_field@1.3.5@@alifd/field/lib/main.scss ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694894693 + var cssReload = __webpack_require__(/*! ../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_field@1.3.5@@alifd/field/lib/style.js": +/*!********************************************************************!*\ + !*** ./node_modules/_@alifd_field@1.3.5@@alifd/field/lib/style.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 组件依赖样式 +__webpack_require__(/*! @alifd/validate/lib/style.js */ "./node_modules/_@alifd_validate@1.1.5@@alifd/validate/lib/style.js"); + +// 组件自身样式 +__webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_field@1.3.5@@alifd/field/lib/main.scss"); + + +/***/ }), + +/***/ "./node_modules/_@alifd_field@1.3.5@@alifd/field/lib/utils.js": +/*!********************************************************************!*\ + !*** ./node_modules/_@alifd_field@1.3.5@@alifd/field/lib/utils.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getIn = getIn; +exports.setIn = setIn; +exports.deleteIn = deleteIn; +exports.getErrorStrs = getErrorStrs; +exports.getParams = getParams; +exports.getValueFromEvent = getValueFromEvent; +exports.mapValidateRules = mapValidateRules; +exports.warning = void 0; + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/defineProperty.js")); + +var _extends3 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/_@babel_runtime@7.8.4@@babel/runtime/helpers/extends.js")); + +function getIn(state, name) { + if (!state) { + return state; + } + + var path = typeof name === 'string' ? name.replace(/\[/, '.').replace(/\]/, '').split('.') : ''; + var length = path.length; + + if (!length) { + return undefined; + } + + var result = state; + + for (var i = 0; i < length && !!result; ++i) { + result = result[path[i]]; + } + + return result; +} + +var setInWithPath = function setInWithPath(state, value, path, pathIndex) { + if (pathIndex >= path.length) { + return value; + } + + var first = path[pathIndex]; + var next = setInWithPath(state && state[first], value, path, pathIndex + 1); + + if (!state) { + var initialized = isNaN(first) ? {} : []; + initialized[first] = next; + return initialized; + } + + if (Array.isArray(state)) { + var copy = [].concat(state); + copy[first] = next; + return copy; + } + + return (0, _extends3.default)({}, state, (0, _defineProperty2.default)({}, first, next)); +}; + +function setIn(state, name, value) { + return setInWithPath(state, value, typeof name === 'string' ? name.replace(/\[/, '.').replace(/\]/, '').split('.') : '', 0); +} + +function deleteIn(state, name) { + if (!state) { + return; + } + + var path = typeof name === 'string' ? name.replace(/\[/, '.').replace(/\]/, '').split('.') : ''; + var length = path.length; + + if (!length) { + return state; + } + + var result = state; + + for (var i = 0; i < length && !!result; ++i) { + if (i === length - 1) { + delete result[path[i]]; + } else { + result = result[path[i]]; + } + } + + return state; +} + +function getErrorStrs(errors, processErrorMessage) { + if (errors) { + return errors.map(function (e) { + var message = e.message || e; + + if (typeof processErrorMessage === 'function') { + return processErrorMessage(message); + } + + return message; + }); + } + + return errors; +} + +function getParams(ns, cb) { + var names = typeof ns === 'string' ? [ns] : ns; + var callback = cb; + + if (cb === undefined && typeof names === 'function') { + callback = names; + names = undefined; + } + + return { + names: names, + callback: callback + }; +} +/** + * 从组件事件中获取数据 + * @param e Event或者value + * @returns value + */ + + +function getValueFromEvent(e) { + // support custom element + if (!e || !e.target) { + return e; + } + + var target = e.target; + + if (target.type === 'checkbox') { + return target.checked; + } else if (target.type === 'radio') { + //兼容原生radioGroup + if (target.value) { + return target.value; + } else { + return target.checked; + } + } + + return target.value; +} + +function validateMap(rulesMap, rule, defaultTrigger) { + var nrule = (0, _extends3.default)({}, rule); + + if (!nrule.trigger) { + nrule.trigger = [defaultTrigger]; + } + + if (typeof nrule.trigger === 'string') { + nrule.trigger = [nrule.trigger]; + } + + for (var i = 0; i < nrule.trigger.length; i++) { + var trigger = nrule.trigger[i]; + + if (trigger in rulesMap) { + rulesMap[trigger].push(nrule); + } else { + rulesMap[trigger] = [nrule]; + } + } + + delete nrule.trigger; +} +/** + * 提取rule里面的trigger并且做映射 + * @param {Array} rules 规则 + * @param {String} defaultTrigger 默认触发 + * @return {Object} {onChange:rule1, onBlur: rule2} + */ + + +function mapValidateRules(rules, defaultTrigger) { + var rulesMap = {}; + rules.forEach(function (rule) { + validateMap(rulesMap, rule, defaultTrigger); + }); + return rulesMap; +} + +var warn = function warn() {}; + +if (typeof process !== 'undefined' && process.env && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') { + warn = function warn() { + /* eslint-disable no-console */ + if (typeof console !== 'undefined' && console.error) { + var _console; + + (_console = console).error.apply(_console, arguments); + } + }; +} + +var warning = warn; +exports.warning = warning; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../_process@0.11.10@process/browser.js */ "./node_modules/_process@0.11.10@process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/affix/index.js": +/*!*************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/affix/index.js ***! + \*************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-dom */ "./node_modules/_react-dom@16.12.0@react-dom/index.js"); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-lifecycles-compat */ "./node_modules/_react-lifecycles-compat@3.0.4@react-lifecycles-compat/react-lifecycles-compat.es.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/affix/util.js"); + + + + + +var _class, _temp; + + + + + + + + + + + +/** Affix */ +var Affix = (_temp = _class = function (_React$Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(Affix, _React$Component); + + Affix._getAffixMode = function _getAffixMode(nextProps) { + var affixMode = { + top: false, + bottom: false, + offset: 0 + }; + if (!nextProps) { + return affixMode; + } + var offsetTop = nextProps.offsetTop, + offsetBottom = nextProps.offsetBottom; + + + if (typeof offsetTop !== 'number' && typeof offsetBottom !== 'number') { + // set default + affixMode.top = true; + } else if (typeof offsetTop === 'number') { + affixMode.top = true; + affixMode.bottom = false; + affixMode.offset = offsetTop; + } else if (typeof offsetBottom === 'number') { + affixMode.bottom = true; + affixMode.top = false; + affixMode.offset = offsetBottom; + } + + return affixMode; + }; + + function Affix(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Affix); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _React$Component.call(this, props, context)); + + _this.updatePosition = function () { + _this._updateNodePosition(); + }; + + _this._updateNodePosition = function () { + var affixMode = _this.state.affixMode; + var _this$props = _this.props, + container = _this$props.container, + useAbsolute = _this$props.useAbsolute; + + var affixContainer = container(); + + if (!affixContainer) { + return false; + } + var containerScrollTop = Object(_util__WEBPACK_IMPORTED_MODULE_11__["getScroll"])(affixContainer, true); // 容器在垂直位置上的滚动 offset + var affixOffset = _this._getOffset(_this.affixNode, affixContainer); // 目标节点当前相对于容器的 offset + var containerHeight = Object(_util__WEBPACK_IMPORTED_MODULE_11__["getNodeHeight"])(affixContainer); // 容器的高度 + var affixHeight = _this.affixNode.offsetHeight; + var containerRect = Object(_util__WEBPACK_IMPORTED_MODULE_11__["getRect"])(affixContainer); + + var affixChildHeight = _this.affixChildNode.offsetHeight; + + var affixStyle = { + width: affixOffset.width + }; + var containerStyle = { + width: affixOffset.width, + height: affixChildHeight + }; + if (affixMode.top && containerScrollTop > affixOffset.top - affixMode.offset) { + // affix top + if (useAbsolute) { + affixStyle.position = 'absolute'; + affixStyle.top = containerScrollTop - (affixOffset.top - affixMode.offset); + containerStyle.position = 'relative'; + } else { + affixStyle.position = 'fixed'; + affixStyle.top = affixMode.offset + containerRect.top; + } + _this._setAffixStyle(affixStyle, true); + _this._setContainerStyle(containerStyle); + } else if (affixMode.bottom && containerScrollTop < affixOffset.top + affixHeight + affixMode.offset - containerHeight) { + // affix bottom + affixStyle.height = affixHeight; + if (useAbsolute) { + affixStyle.position = 'absolute'; + affixStyle.top = containerScrollTop - (affixOffset.top + affixHeight + affixMode.offset - containerHeight); + containerStyle.position = 'relative'; + } else { + affixStyle.position = 'fixed'; + affixStyle.bottom = affixMode.offset; + } + _this._setAffixStyle(affixStyle, true); + _this._setContainerStyle(containerStyle); + } else { + _this._setAffixStyle(null); + _this._setContainerStyle(null); + } + }; + + _this._affixNodeRefHandler = function (ref) { + _this.affixNode = Object(react_dom__WEBPACK_IMPORTED_MODULE_7__["findDOMNode"])(ref); + }; + + _this._affixChildNodeRefHandler = function (ref) { + _this.affixChildNode = Object(react_dom__WEBPACK_IMPORTED_MODULE_7__["findDOMNode"])(ref); + }; + + _this.state = { + style: null, + containerStyle: null, + affixMode: Affix._getAffixMode(props) + }; + return _this; + } + + Affix.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) { + if ('offsetTop' in nextProps || 'offsetBottom' in nextProps) { + return { + affixMode: Affix._getAffixMode(nextProps) + }; + } + return null; + }; + + Affix.prototype.componentDidMount = function componentDidMount() { + var _this2 = this; + + var container = this.props.container; + + this._updateNodePosition(); + // wait for parent rendered + this.timeout = setTimeout(function () { + _this2._setEventHandlerForContainer(container); + }); + }; + + Affix.prototype.componentDidUpdate = function componentDidUpdate(prevProps, prevState, snapshot) { + setTimeout(this._updateNodePosition); + }; + + Affix.prototype.componentWillUnmount = function componentWillUnmount() { + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + var container = this.props.container; + + this._removeEventHandlerForContainer(container); + }; + + Affix.prototype._setEventHandlerForContainer = function _setEventHandlerForContainer(getContainer) { + var container = getContainer(); + if (!container) { + return; + } + _util__WEBPACK_IMPORTED_MODULE_9__["events"].on(container, 'scroll', this._updateNodePosition, false); + _util__WEBPACK_IMPORTED_MODULE_9__["events"].on(container, 'resize', this._updateNodePosition, false); + }; + + Affix.prototype._removeEventHandlerForContainer = function _removeEventHandlerForContainer(getContainer) { + var container = getContainer(); + if (container) { + _util__WEBPACK_IMPORTED_MODULE_9__["events"].off(container, 'scroll', this._updateNodePosition); + _util__WEBPACK_IMPORTED_MODULE_9__["events"].off(container, 'resize', this._updateNodePosition); + } + }; + + Affix.prototype._setAffixStyle = function _setAffixStyle(affixStyle) { + var affixed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (_util__WEBPACK_IMPORTED_MODULE_9__["obj"].shallowEqual(affixStyle, this.state.style)) { + return; + } + + this.setState({ + style: affixStyle + }); + + var onAffix = this.props.onAffix; + + + if (affixed) { + setTimeout(function () { + return onAffix(true); + }); + } else if (!affixStyle) { + setTimeout(function () { + return onAffix(false); + }); + } + }; + + Affix.prototype._setContainerStyle = function _setContainerStyle(containerStyle) { + if (_util__WEBPACK_IMPORTED_MODULE_9__["obj"].shallowEqual(containerStyle, this.state.containerStyle)) { + return; + } + this.setState({ containerStyle: containerStyle }); + }; + + Affix.prototype._getOffset = function _getOffset(affixNode, affixContainer) { + var affixRect = affixNode.getBoundingClientRect(); // affix 元素 相对浏览器窗口的位置 + var containerRect = Object(_util__WEBPACK_IMPORTED_MODULE_11__["getRect"])(affixContainer); // affix 容器 相对浏览器窗口的位置 + var containerScrollTop = Object(_util__WEBPACK_IMPORTED_MODULE_11__["getScroll"])(affixContainer, true); + var containerScrollLeft = Object(_util__WEBPACK_IMPORTED_MODULE_11__["getScroll"])(affixContainer, false); + + return { + top: affixRect.top - containerRect.top + containerScrollTop, + left: affixRect.left - containerRect.left + containerScrollLeft, + width: affixRect.width, + height: affixRect.height + }; + }; + + Affix.prototype.render = function render() { + var _classnames; + + var affixMode = this.state.affixMode; + var _props = this.props, + prefix = _props.prefix, + className = _props.className, + style = _props.style, + children = _props.children; + + var state = this.state; + var classNames = classnames__WEBPACK_IMPORTED_MODULE_6___default()((_classnames = {}, _classnames[prefix + 'affix'] = state.style, _classnames[prefix + 'affix-top'] = !state.style && affixMode.top, _classnames[prefix + 'affix-bottom'] = !state.style && affixMode.bottom, _classnames[className] = className, _classnames)); + var combinedStyle = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, state.containerStyle, style); + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + { ref: this._affixNodeRefHandler, style: combinedStyle }, + react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + { + ref: this._affixChildNodeRefHandler, + className: classNames, + style: state.style + }, + children + ) + ); + }; + + return Affix; +}(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + /** + * 设置 Affix 需要监听滚动事件的容器元素 + * @return {ReactElement} 目标容器元素的实例 + */ + container: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * 距离窗口顶部达到指定偏移量后触发 + */ + offsetTop: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.number, + /** + * 距离窗口底部达到制定偏移量后触发 + */ + offsetBottom: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.number, + /** + * 当元素的样式发生固钉样式变化时触发的回调函数 + * @param {Boolean} affixed 元素是否被固钉 + */ + onAffix: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * 是否启用绝对布局实现 affix + * @param {Boolean} 是否启用绝对布局 + */ + useAbsolute: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + className: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + style: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, + children: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.any +}, _class.defaultProps = { + prefix: 'next-', + container: function container() { + return window; + }, + onAffix: _util__WEBPACK_IMPORTED_MODULE_9__["func"].noop +}, _temp); +Affix.displayName = 'Affix'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_10__["default"].config(Object(react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_8__["polyfill"])(Affix))); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/affix/util.js": +/*!************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/affix/util.js ***! + \************************************************************************/ +/*! exports provided: getScroll, getRect, getNodeHeight */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getScroll", function() { return getScroll; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRect", function() { return getRect; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeHeight", function() { return getNodeHeight; }); +function getScroll(node, isVertical) { + if (typeof window === 'undefined') { + return 0; + } + var windowProp = isVertical ? 'pageYOffset' : 'pageXOffset'; + var elementProp = isVertical ? 'scrollTop' : 'scrollLeft'; + return node === window ? node[windowProp] : node[elementProp]; +} + +function getRect(node) { + return node !== window ? node.getBoundingClientRect() : { top: 0, left: 0, bottom: 0 }; +} + +function getNodeHeight(node) { + if (!node) { + return 0; + } + if (node === window) { + return window.innerHeight; + } + return node.clientHeight; +} + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/animate.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/animate.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/typeof */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/typeof.js"); +/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var react_transition_group__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-transition-group */ "./node_modules/_react-transition-group@2.9.0@react-transition-group/index.js"); +/* harmony import */ var react_transition_group__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_transition_group__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var _child__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./child */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/child.js"); + + + + + + + +var _class, _temp; + + + + + + +var noop = function noop() {}; +var FirstChild = function FirstChild(props) { + var childrenArray = react__WEBPACK_IMPORTED_MODULE_6___default.a.Children.toArray(props.children); + return childrenArray[0] || null; +}; + +/** + * Animate + */ +var Animate = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5___default()(Animate, _Component); + + function Animate() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, Animate); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, _Component.apply(this, arguments)); + } + + Animate.prototype.normalizeNames = function normalizeNames(names) { + if (typeof names === 'string') { + return { + appear: names + '-appear', + appearActive: names + '-appear-active', + enter: names + '-enter', + enterActive: names + '-enter-active', + leave: names + '-leave', + leaveActive: names + '-leave-active' + }; + } + if ((typeof names === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_2___default()(names)) === 'object') { + return { + appear: names.appear, + appearActive: names.appear + '-active', + enter: '' + names.enter, + enterActive: names.enter + '-active', + leave: '' + names.leave, + leaveActive: names.leave + '-active' + }; + } + }; + + Animate.prototype.render = function render() { + var _this2 = this; + + /* eslint-disable no-unused-vars */ + var _props = this.props, + animation = _props.animation, + children = _props.children, + animationAppear = _props.animationAppear, + singleMode = _props.singleMode, + component = _props.component, + beforeAppear = _props.beforeAppear, + onAppear = _props.onAppear, + afterAppear = _props.afterAppear, + beforeEnter = _props.beforeEnter, + onEnter = _props.onEnter, + afterEnter = _props.afterEnter, + beforeLeave = _props.beforeLeave, + onLeave = _props.onLeave, + afterLeave = _props.afterLeave, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['animation', 'children', 'animationAppear', 'singleMode', 'component', 'beforeAppear', 'onAppear', 'afterAppear', 'beforeEnter', 'onEnter', 'afterEnter', 'beforeLeave', 'onLeave', 'afterLeave']); + /* eslint-enable no-unused-vars */ + + var animateChildren = react__WEBPACK_IMPORTED_MODULE_6__["Children"].map(children, function (child) { + return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + _child__WEBPACK_IMPORTED_MODULE_9__["default"], + { + key: child.key, + names: _this2.normalizeNames(animation), + onAppear: beforeAppear, + onAppearing: onAppear, + onAppeared: afterAppear, + onEnter: beforeEnter, + onEntering: onEnter, + onEntered: afterEnter, + onExit: beforeLeave, + onExiting: onLeave, + onExited: afterLeave + }, + child + ); + }); + + return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + react_transition_group__WEBPACK_IMPORTED_MODULE_8__["TransitionGroup"], + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + appear: animationAppear, + component: singleMode ? FirstChild : component + }, others), + animateChildren + ); + }; + + return Animate; +}(react__WEBPACK_IMPORTED_MODULE_6__["Component"]), _class.propTypes = { + /** + * 动画 className + */ + animation: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object]), + /** + * 子元素第一次挂载时是否执行动画 + */ + animationAppear: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 包裹子元素的标签 + */ + component: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.any, + /** + * 是否只有单个子元素,如果有多个子元素,请设置为 false + */ + singleMode: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 子元素 + */ + children: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.element, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.element)]), + /** + * 执行第一次挂载动画前触发的回调函数 + * @param {HTMLElement} node 执行动画的 dom 元素 + */ + beforeAppear: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 执行第一次挂载动画,添加 xxx-appear-active 类名后触发的回调函数 + * @param {HTMLElement} node 执行动画的 dom 元素 + */ + onAppear: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 执行完第一次挂载动画后触发的函数 + * @param {HTMLElement} node 执行动画的 dom 元素 + */ + afterAppear: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 执行进场动画前触发的回调函数 + * @param {HTMLElement} node 执行动画的 dom 元素 + */ + beforeEnter: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 执行进场动画,添加 xxx-enter-active 类名后触发的回调函数 + * @param {HTMLElement} node 执行动画的 dom 元素 + */ + onEnter: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 执行完进场动画后触发的回调函数 + * @param {HTMLElement} node 执行动画的 dom 元素 + */ + afterEnter: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 执行离场动画前触发的回调函数 + * @param {HTMLElement} node 执行动画的 dom 元素 + */ + beforeLeave: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 执行离场动画,添加 xxx-leave-active 类名后触发的回调函数 + * @param {HTMLElement} node 执行动画的 dom 元素 + */ + onLeave: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 执行完离场动画后触发的回调函数 + * @param {HTMLElement} node 执行动画的 dom 元素 + */ + afterLeave: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func +}, _class.defaultProps = { + animationAppear: true, + component: 'div', + singleMode: true, + beforeAppear: noop, + onAppear: noop, + afterAppear: noop, + beforeEnter: noop, + onEnter: noop, + afterEnter: noop, + beforeLeave: noop, + onLeave: noop, + afterLeave: noop +}, _temp); +Animate.displayName = 'Animate'; + + +/* harmony default export */ __webpack_exports__["default"] = (Animate); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/child.js": +/*!***************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/child.js ***! + \***************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AnimateChild; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var react_transition_group__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-transition-group */ "./node_modules/_react-transition-group@2.9.0@react-transition-group/index.js"); +/* harmony import */ var react_transition_group__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_transition_group__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); + + + + + + +var _class, _temp; + + + + + + +var noop = function noop() {}; +var on = _util__WEBPACK_IMPORTED_MODULE_8__["events"].on, + off = _util__WEBPACK_IMPORTED_MODULE_8__["events"].off; +var addClass = _util__WEBPACK_IMPORTED_MODULE_8__["dom"].addClass, + removeClass = _util__WEBPACK_IMPORTED_MODULE_8__["dom"].removeClass; + +var prefixes = ['-webkit-', '-moz-', '-o-', 'ms-', '']; + +function getStyleProperty(node, name) { + var style = window.getComputedStyle(node); + var ret = ''; + for (var i = 0; i < prefixes.length; i++) { + ret = style.getPropertyValue(prefixes[i] + name); + if (ret) { + break; + } + } + return ret; +} + +var AnimateChild = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(AnimateChild, _Component); + + function AnimateChild(props) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, AnimateChild); + + var _this2 = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.call(this, props)); + + _util__WEBPACK_IMPORTED_MODULE_8__["func"].bindCtx(_this2, ['handleEnter', 'handleEntering', 'handleEntered', 'handleExit', 'handleExiting', 'handleExited', 'addEndListener']); + _this2.endListeners = { + transitionend: [], + animationend: [] + }; + _this2.timeoutMap = {}; + return _this2; + } + + AnimateChild.prototype.componentWillUnmount = function componentWillUnmount() { + var _this3 = this; + + Object.keys(this.endListeners).forEach(function (eventName) { + _this3.endListeners[eventName].forEach(function (listener) { + off(_this3.node, eventName, listener); + }); + }); + this.endListeners = { + transitionend: [], + animationend: [] + }; + }; + + AnimateChild.prototype.generateEndListener = function generateEndListener(node, done, eventName, id) { + var _this = this; + return function endListener(e) { + if (e && e.target === node) { + if (_this.timeoutMap[id]) { + clearTimeout(_this.timeoutMap[id]); + delete _this.timeoutMap[id]; + } + + done(); + off(node, eventName, endListener); + var listeners = _this.endListeners[eventName]; + var index = listeners.indexOf(endListener); + index > -1 && listeners.splice(index, 1); + } + }; + }; + + AnimateChild.prototype.addEndListener = function addEndListener(node, done) { + var _this4 = this; + + if (_util__WEBPACK_IMPORTED_MODULE_8__["support"].transition || _util__WEBPACK_IMPORTED_MODULE_8__["support"].animation) { + var id = Object(_util__WEBPACK_IMPORTED_MODULE_8__["guid"])(); + + this.node = node; + if (_util__WEBPACK_IMPORTED_MODULE_8__["support"].transition) { + var transitionEndListener = this.generateEndListener(node, done, 'transitionend', id); + on(node, 'transitionend', transitionEndListener); + this.endListeners.transitionend.push(transitionEndListener); + } + if (_util__WEBPACK_IMPORTED_MODULE_8__["support"].animation) { + var animationEndListener = this.generateEndListener(node, done, 'animationend', id); + on(node, 'animationend', animationEndListener); + this.endListeners.animationend.push(animationEndListener); + } + + setTimeout(function () { + var transitionDelay = parseFloat(getStyleProperty(node, 'transition-delay')) || 0; + var transitionDuration = parseFloat(getStyleProperty(node, 'transition-duration')) || 0; + var animationDelay = parseFloat(getStyleProperty(node, 'animation-delay')) || 0; + var animationDuration = parseFloat(getStyleProperty(node, 'animation-duration')) || 0; + var time = Math.max(transitionDuration + transitionDelay, animationDuration + animationDelay); + if (time) { + _this4.timeoutMap[id] = setTimeout(function () { + done(); + }, time * 1000 + 200); + } + }, 15); + } else { + done(); + } + }; + + AnimateChild.prototype.removeEndtListener = function removeEndtListener() { + this.transitionOff && this.transitionOff(); + this.animationOff && this.animationOff(); + }; + + AnimateChild.prototype.removeClassNames = function removeClassNames(node, names) { + Object.keys(names).forEach(function (key) { + removeClass(node, names[key]); + }); + }; + + AnimateChild.prototype.handleEnter = function handleEnter(node, isAppearing) { + var names = this.props.names; + + if (names) { + this.removeClassNames(node, names); + var className = isAppearing ? 'appear' : 'enter'; + addClass(node, names[className]); + } + + var hook = isAppearing ? this.props.onAppear : this.props.onEnter; + hook(node); + }; + + AnimateChild.prototype.handleEntering = function handleEntering(node, isAppearing) { + var _this5 = this; + + setTimeout(function () { + var names = _this5.props.names; + + if (names) { + var className = isAppearing ? 'appearActive' : 'enterActive'; + addClass(node, names[className]); + } + + var hook = isAppearing ? _this5.props.onAppearing : _this5.props.onEntering; + hook(node); + }, 10); + }; + + AnimateChild.prototype.handleEntered = function handleEntered(node, isAppearing) { + var names = this.props.names; + + if (names) { + var classNames = isAppearing ? [names.appear, names.appearActive] : [names.enter, names.enterActive]; + classNames.forEach(function (className) { + removeClass(node, className); + }); + } + + var hook = isAppearing ? this.props.onAppeared : this.props.onEntered; + hook(node); + }; + + AnimateChild.prototype.handleExit = function handleExit(node) { + var names = this.props.names; + + if (names) { + this.removeClassNames(node, names); + addClass(node, names.leave); + } + + this.props.onExit(node); + }; + + AnimateChild.prototype.handleExiting = function handleExiting(node) { + var _this6 = this; + + setTimeout(function () { + var names = _this6.props.names; + + if (names) { + addClass(node, names.leaveActive); + } + _this6.props.onExiting(node); + }, 10); + }; + + AnimateChild.prototype.handleExited = function handleExited(node) { + var names = this.props.names; + + if (names) { + [names.leave, names.leaveActive].forEach(function (className) { + removeClass(node, className); + }); + } + + this.props.onExited(node); + }; + + AnimateChild.prototype.render = function render() { + /* eslint-disable no-unused-vars */ + var _props = this.props, + names = _props.names, + onAppear = _props.onAppear, + onAppeared = _props.onAppeared, + onAppearing = _props.onAppearing, + onEnter = _props.onEnter, + onEntering = _props.onEntering, + onEntered = _props.onEntered, + onExit = _props.onExit, + onExiting = _props.onExiting, + onExited = _props.onExited, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['names', 'onAppear', 'onAppeared', 'onAppearing', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited']); + /* eslint-enable no-unused-vars */ + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(react_transition_group__WEBPACK_IMPORTED_MODULE_7__["Transition"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { + onEnter: this.handleEnter, + onEntering: this.handleEntering, + onEntered: this.handleEntered, + onExit: this.handleExit, + onExiting: this.handleExiting, + onExited: this.handleExited, + addEndListener: this.addEndListener + })); + }; + + return AnimateChild; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = { + names: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object]), + onAppear: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + onAppearing: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + onAppeared: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + onEnter: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + onEntering: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + onEntered: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + onExit: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + onExiting: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + onExited: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func +}, _class.defaultProps = { + onAppear: noop, + onAppearing: noop, + onAppeared: noop, + onEnter: noop, + onEntering: noop, + onEntered: noop, + onExit: noop, + onExiting: noop, + onExited: noop +}, _temp); +AnimateChild.displayName = 'AnimateChild'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/expand.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/expand.js ***! + \****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Expand; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _animate__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./animate */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/animate.js"); + + + + + + +var _class, _temp; + + + + + + +var noop = function noop() {}; +var getStyle = _util__WEBPACK_IMPORTED_MODULE_7__["dom"].getStyle; +var Expand = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Expand, _Component); + + function Expand(props) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Expand); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.call(this, props)); + + _util__WEBPACK_IMPORTED_MODULE_7__["func"].bindCtx(_this, ['beforeEnter', 'onEnter', 'afterEnter', 'beforeLeave', 'onLeave', 'afterLeave']); + return _this; + } + + Expand.prototype.beforeEnter = function beforeEnter(node) { + if (this.leaving) { + this.afterLeave(node); + } + + this.cacheCurrentStyle(node); + this.cacheComputedStyle(node); + this.setCurrentStyleToZero(node); + + this.props.beforeEnter(node); + }; + + Expand.prototype.onEnter = function onEnter(node) { + this.setCurrentStyleToComputedStyle(node); + + this.props.onEnter(node); + }; + + Expand.prototype.afterEnter = function afterEnter(node) { + this.restoreCurrentStyle(node); + + this.props.afterEnter(node); + }; + + Expand.prototype.beforeLeave = function beforeLeave(node) { + this.leaving = true; + + this.cacheCurrentStyle(node); + this.cacheComputedStyle(node); + this.setCurrentStyleToComputedStyle(node); + + this.props.beforeLeave(node); + }; + + Expand.prototype.onLeave = function onLeave(node) { + this.setCurrentStyleToZero(node); + + this.props.onLeave(node); + }; + + Expand.prototype.afterLeave = function afterLeave(node) { + this.leaving = false; + + this.restoreCurrentStyle(node); + + this.props.afterLeave(node); + }; + + Expand.prototype.cacheCurrentStyle = function cacheCurrentStyle(node) { + this.styleBorderTopWidth = node.style.borderTopWidth; + this.stylePaddingTop = node.style.paddingTop; + this.styleHeight = node.style.height; + this.stylePaddingBottom = node.style.paddingBottom; + this.styleBorderBottomWidth = node.style.borderBottomWidth; + }; + + Expand.prototype.cacheComputedStyle = function cacheComputedStyle(node) { + this.borderTopWidth = getStyle(node, 'borderTopWidth'); + this.paddingTop = getStyle(node, 'paddingTop'); + this.height = node.offsetHeight; + this.paddingBottom = getStyle(node, 'paddingBottom'); + this.borderBottomWidth = getStyle(node, 'borderBottomWidth'); + }; + + Expand.prototype.setCurrentStyleToZero = function setCurrentStyleToZero(node) { + node.style.borderTopWidth = '0px'; + node.style.paddingTop = '0px'; + node.style.height = '0px'; + node.style.paddingBottom = '0px'; + node.style.borderBottomWidth = '0px'; + }; + + Expand.prototype.setCurrentStyleToComputedStyle = function setCurrentStyleToComputedStyle(node) { + node.style.borderTopWidth = this.borderTopWidth + 'px'; + node.style.paddingTop = this.paddingTop + 'px'; + node.style.height = this.height + 'px'; + node.style.paddingBottom = this.paddingBottom + 'px'; + node.style.borderBottomWidth = this.borderBottomWidth + 'px'; + }; + + Expand.prototype.restoreCurrentStyle = function restoreCurrentStyle(node) { + node.style.borderTopWidth = this.styleBorderTopWidth; + node.style.paddingTop = this.stylePaddingTop; + node.style.height = this.styleHeight; + node.style.paddingBottom = this.stylePaddingBottom; + node.style.borderBottomWidth = this.styleBorderBottomWidth; + }; + + Expand.prototype.render = function render() { + var _props = this.props, + animation = _props.animation, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['animation']); + + var newAnimation = animation || 'expand'; + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_animate__WEBPACK_IMPORTED_MODULE_8__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { + animation: newAnimation, + beforeEnter: this.beforeEnter, + onEnter: this.onEnter, + afterEnter: this.afterEnter, + beforeLeave: this.beforeLeave, + onLeave: this.onLeave, + afterLeave: this.afterLeave + })); + }; + + return Expand; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = { + animation: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object]), + beforeEnter: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + onEnter: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + afterEnter: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + beforeLeave: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + onLeave: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + afterLeave: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func +}, _class.defaultProps = { + beforeEnter: noop, + onEnter: noop, + afterEnter: noop, + beforeLeave: noop, + onLeave: noop, + afterLeave: noop +}, _temp); +Expand.displayName = 'Expand'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/index.js": +/*!***************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/index.js ***! + \***************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _animate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./animate */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/animate.js"); +/* harmony import */ var _expand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./expand */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/expand.js"); + + + +_animate__WEBPACK_IMPORTED_MODULE_0__["default"].Expand = _expand__WEBPACK_IMPORTED_MODULE_1__["default"]; + +/* harmony default export */ __webpack_exports__["default"] = (_animate__WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/main.scss": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/main.scss ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694893234 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/style.js": +/*!***************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/style.js ***! + \***************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_0__); + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/badge/index.js": +/*!*************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/badge/index.js ***! + \*************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _sup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./sup */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/badge/sup.js"); + + + + + +var _class, _temp; + + + + + + + + +/** + * Badge + */ +var Badge = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(Badge, _Component); + + function Badge() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Badge); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _Component.apply(this, arguments)); + } + + Badge.prototype.render = function render() { + var _classNames; + + var _props = this.props, + prefix = _props.prefix, + dot = _props.dot, + className = _props.className, + children = _props.children, + content = _props.content, + style = _props.style, + rtl = _props.rtl, + originCount = _props.count, + showZero = _props.showZero, + originOverflowCount = _props.overflowCount; + + var count = parseInt(originCount, 10); + var overflowCount = parseInt(originOverflowCount, 10); + var others = _util__WEBPACK_IMPORTED_MODULE_8__["obj"].pickOthers(Badge.propTypes, this.props); + + // 如果是数字,则添加默认的 title + if (count || count === 0 && showZero) { + others.title = others.title || '' + count; + } + + var classes = classnames__WEBPACK_IMPORTED_MODULE_6___default()(prefix + 'badge', (_classNames = {}, _classNames[prefix + 'badge-not-a-wrapper'] = !children, _classNames), className); + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'span', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ dir: rtl ? 'rtl' : undefined, className: classes }, others), + children, + react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_sup__WEBPACK_IMPORTED_MODULE_9__["default"], { + prefix: prefix, + content: content, + count: count, + showZero: showZero, + overflowCount: overflowCount, + dot: dot, + style: style + }) + ); + }; + + return Badge; +}(react__WEBPACK_IMPORTED_MODULE_4__["Component"]), _class.propTypes = { + // 样式类名的品牌前缀 + prefix: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + // 自定义类名 + className: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + // 自定义内联样式 + style: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, + /** + * 徽章依托的内容 + */ + children: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + /** + * 展示的数字,大于 overflowCount 时显示为 ${overflowCount}+,为 0 时默认隐藏 + */ + count: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string]), + /** + * 当count为0时,是否显示count + */ + showZero: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 自定义节点内容 + */ + content: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + /** + * 展示的封顶的数字 + */ + overflowCount: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string]), + /** + * 不展示数字,只展示一个小红点 + */ + dot: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool +}, _class.defaultProps = { + prefix: 'next-', + count: 0, + showZero: false, + overflowCount: 99, + dot: false +}, _temp); +Badge.displayName = 'Badge'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_7__["default"].config(Badge)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/badge/main.scss": +/*!**************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/badge/main.scss ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694895664 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/badge/style.js": +/*!*************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/badge/style.js ***! + \*************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _animate_style_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../animate/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/style.js"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/badge/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_1__); + + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/badge/sup.js": +/*!***********************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/badge/sup.js ***! + \***********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-lifecycles-compat */ "./node_modules/_react-lifecycles-compat@3.0.4@react-lifecycles-compat/react-lifecycles-compat.es.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _animate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../animate */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); + + + + +var _class, _temp; + + + + + + + + +/** + * badge sup component + */ + +// util::getDigitArray +var getDigitArray = function getDigitArray(num) { + return num.toString().split('').reverse().map(function (i) { + return parseInt(i, 10); + }); +}; + +var Sup = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(Sup, _Component); + + // 单排可滚动的数字列表 + Sup.renderDigit = function renderDigit(prefix, digit, key) { + var children = []; + for (var i = 0; i < 30; i++) { + children.push(react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'span', + { key: i }, + i % 10 + )); + } + + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'span', + { className: prefix + 'badge-scroll-number-only', key: key }, + children + ); + }; + + // 可滚动数字组 + + + Sup.renderNumber = function renderNumber(prefix, count) { + return getDigitArray(count).map(function (digit, i) { + return Sup.renderDigit(prefix, digit, i); + }).reverse(); + }; + + function Sup(props) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Sup); + + // render 时, 上一次的渲染数字 和 当前渲染的数字 + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(this, _Component.call(this, props)); + + _this.state = { + lastCount: 0, + currentCount: props.count + }; + return _this; + } + + Sup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) { + if ('count' in nextProps) { + return { + lastCount: prevState.currentCount, + currentCount: nextProps.count + }; + } + + return null; + }; + + Sup.prototype.componentDidMount = function componentDidMount() { + this.computeStyle(true); + }; + + Sup.prototype.componentDidUpdate = function componentDidUpdate(prevProps) { + var _this2 = this; + + if (prevProps.count !== this.props.count) { + this.computeStyle(false); + + // NOTE why called `computeStyle` again after 300ms ? + setTimeout(function () { + _this2.computeStyle(true, true); + }, 300); + } + }; + + Sup.prototype.computeStyle = function computeStyle(removeTransition, revert) { + var _this3 = this; + + var _props = this.props, + prefix = _props.prefix, + count = _props.count, + overflowCount = _props.overflowCount; + var lastCount = this.state.lastCount; + + + if (count < 0) { + return; + } + var supNode = this.refs.sup; + + if (supNode && _util__WEBPACK_IMPORTED_MODULE_8__["dom"].hasClass(supNode, prefix + 'badge-count')) { + var scrollNums = supNode.querySelectorAll('.' + prefix + 'badge-scroll-number-only'); + + if (scrollNums.length) { + var height = window.getComputedStyle(supNode).height; + + scrollNums = [].slice.call(scrollNums, 0).reverse(); + + getDigitArray(count).forEach(function (digit, i) { + var position = _this3.getPositionByDigit(digit, i, revert); + var transformTo = -position * parseInt(height, 10); + + removeTransition = removeTransition || typeof getDigitArray(lastCount)[i] === 'undefined' || lastCount > overflowCount || lastCount <= 0; + + var scrollStyle = _util__WEBPACK_IMPORTED_MODULE_8__["support"].animation ? { + transition: removeTransition ? 'none' : 'transform .3s cubic-bezier(.645, .045, .355, 1), -webkit-transform .3s cubic-bezier(.645, .045, .355, 1)', + WebkitTransform: 'translateY(' + transformTo + 'px)', + transform: 'translateY(' + transformTo + 'px)', + height: height, + lineHeight: height + } : { + top: transformTo + 'px', + height: height, + lineHeight: height + }; + + Object.keys(scrollStyle).forEach(function (key) { + scrollNums[i].style[key] = scrollStyle[key]; + }); + }); + } + } + }; + + Sup.prototype.getPositionByDigit = function getPositionByDigit(digit, i, revert) { + var lastCount = this.state.lastCount; + + if (revert) { + return 10 + digit; + } + var lastDigit = getDigitArray(lastCount)[i] || 0; + + if (this.props.count > lastCount) { + return (digit >= lastDigit ? 10 : 20) + digit; + } + + if (digit <= lastDigit) { + return 10 + digit; + } + + return digit; + }; + + Sup.prototype.render = function render() { + var _classNames; + + var _props2 = this.props, + prefix = _props2.prefix, + count = _props2.count, + showZero = _props2.showZero, + overflowCount = _props2.overflowCount, + dot = _props2.dot, + style = _props2.style, + content = _props2.content; + + + var supClasses = classnames__WEBPACK_IMPORTED_MODULE_6___default()(prefix + 'badge-scroll-number', (_classNames = {}, _classNames[prefix + 'badge-count'] = !!count || count === 0 && showZero, _classNames[prefix + 'badge-dot'] = dot, _classNames[prefix + 'badge-custom'] = !!content, _classNames)); + + var children = null; + var show = dot || count > 0 || count === 0 && showZero || content; + + if (count > 0 || count === 0 && showZero) { + var realCount = overflowCount > 0 && count > overflowCount ? overflowCount + '+' : count; + + children = isNaN(realCount) ? realCount : Sup.renderNumber(prefix, count); + } else if (content) { + children = content; + } + + var animation = { + appear: 'zoomIn', + enter: 'zoomIn', + leave: 'zoomOut' + }; + + var wrapper = _util__WEBPACK_IMPORTED_MODULE_8__["support"].animation ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_animate__WEBPACK_IMPORTED_MODULE_7__["default"], { animation: animation }) : react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement('span', null); + var element = show ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'sup', + { ref: 'sup', className: supClasses, style: style }, + children + ) : null; + + return react__WEBPACK_IMPORTED_MODULE_3___default.a.cloneElement(wrapper, {}, element); + }; + + return Sup; +}(react__WEBPACK_IMPORTED_MODULE_3__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, + count: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.number, + showZero: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, + overflowCount: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.number, + content: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.node, + dot: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, + style: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.object +}, _class.defaultProps = { + prefix: 'next-', + count: 0, + showZero: false, + overflowCount: 99, + dot: false +}, _temp); +Sup.displayName = 'Sup'; + + +/* harmony default export */ __webpack_exports__["default"] = (Object(react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_5__["polyfill"])(Sup)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/alignMap.js": +/*!******************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/alignMap.js ***! + \******************************************************************************/ +/*! exports provided: normalMap, edgeMap */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalMap", function() { return normalMap; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "edgeMap", function() { return edgeMap; }); +/** + * Created by xiachi on 17/1/17. + */ + +var normalMap = { + t: { + align: 'bc tc', + rtlAlign: 'bc tc', + arrow: 'bottom', + trOrigin: 'bottom', + rtlTrOrigin: 'bottom', + offset: [0, -12] + }, + r: { + align: 'cl cr', + rtlAlign: 'cr cl', + arrow: 'left', + trOrigin: 'left', + rtlTrOrigin: 'right', + offset: [12, 0] + }, + b: { + align: 'tc bc', + rtlAlign: 'tc bc', + arrow: 'top', + trOrigin: 'top', + rtlTrOrigin: 'top', + offset: [0, 12] + }, + l: { + align: 'cr cl', + rtlAlign: 'cl cr', + arrow: 'right', + trOrigin: 'right', + rtlTrOrigin: 'left', + offset: [-12, 0] + }, + tl: { + align: 'br tc', + rtlAlign: 'bl tc', + arrow: 'bottom-right', + trOrigin: 'bottom right', + rtlTrOrigin: 'bottom left', + offset: [20, -12] + }, + tr: { + align: 'bl tc', + rtlAlign: 'br tc', + arrow: 'bottom-left', + trOrigin: 'bottom left', + rtlTrOrigin: 'bottom right', + offset: [-20, -12] + }, + rt: { + align: 'bl cr', + rtlAlign: 'br cl', + arrow: 'left-bottom', + trOrigin: 'bottom left', + rtlTrOrigin: 'bottom right', + offset: [12, 20] + }, + rb: { + align: 'tl cr', + rtlAlign: 'tr cl', + arrow: 'left-top', + trOrigin: 'top left', + rtlTrOrigin: 'top right', + offset: [12, -20] + }, + bl: { + align: 'tr bc', + rtlAlign: 'tl bc', + arrow: 'top-right', + trOrigin: 'top right', + rtlTrOrigin: 'top left', + offset: [20, 12] + }, + br: { + align: 'tl bc', + rtlAlign: 'tr bc', + arrow: 'top-left', + trOrigin: 'top left', + rtlTrOrigin: 'top right', + offset: [-20, 12] + }, + lt: { + align: 'br cl', + rtlAlign: 'bl cr', + arrow: 'right-bottom', + trOrigin: 'bottom right', + rtlTrOrigin: 'bottom left', + offset: [-12, 20] + }, + lb: { + align: 'tr cl', + rtlAlign: 'tl cr', + arrow: 'right-top', + trOrigin: 'top right', + rtlTrOrigin: 'top left', + offset: [-12, -20] + } +}; +var edgeMap = { + t: { + align: 'bc tc', + rtlAlign: 'bc tc', + arrow: 'bottom', + trOrigin: 'bottom', + rtlTrOrigin: 'bottom', + offset: [0, -12] + }, + r: { + align: 'cl cr', + rtlAlign: 'cr cl', + arrow: 'left', + trOrigin: 'left', + rtlTrOrigin: 'right', + offset: [12, 0] + }, + b: { + align: 'tc bc', + rtlAlign: 'tc bc', + arrow: 'top', + trOrigin: 'top', + rtlTrOrigin: 'top', + offset: [0, 12] + }, + l: { + align: 'cr cl', + rtlAlign: 'cl cr', + arrow: 'right', + trOrigin: 'right', + rtlTrOrigin: 'left', + offset: [-12, 0] + }, + tl: { + align: 'bl tl', + rtlAlign: 'br tr', + arrow: 'bottom-left', + trOrigin: 'bottom left', + rtlTrOrigin: 'bottom right', + offset: [0, -12] + }, + tr: { + align: 'br tr', + rtlAlign: 'bl tl', + arrow: 'bottom-right', + trOrigin: 'bottom right', + rtlTrOrigin: 'bottom left', + offset: [0, -12] + }, + rt: { + align: 'tl tr', + rtlAlign: 'tr tl', + arrow: 'left-top', + trOrigin: 'top left', + rtlTrOrigin: 'top right', + offset: [12, 0] + }, + rb: { + align: 'bl br', + rtlAlign: 'br bl', + arrow: 'left-bottom', + trOrigin: 'bottom left', + rtlTrOrigin: 'bottom right', + offset: [12, 0] + }, + bl: { + align: 'tl bl', + rtlAlign: 'tr br', + arrow: 'top-left', + trOrigin: 'top left', + rtlTrOrigin: 'top right', + offset: [0, 12] + }, + br: { + align: 'tr br', + rtlAlign: 'tl bl', + arrow: 'top-right', + trOrigin: 'top right', + rtlTrOrigin: 'top left', + offset: [0, 12] + }, + lt: { + align: 'tr tl', + rtlAlign: 'tl tr', + arrow: 'right-top', + trOrigin: 'top right', + rtlTrOrigin: 'top left', + offset: [-12, 0] + }, + lb: { + align: 'br bl', + rtlAlign: 'bl br', + arrow: 'right-bottom', + trOrigin: 'bottom right', + rtlTrOrigin: 'bottom left', + offset: [-12, 0] + } +}; + + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/balloon.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/balloon.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-lifecycles-compat */ "./node_modules/_react-lifecycles-compat@3.0.4@react-lifecycles-compat/react-lifecycles-compat.es.js"); +/* harmony import */ var _overlay__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../overlay */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/overlay/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _inner__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./inner */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/inner.js"); +/* harmony import */ var _alignMap__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./alignMap */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/alignMap.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/util.js"); + + + + + + +var _class, _temp; + + + + + + + + + + +var noop = _util__WEBPACK_IMPORTED_MODULE_9__["func"].noop; +var Popup = _overlay__WEBPACK_IMPORTED_MODULE_8__["default"].Popup; + + +var alignList = ['t', 'r', 'b', 'l', 'tl', 'tr', 'bl', 'br', 'lt', 'lb', 'rt', 'rb']; + +var alignMap = _alignMap__WEBPACK_IMPORTED_MODULE_11__["normalMap"]; + +/** Balloon */ +var Balloon = (_temp = _class = function (_React$Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Balloon, _React$Component); + + function Balloon(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Balloon); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _React$Component.call(this, props, context)); + + _this.state = { + align: alignList.includes(props.align) ? props.align : 'b', + visible: 'visible' in props ? props.visible : props.defaultVisible + }; + _this._onClose = _this._onClose.bind(_this); + _this._onPosition = _this._onPosition.bind(_this); + _this._onVisibleChange = _this._onVisibleChange.bind(_this); + return _this; + } + + Balloon.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) { + var nextState = {}; + if ('visible' in nextProps) { + nextState.visible = nextProps.visible; + } + + if (!prevState.innerAlign && 'align' in nextProps && alignList.includes(nextProps.align)) { + nextState.align = nextProps.align; + nextState.innerAlign = false; + } + + return nextState; + }; + + Balloon.prototype._onVisibleChange = function _onVisibleChange(visible, trigger) { + // Not Controlled + if (!('visible' in this.props)) { + this.setState({ + visible: visible + }); + } + + this.props.onVisibleChange(visible, trigger); + + if (!visible) { + this.props.onClose(); + } + }; + + Balloon.prototype._onClose = function _onClose(e) { + this._onVisibleChange(false, 'closeClick'); + + //必须加上preventDefault,否则单测IE下报错,出现full page reload 异常 + e.preventDefault(); + }; + + Balloon.prototype._onPosition = function _onPosition(res) { + var rtl = this.props.rtl; + + alignMap = this.props.alignEdge ? _alignMap__WEBPACK_IMPORTED_MODULE_11__["edgeMap"] : _alignMap__WEBPACK_IMPORTED_MODULE_11__["normalMap"]; + var newAlign = res.align.join(' '); + var resAlign = void 0; + + var alignKey = 'align'; + if (rtl) { + alignKey = 'rtlAlign'; + } + + for (var key in alignMap) { + if (alignMap[key][alignKey] === newAlign) { + resAlign = key; + + break; + } + } + + resAlign = resAlign || this.state.align; + if (resAlign !== this.state.align) { + this.setState({ + align: resAlign, + innerAlign: true + }); + } + }; + + Balloon.prototype.render = function render() { + var _props = this.props, + id = _props.id, + type = _props.type, + prefix = _props.prefix, + className = _props.className, + alignEdge = _props.alignEdge, + trigger = _props.trigger, + triggerType = _props.triggerType, + children = _props.children, + closable = _props.closable, + shouldUpdatePosition = _props.shouldUpdatePosition, + delay = _props.delay, + needAdjust = _props.needAdjust, + safeId = _props.safeId, + autoFocus = _props.autoFocus, + safeNode = _props.safeNode, + onClick = _props.onClick, + onHover = _props.onHover, + animation = _props.animation, + offset = _props.offset, + style = _props.style, + container = _props.container, + popupContainer = _props.popupContainer, + cache = _props.cache, + popupStyle = _props.popupStyle, + popupClassName = _props.popupClassName, + popupProps = _props.popupProps, + followTrigger = _props.followTrigger, + rtl = _props.rtl, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['id', 'type', 'prefix', 'className', 'alignEdge', 'trigger', 'triggerType', 'children', 'closable', 'shouldUpdatePosition', 'delay', 'needAdjust', 'safeId', 'autoFocus', 'safeNode', 'onClick', 'onHover', 'animation', 'offset', 'style', 'container', 'popupContainer', 'cache', 'popupStyle', 'popupClassName', 'popupProps', 'followTrigger', 'rtl']); + + if (container) { + _util__WEBPACK_IMPORTED_MODULE_9__["log"].deprecated('container', 'popupContainer', 'Balloon'); + } + + var align = this.state.align; + + + alignMap = alignEdge ? _alignMap__WEBPACK_IMPORTED_MODULE_11__["edgeMap"] : _alignMap__WEBPACK_IMPORTED_MODULE_11__["normalMap"]; + var _prefix = this.context.prefix || prefix; + + var trOrigin = 'trOrigin'; + if (rtl) { + trOrigin = 'rtlTrOrigin'; + } + + var _offset = [alignMap[align].offset[0] + offset[0], alignMap[align].offset[1] + offset[1]]; + var transformOrigin = alignMap[align][trOrigin]; + var _style = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ transformOrigin: transformOrigin }, style); + + var content = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + _inner__WEBPACK_IMPORTED_MODULE_10__["default"], + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _util__WEBPACK_IMPORTED_MODULE_9__["obj"].pickOthers(Object.keys(Balloon.propTypes), others), { + id: id, + prefix: _prefix, + closable: closable, + onClose: this._onClose, + className: className, + style: _style, + align: align, + type: type, + rtl: rtl, + alignEdge: alignEdge + }), + children + ); + + var triggerProps = {}; + triggerProps['aria-describedby'] = id; + triggerProps.tabIndex = '0'; + + var ariaTrigger = id ? react__WEBPACK_IMPORTED_MODULE_5___default.a.cloneElement(trigger, triggerProps) : trigger; + + var newTrigger = Object(_util__WEBPACK_IMPORTED_MODULE_12__["getDisabledCompatibleTrigger"])(react__WEBPACK_IMPORTED_MODULE_5___default.a.isValidElement(ariaTrigger) ? ariaTrigger : react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'span', + null, + ariaTrigger + )); + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + Popup, + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, popupProps, { + followTrigger: followTrigger, + trigger: newTrigger, + cache: cache, + safeId: safeId, + triggerType: triggerType, + align: alignMap[align].align, + offset: _offset, + visible: this.state.visible, + onPosition: this._onPosition, + onClick: onClick, + onHover: onHover, + afterClose: this.props.afterClose, + onVisibleChange: this._onVisibleChange, + shouldUpdatePosition: shouldUpdatePosition, + needAdjust: needAdjust, + animation: animation, + delay: delay, + autoFocus: triggerType === 'focus' ? false : autoFocus, + safeNode: safeNode, + container: popupContainer || container, + className: popupClassName, + style: popupStyle, + rtl: rtl + }), + content + ); + }; + + return Balloon; +}(react__WEBPACK_IMPORTED_MODULE_5___default.a.Component), _class.contextTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string +}, _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + pure: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 自定义类名 + */ + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 自定义内敛样式 + */ + style: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 浮层的内容 + */ + children: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + size: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 样式类型 + */ + type: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['normal', 'primary']), + /** + * 弹层当前显示的状态 + */ + visible: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层默认显示的状态 + */ + defaultVisible: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层在显示和隐藏触发的事件 + * @param {Boolean} visible 弹层是否隐藏和显示 + * @param {String} type 触发弹层显示或隐藏的来源, closeClick 表示由自带的关闭按钮触发; fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发 + */ + onVisibleChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 弹出层对齐方式, 是否为边缘对齐 + */ + alignEdge: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 是否显示关闭按钮 + */ + closable: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹出层位置 + * @enumdesc 上, 右, 下, 左, 上左, 上右, 下左, 下右, 左上, 左下, 右上, 右下 及其 两两组合 + */ + align: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(alignList), + /** + * 弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量 + * e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px + */ + offset: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.array, + /** + * 触发元素 + */ + trigger: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + /** + * 触发行为 + * 鼠标悬浮, 鼠标点击('hover','click')或者它们组成的数组,如 ['hover', 'click'], 强烈不建议使用'focus',若弹窗内容有复杂交互请使用click + */ + triggerType: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.array]), + + onClick: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 任何visible为false时会触发的事件 + */ + onClose: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + onHover: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 是否进行自动位置调整 + */ + needAdjust: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层在触发以后的延时显示, 单位毫秒 ms + */ + delay: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.number, + /** + * 浮层关闭后触发的事件, 如果有动画,则在动画结束后触发 + */ + afterClose: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 强制更新定位信息 + */ + shouldUpdatePosition: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层出现后是否自动focus到内部第一个元素 + */ + autoFocus: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 安全节点:对于triggetType为click的浮层,会在点击除了浮层外的其它区域时关闭浮层.safeNode用于添加不触发关闭的节点, 值可以是dom节点的id或者是节点的dom对象 + */ + safeNode: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 用来指定safeNode节点的id,和safeNode配合使用 + */ + safeId: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 配置动画的播放方式 + * @param {String} in 进场动画 + * @param {String} out 出场动画 + */ + animation: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool]), + + /** + * 弹层的dom节点关闭时是否删除 + */ + cache: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 指定浮层渲染的父节点, 可以为节点id的字符串,也可以返回节点的函数。 + */ + popupContainer: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + container: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + /** + * 弹层组件style,透传给Popup + */ + popupStyle: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 弹层组件className,透传给Popup + */ + popupClassName: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 弹层组件属性,透传给Popup + */ + popupProps: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 是否跟随滚动 + */ + followTrigger: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层id, 传入值才会支持无障碍 + */ + id: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string +}, _class.defaultProps = { + prefix: 'next-', + pure: false, + type: 'normal', + closable: true, + defaultVisible: false, + size: 'medium', + alignEdge: false, + align: 'b', + offset: [0, 0], + trigger: react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement('span', null), + onClose: noop, + afterClose: noop, + onVisibleChange: noop, + needAdjust: false, + triggerType: 'hover', + safeNode: undefined, + safeId: null, + autoFocus: true, + animation: { + in: 'zoomIn', + out: 'zoomOut' + }, + cache: false, + popupStyle: {}, + popupClassName: '', + popupProps: {} +}, _temp); +Balloon.displayName = 'Balloon'; + + +/* harmony default export */ __webpack_exports__["default"] = (Object(react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_7__["polyfill"])(Balloon)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/index.js": +/*!***************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/index.js ***! + \***************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _balloon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./balloon */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/balloon.js"); +/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tooltip */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/tooltip.js"); +/* harmony import */ var _inner__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./inner */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/inner.js"); + + + + + + + +_balloon__WEBPACK_IMPORTED_MODULE_3__["default"].Tooltip = _config_provider__WEBPACK_IMPORTED_MODULE_2__["default"].config(_tooltip__WEBPACK_IMPORTED_MODULE_4__["default"], { + transform: /* istanbul ignore next */function transform(props, deprecated) { + if ('text' in props) { + deprecated('text', 'children', 'Tooltip'); + + var _props = props, + text = _props.text, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['text']); + + props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ children: text }, others); + } + + return props; + } +}); +_balloon__WEBPACK_IMPORTED_MODULE_3__["default"].Inner = _inner__WEBPACK_IMPORTED_MODULE_5__["default"]; + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_2__["default"].config(_balloon__WEBPACK_IMPORTED_MODULE_3__["default"], { + transform: /* istanbul ignore next */function transform(props, deprecated) { + if (props.alignment) { + deprecated('alignment', 'alignEdge', 'Balloon'); + + var _props2 = props, + alignment = _props2.alignment, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props2, ['alignment']); + + props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ alignEdge: alignment === 'edge' }, others); + } + if (props.onCloseClick) { + deprecated('onCloseClick', 'onVisibleChange(visible, [type = "closeClick"])', 'Balloon'); + + var _props3 = props, + onCloseClick = _props3.onCloseClick, + onVisibleChange = _props3.onVisibleChange, + _others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props3, ['onCloseClick', 'onVisibleChange']); + + var newOnVisibleChange = function newOnVisibleChange(visible, type) { + if (type === 'closeClick') { + onCloseClick(); + } + if (onVisibleChange) { + onVisibleChange(visible, type); + } + }; + props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ onVisibleChange: newOnVisibleChange }, _others); + } + + return props; + } +})); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/inner.js": +/*!***************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/inner.js ***! + \***************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../icon */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/index.js"); +/* harmony import */ var _locale_zh_cn__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../locale/zh-cn */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/locale/zh-cn.js"); +/* harmony import */ var _alignMap__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./alignMap */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/alignMap.js"); + + + + + + +var _class, _temp; + + + + + + + + + +/** + * Created by xiachi on 17/2/10. + */ + +var noop = _util__WEBPACK_IMPORTED_MODULE_8__["func"].noop; +var BalloonInner = (_temp = _class = function (_React$Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(BalloonInner, _React$Component); + + function BalloonInner() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, BalloonInner); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _React$Component.apply(this, arguments)); + } + + BalloonInner.prototype.render = function render() { + var _classNames; + + var _props = this.props, + prefix = _props.prefix, + closable = _props.closable, + className = _props.className, + style = _props.style, + isTooltip = _props.isTooltip, + align = _props.align, + type = _props.type, + onClose = _props.onClose, + alignEdge = _props.alignEdge, + children = _props.children, + rtl = _props.rtl, + locale = _props.locale, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['prefix', 'closable', 'className', 'style', 'isTooltip', 'align', 'type', 'onClose', 'alignEdge', 'children', 'rtl', 'locale']); + + var alignMap = alignEdge ? _alignMap__WEBPACK_IMPORTED_MODULE_11__["edgeMap"] : _alignMap__WEBPACK_IMPORTED_MODULE_11__["normalMap"]; + var _prefix = prefix; + + if (isTooltip) { + _prefix = _prefix + 'balloon-tooltip'; + } else { + _prefix = _prefix + 'balloon'; + } + + var classes = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classNames = {}, _classNames['' + _prefix] = true, _classNames[_prefix + '-' + type] = type, _classNames[_prefix + '-medium'] = true, _classNames[_prefix + '-' + alignMap[align].arrow] = alignMap[align], _classNames[_prefix + '-closable'] = closable, _classNames[className] = className, _classNames)); + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + role: 'tooltip', + 'aria-live': 'polite', + dir: rtl ? 'rtl' : undefined, + className: classes, + style: style + }, _util__WEBPACK_IMPORTED_MODULE_8__["obj"].pickOthers(Object.keys(BalloonInner.propTypes), others)), + children, + closable ? react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'a', + { + role: 'button', + 'aria-label': locale.close, + tabIndex: '0', + className: _prefix + '-close', + onClick: onClose + }, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_9__["default"], { type: 'close', size: 'small' }) + ) : null + ); + }; + + return BalloonInner; +}(react__WEBPACK_IMPORTED_MODULE_5___default.a.Component), _class.contextTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string +}, _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + closable: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + children: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + alignEdge: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + onClose: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + style: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + align: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + type: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + isTooltip: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + locale: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + pure: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool +}, _class.defaultProps = { + prefix: 'next-', + closable: true, + onClose: noop, + locale: _locale_zh_cn__WEBPACK_IMPORTED_MODULE_10__["default"].Balloon, + align: 'b', + type: 'normal', + alignEdge: false, + pure: false +}, _temp); +BalloonInner.displayName = 'BalloonInner'; + + +/* harmony default export */ __webpack_exports__["default"] = (BalloonInner); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/main.scss": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/main.scss ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694893029 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/style.js": +/*!***************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/style.js ***! + \***************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _animate_style_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../animate/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/style.js"); +/* harmony import */ var _overlay_style_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../overlay/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/overlay/style.js"); +/* harmony import */ var _icon_style_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../icon/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/style.js"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_3__); + + + + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/tooltip.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/tooltip.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Tooltip; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _overlay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../overlay */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/overlay/index.js"); +/* harmony import */ var _inner__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./inner */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/inner.js"); +/* harmony import */ var _alignMap__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./alignMap */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/alignMap.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/util.js"); + + + + + + +var _class, _temp; + + + + + + + + +var Popup = _overlay__WEBPACK_IMPORTED_MODULE_7__["default"].Popup; + + +var alignMap = _alignMap__WEBPACK_IMPORTED_MODULE_9__["normalMap"]; +/** Balloon.Tooltip */ +var Tooltip = (_temp = _class = function (_React$Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Tooltip, _React$Component); + + function Tooltip() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Tooltip); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _React$Component.apply(this, arguments)); + } + + Tooltip.prototype.render = function render() { + var _props = this.props, + id = _props.id, + className = _props.className, + align = _props.align, + style = _props.style, + prefix = _props.prefix, + trigger = _props.trigger, + children = _props.children, + popupContainer = _props.popupContainer, + popupProps = _props.popupProps, + popupClassName = _props.popupClassName, + popupStyle = _props.popupStyle, + followTrigger = _props.followTrigger, + triggerType = _props.triggerType, + autoFocus = _props.autoFocus, + alignEdge = _props.alignEdge, + rtl = _props.rtl, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['id', 'className', 'align', 'style', 'prefix', 'trigger', 'children', 'popupContainer', 'popupProps', 'popupClassName', 'popupStyle', 'followTrigger', 'triggerType', 'autoFocus', 'alignEdge', 'rtl']); + + var trOrigin = 'trOrigin'; + if (rtl) { + others.rtl = true; + trOrigin = 'rtlTrOrigin'; + } + + alignMap = alignEdge ? _alignMap__WEBPACK_IMPORTED_MODULE_9__["edgeMap"] : _alignMap__WEBPACK_IMPORTED_MODULE_9__["normalMap"]; + + var transformOrigin = alignMap[align][trOrigin]; + var _offset = alignMap[align].offset; + var _style = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ transformOrigin: transformOrigin }, style); + + var content = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + _inner__WEBPACK_IMPORTED_MODULE_8__["default"], + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { + id: id, + prefix: prefix, + closable: false, + isTooltip: true, + className: className, + style: _style, + align: align, + rtl: rtl, + alignEdge: alignEdge + }), + children + ); + + var triggerProps = {}; + triggerProps['aria-describedby'] = id; + triggerProps.tabIndex = '0'; + + var newTriggerType = triggerType; + + if (triggerType === 'hover' && id) { + newTriggerType = ['focus', 'hover']; + } + + var ariaTrigger = id ? react__WEBPACK_IMPORTED_MODULE_5___default.a.cloneElement(trigger, triggerProps) : trigger; + + var newTrigger = Object(_util__WEBPACK_IMPORTED_MODULE_10__["getDisabledCompatibleTrigger"])(react__WEBPACK_IMPORTED_MODULE_5___default.a.isValidElement(ariaTrigger) ? ariaTrigger : react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'span', + null, + ariaTrigger + )); + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + Popup, + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + role: 'tooltip', + container: popupContainer, + followTrigger: followTrigger, + trigger: newTrigger, + triggerType: newTriggerType, + align: alignMap[align].align, + offset: _offset, + delay: 0, + className: popupClassName, + style: popupStyle, + rtl: rtl, + autoFocus: triggerType === 'focus' ? false : autoFocus, + shouldUpdatePosition: true, + needAdjust: false + }, popupProps), + content + ); + }; + + return Tooltip; +}(react__WEBPACK_IMPORTED_MODULE_5___default.a.Component), _class.propTypes = { + /** + * 样式类名的品牌前缀 + */ + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 自定义类名 + */ + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 自定义内联样式 + */ + style: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * tooltip的内容 + */ + children: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + /** + * 弹出层位置 + * @enumdesc 上, 右, 下, 左, 上左, 上右, 下左, 下右, 左上, 左下, 右上, 右下 及其 两两组合 + */ + align: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['t', 'r', 'b', 'l', 'tl', 'tr', 'bl', 'br', 'lt', 'lb', 'rt', 'rb']), + /** + * 触发元素 + */ + trigger: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + /** + * 触发行为 + * 鼠标悬浮, 鼠标点击('hover', 'click')或者它们组成的数组,如 ['hover', 'click'], 强烈不建议使用'focus',若有复杂交互,推荐使用triggerType为click的Balloon组件 + */ + triggerType: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.array]), + /** + * 弹层组件style,透传给Popup + */ + popupStyle: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 弹层组件className,透传给Popup + */ + popupClassName: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 弹层组件属性,透传给Popup + */ + popupProps: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 是否pure render + */ + pure: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 指定浮层渲染的父节点, 可以为节点id的字符串,也可以返回节点的函数。 + */ + popupContainer: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + /** + * 是否跟随滚动 + */ + followTrigger: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层id, 传入值才会支持无障碍 + */ + id: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string +}, _class.defaultProps = { + triggerType: 'hover', + prefix: 'next-', + align: 'b', + trigger: react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement('span', null) +}, _temp); +Tooltip.displayName = 'Tooltip'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/util.js": +/*!**************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/balloon/util.js ***! + \**************************************************************************/ +/*! exports provided: getDisabledCompatibleTrigger */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDisabledCompatibleTrigger", function() { return getDisabledCompatibleTrigger; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); + + + +function getDisabledCompatibleTrigger(element) { + if (element.type.displayName === 'Config(Button)' && element.props.disabled) { + var displayStyle = element.props.style && element.props.style.display ? element.props.style.display : 'inline-block'; + var child = react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(element, { + style: babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, element.props.style, { + pointerEvents: 'none' + }) + }); + return ( + // eslint-disable-next-line + react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement( + 'span', + { style: { display: displayStyle, cursor: 'not-allowed' } }, + child + ) + ); + } + return element; +} + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/breadcrumb/index.js": +/*!******************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/breadcrumb/index.js ***! + \******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-lifecycles-compat */ "./node_modules/_react-lifecycles-compat@3.0.4@react-lifecycles-compat/react-lifecycles-compat.es.js"); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../icon */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/index.js"); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./item */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/breadcrumb/item.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); + + + + + + +var _class, _temp, _initialiseProps; + + + + + + + + + +/** + * Breadcrumb + */ +var Breadcrumb = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Breadcrumb, _Component); + + function Breadcrumb(props) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Breadcrumb); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.call(this, props)); + + _initialiseProps.call(_this); + + _this.state = { + maxNode: props.maxNode === 'auto' ? 100 : props.maxNode + }; + return _this; + } + + Breadcrumb.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) { + if (state.prevMaxNode === props.maxNode) { + return {}; + } + + return { + prevMaxNode: props.maxNode, + maxNode: props.maxNode === 'auto' ? 100 : props.maxNode + }; + }; + + Breadcrumb.prototype.componentDidMount = function componentDidMount() { + this.computeMaxNode(); + _util__WEBPACK_IMPORTED_MODULE_11__["events"].on(window, 'resize', this.computeMaxNode); + }; + + Breadcrumb.prototype.componentDidUpdate = function componentDidUpdate() { + this.computeMaxNode(); + }; + + Breadcrumb.prototype.componentWillUnmount = function componentWillUnmount() { + _util__WEBPACK_IMPORTED_MODULE_11__["events"].off(window, 'resize', this.computeMaxNode); + }; + + Breadcrumb.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + rtl = _props.rtl, + className = _props.className, + children = _props.children, + separator = _props.separator, + component = _props.component, + maxNodeProp = _props.maxNode, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['prefix', 'rtl', 'className', 'children', 'separator', 'component', 'maxNode']); + + var maxNode = this.state.maxNode; + + + var items = void 0; + var length = react__WEBPACK_IMPORTED_MODULE_5__["Children"].count(children); + + if (maxNode > 1 && length > maxNode) { + var breakpointer = length - maxNode + 1; + items = []; + + react__WEBPACK_IMPORTED_MODULE_5__["Children"].forEach(children, function (item, i) { + var ariaProps = {}; + + if (i === length - 1) { + ariaProps['aria-current'] = 'page'; + } + + if (i && i === breakpointer) { + items.push(react__WEBPACK_IMPORTED_MODULE_5___default.a.cloneElement(item, babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + separator: separator, + prefix: prefix, + key: i, + activated: i === length - 1 + }, ariaProps, { + className: prefix + 'breadcrumb-text-ellipsis' + }), '...')); + } else if (!i || i > breakpointer) { + items.push(react__WEBPACK_IMPORTED_MODULE_5___default.a.cloneElement(item, babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + separator: separator, + prefix: prefix, + key: i + }, ariaProps, { + activated: i === length - 1 + }))); + } + }); + } else { + items = react__WEBPACK_IMPORTED_MODULE_5__["Children"].map(children, function (item, i) { + var ariaProps = {}; + + if (i === length - 1) { + ariaProps['aria-current'] = 'page'; + } + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.cloneElement(item, babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + separator: separator, + prefix: prefix, + activated: i === length - 1 + }, ariaProps, { + key: i + })); + }); + } + + if (rtl) { + others.dir = 'rtl'; + } + + var BreadcrumbComponent = component; + + delete others.maxNode; + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + BreadcrumbComponent, + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + 'aria-label': 'Breadcrumb', + className: className + }, others, { + style: babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ position: 'relative' }, others.style || {}) + }), + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'ul', + { className: prefix + 'breadcrumb' }, + items + ), + maxNodeProp === 'auto' ? react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'ul', + { + style: { + position: 'absolute', + left: 0, + right: 0, + top: 0, + visibility: 'hidden' + }, + ref: this.saveBreadcrumbRef, + className: prefix + 'breadcrumb' + }, + react__WEBPACK_IMPORTED_MODULE_5__["Children"].map(children, function (item, i) { + return react__WEBPACK_IMPORTED_MODULE_5___default.a.cloneElement(item, { + separator: separator, + prefix: prefix, + activated: i === length - 1, + key: i + }); + }) + ) : null + ); + }; + + return Breadcrumb; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.Item = _item__WEBPACK_IMPORTED_MODULE_10__["default"], _class.propTypes = { + /** + * 样式类名的品牌前缀 + */ + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /*eslint-disable*/ + /** + * 面包屑子节点,需传入 Breadcrumb.Item + */ + children: function children(props, propName) { + react__WEBPACK_IMPORTED_MODULE_5__["Children"].forEach(props[propName], function (child) { + if (!(child && typeof child.type === 'function' && child.type._typeMark === 'breadcrumb_item')) { + throw new Error("Breadcrumb's children must be Breadcrumb.Item!"); + } + }); + }, + /*eslint-enable*/ + /** + * 面包屑最多显示个数,超出部分会被隐藏, 设置为 auto 会自动根据父元素的宽度适配。 + */ + maxNode: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['auto'])]), + /** + * 分隔符,可以是文本或 Icon + */ + separator: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node, + /** + * 设置标签类型 + */ + component: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func]), + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any +}, _class.defaultProps = { + prefix: 'next-', + maxNode: 100, + separator: react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_8__["default"], { type: 'arrow-right' }), + component: 'nav' +}, _initialiseProps = function _initialiseProps() { + var _this2 = this; + + this.computeMaxNode = function () { + // 计算最大node节点,无法获取到 ... 节点的宽度,目前会有 nodeWidth - ellipsisNodeWidth 的误差 + if (_this2.props.maxNode !== 'auto' || !_this2.breadcrumbEl) return; + var scrollWidth = _this2.breadcrumbEl.scrollWidth; + var rect = _this2.breadcrumbEl.getBoundingClientRect(); + + if (scrollWidth <= rect.width) return; + var maxNode = _this2.breadcrumbEl.children.length; + var index = 1; + var fullWidth = scrollWidth; + + while (index < _this2.breadcrumbEl.children.length - 1) { + var el = _this2.breadcrumbEl.children[index]; + maxNode--; + fullWidth -= el.getBoundingClientRect().width; + if (fullWidth <= rect.width) { + break; + } + index++; + } + + maxNode = Math.max(3, maxNode); + + if (maxNode !== _this2.state.maxNode) { + _this2.setState({ + maxNode: maxNode + }); + } + }; + + this.saveBreadcrumbRef = function (ref) { + _this2.breadcrumbEl = ref; + }; +}, _temp); +Breadcrumb.displayName = 'Breadcrumb'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_9__["default"].config(Object(react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_7__["polyfill"])(Breadcrumb))); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/breadcrumb/item.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/breadcrumb/item.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); + + + + + + +var _class, _temp; + + + + + + +/** + * Breadcrumb.Item + */ +var Item = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Item, _Component); + + function Item() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Item); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.apply(this, arguments)); + } + + // stateless separator component + Item.Separator = function Separator(_ref) { + var prefix = _ref.prefix, + children = _ref.children; + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'span', + { className: prefix + 'breadcrumb-separator' }, + children + ); + }; + + Item.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + rtl = _props.rtl, + className = _props.className, + children = _props.children, + link = _props.link, + activated = _props.activated, + separator = _props.separator, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['prefix', 'rtl', 'className', 'children', 'link', 'activated', 'separator']); + + var clazz = classnames__WEBPACK_IMPORTED_MODULE_7___default()(prefix + 'breadcrumb-text', className, { + activated: activated + }); + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'li', + { dir: rtl ? 'rtl' : null, className: prefix + 'breadcrumb-item' }, + link ? react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'a', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ href: link, className: clazz }, others), + children + ) : react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'span', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ className: clazz }, others), + children + ), + activated ? null : Item.Separator({ prefix: prefix, children: separator }) + ); + }; + + return Item; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 面包屑节点链接,如果设置这个属性,则该节点为`` ,否则是`` + */ + link: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + activated: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + separator: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + children: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node +}, _class.defaultProps = { + prefix: 'next-' +}, _class._typeMark = 'breadcrumb_item', _temp); +Item.displayName = 'Item'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_8__["default"].config(Item)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/breadcrumb/main.scss": +/*!*******************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/breadcrumb/main.scss ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694895028 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/breadcrumb/style.js": +/*!******************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/breadcrumb/style.js ***! + \******************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _icon_style_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../icon/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/style.js"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/breadcrumb/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_1__); + + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/index.js": +/*!**************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/index.js ***! + \**************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _view_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./view/button */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/view/button.js"); +/* harmony import */ var _view_group__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./view/group */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/view/group.js"); + + + + + + +_view_button__WEBPACK_IMPORTED_MODULE_3__["default"].Group = _view_group__WEBPACK_IMPORTED_MODULE_4__["default"]; + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_2__["default"].config(_view_button__WEBPACK_IMPORTED_MODULE_3__["default"], { + transform: /* istanbul ignore next */function transform(props, deprecated) { + if ('shape' in props) { + deprecated('shape', 'text | warning | ghost', 'Button'); + + var _props = props, + shape = _props.shape, + type = _props.type, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['shape', 'type']); + + var newType = type; + if (type === 'light' || type === 'dark' || type === 'secondary' && shape === 'warning') { + newType = 'normal'; + } + + var ghost = void 0; + if (shape === 'ghost') { + ghost = { + primary: 'dark', + secondary: 'dark', + normal: 'light', + dark: 'dark', + light: 'light' + }[type || _view_button__WEBPACK_IMPORTED_MODULE_3__["default"].defaultProps.type]; + } + + var text = shape === 'text'; + var warning = shape === 'warning'; + + props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ type: newType, ghost: ghost, text: text, warning: warning }, others); + } + + return props; + } +})); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/main.scss": +/*!***************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/main.scss ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694892388 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/style.js": +/*!**************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/style.js ***! + \**************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _icon_style_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../icon/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/style.js"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_1__); + + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/view/button.js": +/*!********************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/view/button.js ***! + \********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Button; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); + + + + + + +var _class, _temp2; + + + + + + + +function mapIconSize(size) { + return { + large: 'small', + medium: 'xs', + small: 'xs' + }[size]; +} + +/** Button */ +var Button = (_temp2 = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Button, _Component); + + function Button() { + var _temp, _this, _ret; + + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Button); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onMouseUp = function (e) { + _this.button.blur(); + + if (_this.props.onMouseUp) { + _this.props.onMouseUp(e); + } + }, _this.buttonRefHandler = function (button) { + _this.button = button; + }, _temp), babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(_this, _ret); + } + + Button.prototype.render = function render() { + var _classNames; + + var _props = this.props, + prefix = _props.prefix, + className = _props.className, + type = _props.type, + size = _props.size, + htmlType = _props.htmlType, + loading = _props.loading, + text = _props.text, + warning = _props.warning, + ghost = _props.ghost, + component = _props.component, + iconSize = _props.iconSize, + disabled = _props.disabled, + onClick = _props.onClick, + children = _props.children, + rtl = _props.rtl, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['prefix', 'className', 'type', 'size', 'htmlType', 'loading', 'text', 'warning', 'ghost', 'component', 'iconSize', 'disabled', 'onClick', 'children', 'rtl']); + + var ghostType = ['light', 'dark'].indexOf(ghost) >= 0 ? ghost : 'dark'; + + var btnCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classNames = {}, _classNames[prefix + 'btn'] = true, _classNames['' + prefix + size] = size, _classNames[prefix + 'btn-' + type] = type && !ghost, _classNames[prefix + 'btn-text'] = text, _classNames[prefix + 'btn-warning'] = warning, _classNames[prefix + 'btn-loading'] = loading, _classNames[prefix + 'btn-ghost'] = ghost, _classNames[prefix + 'btn-' + ghostType] = ghost, _classNames[className] = className, _classNames)); + + var count = react__WEBPACK_IMPORTED_MODULE_5__["Children"].count(children); + var clonedChildren = react__WEBPACK_IMPORTED_MODULE_5__["Children"].map(children, function (child, index) { + if (child && typeof child.type === 'function' && child.type._typeMark === 'icon') { + var _classNames2; + + var iconCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classNames2 = {}, _classNames2[prefix + 'btn-icon'] = !iconSize, _classNames2[prefix + 'icon-first'] = count > 1 && index === 0, _classNames2[prefix + 'icon-last'] = count > 1 && index === count - 1, _classNames2[prefix + 'icon-alone'] = count === 1, _classNames2[child.props.className] = !!child.props.className, _classNames2)); + + if ('size' in child.props) { + _util__WEBPACK_IMPORTED_MODULE_9__["log"].warning('The size of Icon will not take effect, when Icon is the [direct child element] of Button(), use instead of.'); + } + return react__WEBPACK_IMPORTED_MODULE_5___default.a.cloneElement(child, { + className: iconCls, + size: iconSize || mapIconSize(size) + }); + } + + if (!Object(react__WEBPACK_IMPORTED_MODULE_5__["isValidElement"])(child)) { + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'span', + null, + child + ); + } + + return child; + }); + + var TagName = component; + var tagAttrs = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _util__WEBPACK_IMPORTED_MODULE_9__["obj"].pickOthers(Object.keys(Button.propTypes), others), { + type: htmlType, + disabled: disabled, + onClick: onClick, + className: btnCls + }); + + if (TagName !== 'button') { + delete tagAttrs.type; + + if (tagAttrs.disabled) { + delete tagAttrs.onClick; // a 标签的 onClick 浏览器默认不会禁用 + tagAttrs.href && delete tagAttrs.href; // a 标签在禁用状态下无跳转 + } + } + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + TagName, + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, tagAttrs, { + dir: rtl ? 'rtl' : undefined, + onMouseUp: this.onMouseUp, + ref: this.buttonRefHandler + }), + clonedChildren + ); + }; + + return Button; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _config_provider__WEBPACK_IMPORTED_MODULE_8__["default"].propTypes, { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 按钮的类型 + */ + type: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['primary', 'secondary', 'normal']), + /** + * 按钮的尺寸 + */ + size: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['small', 'medium', 'large']), + /** + * 按钮中 Icon 的尺寸,用于替代 Icon 的默认大小 + */ + iconSize: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['xxs', 'xs', 'small', 'medium', 'large', 'xl', 'xxl', 'xxxl']), + /** + * 当 component = 'button' 时,设置 button 标签的 type 值 + */ + htmlType: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['submit', 'reset', 'button']), + /** + * 设置标签类型 + */ + component: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['button', 'a', 'div', 'span']), + /** + * 设置按钮的载入状态 + */ + loading: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 是否为幽灵按钮 + */ + ghost: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf([true, false, 'light', 'dark']), + /** + * 是否为文本按钮 + */ + text: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 是否为警告按钮 + */ + warning: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 是否禁用 + */ + disabled: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 点击按钮的回调 + * @param {Object} e Event Object + */ + onClick: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + onMouseUp: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + children: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node +}), _class.defaultProps = { + prefix: 'next-', + type: 'normal', + size: 'medium', + htmlType: 'button', + component: 'button', + loading: false, + ghost: false, + text: false, + warning: false, + disabled: false, + onClick: function onClick() {} +}, _temp2); +Button.displayName = 'Button'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/view/group.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/view/group.js ***! + \*******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); + + + + + + +var _class, _temp; + + + + + + +/** + * Button.Group + */ +var ButtonGroup = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(ButtonGroup, _Component); + + function ButtonGroup() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, ButtonGroup); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.apply(this, arguments)); + } + + ButtonGroup.prototype.render = function render() { + var _classNames; + + var _props = this.props, + prefix = _props.prefix, + className = _props.className, + size = _props.size, + children = _props.children, + rtl = _props.rtl, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['prefix', 'className', 'size', 'children', 'rtl']); + + var groupCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classNames = {}, _classNames[prefix + 'btn-group'] = true, _classNames[className] = className, _classNames)); + + var cloneChildren = react__WEBPACK_IMPORTED_MODULE_5__["Children"].map(children, function (child) { + if (child) { + return react__WEBPACK_IMPORTED_MODULE_5___default.a.cloneElement(child, { + size: size + }); + } + }); + + if (rtl) { + others.dir = 'rtl'; + } + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { className: groupCls }), + cloneChildren + ); + }; + + return ButtonGroup; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _config_provider__WEBPACK_IMPORTED_MODULE_8__["default"].propTypes, { + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 统一设置 Button 组件的按钮大小 + */ + size: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + children: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node +}), _class.defaultProps = { + prefix: 'next-', + size: 'medium' +}, _temp); +ButtonGroup.displayName = 'ButtonGroup'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_8__["default"].config(ButtonGroup)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/calendar.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/calendar.js ***! + \*******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! moment */ "./node_modules/_moment@2.24.0@moment/moment.js"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _locale_zh_cn__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../locale/zh-cn */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/locale/zh-cn.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _head_card_header__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./head/card-header */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/card-header.js"); +/* harmony import */ var _head_date_panel_header__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./head/date-panel-header */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/date-panel-header.js"); +/* harmony import */ var _head_month_panel_header__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./head/month-panel-header */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/month-panel-header.js"); +/* harmony import */ var _head_year_panel_header__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./head/year-panel-header */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/year-panel-header.js"); +/* harmony import */ var _table_date_table__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./table/date-table */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/date-table.js"); +/* harmony import */ var _table_month_table__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./table/month-table */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/month-table.js"); +/* harmony import */ var _table_year_table__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./table/year-table */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/year-table.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./utils */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/utils/index.js"); + + + + + + +var _class, _temp, _initialiseProps; + + + + + + + + + + + + + + + + + +/** Calendar */ +var Calendar = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Calendar, _Component); + + function Calendar(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Calendar); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.call(this, props, context)); + + _initialiseProps.call(_this); + + var value = Object(_utils__WEBPACK_IMPORTED_MODULE_19__["formatDateValue"])(props.value || props.defaultValue); + var visibleMonth = Object(_utils__WEBPACK_IMPORTED_MODULE_19__["getVisibleMonth"])(props.defaultVisibleMonth, value); + + _this.MODES = props.modes; + _this.today = moment__WEBPACK_IMPORTED_MODULE_7___default()(); + _this.state = { + value: value, + mode: props.mode || _this.MODES[0], + visibleMonth: visibleMonth + }; + return _this; + } + + Calendar.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if ('value' in nextProps) { + var value = Object(_utils__WEBPACK_IMPORTED_MODULE_19__["formatDateValue"])(nextProps.value); + this.setState({ + value: value + }); + + if (value) { + this.setState({ + visibleMonth: value + }); + } + } + + if (nextProps.mode && this.MODES.indexOf(nextProps.mode) > -1) { + this.setState({ + mode: nextProps.mode + }); + } + }; + + /** + * 根据日期偏移量设置当前展示的月份 + * @param {Number} offset 日期偏移的数量 + * @param {String} type 日期偏移的类型 days, months, years + */ + Calendar.prototype.changeVisibleMonthByOffset = function changeVisibleMonthByOffset(offset, type) { + var cloneValue = this.state.visibleMonth.clone(); + cloneValue.add(offset, type); + this.changeVisibleMonth(cloneValue, 'buttonClick'); + }; + + Calendar.prototype.render = function render() { + var _classnames, _tables, _panelHeaders; + + var _props = this.props, + prefix = _props.prefix, + rtl = _props.rtl, + className = _props.className, + shape = _props.shape, + showOtherMonth = _props.showOtherMonth, + format = _props.format, + locale = _props.locale, + dateCellRender = _props.dateCellRender, + monthCellRender = _props.monthCellRender, + yearCellRender = _props.yearCellRender, + disabledDate = _props.disabledDate, + yearRange = _props.yearRange, + disableChangeMode = _props.disableChangeMode, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['prefix', 'rtl', 'className', 'shape', 'showOtherMonth', 'format', 'locale', 'dateCellRender', 'monthCellRender', 'yearCellRender', 'disabledDate', 'yearRange', 'disableChangeMode']); + + var state = this.state; + + var classNames = classnames__WEBPACK_IMPORTED_MODULE_8___default()((_classnames = {}, _classnames[prefix + 'calendar'] = true, _classnames[prefix + 'calendar-' + shape] = shape, _classnames), className); + + if (rtl) { + others.dir = 'rtl'; + } + + var visibleMonth = state.visibleMonth; + + // reset moment locale + if (locale.momentLocale) { + state.value && state.value.locale(locale.momentLocale); + visibleMonth.locale(locale.momentLocale); + } + + var localeData = Object(_utils__WEBPACK_IMPORTED_MODULE_19__["getLocaleData"])(locale.format || {}, visibleMonth.localeData()); + + var headerProps = { + prefix: prefix, + value: state.value, + mode: state.mode, + disableChangeMode: disableChangeMode, + yearRange: yearRange, + locale: locale, + rtl: rtl, + visibleMonth: visibleMonth, + momentLocale: localeData, + changeMode: this.changeMode, + changeVisibleMonth: this.changeVisibleMonth, + goNextDecade: this.goNextDecade, + goNextYear: this.goNextYear, + goNextMonth: this.goNextMonth, + goPrevDecade: this.goPrevDecade, + goPrevYear: this.goPrevYear, + goPrevMonth: this.goPrevMonth + }; + + var tableProps = { + prefix: prefix, + visibleMonth: visibleMonth, + showOtherMonth: showOtherMonth, + value: state.value, + mode: state.mode, + locale: locale, + dateCellRender: dateCellRender, + monthCellRender: monthCellRender, + yearCellRender: yearCellRender, + disabledDate: disabledDate, + momentLocale: localeData, + today: this.today, + goPrevDecade: this.goPrevDecade, + goNextDecade: this.goNextDecade + }; + + var tables = (_tables = {}, _tables[_utils__WEBPACK_IMPORTED_MODULE_19__["CALENDAR_MODE_DATE"]] = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_table_date_table__WEBPACK_IMPORTED_MODULE_16__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + format: format + }, tableProps, { + onSelectDate: this.onSelectCell + })), _tables[_utils__WEBPACK_IMPORTED_MODULE_19__["CALENDAR_MODE_MONTH"]] = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_table_month_table__WEBPACK_IMPORTED_MODULE_17__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, tableProps, { onSelectMonth: this.onSelectCell })), _tables[_utils__WEBPACK_IMPORTED_MODULE_19__["CALENDAR_MODE_YEAR"]] = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_table_year_table__WEBPACK_IMPORTED_MODULE_18__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, tableProps, { + rtl: rtl, + onSelectYear: this.onSelectCell + })), _tables); + + var panelHeaders = (_panelHeaders = {}, _panelHeaders[_utils__WEBPACK_IMPORTED_MODULE_19__["CALENDAR_MODE_DATE"]] = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_head_date_panel_header__WEBPACK_IMPORTED_MODULE_13__["default"], headerProps), _panelHeaders[_utils__WEBPACK_IMPORTED_MODULE_19__["CALENDAR_MODE_MONTH"]] = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_head_month_panel_header__WEBPACK_IMPORTED_MODULE_14__["default"], headerProps), _panelHeaders[_utils__WEBPACK_IMPORTED_MODULE_19__["CALENDAR_MODE_YEAR"]] = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_head_year_panel_header__WEBPACK_IMPORTED_MODULE_15__["default"], headerProps), _panelHeaders); + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _util__WEBPACK_IMPORTED_MODULE_11__["obj"].pickOthers(Calendar.propTypes, others), { + className: classNames + }), + shape === 'panel' ? panelHeaders[state.mode] : react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_head_card_header__WEBPACK_IMPORTED_MODULE_12__["default"], headerProps), + tables[state.mode] + ); + }; + + return Calendar; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _config_provider__WEBPACK_IMPORTED_MODULE_9__["default"].propTypes, { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 默认选中的日期(moment 对象) + */ + defaultValue: _utils__WEBPACK_IMPORTED_MODULE_19__["checkMomentObj"], + /** + * 选中的日期值 (moment 对象) + */ + value: _utils__WEBPACK_IMPORTED_MODULE_19__["checkMomentObj"], + /** + * 面板模式 + */ + mode: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(_utils__WEBPACK_IMPORTED_MODULE_19__["CALENDAR_MODES"]), // 生成 API 文档需要手动改回 ['date', 'month', 'year'] + // 面板可变化的模式列表,仅初始化时接收一次 + modes: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.array, + // 禁用更改面板模式,采用 dropdown 的方式切换显示日期 (暂不正式对外透出) + disableChangeMode: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + // 日期值的格式(用于日期title显示的格式) + format: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 是否展示非本月的日期 + */ + showOtherMonth: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 默认展示的月份 + */ + defaultVisibleMonth: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 展现形态 + */ + shape: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['card', 'fullscreen', 'panel']), + /** + * 选择日期单元格时的回调 + * @param {Object} value 对应的日期值 (moment 对象) + */ + onSelect: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 面板模式变化时的回调 + * @param {String} mode 对应面板模式 date month year + */ + onModeChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 展现的月份变化时的回调 + * @param {Object} value 显示的月份 (moment 对象) + * @param {String} reason 触发月份改变原因 + */ + onVisibleMonthChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 自定义样式类 + */ + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 自定义日期渲染函数 + * @param {Object} value 日期值(moment对象) + * @returns {ReactNode} + */ + dateCellRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 自定义月份渲染函数 + * @param {Object} calendarDate 对应 Calendar 返回的自定义日期对象 + * @returns {ReactNode} + */ + monthCellRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + yearCellRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, // 兼容 0.x yearCellRender + /** + * 年份范围,[START_YEAR, END_YEAR] (只在shape 为 ‘card’, 'fullscreen' 下生效) + */ + yearRange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.number), + /** + * 不可选择的日期 + * @param {Object} calendarDate 对应 Calendar 返回的自定义日期对象 + * @param {String} view 当前视图类型,year: 年, month: 月, date: 日 + * @returns {Boolean} + */ + disabledDate: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 国际化配置 + */ + locale: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object +}), _class.defaultProps = { + prefix: 'next-', + rtl: false, + shape: 'fullscreen', + modes: _utils__WEBPACK_IMPORTED_MODULE_19__["CALENDAR_MODES"], + disableChangeMode: false, + format: 'YYYY-MM-DD', + onSelect: _util__WEBPACK_IMPORTED_MODULE_11__["func"].noop, + onVisibleMonthChange: _util__WEBPACK_IMPORTED_MODULE_11__["func"].noop, + onModeChange: _util__WEBPACK_IMPORTED_MODULE_11__["func"].noop, + dateCellRender: function dateCellRender(value) { + return value.date(); + }, + locale: _locale_zh_cn__WEBPACK_IMPORTED_MODULE_10__["default"].Calendar, + showOtherMonth: true +}, _initialiseProps = function _initialiseProps() { + var _this2 = this; + + this.onSelectCell = function (date, nextMode) { + var shape = _this2.props.shape; + + + _this2.changeVisibleMonth(date, 'cellClick'); + + // 当用户所在的面板为初始化面板时,则选择动作为触发 onSelect 回调 + if (_this2.state.mode === _this2.MODES[0]) { + _this2.props.onSelect(date); + } + + if (shape === 'panel') { + _this2.changeMode(nextMode); + } + }; + + this.changeMode = function (nextMode) { + if (nextMode && _this2.MODES.indexOf(nextMode) > -1 && nextMode !== _this2.state.mode) { + _this2.setState({ mode: nextMode }); + _this2.props.onModeChange(nextMode); + } + }; + + this.changeVisibleMonth = function (date, reason) { + if (!Object(_utils__WEBPACK_IMPORTED_MODULE_19__["isSameYearMonth"])(date, _this2.state.visibleMonth)) { + _this2.setState({ visibleMonth: date }); + _this2.props.onVisibleMonthChange(date, reason); + } + }; + + this.goPrevDecade = function () { + _this2.changeVisibleMonthByOffset(-10, 'years'); + }; + + this.goNextDecade = function () { + _this2.changeVisibleMonthByOffset(10, 'years'); + }; + + this.goPrevYear = function () { + _this2.changeVisibleMonthByOffset(-1, 'years'); + }; + + this.goNextYear = function () { + _this2.changeVisibleMonthByOffset(1, 'years'); + }; + + this.goPrevMonth = function () { + _this2.changeVisibleMonthByOffset(-1, 'months'); + }; + + this.goNextMonth = function () { + _this2.changeVisibleMonthByOffset(1, 'months'); + }; +}, _temp); +Calendar.displayName = 'Calendar'; + + +/* harmony default export */ __webpack_exports__["default"] = (Calendar); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/card-header.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/card-header.js ***! + \***************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../select */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/select/index.js"); +/* harmony import */ var _radio__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../radio */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/radio/index.js"); + + + + +var _class, _temp2; + + + + + + +var CardHeader = (_temp2 = _class = function (_React$PureComponent) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(CardHeader, _React$PureComponent); + + function CardHeader() { + var _temp, _this, _ret; + + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CardHeader); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(this, _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args))), _this), _this.selectContainerHandler = function (target) { + return target.parentNode; + }, _this.onYearChange = function (year) { + var _this$props = _this.props, + visibleMonth = _this$props.visibleMonth, + changeVisibleMonth = _this$props.changeVisibleMonth; + + changeVisibleMonth(visibleMonth.clone().year(year), 'yearSelect'); + }, _this.changeVisibleMonth = function (month) { + var _this$props2 = _this.props, + visibleMonth = _this$props2.visibleMonth, + changeVisibleMonth = _this$props2.changeVisibleMonth; + + changeVisibleMonth(visibleMonth.clone().month(month), 'monthSelect'); + }, _this.onModePanelChange = function (mode) { + _this.props.changeMode(mode); + }, _temp), babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(_this, _ret); + } + + CardHeader.prototype.getYearSelect = function getYearSelect(year) { + var _props = this.props, + prefix = _props.prefix, + yearRangeOffset = _props.yearRangeOffset, + _props$yearRange = _props.yearRange, + yearRange = _props$yearRange === undefined ? [] : _props$yearRange, + locale = _props.locale; + var startYear = yearRange[0], + endYear = yearRange[1]; + + if (!startYear || !endYear) { + startYear = year - yearRangeOffset; + endYear = year + yearRangeOffset; + } + + var options = []; + for (var i = startYear; i <= endYear; i++) { + options.push(react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + _select__WEBPACK_IMPORTED_MODULE_5__["default"].Option, + { key: i, value: i }, + i + )); + } + + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + _select__WEBPACK_IMPORTED_MODULE_5__["default"], + { + prefix: prefix, + value: year, + 'aria-label': locale.yearSelectAriaLabel, + onChange: this.onYearChange, + popupContainer: this.selectContainerHandler + }, + options + ); + }; + + CardHeader.prototype.getMonthSelect = function getMonthSelect(month) { + var _props2 = this.props, + prefix = _props2.prefix, + momentLocale = _props2.momentLocale, + locale = _props2.locale; + + var localeMonths = momentLocale.monthsShort(); + var options = []; + for (var i = 0; i < 12; i++) { + options.push(react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + _select__WEBPACK_IMPORTED_MODULE_5__["default"].Option, + { key: i, value: i }, + localeMonths[i] + )); + } + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + _select__WEBPACK_IMPORTED_MODULE_5__["default"], + { + 'aria-label': locale.monthSelectAriaLabel, + prefix: prefix, + value: month, + onChange: this.changeVisibleMonth, + popupContainer: this.selectContainerHandler + }, + options + ); + }; + + CardHeader.prototype.render = function render() { + var _props3 = this.props, + prefix = _props3.prefix, + mode = _props3.mode, + locale = _props3.locale, + visibleMonth = _props3.visibleMonth; + + + var yearSelect = this.getYearSelect(visibleMonth.year()); + var monthSelect = mode === 'month' ? null : this.getMonthSelect(visibleMonth.month()); + var panelSelect = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + _radio__WEBPACK_IMPORTED_MODULE_6__["default"].Group, + { + shape: 'button', + size: 'medium', + value: mode, + onChange: this.onModePanelChange + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + _radio__WEBPACK_IMPORTED_MODULE_6__["default"], + { value: 'date' }, + locale.month + ), + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + _radio__WEBPACK_IMPORTED_MODULE_6__["default"], + { value: 'month' }, + locale.year + ) + ); + + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'calendar-header' }, + yearSelect, + monthSelect, + panelSelect + ); + }; + + return CardHeader; +}(react__WEBPACK_IMPORTED_MODULE_3___default.a.PureComponent), _class.propTypes = { + yearRange: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.number), + yearRangeOffset: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.number, + locale: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.object +}, _class.defaultProps = { + yearRangeOffset: 10 +}, _temp2); + + +/* harmony default export */ __webpack_exports__["default"] = (CardHeader); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/date-panel-header.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/date-panel-header.js ***! + \*********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../icon */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/index.js"); +/* harmony import */ var _dropdown__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../dropdown */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dropdown/index.js"); +/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./menu */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/menu.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/utils/index.js"); + + + + +var _class, _temp2; + +/* istanbul ignore file */ + + + + + + +/* eslint-disable */ +var DatePanelHeader = (_temp2 = _class = function (_React$PureComponent) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(DatePanelHeader, _React$PureComponent); + + function DatePanelHeader() { + var _temp, _this, _ret; + + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, DatePanelHeader); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(this, _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args))), _this), _this.selectContainerHandler = function (target) { + return target.parentNode; + }, _this.onYearChange = function (year) { + var _this$props = _this.props, + visibleMonth = _this$props.visibleMonth, + changeVisibleMonth = _this$props.changeVisibleMonth; + + changeVisibleMonth(visibleMonth.clone().year(year), 'yearSelect'); + }, _this.changeVisibleMonth = function (month) { + var _this$props2 = _this.props, + visibleMonth = _this$props2.visibleMonth, + changeVisibleMonth = _this$props2.changeVisibleMonth; + + changeVisibleMonth(visibleMonth.clone().month(month), 'monthSelect'); + }, _temp), babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(_this, _ret); + } + + DatePanelHeader.prototype.render = function render() { + var _this2 = this; + + var _props = this.props, + prefix = _props.prefix, + visibleMonth = _props.visibleMonth, + momentLocale = _props.momentLocale, + locale = _props.locale, + changeMode = _props.changeMode, + goNextMonth = _props.goNextMonth, + goNextYear = _props.goNextYear, + goPrevMonth = _props.goPrevMonth, + goPrevYear = _props.goPrevYear, + disableChangeMode = _props.disableChangeMode, + yearRangeOffset = _props.yearRangeOffset, + _props$yearRange = _props.yearRange, + yearRange = _props$yearRange === undefined ? [] : _props$yearRange; + + + var localedMonths = momentLocale.months(); + var monthLabel = localedMonths[visibleMonth.month()]; + var yearLabel = visibleMonth.year(); + var btnCls = prefix + 'calendar-btn'; + + var monthButton = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + className: btnCls, + title: monthLabel, + onClick: function onClick() { + return changeMode('month', 'start'); + } + }, + monthLabel + ); + + var yearButton = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + className: btnCls, + title: yearLabel, + onClick: function onClick() { + return changeMode('year', 'start'); + } + }, + yearLabel + ); + + if (disableChangeMode) { + var months = Object(_utils__WEBPACK_IMPORTED_MODULE_7__["getMonths"])(momentLocale); + var years = Object(_utils__WEBPACK_IMPORTED_MODULE_7__["getYears"])(yearRange, yearRangeOffset, visibleMonth.year()); + + monthButton = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + _dropdown__WEBPACK_IMPORTED_MODULE_5__["default"], + { + align: 'tc bc', + container: this.selectContainerHandler, + trigger: react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + className: btnCls, + title: monthLabel + }, + monthLabel, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-down' }) + ), + triggerType: 'click' + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_menu__WEBPACK_IMPORTED_MODULE_6__["default"], { + prefix: prefix, + value: visibleMonth.month(), + dataSource: months, + onChange: function onChange(value) { + return _this2.changeVisibleMonth(value); + } + }) + ); + + yearButton = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + _dropdown__WEBPACK_IMPORTED_MODULE_5__["default"], + { + align: 'tc bc', + container: this.selectContainerHandler, + trigger: react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + className: btnCls, + title: yearLabel + }, + yearLabel, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-down' }) + ), + triggerType: 'click' + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_menu__WEBPACK_IMPORTED_MODULE_6__["default"], { + prefix: prefix, + value: visibleMonth.year(), + dataSource: years, + onChange: this.onYearChange + }) + ); + } + + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'calendar-panel-header' }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: locale.prevYear, + className: btnCls + ' ' + btnCls + '-prev-year', + onClick: goPrevYear + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-double-left' }) + ), + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: locale.prevMonth, + className: btnCls + ' ' + btnCls + '-prev-month', + onClick: goPrevMonth + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-left' }) + ), + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'calendar-panel-header-full' }, + monthButton, + yearButton + ), + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: locale.nextMonth, + className: btnCls + ' ' + btnCls + '-next-month', + onClick: goNextMonth + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-right' }) + ), + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: locale.nextYear, + className: btnCls + ' ' + btnCls + '-next-year', + onClick: goNextYear + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-double-right' }) + ) + ); + }; + + return DatePanelHeader; +}(react__WEBPACK_IMPORTED_MODULE_3___default.a.PureComponent), _class.defaultProps = { + yearRangeOffset: 10 +}, _temp2); + + +/* harmony default export */ __webpack_exports__["default"] = (DatePanelHeader); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/menu.js": +/*!********************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/menu.js ***! + \********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectMenu; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-dom */ "./node_modules/_react-dom@16.12.0@react-dom/index.js"); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../menu */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/menu/index.js"); + + + + + + +var _class, _temp; + +/* istanbul ignore file */ + + + + + +var SelectMenu = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(SelectMenu, _Component); + + function SelectMenu() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, SelectMenu); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.apply(this, arguments)); + } + + SelectMenu.prototype.componentDidMount = function componentDidMount() { + this.scrollToSelectedItem(); + }; + + SelectMenu.prototype.scrollToSelectedItem = function scrollToSelectedItem() { + var _props = this.props, + prefix = _props.prefix, + dataSource = _props.dataSource, + value = _props.value; + + + var selectedIndex = dataSource.findIndex(function (item) { + return item.value === value; + }); + + if (selectedIndex === -1) { + return; + } + + var itemSelector = '.' + prefix + 'menu-item'; + var menu = Object(react_dom__WEBPACK_IMPORTED_MODULE_7__["findDOMNode"])(this.refs.menu); + var targetItem = menu.querySelectorAll(itemSelector)[selectedIndex]; + if (targetItem) { + menu.scrollTop = targetItem.offsetTop - Math.floor((menu.clientHeight / targetItem.clientHeight - 1) / 2) * targetItem.clientHeight; + } + }; + + SelectMenu.prototype.render = function render() { + var _props2 = this.props, + prefix = _props2.prefix, + dataSource = _props2.dataSource, + onChange = _props2.onChange, + value = _props2.value, + className = _props2.className, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props2, ['prefix', 'dataSource', 'onChange', 'value', 'className']); + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + _menu__WEBPACK_IMPORTED_MODULE_8__["default"], + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { + ref: 'menu', + selectMode: 'single', + selectedKeys: [String(value)], + onSelect: function onSelect(selectKeys) { + return onChange(Number(selectKeys[0])); + }, + role: 'listbox', + className: prefix + 'calendar-panel-menu ' + className + }), + dataSource.map(function (_ref) { + var label = _ref.label, + value = _ref.value; + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + _menu__WEBPACK_IMPORTED_MODULE_8__["default"].Item, + { key: value }, + label + ); + }) + ); + }; + + return SelectMenu; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.isNextMenu = true, _class.propTypes = { + dataSource: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object), + value: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.number, + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + onChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + children: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node +}, _temp); +SelectMenu.displayName = 'SelectMenu'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/month-panel-header.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/month-panel-header.js ***! + \**********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../icon */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/index.js"); + + + + + + +var MonthPanelHeader = function (_React$PureComponent) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(MonthPanelHeader, _React$PureComponent); + + function MonthPanelHeader() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, MonthPanelHeader); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(this, _React$PureComponent.apply(this, arguments)); + } + + MonthPanelHeader.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + visibleMonth = _props.visibleMonth, + locale = _props.locale, + changeMode = _props.changeMode, + goPrevYear = _props.goPrevYear, + goNextYear = _props.goNextYear; + + var yearLabel = visibleMonth.year(); + var btnCls = prefix + 'calendar-btn'; + + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'calendar-panel-header' }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: locale.prevYear, + className: btnCls + ' ' + btnCls + '-prev-year', + onClick: goPrevYear + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-double-left' }) + ), + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'calendar-panel-header-full' }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: yearLabel, + className: '' + btnCls, + onClick: function onClick() { + return changeMode('year'); + } + }, + yearLabel + ) + ), + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: locale.nextYear, + className: btnCls + ' ' + btnCls + '-next-year', + onClick: goNextYear + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-double-right' }) + ) + ); + }; + + return MonthPanelHeader; +}(react__WEBPACK_IMPORTED_MODULE_3___default.a.PureComponent); + +/* harmony default export */ __webpack_exports__["default"] = (MonthPanelHeader); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/range-panel-header.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/range-panel-header.js ***! + \**********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../icon */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/index.js"); +/* harmony import */ var _dropdown__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../dropdown */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dropdown/index.js"); +/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./menu */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/menu.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/utils/index.js"); + + + + +var _class, _temp2; + +/* istanbul ignore file */ + + + + + + +/* eslint-disable */ +var RangePanelHeader = (_temp2 = _class = function (_React$PureComponent) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(RangePanelHeader, _React$PureComponent); + + function RangePanelHeader() { + var _temp, _this, _ret; + + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RangePanelHeader); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(this, _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args))), _this), _this.selectContainerHandler = function (target) { + return target.parentNode; + }, _this.onYearChange = function (visibleMonth, year) { + var changeVisibleMonth = _this.props.changeVisibleMonth; + + changeVisibleMonth(visibleMonth.clone().year(year), 'yearSelect'); + }, _this.changeVisibleMonth = function (visibleMonth, month) { + var changeVisibleMonth = _this.props.changeVisibleMonth; + + changeVisibleMonth(visibleMonth.clone().month(month), 'monthSelect'); + }, _temp), babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(_this, _ret); + } + + RangePanelHeader.prototype.render = function render() { + var _this2 = this; + + var _props = this.props, + prefix = _props.prefix, + startVisibleMonth = _props.startVisibleMonth, + endVisibleMonth = _props.endVisibleMonth, + _props$yearRange = _props.yearRange, + yearRange = _props$yearRange === undefined ? [] : _props$yearRange, + yearRangeOffset = _props.yearRangeOffset, + momentLocale = _props.momentLocale, + locale = _props.locale, + changeMode = _props.changeMode, + goNextMonth = _props.goNextMonth, + goNextYear = _props.goNextYear, + goPrevMonth = _props.goPrevMonth, + goPrevYear = _props.goPrevYear, + disableChangeMode = _props.disableChangeMode; + + + var localedMonths = momentLocale.months(); + var startMonthLabel = localedMonths[startVisibleMonth.month()]; + var endMonthLabel = localedMonths[endVisibleMonth.month()]; + var startYearLabel = startVisibleMonth.year(); + var endYearLabel = endVisibleMonth.year(); + var btnCls = prefix + 'calendar-btn'; + + var months = Object(_utils__WEBPACK_IMPORTED_MODULE_7__["getMonths"])(momentLocale); + var startYears = Object(_utils__WEBPACK_IMPORTED_MODULE_7__["getYears"])(yearRange, yearRangeOffset, startVisibleMonth.year()); + var endYears = Object(_utils__WEBPACK_IMPORTED_MODULE_7__["getYears"])(yearRange, yearRangeOffset, endVisibleMonth.year()); + + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'calendar-panel-header' }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: locale.prevYear, + className: btnCls + ' ' + btnCls + '-prev-year', + onClick: goPrevYear + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-double-left' }) + ), + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: locale.prevMonth, + className: btnCls + ' ' + btnCls + '-prev-month', + onClick: goPrevMonth + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-left' }) + ), + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'calendar-panel-header-left' }, + disableChangeMode ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + _dropdown__WEBPACK_IMPORTED_MODULE_5__["default"], + { + align: 'tc bc', + container: this.selectContainerHandler, + trigger: react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + className: btnCls, + title: startMonthLabel + }, + startMonthLabel, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-down' }) + ), + triggerType: 'click' + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_menu__WEBPACK_IMPORTED_MODULE_6__["default"], { + prefix: prefix, + value: startVisibleMonth.month(), + dataSource: months, + onChange: function onChange(value) { + return _this2.changeVisibleMonth(startVisibleMonth, value); + } + }) + ) : react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: startMonthLabel, + className: btnCls, + onClick: function onClick() { + return changeMode('month', 'start'); + } + }, + startMonthLabel + ), + disableChangeMode ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + _dropdown__WEBPACK_IMPORTED_MODULE_5__["default"], + { + align: 'tc bc', + container: this.selectContainerHandler, + trigger: react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + className: btnCls, + title: startYearLabel + }, + startYearLabel, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-down' }) + ), + triggerType: 'click' + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_menu__WEBPACK_IMPORTED_MODULE_6__["default"], { + prefix: prefix, + value: startVisibleMonth.year(), + dataSource: startYears, + onChange: function onChange(v) { + return _this2.onYearChange(startVisibleMonth, v); + } + }) + ) : react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: startYearLabel, + className: btnCls, + onClick: function onClick() { + return changeMode('year', 'start'); + } + }, + startYearLabel + ) + ), + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'calendar-panel-header-right' }, + disableChangeMode ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + _dropdown__WEBPACK_IMPORTED_MODULE_5__["default"], + { + align: 'tc bc', + container: this.selectContainerHandler, + trigger: react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + className: btnCls, + title: endMonthLabel + }, + endMonthLabel, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-down' }) + ), + triggerType: 'click' + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_menu__WEBPACK_IMPORTED_MODULE_6__["default"], { + prefix: prefix, + value: endVisibleMonth.month(), + dataSource: months, + onChange: function onChange(value) { + return _this2.changeVisibleMonth(endVisibleMonth, value); + } + }) + ) : react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: endMonthLabel, + className: btnCls, + onClick: function onClick() { + return changeMode('month', 'end'); + } + }, + endMonthLabel + ), + disableChangeMode ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + _dropdown__WEBPACK_IMPORTED_MODULE_5__["default"], + { + align: 'tc bc', + container: this.selectContainerHandler, + trigger: react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + className: btnCls, + title: endYearLabel + }, + endYearLabel, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-down' }) + ), + triggerType: 'click' + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_menu__WEBPACK_IMPORTED_MODULE_6__["default"], { + prefix: prefix, + value: endVisibleMonth.year(), + dataSource: endYears, + onChange: function onChange(v) { + return _this2.onYearChange(endVisibleMonth, v); + } + }) + ) : react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: endYearLabel, + className: btnCls, + onClick: function onClick() { + return changeMode('year', 'end'); + } + }, + endYearLabel + ) + ), + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: locale.nextMonth, + className: btnCls + ' ' + btnCls + '-next-month', + onClick: goNextMonth + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-right' }) + ), + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: locale.nextYear, + className: btnCls + ' ' + btnCls + '-next-year', + onClick: goNextYear + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-double-right' }) + ) + ); + }; + + return RangePanelHeader; +}(react__WEBPACK_IMPORTED_MODULE_3___default.a.PureComponent), _class.defaultProps = { + yearRangeOffset: 10 +}, _temp2); + + +/* harmony default export */ __webpack_exports__["default"] = (RangePanelHeader); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/year-panel-header.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/year-panel-header.js ***! + \*********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../icon */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/index.js"); + + + + + + +var YearPanelHeader = function (_React$PureComponent) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(YearPanelHeader, _React$PureComponent); + + function YearPanelHeader() { + var _temp, _this, _ret; + + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, YearPanelHeader); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(this, _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args))), _this), _this.getDecadeLabel = function (date) { + var year = date.year(); + var start = parseInt(year / 10, 10) * 10; + var end = start + 9; + return start + '-' + end; + }, _temp), babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(_this, _ret); + } + + YearPanelHeader.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + visibleMonth = _props.visibleMonth, + locale = _props.locale, + goPrevDecade = _props.goPrevDecade, + goNextDecade = _props.goNextDecade; + + var decadeLable = this.getDecadeLabel(visibleMonth); + var btnCls = prefix + 'calendar-btn'; + + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'calendar-panel-header' }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: locale.prevDecade, + className: btnCls + ' ' + btnCls + '-prev-decade', + onClick: goPrevDecade + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-double-left' }) + ), + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'calendar-panel-header-full' }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: decadeLable, + className: btnCls + }, + decadeLable + ) + ), + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'button', + { + role: 'button', + title: locale.nextDecade, + className: btnCls + ' ' + btnCls + '-next-decade', + onClick: goNextDecade + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_4__["default"], { type: 'arrow-double-right' }) + ) + ); + }; + + return YearPanelHeader; +}(react__WEBPACK_IMPORTED_MODULE_3___default.a.PureComponent); + +/* harmony default export */ __webpack_exports__["default"] = (YearPanelHeader); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/index.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/index.js ***! + \****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/utils/index.js"); +/* harmony import */ var _calendar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./calendar */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/calendar.js"); +/* harmony import */ var _range_calendar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./range-calendar */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/range-calendar.js"); + + + + + + +/* istanbul ignore next */ +var transform = function transform(props, deprecated) { + var type = props.type, + onChange = props.onChange, + base = props.base, + disabledMonth = props.disabledMonth, + disabledYear = props.disabledYear, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default()(props, ['type', 'onChange', 'base', 'disabledMonth', 'disabledYear']); + + var newProps = others; + + if ('type' in props) { + deprecated('type', 'shape', 'Calendar'); + + newProps.shape = type; + + if ('shape' in props) { + newProps.shape = props.shape; + } + } + + if ('base' in props) { + deprecated('base', 'defaultVisibleMonth', 'Calendar'); + + var newDefaultVisibleMonth = function newDefaultVisibleMonth() { + Object(_utils__WEBPACK_IMPORTED_MODULE_2__["preFormatDateValue"])(base, 'YYYY-MM-DD'); + }; + + if ('defaultVisibleMonth' in props) { + newDefaultVisibleMonth = props.defaultVisibleMonth; + } + + newProps.defaultVisibleMonth = newDefaultVisibleMonth; + } + + if ('onChange' in props && typeof onChange === 'function') { + deprecated('onChange', 'onSelect', 'Calendar'); + + var newOnSelect = function newOnSelect(date) { + onChange({ mode: others.mode, value: date }); + + if ('onSelect' in props) { + props.onSelect(date); + } + }; + + newProps.onSelect = newOnSelect; + } + + if ('disabledMonth' in props && typeof disabledMonth === 'function') { + deprecated('disabledMonth', 'disabledDate', 'Calendar'); + } + + if ('disabledYear' in props && typeof disabledYear === 'function') { + deprecated('disabledYear', 'disabledDate', 'Calendar'); + } + + if ('yearCellRender' in props && typeof yearCellRender === 'function') { + deprecated('yearCellRender', 'monthCellRender/dateCellRender', 'Calendar'); + } + + if ('language' in props) { + deprecated('language', 'moment.locale', 'Calendar'); + } + + return newProps; +}; + +_calendar__WEBPACK_IMPORTED_MODULE_3__["default"].RangeCalendar = _range_calendar__WEBPACK_IMPORTED_MODULE_4__["default"]; +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_1__["default"].config(_calendar__WEBPACK_IMPORTED_MODULE_3__["default"], { + transform: transform +})); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/main.scss": +/*!*****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/main.scss ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694896172 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/range-calendar.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/range-calendar.js ***! + \*************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! moment */ "./node_modules/_moment@2.24.0@moment/moment.js"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _locale_zh_cn__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../locale/zh-cn */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/locale/zh-cn.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _head_range_panel_header__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./head/range-panel-header */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/range-panel-header.js"); +/* harmony import */ var _head_month_panel_header__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./head/month-panel-header */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/month-panel-header.js"); +/* harmony import */ var _head_year_panel_header__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./head/year-panel-header */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/head/year-panel-header.js"); +/* harmony import */ var _table_date_table__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./table/date-table */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/date-table.js"); +/* harmony import */ var _table_month_table__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./table/month-table */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/month-table.js"); +/* harmony import */ var _table_year_table__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./table/year-table */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/year-table.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./utils */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/utils/index.js"); + + + + + + +var _class, _temp; + + + + + + + + + + + + + + + + +var RangeCalendar = (_temp = _class = function (_React$Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(RangeCalendar, _React$Component); + + function RangeCalendar(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, RangeCalendar); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _React$Component.call(this, props, context)); + + _this.onSelectCell = function (date, nextMode) { + if (_this.state.mode === _utils__WEBPACK_IMPORTED_MODULE_18__["CALENDAR_MODE_DATE"]) { + _this.props.onSelect(date); + } else { + _this.changeVisibleMonth(date, 'cellClick'); + } + + _this.changeMode(nextMode); + }; + + _this.changeMode = function (mode, activePanel) { + if (typeof mode === 'string' && mode !== _this.state.mode) { + _this.setState({ mode: mode }); + } + if (activePanel && activePanel !== _this.state.activePanel) { + _this.setState({ activePanel: activePanel }); + } + }; + + _this.changeVisibleMonth = function (date, reason) { + if (!Object(_utils__WEBPACK_IMPORTED_MODULE_18__["isSameYearMonth"])(date, _this.state.startVisibleMonth)) { + _this.setState({ startVisibleMonth: date }); + _this.props.onVisibleMonthChange(date, reason); + } + }; + + _this.changeVisibleMonthByOffset = function (offset, type) { + var offsetDate = _this.state.startVisibleMonth.clone().add(offset, type); + _this.changeVisibleMonth(offsetDate, 'buttonClick'); + }; + + _this.goPrevDecade = function () { + _this.changeVisibleMonthByOffset(-10, 'years'); + }; + + _this.goNextDecade = function () { + _this.changeVisibleMonthByOffset(10, 'years'); + }; + + _this.goPrevYear = function () { + _this.changeVisibleMonthByOffset(-1, 'years'); + }; + + _this.goNextYear = function () { + _this.changeVisibleMonthByOffset(1, 'years'); + }; + + _this.goPrevMonth = function () { + _this.changeVisibleMonthByOffset(-1, 'months'); + }; + + _this.goNextMonth = function () { + _this.changeVisibleMonthByOffset(1, 'months'); + }; + + var startValue = Object(_utils__WEBPACK_IMPORTED_MODULE_18__["formatDateValue"])(props.startValue || props.defaultStartValue); + var endValue = Object(_utils__WEBPACK_IMPORTED_MODULE_18__["formatDateValue"])(props.endValue || props.defaultEndValue); + var visibleMonth = Object(_utils__WEBPACK_IMPORTED_MODULE_18__["getVisibleMonth"])(props.defaultVisibleMonth, startValue); + + _this.state = { + startValue: startValue, + endValue: endValue, + mode: props.mode, + startVisibleMonth: visibleMonth, + activePanel: undefined + }; + _this.today = moment__WEBPACK_IMPORTED_MODULE_8___default()(); + return _this; + } + + RangeCalendar.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if ('startValue' in nextProps) { + var startValue = Object(_utils__WEBPACK_IMPORTED_MODULE_18__["formatDateValue"])(nextProps.startValue); + this.setState({ + startValue: startValue + }); + + if (startValue && !startValue.isSame(this.state.startValue, 'day')) { + this.setState({ + startVisibleMonth: startValue + }); + } + } + + if ('endValue' in nextProps) { + var endValue = Object(_utils__WEBPACK_IMPORTED_MODULE_18__["formatDateValue"])(nextProps.endValue); + this.setState({ + endValue: endValue + }); + } + + if ('mode' in nextProps) { + this.setState({ + mode: nextProps.mode + }); + } + }; + + /** + * 根据日期偏移量设置当前展示的月份 + * @param {Number} offset 日期偏移量 + * @param {String} type 日期偏移类型 days, months, years + */ + + + RangeCalendar.prototype.render = function render() { + var _classnames; + + var _props = this.props, + prefix = _props.prefix, + rtl = _props.rtl, + dateCellRender = _props.dateCellRender, + monthCellRender = _props.monthCellRender, + yearCellRender = _props.yearCellRender, + className = _props.className, + format = _props.format, + locale = _props.locale, + showOtherMonth = _props.showOtherMonth, + disabledDate = _props.disabledDate, + disableChangeMode = _props.disableChangeMode, + yearRange = _props.yearRange, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['prefix', 'rtl', 'dateCellRender', 'monthCellRender', 'yearCellRender', 'className', 'format', 'locale', 'showOtherMonth', 'disabledDate', 'disableChangeMode', 'yearRange']); + + var _state = this.state, + startValue = _state.startValue, + endValue = _state.endValue, + mode = _state.mode, + startVisibleMonth = _state.startVisibleMonth, + activePanel = _state.activePanel; + + // reset moment locale + + if (locale.momentLocale) { + startValue && startValue.locale(locale.momentLocale); + endValue && endValue.locale(locale.momentLocale); + startVisibleMonth.locale(locale.momentLocale); + } + + if (rtl) { + others.dir = 'rtl'; + } + var localeData = Object(_utils__WEBPACK_IMPORTED_MODULE_18__["getLocaleData"])(locale.format || {}, startVisibleMonth.localeData()); + + var endVisibleMonth = startVisibleMonth.clone().add(1, 'months'); + + var headerProps = { + prefix: prefix, + rtl: rtl, + mode: mode, + locale: locale, + momentLocale: localeData, + startVisibleMonth: startVisibleMonth, + endVisibleMonth: endVisibleMonth, + changeVisibleMonth: this.changeVisibleMonth, + changeMode: this.changeMode, + yearRange: yearRange, + disableChangeMode: disableChangeMode + }; + + var tableProps = { + prefix: prefix, + value: startValue, + startValue: startValue, + endValue: endValue, + mode: mode, + locale: locale, + momentLocale: localeData, + showOtherMonth: showOtherMonth, + today: this.today, + disabledDate: disabledDate, + dateCellRender: dateCellRender, + monthCellRender: monthCellRender, + yearCellRender: yearCellRender, + changeMode: this.changeMode, + changeVisibleMonth: this.changeVisibleMonth + }; + + var visibleMonths = { + start: startVisibleMonth, + end: endVisibleMonth + }; + + var visibleMonth = visibleMonths[activePanel]; + + var header = void 0; + var table = void 0; + + switch (mode) { + case _utils__WEBPACK_IMPORTED_MODULE_18__["CALENDAR_MODE_DATE"]: + { + table = [react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { + className: prefix + 'calendar-body-left', + key: 'left-panel' + }, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_table_date_table__WEBPACK_IMPORTED_MODULE_15__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + format: format + }, tableProps, { + visibleMonth: startVisibleMonth, + onSelectDate: this.onSelectCell + })) + ), react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { + className: prefix + 'calendar-body-right', + key: 'right-panel' + }, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_table_date_table__WEBPACK_IMPORTED_MODULE_15__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + format: format + }, tableProps, { + visibleMonth: endVisibleMonth, + onSelectDate: this.onSelectCell + })) + )]; + header = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_head_range_panel_header__WEBPACK_IMPORTED_MODULE_12__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, headerProps, { + goPrevYear: this.goPrevYear, + goPrevMonth: this.goPrevMonth, + goNextYear: this.goNextYear, + goNextMonth: this.goNextMonth + })); + break; + } + case _utils__WEBPACK_IMPORTED_MODULE_18__["CALENDAR_MODE_MONTH"]: + { + table = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_table_month_table__WEBPACK_IMPORTED_MODULE_16__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, tableProps, { + visibleMonth: visibleMonth, + onSelectMonth: this.onSelectCell + })); + header = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_head_month_panel_header__WEBPACK_IMPORTED_MODULE_13__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, headerProps, { + visibleMonth: visibleMonth, + goPrevYear: this.goPrevYear, + goNextYear: this.goNextYear + })); + break; + } + case _utils__WEBPACK_IMPORTED_MODULE_18__["CALENDAR_MODE_YEAR"]: + { + table = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_table_year_table__WEBPACK_IMPORTED_MODULE_17__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, tableProps, { + rtl: rtl, + visibleMonth: visibleMonth, + onSelectYear: this.onSelectCell, + goPrevDecade: this.goPrevDecade, + goNextDecade: this.goNextDecade + })); + header = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_head_year_panel_header__WEBPACK_IMPORTED_MODULE_14__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, headerProps, { + visibleMonth: visibleMonth, + goPrevDecade: this.goPrevDecade, + goNextDecade: this.goNextDecade + })); + break; + } + } + + var classNames = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classnames = {}, _classnames[prefix + 'calendar'] = true, _classnames[prefix + 'calendar-range'] = true, _classnames), className); + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _util__WEBPACK_IMPORTED_MODULE_11__["obj"].pickOthers(RangeCalendar.propTypes, others), { + className: classNames + }), + header, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { className: prefix + 'calendar-body' }, + table + ) + ); + }; + + return RangeCalendar; +}(react__WEBPACK_IMPORTED_MODULE_5___default.a.Component), _class.propTypes = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _config_provider__WEBPACK_IMPORTED_MODULE_9__["default"].propTypes, { + /** + * 样式前缀 + */ + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 默认的开始日期 + */ + defaultStartValue: _utils__WEBPACK_IMPORTED_MODULE_18__["checkMomentObj"], + /** + * 默认的结束日期 + */ + defaultEndValue: _utils__WEBPACK_IMPORTED_MODULE_18__["checkMomentObj"], + /** + * 开始日期(moment 对象) + */ + startValue: _utils__WEBPACK_IMPORTED_MODULE_18__["checkMomentObj"], + /** + * 结束日期(moment 对象) + */ + endValue: _utils__WEBPACK_IMPORTED_MODULE_18__["checkMomentObj"], + // 面板模式 + mode: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(_utils__WEBPACK_IMPORTED_MODULE_18__["CALENDAR_MODES"]), + // 禁用更改面板模式,采用 dropdown 的方式切换显示日期 (暂不正式对外透出) + disableChangeMode: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + // 日期值的格式(用于日期title显示的格式) + format: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + yearRange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.number), + /** + * 是否显示非本月的日期 + */ + showOtherMonth: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 模板展示的月份(起始月份) + */ + defaultVisibleMonth: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 展现的月份变化时的回调 + * @param {Object} value 显示的月份 (moment 对象) + * @param {String} reason 触发月份改变原因 + */ + onVisibleMonthChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 不可选择的日期 + * @param {Object} calendarDate 对应 Calendar 返回的自定义日期对象 + * @param {String} view 当前视图类型,year: 年, month: 月, date: 日 + * @returns {Boolean} + */ + disabledDate: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 选择日期单元格时的回调 + * @param {Object} value 对应的日期值 (moment 对象) + */ + onSelect: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 自定义日期单元格渲染 + */ + dateCellRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 自定义月份渲染函数 + * @param {Object} calendarDate 对应 Calendar 返回的自定义日期对象 + * @returns {ReactNode} + */ + monthCellRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + yearCellRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, // 兼容 0.x yearCellRender + locale: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string +}), _class.defaultProps = { + prefix: 'next-', + rtl: false, + mode: _utils__WEBPACK_IMPORTED_MODULE_18__["CALENDAR_MODE_DATE"], + disableChangeMode: false, + format: 'YYYY-MM-DD', + dateCellRender: function dateCellRender(value) { + return value.date(); + }, + onSelect: _util__WEBPACK_IMPORTED_MODULE_11__["func"].noop, + onVisibleMonthChange: _util__WEBPACK_IMPORTED_MODULE_11__["func"].noop, + locale: _locale_zh_cn__WEBPACK_IMPORTED_MODULE_10__["default"].Calendar, + showOtherMonth: false +}, _temp); +RangeCalendar.displayName = 'RangeCalendar'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_9__["default"].config(RangeCalendar, { + componentName: 'Calendar' +})); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/style.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/style.js ***! + \****************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _icon_style_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../icon/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/style.js"); +/* harmony import */ var _radio_style_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../radio/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/radio/style.js"); +/* harmony import */ var _select_style_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../select/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/select/style.js"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_3__); + + + + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/date-table-head.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/date-table-head.js ***! + \********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/utils/index.js"); + + + + + + +var DateTableHead = function (_PureComponent) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(DateTableHead, _PureComponent); + + function DateTableHead() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, DateTableHead); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(this, _PureComponent.apply(this, arguments)); + } + + DateTableHead.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + momentLocale = _props.momentLocale; + + var firstDayOfWeek = momentLocale.firstDayOfWeek(); + var weekdaysShort = momentLocale.weekdaysShort(); + + var elements = []; + for (var i = 0; i < _utils__WEBPACK_IMPORTED_MODULE_4__["DAYS_OF_WEEK"]; i++) { + var index = (firstDayOfWeek + i) % _utils__WEBPACK_IMPORTED_MODULE_4__["DAYS_OF_WEEK"]; + elements.push(react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'th', + { key: i, className: prefix + 'calendar-th', role: 'cell' }, + weekdaysShort[index] + )); + } + + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'thead', + { className: prefix + 'calendar-thead', role: 'rowgroup' }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'tr', + { role: 'row' }, + elements + ) + ); + }; + + return DateTableHead; +}(react__WEBPACK_IMPORTED_MODULE_3__["PureComponent"]); + +/* harmony default export */ __webpack_exports__["default"] = (DateTableHead); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/date-table.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/date-table.js ***! + \***************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _date_table_head__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./date-table-head */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/date-table-head.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/utils/index.js"); + + + + + + + + + +function isSameDay(a, b) { + return a && b && a.isSame(b, 'day'); +} + +function isRangeDate(date, startDate, endDate) { + return date.format('L') !== startDate.format('L') && date.format('L') !== endDate.format('L') && date.valueOf() > startDate.valueOf() && date.valueOf() < endDate.valueOf(); +} + +function isLastMonthDate(date, target) { + if (date.year() < target.year()) { + return 1; + } + return date.year() === target.year() && date.month() < target.month(); +} + +function isNextMonthDate(date, target) { + if (date.year() > target.year()) { + return 1; + } + return date.year() === target.year() && date.month() > target.month(); +} + +var DateTable = function (_PureComponent) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(DateTable, _PureComponent); + + function DateTable() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, DateTable); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _PureComponent.apply(this, arguments)); + } + + DateTable.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + visibleMonth = _props.visibleMonth, + showOtherMonth = _props.showOtherMonth, + endValue = _props.endValue, + format = _props.format, + today = _props.today, + momentLocale = _props.momentLocale, + dateCellRender = _props.dateCellRender, + disabledDate = _props.disabledDate, + onSelectDate = _props.onSelectDate; + + var startValue = this.props.startValue || this.props.value; + + var firstDayOfMonth = visibleMonth.clone().startOf('month'); // 该月的 1 号 + var firstDayOfMonthInWeek = firstDayOfMonth.day(); // 星期几 + + var firstDayOfWeek = momentLocale.firstDayOfWeek(); + + var datesOfLastMonthCount = (firstDayOfMonthInWeek + _utils__WEBPACK_IMPORTED_MODULE_7__["DAYS_OF_WEEK"] - firstDayOfWeek) % _utils__WEBPACK_IMPORTED_MODULE_7__["DAYS_OF_WEEK"]; + + var lastMonthDate = firstDayOfMonth.clone(); + lastMonthDate.add(0 - datesOfLastMonthCount, 'days'); + + var counter = 0; + var currentDate = void 0; + var dateList = []; + for (var i = 0; i < _utils__WEBPACK_IMPORTED_MODULE_7__["CALENDAR_TABLE_ROW_COUNT"]; i++) { + for (var j = 0; j < _utils__WEBPACK_IMPORTED_MODULE_7__["CALENDAR_TABLE_COL_COUNT"]; j++) { + currentDate = lastMonthDate; + if (counter) { + currentDate = currentDate.clone(); + currentDate.add(counter, 'days'); + } + dateList.push(currentDate); + counter++; + } + } + + counter = 0; // reset counter + var monthElements = []; + for (var _i = 0; _i < _utils__WEBPACK_IMPORTED_MODULE_7__["CALENDAR_TABLE_ROW_COUNT"]; _i++) { + var weekElements = []; + for (var _j = 0; _j < _utils__WEBPACK_IMPORTED_MODULE_7__["CALENDAR_TABLE_COL_COUNT"]; _j++) { + var _classNames; + + currentDate = dateList[counter]; + var isLastMonth = isLastMonthDate(currentDate, visibleMonth); + var isNextMonth = isNextMonthDate(currentDate, visibleMonth); + var isCurrentMonth = !isLastMonth && !isNextMonth; + + var isDisabled = Object(_utils__WEBPACK_IMPORTED_MODULE_7__["isDisabledDate"])(currentDate, disabledDate, 'date'); + var isToday = !isDisabled && isSameDay(currentDate, today) && isCurrentMonth; + var isSelected = !isDisabled && (isSameDay(currentDate, startValue) || isSameDay(currentDate, endValue)) && isCurrentMonth; + var isInRange = !isDisabled && startValue && endValue && isRangeDate(currentDate, startValue, endValue) && isCurrentMonth; + + var cellContent = !showOtherMonth && !isCurrentMonth ? null : dateCellRender(currentDate); + + var elementCls = classnames__WEBPACK_IMPORTED_MODULE_5___default()((_classNames = {}, _classNames[prefix + 'calendar-cell'] = true, _classNames[prefix + 'calendar-cell-prev-month'] = isLastMonth, _classNames[prefix + 'calendar-cell-next-month'] = isNextMonth, _classNames[prefix + 'calendar-cell-current'] = isToday, _classNames[prefix + 'inrange'] = isInRange, _classNames[prefix + 'selected'] = isSelected, _classNames[prefix + 'disabled'] = cellContent && isDisabled, _classNames)); + + weekElements.push(react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'td', + { + key: counter, + title: currentDate.format(format), + onClick: isDisabled ? undefined : onSelectDate.bind(null, currentDate), + className: elementCls, + role: 'cell', + 'aria-disabled': isDisabled ? 'true' : 'false', + 'aria-selected': isSelected ? 'true' : 'false' + }, + react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + { className: prefix + 'calendar-date' }, + cellContent + ) + )); + counter++; + } + monthElements.push(react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'tr', + { key: _i, role: 'row' }, + weekElements + )); + } + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'table', + { className: prefix + 'calendar-table', role: 'grid' }, + react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_date_table_head__WEBPACK_IMPORTED_MODULE_6__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, this.props, { momentLocale: momentLocale })), + react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'tbody', + { className: prefix + 'calendar-tbody', role: 'rowgroup' }, + monthElements + ) + ); + }; + + return DateTable; +}(react__WEBPACK_IMPORTED_MODULE_4__["PureComponent"]); + +/* harmony default export */ __webpack_exports__["default"] = (DateTable); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/month-table.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/month-table.js ***! + \****************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/utils/index.js"); + + + + + + + +function isSameMonth(currentDate, selectedDate) { + return selectedDate && currentDate.year() === selectedDate.year() && currentDate.month() === selectedDate.month(); +} + +var MonthTable = function (_PureComponent) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(MonthTable, _PureComponent); + + function MonthTable() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, MonthTable); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(this, _PureComponent.apply(this, arguments)); + } + + MonthTable.prototype.onMonthCellClick = function onMonthCellClick(date) { + this.props.onSelectMonth(date, 'date'); + }; + + MonthTable.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + value = _props.value, + visibleMonth = _props.visibleMonth, + disabledDate = _props.disabledDate, + today = _props.today, + momentLocale = _props.momentLocale, + monthCellRender = _props.monthCellRender; + + + var monthLocale = momentLocale.monthsShort(); + + var counter = 0; + var monthList = []; + for (var i = 0; i < _utils__WEBPACK_IMPORTED_MODULE_5__["MONTH_TABLE_ROW_COUNT"]; i++) { + var rowList = []; + for (var j = 0; j < _utils__WEBPACK_IMPORTED_MODULE_5__["MONTH_TABLE_COL_COUNT"]; j++) { + var _classnames; + + var monthDate = visibleMonth.clone().month(counter); + var isDisabled = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isDisabledDate"])(monthDate, disabledDate, 'month'); + var isSelected = isSameMonth(monthDate, value); + var isThisMonth = isSameMonth(monthDate, today); + var elementCls = classnames__WEBPACK_IMPORTED_MODULE_4___default()((_classnames = {}, _classnames[prefix + 'calendar-cell'] = true, _classnames[prefix + 'calendar-cell-current'] = isThisMonth, _classnames[prefix + 'selected'] = isSelected, _classnames[prefix + 'disabled'] = isDisabled, _classnames)); + var localedMonth = monthLocale[counter]; + var monthCellContent = monthCellRender ? monthCellRender(monthDate) : localedMonth; + rowList.push(react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'td', + { + key: counter, + title: localedMonth, + onClick: isDisabled ? undefined : this.onMonthCellClick.bind(this, monthDate), + className: elementCls, + role: 'cell', + 'aria-disabled': isDisabled ? 'true' : 'false', + 'aria-selected': isSelected ? 'true' : 'false' + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'calendar-month' }, + monthCellContent + ) + )); + counter++; + } + monthList.push(react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'tr', + { key: i, role: 'row' }, + rowList + )); + } + + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'table', + { className: prefix + 'calendar-table', role: 'grid' }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'tbody', + { className: prefix + 'calendar-tbody', role: 'rowgroup' }, + monthList + ) + ); + }; + + return MonthTable; +}(react__WEBPACK_IMPORTED_MODULE_3__["PureComponent"]); + +/* harmony default export */ __webpack_exports__["default"] = (MonthTable); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/year-table.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/table/year-table.js ***! + \***************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../icon */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/index.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/utils/index.js"); + + + + + + + + +var YearTable = function (_React$PureComponent) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(YearTable, _React$PureComponent); + + function YearTable() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, YearTable); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(this, _React$PureComponent.apply(this, arguments)); + } + + YearTable.prototype.onYearCellClick = function onYearCellClick(date) { + this.props.onSelectYear(date, 'month'); + }; + + YearTable.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + value = _props.value, + today = _props.today, + visibleMonth = _props.visibleMonth, + locale = _props.locale, + disabledDate = _props.disabledDate, + goPrevDecade = _props.goPrevDecade, + goNextDecade = _props.goNextDecade, + yearCellRender = _props.yearCellRender; + + var currentYear = today.year(); + var selectedYear = value ? value.year() : null; + var visibleYear = visibleMonth.year(); + var startYear = Math.floor(visibleYear / 10) * 10; + + var yearElements = []; + var counter = 0; + + var lastRowIndex = _utils__WEBPACK_IMPORTED_MODULE_6__["YEAR_TABLE_ROW_COUNT"] - 1; + var lastColIndex = _utils__WEBPACK_IMPORTED_MODULE_6__["YEAR_TABLE_COL_COUNT"] - 1; + + for (var i = 0; i < _utils__WEBPACK_IMPORTED_MODULE_6__["YEAR_TABLE_ROW_COUNT"]; i++) { + var rowElements = []; + for (var j = 0; j < _utils__WEBPACK_IMPORTED_MODULE_6__["YEAR_TABLE_COL_COUNT"]; j++) { + var _classnames; + + var content = void 0; + var year = void 0; + var isDisabled = false; + var onClick = void 0; + var title = void 0; + + if (i === 0 && j === 0) { + title = locale.prevDecade; + onClick = goPrevDecade; + content = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_5__["default"], { type: 'arrow-left', size: 'xs' }); + } else if (i === lastRowIndex && j === lastColIndex) { + title = locale.nextDecade; + onClick = goNextDecade; + content = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_5__["default"], { type: 'arrow-right', size: 'xs' }); + } else { + year = startYear + counter++; + title = year; + var yearDate = visibleMonth.clone().year(year); + isDisabled = Object(_utils__WEBPACK_IMPORTED_MODULE_6__["isDisabledDate"])(yearDate, disabledDate, 'year'); + + !isDisabled && (onClick = this.onYearCellClick.bind(this, yearDate)); + + content = yearCellRender ? yearCellRender(yearDate) : year; + } + + var isSelected = year === selectedYear; + + var classNames = classnames__WEBPACK_IMPORTED_MODULE_4___default()((_classnames = {}, _classnames[prefix + 'calendar-cell'] = true, _classnames[prefix + 'calendar-cell-current'] = year === currentYear, _classnames[prefix + 'selected'] = isSelected, _classnames[prefix + 'disabled'] = isDisabled, _classnames)); + + rowElements.push(react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'td', + { key: i + '-' + j, className: classNames, role: 'cell' }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { + className: prefix + 'calendar-year', + onClick: onClick, + title: title, + 'aria-disabled': isDisabled ? 'true' : 'false', + 'aria-selected': isSelected ? 'true' : 'false' + }, + content + ) + )); + } + yearElements.push(react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'tr', + { key: i, role: 'row' }, + rowElements + )); + } + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'table', + { className: prefix + 'calendar-table', role: 'grid' }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'tbody', + { className: prefix + 'calendar-tbody', role: 'rowgroup' }, + yearElements + ) + ); + }; + + return YearTable; +}(react__WEBPACK_IMPORTED_MODULE_3___default.a.PureComponent); + +/* harmony default export */ __webpack_exports__["default"] = (YearTable); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/utils/index.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/utils/index.js ***! + \**********************************************************************************/ +/*! exports provided: getLocaleData, DAYS_OF_WEEK, CALENDAR_TABLE_COL_COUNT, CALENDAR_TABLE_ROW_COUNT, MONTH_TABLE_ROW_COUNT, MONTH_TABLE_COL_COUNT, YEAR_TABLE_ROW_COUNT, YEAR_TABLE_COL_COUNT, CALENDAR_MODE_YEAR, CALENDAR_MODE_MONTH, CALENDAR_MODE_DATE, CALENDAR_MODES, isDisabledDate, checkMomentObj, formatDateValue, getVisibleMonth, isSameYearMonth, preFormatDateValue, getYears, getMonths */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleData", function() { return getLocaleData; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DAYS_OF_WEEK", function() { return DAYS_OF_WEEK; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CALENDAR_TABLE_COL_COUNT", function() { return CALENDAR_TABLE_COL_COUNT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CALENDAR_TABLE_ROW_COUNT", function() { return CALENDAR_TABLE_ROW_COUNT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MONTH_TABLE_ROW_COUNT", function() { return MONTH_TABLE_ROW_COUNT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MONTH_TABLE_COL_COUNT", function() { return MONTH_TABLE_COL_COUNT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "YEAR_TABLE_ROW_COUNT", function() { return YEAR_TABLE_ROW_COUNT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "YEAR_TABLE_COL_COUNT", function() { return YEAR_TABLE_COL_COUNT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CALENDAR_MODE_YEAR", function() { return CALENDAR_MODE_YEAR; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CALENDAR_MODE_MONTH", function() { return CALENDAR_MODE_MONTH; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CALENDAR_MODE_DATE", function() { return CALENDAR_MODE_DATE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CALENDAR_MODES", function() { return CALENDAR_MODES; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDisabledDate", function() { return isDisabledDate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkMomentObj", function() { return checkMomentObj; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatDateValue", function() { return formatDateValue; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVisibleMonth", function() { return getVisibleMonth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSameYearMonth", function() { return isSameYearMonth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "preFormatDateValue", function() { return preFormatDateValue; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getYears", function() { return getYears; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMonths", function() { return getMonths; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! moment */ "./node_modules/_moment@2.24.0@moment/moment.js"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_1__); + + + + +var DAYS_OF_WEEK = 7; + +var CALENDAR_TABLE_COL_COUNT = 7; + +var CALENDAR_TABLE_ROW_COUNT = 6; + +var MONTH_TABLE_ROW_COUNT = 4; + +var MONTH_TABLE_COL_COUNT = 3; + +var YEAR_TABLE_ROW_COUNT = 4; + +var YEAR_TABLE_COL_COUNT = 3; + +var CALENDAR_MODE_YEAR = 'year'; + +var CALENDAR_MODE_MONTH = 'month'; + +var CALENDAR_MODE_DATE = 'date'; + +var CALENDAR_MODES = [CALENDAR_MODE_DATE, CALENDAR_MODE_MONTH, CALENDAR_MODE_YEAR]; + +function isDisabledDate(date, fn, view) { + if (typeof fn === 'function' && fn(date, view)) { + return true; + } + return false; +} + +function checkMomentObj(props, propName, componentName) { + if (props[propName] && !moment__WEBPACK_IMPORTED_MODULE_1___default.a.isMoment(props[propName])) { + return new Error('Invalid prop ' + propName + ' supplied to ' + componentName + '. Required a moment object'); + } +} + +function formatDateValue(value) { + var reservedValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (value && moment__WEBPACK_IMPORTED_MODULE_1___default.a.isMoment(value)) { + return value; + } + return reservedValue; +} + +function getVisibleMonth(defaultVisibleMonth, value) { + var getVM = defaultVisibleMonth; + if (typeof getVM !== 'function' || !moment__WEBPACK_IMPORTED_MODULE_1___default.a.isMoment(getVM())) { + getVM = function getVM() { + if (value) { + return value; + } + return moment__WEBPACK_IMPORTED_MODULE_1___default()(); + }; + } + return getVM(); +} + +function isSameYearMonth(dateA, dateB) { + return dateA.month() === dateB.month() && dateA.year() === dateB.year(); +} + +function preFormatDateValue(value, format) { + var val = typeof value === 'string' ? moment__WEBPACK_IMPORTED_MODULE_1___default()(value, format, false) : value; + if (val && moment__WEBPACK_IMPORTED_MODULE_1___default.a.isMoment(val) && val.isValid()) { + return val; + } + + return null; +} + +function getLocaleData(_ref, localeData) { + var _months = _ref.months, + shortMonths = _ref.shortMonths, + _firstDayOfWeek = _ref.firstDayOfWeek, + _weekdays = _ref.weekdays, + shortWeekdays = _ref.shortWeekdays, + veryShortWeekdays = _ref.veryShortWeekdays; + + return babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, localeData, { + monthsShort: function monthsShort() { + return shortMonths || localeData.monthsShort(); + }, + months: function months() { + return _months || localeData.months(); + }, + firstDayOfWeek: function firstDayOfWeek() { + return _firstDayOfWeek || localeData.firstDayOfWeek(); + }, + weekdays: function weekdays() { + return _weekdays || localeData.weekdays; + }, + weekdaysShort: function weekdaysShort() { + return shortWeekdays || localeData.weekdaysShort(); + }, + weekdaysMin: function weekdaysMin() { + return veryShortWeekdays || localeData.weekdaysMin(); + } + }); +} + +/* istanbul ignore next */ +function getYears(yearRange, yearRangeOffset, year) { + var options = []; + var startYear = yearRange[0], + endYear = yearRange[1]; + + if (!startYear || !endYear) { + startYear = year - yearRangeOffset; + endYear = year + yearRangeOffset; + } + + for (var i = startYear; i <= endYear; i++) { + options.push({ + label: i, + value: i + }); + } + return options; +} + +/* istanbul ignore next */ +function getMonths(momentLocale) { + var localeMonths = momentLocale.monthsShort(); + var options = []; + for (var i = 0; i < 12; i++) { + options.push({ + value: i, + label: localeMonths[i] + }); + } + return options; +} + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/actions.js": +/*!**************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/actions.js ***! + \**************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); + + + + + + +var _class, _temp; + + + + + + +/** + * Card.Actions + * @order 5 + */ +var CardActions = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(CardActions, _Component); + + function CardActions() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, CardActions); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.apply(this, arguments)); + } + + CardActions.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + Component = _props.component, + className = _props.className, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['prefix', 'component', 'className']); + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(Component, babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { + className: classnames__WEBPACK_IMPORTED_MODULE_7___default()(prefix + 'card-actions', className) + })); + }; + + return CardActions; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 设置标签类型 + */ + component: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.elementType, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string +}, _class.defaultProps = { + prefix: 'next-', + component: 'div' +}, _temp); +CardActions.displayName = 'CardActions'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_8__["default"].config(CardActions)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/bullet-header.js": +/*!********************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/bullet-header.js ***! + \********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); + + + + +var _class, _temp; + + + + + + +/** + * Card.BulletHeader + * @order 2 + */ +var CardBulletHeader = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(CardBulletHeader, _Component); + + function CardBulletHeader() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CardBulletHeader); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(this, _Component.apply(this, arguments)); + } + + CardBulletHeader.prototype.render = function render() { + var _classNames; + + var _props = this.props, + prefix = _props.prefix, + title = _props.title, + subTitle = _props.subTitle, + extra = _props.extra, + showTitleBullet = _props.showTitleBullet; + + + if (!title) return null; + + var headCls = classnames__WEBPACK_IMPORTED_MODULE_5___default()((_classNames = {}, _classNames[prefix + 'card-head'] = true, _classNames[prefix + 'card-head-show-bullet'] = showTitleBullet, _classNames)); + + var headExtra = extra ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'card-extra' }, + extra + ) : null; + + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: headCls }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'card-head-main' }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'card-title' }, + title, + subTitle ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'span', + { className: prefix + 'card-subtitle' }, + subTitle + ) : null + ), + headExtra + ) + ); + }; + + return CardBulletHeader; +}(react__WEBPACK_IMPORTED_MODULE_3__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string, + /** + * 卡片的标题 + */ + title: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.node, + /** + * 卡片的副标题 + */ + subTitle: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.node, + /** + * 是否显示标题的项目符号 + */ + showTitleBullet: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, + /** + * 标题区域的用户自定义内容 + */ + extra: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.node +}, _class.defaultProps = { + prefix: 'next-', + showTitleBullet: true +}, _temp); +CardBulletHeader.displayName = 'CardBulletHeader'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_6__["default"].config(CardBulletHeader, { + componentName: 'Card' +})); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/card.js": +/*!***********************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/card.js ***! + \***********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Card; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _bullet_header__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./bullet-header */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/bullet-header.js"); +/* harmony import */ var _collapse_content__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./collapse-content */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/collapse-content.js"); +/* harmony import */ var _media__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./media */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/media.js"); +/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./actions */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/actions.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); + + + + + +var _class, _temp; + +/* eslint-disable valid-jsdoc */ + + + + + + + + + + +var pickOthers = _util__WEBPACK_IMPORTED_MODULE_12__["obj"].pickOthers; + +/** + * Card + * @order 0 + */ + +var Card = (_temp = _class = function (_React$Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(Card, _React$Component); + + function Card() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Card); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _React$Component.apply(this, arguments)); + } + + Card.prototype.render = function render() { + var _classNames; + + var _props = this.props, + prefix = _props.prefix, + className = _props.className, + title = _props.title, + subTitle = _props.subTitle, + extra = _props.extra, + showTitleBullet = _props.showTitleBullet, + showHeadDivider = _props.showHeadDivider, + children = _props.children, + rtl = _props.rtl, + contentHeight = _props.contentHeight, + free = _props.free, + actions = _props.actions, + media = _props.media; + + + var cardCls = classnames__WEBPACK_IMPORTED_MODULE_6___default()((_classNames = {}, _classNames[prefix + 'card'] = true, _classNames[prefix + 'card-free'] = free, _classNames[prefix + 'card-show-divider'] = showHeadDivider, _classNames[prefix + 'card-hide-divider'] = !showHeadDivider, _classNames), className); + + var others = pickOthers(Object.keys(Card.propTypes), this.props); + + others.dir = rtl ? 'rtl' : undefined; + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { className: cardCls }), + media && react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + _media__WEBPACK_IMPORTED_MODULE_10__["default"], + null, + media + ), + react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_bullet_header__WEBPACK_IMPORTED_MODULE_8__["default"], { + title: title, + subTitle: subTitle, + extra: extra, + showTitleBullet: showTitleBullet + }), + free ? children : react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + _collapse_content__WEBPACK_IMPORTED_MODULE_9__["default"], + { contentHeight: contentHeight }, + children + ), + actions && react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + _actions__WEBPACK_IMPORTED_MODULE_11__["default"], + null, + actions + ) + ); + }; + + return Card; +}(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component), _class.displayName = 'Card', _class.propTypes = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _config_provider__WEBPACK_IMPORTED_MODULE_7__["default"].propTypes, { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 卡片的上的图片 / 视频 + */ + media: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + /** + * 卡片的标题 + */ + title: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + /** + * 卡片的副标题 + */ + subTitle: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + /** + * 卡片操作组,位置在卡片底部 + */ + actions: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + /** + * 是否显示标题的项目符号 + */ + showTitleBullet: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 是否展示头部的分隔线 + */ + showHeadDivider: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 内容区域的固定高度 + */ + contentHeight: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.number]), + /** + * 标题区域的用户自定义内容 + */ + extra: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + /** + * 是否开启自由模式,开启后card 将使用子组件配合使用, 设置此项后 title, subtitle, 等等属性都将失效 + */ + free: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + className: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + children: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node +}), _class.defaultProps = { + prefix: 'next-', + free: false, + showTitleBullet: true, + showHeadDivider: true, + contentHeight: 120 +}, _temp); +Card.displayName = 'Card'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/collapse-content.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/collapse-content.js ***! + \***********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-dom */ "./node_modules/_react-dom@16.12.0@react-dom/index.js"); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../icon */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/index.js"); +/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../button */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/index.js"); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _locale_zh_cn__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../locale/zh-cn */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/locale/zh-cn.js"); + + + + +var _class, _temp; + + + + + + + + + +/** + * Card.CollaspeContent + * @order 3 + */ +var CardCollaspeContent = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(CardCollaspeContent, _Component); + + function CardCollaspeContent(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CardCollaspeContent); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(this, _Component.call(this, props, context)); + + _this.handleToggle = function () { + _this.setState(function (prevState) { + return { + expand: !prevState.expand + }; + }); + }; + + _this._contentRefHandler = function (ref) { + _this.content = ref; + }; + + _this.saveFooter = function (ref) { + _this.footer = ref; + }; + + _this.state = { + needMore: false, + expand: false, + contentHeight: 'auto' + }; + return _this; + } + + CardCollaspeContent.prototype.componentDidMount = function componentDidMount() { + this._setNeedMore(); + this._setContentHeight(); + }; + + CardCollaspeContent.prototype.componentDidUpdate = function componentDidUpdate() { + this._setContentHeight(); + }; + + // 是否展示 More 按钮 + CardCollaspeContent.prototype._setNeedMore = function _setNeedMore() { + var contentHeight = this.props.contentHeight; + + var childrenHeight = this._getNodeChildrenHeight(this.content); + this.setState({ + needMore: contentHeight !== 'auto' && childrenHeight > contentHeight + }); + }; + + // 设置 Body 的高度 + + + CardCollaspeContent.prototype._setContentHeight = function _setContentHeight() { + if (this.state.expand) { + var childrenHeight = this._getNodeChildrenHeight(this.content); + this.content.style.height = childrenHeight + 'px'; // get the real height + } else { + var el = react_dom__WEBPACK_IMPORTED_MODULE_4___default.a.findDOMNode(this.footer); + var height = this.props.contentHeight; + + if (el) { + height = height - el.getBoundingClientRect().height; + } + + this.content.style.height = height + 'px'; + } + }; + + CardCollaspeContent.prototype._getNodeChildrenHeight = function _getNodeChildrenHeight(node) { + if (!node) { + return 0; + } + + var contentChildNodes = node.childNodes; + var length = contentChildNodes.length; + + if (!length) { + return 0; + } + + var lastNode = contentChildNodes[length - 1]; + + return lastNode.offsetTop + lastNode.offsetHeight; + }; + + CardCollaspeContent.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + children = _props.children, + locale = _props.locale; + var _state = this.state, + needMore = _state.needMore, + expand = _state.expand; + + + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { className: prefix + 'card-body' }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { + className: prefix + 'card-content', + ref: this._contentRefHandler + }, + children + ), + needMore ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + 'div', + { + className: prefix + 'card-footer', + ref: this.saveFooter, + onClick: this.handleToggle + }, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement( + _button__WEBPACK_IMPORTED_MODULE_7__["default"], + { text: true, type: 'primary' }, + expand ? locale.fold : locale.expand, + react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_6__["default"], { + type: 'arrow-down', + size: 'xs', + className: expand ? 'expand' : '' + }) + ) + ) : null + ); + }; + + return CardCollaspeContent; +}(react__WEBPACK_IMPORTED_MODULE_3__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + /** + * 内容区域的固定高度 + */ + contentHeight: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.number]), + locale: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, + children: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node +}, _class.defaultProps = { + prefix: 'next-', + contentHeight: 120, + locale: _locale_zh_cn__WEBPACK_IMPORTED_MODULE_9__["default"].Card +}, _temp); +CardCollaspeContent.displayName = 'CardCollaspeContent'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_8__["default"].config(CardCollaspeContent, { + componentName: 'Card' +})); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/content.js": +/*!**************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/content.js ***! + \**************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); + + + + + + +var _class, _temp; + + + + + + +/** + * Card.Content + * @order 3 + */ +var CardContent = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(CardContent, _Component); + + function CardContent() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, CardContent); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.apply(this, arguments)); + } + + CardContent.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + className = _props.className, + Component = _props.component, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['prefix', 'className', 'component']); + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(Component, babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { + className: classnames__WEBPACK_IMPORTED_MODULE_7___default()(prefix + 'card-content-container', className) + })); + }; + + return CardContent; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 设置标签类型 + */ + component: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.elementType, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string +}, _class.defaultProps = { + prefix: 'next-', + component: 'div' +}, _temp); +CardContent.displayName = 'CardContent'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_8__["default"].config(CardContent)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/divider.js": +/*!**************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/divider.js ***! + \**************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); + + + + + + +var _class, _temp; + + + + + + +/** + * Card.Divider + * @order 4 + */ +var CardDivider = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(CardDivider, _Component); + + function CardDivider() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, CardDivider); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.apply(this, arguments)); + } + + CardDivider.prototype.render = function render() { + var _classNames; + + var _props = this.props, + prefix = _props.prefix, + Component = _props.component, + inset = _props.inset, + className = _props.className, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['prefix', 'component', 'inset', 'className']); + + var dividerClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()(prefix + 'card-divider', (_classNames = {}, _classNames[prefix + 'card-divider--inset'] = inset, _classNames), className); + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(Component, babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { className: dividerClassName })); + }; + + return CardDivider; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 设置标签类型 + */ + component: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.elementType, + /** + * 分割线是否向内缩进 + */ + inset: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string +}, _class.defaultProps = { + prefix: 'next-', + component: 'hr' +}, _temp); +CardDivider.displayName = 'CardDivider'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_8__["default"].config(CardDivider)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/header.js": +/*!*************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/header.js ***! + \*************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); + + + + + + +var _class, _temp; + + + + + + +/** + * Card.Header + * @order 2 + */ +var CardHeader = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(CardHeader, _Component); + + function CardHeader() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, CardHeader); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.apply(this, arguments)); + } + + CardHeader.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + title = _props.title, + subTitle = _props.subTitle, + extra = _props.extra, + className = _props.className, + Component = _props.component, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['prefix', 'title', 'subTitle', 'extra', 'className', 'component']); + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + Component, + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { + className: classnames__WEBPACK_IMPORTED_MODULE_7___default()(prefix + 'card-header', className) + }), + extra && react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { className: prefix + 'card-header-extra' }, + extra + ), + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { className: prefix + 'card-header-titles' }, + title && react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { className: prefix + 'card-header-title' }, + title + ), + subTitle && react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { className: prefix + 'card-header-subtitle' }, + subTitle + ) + ) + ); + }; + + return CardHeader; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 卡片的标题 + */ + title: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node, + /** + * 卡片的副标题 + */ + subTitle: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node, + /** + * 标题区域的用户自定义内容 + */ + extra: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node, + /** + * 设置标签类型 + */ + component: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.elementType, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string +}, _class.defaultProps = { + prefix: 'next-', + component: 'div' +}, _temp); +CardHeader.displayName = 'CardHeader'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_8__["default"].config(CardHeader)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/index.js": +/*!************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/index.js ***! + \************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _card__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./card */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/card.js"); +/* harmony import */ var _header__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./header */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/header.js"); +/* harmony import */ var _bullet_header__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./bullet-header */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/bullet-header.js"); +/* harmony import */ var _media__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./media */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/media.js"); +/* harmony import */ var _divider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./divider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/divider.js"); +/* harmony import */ var _content__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./content */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/content.js"); +/* harmony import */ var _collapse_content__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./collapse-content */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/collapse-content.js"); +/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./actions */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/actions.js"); + + + + + + + + + + + + +_card__WEBPACK_IMPORTED_MODULE_3__["default"].Header = _header__WEBPACK_IMPORTED_MODULE_4__["default"]; +_card__WEBPACK_IMPORTED_MODULE_3__["default"].Media = _media__WEBPACK_IMPORTED_MODULE_6__["default"]; +_card__WEBPACK_IMPORTED_MODULE_3__["default"].Divider = _divider__WEBPACK_IMPORTED_MODULE_7__["default"]; +_card__WEBPACK_IMPORTED_MODULE_3__["default"].Content = _content__WEBPACK_IMPORTED_MODULE_8__["default"]; +_card__WEBPACK_IMPORTED_MODULE_3__["default"].Actions = _actions__WEBPACK_IMPORTED_MODULE_10__["default"]; +_card__WEBPACK_IMPORTED_MODULE_3__["default"].BulletHeader = _bullet_header__WEBPACK_IMPORTED_MODULE_5__["default"]; +_card__WEBPACK_IMPORTED_MODULE_3__["default"].CollaspeContent = _collapse_content__WEBPACK_IMPORTED_MODULE_9__["default"]; + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_2__["default"].config(_card__WEBPACK_IMPORTED_MODULE_3__["default"], { + transform: /* istanbul ignore next */function transform(props, deprecated) { + if ('titlePrefixLine' in props) { + deprecated('titlePrefixLine', 'showTitleBullet', 'Card'); + + var _props = props, + titlePrefixLine = _props.titlePrefixLine, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['titlePrefixLine']); + + props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ showTitleBullet: titlePrefixLine }, others); + } + if ('titleBottomLine' in props) { + deprecated('titleBottomLine', 'showHeadDivider', 'Card'); + + var _props2 = props, + titleBottomLine = _props2.titleBottomLine, + _others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props2, ['titleBottomLine']); + + props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ showHeadDivider: titleBottomLine }, _others); + } + if ('bodyHeight' in props) { + deprecated('bodyHeight', 'contentHeight', 'Card'); + + var _props3 = props, + bodyHeight = _props3.bodyHeight, + _others2 = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props3, ['bodyHeight']); + + props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ contentHeight: bodyHeight }, _others2); + } + + return props; + } +})); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/main.scss": +/*!*************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/main.scss ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694896407 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/media.js": +/*!************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/media.js ***! + \************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); + + + + + + +var _class, _temp; + + + + + + + +var warning = _util__WEBPACK_IMPORTED_MODULE_9__["log"].warning; + + +var MEDIA_COMPONENTS = ['video', 'audio', 'picture', 'iframe', 'img']; + +/** + * Card.Media + * @order 1 + */ +var CardMedia = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(CardMedia, _Component); + + function CardMedia() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, CardMedia); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.apply(this, arguments)); + } + + CardMedia.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + style = _props.style, + className = _props.className, + Component = _props.component, + image = _props.image, + src = _props.src, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['prefix', 'style', 'className', 'component', 'image', 'src']); + + warning('children' in others || Boolean(image || src), 'either `children`, `image` or `src` prop must be specified.'); + + var isMediaComponent = MEDIA_COMPONENTS.indexOf(Component) !== -1; + var composedStyle = !isMediaComponent && image ? babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ backgroundImage: 'url("' + image + '")' }, style) : style; + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(Component, babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { + style: composedStyle, + className: classnames__WEBPACK_IMPORTED_MODULE_7___default()(prefix + 'card-media', className), + src: isMediaComponent ? image || src : undefined + })); + }; + + return CardMedia; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 设置标签类型 + */ + component: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.elementType, + /** + * 背景图片地址 + */ + image: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 媒体源文件地址 + */ + src: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + style: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string +}, _class.defaultProps = { + prefix: 'next-', + component: 'div', + style: {} +}, _temp); +CardMedia.displayName = 'CardMedia'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_8__["default"].config(CardMedia)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/style.js": +/*!************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/style.js ***! + \************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _icon_style_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../icon/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/style.js"); +/* harmony import */ var _button_style_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../button/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/style.js"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/card/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_2__); + + + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader-select/cascader-select.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader-select/cascader-select.js ***! + \*********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CascaderSelect; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../select */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/select/index.js"); +/* harmony import */ var _cascader__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../cascader */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/index.js"); +/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../menu */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/menu/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); + + + + + +var _class, _temp; + + + + + + + + + +var bindCtx = _util__WEBPACK_IMPORTED_MODULE_10__["func"].bindCtx; +var pickOthers = _util__WEBPACK_IMPORTED_MODULE_10__["obj"].pickOthers; +var getStyle = _util__WEBPACK_IMPORTED_MODULE_10__["dom"].getStyle; + +/** + * CascaderSelect + */ + +var CascaderSelect = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(CascaderSelect, _Component); + + function CascaderSelect(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, CascaderSelect); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _Component.call(this, props, context)); + + _this.state = { + value: _this.normalizeValue('value' in props ? props.value : props.defaultValue), + searchValue: '', + visible: typeof props.visible === 'undefined' ? props.defaultVisible : props.visible + }; + + bindCtx(_this, ['handleVisibleChange', 'handleAfterOpen', 'handleSelect', 'handleChange', 'handleClear', 'handleRemove', 'handleSearch', 'getPopup', 'saveSelectRef', 'saveCascaderRef', 'handleKeyDown']); + return _this; + } + + CascaderSelect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + var st = {}; + + if ('value' in nextProps) { + st.value = this.normalizeValue(nextProps.value); + } + if ('visible' in nextProps) { + st.visible = nextProps.visible; + } + + if (Object.keys(st).length) { + this.setState(st); + } + }; + + CascaderSelect.prototype.normalizeValue = function normalizeValue(value) { + if (value) { + if (Array.isArray(value)) { + return value; + } + + return [value]; + } + + return []; + }; + + CascaderSelect.prototype.updateCache = function updateCache(dataSource) { + var _this2 = this; + + this._v2n = {}; + this._p2n = {}; + var loop = function loop(data) { + var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0'; + return data.forEach(function (item, index) { + var value = item.value, + children = item.children; + + var pos = prefix + '-' + index; + _this2._v2n[value] = _this2._p2n[pos] = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, item, { pos: pos }); + + if (children && children.length) { + loop(children, pos); + } + }); + }; + + loop(dataSource); + }; + + CascaderSelect.prototype.flatValue = function flatValue(value) { + var _this3 = this; + + var getDepth = function getDepth(v) { + var pos = _this3.getPos(v); + if (!pos) { + return 0; + } + return pos.split('-').length; + }; + var newValue = value.slice(0).sort(function (prev, next) { + return getDepth(prev) - getDepth(next); + }); + + for (var i = 0; i < newValue.length; i++) { + for (var j = 0; j < newValue.length; j++) { + if (i !== j && this.isDescendantOrSelf(this.getPos(newValue[i]), this.getPos(newValue[j]))) { + newValue.splice(j, 1); + j--; + } + } + } + + return newValue; + }; + + CascaderSelect.prototype.isDescendantOrSelf = function isDescendantOrSelf(currentPos, targetPos) { + if (!currentPos || !targetPos) { + return false; + } + + var currentNums = currentPos.split('-'); + var targetNums = targetPos.split('-'); + + return currentNums.length <= targetNums.length && currentNums.every(function (num, index) { + return num === targetNums[index]; + }); + }; + + CascaderSelect.prototype.getValue = function getValue(pos) { + return this._p2n[pos] ? this._p2n[pos].value : null; + }; + + CascaderSelect.prototype.getPos = function getPos(value) { + return this._v2n[value] ? this._v2n[value].pos : null; + }; + + CascaderSelect.prototype.getData = function getData(value) { + var _this4 = this; + + return value.map(function (v) { + return _this4._v2n[v]; + }); + }; + + CascaderSelect.prototype.getLabelPath = function getLabelPath(data) { + var _this5 = this; + + var nums = data.pos.split('-'); + return nums.slice(1).reduce(function (ret, num, index) { + var p = nums.slice(0, index + 2).join('-'); + ret.push(_this5._p2n[p].label); + return ret; + }, []); + }; + + CascaderSelect.prototype.getSignleData = function getSignleData(value) { + if (!value.length) { + return null; + } + + if (Array.isArray(value)) value = value[0]; + + var data = this._v2n[value]; + if (!data) { + return { + value: value + }; + } + + var labelPath = this.getLabelPath(data); + var displayRender = this.props.displayRender || function (labels) { + return labels.join(' / '); + }; + + return babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, data, { + label: displayRender(labelPath, data) + }); + }; + + CascaderSelect.prototype.getMultipleData = function getMultipleData(value) { + var _this6 = this; + + if (!value.length) { + return null; + } + + var _props = this.props, + checkStrictly = _props.checkStrictly, + canOnlyCheckLeaf = _props.canOnlyCheckLeaf, + displayRender = _props.displayRender; + + var data = (checkStrictly || canOnlyCheckLeaf ? value : this.flatValue(value)).map(function (v) { + return _this6._v2n[v] || { value: v }; + }); + + if (displayRender) { + data = data.map(function (item) { + if (!item.pos) { + return item; + } + var labelPath = _this6.getLabelPath(item); + + return babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, item, { + label: displayRender(labelPath, item) + }); + }); + } + + return data; + }; + + CascaderSelect.prototype.getIndeterminate = function getIndeterminate(value) { + var _this7 = this; + + var indeterminate = []; + + var positions = value.map(this.getPos.bind(this)); + positions.forEach(function (pos) { + if (!pos) { + return false; + } + var nums = pos.split('-'); + for (var i = nums.length; i > 2; i--) { + var parentPos = nums.slice(0, i - 1).join('-'); + var parentValue = _this7.getValue(parentPos); + if (indeterminate.indexOf(parentValue) === -1) { + indeterminate.push(parentValue); + } + } + }); + + return indeterminate; + }; + + CascaderSelect.prototype.saveSelectRef = function saveSelectRef(ref) { + this.select = ref; + }; + + CascaderSelect.prototype.saveCascaderRef = function saveCascaderRef(ref) { + this.cascader = ref; + }; + + CascaderSelect.prototype.completeValue = function completeValue(value) { + var newValue = []; + + var flatValue = this.flatValue(value).reverse(); + var ps = Object.keys(this._p2n); + for (var i = 0; i < ps.length; i++) { + for (var j = 0; j < flatValue.length; j++) { + var v = flatValue[j]; + if (this.isDescendantOrSelf(this.getPos(v), ps[i])) { + newValue.push(this.getValue(ps[i])); + ps.splice(i, 1); + i--; + break; + } + } + } + + return newValue; + }; + + CascaderSelect.prototype.isLeaf = function isLeaf(data) { + return !(data.children && data.children.length || !!this.props.loadData && !data.isLeaf); + }; + + CascaderSelect.prototype.handleVisibleChange = function handleVisibleChange(visible, type) { + var searchValue = this.state.searchValue; + + if (!('visible' in this.props)) { + this.setState({ + visible: visible + }); + } + + if (!visible && searchValue) { + this.setState({ + searchValue: '' + }); + } + + if (['fromCascader', 'keyboard'].indexOf(type) !== -1 && !visible) { + this.select.focusInput(); + } + + this.props.onVisibleChange(visible, type); + }; + + CascaderSelect.prototype.handleKeyDown = function handleKeyDown(e) { + var onKeyDown = this.props.onKeyDown; + var visible = this.state.visible; + + + if (onKeyDown) { + onKeyDown(e); + } + + if (!visible) { + return; + } + + switch (e.keyCode) { + case _util__WEBPACK_IMPORTED_MODULE_10__["KEYCODE"].UP: + case _util__WEBPACK_IMPORTED_MODULE_10__["KEYCODE"].DOWN: + this.cascader.setFocusValue(); + e.preventDefault(); + break; + default: + break; + } + }; + + CascaderSelect.prototype.getPopup = function getPopup(ref) { + this.popup = ref; + if (typeof this.props.popupProps.ref === 'function') { + this.props.popupProps.ref(ref); + } + }; + + CascaderSelect.prototype.handleAfterOpen = function handleAfterOpen() { + if (!this.popup) { + return; + } + + var _props2 = this.props, + prefix = _props2.prefix, + popupProps = _props2.popupProps; + + var dropDownNode = this.popup.getInstance().overlay.getInstance().getContentNode(); + var cascaderNode = dropDownNode.querySelector('.' + prefix + 'cascader'); + if (cascaderNode) { + this.cascaderHeight = getStyle(cascaderNode, 'height'); + } + + if (typeof popupProps.afterOpen === 'function') { + popupProps.afterOpen(); + } + }; + + CascaderSelect.prototype.handleSelect = function handleSelect(value, data) { + var _props3 = this.props, + multiple = _props3.multiple, + changeOnSelect = _props3.changeOnSelect; + var _state = this.state, + visible = _state.visible, + searchValue = _state.searchValue; + + + if (!multiple && (!changeOnSelect || this.isLeaf(data) || !!searchValue)) { + this.handleVisibleChange(!visible, 'fromCascader'); + } + }; + + CascaderSelect.prototype.handleChange = function handleChange(value, data, extra) { + var _this8 = this; + + var _props4 = this.props, + multiple = _props4.multiple, + onChange = _props4.onChange; + var _state2 = this.state, + searchValue = _state2.searchValue, + stateValue = _state2.value; + + + var st = {}; + + if (multiple && stateValue && Array.isArray(stateValue)) { + value = [].concat(stateValue.filter(function (v) { + return !_this8._v2n[v]; + }), value); + } + + if (!('value' in this.props)) { + st.value = value; + } + if (!multiple && searchValue) { + st.searchValue = ''; + } + if (Object.keys(st).length) { + this.setState(st); + } + + if (onChange) { + onChange(value, data, extra); + } + + if (searchValue && this.select) { + this.select.handleSearchClear(); + } + }; + + CascaderSelect.prototype.handleClear = function handleClear() { + // 单选时点击清空按钮 + var _props5 = this.props, + hasClear = _props5.hasClear, + multiple = _props5.multiple, + treeCheckable = _props5.treeCheckable; + + if (hasClear && (!multiple || !treeCheckable)) { + if (!('value' in this.props)) { + this.setState({ + value: [] + }); + } + + this.props.onChange(null, null); + } + }; + + CascaderSelect.prototype.handleRemove = function handleRemove(currentData) { + var currentValue = currentData.value; + + var value = void 0; + + var _props6 = this.props, + multiple = _props6.multiple, + checkStrictly = _props6.checkStrictly, + onChange = _props6.onChange; + + if (multiple) { + value = [].concat(this.state.value); + value.splice(value.indexOf(currentValue), 1); + + if (this.props.onChange) { + var data = this.getData(value); + var checked = false; + + if (checkStrictly) { + this.props.onChange(value, data, { + checked: checked, + currentData: currentData, + checkedData: data + }); + } else { + var checkedValue = this.completeValue(value); + var checkedData = this.getData(checkedValue); + var indeterminateValue = this.getIndeterminate(value); + var indeterminateData = this.getData(indeterminateValue); + this.props.onChange(value, data, { + checked: checked, + currentData: currentData, + checkedData: checkedData, + indeterminateData: indeterminateData + }); + } + } + } else { + value = []; + onChange(null, null); + } + + if (!('value' in this.props)) { + this.setState({ + value: value + }); + } + }; + + CascaderSelect.prototype.handleSearch = function handleSearch(searchValue) { + this.setState({ + searchValue: searchValue + }); + }; + + CascaderSelect.prototype.getPath = function getPath(pos) { + var items = []; + + var nums = pos.split('-'); + if (nums === 2) { + items.push(this._p2n[pos]); + } else { + for (var i = 1; i < nums.length; i++) { + var p = nums.slice(0, i + 1).join('-'); + items.push(this._p2n[p]); + } + } + + return items; + }; + + CascaderSelect.prototype.filterItems = function filterItems() { + var _this9 = this; + + var _props7 = this.props, + multiple = _props7.multiple, + changeOnSelect = _props7.changeOnSelect, + canOnlyCheckLeaf = _props7.canOnlyCheckLeaf, + filter = _props7.filter; + var searchValue = this.state.searchValue; + + var items = Object.keys(this._p2n).map(function (p) { + return _this9._p2n[p]; + }); + if (!multiple && !changeOnSelect || multiple && canOnlyCheckLeaf) { + items = items.filter(function (item) { + return !item.children || !item.children.length; + }); + } + + return items.map(function (item) { + return _this9.getPath(item.pos); + }).filter(function (path) { + return filter(searchValue, path); + }); + }; + + CascaderSelect.prototype.renderNotFound = function renderNotFound() { + var _props8 = this.props, + prefix = _props8.prefix, + notFoundContent = _props8.notFoundContent; + + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + _menu__WEBPACK_IMPORTED_MODULE_9__["default"], + { className: prefix + 'cascader-select-not-found' }, + react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + _menu__WEBPACK_IMPORTED_MODULE_9__["default"].Item, + null, + notFoundContent + ) + ); + }; + + CascaderSelect.prototype.renderCascader = function renderCascader() { + var dataSource = this.props.dataSource; + + if (dataSource.length === 0) { + return this.renderNotFound(); + } + + var searchValue = this.state.searchValue; + + var filteredPaths = []; + if (searchValue) { + filteredPaths = this.filterItems(); + if (filteredPaths.length === 0) { + return this.renderNotFound(); + } + } + + var _props9 = this.props, + multiple = _props9.multiple, + useVirtual = _props9.useVirtual, + changeOnSelect = _props9.changeOnSelect, + checkStrictly = _props9.checkStrictly, + canOnlyCheckLeaf = _props9.canOnlyCheckLeaf, + defaultExpandedValue = _props9.defaultExpandedValue, + expandTriggerType = _props9.expandTriggerType, + onExpand = _props9.onExpand, + listStyle = _props9.listStyle, + listClassName = _props9.listClassName, + loadData = _props9.loadData, + showSearch = _props9.showSearch, + resultRender = _props9.resultRender, + readOnly = _props9.readOnly, + itemRender = _props9.itemRender; + var value = this.state.value; + + + var props = { + dataSource: dataSource, + value: value, + multiple: multiple, + useVirtual: useVirtual, + canOnlySelectLeaf: !changeOnSelect, + checkStrictly: checkStrictly, + canOnlyCheckLeaf: canOnlyCheckLeaf, + defaultExpandedValue: defaultExpandedValue, + expandTriggerType: expandTriggerType, + ref: this.saveCascaderRef, + onExpand: onExpand, + listStyle: listStyle, + listClassName: listClassName, + loadData: loadData, + itemRender: itemRender + }; + if (!readOnly) { + props.onChange = this.handleChange; + props.onSelect = this.handleSelect; + } + if (showSearch) { + props.searchValue = searchValue; + props.filteredPaths = filteredPaths; + props.resultRender = resultRender; + props.filteredListStyle = { height: this.cascaderHeight }; + } + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_cascader__WEBPACK_IMPORTED_MODULE_8__["default"], props); + }; + + CascaderSelect.prototype.renderPopupContent = function renderPopupContent() { + var _props10 = this.props, + prefix = _props10.prefix, + header = _props10.header, + footer = _props10.footer; + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + { className: prefix + 'cascader-select-dropdown' }, + header, + this.renderCascader(), + footer + ); + }; + + CascaderSelect.prototype.renderPreview = function renderPreview(others) { + var _props11 = this.props, + prefix = _props11.prefix, + multiple = _props11.multiple, + className = _props11.className, + renderPreview = _props11.renderPreview; + var value = this.state.value; + + var previewCls = classnames__WEBPACK_IMPORTED_MODULE_6___default()(className, prefix + 'form-preview'); + var items = (multiple ? this.getMultipleData(value) : this.getSignleData(value)) || []; + + if (!Array.isArray(items)) { + items = [items]; + } + + if (typeof renderPreview === 'function') { + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { className: previewCls }), + renderPreview(items, this.props) + ); + } + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'p', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { className: previewCls }), + items.map(function (_ref) { + var label = _ref.label; + return label; + }).join(', ') + ); + }; + + CascaderSelect.prototype.render = function render() { + var _props12 = this.props, + prefix = _props12.prefix, + size = _props12.size, + hasArrow = _props12.hasArrow, + hasBorder = _props12.hasBorder, + hasClear = _props12.hasClear, + label = _props12.label, + readOnly = _props12.readOnly, + placeholder = _props12.placeholder, + dataSource = _props12.dataSource, + disabled = _props12.disabled, + multiple = _props12.multiple, + className = _props12.className, + showSearch = _props12.showSearch, + popupStyle = _props12.popupStyle, + popupClassName = _props12.popupClassName, + popupContainer = _props12.popupContainer, + popupProps = _props12.popupProps, + followTrigger = _props12.followTrigger, + isPreview = _props12.isPreview; + var _state3 = this.state, + value = _state3.value, + searchValue = _state3.searchValue, + visible = _state3.visible; + + var others = pickOthers(Object.keys(CascaderSelect.propTypes), this.props); + + this.updateCache(dataSource); + + if (isPreview) { + return this.renderPreview(others); + } + + var popupContent = this.renderPopupContent(); + + var props = { + prefix: prefix, + className: className, + size: size, + placeholder: placeholder, + disabled: disabled, + hasArrow: hasArrow, + hasBorder: hasBorder, + hasClear: hasClear, + label: label, + readOnly: readOnly, + ref: this.saveSelectRef, + autoWidth: false, + mode: multiple ? 'multiple' : 'single', + value: multiple ? this.getMultipleData(value) : this.getSignleData(value), + onChange: this.handleClear, + onRemove: this.handleRemove, + visible: visible, + onVisibleChange: this.handleVisibleChange, + showSearch: showSearch, + // searchValue, + onSearch: this.handleSearch, + onKeyDown: this.handleKeyDown, + popupContent: popupContent, + popupStyle: popupStyle, + popupClassName: popupClassName, + popupContainer: popupContainer, + popupProps: popupProps, + followTrigger: followTrigger + }; + + if (showSearch) { + props.popupProps = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, popupProps, { + ref: this.getPopup, + afterOpen: this.handleAfterOpen + }); + props.autoWidth = showSearch && !!searchValue; + } + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_select__WEBPACK_IMPORTED_MODULE_7__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, props, others)); + }; + + return CascaderSelect; +}(react__WEBPACK_IMPORTED_MODULE_4__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + pure: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + className: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + /** + * 选择框大小 + */ + size: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOf(['small', 'medium', 'large']), + /** + * 选择框占位符 + */ + placeholder: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + /** + * 是否禁用 + */ + disabled: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 是否有下拉箭头 + */ + hasArrow: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 是否有边框 + */ + hasBorder: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 是否有清除按钮 + */ + hasClear: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 自定义内联 label + */ + label: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + /** + * 是否只读,只读模式下可以展开弹层但不能选 + */ + readOnly: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 数据源,结构可参考下方说明 + */ + dataSource: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object), + /** + * (非受控)默认值 + */ + defaultValue: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string)]), + /** + * (受控)当前值 + */ + value: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string)]), + /** + * 选中值改变时触发的回调函数 + * @param {String|Array} value 选中的值,单选时返回单个值,多选时返回数组 + * @param {Object|Array} data 选中的数据,包括 value 和 label,单选时返回单个值,多选时返回数组,父子节点选中关联时,同时选中,只返回父节点 + * @param {Object} extra 额外参数 + * @param {Array} extra.selectedPath 单选时选中的数据的路径 + * @param {Boolean} extra.checked 多选时当前的操作是选中还是取消选中 + * @param {Object} extra.currentData 多选时当前操作的数据 + * @param {Array} extra.checkedData 多选时所有被选中的数据 + * @param {Array} extra.indeterminateData 多选时半选的数据 + */ + onChange: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * 默认展开值,如果不设置,组件内部会根据 defaultValue/value 进行自动设置 + */ + defaultExpandedValue: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string), + /** + * 展开触发的方式 + */ + expandTriggerType: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOf(['click', 'hover']), + onExpand: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * 是否开启虚拟滚动 + */ + useVirtual: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 是否多选 + */ + multiple: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 是否选中即发生改变, 该属性仅在单选模式下有效 + */ + changeOnSelect: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 是否只能勾选叶子项的checkbox,该属性仅在多选模式下有效 + */ + canOnlyCheckLeaf: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 父子节点是否选中不关联 + */ + checkStrictly: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 每列列表样式对象 + */ + listStyle: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, + /** + * 每列列表类名 + */ + listClassName: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + /** + * 选择框单选时展示结果的自定义渲染函数 + * @param {Array} label 选中路径的文本数组 + * @return {ReactNode} 渲染在选择框中的内容 + * @default 单选时:labelPath => labelPath.join(' / ');多选时:labelPath => labelPath[labelPath.length - 1] + */ + displayRender: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * 渲染 item 内容的方法 + * @param {Object} item 渲染节点的item + * @return {ReactNode} item node + */ + itemRender: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * 是否显示搜索框 + */ + showSearch: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 自定义搜索函数 + * @param {String} searchValue 搜索的关键字 + * @param {Array} path 节点路径 + * @return {Boolean} 是否匹配 + * @default 根据路径所有节点的文本值模糊匹配 + */ + filter: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * 搜索结果自定义渲染函数 + * @param {String} searchValue 搜索的关键字 + * @param {Array} path 匹配到的节点路径 + * @return {ReactNode} 渲染的内容 + * @default 按照节点文本 a / b / c 的模式渲染 + */ + resultRender: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * 搜索结果列表是否和选择框等宽 + */ + resultAutoWidth: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 无数据时显示内容 + */ + notFoundContent: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + /** + * 异步加载数据函数 + * @param {Object} data 当前点击异步加载的数据 + */ + loadData: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * 自定义下拉框头部 + */ + header: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + /** + * 自定义下拉框底部 + */ + footer: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + /** + * 初始下拉框是否显示 + */ + defaultVisible: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 当前下拉框是否显示 + */ + visible: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 下拉框显示或关闭时触发事件的回调函数 + * @param {Boolean} visible 是否显示 + * @param {String} type 触发显示关闭的操作类型, fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发 + */ + onVisibleChange: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * 下拉框自定义样式对象 + */ + popupStyle: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, + /** + * 下拉框样式自定义类名 + */ + popupClassName: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + /** + * 下拉框挂载的容器节点 + */ + popupContainer: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.any, + /** + * 透传到 Popup 的属性对象 + */ + popupProps: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, + /** + * 是否跟随滚动 + */ + followTrigger: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 是否为预览态 + */ + isPreview: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 预览态模式下渲染的内容 + * @param {Array} value 选择值 { label: , value:} + */ + renderPreview: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func +}, _class.defaultProps = { + prefix: 'next-', + pure: false, + size: 'medium', + disabled: false, + hasArrow: true, + hasBorder: true, + hasClear: false, + dataSource: [], + defaultValue: null, + expandTriggerType: 'click', + onExpand: function onExpand() {}, + useVirtual: false, + multiple: false, + changeOnSelect: false, + canOnlyCheckLeaf: false, + checkStrictly: false, + showSearch: false, + filter: function filter(searchValue, path) { + return path.some(function (item) { + return item.label.indexOf(searchValue) > -1; + }); + }, + resultRender: function resultRender(searchValue, path) { + var parts = []; + path.forEach(function (item, i) { + var others = item.label.split(searchValue); + others.forEach(function (other, j) { + if (other) { + parts.push(other); + } + if (j < others.length - 1) { + parts.push(react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'em', + { key: i + '-' + j }, + searchValue + )); + } + }); + if (i < path.length - 1) { + parts.push(' / '); + } + }); + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'span', + null, + parts + ); + }, + resultAutoWidth: true, + notFoundContent: 'Not Found', + defaultVisible: false, + onVisibleChange: function onVisibleChange() {}, + popupProps: {} +}, _temp); +CascaderSelect.displayName = 'CascaderSelect'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader-select/index.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader-select/index.js ***! + \***********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _cascader_select__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cascader-select */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader-select/cascader-select.js"); + + + + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_2__["default"].config(_cascader_select__WEBPACK_IMPORTED_MODULE_3__["default"], { + transform: /* istanbul ignore next */function transform(props, deprecated) { + if ('shape' in props) { + deprecated('shape', 'hasBorder', 'CascaderSelect'); + + var _props = props, + shape = _props.shape, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['shape']); + + props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ hasBorder: shape !== 'arrow-only' }, others); + } + + if ('container' in props) { + deprecated('container', 'popupContainer', 'CascaderSelect'); + + var _props2 = props, + container = _props2.container, + _others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props2, ['container']); + + props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ popupContainer: container }, _others); + } + + if ('expandTrigger' in props) { + deprecated('expandTrigger', 'expandTriggerType', 'CascaderSelect'); + + var _props3 = props, + expandTrigger = _props3.expandTrigger, + _others2 = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props3, ['expandTrigger']); + + props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ expandTriggerType: expandTrigger }, _others2); + } + + if ('showItemCount' in props) { + deprecated('showItemCount', 'listStyle | listClassName', 'CascaderSelect'); + } + if ('labelWidth' in props) { + deprecated('labelWidth', 'listStyle | listClassName', 'CascaderSelect'); + } + + return props; + } +})); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader-select/main.scss": +/*!************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader-select/main.scss ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694896318 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader-select/style.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader-select/style.js ***! + \***********************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _select_style_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../select/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/select/style.js"); +/* harmony import */ var _cascader_style_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../cascader/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/style.js"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader-select/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_2__); + + + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/cascader.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/cascader.js ***! + \*******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Cascader; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../menu */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/menu/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./menu */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/menu.js"); +/* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./item */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/item.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/utils.js"); + + + + + +var _class, _temp; + + + + + + + + + + +var bindCtx = _util__WEBPACK_IMPORTED_MODULE_8__["func"].bindCtx; +var pickOthers = _util__WEBPACK_IMPORTED_MODULE_8__["obj"].pickOthers; +var addClass = _util__WEBPACK_IMPORTED_MODULE_8__["dom"].addClass, + removeClass = _util__WEBPACK_IMPORTED_MODULE_8__["dom"].removeClass, + setStyle = _util__WEBPACK_IMPORTED_MODULE_8__["dom"].setStyle, + getStyle = _util__WEBPACK_IMPORTED_MODULE_8__["dom"].getStyle; + +/** + * Cascader + */ + +var Cascader = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(Cascader, _Component); + + function Cascader(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Cascader); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _Component.call(this, props, context)); + + var defaultValue = props.defaultValue, + value = props.value, + defaultExpandedValue = props.defaultExpandedValue, + expandedValue = props.expandedValue, + dataSource = props.dataSource, + multiple = props.multiple, + checkStrictly = props.checkStrictly, + canOnlyCheckLeaf = props.canOnlyCheckLeaf, + loadData = props.loadData; + + + _this.updateCache(dataSource); + + var normalizedValue = _this.normalizeValue(typeof value === 'undefined' ? defaultValue : value); + if (!loadData) { + normalizedValue = normalizedValue.filter(function (v) { + return _this._v2n[v]; + }); + } + // TODO loadData + var realExpandedValue = typeof expandedValue === 'undefined' ? typeof defaultExpandedValue === 'undefined' ? _this.getExpandedValue(normalizedValue[0]) : _this.normalizeValue(defaultExpandedValue) : _this.normalizeValue(expandedValue); + var st = { + value: normalizedValue, + expandedValue: realExpandedValue + }; + if (multiple && !checkStrictly && !canOnlyCheckLeaf) { + st.value = _this.completeValue(props.dataSource, st.value); + } + + _this.state = st; + + _this.lastExpandedValue = [].concat(_this.state.expandedValue); + + bindCtx(_this, ['handleMouseLeave', 'handleFocus', 'handleFold', 'getCascaderNode', 'onBlur']); + return _this; + } + + Cascader.prototype.componentDidMount = function componentDidMount() { + this.setCascaderInnerWidth(); + }; + + Cascader.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + var _this2 = this; + + this.updateCache(nextProps.dataSource); + + var state = {}; + if ('value' in nextProps) { + state.value = this.normalizeValue(nextProps.value); + if (!nextProps.loadData) { + state.value = state.value.filter(function (v) { + return _this2._v2n[v]; + }); + } + + var multiple = nextProps.multiple, + checkStrictly = nextProps.checkStrictly, + canOnlyCheckLeaf = nextProps.canOnlyCheckLeaf; + + if (multiple && !checkStrictly && !canOnlyCheckLeaf) { + state.value = this.completeValue(nextProps.dataSource, state.value); + } + if (!this.state.expandedValue.length && !('expandedValue' in nextProps)) { + state.expandedValue = this.getExpandedValue(state.value[0]); + } + } + if ('expandedValue' in nextProps) { + state.expandedValue = this.normalizeValue(nextProps.expandedValue); + } + if (Object.keys(state).length) { + this.setState(state); + } + }; + + Cascader.prototype.componentDidUpdate = function componentDidUpdate() { + this.setCascaderInnerWidth(); + }; + + Cascader.prototype.getCascaderNode = function getCascaderNode(ref) { + this.cascader = ref; + if (this.cascader) { + this.cascaderInner = this.cascader.querySelector('.' + this.props.prefix + 'cascader-inner'); + } + }; + + Cascader.prototype.setCascaderInnerWidth = function setCascaderInnerWidth() { + if (!this.cascaderInner) { + return; + } + var menus = [].slice.call(this.cascaderInner.querySelectorAll('.' + this.props.prefix + 'cascader-menu-wrapper')); + if (menus.length === 0) { + return; + } + + var menusWidth = Math.ceil(menus.reduce(function (ret, menu) { + return ret + getStyle(menu, 'width'); + }, 0)); + + if (getStyle(this.cascaderInner, 'width') !== menusWidth) { + setStyle(this.cascaderInner, 'width', menusWidth); + } + + if (getStyle(this.cascader, 'display') === 'inline-block') { + var hasRightBorderClass = this.props.prefix + 'has-right-border'; + menus.forEach(function (menu) { + return removeClass(menu, hasRightBorderClass); + }); + if (this.cascader.clientWidth > menusWidth) { + addClass(menus[menus.length - 1], hasRightBorderClass); + } + } + }; + + Cascader.prototype.setCache = function setCache(data) { + var _this3 = this; + + var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0'; + + data.forEach(function (item, index) { + var value = item.value, + children = item.children; + + var pos = prefix + '-' + index; + var newValue = String(value); + item.value = newValue; + _this3._v2n[newValue] = _this3._p2n[pos] = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, item, { + pos: pos, + _source: item + }); + + if (children && children.length) { + _this3.setCache(children, pos); + } + }); + }; + + Cascader.prototype.updateCache = function updateCache(dataSource) { + this._v2n = {}; + this._p2n = {}; + this.setCache(dataSource); + }; + + Cascader.prototype.normalizeValue = function normalizeValue(value) { + if (value) { + if (Array.isArray(value)) { + return value; + } + + return [value]; + } + + return []; + }; + + Cascader.prototype.getExpandedValue = function getExpandedValue(v) { + var _this4 = this; + + if (!v || !this._v2n[v]) { + return []; + } + + var pos = this._v2n[v].pos; + if (pos.split('-').length === 2) { + return []; + } + + var expandedMap = {}; + Object.keys(this._p2n).forEach(function (p) { + if (_this4.isDescendantOrSelf(p, pos) && p !== pos) { + expandedMap[_this4._p2n[p].value] = p; + } + }); + + return Object.keys(expandedMap).sort(function (prev, next) { + return expandedMap[prev].split('-').length - expandedMap[next].split('-').length; + }); + }; + /*eslint-disable max-statements*/ + + + Cascader.prototype.completeValue = function completeValue(dataSource, value) { + return Object(_utils__WEBPACK_IMPORTED_MODULE_11__["getAllCheckedValues"])(value, this._v2n, this._p2n); + }; + /*eslint-enable*/ + + + Cascader.prototype.flatValue = function flatValue(value) { + return Object(_utils__WEBPACK_IMPORTED_MODULE_11__["filterChildValue"])(value, this._v2n, this._p2n); + }; + + Cascader.prototype.getValue = function getValue(pos) { + return this._p2n[pos] ? this._p2n[pos].value : null; + }; + + Cascader.prototype.getPos = function getPos(value) { + return this._v2n[value] ? this._v2n[value].pos : null; + }; + + Cascader.prototype.getData = function getData(value) { + var _this5 = this; + + return value.map(function (v) { + return _this5._v2n[v]; + }); + }; + + Cascader.prototype.isDescendantOrSelf = function isDescendantOrSelf(currentPos, targetPos) { + if (!currentPos || !targetPos) { + return false; + } + + var currentNums = currentPos.split('-'); + var targetNums = targetPos.split('-'); + + return currentNums.length <= targetNums.length && currentNums.every(function (num, index) { + return num === targetNums[index]; + }); + }; + + Cascader.prototype.processValue = function processValue(value, v, checked) { + var index = value.indexOf(v); + if (checked && index === -1) { + value.push(v); + } else if (!checked && index > -1) { + value.splice(index, 1); + } + }; + + Cascader.prototype.handleSelect = function handleSelect(v, canExpand) { + var _this6 = this; + + if (!(this.props.canOnlySelectLeaf && canExpand)) { + var data = this._v2n[v]; + var nums = data.pos.split('-'); + var selectedPath = nums.slice(1).reduce(function (ret, num, index) { + var p = nums.slice(0, index + 2).join('-'); + ret.push(_this6._p2n[p]); + return ret; + }, []); + + if (this.state.value[0] !== v) { + if (!('value' in this.props)) { + this.setState({ + value: [v] + }); + } + + if ('onChange' in this.props) { + this.props.onChange(v, data, { + selectedPath: selectedPath + }); + } + } + + if ('onSelect' in this.props) { + this.props.onSelect(v, data, { + selectedPath: selectedPath + }); + } + } + + if (canExpand) { + if (!this.props.canOnlySelectLeaf) { + this.lastExpandedValue = this.state.expandedValue.slice(0, -1); + } + } else { + this.lastExpandedValue = [].concat(this.state.expandedValue); + } + }; + /*eslint-disable max-statements*/ + + + Cascader.prototype.handleCheck = function handleCheck(v, checked) { + var _this7 = this; + + var _props = this.props, + checkStrictly = _props.checkStrictly, + canOnlyCheckLeaf = _props.canOnlyCheckLeaf; + + var value = [].concat(this.state.value); + + if (checkStrictly || canOnlyCheckLeaf) { + this.processValue(value, v, checked); + } else { + var pos = this.getPos(v); + + var ps = Object.keys(this._p2n); + + Object(_utils__WEBPACK_IMPORTED_MODULE_11__["forEachEnableNode"])(this._v2n[v], function (node) { + if (node.checkable === false) return; + _this7.processValue(value, node.value, checked); + }); + + var currentPos = pos; + var nums = pos.split('-'); + for (var i = nums.length; i > 2; i--) { + var parentCheck = true; + + var parentPos = nums.slice(0, i - 1).join('-'); + if (this._p2n[parentPos].disabled || this._p2n[parentPos].checkboxDisabled || this._p2n[parentPos].checkable === false) { + currentPos = parentPos; + continue; + } + + var parentValue = this._p2n[parentPos].value; + var parentChecked = value.indexOf(parentValue) > -1; + if (!checked && !parentChecked) { + break; + } + + for (var j = 0; j < ps.length; j++) { + var p = ps[j]; + var pnode = this._p2n[p]; + if (Object(_utils__WEBPACK_IMPORTED_MODULE_11__["isSiblingOrSelf"])(currentPos, p) && !pnode.disabled && !pnode.checkboxDisabled) { + var k = pnode.value; + // eslint-disable-next-line max-depth + if (pnode.checkable === false) { + // eslint-disable-next-line max-depth + if (!pnode.children || pnode.children.length === 0) { + continue; + } + // eslint-disable-next-line max-depth + for (var m = 0; m < pnode.children.length; m++) { + // eslint-disable-next-line max-depth + if (!pnode.children.every(function (child) { + return Object(_utils__WEBPACK_IMPORTED_MODULE_11__["isNodeChecked"])(child, value); + })) { + parentCheck = false; + break; + } + } + } else if (value.indexOf(k) === -1) { + parentCheck = false; + } + + if (!parentCheck) break; + } + } + + this.processValue(value, parentValue, parentCheck); + + currentPos = parentPos; + } + } + + if (!('value' in this.props)) { + this.setState({ + value: value + }); + } + + if ('onChange' in this.props) { + if (checkStrictly || canOnlyCheckLeaf) { + var data = this.getData(value); + this.props.onChange(value, data, { + checked: checked, + currentData: this._v2n[v], + checkedData: data + }); + } else { + var flatValue = this.flatValue(value); + var flatData = this.getData(flatValue); + var checkedData = this.getData(value); + var indeterminateValue = this.getIndeterminate(value); + var indeterminateData = this.getData(indeterminateValue); + this.props.onChange(flatValue, flatData, { + checked: checked, + currentData: this._v2n[v], + checkedData: checkedData, + indeterminateData: indeterminateData + }); + } + } + + this.lastExpandedValue = [].concat(this.state.expandedValue); + }; + + Cascader.prototype.handleExpand = function handleExpand(value, level, canExpand, focusedFirstChild) { + var _this8 = this; + + var expandedValue = this.state.expandedValue; + + + if (canExpand || expandedValue.length > level) { + if (canExpand) { + expandedValue.splice(level, expandedValue.length - level, value); + } else { + expandedValue.splice(level); + } + + var callback = function callback() { + _this8.setExpandValue(expandedValue); + + if (focusedFirstChild) { + var endExpandedValue = expandedValue[expandedValue.length - 1]; + _this8.setState({ + focusedValue: _this8._v2n[endExpandedValue].children[0].value + }); + } + }; + + var loadData = this.props.loadData; + + if (canExpand && loadData) { + var data = this._v2n[value]; + return loadData(data, data._source).then(callback); + } else { + return callback(); + } + } + }; + + Cascader.prototype.handleMouseLeave = function handleMouseLeave() { + this.setExpandValue([].concat(this.lastExpandedValue)); + }; + + Cascader.prototype.setExpandValue = function setExpandValue(expandedValue) { + if (!('expandedValue' in this.props)) { + this.setState({ + expandedValue: expandedValue + }); + } + + if ('onExpand' in this.props) { + this.props.onExpand(expandedValue); + } + }; + + Cascader.prototype.getFirstFocusKeyByDataSource = function getFirstFocusKeyByDataSource(dataSource) { + if (!dataSource || dataSource.length === 0) { + return ''; + } + + for (var i = 0; i < dataSource.length; i++) { + if (dataSource[i] && !dataSource[i].disabled) { + return dataSource[i].value; + } + } + + return ''; + }; + + Cascader.prototype.getFirstFocusKeyByFilteredPaths = function getFirstFocusKeyByFilteredPaths(filteredPaths) { + if (!filteredPaths || filteredPaths.length === 0) { + return ''; + } + + for (var i = 0; i < filteredPaths.length; i++) { + var path = filteredPaths[i]; + if (!path.some(function (item) { + return item.disabled; + })) { + var lastItem = path[path.length - 1]; + return lastItem.value; + } + } + + return ''; + }; + + Cascader.prototype.getFirstFocusKey = function getFirstFocusKey() { + var _props2 = this.props, + dataSource = _props2.dataSource, + searchValue = _props2.searchValue, + filteredPaths = _props2.filteredPaths; + + + return !searchValue ? this.getFirstFocusKeyByDataSource(dataSource) : this.getFirstFocusKeyByFilteredPaths(filteredPaths); + }; + + Cascader.prototype.setFocusValue = function setFocusValue() { + this.setState({ + focusedValue: this.getFirstFocusKey() + }); + }; + + Cascader.prototype.handleFocus = function handleFocus(focusedValue) { + this.setState({ + focusedValue: focusedValue + }); + }; + + Cascader.prototype.handleFold = function handleFold() { + var expandedValue = this.state.expandedValue; + + if (expandedValue.length > 0) { + this.setExpandValue(expandedValue.slice(0, -1)); + } + + this.setState({ + focusedValue: expandedValue[expandedValue.length - 1] + }); + }; + + Cascader.prototype.getIndeterminate = function getIndeterminate(value) { + var _this9 = this; + + var indeterminateValues = []; + + var poss = Object(_utils__WEBPACK_IMPORTED_MODULE_11__["filterChildValue"])(value.filter(function (v) { + return !!_this9._v2n[v]; + }).filter(function (v) { + return !_this9._v2n[v].disabled && !_this9._v2n[v].checkboxDisabled && _this9._v2n[v].checkable !== false; + }), this._v2n, this._p2n).map(function (v) { + return _this9._v2n[v].pos; + }); + poss.forEach(function (pos) { + var nums = pos.split('-'); + for (var i = nums.length; i > 2; i--) { + var parentPos = nums.slice(0, i - 1).join('-'); + var parent = _this9._p2n[parentPos]; + if (parent.disabled || parent.checkboxDisabled) break; + var parentValue = parent.value; + if (indeterminateValues.indexOf(parentValue) === -1) { + indeterminateValues.push(parentValue); + } + } + }); + + return indeterminateValues; + }; + + Cascader.prototype.onBlur = function onBlur(e) { + this.setState({ + focusedValue: undefined + }); + + this.props.onBlur && this.props.onBlur(e); + }; + + Cascader.prototype.renderMenu = function renderMenu(data, level) { + var _this10 = this; + + var _props3 = this.props, + prefix = _props3.prefix, + multiple = _props3.multiple, + useVirtual = _props3.useVirtual, + checkStrictly = _props3.checkStrictly, + expandTriggerType = _props3.expandTriggerType, + loadData = _props3.loadData, + canOnlyCheckLeaf = _props3.canOnlyCheckLeaf, + listClassName = _props3.listClassName, + listStyle = _props3.listStyle, + itemRender = _props3.itemRender; + var _state = this.state, + value = _state.value, + expandedValue = _state.expandedValue, + focusedValue = _state.focusedValue; + + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + _menu__WEBPACK_IMPORTED_MODULE_9__["default"], + { + key: level, + prefix: prefix, + useVirtual: useVirtual, + className: listClassName, + style: listStyle, + ref: this.saveMenuRef, + focusedKey: focusedValue, + onItemFocus: this.handleFocus, + onBlur: this.onBlur + }, + data.map(function (item) { + var disabled = !!item.disabled; + var canExpand = !!item.children && !!item.children.length || !!loadData && !item.isLeaf; + var expanded = expandedValue[level] === item.value; + var props = { + prefix: prefix, + disabled: disabled, + canExpand: canExpand, + expanded: expanded, + expandTriggerType: expandTriggerType, + onExpand: _this10.handleExpand.bind(_this10, item.value, level, canExpand), + onFold: _this10.handleFold + }; + + if (multiple) { + props.checkable = !(canOnlyCheckLeaf && canExpand); + props.checked = value.indexOf(item.value) > -1 || !!item.checked; + props.indeterminate = (checkStrictly || canOnlyCheckLeaf ? false : _this10.indeterminate.indexOf(item.value) > -1) || !!item.indeterminate; + props.checkboxDisabled = !!item.checkboxDisabled; + props.onCheck = _this10.handleCheck.bind(_this10, item.value); + } else { + props.selected = value[0] === item.value; + props.onSelect = _this10.handleSelect.bind(_this10, item.value, canExpand); + } + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + _item__WEBPACK_IMPORTED_MODULE_10__["default"], + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ key: item.value }, props), + itemRender(item) + ); + }) + ); + }; + + Cascader.prototype.renderMenus = function renderMenus() { + var dataSource = this.props.dataSource; + var expandedValue = this.state.expandedValue; + + + var menus = []; + var data = dataSource; + + for (var i = 0; i <= expandedValue.length; i++) { + if (!data) { + break; + } + + menus.push(this.renderMenu(data, i)); + + var expandedItem = void 0; + for (var j = 0; j < data.length; j++) { + if (data[j].value === expandedValue[i]) { + expandedItem = data[j]; + break; + } + } + data = expandedItem ? expandedItem.children : null; + } + + return menus; + }; + + Cascader.prototype.renderFilteredItem = function renderFilteredItem(path) { + var _props4 = this.props, + prefix = _props4.prefix, + resultRender = _props4.resultRender, + searchValue = _props4.searchValue, + multiple = _props4.multiple; + var value = this.state.value; + + var lastItem = path[path.length - 1]; + + var Item = void 0; + var props = { + key: lastItem.value, + className: prefix + 'cascader-filtered-item', + disabled: path.some(function (item) { + return item.disabled; + }), + children: resultRender(searchValue, path) + }; + + if (multiple) { + Item = _menu__WEBPACK_IMPORTED_MODULE_7__["default"].CheckboxItem; + var _props5 = this.props, + checkStrictly = _props5.checkStrictly, + canOnlyCheckLeaf = _props5.canOnlyCheckLeaf; + + props.checked = value.indexOf(lastItem.value) > -1; + props.indeterminate = !checkStrictly && !canOnlyCheckLeaf && this.indeterminate.indexOf(lastItem.value) > -1; + props.checkboxDisabled = lastItem.checkboxDisabled; + props.onChange = this.handleCheck.bind(this, lastItem.value); + } else { + Item = _menu__WEBPACK_IMPORTED_MODULE_7__["default"].Item; + props.selected = value[0] === lastItem.value; + props.onSelect = this.handleSelect.bind(this, lastItem.value, false); + } + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(Item, props); + }; + + Cascader.prototype.renderFilteredList = function renderFilteredList() { + var _this11 = this; + + var _props6 = this.props, + prefix = _props6.prefix, + filteredListStyle = _props6.filteredListStyle, + filteredPaths = _props6.filteredPaths; + var focusedValue = this.state.focusedValue; + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + _menu__WEBPACK_IMPORTED_MODULE_7__["default"], + { + focusedKey: focusedValue, + onItemFocus: this.handleFocus, + className: prefix + 'cascader-filtered-list', + style: filteredListStyle + }, + filteredPaths.map(function (path) { + return _this11.renderFilteredItem(path); + }) + ); + }; + + Cascader.prototype.render = function render() { + var _cx; + + var _props7 = this.props, + prefix = _props7.prefix, + rtl = _props7.rtl, + className = _props7.className, + expandTriggerType = _props7.expandTriggerType, + multiple = _props7.multiple, + dataSource = _props7.dataSource, + checkStrictly = _props7.checkStrictly, + canOnlyCheckLeaf = _props7.canOnlyCheckLeaf, + searchValue = _props7.searchValue; + + var others = pickOthers(Object.keys(Cascader.propTypes), this.props); + var value = this.state.value; + + + if (rtl) { + others.dir = 'rtl'; + } + + var props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + className: classnames__WEBPACK_IMPORTED_MODULE_6___default()((_cx = {}, _cx[prefix + 'cascader'] = true, _cx.multiple = multiple, _cx[className] = !!className, _cx)), + ref: 'cascader' + }, others); + if (expandTriggerType === 'hover') { + props.onMouseLeave = this.handleMouseLeave; + } + + if (multiple && !checkStrictly && !canOnlyCheckLeaf) { + this.indeterminate = this.getIndeterminate(value); + } + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, props, { ref: this.getCascaderNode }), + !searchValue ? react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + { className: prefix + 'cascader-inner' }, + dataSource && dataSource.length ? this.renderMenus() : null + ) : this.renderFilteredList() + ); + }; + + return Cascader; +}(react__WEBPACK_IMPORTED_MODULE_4__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + pure: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + className: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + /** + * 数据源,结构可参考下方说明 + */ + dataSource: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object), + /** + * (非受控)默认值 + */ + defaultValue: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string)]), + /** + * (受控)当前值 + */ + value: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string)]), + /** + * 选中值改变时触发的回调函数 + * @param {String|Array} value 选中的值,单选时返回单个值,多选时返回数组 + * @param {Object|Array} data 选中的数据,包括 value 和 label,单选时返回单个值,多选时返回数组,父子节点选中关联时,同时选中,只返回父节点 + * @param {Object} extra 额外参数 + * @param {Array} extra.selectedPath 单选时选中的数据的路径 + * @param {Boolean} extra.checked 多选时当前的操作是选中还是取消选中 + * @param {Object} extra.currentData 多选时当前操作的数据 + * @param {Array} extra.checkedData 多选时所有被选中的数据 + * @param {Array} extra.indeterminateData 多选时半选的数据 + */ + onChange: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + onSelect: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * (非受控)默认展开值,如果不设置,组件内部会根据 defaultValue/value 进行自动设置 + */ + defaultExpandedValue: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string), + /** + * (受控)当前展开值 + */ + expandedValue: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string), + /** + * 展开触发的方式 + */ + expandTriggerType: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOf(['click', 'hover']), + /** + * 展开时触发的回调函数 + * @param {Array} expandedValue 各列展开值的数组 + */ + onExpand: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * 是否开启虚拟滚动 + */ + useVirtual: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 是否多选 + */ + multiple: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 单选时是否只能选中叶子节点 + */ + canOnlySelectLeaf: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 多选时是否只能选中叶子节点 + */ + canOnlyCheckLeaf: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 父子节点是否选中不关联 + */ + checkStrictly: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 每列列表样式对象 + */ + listStyle: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, + /** + * 每列列表类名 + */ + listClassName: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + /** + * 每列列表项渲染函数 + * @param {Object} data 数据 + * @return {ReactNode} 列表项内容 + */ + itemRender: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * 异步加载数据函数 + * @param {Object} data 当前点击异步加载的数据 + * @param {Object} source 当前点击数据,source是原始对象 + */ + loadData: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + searchValue: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + onBlur: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + filteredPaths: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.array, + filteredListStyle: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, + resultRender: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func +}, _class.defaultProps = { + prefix: 'next-', + rtl: false, + pure: false, + dataSource: [], + defaultValue: null, + canOnlySelectLeaf: false, + canOnlyCheckLeaf: false, + expandTriggerType: 'click', + multiple: false, + useVirtual: false, + checkStrictly: false, + itemRender: function itemRender(item) { + return item.label; + } +}, _temp); +Cascader.displayName = 'Cascader'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/index.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/index.js ***! + \****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _cascader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cascader */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/cascader.js"); + + + + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_2__["default"].config(_cascader__WEBPACK_IMPORTED_MODULE_3__["default"], { + transform: /* istanbul ignore next */function transform(props, deprecated) { + if ('expandTrigger' in props) { + deprecated('expandTrigger', 'expandTriggerType', 'Cascader'); + + var _props = props, + expandTrigger = _props.expandTrigger, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['expandTrigger']); + + props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ expandTriggerType: expandTrigger }, others); + } + + if ('showItemCount' in props) { + deprecated('showItemCount', 'listStyle | listClassName', 'Cascader'); + } + if ('labelWidth' in props) { + deprecated('labelWidth', 'listStyle | listClassName', 'Cascader'); + } + + return props; + }, + exportNames: ['setFocusValue'] +})); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/item.js": +/*!***************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/item.js ***! + \***************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CascaderMenuItem; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../menu */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/menu/index.js"); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../icon */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); + + + + + +var _class, _temp; + + + + + + + + +var bindCtx = _util__WEBPACK_IMPORTED_MODULE_9__["func"].bindCtx; +var pickOthers = _util__WEBPACK_IMPORTED_MODULE_9__["obj"].pickOthers; +var CascaderMenuItem = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(CascaderMenuItem, _Component); + + function CascaderMenuItem(props) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, CascaderMenuItem); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _Component.call(this, props)); + + _this.state = { + loading: false + }; + + bindCtx(_this, ['handleExpand', 'handleClick', 'handleMouseEnter', 'handleKeyDown', 'removeLoading']); + return _this; + } + + CascaderMenuItem.prototype.addLoading = function addLoading() { + this.setState({ + loading: true + }); + }; + + CascaderMenuItem.prototype.removeLoading = function removeLoading() { + this.setState({ + loading: false + }); + }; + + CascaderMenuItem.prototype.setLoadingIfNeed = function setLoadingIfNeed(p) { + if (p && typeof p.then === 'function') { + this.addLoading(); + p.then(this.removeLoading).catch(this.removeLoading); + } + }; + + CascaderMenuItem.prototype.handleExpand = function handleExpand(focusedFirstChild) { + this.setLoadingIfNeed(this.props.onExpand(focusedFirstChild)); + }; + + CascaderMenuItem.prototype.handleClick = function handleClick() { + this.handleExpand(false); + }; + + CascaderMenuItem.prototype.handleMouseEnter = function handleMouseEnter() { + this.handleExpand(false); + }; + + CascaderMenuItem.prototype.handleKeyDown = function handleKeyDown(e) { + if (!this.props.disabled) { + if (e.keyCode === _util__WEBPACK_IMPORTED_MODULE_9__["KEYCODE"].RIGHT || e.keyCode === _util__WEBPACK_IMPORTED_MODULE_9__["KEYCODE"].ENTER) { + if (this.props.canExpand) { + this.handleExpand(true); + } + } else if (e.keyCode === _util__WEBPACK_IMPORTED_MODULE_9__["KEYCODE"].LEFT || e.keyCode === _util__WEBPACK_IMPORTED_MODULE_9__["KEYCODE"].ESC) { + this.props.onFold(); + } else if (e.keyCode === _util__WEBPACK_IMPORTED_MODULE_9__["KEYCODE"].SPACE) { + this.handleExpand(false); + } + } + }; + + CascaderMenuItem.prototype.render = function render() { + var _cx; + + var _props = this.props, + prefix = _props.prefix, + className = _props.className, + menu = _props.menu, + disabled = _props.disabled, + selected = _props.selected, + onSelect = _props.onSelect, + expanded = _props.expanded, + canExpand = _props.canExpand, + expandTriggerType = _props.expandTriggerType, + checkable = _props.checkable, + checked = _props.checked, + indeterminate = _props.indeterminate, + checkboxDisabled = _props.checkboxDisabled, + onCheck = _props.onCheck, + children = _props.children; + + var others = pickOthers(Object.keys(CascaderMenuItem.propTypes), this.props); + var loading = this.state.loading; + + + var itemProps = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + className: classnames__WEBPACK_IMPORTED_MODULE_6___default()((_cx = {}, _cx[prefix + 'cascader-menu-item'] = true, _cx[prefix + 'expanded'] = expanded, _cx[className] = !!className, _cx)), + disabled: disabled, + menu: menu, + onKeyDown: this.handleKeyDown, + role: 'option' + }, others); + if (!disabled) { + if (expandTriggerType === 'hover') { + itemProps.onMouseEnter = this.handleMouseEnter; + } else { + itemProps.onClick = this.handleClick; + } + } + + var Item = void 0; + if (checkable) { + Item = _menu__WEBPACK_IMPORTED_MODULE_7__["default"].CheckboxItem; + itemProps.checked = checked; + itemProps.indeterminate = indeterminate; + itemProps.checkboxDisabled = checkboxDisabled; + itemProps.onChange = onCheck; + } else { + Item = _menu__WEBPACK_IMPORTED_MODULE_7__["default"].Item; + itemProps.selected = selected; + itemProps.onSelect = onSelect; + } + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + Item, + itemProps, + children, + canExpand ? loading ? react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_8__["default"], { + className: prefix + 'cascader-menu-icon-right ' + prefix + 'cascader-menu-icon-loading', + type: 'loading' + }) : react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_8__["default"], { + className: prefix + 'cascader-menu-icon-right ' + prefix + 'cascader-menu-icon-expand', + type: 'arrow-right' + }) : null + ); + }; + + return CascaderMenuItem; +}(react__WEBPACK_IMPORTED_MODULE_4__["Component"]), _class.menuChildType = 'item', _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + className: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + disabled: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + selected: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + onSelect: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + expanded: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + canExpand: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + menu: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.any, + expandTriggerType: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOf(['click', 'hover']), + onExpand: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + onFold: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + checkable: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + checked: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + indeterminate: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + checkboxDisabled: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + onCheck: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + children: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node +}, _temp); +CascaderMenuItem.displayName = 'CascaderMenuItem'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/main.scss": +/*!*****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/main.scss ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694896300 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/menu.js": +/*!***************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/menu.js ***! + \***************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CascaderMenu; }); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-dom */ "./node_modules/_react-dom@16.12.0@react-dom/index.js"); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../menu */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/menu/index.js"); +/* harmony import */ var _virtual_list__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../virtual-list */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/virtual-list/index.js"); + + + + + + +var _class, _temp; + + + + + + + +var CascaderMenu = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(CascaderMenu, _Component); + + function CascaderMenu() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, CascaderMenu); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.apply(this, arguments)); + } + + CascaderMenu.prototype.componentDidMount = function componentDidMount() { + this.scrollToSelectedItem(); + }; + + CascaderMenu.prototype.scrollToSelectedItem = function scrollToSelectedItem() { + var _props = this.props, + prefix = _props.prefix, + useVirtual = _props.useVirtual, + children = _props.children; + + if (!children || children.length === 0) { + return; + } + var selectedIndex = children.findIndex(function (item) { + return !!item.props.checked || !!item.props.selected || !!item.props.expanded; + }); + + if (selectedIndex === -1) { + return; + } + + if (useVirtual) { + var instance = this.refs.virtual.getInstance(); + setTimeout(function () { + return instance.scrollTo(selectedIndex); + }, 0); + } else { + var itemSelector = '.' + prefix + 'menu-item'; + var menu = Object(react_dom__WEBPACK_IMPORTED_MODULE_7__["findDOMNode"])(this.refs.menu); + var targetItem = menu.querySelectorAll(itemSelector)[selectedIndex]; + if (targetItem) { + menu.scrollTop = targetItem.offsetTop - Math.floor((menu.clientHeight / targetItem.clientHeight - 1) / 2) * targetItem.clientHeight; + } + } + }; + + CascaderMenu.prototype.renderMenu = function renderMenu(items, ref, props) { + var _this2 = this; + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + _menu__WEBPACK_IMPORTED_MODULE_8__["default"], + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({ ref: ref, role: 'listbox' }, props), + items.map(function (node) { + if (react__WEBPACK_IMPORTED_MODULE_5___default.a.isValidElement(node) && node.type.menuChildType === 'item') { + return react__WEBPACK_IMPORTED_MODULE_5___default.a.cloneElement(node, { + menu: _this2 + }); + } + + return node; + }) + ); + }; + + CascaderMenu.prototype.render = function render() { + var _this3 = this; + + var _props2 = this.props, + prefix = _props2.prefix, + useVirtual = _props2.useVirtual, + className = _props2.className, + style = _props2.style, + children = _props2.children, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default()(_props2, ['prefix', 'useVirtual', 'className', 'style', 'children']); + + var menuProps = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({ + labelToggleChecked: false, + className: prefix + 'cascader-menu' + }, others); + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { + ref: 'menu', + className: prefix + 'cascader-menu-wrapper ' + (className ? className : ''), + style: style + }, + useVirtual ? react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + _virtual_list__WEBPACK_IMPORTED_MODULE_9__["default"], + { + ref: 'virtual', + itemsRenderer: function itemsRenderer(items, ref) { + return _this3.renderMenu(items, ref, menuProps); + } + }, + children + ) : this.renderMenu(children, undefined, menuProps) + ); + }; + + return CascaderMenu; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + useVirtual: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + children: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node +}, _temp); +CascaderMenu.displayName = 'CascaderMenu'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/style.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/style.js ***! + \****************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _menu_style_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../menu/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/menu/style.js"); +/* harmony import */ var _icon_style_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../icon/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/style.js"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_2__); + + + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/utils.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/cascader/utils.js ***! + \****************************************************************************/ +/*! exports provided: normalizeToArray, isNodeChecked, forEachEnableNode, isNodeDisabledChecked, getCheckableParentNode, filterChildValue, filterParentValue, isDescendantOrSelf, isSiblingOrSelf, getAllCheckedValues */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeToArray", function() { return normalizeToArray; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNodeChecked", function() { return isNodeChecked; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEachEnableNode", function() { return forEachEnableNode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNodeDisabledChecked", function() { return isNodeDisabledChecked; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCheckableParentNode", function() { return getCheckableParentNode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filterChildValue", function() { return filterChildValue; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filterParentValue", function() { return filterParentValue; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDescendantOrSelf", function() { return isDescendantOrSelf; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSiblingOrSelf", function() { return isSiblingOrSelf; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllCheckedValues", function() { return getAllCheckedValues; }); +/* eslint-disable valid-jsdoc */ +function normalizeToArray(values) { + if (values !== undefined && values !== null) { + if (Array.isArray(values)) { + return [].concat(values); + } + + return [values]; + } + + return []; +} + +/** + * 判断子节点是否是选中状态,如果 checkable={false} 则向下递归, + * @param {Node} child + * @param {Array} checkedValues + */ +function isNodeChecked(node, checkedValues) { + if (node.disabled || node.checkboxDisabled) return true; + /* istanbul ignore next */ + if (node.checkable === false) { + return !node.children || node.children.length === 0 || node.children.every(function (c) { + return isNodeChecked(c, checkedValues); + }); + } + return checkedValues.indexOf(node.value) > -1; +} + +/** + * 遍历所有可用的子节点 + * @param {Node} + * @param {Function} callback + */ +function forEachEnableNode(node) { + var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + + if (node.disabled || node.checkboxDisabled) return; + // eslint-disable-next-line callback-return + callback(node); + if (node.children && node.children.length > 0) { + node.children.forEach(function (child) { + return forEachEnableNode(child, callback); + }); + } +} +/** + * 判断节点是否禁用checked + * @param {Node} node + * @returns {Boolean} + */ +function isNodeDisabledChecked(node) { + if (node.disabled || node.checkboxDisabled) return true; + /* istanbul ignore next */ + if (node.checkable === false) { + return !node.children || node.children.length === 0 || node.children.every(isNodeDisabledChecked); + } + + return false; +} + +/** + * 递归获取一个 checkable = {true} 的父节点,当 checkable={false} 时继续往上查找 + * @param {Node} node + * @param {Map} _p2n + * @return {Node} + */ +function getCheckableParentNode(node, _p2n) { + var parentPos = node.pos.split(['-']); + if (parentPos.length === 2) return node; + parentPos.splice(parentPos.length - 1, 1); + parentPos = parentPos.join('-'); + var parentNode = _p2n[parentPos]; + if (parentNode.disabled || parentNode.checkboxDisabled) return false; + /* istanbul ignore next */ + if (parentNode.checkable === false) { + return getCheckableParentNode(parentNode, _p2n); + } + + return parentNode; +} +/** + * 过滤子节点 + * @param {Array} values + * @param {Object} _v2n + */ +function filterChildValue(values, _v2n, _p2n) { + var newValues = []; + values.forEach(function (value) { + var node = getCheckableParentNode(_v2n[value], _p2n); + if (!node || node.checkable === false || node === _v2n[value] || values.indexOf(node.value) === -1) { + newValues.push(value); + } + }); + return newValues; +} + +function filterParentValue(values, _v2n) { + var newValues = []; + + for (var i = 0; i < values.length; i++) { + var node = _v2n[values[i]]; + if (!node.children || node.children.length === 0 || node.children.every(isNodeDisabledChecked)) { + newValues.push(values[i]); + } + } + + return newValues; +} + +function isDescendantOrSelf(currentPos, targetPos) { + if (!currentPos || !targetPos) { + return false; + } + + var currentNums = currentPos.split('-'); + var targetNums = targetPos.split('-'); + + return currentNums.length <= targetNums.length && currentNums.every(function (num, index) { + return num === targetNums[index]; + }); +} + +function isSiblingOrSelf(currentPos, targetPos) { + var currentNums = currentPos.split('-').slice(0, -1); + var targetNums = targetPos.split('-').slice(0, -1); + + return currentNums.length === targetNums.length && currentNums.every(function (num, index) { + return num === targetNums[index]; + }); +} + +// eslint-disable-next-line max-statements +function getAllCheckedValues(checkedValues, _v2n, _p2n) { + checkedValues = normalizeToArray(checkedValues); + var filteredValues = checkedValues.filter(function (value) { + return !!_v2n[value]; + }); + var flatValues = [].concat(filterChildValue(filteredValues, _v2n, _p2n), filteredValues.filter(function (value) { + return _v2n[value].disabled || _v2n[value].checkboxDisabled; + })); + var removeValue = function removeValue(child) { + if (child.disabled || child.checkboxDisabled) return; + if (child.checkable === false && child.children && child.children.length > 0) { + return child.children.forEach(removeValue); + } + flatValues.splice(flatValues.indexOf(child.value), 1); + }; + + var addParentValue = function addParentValue(i, parent) { + return flatValues.splice(i, 0, parent.value); + }; + + var values = [].concat(flatValues); + for (var i = 0; i < values.length; i++) { + var pos = _v2n[values[i]].pos; + var nums = pos.split('-'); + if (nums.length === 2) { + break; + } + for (var j = nums.length - 2; j > 0; j--) { + var parentPos = nums.slice(0, j + 1).join('-'); + var parent = _p2n[parentPos]; + if (parent.checkable === false || parent.disabled || parent.checkboxDisabled) continue; + var parentChecked = parent.children.every(function (child) { + return isNodeChecked(child, flatValues); + }); + if (parentChecked) { + parent.children.forEach(removeValue); + addParentValue(i, parent); + } else { + break; + } + } + } + + var newValues = []; + flatValues.forEach(function (value) { + if (_v2n[value].disabled || _v2n[value].checkboxDisabled) { + newValues.push(value); + return; + } + forEachEnableNode(_v2n[value], function (node) { + if (node.checkable === false) return; + newValues.push(node.value); + }); + }); + + return newValues; +} + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/checkbox/checkbox-group.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/checkbox/checkbox-group.js ***! + \*************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/typeof */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/typeof.js"); +/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _checkbox__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./checkbox */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/checkbox/checkbox.js"); + + + + + + +var _class, _temp; + + + + + + + + +var pickOthers = _util__WEBPACK_IMPORTED_MODULE_9__["obj"].pickOthers; + +/** Checkbox.Group */ + +var CheckboxGroup = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(CheckboxGroup, _Component); + + function CheckboxGroup(props) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, CheckboxGroup); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.call(this, props)); + + var value = []; + if ('value' in props) { + value = props.value; + } else if ('defaultValue' in props) { + value = props.defaultValue; + } + if (!Array.isArray(value)) { + if (value === null || value === undefined) { + value = []; + } else { + value = [value]; + } + } + _this.state = { + value: [].concat(value) + }; + + _this.onChange = _this.onChange.bind(_this); + return _this; + } + + CheckboxGroup.prototype.getChildContext = function getChildContext() { + return { + __group__: true, + onChange: this.onChange, + selectedValue: this.state.value, + disabled: this.props.disabled + }; + }; + + CheckboxGroup.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if ('value' in nextProps) { + var value = nextProps.value; + + if (!Array.isArray(value)) { + if (value === null || value === undefined) { + value = []; + } else { + value = [value]; + } + } + this.setState({ + value: value + }); + } + }; + + CheckboxGroup.prototype.onChange = function onChange(currentValue, e) { + var value = this.state.value; + + var index = value.indexOf(currentValue); + var valTemp = [].concat(value); + + if (index === -1) { + valTemp.push(currentValue); + } else { + valTemp.splice(index, 1); + } + + if (!('value' in this.props)) { + this.setState({ value: valTemp }); + } + this.props.onChange(valTemp, e); + }; + + CheckboxGroup.prototype.render = function render() { + var _this2 = this, + _classnames; + + var _props = this.props, + className = _props.className, + style = _props.style, + prefix = _props.prefix, + disabled = _props.disabled, + itemDirection = _props.itemDirection, + rtl = _props.rtl, + isPreview = _props.isPreview, + renderPreview = _props.renderPreview; + + var others = pickOthers(CheckboxGroup.propTypes, this.props); + + // 如果内嵌标签跟dataSource同时存在,以内嵌标签为主 + var children = void 0; + var previewed = []; + if (this.props.children) { + children = react__WEBPACK_IMPORTED_MODULE_5___default.a.Children.map(this.props.children, function (child) { + if (!react__WEBPACK_IMPORTED_MODULE_5___default.a.isValidElement(child)) { + return child; + } + var checked = _this2.state.value && _this2.state.value.indexOf(child.props.value) > -1; + + if (checked) { + previewed.push({ + label: child.props.children, + value: child.props.value + }); + } + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.cloneElement(child, child.props.rtl === undefined ? { rtl: rtl } : null); + }); + } else { + children = this.props.dataSource.map(function (item, index) { + var option = item; + if ((typeof item === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default()(item)) !== 'object') { + option = { + label: item, + value: item, + disabled: disabled + }; + } + var checked = _this2.state.value && _this2.state.value.indexOf(option.value) > -1; + + if (checked) { + previewed.push({ + label: option.label, + value: option.value + }); + } + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_checkbox__WEBPACK_IMPORTED_MODULE_10__["default"], { + key: index, + value: option.value, + checked: checked, + rtl: rtl, + disabled: disabled || option.disabled, + label: option.label + }); + }); + } + + if (isPreview) { + var previewCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()(className, prefix + 'form-preview'); + + if ('renderPreview' in this.props) { + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { + dir: rtl ? 'rtl' : undefined, + className: previewCls + }), + renderPreview(previewed, this.props) + ); + } + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'p', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others, { + dir: rtl ? 'rtl' : undefined, + className: previewCls + }), + previewed.map(function (item) { + return item.label; + }).join(', ') + ); + } + + var cls = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classnames = {}, _classnames[prefix + 'checkbox-group'] = true, _classnames[prefix + 'checkbox-group-' + itemDirection] = true, _classnames[className] = !!className, _classnames.disabled = disabled, _classnames)); + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'span', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + dir: rtl ? 'rtl' : undefined + }, others, { + className: cls, + style: style + }), + children + ); + }; + + return CheckboxGroup; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 自定义类名 + */ + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 自定义内敛样式 + */ + style: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 整体禁用 + */ + disabled: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 可选项列表, 数据项可为 String 或者 Object, 如 `['apple', 'pear', 'orange']` 或者 `[{value: 'apple', label: '苹果',}, {value: 'pear', label: '梨'}, {value: 'orange', label: '橙子'}]` + */ + dataSource: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string), prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object)]), + /** + * 被选中的值列表 + */ + value: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.array, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.number]), + /** + * 默认被选中的值列表 + */ + defaultValue: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.array, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.number]), + /** + * 通过子元素方式设置内部 checkbox + */ + children: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.element), + /** + * 选中值改变时的事件 + * @param {Array} value 选中项列表 + * @param {Event} e Dom 事件对象 + */ + onChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + + /** + * 子项目的排列方式 + * - hoz: 水平排列 (default) + * - ver: 垂直排列 + */ + itemDirection: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['hoz', 'ver']), + /** + * 是否为预览态 + */ + isPreview: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 预览态模式下渲染的内容 + * @param {number} value 评分值 + */ + renderPreview: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func +}, _class.defaultProps = { + dataSource: [], + onChange: function onChange() {}, + prefix: 'next-', + itemDirection: 'hoz', + isPreview: false +}, _class.childContextTypes = { + onChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + __group__: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + selectedValue: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.array, + disabled: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool +}, _temp); +CheckboxGroup.displayName = 'CheckboxGroup'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_8__["default"].config(CheckboxGroup)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/checkbox/checkbox.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/checkbox/checkbox.js ***! + \*******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _mixin_ui_state__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../mixin-ui-state */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/mixin-ui-state/index.js"); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../icon */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); + + + + + + +var _class, _temp; + + + + + + + + + +var noop = _util__WEBPACK_IMPORTED_MODULE_11__["func"].noop; +function isChecked(selectedValue, value) { + return selectedValue.indexOf(value) > -1; +} +/** + * Checkbox + * @order 1 + */ +var Checkbox = (_temp = _class = function (_UIState) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Checkbox, _UIState); + + function Checkbox(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Checkbox); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _UIState.call(this, props)); + + var checked = void 0, + indeterminate = void 0; + + if ('checked' in props) { + checked = props.checked; + } else { + checked = props.defaultChecked; + } + + if ('indeterminate' in props) { + indeterminate = props.indeterminate; + } else { + indeterminate = props.defaultIndeterminate; + } + if (context.__group__) { + checked = isChecked(context.selectedValue, props.value); + } + _this.state = { + checked: checked, + indeterminate: indeterminate + }; + + _this.disabled = props.disabled || context.__group__ && 'disabled' in context && context.disabled; + _this.onChange = _this.onChange.bind(_this); + return _this; + } + + Checkbox.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) { + if (nextContext.__group__) { + if ('selectedValue' in nextContext) { + this.setState({ + checked: isChecked(nextContext.selectedValue, nextProps.value) + }); + } + + this.disabled = nextProps.disabled || 'disabled' in nextContext && nextContext.disabled; + } else { + if ('checked' in nextProps) { + this.setState({ + checked: nextProps.checked + }); + } + this.disabled = nextProps.disabled; + } + + if ('indeterminate' in nextProps) { + this.setState({ + indeterminate: nextProps.indeterminate + }); + } + }; + + Checkbox.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState, nextContext) { + var shallowEqual = _util__WEBPACK_IMPORTED_MODULE_11__["obj"].shallowEqual; + + return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState) || !shallowEqual(this.context, nextContext); + }; + + Checkbox.prototype.onChange = function onChange(e) { + var checked = e.target.checked; + var value = this.props.value; + if (this.disabled) { + return; + } + if (this.context.__group__) { + this.context.onChange(value, e); + } else { + if (!('checked' in this.props)) { + this.setState({ + checked: checked + }); + } + + if (!('indeterminate' in this.props)) { + this.setState({ + indeterminate: false + }); + } + this.props.onChange(checked, e); + } + }; + + Checkbox.prototype.render = function render() { + var _classnames; + + /* eslint-disable no-unused-vars */ + var _props = this.props, + id = _props.id, + className = _props.className, + children = _props.children, + style = _props.style, + label = _props.label, + onMouseEnter = _props.onMouseEnter, + onMouseLeave = _props.onMouseLeave, + rtl = _props.rtl, + isPreview = _props.isPreview, + renderPreview = _props.renderPreview, + otherProps = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['id', 'className', 'children', 'style', 'label', 'onMouseEnter', 'onMouseLeave', 'rtl', 'isPreview', 'renderPreview']); + + var checked = !!this.state.checked; + var disabled = this.disabled; + var indeterminate = !!this.state.indeterminate; + var prefix = this.context.prefix || this.props.prefix; + + var others = _util__WEBPACK_IMPORTED_MODULE_11__["obj"].pickOthers(Checkbox.propTypes, otherProps); + var othersData = _util__WEBPACK_IMPORTED_MODULE_11__["obj"].pickAttrsWith(others, 'data-'); + if (otherProps.title) { + othersData.title = otherProps.title; + } + + var childInput = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement('input', babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _util__WEBPACK_IMPORTED_MODULE_11__["obj"].pickOthers(Checkbox.propTypes, otherProps), { + id: id, + disabled: disabled, + checked: checked, + type: 'checkbox', + onChange: this.onChange, + 'aria-checked': indeterminate ? 'mixed' : checked, + className: prefix + 'checkbox-input' + })); + + // disable 无状态操作 + if (!disabled) { + childInput = this.getStateElement(childInput); + } + var cls = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classnames = {}, _classnames[prefix + 'checkbox-wrapper'] = true, _classnames[className] = !!className, _classnames.checked = checked, _classnames.disabled = disabled, _classnames.indeterminate = indeterminate, _classnames[this.getStateClassName()] = true, _classnames)); + var labelCls = prefix + 'checkbox-label'; + var type = indeterminate ? 'semi-select' : 'select'; + + if (isPreview) { + var previewCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()(className, prefix + 'form-preview'); + if ('renderPreview' in this.props) { + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + id: id, + dir: rtl ? 'rtl' : undefined + }, othersData, { + className: previewCls + }), + renderPreview(checked, this.props) + ); + } + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'p', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + id: id, + dir: rtl ? 'rtl' : undefined + }, othersData, { + className: previewCls + }), + checked && (children || label || this.state.value) + ); + } + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'label', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, othersData, { + className: cls, + style: style, + dir: rtl ? 'rtl' : undefined, + onMouseEnter: onMouseEnter, + onMouseLeave: onMouseLeave + }), + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'span', + { className: prefix + 'checkbox' }, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'span', + { className: prefix + 'checkbox-inner' }, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_10__["default"], { + type: type, + size: 'xs', + className: indeterminate ? 'zoomIn' : '' + }) + ), + childInput + ), + [label, children].map(function (item, i) { + return [undefined, null].indexOf(item) === -1 ? react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'span', + { key: i, className: labelCls }, + item + ) : null; + }) + ); + }; + + return Checkbox; +}(_mixin_ui_state__WEBPACK_IMPORTED_MODULE_8__["default"]), _class.displayName = 'Checkbox', _class.propTypes = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _config_provider__WEBPACK_IMPORTED_MODULE_9__["default"].propTypes, { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 自定义类名 + */ + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * checkbox id, 挂载在input上 + */ + id: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 自定义内敛样式 + */ + style: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 选中状态 + */ + checked: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 默认选中状态 + */ + defaultChecked: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 禁用 + */ + disabled: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 通过属性配置label, + */ + label: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node, + /** + * Checkbox 的中间状态,只会影响到 Checkbox 的样式,并不影响其 checked 属性 + */ + indeterminate: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * Checkbox 的默认中间态,只会影响到 Checkbox 的样式,并不影响其 checked 属性 + */ + defaultIndeterminate: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 状态变化时触发的事件 + * @param {Boolean} checked 是否选中 + * @param {Event} e Dom 事件对象 + */ + onChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 鼠标进入enter事件 + * @param {Event} e Dom 事件对象 + */ + onMouseEnter: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 鼠标离开Leave事件 + * @param {Event} e Dom 事件对象 + */ + onMouseLeave: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * checkbox 的value + */ + value: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.number]), + /** + * name + */ + name: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 是否为预览态 + */ + isPreview: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 预览态模式下渲染的内容 + * @param {number} value 评分值 + */ + renderPreview: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func +}), _class.defaultProps = { + defaultChecked: false, + defaultIndeterminate: false, + onChange: noop, + onMouseEnter: noop, + onMouseLeave: noop, + prefix: 'next-', + isPreview: false +}, _class.contextTypes = { + onChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + __group__: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + selectedValue: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.array, + disabled: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string +}, _temp); + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_9__["default"].config(Checkbox)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/checkbox/index.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/checkbox/index.js ***! + \****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _checkbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./checkbox */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/checkbox/checkbox.js"); +/* harmony import */ var _checkbox_group__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./checkbox-group */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/checkbox/checkbox-group.js"); + + + +_checkbox__WEBPACK_IMPORTED_MODULE_0__["default"].Group = _checkbox_group__WEBPACK_IMPORTED_MODULE_1__["default"]; + +/* harmony default export */ __webpack_exports__["default"] = (_checkbox__WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/checkbox/main.scss": +/*!*****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/checkbox/main.scss ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694894037 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/checkbox/style.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/checkbox/style.js ***! + \****************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _icon_style_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../icon/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/style.js"); +/* harmony import */ var _animate_style_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../animate/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/animate/style.js"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/checkbox/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_2__); + + + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/collapse/collapse.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/collapse/collapse.js ***! + \*******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-lifecycles-compat */ "./node_modules/_react-lifecycles-compat@3.0.4@react-lifecycles-compat/react-lifecycles-compat.es.js"); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _panel__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./panel */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/collapse/panel.js"); + + + + + +var _class, _temp; + + + + + + + + + +/** Collapse */ +var Collapse = (_temp = _class = function (_React$Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(Collapse, _React$Component); + + function Collapse(props) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Collapse); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _React$Component.call(this, props)); + + var expandedKeys = void 0; + if ('expandedKeys' in props) { + expandedKeys = props.expandedKeys; + } else { + expandedKeys = props.defaultExpandedKeys; + } + + _this.state = { + expandedKeys: typeof expandedKeys === 'undefined' ? [] : expandedKeys + }; + return _this; + } + + Collapse.getDerivedStateFromProps = function getDerivedStateFromProps(props) { + if ('expandedKeys' in props) { + return { + expandedKeys: typeof props.expandedKeys === 'undefined' ? [] : props.expandedKeys + }; + } + return null; + }; + + Collapse.prototype.onItemClick = function onItemClick(key) { + var expandedKeys = this.state.expandedKeys; + if (this.props.accordion) { + expandedKeys = String(expandedKeys[0]) === String(key) ? [] : [key]; + } else { + expandedKeys = [].concat(expandedKeys); + var stringKey = String(key); + var index = expandedKeys.findIndex(function (k) { + return String(k) === stringKey; + }); + var isExpanded = index > -1; + if (isExpanded) { + expandedKeys.splice(index, 1); + } else { + expandedKeys.push(key); + } + } + this.setExpandedKey(expandedKeys); + }; + + Collapse.prototype.genratePanelId = function genratePanelId(itemId, index) { + var collapseId = this.props.id; + + var id = void 0; + if (itemId) { + // 优先用 item自带的id + id = itemId; + } else if (collapseId) { + // 其次用 collapseId 和 index 生成id + id = collapseId + '-panel-' + index; + } + return id; + }; + + Collapse.prototype.getProps = function getProps(item, index, key) { + var _this2 = this; + + var expandedKeys = this.state.expandedKeys; + var title = item.title; + + var disabled = this.props.disabled; + + if (!disabled) { + disabled = item.disabled; + } + + var isExpanded = false; + + if (this.props.accordion) { + isExpanded = String(expandedKeys[0]) === String(key); + } else { + isExpanded = expandedKeys.some(function (expandedKey) { + if (expandedKey === null || expandedKey === undefined || key === null || key === undefined) { + return false; + } + + if (expandedKey === key || expandedKey.toString() === key.toString()) { + return true; + } + return false; + }); + } + + var id = this.genratePanelId(item.id, index); + return { + key: key, + title: title, + isExpanded: isExpanded, + disabled: disabled, + id: id, + onClick: disabled ? null : function () { + _this2.onItemClick(key); + if ('onClick' in item) { + item.onClick(key); + } + } + }; + }; + + Collapse.prototype.getItemsByDataSource = function getItemsByDataSource() { + var _this3 = this; + + var props = this.props; + var dataSource = props.dataSource; + // 是否有dataSource.item传入过key + + var hasKeys = dataSource.some(function (item) { + return 'key' in item; + }); + + return dataSource.map(function (item, index) { + // 传入过key就用item.key 没传入则统一使用index为key + var key = hasKeys ? item.key : '' + index; + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + _panel__WEBPACK_IMPORTED_MODULE_10__["default"], + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _this3.getProps(item, index, key), { key: key }), + item.content + ); + }); + }; + + Collapse.prototype.getItemsByChildren = function getItemsByChildren() { + var _this4 = this; + + // 是否有child传入过key + var allKeys = react__WEBPACK_IMPORTED_MODULE_4___default.a.Children.map(this.props.children, function (child) { + return child && child.key; + }); + var hasKeys = Boolean(allKeys.length); + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.Children.map(this.props.children, function (child, index) { + if (child && typeof child.type === 'function' && child.type.isNextPanel) { + // 传入过key就用child.key 没传入则统一使用index为key + var key = hasKeys ? child.key : '' + index; + return react__WEBPACK_IMPORTED_MODULE_4___default.a.cloneElement(child, _this4.getProps(child.props, index, key)); + } else { + return child; + } + }); + }; + + Collapse.prototype.setExpandedKey = function setExpandedKey(expandedKeys) { + if (!('expandedKeys' in this.props)) { + this.setState({ expandedKeys: expandedKeys }); + } + this.props.onExpand(this.props.accordion ? expandedKeys[0] : expandedKeys); + }; + + Collapse.prototype.render = function render() { + var _classNames; + + var _props = this.props, + prefix = _props.prefix, + className = _props.className, + style = _props.style, + disabled = _props.disabled, + dataSource = _props.dataSource, + id = _props.id, + rtl = _props.rtl; + + var collapseClassName = classnames__WEBPACK_IMPORTED_MODULE_6___default()((_classNames = {}, _classNames[prefix + 'collapse'] = true, _classNames[prefix + 'collapse-disabled'] = disabled, _classNames[className] = Boolean(className), _classNames)); + + var others = _util__WEBPACK_IMPORTED_MODULE_9__["obj"].pickOthers(Collapse.propTypes, this.props); + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + id: id, + className: collapseClassName, + style: style + }, others, { + role: 'presentation', + dir: rtl ? 'rtl' : undefined + }), + dataSource ? this.getItemsByDataSource() : this.getItemsByChildren() + ); + }; + + return Collapse; +}(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component), _class.propTypes = { + /** + * 样式前缀 + */ + prefix: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + /** + * 组件接受行内样式 + */ + style: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, + /** + * 使用数据模型构建 + */ + dataSource: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.array, + /** + * 默认展开keys + */ + defaultExpandedKeys: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.array, + /** + * 受控展开keys + */ + expandedKeys: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.array, + /** + * 展开状态发升变化时候的回调 + */ + onExpand: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * 所有禁用 + */ + disabled: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 扩展class + */ + className: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + /** + * 手风琴模式,一次只能打开一个 + */ + accordion: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + children: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + id: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool +}, _class.defaultProps = { + accordion: false, + prefix: 'next-', + onExpand: _util__WEBPACK_IMPORTED_MODULE_9__["func"].noop +}, _class.contextTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string +}, _temp); +Collapse.displayName = 'Collapse'; + + +/* harmony default export */ __webpack_exports__["default"] = (Object(react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_7__["polyfill"])(_config_provider__WEBPACK_IMPORTED_MODULE_8__["default"].config(Collapse))); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/collapse/index.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/collapse/index.js ***! + \****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _collapse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./collapse */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/collapse/collapse.js"); +/* harmony import */ var _panel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./panel */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/collapse/panel.js"); + + + +_collapse__WEBPACK_IMPORTED_MODULE_0__["default"].Panel = _panel__WEBPACK_IMPORTED_MODULE_1__["default"]; + +/* harmony default export */ __webpack_exports__["default"] = (_collapse__WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/collapse/main.scss": +/*!*****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/collapse/main.scss ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694892868 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/collapse/panel.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/collapse/panel.js ***! + \****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../icon */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); + + + + + + +var _class, _temp2; + + + + + + + + +/** Collapse.Panel */ +var Panel = (_temp2 = _class = function (_React$Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Panel, _React$Component); + + function Panel() { + var _temp, _this, _ret; + + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Panel); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.onKeyDown = function (e) { + var keyCode = e.keyCode; + + if (keyCode === _util__WEBPACK_IMPORTED_MODULE_10__["KEYCODE"].SPACE) { + var onClick = _this.props.onClick; + + e.preventDefault(); + onClick && onClick(e); + } + }, _temp), babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(_this, _ret); + } // + + Panel.prototype.render = function render() { + var _classNames, _classNames2; + + var _props = this.props, + title = _props.title, + children = _props.children, + className = _props.className, + isExpanded = _props.isExpanded, + disabled = _props.disabled, + style = _props.style, + prefix = _props.prefix, + onClick = _props.onClick, + id = _props.id, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['title', 'children', 'className', 'isExpanded', 'disabled', 'style', 'prefix', 'onClick', 'id']); + + var cls = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classNames = {}, _classNames[prefix + 'collapse-panel'] = true, _classNames[prefix + 'collapse-panel-hidden'] = !isExpanded, _classNames[prefix + 'collapse-panel-expanded'] = isExpanded, _classNames[prefix + 'collapse-panel-disabled'] = disabled, _classNames[className] = className, _classNames)); + + var iconCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classNames2 = {}, _classNames2[prefix + 'collapse-panel-icon'] = true, _classNames2[prefix + 'collapse-panel-icon-expanded'] = isExpanded, _classNames2)); + + // 为了无障碍 需要添加两个id + var headingId = id ? id + '-heading' : undefined; + var regionId = id ? id + '-region' : undefined; + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ className: cls, style: style, id: id }, others), + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { + id: headingId, + className: prefix + 'collapse-panel-title', + onClick: onClick, + onKeyDown: this.onKeyDown, + tabIndex: '0', + 'aria-disabled': disabled, + 'aria-expanded': isExpanded, + 'aria-controls': regionId, + role: 'button' + }, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_9__["default"], { + type: 'arrow-up', + className: iconCls, + 'aria-hidden': 'true' + }), + title + ), + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { + className: prefix + 'collapse-panel-content', + role: 'region', + id: regionId + }, + children + ) + ); + }; + + return Panel; +}(react__WEBPACK_IMPORTED_MODULE_5___default.a.Component), _class.propTypes = { + /** + * 样式类名的品牌前缀 + */ + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 子组件接受行内样式 + */ + style: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + children: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + isExpanded: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 是否禁止用户操作 + */ + disabled: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 标题 + */ + title: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node, + /** + * 扩展class + */ + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + onClick: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + id: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string +}, _class.defaultProps = { + prefix: 'next-', + isExpanded: false, + onClick: _util__WEBPACK_IMPORTED_MODULE_10__["func"].noop +}, _class.isNextPanel = true, _temp2); +Panel.displayName = 'Panel'; + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_8__["default"].config(Panel)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/collapse/style.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/collapse/style.js ***! + \****************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _icon_style_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../icon/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/style.js"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/collapse/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_1__); + + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/cache.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/cache.js ***! + \***********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); + + +var Cache = function () { + function Cache() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Cache); + + this._root = null; + this._store = new Map(); + } + + Cache.prototype.empty = function empty() { + return this._store.size === 0; + }; + + Cache.prototype.has = function has(key) { + return this._store.has(key); + }; + + Cache.prototype.get = function get(key, defaultValue) { + var res = this.has(key) ? this._store.get(key) : this.root(); + return typeof res === 'undefined' || res === null ? defaultValue : res; + }; + + Cache.prototype.add = function add(key, value) { + if (this.empty()) { + this._root = key; + } + this._store.set(key, value); + }; + + Cache.prototype.update = function update(key, value) { + if (this.has(key)) { + this._store.set(key, value); + } + }; + + Cache.prototype.remove = function remove(key) { + this._store.delete(key); + }; + + Cache.prototype.root = function root() { + return this._store.get(this._root); + }; + + return Cache; +}(); + +/* harmony default export */ __webpack_exports__["default"] = (Cache); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/config.js": +/*!************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/config.js ***! + \************************************************************************************/ +/*! exports provided: initLocales, setLanguage, setLocale, setDirection, getLocale, getLanguage, getDirection, config */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initLocales", function() { return initLocales; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLanguage", function() { return setLanguage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLocale", function() { return setLocale; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDirection", function() { return setDirection; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocale", function() { return getLocale; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLanguage", function() { return getLanguage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDirection", function() { return getDirection; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return config; }); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! hoist-non-react-statics */ "./node_modules/_hoist-non-react-statics@2.5.5@hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _get_context_props__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./get-context-props */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/get-context-props.js"); +/* harmony import */ var _error_boundary__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./error-boundary */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/error-boundary.js"); + + + + + + + + + + + + +var shallowEqual = _util__WEBPACK_IMPORTED_MODULE_8__["obj"].shallowEqual; + + +function getDisplayName(Component) { + return Component.displayName || Component.name || 'Component'; +} + +var globalLocales = void 0; +var currentGlobalLanguage = 'zh-cn'; +var currentGlobalLocale = {}; +var currentGlobalRtl = void 0; + +function initLocales(locales) { + globalLocales = locales; + + if (locales) { + currentGlobalLocale = locales[currentGlobalLanguage]; + + if (typeof currentGlobalRtl !== 'boolean') { + currentGlobalRtl = currentGlobalLocale && currentGlobalLocale.rtl; + } + } +} + +function setLanguage(language) { + if (globalLocales) { + currentGlobalLanguage = language; + currentGlobalLocale = globalLocales[language]; + + if (typeof currentGlobalRtl !== 'boolean') { + currentGlobalRtl = currentGlobalLocale && currentGlobalLocale.rtl; + } + } +} + +function setLocale(locale) { + currentGlobalLocale = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_4___default()({}, globalLocales ? globalLocales[currentGlobalLanguage] : {}, locale); + + if (typeof currentGlobalRtl !== 'boolean') { + currentGlobalRtl = currentGlobalLocale && currentGlobalLocale.rtl; + } +} + +function setDirection(dir) { + currentGlobalRtl = dir === 'rtl'; +} + +function getLocale() { + return currentGlobalLocale; +} + +function getLanguage() { + return currentGlobalLanguage; +} + +function getDirection() { + return currentGlobalRtl; +} + +function config(Component) { + var _class, _temp; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + // 非 forwardRef 创建的 class component + if (_util__WEBPACK_IMPORTED_MODULE_8__["obj"].isClassComponent(Component) && Component.prototype.shouldComponentUpdate === undefined) { + // class component: 通过定义 shouldComponentUpdate 改写成 pure component, 有refs + Component.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) { + if (this.props.pure) { + return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState); + } + + return true; + }; + } + + var ConfigedComponent = (_temp = _class = function (_React$Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(ConfigedComponent, _React$Component); + + function ConfigedComponent(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ConfigedComponent); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _React$Component.call(this, props, context)); + + _this._getInstance = _this._getInstance.bind(_this); + _this._deprecated = _this._deprecated.bind(_this); + return _this; + } + + ConfigedComponent.prototype._getInstance = function _getInstance(ref) { + var _this2 = this; + + this._instance = ref; + + if (this._instance && options.exportNames) { + options.exportNames.forEach(function (name) { + var field = _this2._instance[name]; + if (typeof field === 'function') { + _this2[name] = field.bind(_this2._instance); + } else { + _this2[name] = field; + } + }); + } + }; + + ConfigedComponent.prototype._deprecated = function _deprecated() { + if (this.context.nextWarning !== false) { + _util__WEBPACK_IMPORTED_MODULE_8__["log"].deprecated.apply(_util__WEBPACK_IMPORTED_MODULE_8__["log"], arguments); + } + }; + + ConfigedComponent.prototype.getInstance = function getInstance() { + return this._instance; + }; + + ConfigedComponent.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + locale = _props.locale, + pure = _props.pure, + rtl = _props.rtl, + device = _props.device, + popupContainer = _props.popupContainer, + errorBoundary = _props.errorBoundary, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default()(_props, ['prefix', 'locale', 'pure', 'rtl', 'device', 'popupContainer', 'errorBoundary']); + + var _context = this.context, + nextPrefix = _context.nextPrefix, + _context$nextLocale = _context.nextLocale, + nextLocale = _context$nextLocale === undefined ? {} : _context$nextLocale, + nextPure = _context.nextPure, + nextRtl = _context.nextRtl, + nextDevice = _context.nextDevice, + nextPopupContainer = _context.nextPopupContainer, + nextErrorBoundary = _context.nextErrorBoundary; + + + var displayName = options.componentName || getDisplayName(Component); + var contextProps = Object(_get_context_props__WEBPACK_IMPORTED_MODULE_9__["default"])({ + prefix: prefix, + locale: locale, + pure: pure, + device: device, + popupContainer: popupContainer, + rtl: rtl, + errorBoundary: errorBoundary + }, { + nextPrefix: nextPrefix, + nextLocale: babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_4___default()({}, currentGlobalLocale, nextLocale), + nextPure: nextPure, + nextDevice: nextDevice, + nextPopupContainer: nextPopupContainer, + nextRtl: typeof nextRtl === 'boolean' ? nextRtl : currentGlobalRtl === true ? true : undefined, + nextErrorBoundary: nextErrorBoundary + }, displayName); + + // errorBoundary is only for + var newContextProps = ['prefix', 'locale', 'pure', 'rtl', 'device', 'popupContainer'].reduce(function (ret, name) { + if (typeof contextProps[name] !== 'undefined') { + ret[name] = contextProps[name]; + } + return ret; + }, {}); + + if ('pure' in newContextProps && newContextProps.pure) { + _util__WEBPACK_IMPORTED_MODULE_8__["log"].warning('pure of ConfigProvider is deprecated, use Function Component or React.PureComponent'); + } + + var newOthers = options.transform ? options.transform(others, this._deprecated) : others; + + var content = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(Component, babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_4___default()({}, newOthers, newContextProps, { + ref: _util__WEBPACK_IMPORTED_MODULE_8__["obj"].isClassComponent(Component) ? this._getInstance : null + })); + + var _contextProps$errorBo = contextProps.errorBoundary, + open = _contextProps$errorBo.open, + othersBoundary = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default()(_contextProps$errorBo, ['open']); + + return open ? react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + _error_boundary__WEBPACK_IMPORTED_MODULE_10__["default"], + othersBoundary, + content + ) : content; + }; + + return ConfigedComponent; + }(react__WEBPACK_IMPORTED_MODULE_5___default.a.Component), _class.propTypes = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_4___default()({}, Component.propTypes || {}, { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + locale: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + pure: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + device: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['tablet', 'desktop', 'phone']), + popupContainer: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + errorBoundary: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object]) + }), _class.contextTypes = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_4___default()({}, Component.contextTypes || {}, { + nextPrefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + nextLocale: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + nextPure: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + nextRtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + nextWarning: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + nextDevice: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['tablet', 'desktop', 'phone']), + nextPopupContainer: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + nextErrorBoundary: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object]) + }), _temp); + ConfigedComponent.displayName = 'ConfigedComponent'; + + + ConfigedComponent.displayName = 'Config(' + getDisplayName(Component) + ')'; + + hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_7___default()(ConfigedComponent, Component); + + return ConfigedComponent; +} + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/consumer.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/consumer.js ***! + \**************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Creates an object with the same values as object and keys + * generated by running each own enumerable string keyed property + * of object thru iteratee. + * @param {Object} obj + * @param {Function} fn + * @return {Object} + */ +var mapKeys = function mapKeys(obj, fn) { + var result = {}; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var value = obj[key]; + var newKey = fn(key, value); + result[newKey] = value; + } + } + + return result; +}; + +/** + * Replace specific key with prefix `next` + * and lowercase first character of the result. + * @param {String} key + * @return {String} + */ +var replaceKey = function replaceKey(key) { + return key.replace(/^(next)([A-Z])/, function (match, p1, p2) { + return p2.toLowerCase(); + }); +}; + +/** + * @param {Object} source + * @return {Object} + */ +var transformContext = function transformContext(source) { + return mapKeys(source, replaceKey); +}; + +/** + * Consumer + * @param {Object} prop + * @param {Object} context + */ +var Consumer = function Consumer(_ref, context) { + var children = _ref.children; + return typeof children === 'function' ? children(transformContext(context)) : null; +}; + +/** + * PropTypes + * @type {Object} + * @static + */ +Consumer.propTypes = { + // Render context as function + // Function(context: object): ReactElement + children: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func +}; + +/** + * ContextTypes (legacy context) + * @type {Object} + * @static + */ +Consumer.contextTypes = { + nextPrefix: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, + nextLocale: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.object, + nextPure: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, + newRtl: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, + nextWarning: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, + nextDevice: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOf(['tablet', 'desktop', 'phone']), + nextPopupContainer: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.any +}; + +/* harmony default export */ __webpack_exports__["default"] = (Consumer); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/error-boundary.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/error-boundary.js ***! + \********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ErrorBoundary; }); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__); + + + + +var _class, _temp; + + + + +DefaultUI.propTypes = { + error: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.object, + errorInfo: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.object +}; + +function DefaultUI() { + return ''; +} + +var ErrorBoundary = (_temp = _class = function (_React$Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ErrorBoundary, _React$Component); + + function ErrorBoundary(props) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ErrorBoundary); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1___default()(this, _React$Component.call(this, props)); + + _this.state = { error: null, errorInfo: null }; + return _this; + } + + ErrorBoundary.prototype.componentDidCatch = function componentDidCatch(error, errorInfo) { + this.setState({ + error: error, + errorInfo: errorInfo + }); + + var afterCatch = this.props.afterCatch; + + + if ('afterCatch' in this.props && typeof afterCatch === 'function') { + this.props.afterCatch(error, errorInfo); + } + }; + + ErrorBoundary.prototype.render = function render() { + var _props$fallbackUI = this.props.fallbackUI, + FallbackUI = _props$fallbackUI === undefined ? DefaultUI : _props$fallbackUI; + + + if (this.state.errorInfo) { + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(FallbackUI, { + error: this.state.error, + errorInfo: this.state.errorInfo + }); + } + // Normally, just render children + return this.props.children; + }; + + return ErrorBoundary; +}(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component), _class.propTypes = { + children: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.element, + /** + * 捕获错误后的自定义处理, 比如埋点上传 + * @param {Object} error 错误 + * @param {Object} errorInfo 错误详细信息 + */ + afterCatch: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func, + /** + * 捕获错误后的展现 自定义组件 + * @param {Object} error 错误 + * @param {Object} errorInfo 错误详细信息 + * @returns {Element} 捕获错误后的处理 + */ + fallbackUI: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func +}, _temp); +ErrorBoundary.displayName = 'ErrorBoundary'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/get-context-props.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/get-context-props.js ***! + \***********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getContextProps; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _locale_zh_cn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../locale/zh-cn.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/locale/zh-cn.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); + + + +/** + * + * @param {Object|Boolean} input + * @returns {Object} typeof obj.open === 'boolean' + */ +var parseBoundary = function parseBoundary(input) { + var obj = void 0; + if (input === undefined || input === null) { + return {}; + } else if (typeof input === 'boolean') { + obj = { open: input }; + } else { + obj = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ open: true }, input); + } + + return obj; +}; + +function getContextProps(props, context, displayName) { + var prefix = props.prefix, + locale = props.locale, + pure = props.pure, + rtl = props.rtl, + device = props.device, + popupContainer = props.popupContainer, + errorBoundary = props.errorBoundary; + var nextPrefix = context.nextPrefix, + nextLocale = context.nextLocale, + nextPure = context.nextPure, + nextWarning = context.nextWarning, + nextRtl = context.nextRtl, + nextDevice = context.nextDevice, + nextPopupContainer = context.nextPopupContainer, + nextErrorBoundary = context.nextErrorBoundary; + + + var newPrefix = prefix || nextPrefix; + + var localeFromContext = void 0; + if (nextLocale) { + localeFromContext = nextLocale[displayName]; + if (localeFromContext) { + localeFromContext.momentLocale = nextLocale.momentLocale; + } + } + + var newLocale = void 0; + if (locale) { + newLocale = _util__WEBPACK_IMPORTED_MODULE_2__["obj"].deepMerge({}, _locale_zh_cn_js__WEBPACK_IMPORTED_MODULE_1__["default"][displayName], localeFromContext, locale); + } else if (localeFromContext) { + newLocale = _util__WEBPACK_IMPORTED_MODULE_2__["obj"].deepMerge({}, _locale_zh_cn_js__WEBPACK_IMPORTED_MODULE_1__["default"][displayName], localeFromContext); + } + + var newPure = typeof pure === 'boolean' ? pure : nextPure; + var newRtl = typeof rtl === 'boolean' ? rtl : nextRtl; + + // ProtoType of [nextE|e]rrorBoundary can be one of [boolean, object] + // but typeof newErrorBoundary === 'object' + // newErrorBoundary should always have the key 'open', which indicates ErrorBoundary on or off + var newErrorBoundary = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, parseBoundary(nextErrorBoundary), parseBoundary(errorBoundary)); + + if (!('open' in newErrorBoundary)) { + newErrorBoundary.open = false; + } + + return { + prefix: newPrefix, + locale: newLocale, + pure: newPure, + rtl: newRtl, + warning: nextWarning, + device: device || nextDevice || undefined, + popupContainer: popupContainer || nextPopupContainer, + errorBoundary: newErrorBoundary + }; +} + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js ***! + \***********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-lifecycles-compat */ "./node_modules/_react-lifecycles-compat@3.0.4@react-lifecycles-compat/react-lifecycles-compat.es.js"); +/* harmony import */ var _get_context_props__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./get-context-props */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/get-context-props.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./config */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/config.js"); +/* harmony import */ var _consumer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./consumer */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/consumer.js"); +/* harmony import */ var _error_boundary__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./error-boundary */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/error-boundary.js"); +/* harmony import */ var _cache__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./cache */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/cache.js"); + + + + + +var _class, _temp; + + + + + + + + + + +var childContextCache = new _cache__WEBPACK_IMPORTED_MODULE_11__["default"](); + +var setMomentLocale = function setMomentLocale(locale) { + var moment = void 0; + try { + moment = __webpack_require__(/*! moment */ "./node_modules/_moment@2.24.0@moment/moment.js"); + } catch (e) { + // ignore + } + + if (moment && locale) { + moment.locale(locale.momentLocale); + } +}; +/** + * ConfigProvider + * @propsExtends false + */ +var ConfigProvider = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(ConfigProvider, _Component); + + /** + * 传入组件,生成受 ConfigProvider 控制的 HOC 组件 + * @param {Component} Component 组件类 + * @param {Object} options 可选项 + * @returns {Component} HOC + */ + function ConfigProvider() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ConfigProvider); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _Component.call.apply(_Component, [this].concat(args))); + + childContextCache.add(_this, babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, childContextCache.get(_this, {}), _this.getChildContext())); + + _this.state = { + locale: _this.props.locale + }; + return _this; + } + + /** + * 传入组件的 props 和 displayName,得到和 childContext 计算过的包含有 preifx/locale/pure 的对象,一般用于通过静态方法生成脱离组件树的组件 + * @param {Object} props 组件的 props + * @param {String} displayName 组件的 displayName + * @returns {Object} 新的 context props + */ + + + ConfigProvider.prototype.getChildContext = function getChildContext() { + var _props = this.props, + prefix = _props.prefix, + locale = _props.locale, + pure = _props.pure, + warning = _props.warning, + rtl = _props.rtl, + device = _props.device, + popupContainer = _props.popupContainer, + errorBoundary = _props.errorBoundary; + + + return { + nextPrefix: prefix, + nextLocale: locale, + nextPure: pure, + nextRtl: rtl, + nextWarning: warning, + nextDevice: device, + nextPopupContainer: popupContainer, + nextErrorBoundary: errorBoundary + }; + }; + + ConfigProvider.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) { + if (nextProps.locale !== prevState.locale) { + setMomentLocale(nextProps.locale); + + return { + locale: nextProps.locale + }; + } + + return null; + }; + + ConfigProvider.prototype.componentDidUpdate = function componentDidUpdate() { + childContextCache.add(this, babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, childContextCache.get(this, {}), this.getChildContext())); + }; + + ConfigProvider.prototype.componentWillUnmount = function componentWillUnmount() { + childContextCache.remove(this); + }; + + ConfigProvider.prototype.render = function render() { + return react__WEBPACK_IMPORTED_MODULE_4__["Children"].only(this.props.children); + }; + + return ConfigProvider; +}(react__WEBPACK_IMPORTED_MODULE_4__["Component"]), _class.propTypes = { + /** + * 样式类名的品牌前缀 + */ + prefix: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + /** + * 国际化文案对象,属性为组件的 displayName + */ + locale: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, + /** + * 是否开启错误捕捉 errorBoundary + * 如需自定义参数,请传入对象 对象接受参数列表如下: + * + * fallbackUI `Function(error?: {}, errorInfo?: {}) => Element` 捕获错误后的展示 + * afterCatch `Function(error?: {}, errorInfo?: {})` 捕获错误后的行为, 比如埋点上传 + */ + errorBoundary: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object]), + /** + * 是否开启 Pure Render 模式,会提高性能,但是也会带来副作用 + */ + pure: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 是否在开发模式下显示组件属性被废弃的 warning 提示 + */ + warning: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 是否开启 rtl 模式 + */ + rtl: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 设备类型,针对不同的设备类型组件做出对应的响应式变化 + */ + device: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOf(['tablet', 'desktop', 'phone']), + /** + * 组件树 + */ + children: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.any, + /** + * 指定浮层渲染的父节点, 可以为节点id的字符串,也可以返回节点的函数 + */ + popupContainer: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.any +}, _class.defaultProps = { + warning: true, + errorBoundary: false +}, _class.childContextTypes = { + nextPrefix: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + nextLocale: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, + nextPure: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + nextRtl: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + nextWarning: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + nextDevice: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOf(['tablet', 'desktop', 'phone']), + nextPopupContainer: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.any, + nextErrorBoundary: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object]) +}, _class.config = function (Component, options) { + return Object(_config__WEBPACK_IMPORTED_MODULE_8__["config"])(Component, options); +}, _class.getContextProps = function (props, displayName) { + return Object(_get_context_props__WEBPACK_IMPORTED_MODULE_7__["default"])(props, childContextCache.root() || {}, displayName); +}, _class.initLocales = _config__WEBPACK_IMPORTED_MODULE_8__["initLocales"], _class.setLanguage = _config__WEBPACK_IMPORTED_MODULE_8__["setLanguage"], _class.setLocale = _config__WEBPACK_IMPORTED_MODULE_8__["setLocale"], _class.setDirection = _config__WEBPACK_IMPORTED_MODULE_8__["setDirection"], _class.getLanguage = _config__WEBPACK_IMPORTED_MODULE_8__["getLanguage"], _class.getLocale = _config__WEBPACK_IMPORTED_MODULE_8__["getLocale"], _class.getDirection = _config__WEBPACK_IMPORTED_MODULE_8__["getDirection"], _class.Consumer = _consumer__WEBPACK_IMPORTED_MODULE_9__["default"], _class.ErrorBoundary = _error_boundary__WEBPACK_IMPORTED_MODULE_10__["default"], _class.getContext = function () { + var _ref = childContextCache.root() || {}, + nextPrefix = _ref.nextPrefix, + nextLocale = _ref.nextLocale, + nextPure = _ref.nextPure, + nextRtl = _ref.nextRtl, + nextWarning = _ref.nextWarning, + nextDevice = _ref.nextDevice, + nextPopupContainer = _ref.nextPopupContainer, + nextErrorBoundary = _ref.nextErrorBoundary; + + return { + prefix: nextPrefix, + locale: nextLocale, + pure: nextPure, + rtl: nextRtl, + warning: nextWarning, + device: nextDevice, + popupContainer: nextPopupContainer, + errorBoundary: nextErrorBoundary + }; +}, _temp); +ConfigProvider.displayName = 'ConfigProvider'; + + +/* harmony default export */ __webpack_exports__["default"] = (Object(react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_6__["polyfill"])(ConfigProvider)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/main.scss": +/*!************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/main.scss ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694896201 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/style.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/style.js ***! + \***********************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_0__); + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/date-picker.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/date-picker.js ***! + \*************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DatePicker; }); +/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/typeof */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/typeof.js"); +/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! moment */ "./node_modules/_moment@2.24.0@moment/moment.js"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_9__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _overlay__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../overlay */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/overlay/index.js"); +/* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../input */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/input/index.js"); +/* harmony import */ var _calendar__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../calendar */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/index.js"); +/* harmony import */ var _time_picker_panel__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../time-picker/panel */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/time-picker/panel.js"); +/* harmony import */ var _locale_zh_cn__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../locale/zh-cn */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/locale/zh-cn.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/util/index.js"); +/* harmony import */ var _module_panel_footer__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./module/panel-footer */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/module/panel-footer.js"); + + + + + + + +var _class, _temp, _initialiseProps; + + + + + + + + + + + + + + + +var Popup = _overlay__WEBPACK_IMPORTED_MODULE_11__["default"].Popup; + +/** + * DatePicker + */ + +var DatePicker = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5___default()(DatePicker, _Component); + + function DatePicker(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, DatePicker); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, _Component.call(this, props, context)); + + _initialiseProps.call(_this); + + var dateTimeFormat = Object(_util__WEBPACK_IMPORTED_MODULE_17__["getDateTimeFormat"])(props.format, props.showTime); + Object(_util__WEBPACK_IMPORTED_MODULE_17__["extend"])(dateTimeFormat, _this); + + var value = Object(_util__WEBPACK_IMPORTED_MODULE_17__["formatDateValue"])(props.value || props.defaultValue, _this.dateTimeFormat); + _this.inputAsString = typeof (props.value || props.defaultValue) === 'string'; // 判断用户输入是否是字符串 + _this.state = { + value: value, + dateInputStr: '', + timeInputStr: '', + inputing: false, // 当前是否处于输入状态 + visible: props.visible || props.defaultVisible, + panel: _util__WEBPACK_IMPORTED_MODULE_17__["PANEL"].DATE + }; + return _this; + } + + DatePicker.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if ('showTime' in nextProps) { + var dateTimeFormat = Object(_util__WEBPACK_IMPORTED_MODULE_17__["getDateTimeFormat"])(nextProps.format || this.props.format, nextProps.showTime); + Object(_util__WEBPACK_IMPORTED_MODULE_17__["extend"])(dateTimeFormat, this); + } + + if ('value' in nextProps) { + var value = Object(_util__WEBPACK_IMPORTED_MODULE_17__["formatDateValue"])(nextProps.value, this.dateTimeFormat); + this.setState({ + value: value + }); + this.inputAsString = typeof nextProps.value === 'string'; + } + + if ('visible' in nextProps) { + this.setState({ + visible: nextProps.visible + }); + } + }; + + DatePicker.prototype.renderPreview = function renderPreview(others) { + var _props = this.props, + prefix = _props.prefix, + format = _props.format, + className = _props.className, + renderPreview = _props.renderPreview; + var value = this.state.value; + + var previewCls = classnames__WEBPACK_IMPORTED_MODULE_8___default()(className, prefix + 'form-preview'); + + var label = value ? value.format(format) : ''; + + if (typeof renderPreview === 'function') { + return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, others, { className: previewCls }), + renderPreview(value, this.props) + ); + } + + return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'p', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, others, { className: previewCls }), + label + ); + }; + + DatePicker.prototype.render = function render() { + var _classnames, _classnames2, _classnames3, _classnames4, _PANEL$DATE$PANEL$TIM; + + var _props2 = this.props, + prefix = _props2.prefix, + rtl = _props2.rtl, + locale = _props2.locale, + label = _props2.label, + state = _props2.state, + defaultVisibleMonth = _props2.defaultVisibleMonth, + onVisibleMonthChange = _props2.onVisibleMonthChange, + showTime = _props2.showTime, + disabledDate = _props2.disabledDate, + footerRender = _props2.footerRender, + placeholder = _props2.placeholder, + size = _props2.size, + disabled = _props2.disabled, + hasClear = _props2.hasClear, + popupTriggerType = _props2.popupTriggerType, + popupAlign = _props2.popupAlign, + popupContainer = _props2.popupContainer, + popupStyle = _props2.popupStyle, + popupClassName = _props2.popupClassName, + popupProps = _props2.popupProps, + popupComponent = _props2.popupComponent, + popupContent = _props2.popupContent, + followTrigger = _props2.followTrigger, + className = _props2.className, + inputProps = _props2.inputProps, + dateCellRender = _props2.dateCellRender, + monthCellRender = _props2.monthCellRender, + yearCellRender = _props2.yearCellRender, + dateInputAriaLabel = _props2.dateInputAriaLabel, + timeInputAriaLabel = _props2.timeInputAriaLabel, + isPreview = _props2.isPreview, + disableChangeMode = _props2.disableChangeMode, + yearRange = _props2.yearRange, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props2, ['prefix', 'rtl', 'locale', 'label', 'state', 'defaultVisibleMonth', 'onVisibleMonthChange', 'showTime', 'disabledDate', 'footerRender', 'placeholder', 'size', 'disabled', 'hasClear', 'popupTriggerType', 'popupAlign', 'popupContainer', 'popupStyle', 'popupClassName', 'popupProps', 'popupComponent', 'popupContent', 'followTrigger', 'className', 'inputProps', 'dateCellRender', 'monthCellRender', 'yearCellRender', 'dateInputAriaLabel', 'timeInputAriaLabel', 'isPreview', 'disableChangeMode', 'yearRange']); + + var _state = this.state, + visible = _state.visible, + value = _state.value, + dateInputStr = _state.dateInputStr, + timeInputStr = _state.timeInputStr, + panel = _state.panel, + inputing = _state.inputing; + + + var datePickerCls = classnames__WEBPACK_IMPORTED_MODULE_8___default()((_classnames = {}, _classnames[prefix + 'date-picker'] = true, _classnames), className); + + var triggerInputCls = classnames__WEBPACK_IMPORTED_MODULE_8___default()((_classnames2 = {}, _classnames2[prefix + 'date-picker-input'] = true, _classnames2[prefix + 'error'] = false, _classnames2)); + + var panelBodyClassName = classnames__WEBPACK_IMPORTED_MODULE_8___default()((_classnames3 = {}, _classnames3[prefix + 'date-picker-body'] = true, _classnames3[prefix + 'date-picker-body-show-time'] = showTime, _classnames3)); + + var panelDateInputCls = classnames__WEBPACK_IMPORTED_MODULE_8___default()((_classnames4 = {}, _classnames4[prefix + 'date-picker-panel-input'] = true, _classnames4[prefix + 'focus'] = panel === _util__WEBPACK_IMPORTED_MODULE_17__["PANEL"].DATE, _classnames4)); + + if (rtl) { + others.dir = 'rtl'; + } + + if (isPreview) { + return this.renderPreview(_util__WEBPACK_IMPORTED_MODULE_16__["obj"].pickOthers(others, DatePicker.PropTypes)); + } + + var sharedInputProps = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, inputProps, { + size: size, + disabled: disabled, + onChange: this.onDateInputChange, + onBlur: this.onDateInputBlur, + onPressEnter: this.onDateInputBlur, + onKeyDown: this.onKeyDown + }); + + var dateInputValue = inputing === 'date' ? dateInputStr : value && value.format(this.format) || ''; + var triggerInputValue = dateInputValue; + + var dateInput = react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_input__WEBPACK_IMPORTED_MODULE_12__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, sharedInputProps, { + 'aria-label': dateInputAriaLabel, + value: dateInputValue, + onFocus: this.onFoucsDateInput, + placeholder: this.format, + className: panelDateInputCls + })); + + var datePanel = react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_calendar__WEBPACK_IMPORTED_MODULE_13__["default"], { + shape: 'panel', + value: value, + format: this.format, + dateCellRender: dateCellRender, + monthCellRender: monthCellRender, + yearCellRender: yearCellRender, + onSelect: this.onSelectCalendarPanel, + defaultVisibleMonth: defaultVisibleMonth, + onVisibleMonthChange: onVisibleMonthChange, + disabledDate: disabledDate, + disableChangeMode: disableChangeMode, + yearRange: yearRange + }); + + var panelFooter = footerRender(); + + var timeInput = null; + var timePanel = null; + + if (showTime) { + var _classnames5; + + var timeInputValue = inputing === 'time' ? timeInputStr : value && value.format(this.timeFormat) || ''; + triggerInputValue = value && value.format(this.dateTimeFormat) || ''; + + var timePanelProps = (typeof showTime === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(showTime)) === 'object' ? showTime : {}; + + var showSecond = this.timeFormat.indexOf('s') > -1; + var showMinute = this.timeFormat.indexOf('m') > -1; + + var panelTimeInputCls = classnames__WEBPACK_IMPORTED_MODULE_8___default()((_classnames5 = {}, _classnames5[prefix + 'date-picker-panel-input'] = true, _classnames5[prefix + 'focus'] = panel === _util__WEBPACK_IMPORTED_MODULE_17__["PANEL"].TIME, _classnames5)); + + timeInput = react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_input__WEBPACK_IMPORTED_MODULE_12__["default"], { + placeholder: this.timeFormat, + value: timeInputValue, + size: size, + 'aria-label': timeInputAriaLabel, + disabled: disabled || !value, + onChange: this.onTimeInputChange, + onFocus: this.onFoucsTimeInput, + onBlur: this.onTimeInputBlur, + onPressEnter: this.onTimeInputBlur, + onKeyDown: this.onTimeKeyDown, + className: panelTimeInputCls + }); + + timePanel = react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_time_picker_panel__WEBPACK_IMPORTED_MODULE_14__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, timePanelProps, { + locale: locale, + className: prefix + 'date-picker-panel-time', + showSecond: showSecond, + showMinute: showMinute, + disabled: disabled, + prefix: prefix, + value: value, + onSelect: this.onSelectTimePanel + })); + + panelFooter = panelFooter || react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_module_panel_footer__WEBPACK_IMPORTED_MODULE_18__["default"], { + prefix: prefix, + locale: locale, + value: value, + panel: panel, + onPanelChange: this.changePanel, + onOk: this.onOk + }); + } + + var panelBody = (_PANEL$DATE$PANEL$TIM = {}, _PANEL$DATE$PANEL$TIM[_util__WEBPACK_IMPORTED_MODULE_17__["PANEL"].DATE] = datePanel, _PANEL$DATE$PANEL$TIM[_util__WEBPACK_IMPORTED_MODULE_17__["PANEL"].TIME] = timePanel, _PANEL$DATE$PANEL$TIM)[panel]; + + var allowClear = value && hasClear; + var trigger = react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'div', + { className: prefix + 'date-picker-trigger' }, + react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_input__WEBPACK_IMPORTED_MODULE_12__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, sharedInputProps, { + label: label, + state: state, + value: triggerInputValue, + role: 'combobox', + 'aria-expanded': visible, + readOnly: true, + placeholder: placeholder || (showTime ? locale.datetimePlaceholder : locale.placeholder), + hint: 'calendar', + hasClear: allowClear, + className: triggerInputCls + })) + ); + var PopupComponent = popupComponent ? popupComponent : Popup; + + return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, _util__WEBPACK_IMPORTED_MODULE_16__["obj"].pickOthers(DatePicker.propTypes, others), { + className: datePickerCls + }), + react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + PopupComponent, + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({ + autoFocus: true, + align: popupAlign + }, popupProps, { + followTrigger: followTrigger, + disabled: disabled, + visible: visible, + onVisibleChange: this.onVisibleChange, + triggerType: popupTriggerType, + container: popupContainer, + style: popupStyle, + className: popupClassName, + trigger: trigger + }), + popupContent ? popupContent : react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'div', + { dir: others.dir, className: panelBodyClassName }, + react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'div', + { + className: prefix + 'date-picker-panel-header' + }, + dateInput, + timeInput + ), + panelBody, + panelFooter + ) + ) + ); + }; + + return DatePicker; +}(react__WEBPACK_IMPORTED_MODULE_6__["Component"]), _class.propTypes = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, _config_provider__WEBPACK_IMPORTED_MODULE_10__["default"].propTypes, { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 输入框内置标签 + */ + label: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.node, + /** + * 输入框状态 + */ + state: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOf(['success', 'loading', 'error']), + /** + * 输入提示 + */ + placeholder: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + /** + * 默认展现的月 + * @return {MomentObject} 返回包含指定月份的 moment 对象实例 + */ + defaultVisibleMonth: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + onVisibleMonthChange: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 日期值(受控)moment 对象 + */ + value: _util__WEBPACK_IMPORTED_MODULE_17__["checkDateValue"], + /** + * 初始日期值,moment 对象 + */ + defaultValue: _util__WEBPACK_IMPORTED_MODULE_17__["checkDateValue"], + /** + * 日期值的格式(用于限定用户输入和展示) + */ + format: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + /** + * 是否使用时间控件,传入 TimePicker 的属性 { defaultValue, format, ... } + */ + showTime: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool]), + /** + * 每次选择日期时是否重置时间(仅在 showTime 开启时有效) + */ + resetTime: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 禁用日期函数 + * @param {MomentObject} 日期值 + * @param {String} view 当前视图类型,year: 年, month: 月, date: 日 + * @return {Boolean} 是否禁用 + */ + disabledDate: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 自定义面板页脚 + * @return {Node} 自定义的面板页脚组件 + */ + footerRender: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 日期值改变时的回调 + * @param {MomentObject|String} value 日期值 + */ + onChange: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 点击确认按钮时的回调 + * @return {MomentObject|String} 日期值 + */ + onOk: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 输入框尺寸 + */ + size: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOf(['small', 'medium', 'large']), + /** + * 是否禁用 + */ + disabled: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 是否显示清空按钮 + */ + hasClear: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 弹层显示状态 + */ + visible: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 弹层默认是否显示 + */ + defaultVisible: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 弹层展示状态变化时的回调 + * @param {Boolean} visible 弹层是否显示 + * @param {String} type 触发弹层显示和隐藏的来源 calendarSelect 表示由日期表盘的选择触发; okBtnClick 表示由确认按钮触发; fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发 + */ + onVisibleChange: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 弹层触发方式 + */ + popupTriggerType: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOf(['click', 'hover']), + /** + * 弹层对齐方式,具体含义见 OverLay文档 + */ + popupAlign: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + /** + * 弹层容器 + * @param {Element} target 目标元素 + * @return {Element} 弹层的容器元素 + */ + popupContainer: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.any, + /** + * 弹层自定义样式 + */ + popupStyle: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object, + /** + * 弹层自定义样式类 + */ + popupClassName: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + /** + * 弹层其他属性 + */ + popupProps: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object, + /** + * 是否跟随滚动 + */ + followTrigger: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 输入框其他属性 + */ + inputProps: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object, + /** + * 自定义日期渲染函数 + * @param {Object} value 日期值(moment对象) + * @returns {ReactNode} + */ + dateCellRender: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 自定义月份渲染函数 + * @param {Object} calendarDate 对应 Calendar 返回的自定义日期对象 + * @returns {ReactNode} + */ + monthCellRender: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + yearCellRender: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, // 兼容 0.x yearCellRender + /** + * 日期输入框的 aria-label 属性 + */ + dateInputAriaLabel: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + /** + * 时间输入框的 aria-label 属性 + */ + timeInputAriaLabel: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + /** + * 是否为预览态 + */ + isPreview: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 预览态模式下渲染的内容 + * @param {MomentObject} value 日期 + */ + renderPreview: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + locale: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object, + className: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + name: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + popupComponent: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.elementType, + popupContent: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.node, + disableChangeMode: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + yearRange: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.number) +}), _class.defaultProps = { + prefix: 'next-', + rtl: false, + format: 'YYYY-MM-DD', + size: 'medium', + showTime: false, + resetTime: false, + disabledDate: function disabledDate() { + return false; + }, + footerRender: function footerRender() { + return null; + }, + hasClear: true, + popupTriggerType: 'click', + popupAlign: 'tl tl', + locale: _locale_zh_cn__WEBPACK_IMPORTED_MODULE_15__["default"].DatePicker, + defaultVisible: false, + onChange: _util__WEBPACK_IMPORTED_MODULE_16__["func"].noop, + onVisibleChange: _util__WEBPACK_IMPORTED_MODULE_16__["func"].noop, + onOk: _util__WEBPACK_IMPORTED_MODULE_16__["func"].noop +}, _initialiseProps = function _initialiseProps() { + var _this2 = this; + + this.onValueChange = function (newValue) { + var handler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'onChange'; + + var ret = _this2.inputAsString && newValue ? newValue.format(_this2.dateTimeFormat) : newValue; + _this2.props[handler](ret); + }; + + this.onSelectCalendarPanel = function (value) { + var _props3 = _this2.props, + showTime = _props3.showTime, + resetTime = _props3.resetTime; + + + var prevValue = _this2.state.value; + var newValue = value; + if (showTime) { + if (!prevValue) { + // 第一次选择日期值时,如果设置了默认时间,则使用该默认时间 + if (showTime.defaultValue) { + var defaultTimeValue = Object(_util__WEBPACK_IMPORTED_MODULE_17__["formatDateValue"])(showTime.defaultValue, _this2.timeFormat); + newValue = Object(_util__WEBPACK_IMPORTED_MODULE_17__["resetValueTime"])(value, defaultTimeValue); + } + } else if (!resetTime) { + // 非第一选择日期,如果开启了 resetTime 属性,则记住之前选择的时间值 + newValue = Object(_util__WEBPACK_IMPORTED_MODULE_17__["resetValueTime"])(value, prevValue); + } + } + + _this2.handleChange(newValue, prevValue, { inputing: false }); + + if (!showTime) { + _this2.onVisibleChange(false, 'calendarSelect'); + } + }; + + this.onSelectTimePanel = function (value) { + _this2.handleChange(value, _this2.state.value, { inputing: false }); + }; + + this.clearValue = function () { + _this2.setState({ + dateInputStr: '', + timeInputStr: '' + }); + + _this2.handleChange(null, _this2.state.value, { inputing: false }); + }; + + this.onDateInputChange = function (inputStr, e, eventType) { + if (eventType === 'clear' || !inputStr) { + e.stopPropagation(); + _this2.clearValue(); + } else { + _this2.setState({ + dateInputStr: inputStr, + inputing: 'date' + }); + } + }; + + this.onTimeInputChange = function (inputStr) { + _this2.setState({ + timeInputStr: inputStr, + inputing: 'time' + }); + }; + + this.onDateInputBlur = function () { + var dateInputStr = _this2.state.dateInputStr; + + if (dateInputStr) { + var disabledDate = _this2.props.disabledDate; + + var parsed = moment__WEBPACK_IMPORTED_MODULE_9___default()(dateInputStr, _this2.format, true); + + _this2.setState({ + dateInputStr: '', + inputing: false + }); + + if (parsed.isValid() && !disabledDate(parsed, 'date')) { + _this2.handleChange(parsed, _this2.state.value); + } + } + }; + + this.onTimeInputBlur = function () { + var _state2 = _this2.state, + value = _state2.value, + timeInputStr = _state2.timeInputStr; + + if (timeInputStr) { + var parsed = moment__WEBPACK_IMPORTED_MODULE_9___default()(timeInputStr, _this2.timeFormat, true); + + _this2.setState({ + timeInputStr: '', + inputing: false + }); + + if (parsed.isValid()) { + var hour = parsed.hour(); + var minute = parsed.minute(); + var second = parsed.second(); + var newValue = value.clone().hour(hour).minute(minute).second(second); + + _this2.handleChange(newValue, _this2.state.value); + } + } + }; + + this.onKeyDown = function (e) { + var format = _this2.props.format; + var _state3 = _this2.state, + dateInputStr = _state3.dateInputStr, + value = _state3.value; + + var dateStr = Object(_util__WEBPACK_IMPORTED_MODULE_17__["onDateKeydown"])(e, { format: format, dateInputStr: dateInputStr, value: value }, 'day'); + if (!dateStr) return; + _this2.onDateInputChange(dateStr); + }; + + this.onTimeKeyDown = function (e) { + var showTime = _this2.props.showTime; + var _state4 = _this2.state, + timeInputStr = _state4.timeInputStr, + value = _state4.value; + + var _ref = (typeof showTime === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(showTime)) === 'object' ? showTime : {}, + disabledMinutes = _ref.disabledMinutes, + disabledSeconds = _ref.disabledSeconds, + _ref$hourStep = _ref.hourStep, + hourStep = _ref$hourStep === undefined ? 1 : _ref$hourStep, + _ref$minuteStep = _ref.minuteStep, + minuteStep = _ref$minuteStep === undefined ? 1 : _ref$minuteStep, + _ref$secondStep = _ref.secondStep, + secondStep = _ref$secondStep === undefined ? 1 : _ref$secondStep; + + var unit = 'second'; + + if (disabledSeconds) { + unit = disabledMinutes ? 'hour' : 'minute'; + } + + var timeStr = Object(_util__WEBPACK_IMPORTED_MODULE_17__["onTimeKeydown"])(e, { + format: _this2.timeFormat, + timeInputStr: timeInputStr, + value: value, + steps: { + hour: hourStep, + minute: minuteStep, + second: secondStep + } + }, unit); + + if (!timeStr) return; + + _this2.onTimeInputChange(timeStr); + }; + + this.handleChange = function (newValue, prevValue) { + var others = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + if (!('value' in _this2.props)) { + _this2.setState(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({ + value: newValue + }, others)); + } else { + _this2.setState(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, others)); + } + + var newValueOf = newValue ? newValue.valueOf() : null; + var preValueOf = prevValue ? prevValue.valueOf() : null; + + if (newValueOf !== preValueOf) { + _this2.onValueChange(newValue); + } + }; + + this.onFoucsDateInput = function () { + if (_this2.state.panel !== _util__WEBPACK_IMPORTED_MODULE_17__["PANEL"].DATE) { + _this2.setState({ + panel: _util__WEBPACK_IMPORTED_MODULE_17__["PANEL"].DATE + }); + } + }; + + this.onFoucsTimeInput = function () { + if (_this2.state.panel !== _util__WEBPACK_IMPORTED_MODULE_17__["PANEL"].TIME) { + _this2.setState({ + panel: _util__WEBPACK_IMPORTED_MODULE_17__["PANEL"].TIME + }); + } + }; + + this.onVisibleChange = function (visible, type) { + if (!('visible' in _this2.props)) { + _this2.setState({ + visible: visible + }); + } + _this2.props.onVisibleChange(visible, type); + }; + + this.changePanel = function (panel) { + _this2.setState({ + panel: panel + }); + }; + + this.onOk = function () { + _this2.onVisibleChange(false, 'okBtnClick'); + _this2.onValueChange(_this2.state.value, 'onOk'); + }; +}, _temp); +DatePicker.displayName = 'DatePicker'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/index.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/index.js ***! + \*******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _date_picker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./date-picker */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/date-picker.js"); +/* harmony import */ var _range_picker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./range-picker */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/range-picker.js"); +/* harmony import */ var _month_picker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./month-picker */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/month-picker.js"); +/* harmony import */ var _year_picker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./year-picker */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/year-picker.js"); +/* harmony import */ var _week_picker__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./week-picker */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/week-picker.js"); + + + + + + + + +/* istanbul ignore next */ +var transform = function transform(props, deprecated) { + var open = props.open, + defaultOpen = props.defaultOpen, + onOpenChange = props.onOpenChange, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default()(props, ['open', 'defaultOpen', 'onOpenChange']); + + var newProps = others; + + delete newProps.formater; + + if ('open' in props) { + deprecated('open', 'visible', 'DatePicker'); + + newProps.visible = open; + + if ('visible' in props) { + newProps.visible = props.visible; + } + } + + if ('defaultOpen' in props) { + deprecated('defaultOpen', 'defaultVisible', 'DatePicker'); + + newProps.defaultVisible = defaultOpen; + + if ('defaultVisible' in props) { + newProps.defaultVisible = props.defaultVisible; + } + } + + if ('onOpenChange' in props && typeof onOpenChange === 'function') { + deprecated('onOpenChange', 'onVisibleChange', 'DatePicker'); + + newProps.onVisibleChange = onOpenChange; + + if ('onVisibleChange' in props) { + newProps.onVisibleChange = props.onVisibleChange; + } + } + + if ('formater' in props) { + deprecated('formater', 'format showTime.format', 'DatePicker'); + } + + if ('format' in props && typeof props.format !== 'string') { + deprecated('format', 'format: PropTypes.string,', 'DatePicker'); + } + + if ('ranges' in props) { + deprecated('ranges', 'footerRender: PropTypes.func', 'RangePicker'); + } + + return newProps; +}; + +_date_picker__WEBPACK_IMPORTED_MODULE_2__["default"].RangePicker = _config_provider__WEBPACK_IMPORTED_MODULE_1__["default"].config(_range_picker__WEBPACK_IMPORTED_MODULE_3__["default"], { + componentName: 'DatePicker', + transform: transform +}); +_date_picker__WEBPACK_IMPORTED_MODULE_2__["default"].MonthPicker = _config_provider__WEBPACK_IMPORTED_MODULE_1__["default"].config(_month_picker__WEBPACK_IMPORTED_MODULE_4__["default"], { + componentName: 'DatePicker', + transform: transform +}); +_date_picker__WEBPACK_IMPORTED_MODULE_2__["default"].YearPicker = _config_provider__WEBPACK_IMPORTED_MODULE_1__["default"].config(_year_picker__WEBPACK_IMPORTED_MODULE_5__["default"], { + componentName: 'DatePicker', + transform: transform +}); + +_date_picker__WEBPACK_IMPORTED_MODULE_2__["default"].WeekPicker = _config_provider__WEBPACK_IMPORTED_MODULE_1__["default"].config(_week_picker__WEBPACK_IMPORTED_MODULE_6__["default"], { + componentName: 'DatePicker' +}); + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_1__["default"].config(_date_picker__WEBPACK_IMPORTED_MODULE_2__["default"], { + transform: transform +})); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/main.scss": +/*!********************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/main.scss ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694895257 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/module/panel-footer.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/module/panel-footer.js ***! + \*********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! moment */ "./node_modules/_moment@2.24.0@moment/moment.js"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../button */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/util/index.js"); + + + + + +var _class, _temp2; + + + + + + + +var PanelFooter = (_temp2 = _class = function (_React$PureComponent) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(PanelFooter, _React$PureComponent); + + function PanelFooter() { + var _temp, _this, _ret; + + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, PanelFooter); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args))), _this), _this.changePanel = function () { + var _PANEL$DATE$PANEL$TIM; + + var targetPanel = (_PANEL$DATE$PANEL$TIM = {}, _PANEL$DATE$PANEL$TIM[_util__WEBPACK_IMPORTED_MODULE_8__["PANEL"].DATE] = _util__WEBPACK_IMPORTED_MODULE_8__["PANEL"].TIME, _PANEL$DATE$PANEL$TIM[_util__WEBPACK_IMPORTED_MODULE_8__["PANEL"].TIME] = _util__WEBPACK_IMPORTED_MODULE_8__["PANEL"].DATE, _PANEL$DATE$PANEL$TIM)[_this.props.panel]; + _this.props.onPanelChange(targetPanel); + }, _this.createRanges = function (ranges) { + if (!ranges || ranges.length === 0) return null; + var _this$props = _this.props, + onOk = _this$props.onOk, + prefix = _this$props.prefix; + + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + { className: prefix + 'date-picker-panel-tools' }, + ranges.map(function (_ref) { + var label = _ref.label, + _ref$value = _ref.value, + value = _ref$value === undefined ? [] : _ref$value, + onChange = _ref.onChange; + + var handleClick = function handleClick() { + onChange(value.map(function (v) { + return moment__WEBPACK_IMPORTED_MODULE_5___default()(v); + })); + onOk(); + }; + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + _button__WEBPACK_IMPORTED_MODULE_6__["default"], + { + key: label, + text: true, + size: 'small', + type: 'primary', + onClick: handleClick + }, + label + ); + }) + ); + }, _temp), babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(_this, _ret); + } + + PanelFooter.prototype.render = function render() { + var _PANEL$DATE$PANEL$TIM2; + + var _props = this.props, + prefix = _props.prefix, + locale = _props.locale, + panel = _props.panel, + value = _props.value, + ranges = _props.ranges, + disabledOk = _props.disabledOk, + onPanelChange = _props.onPanelChange, + onOk = _props.onOk; + + var panelBtnLabel = (_PANEL$DATE$PANEL$TIM2 = {}, _PANEL$DATE$PANEL$TIM2[_util__WEBPACK_IMPORTED_MODULE_8__["PANEL"].DATE] = locale.selectTime, _PANEL$DATE$PANEL$TIM2[_util__WEBPACK_IMPORTED_MODULE_8__["PANEL"].TIME] = locale.selectDate, _PANEL$DATE$PANEL$TIM2)[panel]; + + var sharedBtnProps = { + size: 'small', + type: 'primary', + disabled: !value + }; + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + { className: prefix + 'date-picker-panel-footer' }, + this.createRanges(ranges), + onPanelChange ? react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + _button__WEBPACK_IMPORTED_MODULE_6__["default"], + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, sharedBtnProps, { text: true, onClick: this.changePanel }), + panelBtnLabel + ) : null, + react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + _button__WEBPACK_IMPORTED_MODULE_6__["default"], + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, sharedBtnProps, { + disabled: disabledOk || !value, + onClick: onOk + }), + locale.ok + ) + ); + }; + + return PanelFooter; +}(react__WEBPACK_IMPORTED_MODULE_4___default.a.PureComponent), _class.defaultProps = { + // onPanelChange: func.noop, + onOk: _util__WEBPACK_IMPORTED_MODULE_7__["func"].noop +}, _temp2); + + +/* harmony default export */ __webpack_exports__["default"] = (PanelFooter); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/month-picker.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/month-picker.js ***! + \**************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! moment */ "./node_modules/_moment@2.24.0@moment/moment.js"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _overlay__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../overlay */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/overlay/index.js"); +/* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../input */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/input/index.js"); +/* harmony import */ var _calendar__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../calendar */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/index.js"); +/* harmony import */ var _locale_zh_cn__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../locale/zh-cn */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/locale/zh-cn.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/util/index.js"); + + + + + + +var _class, _temp, _initialiseProps; + + + + + + + + + + + + + +var Popup = _overlay__WEBPACK_IMPORTED_MODULE_10__["default"].Popup; + +/** + * DatePicker.MonthPicker + */ + +var MonthPicker = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(MonthPicker, _Component); + + function MonthPicker(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, MonthPicker); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.call(this, props, context)); + + _initialiseProps.call(_this); + + var value = Object(_util__WEBPACK_IMPORTED_MODULE_15__["formatDateValue"])(props.value || props.defaultValue, props.format); + + _this.inputAsString = typeof (props.value || props.defaultValue) === 'string'; // 判断用户输入是否是字符串 + _this.state = { + value: value, + dateInputStr: '', + inputing: false, + visible: props.visible || props.defaultVisible + }; + return _this; + } + + MonthPicker.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if ('value' in nextProps) { + var value = Object(_util__WEBPACK_IMPORTED_MODULE_15__["formatDateValue"])(nextProps.value, nextProps.format || this.props.format); + this.setState({ + value: value + }); + this.inputAsString = typeof nextProps.value === 'string'; + } + + if ('visible' in nextProps) { + this.setState({ + visible: nextProps.visible + }); + } + }; + + MonthPicker.prototype.renderPreview = function renderPreview(others) { + var _props = this.props, + prefix = _props.prefix, + format = _props.format, + className = _props.className, + renderPreview = _props.renderPreview; + var value = this.state.value; + + var previewCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()(className, prefix + 'form-preview'); + + var label = value ? value.format(format) : ''; + + if (typeof renderPreview === 'function') { + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, others, { className: previewCls }), + renderPreview(value, this.props) + ); + } + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'p', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, others, { className: previewCls }), + label + ); + }; + + MonthPicker.prototype.render = function render() { + var _classnames, _classnames2, _classnames3; + + var _props2 = this.props, + prefix = _props2.prefix, + rtl = _props2.rtl, + locale = _props2.locale, + label = _props2.label, + state = _props2.state, + format = _props2.format, + defaultVisibleYear = _props2.defaultVisibleYear, + disabledDate = _props2.disabledDate, + footerRender = _props2.footerRender, + placeholder = _props2.placeholder, + size = _props2.size, + disabled = _props2.disabled, + hasClear = _props2.hasClear, + popupTriggerType = _props2.popupTriggerType, + popupAlign = _props2.popupAlign, + popupContainer = _props2.popupContainer, + popupStyle = _props2.popupStyle, + popupClassName = _props2.popupClassName, + popupProps = _props2.popupProps, + popupComponent = _props2.popupComponent, + popupContent = _props2.popupContent, + followTrigger = _props2.followTrigger, + className = _props2.className, + inputProps = _props2.inputProps, + monthCellRender = _props2.monthCellRender, + yearCellRender = _props2.yearCellRender, + dateInputAriaLabel = _props2.dateInputAriaLabel, + isPreview = _props2.isPreview, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default()(_props2, ['prefix', 'rtl', 'locale', 'label', 'state', 'format', 'defaultVisibleYear', 'disabledDate', 'footerRender', 'placeholder', 'size', 'disabled', 'hasClear', 'popupTriggerType', 'popupAlign', 'popupContainer', 'popupStyle', 'popupClassName', 'popupProps', 'popupComponent', 'popupContent', 'followTrigger', 'className', 'inputProps', 'monthCellRender', 'yearCellRender', 'dateInputAriaLabel', 'isPreview']); + + var _state = this.state, + visible = _state.visible, + value = _state.value, + dateInputStr = _state.dateInputStr, + inputing = _state.inputing; + + + var monthPickerCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classnames = {}, _classnames[prefix + 'month-picker'] = true, _classnames), className); + + var triggerInputCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classnames2 = {}, _classnames2[prefix + 'month-picker-input'] = true, _classnames2[prefix + 'error'] = false, _classnames2)); + + var panelBodyClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classnames3 = {}, _classnames3[prefix + 'month-picker-body'] = true, _classnames3)); + + if (rtl) { + others.dir = 'rtl'; + } + + if (isPreview) { + return this.renderPreview(_util__WEBPACK_IMPORTED_MODULE_14__["obj"].pickOthers(others, MonthPicker.PropTypes)); + } + + var panelInputCls = prefix + 'month-picker-panel-input'; + + var sharedInputProps = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, inputProps, { + size: size, + disabled: disabled, + onChange: this.onDateInputChange, + onBlur: this.onDateInputBlur, + onPressEnter: this.onDateInputBlur, + onKeyDown: this.onKeyDown + }); + + var dateInputValue = inputing ? dateInputStr : value && value.format(format) || ''; + var triggerInputValue = dateInputValue; + + var dateInput = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_input__WEBPACK_IMPORTED_MODULE_11__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, sharedInputProps, { + value: dateInputValue, + 'aria-label': dateInputAriaLabel, + onFocus: this.onFoucsDateInput, + placeholder: format, + className: panelInputCls + })); + + var datePanel = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_calendar__WEBPACK_IMPORTED_MODULE_12__["default"], { + shape: 'panel', + modes: ['month', 'year'], + monthCellRender: monthCellRender, + yearCellRender: yearCellRender, + value: value, + onSelect: this.onSelectCalendarPanel, + defaultVisibleMonth: defaultVisibleYear, + disabledDate: disabledDate + }); + + var panelBody = datePanel; + var panelFooter = footerRender(); + + var allowClear = value && hasClear; + var trigger = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { className: prefix + 'month-picker-trigger' }, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_input__WEBPACK_IMPORTED_MODULE_11__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, sharedInputProps, { + label: label, + state: state, + readOnly: true, + value: triggerInputValue, + placeholder: placeholder || locale.monthPlaceholder, + hint: 'calendar', + hasClear: allowClear, + className: triggerInputCls + })) + ); + + var PopupComponent = popupComponent ? popupComponent : Popup; + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, _util__WEBPACK_IMPORTED_MODULE_14__["obj"].pickOthers(MonthPicker.propTypes, others), { + className: monthPickerCls + }), + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + PopupComponent, + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({ + autoFocus: true, + align: popupAlign + }, popupProps, { + followTrigger: followTrigger, + role: 'combobox', + 'aria-expanded': visible, + disabled: disabled, + visible: visible, + onVisibleChange: this.onVisibleChange, + triggerType: popupTriggerType, + container: popupContainer, + style: popupStyle, + className: popupClassName, + trigger: trigger + }), + popupContent ? popupContent : react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { className: panelBodyClassName, dir: others.dir }, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { + className: prefix + 'month-picker-panel-header' + }, + dateInput + ), + panelBody, + panelFooter + ) + ) + ); + }; + + return MonthPicker; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, _config_provider__WEBPACK_IMPORTED_MODULE_9__["default"].propTypes, { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 输入框内置标签 + */ + label: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node, + /** + * 输入框状态 + */ + state: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['success', 'loading', 'error']), + /** + * 输入提示 + */ + placeholder: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 默认展现的年 + * @return {MomentObject} 返回包含指定年份的 moment 对象实例 + */ + defaultVisibleYear: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 日期值(受控)moment 对象 + */ + value: _util__WEBPACK_IMPORTED_MODULE_15__["checkDateValue"], + /** + * 初始日期值,moment 对象 + */ + defaultValue: _util__WEBPACK_IMPORTED_MODULE_15__["checkDateValue"], + /** + * 日期值的格式(用于限定用户输入和展示) + */ + format: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 禁用日期函数 + * @param {MomentObject} 日期值 + * @param {String} view 当前视图类型,year: 年, month: 月, date: 日 + * @return {Boolean} 是否禁用 + */ + disabledDate: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 自定义面板页脚 + * @return {Node} 自定义的面板页脚组件 + */ + footerRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 日期值改变时的回调 + * @param {MomentObject|String} value 日期值 + */ + onChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 输入框尺寸 + */ + size: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['small', 'medium', 'large']), + /** + * 是否禁用 + */ + disabled: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 是否显示清空按钮 + */ + hasClear: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层显示状态 + */ + visible: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层默认是否显示 + */ + defaultVisible: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层展示状态变化时的回调 + * @param {Boolean} visible 弹层是否显示 + * @param {String} type 触发弹层显示和隐藏的来源 calendarSelect 表示由日期表盘的选择触发; fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发 + */ + onVisibleChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 弹层触发方式 + */ + popupTriggerType: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['click', 'hover']), + /** + * 弹层对齐方式, 具体含义见 OverLay文档 + */ + popupAlign: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 弹层容器 + * @param {Element} target 目标元素 + * @return {Element} 弹层的容器元素 + */ + popupContainer: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + /** + * 弹层自定义样式 + */ + popupStyle: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 弹层自定义样式类 + */ + popupClassName: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 弹层其他属性 + */ + popupProps: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 是否跟随滚动 + */ + followTrigger: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 输入框其他属性 + */ + inputProps: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 自定义月份渲染函数 + * @param {Object} calendarDate 对应 Calendar 返回的自定义日期对象 + * @returns {ReactNode} + */ + monthCellRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + yearCellRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, // 兼容 0.x yearCellRender + /** + * 日期输入框的 aria-label 属性 + */ + dateInputAriaLabel: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 是否为预览态 + */ + isPreview: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 预览态模式下渲染的内容 + * @param {MomentObject} value 月份 + */ + renderPreview: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + locale: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + name: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + popupComponent: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.elementType, + popupContent: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node +}), _class.defaultProps = { + prefix: 'next-', + rtl: false, + format: 'YYYY-MM', + size: 'medium', + disabledDate: function disabledDate() { + return false; + }, + footerRender: function footerRender() { + return null; + }, + hasClear: true, + popupTriggerType: 'click', + popupAlign: 'tl tl', + locale: _locale_zh_cn__WEBPACK_IMPORTED_MODULE_13__["default"].DatePicker, + onChange: _util__WEBPACK_IMPORTED_MODULE_14__["func"].noop, + onVisibleChange: _util__WEBPACK_IMPORTED_MODULE_14__["func"].noop +}, _initialiseProps = function _initialiseProps() { + var _this2 = this; + + this.onValueChange = function (newValue) { + var ret = _this2.inputAsString && newValue ? newValue.format(_this2.props.format) : newValue; + _this2.props.onChange(ret); + }; + + this.onSelectCalendarPanel = function (value) { + // const { format } = this.props; + var prevSelectedMonth = _this2.state.value; + var selectedMonth = value.clone().date(1).hour(0).minute(0).second(0); + + _this2.handleChange(selectedMonth, prevSelectedMonth, { inputing: false }, function () { + _this2.onVisibleChange(false, 'calendarSelect'); + }); + }; + + this.clearValue = function () { + _this2.setState({ + dateInputStr: '' + }); + + _this2.handleChange(null, _this2.state.value); + }; + + this.onDateInputChange = function (inputStr, e, eventType) { + if (eventType === 'clear' || !inputStr) { + e.stopPropagation(); + _this2.clearValue(); + } else { + _this2.setState({ + dateInputStr: inputStr, + inputing: true + }); + } + }; + + this.onDateInputBlur = function () { + var dateInputStr = _this2.state.dateInputStr; + + if (dateInputStr) { + var _props3 = _this2.props, + disabledDate = _props3.disabledDate, + format = _props3.format; + + var parsed = moment__WEBPACK_IMPORTED_MODULE_8___default()(dateInputStr, format, true); + + _this2.setState({ + dateInputStr: '', + inputing: false + }); + + if (parsed.isValid() && !disabledDate(parsed, 'month')) { + _this2.handleChange(parsed, _this2.state.value); + } + } + }; + + this.onKeyDown = function (e) { + var format = _this2.props.format; + var _state2 = _this2.state, + dateInputStr = _state2.dateInputStr, + value = _state2.value; + + var dateStr = Object(_util__WEBPACK_IMPORTED_MODULE_15__["onDateKeydown"])(e, { format: format, dateInputStr: dateInputStr, value: value }, 'month'); + if (!dateStr) return; + _this2.onDateInputChange(dateStr); + }; + + this.handleChange = function (newValue, prevValue) { + var others = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var callback = arguments[3]; + + if (!('value' in _this2.props)) { + _this2.setState(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({ + value: newValue + }, others)); + } else { + _this2.setState(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, others)); + } + + var format = _this2.props.format; + + + var newValueOf = newValue ? newValue.format(format) : null; + var preValueOf = prevValue ? prevValue.format(format) : null; + + if (newValueOf !== preValueOf) { + _this2.onValueChange(newValue); + if (typeof callback === 'function') { + return callback(); + } + } + }; + + this.onVisibleChange = function (visible, type) { + if (!('visible' in _this2.props)) { + _this2.setState({ + visible: visible + }); + } + _this2.props.onVisibleChange(visible, type); + }; +}, _temp); +MonthPicker.displayName = 'MonthPicker'; + + +/* harmony default export */ __webpack_exports__["default"] = (MonthPicker); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/range-picker.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/range-picker.js ***! + \**************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RangePicker; }); +/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/typeof */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/typeof.js"); +/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! moment */ "./node_modules/_moment@2.24.0@moment/moment.js"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_9__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _overlay__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../overlay */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/overlay/index.js"); +/* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../input */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/input/index.js"); +/* harmony import */ var _calendar__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../calendar */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/index.js"); +/* harmony import */ var _calendar_range_calendar__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../calendar/range-calendar */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/range-calendar.js"); +/* harmony import */ var _time_picker_panel__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../time-picker/panel */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/time-picker/panel.js"); +/* harmony import */ var _locale_zh_cn__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../locale/zh-cn */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/locale/zh-cn.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/util/index.js"); +/* harmony import */ var _module_panel_footer__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./module/panel-footer */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/module/panel-footer.js"); + + + + + + + +var _class, _temp, _initialiseProps; + + + + + + + + + + + + + + + + +var Popup = _overlay__WEBPACK_IMPORTED_MODULE_11__["default"].Popup; + + +function mapInputStateName(name) { + return { + startValue: 'startDateInputStr', + endValue: 'endDateInputStr', + startTime: 'startTimeInputStr', + endTime: 'endTimeInputStr' + }[name]; +} + +function mapTimeToValue(name) { + return { + startTime: 'startValue', + endTime: 'endValue' + }[name]; +} + +function getFormatValues(values, format) { + if (!Array.isArray(values)) { + return [null, null]; + } + return [Object(_util__WEBPACK_IMPORTED_MODULE_18__["formatDateValue"])(values[0], format), Object(_util__WEBPACK_IMPORTED_MODULE_18__["formatDateValue"])(values[1], format)]; +} + +/** + * DatePicker.RangePicker + */ +var RangePicker = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5___default()(RangePicker, _Component); + + function RangePicker(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, RangePicker); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, _Component.call(this, props, context)); + + _initialiseProps.call(_this); + + var dateTimeFormat = Object(_util__WEBPACK_IMPORTED_MODULE_18__["getDateTimeFormat"])(props.format, props.showTime, props.type); + Object(_util__WEBPACK_IMPORTED_MODULE_18__["extend"])(dateTimeFormat, _this); + + var val = props.value || props.defaultValue; + var values = getFormatValues(val, _this.dateTimeFormat); + _this.inputAsString = val && (typeof val[0] === 'string' || typeof val[1] === 'string'); + _this.state = { + visible: props.visible || props.defaultVisible, + startValue: values[0], + endValue: values[1], + startDateInputStr: '', + endDateInputStr: '', + activeDateInput: 'startValue', + startTimeInputStr: '', + endTimeInputStr: '', + inputing: false, // 当前是否处于输入状态 + panel: _util__WEBPACK_IMPORTED_MODULE_18__["PANEL"].DATE + }; + return _this; + } + + RangePicker.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if ('showTime' in nextProps) { + var dateTimeFormat = Object(_util__WEBPACK_IMPORTED_MODULE_18__["getDateTimeFormat"])(nextProps.format || this.props.format, nextProps.showTime, nextProps.type); + Object(_util__WEBPACK_IMPORTED_MODULE_18__["extend"])(dateTimeFormat, this); + } + + if ('value' in nextProps) { + var values = getFormatValues(nextProps.value, this.dateTimeFormat); + this.setState({ + startValue: values[0], + endValue: values[1] + }); + this.inputAsString = nextProps.value && (typeof nextProps.value[0] === 'string' || typeof nextProps.value[1] === 'string'); + } + + if ('visible' in nextProps) { + this.setState({ + visible: nextProps.visible + }); + } + }; + + // 如果用户没有给定时间禁用逻辑,则给默认到禁用逻辑,即如果是同一天,则时间不能是同样的 + + + RangePicker.prototype.renderPreview = function renderPreview(_ref, others) { + var startValue = _ref[0], + endValue = _ref[1]; + var _props = this.props, + prefix = _props.prefix, + format = _props.format, + className = _props.className, + renderPreview = _props.renderPreview; + + + var previewCls = classnames__WEBPACK_IMPORTED_MODULE_8___default()(className, prefix + 'form-preview'); + var startLabel = startValue ? startValue.format(format) : ''; + var endLabel = endValue ? endValue.format(format) : ''; + + if (typeof renderPreview === 'function') { + return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, others, { className: previewCls }), + renderPreview([startValue, endValue], this.props) + ); + } + + return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'p', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, others, { className: previewCls }), + startLabel, + ' - ', + endLabel + ); + }; + + RangePicker.prototype.render = function render() { + var _classnames, + _classnames2, + _classnames3, + _classnames4, + _classnames5, + _this2 = this, + _PANEL$DATE$PANEL$TIM; + + var _props2 = this.props, + prefix = _props2.prefix, + rtl = _props2.rtl, + type = _props2.type, + defaultVisibleMonth = _props2.defaultVisibleMonth, + onVisibleMonthChange = _props2.onVisibleMonthChange, + showTime = _props2.showTime, + disabledDate = _props2.disabledDate, + footerRender = _props2.footerRender, + label = _props2.label, + _props2$ranges = _props2.ranges, + ranges = _props2$ranges === undefined ? {} : _props2$ranges, + inputState = _props2.state, + size = _props2.size, + disabled = _props2.disabled, + hasClear = _props2.hasClear, + popupTriggerType = _props2.popupTriggerType, + popupAlign = _props2.popupAlign, + popupContainer = _props2.popupContainer, + popupStyle = _props2.popupStyle, + popupClassName = _props2.popupClassName, + popupProps = _props2.popupProps, + popupComponent = _props2.popupComponent, + popupContent = _props2.popupContent, + followTrigger = _props2.followTrigger, + className = _props2.className, + locale = _props2.locale, + inputProps = _props2.inputProps, + dateCellRender = _props2.dateCellRender, + monthCellRender = _props2.monthCellRender, + yearCellRender = _props2.yearCellRender, + startDateInputAriaLabel = _props2.startDateInputAriaLabel, + startTimeInputAriaLabel = _props2.startTimeInputAriaLabel, + endDateInputAriaLabel = _props2.endDateInputAriaLabel, + endTimeInputAriaLabel = _props2.endTimeInputAriaLabel, + isPreview = _props2.isPreview, + disableChangeMode = _props2.disableChangeMode, + yearRange = _props2.yearRange, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props2, ['prefix', 'rtl', 'type', 'defaultVisibleMonth', 'onVisibleMonthChange', 'showTime', 'disabledDate', 'footerRender', 'label', 'ranges', 'state', 'size', 'disabled', 'hasClear', 'popupTriggerType', 'popupAlign', 'popupContainer', 'popupStyle', 'popupClassName', 'popupProps', 'popupComponent', 'popupContent', 'followTrigger', 'className', 'locale', 'inputProps', 'dateCellRender', 'monthCellRender', 'yearCellRender', 'startDateInputAriaLabel', 'startTimeInputAriaLabel', 'endDateInputAriaLabel', 'endTimeInputAriaLabel', 'isPreview', 'disableChangeMode', 'yearRange']); + + var state = this.state; + + var classNames = classnames__WEBPACK_IMPORTED_MODULE_8___default()((_classnames = {}, _classnames[prefix + 'range-picker'] = true, _classnames['' + prefix + size] = size, _classnames[prefix + 'disabled'] = disabled, _classnames), className); + + var panelBodyClassName = classnames__WEBPACK_IMPORTED_MODULE_8___default()((_classnames2 = {}, _classnames2[prefix + 'range-picker-body'] = true, _classnames2[prefix + 'range-picker-body-show-time'] = showTime, _classnames2)); + + var triggerCls = classnames__WEBPACK_IMPORTED_MODULE_8___default()((_classnames3 = {}, _classnames3[prefix + 'range-picker-trigger'] = true, _classnames3[prefix + 'error'] = inputState === 'error', _classnames3)); + + var startDateInputCls = classnames__WEBPACK_IMPORTED_MODULE_8___default()((_classnames4 = {}, _classnames4[prefix + 'range-picker-panel-input-start-date'] = true, _classnames4[prefix + 'focus'] = state.activeDateInput === 'startValue', _classnames4)); + + var endDateInputCls = classnames__WEBPACK_IMPORTED_MODULE_8___default()((_classnames5 = {}, _classnames5[prefix + 'range-picker-panel-input-end-date'] = true, _classnames5[prefix + 'focus'] = state.activeDateInput === 'endValue', _classnames5)); + + if (rtl) { + others.dir = 'rtl'; + } + + if (isPreview) { + return this.renderPreview([state.startValue, state.endValue], _util__WEBPACK_IMPORTED_MODULE_17__["obj"].pickOthers(others, RangePicker.PropTypes)); + } + + var startDateInputValue = state.inputing === 'startValue' ? state.startDateInputStr : state.startValue && state.startValue.format(this.format) || ''; + var endDateInputValue = state.inputing === 'endValue' ? state.endDateInputStr : state.endValue && state.endValue.format(this.format) || ''; + + var startTriggerValue = startDateInputValue; + var endTriggerValue = endDateInputValue; + + var sharedInputProps = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, inputProps, { + size: size, + disabled: disabled, + onChange: this.onDateInputChange, + onBlur: this.onDateInputBlur, + onPressEnter: this.onDateInputBlur, + onKeyDown: this.onDateInputKeyDown + }); + + var startDateInput = react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_input__WEBPACK_IMPORTED_MODULE_12__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, sharedInputProps, { + 'aria-label': startDateInputAriaLabel, + placeholder: this.format, + value: startDateInputValue, + onFocus: function onFocus() { + return _this2.onFocusDateInput('startValue'); + }, + className: startDateInputCls + })); + + var endDateInput = react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_input__WEBPACK_IMPORTED_MODULE_12__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, sharedInputProps, { + 'aria-label': endDateInputAriaLabel, + placeholder: this.format, + value: endDateInputValue, + onFocus: function onFocus() { + return _this2.onFocusDateInput('endValue'); + }, + className: endDateInputCls + })); + + var shareCalendarProps = { + showOtherMonth: true, + dateCellRender: dateCellRender, + monthCellRender: monthCellRender, + yearCellRender: yearCellRender, + format: this.format, + defaultVisibleMonth: defaultVisibleMonth, + onVisibleMonthChange: onVisibleMonthChange + }; + + var datePanel = type === 'date' ? react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_calendar_range_calendar__WEBPACK_IMPORTED_MODULE_14__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, shareCalendarProps, { + yearRange: yearRange, + disableChangeMode: disableChangeMode, + disabledDate: disabledDate, + onSelect: this.onSelectCalendarPanel, + startValue: state.startValue, + endValue: state.endValue + })) : react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'div', + { className: prefix + 'range-picker-panel-body' }, + react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_calendar__WEBPACK_IMPORTED_MODULE_13__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({ + shape: 'panel', + modes: type === 'month' ? ['month', 'year'] : ['year'] + }, babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, shareCalendarProps), { + disabledDate: function disabledDate(date) { + return state.endValue && date.isAfter(state.endValue, type); + }, + onSelect: function onSelect(value) { + var selectedValue = value.clone().date(1).hour(0).minute(0).second(0); + if (type === 'year') { + selectedValue.month(0); + } + _this2.onSelectCalendarPanel(selectedValue, 'startValue'); + }, + value: state.startValue + })), + react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_calendar__WEBPACK_IMPORTED_MODULE_13__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({ + shape: 'panel', + modes: type === 'month' ? ['month', 'year'] : ['year'] + }, shareCalendarProps, { + disabledDate: function disabledDate(date) { + return state.startValue && date.isBefore(state.startValue, type); + }, + onSelect: function onSelect(value) { + var selectedValue = value.clone().hour(23).minute(59).second(59); + if (type === 'year') { + selectedValue.month(11).date(31); + } else { + selectedValue.date(selectedValue.daysInMonth()); + } + _this2.onSelectCalendarPanel(selectedValue, 'endValue'); + }, + value: state.endValue + })) + ); + + var startTimeInput = null; + var endTimeInput = null; + var timePanel = null; + var panelFooter = footerRender(); + + if (showTime) { + var _classnames6, _classnames7; + + var startTimeInputValue = state.inputing === 'startTime' ? state.startTimeInputStr : state.startValue && state.startValue.format(this.timeFormat) || ''; + var endTimeInputValue = state.inputing === 'endTime' ? state.endTimeInputStr : state.endValue && state.endValue.format(this.timeFormat) || ''; + + startTriggerValue = state.startValue && state.startValue.format(this.dateTimeFormat) || ''; + endTriggerValue = state.endValue && state.endValue.format(this.dateTimeFormat) || ''; + + var sharedTimeInputProps = { + size: size, + placeholder: this.timeFormat, + onFocus: this.onFocusTimeInput, + onBlur: this.onTimeInputBlur, + onPressEnter: this.onTimeInputBlur, + onChange: this.onTimeInputChange, + onKeyDown: this.onTimeInputKeyDown + }; + + var startTimeInputCls = classnames__WEBPACK_IMPORTED_MODULE_8___default()((_classnames6 = {}, _classnames6[prefix + 'range-picker-panel-input-start-time'] = true, _classnames6[prefix + 'focus'] = state.activeDateInput === 'startTime', _classnames6)); + + startTimeInput = react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_input__WEBPACK_IMPORTED_MODULE_12__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, sharedTimeInputProps, { + value: startTimeInputValue, + 'aria-label': startTimeInputAriaLabel, + disabled: disabled || !state.startValue, + onFocus: function onFocus() { + return _this2.onFocusTimeInput('startTime'); + }, + className: startTimeInputCls + })); + + var endTimeInputCls = classnames__WEBPACK_IMPORTED_MODULE_8___default()((_classnames7 = {}, _classnames7[prefix + 'range-picker-panel-input-end-time'] = true, _classnames7[prefix + 'focus'] = state.activeDateInput === 'endTime', _classnames7)); + + endTimeInput = react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_input__WEBPACK_IMPORTED_MODULE_12__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, sharedTimeInputProps, { + value: endTimeInputValue, + 'aria-label': endTimeInputAriaLabel, + disabled: disabled || !state.endValue, + onFocus: function onFocus() { + return _this2.onFocusTimeInput('endTime'); + }, + className: endTimeInputCls + })); + + var showSecond = this.timeFormat.indexOf('s') > -1; + var showMinute = this.timeFormat.indexOf('m') > -1; + + var sharedTimePickerProps = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, showTime, { + prefix: prefix, + locale: locale, + disabled: disabled, + showSecond: showSecond, + showMinute: showMinute + }); + + var disabledTime = this.getDisabledTime(state); + + timePanel = react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'div', + { className: prefix + 'range-picker-panel-time' }, + react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_time_picker_panel__WEBPACK_IMPORTED_MODULE_15__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, sharedTimePickerProps, { + disabled: disabled || !state.startValue, + className: prefix + 'range-picker-panel-time-start', + value: state.startValue, + onSelect: this.onSelectStartTime + })), + react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_time_picker_panel__WEBPACK_IMPORTED_MODULE_15__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, sharedTimePickerProps, disabledTime, { + disabled: disabled || !state.endValue, + className: prefix + 'range-picker-panel-time-end', + value: state.endValue, + onSelect: this.onSelectEndTime + })) + ); + } + + panelFooter = panelFooter || react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_module_panel_footer__WEBPACK_IMPORTED_MODULE_19__["default"], { + prefix: prefix, + value: state.startValue || state.endValue, + ranges: Object.keys(ranges).map(function (key) { + return { + label: key, + value: ranges[key], + onChange: function onChange(values) { + _this2.setState({ + startValue: values[0], + endValue: values[1] + }); + _this2.onValueChange(values); + } + }; + }), + disabledOk: !state.startValue || !state.endValue || state.startValue.valueOf() > state.endValue.valueOf(), + locale: locale, + panel: state.panel, + onPanelChange: showTime ? this.changePanel : null, + onOk: this.onOk + }); + + var panelBody = (_PANEL$DATE$PANEL$TIM = {}, _PANEL$DATE$PANEL$TIM[_util__WEBPACK_IMPORTED_MODULE_18__["PANEL"].DATE] = datePanel, _PANEL$DATE$PANEL$TIM[_util__WEBPACK_IMPORTED_MODULE_18__["PANEL"].TIME] = timePanel, _PANEL$DATE$PANEL$TIM)[state.panel]; + + var allowClear = state.startValue && state.endValue && hasClear; + var trigger = react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'div', + { className: triggerCls }, + react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_input__WEBPACK_IMPORTED_MODULE_12__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, sharedInputProps, { + readOnly: true, + role: 'combobox', + 'aria-expanded': state.visible, + label: label, + placeholder: locale.startPlaceholder, + value: startTriggerValue, + hasBorder: false, + className: prefix + 'range-picker-trigger-input', + onFocus: function onFocus() { + return _this2.onFocusDateInput('startValue'); + } + })), + react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'span', + { className: prefix + 'range-picker-trigger-separator' }, + '-' + ), + react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_input__WEBPACK_IMPORTED_MODULE_12__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, sharedInputProps, { + readOnly: true, + role: 'combobox', + 'aria-expanded': state.visible, + placeholder: locale.endPlaceholder, + value: endTriggerValue, + hasBorder: false, + className: prefix + 'range-picker-trigger-input', + onFocus: function onFocus() { + return _this2.onFocusDateInput('endValue'); + }, + hasClear: allowClear, + hint: 'calendar' + })) + ); + + var PopupComponent = popupComponent ? popupComponent : Popup; + + return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, _util__WEBPACK_IMPORTED_MODULE_17__["obj"].pickOthers(RangePicker.propTypes, others), { + className: classNames + }), + react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + PopupComponent, + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({ + autoFocus: true, + align: popupAlign + }, popupProps, { + followTrigger: followTrigger, + disabled: disabled, + visible: state.visible, + onVisibleChange: this.onVisibleChange, + triggerType: popupTriggerType, + container: popupContainer, + style: popupStyle, + className: popupClassName, + trigger: trigger + }), + popupContent ? popupContent : react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'div', + { dir: others.dir, className: panelBodyClassName }, + react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'div', + { + className: prefix + 'range-picker-panel-header' + }, + react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'div', + { + className: prefix + 'range-picker-panel-input' + }, + startDateInput, + startTimeInput, + react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + 'span', + { + className: prefix + 'range-picker-panel-input-separator' + }, + '-' + ), + endDateInput, + endTimeInput + ) + ), + panelBody, + panelFooter + ) + ) + ); + }; + + return RangePicker; +}(react__WEBPACK_IMPORTED_MODULE_6__["Component"]), _class.propTypes = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, _config_provider__WEBPACK_IMPORTED_MODULE_10__["default"].propTypes, { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 日期范围类型 + */ + type: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOf(['date', 'month', 'year']), + /** + * 默认展示的起始月份 + * @return {MomentObject} 返回包含指定月份的 moment 对象实例 + */ + defaultVisibleMonth: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + onVisibleMonthChange: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 日期范围值数组 [moment, moment] + */ + value: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.array, + /** + * 初始的日期范围值数组 [moment, moment] + */ + defaultValue: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.array, + /** + * 日期格式 + */ + format: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + /** + * 是否使用时间控件,支持传入 TimePicker 的属性 + */ + showTime: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool]), + /** + * 每次选择是否重置时间(仅在 showTime 开启时有效) + */ + resetTime: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 禁用日期函数 + * @param {MomentObject} 日期值 + * @param {String} view 当前视图类型,year: 年, month: 月, date: 日 + * @return {Boolean} 是否禁用 + */ + disabledDate: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 自定义面板页脚 + * @return {Node} 自定义的面板页脚组件 + */ + footerRender: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 日期范围值改变时的回调 [ MomentObject|String, MomentObject|String ] + * @param {Array} value 日期值 + */ + onChange: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 点击确认按钮时的回调 返回开始时间和结束时间`[ MomentObject|String, MomentObject|String ]` + * @return {Array} 日期范围 + */ + onOk: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 输入框内置标签 + */ + label: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.node, + /** + * 输入框状态 + */ + state: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOf(['error', 'loading', 'success']), + /** + * 输入框尺寸 + */ + size: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOf(['small', 'medium', 'large']), + /** + * 是否禁用 + */ + disabled: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 是否显示清空按钮 + */ + hasClear: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 弹层显示状态 + */ + visible: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 弹层默认是否显示 + */ + defaultVisible: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 弹层展示状态变化时的回调 + * @param {Boolean} visible 弹层是否显示 + * @param {String} type 触发弹层显示和隐藏的来源 okBtnClick 表示由确认按钮触发; fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发 + */ + onVisibleChange: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 弹层触发方式 + */ + popupTriggerType: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOf(['click', 'hover']), + /** + * 弹层对齐方式, 具体含义见 OverLay文档 + */ + popupAlign: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + /** + * 弹层容器 + * @param {Element} target 目标元素 + * @return {Element} 弹层的容器元素 + */ + popupContainer: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.any, + /** + * 弹层自定义样式 + */ + popupStyle: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object, + /** + * 弹层自定义样式类 + */ + popupClassName: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + /** + * 弹层其他属性 + */ + popupProps: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object, + /** + * 是否跟随滚动 + */ + followTrigger: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 输入框其他属性 + */ + inputProps: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object, + /** + * 自定义日期单元格渲染 + */ + dateCellRender: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * 自定义月份渲染函数 + * @param {Object} calendarDate 对应 Calendar 返回的自定义日期对象 + * @returns {ReactNode} + */ + monthCellRender: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + yearCellRender: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, // 兼容 0.x yearCellRender + /** + * 开始日期输入框的 aria-label 属性 + */ + startDateInputAriaLabel: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + /** + * 开始时间输入框的 aria-label 属性 + */ + startTimeInputAriaLabel: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + /** + * 结束日期输入框的 aria-label 属性 + */ + endDateInputAriaLabel: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + /** + * 结束时间输入框的 aria-label 属性 + */ + endTimeInputAriaLabel: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + /** + * 是否为预览态 + */ + isPreview: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + /** + * 预览态模式下渲染的内容 + * @param {Array} value 日期区间 + */ + renderPreview: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + disableChangeMode: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + yearRange: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.number), + ranges: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object, // 兼容0.x版本 + locale: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object, + className: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + name: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + popupComponent: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.elementType, + popupContent: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.node +}), _class.defaultProps = { + prefix: 'next-', + rtl: false, + type: 'date', + size: 'medium', + showTime: false, + resetTime: false, + format: 'YYYY-MM-DD', + disabledDate: function disabledDate() { + return false; + }, + footerRender: function footerRender() { + return null; + }, + hasClear: true, + defaultVisible: false, + popupTriggerType: 'click', + popupAlign: 'tl tl', + locale: _locale_zh_cn__WEBPACK_IMPORTED_MODULE_16__["default"].DatePicker, + disableChangeMode: false, + onChange: _util__WEBPACK_IMPORTED_MODULE_17__["func"].noop, + onOk: _util__WEBPACK_IMPORTED_MODULE_17__["func"].noop, + onVisibleChange: _util__WEBPACK_IMPORTED_MODULE_17__["func"].noop +}, _initialiseProps = function _initialiseProps() { + var _this3 = this; + + this.onValueChange = function (values) { + var handler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'onChange'; + + var ret = void 0; + if (!values.length || !_this3.inputAsString) { + ret = values; + } else { + ret = [values[0] ? values[0].format(_this3.dateTimeFormat) : null, values[1] ? values[1].format(_this3.dateTimeFormat) : null]; + } + _this3.props[handler](ret); + }; + + this.onSelectCalendarPanel = function (value, active) { + var _props3 = _this3.props, + showTime = _props3.showTime, + resetTime = _props3.resetTime; + var _state = _this3.state, + prevActiveDateInput = _state.activeDateInput, + prevStartValue = _state.startValue, + prevEndValue = _state.endValue; + + + var newState = { + activeDateInput: active || prevActiveDateInput, + inputing: false + }; + + var newValue = value; + switch (active || prevActiveDateInput) { + case 'startValue': + { + if (!prevEndValue || value.valueOf() <= prevEndValue.valueOf()) { + newState.activeDateInput = 'endValue'; + } + + if (showTime) { + if (!prevStartValue) { + // 第一次选择,如果设置了时间默认值,则使用该默认时间 + if (showTime.defaultValue) { + var defaultTimeValue = Object(_util__WEBPACK_IMPORTED_MODULE_18__["formatDateValue"])(Array.isArray(showTime.defaultValue) ? showTime.defaultValue[0] : showTime.defaultValue, _this3.timeFormat); + newValue = Object(_util__WEBPACK_IMPORTED_MODULE_18__["resetValueTime"])(value, defaultTimeValue); + } + } else if (!resetTime) { + // 非第一次选择,如果开启了 resetTime ,则记住之前选择的时间值 + newValue = Object(_util__WEBPACK_IMPORTED_MODULE_18__["resetValueTime"])(value, prevStartValue); + } + } + + newState.startValue = newValue; + + if (prevEndValue && value.valueOf() > prevEndValue.valueOf()) { + newState.endValue = null; + newState.activeDateInput = 'endValue'; + } + break; + } + + case 'endValue': + if (!prevStartValue) { + newState.activeDateInput = 'startValue'; + } + + if (showTime) { + if (!prevEndValue) { + // 第一次选择,如果设置了时间默认值,则使用该默认时间 + if (showTime.defaultValue) { + var _defaultTimeValue = Object(_util__WEBPACK_IMPORTED_MODULE_18__["formatDateValue"])(Array.isArray(showTime.defaultValue) ? showTime.defaultValue[1] || showTime.defaultValue[0] : showTime.defaultValue, _this3.timeFormat); + newValue = Object(_util__WEBPACK_IMPORTED_MODULE_18__["resetValueTime"])(value, _defaultTimeValue); + } + } else if (!resetTime) { + // 非第一次选择,如果开启了 resetTime ,则记住之前选择的时间值 + newValue = Object(_util__WEBPACK_IMPORTED_MODULE_18__["resetValueTime"])(value, prevEndValue); + } + } + + newState.endValue = newValue; + + // 选择了一个比开始日期更小的结束日期,此时表示用户重新选择了 + if (prevStartValue && value.valueOf() < prevStartValue.valueOf()) { + newState.startValue = value; + newState.endValue = null; + } + break; + } + + var newStartValue = 'startValue' in newState ? newState.startValue : prevStartValue; + var newEndValue = 'endValue' in newState ? newState.endValue : prevEndValue; + + // 受控状态选择不更新值 + if ('value' in _this3.props) { + delete newState.startValue; + delete newState.endValue; + } + + _this3.setState(newState); + + _this3.onValueChange([newStartValue, newEndValue]); + }; + + this.clearRange = function () { + _this3.setState({ + startDateInputStr: '', + endDateInputStr: '', + startTimeInputStr: '', + endTimeInputStr: '' + }); + + if (!('value' in _this3.props)) { + _this3.setState({ + startValue: null, + endValue: null + }); + } + + _this3.onValueChange([]); + }; + + this.onDateInputChange = function (inputStr, e, eventType) { + if (eventType === 'clear' || !inputStr) { + e.stopPropagation(); + _this3.clearRange(); + } else { + var _this3$setState; + + var stateName = mapInputStateName(_this3.state.activeDateInput); + _this3.setState((_this3$setState = {}, _this3$setState[stateName] = inputStr, _this3$setState.inputing = _this3.state.activeDateInput, _this3$setState)); + } + }; + + this.onDateInputBlur = function () { + var stateName = mapInputStateName(_this3.state.activeDateInput); + var dateInputStr = _this3.state[stateName]; + if (dateInputStr) { + var _this3$setState2; + + var _props4 = _this3.props, + format = _props4.format, + disabledDate = _props4.disabledDate; + + var parsed = moment__WEBPACK_IMPORTED_MODULE_9___default()(dateInputStr, format, true); + + _this3.setState((_this3$setState2 = {}, _this3$setState2[stateName] = '', _this3$setState2.inputing = false, _this3$setState2)); + + if (parsed.isValid() && !disabledDate(parsed, 'date')) { + var valueName = _this3.state.activeDateInput; + var newValue = parsed; + + _this3.handleChange(valueName, newValue); + } + } + }; + + this.onDateInputKeyDown = function (e) { + var type = _this3.props.type; + var activeDateInput = _this3.state.activeDateInput; + + var stateName = mapInputStateName(activeDateInput); + var dateInputStr = _this3.state[stateName]; + var dateStr = Object(_util__WEBPACK_IMPORTED_MODULE_18__["onDateKeydown"])(e, { + format: _this3.format, + value: _this3.state[activeDateInput], + dateInputStr: dateInputStr + }, type === 'date' ? 'day' : type); + if (!dateStr) return; + + return _this3.onDateInputChange(dateStr); + }; + + this.onFocusDateInput = function (type) { + if (type !== _this3.state.activeDateInput) { + _this3.setState({ + activeDateInput: type + }); + } + if (_this3.state.panel !== _util__WEBPACK_IMPORTED_MODULE_18__["PANEL"].DATE) { + _this3.setState({ + panel: _util__WEBPACK_IMPORTED_MODULE_18__["PANEL"].DATE + }); + } + }; + + this.onFocusTimeInput = function (type) { + if (type !== _this3.state.activeDateInput) { + _this3.setState({ + activeDateInput: type + }); + } + + if (_this3.state.panel !== _util__WEBPACK_IMPORTED_MODULE_18__["PANEL"].TIME) { + _this3.setState({ + panel: _util__WEBPACK_IMPORTED_MODULE_18__["PANEL"].TIME + }); + } + }; + + this.onSelectStartTime = function (value) { + if (!('value' in _this3.props)) { + _this3.setState({ + startValue: value, + inputing: false, + activeDateInput: 'startTime' + }); + } + if (value.valueOf() !== _this3.state.startValue.valueOf()) { + _this3.onValueChange([value, _this3.state.endValue]); + } + }; + + this.onSelectEndTime = function (value) { + if (!('value' in _this3.props)) { + _this3.setState({ + endValue: value, + inputing: false, + activeDateInput: 'endTime' + }); + } + if (value.valueOf() !== _this3.state.endValue.valueOf()) { + _this3.onValueChange([_this3.state.startValue, value]); + } + }; + + this.onTimeInputChange = function (inputStr) { + var _this3$setState3; + + var stateName = mapInputStateName(_this3.state.activeDateInput); + _this3.setState((_this3$setState3 = {}, _this3$setState3[stateName] = inputStr, _this3$setState3.inputing = _this3.state.activeDateInput, _this3$setState3)); + }; + + this.onTimeInputBlur = function () { + var stateName = mapInputStateName(_this3.state.activeDateInput); + var timeInputStr = _this3.state[stateName]; + if (timeInputStr) { + var _this3$setState4; + + var parsed = moment__WEBPACK_IMPORTED_MODULE_9___default()(timeInputStr, _this3.timeFormat, true); + + _this3.setState((_this3$setState4 = {}, _this3$setState4[stateName] = '', _this3$setState4.inputing = false, _this3$setState4)); + + if (parsed.isValid()) { + var hour = parsed.hour(); + var minute = parsed.minute(); + var second = parsed.second(); + var valueName = mapTimeToValue(_this3.state.activeDateInput); + var newValue = _this3.state[valueName].clone().hour(hour).minute(minute).second(second); + + _this3.handleChange(valueName, newValue); + } + } + }; + + this.onTimeInputKeyDown = function (e) { + var showTime = _this3.props.showTime; + var activeDateInput = _this3.state.activeDateInput; + + var stateName = mapInputStateName(activeDateInput); + var timeInputStr = _this3.state[stateName]; + + var _ref2 = (typeof showTime === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(showTime)) === 'object' ? showTime : {}, + disabledMinutes = _ref2.disabledMinutes, + disabledSeconds = _ref2.disabledSeconds, + _ref2$hourStep = _ref2.hourStep, + hourStep = _ref2$hourStep === undefined ? 1 : _ref2$hourStep, + _ref2$minuteStep = _ref2.minuteStep, + minuteStep = _ref2$minuteStep === undefined ? 1 : _ref2$minuteStep, + _ref2$secondStep = _ref2.secondStep, + secondStep = _ref2$secondStep === undefined ? 1 : _ref2$secondStep; + + var unit = 'second'; + + if (disabledSeconds) { + unit = disabledMinutes ? 'hour' : 'minute'; + } + + var timeStr = Object(_util__WEBPACK_IMPORTED_MODULE_18__["onTimeKeydown"])(e, { + format: _this3.timeFormat, + timeInputStr: timeInputStr, + value: _this3.state[activeDateInput.indexOf('start') ? 'startValue' : 'endValue'], + steps: { + hour: hourStep, + minute: minuteStep, + second: secondStep + } + }, unit); + + if (!timeStr) return; + + _this3.onTimeInputChange(timeStr); + }; + + this.handleChange = function (valueName, newValue) { + if (!('value' in _this3.props)) { + var _this3$setState5; + + _this3.setState((_this3$setState5 = {}, _this3$setState5[valueName] = newValue, _this3$setState5)); + } + + var startValue = valueName === 'startValue' ? newValue : _this3.state.startValue; + var endValue = valueName === 'endValue' ? newValue : _this3.state.endValue; + + _this3.onValueChange([startValue, endValue]); + }; + + this.onVisibleChange = function (visible, type) { + if (!('visible' in _this3.props)) { + _this3.setState({ + visible: visible + }); + } + _this3.props.onVisibleChange(visible, type); + }; + + this.changePanel = function (panel) { + var _state2 = _this3.state, + startValue = _state2.startValue, + endValue = _state2.endValue; + + _this3.setState({ + panel: panel, + activeDateInput: panel === _util__WEBPACK_IMPORTED_MODULE_18__["PANEL"].DATE ? !!startValue && !endValue ? 'endValue' : 'startValue' : 'startTime' + }); + }; + + this.onOk = function () { + _this3.onVisibleChange(false, 'okBtnClick'); + _this3.onValueChange([_this3.state.startValue, _this3.state.endValue], 'onOk'); + }; + + this.getDisabledTime = function (_ref3) { + var startValue = _ref3.startValue, + endValue = _ref3.endValue; + + var _ref4 = _this3.props.showTime || {}, + disabledHours = _ref4.disabledHours, + disabledMinutes = _ref4.disabledMinutes, + disabledSeconds = _ref4.disabledSeconds; + + var disabledTime = {}; + + if (startValue && endValue) { + var isSameDay = startValue.format('L') === endValue.format('L'); + var newDisabledHours = Object(_util__WEBPACK_IMPORTED_MODULE_18__["isFunction"])(disabledHours) ? disabledHours : function (index) { + if (isSameDay && index < startValue.hour()) { + return true; + } + }; + + var newDisabledMinutes = Object(_util__WEBPACK_IMPORTED_MODULE_18__["isFunction"])(disabledMinutes) ? disabledMinutes : function (index) { + if (isSameDay && startValue.hour() === endValue.hour() && index < startValue.minute()) { + return true; + } + }; + + var newDisabledSeconds = Object(_util__WEBPACK_IMPORTED_MODULE_18__["isFunction"])(disabledSeconds) ? disabledSeconds : function (index) { + if (isSameDay && startValue.hour() === endValue.hour() && startValue.minute() === endValue.minute() && index <= startValue.second()) { + return true; + } + }; + disabledTime = { + disabledHours: newDisabledHours, + disabledMinutes: newDisabledMinutes, + disabledSeconds: newDisabledSeconds + }; + } + + return disabledTime; + }; +}, _temp); +RangePicker.displayName = 'RangePicker'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/style.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/style.js ***! + \*******************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _input_style_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../input/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/input/style.js"); +/* harmony import */ var _overlay_style_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../overlay/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/overlay/style.js"); +/* harmony import */ var _calendar_style_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../calendar/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/style.js"); +/* harmony import */ var _time_picker_style_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../time-picker/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/time-picker/style.js"); +/* harmony import */ var _button_style_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../button/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/style.js"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_5__); + + + + + + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/util/index.js": +/*!************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/util/index.js ***! + \************************************************************************************/ +/*! exports provided: PANEL, DEFAULT_TIME_FORMAT, isFunction, resetValueTime, formatDateValue, checkDateValue, getDateTimeFormat, extend, onDateKeydown, onTimeKeydown */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PANEL", function() { return PANEL; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_TIME_FORMAT", function() { return DEFAULT_TIME_FORMAT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resetValueTime", function() { return resetValueTime; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatDateValue", function() { return formatDateValue; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkDateValue", function() { return checkDateValue; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDateTimeFormat", function() { return getDateTimeFormat; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return extend; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onDateKeydown", function() { return onDateKeydown; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onTimeKeydown", function() { return onTimeKeydown; }); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "./node_modules/_moment@2.24.0@moment/moment.js"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); + + + +var PANEL = { + TIME: 'time-panel', + DATE: 'date-panel' +}; + +var DEFAULT_TIME_FORMAT = 'HH:mm:ss'; + +function isFunction(obj) { + return !!(obj && obj.constructor && obj.call && obj.apply); +} + +/** + * 将 source 的 time 替换为 target 的 time + * @param {Object} source 输入值 + * @param {Object} target 目标值 + */ +function resetValueTime(source, target) { + if (!moment__WEBPACK_IMPORTED_MODULE_0___default.a.isMoment(source) || !moment__WEBPACK_IMPORTED_MODULE_0___default.a.isMoment(target)) { + return source; + } + return source.clone().hour(target.hour()).minute(target.minute()).second(target.second()); +} + +function formatDateValue(value, format) { + var val = typeof value === 'string' ? moment__WEBPACK_IMPORTED_MODULE_0___default()(value, format, false) : value; + if (val && moment__WEBPACK_IMPORTED_MODULE_0___default.a.isMoment(val) && val.isValid()) { + return val; + } + + return null; +} + +function checkDateValue(props, propName, componentName) { + // 支持传入 moment 对象或字符串,字符串不检测是否为日期字符串 + if (props[propName] && !moment__WEBPACK_IMPORTED_MODULE_0___default.a.isMoment(props[propName]) && typeof props[propName] !== 'string') { + return new Error('Invalid prop ' + propName + ' supplied to ' + componentName + '. Required a moment object or format date string!'); + } +} + +function getDateTimeFormat(format, showTime, type) { + if (!format && type) { + format = { + date: 'YYYY-MM-DD', + month: 'YYYY-MM', + year: 'YYYY', + time: '' + }[type]; + } + var timeFormat = showTime ? showTime.format || DEFAULT_TIME_FORMAT : ''; + var dateTimeFormat = timeFormat ? format + ' ' + timeFormat : format; + return { + format: format, + timeFormat: timeFormat, + dateTimeFormat: dateTimeFormat + }; +} + +function extend(source, target) { + for (var key in source) { + if (source.hasOwnProperty(key)) { + target[key] = source[key]; + } + } + return target; +} + +/** + * 监听键盘事件,操作日期字符串 + * @param {KeyboardEvent} e 事件对象 + * @param {Object} param1 + * @param {String} type 类型 year month day + */ +function onDateKeydown(e, _ref, type) { + var format = _ref.format, + dateInputStr = _ref.dateInputStr, + value = _ref.value; + + if ([_util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].UP, _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].DOWN, _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].PAGE_UP, _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].PAGE_DOWN].indexOf(e.keyCode) === -1) { + return; + } + + if (e.altKey && [_util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].PAGE_UP, _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].PAGE_DOWN].indexOf(e.keyCode) === -1 || e.controlKey || e.shiftKey) { + return; + } + + var date = moment__WEBPACK_IMPORTED_MODULE_0___default()(dateInputStr, format, true); + + if (date.isValid()) { + var stepUnit = e.altKey ? 'year' : 'month'; + switch (e.keyCode) { + case _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].UP: + date.subtract(1, type); + break; + case _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].DOWN: + date.add(1, type); + break; + case _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].PAGE_UP: + date.subtract(1, stepUnit); + break; + case _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].PAGE_DOWN: + date.add(1, stepUnit); + break; + } + } else if (value) { + date = value.clone(); + } else { + date = moment__WEBPACK_IMPORTED_MODULE_0___default()(); + } + + e.preventDefault(); + return date.format(format); +} + +/** + * 监听键盘事件,操作时间 + * @param {KeyboardEvent} e + * @param {Object} param1 + * @param {String} type second hour minute + */ +function onTimeKeydown(e, _ref2, type) { + var format = _ref2.format, + timeInputStr = _ref2.timeInputStr, + steps = _ref2.steps, + value = _ref2.value; + + if ([_util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].UP, _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].DOWN, _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].PAGE_UP, _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].PAGE_DOWN].indexOf(e.keyCode) === -1) return; + if (e.altKey && [_util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].PAGE_UP, _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].PAGE_DOWN].indexOf(e.keyCode) === -1 || e.controlKey || e.shiftKey) return; + + var time = moment__WEBPACK_IMPORTED_MODULE_0___default()(timeInputStr, format, true); + + if (time.isValid()) { + var stepUnit = e.altKey ? 'hour' : 'minute'; + switch (e.keyCode) { + case _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].UP: + time.subtract(steps[type], type); + break; + case _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].DOWN: + time.add(steps[type], type); + break; + case _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].PAGE_UP: + time.subtract(steps[stepUnit], stepUnit); + break; + case _util__WEBPACK_IMPORTED_MODULE_1__["KEYCODE"].PAGE_DOWN: + time.add(steps[stepUnit], stepUnit); + break; + } + } else if (value) { + time = value.clone(); + } else { + time = moment__WEBPACK_IMPORTED_MODULE_0___default()().hours(0).minutes(0).seconds(0); + } + + e.preventDefault(); + return time.format(format); +} + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/week-picker.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/week-picker.js ***! + \*************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! moment */ "./node_modules/_moment@2.24.0@moment/moment.js"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react-lifecycles-compat */ "./node_modules/_react-lifecycles-compat@3.0.4@react-lifecycles-compat/react-lifecycles-compat.es.js"); +/* harmony import */ var _overlay__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../overlay */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/overlay/index.js"); +/* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../input */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/input/index.js"); +/* harmony import */ var _calendar__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../calendar */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/index.js"); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _locale_zh_cn__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../locale/zh-cn */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/locale/zh-cn.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/util/index.js"); + + + + + + +var _class, _temp, _initialiseProps; + + + + + + + + + + + + + + +var Popup = _overlay__WEBPACK_IMPORTED_MODULE_10__["default"].Popup; + +/** + * DatePicker.WeekPicker + */ + +var WeekPicker = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(WeekPicker, _Component); + + function WeekPicker(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, WeekPicker); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.call(this, props, context)); + + _initialiseProps.call(_this); + + var value = Object(_util__WEBPACK_IMPORTED_MODULE_16__["formatDateValue"])(props.value || props.defaultValue, props.format); + + _this.state = { + value: value, + visible: props.visible || props.defaultVisible + }; + return _this; + } + + WeekPicker.getDerivedStateFromProps = function getDerivedStateFromProps(props) { + var st = {}; + if ('value' in props) { + st.value = Object(_util__WEBPACK_IMPORTED_MODULE_16__["formatDateValue"])(props.value, props.format); + } + + if ('visible' in props) { + st.visible = props.visible; + } + + return st; + }; + + WeekPicker.prototype.renderPreview = function renderPreview(others) { + var _props = this.props, + prefix = _props.prefix, + format = _props.format, + className = _props.className, + renderPreview = _props.renderPreview; + var value = this.state.value; + + var previewCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()(className, prefix + 'form-preview'); + + var label = value ? value.format(format) : ''; + + if (typeof renderPreview === 'function') { + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, others, { className: previewCls }), + renderPreview(value, this.props) + ); + } + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'p', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, others, { className: previewCls }), + label + ); + }; + + WeekPicker.prototype.render = function render() { + var _props2 = this.props, + prefix = _props2.prefix, + rtl = _props2.rtl, + locale = _props2.locale, + label = _props2.label, + state = _props2.state, + format = _props2.format, + defaultVisibleMonth = _props2.defaultVisibleMonth, + onVisibleMonthChange = _props2.onVisibleMonthChange, + disabledDate = _props2.disabledDate, + footerRender = _props2.footerRender, + placeholder = _props2.placeholder, + size = _props2.size, + disabled = _props2.disabled, + hasClear = _props2.hasClear, + popupTriggerType = _props2.popupTriggerType, + popupAlign = _props2.popupAlign, + popupContainer = _props2.popupContainer, + popupStyle = _props2.popupStyle, + popupClassName = _props2.popupClassName, + popupProps = _props2.popupProps, + popupComponent = _props2.popupComponent, + popupContent = _props2.popupContent, + followTrigger = _props2.followTrigger, + className = _props2.className, + inputProps = _props2.inputProps, + monthCellRender = _props2.monthCellRender, + yearCellRender = _props2.yearCellRender, + isPreview = _props2.isPreview, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default()(_props2, ['prefix', 'rtl', 'locale', 'label', 'state', 'format', 'defaultVisibleMonth', 'onVisibleMonthChange', 'disabledDate', 'footerRender', 'placeholder', 'size', 'disabled', 'hasClear', 'popupTriggerType', 'popupAlign', 'popupContainer', 'popupStyle', 'popupClassName', 'popupProps', 'popupComponent', 'popupContent', 'followTrigger', 'className', 'inputProps', 'monthCellRender', 'yearCellRender', 'isPreview']); + + var _state = this.state, + visible = _state.visible, + value = _state.value; + + + var sharedInputProps = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, inputProps, { + size: size, + disabled: disabled, + onChange: this.onDateInputChange, + onKeyDown: this.onKeyDown + }); + + if (rtl) { + others.dir = 'rtl'; + } + + if (isPreview) { + return this.renderPreview(_util__WEBPACK_IMPORTED_MODULE_15__["obj"].pickOthers(others, WeekPicker.PropTypes)); + } + + var trigger = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { className: prefix + 'week-picker-trigger' }, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_input__WEBPACK_IMPORTED_MODULE_11__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, sharedInputProps, { + label: label, + state: state, + value: value ? value.format(format) : '', + role: 'combobox', + 'aria-expanded': visible, + readOnly: true, + placeholder: placeholder || locale.weekPlaceholder, + hint: 'calendar', + hasClear: value && hasClear, + className: prefix + 'week-picker-input' + })) + ); + + var PopupComponent = popupComponent ? popupComponent : Popup; + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, _util__WEBPACK_IMPORTED_MODULE_15__["obj"].pickOthers(WeekPicker.propTypes, others), { + className: classnames__WEBPACK_IMPORTED_MODULE_7___default()(prefix + 'week-picker', className) + }), + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + PopupComponent, + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({ + align: popupAlign + }, popupProps, { + followTrigger: followTrigger, + disabled: disabled, + visible: visible, + onVisibleChange: this.onVisibleChange, + triggerType: popupTriggerType, + container: popupContainer, + style: popupStyle, + className: popupClassName, + trigger: trigger + }), + popupContent ? popupContent : react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { + dir: others.dir, + className: prefix + 'week-picker-body' + }, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_calendar__WEBPACK_IMPORTED_MODULE_12__["default"], { + shape: 'panel', + value: value, + format: format, + className: prefix + 'calendar-week', + dateCellRender: this.dateRender, + monthCellRender: monthCellRender, + yearCellRender: yearCellRender, + onSelect: this.onSelectCalendarPanel, + defaultVisibleMonth: defaultVisibleMonth, + onVisibleMonthChange: onVisibleMonthChange, + disabledDate: disabledDate + }), + footerRender() + ) + ) + ); + }; + + return WeekPicker; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, _config_provider__WEBPACK_IMPORTED_MODULE_13__["default"].propTypes, { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 输入框内置标签 + */ + label: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node, + /** + * 输入框状态 + */ + state: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['success', 'loading', 'error']), + /** + * 输入提示 + */ + placeholder: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 默认展现的月 + * @return {MomentObject} 返回包含指定月份的 moment 对象实例 + */ + defaultVisibleMonth: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + onVisibleMonthChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 日期值(受控)moment 对象 + */ + value: _util__WEBPACK_IMPORTED_MODULE_16__["checkDateValue"], + /** + * 初始日期值,moment 对象 + */ + defaultValue: _util__WEBPACK_IMPORTED_MODULE_16__["checkDateValue"], + /** + * 日期值的格式(用于限定用户输入和展示) + */ + format: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 禁用日期函数 + * @param {MomentObject} 日期值 + * @param {String} view 当前视图类型,year: 年, month: 月, date: 日 + * @return {Boolean} 是否禁用 + */ + disabledDate: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 自定义面板页脚 + * @return {Node} 自定义的面板页脚组件 + */ + footerRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 日期值改变时的回调 + * @param {MomentObject|String} value 日期值 + */ + onChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 输入框尺寸 + */ + size: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['small', 'medium', 'large']), + /** + * 是否禁用 + */ + disabled: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 是否显示清空按钮 + */ + hasClear: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层显示状态 + */ + visible: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层默认是否显示 + */ + defaultVisible: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层展示状态变化时的回调 + * @param {Boolean} visible 弹层是否显示 + * @param {String} type 触发弹层显示和隐藏的来源 calendarSelect 表示由日期表盘的选择触发; okBtnClick 表示由确认按钮触发; fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发 + */ + onVisibleChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 弹层触发方式 + */ + popupTriggerType: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['click', 'hover']), + /** + * 弹层对齐方式,具体含义见 OverLay文档 + */ + popupAlign: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 弹层容器 + * @param {Element} target 目标元素 + * @return {Element} 弹层的容器元素 + */ + popupContainer: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + /** + * 弹层自定义样式 + */ + popupStyle: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 弹层自定义样式类 + */ + popupClassName: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 弹层其他属性 + */ + popupProps: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 是否跟随滚动 + */ + followTrigger: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 输入框其他属性 + */ + inputProps: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 自定义日期渲染函数 + * @param {Object} value 日期值(moment对象) + * @returns {ReactNode} + */ + dateCellRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 自定义月份渲染函数 + * @param {Object} calendarDate 对应 Calendar 返回的自定义日期对象 + * @returns {ReactNode} + */ + monthCellRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 是否为预览态 + */ + isPreview: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 预览态模式下渲染的内容 + * @param {MomentObject} value 年份 + */ + renderPreview: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + yearCellRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, // 兼容 0.x yearCellRender + locale: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + name: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + popupComponent: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.elementType, + popupContent: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node +}), _class.defaultProps = { + prefix: 'next-', + rtl: false, + format: 'YYYY-wo', + size: 'medium', + disabledDate: function disabledDate() { + return false; + }, + footerRender: function footerRender() { + return null; + }, + hasClear: true, + popupTriggerType: 'click', + popupAlign: 'tl tl', + locale: _locale_zh_cn__WEBPACK_IMPORTED_MODULE_14__["default"].DatePicker, + defaultVisible: false, + onChange: _util__WEBPACK_IMPORTED_MODULE_15__["func"].noop, + onVisibleChange: _util__WEBPACK_IMPORTED_MODULE_15__["func"].noop +}, _initialiseProps = function _initialiseProps() { + var _this2 = this; + + this.handleChange = function (newValue, prevValue) { + if (!('value' in _this2.props)) { + _this2.setState({ + value: newValue + }); + } + + var newValueOf = newValue ? newValue.valueOf() : null; + var preValueOf = prevValue ? prevValue.valueOf() : null; + + if (newValueOf !== preValueOf) { + _this2.props.onChange(newValue); + } + }; + + this.onDateInputChange = function (value, e, eventType) { + if (eventType === 'clear' || !value) { + e.stopPropagation(); + _this2.handleChange(null, _this2.state.value); + } + }; + + this.onKeyDown = function (e) { + if ([_util__WEBPACK_IMPORTED_MODULE_15__["KEYCODE"].UP, _util__WEBPACK_IMPORTED_MODULE_15__["KEYCODE"].DOWN, _util__WEBPACK_IMPORTED_MODULE_15__["KEYCODE"].PAGE_UP, _util__WEBPACK_IMPORTED_MODULE_15__["KEYCODE"].PAGE_DOWN].indexOf(e.keyCode) === -1) { + return; + } + + if (e.altKey && [_util__WEBPACK_IMPORTED_MODULE_15__["KEYCODE"].PAGE_UP, _util__WEBPACK_IMPORTED_MODULE_15__["KEYCODE"].PAGE_DOWN].indexOf(e.keyCode) === -1 || e.controlKey || e.shiftKey) { + return; + } + + var date = _this2.state.value; + + if (date && date.isValid()) { + var stepUnit = e.altKey ? 'year' : 'month'; + switch (e.keyCode) { + case _util__WEBPACK_IMPORTED_MODULE_15__["KEYCODE"].UP: + date.subtract(1, 'w'); + break; + case _util__WEBPACK_IMPORTED_MODULE_15__["KEYCODE"].DOWN: + date.add(1, 'w'); + break; + case _util__WEBPACK_IMPORTED_MODULE_15__["KEYCODE"].PAGE_UP: + date.subtract(1, stepUnit); + break; + case _util__WEBPACK_IMPORTED_MODULE_15__["KEYCODE"].PAGE_DOWN: + date.add(1, stepUnit); + break; + } + } else { + date = moment__WEBPACK_IMPORTED_MODULE_8___default()(); + } + + e.preventDefault(); + + _this2.handleChange(date, _this2.state.value); + }; + + this.onVisibleChange = function (visible, type) { + if (!('visible' in _this2.props)) { + _this2.setState({ + visible: visible + }); + } + _this2.props.onVisibleChange(visible, type); + }; + + this.onSelectCalendarPanel = function (value) { + _this2.handleChange(value, _this2.state.value); + _this2.onVisibleChange(false, 'calendarSelect'); + }; + + this.dateRender = function (value) { + var _props3 = _this2.props, + prefix = _props3.prefix, + dateCellRender = _props3.dateCellRender; + + var selectedValue = _this2.state.value; + var content = dateCellRender && typeof dateCellRender === 'function' ? dateCellRender(value) : value.dates(); + if (selectedValue && selectedValue.years() === value.years() && selectedValue.weeks() === value.weeks()) { + var _classnames; + + var firstDay = moment__WEBPACK_IMPORTED_MODULE_8___default.a.localeData().firstDayOfWeek(); + var endDay = firstDay - 1 < 0 ? 6 : firstDay - 1; + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { + className: classnames__WEBPACK_IMPORTED_MODULE_7___default()(prefix + 'calendar-week-active-date', (_classnames = {}, _classnames[prefix + 'calendar-week-active-start'] = value.days() === moment__WEBPACK_IMPORTED_MODULE_8___default.a.localeData().firstDayOfWeek(), _classnames[prefix + 'calendar-week-active-end'] = value.days() === endDay, _classnames)) + }, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'span', + null, + content + ) + ); + } + + return content; + }; +}, _temp); +WeekPicker.displayName = 'WeekPicker'; + + +/* harmony default export */ __webpack_exports__["default"] = (Object(react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_9__["polyfill"])(WeekPicker)); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/year-picker.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/year-picker.js ***! + \*************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! moment */ "./node_modules/_moment@2.24.0@moment/moment.js"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var _overlay__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../overlay */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/overlay/index.js"); +/* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../input */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/input/index.js"); +/* harmony import */ var _calendar__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../calendar */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/calendar/index.js"); +/* harmony import */ var _locale_zh_cn__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../locale/zh-cn */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/locale/zh-cn.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/date-picker/util/index.js"); + + + + + + +var _class, _temp, _initialiseProps; + + + + + + + + + + + + +var Popup = _overlay__WEBPACK_IMPORTED_MODULE_9__["default"].Popup; + +/** + * DatePicker.YearPicker + */ + +var YearPicker = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(YearPicker, _Component); + + function YearPicker(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, YearPicker); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.call(this, props, context)); + + _initialiseProps.call(_this); + + var value = Object(_util__WEBPACK_IMPORTED_MODULE_14__["formatDateValue"])(props.value || props.defaultValue, props.format); + + _this.inputAsString = typeof (props.value || props.defaultValue) === 'string'; // 判断用户输入是否是字符串 + _this.state = { + value: value, + dateInputStr: '', + inputing: false, + visible: props.visible || props.defaultVisible + }; + return _this; + } + + YearPicker.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if ('value' in nextProps) { + var value = Object(_util__WEBPACK_IMPORTED_MODULE_14__["formatDateValue"])(nextProps.value, nextProps.format || this.props.format); + this.setState({ + value: value + }); + this.inputAsString = typeof nextProps.value === 'string'; + } + + if ('visible' in nextProps) { + this.setState({ + visible: nextProps.visible + }); + } + }; + + YearPicker.prototype.renderPreview = function renderPreview(others) { + var _props = this.props, + prefix = _props.prefix, + format = _props.format, + className = _props.className, + renderPreview = _props.renderPreview; + var value = this.state.value; + + var previewCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()(className, prefix + 'form-preview'); + + var label = value ? value.format(format) : ''; + + if (typeof renderPreview === 'function') { + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, others, { className: previewCls }), + renderPreview(value, this.props) + ); + } + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'p', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, others, { className: previewCls }), + label + ); + }; + + YearPicker.prototype.render = function render() { + var _classnames, _classnames2, _classnames3; + + var _props2 = this.props, + prefix = _props2.prefix, + rtl = _props2.rtl, + locale = _props2.locale, + label = _props2.label, + state = _props2.state, + format = _props2.format, + disabledDate = _props2.disabledDate, + footerRender = _props2.footerRender, + placeholder = _props2.placeholder, + size = _props2.size, + disabled = _props2.disabled, + hasClear = _props2.hasClear, + popupTriggerType = _props2.popupTriggerType, + popupAlign = _props2.popupAlign, + popupContainer = _props2.popupContainer, + popupStyle = _props2.popupStyle, + popupClassName = _props2.popupClassName, + popupProps = _props2.popupProps, + popupComponent = _props2.popupComponent, + popupContent = _props2.popupContent, + followTrigger = _props2.followTrigger, + className = _props2.className, + inputProps = _props2.inputProps, + dateInputAriaLabel = _props2.dateInputAriaLabel, + yearCellRender = _props2.yearCellRender, + isPreview = _props2.isPreview, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default()(_props2, ['prefix', 'rtl', 'locale', 'label', 'state', 'format', 'disabledDate', 'footerRender', 'placeholder', 'size', 'disabled', 'hasClear', 'popupTriggerType', 'popupAlign', 'popupContainer', 'popupStyle', 'popupClassName', 'popupProps', 'popupComponent', 'popupContent', 'followTrigger', 'className', 'inputProps', 'dateInputAriaLabel', 'yearCellRender', 'isPreview']); + + var _state = this.state, + visible = _state.visible, + value = _state.value, + dateInputStr = _state.dateInputStr, + inputing = _state.inputing; + + + var yearPickerCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classnames = {}, _classnames[prefix + 'year-picker'] = true, _classnames), className); + + var triggerInputCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classnames2 = {}, _classnames2[prefix + 'year-picker-input'] = true, _classnames2[prefix + 'error'] = false, _classnames2)); + + var panelBodyClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classnames3 = {}, _classnames3[prefix + 'year-picker-body'] = true, _classnames3)); + + if (rtl) { + others.dir = 'rtl'; + } + + if (isPreview) { + return this.renderPreview(_util__WEBPACK_IMPORTED_MODULE_13__["obj"].pickOthers(others, YearPicker.PropTypes)); + } + + var panelInputCls = prefix + 'year-picker-panel-input'; + + var sharedInputProps = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, inputProps, { + size: size, + disabled: disabled, + onChange: this.onDateInputChange, + onBlur: this.onDateInputBlur, + onPressEnter: this.onDateInputBlur, + onKeyDown: this.onKeyDown + }); + + var dateInputValue = inputing ? dateInputStr : value && value.format(format) || ''; + var triggerInputValue = dateInputValue; + + var dateInput = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_input__WEBPACK_IMPORTED_MODULE_10__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, sharedInputProps, { + 'aria-label': dateInputAriaLabel, + value: dateInputValue, + placeholder: format, + className: panelInputCls + })); + + var datePanel = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_calendar__WEBPACK_IMPORTED_MODULE_11__["default"], { + shape: 'panel', + modes: ['year'], + value: value, + yearCellRender: yearCellRender, + onSelect: this.onSelectCalendarPanel, + disabledDate: disabledDate + }); + + var panelBody = datePanel; + var panelFooter = footerRender(); + + var allowClear = value && hasClear; + var trigger = react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { className: prefix + 'year-picker-trigger' }, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_input__WEBPACK_IMPORTED_MODULE_10__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, sharedInputProps, { + label: label, + state: state, + value: triggerInputValue, + role: 'combobox', + 'aria-expanded': visible, + readOnly: true, + placeholder: placeholder || locale.yearPlaceholder, + hint: 'calendar', + hasClear: allowClear, + className: triggerInputCls + })) + ); + + var PopupComponent = popupComponent ? popupComponent : Popup; + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, _util__WEBPACK_IMPORTED_MODULE_13__["obj"].pickOthers(YearPicker.propTypes, others), { + className: yearPickerCls + }), + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + PopupComponent, + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({ + autoFocus: true, + align: popupAlign + }, popupProps, { + followTrigger: followTrigger, + disabled: disabled, + visible: visible, + onVisibleChange: this.onVisibleChange, + triggerType: popupTriggerType, + container: popupContainer, + style: popupStyle, + className: popupClassName, + trigger: trigger + }), + popupContent ? popupContent : react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { dir: others.dir, className: panelBodyClassName }, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { + className: prefix + 'year-picker-panel-header' + }, + dateInput + ), + panelBody, + panelFooter + ) + ) + ); + }; + + return YearPicker; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 输入框内置标签 + */ + label: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node, + /** + * 输入框状态 + */ + state: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['success', 'loading', 'error']), + /** + * 输入提示 + */ + placeholder: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 日期值(受控)moment 对象 + */ + value: _util__WEBPACK_IMPORTED_MODULE_14__["checkDateValue"], + /** + * 初始日期值,moment 对象 + */ + defaultValue: _util__WEBPACK_IMPORTED_MODULE_14__["checkDateValue"], + /** + * 日期值的格式(用于限定用户输入和展示) + */ + format: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 禁用日期函数 + * @param {MomentObject} 日期值 + * @param {String} view 当前视图类型,year: 年, month: 月, date: 日 + * @return {Boolean} 是否禁用 + */ + disabledDate: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 自定义面板页脚 + * @return {Node} 自定义的面板页脚组件 + */ + footerRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 日期值改变时的回调 + * @param {MomentObject|String} value 日期值 + */ + onChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 输入框尺寸 + */ + size: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['small', 'medium', 'large']), + /** + * 是否禁用 + */ + disabled: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 是否显示清空按钮 + */ + hasClear: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层显示状态 + */ + visible: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层默认是否显示 + */ + defaultVisible: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 弹层展示状态变化时的回调 + * @param {Boolean} visible 弹层是否显示 + * @param {String} reason 触发弹层显示和隐藏的来源 calendarSelect 表示由日期表盘的选择触发; fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发 + */ + onVisibleChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 弹层触发方式 + */ + popupTriggerType: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['click', 'hover']), + /** + * 弹层对齐方式, 具体含义见 OverLay文档 + */ + popupAlign: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 弹层容器 + * @param {Element} target 目标元素 + * @return {Element} 弹层的容器元素 + */ + popupContainer: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any, + /** + * 弹层自定义样式 + */ + popupStyle: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 弹层自定义样式类 + */ + popupClassName: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 弹层其他属性 + */ + popupProps: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 是否跟随滚动 + */ + followTrigger: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 输入框其他属性 + */ + inputProps: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + yearCellRender: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, // 兼容 0.x yearCellRender + /** + * 日期输入框的 aria-label 属性 + */ + dateInputAriaLabel: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 是否为预览态 + */ + isPreview: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 预览态模式下渲染的内容 + * @param {MomentObject} value 年份 + */ + renderPreview: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + locale: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + name: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + popupComponent: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.elementType, + popupContent: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node +}, _class.defaultProps = { + prefix: 'next-', + rtl: false, + format: 'YYYY', + size: 'medium', + disabledDate: function disabledDate() { + return false; + }, + footerRender: function footerRender() { + return null; + }, + hasClear: true, + popupTriggerType: 'click', + popupAlign: 'tl tl', + locale: _locale_zh_cn__WEBPACK_IMPORTED_MODULE_12__["default"].DatePicker, + onChange: _util__WEBPACK_IMPORTED_MODULE_13__["func"].noop, + onVisibleChange: _util__WEBPACK_IMPORTED_MODULE_13__["func"].noop +}, _initialiseProps = function _initialiseProps() { + var _this2 = this; + + this.onValueChange = function (newValue) { + var ret = _this2.inputAsString && newValue ? newValue.format(_this2.props.format) : newValue; + _this2.props.onChange(ret); + }; + + this.onSelectCalendarPanel = function (value) { + // const { format } = this.props; + var prevSelectedMonth = _this2.state.value; + var selectedMonth = value.clone().month(0).date(1).hour(0).minute(0).second(0); + + _this2.handleChange(selectedMonth, prevSelectedMonth, { inputing: false }, function () { + _this2.onVisibleChange(false, 'calendarSelect'); + }); + }; + + this.clearValue = function () { + _this2.setState({ + dateInputStr: '' + }); + + _this2.handleChange(null, _this2.state.value); + }; + + this.onDateInputChange = function (inputStr, e, eventType) { + if (eventType === 'clear' || !inputStr) { + e.stopPropagation(); + _this2.clearValue(); + } else { + _this2.setState({ + dateInputStr: inputStr, + inputing: true + }); + } + }; + + this.onDateInputBlur = function () { + var dateInputStr = _this2.state.dateInputStr; + + if (dateInputStr) { + var _props3 = _this2.props, + disabledDate = _props3.disabledDate, + format = _props3.format; + + var parsed = moment__WEBPACK_IMPORTED_MODULE_8___default()(dateInputStr, format, true); + + _this2.setState({ + dateInputStr: '', + inputing: false + }); + + if (parsed.isValid() && !disabledDate(parsed, 'year')) { + _this2.handleChange(parsed, _this2.state.value); + } + } + }; + + this.onKeyDown = function (e) { + var format = _this2.props.format; + var _state2 = _this2.state, + dateInputStr = _state2.dateInputStr, + value = _state2.value; + + var dateStr = Object(_util__WEBPACK_IMPORTED_MODULE_14__["onDateKeydown"])(e, { format: format, dateInputStr: dateInputStr, value: value }, 'year'); + if (!dateStr) return; + _this2.onDateInputChange(dateStr); + }; + + this.handleChange = function (newValue, prevValue) { + var others = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var callback = arguments[3]; + + if (!('value' in _this2.props)) { + _this2.setState(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({ + value: newValue + }, others)); + } else { + _this2.setState(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, others)); + } + + var format = _this2.props.format; + + + var newValueOf = newValue ? newValue.format(format) : null; + var preValueOf = prevValue ? prevValue.format(format) : null; + + if (newValueOf !== preValueOf) { + _this2.onValueChange(newValue); + if (typeof callback === 'function') { + return callback(); + } + } + }; + + this.onVisibleChange = function (visible, reason) { + if (!('visible' in _this2.props)) { + _this2.setState({ + visible: visible + }); + } + _this2.props.onVisibleChange(visible, reason); + }; +}, _temp); +YearPicker.displayName = 'YearPicker'; + + +/* harmony default export */ __webpack_exports__["default"] = (YearPicker); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/dialog.js": +/*!***************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/dialog.js ***! + \***************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Dialog; }); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _overlay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../overlay */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/overlay/index.js"); +/* harmony import */ var _locale_zh_cn__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../locale/zh-cn */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/locale/zh-cn.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _inner__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./inner */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/inner.js"); + + + + + + +var _class, _temp; + + + + + + + + +var noop = function noop() {}; +var limitTabRange = _util__WEBPACK_IMPORTED_MODULE_9__["focus"].limitTabRange; +var bindCtx = _util__WEBPACK_IMPORTED_MODULE_9__["func"].bindCtx; +var pickOthers = _util__WEBPACK_IMPORTED_MODULE_9__["obj"].pickOthers; +var getStyle = _util__WEBPACK_IMPORTED_MODULE_9__["dom"].getStyle, + setStyle = _util__WEBPACK_IMPORTED_MODULE_9__["dom"].setStyle; + +/** + * Dialog + */ + +var Dialog = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Dialog, _Component); + + function Dialog(props, context) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Dialog); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.call(this, props, context)); + + bindCtx(_this, ['onKeyDown', 'beforePosition', 'adjustPosition', 'getOverlayRef']); + return _this; + } + + Dialog.prototype.componentDidMount = function componentDidMount() { + _util__WEBPACK_IMPORTED_MODULE_9__["events"].on(document, 'keydown', this.onKeyDown); + if (!this.useCSSToPosition()) { + this.adjustPosition(); + } + }; + + Dialog.prototype.componentWillUnmount = function componentWillUnmount() { + _util__WEBPACK_IMPORTED_MODULE_9__["events"].off(document, 'keydown', this.onKeyDown); + }; + + Dialog.prototype.useCSSToPosition = function useCSSToPosition() { + var _props = this.props, + align = _props.align, + isFullScreen = _props.isFullScreen; + + return align === 'cc cc' && isFullScreen; + }; + + Dialog.prototype.onKeyDown = function onKeyDown(e) { + var node = this.getInnerNode(); + if (node) { + limitTabRange(node, e); + } + }; + + Dialog.prototype.beforePosition = function beforePosition() { + if (this.props.visible && this.overlay) { + var inner = this.getInner(); + if (inner) { + var node = this.getInnerNode(); + if (this._lastDialogHeight !== getStyle(node, 'height')) { + this.revertSize(inner.bodyNode); + } + } + } + }; + + Dialog.prototype.adjustPosition = function adjustPosition() { + if (this.props.visible && this.overlay) { + var inner = this.getInner(); + if (inner) { + var node = this.getInnerNode(); + + var top = getStyle(node, 'top'); + var minMargin = this.props.minMargin; + if (top < minMargin) { + top = minMargin; + setStyle(node, 'top', minMargin + 'px'); + } + + var height = getStyle(node, 'height'); + var viewportHeight = window.innerHeight || document.documentElement.clientHeight; + if (viewportHeight < height + top * 2) { + var expectHeight = viewportHeight - top * 2; + this.adjustSize(inner, node, expectHeight); + } else { + this.revertSize(inner.bodyNode); + } + + this._lastDialogHeight = height; + } + } + }; + + Dialog.prototype.adjustSize = function adjustSize(inner, node, expectHeight) { + var headerNode = inner.headerNode, + bodyNode = inner.bodyNode, + footerNode = inner.footerNode; + + + var headerHeight = headerNode ? getStyle(headerNode, 'height') : 0; + var footerHeight = footerNode ? getStyle(footerNode, 'height') : 0; + var padding = getStyle(node, 'padding-top') + getStyle(node, 'padding-bottom'); + var maxBodyHeight = expectHeight - headerHeight - footerHeight - padding; + if (maxBodyHeight < 0) { + maxBodyHeight = 1; + } + + if (bodyNode) { + this.dialogBodyStyleMaxHeight = bodyNode.style.maxHeight; + this.dialogBodyStyleOverflowY = bodyNode.style.overflowY; + + setStyle(bodyNode, { + 'max-height': maxBodyHeight + 'px', + 'overflow-y': 'auto' + }); + } + }; + + Dialog.prototype.revertSize = function revertSize(bodyNode) { + setStyle(bodyNode, { + 'max-height': this.dialogBodyStyleMaxHeight, + 'overflow-y': this.dialogBodyStyleOverflowY + }); + }; + + Dialog.prototype.mapcloseableToConfig = function mapcloseableToConfig(closeable) { + return ['esc', 'close', 'mask'].reduce(function (ret, option) { + var key = option.charAt(0).toUpperCase() + option.substr(1); + var value = typeof closeable === 'boolean' ? closeable : closeable.split(',').indexOf(option) > -1; + + if (option === 'esc' || option === 'mask') { + ret['canCloseBy' + key] = value; + } else { + ret['canCloseBy' + key + 'Click'] = value; + } + + return ret; + }, {}); + }; + + Dialog.prototype.getOverlayRef = function getOverlayRef(ref) { + this.overlay = ref; + }; + + Dialog.prototype.getInner = function getInner() { + return this.overlay.getInstance().getContent(); + }; + + Dialog.prototype.getInnerNode = function getInnerNode() { + return this.overlay.getInstance().getContentNode(); + }; + + Dialog.prototype.renderInner = function renderInner(closeable) { + var _props2 = this.props, + prefix = _props2.prefix, + className = _props2.className, + title = _props2.title, + children = _props2.children, + footer = _props2.footer, + footerAlign = _props2.footerAlign, + footerActions = _props2.footerActions, + onOk = _props2.onOk, + onCancel = _props2.onCancel, + okProps = _props2.okProps, + cancelProps = _props2.cancelProps, + onClose = _props2.onClose, + locale = _props2.locale, + visible = _props2.visible, + rtl = _props2.rtl, + height = _props2.height; + + var others = pickOthers(Object.keys(Dialog.propTypes), this.props); + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + _inner__WEBPACK_IMPORTED_MODULE_10__["default"], + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({ + prefix: prefix, + className: className, + title: title, + footer: footer, + footerAlign: footerAlign, + footerActions: footerActions, + onOk: visible ? onOk : noop, + onCancel: visible ? onCancel : noop, + okProps: okProps, + cancelProps: cancelProps, + locale: locale, + closeable: closeable, + rtl: rtl, + onClose: onClose.bind(this, 'closeClick'), + height: height + }, others), + children + ); + }; + + Dialog.prototype.render = function render() { + var _props3 = this.props, + prefix = _props3.prefix, + visible = _props3.visible, + hasMask = _props3.hasMask, + animation = _props3.animation, + autoFocus = _props3.autoFocus, + closeable = _props3.closeable, + onClose = _props3.onClose, + afterClose = _props3.afterClose, + shouldUpdatePosition = _props3.shouldUpdatePosition, + align = _props3.align, + popupContainer = _props3.popupContainer, + overlayProps = _props3.overlayProps, + rtl = _props3.rtl; + + + var useCSS = this.useCSSToPosition(); + + var _mapcloseableToConfig = this.mapcloseableToConfig(closeable), + canCloseByCloseClick = _mapcloseableToConfig.canCloseByCloseClick, + closeConfig = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default()(_mapcloseableToConfig, ['canCloseByCloseClick']); + + var newOverlayProps = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({ + disableScroll: true, + container: popupContainer + }, overlayProps, { + prefix: prefix, + visible: visible, + animation: animation, + hasMask: hasMask, + autoFocus: autoFocus, + afterClose: afterClose + }, closeConfig, { + canCloseByOutSideClick: false, + align: useCSS ? false : align, + onRequestClose: onClose, + needAdjust: false, + ref: this.getOverlayRef, + rtl: rtl, + maskClass: useCSS ? prefix + 'dialog-container' : '', + isChildrenInMask: useCSS && hasMask + }); + if (!useCSS) { + newOverlayProps.beforePosition = this.beforePosition; + newOverlayProps.onPosition = this.adjustPosition; + newOverlayProps.shouldUpdatePosition = shouldUpdatePosition; + } + + var inner = this.renderInner(canCloseByCloseClick); + + // useCSS && hasMask : isFullScreen 并且 有mask的模式下,为了解决 next-overlay-backdrop 覆盖mask,使得点击mask关闭页面的功能不生效的问题,需要开启 Overlay 的 isChildrenInMask 功能,并且把 next-dialog-container 放到 next-overlay-backdrop上 + // useCSS && !hasMask : isFullScreen 并且 没有mask的情况下,需要关闭 isChildrenInMask 功能,以防止children不渲染 + // 其他模式下维持 mask 与 children 同级的关系 + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + _overlay__WEBPACK_IMPORTED_MODULE_7__["default"], + newOverlayProps, + useCSS && !hasMask ? react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + 'div', + { + className: prefix + 'dialog-container', + dir: rtl ? 'rtl' : undefined + }, + inner + ) : inner + ); + }; + + return Dialog; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + pure: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + /** + * 是否显示 + */ + visible: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 标题 + */ + title: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node, + /** + * 内容 + */ + children: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node, + /** + * 底部内容,设置为 false,则不进行显示 + * @default [, ] + */ + footer: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node]), + /** + * 底部按钮的对齐方式 + */ + footerAlign: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['left', 'center', 'right']), + /** + * 指定确定按钮和取消按钮是否存在以及如何排列,

**可选值**: + * ['ok', 'cancel'](确认取消按钮同时存在,确认按钮在左) + * ['cancel', 'ok'](确认取消按钮同时存在,确认按钮在右) + * ['ok'](只存在确认按钮) + * ['cancel'](只存在取消按钮) + */ + footerActions: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.array, + /** + * 在点击确定按钮时触发的回调函数 + * @param {Object} event 点击事件对象 + */ + onOk: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 在点击取消按钮时触发的回调函数 + * @param {Object} event 点击事件对象 + */ + onCancel: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 应用于确定按钮的属性对象 + */ + okProps: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 应用于取消按钮的属性对象 + */ + cancelProps: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 控制对话框关闭的方式,值可以为字符串或者布尔值,其中字符串是由以下值组成: + * **close** 表示点击关闭按钮可以关闭对话框 + * **mask** 表示点击遮罩区域可以关闭对话框 + * **esc** 表示按下 esc 键可以关闭对话框 + * 如 'close' 或 'close,esc,mask' + * 如果设置为 true,则以上关闭方式全部生效 + * 如果设置为 false,则以上关闭方式全部失效 + */ + closeable: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool]), + /** + * 对话框关闭时触发的回调函数 + * @param {String} trigger 关闭触发行为的描述字符串 + * @param {Object} event 关闭时事件对象 + */ + onClose: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 对话框关闭后触发的回调函数, 如果有动画,则在动画结束后触发 + */ + afterClose: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func, + /** + * 是否显示遮罩 + */ + hasMask: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 显示隐藏时动画的播放方式 + * @property {String} in 进场动画 + * @property {String} out 出场动画 + */ + animation: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool]), + /** + * 对话框弹出时是否自动获得焦点 + */ + autoFocus: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 对话框对齐方式, 具体见Overlay文档 + */ + align: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool]), + /** + * 当对话框高度超过浏览器视口高度时,是否显示所有内容而不是出现滚动条以保证对话框完整显示在浏览器视口内,该属性仅在对话框垂直水平居中时生效,即 align 被设置为 'cc cc' 时 + */ + isFullScreen: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 是否在对话框重新渲染时及时更新对话框位置,一般用于对话框高度变化后依然能保证原来的对齐方式 + */ + shouldUpdatePosition: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 对话框距离浏览器顶部和底部的最小间距,align 被设置为 'cc cc' 并且 isFullScreen 被设置为 true 时不生效 + */ + minMargin: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.number, + /** + * 透传到弹层组件的属性对象 + */ + overlayProps: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 自定义国际化文案对象 + * @property {String} ok 确认按钮文案 + * @property {String} cancel 取消按钮文案 + */ + locale: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 对话框的高度样式属性 + */ + height: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + // Do not remove this, it's for + // see https://github.com/alibaba-fusion/next/issues/1508 + popupContainer: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.any +}, _class.defaultProps = { + prefix: 'next-', + pure: false, + visible: false, + footerAlign: 'right', + footerActions: ['ok', 'cancel'], + onOk: noop, + onCancel: noop, + okProps: {}, + cancelProps: {}, + closeable: 'esc,close', + onClose: noop, + afterClose: noop, + hasMask: true, + animation: { + in: 'fadeInDown', + out: 'fadeOutUp' + }, + autoFocus: false, + align: 'cc cc', + isFullScreen: false, + shouldUpdatePosition: false, + minMargin: 40, + overlayProps: {}, + locale: _locale_zh_cn__WEBPACK_IMPORTED_MODULE_8__["default"].Dialog +}, _temp); +Dialog.displayName = 'Dialog'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/index.js": +/*!**************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/index.js ***! + \**************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); +/* harmony import */ var _dialog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dialog */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/dialog.js"); +/* harmony import */ var _inner__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./inner */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/inner.js"); +/* harmony import */ var _show__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./show */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/show.js"); + + + + + + + + +_dialog__WEBPACK_IMPORTED_MODULE_4__["default"].Inner = _inner__WEBPACK_IMPORTED_MODULE_5__["default"]; +_dialog__WEBPACK_IMPORTED_MODULE_4__["default"].show = function (config) { + var _ConfigProvider$getCo = _config_provider__WEBPACK_IMPORTED_MODULE_2__["default"].getContextProps(config, 'Dialog'), + warning = _ConfigProvider$getCo.warning; + + if (warning !== false) { + config = processProps(config, _util__WEBPACK_IMPORTED_MODULE_3__["log"].deprecated); + } + return Object(_show__WEBPACK_IMPORTED_MODULE_6__["show"])(config); +}; +_dialog__WEBPACK_IMPORTED_MODULE_4__["default"].alert = function (config) { + var _ConfigProvider$getCo2 = _config_provider__WEBPACK_IMPORTED_MODULE_2__["default"].getContextProps(config, 'Dialog'), + warning = _ConfigProvider$getCo2.warning; + + if (warning !== false) { + config = processProps(config, _util__WEBPACK_IMPORTED_MODULE_3__["log"].deprecated); + } + return Object(_show__WEBPACK_IMPORTED_MODULE_6__["alert"])(config); +}; +_dialog__WEBPACK_IMPORTED_MODULE_4__["default"].confirm = function (config) { + var _ConfigProvider$getCo3 = _config_provider__WEBPACK_IMPORTED_MODULE_2__["default"].getContextProps(config, 'Dialog'), + warning = _ConfigProvider$getCo3.warning; + + if (warning !== false) { + config = processProps(config, _util__WEBPACK_IMPORTED_MODULE_3__["log"].deprecated); + } + return Object(_show__WEBPACK_IMPORTED_MODULE_6__["confirm"])(config); +}; + +/* istanbul ignore next */ +function processProps(props, deprecated) { + if ('closable' in props) { + deprecated('closable', 'closeable', 'Dialog'); + + var _props = props, + closable = _props.closable, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['closable']); + + props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ closeable: closable }, others); + } + + var overlayPropNames = ['target', 'offset', 'beforeOpen', 'onOpen', 'afterOpen', 'beforePosition', 'onPosition', 'cache', 'safeNode', 'wrapperClassName', 'container']; + overlayPropNames.forEach(function (name) { + if (name in props) { + var _extends2; + + deprecated(name, 'overlayProps.' + name, 'Dialog'); + + var _props2 = props, + overlayProps = _props2.overlayProps, + _others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props2, ['overlayProps']); + + var newOverlayProps = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()((_extends2 = {}, _extends2[name] = props[name], _extends2), overlayProps || {}); + delete _others[name]; + props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ overlayProps: newOverlayProps }, _others); + } + }); + + return props; +} + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_2__["default"].config(_dialog__WEBPACK_IMPORTED_MODULE_4__["default"], { + transform: function transform(props, deprecated) { + return processProps(props, deprecated); + } +})); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/inner.js": +/*!**************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/inner.js ***! + \**************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Inner; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../button */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/index.js"); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../icon */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/index.js"); +/* harmony import */ var _locale_zh_cn__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../locale/zh-cn */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/locale/zh-cn.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); + + + + + +var _class, _temp; + + + + + + + + + +var makeChain = _util__WEBPACK_IMPORTED_MODULE_10__["func"].makeChain; +var pickOthers = _util__WEBPACK_IMPORTED_MODULE_10__["obj"].pickOthers; + +var noop = function noop() {}; + +var Inner = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(Inner, _Component); + + function Inner() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Inner); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _Component.apply(this, arguments)); + } + + Inner.prototype.getNode = function getNode(name, ref) { + this[name] = ref; + }; + + Inner.prototype.renderHeader = function renderHeader() { + var _props = this.props, + prefix = _props.prefix, + title = _props.title; + + if (title) { + this.titleId = Object(_util__WEBPACK_IMPORTED_MODULE_10__["guid"])('dialog-title-'); + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + { + className: prefix + 'dialog-header', + id: this.titleId, + ref: this.getNode.bind(this, 'headerNode'), + role: 'heading', + 'aria-level': '1' + }, + title + ); + } + return null; + }; + + Inner.prototype.renderBody = function renderBody() { + var _props2 = this.props, + prefix = _props2.prefix, + children = _props2.children; + + if (children) { + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + { + className: prefix + 'dialog-body', + ref: this.getNode.bind(this, 'bodyNode') + }, + children + ); + } + return null; + }; + + Inner.prototype.renderFooter = function renderFooter() { + var _cx, + _this2 = this; + + var _props3 = this.props, + prefix = _props3.prefix, + footer = _props3.footer, + footerAlign = _props3.footerAlign, + footerActions = _props3.footerActions, + locale = _props3.locale, + height = _props3.height; + + + if (footer === false) { + return null; + } + + var newClassName = classnames__WEBPACK_IMPORTED_MODULE_6___default()((_cx = {}, _cx[prefix + 'dialog-footer'] = true, _cx[prefix + 'align-' + footerAlign] = true, _cx[prefix + 'dialog-footer-fixed-height'] = !!height, _cx)); + var footerContent = footer === true || !footer ? footerActions.map(function (action) { + var btnProps = _this2.props[action + 'Props']; + var newBtnProps = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, btnProps, { + prefix: prefix, + className: classnames__WEBPACK_IMPORTED_MODULE_6___default()(prefix + 'dialog-btn', btnProps.className), + onClick: makeChain(_this2.props['on' + (action[0].toUpperCase() + action.slice(1))], btnProps.onClick), + children: btnProps.children || locale[action] + }); + if (action === 'ok') { + newBtnProps.type = 'primary'; + } + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_button__WEBPACK_IMPORTED_MODULE_7__["default"], babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ key: action }, newBtnProps)); + }) : footer; + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + { + className: newClassName, + ref: this.getNode.bind(this, 'footerNode') + }, + footerContent + ); + }; + + Inner.prototype.renderCloseLink = function renderCloseLink() { + var _props4 = this.props, + prefix = _props4.prefix, + closeable = _props4.closeable, + onClose = _props4.onClose, + locale = _props4.locale; + + + if (closeable) { + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'a', + { + role: 'button', + 'aria-label': locale.close, + className: prefix + 'dialog-close', + onClick: onClose + }, + react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_8__["default"], { + className: prefix + 'dialog-close-icon', + type: 'close' + }) + ); + } + + return null; + }; + + Inner.prototype.render = function render() { + var _cx2; + + var _props5 = this.props, + prefix = _props5.prefix, + className = _props5.className, + closeable = _props5.closeable, + title = _props5.title, + role = _props5.role, + rtl = _props5.rtl, + height = _props5.height; + + var others = pickOthers(Object.keys(Inner.propTypes), this.props); + var newClassName = classnames__WEBPACK_IMPORTED_MODULE_6___default()((_cx2 = {}, _cx2[prefix + 'dialog'] = true, _cx2[prefix + 'closeable'] = closeable, _cx2[className] = !!className, _cx2)); + + var header = this.renderHeader(); + var body = this.renderBody(); + var footer = this.renderFooter(); + var closeLink = this.renderCloseLink(); + + var ariaProps = { + role: role, + 'aria-modal': 'true' + }; + if (title) { + ariaProps['aria-labelledby'] = this.titleId; + } + + others.style = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, others.style, { height: height }); + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + 'div', + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, ariaProps, { + className: newClassName + }, others, { + dir: rtl ? 'rtl' : undefined + }), + header, + body, + footer, + closeLink + ); + }; + + return Inner; +}(react__WEBPACK_IMPORTED_MODULE_4__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + className: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + title: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + children: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + footer: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node]), + footerAlign: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOf(['left', 'center', 'right']), + footerActions: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.array, + onOk: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + onCancel: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + okProps: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, + cancelProps: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, + closeable: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + onClose: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + locale: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, + role: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + // set value for a fixed height dialog. Passing a value will absolutely position the footer to the bottom. + height: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string +}, _class.defaultProps = { + prefix: 'next-', + footerAlign: 'right', + footerActions: ['ok', 'cancel'], + onOk: noop, + onCancel: noop, + okProps: {}, + cancelProps: {}, + closeable: true, + onClose: noop, + locale: _locale_zh_cn__WEBPACK_IMPORTED_MODULE_9__["default"].Dialog, + role: 'dialog' +}, _temp); +Inner.displayName = 'Inner'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/main.scss": +/*!***************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/main.scss ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694891128 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/show.js": +/*!*************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/show.js ***! + \*************************************************************************/ +/*! exports provided: ModalInner, show, alert, confirm */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModalInner", function() { return ModalInner; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "show", function() { return show; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "alert", function() { return alert; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "confirm", function() { return confirm; }); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-dom */ "./node_modules/_react-dom@16.12.0@react-dom/index.js"); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../message */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/message/index.js"); +/* harmony import */ var _locale_zh_cn__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../locale/zh-cn */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/locale/zh-cn.js"); +/* harmony import */ var _dialog__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./dialog */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/dialog.js"); + + + + + + +var _class, _temp2; + + + + + + + + + + +var Dialog = _config_provider__WEBPACK_IMPORTED_MODULE_9__["default"].config(_dialog__WEBPACK_IMPORTED_MODULE_12__["default"]); + +var noop = function noop() {}; +var MESSAGE_TYPE = { + alert: 'warning', + confirm: 'help' +}; + +var ModalInner = function ModalInner(_ref) { + var type = _ref.type, + _ref$messageProps = _ref.messageProps, + messageProps = _ref$messageProps === undefined ? {} : _ref$messageProps, + title = _ref.title, + rtl = _ref.rtl, + _ref$prefix = _ref.prefix, + prefix = _ref$prefix === undefined ? 'next-' : _ref$prefix, + content = _ref.content; + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + _message__WEBPACK_IMPORTED_MODULE_10__["default"], + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_4___default()({ + size: 'large', + shape: 'addon', + type: MESSAGE_TYPE[type] + }, messageProps, { + title: title, + rtl: rtl, + className: classnames__WEBPACK_IMPORTED_MODULE_8___default()(prefix + 'dialog-message', messageProps.className) + }), + content + ); +}; + +var Modal = (_temp2 = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(Modal, _Component); + + function Modal() { + var _temp, _this, _ret; + + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Modal); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = { + visible: true, + loading: false + }, _this.close = function () { + _this.setState({ + visible: false + }); + }, _this.loading = function (loading) { + _this.setState({ + loading: loading + }); + }, _temp), babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(_this, _ret); + } + + Modal.prototype.wrapper = function wrapper(fn, callback) { + var _this2 = this; + + return function () { + var res = fn.apply(undefined, arguments); + if (res && res.then) { + _this2.loading(true); + + res.then(function (result) { + _this2.loading(false); + + if (result !== false) { + return callback(); + } + }).catch(function (e) { + _this2.loading(false); + throw e; + }); + } else if (res !== false) { + return callback(); + } + }; + }; + + Modal.prototype.render = function render() { + var _props = this.props, + prefix = _props.prefix, + type = _props.type, + title = _props.title, + content = _props.content, + messageProps = _props.messageProps, + footerActions = _props.footerActions, + onOk = _props.onOk, + onCancel = _props.onCancel, + onClose = _props.onClose, + okProps = _props.okProps, + needWrapper = _props.needWrapper, + rtl = _props.rtl, + className = _props.className, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0___default()(_props, ['prefix', 'type', 'title', 'content', 'messageProps', 'footerActions', 'onOk', 'onCancel', 'onClose', 'okProps', 'needWrapper', 'rtl', 'className']); + + var newTitle = needWrapper && type ? null : title; + + var newContent = needWrapper && type ? react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ModalInner, { + type: type, + messageProps: messageProps, + title: title, + rtl: rtl, + prefix: prefix, + content: content + }) : content; + + var newFooterActions = footerActions || (type === 'alert' ? ['ok'] : type === 'confirm' ? ['ok', 'cancel'] : undefined); + var newOnOk = this.wrapper(onOk, this.close); + var newOnCancel = this.wrapper(onCancel, this.close); + var newOnClose = this.wrapper(onClose, this.close); + + var _state = this.state, + visible = _state.visible, + loading = _state.loading; + + okProps.loading = loading; + + var classNames = classnames__WEBPACK_IMPORTED_MODULE_8___default()(prefix + 'dialog-quick', className); + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + Dialog, + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_4___default()({ + prefix: prefix, + role: 'alertdialog' + }, others, { + visible: visible, + title: newTitle, + rtl: rtl, + footerActions: newFooterActions, + onOk: this.state.loading ? noop : newOnOk, + onCancel: newOnCancel, + onClose: newOnClose, + okProps: okProps, + className: classNames + }), + newContent + ); + }; + + return Modal; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + pure: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + type: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOf(['alert', 'confirm']), + title: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.node, + content: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.node, + messageProps: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object, + footerActions: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.array, + /** + * Callback function triggered when Ok button is clicked + * @param {Object} event click event object + * @returns {Promise} Optionally handles a Promise return object + */ + onOk: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * Callback function triggered when Cancel button is clicked + * @param {Object} event click event object + * @returns {Promise} Optionally handles a Promise return object + */ + onCancel: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + /** + * Callback function triggered when Close button is clicked + * @param {Object} event click event object + * @returns {Promise} Optionally handles a Promise return object + */ + onClose: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func, + okProps: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object, + locale: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object, + needWrapper: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + className: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string +}, _class.defaultProps = { + prefix: 'next-', + pure: false, + messageProps: {}, + onOk: noop, + onCancel: noop, + onClose: noop, + okProps: {}, + locale: _locale_zh_cn__WEBPACK_IMPORTED_MODULE_11__["default"].Dialog, + needWrapper: true +}, _temp2); +Modal.displayName = 'Modal'; + + +var ConfigModal = _config_provider__WEBPACK_IMPORTED_MODULE_9__["default"].config(Modal, { componentName: 'Dialog' }); + +/** + * 创建对话框 + * @exportName show + * @param {Object} config 配置项 + * @returns {Object} 包含有 hide 方法,可用来关闭对话框 + */ +var show = function show() { + var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var container = document.createElement('div'); + var unmount = function unmount() { + if (config.afterClose) { + config.afterClose(); + } + react_dom__WEBPACK_IMPORTED_MODULE_6___default.a.unmountComponentAtNode(container); + container.parentNode.removeChild(container); + }; + + document.body.appendChild(container); + var newContext = _config_provider__WEBPACK_IMPORTED_MODULE_9__["default"].getContext(); + + var instance = void 0, + myRef = void 0; + + react_dom__WEBPACK_IMPORTED_MODULE_6___default.a.render(react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + _config_provider__WEBPACK_IMPORTED_MODULE_9__["default"], + newContext, + react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ConfigModal, babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_4___default()({}, config, { + afterClose: unmount, + ref: function ref(_ref2) { + myRef = _ref2; + } + })) + ), container, function () { + instance = myRef; + }); + return { + hide: function hide() { + var inc = instance && instance.getInstance(); + inc && inc.close(); + } + }; +}; + +var methodFactory = function methodFactory(type) { + return function () { + var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + config.type = type; + return show(config); + }; +}; + +/** + * 创建警示对话框 + * @exportName alert + * @param {Object} config 配置项 + * @returns {Object} 包含有 hide 方法,可用来关闭对话框 + */ +var alert = methodFactory('alert'); + +/** + * 创建确认对话框 + * @exportName confirm + * @param {Object} config 配置项 + * @returns {Object} 包含有 hide 方法,可用来关闭对话框 + */ +var confirm = methodFactory('confirm'); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/style.js": +/*!**************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/style.js ***! + \**************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _overlay_style_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../overlay/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/overlay/style.js"); +/* harmony import */ var _message_style_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../message/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/message/style.js"); +/* harmony import */ var _button_style_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../button/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/button/style.js"); +/* harmony import */ var _icon_style_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icon/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/style.js"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dialog/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_4__); + + + + + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dropdown/dropdown.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dropdown/dropdown.js ***! + \*******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Dropdown; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _overlay__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../overlay */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/overlay/index.js"); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/util/index.js"); + + + + + +var _class, _temp; + + + + + + +var noop = _util__WEBPACK_IMPORTED_MODULE_7__["func"].noop, + makeChain = _util__WEBPACK_IMPORTED_MODULE_7__["func"].makeChain, + bindCtx = _util__WEBPACK_IMPORTED_MODULE_7__["func"].bindCtx; + +var Popup = _overlay__WEBPACK_IMPORTED_MODULE_6__["default"].Popup; + +/** + * Dropdown + * @description 继承 Popup 的 API,除非特别说明 + */ +var Dropdown = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(Dropdown, _Component); + + function Dropdown(props) { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Dropdown); + + var _this = babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _Component.call(this, props)); + + _this.state = { + visible: 'visible' in props ? props.visible : props.defaultVisible || false, + autoFocus: 'autoFocus' in props ? props.autoFocus : false + }; + + bindCtx(_this, ['onTriggerKeyDown', 'onMenuClick', 'onVisibleChange']); + return _this; + } + + Dropdown.prototype.getVisible = function getVisible() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props; + + return 'visible' in props ? props.visible : this.state.visible; + }; + + Dropdown.prototype.onMenuClick = function onMenuClick() { + this.onVisibleChange(false, 'fromContent'); + }; + + Dropdown.prototype.onVisibleChange = function onVisibleChange(visible, from) { + this.setState({ visible: visible }); + + this.props.onVisibleChange(visible, from); + }; + + Dropdown.prototype.onTriggerKeyDown = function onTriggerKeyDown() { + var autoFocus = true; + + if ('autoFocus' in this.props) { + autoFocus = this.props.autoFocus; + } + + this.setState({ + autoFocus: autoFocus + }); + }; + + Dropdown.prototype.render = function render() { + var child = react__WEBPACK_IMPORTED_MODULE_4__["Children"].only(this.props.children); + if (typeof child.type === 'function' && child.type.isNextMenu) { + child = react__WEBPACK_IMPORTED_MODULE_4___default.a.cloneElement(child, { + onItemClick: makeChain(this.onMenuClick, child.props.onItemClick) + }); + } + + var _props = this.props, + trigger = _props.trigger, + rtl = _props.rtl; + + var newTrigger = react__WEBPACK_IMPORTED_MODULE_4___default.a.cloneElement(trigger, { + onKeyDown: makeChain(this.onTriggerKeyDown, trigger.props.onKeyDown) + }); + + return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement( + Popup, + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, this.props, { + rtl: rtl, + autoFocus: this.state.autoFocus, + trigger: newTrigger, + visible: this.getVisible(), + onVisibleChange: this.onVisibleChange, + canCloseByOutSideClick: true + }), + child + ); + }; + + return Dropdown; +}(react__WEBPACK_IMPORTED_MODULE_4__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + pure: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + className: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + /** + * 弹层内容 + */ + children: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + /** + * 弹层当前是否显示 + */ + visible: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 弹层默认是否显示 + */ + defaultVisible: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 弹层显示或隐藏时触发的回调函数 + * @param {Boolean} visible 弹层是否显示 + * @param {String} type 触发弹层显示或隐藏的来源 fromContent 表示由Dropdown内容触发; fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发 + */ + onVisibleChange: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.func, + /** + * 触发弹层显示或者隐藏的元素 + */ + trigger: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.node, + /** + * 触发弹层显示或隐藏的操作类型,可以是 'click','hover',或者它们组成的数组,如 ['hover', 'click'] + */ + triggerType: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.array]), + /** + * 设置此属性,弹层无法显示或隐藏 + */ + disabled: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 弹层相对于触发元素的定位, 详见 Overlay 的定位部分 + */ + align: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.string, + /** + * 弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量 + * e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px + */ + offset: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.array, + /** + * 弹层显示或隐藏的延时时间(以毫秒为单位),在 triggerType 被设置为 hover 时生效 + */ + delay: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.number, + /** + * 弹层打开时是否让其中的元素自动获取焦点 + */ + autoFocus: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 是否显示遮罩 + */ + hasMask: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 隐藏时是否保留子节点 + */ + cache: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool, + /** + * 配置动画的播放方式,支持 { in: 'enter-class', out: 'leave-class' } 的对象参数,如果设置为 false,则不播放动画 + * @default { in: 'expandInDown', out: 'expandOutUp' } + */ + animation: prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.object, prop_types__WEBPACK_IMPORTED_MODULE_5___default.a.bool]) +}, _class.defaultProps = { + prefix: 'next-', + pure: false, + defaultVisible: false, + onVisibleChange: noop, + triggerType: 'hover', + disabled: false, + align: 'tl bl', + offset: [0, 0], + delay: 200, + hasMask: false, + cache: false, + onPosition: noop +}, _temp); +Dropdown.displayName = 'Dropdown'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dropdown/index.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dropdown/index.js ***! + \****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _dropdown__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dropdown */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dropdown/dropdown.js"); + + + +/* harmony default export */ __webpack_exports__["default"] = (_config_provider__WEBPACK_IMPORTED_MODULE_0__["default"].config(_dropdown__WEBPACK_IMPORTED_MODULE_1__["default"], { + transform: /* istanbul ignore next */function transform(props, deprecated) { + if ('triggerType' in props) { + var triggerType = Array.isArray(props.triggerType) ? [].concat(props.triggerType) : [props.triggerType]; + + if (triggerType.indexOf('focus') > -1) { + deprecated('triggerType[focus]', 'triggerType[hover, click]', 'Balloon'); + } + } + + return props; + } +})); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dropdown/main.scss": +/*!*****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dropdown/main.scss ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694894046 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dropdown/style.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dropdown/style.js ***! + \****************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _overlay_style_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../overlay/style.js */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/overlay/style.js"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/dropdown/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_1__); + + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/grid/col.js": +/*!**********************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/grid/col.js ***! + \**********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Col; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/typeof */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/typeof.js"); +/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__); + + + + + + + +var _class, _temp; + + + + + +var breakPoints = ['xxs', 'xs', 's', 'm', 'l', 'xl']; + +/** + * Grid.Col + * @order 2 + */ +var Col = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5___default()(Col, _Component); + + function Col() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, Col); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, _Component.apply(this, arguments)); + } + + Col.prototype.render = function render() { + var _this2 = this, + _extends2, + _extends3; + + /* eslint-disable no-unused-vars */ + var _props = this.props, + prefix = _props.prefix, + pure = _props.pure, + span = _props.span, + offset = _props.offset, + fixedSpan = _props.fixedSpan, + fixedOffset = _props.fixedOffset, + hidden = _props.hidden, + align = _props.align, + xxs = _props.xxs, + xs = _props.xs, + s = _props.s, + m = _props.m, + l = _props.l, + xl = _props.xl, + Tag = _props.component, + className = _props.className, + children = _props.children, + rtl = _props.rtl, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2___default()(_props, ['prefix', 'pure', 'span', 'offset', 'fixedSpan', 'fixedOffset', 'hidden', 'align', 'xxs', 'xs', 's', 'm', 'l', 'xl', 'component', 'className', 'children', 'rtl']); + /* eslint-enable no-unused-vars */ + + var pointClassObj = breakPoints.reduce(function (ret, point) { + var pointProps = {}; + if (babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default()(_this2.props[point]) === 'object') { + pointProps = _this2.props[point]; + } else { + pointProps.span = _this2.props[point]; + } + + ret[prefix + 'col-' + point + '-' + pointProps.span] = !!pointProps.span; + ret[prefix + 'col-' + point + '-offset-' + pointProps.offset] = !!pointProps.offset; + + return ret; + }, {}); + + var hiddenClassObj = void 0; + if (hidden === true) { + var _hiddenClassObj; + + hiddenClassObj = (_hiddenClassObj = {}, _hiddenClassObj[prefix + 'col-hidden'] = true, _hiddenClassObj); + } else if (typeof hidden === 'string') { + var _hiddenClassObj2; + + hiddenClassObj = (_hiddenClassObj2 = {}, _hiddenClassObj2[prefix + 'col-' + hidden + '-hidden'] = !!hidden, _hiddenClassObj2); + } else if (Array.isArray(hidden)) { + hiddenClassObj = hidden.reduce(function (ret, point) { + ret[prefix + 'col-' + point + '-hidden'] = !!point; + return ret; + }, {}); + } + + var classes = classnames__WEBPACK_IMPORTED_MODULE_8___default()(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()((_extends2 = {}, _extends2[prefix + 'col'] = true, _extends2[prefix + 'col-' + span] = !!span, _extends2[prefix + 'col-fixed-' + fixedSpan] = !!fixedSpan, _extends2[prefix + 'col-offset-' + offset] = !!offset, _extends2[prefix + 'col-offset-fixed-' + fixedOffset] = !!fixedOffset, _extends2[prefix + 'col-' + align] = !!align, _extends2), pointClassObj, hiddenClassObj, (_extends3 = {}, _extends3[className] = className, _extends3))); + + return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement( + Tag, + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + dir: rtl ? 'rtl' : 'ltr', + role: 'gridcell', + className: classes + }, others), + children + ); + }; + + return Col; +}(react__WEBPACK_IMPORTED_MODULE_6__["Component"]), _class.isNextCol = true, _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + pure: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, + className: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, + /** + * 列内容 + */ + children: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.node, + /** + * 列宽度

**可选值**:
1, 2, 3, ..., 22, 23, 24 + */ + span: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.number]), + /** + * 固定列宽度,宽度值为20 * 栅格数

**可选值**:
1, 2, 3, ..., 28, 29, 30 + */ + fixedSpan: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.number]), + /** + * (不支持IE9浏览器)列偏移

**可选值**:
1, 2, 3, ..., 22, 23, 24 + */ + offset: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.number]), + /** + * (不支持IE9浏览器)固定列偏移,宽度值为20 * 栅格数

**可选值**:
1, 2, 3, ..., 28, 29, 30 + */ + fixedOffset: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.number]), + /** + * (不支持IE9浏览器)多列垂直方向对齐方式,可覆盖Row的align属性 + */ + align: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOf(['top', 'center', 'bottom', 'baseline', 'stretch']), + /** + * 列在不同断点下的显示与隐藏

**可选值**:
true(在所有断点下隐藏)
false(在所有断点下显示)
'xs'(在 xs 断点下隐藏)
['xxs', 'xs', 's', 'm', 'l', 'xl'](在 xxs, xs, s, m, l, xl 断点下隐藏) + */ + hidden: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.array]), + /** + * >=320px,响应式栅格,可为栅格数(span)或一个包含栅格数(span)和偏移栅格数(offset)对象 + */ + xxs: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object]), + /** + * >=480px,响应式栅格,可为栅格数(span)或一个包含栅格数(span)和偏移栅格数(offset)对象 + */ + xs: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object]), + /** + * >=720px,响应式栅格,可为栅格数(span)或一个包含栅格数(span)和偏移栅格数(offset)对象 + */ + s: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object]), + /** + * >=990px,响应式栅格,可为栅格数(span)或一个包含栅格数(span)和偏移栅格数(offset)对象 + */ + m: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object]), + /** + * >=1200px,响应式栅格,可为栅格数(span)或一个包含栅格数(span)和偏移栅格数(offset)对象 + */ + l: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object]), + /** + * >=1500px,响应式栅格,可为栅格数(span)或一个包含栅格数(span)和偏移栅格数(offset)对象 + */ + xl: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.object]), + /** + * 指定以何种元素渲染该节点,默认为 'div' + */ + component: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.func]) +}, _class.defaultProps = { + prefix: 'next-', + pure: false, + component: 'div' +}, _temp); +Col.displayName = 'Col'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/grid/index.js": +/*!************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/grid/index.js ***! + \************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _row__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./row */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/grid/row.js"); +/* harmony import */ var _col__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./col */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/grid/col.js"); + + + + + + +var Grid = { + Row: _config_provider__WEBPACK_IMPORTED_MODULE_2__["default"].config(_row__WEBPACK_IMPORTED_MODULE_3__["default"], { + transform: /* istanbul ignore next */function transform(props, deprecated) { + if ('type' in props) { + deprecated('type', 'fixed | wrap | gutter', 'Row'); + + var _props = props, + type = _props.type, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['type']); + + var types = Array.isArray(type) ? type : [type]; + var fixed = void 0; + if (types.indexOf('fixed') > -1) { + fixed = true; + } + var wrap = void 0; + if (types.indexOf('wrap') > -1) { + wrap = true; + } + props = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ fixed: fixed, wrap: wrap }, others); + } + + return props; + } + }), + Col: _config_provider__WEBPACK_IMPORTED_MODULE_2__["default"].config(_col__WEBPACK_IMPORTED_MODULE_4__["default"]) +}; + +/* harmony default export */ __webpack_exports__["default"] = (Grid); + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/grid/main.scss": +/*!*************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/grid/main.scss ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(true) { + // 1582694891914 + var cssReload = __webpack_require__(/*! ../../../../_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js */ "./node_modules/_css-hot-loader@1.4.4@css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); + module.hot.dispose(cssReload); + module.hot.accept(undefined, cssReload);; + } + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/grid/row.js": +/*!**********************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/grid/row.js ***! + \**********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Row; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/classCallCheck.js"); +/* harmony import */ var babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/possibleConstructorReturn.js"); +/* harmony import */ var babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/inherits.js"); +/* harmony import */ var babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "./node_modules/_prop-types@15.7.2@prop-types/index.js"); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__); + + + + + + +var _class, _temp; + + + + + +/** + * Grid.Row + * @order 1 + */ +var Row = (_temp = _class = function (_Component) { + babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Row, _Component); + + function Row() { + babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Row); + + return babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, _Component.apply(this, arguments)); + } + + Row.prototype.render = function render() { + var _extends2, _extends3; + + /* eslint-disable no-unused-vars */ + var _props = this.props, + prefix = _props.prefix, + pure = _props.pure, + wrap = _props.wrap, + fixed = _props.fixed, + gutter = _props.gutter, + fixedWidth = _props.fixedWidth, + align = _props.align, + justify = _props.justify, + hidden = _props.hidden, + className = _props.className, + Tag = _props.component, + children = _props.children, + rtl = _props.rtl, + others = babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_props, ['prefix', 'pure', 'wrap', 'fixed', 'gutter', 'fixedWidth', 'align', 'justify', 'hidden', 'className', 'component', 'children', 'rtl']); + /* eslint-enable no-unused-vars */ + + var hiddenClassObj = void 0; + if (hidden === true) { + var _hiddenClassObj; + + hiddenClassObj = (_hiddenClassObj = {}, _hiddenClassObj[prefix + 'row-hidden'] = true, _hiddenClassObj); + } else if (typeof hidden === 'string') { + var _hiddenClassObj2; + + hiddenClassObj = (_hiddenClassObj2 = {}, _hiddenClassObj2[prefix + 'row-' + hidden + '-hidden'] = !!hidden, _hiddenClassObj2); + } else if (Array.isArray(hidden)) { + hiddenClassObj = hidden.reduce(function (ret, point) { + ret[prefix + 'row-' + point + '-hidden'] = !!point; + return ret; + }, {}); + } + + var newClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()((_extends2 = {}, _extends2[prefix + 'row'] = true, _extends2[prefix + 'row-wrap'] = wrap, _extends2[prefix + 'row-fixed'] = fixed, _extends2[prefix + 'row-fixed-' + fixedWidth] = !!fixedWidth, _extends2[prefix + 'row-justify-' + justify] = !!justify, _extends2[prefix + 'row-align-' + align] = !!align, _extends2), hiddenClassObj, (_extends3 = {}, _extends3[className] = !!className, _extends3))); + + var newChildren = children; + var gutterNumber = parseInt(gutter, 10); + if (gutterNumber !== 0) { + var halfGutterString = gutterNumber / 2 + 'px'; + others.style = babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + marginLeft: '-' + halfGutterString, + marginRight: '-' + halfGutterString + }, others.style || {}); + newChildren = react__WEBPACK_IMPORTED_MODULE_5__["Children"].map(children, function (child) { + if (child && child.type && typeof child.type === 'function' && child.type.isNextCol) { + var newChild = Object(react__WEBPACK_IMPORTED_MODULE_5__["cloneElement"])(child, { + style: babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + paddingLeft: halfGutterString, + paddingRight: halfGutterString + }, child.style || {}) + }); + return newChild; + } + + return child; + }); + } + + return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement( + Tag, + babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ + dir: rtl ? 'rtl' : 'ltr', + role: 'row', + className: newClassName + }, others), + newChildren + ); + }; + + return Row; +}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]), _class.propTypes = { + prefix: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + pure: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + rtl: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + className: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, + style: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.object, + /** + * 行内容 + */ + children: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.node, + /** + * 列间隔 + */ + gutter: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.number]), + /** + * 列在行中宽度溢出后是否换行 + */ + wrap: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 行在某一断点下宽度是否保持不变(默认行宽度随视口变化而变化) + */ + fixed: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, + /** + * 固定行的宽度为某一断点的宽度,不受视口影响而变动 + * @enumdesc 320px, 480px, 720px, 990px, 1200px, 1500px + */ + fixedWidth: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl']), + /** + * (不支持IE9浏览器)多列垂直方向对齐方式 + * @enumdesc 顶部对齐, 居中对齐, 底部对齐, 按第一行文字基线对齐, 未设置高度或设为 auto,将占满整个容器的高度 + */ + align: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['top', 'center', 'bottom', 'baseline', 'stretch']), + /** + * (不支持IE9浏览器)行内具有多余空间时的布局方式 + * @enumdesc 左对齐, 居中对齐, 右对齐, 两端对齐,列之间间距相等, 每列具有相同的左右间距,行两端间距是列间距的二分之一 + */ + justify: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOf(['start', 'center', 'end', 'space-between', 'space-around']), + /** + * 行在不同断点下的显示与隐藏

**可选值**:
true(在所有断点下隐藏)
false(在所有断点下显示)
'xs'(在 xs 断点下隐藏)
['xxs', 'xs', 's', 'm', 'l', 'xl'](在 xxs, xs, s, m, l, xl 断点下隐藏) + */ + hidden: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.bool, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.array]), + /** + * 指定以何种元素渲染该节点 + * - 默认为 'div' + */ + component: prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_6___default.a.func]) +}, _class.defaultProps = { + prefix: 'next-', + pure: false, + fixed: false, + gutter: 0, + wrap: false, + component: 'div' +}, _temp); +Row.displayName = 'Row'; + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/grid/style.js": +/*!************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/grid/style.js ***! + \************************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./main.scss */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/grid/main.scss"); +/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_0__); + + +/***/ }), + +/***/ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/icon-font.js": +/*!****************************************************************************!*\ + !*** ./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/icon-font.js ***! + \****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createFromIconfontCN; }); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js"); +/* harmony import */ var babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/objectWithoutProperties.js"); +/* harmony import */ var babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/_react@16.12.0@react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/_classnames@2.2.6@classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../config-provider */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/config-provider/index.js"); +/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./index */ "./node_modules/_@alifd_next@1.19.13@@alifd/next/es/icon/index.js"); + + + + + + + +var customCache = new Set(); + +function createFromIconfontCN() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var scriptUrl = options.scriptUrl, + _options$extraCommonP = options.extraCommonProps, + extraCommonProps = _options$extraCommonP === undefined ? {} : _options$extraCommonP; + + /** + * DOM API required. + * Make sure in browser environment. + * The Custom Icon will create a