@per-diem-calculator/vanilla 1.0.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.
Files changed (103) hide show
  1. package/.prettierrc +17 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1 -0
  4. package/eslint.config.js +29 -0
  5. package/index.html +11 -0
  6. package/package.json +49 -0
  7. package/public/output.css +2503 -0
  8. package/src/css/_styles.css +8 -0
  9. package/src/css/colors.css +45 -0
  10. package/src/css/fonts.css +9 -0
  11. package/src/css/rows/_heights.css +6 -0
  12. package/src/css/rows/_index.css +15 -0
  13. package/src/css/rows/add.css +18 -0
  14. package/src/css/rows/animate-btns.css +18 -0
  15. package/src/css/rows/animate-row-close.css +18 -0
  16. package/src/css/rows/animate-row-open.css +14 -0
  17. package/src/css/rows/animate-row-other.css +5 -0
  18. package/src/css/rows/btn-add-row.css +41 -0
  19. package/src/css/rows/btn-delete.css +22 -0
  20. package/src/css/rows/btn-expenses-calculate.css +22 -0
  21. package/src/css/rows/btn-expenses-category.css +22 -0
  22. package/src/css/rows/delete.css +10 -0
  23. package/src/css/rows/details.css +22 -0
  24. package/src/css/rows/expense.css +18 -0
  25. package/src/css/rows/location.css +34 -0
  26. package/src/css/rows/summary.css +22 -0
  27. package/src/css/tom-select/defaults.css +530 -0
  28. package/src/css/tom-select/overrides.css +55 -0
  29. package/src/css/tw-shadow-props.css +50 -0
  30. package/src/index.ts +1 -0
  31. package/src/ts/components/Button/Button.ts +50 -0
  32. package/src/ts/components/Button/template.html +34 -0
  33. package/src/ts/components/ExpenseRow/ExpenseRow.ts +397 -0
  34. package/src/ts/components/ExpenseRow/template.html +260 -0
  35. package/src/ts/components/Label/Label.ts +45 -0
  36. package/src/ts/components/Label/template.html +1 -0
  37. package/src/ts/components/LocationCategory/LocationCategory.ts +226 -0
  38. package/src/ts/components/LocationCategory/template.html +520 -0
  39. package/src/ts/components/LocationDate/LocationDate.ts +366 -0
  40. package/src/ts/components/LocationDate/template.html +27 -0
  41. package/src/ts/components/LocationSelect/LocationSelect.ts +299 -0
  42. package/src/ts/components/LocationSelect/template.html +45 -0
  43. package/src/ts/components/index.ts +6 -0
  44. package/src/ts/controller.ts +193 -0
  45. package/src/ts/model.ts +163 -0
  46. package/src/ts/types/config.ts +22 -0
  47. package/src/ts/types/dates.ts +82 -0
  48. package/src/ts/types/expenses.ts +73 -0
  49. package/src/ts/types/locations.ts +25 -0
  50. package/src/ts/utils/config/configDefault.ts +13 -0
  51. package/src/ts/utils/config/index.ts +12 -0
  52. package/src/ts/utils/config/numbers.ts +24 -0
  53. package/src/ts/utils/config/sanitizeConfig.ts +39 -0
  54. package/src/ts/utils/dates/INPUT_DATE_MINMAX.ts +5 -0
  55. package/src/ts/utils/dates/YEAR_REGEX.ts +4 -0
  56. package/src/ts/utils/dates/getDateSlice.ts +54 -0
  57. package/src/ts/utils/dates/getValidAPIYear.ts +17 -0
  58. package/src/ts/utils/dates/index.ts +19 -0
  59. package/src/ts/utils/dates/isDateRaw.ts +90 -0
  60. package/src/ts/utils/dates/isShortMonth.ts +24 -0
  61. package/src/ts/utils/dates/isYYYY.ts +10 -0
  62. package/src/ts/utils/dates/offsetDateString.ts +17 -0
  63. package/src/ts/utils/expenses/INTL_MIE_RATES.ts +2125 -0
  64. package/src/ts/utils/expenses/createExpenseObjs.ts +35 -0
  65. package/src/ts/utils/expenses/getLodgingRateDomestic.ts +73 -0
  66. package/src/ts/utils/expenses/getLodgingRateIntl.ts +119 -0
  67. package/src/ts/utils/expenses/getMieRates.ts +84 -0
  68. package/src/ts/utils/expenses/index.ts +5 -0
  69. package/src/ts/utils/expenses/parseIntlLodgingRates.ts +124 -0
  70. package/src/ts/utils/expenses/returnValidStateExpense.ts +46 -0
  71. package/src/ts/utils/fetch/fetchJsonGSA.ts +29 -0
  72. package/src/ts/utils/fetch/fetchXmlDOD.ts +38 -0
  73. package/src/ts/utils/fetch/index.ts +3 -0
  74. package/src/ts/utils/fetch/memoize.ts +46 -0
  75. package/src/ts/utils/fetch/parseXml.ts +19 -0
  76. package/src/ts/utils/locations/getCitiesDomestic.ts +48 -0
  77. package/src/ts/utils/locations/getCitiesIntl.ts +63 -0
  78. package/src/ts/utils/locations/getCountriesDomestic.ts +237 -0
  79. package/src/ts/utils/locations/getCountriesIntl.ts +34 -0
  80. package/src/ts/utils/locations/index.ts +6 -0
  81. package/src/ts/utils/locations/keepUniqueLocations.ts +12 -0
  82. package/src/ts/utils/locations/locationKeys.ts +10 -0
  83. package/src/ts/utils/locations/returnValidStateLocation.ts +13 -0
  84. package/src/ts/utils/locations/sortLocations.ts +19 -0
  85. package/src/ts/utils/misc/USD.ts +4 -0
  86. package/src/ts/utils/misc/debounce.ts +22 -0
  87. package/src/ts/utils/misc/handlePointerDown.ts +3 -0
  88. package/src/ts/utils/misc/handlePointerUp.ts +22 -0
  89. package/src/ts/utils/misc/inPrimitiveType.ts +4 -0
  90. package/src/ts/utils/misc/index.ts +6 -0
  91. package/src/ts/utils/misc/wait.ts +4 -0
  92. package/src/ts/utils/styles/applyStyles.ts +19 -0
  93. package/src/ts/utils/styles/highlightInput.ts +15 -0
  94. package/src/ts/utils/styles/index.ts +3 -0
  95. package/src/ts/utils/styles/removeStyles.ts +14 -0
  96. package/src/ts/views/Expense/Expense.ts +465 -0
  97. package/src/ts/views/Expense/template.html +176 -0
  98. package/src/ts/views/Location/Location.ts +763 -0
  99. package/src/ts/views/Location/template-row.html +146 -0
  100. package/src/ts/views/Location/template.html +130 -0
  101. package/src/ts/views/index.ts +2 -0
  102. package/tsconfig.json +27 -0
  103. package/vite.config.ts +12 -0
@@ -0,0 +1,8 @@
1
+ @import 'tailwindcss';
2
+ @import './tw-shadow-props.css';
3
+ @import './colors.css';
4
+ @import './fonts.css';
5
+
6
+ @import './rows/_index.css';
7
+ @import './tom-select/defaults';
8
+ @import './tom-select/overrides';
@@ -0,0 +1,45 @@
1
+ @theme {
2
+ --color-primary-900: hsl(245, 100%, 27%);
3
+ --color-primary-800: hsl(245, 86%, 40%);
4
+ --color-primary-700: hsl(245, 79%, 52%);
5
+ --color-primary-600: hsl(245, 92%, 60%);
6
+ --color-primary-500: hsl(243, 94%, 66%);
7
+ --color-primary-400: hsl(243, 94%, 70%);
8
+ --color-primary-300: hsl(240, 95%, 76%);
9
+ --color-primary-200: hsl(238, 94%, 81%);
10
+ --color-primary-100: hsl(238, 100%, 88%);
11
+ --color-primary-50: hsl(240, 100%, 95%);
12
+
13
+ --color-success-900: hsl(170, 97%, 15%);
14
+ --color-success-800: hsl(168, 80%, 23%);
15
+ --color-success-700: hsl(166, 72%, 28%);
16
+ --color-success-600: hsl(164, 71%, 34%);
17
+ --color-success-500: hsl(162, 63%, 41%);
18
+ --color-success-400: hsl(160, 51%, 49%);
19
+ --color-success-300: hsl(158, 58%, 62%);
20
+ --color-success-200: hsl(156, 73%, 74%);
21
+ --color-success-100: hsl(154, 75%, 87%);
22
+ --color-success-50: hsl(152, 68%, 96%);
23
+
24
+ --color-neutral-900: hsl(209, 61%, 16%);
25
+ --color-neutral-800: hsl(211, 39%, 23%);
26
+ --color-neutral-700: hsl(209, 34%, 30%);
27
+ --color-neutral-600: hsl(209, 28%, 39%);
28
+ --color-neutral-500: hsl(210, 22%, 49%);
29
+ --color-neutral-400: hsl(209, 23%, 60%);
30
+ --color-neutral-300: hsl(211, 27%, 70%);
31
+ --color-neutral-200: hsl(210, 31%, 80%);
32
+ --color-neutral-100: hsl(212, 33%, 89%);
33
+ --color-neutral-50: hsl(210, 36%, 96%);
34
+
35
+ --color-error-900: hsl(348, 94%, 20%);
36
+ --color-error-800: hsl(350, 94%, 28%);
37
+ --color-error-700: hsl(352, 90%, 35%);
38
+ --color-error-600: hsl(354, 85%, 44%);
39
+ --color-error-500: hsl(356, 75%, 53%);
40
+ --color-error-400: hsl(360, 83%, 62%);
41
+ --color-error-300: hsl(360, 91%, 69%);
42
+ --color-error-200: hsl(360, 100%, 80%);
43
+ --color-error-100: hsl(360, 100%, 87%);
44
+ --color-error-50: hsl(360, 100%, 95%);
45
+ }
@@ -0,0 +1,9 @@
1
+ @theme {
2
+ --font-sans:
3
+ 'IBM Plex Mono', ui-sans-serif, system-ui, sans-serif,
4
+ 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
5
+ 'Noto Color Emoji';
6
+ --font-mono:
7
+ 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
8
+ 'Liberation Mono', 'Courier New', monospace;
9
+ }
@@ -0,0 +1,6 @@
1
+ @theme {
2
+ --row-expense-open: 400px;
3
+ --row-close: 96px;
4
+ --row-location-open: 477px;
5
+ --row-location-open-sm: 537px;
6
+ }
@@ -0,0 +1,15 @@
1
+ @import './_heights.css';
2
+ @import './add.css';
3
+ @import './animate-btns.css';
4
+ @import './animate-row-close.css';
5
+ @import './animate-row-open.css';
6
+ @import './animate-row-other.css';
7
+ @import './btn-add-row.css';
8
+ @import './btn-delete.css';
9
+ @import './btn-expenses-calculate.css';
10
+ @import './btn-expenses-category.css';
11
+ @import './delete.css';
12
+ @import './details.css';
13
+ @import './expense.css';
14
+ @import './location.css';
15
+ @import './summary.css';
@@ -0,0 +1,18 @@
1
+ @theme {
2
+ @keyframes row-add {
3
+ 0% {
4
+ height: 0;
5
+ }
6
+ 100% {
7
+ height: var(--row-location-open);
8
+ }
9
+ }
10
+ @keyframes row-add-sm {
11
+ 0% {
12
+ height: 0;
13
+ }
14
+ 100% {
15
+ height: var(--row-location-open-sm);
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,18 @@
1
+ @theme {
2
+ --animate-rows-closed-addRowBtn: rows-closed-addRowBtn 0.45s ease-out
3
+ forwards;
4
+
5
+ --animate-rows-closed-expenseCategoryBtn: rows-closed-expenseCategoryBtn
6
+ 0.45s forwards;
7
+
8
+ --animate-rows-closed-expensesCalculateBtn: rows-closed-expensesCalculateBtn
9
+ 0.45s forwards;
10
+
11
+ --animate-rows-open-addRowBtn: rows-open-addRowBtn 0.45s forwards;
12
+
13
+ --animate-rows-open-expenseCategoryBtn: rows-open-expenseCategoryBtn 0.35s
14
+ 0.45s forwards;
15
+
16
+ --animate-rows-open-expensesCalculateBtn: rows-open-expensesCalculateBtn
17
+ 0.35s 0.45s forwards;
18
+ }
@@ -0,0 +1,18 @@
1
+ @theme {
2
+ /* First stage */
3
+ /* Details */
4
+ --animate-row-close-details: row-close-details 0.35s ease-in forwards;
5
+
6
+ /* Second Stage */
7
+ /* Row */
8
+ --animate-row-location-close: row-location-close 0.35s 0.35s ease-in
9
+ forwards;
10
+ --animate-row-location-close-sm: row-location-close-sm 0.35s 0.35s ease-in
11
+ forwards;
12
+ --animate-row-expense-close: row-expense-close 0.35s 0.35s ease-in forwards;
13
+
14
+ /* Summary, delete btn */
15
+ --animate-row-close-summary: row-close-summary 0.35s 0.35s ease-out forwards;
16
+ --animate-row-close-deletebtn: row-close-deletebtn 0.35s 0.35s ease-out
17
+ forwards;
18
+ }
@@ -0,0 +1,14 @@
1
+ @theme {
2
+ /* First stage */
3
+ /* Row */
4
+ --animate-row-location-open: row-location-open 0.35s 0.45s ease-in forwards;
5
+ --animate-row-location-open-sm: row-location-open-sm 0.35s 0.45s ease-in
6
+ forwards;
7
+ --animate-row-expense-open: row-expense-open 0.35s 0.45s ease-in forwards;
8
+
9
+ /* Details, summary, delete */
10
+ --animate-row-open-details: row-open-details 0.35s 0.45s ease-in forwards;
11
+ --animate-row-open-summary: row-open-summary 0.35s 0.45s ease-in forwards;
12
+ --animate-row-open-deletebtn: row-open-deletebtn 0.35s 0.45s ease-in
13
+ forwards;
14
+ }
@@ -0,0 +1,5 @@
1
+ @theme {
2
+ --animate-row-delete: row-delete 0.35s 0.45s ease-out forwards;
3
+ --animate-row-add: row-add 0.35s 0.45s ease-in forwards;
4
+ --animate-row-add-sm: row-add-sm 0.35s 0.45s ease-in forwards;
5
+ }
@@ -0,0 +1,41 @@
1
+ @theme {
2
+ @keyframes rows-open-addRowBtn {
3
+ 0% {
4
+ transform: translateY(0%);
5
+ opacity: 100;
6
+ z-index: 50;
7
+ }
8
+ 33% {
9
+ transform: translateY(75%);
10
+ opacity: 100;
11
+ z-index: 0;
12
+ }
13
+ 70% {
14
+ opacity: 0;
15
+ }
16
+ 100% {
17
+ transform: translateY(-100%);
18
+ z-index: 0;
19
+ opacity: 0;
20
+ }
21
+ }
22
+ @keyframes rows-closed-addRowBtn {
23
+ 0% {
24
+ transform: translateY(-100%);
25
+ z-index: 0;
26
+ opacity: 0;
27
+ }
28
+ 30% {
29
+ opacity: 100;
30
+ }
31
+ 66% {
32
+ transform: translateY(75%);
33
+ z-index: 0;
34
+ }
35
+ 100% {
36
+ transform: translateY(0%);
37
+ z-index: 50;
38
+ opacity: 100;
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,22 @@
1
+ @theme {
2
+ @keyframes row-open-deletebtn {
3
+ 0% {
4
+ transform: translateX(0%);
5
+ opacity: 100;
6
+ }
7
+ 100% {
8
+ transform: translateX(200%);
9
+ opacity: 0;
10
+ }
11
+ }
12
+ @keyframes row-close-deletebtn {
13
+ 0% {
14
+ transform: translateX(200%);
15
+ opacity: 0;
16
+ }
17
+ 100% {
18
+ transform: translateX(0%);
19
+ opacity: 100;
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ @theme {
2
+ @keyframes rows-open-expensesCalculateBtn {
3
+ 0% {
4
+ transform: translateY(0%);
5
+ opacity: 100;
6
+ }
7
+ 100% {
8
+ transform: translateY(200%);
9
+ opacity: 0;
10
+ }
11
+ }
12
+ @keyframes rows-closed-expensesCalculateBtn {
13
+ 0% {
14
+ transform: translateY(200%);
15
+ opacity: 0;
16
+ }
17
+ 100% {
18
+ transform: translateY(0%);
19
+ opacity: 100;
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ @theme {
2
+ @keyframes rows-open-expenseCategoryBtn {
3
+ 0% {
4
+ transform: translateY(0%);
5
+ opacity: 100;
6
+ }
7
+ 100% {
8
+ transform: translateY(400%);
9
+ opacity: 0;
10
+ }
11
+ }
12
+ @keyframes rows-closed-expenseCategoryBtn {
13
+ 0% {
14
+ transform: translateY(400%);
15
+ opacity: 0;
16
+ }
17
+ 100% {
18
+ transform: translateY(0%);
19
+ opacity: 100;
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,10 @@
1
+ @theme {
2
+ @keyframes row-delete {
3
+ 0% {
4
+ height: var(--row-close);
5
+ }
6
+ 100% {
7
+ height: 0;
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,22 @@
1
+ @theme {
2
+ @keyframes row-open-details {
3
+ 0% {
4
+ transform: translateX(0);
5
+ opacity: 0;
6
+ }
7
+ 100% {
8
+ transform: translateX(100%);
9
+ opacity: 100;
10
+ }
11
+ }
12
+ @keyframes row-close-details {
13
+ 0% {
14
+ transform: translateX(100%);
15
+ opacity: 100;
16
+ }
17
+ 100% {
18
+ transform: translateX(0);
19
+ opacity: 0;
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,18 @@
1
+ @theme {
2
+ @keyframes row-expense-open {
3
+ 0% {
4
+ height: var(--row-close);
5
+ }
6
+ 100% {
7
+ height: var(--row-expense-open);
8
+ }
9
+ }
10
+ @keyframes row-expense-close {
11
+ 0% {
12
+ height: var(--row-expense-open);
13
+ }
14
+ 100% {
15
+ height: var(--row-close);
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,34 @@
1
+ @theme {
2
+ @keyframes row-location-open {
3
+ 0% {
4
+ height: var(--row-close);
5
+ }
6
+ 100% {
7
+ height: var(--row-location-open);
8
+ }
9
+ }
10
+ @keyframes row-location-open-sm {
11
+ 0% {
12
+ height: var(--row-close);
13
+ }
14
+ 100% {
15
+ height: var(--row-location-open-sm);
16
+ }
17
+ }
18
+ }
19
+ @keyframes row-location-close {
20
+ 0% {
21
+ height: var(--row-location-open);
22
+ }
23
+ 100% {
24
+ height: var(--row-close);
25
+ }
26
+ }
27
+ @keyframes row-location-close-sm {
28
+ 0% {
29
+ height: var(--row-location-open-sm);
30
+ }
31
+ 100% {
32
+ height: var(--row-close);
33
+ }
34
+ }
@@ -0,0 +1,22 @@
1
+ @theme {
2
+ @keyframes row-open-summary {
3
+ 0% {
4
+ transform: translateY(0%);
5
+ opacity: 100;
6
+ }
7
+ 100% {
8
+ transform: translateY(-200%);
9
+ opacity: 0;
10
+ }
11
+ }
12
+ @keyframes row-close-summary {
13
+ 0% {
14
+ transform: translateY(-200%);
15
+ opacity: 0;
16
+ }
17
+ 100% {
18
+ transform: translateY(0%);
19
+ opacity: 100;
20
+ }
21
+ }
22
+ }