@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.
- package/.prettierrc +17 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/eslint.config.js +29 -0
- package/index.html +11 -0
- package/package.json +49 -0
- package/public/output.css +2503 -0
- package/src/css/_styles.css +8 -0
- package/src/css/colors.css +45 -0
- package/src/css/fonts.css +9 -0
- package/src/css/rows/_heights.css +6 -0
- package/src/css/rows/_index.css +15 -0
- package/src/css/rows/add.css +18 -0
- package/src/css/rows/animate-btns.css +18 -0
- package/src/css/rows/animate-row-close.css +18 -0
- package/src/css/rows/animate-row-open.css +14 -0
- package/src/css/rows/animate-row-other.css +5 -0
- package/src/css/rows/btn-add-row.css +41 -0
- package/src/css/rows/btn-delete.css +22 -0
- package/src/css/rows/btn-expenses-calculate.css +22 -0
- package/src/css/rows/btn-expenses-category.css +22 -0
- package/src/css/rows/delete.css +10 -0
- package/src/css/rows/details.css +22 -0
- package/src/css/rows/expense.css +18 -0
- package/src/css/rows/location.css +34 -0
- package/src/css/rows/summary.css +22 -0
- package/src/css/tom-select/defaults.css +530 -0
- package/src/css/tom-select/overrides.css +55 -0
- package/src/css/tw-shadow-props.css +50 -0
- package/src/index.ts +1 -0
- package/src/ts/components/Button/Button.ts +50 -0
- package/src/ts/components/Button/template.html +34 -0
- package/src/ts/components/ExpenseRow/ExpenseRow.ts +397 -0
- package/src/ts/components/ExpenseRow/template.html +260 -0
- package/src/ts/components/Label/Label.ts +45 -0
- package/src/ts/components/Label/template.html +1 -0
- package/src/ts/components/LocationCategory/LocationCategory.ts +226 -0
- package/src/ts/components/LocationCategory/template.html +520 -0
- package/src/ts/components/LocationDate/LocationDate.ts +366 -0
- package/src/ts/components/LocationDate/template.html +27 -0
- package/src/ts/components/LocationSelect/LocationSelect.ts +299 -0
- package/src/ts/components/LocationSelect/template.html +45 -0
- package/src/ts/components/index.ts +6 -0
- package/src/ts/controller.ts +193 -0
- package/src/ts/model.ts +163 -0
- package/src/ts/types/config.ts +22 -0
- package/src/ts/types/dates.ts +82 -0
- package/src/ts/types/expenses.ts +73 -0
- package/src/ts/types/locations.ts +25 -0
- package/src/ts/utils/config/configDefault.ts +13 -0
- package/src/ts/utils/config/index.ts +12 -0
- package/src/ts/utils/config/numbers.ts +24 -0
- package/src/ts/utils/config/sanitizeConfig.ts +39 -0
- package/src/ts/utils/dates/INPUT_DATE_MINMAX.ts +5 -0
- package/src/ts/utils/dates/YEAR_REGEX.ts +4 -0
- package/src/ts/utils/dates/getDateSlice.ts +54 -0
- package/src/ts/utils/dates/getValidAPIYear.ts +17 -0
- package/src/ts/utils/dates/index.ts +19 -0
- package/src/ts/utils/dates/isDateRaw.ts +90 -0
- package/src/ts/utils/dates/isShortMonth.ts +24 -0
- package/src/ts/utils/dates/isYYYY.ts +10 -0
- package/src/ts/utils/dates/offsetDateString.ts +17 -0
- package/src/ts/utils/expenses/INTL_MIE_RATES.ts +2125 -0
- package/src/ts/utils/expenses/createExpenseObjs.ts +35 -0
- package/src/ts/utils/expenses/getLodgingRateDomestic.ts +73 -0
- package/src/ts/utils/expenses/getLodgingRateIntl.ts +119 -0
- package/src/ts/utils/expenses/getMieRates.ts +84 -0
- package/src/ts/utils/expenses/index.ts +5 -0
- package/src/ts/utils/expenses/parseIntlLodgingRates.ts +124 -0
- package/src/ts/utils/expenses/returnValidStateExpense.ts +46 -0
- package/src/ts/utils/fetch/fetchJsonGSA.ts +29 -0
- package/src/ts/utils/fetch/fetchXmlDOD.ts +38 -0
- package/src/ts/utils/fetch/index.ts +3 -0
- package/src/ts/utils/fetch/memoize.ts +46 -0
- package/src/ts/utils/fetch/parseXml.ts +19 -0
- package/src/ts/utils/locations/getCitiesDomestic.ts +48 -0
- package/src/ts/utils/locations/getCitiesIntl.ts +63 -0
- package/src/ts/utils/locations/getCountriesDomestic.ts +237 -0
- package/src/ts/utils/locations/getCountriesIntl.ts +34 -0
- package/src/ts/utils/locations/index.ts +6 -0
- package/src/ts/utils/locations/keepUniqueLocations.ts +12 -0
- package/src/ts/utils/locations/locationKeys.ts +10 -0
- package/src/ts/utils/locations/returnValidStateLocation.ts +13 -0
- package/src/ts/utils/locations/sortLocations.ts +19 -0
- package/src/ts/utils/misc/USD.ts +4 -0
- package/src/ts/utils/misc/debounce.ts +22 -0
- package/src/ts/utils/misc/handlePointerDown.ts +3 -0
- package/src/ts/utils/misc/handlePointerUp.ts +22 -0
- package/src/ts/utils/misc/inPrimitiveType.ts +4 -0
- package/src/ts/utils/misc/index.ts +6 -0
- package/src/ts/utils/misc/wait.ts +4 -0
- package/src/ts/utils/styles/applyStyles.ts +19 -0
- package/src/ts/utils/styles/highlightInput.ts +15 -0
- package/src/ts/utils/styles/index.ts +3 -0
- package/src/ts/utils/styles/removeStyles.ts +14 -0
- package/src/ts/views/Expense/Expense.ts +465 -0
- package/src/ts/views/Expense/template.html +176 -0
- package/src/ts/views/Location/Location.ts +763 -0
- package/src/ts/views/Location/template-row.html +146 -0
- package/src/ts/views/Location/template.html +130 -0
- package/src/ts/views/index.ts +2 -0
- package/tsconfig.json +27 -0
- package/vite.config.ts +12 -0
|
@@ -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,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
|
+
--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,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,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
|
+
}
|