Browse Source

Pull request #3553: BI-126203 fix: 【6.0.10冒烟】设置周开始于周日,日期面板仍然以周一开始

Merge in VISUAL/fineui from ~DAILER/fineui:es6 to es6

* commit 'cffd97f4508f7b6fcc2add0e0f7ed94b457ed412':
  BI-126203 fix: 【6.0.10冒烟】设置周开始于周日,日期面板仍然以周一开始
es6
Dailer-刘荣歆 2 years ago
parent
commit
ff10d4e239
  1. 6
      packages/fineui/src/bundle.js
  2. 1
      packages/fineui/src/core/constant/index.js
  3. 42
      packages/fineui/src/core/constant/var.js
  4. 139
      packages/fineui/src/core/constant/writable.var.js

6
packages/fineui/src/bundle.js

@ -1,6 +1,7 @@
import * as fuiExport from "./index";
import * as injectFn from "@/core/5.inject";
import { _global } from "@/core/0.foundation";
import {_defineVarProperties} from "@/core/constant/writable.var";
_global.BI = _global.BI || {};
@ -14,7 +15,4 @@ Object.assign(_global, {
Object.assign(_global.BI, fuiExport, injectFn);
Object.defineProperty(_global.BI, "EVENT_BLUR", {
set: fuiExport.setEventBlur,
get: () => fuiExport.EVENT_BLUR
});
_defineVarProperties(_global.BI)

1
packages/fineui/src/core/constant/index.js

@ -1,2 +1,3 @@
export { Events } from "./events";
export * from "./var";
export * from "./writable.var"

42
packages/fineui/src/core/constant/var.js

@ -1,24 +1,15 @@
/**
* 常量
*/
import { isNumber } from "../2.base";
import { Cache } from "../structure/cache";
import { _global } from "../0.foundation";
export let EVENT_BLUR = _global.localStorage ? Cache.getItem("event.blur", {typeConversion: true, defaultValue: true}) : true;
export const setEventBlur = (v) => { EVENT_BLUR = v, Cache.setItem("event.blur", v) };
export const MAX = 0xfffffffffffffff;
export const MIN = -0xfffffffffffffff;
export const EVENT_RESPONSE_TIME = 200;
export const zIndex_layer = 1e5;
export const zIndex_popover = 1e6;
export const zIndex_popup = 1e7;
export const zIndex_masker = 1e8;
export const zIndex_tip = 1e9;
export const emptyStr = "";
export const pixUnit = "px";
export const pixRatio = 1;
export const empty = null;
export const Key = {
48: "0",
@ -138,37 +129,4 @@ export const VerticalAlign = {
Bottom: "bottom",
Stretch: "stretch",
};
export const StartOfWeek = 1;
export const BlankSplitChar = "\u200b \u200b";
// 一定返回最终的单位
export function pixFormat(pix, border) {
if (!isNumber(pix)) {
return pix;
}
if (pixUnit === "px") {
return (pix / pixRatio - (border || 0)) + pixUnit;
}
const length = pix / pixRatio + pixUnit;
if (border > 0) {
return `calc(${length} - ${`${border}px`})`;
}
return length;
}
export function toPix(pix, border) {
if (!isNumber(pix)) {
return pix;
}
if (pixUnit === "px") {
return pix - (border || 0) * pixRatio;
}
if (border > 0) {
return `calc(${pix / pixRatio + pixUnit} - ${`${border}px`})`;
}
return pix;
}
export function emptyFn() {}

139
packages/fineui/src/core/constant/writable.var.js

@ -0,0 +1,139 @@
/**
* 可写的常量
*/
import { isNumber } from "../2.base";
import { _global } from "../0.foundation";
import { Cache } from "../structure";
const PropertyDescriptors = {};
export let EVENT_RESPONSE_TIME = 200;
PropertyDescriptors["EVENT_RESPONSE_TIME"] = {
enumerable: true,
configurable: true,
get: function() {
return EVENT_RESPONSE_TIME;
},
set: function(newVal) {
EVENT_RESPONSE_TIME = newVal;
}
};
export let pixUnit = "px";
PropertyDescriptors["pixUnit"] = {
enumerable: true,
configurable: true,
get: function() {
return pixUnit;
},
set: function(newVal) {
pixUnit = newVal;
}
};
export let pixRatio = 1;
PropertyDescriptors["pixRatio"] = {
enumerable: true,
configurable: true,
get: function() {
return pixRatio;
},
set: function(newVal) {
pixRatio = newVal;
}
};
export let StartOfWeek = 1;
PropertyDescriptors["StartOfWeek"] = {
enumerable: true,
configurable: true,
get: function() {
return StartOfWeek;
},
set: function(newVal) {
StartOfWeek = newVal;
}
};
export let BlankSplitChar = "\u200b \u200b";
PropertyDescriptors["BlankSplitChar"] = {
enumerable: true,
configurable: true,
get: function() {
return BlankSplitChar;
},
set: function(newVal) {
BlankSplitChar = newVal;
}
};
// 一定返回最终的单位
export function pixFormat(pix, border) {
if (!isNumber(pix)) {
return pix;
}
if (pixUnit === "px") {
return (pix / pixRatio - (border || 0)) + pixUnit;
}
const length = pix / pixRatio + pixUnit;
if (border > 0) {
return `calc(${length} - ${`${border}px`})`;
}
return length;
}
PropertyDescriptors["pixFormat"] = {
enumerable: true,
configurable: true,
get: function() {
return pixFormat;
},
set: function(newVal) {
pixFormat = newVal;
}
};
export function toPix(pix, border) {
if (!isNumber(pix)) {
return pix;
}
if (pixUnit === "px") {
return pix - (border || 0) * pixRatio;
}
if (border > 0) {
return `calc(${pix / pixRatio + pixUnit} - ${`${border}px`})`;
}
return pix;
}
PropertyDescriptors["toPix"] = {
enumerable: true,
configurable: true,
get: function() {
return toPix;
},
set: function(newVal) {
toPix = newVal;
}
};
export let EVENT_BLUR = _global.localStorage ? Cache.getItem("event.blur", {typeConversion: true, defaultValue: true}) : true;
PropertyDescriptors["EVENT_BLUR"] = {
enumerable: true,
configurable: true,
get: function() {
return EVENT_BLUR;
},
set: function(newVal) {
EVENT_BLUR = newVal
Cache.setItem("event.blur", newVal)
}
};
export function _defineVarProperties(libName) {
Object.defineProperties(libName, PropertyDescriptors);
}
Loading…
Cancel
Save