physical-quantity 1.3.1 → 1.3.3
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 → README.md} +16 -2
- package/index.html +2 -1
- package/package.json +2 -3
package/{Readme.md → README.md}
RENAMED
|
@@ -41,6 +41,18 @@ By leveraging these custom elements, developers can easily incorporate sophistic
|
|
|
41
41
|
|
|
42
42
|
[](https://jsfiddle.net/hithere/tz8ym4fh/100/embedded/result)
|
|
43
43
|
|
|
44
|
+
## Use on WordPress
|
|
45
|
+
|
|
46
|
+
The `physical-quantity` components are available as a WordPress plugin [CalcsLive Unit Converter & Sizing Calculator for Product Pages](https://wordpress.org/plugins/calcslive-article-embed/) — no npm, no build step. Install once, then use the shortcodes anywhere in your content:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
[calcslive_qty value="25.4" unit="mm"]
|
|
50
|
+
[calcslive_qty value='2000' unit="g"]
|
|
51
|
+
[calcslive_qty value=2 unit="in"]
|
|
52
|
+
[calcslive_qty_pair values="10x20" unit="cm"]
|
|
53
|
+
[calcslive_qty_triplet values="(10, 20, 30)" unit="cm"]
|
|
54
|
+
```
|
|
55
|
+
|
|
44
56
|
## Installation
|
|
45
57
|
|
|
46
58
|
You can install the `physical-quantity` package using npm:
|
|
@@ -67,8 +79,10 @@ Include the following script tag in your HTML file:
|
|
|
67
79
|
### Using the Component
|
|
68
80
|
Add the `<physical-quantity>`, `<uc-qty>`, `<uc-qty-pair>`, or `<uc-qty-triplet>` tag to your HTML file:
|
|
69
81
|
```html
|
|
70
|
-
<physical-quantity value="25.4" unit="mm" decimal-places="4"></physical-quantity>
|
|
71
|
-
<uc-qty value="25.4" unit="mm" decimal-places="4"></uc-qty>
|
|
82
|
+
<physical-quantity value="25.4" unit="mm" decimal-places="4"></physical-quantity> <br>
|
|
83
|
+
<uc-qty value="25.4" unit="mm" decimal-places="4"></uc-qty> Value input with " " <br>
|
|
84
|
+
<uc-qty value='2.5' unit="kg" decimal-places="4"></uc-qty> Value input with ' ' <br>
|
|
85
|
+
<uc-qty value=2500 unit="mm" decimal-places="4"></uc-qty> Value input without quotes <br>
|
|
72
86
|
<uc-qty value="25.4" unit="mm" show-unit-arrow="false"></uc-qty> Compact mode, no arrow.<br>
|
|
73
87
|
<physical-quantity value="25.4" unit="mxm" decimal-places="2"></physical-quantity> Non-exist unit, shown as is.<br>
|
|
74
88
|
<physical-quantity value="25" unit="mm" decimal-places="2"></physical-quantity><br>
|
package/index.html
CHANGED
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
|
|
27
27
|
<h3>physical-quantity or uc-qty:</h3>
|
|
28
28
|
<physical-quantity value="25.4" unit="mm" decimal-places="4"></physical-quantity>
|
|
29
|
-
<uc-qty value="25.4" unit="mm" decimal-places="4"></uc-qty>
|
|
29
|
+
<uc-qty value="25.4" unit="mm" decimal-places="4"></uc-qty> Value input with text string. <br>
|
|
30
|
+
<uc-qty value=1 unit="in" decimal-places="4"></uc-qty> Value input with number. <br>
|
|
30
31
|
<uc-qty value="50" unit="mm" show-unit-arrow="false"></uc-qty> Compact mode, no arrow.<br>
|
|
31
32
|
<physical-quantity value="25.4" unit="mxm" decimal-places="2"></physical-quantity> Non-exist unit, shown as is.<br>
|
|
32
33
|
<physical-quantity value="25" unit="mm" decimal-places="2"></physical-quantity><br>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "physical-quantity",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "A web component bundle to represent physical quantities with automated unit conversion.",
|
|
5
5
|
"main": "dist/pq.umd.js",
|
|
6
6
|
"module": "dist/pq.es.js",
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
"test": "jest",
|
|
24
24
|
"tw": "jest --watch",
|
|
25
25
|
"test:watch": "jest --watch",
|
|
26
|
-
"release": "release-it"
|
|
27
|
-
"pub": "npm publish --access public"
|
|
26
|
+
"release": "release-it"
|
|
28
27
|
},
|
|
29
28
|
"release-it": {
|
|
30
29
|
"plugins": {
|