From 1392f049d6a35e957236ae5e22428dfd500021ec Mon Sep 17 00:00:00 2001 From: Treecat Date: Mon, 23 Oct 2023 11:30:26 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E6=97=A0jria=20fix:group.virtual?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/base/combination/group.virtual.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fineui/src/base/combination/group.virtual.js b/packages/fineui/src/base/combination/group.virtual.js index b7e8ce938..44e45e573 100644 --- a/packages/fineui/src/base/combination/group.virtual.js +++ b/packages/fineui/src/base/combination/group.virtual.js @@ -68,7 +68,7 @@ export class VirtualGroup extends Widget { el: extend( { ref: _ref => { - if (isKey(btMap[el.value])) { + if (isKey(el.value)) { btMap[el.value] = _ref; } }, From 4f0a423f240c9c3b07126ed783dc0c24ad70884b Mon Sep 17 00:00:00 2001 From: dailer Date: Thu, 26 Oct 2023 15:16:07 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E6=97=A0JIRA=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=BC=82=E6=AD=A5=E5=8A=A0=E8=BD=BD=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/platform/web/load.js | 19 ++++++++++++++----- packages/fineui/typescript/core/base.ts | 2 +- .../typescript/core/platform/web/load.ts | 2 ++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/packages/fineui/src/core/platform/web/load.js b/packages/fineui/src/core/platform/web/load.js index 6dd203ea1..8a43934dd 100644 --- a/packages/fineui/src/core/platform/web/load.js +++ b/packages/fineui/src/core/platform/web/load.js @@ -81,25 +81,34 @@ export function syncLoadScript(uri) { return false; } + +const promises = {}; + /** * 默认的异步加载javascript方法 * @param uri * @returns {Promise|Promise} */ export function loadScript(uri) { - if (_LOADED[uri]) { - return Promise.resolve(true); + if (promises[uri]) { + return Promise.all(promises[uri]); } - return new Promise(resolve => { + + const promise = new Promise(resolve => { const script = document.createElement("script"); script.type = "application/javascript"; - script.src = uri; script.onload = function() { + _LOADED[uri] = true; resolve(true); }; + script.src = uri; document.head.appendChild(script); - _LOADED[uri] = true; }); + + promises[uri] ??= []; + promises[uri].push(promise); + + return Promise.all(promises[uri]); } /** diff --git a/packages/fineui/typescript/core/base.ts b/packages/fineui/typescript/core/base.ts index abdd7ba80..5b4a86af3 100644 --- a/packages/fineui/typescript/core/base.ts +++ b/packages/fineui/typescript/core/base.ts @@ -266,7 +266,7 @@ export declare function isNull(obj: any): obj is (undefined | null); export declare function isEmptyArray(arr: T[] | U): arr is T[] & { length: 0 }; -export declare function isNotEmptyArray(arr: T[] | U): arr is [T, ...T[]]; +export declare function isNotEmptyArray(arr: T[]): arr is NonNullable[]; export declare function isEmptyObject(obj: any): boolean; diff --git a/packages/fineui/typescript/core/platform/web/load.ts b/packages/fineui/typescript/core/platform/web/load.ts index 144150ff5..cef294db8 100644 --- a/packages/fineui/typescript/core/platform/web/load.ts +++ b/packages/fineui/typescript/core/platform/web/load.ts @@ -1 +1,3 @@ export declare function $import(src: string, ext?: string, must?: boolean): void + +export declare function loadResource(opt: { src: string, extension?: string, async?: boolean }): Promise From a7ebd6ec1b2a8c53f3b85aa8f183cfc5fc154139 Mon Sep 17 00:00:00 2001 From: Treecat Date: Fri, 27 Oct 2023 11:32:26 +0800 Subject: [PATCH 03/14] =?UTF-8?q?KERNEL-15856=20fix:=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E8=B0=83=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/constant/writable.var.js | 10 ++++++++++ packages/fineui/src/core/utils/index.js | 6 +++++- packages/fineui/src/without_Jquery_Polyfill.js | 14 -------------- packages/fineui/webpack/attachments.js | 3 +-- 4 files changed, 16 insertions(+), 17 deletions(-) delete mode 100644 packages/fineui/src/without_Jquery_Polyfill.js diff --git a/packages/fineui/src/core/constant/writable.var.js b/packages/fineui/src/core/constant/writable.var.js index 45e048502..4d4f90484 100644 --- a/packages/fineui/src/core/constant/writable.var.js +++ b/packages/fineui/src/core/constant/writable.var.js @@ -4,6 +4,7 @@ import { isNumber } from "../2.base"; import { _global } from "../0.foundation"; import { Cache } from "../structure"; +import { setDom, DOM } from "../utils"; const PropertyDescriptors = {}; @@ -145,6 +146,15 @@ PropertyDescriptors["EVENT_BLUR"] = { set: setEventBlur, }; +PropertyDescriptors["DOM"] = { + enumerable: true, + configurable: true, + get: function() { + return DOM; + }, + set: setDom, +}; + export function _defineVarProperties(libName) { Object.defineProperties(libName, PropertyDescriptors); } diff --git a/packages/fineui/src/core/utils/index.js b/packages/fineui/src/core/utils/index.js index d01e65bbc..0c7c22f22 100644 --- a/packages/fineui/src/core/utils/index.js +++ b/packages/fineui/src/core/utils/index.js @@ -6,7 +6,11 @@ import * as platformDom from "./dom"; import * as colorDom from "./color"; -export const DOM = { +export let DOM = { ...platformDom, ...colorDom, }; + +export function setDom(dom) { + DOM = dom; +} diff --git a/packages/fineui/src/without_Jquery_Polyfill.js b/packages/fineui/src/without_Jquery_Polyfill.js deleted file mode 100644 index 369bc3a7f..000000000 --- a/packages/fineui/src/without_Jquery_Polyfill.js +++ /dev/null @@ -1,14 +0,0 @@ -export * from './worker.js'; - -// "!src/base/single/input/file.js", -// "!src/case/ztree/**/*.js", -import * as _case from './case'; -import * as _widget from './widget'; -import { _global } from "@/core/0.foundation"; - -const fuiExport = { - ..._case, - ..._widget -}; - -Object.assign(_global.BI, fuiExport); diff --git a/packages/fineui/webpack/attachments.js b/packages/fineui/webpack/attachments.js index afe2b8a04..882ada3b9 100644 --- a/packages/fineui/webpack/attachments.js +++ b/packages/fineui/webpack/attachments.js @@ -19,8 +19,7 @@ const basicAttachmentMap = { "src/less/component/**/*.less" ]), js_bundle: sync(["src/bundle.js"]), - js_worker: sync(["src/worker.js"]), - js_without_Jquery_polyfill: sync(["src/without_Jquery_Polyfill.js"]), + js_worker: sync(["src/worker.js"]) }; const bundleCss = uniq([].concat(basicAttachmentMap.less, basicAttachmentMap.ui, sync(["public/less/app.less", "public/less/**/*.less"]))); From d7b26c22e1146d796927231570cbe0e1c818f0a6 Mon Sep 17 00:00:00 2001 From: dailer Date: Mon, 30 Oct 2023 09:52:47 +0800 Subject: [PATCH 04/14] update --- packages/fineui/src/core/platform/web/load.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fineui/src/core/platform/web/load.js b/packages/fineui/src/core/platform/web/load.js index 8a43934dd..d010bdb54 100644 --- a/packages/fineui/src/core/platform/web/load.js +++ b/packages/fineui/src/core/platform/web/load.js @@ -105,7 +105,7 @@ export function loadScript(uri) { document.head.appendChild(script); }); - promises[uri] ??= []; + promises[uri] = []; promises[uri].push(promise); return Promise.all(promises[uri]); From 8e67cef3f787f72c8ab172ad96c95c8659493119 Mon Sep 17 00:00:00 2001 From: dailer Date: Tue, 31 Oct 2023 16:15:03 +0800 Subject: [PATCH 05/14] =?UTF-8?q?BI-129591=20feat:=20HexColorChooserPopup?= =?UTF-8?q?=20=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AE=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=92=8C=E9=80=8F=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../colorchooser/colorchooser.popup.hex.js | 2 + .../colorpicker/editor.colorpicker.hex.js | 47 +++++++++++-------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js b/packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js index 0a9f9a24c..afde53a6a 100644 --- a/packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js +++ b/packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js @@ -69,6 +69,8 @@ export class HexColorChooserPopup extends Widget { : HexColorPickerEditor.xtype, value: o.value, height: o.simple ? 36 : 70, + transparent: o.transparent, + auto: o.auto, listeners: [ { eventName: ColorPickerEditor.EVENT_CHANGE, diff --git a/packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.hex.js b/packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.hex.js index 25ffb0a2a..02ea9293c 100644 --- a/packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.hex.js +++ b/packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.hex.js @@ -41,6 +41,8 @@ export class HexColorPickerEditor extends Widget { props = { baseCls: "bi-color-picker-editor bi-hex-color-picker-editor", height: 30, + transparent: true, + auto: true, }; render() { @@ -95,23 +97,27 @@ export class HexColorPickerEditor extends Widget { height: 24, items: [ { - type: ColorChooserShowButton.xtype, - cls: "trans-color-icon", - height: 22, - title: i18nText("BI-Transparent_Color"), - text: i18nText("BI-Transparent_Color"), - listeners: [ - { - eventName: ColorChooserShowButton.EVENT_CHANGE, - action: () => { - this.setValue("transparent"); - this.fireEvent(ColorPickerEditor.EVENT_CHANGE); - }, - } - ], - ref: _ref => { - this.transparent = _ref; + el: { + type: ColorChooserShowButton.xtype, + cls: "trans-color-icon", + height: 22, + title: i18nText("BI-Transparent_Color"), + text: i18nText("BI-Transparent_Color"), + invisible: !this.options.transparent, + listeners: [ + { + eventName: ColorChooserShowButton.EVENT_CHANGE, + action: () => { + this.setValue("transparent"); + this.fireEvent(ColorPickerEditor.EVENT_CHANGE); + }, + } + ], + ref: _ref => { + this.transparent = _ref; + }, }, + rgap: this.options.auto ? 5 : 0, }, { el: { @@ -120,6 +126,7 @@ export class HexColorPickerEditor extends Widget { height: 22, title: i18nText("BI-Basic_Auto"), text: i18nText("BI-Basic_Auto"), + invisible: !this.options.auto, listeners: [ { eventName: ColorChooserShowButton.EVENT_CHANGE, @@ -133,7 +140,7 @@ export class HexColorPickerEditor extends Widget { this.none = _ref; }, }, - lgap: 10, + lgap: this.options.transparent ? 5 : 0, } ], }, @@ -176,6 +183,9 @@ export class HexColorPickerEditor extends Widget { { eventName: "EVENT_CHANGE", action: () => { + if (isEmptyString(this.hexEditor.getValue())) { + return; + } this._checkHexEditor(); if ( checker(this.storeValue.r) && @@ -261,9 +271,6 @@ export class HexColorPickerEditor extends Widget { } _checkHexEditor() { - if (isEmptyString(this.hexEditor.getValue())) { - this.hexEditor.setValue("000000"); - } const json = DOM.rgb2json(DOM.hex2rgb(`#${this.hexEditor.getValue()}`)); this.storeValue = { r: json.r || 0, From d453ab34e46babd4f596b7c8dc02491c0fdc8aeb Mon Sep 17 00:00:00 2001 From: jimmychai Date: Wed, 1 Nov 2023 16:19:09 +0800 Subject: [PATCH 06/14] =?UTF-8?q?BI-125208=20feat:=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E7=B1=BB=E5=9E=8B=E7=9A=84=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E7=AE=97=E5=AD=90=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/widget/dynamicdatetime/dynamicdatetime.combo.js | 1 + .../src/widget/dynamicdatetime/dynamicdatetime.popup.js | 1 + .../widget/dynamicdatetime/dynamicdatetime.timeselect.js | 9 ++++++++- packages/fineui/src/widget/numbereditor/number.editor.js | 4 ++-- packages/fineui/src/widget/timeinterval/timeinterval.js | 1 + packages/fineui/src/widget/yearinterval/yearinterval.js | 2 ++ .../widget/yearquarterinterval/yearquarterinterval.js | 2 ++ 7 files changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js index 3ac88d788..0fc27ae09 100644 --- a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js +++ b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js @@ -207,6 +207,7 @@ export class DynamicDateTimeCombo extends Single { popup: { el: { type: DynamicDateTimePopup.xtype, + timeSelectTypes: opts.timeSelectTypes, width: opts.isNeedAdjustWidth ? opts.width : undefined, supportDynamic: opts.supportDynamic, behaviors: opts.behaviors, diff --git a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.popup.js b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.popup.js index 6668ca462..33678a041 100644 --- a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.popup.js +++ b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.popup.js @@ -204,6 +204,7 @@ export class DynamicDateTimePopup extends Widget { { el: { type: DynamicDateTimeSelect.xtype, + timeSelectTypes: o.timeSelectTypes, cls: "bi-split-top", ref: _ref => { this.timeSelect = _ref; diff --git a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js index 45355275b..32ef8f9a0 100644 --- a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js +++ b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js @@ -29,11 +29,12 @@ export class DynamicDateTimeSelect extends Widget { return { baseCls: "bi-date-time-select", editorHeight: SIZE_CONSANTS.LIST_ITEM_HEIGHT, + timeSelectTypes: [DynamicDateTimeSelect.HOUR, DynamicDateTimeSelect.MINUTE, DynamicDateTimeSelect.SECOND], }; } render() { - const { editorHeight } = this.options; + const { editorHeight, timeSelectTypes } = this.options; return { type: CenterAdaptLayout.xtype, @@ -44,6 +45,8 @@ export class DynamicDateTimeSelect extends Widget { { el: { type: NumberEditor.xtype, + disabled: !timeSelectTypes.includes(DynamicDateTimeSelect.HOUR), + warningTitle: i18nText("BI-Basic_Do_Not_Support_Modification"), ref: _ref => { this.hour = _ref; }, @@ -89,6 +92,8 @@ export class DynamicDateTimeSelect extends Widget { }, { type: NumberEditor.xtype, + disabled: !timeSelectTypes.includes(DynamicDateTimeSelect.MINUTE), + warningTitle: i18nText("BI-Basic_Do_Not_Support_Modification"), ref: _ref => { this.minute = _ref; }, @@ -133,6 +138,8 @@ export class DynamicDateTimeSelect extends Widget { }, { type: NumberEditor.xtype, + disabled: !timeSelectTypes.includes(DynamicDateTimeSelect.SECOND), + warningTitle: i18nText("BI-Basic_Do_Not_Support_Modification"), ref: _ref => { this.second = _ref; }, diff --git a/packages/fineui/src/widget/numbereditor/number.editor.js b/packages/fineui/src/widget/numbereditor/number.editor.js index 1adc95ce4..054830699 100644 --- a/packages/fineui/src/widget/numbereditor/number.editor.js +++ b/packages/fineui/src/widget/numbereditor/number.editor.js @@ -1,6 +1,5 @@ import { shortcut, - Widget, extend, emptyFn, createWidget, @@ -18,9 +17,10 @@ import { import { SignEditor } from "@/case"; import { TextEditor } from "../editor"; import { IconButton } from "@/base"; +import { Single } from "../../base/single"; @shortcut() -export class NumberEditor extends Widget { +export class NumberEditor extends Single { static xtype = "bi.number_editor"; static EVENT_CONFIRM = "EVENT_CONFIRM"; diff --git a/packages/fineui/src/widget/timeinterval/timeinterval.js b/packages/fineui/src/widget/timeinterval/timeinterval.js index b1c9848c2..47e6d0210 100644 --- a/packages/fineui/src/widget/timeinterval/timeinterval.js +++ b/packages/fineui/src/widget/timeinterval/timeinterval.js @@ -76,6 +76,7 @@ export class TimeInterval extends Single { const o = this.options; const combo = createWidget({ type: DynamicDateTimeCombo.xtype, + timeSelectTypes: o.timeSelectTypes, simple: o.simple, supportDynamic: o.supportDynamic, minDate: o.minDate, diff --git a/packages/fineui/src/widget/yearinterval/yearinterval.js b/packages/fineui/src/widget/yearinterval/yearinterval.js index 42172300f..d82ee5654 100644 --- a/packages/fineui/src/widget/yearinterval/yearinterval.js +++ b/packages/fineui/src/widget/yearinterval/yearinterval.js @@ -28,6 +28,7 @@ export class YearInterval extends Single { minDate: "1900-01-01", maxDate: "2099-12-31", supportDynamic: true, + simple: false, }; static EVENT_VALID = "EVENT_VALID"; @@ -71,6 +72,7 @@ export class YearInterval extends Single { const o = this.options; const combo = createWidget({ type: DynamicYearCombo.xtype, + simple: o.simple, supportDynamic: o.supportDynamic, minDate: o.minDate, maxDate: o.maxDate, diff --git a/packages/fineui/src/widget/yearquarterinterval/yearquarterinterval.js b/packages/fineui/src/widget/yearquarterinterval/yearquarterinterval.js index 16fa9f4a5..e6ea96a7d 100644 --- a/packages/fineui/src/widget/yearquarterinterval/yearquarterinterval.js +++ b/packages/fineui/src/widget/yearquarterinterval/yearquarterinterval.js @@ -28,6 +28,7 @@ export class YearQuarterInterval extends Single { minDate: "1900-01-01", maxDate: "2099-12-31", supportDynamic: true, + simple: false, }; static EVENT_VALID = "EVENT_VALID"; @@ -71,6 +72,7 @@ export class YearQuarterInterval extends Single { const o = this.options; const combo = createWidget({ type: DynamicYearQuarterCombo.xtype, + simple: o.simple, supportDynamic: o.supportDynamic, minDate: o.minDate, maxDate: o.maxDate, From 421980d3ade5cda071397573adfc325899144d57 Mon Sep 17 00:00:00 2001 From: dailer Date: Wed, 1 Nov 2023 17:29:56 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E6=97=A0JIRA=20singletree.combo=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=BC=A0=E5=85=A5popup=E5=B1=9E=E6=80=A7,=20?= =?UTF-8?q?maxHeight=E4=B9=8B=E7=B1=BB=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/widget/singletree/singletree.combo.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/fineui/src/widget/singletree/singletree.combo.js b/packages/fineui/src/widget/singletree/singletree.combo.js index 66cc15d95..7639c9eb5 100644 --- a/packages/fineui/src/widget/singletree/singletree.combo.js +++ b/packages/fineui/src/widget/singletree/singletree.combo.js @@ -33,6 +33,7 @@ export class SingleTreeCombo extends Widget { items: [], value: "", allowClear: false, + popup: {} }); } @@ -77,6 +78,7 @@ export class SingleTreeCombo extends Widget { el: this.trigger, popup: { el: this.popup, + ...o.popup }, }); From e84293c18bc379033a96588b1c125204dd1b7a5e Mon Sep 17 00:00:00 2001 From: dailer Date: Wed, 1 Nov 2023 17:31:01 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E6=97=A0JIRA=20singletree.combo=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=BC=A0=E5=85=A5popup=E5=B1=9E=E6=80=A7,=20?= =?UTF-8?q?maxHeight=E4=B9=8B=E7=B1=BB=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/widget/singletree/singletree.combo.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/fineui/src/widget/singletree/singletree.combo.js b/packages/fineui/src/widget/singletree/singletree.combo.js index 7639c9eb5..02f20ed42 100644 --- a/packages/fineui/src/widget/singletree/singletree.combo.js +++ b/packages/fineui/src/widget/singletree/singletree.combo.js @@ -33,7 +33,10 @@ export class SingleTreeCombo extends Widget { items: [], value: "", allowClear: false, - popup: {} + popup: { + maxHeight: 400, + minHeight: 240, + } }); } From ed7c3ce2b23c54f583d927e407d09d238201f655 Mon Sep 17 00:00:00 2001 From: "Oliver.Ke" Date: Fri, 3 Nov 2023 15:23:38 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/dynamicdate/dynamicdate.combo.ts | 1 + .../dynamicdatetime/dynamicdatetime.combo.ts | 14 +++++++++++ .../widget/timeinterval/timeinterval.ts | 8 +++---- .../typescript/widget/year/combo.year.ts | 9 ++++++++ .../widget/yearinterval/yearinterval.ts | 23 +++++++++++++++++++ .../widget/yearmonth/combo.yearmonth.ts | 11 +++++++++ .../yearmonthinterval/yearmonthinterval.ts | 9 ++++++-- .../widget/yearquarter/combo.yearquarter.ts | 10 ++++++++ .../yearquarterinterval.ts | 23 +++++++++++++++++++ 9 files changed, 102 insertions(+), 6 deletions(-) create mode 100644 packages/fineui/typescript/widget/yearinterval/yearinterval.ts create mode 100644 packages/fineui/typescript/widget/yearquarterinterval/yearquarterinterval.ts diff --git a/packages/fineui/typescript/widget/dynamicdate/dynamicdate.combo.ts b/packages/fineui/typescript/widget/dynamicdate/dynamicdate.combo.ts index 305a71c4f..e9a54490a 100644 --- a/packages/fineui/typescript/widget/dynamicdate/dynamicdate.combo.ts +++ b/packages/fineui/typescript/widget/dynamicdate/dynamicdate.combo.ts @@ -25,6 +25,7 @@ export declare class DynamicDateCombo extends Single { tabIndex?: number; }; watermark?: string; + simple?: boolean; } & Single['props'] setMinDate(minDate: string): void; diff --git a/packages/fineui/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts b/packages/fineui/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts index 268372758..120f38ef3 100644 --- a/packages/fineui/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts +++ b/packages/fineui/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts @@ -25,6 +25,8 @@ export declare class DynamicDateTimeCombo extends Single { watermark?: string; } & Single['props']; + getValue(): DynamicDateTimeComboValue; + setMinDate(minDate: string): void; setMaxDate(minDate: string): void; @@ -39,3 +41,15 @@ export declare class DynamicDateTimeCombo extends Single { setWaterMark(v: string): void } + +export interface DynamicDateTimeComboValue { + type: number; + value: { + year: number; + month: number; + day: number; + hour: number; + minute: number; + second: number; + }; +} diff --git a/packages/fineui/typescript/widget/timeinterval/timeinterval.ts b/packages/fineui/typescript/widget/timeinterval/timeinterval.ts index d9596e4fd..87d4fd977 100644 --- a/packages/fineui/typescript/widget/timeinterval/timeinterval.ts +++ b/packages/fineui/typescript/widget/timeinterval/timeinterval.ts @@ -1,5 +1,5 @@ import { Single } from "../../base/single/single"; -import { DynamicDataComboValue } from "../dynamicdate/dynamicdate.combo"; +import { DynamicDateTimeComboValue } from "../dynamicdatetime/dynamicdatetime.combo"; export declare class TimeInterval extends Single { static xtype: string; @@ -13,11 +13,11 @@ export declare class TimeInterval extends Single { supportDynamic?: boolean; watermark?: string; simple?: boolean; - } & Single['props'] + } & Single['props']; getValue(): { - start: DynamicDataComboValue; - end: DynamicDataComboValue; + start: DynamicDateTimeComboValue; + end: DynamicDateTimeComboValue; }; setMinDate(minDate: string): void; diff --git a/packages/fineui/typescript/widget/year/combo.year.ts b/packages/fineui/typescript/widget/year/combo.year.ts index 605f1700d..5b9b21acb 100644 --- a/packages/fineui/typescript/widget/year/combo.year.ts +++ b/packages/fineui/typescript/widget/year/combo.year.ts @@ -7,7 +7,16 @@ export declare class DynamicYearCombo extends Widget { static EVENT_CONFIRM: string; static EVENT_BEFORE_POPUPVIEW: string; + getValue(): DynamicYearComboValue; + setMinDate(minDate: string): void; setMaxDate(maxDate: string): void; } + +export interface DynamicYearComboValue { + type: number; + value: { + year: number; + }; +} diff --git a/packages/fineui/typescript/widget/yearinterval/yearinterval.ts b/packages/fineui/typescript/widget/yearinterval/yearinterval.ts new file mode 100644 index 000000000..36461498a --- /dev/null +++ b/packages/fineui/typescript/widget/yearinterval/yearinterval.ts @@ -0,0 +1,23 @@ +import { Single } from "../../base/single/single"; +import { DynamicYearComboValue } from "../year/combo.year"; + +export declare class YearInterval extends Single { + static xtype: string; + static EVENT_VALID: string; + static EVENT_ERROR: string; + static EVENT_CHANGE: string; + static EVENT_BEFORE_POPUPVIEW: string; + + props: { + simple?: boolean; + } & Single['props']; + + getValue(): { + start: DynamicYearComboValue; + end: DynamicYearComboValue; + }; + + setMinDate(minDate: string): void; + + setMaxDate(maxDate: string): void; +} diff --git a/packages/fineui/typescript/widget/yearmonth/combo.yearmonth.ts b/packages/fineui/typescript/widget/yearmonth/combo.yearmonth.ts index 557173441..10f198e46 100644 --- a/packages/fineui/typescript/widget/yearmonth/combo.yearmonth.ts +++ b/packages/fineui/typescript/widget/yearmonth/combo.yearmonth.ts @@ -12,7 +12,18 @@ export declare class DynamicYearMonthCombo extends Single { getKey(): string; + getValue(): DynamicYearMonthComboValue; + setMinDate(minDate: string): void; setMaxDate(maxDate: string): void; } + +export interface DynamicYearMonthComboValue { + type: number; + value: { + year: number; + month: number; + }; +} + diff --git a/packages/fineui/typescript/widget/yearmonthinterval/yearmonthinterval.ts b/packages/fineui/typescript/widget/yearmonthinterval/yearmonthinterval.ts index 0c12744ae..9da536c22 100644 --- a/packages/fineui/typescript/widget/yearmonthinterval/yearmonthinterval.ts +++ b/packages/fineui/typescript/widget/yearmonthinterval/yearmonthinterval.ts @@ -1,4 +1,5 @@ import { Single } from '../../base/single/single'; +import { DynamicYearMonthComboValue } from '../yearmonth/combo.yearmonth'; export declare class YearMonthInterval extends Single { static xtype: string; @@ -7,9 +8,13 @@ export declare class YearMonthInterval extends Single { static EVENT_CHANGE: string; static EVENT_BEFORE_POPUPVIEW: string; + props: { + simple?: boolean; + } & Single['props']; + getValue(): { - start: number; - end: number; + start: DynamicYearMonthComboValue; + end: DynamicYearMonthComboValue; }; setMinDate(minDate: string): void; diff --git a/packages/fineui/typescript/widget/yearquarter/combo.yearquarter.ts b/packages/fineui/typescript/widget/yearquarter/combo.yearquarter.ts index b1e42df97..f1a07770b 100644 --- a/packages/fineui/typescript/widget/yearquarter/combo.yearquarter.ts +++ b/packages/fineui/typescript/widget/yearquarter/combo.yearquarter.ts @@ -5,7 +5,17 @@ export declare class DynamicYearQuarterCombo extends Widget { static EVENT_CONFIRM: string; static EVENT_BEFORE_POPUPVIEW: string; + getValue(): DynamicYearQuarterComboValue; + setMinDate(minDate: string): void; setMaxDate(maxDate: string): void; } + +export interface DynamicYearQuarterComboValue { + type: number; + value: { + year: number; + quarter: number; + }; +} diff --git a/packages/fineui/typescript/widget/yearquarterinterval/yearquarterinterval.ts b/packages/fineui/typescript/widget/yearquarterinterval/yearquarterinterval.ts new file mode 100644 index 000000000..30f90abcf --- /dev/null +++ b/packages/fineui/typescript/widget/yearquarterinterval/yearquarterinterval.ts @@ -0,0 +1,23 @@ +import { Single } from "../../base/single/single"; +import { DynamicYearQuarterComboValue } from "../yearquarter/combo.yearquarter"; + +export declare class YearQuarterInterval extends Single { + static xtype: string; + static EVENT_VALID: string; + static EVENT_ERROR: string; + static EVENT_CHANGE: string; + static EVENT_BEFORE_POPUPVIEW: string; + + props: { + simple?: boolean; + } & Single['props']; + + getValue(): { + start: DynamicYearQuarterComboValue; + end: DynamicYearQuarterComboValue; + }; + + setMinDate(minDate: string): void; + + setMaxDate(maxDate: string): void; +} From 831f9e02593485f36a0015add5c4e7b9711c11ef Mon Sep 17 00:00:00 2001 From: "Oliver.Ke" Date: Fri, 3 Nov 2023 15:28:03 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/typescript/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/fineui/typescript/index.ts b/packages/fineui/typescript/index.ts index 3e85c960b..97de6153e 100644 --- a/packages/fineui/typescript/index.ts +++ b/packages/fineui/typescript/index.ts @@ -167,8 +167,10 @@ export { BubblePopupView, BubblePopupBarView, TextBubblePopupBarView } from "./c export { ArrowTreeGroupNodeCheckbox } from "./case/checkbox/check.arrownode"; export { NumberInterval } from "./widget/numberinterval/numberinterval"; export { DynamicYearQuarterCombo } from "./widget/yearquarter/combo.yearquarter"; +export { YearQuarterInterval } from "./widget/yearquarterinterval/yearquarterinterval"; export { DynamicYearCombo } from "./widget/year/combo.year"; export { DynamicYearPopup } from "./widget/year/popup.year"; +export { YearInterval } from "./widget/yearinterval/yearinterval"; export { IntervalSlider } from "./widget/intervalslider/intervalslider"; export { MultiSelectInsertList } from "./widget/multiselectlist/multiselectlist.insert"; export { YearMonthInterval } from "./widget/yearmonthinterval/yearmonthinterval"; From e96ed20207d27480c9c3563ed766794eaffd2ca2 Mon Sep 17 00:00:00 2001 From: dailer Date: Mon, 6 Nov 2023 10:39:05 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E6=97=A0JIRA=20=E8=A1=A5=E4=B8=80?= =?UTF-8?q?=E4=B8=AAts=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/typescript/core/base.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/fineui/typescript/core/base.ts b/packages/fineui/typescript/core/base.ts index 5b4a86af3..3b4efbf36 100644 --- a/packages/fineui/typescript/core/base.ts +++ b/packages/fineui/typescript/core/base.ts @@ -402,6 +402,8 @@ export declare function getTime(...args: any[]): number; export declare function clamp(number: number, lower: number, upper: number): number; +export declare function chunk(array: T[], size?: number): T[][]; + /** * 判断一个对象是不是promise * @param obj 对象 From 50d43612d4d71a190c4adb2b382fa3c7dd92f882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 8 Nov 2023 17:29:27 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96object=E5=AF=B9=E8=B1=A1=E7=9A=84un=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/3.ob.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fineui/src/core/3.ob.js b/packages/fineui/src/core/3.ob.js index 1cf2d94ae..3e4ed7fe4 100644 --- a/packages/fineui/src/core/3.ob.js +++ b/packages/fineui/src/core/3.ob.js @@ -155,7 +155,7 @@ export class OB { eventName = eventName.toLowerCase(); /* alex:如果fn是null,就是把eventName上面所有方法都un掉*/ - if (fn === null) { + if (!fn) { delete this._getEvents()[eventName]; } else { const fns = this._getEvents()[eventName]; From 2668c807be38054fef8d585bf4e013a29bb2117c Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 13 Nov 2023 15:48:37 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20rowHeig?= =?UTF-8?q?ht=E6=94=AF=E6=8C=81=E4=B8=80=E4=B8=8B=E4=BC=A0function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fineui/src/base/list/virtualgrouplist.js | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/fineui/src/base/list/virtualgrouplist.js b/packages/fineui/src/base/list/virtualgrouplist.js index 06edd5692..40bbaf9a5 100644 --- a/packages/fineui/src/base/list/virtualgrouplist.js +++ b/packages/fineui/src/base/list/virtualgrouplist.js @@ -17,7 +17,7 @@ export class VirtualGroupList extends Widget { overscanHeight: 100, blockSize: 10, scrollTop: 0, - rowHeight: "auto", + rowHeight: "auto", // 'auto' 或 数值 或function items: [], el: {}, itemFormatter: (item, index) => item, @@ -97,7 +97,7 @@ export class VirtualGroupList extends Widget { } _isAutoHeight() { - return !isNumber(this.options.rowHeight); + return this.options.rowHeight === 'auto'; } _renderMoreIf() { @@ -163,7 +163,7 @@ export class VirtualGroupList extends Widget { itemsArr.push(items[j]); } } - this.container.element.height(rowHeight * items.length - topHeight); + this.container.element.height(this.summaryHeight - topHeight); this.container.populate( itemsArr.map((item, i) => itemFormatter(item, (start < 0 ? 0 : start) * blockSize + i)) ); @@ -180,6 +180,16 @@ export class VirtualGroupList extends Widget { Math.ceil(this.options.items.length / blockSize), this._isAutoHeight() ? 0 : rowHeight * blockSize ); + if (isFunction(rowHeight)) { + for (let i = 0; i < this.options.items.length / blockSize; i++) { + const index = i * blockSize; + let summaryHeight = 0; + for (let j = index; j < index + blockSize && j < this.options.items.length; j++) { + summaryHeight += rowHeight(j, this.options.items[j]); + } + this.tree.set(i, summaryHeight); + } + } this._calculateBlocksToRender(); try { @@ -188,7 +198,13 @@ export class VirtualGroupList extends Widget { } _restore() { + const o = this.options; this.renderedIndex = -1; + if (isFunction(o.rowHeight)) { + this.summaryHeight = BI.sum(o.items, o.rowHeight); + } else { + this.summaryHeight = this._isAutoHeight() ? 0 : o.rowHeight * o.items.length; + } // 依赖于cache的占位元素也要初始化 this.topBlank.setHeight(0); this.bottomBlank.setHeight(0); From 697bc5bb239817a7d9a277f40e2ba356dbb0a7ef Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 20 Nov 2023 09:57:07 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20custom?= =?UTF-8?q?=5Ftree=E6=94=AF=E6=8C=81hasNext?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/base/list/virtualgrouplist.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/fineui/src/base/list/virtualgrouplist.js b/packages/fineui/src/base/list/virtualgrouplist.js index 40bbaf9a5..e2e0d5ddf 100644 --- a/packages/fineui/src/base/list/virtualgrouplist.js +++ b/packages/fineui/src/base/list/virtualgrouplist.js @@ -1,4 +1,4 @@ -import { VerticalLayout, Layout, Widget, shortcut, extend, isFunction, isNumber, PrefixIntervalTree, ResizeDetector } from "@/core"; +import { VerticalLayout, Layout, Widget, shortcut, extend, isFunction, isNumber, sum, PrefixIntervalTree, ResizeDetector } from "@/core"; import { VirtualGroup } from "../combination"; /** @@ -201,7 +201,7 @@ export class VirtualGroupList extends Widget { const o = this.options; this.renderedIndex = -1; if (isFunction(o.rowHeight)) { - this.summaryHeight = BI.sum(o.items, o.rowHeight); + this.summaryHeight = sum(o.items, o.rowHeight); } else { this.summaryHeight = this._isAutoHeight() ? 0 : o.rowHeight * o.items.length; }