@per-diem-calculator/vanilla 1.0.1 → 1.0.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 +59 -0
- package/dist/index.js +11184 -0
- package/dist/index.umd.cjs +1512 -0
- package/package.json +14 -4
- package/.prettierrc +0 -17
- package/eslint.config.js +0 -29
- package/index.html +0 -11
- package/src/css/_styles.css +0 -8
- package/src/css/colors.css +0 -45
- package/src/css/fonts.css +0 -9
- package/src/css/rows/_heights.css +0 -6
- package/src/css/rows/_index.css +0 -15
- package/src/css/rows/add.css +0 -18
- package/src/css/rows/animate-btns.css +0 -18
- package/src/css/rows/animate-row-close.css +0 -18
- package/src/css/rows/animate-row-open.css +0 -14
- package/src/css/rows/animate-row-other.css +0 -5
- package/src/css/rows/btn-add-row.css +0 -41
- package/src/css/rows/btn-delete.css +0 -22
- package/src/css/rows/btn-expenses-calculate.css +0 -22
- package/src/css/rows/btn-expenses-category.css +0 -22
- package/src/css/rows/delete.css +0 -10
- package/src/css/rows/details.css +0 -22
- package/src/css/rows/expense.css +0 -18
- package/src/css/rows/location.css +0 -34
- package/src/css/rows/summary.css +0 -22
- package/src/css/tom-select/defaults.css +0 -530
- package/src/css/tom-select/overrides.css +0 -55
- package/src/css/tw-shadow-props.css +0 -50
- package/src/index.ts +0 -1
- package/src/ts/components/Button/Button.ts +0 -50
- package/src/ts/components/Button/template.html +0 -34
- package/src/ts/components/ExpenseRow/ExpenseRow.ts +0 -397
- package/src/ts/components/ExpenseRow/template.html +0 -260
- package/src/ts/components/Label/Label.ts +0 -45
- package/src/ts/components/Label/template.html +0 -1
- package/src/ts/components/LocationCategory/LocationCategory.ts +0 -226
- package/src/ts/components/LocationCategory/template.html +0 -520
- package/src/ts/components/LocationDate/LocationDate.ts +0 -366
- package/src/ts/components/LocationDate/template.html +0 -27
- package/src/ts/components/LocationSelect/LocationSelect.ts +0 -299
- package/src/ts/components/LocationSelect/template.html +0 -45
- package/src/ts/components/index.ts +0 -6
- package/src/ts/controller.ts +0 -193
- package/src/ts/model.ts +0 -163
- package/src/ts/types/config.ts +0 -22
- package/src/ts/types/dates.ts +0 -82
- package/src/ts/types/expenses.ts +0 -73
- package/src/ts/types/locations.ts +0 -25
- package/src/ts/utils/config/configDefault.ts +0 -13
- package/src/ts/utils/config/index.ts +0 -12
- package/src/ts/utils/config/numbers.ts +0 -24
- package/src/ts/utils/config/sanitizeConfig.ts +0 -39
- package/src/ts/utils/dates/INPUT_DATE_MINMAX.ts +0 -5
- package/src/ts/utils/dates/YEAR_REGEX.ts +0 -4
- package/src/ts/utils/dates/getDateSlice.ts +0 -54
- package/src/ts/utils/dates/getValidAPIYear.ts +0 -17
- package/src/ts/utils/dates/index.ts +0 -19
- package/src/ts/utils/dates/isDateRaw.ts +0 -90
- package/src/ts/utils/dates/isShortMonth.ts +0 -24
- package/src/ts/utils/dates/isYYYY.ts +0 -10
- package/src/ts/utils/dates/offsetDateString.ts +0 -17
- package/src/ts/utils/expenses/INTL_MIE_RATES.ts +0 -2125
- package/src/ts/utils/expenses/createExpenseObjs.ts +0 -35
- package/src/ts/utils/expenses/getLodgingRateDomestic.ts +0 -73
- package/src/ts/utils/expenses/getLodgingRateIntl.ts +0 -119
- package/src/ts/utils/expenses/getMieRates.ts +0 -84
- package/src/ts/utils/expenses/index.ts +0 -5
- package/src/ts/utils/expenses/parseIntlLodgingRates.ts +0 -124
- package/src/ts/utils/expenses/returnValidStateExpense.ts +0 -46
- package/src/ts/utils/fetch/fetchJsonGSA.ts +0 -29
- package/src/ts/utils/fetch/fetchXmlDOD.ts +0 -38
- package/src/ts/utils/fetch/index.ts +0 -3
- package/src/ts/utils/fetch/memoize.ts +0 -46
- package/src/ts/utils/fetch/parseXml.ts +0 -19
- package/src/ts/utils/locations/getCitiesDomestic.ts +0 -48
- package/src/ts/utils/locations/getCitiesIntl.ts +0 -63
- package/src/ts/utils/locations/getCountriesDomestic.ts +0 -237
- package/src/ts/utils/locations/getCountriesIntl.ts +0 -34
- package/src/ts/utils/locations/index.ts +0 -6
- package/src/ts/utils/locations/keepUniqueLocations.ts +0 -12
- package/src/ts/utils/locations/locationKeys.ts +0 -10
- package/src/ts/utils/locations/returnValidStateLocation.ts +0 -13
- package/src/ts/utils/locations/sortLocations.ts +0 -19
- package/src/ts/utils/misc/USD.ts +0 -4
- package/src/ts/utils/misc/debounce.ts +0 -22
- package/src/ts/utils/misc/handlePointerDown.ts +0 -3
- package/src/ts/utils/misc/handlePointerUp.ts +0 -22
- package/src/ts/utils/misc/inPrimitiveType.ts +0 -4
- package/src/ts/utils/misc/index.ts +0 -6
- package/src/ts/utils/misc/wait.ts +0 -4
- package/src/ts/utils/styles/applyStyles.ts +0 -19
- package/src/ts/utils/styles/highlightInput.ts +0 -15
- package/src/ts/utils/styles/index.ts +0 -3
- package/src/ts/utils/styles/removeStyles.ts +0 -14
- package/src/ts/views/Expense/Expense.ts +0 -465
- package/src/ts/views/Expense/template.html +0 -176
- package/src/ts/views/Location/Location.ts +0 -763
- package/src/ts/views/Location/template-row.html +0 -146
- package/src/ts/views/Location/template.html +0 -130
- package/src/ts/views/index.ts +0 -2
- package/tsconfig.json +0 -27
- package/vite.config.ts +0 -12
package/README.md
CHANGED
|
@@ -1 +1,60 @@
|
|
|
1
1
|
# Per Diem Calculator
|
|
2
|
+
|
|
3
|
+
Open source per diem calculator for both domestic and international trips. Built in TypeScript with Tailwind. Rates sourced directly from General Services Administration (GSA), Dept. of State, and Dept. of Defense (DOD).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Lookup both domestic and international rates in one place and get accurate deductions for first/last day and meals provided
|
|
8
|
+
- print expense report PDF that includes daily breakdown, rates used, and links to the original federal source
|
|
9
|
+
- Full keyboard-only navigation support
|
|
10
|
+
- TK accessibility compliance
|
|
11
|
+
- Developers: calculator outputs expenses as object that can be easily incorporated into other tools
|
|
12
|
+
|
|
13
|
+
## Issues resolved
|
|
14
|
+
|
|
15
|
+
- No existing calculator for end users that lets them lookup both domestic and international rates, and also lets them deduct meals provided
|
|
16
|
+
- No existing calculator for developers to integrate into their expense management system
|
|
17
|
+
- No API for OCONUS rates from Dept. of State and Dept. of Defense
|
|
18
|
+
|
|
19
|
+
## Who this is for
|
|
20
|
+
|
|
21
|
+
- Individuals who want to quickly and easily look up their lodging and meals per diem allowances - https://perdiemcalc.org
|
|
22
|
+
- Developers who want to integrate into their expense platform - see console in https://perdiemcalc.org/object to outputted expense object that can be incorporated into projects
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
- https://perdiemcalc.org
|
|
27
|
+
- Develop locally
|
|
28
|
+
|
|
29
|
+
## Local Development
|
|
30
|
+
|
|
31
|
+
- deploy per diem proxy - https://github.com/ahmad-dowla/per-diem-calculator-proxy
|
|
32
|
+
- VITE_PROXY_KEY, VITE_PROXY_URL, GSA_API_KEY
|
|
33
|
+
-
|
|
34
|
+
|
|
35
|
+
## Config
|
|
36
|
+
|
|
37
|
+
- Expense object printed to console - https://perdiemcalc.org/object/
|
|
38
|
+
- Unstyled - https://perdiemcalc.org/unstyled/
|
|
39
|
+
|
|
40
|
+
## Behind scenes
|
|
41
|
+
|
|
42
|
+
GSA API
|
|
43
|
+
DOD zip files unpacked with JSZIP, parsed with DOMParser and XPathEvaluator
|
|
44
|
+
API calls reduced with memoization and caching results in Cloudflare on the proxy side
|
|
45
|
+
|
|
46
|
+
## Built with
|
|
47
|
+
|
|
48
|
+
TypeScript - native web components encapsulated in shadow DOM
|
|
49
|
+
Tailwind
|
|
50
|
+
TomSelect for searchable dropdowns
|
|
51
|
+
JSZip to unpack
|
|
52
|
+
DOMPurify to santize developer config object
|
|
53
|
+
|
|
54
|
+
## Planned Updates
|
|
55
|
+
|
|
56
|
+
- Dark mode
|
|
57
|
+
- Add CSS paths to make it easy to style shadowDOM elements
|
|
58
|
+
- CDN option
|
|
59
|
+
- Option to display rates only vs calculating expenses
|
|
60
|
+
- React version
|