diff --git a/web_pivot_computed_measure.zip b/web_pivot_computed_measure.zip deleted file mode 100644 index 0244e21ca76e..000000000000 Binary files a/web_pivot_computed_measure.zip and /dev/null differ diff --git a/web_widget_numeric_step/README.rst b/web_widget_numeric_step/README.rst new file mode 100644 index 000000000000..a15e05e63b13 --- /dev/null +++ b/web_widget_numeric_step/README.rst @@ -0,0 +1,157 @@ +======================= +Web Widget Numeric Step +======================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:1062d0c26bb10198c524113d70fa069c5928514e9569f607316544fee88bb6d9 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/18.0/web_widget_numeric_step + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_widget_numeric_step + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This widget changes input number field and make it easier to increment +the number thanks to 2 buttons (+ and -). Use JS native logic for input +number, so you can use the options ``min``, ``max``, ``step``, +``placeholder``. + +Demo available at Settings > Users & Companies > Users > \*Select One\* +> See 'Credit Limit' field + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +In your xml view, add ``widget="numeric_step"`` This will add the 2 +buttons "+" and "-" just next to the input field in edit mode. Iteration +step by default is 1. + +|image1| + +**Optional** + +Add an option to choose the step iteration and limits (min and max +values). + +Example for an 0.25 step, min to -1 and max to 10 : + +.. code:: xml + + days + +**Available Options** + +- step > Amount to increase/decrease (default: 1.0) +- min > Min. value allowed (default: no limit) +- max > Max. value allowed (default: no limit) +- auto_select > Select the content when the element get focus (default: + False) +- placeholder > Define the placeholder text (default: None) + +**Examples** + +Iteration with 0.25 step, min to -1 and max to 10. + +Start to increment with button, continue incrementing with scrolling +mouse. + +|image2| + +Iteration with 10 step, max limit 15, placeholder with onchange + +|image3| + +**Demo** + +You can test the feature by going to Settings > Technical > Scheduled +Actions. The field "Execute Every" is configured to use the widget with +2 step, min to 0 and max to 40. + +.. |image1| image:: https://raw.githubusercontent.com/OCA/web/18.0/web_widget_numeric_step/static/description/add_two_buttons.png +.. |image2| image:: https://raw.githubusercontent.com/OCA/web/18.0/web_widget_numeric_step/static/description/step0,25andlimits.gif +.. |image3| image:: https://raw.githubusercontent.com/OCA/web/18.0/web_widget_numeric_step/static/description/step10_limit15_placeholder117_with_onchange.gif + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* GRAP +* Tecnativa + +Contributors +------------ + +- `GRAP `__: + + - Quentin DUPONT + +- `Tecnativa `__: + + - Alexandre Díaz + - Carlos Roca + +- Helly kapatel +- Thanakrit Pintana +- Dhara Solanki + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px + :target: https://github.com/rafaelbn + :alt: rafaelbn +.. |maintainer-yajo| image:: https://github.com/yajo.png?size=40px + :target: https://github.com/yajo + :alt: yajo + +Current `maintainers `__: + +|maintainer-rafaelbn| |maintainer-yajo| + +This module is part of the `OCA/web `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_widget_numeric_step/__init__.py b/web_widget_numeric_step/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/web_widget_numeric_step/__manifest__.py b/web_widget_numeric_step/__manifest__.py new file mode 100644 index 000000000000..d1cf0ae3e2f5 --- /dev/null +++ b/web_widget_numeric_step/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2019 GRAP - Quentin DUPONT +# Copyright 2020 Tecnativa - Alexandre Díaz +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +{ + "name": "Web Widget Numeric Step", + "category": "web", + "version": "18.0.1.0.0", + "author": "GRAP, Tecnativa, Odoo Community Association (OCA)", + "license": "AGPL-3", + "website": "https://github.com/OCA/web", + "depends": ["web"], + "demo": ["demo/ir_cron.xml"], + "assets": { + "web.assets_backend": [ + "web_widget_numeric_step/static/src/*", + ], + }, + "maintainers": ["rafaelbn", "yajo"], + "auto_install": False, + "installable": True, +} diff --git a/web_widget_numeric_step/demo/ir_cron.xml b/web_widget_numeric_step/demo/ir_cron.xml new file mode 100644 index 000000000000..1a4f7bdc47ee --- /dev/null +++ b/web_widget_numeric_step/demo/ir_cron.xml @@ -0,0 +1,13 @@ + + + + ir.cron + + + + numeric_step + {'step': 2, 'min': 0, 'max': 40} + + + + diff --git a/web_widget_numeric_step/i18n/de.po b/web_widget_numeric_step/i18n/de.po new file mode 100644 index 000000000000..f4a401e7d441 --- /dev/null +++ b/web_widget_numeric_step/i18n/de.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_widget_numeric_step +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-10-13 20:46+0000\n" +"Last-Translator: Corneliuus \n" +"Language-Team: none\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.xml:0 +#, python-format +msgid "Minus" +msgstr "Minus" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.esm.js:0 +#, python-format +msgid "Numeric Step" +msgstr "" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.xml:0 +#, python-format +msgid "Plus" +msgstr "Plus" + +#, python-format +#~ msgid "Value" +#~ msgstr "Wert" diff --git a/web_widget_numeric_step/i18n/es.po b/web_widget_numeric_step/i18n/es.po new file mode 100644 index 000000000000..86632af6cb44 --- /dev/null +++ b/web_widget_numeric_step/i18n/es.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_widget_numeric_step +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-15 20:36+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.xml:0 +#, python-format +msgid "Minus" +msgstr "Menos" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.esm.js:0 +#, python-format +msgid "Numeric Step" +msgstr "Paso Numérico" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.xml:0 +#, python-format +msgid "Plus" +msgstr "Más" + +#, python-format +#~ msgid "Value" +#~ msgstr "Valor" diff --git a/web_widget_numeric_step/i18n/fr.po b/web_widget_numeric_step/i18n/fr.po new file mode 100644 index 000000000000..dc0e6d2e684e --- /dev/null +++ b/web_widget_numeric_step/i18n/fr.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_widget_number_ux_choice +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-08-30 12:07+0000\n" +"PO-Revision-Date: 2019-08-30 12:07+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.xml:0 +#, python-format +msgid "Minus" +msgstr "Moins" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.esm.js:0 +#, python-format +msgid "Numeric Step" +msgstr "" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.xml:0 +#, python-format +msgid "Plus" +msgstr "Plus" diff --git a/web_widget_numeric_step/i18n/it.po b/web_widget_numeric_step/i18n/it.po new file mode 100644 index 000000000000..ca3d5e88ee79 --- /dev/null +++ b/web_widget_numeric_step/i18n/it.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_widget_numeric_step +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-27 11:33+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.xml:0 +#, python-format +msgid "Minus" +msgstr "Meno" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.esm.js:0 +#, python-format +msgid "Numeric Step" +msgstr "Passo numerico" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.xml:0 +#, python-format +msgid "Plus" +msgstr "Più" + +#, python-format +#~ msgid "Value" +#~ msgstr "Valore" diff --git a/web_widget_numeric_step/i18n/web_widget_numeric_step.pot b/web_widget_numeric_step/i18n/web_widget_numeric_step.pot new file mode 100644 index 000000000000..925a5eac5208 --- /dev/null +++ b/web_widget_numeric_step/i18n/web_widget_numeric_step.pot @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_widget_numeric_step +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.xml:0 +#: code:addons/web_widget_numeric_step/static/src/numeric_step.xml:0 +#, python-format +msgid "Minus" +msgstr "" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.esm.js:0 +#, python-format +msgid "Numeric Step" +msgstr "" + +#. module: web_widget_numeric_step +#. odoo-javascript +#: code:addons/web_widget_numeric_step/static/src/numeric_step.xml:0 +#: code:addons/web_widget_numeric_step/static/src/numeric_step.xml:0 +#, python-format +msgid "Plus" +msgstr "" diff --git a/web_widget_numeric_step/pyproject.toml b/web_widget_numeric_step/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/web_widget_numeric_step/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/web_widget_numeric_step/readme/CONTRIBUTORS.md b/web_widget_numeric_step/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..3ab6f2745272 --- /dev/null +++ b/web_widget_numeric_step/readme/CONTRIBUTORS.md @@ -0,0 +1,8 @@ +- [GRAP](http://www.grap.coop): + - Quentin DUPONT \<\> +- [Tecnativa](https://www.tecnativa.com/): + - Alexandre Díaz + - Carlos Roca +- Helly kapatel \<\> +- Thanakrit Pintana \<\> +- Dhara Solanki \<\> diff --git a/web_widget_numeric_step/readme/DESCRIPTION.md b/web_widget_numeric_step/readme/DESCRIPTION.md new file mode 100644 index 000000000000..c679491a0098 --- /dev/null +++ b/web_widget_numeric_step/readme/DESCRIPTION.md @@ -0,0 +1,6 @@ +This widget changes input number field and make it easier to increment +the number thanks to 2 buttons (+ and -). Use JS native logic for input +number, so you can use the options `min`, `max`, `step`, `placeholder`. + +Demo available at Settings \> Users & Companies \> Users \> \*Select +One\* \> See 'Credit Limit' field diff --git a/web_widget_numeric_step/readme/USAGE.md b/web_widget_numeric_step/readme/USAGE.md new file mode 100644 index 000000000000..e95f2e4dc3d9 --- /dev/null +++ b/web_widget_numeric_step/readme/USAGE.md @@ -0,0 +1,44 @@ +In your xml view, add `widget="numeric_step"` This will add the 2 +buttons "+" and "-" just next to the input field in edit mode. Iteration +step by default is 1. + +![](../static/description/add_two_buttons.png) + +**Optional** + +Add an option to choose the step iteration and limits (min and max +values). + +Example for an 0.25 step, min to -1 and max to 10 : + +``` xml + days +``` + +**Available Options** + +- step \> Amount to increase/decrease (default: 1.0) +- min \> Min. value allowed (default: no limit) +- max \> Max. value allowed (default: no limit) +- auto_select \> Select the content when the element get focus (default: + False) +- placeholder \> Define the placeholder text (default: None) + +**Examples** + +Iteration with 0.25 step, min to -1 and max to 10. + +Start to increment with button, continue incrementing with scrolling +mouse. + +![](../static/description/step0,25andlimits.gif) + +Iteration with 10 step, max limit 15, placeholder with onchange + +![](../static/description/step10_limit15_placeholder117_with_onchange.gif) + +**Demo** + +You can test the feature by going to Settings > Technical > Scheduled Actions. The +field "Execute Every" is configured to use the widget with 2 step, min to 0 and max +to 40. \ No newline at end of file diff --git a/web_widget_numeric_step/static/description/add_two_buttons.png b/web_widget_numeric_step/static/description/add_two_buttons.png new file mode 100644 index 000000000000..7a60f2dea9bf Binary files /dev/null and b/web_widget_numeric_step/static/description/add_two_buttons.png differ diff --git a/web_widget_numeric_step/static/description/icon.png b/web_widget_numeric_step/static/description/icon.png new file mode 100644 index 000000000000..3a662b992dd6 Binary files /dev/null and b/web_widget_numeric_step/static/description/icon.png differ diff --git a/web_widget_numeric_step/static/description/index.html b/web_widget_numeric_step/static/description/index.html new file mode 100644 index 000000000000..beda192b7bfa --- /dev/null +++ b/web_widget_numeric_step/static/description/index.html @@ -0,0 +1,477 @@ + + + + + +Web Widget Numeric Step + + + +
+

Web Widget Numeric Step

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

This widget changes input number field and make it easier to increment +the number thanks to 2 buttons (+ and -). Use JS native logic for input +number, so you can use the options min, max, step, +placeholder.

+

Demo available at Settings > Users & Companies > Users > *Select One* +> See ‘Credit Limit’ field

+

Table of contents

+ +
+

Usage

+

In your xml view, add widget="numeric_step" This will add the 2 +buttons “+” and “-” just next to the input field in edit mode. Iteration +step by default is 1.

+

image1

+

Optional

+

Add an option to choose the step iteration and limits (min and max +values).

+

Example for an 0.25 step, min to -1 and max to 10 :

+
+<field name="sale_delay" widget="numeric_step" options="{'step': 0.25, 'min': -1, 'max': 10}" /> days
+
+

Available Options

+
    +
  • step > Amount to increase/decrease (default: 1.0)
  • +
  • min > Min. value allowed (default: no limit)
  • +
  • max > Max. value allowed (default: no limit)
  • +
  • auto_select > Select the content when the element get focus (default: +False)
  • +
  • placeholder > Define the placeholder text (default: None)
  • +
+

Examples

+

Iteration with 0.25 step, min to -1 and max to 10.

+

Start to increment with button, continue incrementing with scrolling +mouse.

+

image2

+

Iteration with 10 step, max limit 15, placeholder with onchange

+

image3

+

Demo

+

You can test the feature by going to Settings > Technical > Scheduled +Actions. The field “Execute Every” is configured to use the widget with +2 step, min to 0 and max to 40.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • GRAP
  • +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainers:

+

rafaelbn yajo

+

This module is part of the OCA/web project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/web_widget_numeric_step/static/description/step0,25andlimits.gif b/web_widget_numeric_step/static/description/step0,25andlimits.gif new file mode 100644 index 000000000000..ce6780e1b753 Binary files /dev/null and b/web_widget_numeric_step/static/description/step0,25andlimits.gif differ diff --git a/web_widget_numeric_step/static/description/step10_limit15_placeholder117_with_onchange.gif b/web_widget_numeric_step/static/description/step10_limit15_placeholder117_with_onchange.gif new file mode 100644 index 000000000000..709498e3cf32 Binary files /dev/null and b/web_widget_numeric_step/static/description/step10_limit15_placeholder117_with_onchange.gif differ diff --git a/web_widget_numeric_step/static/src/numeric_step.esm.js b/web_widget_numeric_step/static/src/numeric_step.esm.js new file mode 100644 index 000000000000..986c0d9dda84 --- /dev/null +++ b/web_widget_numeric_step/static/src/numeric_step.esm.js @@ -0,0 +1,89 @@ +/** @odoo-module */ + +import {_t} from "@web/core/l10n/translation"; +import {registry} from "@web/core/registry"; +import {FloatField} from "@web/views/fields/float/float_field"; +import {standardFieldProps} from "@web/views/fields/standard_field_props"; + +export class NumericStep extends FloatField { + setup() { + super.setup(); + } + _onStepClick(ev) { + const mode = ev.target.dataset.mode; + this._doStep(mode); + } + _onKeyDown(ev) { + if (ev.keyCode === 38) { + this._doStep("plus"); + } else if (ev.keyCode === 40) { + this._doStep("minus"); + } + } + _onWheel(ev) { + ev.preventDefault(); + if (!this._lastWheelTime) { + this._lastWheelTime = 0; + } + const now = Date.now(); + const throttleLimit = 100; + if (now - this._lastWheelTime >= throttleLimit) { + this._lastWheelTime = now; + + if (ev.deltaY > 0) { + this._doStep("minus"); + } else { + this._doStep("plus"); + } + } + } + updateField(val) { + return this.props.record.update({[this.props.name]: val}); + } + _doStep(mode) { + let cval = this.props.record.data[this.props.name]; + if (mode === "plus") { + cval += this.props.step; + } else if (mode === "minus") { + cval -= this.props.step; + } + if (cval < this.props.min) { + cval = this.props.min; + } else if (cval > this.props.max) { + cval = this.props.max; + } + this.updateField(cval); + } +} + +NumericStep.template = "web_widget_numeric_step"; +NumericStep.props = { + ...standardFieldProps, + inputType: {type: String, optional: true}, + step: {type: Number, optional: true}, + min: {type: Number, optional: true}, + max: {type: Number, optional: true}, + placeholder: {type: String, optional: true}, +}; +NumericStep.defaultProps = { + ...FloatField.defaultProps, + inputType: "text", +}; + +export const numericStep = { + component: NumericStep, + supportedTypes: ["float"], + displayName: _t("Numeric Step"), + extractProps: ({attrs, options}) => { + return { + name: attrs.name, + inputType: attrs.type, + step: options.step || 1, + min: options.min, + max: options.max, + placeholder: attrs.placeholder, + }; + }, +}; + +registry.category("fields").add("numeric_step", numericStep); diff --git a/web_widget_numeric_step/static/src/numeric_step.scss b/web_widget_numeric_step/static/src/numeric_step.scss new file mode 100644 index 000000000000..04a55184f07f --- /dev/null +++ b/web_widget_numeric_step/static/src/numeric_step.scss @@ -0,0 +1,22 @@ +// Copyright 2023 Moduon Team S.L. +// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +.widget_numeric_step { + // Hide the buttons until the user hovers if possible + @media (hover: hover) { + .btn_numeric_step { + visibility: hidden; + } + } + &:hover .btn_numeric_step { + visibility: visible; + } +} + +.o_numeric_step_cell { + // Default for old browsers + min-width: 15 * $btn-padding-x; + // Value hardcoded in `FIXED_FIELD_COLUMN_WIDTHS.float` + width of 2 + // FontAwesome icons + 2 buttons * 2 horizontal paddings + min-width: calc(92px + 2ex + 4 * #{$btn-padding-x}); +} diff --git a/web_widget_numeric_step/static/src/numeric_step.xml b/web_widget_numeric_step/static/src/numeric_step.xml new file mode 100644 index 000000000000..e8d6e75fe965 --- /dev/null +++ b/web_widget_numeric_step/static/src/numeric_step.xml @@ -0,0 +1,47 @@ + + +