physical-quantity 1.1.92 → 1.2.2

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/index.html ADDED
@@ -0,0 +1,70 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Physical Quantity Web Component</title>
7
+ <script type="module" defer>
8
+ // src="./src/index.js"
9
+ import { PhysicalQuantity } from './src/index.js';
10
+ </script>
11
+ <!-- <script type="module" src="./dist/pq.es.js" defer></script> -->
12
+ </head>
13
+ <body>
14
+ <h3>uc-qty-pair:</h3>
15
+ pair values="10x20" unit="cm" =><uc-qty-pair values="10x20" unit="cm"></uc-qty-pair> // for 2D dimensions <br>
16
+ pair values="(10, 20)" unit="cm" =><uc-qty-pair values="(10, 20)" unit="cm"></uc-qty-pair> // for 2D coordinates or range <br>
17
+ pair values="10x20" unit="cm" decimal-places="3" =><uc-qty-pair values="10x20" unit="cm" decimal-places="3"></uc-qty-pair> <br>
18
+ pair values="10.1234x20" unit="cm" decimal-places="5" =><uc-qty-pair values="10.1234x20" unit="cm" decimal-places="5"></uc-qty-pair> <br>
19
+
20
+ <h3>uc-qty-triplet:</h3>
21
+ triplet values="10x20x30" unit="cm" =><uc-qty-triplet values="10x20x30" unit="cm"></uc-qty-triplet> // for 3D dimensions <br>
22
+ triplet values="(10, 20, 30)" unit="cm" =><uc-qty-triplet values="(10, 20, 30)" unit="cm"></uc-qty-triplet> // for 3D coordinates <br>
23
+ triplet values="10x20x30" unit="cm" decimal-places="3" =><uc-qty-triplet values="10x20x30" unit="cm" decimal-places="3"></uc-qty-triplet> <br>
24
+
25
+ <br>
26
+
27
+ <h3>physical-quantity or uc-qty:</h3>
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>
30
+ <uc-qty value="50" unit="mm" show-unit-arrow="false"></uc-qty> Compact mode, no arrow.<br>
31
+ <physical-quantity value="25.4" unit="mxm" decimal-places="2"></physical-quantity> Non-exist unit, shown as is.<br>
32
+ <physical-quantity value="25" unit="mm" decimal-places="2"></physical-quantity><br>
33
+ <physical-quantity value="25" unit="mm" decimal-places="3"></physical-quantity> 3 digits<br>
34
+ <physical-quantity value="25" unit="mm" decimal-places="4"></physical-quantity> 4 digits<br>
35
+ <physical-quantity value="25" unit="mm" decimal-places="5"></physical-quantity> 5 digits<br>
36
+ <physical-quantity value="1500" unit="g"></physical-quantity> <br>
37
+ <physical-quantity value="1500" unit="psf"></physical-quantity> <br>
38
+ <physical-quantity value="137.16" unit="cm"></physical-quantity>x
39
+ <physical-quantity value="137.16" unit="cm"></physical-quantity>x
40
+ <physical-quantity value="91.44" unit="cm"></physical-quantity><br>
41
+ <uc-qty-triplet values="10x20x30" unit="cm"></uc-qty-triplet><br>
42
+ <physical-quantity value="800" unit="kg/m³"></physical-quantity><br>
43
+ <physical-quantity value="800" unit="kg/m³" show-unit-arrow="false"></physical-quantity>Compact mode, no arrow.<br>
44
+ <uc-qty value="91" unit="cm"></uc-qty><br>
45
+ <uc-qty value="2" unit="minute"></uc-qty><br>
46
+ <uc-qty value="2" unit="A"></uc-qty> Default with arrow.<br>
47
+ <uc-qty value="2" unit="A" show-unit-arrow="false"></uc-qty>Compact mode, no arrow.<br>
48
+ <uc-qty value="37.778" unit="°C" show-unit-arrow="false"></uc-qty>Compact mode, no arrow.<br>
49
+ <uc-qty value="100" unit="°F"></uc-qty><br>
50
+ <uc-qty value="2'-3" unit="ft-in"></uc-qty>For Feet-Inches unit<br>
51
+ <physical-quantity value="2'-3 3/16" unit="ft-in" ></physical-quantity>
52
+ <physical-quantity value="2" unit="ft-in"></physical-quantity>
53
+ <physical-quantity value="2'-3" unit="ft-in" ></physical-quantity><br>
54
+ <physical-quantity value="10" unit="kgf" ></physical-quantity>
55
+ <physical-quantity value="10" unit="Volt" ></physical-quantity><br>
56
+ <uc-qty value="1" unit="fluid ounce(US-liquid)" decimal-places="3"></uc-qty><br>
57
+ <uc-qty value="1" unit="fluid ounce(UK-imperial)" decimal-places="3"></uc-qty><br>
58
+ <uc-qty value="1" unit="cup(US-liquid)" decimal-places="3"></uc-qty><br>
59
+ <uc-qty value="1" unit="cup(Legal)" decimal-places="3"></uc-qty><br>
60
+ <uc-qty value="1" unit="cup(Metric)" decimal-places="3"></uc-qty><br>
61
+ <uc-qty value="1" unit="cup(Imperial)" decimal-places="3"></uc-qty><br>
62
+ <uc-qty value="8000" unit="Btu(AC)" decimal-places="3"></uc-qty>
63
+
64
+ <div> <!-- demo in paragraph -->
65
+ It's like how we all know what <uc-qty value='1' unit="kg"> </uc-qty> or <uc-qty value='10' unit="kg" > </uc-qty> feels like, but most people struggle to intuitively grasp the weight of a Model Y (about <uc-qty value='2000' unit="kg"> </uc-qty>) compared to a human body (about <uc-qty value='75' unit="kg"> </uc-qty>), let alone the weight of an airplane or an aircraft carrier. We need calculations to truly comprehend these differences.<br>
66
+
67
+ </div>
68
+
69
+ </body>
70
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "physical-quantity",
3
- "version": "1.1.92",
3
+ "version": "1.2.2",
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",
@@ -11,7 +11,9 @@
11
11
  }
12
12
  },
13
13
  "files": [
14
- "dist/"
14
+ "dist/",
15
+ "index.html",
16
+ "CHANGELOG.md"
15
17
  ],
16
18
  "scripts": {
17
19
  "d": "vite",
@@ -20,7 +22,29 @@
20
22
  "t": "jest",
21
23
  "test": "jest",
22
24
  "tw": "jest --watch",
23
- "test:watch": "jest --watch"
25
+ "test:watch": "jest --watch",
26
+ "release": "release-it",
27
+ "pub": "npm publish --access public"
28
+ },
29
+ "release-it": {
30
+ "plugins": {
31
+ "@release-it/conventional-changelog": {
32
+ "infile": "CHANGELOG.md",
33
+ "preset": "conventionalcommits"
34
+ }
35
+ },
36
+ "hooks": {
37
+ "before:init": "yarn b"
38
+ },
39
+ "git": {
40
+ "commitMessage": "chore: release v${version}"
41
+ },
42
+ "npm": {
43
+ "publish": true,
44
+ "publishArgs": [
45
+ "--access public"
46
+ ]
47
+ }
24
48
  },
25
49
  "keywords": [
26
50
  "web-component",
@@ -28,20 +52,22 @@
28
52
  "unit conversion",
29
53
  "unit converter"
30
54
  ],
31
- "author": "E3d - Don Wen <don.wen@yahoo.com>",
55
+ "author": "E3d - Don Wen <don.wen@calcslive.com>",
32
56
  "license": "MIT",
33
- "devDependencies": {
34
- "@vitejs/plugin-legacy": "^5.4.1",
35
- "vite": "^5.2.12",
36
- "jest": "^27.5.1",
57
+ "devDependencies": {
37
58
  "@babel/core": "^7.14.0",
38
59
  "@babel/preset-env": "^7.14.0",
39
- "babel-jest": "^27.5.1",
60
+ "@release-it/conventional-changelog": "^10.0.6",
40
61
  "@testing-library/dom": "^8.0.0",
41
62
  "@testing-library/jest-dom": "^5.14.0",
42
- "jest-environment-jsdom": "^27.5.1"
63
+ "@vitejs/plugin-legacy": "^5.4.1",
64
+ "babel-jest": "^27.5.1",
65
+ "jest": "^27.5.1",
66
+ "jest-environment-jsdom": "^27.5.1",
67
+ "release-it": "^19.2.4",
68
+ "vite": "^5.2.12"
43
69
  },
44
70
  "maintainers": [
45
- "Don Wen <don.wen@yahoo.com>"
71
+ "Don Wen <don.wen@calcslive.com>"
46
72
  ]
47
73
  }