@bexis2/bexis2-core-ui 0.0.26 → 0.0.28

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.
@@ -1,176 +1,176 @@
1
- <script lang="ts">
2
- import Fa from 'svelte-fa/src/fa.svelte';
3
- import { faFilter } from '@fortawesome/free-solid-svg-icons';
4
- import { popup } from '@skeletonlabs/skeleton';
5
- import type { PopupSettings } from '@skeletonlabs/skeleton';
6
-
7
- export let filterValue;
8
- export let values;
9
- export let id;
10
- export let tableId;
11
-
12
- let firstOption;
13
- let firstValue;
14
- let secondOption;
15
- let secondValue;
16
- let active = false;
17
-
18
- const options = {
19
- number: [
20
- {
21
- value: 'isequal',
22
- label: 'Is equal to'
23
- },
24
- {
25
- value: 'isgreaterorequal',
26
- label: 'Is greater than or equal to'
27
- },
28
- {
29
- value: 'isgreater',
30
- label: 'Is greater than'
31
- },
32
- {
33
- value: 'islessorequal',
34
- label: 'Is less than or equal to'
35
- },
36
- {
37
- value: 'isless',
38
- label: 'Is less than'
39
- },
40
- {
41
- value: 'isnotequal',
42
- label: 'Is not equal to'
43
- }
44
- ],
45
- string: [
46
- {
47
- value: 'isequal',
48
- label: 'Is equal to'
49
- },
50
- {
51
- value: 'isnotequal',
52
- label: 'Is not equal to'
53
- },
54
- {
55
- value: 'starts',
56
- label: 'Starts with'
57
- },
58
- {
59
- value: 'contains',
60
- label: 'Contains'
61
- },
62
- {
63
- value: 'notcontains',
64
- label: 'Does not contain'
65
- },
66
- {
67
- value: 'ends',
68
- label: 'Ends with'
69
- }
70
- ]
71
- };
72
-
73
- const popupId = `${tableId}-${id}`;
74
-
75
- const popupFeatured: PopupSettings = {
76
- event: 'click',
77
- target: popupId,
78
- placement: 'bottom-start'
79
- };
80
-
81
- const type = typeof $values[0];
82
- </script>
83
-
84
- <form class="">
85
- <button
86
- class:variant-filled-primary={active}
87
- class="btn w-max p-2"
88
- type="button"
89
- use:popup={popupFeatured}
90
- >
91
- <Fa icon={faFilter} size="12" />
92
- </button>
93
-
94
- <div data-popup={`${popupId}`}>
95
- <div class="card p-3 absolute grid gap-2 shadow-lg z-10 w-min">
96
- <button
97
- class="btn variant-filled-primary btn-sm"
98
- type="submit"
99
- on:click={() => {
100
- firstOption = 'isequal';
101
- firstValue = undefined;
102
- secondOption = 'isequal';
103
- secondValue = undefined;
104
-
105
- $filterValue = [firstOption, firstValue, secondOption, secondValue];
106
- active = false;
107
- }}>Clear Filter</button
108
- >
109
-
110
- <label for="" class="label normal-case text-sm">Show rows with value that</label>
111
- <div class="grid gap-2 w-full">
112
- <select
113
- class="select border border-primary-500 text-sm p-1"
114
- aria-label="Show rows with value that"
115
- bind:value={firstOption}
116
- on:click|stopPropagation
117
- >
118
- {#each options[type] as option (option)}
119
- <option value={option.value}>{option.label}</option>
120
- {/each}
121
- </select>
122
- {#if type === 'number'}
123
- <input
124
- type="number"
125
- class="input p-1 border border-primary-500"
126
- bind:value={firstValue}
127
- on:click|stopPropagation
128
- />
129
- {:else}
130
- <input
131
- type="text"
132
- class="input p-1 border border-primary-500"
133
- bind:value={firstValue}
134
- on:click|stopPropagation
135
- />
136
- {/if}
137
- </div>
138
- <label for="" class="label normal-case">And</label>
139
- <div class="grid gap-2 w-max">
140
- <select
141
- class="select border border-primary-500 text-sm p-1"
142
- aria-label="Show rows with value that"
143
- bind:value={secondOption}
144
- on:click|stopPropagation
145
- >
146
- {#each options[type] as option (option)}
147
- <option value={option.value}>{option.label}</option>
148
- {/each}
149
- </select>
150
- {#if type === 'number'}
151
- <input
152
- type="number"
153
- class="input p-1 border border-primary-500"
154
- bind:value={secondValue}
155
- on:click|stopPropagation
156
- />
157
- {:else}
158
- <input
159
- type="text"
160
- class="input p-1 border border-primary-500"
161
- bind:value={secondValue}
162
- on:click|stopPropagation
163
- />
164
- {/if}
165
- </div>
166
- <button
167
- class="btn variant-filled-primary btn-sm"
168
- type="submit"
169
- on:click={() => {
170
- active = firstValue?.toString().length > 0 || secondValue?.toString().length > 0;
171
- $filterValue = [firstOption, firstValue, secondOption, secondValue];
172
- }}>Submit</button
173
- >
174
- </div>
175
- </div>
176
- </form>
1
+ <script lang="ts">
2
+ import Fa from 'svelte-fa/src/fa.svelte';
3
+ import { faFilter } from '@fortawesome/free-solid-svg-icons';
4
+ import { popup } from '@skeletonlabs/skeleton';
5
+ import type { PopupSettings } from '@skeletonlabs/skeleton';
6
+
7
+ export let filterValue;
8
+ export let values;
9
+ export let id;
10
+ export let tableId;
11
+
12
+ let firstOption;
13
+ let firstValue;
14
+ let secondOption;
15
+ let secondValue;
16
+ let active = false;
17
+
18
+ const options = {
19
+ number: [
20
+ {
21
+ value: 'isequal',
22
+ label: 'Is equal to'
23
+ },
24
+ {
25
+ value: 'isgreaterorequal',
26
+ label: 'Is greater than or equal to'
27
+ },
28
+ {
29
+ value: 'isgreater',
30
+ label: 'Is greater than'
31
+ },
32
+ {
33
+ value: 'islessorequal',
34
+ label: 'Is less than or equal to'
35
+ },
36
+ {
37
+ value: 'isless',
38
+ label: 'Is less than'
39
+ },
40
+ {
41
+ value: 'isnotequal',
42
+ label: 'Is not equal to'
43
+ }
44
+ ],
45
+ string: [
46
+ {
47
+ value: 'isequal',
48
+ label: 'Is equal to'
49
+ },
50
+ {
51
+ value: 'isnotequal',
52
+ label: 'Is not equal to'
53
+ },
54
+ {
55
+ value: 'starts',
56
+ label: 'Starts with'
57
+ },
58
+ {
59
+ value: 'contains',
60
+ label: 'Contains'
61
+ },
62
+ {
63
+ value: 'notcontains',
64
+ label: 'Does not contain'
65
+ },
66
+ {
67
+ value: 'ends',
68
+ label: 'Ends with'
69
+ }
70
+ ]
71
+ };
72
+
73
+ const popupId = `${tableId}-${id}`;
74
+
75
+ const popupFeatured: PopupSettings = {
76
+ event: 'click',
77
+ target: popupId,
78
+ placement: 'bottom-start'
79
+ };
80
+
81
+ const type = typeof $values[0];
82
+ </script>
83
+
84
+ <form class="">
85
+ <button
86
+ class:variant-filled-primary={active}
87
+ class="btn w-max p-2"
88
+ type="button"
89
+ use:popup={popupFeatured}
90
+ >
91
+ <Fa icon={faFilter} size="12" />
92
+ </button>
93
+
94
+ <div data-popup={`${popupId}`}>
95
+ <div class="card p-3 absolute grid gap-2 shadow-lg z-10 w-min">
96
+ <button
97
+ class="btn variant-filled-primary btn-sm"
98
+ type="submit"
99
+ on:click|preventDefault={() => {
100
+ firstOption = 'isequal';
101
+ firstValue = undefined;
102
+ secondOption = 'isequal';
103
+ secondValue = undefined;
104
+
105
+ $filterValue = [firstOption, firstValue, secondOption, secondValue];
106
+ active = false;
107
+ }}>Clear Filter</button
108
+ >
109
+
110
+ <label for="" class="label normal-case text-sm">Show rows with value that</label>
111
+ <div class="grid gap-2 w-full">
112
+ <select
113
+ class="select border border-primary-500 text-sm p-1"
114
+ aria-label="Show rows with value that"
115
+ bind:value={firstOption}
116
+ on:click|stopPropagation
117
+ >
118
+ {#each options[type] as option (option)}
119
+ <option value={option.value}>{option.label}</option>
120
+ {/each}
121
+ </select>
122
+ {#if type === 'number'}
123
+ <input
124
+ type="number"
125
+ class="input p-1 border border-primary-500"
126
+ bind:value={firstValue}
127
+ on:click|stopPropagation
128
+ />
129
+ {:else}
130
+ <input
131
+ type="text"
132
+ class="input p-1 border border-primary-500"
133
+ bind:value={firstValue}
134
+ on:click|stopPropagation
135
+ />
136
+ {/if}
137
+ </div>
138
+ <label for="" class="label normal-case">And</label>
139
+ <div class="grid gap-2 w-max">
140
+ <select
141
+ class="select border border-primary-500 text-sm p-1"
142
+ aria-label="Show rows with value that"
143
+ bind:value={secondOption}
144
+ on:click|stopPropagation
145
+ >
146
+ {#each options[type] as option (option)}
147
+ <option value={option.value}>{option.label}</option>
148
+ {/each}
149
+ </select>
150
+ {#if type === 'number'}
151
+ <input
152
+ type="number"
153
+ class="input p-1 border border-primary-500"
154
+ bind:value={secondValue}
155
+ on:click|stopPropagation
156
+ />
157
+ {:else}
158
+ <input
159
+ type="text"
160
+ class="input p-1 border border-primary-500"
161
+ bind:value={secondValue}
162
+ on:click|stopPropagation
163
+ />
164
+ {/if}
165
+ </div>
166
+ <button
167
+ class="btn variant-filled-primary btn-sm"
168
+ type="submit"
169
+ on:click|preventDefault={() => {
170
+ active = firstValue?.toString().length > 0 || secondValue?.toString().length > 0;
171
+ $filterValue = [firstOption, firstValue, secondOption, secondValue];
172
+ }}>Submit</button
173
+ >
174
+ </div>
175
+ </div>
176
+ </form>
@@ -1,61 +1,61 @@
1
- <script lang="ts">
2
- import Fa from 'svelte-fa/src/fa.svelte';
3
- import {
4
- faAnglesRight,
5
- faAngleRight,
6
- faAnglesLeft,
7
- faAngleLeft
8
- } from '@fortawesome/free-solid-svg-icons';
9
-
10
- export let pageConfig;
11
- export let pageSizes;
12
-
13
- const { pageIndex, pageCount, pageSize, hasNextPage, hasPreviousPage } = pageConfig;
14
-
15
- const goToFirstPage = () => ($pageIndex = 0);
16
- const goToLastPage = () => ($pageIndex = $pageCount - 1);
17
- const goToNextPage = () => ($pageIndex += 1);
18
- const goToPreviousPage = () => ($pageIndex -= 1);
19
-
20
- $: goToFirstPageDisabled = !$pageIndex;
21
- $: goToLastPageDisabled = $pageIndex == $pageCount - 1;
22
- $: goToNextPageDisabled = !$hasNextPage;
23
- $: goToPreviousPageDisabled = !$hasPreviousPage;
24
- </script>
25
-
26
- <div class="flex justify-center gap-1">
27
- <button
28
- class="btn btn-sm variant-filled-primary"
29
- on:click={goToFirstPage}
30
- disabled={goToFirstPageDisabled}
31
- >
32
- <Fa icon={faAnglesLeft} /></button
33
- >
34
- <button
35
- class="btn btn-sm variant-filled-primary"
36
- on:click={goToPreviousPage}
37
- disabled={goToPreviousPageDisabled}><Fa icon={faAngleLeft} /></button
38
- >
39
-
40
- <select
41
- name="pageSize"
42
- id="pageSize"
43
- class="select btn btn-sm variant-filled-primary w-min font-bold"
44
- bind:value={$pageSize}
45
- >
46
- {#each pageSizes as size}
47
- <option value={size}>{size}</option>
48
- {/each}
49
- </select>
50
-
51
- <button
52
- class="btn btn-sm variant-filled-primary"
53
- on:click={goToNextPage}
54
- disabled={goToNextPageDisabled}><Fa icon={faAngleRight} /></button
55
- >
56
- <button
57
- class="btn btn-sm variant-filled-primary"
58
- on:click={goToLastPage}
59
- disabled={goToLastPageDisabled}><Fa icon={faAnglesRight} /></button
60
- >
61
- </div>
1
+ <script lang="ts">
2
+ import Fa from 'svelte-fa/src/fa.svelte';
3
+ import {
4
+ faAnglesRight,
5
+ faAngleRight,
6
+ faAnglesLeft,
7
+ faAngleLeft
8
+ } from '@fortawesome/free-solid-svg-icons';
9
+
10
+ export let pageConfig;
11
+ export let pageSizes;
12
+
13
+ const { pageIndex, pageCount, pageSize, hasNextPage, hasPreviousPage } = pageConfig;
14
+
15
+ const goToFirstPage = () => ($pageIndex = 0);
16
+ const goToLastPage = () => ($pageIndex = $pageCount - 1);
17
+ const goToNextPage = () => ($pageIndex += 1);
18
+ const goToPreviousPage = () => ($pageIndex -= 1);
19
+
20
+ $: goToFirstPageDisabled = !$pageIndex;
21
+ $: goToLastPageDisabled = $pageIndex == $pageCount - 1;
22
+ $: goToNextPageDisabled = !$hasNextPage;
23
+ $: goToPreviousPageDisabled = !$hasPreviousPage;
24
+ </script>
25
+
26
+ <div class="flex justify-center gap-1">
27
+ <button
28
+ class="btn btn-sm variant-filled-primary"
29
+ on:click|preventDefault={goToFirstPage}
30
+ disabled={goToFirstPageDisabled}
31
+ >
32
+ <Fa icon={faAnglesLeft} /></button
33
+ >
34
+ <button
35
+ class="btn btn-sm variant-filled-primary"
36
+ on:click|preventDefault={goToPreviousPage}
37
+ disabled={goToPreviousPageDisabled}><Fa icon={faAngleLeft} /></button
38
+ >
39
+
40
+ <select
41
+ name="pageSize"
42
+ id="pageSize"
43
+ class="select btn btn-sm variant-filled-primary w-min font-bold"
44
+ bind:value={$pageSize}
45
+ >
46
+ {#each pageSizes as size}
47
+ <option value={size}>{size}</option>
48
+ {/each}
49
+ </select>
50
+
51
+ <button
52
+ class="btn btn-sm variant-filled-primary"
53
+ on:click|preventDefault={goToNextPage}
54
+ disabled={goToNextPageDisabled}><Fa icon={faAngleRight} /></button
55
+ >
56
+ <button
57
+ class="btn btn-sm variant-filled-primary"
58
+ on:click|preventDefault={goToLastPage}
59
+ disabled={goToLastPageDisabled}><Fa icon={faAnglesRight} /></button
60
+ >
61
+ </div>
@@ -0,0 +1,30 @@
1
+ <script>
2
+ export let showOnPx = 150;
3
+ let hidden = true;
4
+
5
+ function goTop() {
6
+ document.body.scrollIntoView();
7
+ }
8
+
9
+ function scrollContainer() {
10
+ return document.documentElement || document.body;
11
+ }
12
+
13
+ function handleOnScroll() {
14
+ if (!scrollContainer()) {
15
+ return;
16
+ }
17
+
18
+ if (scrollContainer().scrollTop > showOnPx) {
19
+ hidden = false;
20
+ } else {
21
+ hidden = true;
22
+ }
23
+ }
24
+ </script>
25
+
26
+ <svelte:window on:scroll={handleOnScroll} />
27
+
28
+ <div class="w-full items-center">
29
+ <button class="btn ring back-to-top" on:click={goTop} class:hidden >Back to top</button>
30
+ </div>
@@ -0,0 +1,28 @@
1
+ <script lang="ts">
2
+
3
+ import type { Link } from "$lib/models/Models";
4
+
5
+ export let title = "";
6
+ export let note = "";
7
+ export let links:Link[]=[];
8
+
9
+ </script>
10
+
11
+ <div class="px-5 grid gap-5" >
12
+ <h1>{title}</h1>
13
+ {#if note}
14
+ <blockquote class="blockquote">{note}</blockquote>
15
+ {/if}
16
+
17
+ <slot name="description" />
18
+
19
+ {#if links.length>0}
20
+ <div class="py-5">
21
+ {#each links as link}
22
+ <a class="chip variant-ringed" href={link.url}>{link.label}</a>
23
+ {/each}
24
+ </div>
25
+ {/if}
26
+ <slot/>
27
+ </div>
28
+
@@ -0,0 +1,10 @@
1
+ /*place global styles here */
2
+ html, body { @apply h-full}
3
+
4
+ h1{
5
+ @apply text-primary-500;
6
+ }
7
+
8
+ :root {
9
+ --background:rgb(var(--color-surface-200))
10
+ }
@@ -60,17 +60,17 @@
60
60
  --color-success-700: 56 136 50; /* ⬅ #388832 */
61
61
  --color-success-800: 45 109 40; /* ⬅ #2d6d28 */
62
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 */
63
+ /* warning | #EAB308 */
64
+ --color-warning-50: 252 244 218; /* ⬅ #fcf4da */
65
+ --color-warning-100: 251 240 206; /* ⬅ #fbf0ce */
66
+ --color-warning-200: 250 236 193; /* ⬅ #faecc1 */
67
+ --color-warning-300: 247 225 156; /* ⬅ #f7e19c */
68
+ --color-warning-400: 240 202 82; /* ⬅ #f0ca52 */
69
+ --color-warning-500: 234 179 8; /* ⬅ #EAB308 */
70
+ --color-warning-600: 211 161 7; /* ⬅ #d3a107 */
71
+ --color-warning-700: 176 134 6; /* ⬅ #b08606 */
72
+ --color-warning-800: 140 107 5; /* ⬅ #8c6b05 */
73
+ --color-warning-900: 115 88 4; /* ⬅ #735804 */
74
74
  /* error | #FF0000 */
75
75
  --color-error-50: 255 217 217; /* ⬅ #ffd9d9 */
76
76
  --color-error-100: 255 204 204; /* ⬅ #ffcccc */
@@ -82,15 +82,16 @@
82
82
  --color-error-700: 191 0 0; /* ⬅ #bf0000 */
83
83
  --color-error-800: 153 0 0; /* ⬅ #990000 */
84
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
- }
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: 80 80 80; /* ⬅ #6c6c6c */
96
+
97
+ }