@per-diem-calculator/vanilla 1.0.28 → 1.0.29
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 +24 -7
- package/dist/index.js +1849 -1714
- package/dist/index.umd.cjs +178 -49
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ const container = document.querySelector('#perDiemCalc');
|
|
|
48
48
|
new Pdc(container);
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
The expenses can be outputted to an object for further use in your application (see your console in [this demo](https://perdiemcalc.org/object) and
|
|
51
|
+
The expenses can be outputted to an object for further use in your application (see your console in [this demo](https://perdiemcalc.org/object), and the [Expense Object](#expense-object) and [Rates Object](#rates-object) sections):
|
|
52
52
|
|
|
53
53
|
```
|
|
54
54
|
import { Pdc } from '@per-diem-calculator/vanilla';
|
|
@@ -58,8 +58,9 @@ const container = document.querySelector('#perDiemCalc');
|
|
|
58
58
|
const pdc = new Pdc(container);
|
|
59
59
|
|
|
60
60
|
pdc.addEventListener('expenseUpdate', e => {
|
|
61
|
-
const {
|
|
62
|
-
console.table(
|
|
61
|
+
const { expenses, rates } = e.detail;
|
|
62
|
+
console.table(expenses);
|
|
63
|
+
console.table(rates);
|
|
63
64
|
});
|
|
64
65
|
|
|
65
66
|
```
|
|
@@ -76,8 +77,8 @@ pdc.addEventListener('expenseUpdate', e => {
|
|
|
76
77
|
```
|
|
77
78
|
{
|
|
78
79
|
date: "2025-05-27",
|
|
79
|
-
country: "AR" // for domestic rates, states are counted as countries
|
|
80
|
-
city: "Hot Springs"
|
|
80
|
+
country: "AR", // for domestic rates, states are counted as countries
|
|
81
|
+
city: "Hot Springs",
|
|
81
82
|
deductions: {
|
|
82
83
|
FirstLastDay: true,
|
|
83
84
|
breakfastProvided: true,
|
|
@@ -101,19 +102,35 @@ pdc.addEventListener('expenseUpdate', e => {
|
|
|
101
102
|
}
|
|
102
103
|
```
|
|
103
104
|
|
|
105
|
+
## Rates Object
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
{
|
|
109
|
+
eff_date: "05/2025",
|
|
110
|
+
location: "Hotsprings, AR",
|
|
111
|
+
maxLodging: 114,
|
|
112
|
+
maxMie: 68,
|
|
113
|
+
maxMieFirstLast: 51,
|
|
114
|
+
maxIncidental: 5,
|
|
115
|
+
deductionBreakfast: 16,
|
|
116
|
+
deductionLunch: 19,
|
|
117
|
+
deductionDinner: 28,
|
|
118
|
+
source: "https://www.gsa.gov/travel/plan-book/per-diem-rates/per-diem-rates-results?action=perdiems_report&fiscal_year=2025&state=AR&city=Hot Springs"
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
104
122
|
## Built With
|
|
105
123
|
|
|
106
124
|
- TypeScript
|
|
107
125
|
- Tailwind
|
|
108
126
|
- [Tom Select](https://github.com/orchidjs/tom-select) ([Apache-2.0](https://github.com/orchidjs/tom-select?tab=Apache-2.0-1-ov-file)) for searchable dropdowns
|
|
109
127
|
- [JSZip](https://github.com/Stuk/jszip) ([MIT](https://github.com/Stuk/jszip?tab=License-1-ov-file)) to unpack DOD rate zip files
|
|
110
|
-
- [DOMPurify](https://github.com/cure53/DOMPurify) ([Apache-2.0](https://github.com/cure53/DOMPurify?tab=License-1-ov-file)) to
|
|
128
|
+
- [DOMPurify](https://github.com/cure53/DOMPurify) ([Apache-2.0](https://github.com/cure53/DOMPurify?tab=License-1-ov-file)) to sanitize config options
|
|
111
129
|
|
|
112
130
|
## Planned Updates
|
|
113
131
|
|
|
114
132
|
- Accessibility improvements to reach full WCAG compliance
|
|
115
133
|
- CSS paths for an easy way to style shadowDOM elements
|
|
116
|
-
- Option to display rates onscreen vs just in the generated PDF
|
|
117
134
|
- Option to mark personal days and remove them from the final expense amount
|
|
118
135
|
- React version - I used this project as a way to get familiar with native web components, but a React version will be shared soon
|
|
119
136
|
- CDN option
|