Browse Source

Merge remote-tracking branch 'origin/es6' into es6

es6
Kobi 1 year ago
parent
commit
2b50b02d79
  1. 3
      package.json
  2. 2
      packages/fineui/package.json
  3. 15
      packages/fineui/src/base/combination/searcher.js
  4. 5
      packages/fineui/src/base/combination/switcher.js
  5. 8
      packages/fineui/src/core/2.base.js
  6. 2
      packages/fineui/src/core/constant/writable.var.js
  7. 2
      packages/fineui/src/core/func/alias.js
  8. 20
      packages/fineui/src/widget/multiselect/multiselect.combo.js
  9. 20
      packages/fineui/src/widget/multiselect/multiselect.combo.nobar.js
  10. 21
      packages/fineui/src/widget/multiselect/multiselect.insert.combo.js
  11. 21
      packages/fineui/src/widget/multiselect/multiselect.insert.combo.nobar.js
  12. 4
      packages/fineui/src/widget/multiselect/multiselect.popup.view.js
  13. 4
      packages/fineui/src/widget/multiselect/multiselect.popup.view.nobar.js
  14. 2
      packages/fineui/src/widget/multitree/multi.tree.combo.js
  15. 3
      packages/fineui/typescript/base/base.ts
  16. 2
      packages/fineui/typescript/core/base.ts
  17. 5
      packages/fineui/typescript/core/controller/controller.masker.ts
  18. 14
      packages/fineui/typescript/core/func/alias.ts
  19. 1
      packages/fineui/typescript/core/platform/web/index.ts
  20. 4
      packages/fineui/typescript/router/router.ts

3
package.json

@ -15,7 +15,8 @@
"dev:demo": "pnpm --dir packages/demo dev",
"dev:fineui": "pnpm --dir packages/fineui dev",
"build": "pnpm --dir packages/fineui build",
"build:demo": "pnpm --dir packages/demo build"
"build:demo": "pnpm --dir packages/demo build",
"tsc": "pnpm --dir packages/fineui tsc"
},
"devDependencies": {
"@babel/cli": "^7.21.0",

2
packages/fineui/package.json

@ -1,6 +1,6 @@
{
"name": "@fui/core",
"version": "3.0.20230606133653",
"version": "3.0.20230615140705",
"description": "fineui",
"main": "dist/fineui.min.js",
"module": "dist/lib/index.js",

15
packages/fineui/src/base/combination/searcher.js

@ -17,7 +17,8 @@ import {
BlankSplitChar,
Events,
EVENT_RESPONSE_TIME,
Func
Func,
isFunction,
} from "@/core";
import { ButtonGroup } from "./group.button";
import { Maskers } from "@/base/0.base";
@ -127,7 +128,8 @@ export class Searcher extends Widget {
}
_assertPopupView() {
const { masker, popup, chooseType, isAutoSync, adapter } = this.options;
const { masker, popup, chooseType, isAutoSync } = this.options;
const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter;
if ((masker && !Maskers.has(this.getName())) || (masker === false && !this.popupView)) {
this.popupView = createWidget(popup, {
type: SearcherView.xtype,
@ -213,7 +215,8 @@ export class Searcher extends Widget {
}
_search() {
const { isAutoSearch, adapter, isAutoSync, onSearch } = this.options;
const { isAutoSearch, isAutoSync, onSearch } = this.options;
const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter;
const keyword = this.editor.getValue();
if (keyword === "" || this._stop) {
return;
@ -333,7 +336,8 @@ export class Searcher extends Widget {
}
getValue() {
const { isAutoSync, adapter, popup } = this.options;
const { isAutoSync, popup } = this.options;
const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter;
if (isAutoSync && adapter && adapter.getValue) {
return adapter.getValue();
}
@ -350,7 +354,8 @@ export class Searcher extends Widget {
}
populate(result, searchResult, keyword) {
const { isAutoSync, adapter } = this.options;
const { isAutoSync } = this.options;
const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter;
this._assertPopupView();
this.popupView.populate(...arguments);
if (isAutoSync && adapter && adapter.getValue) {

5
packages/fineui/src/base/combination/switcher.js

@ -11,7 +11,7 @@ import {
isNull,
Events,
Direction,
EVENT_RESPONSE_TIME
EVENT_RESPONSE_TIME, isFunction
} from "@/core";
import { ButtonGroup } from "./group.button";
import { Maskers } from "@/base/0.base";
@ -188,7 +188,8 @@ export class Switcher extends Widget {
}
_assertPopupView() {
const { popup, adapter, masker, value, direction } = this.options;
const { popup, masker, value, direction } = this.options;
const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter;
if (!this._created) {
this.popupView = createWidget(
popup,

8
packages/fineui/src/core/2.base.js

@ -1227,19 +1227,19 @@ export function checkDateVoid(YY, MM, DD, minDate, maxDate) {
} else if (YY > maxDate[0]) {
back = ["y", 1];
} else if (YY >= minDate[0] && YY <= maxDate[0]) {
if (YY === minDate[0]) {
if (YY == minDate[0]) {
if (MM < minDate[1]) {
back = ["m"];
} else if (MM === minDate[1]) {
} else if (MM == minDate[1]) {
if (DD < minDate[2]) {
back = ["d"];
}
}
}
if (YY === maxDate[0]) {
if (YY == maxDate[0]) {
if (MM > maxDate[1]) {
back = ["m", 1];
} else if (MM === maxDate[1]) {
} else if (MM == maxDate[1]) {
if (DD > maxDate[2]) {
back = ["d", 1];
}

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

@ -130,7 +130,7 @@ const getCacheItem = key => {
export let EVENT_BLUR = _global.localStorage ? getCacheItem("event.blur") : true;
export const setEventBlur = v => {
EVENT_BLUR = v;
Cache.setItem("event.blur", newVal);
Cache.setItem("event.blur", v);
};
PropertyDescriptors["EVENT_BLUR"] = {
enumerable: true,

2
packages/fineui/src/core/func/alias.js

@ -456,7 +456,7 @@ export const htmlDecode = function(text) {
export const cjkEncodeDO = function(o) {
if (isPlainObject(o)) {
const result = {};
each(o, (v, k) => {
each(o, (k, v) => {
if (!(typeof v === "string")) {
v = jsonEncode(v);
}

20
packages/fineui/src/widget/multiselect/multiselect.combo.js

@ -99,13 +99,8 @@ export class MultiSelectCombo extends Single {
height: toPix(o.height, o.simple ? 1 : 2),
text: o.text,
defaultText: o.defaultText,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: SIZE_CONSANTS.LIST_ITEM_HEIGHT + 1,
},
adapter: () => {
return this.popup.getView();
},
valueFormatter: o.valueFormatter,
itemFormatter: o.itemFormatter,
@ -185,8 +180,6 @@ export class MultiSelectCombo extends Single {
type: MultiSelectPopupView.xtype,
ref() {
self.popup = this;
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [
{
@ -269,13 +262,8 @@ export class MultiSelectCombo extends Single {
this.numberCounter = createWidget({
type: MultiSelectCheckSelectedSwitcher.xtype,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: SIZE_CONSANTS.LIST_ITEM_HEIGHT + 1,
},
adapter: () => {
return this.popup.getView();
},
valueFormatter: o.valueFormatter,
itemsCreator: bind(this._itemsCreator4Trigger, this),

20
packages/fineui/src/widget/multiselect/multiselect.combo.nobar.js

@ -97,13 +97,8 @@ export class MultiSelectNoBarCombo extends Single {
height: toPix(o.height, o.simple ? 1 : 2),
text: o.text,
defaultText: o.defaultText,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: SIZE_CONSANTS.LIST_ITEM_HEIGHT + 1,
},
adapter: () => {
return this.popup.getView();
},
valueFormatter: o.valueFormatter,
itemsCreator: bind(this._itemsCreator4Trigger, this),
@ -185,8 +180,6 @@ export class MultiSelectNoBarCombo extends Single {
type: MultiSelectNoBarPopupView.xtype,
ref() {
self.popup = this;
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [
{
@ -272,13 +265,8 @@ export class MultiSelectNoBarCombo extends Single {
this.numberCounter = createWidget({
type: MultiSelectCheckSelectedSwitcher.xtype,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: SIZE_CONSANTS.LIST_ITEM_HEIGHT + 1,
},
adapter: () => {
return this.popup.getView();
},
valueFormatter: o.valueFormatter,
itemsCreator: bind(this._itemsCreator4Trigger, this),

21
packages/fineui/src/widget/multiselect/multiselect.insert.combo.js

@ -99,14 +99,8 @@ export class MultiSelectInsertCombo extends Single {
text: o.text,
watermark: o.watermark,
defaultText: o.defaultText,
// adapter: this.popup,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: SIZE_CONSANTS.LIST_ITEM_HEIGHT + 1,
},
adapter: () => {
return this.popup.getView();
},
valueFormatter: o.valueFormatter,
itemsCreator: bind(this._itemsCreator4Trigger, this),
@ -192,8 +186,6 @@ export class MultiSelectInsertCombo extends Single {
type: MultiSelectPopupView.xtype,
ref() {
self.popup = this;
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [
{
@ -276,13 +268,8 @@ export class MultiSelectInsertCombo extends Single {
this.numberCounter = createWidget({
type: MultiSelectCheckSelectedSwitcher.xtype,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: SIZE_CONSANTS.LIST_ITEM_HEIGHT + 1,
},
adapter: () => {
return this.popup.getView();
},
valueFormatter: o.valueFormatter,
itemsCreator: bind(this._itemsCreator4Trigger, this),

21
packages/fineui/src/widget/multiselect/multiselect.insert.combo.nobar.js

@ -93,14 +93,8 @@ export class MultiSelectInsertNoBarCombo extends Single {
type: MultiSelectInsertTrigger.xtype,
height: toPix(o.height, o.simple ? 1 : 2),
text: o.text,
// adapter: this.popup,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: SIZE_CONSANTS.LIST_ITEM_HEIGHT + 1,
},
adapter: () => {
return this.popup.getView();
},
valueFormatter: o.valueFormatter,
itemsCreator: bind(this._itemsCreator4Trigger, this),
@ -178,8 +172,6 @@ export class MultiSelectInsertNoBarCombo extends Single {
type: MultiSelectNoBarPopupView.xtype,
ref() {
self.popup = this;
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [
{
@ -263,13 +255,8 @@ export class MultiSelectInsertNoBarCombo extends Single {
this.numberCounter = createWidget({
type: MultiSelectCheckSelectedSwitcher.xtype,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: SIZE_CONSANTS.LIST_ITEM_HEIGHT + 1,
},
adapter: () => {
return this.popup.getView();
},
valueFormatter: o.valueFormatter,
itemsCreator: bind(this._itemsCreator4Trigger, this),

4
packages/fineui/src/widget/multiselect/multiselect.popup.view.js

@ -98,4 +98,8 @@ export class MultiSelectPopupView extends Widget {
setDirection(direction, position) {
this.popupView.setDirection(direction, position);
}
getView() {
return this.popupView.getView();
}
}

4
packages/fineui/src/widget/multiselect/multiselect.popup.view.nobar.js

@ -93,4 +93,8 @@ export class MultiSelectNoBarPopupView extends Widget {
setDirection(direction, position) {
this.popupView.setDirection(direction, position);
}
getView() {
return this.popupView.getView();
}
}

2
packages/fineui/src/widget/multitree/multi.tree.combo.js

@ -101,7 +101,7 @@ export class MultiTreeCombo extends Single {
el: this.trigger,
adjustLength: 1,
popup: {
type: "bi.multi_tree_popup_view",
type: MultiTreePopup.xtype,
ref() {
self.popup = this;
self.trigger.setAdapter(this);

3
packages/fineui/typescript/base/base.ts

@ -3,9 +3,12 @@ import { BroadcastController } from "../core/controller/controller.broadcast";
import { StyleLoaderManager } from "../core/loader/loader.style";
import { BubblesController } from "../core/controller/controller.bubbles";
import { PopoverController } from "../core/controller/controller.popovers";
import { MaskersController } from "../core/controller/controller.masker";
export const Layers = new LayerController();
export const Maskers = new MaskersController();
export const Bubbles = new BubblesController();
export const Broadcasts = new BroadcastController();

2
packages/fineui/typescript/core/base.ts

@ -400,6 +400,8 @@ export declare function getDate(...args: (number | string)[]): Date;
export declare function getTime(...args: any[]): number;
export declare function clamp(number: number, lower: number, upper: number): number;
/**
* promise
* @param obj

5
packages/fineui/typescript/core/controller/controller.masker.ts

@ -0,0 +1,5 @@
import { LayerController } from "./controller.layer";
export declare class MaskersController extends LayerController {
}

14
packages/fineui/typescript/core/func/alias.ts

@ -1,3 +1,17 @@
export declare function jsonDecode(text: string): any;
export declare function jsonEncode(json: any): any;
export declare function contentFormat(cv: any, fmt: string): string;
export declare function htmlDecode(text: string): string;
export declare function htmlEncode(text: string): string;
export declare function getEncodeURL(urlTemplate: string, param: any): string;
export declare function encodeURIComponent(url: string): string;
export declare function decodeURIComponent(url: string): string;

1
packages/fineui/typescript/core/platform/web/index.ts

@ -3,3 +3,4 @@ export * as EventListener from "./eventListener";
export * as ResizeDetector from "./detectElementResize";
export * from "./load";
export * as DOM from "./dom";
export declare var $: any;

4
packages/fineui/typescript/router/router.ts

@ -1,3 +1,5 @@
import { Widget } from '../core/widget';
type Component = any
type Dictionary<T> = { [key: string]: T }
type ErrorHandler = (err: Error) => void
@ -244,6 +246,6 @@ export declare class RouterWidget {
static xtype: string;
}
export declare class RouterView {
export declare class RouterView extends Widget {
static xtype: string;
}

Loading…
Cancel
Save