diff --git a/debian/changelog b/debian/changelog index 3a2a50cf..36fc6419 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.407.78) stable; urgency=low +hedera-web (1.407.79) stable; urgency=low * Initial Release. diff --git a/forms/ecomerce/catalog/catalog.js b/forms/ecomerce/catalog/catalog.js index 71aa2a21..74ae04f9 100644 --- a/forms/ecomerce/catalog/catalog.js +++ b/forms/ecomerce/catalog/catalog.js @@ -105,6 +105,8 @@ Hedera.Catalog = new Class({ for (const tag of tags) $[`${tag}s`].lot = this.getFilter(params, tags, tag); + + if (lot) this.hideMenu(); } ,refreshTitle: function() { diff --git a/forms/ecomerce/catalog/style.css b/forms/ecomerce/catalog/style.css index 56b00e37..31aa4498 100644 --- a/forms/ecomerce/catalog/style.css +++ b/forms/ecomerce/catalog/style.css @@ -4,6 +4,9 @@ .title ._subtitle { font-size: .7rem; color: #bbb; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; } /* Right panel */ @@ -78,10 +81,10 @@ width: 25%; padding: .6em; box-sizing: border-box; + border-radius: 50%; } .right-panel .realms a:hover { background-color: rgba(1, 1, 1, .05); - border-radius: .15em; } .right-panel .realms a > img { display: block; @@ -98,12 +101,9 @@ display: flex; box-sizing: border-box; } -.item-box > htk-image { +.item-box > .htk-image { flex: none; } -.item-box > htk-image:hover { - background-color: transparent; -} .item-box > .item-info { flex: auto; position: relative; @@ -212,8 +212,8 @@ background-color: white; flex-direction: column; - width: 240px; - height: 410px; + width: 260px; + height: 425px; overflow: hidden; } .grid-view .item-box:hover { @@ -223,8 +223,8 @@ margin: 10px; } .grid-view .item-box > .htk-image { - width: 240px; - height: 240px; + width: 260px; + height: 260px; } .grid-view .item-box > .item-info { flex: auto; @@ -254,7 +254,7 @@ gap: 10px; margin: 0; padding: 10px; - height: 120px; + height: 130px; overflow: visible; border-bottom: 1px solid #DDD; } @@ -262,15 +262,15 @@ border-bottom: none; } .list-view .item-box > .htk-image { - width: 100px; - height: 100px; + width: 110px; + height: 110px; border-radius: 50%; } .list-view .item-info { overflow: hidden; } .list-view .item-info > h2 { - font-size: 1em; + font-size: 1rem; white-space: nowrap; } .list-view .item-info > .color { diff --git a/js/hedera/gui.scss b/js/hedera/gui.scss index d9f73906..e78c9721 100644 --- a/js/hedera/gui.scss +++ b/js/hedera/gui.scss @@ -49,9 +49,9 @@ $navbar-height: 64px; flex: auto; display: flex; align-items: center; - gap: 15px; + gap: 12px; overflow: hidden; - padding-left: 15px; + padding-left: 12px; & > .title { overflow: hidden; @@ -74,9 +74,9 @@ $navbar-height: 64px; height: 100%; display: flex; align-items: center; - padding-right: $spacing-md; - padding-left: $spacing-sm; - gap: .5em; + padding-right: 12px; + padding-left: 4px; + gap: 2px; & > * { float: right; @@ -84,7 +84,7 @@ $navbar-height: 64px; } button { margin: 0; - padding: 10px 15px; + padding: 8px 13px; &:hover { background-color: rgba(2550, 255, 255, .2); @@ -305,7 +305,7 @@ $navbar-height: 64px; @media (max-width: 960px) { & > .navbar { - padding-left: 16px; + padding-left: 12px; left: 0; & > .menu-button { @@ -313,7 +313,7 @@ $navbar-height: 64px; } & > .action-bar { button { - padding: 10px; + padding: 8px; } span.label, button > .text { diff --git a/js/htk/calendar/index.js b/js/htk/calendar/index.js index 4d6b542d..aeaeb569 100644 --- a/js/htk/calendar/index.js +++ b/js/htk/calendar/index.js @@ -21,9 +21,7 @@ module.exports = new Class({ ,month: null ,render: function() { - var len = Vn.Date.WDays.length; - - var node = this.createRoot('div'); + this.createRoot('div'); var table = this.createElement('table'); this.node.appendChild(table); @@ -31,6 +29,7 @@ module.exports = new Class({ var colgroup = this.createElement('colgroup'); table.appendChild(colgroup); + var len = Vn.Date.WDays.length; for (var i = 0; i < len; i++) colgroup.appendChild(this.createElement('col')); diff --git a/js/htk/columns/button/style.scss b/js/htk/columns/button/style.scss index 787ca01d..d56f10d6 100644 --- a/js/htk/columns/button/style.scss +++ b/js/htk/columns/button/style.scss @@ -11,8 +11,6 @@ td.cell-button { height: 44px; width: 44px; margin: 0 auto; - border-radius: 50%; - padding: 10px; border: none; background-color: transparent; box-sizing: border-box; diff --git a/js/htk/loader/index.js b/js/htk/loader/index.js index 89edfbc0..dd6d8b19 100644 --- a/js/htk/loader/index.js +++ b/js/htk/loader/index.js @@ -2,8 +2,8 @@ require('./style.scss'); var Component = require('vn/component'); module.exports = new Class({ - Tag: 'htk-loader' - ,Extends: Component + Extends: Component + ,Tag: 'htk-loader' ,Properties: { form: { type: Db.Form diff --git a/js/htk/popup/index.js b/js/htk/popup/index.js index 4ab0e3b9..fa461ad3 100644 --- a/js/htk/popup/index.js +++ b/js/htk/popup/index.js @@ -91,7 +91,7 @@ module.exports = new Class({ bg.addEventListener('mousedown', this._bgMouseDownHandler); Htk.Toast.pushTop(bg); - Vn.Node.addClass(this.node, 'modal'); + this.node.classList.add('modal'); bg.appendChild(this.node); this.doc.body.appendChild(bg); @@ -125,26 +125,23 @@ module.exports = new Class({ style.height = ''; style.width = ''; - var margin = 20; - var dblMargin = margin * 2; - var width = node.offsetWidth; - var height = node.offsetHeight; - var innerWidth = window.innerWidth; - var innerHeight = window.innerHeight; + if (!this.isModal()) { + var margin = 20; + var dblMargin = margin * 2; + var width = node.offsetWidth; + var height = node.offsetHeight; + var innerWidth = window.innerWidth; + var innerHeight = window.innerHeight; + + if (width + dblMargin > innerWidth) { + width = innerWidth - dblMargin; + style.width = width +'px'; + } + if (height + dblMargin > innerHeight) { + height = innerHeight - dblMargin; + style.height = height +'px'; + } - if (width + dblMargin > innerWidth) { - width = innerWidth - dblMargin; - style.width = width +'px'; - } - if (height + dblMargin > innerHeight) { - height = innerHeight - dblMargin; - style.height = height +'px'; - } - - if (this.isModal()) { - style.marginLeft = (-node.offsetWidth / 2) +'px'; - style.marginTop = (-node.offsetHeight / 2) +'px'; - } else { var spacing = 4; var rect = this._parent.getBoundingClientRect(); var left = rect.left; diff --git a/js/htk/popup/style.scss b/js/htk/popup/style.scss index c89d5967..89a15908 100644 --- a/js/htk/popup/style.scss +++ b/js/htk/popup/style.scss @@ -10,10 +10,10 @@ box-sizing: content-box; &.modal { - position: absolute; + position: relative; font-size: 1.2em; - top: 50%; - left: 50%; + max-width: 100%; + max-height: 100%; } & > * { border-radius: 0.1em; @@ -21,11 +21,15 @@ } .htk-background { position: fixed; + display: flex; + align-items: center; + justify-content: center; left: 0; right: 0; top: 0; bottom: 0; z-index: 190; + padding: 20px; background-color: rgba(1, 1, 1, 0.7); opacity: 0; transition: opacity 200ms ease-in-out; diff --git a/js/htk/style/responsive.scss b/js/htk/style/responsive.scss index 8b55c2ad..2454e214 100644 --- a/js/htk/style/responsive.scss +++ b/js/htk/style/responsive.scss @@ -4,51 +4,51 @@ /* Standard */ @media screen { - body { font-size: 10pt; } + body { font-size: 14px; } } /* Desktop - Laptop 1360x768 */ @media (max-resolution: 119dpi) and (min-device-width: 1340px) and (max-device-width: 1899px) { - body { font-size: 10pt; } + body { font-size: 14px; } } /* Desktop - FHD 1920x1080 */ @media (max-resolution: 119dpi) and (min-device-width: 1900px) { - body { font-size: 10pt; } + body { font-size: 14px; } } /* Mobile - Low DPI */ @media (min-resolution: 120dpi), (-webkit-min-device-pixel-ratio: 1.5) { - body { font-size: 10pt; } + body { font-size: 14px; } } @media (min-resolution: 144dpi), (-webkit-min-device-pixel-ratio: 1.5) { - body { font-size: 10pt; } + body { font-size: 14px; } } /* Mobile - Normal DPI */ @media (max-device-width: 383px) and (min-resolution: 192dpi), (max-device-width: 383px) and (-webkit-min-device-pixel-ratio: 2) { - body { font-size: 10pt; } + body { font-size: 14px; } } @media (min-device-width: 384px) and (min-resolution: 192dpi), (min-device-width: 384px) and (-webkit-min-device-pixel-ratio: 2) { - body { font-size: 10pt; } + body { font-size: 14px; } } /* Mobile - High DPI */ @media (max-device-width: 411px) and (min-resolution: 249dpi), (max-device-width: 411px) and (-webkit-min-device-pixel-ratio: 3) { - body { font-size: 10pt; } + body { font-size: 14px; } } @media - (min-device-width: 412px) and (min-resolution: 249dpi), - (min-device-width: 412px) and (-webkit-min-device-pixel-ratio: 3) { - body { font-size: 10pt; } + (min-device-width: 414px) and (min-resolution: 249dpi), + (min-device-width: 414px) and (-webkit-min-device-pixel-ratio: 3) { + body { font-size: 14px; } } diff --git a/js/htk/style/style.scss b/js/htk/style/style.scss index 86dfc3db..801b8cc6 100644 --- a/js/htk/style/style.scss +++ b/js/htk/style/style.scss @@ -170,9 +170,8 @@ button, @extend %clickable; border: none; background-color: transparent; - padding: 10px; + padding: 8px; border-radius: 22px; - margin: -0.5em; font-weight: normal; &:disabled { diff --git a/js/vn/builder.js b/js/vn/builder.js index e918f0df..000d2082 100644 --- a/js/vn/builder.js +++ b/js/vn/builder.js @@ -186,7 +186,7 @@ module.exports = new Class({ return scope; } - ,link: function(scope, exprScope) { + ,link: function(scope) { const objects = scope.objects; const links = this._links; @@ -211,30 +211,22 @@ module.exports = new Class({ // Post-link - const baseExprScope = [ - _, - scope.$ - ].concat(exprScope); - - this.linkExpr(scope, baseExprScope); - const contexts = this._contexts; for (var i = 0; i < contexts.length; i++) { const context = contexts[i]; const object = objects[i]; if (context.tagName) - this.elementLink(context, object, objects, scope, baseExprScope); + this.elementLink(context, object, objects, scope); else if (context.klass) - this.objectLink(context, object, objects, scope, baseExprScope); + this.objectLink(context, object, objects, scope); } } - ,linkExpr(scope, baseScope, exprScope) { + ,digest(scope) { const contexts = this._contexts; const objects = scope.objects; - - exprScope = baseScope.concat(exprScope); + const exprScope = scope.exprScope; for (let i = 0; i < contexts.length; i++) { const context = contexts[i]; @@ -242,10 +234,16 @@ module.exports = new Class({ if (context.exprs) { const values = []; + let isEmpty = false; + for (expr of context.exprs) { let value = undefined; try { value = expr.apply(scope.thisArg, exprScope); + if (value == null) { + isEmpty = true; + break; + } } catch (e) { console.warn('Expression error:', e.message); continue; @@ -253,10 +251,16 @@ module.exports = new Class({ values.push(value); } - let k = 0; - const text = context.text.replace(/{{\d+}}/g, function() { - return values[k++]; - }); + let text; + + if (!isEmpty) { + let k = 0; + text = context.text.replace(/{{\d+}}/g, function() { + return values[k++]; + }); + } else + text = ''; + object.textContent = text; } else { const dynProps = context.dynProps; @@ -524,7 +528,7 @@ module.exports = new Class({ return object; } - ,objectLink: function(context, object, objects, scope, exprScope) { + ,objectLink: function(context, object, objects, scope) { const objectProps = context.objectProps; for (const prop in objectProps) object[prop] = objects[objectProps[prop]]; @@ -546,7 +550,7 @@ module.exports = new Class({ method = method.bind(scope.thisArg); } else { method = function() { - handler.apply(scope.thisArg, exprScope); + handler.apply(scope.thisArg, scope.exprScope); }; } @@ -566,7 +570,7 @@ module.exports = new Class({ this.showError(`Function '${handler}' not found`); } else { listener = function() { - handler.apply(scope.thisArg, exprScope.concat(arguments)); + handler.apply(scope.thisArg, scope.exprScope.concat(arguments)); }; } @@ -641,7 +645,7 @@ module.exports = new Class({ return object; } - ,elementLink: function(context, object, objects, scope, exprScope) { + ,elementLink: function(context, object, objects, scope) { const childs = context.childs; for (var i = 0; i < childs.length; i++) { let child = objects[childs[i]]; @@ -664,7 +668,7 @@ module.exports = new Class({ listener = listener.bind(scope.thisArg); } else { listener = function(e) { - handler.apply(scope.thisArg, exprScope.concat(e)); + handler.apply(scope.thisArg, scope.exprScope.concat(e)); }; } diff --git a/js/vn/mutators.js b/js/vn/mutators.js index 0c681e0c..a30a14ef 100644 --- a/js/vn/mutators.js +++ b/js/vn/mutators.js @@ -12,7 +12,7 @@ Mutators.Extends = function() { Mutators.Tag = function(tagName) { vnCustomTags[tagName] = this; this.extend({Tag: tagName}); - + const parent = this.parent; if (parent && parent.Classes !== undefined) { let Classes = tagName diff --git a/js/vn/scope.js b/js/vn/scope.js index 57b9771b..65a2656c 100644 --- a/js/vn/scope.js +++ b/js/vn/scope.js @@ -10,12 +10,14 @@ module.exports = new Class({ this.builder = builder; this.objects = objects; this.thisArg = thisArg; - this.parentScope = parent; + this.parent = parent; this.uid = ++scopeUid; this.$ = parent ? Object.create(parent.$) : {}; - if (!thisArg && parent) - this.thisArg = parent.thisArg; + if (parent) { + parent.on('lot-change', this.onLotChange, this); + if (!thisArg) this.thisArg = parent.thisArg; + } } ,link: function(exprScope, extraObjects) { @@ -26,7 +28,22 @@ module.exports = new Class({ for (var id in contextMap) this.$[id] = this.objects[contextMap[id]]; - this.builder.link(this, exprScope); + this.exprScope = [ + _, + this.$ + ].concat(exprScope); + + this.builder.link(this); + this.builder.digest(this); + + for (const object of this.objects) + if (object.assignLot) + object.on('change', this.onLotChange, this); + } + + ,onLotChange() { + this.emit('lot-change'); + this.builder.digest(this); } ,getMain: function() { @@ -47,11 +64,15 @@ module.exports = new Class({ } ,_destroy: function() { - var objects = this.objects; - - for (var i = 0; i < objects.length; i++) - if (objects[i] instanceof VnObject) - objects[i].unref(); + for (const object of this.objects) + if (object instanceof VnObject) { + object.disconnectByInstance(this); + object.unref(); + } + if (this.parent) { + this.parent.disconnectByInstance(this); + this.parent.unref(); + } VnObject.prototype._destroy.call(this); } diff --git a/package.json b/package.json index 652f0c42..20973eb9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.407.78", + "version": "1.407.79", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": {