From dd1d894b237cc043a3de239f36572271ef107ae3 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 26 Apr 2017 18:37:27 +0800 Subject: [PATCH] segment --- bi/base.css | 17 +++++++++++++++++ bi/case.js | 13 ++++--------- bi/core.js | 6 +++--- docs/base.css | 17 +++++++++++++++++ docs/case.js | 13 ++++--------- docs/core.js | 6 +++--- src/case/segment/segment.js | 13 ++++--------- src/core/proto/date.js | 2 +- src/css/base/segment/segment.css | 17 +++++++++++++++++ src/less/base/segment/segment.less | 20 ++++++++++++++++++++ 10 files changed, 90 insertions(+), 34 deletions(-) diff --git a/bi/base.css b/bi/base.css index f423941b21..8a57a0a64d 100644 --- a/bi/base.css +++ b/bi/base.css @@ -678,8 +678,13 @@ li.CodeMirror-hint-active { overflow: hidden; overflow-x: hidden; overflow-y: hidden; + background: #ffffff; + border-right: 1px solid #d4dadd; + border-top: 1px solid #d4dadd; + border-bottom: 1px solid #d4dadd; } .bi-segment > .first-element { + border-left: 1px solid #d4dadd; -webkit-border-radius: 6px 0px 0px 6px; -moz-border-radius: 6px 0px 0px 6px; border-radius: 6px 0px 0px 6px; @@ -689,6 +694,18 @@ li.CodeMirror-hint-active { -moz-border-radius: 0px 6px 6px 0px; border-radius: 0px 6px 6px 0px; } +.bi-theme-dark .bi-segment > .center-element { + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; + background: #242640; + border-right: 1px solid #525466; + border-top: 1px solid #525466; + border-bottom: 1px solid #525466; +} +.bi-theme-dark .bi-segment > .first-element { + border-left: 1px solid #242640; +} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ diff --git a/bi/case.js b/bi/case.js index 41a27538cc..d5d9092aaf 100644 --- a/bi/case.js +++ b/bi/case.js @@ -8804,15 +8804,10 @@ BI.Segment = BI.inherit(BI.Widget, { this.buttonGroup = BI.createWidget({ element: this, type: "bi.button_group", - items: BI.map(o.items, function (i, item) { - return BI.extend({ - type: "bi.segment_button", - height: o.height - 2, - whiteSpace: o.whiteSpace - }, item, { - cls: (i === 0 ? "bi-border-left " : "") - + (item.cls || "") + " bi-border-top bi-border-right bi-border-bottom" - }); + items: BI.createItems(o.items, { + type: "bi.segment_button", + height: o.height - 2, + whiteSpace: o.whiteSpace }), layout: [ { diff --git a/bi/core.js b/bi/core.js index db3206894e..da9046cb6b 100644 --- a/bi/core.js +++ b/bi/core.js @@ -6169,19 +6169,19 @@ Date._DN = [BI.i18nText("BI-Basic_Sunday"), BI.i18nText("BI-Basic_Sunday")]; // short day names -Date._SDN = [BI.i18nText("BI-Day_Ri"), +Date._SDN = [BI.i18nText("BI-Date_Day"), BI.i18nText("BI-Basic_One"), BI.i18nText("BI-Basic_Two"), BI.i18nText("BI-Basic_Three"), BI.i18nText("BI-Basic_Four"), BI.i18nText("BI-Basic_Five"), BI.i18nText("BI-Basic_Six"), - BI.i18nText("BI-Day_Ri")]; + BI.i18nText("BI-Date_Day")]; // Monday first, etc. Date._FD = 1; -// full month names +// full month namesdat Date._MN = [ BI.i18nText("BI-Basic_January"), BI.i18nText("BI-Basic_February"), diff --git a/docs/base.css b/docs/base.css index f423941b21..8a57a0a64d 100644 --- a/docs/base.css +++ b/docs/base.css @@ -678,8 +678,13 @@ li.CodeMirror-hint-active { overflow: hidden; overflow-x: hidden; overflow-y: hidden; + background: #ffffff; + border-right: 1px solid #d4dadd; + border-top: 1px solid #d4dadd; + border-bottom: 1px solid #d4dadd; } .bi-segment > .first-element { + border-left: 1px solid #d4dadd; -webkit-border-radius: 6px 0px 0px 6px; -moz-border-radius: 6px 0px 0px 6px; border-radius: 6px 0px 0px 6px; @@ -689,6 +694,18 @@ li.CodeMirror-hint-active { -moz-border-radius: 0px 6px 6px 0px; border-radius: 0px 6px 6px 0px; } +.bi-theme-dark .bi-segment > .center-element { + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; + background: #242640; + border-right: 1px solid #525466; + border-top: 1px solid #525466; + border-bottom: 1px solid #525466; +} +.bi-theme-dark .bi-segment > .first-element { + border-left: 1px solid #242640; +} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ diff --git a/docs/case.js b/docs/case.js index 41a27538cc..d5d9092aaf 100644 --- a/docs/case.js +++ b/docs/case.js @@ -8804,15 +8804,10 @@ BI.Segment = BI.inherit(BI.Widget, { this.buttonGroup = BI.createWidget({ element: this, type: "bi.button_group", - items: BI.map(o.items, function (i, item) { - return BI.extend({ - type: "bi.segment_button", - height: o.height - 2, - whiteSpace: o.whiteSpace - }, item, { - cls: (i === 0 ? "bi-border-left " : "") - + (item.cls || "") + " bi-border-top bi-border-right bi-border-bottom" - }); + items: BI.createItems(o.items, { + type: "bi.segment_button", + height: o.height - 2, + whiteSpace: o.whiteSpace }), layout: [ { diff --git a/docs/core.js b/docs/core.js index d8367ba606..4b1e3f0790 100644 --- a/docs/core.js +++ b/docs/core.js @@ -23645,19 +23645,19 @@ Date._DN = [BI.i18nText("BI-Basic_Sunday"), BI.i18nText("BI-Basic_Sunday")]; // short day names -Date._SDN = [BI.i18nText("BI-Day_Ri"), +Date._SDN = [BI.i18nText("BI-Date_Day"), BI.i18nText("BI-Basic_One"), BI.i18nText("BI-Basic_Two"), BI.i18nText("BI-Basic_Three"), BI.i18nText("BI-Basic_Four"), BI.i18nText("BI-Basic_Five"), BI.i18nText("BI-Basic_Six"), - BI.i18nText("BI-Day_Ri")]; + BI.i18nText("BI-Date_Day")]; // Monday first, etc. Date._FD = 1; -// full month names +// full month namesdat Date._MN = [ BI.i18nText("BI-Basic_January"), BI.i18nText("BI-Basic_February"), diff --git a/src/case/segment/segment.js b/src/case/segment/segment.js index 3fc3fabea0..0979baaa09 100644 --- a/src/case/segment/segment.js +++ b/src/case/segment/segment.js @@ -19,15 +19,10 @@ BI.Segment = BI.inherit(BI.Widget, { this.buttonGroup = BI.createWidget({ element: this, type: "bi.button_group", - items: BI.map(o.items, function (i, item) { - return BI.extend({ - type: "bi.segment_button", - height: o.height - 2, - whiteSpace: o.whiteSpace - }, item, { - cls: (i === 0 ? "bi-border-left " : "") - + (item.cls || "") + " bi-border-top bi-border-right bi-border-bottom" - }); + items: BI.createItems(o.items, { + type: "bi.segment_button", + height: o.height - 2, + whiteSpace: o.whiteSpace }), layout: [ { diff --git a/src/core/proto/date.js b/src/core/proto/date.js index 8ccbe1e4d0..72df184662 100644 --- a/src/core/proto/date.js +++ b/src/core/proto/date.js @@ -21,7 +21,7 @@ Date._SDN = [BI.i18nText("BI-Date_Day"), // Monday first, etc. Date._FD = 1; -// full month names +// full month namesdat Date._MN = [ BI.i18nText("BI-Basic_January"), BI.i18nText("BI-Basic_February"), diff --git a/src/css/base/segment/segment.css b/src/css/base/segment/segment.css index 7de4338bca..8aaa25a96b 100644 --- a/src/css/base/segment/segment.css +++ b/src/css/base/segment/segment.css @@ -5,8 +5,13 @@ overflow: hidden; overflow-x: hidden; overflow-y: hidden; + background: #ffffff; + border-right: 1px solid #d4dadd; + border-top: 1px solid #d4dadd; + border-bottom: 1px solid #d4dadd; } .bi-segment > .first-element { + border-left: 1px solid #d4dadd; -webkit-border-radius: 6px 0px 0px 6px; -moz-border-radius: 6px 0px 0px 6px; border-radius: 6px 0px 0px 6px; @@ -16,3 +21,15 @@ -moz-border-radius: 0px 6px 6px 0px; border-radius: 0px 6px 6px 0px; } +.bi-theme-dark .bi-segment > .center-element { + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; + background: #242640; + border-right: 1px solid #525466; + border-top: 1px solid #525466; + border-bottom: 1px solid #525466; +} +.bi-theme-dark .bi-segment > .first-element { + border-left: 1px solid #242640; +} diff --git a/src/less/base/segment/segment.less b/src/less/base/segment/segment.less index 981a7426e2..bbf0df435c 100644 --- a/src/less/base/segment/segment.less +++ b/src/less/base/segment/segment.less @@ -3,11 +3,31 @@ .bi-segment{ & > .center-element{ .overflow-hidden(); + background: @color-bi-background-default; + border-right: 1px solid @color-bi-border-line; + border-top: 1px solid @color-bi-border-line; + border-bottom: 1px solid @color-bi-border-line; } & > .first-element{ + border-left: 1px solid @color-bi-border-line; .border-corner-radius(6px,0px,0px,6px) } & > .last-element{ .border-corner-radius(0px,6px,6px,0px) } +} + +.bi-theme-dark { + .bi-segment { + & > .center-element{ + .overflow-hidden(); + background: @color-bi-background-default-theme-dark; + border-right: 1px solid @color-bi-border-line-theme-dark; + border-top: 1px solid @color-bi-border-line-theme-dark; + border-bottom: 1px solid @color-bi-border-line-theme-dark; + } + & > .first-element{ + border-left: 1px solid @color-bi-background-default-theme-dark; + } + } } \ No newline at end of file