physical-quantity 1.1.92 → 1.3.0

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. |
@@ -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 and 3D coordinates.
12
12
 
13
13
  These web components offer:
14
14
  - Self-contained unit conversion
@@ -20,10 +20,14 @@ By leveraging these custom elements, developers can easily incorporate sophistic
20
20
 
21
21
  ## Features
22
22
 
23
- - Create a `<physical quantity>` or `<uc-qty>`, `<uc-qty-pair>` or `<uc-qty-triplet>` with a value(values) and unit.
23
+ - **570+ units across 60+ categories** covering the most common engineering, science, and everyday measurement needs, from Length, Mass, and Temperature to Flow Rate, Viscosity, Electrical quantities, and more. See the full [Units Reference](https://calcslive.com/help/units-reference).
24
+ - Create a `<physical-quantity>` / `<uc-qty>`, `<uc-qty-pair>`, or `<uc-qty-triplet>` with a value and unit.
24
25
  - Automatically convert between units within the same category.
25
- - Display values with customizable decimal places if not an integer; show integers without decimal parts.
26
- - Easy to integrate into any web project.
26
+ - Display values with customizable decimal places; integers shown without trailing decimals.
27
+ - Easy to integrate into any web project — no framework required.
28
+
29
+ > **Missing a unit or category?** We'd love your input!
30
+ > Email [don.wen@calcslive.com](mailto:don.wen@calcslive.com) with your suggestions — your feedback directly shapes the unit library.
27
31
 
28
32
  ## Demo: Physical Quantity element - No Unit Converter or Dual Units Needed
29
33
  [Live Demo 1 - technical writing](https://v2-docs.donwen.com/fun-calculations/slingshot-stress-calculation.html)
@@ -92,9 +96,11 @@ Add the `<physical-quantity>`, `<uc-qty>`, `<uc-qty-pair>`, or `<uc-qty-triplet>
92
96
  <physical-quantity value="10" unit="kgf" ></physical-quantity>
93
97
  <physical-quantity value="10" unit="Volt" ></physical-quantity>
94
98
 
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>
99
+ <uc-qty-pair values="10x20" unit="cm"></uc-qty-pair> Dimension pair (width x height)<br>
100
+ <uc-qty-pair values="(10, 20)" unit="cm"></uc-qty-pair> Coordinate pair (x, y), or value range <br>
101
+
102
+ <uc-qty-triplet values="10x20x30" unit="cm"></uc-qty-triplet> Dimension triplet (L x W x H)<br>
103
+ <uc-qty-triplet values="(10, 20, 30)" unit="cm"></uc-qty-triplet> Coordinate triplet (x, y, z)<br>
98
104
  ```
99
105
  [Above Rendered in Web Browser](https://v2-docs.donwen.com/demo/pq-samples.html)
100
106
 
@@ -112,9 +118,10 @@ Here's an example of how to use the component in an HTML file:
112
118
  <body>
113
119
  <physical-quantity value="25.4" unit="mm"></physical-quantity>
114
120
  <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>
121
+ <uc-qty-pair values="10x20" unit="cm"></uc-qty-pair><br> <!-- x-format: dimensions -->
122
+ <uc-qty-pair values="(10, 20)" unit="cm"></uc-qty-pair><br> <!-- tuple: coordinates, value ranges -->
123
+ <uc-qty-triplet values="10x20x30" unit="cm"></uc-qty-triplet><br> <!-- x-format: L x W x H -->
124
+ <uc-qty-triplet values="(10, 20, 30)" unit="cm"></uc-qty-triplet><br><!-- tuple: coordinates -->
118
125
 
119
126
  <script src="node_modules/physical-quantity/src/pq.es.js"></script>
120
127
  </body>
@@ -135,8 +142,10 @@ Here's an example of how to use the component in an HTML file:
135
142
  <physical-quantity value="25.4" unit="mm"></physical-quantity>
136
143
  <physical-quantity value="1500" unit="psf" decimal-places=4></physical-quantity> <br>
137
144
  <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>
145
+ <uc-qty-pair values="10x20" unit="cm"></uc-qty-pair><br> <!-- x-format: dimensions -->
146
+ <uc-qty-pair values="(10, 20)" unit="cm"></uc-qty-pair><br> <!-- tuple: coordinates, value ranges -->
147
+ <uc-qty-triplet values="10x20x30" unit="cm"></uc-qty-triplet><br> <!-- x-format: L x W x H -->
148
+ <uc-qty-triplet values="(10, 20, 30)" unit="cm"></uc-qty-triplet><br><!-- tuple: coordinates -->
140
149
 
141
150
  </body>
142
151
  </html>
@@ -146,6 +155,9 @@ Here's an example of how to use the component in an HTML file:
146
155
  The physical-quantity component supports the following attributes:
147
156
 
148
157
  - <ins>_value_</ins>: The initial value of the physical quantity. It can be any number.
158
+ - <ins>_values_</ins>: For `uc-qty-pair` and `uc-qty-triplet`. Two formats are supported:
159
+ - **x-format** `values="AxB"` or `values="AxBxC"` — for dimensions (e.g., width x height x depth)
160
+ - **tuple format** `values="(A, B)"` or `values="(A, B, C)"` — for coordinates or ranges
149
161
  - <ins>_unit_</ins>: The initial unit of the physical quantity.
150
162
  When a valid unit within the supported unit categories (e.g., mm, cm, m, in, ft for length), unit conversion is automated;
151
163
  When a unit provided is not in the library, it will show per the author's input, like a regular text input.
@@ -153,162 +165,22 @@ The physical-quantity component supports the following attributes:
153
165
  - <ins>_show-unit-arrow_</ins>: specify to show the downward arrow following the units list. Default to be true. When set to false, it is suitable when the author wants to show in a compact format.
154
166
 
155
167
  ### Supported Units
156
- Currently, the component supports the following categories and units:
157
- | Category | Unit | Description |
158
- |---|---|---|
159
- | Length | m |meter|
160
- | |km |kilometer|
161
- | |mm |millimeter|
162
- | |cm |centimeter|
163
- | |in |inch|
164
- | |ft-in |foot-inch|
165
- | |ft |foot|
166
- | Mass | kg |kilogram|
167
- | | g |gram|
168
- | |lbm |pound mass|
169
- | Time | s[second] ||
170
- | | s||
171
- | | minute||
172
- | | h||
173
- | | h[hour]||
174
- | | day||
175
- | | week||
176
- | ElectricalCurrent | A ||
177
- | | Ampere[amp]||
178
- | | mA||
179
- | | µA||
180
- | | kA||
181
- | | MA||
182
- | | esu/s ||
183
- | Temperature | °K ||
184
- | | °C ||
185
- | | °F ||
186
- | | °Ra ||
187
- | Amount of Substance | mol ||
188
- | | mmol ||
189
- | | kmol ||
190
- | Luminous Intensity | cd[candela] ||
191
- | | lm/sr ||
192
- | | cp[candlepower] ||
193
- | | cp[candlepower(before 1948)] ||
194
- | Acceleration | m/s² ||
195
- | | m/min² ||
196
- | | mm/s² ||
197
- | | ft/s² ||
198
- | | ft/min² ||
199
- | | in/s² ||
200
- | Gravitational Constant | m³/kg/s² ||
201
- | | N⋅m²/kg² ||
202
- | | dyn⋅cm²/g² ||
203
- | Velocity (Angular) | rad/s ||
204
- | | rad/min ||
205
- | | rad/h ||
206
- | | deg°/s ||
207
- | | deg°/min ||
208
- | | deg°/h ||
209
- | | rpm[rev/min]||
210
- | | rev/s ||
211
- | Pressure/Stress | Pa ||
212
- | | kPa ||
213
- | | MPa ||
214
- | | GPa ||
215
- | | bar ||
216
- | | mbar||
217
- | | atm||
218
- | | mm HG||
219
- | | cm HG||
220
- | | in HG||
221
- | | mm W.C.||
222
- | | m W.C.||
223
- | | in W.C.||
224
- | | psf| pound per square foot|
225
- | | psi| pound per square foot|
226
- | | ksi| kilo-pound per square foot|
227
- | | ksi[kip/in²]||
228
- | Density | kg/m³||
229
- | | kg/L||
230
- | | g/cm³||
231
- | | g/mm³||
232
- | | lbm/ft³||
233
- | | lbm/in³||
234
- | Force | N||
235
- | | kN||
236
- | | MN||
237
- | | kgf||
238
- | | lb| pound weight |
239
- | | lbf| pount force |
240
- | | kip[kilo pounds]||
241
- | Flow Rate (Volume) | m³/s ||
242
- | | m³/min ||
243
- | | m³/h ||
244
- | | L/s ||
245
- | | L/min ||
246
- | | L/h ||
247
- | | cm³/s ||
248
- | | cm³/min ||
249
- | | in³/s ||
250
- | | in³/min ||
251
- | | ft³/s ||
252
- | | CFM ||
253
- | | CFM[ft³/min] ||
254
- | | CFH ||
255
- | | CFH[ft³/h] ||
256
- | | yd³/min ||
257
- | | yd³/h ||
258
- | | gpm(US) | gallons(US) per minute |
259
- | | gph(US) | gallons(US) per hour |
260
- | | bushel(UK-imperial)/h ||
261
- | | bushel(US)/h ||
262
- | Electrical Potential Difference (Voltage) | V ||
263
- | | Volt ||
264
- | | joule/coulomb ||
265
- | | J/C ||
266
- | | µV ||
267
- | | mV ||
268
- | | kV ||
269
- | | M ||
270
- | more to update. | (feel free to send your request for other units & categories) ||
271
-
272
- **Note**:
273
- - lbm, lbmass are used for mass units;
274
- - lb, lbf are used for weight/force units.
275
-
168
+ For the full list of supported units and categories, see the
169
+ [Units Reference](https://calcslive.com/help/units-reference) on CalcsLive
170
+ kept in sync with the Excel master source.
171
+
276
172
  ## License
277
173
  This project is licensed under the MIT License. See the LICENSE file for more details.
278
174
 
279
175
  ## Contributing
280
176
  Contributions are welcome! Please contact the developer for any bugs, features, or improvements.
281
177
 
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. |
178
+ ## Changelog
179
+
180
+ See `CHANGELOG.md` (included in the package) for the full version history.
309
181
 
310
182
  ## Contact
311
- If you have any questions or feedback, feel free to contact me at don.wen@yahoo.com.
183
+ If you have any questions or feedback, feel free to contact me at don.wen@calcslive.com.
312
184
  For more info, please visit:
313
185
  [AutoCalcs](https://www.donwen.com/)
314
186
  [AutoCalcs Docs and Library](https://v2-docs.donwen.com/)