Browse Source

REPORT-60473 && REPORT-64922 fix:实现日期控件的focus、blur和setWaterMark

es6
freddy 3 years ago
parent
commit
1a35304ca6
  1. 16
      src/widget/dynamicdate/dynamicdate.combo.js
  2. 13
      src/widget/dynamicdate/dynamicdate.trigger.js
  3. 16
      src/widget/dynamicdatetime/dynamicdatetime.combo.js
  4. 15
      src/widget/dynamicdatetime/dynamicdatetime.trigger.js
  5. 16
      src/widget/time/time.combo.js
  6. 13
      src/widget/time/time.trigger.js
  7. 8
      typescript/widget/dynamicdate/dynamicdate.combo.ts
  8. 8
      typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts
  9. 8
      typescript/widget/time/time.combo.ts

16
src/widget/dynamicdate/dynamicdate.combo.js

@ -298,6 +298,22 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
}, },
hidePopupView: function () { hidePopupView: function () {
this.combo.hideView(); this.combo.hideView();
},
hideView: function () {
this.combo.hideView();
},
focus: function () {
this.trigger.focus();
},
blur: function () {
this.trigger.blur();
},
setWaterMark: function (v) {
this.trigger.setWaterMark(v);
} }
}); });

13
src/widget/dynamicdate/dynamicdate.trigger.js

@ -308,8 +308,19 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
}, },
getValue: function () { getValue: function () {
return this.storeValue; return this.storeValue;
} },
focus: function () {
this.editor.focus();
},
blur: function () {
this.editor.blur();
},
setWaterMark: function (v) {
this.editor.setWaterMark(v);
}
}); });
BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR"; BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR";

16
src/widget/dynamicdatetime/dynamicdatetime.combo.js

@ -306,6 +306,22 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
isValid: function () { isValid: function () {
return this.trigger.isValid(); return this.trigger.isValid();
},
hideView: function () {
this.combo.hideView();
},
focus: function () {
this.trigger.focus();
},
blur: function () {
this.trigger.blur();
},
setWaterMark: function (v) {
this.trigger.setWaterMark(v);
} }
}); });

15
src/widget/dynamicdatetime/dynamicdatetime.trigger.js

@ -379,8 +379,19 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
isValid: function () { isValid: function () {
return this.editor.isValid(); return this.editor.isValid();
} },
focus: function () {
this.editor.focus();
},
blur: function () {
this.editor.blur();
},
setWaterMark: function (v) {
this.editor.setWaterMark(v);
}
}); });
BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR"; BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR";
@ -393,4 +404,4 @@ BI.DynamicDateTimeTrigger.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateTimeTrigger.EVENT_ERROR = "EVENT_ERROR"; BI.DynamicDateTimeTrigger.EVENT_ERROR = "EVENT_ERROR";
BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK = "EVENT_TRIGGER_CLICK"; BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK = "EVENT_TRIGGER_CLICK";
BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.shortcut("bi.dynamic_date_time_trigger", BI.DynamicDateTimeTrigger); BI.shortcut("bi.dynamic_date_time_trigger", BI.DynamicDateTimeTrigger);

16
src/widget/time/time.combo.js

@ -222,6 +222,22 @@
this.setValue(nowTome); this.setValue(nowTome);
this.hidePopupView(); this.hidePopupView();
this.fireEvent(BI.TimeCombo.EVENT_CONFIRM); this.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
},
hideView: function () {
this.combo.hideView();
},
focus: function () {
this.trigger.focus();
},
blur: function () {
this.trigger.blur();
},
setWaterMark: function (v) {
this.trigger.setWaterMark(v);
} }
}); });

13
src/widget/time/time.trigger.js

@ -180,8 +180,19 @@
getValue: function () { getValue: function () {
return this.storeValue; return this.storeValue;
} },
focus: function () {
this.editor.focus();
},
blur: function () {
this.editor.blur();
},
setWaterMark: function (v) {
this.editor.setWaterMark(v);
}
}); });
BI.shortcut("bi.time_trigger", BI.TimeTrigger); BI.shortcut("bi.time_trigger", BI.TimeTrigger);
})(); })();

8
typescript/widget/dynamicdate/dynamicdate.combo.ts

@ -36,6 +36,14 @@ export declare class DynamicDateCombo extends Single {
hidePopupView(): void; hidePopupView(): void;
getValue(): DynamicDataComboValue; getValue(): DynamicDataComboValue;
hideView(): void;
focus(): void;
blur(): void;
setWaterMark(v: string): void;
} }
export interface DynamicDataComboValue { export interface DynamicDataComboValue {

8
typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts

@ -32,4 +32,12 @@ export declare class DynamicDateTimeCombo extends Single {
getKey(): string; getKey(): string;
hidePopupView(): void; hidePopupView(): void;
hideView(): void;
focus(): void;
blur(): void;
seWaterMark(v: string): void;
} }

8
typescript/widget/time/time.combo.ts

@ -10,4 +10,12 @@ export declare class TimeCombo extends Single {
static EVENT_BEFORE_POPUPVIEW: string; static EVENT_BEFORE_POPUPVIEW: string;
hidePopupView(): void; hidePopupView(): void;
hideView(): void;
focus(): void;
blur(): void;
setWaterMark(v: string): void;
} }

Loading…
Cancel
Save