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; } }, diff --git a/packages/fineui/src/base/list/virtualgrouplist.js b/packages/fineui/src/base/list/virtualgrouplist.js index 06edd5692..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"; /** @@ -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 = 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); 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, 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]; 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/platform/web/load.js b/packages/fineui/src/core/platform/web/load.js index 6dd203ea1..d010bdb54 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/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/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/singletree/singletree.combo.js b/packages/fineui/src/widget/singletree/singletree.combo.js index 66cc15d95..02f20ed42 100644 --- a/packages/fineui/src/widget/singletree/singletree.combo.js +++ b/packages/fineui/src/widget/singletree/singletree.combo.js @@ -33,6 +33,10 @@ export class SingleTreeCombo extends Widget { items: [], value: "", allowClear: false, + popup: { + maxHeight: 400, + minHeight: 240, + } }); } @@ -77,6 +81,7 @@ export class SingleTreeCombo extends Widget { el: this.trigger, popup: { el: this.popup, + ...o.popup }, }); 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, 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/typescript/core/base.ts b/packages/fineui/typescript/core/base.ts index abdd7ba80..3b4efbf36 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; @@ -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 对象 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 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"; 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; +} 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"])));