Browse Source

Merge branch 'master' of ssh://code.fineres.com:7999/~dailer/fineui

es6
zsmj 2 years ago
parent
commit
fef6f72ce2
  1. 7
      examples/useContext.html
  2. 2
      package.json
  3. 7
      src/base/combination/group.button.js
  4. 5
      src/base/combination/navigation.js
  5. 2
      src/base/combination/tab.js
  6. 2
      src/core/4.widget.js
  7. 4
      src/widget/date/calendar/popup.month.js

7
examples/useContext.html

@ -5,8 +5,8 @@
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css"/>
<script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>
<!-- <script src="http://localhost:9001/fineui.js"></script>-->
<!-- <script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>-->
<script src="http://localhost:9001/fineui.js"></script>
</head>
<style>
.my-parent {
@ -50,6 +50,9 @@
if (!BI.isNumber(pix)) {
return pix;
}
if (border > 0) {
return "calc(var(--css-scale) * " + pix + "px" + " - " + border + "px"+")";
}
return "calc(var(--css-scale) * " + pix + "px)";
};

2
package.json

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

7
src/base/combination/group.button.js

@ -42,9 +42,12 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
},
_createBtns: function (items) {
return BI.createWidgets(BI.createItems(items, {
BI.Widget.pushContext(this);
var btns = BI.createWidgets(BI.createItems(items, {
type: "bi.text_button",
}), this);
}));
BI.Widget.popContext();
return btns;
},
_btnsCreator: function (items) {

5
src/base/combination/navigation.js

@ -43,9 +43,10 @@ BI.Navigation = BI.inherit(BI.Widget, {
return self.showIndex + v;
},
cardCreator: function (v) {
BI.Widget.pushContext(self);
var card = o.cardCreator(v);
BI.Widget.popContext();
self.cardMap[v] = card;
return card;
},
afterCardCreated: BI.bind(this.afterCardCreated, this),
@ -104,7 +105,9 @@ BI.Navigation = BI.inherit(BI.Widget, {
_assertCard: function (v) {
if (!this.layout.isCardExisted(v)) {
BI.Widget.pushContext(this);
var card = this.options.cardCreator(v);
BI.Widget.popContext();
this.cardMap[v] = card;
this.layout.addCardByName(v, card);
this.afterCardCreated(v);

2
src/base/combination/tab.js

@ -72,7 +72,9 @@ BI.Tab = BI.inherit(BI.Widget, {
_assertCard: function (v) {
if (!this.layout.isCardExisted(v)) {
BI.Widget.pushContext(this);
var card = this.options.cardCreator(v);
BI.Widget.popContext();
this.cardMap[v] = card;
this.layout.addCardByName(v, card);
}

2
src/core/4.widget.js

@ -903,7 +903,7 @@
BI.useContext = function (inject) {
// 通过组件找最近的store
var vm = BI.Widget.findStore(BI.Widget.current);
var vm = BI.Widget.findStore(BI.Widget.current || BI.Widget.context);
if (vm) {
if (inject) {
if (vm.$$computed && inject in vm.$$computed) {

4
src/widget/date/calendar/popup.month.js

@ -49,6 +49,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
},
_getItems: function(m) {
BI.Widget.pushContext(this);
// 纵向排列月
var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12];
var items = [];
@ -75,6 +76,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
};
});
});
BI.Widget.popContext();
return items;
},
@ -94,4 +96,4 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
}
});
BI.MonthPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.month_popup", BI.MonthPopup);
BI.shortcut("bi.month_popup", BI.MonthPopup);

Loading…
Cancel
Save