Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
37
web_widget_mpld3_chart/static/src/js/web_widget_mpld3_chart.esm.js
Executable file
37
web_widget_mpld3_chart/static/src/js/web_widget_mpld3_chart.esm.js
Executable file
@@ -0,0 +1,37 @@
|
||||
import {Component, markup, onMounted, onPatched, onWillStart, useRef} from "@odoo/owl";
|
||||
import {loadJS} from "@web/core/assets";
|
||||
import {registry} from "@web/core/registry";
|
||||
|
||||
export default class Mpld3ChartJsonWidget extends Component {
|
||||
setup() {
|
||||
this.widget = useRef("widget");
|
||||
onPatched(() => {
|
||||
var script = document.createElement("script");
|
||||
script.text = this.props.record.data[this.props.name].script;
|
||||
this.widget.el.append(script);
|
||||
});
|
||||
onMounted(() => {
|
||||
var script = document.createElement("script");
|
||||
script.text = this.props.record.data[this.props.name].script;
|
||||
this.widget.el.append(script);
|
||||
});
|
||||
onWillStart(async () => {
|
||||
await loadJS("/web_widget_mpld3_chart/static/src/lib/d3/d3.v5.js");
|
||||
await loadJS(
|
||||
"/web_widget_mpld3_chart/static/src/lib/mpld3/mpld3.v0.5.10.js"
|
||||
);
|
||||
});
|
||||
}
|
||||
markup(value) {
|
||||
console.log("Marking up...");
|
||||
return markup(value);
|
||||
}
|
||||
}
|
||||
|
||||
Mpld3ChartJsonWidget.template = "web_widget_mpld3_chart.Mpld3ChartJsonWidget";
|
||||
|
||||
export const mpld3ChartJsonWidget = {
|
||||
component: Mpld3ChartJsonWidget,
|
||||
};
|
||||
|
||||
registry.category("fields").add("mpld3_chart", mpld3ChartJsonWidget);
|
||||
18568
web_widget_mpld3_chart/static/src/lib/d3/d3.v5.js
vendored
Executable file
18568
web_widget_mpld3_chart/static/src/lib/d3/d3.v5.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
2079
web_widget_mpld3_chart/static/src/lib/mpld3/mpld3.v0.5.10.js
Executable file
2079
web_widget_mpld3_chart/static/src/lib/mpld3/mpld3.v0.5.10.js
Executable file
File diff suppressed because it is too large
Load Diff
9
web_widget_mpld3_chart/static/src/xml/web_widget_mpld3_chart.xml
Executable file
9
web_widget_mpld3_chart/static/src/xml/web_widget_mpld3_chart.xml
Executable file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<templates xml:space="preserve">
|
||||
<div t-ref="widget" t-name="web_widget_mpld3_chart.Mpld3ChartJsonWidget">
|
||||
<t
|
||||
t-if="this.props.record.data[this.props.name].div"
|
||||
t-out="markup(this.props.record.data[this.props.name].div)"
|
||||
/>
|
||||
</div>
|
||||
</templates>
|
||||
Reference in New Issue
Block a user