diff --git a/packages/fineui/dist/font/iconfont.eot b/packages/fineui/dist/font/iconfont.eot index 0275f3939..edcf45591 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 804f99b88..6c914b991 100644 --- a/packages/fineui/dist/font/iconfont.svg +++ b/packages/fineui/dist/font/iconfont.svg @@ -14,6 +14,14 @@ /> + + + + + + + + @@ -50,7 +58,7 @@ - + @@ -60,7 +68,7 @@ - + @@ -1590,7 +1598,7 @@ - + diff --git a/packages/fineui/dist/font/iconfont.ttf b/packages/fineui/dist/font/iconfont.ttf index 891909403..daeb54097 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 2c1ac1df1..cfe29b66e 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 632aed459..089e49573 100644 Binary files a/packages/fineui/dist/font/iconfont.woff2 and b/packages/fineui/dist/font/iconfont.woff2 differ diff --git a/packages/fineui/package.json b/packages/fineui/package.json index 0bd7ddf2e..f467aa097 100644 --- a/packages/fineui/package.json +++ b/packages/fineui/package.json @@ -1,6 +1,6 @@ { "name": "@fui/core", - "version": "3.0.20230727164622", + "version": "3.0.20231204103846", "description": "fineui", "main": "dist/fineui.min.js", "module": "dist/lib/index.js", diff --git a/packages/fineui/src/core/2.base.js b/packages/fineui/src/core/2.base.js index 23fc68095..3bbf2d00d 100644 --- a/packages/fineui/src/core/2.base.js +++ b/packages/fineui/src/core/2.base.js @@ -912,7 +912,8 @@ export const delay = lodashFns.delay; export const defer = lodashFns.defer; export const wrap = lodashFns.wrap; -export const nextTick = (function () { + +export let nextTick = /*!PURE*/(function () { const callbacks = []; let pending = false; let timerFunc = void 0; @@ -971,7 +972,7 @@ export const nextTick = (function () { pending = true; timerFunc(); } - // $flow-disable-line + if (!cb && typeof Promise !== "undefined") { return new Promise((resolve, reject) => { _resolve = resolve; @@ -980,6 +981,10 @@ export const nextTick = (function () { }; })(); +export const setNextTick = (fn) => { + nextTick = fn; +} + // 数字相关方法 _.each(["random"], name => { lodashFns[name] = _apply(name); diff --git a/packages/fineui/src/core/constant/writable.var.js b/packages/fineui/src/core/constant/writable.var.js index 4d4f90484..d8a503c29 100644 --- a/packages/fineui/src/core/constant/writable.var.js +++ b/packages/fineui/src/core/constant/writable.var.js @@ -1,51 +1,50 @@ /** * 可写的常量 */ -import { isNumber } from "../2.base"; +import { isNumber, nextTick, setNextTick } from "../2.base"; import { _global } from "../0.foundation"; import { Cache } from "../structure"; +import { Element, setElement } from "../element/element"; import { setDom, DOM } from "../utils"; const PropertyDescriptors = {}; +export function _defineVarProperties(libName) { + Object.defineProperties(libName, PropertyDescriptors); +} + +function addDescriptor(key, options) { + options.enumerable = options.enumerable === undefined ? true : options.enumerable; + options.configurable = options.configurable === undefined ? true : options.configurable; + PropertyDescriptors[key] = options; +} + export let EVENT_RESPONSE_TIME = 200; export const setEventResponseTime = v => { EVENT_RESPONSE_TIME = v; }; -PropertyDescriptors["EVENT_RESPONSE_TIME"] = { - enumerable: true, - configurable: true, - get: function() { - return EVENT_RESPONSE_TIME; - }, +addDescriptor("EVENT_RESPONSE_TIME", { + get: () => EVENT_RESPONSE_TIME, set: setEventResponseTime, -}; +}); export let pixUnit = "px"; export const setPixUnit = v => { pixUnit = v; }; -PropertyDescriptors["pixUnit"] = { - enumerable: true, - configurable: true, - get: function() { - return pixUnit; - }, +addDescriptor("pixUnit", { + get: () => pixUnit, set: setPixUnit, -}; +}); export let pixRatio = 1; export const setPixRatio = v => { pixRatio = v; }; -PropertyDescriptors["pixRatio"] = { - enumerable: true, - configurable: true, - get: function() { - return pixRatio; - }, +addDescriptor("pixRatio", { + get: () => pixRatio, set: setPixRatio, -}; +}); export let StartOfWeek = 1; export const setStartOfWeek = v => { @@ -55,27 +54,19 @@ export const setStartOfWeek = v => { } StartOfWeek = v; }; -PropertyDescriptors["StartOfWeek"] = { - enumerable: true, - configurable: true, - get: function() { - return StartOfWeek; - }, +addDescriptor("StartOfWeek", { + get: () => StartOfWeek, set: setStartOfWeek, -}; +}); export let BlankSplitChar = "\u200b \u200b"; export const setBlankSplitChar = v => { BlankSplitChar = v; }; -PropertyDescriptors["BlankSplitChar"] = { - enumerable: true, - configurable: true, - get: function() { - return BlankSplitChar; - }, +addDescriptor("BlankSplitChar", { + get: () => BlankSplitChar, set: setBlankSplitChar, -}; +}); // 一定返回最终的单位 export let pixFormat = (pix, border) => { @@ -95,14 +86,10 @@ export let pixFormat = (pix, border) => { export const setPixFormat = v => { pixFormat = v; }; -PropertyDescriptors["pixFormat"] = { - enumerable: true, - configurable: true, - get: function() { - return pixFormat; - }, +addDescriptor("pixFormat", { + get: () => pixFormat, set: setPixFormat, -}; +}); export let toPix = (pix, border) => { if (!isNumber(pix)) { @@ -120,14 +107,10 @@ export let toPix = (pix, border) => { export let setToPix = v => { toPix = v; }; -PropertyDescriptors["toPix"] = { - enumerable: true, - configurable: true, - get: function() { - return toPix; - }, +addDescriptor("toPix", { + get: () => toPix, set: setToPix, -}; +}); const getCacheItem = key => { Cache.getItem(key, { typeConversion: true, defaultValue: true }); @@ -137,24 +120,22 @@ export const setEventBlur = v => { EVENT_BLUR = v; Cache.setItem("event.blur", v); }; -PropertyDescriptors["EVENT_BLUR"] = { - enumerable: true, - configurable: true, - get: function() { - return EVENT_BLUR; - }, +addDescriptor("EVENT_BLUR", { + get: () => EVENT_BLUR, set: setEventBlur, -}; +}); + +addDescriptor("Element", { + get: () => Element, + set: setElement, +}); -PropertyDescriptors["DOM"] = { - enumerable: true, - configurable: true, - get: function() { - return DOM; - }, +addDescriptor("DOM", { + get: () => DOM, set: setDom, -}; +}); -export function _defineVarProperties(libName) { - Object.defineProperties(libName, PropertyDescriptors); -} +addDescriptor("nextTick", { + get: () => nextTick, + set: setNextTick, +}); \ No newline at end of file diff --git a/packages/fineui/src/core/element/element.js b/packages/fineui/src/core/element/element.js index 9b08c0762..111605ad3 100644 --- a/packages/fineui/src/core/element/element.js +++ b/packages/fineui/src/core/element/element.js @@ -1,76 +1,78 @@ import { registFunction } from "./plugins"; import { isWidget, isString } from "../2.base"; -export function Element(widget, attribs) { - this.l = this.r = this.t = this.b = 0; // 边框 - this.marginLeft = this.marginRight = this.marginTop = this.marginBottom = 0; // 间距 - this.position = {}; - this.classMap = {}; - this.classList = []; - this.children = []; - this.attribs = attribs || {}; - this.styles = {}; - // 兼容处理 - this["0"] = this; - this.style = {}; - if (!widget) { - this.nodeName = "body"; - this.position.x = 0; - this.position.y = 0; - this.attribs.id = "body"; - } else if (isWidget(widget)) { - this.widget = widget; - this.nodeName = widget.options.tagName; - this.textBaseLine = widget.options.textBaseLine; - } else if (isString(widget)) { - this.nodeName = widget; +export let Element = class { + constructor(widget, attribs) { + this.l = this.r = this.t = this.b = 0; // 边框 + this.marginLeft = this.marginRight = this.marginTop = this.marginBottom = 0; // 间距 + this.position = {}; + this.classMap = {}; + this.classList = []; + this.children = []; + this.attribs = attribs || {}; + this.styles = {}; + // 兼容处理 + this["0"] = this; + this.style = {}; + if (!widget) { + this.nodeName = "body"; + this.position.x = 0; + this.position.y = 0; + this.attribs.id = "body"; + } else if (isWidget(widget)) { + this.widget = widget; + this.nodeName = widget.options.tagName; + this.textBaseLine = widget.options.textBaseLine; + } else if (isString(widget)) { + this.nodeName = widget; + } } -} -initElement(Element); -registFunction(Element); + appendChild(child) { + child.parent = this; + if (this.children.push(child) !== 1) { + const sibling = this.children[this.children.length - 2]; + sibling.next = child; + child.prev = sibling; + child.next = null; + } + } + + append(child) { + child.parent = this; + if (this.children.push(child) !== 1) { + const sibling = this.children[this.children.length - 2]; + sibling.next = child; + child.prev = sibling; + child.next = null; + } + } -function initElement(element) { - element.prototype = { - appendChild(child) { - child.parent = this; - if (this.children.push(child) !== 1) { - const sibling = this.children[this.children.length - 2]; - sibling.next = child; - child.prev = sibling; - child.next = null; - } - }, - append(child) { - child.parent = this; - if (this.children.push(child) !== 1) { - const sibling = this.children[this.children.length - 2]; - sibling.next = child; - child.prev = sibling; - child.next = null; - } - }, - getParent() { - return this.parent; - }, - getSiblings() { - const parent = this.getParent(); - - return parent ? parent.getChildren() : [this]; - }, - getChildren() { - return this.children; - }, + getParent() { + return this.parent; + } - getBounds() { - return {}; - }, + getSiblings() { + const parent = this.getParent(); - width() { + return parent ? parent.getChildren() : [this]; + } - }, - height() { + getChildren() { + return this.children; + } + + getBounds() { + return {}; + } + + width() {} + + height() {} +} + +registFunction(Element); - }, - }; +export function setElement(element) { + Element = element; } diff --git a/packages/fineui/src/fix/fix.js b/packages/fineui/src/fix/fix.js index ddc37b044..0572c66d6 100644 --- a/packages/fineui/src/fix/fix.js +++ b/packages/fineui/src/fix/fix.js @@ -205,7 +205,7 @@ const nextTick = (function () { pending = true; timerFunc(); } - // $flow-disable-line + if (!cb && typeof Promise !== "undefined") { return new Promise((resolve, reject) => { _resolve = resolve; diff --git a/packages/fineui/src/less/base/single/input/radio.less b/packages/fineui/src/less/base/single/input/radio.less index a1aaa4071..52e569874 100644 --- a/packages/fineui/src/less/base/single/input/radio.less +++ b/packages/fineui/src/less/base/single/input/radio.less @@ -15,6 +15,9 @@ border-color: @color-bi-border-hover-active-radio; } } + .bi-radio-icon { + background-color: @color-bi-background-active-radio-content; + } &.active { & .radio-content, &.radio-content { border-color: @color-bi-border-hover-active-radio; diff --git a/packages/fineui/src/widget/intervalslider/intervalslider.js b/packages/fineui/src/widget/intervalslider/intervalslider.js index f3a1c4aff..63c1af7b8 100644 --- a/packages/fineui/src/widget/intervalslider/intervalslider.js +++ b/packages/fineui/src/widget/intervalslider/intervalslider.js @@ -59,6 +59,10 @@ export class IntervalSlider extends Single { this.populate(); } + getConstant() { + return CONSTANTS; + } + render() { const o = this.options; this.enable = false; @@ -85,7 +89,7 @@ export class IntervalSlider extends Single { text: unit, allowBlank: false, textAlign: lAlign, - width: BI.isNull(editorWidth) ? BI.toPix(CONSTANTS.EDITOR_WIDTH, 2) : BI.toPix(editorWidth, 2), + width: isNull(editorWidth) ? toPix(CONSTANTS.EDITOR_WIDTH, 2) : toPix(editorWidth, 2), height: toPix(CONSTANTS.EDITOR_HEIGHT, 2), validationChecker: v => this._checkValidation(v), }); @@ -115,7 +119,7 @@ export class IntervalSlider extends Single { text: unit, allowBlank: false, textAlign: rAlign, - width: BI.isNull(editorWidth) ? BI.toPix(CONSTANTS.EDITOR_WIDTH, 2) : BI.toPix(editorWidth, 2), + width: isNull(editorWidth) ? toPix(CONSTANTS.EDITOR_WIDTH, 2) : toPix(editorWidth, 2), height: toPix(CONSTANTS.EDITOR_HEIGHT, 2), validationChecker: v => this._checkValidation(v), }); diff --git a/packages/fineui/src/widget/singleslider/button/editor.sign.text.js b/packages/fineui/src/widget/singleslider/button/editor.sign.text.js index da7c44cb9..c03ba34bc 100644 --- a/packages/fineui/src/widget/singleslider/button/editor.sign.text.js +++ b/packages/fineui/src/widget/singleslider/button/editor.sign.text.js @@ -106,7 +106,7 @@ export class SignTextEditor extends Widget { _checkText() { const o = this.options; nextTick( - bind(() => { + () => { if (this.editor.getValue() === "") { this.text.setValue(o.watermark || ""); this.text.element.addClass("bi-water-mark"); @@ -116,7 +116,7 @@ export class SignTextEditor extends Widget { this.text.setValue(v); this.text.element.removeClass("bi-water-mark"); } - }, this) + } ); }