@bexis2/bexis2-core-ui 0.0.3 → 0.0.4
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/.eslintignore +13 -0
- package/.eslintrc.cjs +20 -0
- package/.prettierignore +13 -0
- package/.prettierrc +9 -0
- package/.vscode/settings.json +99 -0
- package/{TableView.svelte.d.ts → dist/TableView.svelte.d.ts} +23 -23
- package/{components → dist/components}/File/FileIcon.svelte.d.ts +23 -23
- package/{components → dist/components}/File/FileInfo.svelte.d.ts +27 -27
- package/dist/components/File/FileUploader.svelte +217 -0
- package/{components → dist/components}/File/FileUploader.svelte.d.ts +44 -27
- package/{components → dist/components}/ListView.svelte.d.ts +14 -14
- package/dist/components/Spinner/Spinner.svelte +8 -0
- package/dist/components/Spinner/Spinner.svelte.d.ts +23 -0
- package/{index.d.ts → dist/index.d.ts} +9 -9
- package/{index.js → dist/index.js} +9 -9
- package/{models → dist/models}/Models.d.ts +31 -31
- package/{models → dist/models}/Models.js +1 -1
- package/{services → dist/services}/Api.d.ts +7 -7
- package/{services → dist/services}/Api.js +44 -44
- package/{stores → dist/stores}/apistore.d.ts +4 -4
- package/{stores → dist/stores}/apistore.js +22 -22
- package/package.json +36 -168
- package/playwright.config.ts +11 -0
- package/postcss.config.cjs +6 -0
- package/src/app.d.ts +11 -0
- package/src/app.html +15 -0
- package/src/app.postcss +2 -0
- package/src/index.test.ts +7 -0
- package/src/lib/TableView.svelte +1 -0
- package/src/lib/components/File/FileIcon.svelte +49 -0
- package/src/lib/components/File/FileInfo.svelte +14 -0
- package/src/lib/components/File/FileUploader.svelte +217 -0
- package/src/lib/components/ListView.svelte +13 -0
- package/src/lib/components/Spinner/Spinner.svelte +8 -0
- package/src/lib/css/core.ui.postcss +2 -0
- package/src/lib/css/themes/theme-crimson.css +100 -0
- package/src/lib/css/themes/theme-gold-nouveau.css +140 -0
- package/src/lib/css/themes/theme-hamlindigo.css +111 -0
- package/src/lib/css/themes/theme-modern.css +127 -0
- package/src/lib/css/themes/theme-rocket.css +119 -0
- package/src/lib/css/themes/theme-sahara.css +128 -0
- package/src/lib/css/themes/theme-seafoam.css +121 -0
- package/src/lib/css/themes/theme-seasonal.css +115 -0
- package/src/lib/css/themes/theme-skeleton.css +118 -0
- package/src/lib/css/themes/theme-vintage.css +125 -0
- package/src/lib/index.ts +19 -0
- package/src/lib/models/Models.ts +39 -0
- package/src/lib/services/Api.ts +58 -0
- package/src/lib/stores/apistore.ts +32 -0
- package/src/routes/+layout.svelte +10 -0
- package/src/routes/+page.svelte +0 -0
- package/static/favicon.png +0 -0
- package/svelte.config.js +18 -0
- package/tailwind.config.cjs +9 -0
- package/tests/test.ts +6 -0
- package/tsconfig.json +19 -0
- package/vite.config.ts +9 -0
- package/components/File/FileUploader.svelte +0 -135
- /package/{TableView.svelte → dist/TableView.svelte} +0 -0
- /package/{components → dist/components}/File/FileIcon.svelte +0 -0
- /package/{components → dist/components}/File/FileInfo.svelte +0 -0
- /package/{components → dist/components}/ListView.svelte +0 -0
- /package/{css → dist/css}/core.ui.postcss +0 -0
- /package/{css → dist/css}/themes/theme-crimson.css +0 -0
- /package/{css → dist/css}/themes/theme-gold-nouveau.css +0 -0
- /package/{css → dist/css}/themes/theme-hamlindigo.css +0 -0
- /package/{css → dist/css}/themes/theme-modern.css +0 -0
- /package/{css → dist/css}/themes/theme-rocket.css +0 -0
- /package/{css → dist/css}/themes/theme-sahara.css +0 -0
- /package/{css → dist/css}/themes/theme-seafoam.css +0 -0
- /package/{css → dist/css}/themes/theme-seasonal.css +0 -0
- /package/{css → dist/css}/themes/theme-skeleton.css +0 -0
- /package/{css → dist/css}/themes/theme-vintage.css +0 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/* https://fonts.google.com/specimen/Lato?query=lato¬o.query=Abril */
|
|
2
|
+
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
/* =~= Theme Properties =~= */
|
|
6
|
+
--theme-font-family-base: system-ui;
|
|
7
|
+
--theme-font-family-heading: system-ui;
|
|
8
|
+
--theme-font-color-base: 0 0 0;
|
|
9
|
+
--theme-font-color-dark: 255 255 255;
|
|
10
|
+
--theme-rounded-base: 9999px;
|
|
11
|
+
--theme-rounded-container: 8px;
|
|
12
|
+
--theme-border-base: 1px;
|
|
13
|
+
/* =~= Theme On-X Colors =~= */
|
|
14
|
+
--on-primary: 0 0 0;
|
|
15
|
+
--on-secondary: 255 255 255;
|
|
16
|
+
--on-tertiary: 0 0 0;
|
|
17
|
+
--on-success: 0 0 0;
|
|
18
|
+
--on-warning: 0 0 0;
|
|
19
|
+
--on-error: 255 255 255;
|
|
20
|
+
--on-surface: 255 255 255;
|
|
21
|
+
/* =~= Theme Colors =~= */
|
|
22
|
+
/* primary | #0FBA81 */
|
|
23
|
+
--color-primary-50: 219 245 236; /* ⬅ #dbf5ec */
|
|
24
|
+
--color-primary-100: 207 241 230; /* ⬅ #cff1e6 */
|
|
25
|
+
--color-primary-200: 195 238 224; /* ⬅ #c3eee0 */
|
|
26
|
+
--color-primary-300: 159 227 205; /* ⬅ #9fe3cd */
|
|
27
|
+
--color-primary-400: 87 207 167; /* ⬅ #57cfa7 */
|
|
28
|
+
--color-primary-500: 15 186 129; /* ⬅ #0FBA81 */
|
|
29
|
+
--color-primary-600: 14 167 116; /* ⬅ #0ea774 */
|
|
30
|
+
--color-primary-700: 11 140 97; /* ⬅ #0b8c61 */
|
|
31
|
+
--color-primary-800: 9 112 77; /* ⬅ #09704d */
|
|
32
|
+
--color-primary-900: 7 91 63; /* ⬅ #075b3f */
|
|
33
|
+
/* secondary | #4F46E5 */
|
|
34
|
+
--color-secondary-50: 229 227 251; /* ⬅ #e5e3fb */
|
|
35
|
+
--color-secondary-100: 220 218 250; /* ⬅ #dcdafa */
|
|
36
|
+
--color-secondary-200: 211 209 249; /* ⬅ #d3d1f9 */
|
|
37
|
+
--color-secondary-300: 185 181 245; /* ⬅ #b9b5f5 */
|
|
38
|
+
--color-secondary-400: 132 126 237; /* ⬅ #847eed */
|
|
39
|
+
--color-secondary-500: 79 70 229; /* ⬅ #4F46E5 */
|
|
40
|
+
--color-secondary-600: 71 63 206; /* ⬅ #473fce */
|
|
41
|
+
--color-secondary-700: 59 53 172; /* ⬅ #3b35ac */
|
|
42
|
+
--color-secondary-800: 47 42 137; /* ⬅ #2f2a89 */
|
|
43
|
+
--color-secondary-900: 39 34 112; /* ⬅ #272270 */
|
|
44
|
+
/* tertiary | #0EA5E9 */
|
|
45
|
+
--color-tertiary-50: 219 242 252; /* ⬅ #dbf2fc */
|
|
46
|
+
--color-tertiary-100: 207 237 251; /* ⬅ #cfedfb */
|
|
47
|
+
--color-tertiary-200: 195 233 250; /* ⬅ #c3e9fa */
|
|
48
|
+
--color-tertiary-300: 159 219 246; /* ⬅ #9fdbf6 */
|
|
49
|
+
--color-tertiary-400: 86 192 240; /* ⬅ #56c0f0 */
|
|
50
|
+
--color-tertiary-500: 14 165 233; /* ⬅ #0EA5E9 */
|
|
51
|
+
--color-tertiary-600: 13 149 210; /* ⬅ #0d95d2 */
|
|
52
|
+
--color-tertiary-700: 11 124 175; /* ⬅ #0b7caf */
|
|
53
|
+
--color-tertiary-800: 8 99 140; /* ⬅ #08638c */
|
|
54
|
+
--color-tertiary-900: 7 81 114; /* ⬅ #075172 */
|
|
55
|
+
/* success | #84cc16 */
|
|
56
|
+
--color-success-50: 237 247 220; /* ⬅ #edf7dc */
|
|
57
|
+
--color-success-100: 230 245 208; /* ⬅ #e6f5d0 */
|
|
58
|
+
--color-success-200: 224 242 197; /* ⬅ #e0f2c5 */
|
|
59
|
+
--color-success-300: 206 235 162; /* ⬅ #ceeba2 */
|
|
60
|
+
--color-success-400: 169 219 92; /* ⬅ #a9db5c */
|
|
61
|
+
--color-success-500: 132 204 22; /* ⬅ #84cc16 */
|
|
62
|
+
--color-success-600: 119 184 20; /* ⬅ #77b814 */
|
|
63
|
+
--color-success-700: 99 153 17; /* ⬅ #639911 */
|
|
64
|
+
--color-success-800: 79 122 13; /* ⬅ #4f7a0d */
|
|
65
|
+
--color-success-900: 65 100 11; /* ⬅ #41640b */
|
|
66
|
+
/* warning | #EAB308 */
|
|
67
|
+
--color-warning-50: 252 244 218; /* ⬅ #fcf4da */
|
|
68
|
+
--color-warning-100: 251 240 206; /* ⬅ #fbf0ce */
|
|
69
|
+
--color-warning-200: 250 236 193; /* ⬅ #faecc1 */
|
|
70
|
+
--color-warning-300: 247 225 156; /* ⬅ #f7e19c */
|
|
71
|
+
--color-warning-400: 240 202 82; /* ⬅ #f0ca52 */
|
|
72
|
+
--color-warning-500: 234 179 8; /* ⬅ #EAB308 */
|
|
73
|
+
--color-warning-600: 211 161 7; /* ⬅ #d3a107 */
|
|
74
|
+
--color-warning-700: 176 134 6; /* ⬅ #b08606 */
|
|
75
|
+
--color-warning-800: 140 107 5; /* ⬅ #8c6b05 */
|
|
76
|
+
--color-warning-900: 115 88 4; /* ⬅ #735804 */
|
|
77
|
+
/* error | #D41976 */
|
|
78
|
+
--color-error-50: 249 221 234; /* ⬅ #f9ddea */
|
|
79
|
+
--color-error-100: 246 209 228; /* ⬅ #f6d1e4 */
|
|
80
|
+
--color-error-200: 244 198 221; /* ⬅ #f4c6dd */
|
|
81
|
+
--color-error-300: 238 163 200; /* ⬅ #eea3c8 */
|
|
82
|
+
--color-error-400: 225 94 159; /* ⬅ #e15e9f */
|
|
83
|
+
--color-error-500: 212 25 118; /* ⬅ #D41976 */
|
|
84
|
+
--color-error-600: 191 23 106; /* ⬅ #bf176a */
|
|
85
|
+
--color-error-700: 159 19 89; /* ⬅ #9f1359 */
|
|
86
|
+
--color-error-800: 127 15 71; /* ⬅ #7f0f47 */
|
|
87
|
+
--color-error-900: 104 12 58; /* ⬅ #680c3a */
|
|
88
|
+
/* surface | #495a8f */
|
|
89
|
+
--color-surface-50: 228 230 238; /* ⬅ #e4e6ee */
|
|
90
|
+
--color-surface-100: 219 222 233; /* ⬅ #dbdee9 */
|
|
91
|
+
--color-surface-200: 210 214 227; /* ⬅ #d2d6e3 */
|
|
92
|
+
--color-surface-300: 182 189 210; /* ⬅ #b6bdd2 */
|
|
93
|
+
--color-surface-400: 128 140 177; /* ⬅ #808cb1 */
|
|
94
|
+
--color-surface-500: 73 90 143; /* ⬅ #495a8f */
|
|
95
|
+
--color-surface-600: 66 81 129; /* ⬅ #425181 */
|
|
96
|
+
--color-surface-700: 55 68 107; /* ⬅ #37446b */
|
|
97
|
+
--color-surface-800: 44 54 86; /* ⬅ #2c3656 */
|
|
98
|
+
--color-surface-900: 36 44 70; /* ⬅ #242c46 */
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Headings */
|
|
102
|
+
[data-theme='skeleton'] h1,
|
|
103
|
+
[data-theme='skeleton'] h2,
|
|
104
|
+
[data-theme='skeleton'] h3,
|
|
105
|
+
[data-theme='skeleton'] h4,
|
|
106
|
+
[data-theme='skeleton'] h5,
|
|
107
|
+
[data-theme='skeleton'] h6 {
|
|
108
|
+
font-weight: bold;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Applied to body with `<body data-theme="skeleton">` */
|
|
112
|
+
/* Created with: https://csshero.org/mesher/ */
|
|
113
|
+
/* prettier-ignore */
|
|
114
|
+
[data-theme='skeleton'] {
|
|
115
|
+
background-image:
|
|
116
|
+
radial-gradient(at 0% 0%, rgba(var(--color-secondary-500) / 0.33) 0px, transparent 50%),
|
|
117
|
+
radial-gradient(at 98% 1%, rgba(var(--color-error-500) / 0.33) 0px, transparent 50%);
|
|
118
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/* https://fonts.google.com/specimen/Abril+Fatface?query=Abril+Fatface¬o.query=Abril */
|
|
2
|
+
@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&display=swap');
|
|
3
|
+
/* https://fonts.google.com/noto/specimen/Noto+Sans?query=sans */
|
|
4
|
+
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100;0,200;0,300;0,400;1,100;1,200;1,300&display=swap');
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
/* =~= Theme Styles =~= */
|
|
8
|
+
--theme-font-family-base: 'Noto Sans', sans-serif;
|
|
9
|
+
--theme-font-family-heading: 'Abril Fatface', cursive;
|
|
10
|
+
--theme-font-color-base: var(--color-primary-900);
|
|
11
|
+
--theme-font-color-dark: var(--color-primary-100);
|
|
12
|
+
--theme-rounded-base: 2px;
|
|
13
|
+
--theme-rounded-container: 4px;
|
|
14
|
+
--theme-border-base: 1px;
|
|
15
|
+
/* =~= Theme On-X Colors =~= */
|
|
16
|
+
--on-primary: 0 0 0;
|
|
17
|
+
--on-secondary: 0 0 0;
|
|
18
|
+
--on-tertiary: 0 0 0;
|
|
19
|
+
--on-success: 0 0 0;
|
|
20
|
+
--on-warning: 0 0 0;
|
|
21
|
+
--on-error: 0 0 0;
|
|
22
|
+
--on-surface: 255 255 255;
|
|
23
|
+
/* =~= Theme Colors =~= */
|
|
24
|
+
/* primary | #ea861a */
|
|
25
|
+
--color-primary-50: 252 237 221; /* ⬅ #fceddd */
|
|
26
|
+
--color-primary-100: 251 231 209; /* ⬅ #fbe7d1 */
|
|
27
|
+
--color-primary-200: 250 225 198; /* ⬅ #fae1c6 */
|
|
28
|
+
--color-primary-300: 247 207 163; /* ⬅ #f7cfa3 */
|
|
29
|
+
--color-primary-400: 240 170 95; /* ⬅ #f0aa5f */
|
|
30
|
+
--color-primary-500: 234 134 26; /* ⬅ #ea861a */
|
|
31
|
+
--color-primary-600: 211 121 23; /* ⬅ #d37917 */
|
|
32
|
+
--color-primary-700: 176 101 20; /* ⬅ #b06514 */
|
|
33
|
+
--color-primary-800: 140 80 16; /* ⬅ #8c5010 */
|
|
34
|
+
--color-primary-900: 115 66 13; /* ⬅ #73420d */
|
|
35
|
+
/* secondary | #97cea5 */
|
|
36
|
+
--color-secondary-50: 239 248 242; /* ⬅ #eff8f2 */
|
|
37
|
+
--color-secondary-100: 234 245 237; /* ⬅ #eaf5ed */
|
|
38
|
+
--color-secondary-200: 229 243 233; /* ⬅ #e5f3e9 */
|
|
39
|
+
--color-secondary-300: 213 235 219; /* ⬅ #d5ebdb */
|
|
40
|
+
--color-secondary-400: 182 221 192; /* ⬅ #b6ddc0 */
|
|
41
|
+
--color-secondary-500: 151 206 165; /* ⬅ #97cea5 */
|
|
42
|
+
--color-secondary-600: 136 185 149; /* ⬅ #88b995 */
|
|
43
|
+
--color-secondary-700: 113 155 124; /* ⬅ #719b7c */
|
|
44
|
+
--color-secondary-800: 91 124 99; /* ⬅ #5b7c63 */
|
|
45
|
+
--color-secondary-900: 74 101 81; /* ⬅ #4a6551 */
|
|
46
|
+
/* tertiary | #06b6d4 */
|
|
47
|
+
--color-tertiary-50: 218 244 249; /* ⬅ #daf4f9 */
|
|
48
|
+
--color-tertiary-100: 205 240 246; /* ⬅ #cdf0f6 */
|
|
49
|
+
--color-tertiary-200: 193 237 244; /* ⬅ #c1edf4 */
|
|
50
|
+
--color-tertiary-300: 155 226 238; /* ⬅ #9be2ee */
|
|
51
|
+
--color-tertiary-400: 81 204 225; /* ⬅ #51cce1 */
|
|
52
|
+
--color-tertiary-500: 6 182 212; /* ⬅ #06b6d4 */
|
|
53
|
+
--color-tertiary-600: 5 164 191; /* ⬅ #05a4bf */
|
|
54
|
+
--color-tertiary-700: 5 137 159; /* ⬅ #05899f */
|
|
55
|
+
--color-tertiary-800: 4 109 127; /* ⬅ #046d7f */
|
|
56
|
+
--color-tertiary-900: 3 89 104; /* ⬅ #035968 */
|
|
57
|
+
/* success | #84cb5d */
|
|
58
|
+
--color-success-50: 237 247 231; /* ⬅ #edf7e7 */
|
|
59
|
+
--color-success-100: 230 245 223; /* ⬅ #e6f5df */
|
|
60
|
+
--color-success-200: 224 242 215; /* ⬅ #e0f2d7 */
|
|
61
|
+
--color-success-300: 206 234 190; /* ⬅ #ceeabe */
|
|
62
|
+
--color-success-400: 169 219 142; /* ⬅ #a9db8e */
|
|
63
|
+
--color-success-500: 132 203 93; /* ⬅ #84cb5d */
|
|
64
|
+
--color-success-600: 119 183 84; /* ⬅ #77b754 */
|
|
65
|
+
--color-success-700: 99 152 70; /* ⬅ #639846 */
|
|
66
|
+
--color-success-800: 79 122 56; /* ⬅ #4f7a38 */
|
|
67
|
+
--color-success-900: 65 99 46; /* ⬅ #41632e */
|
|
68
|
+
/* warning | #f2ac23 */
|
|
69
|
+
--color-warning-50: 253 243 222; /* ⬅ #fdf3de */
|
|
70
|
+
--color-warning-100: 252 238 211; /* ⬅ #fceed3 */
|
|
71
|
+
--color-warning-200: 252 234 200; /* ⬅ #fceac8 */
|
|
72
|
+
--color-warning-300: 250 222 167; /* ⬅ #fadea7 */
|
|
73
|
+
--color-warning-400: 246 197 101; /* ⬅ #f6c565 */
|
|
74
|
+
--color-warning-500: 242 172 35; /* ⬅ #f2ac23 */
|
|
75
|
+
--color-warning-600: 218 155 32; /* ⬅ #da9b20 */
|
|
76
|
+
--color-warning-700: 182 129 26; /* ⬅ #b6811a */
|
|
77
|
+
--color-warning-800: 145 103 21; /* ⬅ #916715 */
|
|
78
|
+
--color-warning-900: 119 84 17; /* ⬅ #775411 */
|
|
79
|
+
/* error | #d57e78 */
|
|
80
|
+
--color-error-50: 249 236 235; /* ⬅ #f9eceb */
|
|
81
|
+
--color-error-100: 247 229 228; /* ⬅ #f7e5e4 */
|
|
82
|
+
--color-error-200: 245 223 221; /* ⬅ #f5dfdd */
|
|
83
|
+
--color-error-300: 238 203 201; /* ⬅ #eecbc9 */
|
|
84
|
+
--color-error-400: 226 165 161; /* ⬅ #e2a5a1 */
|
|
85
|
+
--color-error-500: 213 126 120; /* ⬅ #d57e78 */
|
|
86
|
+
--color-error-600: 192 113 108; /* ⬅ #c0716c */
|
|
87
|
+
--color-error-700: 160 95 90; /* ⬅ #a05f5a */
|
|
88
|
+
--color-error-800: 128 76 72; /* ⬅ #804c48 */
|
|
89
|
+
--color-error-900: 104 62 59; /* ⬅ #683e3b */
|
|
90
|
+
/* surface | #3f3731 */
|
|
91
|
+
--color-surface-50: 226 225 224; /* ⬅ #e2e1e0 */
|
|
92
|
+
--color-surface-100: 217 215 214; /* ⬅ #d9d7d6 */
|
|
93
|
+
--color-surface-200: 207 205 204; /* ⬅ #cfcdcc */
|
|
94
|
+
--color-surface-300: 178 175 173; /* ⬅ #b2afad */
|
|
95
|
+
--color-surface-400: 121 115 111; /* ⬅ #79736f */
|
|
96
|
+
--color-surface-500: 63 55 49; /* ⬅ #3f3731 */
|
|
97
|
+
--color-surface-600: 57 50 44; /* ⬅ #39322c */
|
|
98
|
+
--color-surface-700: 47 41 37; /* ⬅ #2f2925 */
|
|
99
|
+
--color-surface-800: 38 33 29; /* ⬅ #26211d */
|
|
100
|
+
--color-surface-900: 31 27 24; /* ⬅ #1f1b18 */
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[data-theme='vintage'] h1,
|
|
104
|
+
[data-theme='vintage'] h2,
|
|
105
|
+
[data-theme='vintage'] h3,
|
|
106
|
+
[data-theme='vintage'] h4,
|
|
107
|
+
[data-theme='vintage'] h5,
|
|
108
|
+
[data-theme='vintage'] h6 {
|
|
109
|
+
letter-spacing: 1px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Applied to body with `<body data-theme="vintage">` */
|
|
113
|
+
/* Created with: https://csshero.org/mesher/ */
|
|
114
|
+
[data-theme='vintage'] {
|
|
115
|
+
/* prettier-ignore */
|
|
116
|
+
background-image:
|
|
117
|
+
radial-gradient(at 100% 0%, hsla(135,34%,70%,0.20) 0px, transparent 50%),
|
|
118
|
+
radial-gradient(at 85% 100%, hsla(31,83%,50%,0.20) 0px, transparent 50%);
|
|
119
|
+
}
|
|
120
|
+
.dark [data-theme='vintage'] {
|
|
121
|
+
/* prettier-ignore */
|
|
122
|
+
background-image:
|
|
123
|
+
radial-gradient(at 100% 0%, hsla(135,34%,70%,0.14) 0px, transparent 50%),
|
|
124
|
+
radial-gradient(at 85% 100%, hsla(31,83%,50%,0.14) 0px, transparent 50%);
|
|
125
|
+
}
|
package/src/lib/index.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
// Reexport your entry components here
|
|
3
|
+
import ListView from './components/ListView.svelte'
|
|
4
|
+
|
|
5
|
+
import TableView from './TableView.svelte'
|
|
6
|
+
import FileIcon from './components/File/FileIcon.svelte'
|
|
7
|
+
import FileInfo from './components/File/FileInfo.svelte'
|
|
8
|
+
import FileUploader from './components/File/FileUploader.svelte'
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export {ListView,TableView, FileInfo, FileIcon, FileUploader }
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export {Api} from './services/Api.js'
|
|
16
|
+
export {host,username,password,setApiConfig} from './stores/apistore.js'
|
|
17
|
+
|
|
18
|
+
export type {user, FileUploaderModel} from './models/Models.js'
|
|
19
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
export interface FileInfo {
|
|
3
|
+
name:string,
|
|
4
|
+
type:string,
|
|
5
|
+
lenght:number,
|
|
6
|
+
description:string,
|
|
7
|
+
validationHash:string,
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export interface FileUploaderModel{
|
|
13
|
+
accept:string[],
|
|
14
|
+
existingFiles:FileInfo[],
|
|
15
|
+
descriptionType:number,
|
|
16
|
+
multiple:boolean,
|
|
17
|
+
maxSize:number,
|
|
18
|
+
lastModification:Date
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface Files {
|
|
22
|
+
accepted:Blob[],
|
|
23
|
+
rejected:Blob[]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
export type user = {
|
|
28
|
+
name:string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface FileObj{
|
|
32
|
+
path:string,
|
|
33
|
+
lastModified:number,
|
|
34
|
+
lastModifiedDate:Date,
|
|
35
|
+
name:string,
|
|
36
|
+
size:number,
|
|
37
|
+
type:string,
|
|
38
|
+
webkitRelativePath:string
|
|
39
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Api.js
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
import { host, username, password } from "../stores/apistore";
|
|
4
|
+
|
|
5
|
+
console.log("setup axios")
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
// implement a method to execute all the request from here.
|
|
9
|
+
const apiRequest = (method, url, request) => {
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
// Create a instance of axios to use the same base url.
|
|
13
|
+
const axiosAPI = axios.create({
|
|
14
|
+
baseURL : host
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const headers = {
|
|
18
|
+
authorization: 'Basic ' + btoa(username + ":" + password)
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
//using the axios instance to perform the request that received from each http method
|
|
22
|
+
return axiosAPI({
|
|
23
|
+
method,
|
|
24
|
+
url,
|
|
25
|
+
data: request,
|
|
26
|
+
headers
|
|
27
|
+
}).then(res => {
|
|
28
|
+
|
|
29
|
+
return Promise.resolve(res);
|
|
30
|
+
})
|
|
31
|
+
.catch(err => {
|
|
32
|
+
return Promise.reject(err);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// function to execute the http get request
|
|
37
|
+
const get = (url, request="") => apiRequest("get",url,request);
|
|
38
|
+
|
|
39
|
+
// function to execute the http delete request
|
|
40
|
+
const deleteRequest = (url, request) => apiRequest("delete", url, request);
|
|
41
|
+
|
|
42
|
+
// function to execute the http post request
|
|
43
|
+
const post = (url, request) => apiRequest("post", url, request);
|
|
44
|
+
|
|
45
|
+
// function to execute the http put request
|
|
46
|
+
const put = (url, request) => apiRequest("put", url, request);
|
|
47
|
+
|
|
48
|
+
// function to execute the http path request
|
|
49
|
+
const patch = (url, request) => apiRequest("patch", url, request);
|
|
50
|
+
|
|
51
|
+
// expose your method to other services or actions
|
|
52
|
+
export const Api ={
|
|
53
|
+
get,
|
|
54
|
+
delete: deleteRequest,
|
|
55
|
+
post,
|
|
56
|
+
put,
|
|
57
|
+
patch
|
|
58
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { writable } from 'svelte/store'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export let host = "window.location.origin";
|
|
5
|
+
export let username = "";
|
|
6
|
+
export let password = "";
|
|
7
|
+
|
|
8
|
+
const hostStore = writable(""); //writable(window.location.origin);
|
|
9
|
+
const usernameStore = writable("");
|
|
10
|
+
const passwordStore = writable("");
|
|
11
|
+
|
|
12
|
+
hostStore.subscribe(value => {
|
|
13
|
+
host = value;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
usernameStore.subscribe(value => {
|
|
17
|
+
username = value;
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
passwordStore.subscribe(value => {
|
|
21
|
+
password = value;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export function setApiConfig(_host:string ,_user:string,_pw:string)
|
|
27
|
+
{
|
|
28
|
+
console.log("overwrite settings");
|
|
29
|
+
hostStore.update(h=>h = _host);
|
|
30
|
+
usernameStore.update(u=>u = _user);
|
|
31
|
+
passwordStore.update(p=>p = _pw);
|
|
32
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script lang='ts'>
|
|
2
|
+
// The ordering of these imports is critical to your app working properly
|
|
3
|
+
import '@skeletonlabs/skeleton/themes/theme-skeleton.css';
|
|
4
|
+
// If you have source.organizeImports set to true in VSCode, then it will auto change this ordering
|
|
5
|
+
import '@skeletonlabs/skeleton/styles/all.css';
|
|
6
|
+
// Most of your app wide CSS should be put in this file
|
|
7
|
+
import '../app.postcss';
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<slot />
|
|
File without changes
|
|
Binary file
|
package/svelte.config.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import adapter from '@sveltejs/adapter-auto';
|
|
2
|
+
import { vitePreprocess } from '@sveltejs/kit/vite';
|
|
3
|
+
|
|
4
|
+
/** @type {import('@sveltejs/kit').Config} */
|
|
5
|
+
const config = {
|
|
6
|
+
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
|
7
|
+
// for more information about preprocessors
|
|
8
|
+
preprocess: vitePreprocess(),
|
|
9
|
+
|
|
10
|
+
kit: {
|
|
11
|
+
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
|
12
|
+
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
|
|
13
|
+
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
|
14
|
+
adapter: adapter()
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default config;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
darkMode: 'class',
|
|
4
|
+
content: ['./src/**/*.{html,js,svelte,ts}', require('path').join(require.resolve('@skeletonlabs/skeleton'), '../**/*.{html,js,svelte,ts}')],
|
|
5
|
+
theme: {
|
|
6
|
+
extend: {},
|
|
7
|
+
},
|
|
8
|
+
plugins: [...require('@skeletonlabs/skeleton/tailwind/skeleton.cjs')()],
|
|
9
|
+
}
|
package/tests/test.ts
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./.svelte-kit/tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"checkJs": true,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"forceConsistentCasingInFileNames": true,
|
|
8
|
+
"resolveJsonModule": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"noImplicitAny": false
|
|
13
|
+
},
|
|
14
|
+
"exclude": ["node_modules"]
|
|
15
|
+
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
|
|
16
|
+
//
|
|
17
|
+
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
|
|
18
|
+
// from the referenced tsconfig.json - TypeScript does not merge them in
|
|
19
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
<script >import DropZone from "svelte-file-dropzone/src/index";
|
|
2
|
-
import { Fa } from "svelte-fa/src/index.js";
|
|
3
|
-
import { Spinner, Button, Row, Col, Input } from "sveltestrap";
|
|
4
|
-
import { createEventDispatcher } from "svelte";
|
|
5
|
-
import { faTrash } from "@fortawesome/free-solid-svg-icons";
|
|
6
|
-
import { faSave } from "@fortawesome/free-regular-svg-icons";
|
|
7
|
-
import { faFileUpload } from "@fortawesome/free-solid-svg-icons";
|
|
8
|
-
import { Api } from "../../services/Api.js";
|
|
9
|
-
export let id = 0;
|
|
10
|
-
export let version = 1;
|
|
11
|
-
import { onMount } from "svelte";
|
|
12
|
-
export let start = "";
|
|
13
|
-
export let submit = "";
|
|
14
|
-
export let context = "";
|
|
15
|
-
export let data;
|
|
16
|
-
$:
|
|
17
|
-
model = data;
|
|
18
|
-
$:
|
|
19
|
-
submitBt = "submit";
|
|
20
|
-
let maxSize = 0;
|
|
21
|
-
const dispatch = createEventDispatcher();
|
|
22
|
-
let fx;
|
|
23
|
-
let files = { accepted: [], rejected: [] };
|
|
24
|
-
$:
|
|
25
|
-
files;
|
|
26
|
-
onMount(async () => {
|
|
27
|
-
console.log("fileupload - OnMount", data);
|
|
28
|
-
if (!data) {
|
|
29
|
-
load();
|
|
30
|
-
} else {
|
|
31
|
-
model = data;
|
|
32
|
-
}
|
|
33
|
-
if (model) {
|
|
34
|
-
submitBt += context;
|
|
35
|
-
maxSize = model.maxSize * 1024 * 1024;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
async function load() {
|
|
39
|
-
let url = start + "?id=" + id + "&version=" + version;
|
|
40
|
-
const res = await Api.get(url);
|
|
41
|
-
model = await res.json();
|
|
42
|
-
console.log("fileupload", model);
|
|
43
|
-
}
|
|
44
|
-
function handleFilesSelect(e) {
|
|
45
|
-
console.log("handleFilesSelect", e);
|
|
46
|
-
console.log("files", files);
|
|
47
|
-
const { acceptedFiles, fileRejections } = e.detail;
|
|
48
|
-
files.accepted = [...files.accepted, ...acceptedFiles];
|
|
49
|
-
files.rejected = [...files.rejected, ...fileRejections];
|
|
50
|
-
console.log("acceptedFiles", acceptedFiles);
|
|
51
|
-
console.log("files.accepted", files.accepted);
|
|
52
|
-
if (fileRejections.length > 0) {
|
|
53
|
-
console.log("the dropped file is not supported.");
|
|
54
|
-
console.log(files.rejected);
|
|
55
|
-
let messages = [""];
|
|
56
|
-
for (let index = 0; index < fileRejections.length; index++) {
|
|
57
|
-
const element = fileRejections[index];
|
|
58
|
-
messages.push(getErrorMessage(element));
|
|
59
|
-
}
|
|
60
|
-
console.log(messages);
|
|
61
|
-
dispatch("error", { messages });
|
|
62
|
-
files.rejected = [];
|
|
63
|
-
}
|
|
64
|
-
if (acceptedFiles.length > 0) {
|
|
65
|
-
document.getElementById(submitBt)?.click();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function getErrorMessage(rejected) {
|
|
69
|
-
let message = "";
|
|
70
|
-
message = rejected.file.path + " : ";
|
|
71
|
-
let errors = rejected.errors;
|
|
72
|
-
for (let index = 0; index < errors.length; index++) {
|
|
73
|
-
const error = errors[index];
|
|
74
|
-
message += error.message;
|
|
75
|
-
}
|
|
76
|
-
return message;
|
|
77
|
-
}
|
|
78
|
-
async function handleSubmit() {
|
|
79
|
-
console.log("SUBMIT");
|
|
80
|
-
dispatch("submit");
|
|
81
|
-
let url = submit + "?id=" + id;
|
|
82
|
-
console.log("SUBMIT");
|
|
83
|
-
if (files.accepted.length > 0) {
|
|
84
|
-
console.log(files);
|
|
85
|
-
const formData = new FormData();
|
|
86
|
-
formData.append("files", "123");
|
|
87
|
-
for (var i = 0; i < files.accepted.length; i++) {
|
|
88
|
-
formData.append(files.accepted[i].name, files.accepted[i]);
|
|
89
|
-
}
|
|
90
|
-
const response = await Api.post(url, formData);
|
|
91
|
-
if (response.status == 200) {
|
|
92
|
-
dispatch("submited");
|
|
93
|
-
let message = files.accepted.length + " is/are uploaded";
|
|
94
|
-
dispatch("success", { text: message });
|
|
95
|
-
files.accepted = [];
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
</script>
|
|
100
|
-
|
|
101
|
-
<form on:submit|preventDefault={handleSubmit}>
|
|
102
|
-
{#if model}
|
|
103
|
-
<!--if model exist -->
|
|
104
|
-
<Row>
|
|
105
|
-
|
|
106
|
-
<DropZone
|
|
107
|
-
on:drop={handleFilesSelect}
|
|
108
|
-
accept={model.accept}
|
|
109
|
-
multiple={model.multiple}
|
|
110
|
-
{maxSize}>
|
|
111
|
-
|
|
112
|
-
<b style="font-size:xx-large"><Fa icon={faFileUpload}/></b>
|
|
113
|
-
<span><b>Drag 'n' drop some files here, or click to select files</b>
|
|
114
|
-
<b>max file : {model.maxSize} mb</b></span>
|
|
115
|
-
<p>
|
|
116
|
-
{#if model.accept}
|
|
117
|
-
{#each model.accept as ext}
|
|
118
|
-
{ext} ,
|
|
119
|
-
{/each}
|
|
120
|
-
{/if}
|
|
121
|
-
</p>
|
|
122
|
-
</DropZone>
|
|
123
|
-
|
|
124
|
-
</Row>
|
|
125
|
-
|
|
126
|
-
<Button id="{submitBt}" color="primary" style="display:none" ><Fa icon={faSave}/></Button>
|
|
127
|
-
|
|
128
|
-
{:else} <!-- while data is not loaded show a loading information -->
|
|
129
|
-
|
|
130
|
-
<Spinner color="info" size="sm" type ="grow" />
|
|
131
|
-
{/if}
|
|
132
|
-
|
|
133
|
-
</form>
|
|
134
|
-
|
|
135
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|