@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.
package/README.md CHANGED
@@ -1,9 +1,64 @@
1
1
  # bexis-core-ui
2
2
 
3
- ## new in version 0.0.26
3
+ ## v0.0.28
4
+ #### components
5
+ - Page
6
+
7
+ #### types
8
+ - Link
4
9
 
5
- ## Updates
10
+ ## v0.0.27
11
+
12
+ ### add
13
+ #### components
14
+ - Table
15
+ - TableFilter
16
+ - cloumnFilter
17
+ - searchFilter
18
+
19
+ #### types
20
+ - TableConfig
21
+ - Columns
22
+ - Column
23
+ - Input
24
+
25
+ <hr/>
26
+
27
+ ## v0.0.26
28
+
29
+ ### updates
6
30
 
7
31
  - fix bugs in checkbox list
8
32
  - fix bugs in multi select
9
33
 
34
+ <hr/>
35
+
36
+ ## v0.0.25
37
+
38
+ ### adds
39
+ #### components
40
+ - Spinner
41
+ - FileUploader
42
+ - FileInfo
43
+ - FileIcon
44
+ -
45
+ #### types
46
+ - FileUploaderModel
47
+
48
+ <hr/>
49
+
50
+ ## v0.0.23
51
+
52
+ ### updates
53
+ - update bexis 2 theme
54
+
55
+ ### adds
56
+ - Checkbox
57
+ - CheckboxKVPList
58
+ - CheckboxList
59
+ - DateInput
60
+ - DropdownKVP
61
+ - MultiSelect
62
+ - NumberInput
63
+ - TextArea
64
+ - TextInput
@@ -71,98 +71,98 @@ const popupFeatured = {
71
71
  placement: "bottom-start"
72
72
  };
73
73
  const type = typeof $values[0];
74
- </script>
75
-
76
- <form class="">
77
- <button
78
- class:variant-filled-primary={active}
79
- class="btn w-max p-2"
80
- type="button"
81
- use:popup={popupFeatured}
82
- >
83
- <Fa icon={faFilter} size="12" />
84
- </button>
85
-
86
- <div data-popup={`${popupId}`}>
87
- <div class="card p-3 absolute grid gap-2 shadow-lg z-10 w-min">
88
- <button
89
- class="btn variant-filled-primary btn-sm"
90
- type="submit"
91
- on:click={() => {
92
- firstOption = 'isequal';
93
- firstValue = undefined;
94
- secondOption = 'isequal';
95
- secondValue = undefined;
96
-
97
- $filterValue = [firstOption, firstValue, secondOption, secondValue];
98
- active = false;
99
- }}>Clear Filter</button
100
- >
101
-
102
- <label for="" class="label normal-case text-sm">Show rows with value that</label>
103
- <div class="grid gap-2 w-full">
104
- <select
105
- class="select border border-primary-500 text-sm p-1"
106
- aria-label="Show rows with value that"
107
- bind:value={firstOption}
108
- on:click|stopPropagation
109
- >
110
- {#each options[type] as option (option)}
111
- <option value={option.value}>{option.label}</option>
112
- {/each}
113
- </select>
114
- {#if type === 'number'}
115
- <input
116
- type="number"
117
- class="input p-1 border border-primary-500"
118
- bind:value={firstValue}
119
- on:click|stopPropagation
120
- />
121
- {:else}
122
- <input
123
- type="text"
124
- class="input p-1 border border-primary-500"
125
- bind:value={firstValue}
126
- on:click|stopPropagation
127
- />
128
- {/if}
129
- </div>
130
- <label for="" class="label normal-case">And</label>
131
- <div class="grid gap-2 w-max">
132
- <select
133
- class="select border border-primary-500 text-sm p-1"
134
- aria-label="Show rows with value that"
135
- bind:value={secondOption}
136
- on:click|stopPropagation
137
- >
138
- {#each options[type] as option (option)}
139
- <option value={option.value}>{option.label}</option>
140
- {/each}
141
- </select>
142
- {#if type === 'number'}
143
- <input
144
- type="number"
145
- class="input p-1 border border-primary-500"
146
- bind:value={secondValue}
147
- on:click|stopPropagation
148
- />
149
- {:else}
150
- <input
151
- type="text"
152
- class="input p-1 border border-primary-500"
153
- bind:value={secondValue}
154
- on:click|stopPropagation
155
- />
156
- {/if}
157
- </div>
158
- <button
159
- class="btn variant-filled-primary btn-sm"
160
- type="submit"
161
- on:click={() => {
162
- active = firstValue?.toString().length > 0 || secondValue?.toString().length > 0;
163
- $filterValue = [firstOption, firstValue, secondOption, secondValue];
164
- }}>Submit</button
165
- >
166
- </div>
167
- </div>
168
- </form>
74
+ </script>
75
+
76
+ <form class="">
77
+ <button
78
+ class:variant-filled-primary={active}
79
+ class="btn w-max p-2"
80
+ type="button"
81
+ use:popup={popupFeatured}
82
+ >
83
+ <Fa icon={faFilter} size="12" />
84
+ </button>
85
+
86
+ <div data-popup={`${popupId}`}>
87
+ <div class="card p-3 absolute grid gap-2 shadow-lg z-10 w-min">
88
+ <button
89
+ class="btn variant-filled-primary btn-sm"
90
+ type="submit"
91
+ on:click|preventDefault={() => {
92
+ firstOption = 'isequal';
93
+ firstValue = undefined;
94
+ secondOption = 'isequal';
95
+ secondValue = undefined;
96
+
97
+ $filterValue = [firstOption, firstValue, secondOption, secondValue];
98
+ active = false;
99
+ }}>Clear Filter</button
100
+ >
101
+
102
+ <label for="" class="label normal-case text-sm">Show rows with value that</label>
103
+ <div class="grid gap-2 w-full">
104
+ <select
105
+ class="select border border-primary-500 text-sm p-1"
106
+ aria-label="Show rows with value that"
107
+ bind:value={firstOption}
108
+ on:click|stopPropagation
109
+ >
110
+ {#each options[type] as option (option)}
111
+ <option value={option.value}>{option.label}</option>
112
+ {/each}
113
+ </select>
114
+ {#if type === 'number'}
115
+ <input
116
+ type="number"
117
+ class="input p-1 border border-primary-500"
118
+ bind:value={firstValue}
119
+ on:click|stopPropagation
120
+ />
121
+ {:else}
122
+ <input
123
+ type="text"
124
+ class="input p-1 border border-primary-500"
125
+ bind:value={firstValue}
126
+ on:click|stopPropagation
127
+ />
128
+ {/if}
129
+ </div>
130
+ <label for="" class="label normal-case">And</label>
131
+ <div class="grid gap-2 w-max">
132
+ <select
133
+ class="select border border-primary-500 text-sm p-1"
134
+ aria-label="Show rows with value that"
135
+ bind:value={secondOption}
136
+ on:click|stopPropagation
137
+ >
138
+ {#each options[type] as option (option)}
139
+ <option value={option.value}>{option.label}</option>
140
+ {/each}
141
+ </select>
142
+ {#if type === 'number'}
143
+ <input
144
+ type="number"
145
+ class="input p-1 border border-primary-500"
146
+ bind:value={secondValue}
147
+ on:click|stopPropagation
148
+ />
149
+ {:else}
150
+ <input
151
+ type="text"
152
+ class="input p-1 border border-primary-500"
153
+ bind:value={secondValue}
154
+ on:click|stopPropagation
155
+ />
156
+ {/if}
157
+ </div>
158
+ <button
159
+ class="btn variant-filled-primary btn-sm"
160
+ type="submit"
161
+ on:click|preventDefault={() => {
162
+ active = firstValue?.toString().length > 0 || secondValue?.toString().length > 0;
163
+ $filterValue = [firstOption, firstValue, secondOption, secondValue];
164
+ }}>Submit</button
165
+ >
166
+ </div>
167
+ </div>
168
+ </form>
@@ -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={goToFirstPage}
29
- disabled={goToFirstPageDisabled}
30
- >
31
- <Fa icon={faAnglesLeft} /></button
32
- >
33
- <button
34
- class="btn btn-sm variant-filled-primary"
35
- on:click={goToPreviousPage}
36
- disabled={goToPreviousPageDisabled}><Fa icon={faAngleLeft} /></button
37
- >
38
-
39
- <select
40
- name="pageSize"
41
- id="pageSize"
42
- class="select btn btn-sm 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={goToNextPage}
53
- disabled={goToNextPageDisabled}><Fa icon={faAngleRight} /></button
54
- >
55
- <button
56
- class="btn btn-sm variant-filled-primary"
57
- on:click={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 btn btn-sm 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>
@@ -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,23 @@
1
+ /** @typedef {typeof __propDef.props} BackToTopProps */
2
+ /** @typedef {typeof __propDef.events} BackToTopEvents */
3
+ /** @typedef {typeof __propDef.slots} BackToTopSlots */
4
+ export default class BackToTop extends SvelteComponentTyped<{
5
+ showOnPx?: number | undefined;
6
+ }, {
7
+ [evt: string]: CustomEvent<any>;
8
+ }, {}> {
9
+ }
10
+ export type BackToTopProps = typeof __propDef.props;
11
+ export type BackToTopEvents = typeof __propDef.events;
12
+ export type BackToTopSlots = typeof __propDef.slots;
13
+ import { SvelteComponentTyped } from "svelte";
14
+ declare const __propDef: {
15
+ props: {
16
+ showOnPx?: number | undefined;
17
+ };
18
+ events: {
19
+ [evt: string]: CustomEvent<any>;
20
+ };
21
+ slots: {};
22
+ };
23
+ export {};
@@ -0,0 +1,23 @@
1
+ <script>export let title = "";
2
+ export let note = "";
3
+ export let links = [];
4
+ </script>
5
+
6
+ <div class="px-5 grid gap-5" >
7
+ <h1>{title}</h1>
8
+ {#if note}
9
+ <blockquote class="blockquote">{note}</blockquote>
10
+ {/if}
11
+
12
+ <slot name="description" />
13
+
14
+ {#if links.length>0}
15
+ <div class="py-5">
16
+ {#each links as link}
17
+ <a class="chip variant-ringed" href={link.url}>{link.label}</a>
18
+ {/each}
19
+ </div>
20
+ {/if}
21
+ <slot/>
22
+ </div>
23
+
@@ -0,0 +1,22 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { Link } from "../../models/Models";
3
+ declare const __propDef: {
4
+ props: {
5
+ title?: string | undefined;
6
+ note?: string | undefined;
7
+ links?: Link[] | undefined;
8
+ };
9
+ events: {
10
+ [evt: string]: CustomEvent<any>;
11
+ };
12
+ slots: {
13
+ description: {};
14
+ default: {};
15
+ };
16
+ };
17
+ export type PageProps = typeof __propDef.props;
18
+ export type PageEvents = typeof __propDef.events;
19
+ export type PageSlots = typeof __propDef.slots;
20
+ export default class Page extends SvelteComponentTyped<PageProps, PageEvents, PageSlots> {
21
+ }
22
+ export {};
@@ -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
+ }
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import FileIcon from './components/file/FileIcon.svelte';
4
4
  import FileInfo from './components/file/FileInfo.svelte';
5
5
  import FileUploader from './components/file/FileUploader.svelte';
6
6
  import Spinner from './components/spinner/Spinner.svelte';
7
+ import Page from './components/page/Page.svelte';
7
8
  import Checkbox from './components/form/Checkbox.svelte';
8
9
  import CheckboxKVPList from './components/form/CheckboxKvPList.svelte';
9
10
  import CheckboxList from './components/form/CheckboxList.svelte';
@@ -13,9 +14,15 @@ import MultiSelect from './components/form/MultiSelect.svelte';
13
14
  import NumberInput from './components/form/NumberInput.svelte';
14
15
  import TextInput from './components/form/TextInput.svelte';
15
16
  import TextArea from './components/form/TextArea.svelte';
17
+ import Table from './components/Table/Table.svelte';
18
+ import TableFilter from './components/Table/TableFilter.svelte';
19
+ import { columnFilter, searchFilter } from './components/Table/filter';
20
+ import type { TableConfig, Columns, Column } from './models/Models';
16
21
  export { Checkbox, CheckboxKVPList, CheckboxList, DateInput, DropdownKVP, MultiSelect, NumberInput, TextArea, TextInput };
17
22
  export { FileInfo, FileIcon, FileUploader };
18
- export { ListView, TableView, Spinner };
23
+ export { ListView, TableView, Spinner, Page };
19
24
  export { Api } from './services/Api.js';
20
25
  export { host, username, password, setApiConfig } from './stores/apistore.js';
21
- export type { user, FileUploaderModel } from './models/Models.js';
26
+ export type { user, Input, FileUploaderModel } from './models/Models.js';
27
+ export { Table, TableFilter, columnFilter, searchFilter };
28
+ export type { TableConfig, Columns, Column };
package/dist/index.js CHANGED
@@ -4,7 +4,10 @@ import TableView from './TableView.svelte';
4
4
  import FileIcon from './components/file/FileIcon.svelte';
5
5
  import FileInfo from './components/file/FileInfo.svelte';
6
6
  import FileUploader from './components/file/FileUploader.svelte';
7
+ //page
7
8
  import Spinner from './components/spinner/Spinner.svelte';
9
+ import Page from './components/page/Page.svelte';
10
+ // input
8
11
  import Checkbox from './components/form/Checkbox.svelte';
9
12
  import CheckboxKVPList from './components/form/CheckboxKvPList.svelte';
10
13
  import CheckboxList from './components/form/CheckboxList.svelte';
@@ -14,12 +17,17 @@ import MultiSelect from './components/form/MultiSelect.svelte';
14
17
  import NumberInput from './components/form/NumberInput.svelte';
15
18
  import TextInput from './components/form/TextInput.svelte';
16
19
  import TextArea from './components/form/TextArea.svelte';
20
+ import Table from './components/Table/Table.svelte';
21
+ import TableFilter from './components/Table/TableFilter.svelte';
22
+ import { columnFilter, searchFilter } from './components/Table/filter';
17
23
  //Form
18
24
  export { Checkbox, CheckboxKVPList, CheckboxList, DateInput, DropdownKVP, MultiSelect, NumberInput, TextArea, TextInput };
19
25
  //File
20
26
  export { FileInfo, FileIcon, FileUploader };
21
27
  //others
22
- export { ListView, TableView, Spinner };
28
+ export { ListView, TableView, Spinner, Page };
23
29
  //Api
24
30
  export { Api } from './services/Api.js';
25
31
  export { host, username, password, setApiConfig } from './stores/apistore.js';
32
+ // Table
33
+ export { Table, TableFilter, columnFilter, searchFilter };
@@ -1,6 +1,10 @@
1
1
  import type { SvelteComponent } from 'svelte';
2
2
  import type { ColumnFilterFn } from 'svelte-headless-table/lib/plugins';
3
3
  import type { Writable } from 'svelte/store';
4
+ export interface Link {
5
+ label: string;
6
+ url: string;
7
+ }
4
8
  export interface Input {
5
9
  id: string;
6
10
  label: string;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@bexis2/bexis2-core-ui",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "private": false,
5
5
  "scripts": {
6
- "dev": "vite dev --host",
6
+ "dev": "vite dev",
7
7
  "package": "svelte-package --watch",
8
8
  "build": "vite build",
9
9
  "build package": "svelte-kit sync && svelte-package --watch",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@playwright/test": "^1.28.1",
23
- "@skeletonlabs/skeleton": "^1.2.5",
23
+ "@skeletonlabs/skeleton": "^1.6.0",
24
24
  "@sveltejs/adapter-auto": "^2.0.0",
25
25
  "@sveltejs/adapter-static": "^2.0.2",
26
26
  "@sveltejs/kit": "^1.5.0",