guy 2 years ago
parent
commit
28ca2fee2a
  1. 2
      package.json
  2. 76
      src/base/single/instruction/instruction.js
  3. 2
      src/core/platform/web/detectElementResize.js
  4. 31
      src/less/base/single/instruction.less
  5. 10
      src/less/base/single/tip/tip.bubble.less

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "fineui", "name": "fineui",
"version": "2.0.20221027174605", "version": "2.0.20221028191610",
"description": "fineui", "description": "fineui",
"main": "dist/fineui_without_conflict.min.js", "main": "dist/fineui_without_conflict.min.js",
"types": "dist/lib/index.d.ts", "types": "dist/lib/index.d.ts",

76
src/base/single/instruction/instruction.js

@ -0,0 +1,76 @@
BI.Instruction = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.Link.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-instruction",
height: 20,
level: "error",
textAlign: "left",
whiteSpace: "nowrap",
hgap: 5
});
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "instruction-" + o.level,
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textHeight: o.height,
height: o.height,
hgap: o.hgap,
rgap: o.rgap,
lgap: o.lgap,
vgap: o.vgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
};
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (v) {
this.options.text = v;
this.text.setText(v);
},
getText: function () {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css);
},
setValue: function (v) {
this.text.setValue(v);
},
getValue: function () {
this.text.getValue();
}
});
BI.shortcut("bi.instruction", BI.Instruction);

2
src/core/platform/web/detectElementResize.js

@ -553,7 +553,7 @@ var ResizeObserver = window.ResizeObserver || ResizeObserverPolyfill.ResizeObser
if (!element.__resizeObserver__) { if (!element.__resizeObserver__) {
var resizeObserver = new ResizeObserver(function () { var resizeObserver = new ResizeObserver(function () {
element.__resizeListeners__.forEach(function (listener) { element.__resizeListeners__.forEach(function (listener) {
listener(); BI.$(element).is(":visible") && listener();
}); });
}); });
resizeObserver.observe(element); resizeObserver.observe(element);

31
src/less/base/single/instruction.less

@ -0,0 +1,31 @@
@import "../../index.less";
.bi-instruction {
.border-radius(2px);
&.instruction-error{
background: @color-bi-background-bubble-error;
color: @color-bi-text-failure;
}
&.instruction-common{
background: @color-bi-background-bubble-normal;
color: @color-bi-text-highlight;
}
&.instruction-success{
background: @color-bi-background-bubble-success;
color: @color-bi-text-success;
}
&.instruction-warning{
background: @color-bi-background-bubble-warning;
color: @color-bi-text-redmark;
}
}
.bi-theme-dark {
.bi-instruction.instruction-error {
background: @color-bi-background-bubble-error-theme-dark;
}
}

10
src/less/base/single/tip/tip.bubble.less

@ -9,10 +9,6 @@
color: @color-bi-text-failure; color: @color-bi-text-failure;
} }
.bi-theme-dark &.bubble-error {
background: @color-bi-background-bubble-error-theme-dark;
}
&.bubble-common{ &.bubble-common{
background: @color-bi-background-bubble-normal; background: @color-bi-background-bubble-normal;
color: @color-bi-text-highlight; color: @color-bi-text-highlight;
@ -28,3 +24,9 @@
color: @color-bi-text-redmark; color: @color-bi-text-redmark;
} }
} }
.bi-theme-dark {
.bi-bubble.bubble-error {
background: @color-bi-background-bubble-error-theme-dark;
}
}

Loading…
Cancel
Save