@bexis2/bexis2-core-ui 0.2.21 → 0.2.23
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 +17 -6
- package/dist/TableView.svelte +1 -1
- package/dist/components/CodeEditor/CodeEditor.svelte +87 -0
- package/dist/components/CodeEditor/CodeEditor.svelte.d.ts +28 -0
- package/dist/components/ListView.svelte +5 -5
- package/dist/components/Table/Table.svelte +14 -10
- package/dist/components/Table/TablePagination.svelte +38 -38
- package/dist/components/file/FileIcon.svelte +45 -45
- package/dist/components/file/FileInfo.svelte +13 -13
- package/dist/components/file/FileUploader.svelte +1 -1
- package/dist/components/form/Checkbox.svelte +13 -13
- package/dist/components/form/CheckboxKvPList.svelte +16 -16
- package/dist/components/form/CheckboxList.svelte +10 -10
- package/dist/components/form/DateInput.svelte +13 -13
- package/dist/components/form/DropdownKvP.svelte +54 -54
- package/dist/components/form/InputContainer.svelte +20 -20
- package/dist/components/form/MultiSelect.svelte +178 -178
- package/dist/components/form/NumberInput.svelte +14 -14
- package/dist/components/form/TextArea.svelte +13 -13
- package/dist/components/form/TextInput.svelte +14 -14
- package/dist/components/page/Alert.svelte +28 -28
- package/dist/components/page/BackToTop.svelte +30 -30
- package/dist/components/page/Docs.svelte +22 -22
- package/dist/components/page/ErrorMessage.svelte +8 -8
- package/dist/components/page/Footer.svelte +5 -5
- package/dist/components/page/Header.svelte +5 -5
- package/dist/components/page/HelpPopUp.svelte +30 -30
- package/dist/components/page/PageCaller.js +19 -19
- package/dist/components/page/Spinner.svelte +14 -14
- package/dist/components/page/breadcrumb/Breadcrumb.svelte +24 -19
- package/dist/components/page/menu/MenuDataCaller.js +10 -10
- package/dist/css/core.ui.postcss +17 -17
- package/dist/css/themes/theme-bexis2.css +96 -96
- package/dist/css/themes/theme-crimson.css +101 -101
- package/dist/css/themes/theme-gold-nouveau.css +140 -140
- package/dist/css/themes/theme-hamlindigo.css +112 -112
- package/dist/css/themes/theme-modern.css +127 -127
- package/dist/css/themes/theme-rocket.css +119 -119
- package/dist/css/themes/theme-sahara.css +128 -128
- package/dist/css/themes/theme-seafoam.css +122 -122
- package/dist/css/themes/theme-seasonal.css +115 -115
- package/dist/css/themes/theme-skeleton.css +118 -118
- package/dist/css/themes/theme-vintage.css +125 -125
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/models/Models.d.ts +2 -0
- package/dist/services/BaseCaller.js +16 -16
- package/dist/stores/pageStores.d.ts +1 -0
- package/dist/stores/pageStores.js +13 -2
- package/package.json +7 -1
- package/src/lib/TableView.svelte +1 -1
- package/src/lib/components/CodeEditor/CodeEditor.svelte +94 -0
- package/src/lib/components/{file → File}/FileIcon.svelte +45 -45
- package/src/lib/components/{file → File}/FileInfo.svelte +13 -13
- package/src/lib/components/{file → File}/FileUploader.svelte +1 -1
- package/src/lib/components/ListView.svelte +11 -11
- package/src/lib/components/Table/Table.svelte +14 -10
- package/src/lib/components/Table/TablePagination.svelte +61 -61
- package/src/lib/components/Table/filter.ts +141 -141
- package/src/lib/components/form/Checkbox.svelte +24 -24
- package/src/lib/components/form/CheckboxKvPList.svelte +29 -29
- package/src/lib/components/form/CheckboxList.svelte +21 -21
- package/src/lib/components/form/DateInput.svelte +25 -25
- package/src/lib/components/form/DropdownKvP.svelte +54 -54
- package/src/lib/components/form/InputContainer.svelte +36 -36
- package/src/lib/components/form/MultiSelect.svelte +178 -178
- package/src/lib/components/form/NumberInput.svelte +28 -28
- package/src/lib/components/form/TextArea.svelte +26 -26
- package/src/lib/components/form/TextInput.svelte +26 -26
- package/src/lib/components/page/Alert.svelte +41 -41
- package/src/lib/components/page/BackToTop.svelte +30 -30
- package/src/lib/components/page/Docs.svelte +46 -46
- package/src/lib/components/page/ErrorMessage.svelte +10 -10
- package/src/lib/components/page/Footer.svelte +18 -18
- package/src/lib/components/page/Header.svelte +18 -18
- package/src/lib/components/page/HelpPopUp.svelte +72 -72
- package/src/lib/components/page/PageCaller.js +19 -19
- package/src/lib/components/page/Spinner.svelte +20 -20
- package/src/lib/components/page/breadcrumb/Breadcrumb.svelte +39 -31
- package/src/lib/components/page/menu/MenuDataCaller.js +10 -10
- package/src/lib/css/core.ui.postcss +17 -17
- package/src/lib/css/themes/theme-bexis2.css +96 -96
- package/src/lib/css/themes/theme-crimson.css +101 -101
- package/src/lib/css/themes/theme-gold-nouveau.css +140 -140
- package/src/lib/css/themes/theme-hamlindigo.css +112 -112
- package/src/lib/css/themes/theme-modern.css +127 -127
- package/src/lib/css/themes/theme-rocket.css +119 -119
- package/src/lib/css/themes/theme-sahara.css +128 -128
- package/src/lib/css/themes/theme-seafoam.css +122 -122
- package/src/lib/css/themes/theme-seasonal.css +115 -115
- package/src/lib/css/themes/theme-skeleton.css +118 -118
- package/src/lib/css/themes/theme-vintage.css +125 -125
- package/src/lib/index.ts +7 -0
- package/src/lib/models/Models.ts +2 -0
- package/src/lib/models/Page.ts +40 -40
- package/src/lib/services/Api.ts +55 -55
- package/src/lib/services/BaseCaller.js +16 -16
- package/src/lib/stores/apiStores.ts +31 -31
- package/src/lib/stores/pageStores.ts +20 -2
package/README.md
CHANGED
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
# bexis-core-ui
|
|
2
|
+
|
|
3
|
+
## 0.2.23
|
|
4
|
+
|
|
5
|
+
- add CodeEditor component
|
|
6
|
+
|
|
7
|
+
## 0.2.22
|
|
8
|
+
|
|
9
|
+
- Page title update on breadcrumb
|
|
10
|
+
|
|
2
11
|
## v0.2.19
|
|
12
|
+
|
|
3
13
|
- fix multiselect bug from prev version
|
|
4
14
|
|
|
5
15
|
## v0.2.18
|
|
16
|
+
|
|
6
17
|
- Multiselect
|
|
7
18
|
- fix target bug with simple list and list of simple values
|
|
8
|
-
|
|
9
|
-
- CodeEditor component
|
|
10
19
|
|
|
11
20
|
## v0.2.17
|
|
21
|
+
|
|
12
22
|
- Multiselect
|
|
13
23
|
- fix target bind bug
|
|
14
24
|
|
|
15
25
|
## v0.2.16
|
|
26
|
+
|
|
16
27
|
- Table
|
|
17
28
|
- width - fit to screen
|
|
18
29
|
- Cell - drag to change the height
|
|
@@ -22,7 +33,7 @@
|
|
|
22
33
|
## v0.2.15
|
|
23
34
|
|
|
24
35
|
- Page - centered -> min width defined
|
|
25
|
-
- MultiSelect -> add clearable
|
|
36
|
+
- MultiSelect -> add clearable
|
|
26
37
|
|
|
27
38
|
## v0.2.14
|
|
28
39
|
|
|
@@ -63,13 +74,13 @@
|
|
|
63
74
|
|
|
64
75
|
## v0.2.1
|
|
65
76
|
|
|
66
|
-
> refactoring based on naming conventions (https://bexis2.github.io/bexis2-core-ui/code/naming
|
|
77
|
+
> refactoring based on naming conventions (<https://bexis2.github.io/bexis2-core-ui/code/naming/>)
|
|
67
78
|
|
|
68
79
|
- fix issue in index.ts file for export components
|
|
69
80
|
|
|
70
81
|
## v0.2.0
|
|
71
82
|
|
|
72
|
-
> refactoring based on naming conventions (https://bexis2.github.io/bexis2-core-ui/code/naming
|
|
83
|
+
> refactoring based on naming conventions (<https://bexis2.github.io/bexis2-core-ui/code/naming/>)
|
|
73
84
|
|
|
74
85
|
- add Help, helpStore
|
|
75
86
|
- update Page
|
|
@@ -216,7 +227,7 @@
|
|
|
216
227
|
- Disabling of filters
|
|
217
228
|
- Disabling of sorting
|
|
218
229
|
|
|
219
|
-
### fixes
|
|
230
|
+
### fixes
|
|
220
231
|
|
|
221
232
|
#### table
|
|
222
233
|
|
package/dist/TableView.svelte
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<h1>table</h1>
|
|
1
|
+
<h1>table</h1>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
import CodeMirror from "svelte-codemirror-editor";
|
|
3
|
+
import Fa from "svelte-fa/src/fa.svelte";
|
|
4
|
+
import { html } from "@codemirror/lang-html";
|
|
5
|
+
import { javascript } from "@codemirror/lang-javascript";
|
|
6
|
+
import { json } from "@codemirror/lang-json";
|
|
7
|
+
import { oneDark } from "@codemirror/theme-one-dark";
|
|
8
|
+
import { Modal, modalStore } from "@skeletonlabs/skeleton";
|
|
9
|
+
import { faMoon, faSave, faSun } from "@fortawesome/free-regular-svg-icons";
|
|
10
|
+
import { faArrowRotateLeft, faXmark } from "@fortawesome/free-solid-svg-icons";
|
|
11
|
+
export let title = "";
|
|
12
|
+
export let initialValue = "";
|
|
13
|
+
export let value = initialValue;
|
|
14
|
+
export let language = "html";
|
|
15
|
+
export let dark = true;
|
|
16
|
+
export let toggle = true;
|
|
17
|
+
export let styles = {
|
|
18
|
+
"&": {
|
|
19
|
+
borderRadius: "0.5rem",
|
|
20
|
+
width: "100%"
|
|
21
|
+
},
|
|
22
|
+
".cm-scroller": {
|
|
23
|
+
borderRadius: "0.5rem"
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const dispatch = createEventDispatcher();
|
|
27
|
+
const modal = {
|
|
28
|
+
type: "confirm",
|
|
29
|
+
title: "Reset",
|
|
30
|
+
body: "Unsaved changes will be lost. Are you sure you want to continue?",
|
|
31
|
+
response: (r) => r ? value = initialValue : null
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<div class="items-center justify-center">
|
|
36
|
+
<h1 class="h1 font-semibold text-primary-500 mb-3">{title}</h1>
|
|
37
|
+
<slot />
|
|
38
|
+
<div class="grid gap-1 w-full h-full mt-5">
|
|
39
|
+
<div class="rounded-lg shadow-lg w-full">
|
|
40
|
+
<CodeMirror
|
|
41
|
+
bind:value
|
|
42
|
+
lang={language === 'html'
|
|
43
|
+
? html({ selfClosingTags: true })
|
|
44
|
+
: language === 'js'
|
|
45
|
+
? javascript()
|
|
46
|
+
: json()}
|
|
47
|
+
theme={dark ? oneDark : null}
|
|
48
|
+
class="flex w-full"
|
|
49
|
+
{styles}
|
|
50
|
+
/>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div class="flex justify-between gap-2 items-center mt-3">
|
|
55
|
+
<div class="flex gap-2">
|
|
56
|
+
<button
|
|
57
|
+
class="btn variant-filled-warning"
|
|
58
|
+
on:click|preventDefault={() => modalStore.trigger(modal)}
|
|
59
|
+
><Fa icon={faArrowRotateLeft} /></button
|
|
60
|
+
>{#if toggle}
|
|
61
|
+
<button
|
|
62
|
+
class="btn border"
|
|
63
|
+
class:bg-slate-700={dark}
|
|
64
|
+
class:bg-white={!dark}
|
|
65
|
+
on:click|preventDefault={() => (dark = !dark)}
|
|
66
|
+
>
|
|
67
|
+
{#if dark}
|
|
68
|
+
<Fa icon={faMoon} color="white" />
|
|
69
|
+
{:else}
|
|
70
|
+
<Fa icon={faSun} color="black" />
|
|
71
|
+
{/if}
|
|
72
|
+
</button>
|
|
73
|
+
{/if}
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div class="flex gap-2">
|
|
77
|
+
<button class="btn variant-filled-warning" on:click={() => dispatch('cancel')}
|
|
78
|
+
><Fa icon={faXmark} /></button
|
|
79
|
+
>
|
|
80
|
+
<button class="btn variant-filled-primary" on:click={() => dispatch('save')}
|
|
81
|
+
><Fa icon={faSave} /></button
|
|
82
|
+
>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<Modal />
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { ThemeSpec } from 'svelte-codemirror-editor';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
title?: string | undefined;
|
|
6
|
+
initialValue?: string | undefined;
|
|
7
|
+
value?: string | undefined;
|
|
8
|
+
language?: string | undefined;
|
|
9
|
+
dark?: boolean | undefined;
|
|
10
|
+
toggle?: boolean | undefined;
|
|
11
|
+
styles?: ThemeSpec | undefined;
|
|
12
|
+
};
|
|
13
|
+
events: {
|
|
14
|
+
cancel: CustomEvent<any>;
|
|
15
|
+
save: CustomEvent<any>;
|
|
16
|
+
} & {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
};
|
|
19
|
+
slots: {
|
|
20
|
+
default: {};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export type CodeEditorProps = typeof __propDef.props;
|
|
24
|
+
export type CodeEditorEvents = typeof __propDef.events;
|
|
25
|
+
export type CodeEditorSlots = typeof __propDef.slots;
|
|
26
|
+
export default class CodeEditor extends SvelteComponentTyped<CodeEditorProps, CodeEditorEvents, CodeEditorSlots> {
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>let result = { name: "david" };
|
|
2
|
-
</script>
|
|
3
|
-
|
|
4
|
-
<h1>MyList</h1>
|
|
5
|
-
{result.name}
|
|
6
|
-
<b>from bexis-lib</b>
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<h1>MyList</h1>
|
|
5
|
+
{result.name}
|
|
6
|
+
<b>from bexis-lib</b>
|
|
@@ -21,9 +21,10 @@ let {
|
|
|
21
21
|
height = null,
|
|
22
22
|
optionsComponent,
|
|
23
23
|
defaultPageSize = 10,
|
|
24
|
-
|
|
24
|
+
toggle = false,
|
|
25
|
+
pageSizes = [5, 10, 15, 20],
|
|
26
|
+
fitToScreen = true
|
|
25
27
|
} = config;
|
|
26
|
-
let fitToScreen = true;
|
|
27
28
|
const dispatch = createEventDispatcher();
|
|
28
29
|
const actionDispatcher = (obj) => dispatch("action", obj);
|
|
29
30
|
const table = createTable(data, {
|
|
@@ -132,7 +133,7 @@ const { headerRows, pageRows, tableAttrs, tableBodyAttrs, pluginStates } = table
|
|
|
132
133
|
const { filterValue } = pluginStates.tableFilter;
|
|
133
134
|
</script>
|
|
134
135
|
|
|
135
|
-
<div class="grid gap-2 overflow-auto" class:w-
|
|
136
|
+
<div class="grid gap-2 overflow-auto" class:w-fit={!fitToScreen} class:w-full={fitToScreen}>
|
|
136
137
|
<div class="table-container">
|
|
137
138
|
{#if $data.length > 0}
|
|
138
139
|
<input
|
|
@@ -142,13 +143,16 @@ const { filterValue } = pluginStates.tableFilter;
|
|
|
142
143
|
placeholder="Search rows..."
|
|
143
144
|
/>
|
|
144
145
|
{/if}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
146
|
+
|
|
147
|
+
{#if toggle}
|
|
148
|
+
<SlideToggle
|
|
149
|
+
name="slider-label"
|
|
150
|
+
active="bg-primary-500"
|
|
151
|
+
size="sm"
|
|
152
|
+
checked={fitToScreen}
|
|
153
|
+
on:change={() => (fitToScreen = !fitToScreen)}>Fit to screen</SlideToggle
|
|
154
|
+
>
|
|
155
|
+
{/if}
|
|
152
156
|
|
|
153
157
|
<div class="overflow-auto" style="height: {height}px">
|
|
154
158
|
<table {...$tableAttrs} class="table table-compact bg-tertiary-200 overflow-clip">
|
|
@@ -20,41 +20,41 @@ $:
|
|
|
20
20
|
goToNextPageDisabled = !$hasNextPage;
|
|
21
21
|
$:
|
|
22
22
|
goToPreviousPageDisabled = !$hasPreviousPage;
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<div class="flex justify-center gap-1">
|
|
26
|
-
<button
|
|
27
|
-
class="btn btn-sm variant-filled-primary"
|
|
28
|
-
on:click|preventDefault={goToFirstPage}
|
|
29
|
-
disabled={goToFirstPageDisabled}
|
|
30
|
-
>
|
|
31
|
-
<Fa icon={faAnglesLeft} /></button
|
|
32
|
-
>
|
|
33
|
-
<button
|
|
34
|
-
class="btn btn-sm variant-filled-primary"
|
|
35
|
-
on:click|preventDefault={goToPreviousPage}
|
|
36
|
-
disabled={goToPreviousPageDisabled}><Fa icon={faAngleLeft} /></button
|
|
37
|
-
>
|
|
38
|
-
|
|
39
|
-
<select
|
|
40
|
-
name="pageSize"
|
|
41
|
-
id="pageSize"
|
|
42
|
-
class="select variant-filled-primary w-min font-bold"
|
|
43
|
-
bind:value={$pageSize}
|
|
44
|
-
>
|
|
45
|
-
{#each pageSizes as size}
|
|
46
|
-
<option value={size}>{size}</option>
|
|
47
|
-
{/each}
|
|
48
|
-
</select>
|
|
49
|
-
|
|
50
|
-
<button
|
|
51
|
-
class="btn btn-sm variant-filled-primary"
|
|
52
|
-
on:click|preventDefault={goToNextPage}
|
|
53
|
-
disabled={goToNextPageDisabled}><Fa icon={faAngleRight} /></button
|
|
54
|
-
>
|
|
55
|
-
<button
|
|
56
|
-
class="btn btn-sm variant-filled-primary"
|
|
57
|
-
on:click|preventDefault={goToLastPage}
|
|
58
|
-
disabled={goToLastPageDisabled}><Fa icon={faAnglesRight} /></button
|
|
59
|
-
>
|
|
60
|
-
</div>
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<div class="flex justify-center gap-1">
|
|
26
|
+
<button
|
|
27
|
+
class="btn btn-sm variant-filled-primary"
|
|
28
|
+
on:click|preventDefault={goToFirstPage}
|
|
29
|
+
disabled={goToFirstPageDisabled}
|
|
30
|
+
>
|
|
31
|
+
<Fa icon={faAnglesLeft} /></button
|
|
32
|
+
>
|
|
33
|
+
<button
|
|
34
|
+
class="btn btn-sm variant-filled-primary"
|
|
35
|
+
on:click|preventDefault={goToPreviousPage}
|
|
36
|
+
disabled={goToPreviousPageDisabled}><Fa icon={faAngleLeft} /></button
|
|
37
|
+
>
|
|
38
|
+
|
|
39
|
+
<select
|
|
40
|
+
name="pageSize"
|
|
41
|
+
id="pageSize"
|
|
42
|
+
class="select variant-filled-primary w-min font-bold"
|
|
43
|
+
bind:value={$pageSize}
|
|
44
|
+
>
|
|
45
|
+
{#each pageSizes as size}
|
|
46
|
+
<option value={size}>{size}</option>
|
|
47
|
+
{/each}
|
|
48
|
+
</select>
|
|
49
|
+
|
|
50
|
+
<button
|
|
51
|
+
class="btn btn-sm variant-filled-primary"
|
|
52
|
+
on:click|preventDefault={goToNextPage}
|
|
53
|
+
disabled={goToNextPageDisabled}><Fa icon={faAngleRight} /></button
|
|
54
|
+
>
|
|
55
|
+
<button
|
|
56
|
+
class="btn btn-sm variant-filled-primary"
|
|
57
|
+
on:click|preventDefault={goToLastPage}
|
|
58
|
+
disabled={goToLastPageDisabled}><Fa icon={faAnglesRight} /></button
|
|
59
|
+
>
|
|
60
|
+
</div>
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import Fa from 'svelte-fa';
|
|
3
|
-
import { faFileAudio } from '@fortawesome/free-regular-svg-icons';
|
|
4
|
-
import { faFileVideo } from '@fortawesome/free-regular-svg-icons';
|
|
5
|
-
import { faFileWord } from '@fortawesome/free-regular-svg-icons';
|
|
6
|
-
import { faFilePdf } from '@fortawesome/free-regular-svg-icons';
|
|
7
|
-
import { faFileExcel } from '@fortawesome/free-regular-svg-icons';
|
|
8
|
-
import { faFileAlt } from '@fortawesome/free-regular-svg-icons';
|
|
9
|
-
import { faFileImage } from '@fortawesome/free-regular-svg-icons';
|
|
10
|
-
import { faFileArchive } from '@fortawesome/free-regular-svg-icons';
|
|
11
|
-
|
|
12
|
-
export let type = '';
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
{#if type.includes('excel') || type.includes('spreadsheetml')}
|
|
16
|
-
<Fa icon={faFileExcel} />
|
|
17
|
-
{/if}
|
|
18
|
-
|
|
19
|
-
{#if type.includes('text')}
|
|
20
|
-
<Fa icon={faFileAlt} />
|
|
21
|
-
{/if}
|
|
22
|
-
|
|
23
|
-
{#if type.includes('image')}
|
|
24
|
-
<Fa icon={faFileImage} />
|
|
25
|
-
{/if}
|
|
26
|
-
|
|
27
|
-
{#if type.includes('audio')}
|
|
28
|
-
<Fa icon={faFileAudio} />
|
|
29
|
-
{/if}
|
|
30
|
-
|
|
31
|
-
{#if type.includes('video')}
|
|
32
|
-
<Fa icon={faFileVideo} />
|
|
33
|
-
{/if}
|
|
34
|
-
|
|
35
|
-
{#if type.includes('word')}
|
|
36
|
-
<Fa icon={faFileWord} />
|
|
37
|
-
{/if}
|
|
38
|
-
|
|
39
|
-
{#if type.includes('pdf')}
|
|
40
|
-
<Fa icon={faFilePdf} />
|
|
41
|
-
{/if}
|
|
42
|
-
|
|
43
|
-
{#if type.includes('zip')}
|
|
44
|
-
<Fa icon={faFileArchive} />
|
|
45
|
-
{/if}
|
|
1
|
+
<script>
|
|
2
|
+
import Fa from 'svelte-fa';
|
|
3
|
+
import { faFileAudio } from '@fortawesome/free-regular-svg-icons';
|
|
4
|
+
import { faFileVideo } from '@fortawesome/free-regular-svg-icons';
|
|
5
|
+
import { faFileWord } from '@fortawesome/free-regular-svg-icons';
|
|
6
|
+
import { faFilePdf } from '@fortawesome/free-regular-svg-icons';
|
|
7
|
+
import { faFileExcel } from '@fortawesome/free-regular-svg-icons';
|
|
8
|
+
import { faFileAlt } from '@fortawesome/free-regular-svg-icons';
|
|
9
|
+
import { faFileImage } from '@fortawesome/free-regular-svg-icons';
|
|
10
|
+
import { faFileArchive } from '@fortawesome/free-regular-svg-icons';
|
|
11
|
+
|
|
12
|
+
export let type = '';
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{#if type.includes('excel') || type.includes('spreadsheetml')}
|
|
16
|
+
<Fa icon={faFileExcel} />
|
|
17
|
+
{/if}
|
|
18
|
+
|
|
19
|
+
{#if type.includes('text')}
|
|
20
|
+
<Fa icon={faFileAlt} />
|
|
21
|
+
{/if}
|
|
22
|
+
|
|
23
|
+
{#if type.includes('image')}
|
|
24
|
+
<Fa icon={faFileImage} />
|
|
25
|
+
{/if}
|
|
26
|
+
|
|
27
|
+
{#if type.includes('audio')}
|
|
28
|
+
<Fa icon={faFileAudio} />
|
|
29
|
+
{/if}
|
|
30
|
+
|
|
31
|
+
{#if type.includes('video')}
|
|
32
|
+
<Fa icon={faFileVideo} />
|
|
33
|
+
{/if}
|
|
34
|
+
|
|
35
|
+
{#if type.includes('word')}
|
|
36
|
+
<Fa icon={faFileWord} />
|
|
37
|
+
{/if}
|
|
38
|
+
|
|
39
|
+
{#if type.includes('pdf')}
|
|
40
|
+
<Fa icon={faFilePdf} />
|
|
41
|
+
{/if}
|
|
42
|
+
|
|
43
|
+
{#if type.includes('zip')}
|
|
44
|
+
<Fa icon={faFileArchive} />
|
|
45
|
+
{/if}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import FileIcon from './FileIcon.svelte';
|
|
3
|
-
|
|
4
|
-
export let name = '';
|
|
5
|
-
export let type = '';
|
|
6
|
-
// export let description;
|
|
7
|
-
export let size = '';
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<div style="font-size:{size}">
|
|
11
|
-
<FileIcon {type} />
|
|
12
|
-
{name}
|
|
13
|
-
</div>
|
|
1
|
+
<script>
|
|
2
|
+
import FileIcon from './FileIcon.svelte';
|
|
3
|
+
|
|
4
|
+
export let name = '';
|
|
5
|
+
export let type = '';
|
|
6
|
+
// export let description;
|
|
7
|
+
export let size = '';
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<div style="font-size:{size}">
|
|
11
|
+
<FileIcon {type} />
|
|
12
|
+
{name}
|
|
13
|
+
</div>
|
|
@@ -103,7 +103,7 @@ async function handleSubmit() {
|
|
|
103
103
|
<b style="font-size:xx-large"><Fa icon={faFileUpload} /></b>
|
|
104
104
|
<span
|
|
105
105
|
><b>Drag 'n' drop some files here, or click to select files</b>
|
|
106
|
-
<b>max file : {model.maxSize} mb</b></span
|
|
106
|
+
<b>(max file size: {model.maxSize} mb)</b></span
|
|
107
107
|
>
|
|
108
108
|
<p>
|
|
109
109
|
{#if model.accept}
|
|
@@ -6,16 +6,16 @@ export let valid;
|
|
|
6
6
|
export let invalid;
|
|
7
7
|
export let required;
|
|
8
8
|
export let feedback;
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<InputContainer {label} {feedback} {required}>
|
|
12
|
-
<input
|
|
13
|
-
{id}
|
|
14
|
-
class="input variant-form-material"
|
|
15
|
-
type="checkbox"
|
|
16
|
-
class:input-success={valid}
|
|
17
|
-
class:input-error={invalid}
|
|
18
|
-
bind:checked
|
|
19
|
-
on:input
|
|
20
|
-
/>
|
|
21
|
-
</InputContainer>
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<InputContainer {label} {feedback} {required}>
|
|
12
|
+
<input
|
|
13
|
+
{id}
|
|
14
|
+
class="input variant-form-material"
|
|
15
|
+
type="checkbox"
|
|
16
|
+
class:input-success={valid}
|
|
17
|
+
class:input-error={invalid}
|
|
18
|
+
bind:checked
|
|
19
|
+
on:input
|
|
20
|
+
/>
|
|
21
|
+
</InputContainer>
|
|
@@ -8,19 +8,19 @@ export let key;
|
|
|
8
8
|
export let help = false;
|
|
9
9
|
let required = false;
|
|
10
10
|
let feedback;
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<InputContainer {id} label={title} {feedback} {required} {help}>
|
|
14
|
-
{#each source as item}
|
|
15
|
-
<label class="flex items-center space-x-2" for={key}>
|
|
16
|
-
<input
|
|
17
|
-
class="checkbox"
|
|
18
|
-
type="checkbox"
|
|
19
|
-
bind:group={target}
|
|
20
|
-
checked={item.key}
|
|
21
|
-
value={item.key}
|
|
22
|
-
/>
|
|
23
|
-
<p>{item.value}</p>
|
|
24
|
-
</label>
|
|
25
|
-
{/each}
|
|
26
|
-
</InputContainer>
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<InputContainer {id} label={title} {feedback} {required} {help}>
|
|
14
|
+
{#each source as item}
|
|
15
|
+
<label class="flex items-center space-x-2" for={key}>
|
|
16
|
+
<input
|
|
17
|
+
class="checkbox"
|
|
18
|
+
type="checkbox"
|
|
19
|
+
bind:group={target}
|
|
20
|
+
checked={item.key}
|
|
21
|
+
value={item.key}
|
|
22
|
+
/>
|
|
23
|
+
<p>{item.value}</p>
|
|
24
|
+
</label>
|
|
25
|
+
{/each}
|
|
26
|
+
</InputContainer>
|
|
@@ -6,13 +6,13 @@ export let description = "";
|
|
|
6
6
|
export let key;
|
|
7
7
|
let required = false;
|
|
8
8
|
let feedback;
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<InputContainer label={title} {feedback} {required}>
|
|
12
|
-
{#each source as item}
|
|
13
|
-
<label class="flex items-center space-x-2" for={key}>
|
|
14
|
-
<input class="checkbox" type="checkbox" bind:group={target} value={item} />
|
|
15
|
-
<p>{item}</p>
|
|
16
|
-
</label>
|
|
17
|
-
{/each}
|
|
18
|
-
</InputContainer>
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<InputContainer label={title} {feedback} {required}>
|
|
12
|
+
{#each source as item}
|
|
13
|
+
<label class="flex items-center space-x-2" for={key}>
|
|
14
|
+
<input class="checkbox" type="checkbox" bind:group={target} value={item} />
|
|
15
|
+
<p>{item}</p>
|
|
16
|
+
</label>
|
|
17
|
+
{/each}
|
|
18
|
+
</InputContainer>
|
|
@@ -7,16 +7,16 @@ export let invalid = false;
|
|
|
7
7
|
export let required = false;
|
|
8
8
|
export let feedback = [""];
|
|
9
9
|
export let help = false;
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<InputContainer {id} {label} {feedback} {required} {help}>
|
|
13
|
-
<input
|
|
14
|
-
{id}
|
|
15
|
-
class="input variant-form-material"
|
|
16
|
-
type="date"
|
|
17
|
-
class:input-success={valid}
|
|
18
|
-
class:input-error={invalid}
|
|
19
|
-
bind:value
|
|
20
|
-
on:input
|
|
21
|
-
/>
|
|
22
|
-
</InputContainer>
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<InputContainer {id} {label} {feedback} {required} {help}>
|
|
13
|
+
<input
|
|
14
|
+
{id}
|
|
15
|
+
class="input variant-form-material"
|
|
16
|
+
type="date"
|
|
17
|
+
class:input-success={valid}
|
|
18
|
+
class:input-error={invalid}
|
|
19
|
+
bind:value
|
|
20
|
+
on:input
|
|
21
|
+
/>
|
|
22
|
+
</InputContainer>
|