physical-quantity 1.1.25 → 1.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -7
- package/dist/pq.es.js +373 -1
- package/dist/pq.umd.js +1 -1
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Physical Quantity Web Component
|
|
2
2
|
|
|
3
|
-
`physical-quantity(alias: uc-qty for quantity with built-in unit conversion)
|
|
3
|
+
`physical-quantity`(alias: `uc-qty` for quantity with built-in unit conversion) is a web component that allows you to create and manipulate physical quantities with different units. It provides an input for the value and a dropdown for the unit, automatically converting between units in the same category.
|
|
4
4
|
|
|
5
5
|
It is a new HTML element for expressing physical quantities, featuring self-contained unit conversion, a compact and clean UI, no redundant dual units, and seamless integration across all websites and platforms.
|
|
6
6
|

|
|
7
7
|
|
|
8
8
|
## Features
|
|
9
9
|
|
|
10
|
-
- Create a physical quantity with a value and unit.
|
|
10
|
+
- Create a `physical quantity` with a value and unit.
|
|
11
11
|
- Automatically convert between units within the same category.
|
|
12
12
|
- Display values with customizable decimal places if not an integer; show integers without decimal parts.
|
|
13
13
|
- Easy to integrate into any web project.
|
|
@@ -28,6 +28,12 @@ npm install physical-quantity
|
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
## Usage
|
|
31
|
+
### For Web Visitors
|
|
32
|
+
The unit list displays available units for the physical quantity category. Users can easily switch between units to view the same quantity in different measurements.
|
|
33
|
+
|
|
34
|
+
When hovering over the unit list, an icon appears, providing access to a comprehensive unit converter. This tool allows users to convert quantities across 50+ categories.
|
|
35
|
+
|
|
36
|
+
### For Developers
|
|
31
37
|
After installation, you can import and use the physical-quantity component in your project.
|
|
32
38
|
|
|
33
39
|
### Importing the Component
|
|
@@ -85,9 +91,9 @@ Here's an example of how to use the component in an HTML file:
|
|
|
85
91
|
### Attributes
|
|
86
92
|
The physical-quantity component supports the following attributes:
|
|
87
93
|
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
94
|
+
- <ins>_value_</ins>: The initial value of the physical quantity. It can be any number.
|
|
95
|
+
- <ins>_unit_</ins>: The initial unit of the physical quantity. It must be a valid unit within the supported unit category (e.g., mm, cm, m, in, ft for length).
|
|
96
|
+
- <ins>_decimal-places_</ins>: web author can specify the decimal-places depending on the magnitude of the quantity. Default to be 3.
|
|
91
97
|
|
|
92
98
|
### Supported Units
|
|
93
99
|
Currently, the component supports the following categories and units:
|
|
@@ -127,6 +133,22 @@ Currently, the component supports the following categories and units:
|
|
|
127
133
|
- g/mm³
|
|
128
134
|
- lbm/ft³
|
|
129
135
|
- lbm/in³
|
|
136
|
+
- Time:
|
|
137
|
+
- s[second]
|
|
138
|
+
- s
|
|
139
|
+
- minute
|
|
140
|
+
- h
|
|
141
|
+
- h[hour]
|
|
142
|
+
- day
|
|
143
|
+
- week,
|
|
144
|
+
- ElectricalCurrent:
|
|
145
|
+
- A
|
|
146
|
+
- Ampere[amp]
|
|
147
|
+
- mA
|
|
148
|
+
- µA
|
|
149
|
+
- kA
|
|
150
|
+
- MA
|
|
151
|
+
- esu/s"
|
|
130
152
|
- ... (more to update.)
|
|
131
153
|
|
|
132
154
|
## License
|
|
@@ -136,8 +158,11 @@ This project is licensed under the MIT License. See the LICENSE file for more de
|
|
|
136
158
|
Contributions are welcome! Please contact the developer for any bugs, features, or improvements.
|
|
137
159
|
|
|
138
160
|
## Change Log
|
|
139
|
-
|
|
140
|
-
|
|
161
|
+
| Version | Date | Description |
|
|
162
|
+
|---|---|---|
|
|
163
|
+
| v1.1.28 |20240610| Tooltip for unit list provides a link to the unit converter page for all unit categories. Added more categories.|
|
|
164
|
+
| v1.1.21 |20240603| Added alias uc-qty. |
|
|
165
|
+
| v1.1.19 |20240602| Changed to umd for unpkg, and es for module. |
|
|
141
166
|
|
|
142
167
|
## Contact
|
|
143
168
|
If you have any questions or feedback, feel free to contact me at don.wen@yahoo.com.
|
package/dist/pq.es.js
CHANGED
|
@@ -1 +1,373 @@
|
|
|
1
|
-
function _0x338d(_0x4e209f,_0x19f8e7){const _0x2dae66=_0x2dae();return _0x338d=function(_0x338d70,_0x3a2071){_0x338d70=_0x338d70-0x1ae;let _0x336365=_0x2dae66[_0x338d70];return _0x336365;},_0x338d(_0x4e209f,_0x19f8e7);}const _0x1df461=_0x338d;function _0x2dae(){const _0x3763b7=['value','</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22unit-container\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<select>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','open','lbm','3aOYPph','innerHTML','ksi','unitConversion','9jWsjId','units','style','mm\x20HG','24DFLHTa','1127192TvfcpP','kg/L','https://firebasestorage.googleapis.com/v0/b/auto-calc-80237.appspot.com/o/shared%2Fassets%2Fimages%2Fe3d-logo2.png?alt=media&token=7064f466-6168-4b8a-b921-4e86115cb492','e3dLogoUrl','mbar','querySelectorAll','lbm/in³','bar','display','formatValue','\x0a\x20\x20\x20\x20\x20\x20<style>\x0a\x20\x20\x20\x20\x20\x20\x20\x20:host\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20inline-block;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.quantity\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20flex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.value\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin-left:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin-right:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cursor:\x20pointer;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.unit-container\x20select\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20inline-flex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20blue;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background-color:\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border:\x20none;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cursor:\x20pointer;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20.tooltip\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20absolute;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bottom:\x2075%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20left:\x2085%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20transform:\x20translateX(-50%);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20background-color:\x20#f5f5f5;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20border:\x201px\x20solid\x20#ccc;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20border-radius:\x204px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20none;\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2012px;\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.tooltip\x20a\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-decoration:\x20none;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20blue;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.tooltip\x20a:hover\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-decoration:\x20underline;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20</style>\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22quantity\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22value\x22\x20style=\x22position:\x20relative;\x22>','5254470rAYyRH','join','mouseout','1481008lCZyjy','tooltipTimeout','.unit-container','change','unitCategory','render','in\x20W.C.','898848qUBbql','bind','attachShadow','in\x20HG','MPa','handleUnitChange','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</select>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<a\x20class=\x22tooltip\x22\x20href=\x22https://v2-docs.donwen.com/\x22\x20target=\x22_blank\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<img\x20src=\x22','tagName','38699zqYuzB','m\x20W.C.','addEventListener','g/mm³','block','attributeChangedCallback','getUnitCategory','querySelector','cm\x20HG','atm','psf','>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','isInteger','none','GPa','pow','observedAttributes','decimal-places','uc-qty','decimalPlaces','1046328liSOlG','select','define','shadowRoot','</option>','target','toPrecision','35nqrvde','includes','closest','ksi[kip/in²]','toFixed','focus','removeEventListener','4qONgQl','1142670vacfQy','connectedCallback','\x22\x20width=\x2212\x22\x20/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</a>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20</div>\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20','kPa','disconnectedCallback','unit'];_0x2dae=function(){return _0x3763b7;};return _0x2dae();}(function(_0x51bef8,_0x5874c5){const _0x3762fc=_0x338d,_0x2285d0=_0x51bef8();while(!![]){try{const _0x4f0926=-parseInt(_0x3762fc(0x1e0))/0x1*(parseInt(_0x3762fc(0x1af))/0x2)+-parseInt(_0x3762fc(0x1ba))/0x3*(-parseInt(_0x3762fc(0x1d1))/0x4)+parseInt(_0x3762fc(0x1ce))/0x5+parseInt(_0x3762fc(0x1f4))/0x6+parseInt(_0x3762fc(0x1fb))/0x7*(-parseInt(_0x3762fc(0x1d8))/0x8)+parseInt(_0x3762fc(0x1be))/0x9*(-parseInt(_0x3762fc(0x1b0))/0xa)+parseInt(_0x3762fc(0x1c3))/0xb*(-parseInt(_0x3762fc(0x1c2))/0xc);if(_0x4f0926===_0x5874c5)break;else _0x2285d0['push'](_0x2285d0['shift']());}catch(_0x397162){_0x2285d0['push'](_0x2285d0['shift']());}}}(_0x2dae,0x9b8d9));const s=0.45359237,o=25.4/0x3e8,n=0xc*o,c=0x18bcd,a=133.322387415;class r extends HTMLElement{constructor(){const _0x9513e9=_0x338d;super(),this[_0x9513e9(0x1da)]({'mode':_0x9513e9(0x1b8)}),this[_0x9513e9(0x1b6)]=0x0,this[_0x9513e9(0x1b5)]='mm',this[_0x9513e9(0x1d5)]='Length',this[_0x9513e9(0x1d2)]=null,this[_0x9513e9(0x1f3)]=0x3,this[_0x9513e9(0x1c6)]=_0x9513e9(0x1c5),this[_0x9513e9(0x1bf)]={'Length':['m','km','cm','mm','in','ft'],'Mass':['g','kg',_0x9513e9(0x1b9)],'Pressure':['Pa',_0x9513e9(0x1b3),_0x9513e9(0x1dc),_0x9513e9(0x1ee),_0x9513e9(0x1ca),_0x9513e9(0x1c7),_0x9513e9(0x1e9),_0x9513e9(0x1c1),_0x9513e9(0x1e8),_0x9513e9(0x1db),'mm\x20W.C.',_0x9513e9(0x1e1),_0x9513e9(0x1d7),_0x9513e9(0x1ea),'psi',_0x9513e9(0x1bc),_0x9513e9(0x1fe)],'Density':['kg/m³',_0x9513e9(0x1c4),'g/cm³',_0x9513e9(0x1e3),'lbm/ft³',_0x9513e9(0x1c9)]},this['unitConversion']={'Length':{'m':0x1,'km':0x3e8,'cm':0.01,'mm':0.001,'in':o,'ft':n},'Mass':{'kg':0x1,'g':0.001,'lbm':s},'Pressure':{'Pa':0x1,'kPa':0x3e8,'MPa':0xf4240,'GPa':0x3b9aca00,'bar':0x64*0x3e8,'mbar':0x64,'atm':c,'mm\x20HG':a,'cm\x20HG':a*0xa,'in\x20HG':a*25.4,'mm\x20W.C.':0x1/0x3e8*0x3e8*9.80665,'m\x20W.C.':0x1*0x3e8*9.80665,'in\x20W.C.':o*0x3e8*9.80665,'psf':s*9.80665/Math[_0x9513e9(0x1ef)](n,0x2),'psi':s*9.80665/Math[_0x9513e9(0x1ef)](o,0x2),'ksi':s*9.80665/Math[_0x9513e9(0x1ef)](o,0x2)*0x3e8,'ksi[kip/in²]':s*9.80665/Math[_0x9513e9(0x1ef)](o,0x2)*0x3e8},'Density':{'kg/m³':0x1,'kg/L':0x3e8,'g/cm³':0x1/0x3e8/Math[_0x9513e9(0x1ef)](0.01,0x3),'g/mm³':0x1/0x3e8/Math['pow'](0.001,0x3),'lbm/ft³':s/Math[_0x9513e9(0x1ef)](n,0x3),'lbm/in³':s/Math[_0x9513e9(0x1ef)](o,0x3)}},this[_0x9513e9(0x1d6)]();}static get[_0x1df461(0x1f0)](){const _0x1326ba=_0x1df461;return[_0x1326ba(0x1b6),_0x1326ba(0x1b5),'decimal-places'];}[_0x1df461(0x1e5)](_0x311bdc,_0x530dc6,_0x341d11){const _0x126fbe=_0x1df461;_0x311bdc===_0x126fbe(0x1b6)?this['value']=parseFloat(_0x341d11):_0x311bdc==='unit'?(this['unit']=_0x341d11,this[_0x126fbe(0x1d5)]=this[_0x126fbe(0x1e6)](_0x341d11)):_0x311bdc===_0x126fbe(0x1f1)&&(this['decimalPlaces']=parseInt(_0x341d11)||0x3),this['render']();}[_0x1df461(0x1e6)](_0x469fd7){const _0x3c2c07=_0x1df461;for(const _0x240839 in this[_0x3c2c07(0x1bf)])if(this[_0x3c2c07(0x1bf)][_0x240839][_0x3c2c07(0x1fc)](_0x469fd7))return _0x240839;return null;}[_0x1df461(0x1b1)](){const _0xb1589e=_0x1df461;this[_0xb1589e(0x1f7)]['addEventListener'](_0xb1589e(0x1d4),this[_0xb1589e(0x1dd)][_0xb1589e(0x1d9)](this)),this[_0xb1589e(0x1d6)]();}[_0x1df461(0x1b4)](){const _0x1450f7=_0x1df461;this['shadowRoot'][_0x1450f7(0x1ae)](_0x1450f7(0x1d4),this[_0x1450f7(0x1dd)][_0x1450f7(0x1d9)](this));}['handleArrowClick'](_0x22f153){const _0x2610e9=_0x1df461;if(_0x22f153[_0x2610e9(0x1f9)][_0x2610e9(0x1fd)](_0x2610e9(0x1d3))){const _0x574b5b=this[_0x2610e9(0x1f7)][_0x2610e9(0x1e7)](_0x2610e9(0x1f5));_0x574b5b&&(_0x574b5b[_0x2610e9(0x200)](),_0x574b5b['click']());}}[_0x1df461(0x1dd)](_0x418ce7){const _0x387f6f=_0x1df461;if(_0x418ce7[_0x387f6f(0x1f9)][_0x387f6f(0x1df)]==='SELECT'){const _0x4f46e5=_0x418ce7[_0x387f6f(0x1f9)]['value'],_0xedf0ea=this['unitConversion'][this['unitCategory']][this[_0x387f6f(0x1b5)]]/this[_0x387f6f(0x1bd)][this['unitCategory']][_0x4f46e5];this[_0x387f6f(0x1b6)]=this['value']*_0xedf0ea,this[_0x387f6f(0x1b5)]=_0x4f46e5,this[_0x387f6f(0x1d6)]();}}[_0x1df461(0x1cc)](_0xa74156){const _0x44d984=_0x1df461;return Number[_0x44d984(0x1ec)](_0xa74156)?_0xa74156['toString']():Math['floor'](_0xa74156)!==0x0?_0xa74156[_0x44d984(0x1ff)](this[_0x44d984(0x1f3)])['replace'](/0+$/,'')['replace'](/\.$/,''):_0xa74156[_0x44d984(0x1fa)](0x3);}[_0x1df461(0x1d6)](){const _0x313fb2=_0x1df461;this['shadowRoot'][_0x313fb2(0x1bb)]=_0x313fb2(0x1cd)+this[_0x313fb2(0x1cc)](this[_0x313fb2(0x1b6)])+_0x313fb2(0x1b7)+this[_0x313fb2(0x1bf)][this[_0x313fb2(0x1d5)]]['map'](_0x4d62bc=>'<option\x20value=\x22'+_0x4d62bc+'\x22\x20'+(_0x4d62bc===this[_0x313fb2(0x1b5)]?'selected':'')+_0x313fb2(0x1eb)+_0x4d62bc+_0x313fb2(0x1f8))[_0x313fb2(0x1cf)]('')+_0x313fb2(0x1de)+this['e3dLogoUrl']+_0x313fb2(0x1b2);const _0x3fefb8=this['shadowRoot']['querySelector'](_0x313fb2(0x1d3)),_0x11ba32=this[_0x313fb2(0x1f7)][_0x313fb2(0x1c8)]('.tooltip')[0x0];_0x3fefb8[_0x313fb2(0x1e2)]('mouseover',()=>{const _0x18adad=_0x313fb2;this[_0x18adad(0x1d2)]=setTimeout(()=>{const _0x5665cf=_0x18adad;_0x11ba32[_0x5665cf(0x1c0)][_0x5665cf(0x1cb)]=_0x5665cf(0x1e4);},0x3e8);}),_0x3fefb8[_0x313fb2(0x1e2)](_0x313fb2(0x1d0),()=>{const _0x5df9fc=_0x313fb2;setTimeout(()=>{const _0x330c34=_0x338d;_0x11ba32[_0x330c34(0x1c0)][_0x330c34(0x1cb)]=_0x330c34(0x1ed);},0x3e8),clearTimeout(this[_0x5df9fc(0x1d2)]);}),_0x11ba32['addEventListener'](_0x313fb2(0x1d0),()=>{setTimeout(()=>{const _0x5639f7=_0x338d;_0x11ba32[_0x5639f7(0x1c0)][_0x5639f7(0x1cb)]=_0x5639f7(0x1ed);},0x3e8);});}}customElements[_0x1df461(0x1f6)]('physical-quantity',r);class h extends r{}customElements[_0x1df461(0x1f6)](_0x1df461(0x1f2),h);
|
|
1
|
+
function _0x1f76() {
|
|
2
|
+
const _0x102e4b = [
|
|
3
|
+
"<option\x20value=\x22",
|
|
4
|
+
"selected",
|
|
5
|
+
"SELECT",
|
|
6
|
+
"\x0a\x20\x20\x20\x20\x20\x20<style>\x0a\x20\x20\x20\x20\x20\x20\x20\x20:host\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20inline-block;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.quantity\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20flex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.value\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin-left:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin-right:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20cursor:\x20pointer;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20text-decoration:\x20underline;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.unit-container\x20select\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20inline-flex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20blue;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background-color:\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border:\x20none;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cursor:\x20pointer;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20.tooltip\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20absolute;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bottom:\x2075%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20left:\x2085%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20transform:\x20translateX(-50%);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20background-color:\x20#f5f5f5;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20border:\x201px\x20solid\x20#ccc;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20border-radius:\x204px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20none;\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2012px;\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.tooltip\x20a\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-decoration:\x20none;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20blue;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.tooltip\x20a:hover\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-decoration:\x20underline;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20</style>\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22quantity\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22value\x22\x20style=\x22position:\x20relative;\x22>",
|
|
7
|
+
"mm\x20W.C.",
|
|
8
|
+
"MPa",
|
|
9
|
+
"e3dLogoUrl",
|
|
10
|
+
"\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</select>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<a\x20class=\x22tooltip\x22\x20href=\x22https://v2-docs.donwen.com/daily-calculations/unit-converter.html\x22\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20title=\x22Unit\x20Converter\x20for\x20All\x20Categories\x22\x20target=\x22_blank\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<img\x20src=\x22",
|
|
11
|
+
"disconnectedCallback",
|
|
12
|
+
"unitCategory",
|
|
13
|
+
"toString",
|
|
14
|
+
"select",
|
|
15
|
+
"in\x20HG",
|
|
16
|
+
"getUnitCategory",
|
|
17
|
+
"lbm/in³",
|
|
18
|
+
"day",
|
|
19
|
+
"</option>",
|
|
20
|
+
"ksi",
|
|
21
|
+
"kPa",
|
|
22
|
+
"isInteger",
|
|
23
|
+
"mbar",
|
|
24
|
+
"Length",
|
|
25
|
+
"\x22\x20width=\x2212\x22\x20/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</a>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20</div>\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20",
|
|
26
|
+
"5586031gXaKwN",
|
|
27
|
+
"open",
|
|
28
|
+
"handleArrowClick",
|
|
29
|
+
"toPrecision",
|
|
30
|
+
"none",
|
|
31
|
+
"m\x20W.C.",
|
|
32
|
+
"1052112JyJynC",
|
|
33
|
+
"esu/s",
|
|
34
|
+
"shadowRoot",
|
|
35
|
+
"includes",
|
|
36
|
+
"decimal-places",
|
|
37
|
+
"change",
|
|
38
|
+
"kg/L",
|
|
39
|
+
"in\x20W.C.",
|
|
40
|
+
"h[hour]",
|
|
41
|
+
"display",
|
|
42
|
+
"bar",
|
|
43
|
+
"3639132yqLVJT",
|
|
44
|
+
"1662FoCryp",
|
|
45
|
+
"616eqDTxh",
|
|
46
|
+
"555BnxWir",
|
|
47
|
+
"3lSKTpX",
|
|
48
|
+
"week",
|
|
49
|
+
"lbm/ft³",
|
|
50
|
+
"define",
|
|
51
|
+
"243wuNgTe",
|
|
52
|
+
"minute",
|
|
53
|
+
"removeEventListener",
|
|
54
|
+
"pow",
|
|
55
|
+
"render",
|
|
56
|
+
"formatValue",
|
|
57
|
+
"unit",
|
|
58
|
+
"kg/m³",
|
|
59
|
+
"550qSUYFW",
|
|
60
|
+
"addEventListener",
|
|
61
|
+
"tagName",
|
|
62
|
+
"style",
|
|
63
|
+
"mouseout",
|
|
64
|
+
"tooltipTimeout",
|
|
65
|
+
"ksi[kip/in²]",
|
|
66
|
+
"lbm",
|
|
67
|
+
"bind",
|
|
68
|
+
"replace",
|
|
69
|
+
"connectedCallback",
|
|
70
|
+
"Ampere[amp]",
|
|
71
|
+
"decimalPlaces",
|
|
72
|
+
"s[second]",
|
|
73
|
+
"map",
|
|
74
|
+
"19686ZRCLXs",
|
|
75
|
+
"g/cm³",
|
|
76
|
+
"psi",
|
|
77
|
+
"querySelector",
|
|
78
|
+
"block",
|
|
79
|
+
".unit-container",
|
|
80
|
+
"986410YDaVbP",
|
|
81
|
+
"unitConversion",
|
|
82
|
+
"observedAttributes",
|
|
83
|
+
"join",
|
|
84
|
+
"value",
|
|
85
|
+
"GPa",
|
|
86
|
+
"uc-qty",
|
|
87
|
+
"floor",
|
|
88
|
+
"units",
|
|
89
|
+
"target",
|
|
90
|
+
"handleUnitChange",
|
|
91
|
+
"focus",
|
|
92
|
+
"g/mm³",
|
|
93
|
+
"physical-quantity",
|
|
94
|
+
];
|
|
95
|
+
_0x1f76 = function () {
|
|
96
|
+
return _0x102e4b;
|
|
97
|
+
};
|
|
98
|
+
return _0x1f76();
|
|
99
|
+
}
|
|
100
|
+
const _0x4b6c41 = _0x4250;
|
|
101
|
+
function _0x4250(_0x17483a, _0x249ee0) {
|
|
102
|
+
const _0x1f76b8 = _0x1f76();
|
|
103
|
+
return (
|
|
104
|
+
(_0x4250 = function (_0x4250f4, _0x4dc54e) {
|
|
105
|
+
_0x4250f4 = _0x4250f4 - 0xfb;
|
|
106
|
+
let _0x50e178 = _0x1f76b8[_0x4250f4];
|
|
107
|
+
return _0x50e178;
|
|
108
|
+
}),
|
|
109
|
+
_0x4250(_0x17483a, _0x249ee0)
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
(function (_0x2decea, _0x2c8163) {
|
|
113
|
+
const _0x333bb7 = _0x4250,
|
|
114
|
+
_0x50ea67 = _0x2decea();
|
|
115
|
+
while (!![]) {
|
|
116
|
+
try {
|
|
117
|
+
const _0x257bd9 =
|
|
118
|
+
(-parseInt(_0x333bb7(0x10c)) / 0x1) *
|
|
119
|
+
(-parseInt(_0x333bb7(0xfd)) / 0x2) +
|
|
120
|
+
(parseInt(_0x333bb7(0x100)) / 0x3) *
|
|
121
|
+
(parseInt(_0x333bb7(0x14c)) / 0x4) +
|
|
122
|
+
(-parseInt(_0x333bb7(0xff)) / 0x5) *
|
|
123
|
+
(parseInt(_0x333bb7(0x11b)) / 0x6) +
|
|
124
|
+
parseInt(_0x333bb7(0xfc)) / 0x7 +
|
|
125
|
+
(-parseInt(_0x333bb7(0xfe)) / 0x8) *
|
|
126
|
+
(parseInt(_0x333bb7(0x104)) / 0x9) +
|
|
127
|
+
-parseInt(_0x333bb7(0x121)) / 0xa +
|
|
128
|
+
-parseInt(_0x333bb7(0x146)) / 0xb;
|
|
129
|
+
if (_0x257bd9 === _0x2c8163) break;
|
|
130
|
+
else _0x50ea67["push"](_0x50ea67["shift"]());
|
|
131
|
+
} catch (_0x10108e) {
|
|
132
|
+
_0x50ea67["push"](_0x50ea67["shift"]());
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
})(_0x1f76, 0x413d6);
|
|
136
|
+
const s = 0.45359237,
|
|
137
|
+
o = 25.4 / 0x3e8,
|
|
138
|
+
n = 0xc * o,
|
|
139
|
+
c = 0x18bcd,
|
|
140
|
+
a = 133.322387415;
|
|
141
|
+
class r extends HTMLElement {
|
|
142
|
+
constructor() {
|
|
143
|
+
const _0x431f05 = _0x4250;
|
|
144
|
+
super(),
|
|
145
|
+
this["attachShadow"]({ mode: _0x431f05(0x147) }),
|
|
146
|
+
(this["value"] = 0x0),
|
|
147
|
+
(this["unit"] = "mm"),
|
|
148
|
+
(this[_0x431f05(0x138)] = _0x431f05(0x144)),
|
|
149
|
+
(this[_0x431f05(0x111)] = null),
|
|
150
|
+
(this[_0x431f05(0x118)] = 0x3),
|
|
151
|
+
(this["e3dLogoUrl"] =
|
|
152
|
+
"https://firebasestorage.googleapis.com/v0/b/auto-calc-80237.appspot.com/o/shared%2Fassets%2Fimages%2Fe3d-logo2.png?alt=media&token=7064f466-6168-4b8a-b921-4e86115cb492"),
|
|
153
|
+
(this[_0x431f05(0x129)] = {
|
|
154
|
+
Length: ["m", "km", "cm", "mm", "in", "ft"],
|
|
155
|
+
Mass: ["g", "kg", _0x431f05(0x113)],
|
|
156
|
+
Pressure: [
|
|
157
|
+
"Pa",
|
|
158
|
+
_0x431f05(0x141),
|
|
159
|
+
_0x431f05(0x134),
|
|
160
|
+
_0x431f05(0x126),
|
|
161
|
+
_0x431f05(0xfb),
|
|
162
|
+
_0x431f05(0x143),
|
|
163
|
+
"atm",
|
|
164
|
+
"mm\x20HG",
|
|
165
|
+
"cm\x20HG",
|
|
166
|
+
_0x431f05(0x13b),
|
|
167
|
+
_0x431f05(0x133),
|
|
168
|
+
_0x431f05(0x14b),
|
|
169
|
+
_0x431f05(0x153),
|
|
170
|
+
"psf",
|
|
171
|
+
_0x431f05(0x11d),
|
|
172
|
+
_0x431f05(0x140),
|
|
173
|
+
_0x431f05(0x112),
|
|
174
|
+
],
|
|
175
|
+
Density: [
|
|
176
|
+
_0x431f05(0x10b),
|
|
177
|
+
_0x431f05(0x152),
|
|
178
|
+
_0x431f05(0x11c),
|
|
179
|
+
_0x431f05(0x12d),
|
|
180
|
+
_0x431f05(0x102),
|
|
181
|
+
_0x431f05(0x13d),
|
|
182
|
+
],
|
|
183
|
+
Time: [
|
|
184
|
+
_0x431f05(0x119),
|
|
185
|
+
"s",
|
|
186
|
+
_0x431f05(0x105),
|
|
187
|
+
"h",
|
|
188
|
+
_0x431f05(0x154),
|
|
189
|
+
_0x431f05(0x13e),
|
|
190
|
+
_0x431f05(0x101),
|
|
191
|
+
],
|
|
192
|
+
ElectricalCurrent: [
|
|
193
|
+
"A",
|
|
194
|
+
_0x431f05(0x117),
|
|
195
|
+
"mA",
|
|
196
|
+
"µA",
|
|
197
|
+
"kA",
|
|
198
|
+
"MA",
|
|
199
|
+
_0x431f05(0x14d),
|
|
200
|
+
],
|
|
201
|
+
}),
|
|
202
|
+
(this[_0x431f05(0x122)] = {
|
|
203
|
+
Length: { m: 0x1, km: 0x3e8, cm: 0.01, mm: 0.001, in: o, ft: n },
|
|
204
|
+
Mass: { kg: 0x1, g: 0.001, lbm: s },
|
|
205
|
+
Pressure: {
|
|
206
|
+
Pa: 0x1,
|
|
207
|
+
kPa: 0x3e8,
|
|
208
|
+
MPa: 0xf4240,
|
|
209
|
+
GPa: 0x3b9aca00,
|
|
210
|
+
bar: 0x64 * 0x3e8,
|
|
211
|
+
mbar: 0x64,
|
|
212
|
+
atm: c,
|
|
213
|
+
"mm\x20HG": a,
|
|
214
|
+
"cm\x20HG": a * 0xa,
|
|
215
|
+
"in\x20HG": a * 25.4,
|
|
216
|
+
"mm\x20W.C.": (0x1 / 0x3e8) * 0x3e8 * 9.80665,
|
|
217
|
+
"m\x20W.C.": 0x1 * 0x3e8 * 9.80665,
|
|
218
|
+
"in\x20W.C.": o * 0x3e8 * 9.80665,
|
|
219
|
+
psf: (s * 9.80665) / Math[_0x431f05(0x107)](n, 0x2),
|
|
220
|
+
psi: (s * 9.80665) / Math[_0x431f05(0x107)](o, 0x2),
|
|
221
|
+
ksi: ((s * 9.80665) / Math[_0x431f05(0x107)](o, 0x2)) * 0x3e8,
|
|
222
|
+
"ksi[kip/in²]":
|
|
223
|
+
((s * 9.80665) / Math[_0x431f05(0x107)](o, 0x2)) * 0x3e8,
|
|
224
|
+
},
|
|
225
|
+
Density: {
|
|
226
|
+
"kg/m³": 0x1,
|
|
227
|
+
"kg/L": 0x3e8,
|
|
228
|
+
"g/cm³": 0x1 / 0x3e8 / Math[_0x431f05(0x107)](0.01, 0x3),
|
|
229
|
+
"g/mm³": 0x1 / 0x3e8 / Math["pow"](0.001, 0x3),
|
|
230
|
+
"lbm/ft³": s / Math[_0x431f05(0x107)](n, 0x3),
|
|
231
|
+
"lbm/in³": s / Math["pow"](o, 0x3),
|
|
232
|
+
},
|
|
233
|
+
Time: {
|
|
234
|
+
"s[second]": 0x1,
|
|
235
|
+
s: 0x1,
|
|
236
|
+
minute: 0x3c,
|
|
237
|
+
h: 0xe10,
|
|
238
|
+
"h[hour]": 0xe10,
|
|
239
|
+
day: 0xe10 * 0x18,
|
|
240
|
+
week: 0xe10 * 0x18 * 0x7,
|
|
241
|
+
},
|
|
242
|
+
ElectricalCurrent: {
|
|
243
|
+
A: 0x1,
|
|
244
|
+
"Ampere[amp]": 0x1,
|
|
245
|
+
mA: 0.001,
|
|
246
|
+
µA: 0.000001,
|
|
247
|
+
kA: 0x3e8,
|
|
248
|
+
MA: 0xf4240,
|
|
249
|
+
"esu/s": 0x1 / 0xb2d05e00,
|
|
250
|
+
},
|
|
251
|
+
}),
|
|
252
|
+
this[_0x431f05(0x108)]();
|
|
253
|
+
}
|
|
254
|
+
static get [_0x4b6c41(0x123)]() {
|
|
255
|
+
const _0x2066cc = _0x4b6c41;
|
|
256
|
+
return ["value", "unit", _0x2066cc(0x150)];
|
|
257
|
+
}
|
|
258
|
+
["attributeChangedCallback"](_0x78cea2, _0x143b0f, _0x7aeeca) {
|
|
259
|
+
const _0x30da38 = _0x4b6c41;
|
|
260
|
+
_0x78cea2 === _0x30da38(0x125)
|
|
261
|
+
? (this[_0x30da38(0x125)] = parseFloat(_0x7aeeca))
|
|
262
|
+
: _0x78cea2 === _0x30da38(0x10a)
|
|
263
|
+
? ((this[_0x30da38(0x10a)] = _0x7aeeca),
|
|
264
|
+
(this["unitCategory"] = this[_0x30da38(0x13c)](_0x7aeeca)))
|
|
265
|
+
: _0x78cea2 === _0x30da38(0x150) &&
|
|
266
|
+
(this["decimalPlaces"] = parseInt(_0x7aeeca) || 0x3),
|
|
267
|
+
this[_0x30da38(0x108)]();
|
|
268
|
+
}
|
|
269
|
+
["getUnitCategory"](_0x3f966e) {
|
|
270
|
+
const _0x45f4bc = _0x4b6c41;
|
|
271
|
+
for (const _0x26ef1e in this["units"])
|
|
272
|
+
if (this[_0x45f4bc(0x129)][_0x26ef1e][_0x45f4bc(0x14f)](_0x3f966e))
|
|
273
|
+
return _0x26ef1e;
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
[_0x4b6c41(0x116)]() {
|
|
277
|
+
const _0xe2203a = _0x4b6c41;
|
|
278
|
+
this[_0xe2203a(0x14e)][_0xe2203a(0x10d)](
|
|
279
|
+
_0xe2203a(0x151),
|
|
280
|
+
this[_0xe2203a(0x12b)]["bind"](this)
|
|
281
|
+
),
|
|
282
|
+
this[_0xe2203a(0x108)]();
|
|
283
|
+
}
|
|
284
|
+
[_0x4b6c41(0x137)]() {
|
|
285
|
+
const _0x4b95a5 = _0x4b6c41;
|
|
286
|
+
this[_0x4b95a5(0x14e)][_0x4b95a5(0x106)](
|
|
287
|
+
_0x4b95a5(0x151),
|
|
288
|
+
this[_0x4b95a5(0x12b)][_0x4b95a5(0x114)](this)
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
[_0x4b6c41(0x148)](_0x51979d) {
|
|
292
|
+
const _0x2d6b88 = _0x4b6c41;
|
|
293
|
+
if (_0x51979d["target"]["closest"](_0x2d6b88(0x120))) {
|
|
294
|
+
const _0x2b867f = this[_0x2d6b88(0x14e)][_0x2d6b88(0x11e)](
|
|
295
|
+
_0x2d6b88(0x13a)
|
|
296
|
+
);
|
|
297
|
+
_0x2b867f && (_0x2b867f[_0x2d6b88(0x12c)](), _0x2b867f["click"]());
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
[_0x4b6c41(0x12b)](_0x33c451) {
|
|
301
|
+
const _0x278602 = _0x4b6c41;
|
|
302
|
+
if (_0x33c451[_0x278602(0x12a)][_0x278602(0x10e)] === _0x278602(0x131)) {
|
|
303
|
+
const _0x12ed75 = _0x33c451[_0x278602(0x12a)][_0x278602(0x125)],
|
|
304
|
+
_0x970344 =
|
|
305
|
+
this[_0x278602(0x122)][this[_0x278602(0x138)]][
|
|
306
|
+
this[_0x278602(0x10a)]
|
|
307
|
+
] / this[_0x278602(0x122)][this[_0x278602(0x138)]][_0x12ed75];
|
|
308
|
+
(this[_0x278602(0x125)] = this[_0x278602(0x125)] * _0x970344),
|
|
309
|
+
(this[_0x278602(0x10a)] = _0x12ed75),
|
|
310
|
+
this["render"]();
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
["formatValue"](_0x5b4c11) {
|
|
314
|
+
const _0x1924fb = _0x4b6c41;
|
|
315
|
+
return Number[_0x1924fb(0x142)](_0x5b4c11)
|
|
316
|
+
? _0x5b4c11[_0x1924fb(0x139)]()
|
|
317
|
+
: Math[_0x1924fb(0x128)](_0x5b4c11) !== 0x0
|
|
318
|
+
? _0x5b4c11["toFixed"](this[_0x1924fb(0x118)])
|
|
319
|
+
[_0x1924fb(0x115)](/0+$/, "")
|
|
320
|
+
[_0x1924fb(0x115)](/\.$/, "")
|
|
321
|
+
: _0x5b4c11[_0x1924fb(0x149)](0x3);
|
|
322
|
+
}
|
|
323
|
+
["render"]() {
|
|
324
|
+
const _0x52b9bf = _0x4b6c41;
|
|
325
|
+
this[_0x52b9bf(0x14e)]["innerHTML"] =
|
|
326
|
+
_0x52b9bf(0x132) +
|
|
327
|
+
this[_0x52b9bf(0x109)](this[_0x52b9bf(0x125)]) +
|
|
328
|
+
"</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22unit-container\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<select>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" +
|
|
329
|
+
this["units"][this["unitCategory"]]
|
|
330
|
+
[_0x52b9bf(0x11a)](
|
|
331
|
+
(_0x2b379b) =>
|
|
332
|
+
_0x52b9bf(0x12f) +
|
|
333
|
+
_0x2b379b +
|
|
334
|
+
"\x22\x20" +
|
|
335
|
+
(_0x2b379b === this[_0x52b9bf(0x10a)] ? _0x52b9bf(0x130) : "") +
|
|
336
|
+
">\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" +
|
|
337
|
+
_0x2b379b +
|
|
338
|
+
_0x52b9bf(0x13f)
|
|
339
|
+
)
|
|
340
|
+
[_0x52b9bf(0x124)]("") +
|
|
341
|
+
_0x52b9bf(0x136) +
|
|
342
|
+
this[_0x52b9bf(0x135)] +
|
|
343
|
+
_0x52b9bf(0x145);
|
|
344
|
+
const _0x1ed17b =
|
|
345
|
+
this[_0x52b9bf(0x14e)]["querySelector"](".unit-container"),
|
|
346
|
+
_0x5dd3f8 = this[_0x52b9bf(0x14e)]["querySelectorAll"](".tooltip")[0x0];
|
|
347
|
+
_0x1ed17b[_0x52b9bf(0x10d)]("mouseover", () => {
|
|
348
|
+
const _0x5b79b5 = _0x52b9bf;
|
|
349
|
+
this[_0x5b79b5(0x111)] = setTimeout(() => {
|
|
350
|
+
const _0x3b827c = _0x5b79b5;
|
|
351
|
+
_0x5dd3f8[_0x3b827c(0x10f)]["display"] = _0x3b827c(0x11f);
|
|
352
|
+
}, 0x3e8);
|
|
353
|
+
}),
|
|
354
|
+
_0x1ed17b[_0x52b9bf(0x10d)](_0x52b9bf(0x110), () => {
|
|
355
|
+
const _0xc2a862 = _0x52b9bf;
|
|
356
|
+
setTimeout(() => {
|
|
357
|
+
const _0x5d5cff = _0x4250;
|
|
358
|
+
_0x5dd3f8[_0x5d5cff(0x10f)][_0x5d5cff(0x155)] = _0x5d5cff(0x14a);
|
|
359
|
+
}, 0x7d0),
|
|
360
|
+
clearTimeout(this[_0xc2a862(0x111)]);
|
|
361
|
+
}),
|
|
362
|
+
_0x5dd3f8[_0x52b9bf(0x10d)](_0x52b9bf(0x110), () => {
|
|
363
|
+
setTimeout(() => {
|
|
364
|
+
const _0x5aeb71 = _0x4250;
|
|
365
|
+
_0x5dd3f8[_0x5aeb71(0x10f)][_0x5aeb71(0x155)] = _0x5aeb71(0x14a);
|
|
366
|
+
}, 0x7d0);
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
customElements[_0x4b6c41(0x103)](_0x4b6c41(0x12e), r);
|
|
371
|
+
class m extends r {}
|
|
372
|
+
customElements[_0x4b6c41(0x103)](_0x4b6c41(0x127), m);
|
|
373
|
+
export { r as default };
|
package/dist/pq.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x5594(_0x2fdfb1,_0x287d37){const _0xddf3e5=_0xddf3();return _0x5594=function(_0x5594ee,_0x2dac99){_0x5594ee=_0x5594ee-0x18f;let _0x21454f=_0xddf3e5[_0x5594ee];return _0x21454f;},_0x5594(_0x2fdfb1,_0x287d37);}(function(_0x5af819,_0xa6293a){const _0x3cde88=_0x5594,_0x5b2fbd=_0x5af819();while(!![]){try{const _0x429cbb=parseInt(_0x3cde88(0x1b2))/0x1*(parseInt(_0x3cde88(0x1e3))/0x2)+parseInt(_0x3cde88(0x1b8))/0x3+parseInt(_0x3cde88(0x1c1))/0x4*(-parseInt(_0x3cde88(0x1e1))/0x5)+parseInt(_0x3cde88(0x1bb))/0x6*(-parseInt(_0x3cde88(0x1e8))/0x7)+parseInt(_0x3cde88(0x1bf))/0x8+-parseInt(_0x3cde88(0x193))/0x9*(parseInt(_0x3cde88(0x1c9))/0xa)+-parseInt(_0x3cde88(0x1ba))/0xb*(-parseInt(_0x3cde88(0x1dc))/0xc);if(_0x429cbb===_0xa6293a)break;else _0x5b2fbd['push'](_0x5b2fbd['shift']());}catch(_0x53496f){_0x5b2fbd['push'](_0x5b2fbd['shift']());}}}(_0xddf3,0x7fed9),function(_0x33f870){const _0x5c52e5=_0x5594;typeof define==_0x5c52e5(0x198)&&define[_0x5c52e5(0x1c7)]?define(_0x33f870):_0x33f870();}(function(){'use strict';const _0x406ae4=_0x5594;const _0x2c5a78=0.45359237,_0x4eaaf9=25.4/0x3e8,_0x4660ab=0xc*_0x4eaaf9,_0x161bfa=0x18bcd,_0x5ae5f4=133.322387415;class _0x1e6783 extends HTMLElement{constructor(){const _0x49b087=_0x5594;super(),this[_0x49b087(0x1da)]({'mode':_0x49b087(0x1d7)}),this[_0x49b087(0x1e6)]=0x0,this['unit']='mm',this[_0x49b087(0x19d)]='Length',this[_0x49b087(0x1de)]=null,this[_0x49b087(0x1be)]=0x3,this[_0x49b087(0x190)]=_0x49b087(0x1b3),this[_0x49b087(0x1d4)]={'Length':['m','km','cm','mm','in','ft'],'Mass':['g','kg','lbm'],'Pressure':['Pa',_0x49b087(0x1af),_0x49b087(0x1cd),_0x49b087(0x1b9),_0x49b087(0x197),_0x49b087(0x1cc),'atm',_0x49b087(0x1e0),_0x49b087(0x1d0),_0x49b087(0x1a0),'mm\x20W.C.',_0x49b087(0x1a5),_0x49b087(0x1c3),_0x49b087(0x1e2),'psi',_0x49b087(0x1df),_0x49b087(0x1a3)],'Density':[_0x49b087(0x19b),_0x49b087(0x1a8),_0x49b087(0x1aa),_0x49b087(0x192),_0x49b087(0x1d8),_0x49b087(0x1dd)]},this[_0x49b087(0x1b6)]={'Length':{'m':0x1,'km':0x3e8,'cm':0.01,'mm':0.001,'in':_0x4eaaf9,'ft':_0x4660ab},'Mass':{'kg':0x1,'g':0.001,'lbm':_0x2c5a78},'Pressure':{'Pa':0x1,'kPa':0x3e8,'MPa':0xf4240,'GPa':0x3b9aca00,'bar':0x64*0x3e8,'mbar':0x64,'atm':_0x161bfa,'mm\x20HG':_0x5ae5f4,'cm\x20HG':_0x5ae5f4*0xa,'in\x20HG':_0x5ae5f4*25.4,'mm\x20W.C.':0x1/0x3e8*0x3e8*9.80665,'m\x20W.C.':0x1*0x3e8*9.80665,'in\x20W.C.':_0x4eaaf9*0x3e8*9.80665,'psf':_0x2c5a78*9.80665/Math[_0x49b087(0x1ad)](_0x4660ab,0x2),'psi':_0x2c5a78*9.80665/Math['pow'](_0x4eaaf9,0x2),'ksi':_0x2c5a78*9.80665/Math[_0x49b087(0x1ad)](_0x4eaaf9,0x2)*0x3e8,'ksi[kip/in²]':_0x2c5a78*9.80665/Math['pow'](_0x4eaaf9,0x2)*0x3e8},'Density':{'kg/m³':0x1,'kg/L':0x3e8,'g/cm³':0x1/0x3e8/Math['pow'](0.01,0x3),'g/mm³':0x1/0x3e8/Math['pow'](0.001,0x3),'lbm/ft³':_0x2c5a78/Math['pow'](_0x4660ab,0x3),'lbm/in³':_0x2c5a78/Math[_0x49b087(0x1ad)](_0x4eaaf9,0x3)}},this['render']();}static get[_0x406ae4(0x1b4)](){const _0x5236f5=_0x406ae4;return[_0x5236f5(0x1e6),_0x5236f5(0x19a),_0x5236f5(0x199)];}[_0x406ae4(0x1bc)](_0x3f9129,_0x4788a7,_0x5b0287){const _0x5d020d=_0x406ae4;_0x3f9129===_0x5d020d(0x1e6)?this['value']=parseFloat(_0x5b0287):_0x3f9129==='unit'?(this[_0x5d020d(0x19a)]=_0x5b0287,this[_0x5d020d(0x19d)]=this['getUnitCategory'](_0x5b0287)):_0x3f9129===_0x5d020d(0x199)&&(this[_0x5d020d(0x1be)]=parseInt(_0x5b0287)||0x3),this[_0x5d020d(0x1d1)]();}[_0x406ae4(0x191)](_0x190f02){const _0x2280c5=_0x406ae4;for(const _0x38fa80 in this[_0x2280c5(0x1d4)])if(this[_0x2280c5(0x1d4)][_0x38fa80][_0x2280c5(0x1bd)](_0x190f02))return _0x38fa80;return null;}[_0x406ae4(0x1d5)](){const _0xed4911=_0x406ae4;this[_0xed4911(0x196)]['addEventListener'](_0xed4911(0x1e5),this['handleUnitChange'][_0xed4911(0x1a9)](this)),this[_0xed4911(0x1d1)]();}[_0x406ae4(0x19f)](){const _0x4e2cd2=_0x406ae4;this[_0x4e2cd2(0x196)][_0x4e2cd2(0x1ab)]('change',this[_0x4e2cd2(0x195)][_0x4e2cd2(0x1a9)](this));}[_0x406ae4(0x1a1)](_0x5d1caf){const _0x9b8815=_0x406ae4;if(_0x5d1caf['target']['closest'](_0x9b8815(0x1ae))){const _0x2a1c1f=this[_0x9b8815(0x196)][_0x9b8815(0x1b0)](_0x9b8815(0x1d2));_0x2a1c1f&&(_0x2a1c1f['focus'](),_0x2a1c1f['click']());}}[_0x406ae4(0x195)](_0x98c1a8){const _0x90427e=_0x406ae4;if(_0x98c1a8[_0x90427e(0x1e7)][_0x90427e(0x1ca)]==='SELECT'){const _0x3bfb88=_0x98c1a8[_0x90427e(0x1e7)][_0x90427e(0x1e6)],_0x2b6ac1=this[_0x90427e(0x1b6)][this['unitCategory']][this[_0x90427e(0x19a)]]/this[_0x90427e(0x1b6)][this['unitCategory']][_0x3bfb88];this[_0x90427e(0x1e6)]=this[_0x90427e(0x1e6)]*_0x2b6ac1,this[_0x90427e(0x19a)]=_0x3bfb88,this['render']();}}[_0x406ae4(0x1db)](_0x24f9c1){const _0x235fa7=_0x406ae4;return Number[_0x235fa7(0x1a4)](_0x24f9c1)?_0x24f9c1[_0x235fa7(0x1d3)]():Math[_0x235fa7(0x1c2)](_0x24f9c1)!==0x0?_0x24f9c1[_0x235fa7(0x18f)](this[_0x235fa7(0x1be)])[_0x235fa7(0x19e)](/0+$/,'')[_0x235fa7(0x19e)](/\.$/,''):_0x24f9c1[_0x235fa7(0x1a6)](0x3);}[_0x406ae4(0x1d1)](){const _0x5b6aaa=_0x406ae4;this[_0x5b6aaa(0x196)]['innerHTML']=_0x5b6aaa(0x1a2)+this[_0x5b6aaa(0x1db)](this[_0x5b6aaa(0x1e6)])+_0x5b6aaa(0x1b7)+this[_0x5b6aaa(0x1d4)][this[_0x5b6aaa(0x19d)]][_0x5b6aaa(0x1e9)](_0xaf4f3d=>_0x5b6aaa(0x1b5)+_0xaf4f3d+'\x22\x20'+(_0xaf4f3d===this[_0x5b6aaa(0x19a)]?_0x5b6aaa(0x1cb):'')+_0x5b6aaa(0x1c6)+_0xaf4f3d+_0x5b6aaa(0x1ce))[_0x5b6aaa(0x19c)]('')+_0x5b6aaa(0x1c0)+this['e3dLogoUrl']+_0x5b6aaa(0x1ac);const _0x1e332a=this[_0x5b6aaa(0x196)][_0x5b6aaa(0x1b0)](_0x5b6aaa(0x1ae)),_0x5e6d35=this[_0x5b6aaa(0x196)][_0x5b6aaa(0x1c5)](_0x5b6aaa(0x194))[0x0];_0x1e332a[_0x5b6aaa(0x1c4)](_0x5b6aaa(0x1b1),()=>{this['tooltipTimeout']=setTimeout(()=>{const _0x47303c=_0x5594;_0x5e6d35[_0x47303c(0x1c8)][_0x47303c(0x1e4)]=_0x47303c(0x1d6);},0x3e8);}),_0x1e332a['addEventListener']('mouseout',()=>{setTimeout(()=>{const _0x524eb8=_0x5594;_0x5e6d35[_0x524eb8(0x1c8)][_0x524eb8(0x1e4)]='none';},0x3e8),clearTimeout(this['tooltipTimeout']);}),_0x5e6d35[_0x5b6aaa(0x1c4)]('mouseout',()=>{setTimeout(()=>{const _0x572be8=_0x5594;_0x5e6d35[_0x572be8(0x1c8)][_0x572be8(0x1e4)]=_0x572be8(0x1cf);},0x3e8);});}}customElements[_0x406ae4(0x1d9)]('physical-quantity',_0x1e6783);class _0x4cc7df extends _0x1e6783{}customElements['define'](_0x406ae4(0x1a7),_0x4cc7df);}));function _0xddf3(){const _0x588241=['getUnitCategory','g/mm³','666NsoRpO','.tooltip','handleUnitChange','shadowRoot','bar','function','decimal-places','unit','kg/m³','join','unitCategory','replace','disconnectedCallback','in\x20HG','handleArrowClick','\x0a\x20\x20\x20\x20\x20\x20<style>\x0a\x20\x20\x20\x20\x20\x20\x20\x20:host\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20inline-block;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.quantity\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20flex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.value\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin-left:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin-right:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cursor:\x20pointer;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.unit-container\x20select\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20inline-flex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20blue;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background-color:\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border:\x20none;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cursor:\x20pointer;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20.tooltip\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20absolute;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bottom:\x2075%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20left:\x2085%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20transform:\x20translateX(-50%);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20background-color:\x20#f5f5f5;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20border:\x201px\x20solid\x20#ccc;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20border-radius:\x204px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20none;\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2012px;\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.tooltip\x20a\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-decoration:\x20none;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20blue;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.tooltip\x20a:hover\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-decoration:\x20underline;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20</style>\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22quantity\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22value\x22\x20style=\x22position:\x20relative;\x22>','ksi[kip/in²]','isInteger','m\x20W.C.','toPrecision','uc-qty','kg/L','bind','g/cm³','removeEventListener','\x22\x20width=\x2212\x22\x20/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</a>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20</div>\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20','pow','.unit-container','kPa','querySelector','mouseover','6990wsbRrL','https://firebasestorage.googleapis.com/v0/b/auto-calc-80237.appspot.com/o/shared%2Fassets%2Fimages%2Fe3d-logo2.png?alt=media&token=7064f466-6168-4b8a-b921-4e86115cb492','observedAttributes','<option\x20value=\x22','unitConversion','</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22unit-container\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<select>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','1868178XlunYr','GPa','552266XgwrOt','2258184DubyPr','attributeChangedCallback','includes','decimalPlaces','5851792UKQXSH','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</select>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<a\x20class=\x22tooltip\x22\x20href=\x22https://v2-docs.donwen.com/\x22\x20target=\x22_blank\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<img\x20src=\x22','22412kVvdyQ','floor','in\x20W.C.','addEventListener','querySelectorAll','>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','amd','style','9820qsFEAP','tagName','selected','mbar','MPa','</option>','none','cm\x20HG','render','select','toString','units','connectedCallback','block','open','lbm/ft³','define','attachShadow','formatValue','24JryJvO','lbm/in³','tooltipTimeout','ksi','mm\x20HG','805SJnUAs','psf','228YhDVKh','display','change','value','target','14cAnVZi','map','toFixed','e3dLogoUrl'];_0xddf3=function(){return _0x588241;};return _0xddf3();}
|
|
1
|
+
function _0x2f97(){const _0x504d43=['g/mm³','focus','in\x20HG','\x22\x20width=\x2212\x22\x20/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</a>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20</div>\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20','selected','formatValue','</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22unit-container\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<select>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','psf','lbm/in³','display','kPa','MPa','.unit-container','style','isInteger','map','function','bind','toPrecision','exports','https://firebasestorage.googleapis.com/v0/b/auto-calc-80237.appspot.com/o/shared%2Fassets%2Fimages%2Fe3d-logo2.png?alt=media&token=7064f466-6168-4b8a-b921-4e86115cb492','decimal-places','block','kg/L','126jmeyhb','handleArrowClick','\x0a\x20\x20\x20\x20\x20\x20<style>\x0a\x20\x20\x20\x20\x20\x20\x20\x20:host\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20inline-block;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.quantity\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20flex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.value\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin-left:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin-right:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20cursor:\x20pointer;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20text-decoration:\x20underline;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.unit-container\x20select\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20inline-flex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20blue;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background-color:\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border:\x20none;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin:\x200.25em;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cursor:\x20pointer;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20.tooltip\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20absolute;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bottom:\x2075%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20left:\x2085%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20transform:\x20translateX(-50%);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20background-color:\x20#f5f5f5;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20border:\x201px\x20solid\x20#ccc;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20border-radius:\x204px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20none;\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2012px;\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.tooltip\x20a\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-decoration:\x20none;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20blue;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.tooltip\x20a:hover\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-decoration:\x20underline;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20</style>\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22quantity\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22value\x22\x20style=\x22position:\x20relative;\x22>','133fBFcPE','kg/m³','attributeChangedCallback','join','render','esu/s','ksi','toFixed','Length','closest','tooltipTimeout','target','define','m\x20W.C.','23204zulCMR','minute','unitConversion','uc-qty','removeEventListener','mouseout','unit','handleUnitChange','lbm','140053nBMkkZ','floor','toString','addEventListener','50802TDhjkm','object','10794112qiExsm','e3dLogoUrl','12ZITUhQ','pow','change','Ampere[amp]','decimalPlaces','replace','mouseover','1050970dWjBzI','</option>','amd','units','4080005bYMzSP','1135152IfbEOQ','select','observedAttributes','unitCategory','s[second]','atm','bar','getUnitCategory','attachShadow','week','innerHTML','includes','psi','g/cm³','PhysicalQuantity','value','cm\x20HG','shadowRoot','connectedCallback'];_0x2f97=function(){return _0x504d43;};return _0x2f97();}function _0x39ba(_0x470944,_0x14dee2){const _0x2f97be=_0x2f97();return _0x39ba=function(_0x39baef,_0x1e377d){_0x39baef=_0x39baef-0x1e2;let _0x22f67c=_0x2f97be[_0x39baef];return _0x22f67c;},_0x39ba(_0x470944,_0x14dee2);}(function(_0x4b6a67,_0x271ceb){const _0x4e8d2f=_0x39ba,_0x448f46=_0x4b6a67();while(!![]){try{const _0x33e414=-parseInt(_0x4e8d2f(0x1e3))/0x1+-parseInt(_0x4e8d2f(0x233))/0x2*(-parseInt(_0x4e8d2f(0x1eb))/0x3)+parseInt(_0x4e8d2f(0x1f7))/0x4+parseInt(_0x4e8d2f(0x1f6))/0x5+-parseInt(_0x4e8d2f(0x1e7))/0x6*(parseInt(_0x4e8d2f(0x225))/0x7)+parseInt(_0x4e8d2f(0x1e9))/0x8+parseInt(_0x4e8d2f(0x222))/0x9*(-parseInt(_0x4e8d2f(0x1f2))/0xa);if(_0x33e414===_0x271ceb)break;else _0x448f46['push'](_0x448f46['shift']());}catch(_0x205fb5){_0x448f46['push'](_0x448f46['shift']());}}}(_0x2f97,0xb08e9),function(_0x61a185,_0x4ecb5e){const _0x386f16=_0x39ba;typeof exports==_0x386f16(0x1e8)&&typeof module<'u'?module[_0x386f16(0x21d)]=_0x4ecb5e():typeof define==_0x386f16(0x21a)&&define[_0x386f16(0x1f4)]?define(_0x4ecb5e):(_0x61a185=typeof globalThis<'u'?globalThis:_0x61a185||self,_0x61a185[_0x386f16(0x205)]=_0x4ecb5e());}(this,function(){'use strict';const _0x153a09=_0x39ba;const _0x50ca24=0.45359237,_0x4c3494=25.4/0x3e8,_0x2c3907=0xc*_0x4c3494,_0x25ec30=0x18bcd,_0x5d0dac=133.322387415;class _0x265891 extends HTMLElement{constructor(){const _0x5a5051=_0x39ba;super(),this[_0x5a5051(0x1ff)]({'mode':'open'}),this[_0x5a5051(0x206)]=0x0,this['unit']='mm',this[_0x5a5051(0x1fa)]=_0x5a5051(0x22d),this[_0x5a5051(0x22f)]=null,this[_0x5a5051(0x1ef)]=0x3,this[_0x5a5051(0x1ea)]=_0x5a5051(0x21e),this['units']={'Length':['m','km','cm','mm','in','ft'],'Mass':['g','kg',_0x5a5051(0x1e2)],'Pressure':['Pa',_0x5a5051(0x214),_0x5a5051(0x215),'GPa',_0x5a5051(0x1fd),'mbar',_0x5a5051(0x1fc),'mm\x20HG',_0x5a5051(0x207),_0x5a5051(0x20c),'mm\x20W.C.',_0x5a5051(0x232),'in\x20W.C.',_0x5a5051(0x211),_0x5a5051(0x203),_0x5a5051(0x22b),'ksi[kip/in²]'],'Density':[_0x5a5051(0x226),_0x5a5051(0x221),_0x5a5051(0x204),_0x5a5051(0x20a),'lbm/ft³',_0x5a5051(0x212)],'Time':[_0x5a5051(0x1fb),'s',_0x5a5051(0x234),'h','h[hour]','day',_0x5a5051(0x200)],'ElectricalCurrent':['A',_0x5a5051(0x1ee),'mA','µA','kA','MA',_0x5a5051(0x22a)]},this[_0x5a5051(0x235)]={'Length':{'m':0x1,'km':0x3e8,'cm':0.01,'mm':0.001,'in':_0x4c3494,'ft':_0x2c3907},'Mass':{'kg':0x1,'g':0.001,'lbm':_0x50ca24},'Pressure':{'Pa':0x1,'kPa':0x3e8,'MPa':0xf4240,'GPa':0x3b9aca00,'bar':0x64*0x3e8,'mbar':0x64,'atm':_0x25ec30,'mm\x20HG':_0x5d0dac,'cm\x20HG':_0x5d0dac*0xa,'in\x20HG':_0x5d0dac*25.4,'mm\x20W.C.':0x1/0x3e8*0x3e8*9.80665,'m\x20W.C.':0x1*0x3e8*9.80665,'in\x20W.C.':_0x4c3494*0x3e8*9.80665,'psf':_0x50ca24*9.80665/Math[_0x5a5051(0x1ec)](_0x2c3907,0x2),'psi':_0x50ca24*9.80665/Math['pow'](_0x4c3494,0x2),'ksi':_0x50ca24*9.80665/Math[_0x5a5051(0x1ec)](_0x4c3494,0x2)*0x3e8,'ksi[kip/in²]':_0x50ca24*9.80665/Math[_0x5a5051(0x1ec)](_0x4c3494,0x2)*0x3e8},'Density':{'kg/m³':0x1,'kg/L':0x3e8,'g/cm³':0x1/0x3e8/Math[_0x5a5051(0x1ec)](0.01,0x3),'g/mm³':0x1/0x3e8/Math['pow'](0.001,0x3),'lbm/ft³':_0x50ca24/Math[_0x5a5051(0x1ec)](_0x2c3907,0x3),'lbm/in³':_0x50ca24/Math[_0x5a5051(0x1ec)](_0x4c3494,0x3)},'Time':{'s[second]':0x1,'s':0x1,'minute':0x3c,'h':0xe10,'h[hour]':0xe10,'day':0xe10*0x18,'week':0xe10*0x18*0x7},'ElectricalCurrent':{'A':0x1,'Ampere[amp]':0x1,'mA':0.001,'µA':0.000001,'kA':0x3e8,'MA':0xf4240,'esu/s':0x1/0xb2d05e00}},this[_0x5a5051(0x229)]();}static get[_0x153a09(0x1f9)](){const _0x28209e=_0x153a09;return[_0x28209e(0x206),'unit',_0x28209e(0x21f)];}[_0x153a09(0x227)](_0x4d3c9c,_0x4ca1cb,_0x3c83a7){const _0x3da4b5=_0x153a09;_0x4d3c9c===_0x3da4b5(0x206)?this[_0x3da4b5(0x206)]=parseFloat(_0x3c83a7):_0x4d3c9c===_0x3da4b5(0x239)?(this[_0x3da4b5(0x239)]=_0x3c83a7,this[_0x3da4b5(0x1fa)]=this[_0x3da4b5(0x1fe)](_0x3c83a7)):_0x4d3c9c==='decimal-places'&&(this[_0x3da4b5(0x1ef)]=parseInt(_0x3c83a7)||0x3),this[_0x3da4b5(0x229)]();}[_0x153a09(0x1fe)](_0x23271b){const _0x188331=_0x153a09;for(const _0x2e326d in this[_0x188331(0x1f5)])if(this[_0x188331(0x1f5)][_0x2e326d][_0x188331(0x202)](_0x23271b))return _0x2e326d;return null;}[_0x153a09(0x209)](){const _0x52b68b=_0x153a09;this[_0x52b68b(0x208)][_0x52b68b(0x1e6)](_0x52b68b(0x1ed),this[_0x52b68b(0x23a)][_0x52b68b(0x21b)](this)),this[_0x52b68b(0x229)]();}['disconnectedCallback'](){const _0x10e55f=_0x153a09;this[_0x10e55f(0x208)][_0x10e55f(0x237)](_0x10e55f(0x1ed),this['handleUnitChange'][_0x10e55f(0x21b)](this));}[_0x153a09(0x223)](_0x1bd387){const _0x303c82=_0x153a09;if(_0x1bd387['target'][_0x303c82(0x22e)]('.unit-container')){const _0x4d0178=this[_0x303c82(0x208)]['querySelector'](_0x303c82(0x1f8));_0x4d0178&&(_0x4d0178[_0x303c82(0x20b)](),_0x4d0178['click']());}}[_0x153a09(0x23a)](_0x2429c8){const _0x47edde=_0x153a09;if(_0x2429c8[_0x47edde(0x230)]['tagName']==='SELECT'){const _0x4226ff=_0x2429c8[_0x47edde(0x230)][_0x47edde(0x206)],_0x55554b=this[_0x47edde(0x235)][this[_0x47edde(0x1fa)]][this[_0x47edde(0x239)]]/this[_0x47edde(0x235)][this[_0x47edde(0x1fa)]][_0x4226ff];this['value']=this[_0x47edde(0x206)]*_0x55554b,this[_0x47edde(0x239)]=_0x4226ff,this['render']();}}[_0x153a09(0x20f)](_0x44f266){const _0x291355=_0x153a09;return Number[_0x291355(0x218)](_0x44f266)?_0x44f266[_0x291355(0x1e5)]():Math[_0x291355(0x1e4)](_0x44f266)!==0x0?_0x44f266[_0x291355(0x22c)](this['decimalPlaces'])['replace'](/0+$/,'')[_0x291355(0x1f0)](/\.$/,''):_0x44f266[_0x291355(0x21c)](0x3);}['render'](){const _0xa612ba=_0x153a09;this[_0xa612ba(0x208)][_0xa612ba(0x201)]=_0xa612ba(0x224)+this[_0xa612ba(0x20f)](this[_0xa612ba(0x206)])+_0xa612ba(0x210)+this[_0xa612ba(0x1f5)][this[_0xa612ba(0x1fa)]][_0xa612ba(0x219)](_0x1edad3=>'<option\x20value=\x22'+_0x1edad3+'\x22\x20'+(_0x1edad3===this[_0xa612ba(0x239)]?_0xa612ba(0x20e):'')+'>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x1edad3+_0xa612ba(0x1f3))[_0xa612ba(0x228)]('')+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</select>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<a\x20class=\x22tooltip\x22\x20href=\x22https://v2-docs.donwen.com/daily-calculations/unit-converter.html\x22\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20title=\x22Unit\x20Converter\x20for\x20All\x20Categories\x22\x20target=\x22_blank\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<img\x20src=\x22'+this[_0xa612ba(0x1ea)]+_0xa612ba(0x20d);const _0x1efaa0=this['shadowRoot']['querySelector'](_0xa612ba(0x216)),_0x329502=this[_0xa612ba(0x208)]['querySelectorAll']('.tooltip')[0x0];_0x1efaa0[_0xa612ba(0x1e6)](_0xa612ba(0x1f1),()=>{const _0x3095a7=_0xa612ba;this[_0x3095a7(0x22f)]=setTimeout(()=>{const _0x38fd36=_0x3095a7;_0x329502[_0x38fd36(0x217)][_0x38fd36(0x213)]=_0x38fd36(0x220);},0x3e8);}),_0x1efaa0[_0xa612ba(0x1e6)](_0xa612ba(0x238),()=>{const _0x896d24=_0xa612ba;setTimeout(()=>{const _0x396d10=_0x39ba;_0x329502[_0x396d10(0x217)]['display']='none';},0x7d0),clearTimeout(this[_0x896d24(0x22f)]);}),_0x329502[_0xa612ba(0x1e6)](_0xa612ba(0x238),()=>{setTimeout(()=>{const _0x4ea2d9=_0x39ba;_0x329502[_0x4ea2d9(0x217)]['display']='none';},0x7d0);});}}customElements[_0x153a09(0x231)]('physical-quantity',_0x265891);class _0x4f025e extends _0x265891{}return customElements['define'](_0x153a09(0x236),_0x4f025e),_0x265891;}));
|
package/package.json
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "physical-quantity",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.28",
|
|
4
4
|
"description": "A web component to represent a physical quantity with unit conversion.",
|
|
5
|
-
"main": "
|
|
6
|
-
"module": "
|
|
5
|
+
"main": "dist/pq.umd.js",
|
|
6
|
+
"module": "dist/pq.es.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/pq.es.js",
|
|
10
|
+
"require": "./dist/pq.umd.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
7
13
|
"files": [
|
|
8
14
|
"dist/"
|
|
9
15
|
],
|