mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-08 14:30:05 +01:00
deprecated and replace attributes: needed-->required, blur-->placeholder in preprocessor
remove client-side code for them and enable translation of placeholder
This commit is contained in:
parent
d5dc3cff2b
commit
3b896e0919
@ -82,6 +82,20 @@ const Et2InputWidgetMixin = (superclass) =>
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of properties that get translated
|
||||||
|
* Done separately to not interfere with properties - if we re-define label property,
|
||||||
|
* labels go missing.
|
||||||
|
* @returns object
|
||||||
|
*/
|
||||||
|
static get translate()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
...super.translate,
|
||||||
|
placeholder: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compatibility for deprecated name "needed"
|
* Compatibility for deprecated name "needed"
|
||||||
*
|
*
|
||||||
|
@ -1243,7 +1243,6 @@ export function loadWebComponent(_nodeName : string, _template_node, parent : Et
|
|||||||
*/
|
*/
|
||||||
function transformAttributes(widget, mgr : et2_arrayMgr, attributes)
|
function transformAttributes(widget, mgr : et2_arrayMgr, attributes)
|
||||||
{
|
{
|
||||||
|
|
||||||
const widget_class = window.customElements.get(widget.localName);
|
const widget_class = window.customElements.get(widget.localName);
|
||||||
|
|
||||||
// Apply any set attributes - widget will do its own coercion
|
// Apply any set attributes - widget will do its own coercion
|
||||||
@ -1251,24 +1250,12 @@ function transformAttributes(widget, mgr : et2_arrayMgr, attributes)
|
|||||||
{
|
{
|
||||||
let attrValue = attributes[attribute];
|
let attrValue = attributes[attribute];
|
||||||
|
|
||||||
// If there is not attribute set, ignore it. Widget sets its own default.
|
// If there is no attribute set, ignore it. Widget sets its own default.
|
||||||
if(typeof attrValue === "undefined")
|
if(typeof attrValue === "undefined")
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// "needed" is deprecated, use "required"
|
|
||||||
if(attribute == "needed")
|
|
||||||
{
|
|
||||||
attribute = "required";
|
|
||||||
}
|
|
||||||
// Skip these ones
|
|
||||||
// options is legacy / read-only
|
|
||||||
if(["options"].indexOf(attribute) > -1)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const property = widget_class.getPropertyOptions(attribute);
|
const property = widget_class.getPropertyOptions(attribute);
|
||||||
|
|
||||||
switch(typeof property === "object" ? property.type : property)
|
switch(typeof property === "object" ? property.type : property)
|
||||||
|
Loading…
Reference in New Issue
Block a user