@bexis2/bexis2-core-ui 0.0.23 → 0.0.26

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 (69) hide show
  1. package/README.md +3 -12
  2. package/dist/TableView.svelte +1 -1
  3. package/dist/components/ListView.svelte +5 -5
  4. package/dist/components/Table/Table.svelte +167 -0
  5. package/dist/components/Table/Table.svelte.d.ts +17 -0
  6. package/dist/components/Table/TableFilter.svelte +168 -0
  7. package/dist/components/Table/TableFilter.svelte.d.ts +21 -0
  8. package/dist/components/Table/TablePagination.svelte +60 -0
  9. package/dist/components/Table/TablePagination.svelte.d.ts +17 -0
  10. package/dist/components/Table/filter.d.ts +4 -0
  11. package/dist/components/Table/filter.js +83 -0
  12. package/dist/components/file/FileIcon.svelte +45 -49
  13. package/dist/components/file/FileInfo.svelte +13 -14
  14. package/dist/components/file/FileUploader.svelte +34 -37
  15. package/dist/components/form/Checkbox.svelte +13 -17
  16. package/dist/components/form/CheckboxKvPList.svelte +16 -12
  17. package/dist/components/form/CheckboxList.svelte +10 -10
  18. package/dist/components/form/DateInput.svelte +17 -18
  19. package/dist/components/form/DateInput.svelte.d.ts +4 -4
  20. package/dist/components/form/DropdownKvP.svelte +44 -52
  21. package/dist/components/form/DropdownKvP.svelte.d.ts +10 -10
  22. package/dist/components/form/InputContainer.svelte +18 -20
  23. package/dist/components/form/InputContainer.svelte.d.ts +1 -1
  24. package/dist/components/form/MultiSelect.svelte +91 -101
  25. package/dist/components/form/NumberInput.svelte +17 -18
  26. package/dist/components/form/NumberInput.svelte.d.ts +4 -4
  27. package/dist/components/form/TextArea.svelte +16 -18
  28. package/dist/components/form/TextArea.svelte.d.ts +4 -5
  29. package/dist/components/form/TextInput.svelte +17 -21
  30. package/dist/components/form/TextInput.svelte.d.ts +4 -4
  31. package/dist/components/spinner/Spinner.svelte +9 -8
  32. package/dist/css/core.ui.css +5 -2
  33. package/dist/css/themes/theme-bexis2.css +96 -100
  34. package/dist/css/themes/theme-crimson.css +3 -2
  35. package/dist/css/themes/theme-hamlindigo.css +3 -2
  36. package/dist/css/themes/theme-seafoam.css +3 -2
  37. package/dist/models/Models.d.ts +28 -0
  38. package/dist/services/Api.js +12 -11
  39. package/dist/stores/apistore.js +13 -13
  40. package/package.json +17 -4
  41. package/src/lib/TableView.svelte +1 -1
  42. package/src/lib/components/ListView.svelte +11 -13
  43. package/src/lib/components/Table/Table.svelte +184 -0
  44. package/src/lib/components/Table/TableFilter.svelte +176 -0
  45. package/src/lib/components/Table/TablePagination.svelte +61 -0
  46. package/src/lib/components/Table/filter.ts +94 -0
  47. package/src/lib/components/file/FileIcon.svelte +45 -49
  48. package/src/lib/components/file/FileInfo.svelte +13 -14
  49. package/src/lib/components/file/FileUploader.svelte +184 -217
  50. package/src/lib/components/form/Checkbox.svelte +24 -32
  51. package/src/lib/components/form/CheckboxKvPList.svelte +27 -24
  52. package/src/lib/components/form/CheckboxList.svelte +21 -22
  53. package/src/lib/components/form/DateInput.svelte +24 -30
  54. package/src/lib/components/form/DropdownKvP.svelte +44 -52
  55. package/src/lib/components/form/InputContainer.svelte +22 -27
  56. package/src/lib/components/form/MultiSelect.svelte +91 -101
  57. package/src/lib/components/form/NumberInput.svelte +24 -30
  58. package/src/lib/components/form/TextArea.svelte +23 -28
  59. package/src/lib/components/form/TextInput.svelte +24 -33
  60. package/src/lib/components/spinner/Spinner.svelte +9 -8
  61. package/src/lib/css/core.ui.css +5 -2
  62. package/src/lib/css/themes/theme-bexis2.css +96 -100
  63. package/src/lib/css/themes/theme-crimson.css +3 -2
  64. package/src/lib/css/themes/theme-hamlindigo.css +3 -2
  65. package/src/lib/css/themes/theme-seafoam.css +3 -2
  66. package/src/lib/index.ts +31 -23
  67. package/src/lib/models/Models.ts +70 -39
  68. package/src/lib/services/Api.ts +55 -58
  69. package/src/lib/stores/apistore.ts +28 -32
@@ -1,100 +1,96 @@
1
- :root {
2
- /* =~= Theme Properties =~= */
3
- --theme-font-family-base: system-ui;
4
- --theme-font-family-heading: system-ui;
5
- --theme-font-color-base: 0 0 0;
6
- --theme-font-color-dark: 255 255 255;
7
- --theme-rounded-base: 4px;
8
- --theme-rounded-container: 4px;
9
- --theme-border-base: 1px;
10
- /* =~= Theme On-X Colors =~= */
11
- --on-primary: 0 0 0;
12
- --on-secondary: 0 0 0;
13
- --on-tertiary: 0 0 0;
14
- --on-success: 0 0 0;
15
- --on-warning: 255 255 255;
16
- --on-error: 255 255 255;
17
- --on-surface: 0 0 0;
18
- /* =~= Theme Colors =~= */
19
- /* primary | #45b2a1 */
20
- --color-primary-50: 227 243 241; /* ⬅ #e3f3f1 */
21
- --color-primary-100: 218 240 236; /* ⬅ #daf0ec */
22
- --color-primary-200: 209 236 232; /* ⬅ #d1ece8 */
23
- --color-primary-300: 181 224 217; /* ⬅ #b5e0d9 */
24
- --color-primary-400: 125 201 189; /* ⬅ #7dc9bd */
25
- --color-primary-500: 69 178 161; /* ⬅ #45b2a1 */
26
- --color-primary-600: 62 160 145; /* ⬅ #3ea091 */
27
- --color-primary-700: 52 134 121; /* ⬅ #348679 */
28
- --color-primary-800: 41 107 97; /* ⬅ #296b61 */
29
- --color-primary-900: 34 87 79; /* ⬅ #22574f */
30
- /* secondary | #ff9700 */
31
- --color-secondary-50: 255 239 217; /* ⬅ #ffefd9 */
32
- --color-secondary-100: 255 234 204; /* ⬅ #ffeacc */
33
- --color-secondary-200: 255 229 191; /* ⬅ #ffe5bf */
34
- --color-secondary-300: 255 213 153; /* ⬅ #ffd599 */
35
- --color-secondary-400: 255 182 77; /* ⬅ #ffb64d */
36
- --color-secondary-500: 255 151 0; /* ⬅ #ff9700 */
37
- --color-secondary-600: 230 136 0; /* ⬅ #e68800 */
38
- --color-secondary-700: 191 113 0; /* ⬅ #bf7100 */
39
- --color-secondary-800: 153 91 0; /* ⬅ #995b00 */
40
- --color-secondary-900: 125 74 0; /* ⬅ #7d4a00 */
41
- /* tertiary | #bee1da */
42
- --color-tertiary-50: 245 251 249; /* ⬅ #f5fbf9 */
43
- --color-tertiary-100: 242 249 248; /* ⬅ #f2f9f8 */
44
- --color-tertiary-200: 239 248 246; /* ⬅ #eff8f6 */
45
- --color-tertiary-300: 229 243 240; /* ⬅ #e5f3f0 */
46
- --color-tertiary-400: 210 234 229; /* ⬅ #d2eae5 */
47
- --color-tertiary-500: 190 225 218; /* ⬅ #bee1da */
48
- --color-tertiary-600: 171 203 196; /* ⬅ #abcbc4 */
49
- --color-tertiary-700: 143 169 164; /* ⬅ #8fa9a4 */
50
- --color-tertiary-800: 114 135 131; /* ⬅ #728783 */
51
- --color-tertiary-900: 93 110 107; /* ⬅ #5d6e6b */
52
- /* success | #4BB543 */
53
- --color-success-50: 228 244 227; /* ⬅ #e4f4e3 */
54
- --color-success-100: 219 240 217; /* ⬅ #dbf0d9 */
55
- --color-success-200: 210 237 208; /* ⬅ #d2edd0 */
56
- --color-success-300: 183 225 180; /* ⬅ #b7e1b4 */
57
- --color-success-400: 129 203 123; /* ⬅ #81cb7b */
58
- --color-success-500: 75 181 67; /* ⬅ #4BB543 */
59
- --color-success-600: 68 163 60; /* ⬅ #44a33c */
60
- --color-success-700: 56 136 50; /* ⬅ #388832 */
61
- --color-success-800: 45 109 40; /* ⬅ #2d6d28 */
62
- --color-success-900: 37 89 33; /* ⬅ #255921 */
63
- /* warning | #ef4444 */
64
- --color-warning-50: 253 227 227; /* ⬅ #fde3e3 */
65
- --color-warning-100: 252 218 218; /* ⬅ #fcdada */
66
- --color-warning-200: 251 208 208; /* ⬅ #fbd0d0 */
67
- --color-warning-300: 249 180 180; /* ⬅ #f9b4b4 */
68
- --color-warning-400: 244 124 124; /* ⬅ #f47c7c */
69
- --color-warning-500: 239 68 68; /* ⬅ #ef4444 */
70
- --color-warning-600: 215 61 61; /* ⬅ #d73d3d */
71
- --color-warning-700: 179 51 51; /* ⬅ #b33333 */
72
- --color-warning-800: 143 41 41; /* ⬅ #8f2929 */
73
- --color-warning-900: 117 33 33; /* ⬅ #752121 */
74
- /* error | #FF0000 */
75
- --color-error-50: 255 217 217; /* ⬅ #ffd9d9 */
76
- --color-error-100: 255 204 204; /* ⬅ #ffcccc */
77
- --color-error-200: 255 191 191; /* ⬅ #ffbfbf */
78
- --color-error-300: 255 153 153; /* ⬅ #ff9999 */
79
- --color-error-400: 255 77 77; /* ⬅ #ff4d4d */
80
- --color-error-500: 255 0 0; /* ⬅ #FF0000 */
81
- --color-error-600: 230 0 0; /* ⬅ #e60000 */
82
- --color-error-700: 191 0 0; /* ⬅ #bf0000 */
83
- --color-error-800: 153 0 0; /* ⬅ #990000 */
84
- --color-error-900: 125 0 0; /* ⬅ #7d0000 */
85
- /* surface | #dddddd */
86
- --color-surface-50: 250 250 250; /* ⬅ #fafafa */
87
- --color-surface-100: 248 248 248; /* ⬅ #f8f8f8 */
88
- --color-surface-200: 247 247 247; /* ⬅ #f7f7f7 */
89
- --color-surface-300: 241 241 241; /* ⬅ #f1f1f1 */
90
- --color-surface-400: 231 231 231; /* ⬅ #e7e7e7 */
91
- --color-surface-500: 221 221 221; /* ⬅ #dddddd */
92
- --color-surface-600: 199 199 199; /* ⬅ #c7c7c7 */
93
- --color-surface-700: 166 166 166; /* ⬅ #a6a6a6 */
94
- --color-surface-800: 133 133 133; /* ⬅ #858585 */
95
- --color-surface-900: 108 108 108; /* ⬅ #6c6c6c */
96
- /* dark mode surface | #1f2937 */
97
- --color-surface-800: 19 25 33; /* ⬅ #131921 */
98
- --color-surface-900: 15 20 27; /* ⬅ #0f141b */
99
-
100
- }
1
+ :root {
2
+ /* =~= Theme Properties =~= */
3
+ --theme-font-family-base: system-ui;
4
+ --theme-font-family-heading: system-ui;
5
+ --theme-font-color-base: var(--color-surface-900);
6
+ --theme-font-color-dark: 255 255 255;
7
+ --theme-rounded-base: 4px;
8
+ --theme-rounded-container: 4px;
9
+ --theme-border-base: 1px;
10
+ /* =~= Theme On-X Colors =~= */
11
+ --on-primary: 0 0 0;
12
+ --on-secondary: 0 0 0;
13
+ --on-tertiary: 0 0 0;
14
+ --on-success: 0 0 0;
15
+ --on-warning: 255 255 255;
16
+ --on-error: 255 255 255;
17
+ --on-surface: 0 0 0;
18
+ /* =~= Theme Colors =~= */
19
+ /* primary | #45b2a1 */
20
+ --color-primary-50: 227 243 241; /* ⬅ #e3f3f1 */
21
+ --color-primary-100: 218 240 236; /* ⬅ #daf0ec */
22
+ --color-primary-200: 209 236 232; /* ⬅ #d1ece8 */
23
+ --color-primary-300: 181 224 217; /* ⬅ #b5e0d9 */
24
+ --color-primary-400: 125 201 189; /* ⬅ #7dc9bd */
25
+ --color-primary-500: 69 178 161; /* ⬅ #45b2a1 */
26
+ --color-primary-600: 62 160 145; /* ⬅ #3ea091 */
27
+ --color-primary-700: 52 134 121; /* ⬅ #348679 */
28
+ --color-primary-800: 41 107 97; /* ⬅ #296b61 */
29
+ --color-primary-900: 34 87 79; /* ⬅ #22574f */
30
+ /* secondary | #ff9700 */
31
+ --color-secondary-50: 255 239 217; /* ⬅ #ffefd9 */
32
+ --color-secondary-100: 255 234 204; /* ⬅ #ffeacc */
33
+ --color-secondary-200: 255 229 191; /* ⬅ #ffe5bf */
34
+ --color-secondary-300: 255 213 153; /* ⬅ #ffd599 */
35
+ --color-secondary-400: 255 182 77; /* ⬅ #ffb64d */
36
+ --color-secondary-500: 255 151 0; /* ⬅ #ff9700 */
37
+ --color-secondary-600: 230 136 0; /* ⬅ #e68800 */
38
+ --color-secondary-700: 191 113 0; /* ⬅ #bf7100 */
39
+ --color-secondary-800: 153 91 0; /* ⬅ #995b00 */
40
+ --color-secondary-900: 125 74 0; /* ⬅ #7d4a00 */
41
+ /* tertiary | #bee1da */
42
+ --color-tertiary-50: 245 251 249; /* ⬅ #f5fbf9 */
43
+ --color-tertiary-100: 242 249 248; /* ⬅ #f2f9f8 */
44
+ --color-tertiary-200: 239 248 246; /* ⬅ #eff8f6 */
45
+ --color-tertiary-300: 229 243 240; /* ⬅ #e5f3f0 */
46
+ --color-tertiary-400: 210 234 229; /* ⬅ #d2eae5 */
47
+ --color-tertiary-500: 190 225 218; /* ⬅ #bee1da */
48
+ --color-tertiary-600: 171 203 196; /* ⬅ #abcbc4 */
49
+ --color-tertiary-700: 143 169 164; /* ⬅ #8fa9a4 */
50
+ --color-tertiary-800: 114 135 131; /* ⬅ #728783 */
51
+ --color-tertiary-900: 93 110 107; /* ⬅ #5d6e6b */
52
+ /* success | #4BB543 */
53
+ --color-success-50: 228 244 227; /* ⬅ #e4f4e3 */
54
+ --color-success-100: 219 240 217; /* ⬅ #dbf0d9 */
55
+ --color-success-200: 210 237 208; /* ⬅ #d2edd0 */
56
+ --color-success-300: 183 225 180; /* ⬅ #b7e1b4 */
57
+ --color-success-400: 129 203 123; /* ⬅ #81cb7b */
58
+ --color-success-500: 75 181 67; /* ⬅ #4BB543 */
59
+ --color-success-600: 68 163 60; /* ⬅ #44a33c */
60
+ --color-success-700: 56 136 50; /* ⬅ #388832 */
61
+ --color-success-800: 45 109 40; /* ⬅ #2d6d28 */
62
+ --color-success-900: 37 89 33; /* ⬅ #255921 */
63
+ /* warning | #ef4444 */
64
+ --color-warning-50: 253 227 227; /* ⬅ #fde3e3 */
65
+ --color-warning-100: 252 218 218; /* ⬅ #fcdada */
66
+ --color-warning-200: 251 208 208; /* ⬅ #fbd0d0 */
67
+ --color-warning-300: 249 180 180; /* ⬅ #f9b4b4 */
68
+ --color-warning-400: 244 124 124; /* ⬅ #f47c7c */
69
+ --color-warning-500: 239 68 68; /* ⬅ #ef4444 */
70
+ --color-warning-600: 215 61 61; /* ⬅ #d73d3d */
71
+ --color-warning-700: 179 51 51; /* ⬅ #b33333 */
72
+ --color-warning-800: 143 41 41; /* ⬅ #8f2929 */
73
+ --color-warning-900: 117 33 33; /* ⬅ #752121 */
74
+ /* error | #FF0000 */
75
+ --color-error-50: 255 217 217; /* ⬅ #ffd9d9 */
76
+ --color-error-100: 255 204 204; /* ⬅ #ffcccc */
77
+ --color-error-200: 255 191 191; /* ⬅ #ffbfbf */
78
+ --color-error-300: 255 153 153; /* ⬅ #ff9999 */
79
+ --color-error-400: 255 77 77; /* ⬅ #ff4d4d */
80
+ --color-error-500: 255 0 0; /* ⬅ #FF0000 */
81
+ --color-error-600: 230 0 0; /* ⬅ #e60000 */
82
+ --color-error-700: 191 0 0; /* ⬅ #bf0000 */
83
+ --color-error-800: 153 0 0; /* ⬅ #990000 */
84
+ --color-error-900: 125 0 0; /* ⬅ #7d0000 */
85
+ /* surface | #dddddd */
86
+ --color-surface-50: 250 250 250; /* ⬅ #fafafa */
87
+ --color-surface-100: 248 248 248; /* ⬅ #f8f8f8 */
88
+ --color-surface-200: 247 247 247; /* ⬅ #f7f7f7 */
89
+ --color-surface-300: 241 241 241; /* ⬅ #f1f1f1 */
90
+ --color-surface-400: 231 231 231; /* ⬅ #e7e7e7 */
91
+ --color-surface-500: 221 221 221; /* ⬅ #dddddd */
92
+ --color-surface-600: 199 199 199; /* ⬅ #c7c7c7 */
93
+ --color-surface-700: 166 166 166; /* ⬅ #a6a6a6 */
94
+ --color-surface-800: 133 133 133; /* ⬅ #858585 */
95
+ --color-surface-900: 108 108 108; /* ⬅ #6c6c6c */
96
+ }
@@ -3,8 +3,9 @@
3
3
 
4
4
  :root {
5
5
  /* =~= Theme Styles =~= */
6
- --theme-font-family-base: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
7
- 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
6
+ --theme-font-family-base: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
7
+ 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji',
8
+ 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
8
9
  --theme-font-family-heading: system-ui;
9
10
  --theme-font-color-base: var(--color-surface-900);
10
11
  --theme-font-color-dark: var(--color-surface-50);
@@ -5,8 +5,9 @@
5
5
 
6
6
  :root {
7
7
  /* =~= Hamlindigo Theme | Custom =~= */
8
- --theme-font-family-base: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
9
- 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
8
+ --theme-font-family-base: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
9
+ 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji',
10
+ 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
10
11
  --theme-font-family-heading: 'Playfair Display', serif;
11
12
  --theme-font-color-base: 0 0 0;
12
13
  --theme-font-color-dark: 255 255 255;
@@ -3,8 +3,9 @@
3
3
 
4
4
  :root {
5
5
  /* =~= Theme Styles =~= */
6
- --theme-font-family-base: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
7
- 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
6
+ --theme-font-family-base: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
7
+ 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji',
8
+ 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
8
9
  --theme-font-family-heading: 'Playfair Display', serif;
9
10
  --theme-font-color-base: var(--color-surface-900);
10
11
  --theme-font-color-dark: var(--color-secondary-100);
package/src/lib/index.ts CHANGED
@@ -1,37 +1,45 @@
1
-
2
1
  // Reexport your entry components here
3
- import ListView from './components/ListView.svelte'
4
- import TableView from './TableView.svelte'
5
-
6
- import FileIcon from './components/file/FileIcon.svelte'
7
- import FileInfo from './components/file/FileInfo.svelte'
8
- import FileUploader from './components/file/FileUploader.svelte'
2
+ import ListView from './components/ListView.svelte';
3
+ import TableView from './TableView.svelte';
9
4
 
10
- import Spinner from './components/spinner/Spinner.svelte'
5
+ import FileIcon from './components/file/FileIcon.svelte';
6
+ import FileInfo from './components/file/FileInfo.svelte';
7
+ import FileUploader from './components/file/FileUploader.svelte';
11
8
 
9
+ import Spinner from './components/spinner/Spinner.svelte';
12
10
 
13
- import Checkbox from './components/form/Checkbox.svelte'
14
- import CheckboxKVPList from './components/form/CheckboxKvPList.svelte'
15
- import CheckboxList from './components/form/CheckboxList.svelte'
16
- import DateInput from './components/form/DateInput.svelte'
17
- import DropdownKVP from './components/form/DropdownKvP.svelte'
18
- import MultiSelect from './components/form/MultiSelect.svelte'
19
- import NumberInput from './components/form/NumberInput.svelte'
20
- import TextInput from './components/form/TextInput.svelte'
21
- import TextArea from './components/form/TextArea.svelte'
11
+ import Checkbox from './components/form/Checkbox.svelte';
12
+ import CheckboxKVPList from './components/form/CheckboxKvPList.svelte';
13
+ import CheckboxList from './components/form/CheckboxList.svelte';
14
+ import DateInput from './components/form/DateInput.svelte';
15
+ import DropdownKVP from './components/form/DropdownKvP.svelte';
16
+ import MultiSelect from './components/form/MultiSelect.svelte';
17
+ import NumberInput from './components/form/NumberInput.svelte';
18
+ import TextInput from './components/form/TextInput.svelte';
19
+ import TextArea from './components/form/TextArea.svelte';
22
20
 
23
21
  //Form
24
- export {Checkbox, CheckboxKVPList, CheckboxList, DateInput, DropdownKVP, MultiSelect, NumberInput,TextArea, TextInput }
22
+ export {
23
+ Checkbox,
24
+ CheckboxKVPList,
25
+ CheckboxList,
26
+ DateInput,
27
+ DropdownKVP,
28
+ MultiSelect,
29
+ NumberInput,
30
+ TextArea,
31
+ TextInput
32
+ };
25
33
 
26
34
  //File
27
- export {FileInfo, FileIcon, FileUploader }
35
+ export { FileInfo, FileIcon, FileUploader };
28
36
 
29
37
  //others
30
- export { ListView,TableView, Spinner }
38
+ export { ListView, TableView, Spinner };
31
39
 
32
40
  //Api
33
- export {Api} from './services/Api.js'
34
- export {host,username,password,setApiConfig} from './stores/apistore.js'
41
+ export { Api } from './services/Api.js';
42
+ export { host, username, password, setApiConfig } from './stores/apistore.js';
35
43
 
36
44
  //Type
37
- export type {user, FileUploaderModel} from './models/Models.js'
45
+ export type { user, FileUploaderModel } from './models/Models.js';
@@ -1,39 +1,70 @@
1
-
2
- export interface FileInfo {
3
- name:string,
4
- type:string,
5
- length: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
- }
1
+ import type { SvelteComponent } from 'svelte';
2
+ import type { ColumnFilterFn } from 'svelte-headless-table/lib/plugins';
3
+ import type { Writable } from 'svelte/store';
4
+
5
+ export interface Input {
6
+ id: string;
7
+ label: string;
8
+ feedback: string[];
9
+ invalid: boolean;
10
+ valid: boolean;
11
+ required: boolean;
12
+ }
13
+
14
+ export interface FileInfo {
15
+ name: string;
16
+ type: string;
17
+ length: number;
18
+ description: string;
19
+ validationHash: string;
20
+ }
21
+
22
+ export interface FileUploaderModel {
23
+ accept: string[];
24
+ existingFiles: FileInfo[];
25
+ descriptionType: number;
26
+ multiple: boolean;
27
+ maxSize: number;
28
+ lastModification: Date;
29
+ }
30
+
31
+ export interface Files {
32
+ accepted: Blob[];
33
+ rejected: Blob[];
34
+ }
35
+
36
+ export type user = {
37
+ name: string;
38
+ };
39
+
40
+ export interface FileObj {
41
+ path: string;
42
+ lastModified: number;
43
+ lastModifiedDate: Date;
44
+ name: string;
45
+ size: number;
46
+ type: string;
47
+ webkitRelativePath: string;
48
+ }
49
+
50
+ // Table column type
51
+ export interface Column {
52
+ header?: string;
53
+ exclude?: boolean;
54
+ colFilterFn?: ColumnFilterFn;
55
+ colFilterComponent?: typeof SvelteComponent;
56
+ }
57
+
58
+ export interface Columns {
59
+ [key: string]: Column;
60
+ }
61
+
62
+ // Table config type
63
+ export interface TableConfig<T> {
64
+ id: string;
65
+ data: Writable<T[]>;
66
+ columns?: Columns;
67
+ pageSizes?: number[];
68
+ defaultPageSize?: number;
69
+ optionsComponent?: typeof SvelteComponent;
70
+ }
@@ -1,58 +1,55 @@
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
- };
1
+ // Api.js
2
+ import axios from 'axios';
3
+ import { host, username, password } from '../stores/apistore';
4
+
5
+ console.log('setup axios');
6
+
7
+ // implement a method to execute all the request from here.
8
+ const apiRequest = (method, url, request) => {
9
+ // Create a instance of axios to use the same base url.
10
+ const axiosAPI = axios.create({
11
+ baseURL: host
12
+ });
13
+
14
+ const headers = {
15
+ authorization: 'Basic ' + btoa(username + ':' + password)
16
+ };
17
+
18
+ //using the axios instance to perform the request that received from each http method
19
+ return axiosAPI({
20
+ method,
21
+ url,
22
+ data: request,
23
+ headers
24
+ })
25
+ .then((res) => {
26
+ return Promise.resolve(res);
27
+ })
28
+ .catch((err) => {
29
+ return Promise.reject(err);
30
+ });
31
+ };
32
+
33
+ // function to execute the http get request
34
+ const get = (url, request = '') => apiRequest('get', url, request);
35
+
36
+ // function to execute the http delete request
37
+ const deleteRequest = (url, request) => apiRequest('delete', url, request);
38
+
39
+ // function to execute the http post request
40
+ const post = (url, request) => apiRequest('post', url, request);
41
+
42
+ // function to execute the http put request
43
+ const put = (url, request) => apiRequest('put', url, request);
44
+
45
+ // function to execute the http path request
46
+ const patch = (url, request) => apiRequest('patch', url, request);
47
+
48
+ // expose your method to other services or actions
49
+ export const Api = {
50
+ get,
51
+ delete: deleteRequest,
52
+ post,
53
+ put,
54
+ patch
55
+ };
@@ -1,32 +1,28 @@
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
- }
1
+ import { writable } from 'svelte/store';
2
+
3
+ export let host = 'window.location.origin';
4
+ export let username = '';
5
+ export let password = '';
6
+
7
+ const hostStore = writable(''); //writable(window.location.origin);
8
+ const usernameStore = writable('');
9
+ const passwordStore = writable('');
10
+
11
+ hostStore.subscribe((value) => {
12
+ host = value;
13
+ });
14
+
15
+ usernameStore.subscribe((value) => {
16
+ username = value;
17
+ });
18
+
19
+ passwordStore.subscribe((value) => {
20
+ password = value;
21
+ });
22
+
23
+ export function setApiConfig(_host: string, _user: string, _pw: string) {
24
+ console.log('overwrite settings');
25
+ hostStore.update((h) => (h = _host));
26
+ usernameStore.update((u) => (u = _user));
27
+ passwordStore.update((p) => (p = _pw));
28
+ }