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/CHANGELOG.md ADDED
@@ -0,0 +1,29 @@
1
+ # Changelog
2
+
3
+ | Version | Date | Description |
4
+ |---|---|---|
5
+ | v1.1.93 |20260410| Updated uc-qty-pair & uc-qty-triplet for consistency and 2 styles: x-format and tuple. |
6
+ | v1.1.92 |20251001| Power unit W[Watt] changed to W. |
7
+ | v1.1.91 |20251001| Power unit Btu(AC) for air conditioner. |
8
+ | v1.1.90 |20250120| Volume unit 'mL' to 'ml'. |
9
+ | v1.1.88 |20241016| Code optimized. |
10
+ | v1.1.85 |20241015| Bug fixes. |
11
+ | v1.1.81 |20241014| Added uc-qty-pair & uc-qty-triplet. |
12
+ | v1.1.80 |20241013| Minor bug fixes. |
13
+ | v1.1.75 |20241010| Added more ounces and cups for volume. |
14
+ | v1.1.70 |20240810| Fine-tuned style. Checked usage of PQ element in Vue 3 app. Works with both unpkg and npm installation. |
15
+ | v1.1.68 |20240722| Readme update with Technical Writing example. |
16
+ | v1.1.67 |20240721| Number formatting with comma, eg: 20000 to 23,000; bug fixes. |
17
+ | v1.1.60 |20240721| A main refactoring. |
18
+ | v1.1.52 |20240718| Added category "Electrical Potential Difference (Voltage)".|
19
+ | v1.1.50 |20240716| Corrected decimal point format, default to 2.|
20
+ | v1.1.47 |20240712| Added flow rate (volume) category.|
21
+ | v1.1.46 |20240629| Added more categories; add notes for mass/weight differences.|
22
+ | v1.1.43 |20240623| Added more categories.|
23
+ | v1.1.41 |20240620| Added Force category.|
24
+ | v1.1.40 |20240619| Added *ft-in* (ie: Foot-Inch) in Length category.|
25
+ | v1.1.35 |20240616| Added temperature category.|
26
+ | v1.1.30 |20240615| Added "show-unit-arrow" prop to allow web author to create a compact UI; Unit width is now responsive to the chosen unit; Author can force init unit.|
27
+ | v1.1.28 |20240610| Tooltip for unit list provides a link to the unit converter page for all unit categories. Added more categories.|
28
+ | v1.1.21 |20240603| Added alias uc-qty. |
29
+ | v1.1.19 |20240602| Changed to umd for unpkg, and es for module. |
package/README.md CHANGED
@@ -6,9 +6,9 @@ This package introduces three custom HTML elements designed for expressing and m
6
6
 
7
7
  - `<physical-quantity>` (alias: `<uc-qty>`) A versatile component for single quantities, featuring a value input and a unit dropdown. It automatically handles conversions within the same unit category.
8
8
 
9
- - `<uc-qty-pair>` Represents a pair of physical quantities sharing the same unit. It displays two values and a unit dropdown, enabling simultaneous conversion of both quantities.
9
+ - `<uc-qty-pair>` Represents a pair of physical quantities sharing the same unit. It displays two values and a unit dropdown, enabling simultaneous conversion of both quantities. With 2 formats, it is designed to represent 2D dimension pairs, 2D coordinates, or value ranges.
10
10
 
11
- - `<uc-qty-triplet>` Designed for triplets of physical quantities with a common unit. It presents three values and a unit dropdown, facilitating synchronized conversion across all three quantities.
11
+ - `<uc-qty-triplet>` Designed for triplets of physical quantities with a common unit. It presents three values and a unit dropdown, facilitating synchronized conversion across all three quantities. With 2 formats, it is designed to represent 3D dimension triplets, 3D coordinates.
12
12
 
13
13
  These web components offer:
14
14
  - Self-contained unit conversion
@@ -92,9 +92,11 @@ Add the `<physical-quantity>`, `<uc-qty>`, `<uc-qty-pair>`, or `<uc-qty-triplet>
92
92
  <physical-quantity value="10" unit="kgf" ></physical-quantity>
93
93
  <physical-quantity value="10" unit="Volt" ></physical-quantity>
94
94
 
95
- <uc-qty-pair values="10,20" unit="cm"></uc-qty-pair> Quantity pair<br>
96
-
97
- <uc-qty-triplet values="10x20x30" unit="cm"></uc-qty-triplet> Quantity triplet values="10x20x30" unit="cm"<br>
95
+ <uc-qty-pair values="10x20" unit="cm"></uc-qty-pair> Dimension pair (width x height)<br>
96
+ <uc-qty-pair values="(10, 20)" unit="cm"></uc-qty-pair> Coordinate pair (x, y), or value range <br>
97
+
98
+ <uc-qty-triplet values="10x20x30" unit="cm"></uc-qty-triplet> Dimension triplet (L x W x H)<br>
99
+ <uc-qty-triplet values="(10, 20, 30)" unit="cm"></uc-qty-triplet> Coordinate triplet (x, y, z)<br>
98
100
  ```
99
101
  [Above Rendered in Web Browser](https://v2-docs.donwen.com/demo/pq-samples.html)
100
102
 
@@ -112,9 +114,10 @@ Here's an example of how to use the component in an HTML file:
112
114
  <body>
113
115
  <physical-quantity value="25.4" unit="mm"></physical-quantity>
114
116
  <uc-qty value="25.4" unit="mm" decimal-places="4"></uc-qty> <br>
115
- <uc-qty-pair values="10,20" unit="cm"></uc-qty-pair><br>
116
-
117
- <uc-qty-triplet values="10x20x30" unit="cm"></uc-qty-triplet><br>
117
+ <uc-qty-pair values="10x20" unit="cm"></uc-qty-pair><br> <!-- x-format: dimensions -->
118
+ <uc-qty-pair values="(10, 20)" unit="cm"></uc-qty-pair><br> <!-- tuple: coordinates, value ranges -->
119
+ <uc-qty-triplet values="10x20x30" unit="cm"></uc-qty-triplet><br> <!-- x-format: L x W x H -->
120
+ <uc-qty-triplet values="(10, 20, 30)" unit="cm"></uc-qty-triplet><br><!-- tuple: coordinates -->
118
121
 
119
122
  <script src="node_modules/physical-quantity/src/pq.es.js"></script>
120
123
  </body>
@@ -135,8 +138,10 @@ Here's an example of how to use the component in an HTML file:
135
138
  <physical-quantity value="25.4" unit="mm"></physical-quantity>
136
139
  <physical-quantity value="1500" unit="psf" decimal-places=4></physical-quantity> <br>
137
140
  <uc-qty value="2" unit="lbm" decimal-places="2"></uc-qty> <br>
138
- <uc-qty-pair values="10,20" unit="cm"></uc-qty-pair><br>
139
- <uc-qty-triplet values="10x20x30" unit="cm"></uc-qty-triplet><br>
141
+ <uc-qty-pair values="10x20" unit="cm"></uc-qty-pair><br> <!-- x-format: dimensions -->
142
+ <uc-qty-pair values="(10, 20)" unit="cm"></uc-qty-pair><br> <!-- tuple: coordinates, value ranges -->
143
+ <uc-qty-triplet values="10x20x30" unit="cm"></uc-qty-triplet><br> <!-- x-format: L x W x H -->
144
+ <uc-qty-triplet values="(10, 20, 30)" unit="cm"></uc-qty-triplet><br><!-- tuple: coordinates -->
140
145
 
141
146
  </body>
142
147
  </html>
@@ -146,6 +151,9 @@ Here's an example of how to use the component in an HTML file:
146
151
  The physical-quantity component supports the following attributes:
147
152
 
148
153
  - <ins>_value_</ins>: The initial value of the physical quantity. It can be any number.
154
+ - <ins>_values_</ins>: For `uc-qty-pair` and `uc-qty-triplet`. Two formats are supported:
155
+ - **x-format** `values="AxB"` or `values="AxBxC"` — for dimensions (e.g., width x height x depth)
156
+ - **tuple format** `values="(A, B)"` or `values="(A, B, C)"` — for coordinates or ranges
149
157
  - <ins>_unit_</ins>: The initial unit of the physical quantity.
150
158
  When a valid unit within the supported unit categories (e.g., mm, cm, m, in, ft for length), unit conversion is automated;
151
159
  When a unit provided is not in the library, it will show per the author's input, like a regular text input.
@@ -279,36 +287,12 @@ This project is licensed under the MIT License. See the LICENSE file for more de
279
287
  ## Contributing
280
288
  Contributions are welcome! Please contact the developer for any bugs, features, or improvements.
281
289
 
282
- ## Change Log
283
- | Version | Date | Description |
284
- |---|---|---|
285
- | v1.1.92 |20251001| Power unit W[Watt] changed to W. |
286
- | v1.1.91 |20251001| Power unit Btu(AC) for air conditioner. |
287
- | v1.1.90 |20250120| Volume unit 'mL' to 'ml'. |
288
- | v1.1.88 |20241016| Code optimized. |
289
- | v1.1.85 |20241015| Bug fixes. |
290
- | v1.1.81 |20241014| Added uc-qty-pair & uc-qty-triplet. |
291
- | v1.1.80 |20241013| Minor bug fixes. |
292
- | v1.1.75 |20241010| Added more ounces and cups for volume. |
293
- | v1.1.70 |20240810| Fine-tuned style. Checked usage of PQ element in Vue 3 app. Works with both unpkg and npm installation. |
294
- | v1.1.68 |20240722| Readme update with Technical Writing example. |
295
- | v1.1.67 |20240721| Number formatting with comma, eg: 20000 to 23,000; bug fixes. |
296
- | v1.1.60 |20240721| A main refactoring. |
297
- | v1.1.52 |20240718| Added category "Electrical Potential Difference (Voltage)".|
298
- | v1.1.50 |20240716| Corrected decimal point format, default to 2.|
299
- | v1.1.47 |20240712| Added flow rate (volume) category.|
300
- | v1.1.46 |20240629| Added more categories; add notes for mass/weight differences.|
301
- | v1.1.43 |20240623| Added more categories.|
302
- | v1.1.41 |20240620| Added Force category.|
303
- | v1.1.40 |20240619| Added *ft-in* (ie: Foot-Inch) in Length category.|
304
- | v1.1.35 |20240616| Added temperature category.|
305
- | v1.1.30 |20240615| Added "show-unit-arrow" prop to allow web author to create a compact UI; Unit width is now responsive to the chosen unit; Author can force init unit.|
306
- | v1.1.28 |20240610| Tooltip for unit list provides a link to the unit converter page for all unit categories. Added more categories.|
307
- | v1.1.21 |20240603| Added alias uc-qty. |
308
- | v1.1.19 |20240602| Changed to umd for unpkg, and es for module. |
290
+ ## Changelog
291
+
292
+ See [CHANGELOG.md](CHANGELOG.md) for the full version history.
309
293
 
310
294
  ## Contact
311
- If you have any questions or feedback, feel free to contact me at don.wen@yahoo.com.
295
+ If you have any questions or feedback, feel free to contact me at don.wen@calcslive.com.
312
296
  For more info, please visit:
313
297
  [AutoCalcs](https://www.donwen.com/)
314
298
  [AutoCalcs Docs and Library](https://v2-docs.donwen.com/)