From 917b8e78f20c0477da3e1303e6587dbc5885f8e9 Mon Sep 17 00:00:00 2001 From: Leopoldthecoder Date: Mon, 23 Oct 2017 20:01:49 +0800 Subject: [PATCH] theme-chalk tuning --- examples/docs/en-US/message-box.md | 1 + examples/docs/zh-CN/message-box.md | 1 + package.json | 2 +- packages/date-picker/src/panel/date-range.vue | 13 +++++++++---- packages/message-box/src/main.js | 1 + packages/message-box/src/main.vue | 2 ++ packages/theme-chalk/src/autocomplete.scss | 4 ++-- packages/theme-chalk/src/common/var.scss | 2 +- .../theme-chalk/src/date-picker/date-picker.scss | 3 ++- .../src/date-picker/date-range-picker.scss | 3 ++- packages/theme-chalk/src/dropdown.scss | 1 + packages/theme-chalk/src/input-number.scss | 1 + packages/theme-chalk/src/input.scss | 2 +- packages/theme-chalk/src/option.scss | 7 ++++--- packages/theme-chalk/src/progress.scss | 2 +- packages/theme-chalk/src/step.scss | 2 +- packages/theme-chalk/src/switch.scss | 9 +-------- packages/theme-chalk/src/transfer.scss | 1 + 18 files changed, 33 insertions(+), 24 deletions(-) diff --git a/examples/docs/en-US/message-box.md b/examples/docs/en-US/message-box.md index 02269b602..6b3aeca0d 100644 --- a/examples/docs/en-US/message-box.md +++ b/examples/docs/en-US/message-box.md @@ -393,6 +393,7 @@ The corresponding methods are: `MessageBox`, `MessageBox.alert`, `MessageBox.con | closeOnHashChange | whether to close MessageBox when hash changes | boolean | — | true | | showInput | whether to show an input | boolean | — | false (true when called with prompt) | | inputPlaceholder | placeholder of input | string | — | — | +| inputType | type of input | string | — | text | | inputValue | initial value of input | string | — | — | | inputPattern | regexp for the input | regexp | — | — | | inputValidator | validation function for the input. Should returns a boolean or string. If a string is returned, it will be assigned to inputErrorMessage | function | — | — | diff --git a/examples/docs/zh-CN/message-box.md b/examples/docs/zh-CN/message-box.md index bb1ff3de6..1447ee8eb 100644 --- a/examples/docs/zh-CN/message-box.md +++ b/examples/docs/zh-CN/message-box.md @@ -391,6 +391,7 @@ import { MessageBox } from 'element-ui'; | closeOnHashChange | 是否在 hashchange 时关闭 MessageBox | boolean | — | true | | showInput | 是否显示输入框 | boolean | — | false(以 prompt 方式调用时为 true)| | inputPlaceholder | 输入框的占位符 | string | — | — | +| inputType | 输入框的类型 | string | — | text | | inputValue | 输入框的初始文本 | string | — | — | | inputPattern | 输入框的校验表达式 | regexp | — | — | | inputValidator | 输入框的校验函数。可以返回布尔值或字符串,若返回一个字符串, 则返回结果会被赋值给 inputErrorMessage | function | — | — | diff --git a/package.json b/package.json index ab1a2efb6..adda157f1 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "dist:all": "node build/bin/build-all.js && npm run build:theme", "i18n": "node build/bin/i18n.js", "lint": "eslint src/**/* test/**/* packages/**/*.{js,vue} build/**/* --quiet", - "pub": "npm run bootstrap && sh build/git-release.sh && sh build/release.sh", + "pub": "npm run bootstrap && sh build/git-release.sh && sh build/release.sh && node build/bin/gen-indices.js", "pub:all": "npm run dist:all && lerna publish --skip-git && git commit -am 'publish independent packages' && git push eleme dev", "test": "npm run lint && npm run build:theme && cross-env CI_ENV=/dev/ karma start test/unit/karma.conf.js --single-run", "test:watch": "npm run build:theme && karma start test/unit/karma.conf.js" diff --git a/packages/date-picker/src/panel/date-range.vue b/packages/date-picker/src/panel/date-range.vue index 3cc738b1c..22993e83e 100644 --- a/packages/date-picker/src/panel/date-range.vue +++ b/packages/date-picker/src/panel/date-range.vue @@ -204,7 +204,7 @@ } else if (defaultValue) { return [new Date(defaultValue), advanceDate(defaultValue, 24 * 60 * 60 * 1000)]; } else { - return [new Date(), advanceDate(Date.now, 24 * 60 * 60 * 1000)]; + return [new Date(), advanceDate(Date.now(), 24 * 60 * 60 * 1000)]; } }; @@ -378,7 +378,9 @@ // should allow them to be set individually in the future if (this.minDate) { this.leftDate = this.minDate; - this.rightDate = nextMonth(this.leftDate); + this.rightDate = this.unlinkPanels && this.maxDate + ? this.maxDate + : nextMonth(this.leftDate); } else { this.leftDate = calcDefaultValue(this.defaultValue)[0]; this.rightDate = nextMonth(this.leftDate); @@ -388,8 +390,11 @@ defaultValue(val) { if (!Array.isArray(this.value)) { - this.leftDate = calcDefaultValue(val)[0]; - this.rightDate = nextMonth(this.leftDate); + const [left, right] = calcDefaultValue(val); + this.leftDate = left; + this.rightDate = val && val[1] && this.unlinkPanels + ? right + : nextMonth(this.leftDate); } } }, diff --git a/packages/message-box/src/main.js b/packages/message-box/src/main.js index ffb86a09b..bb3be1a97 100644 --- a/packages/message-box/src/main.js +++ b/packages/message-box/src/main.js @@ -11,6 +11,7 @@ const defaults = { closeOnHashChange: true, inputValue: null, inputPlaceholder: '', + inputType: 'text', inputPattern: null, inputValidator: null, inputErrorMessage: '', diff --git a/packages/message-box/src/main.vue b/packages/message-box/src/main.vue index 5789fe576..00008242b 100644 --- a/packages/message-box/src/main.vue +++ b/packages/message-box/src/main.vue @@ -36,6 +36,7 @@