diff --git a/packages/fineui/dist/font/iconfont.eot b/packages/fineui/dist/font/iconfont.eot
index d66b0d005..2bcb77c86 100644
Binary files a/packages/fineui/dist/font/iconfont.eot and b/packages/fineui/dist/font/iconfont.eot differ
diff --git a/packages/fineui/dist/font/iconfont.svg b/packages/fineui/dist/font/iconfont.svg
index 2d01cfe1c..2fcab0a04 100644
--- a/packages/fineui/dist/font/iconfont.svg
+++ b/packages/fineui/dist/font/iconfont.svg
@@ -14,6 +14,90 @@
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -76,7 +160,7 @@
-
+
diff --git a/packages/fineui/dist/font/iconfont.ttf b/packages/fineui/dist/font/iconfont.ttf
index 1960af3b7..c0dd73e45 100644
Binary files a/packages/fineui/dist/font/iconfont.ttf and b/packages/fineui/dist/font/iconfont.ttf differ
diff --git a/packages/fineui/dist/font/iconfont.woff b/packages/fineui/dist/font/iconfont.woff
index 760361a6b..be66647c1 100644
Binary files a/packages/fineui/dist/font/iconfont.woff and b/packages/fineui/dist/font/iconfont.woff differ
diff --git a/packages/fineui/dist/font/iconfont.woff2 b/packages/fineui/dist/font/iconfont.woff2
index f8525092f..a31812d97 100644
Binary files a/packages/fineui/dist/font/iconfont.woff2 and b/packages/fineui/dist/font/iconfont.woff2 differ
diff --git a/packages/fineui/src/core/utils/dom.js b/packages/fineui/src/core/utils/dom.js
index 275aa3adf..a917a4de6 100644
--- a/packages/fineui/src/core/utils/dom.js
+++ b/packages/fineui/src/core/utils/dom.js
@@ -2,7 +2,7 @@
* 对DOM操作的通用函数
*/
import $ from "jquery";
-import { each, isEmpty, isNotNull, isNull } from "../2.base";
+import { each, isEmpty, isNotEmptyObject } from "../2.base";
import { Widget } from "../4.widget";
import { isIE } from "./../platform";
@@ -102,23 +102,37 @@ export function getTextSizeHeight(text, fontSize = 12) {
}
// 获取滚动条的宽度,页面display: none时候获取到的为0
-let _scrollWidth = null;
+const _scrollWidthMap = {};
export function getScrollWidth(css) {
- if (isNull(_scrollWidth) || isNotNull(css) || _scrollWidth === 0) {
- const ul = Widget._renderEngine.createElement("
").width(50).height(50)
+ /**
+ * 指定 scrollbar-width: none;
+ * 支持的浏览器版本结果肯定为 0,无需重复计算
+ */
+ const supportScrollWidth = 'scrollbarWidth' in document.documentElement.style;
+ const hasNoneScrollWidth =
+ supportScrollWidth && isNotEmptyObject(css) && [css["scrollbar-width"], css["scrollbarWidth"]].includes("none");
+ const key = JSON.stringify(css) || "default";
+
+ if (hasNoneScrollWidth) {
+ return 0;
+ } else if (!_scrollWidthMap[key]) {
+ const ul = Widget._renderEngine
+ .createElement("
")
+ .width(50)
+ .height(50)
.css({
position: "absolute",
top: "-9999px",
overflow: "scroll",
- ...css
+ ...css,
})
.appendTo("body");
- _scrollWidth = ul[0].offsetWidth - ul[0].clientWidth;
+ _scrollWidthMap[key] = ul[0].offsetWidth - ul[0].clientWidth;
ul.destroy();
}
- return _scrollWidth;
+ return _scrollWidthMap[key];
}
export function getImage(param, fillStyle, backgroundColor) {
diff --git a/packages/fineui/src/widget/dynamicdate/dynamicdate.card.js b/packages/fineui/src/widget/dynamicdate/dynamicdate.card.js
index 9ea322d12..c2521bbf4 100644
--- a/packages/fineui/src/widget/dynamicdate/dynamicdate.card.js
+++ b/packages/fineui/src/widget/dynamicdate/dynamicdate.card.js
@@ -45,6 +45,7 @@ export class DynamicDateCard extends Widget {
props = {
baseCls: "bi-dynamic-date-card",
+ supportWorkDay: true,
};
render() {
@@ -162,6 +163,7 @@ export class DynamicDateCard extends Widget {
logic: {
dynamic: true,
},
+ invisible: !this.options.supportWorkDay,
text: i18nText("BI-Basic_Work_Day"),
value: DynamicDateCard.TYPE.WORK_DAY,
listeners: [
diff --git a/packages/fineui/src/widget/dynamicdate/dynamicdate.combo.js b/packages/fineui/src/widget/dynamicdate/dynamicdate.combo.js
index 27e0caae0..d8153894c 100644
--- a/packages/fineui/src/widget/dynamicdate/dynamicdate.combo.js
+++ b/packages/fineui/src/widget/dynamicdate/dynamicdate.combo.js
@@ -28,7 +28,7 @@ export class DynamicDateCombo extends Single {
static EVENT_ERROR = "EVENT_ERROR";
static EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
static EVENT_BEFORE_YEAR_MONTH_POPUPVIEW = "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW";
-
+
static Static = 1;
static Dynamic = 2;
@@ -51,6 +51,7 @@ export class DynamicDateCombo extends Single {
attributes: {
tabIndex: -1,
},
+ supportWorkDay: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isPreview: false, // 是否是预览状态
@@ -204,6 +205,7 @@ export class DynamicDateCombo extends Single {
isPreview: opts.isPreview,
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic,
+ supportWorkDay: opts.supportWorkDay,
behaviors: opts.behaviors,
min: opts.minDate,
max: opts.maxDate,
diff --git a/packages/fineui/src/widget/dynamicdate/dynamicdate.popup.js b/packages/fineui/src/widget/dynamicdate/dynamicdate.popup.js
index c4eafa71e..f647452b0 100644
--- a/packages/fineui/src/widget/dynamicdate/dynamicdate.popup.js
+++ b/packages/fineui/src/widget/dynamicdate/dynamicdate.popup.js
@@ -34,6 +34,7 @@ export class DynamicDatePopup extends Widget {
baseCls: "bi-dynamic-date-popup",
width: 272,
supportDynamic: true,
+ supportWorkDay: true,
isPreview: false, // 是否是预览状态
};
@@ -164,6 +165,7 @@ export class DynamicDatePopup extends Widget {
return {
type: DynamicDateCard.xtype,
cls: "dynamic-date-pane",
+ supportWorkDay: this.options.supportWorkDay,
listeners: [
{
eventName: "EVENT_CHANGE",
diff --git a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js
index 3be733631..b89e8cbb8 100644
--- a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js
+++ b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js
@@ -39,6 +39,7 @@ export class DynamicDateTimeCombo extends Single {
format: "",
allowEdit: true,
supportDynamic: true,
+ supportWorkDay: true,
attributes: {
tabIndex: -1,
},
@@ -212,6 +213,7 @@ export class DynamicDateTimeCombo extends Single {
timeSelectTypes: opts.timeSelectTypes,
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic,
+ supportWorkDay: opts.supportWorkDay,
behaviors: opts.behaviors,
min: opts.minDate,
max: opts.maxDate,
diff --git a/packages/fineui/src/widget/timeinterval/dateinterval.js b/packages/fineui/src/widget/timeinterval/dateinterval.js
index 180785b39..5f1aaef77 100644
--- a/packages/fineui/src/widget/timeinterval/dateinterval.js
+++ b/packages/fineui/src/widget/timeinterval/dateinterval.js
@@ -43,6 +43,7 @@ export class DateInterval extends Single {
height: 24,
format: "",
supportDynamic: true,
+ supportWorkDay: true,
simple: false,
});
}
@@ -93,6 +94,7 @@ export class DateInterval extends Single {
popup: o.popup,
isPreview: o.isPreview,
supportDynamic: o.supportDynamic,
+ supportWorkDay: o.supportWorkDay,
minDate: o.minDate,
maxDate: o.maxDate,
simple: o.simple,
diff --git a/packages/fineui/src/widget/timeinterval/timeinterval.js b/packages/fineui/src/widget/timeinterval/timeinterval.js
index f84971e69..11808d69c 100644
--- a/packages/fineui/src/widget/timeinterval/timeinterval.js
+++ b/packages/fineui/src/widget/timeinterval/timeinterval.js
@@ -31,6 +31,7 @@ export class TimeInterval extends Single {
static EVENT_CHANGE = "EVENT_CHANGE";
static EVENT_BEFORE_START_POPUPVIEW = "EVENT_BEFORE_START_POPUPVIEW";
static EVENT_BEFORE_END_POPUPVIEW = "EVENT_BEFORE_END_POPUPVIEW";
+ static EVENT_BEFORE_YEAR_MONTH_POPUPVIEW = "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW";
_defaultConfig() {
const conf = super._defaultConfig(...arguments);
@@ -42,6 +43,7 @@ export class TimeInterval extends Single {
height: 24,
format: "",
supportDynamic: true,
+ supportWorkDay: true,
});
}
@@ -91,6 +93,7 @@ export class TimeInterval extends Single {
popup: o.popup,
isPreview: o.isPreview,
timeSelectTypes: o.timeSelectTypes,
+ supportWorkDay: o.supportWorkDay,
simple: o.simple,
supportDynamic: o.supportDynamic,
minDate: o.minDate,
@@ -100,6 +103,14 @@ export class TimeInterval extends Single {
watermark,
value: v,
height: o.height,
+ listeners: [
+ {
+ eventName: DynamicDateTimeCombo.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW,
+ action: () => {
+ this.fireEvent(TimeInterval.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW);
+ },
+ },
+ ],
});
combo.on(DynamicDateTimeCombo.EVENT_ERROR, () => {
this._clearTitle();
diff --git a/packages/fineui/typescript/widget/dynamicdate/dynamicdate.combo.ts b/packages/fineui/typescript/widget/dynamicdate/dynamicdate.combo.ts
index a4f82a741..52fb6c560 100644
--- a/packages/fineui/typescript/widget/dynamicdate/dynamicdate.combo.ts
+++ b/packages/fineui/typescript/widget/dynamicdate/dynamicdate.combo.ts
@@ -22,6 +22,7 @@ export declare class DynamicDateCombo extends Single {
format?: string;
allowEdit?: boolean;
supportDynamic?: boolean;
+ supportWorkDay?: boolean;
attributes?: {
tabIndex?: number;
};
diff --git a/packages/fineui/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts b/packages/fineui/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts
index 7ef1abc68..63f8b0845 100644
--- a/packages/fineui/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts
+++ b/packages/fineui/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts
@@ -20,6 +20,7 @@ export declare class DynamicDateTimeCombo extends Single {
format?: string;
allowEdit?: boolean;
supportDynamic?: boolean;
+ supportWorkDay?: boolean;
attributes?: {
tabIndex?: number;
};
diff --git a/packages/fineui/typescript/widget/timeinterval/dateinterval.ts b/packages/fineui/typescript/widget/timeinterval/dateinterval.ts
index 27ca6f787..ec4932452 100644
--- a/packages/fineui/typescript/widget/timeinterval/dateinterval.ts
+++ b/packages/fineui/typescript/widget/timeinterval/dateinterval.ts
@@ -14,6 +14,7 @@ export declare class DateInterval extends Single {
minDate?: string;
maxDate?: string;
supportDynamic?: boolean;
+ supportWorkDay?: boolean;
watermark?: string;
container?: string;
popup?: any;
diff --git a/packages/fineui/typescript/widget/timeinterval/timeinterval.ts b/packages/fineui/typescript/widget/timeinterval/timeinterval.ts
index e7a72f9af..4b8d0f1f4 100644
--- a/packages/fineui/typescript/widget/timeinterval/timeinterval.ts
+++ b/packages/fineui/typescript/widget/timeinterval/timeinterval.ts
@@ -8,11 +8,13 @@ export declare class TimeInterval extends Single {
static EVENT_ERROR: string;
static EVENT_BEFORE_START_POPUPVIEW: string;
static EVENT_BEFORE_END_POPUPVIEW: string;
+ static EVENT_BEFORE_YEAR_MONTH_POPUPVIEW: string;
props: {
minDate?: string;
maxDate?: string;
supportDynamic?: boolean;
+ supportWorkDay?: boolean;
watermark?: string;
simple?: boolean;
container?: string;