runeforge 0.0.13 → 0.0.14
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 +1 -0
- package/dist/components/crud/Field.svelte +1 -0
- package/dist/components/crud/Field.svelte.d.ts +1 -0
- package/dist/components/table/ColumnFilter.svelte +27 -13
- package/dist/components/table/ColumnFilter.svelte.d.ts +1 -0
- package/dist/icons/defaults/Clear.svelte +6 -0
- package/dist/icons/defaults/Clear.svelte.d.ts +7 -0
- package/dist/icons/sets/bootstrap.js +2 -1
- package/dist/icons/sets/default.js +2 -0
- package/dist/icons/types.d.ts +1 -0
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts" generics="T extends object">
|
|
2
|
+
import 'cally';
|
|
2
3
|
import Label from '../form/Label.svelte';
|
|
3
4
|
import Button from '../form/Button.svelte';
|
|
4
5
|
import { getIconSet } from '../../icons/context.js';
|
|
@@ -106,14 +107,33 @@
|
|
|
106
107
|
{dateRange.from || '…'} → {dateRange.to || '…'}
|
|
107
108
|
</p>
|
|
108
109
|
{/if}
|
|
110
|
+
{#if filter.hasActive(column.attribute)}
|
|
111
|
+
<Button variant="ghost" class="btn-sm mt-2 w-full" onclick={clear}>
|
|
112
|
+
{strings.clearFilter}
|
|
113
|
+
</Button>
|
|
114
|
+
{/if}
|
|
109
115
|
{:else}
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
<div class="relative">
|
|
117
|
+
<input
|
|
118
|
+
type="text"
|
|
119
|
+
class={['input input-bordered input-sm w-full', filter.hasActive(column.attribute) && 'pr-7']}
|
|
120
|
+
placeholder={strings.filterPlaceholder}
|
|
121
|
+
value={filter.textFor(column.attribute)}
|
|
122
|
+
oninput={(e) => setText(e.currentTarget.value)}
|
|
123
|
+
/>
|
|
124
|
+
{#if filter.hasActive(column.attribute)}
|
|
125
|
+
{@const Icon = icons.clear}
|
|
126
|
+
<Button
|
|
127
|
+
variant="ghost"
|
|
128
|
+
class="btn-xs btn-square btn-circle absolute top-1/2 right-1 -translate-y-1/2"
|
|
129
|
+
aria-label={strings.clearFilter}
|
|
130
|
+
title={strings.clearFilter}
|
|
131
|
+
onclick={clear}
|
|
132
|
+
>
|
|
133
|
+
<Icon class="size-3" />
|
|
134
|
+
</Button>
|
|
135
|
+
{/if}
|
|
136
|
+
</div>
|
|
117
137
|
|
|
118
138
|
{#if entries.length > 0 && entries.length < maxCheckboxValues}
|
|
119
139
|
<div class="mt-2 flex max-h-60 flex-col gap-1 overflow-y-auto">
|
|
@@ -133,10 +153,4 @@
|
|
|
133
153
|
</div>
|
|
134
154
|
{/if}
|
|
135
155
|
{/if}
|
|
136
|
-
|
|
137
|
-
{#if filter.hasActive(column.attribute)}
|
|
138
|
-
<Button variant="ghost" class="btn-sm mt-2 w-full" onclick={clear}>
|
|
139
|
-
{strings.clearFilter}
|
|
140
|
-
</Button>
|
|
141
|
-
{/if}
|
|
142
156
|
</div>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { size = '1em', class: cls = '' }: { size?: string | number; class?: string } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 16 16" fill="currentColor" class={cls}>
|
|
5
|
+
<path d="M2.146 2.146a.5.5 0 0 1 .708 0L8 7.293l5.146-5.147a.5.5 0 1 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854a.5.5 0 0 1 0-.708z"/>
|
|
6
|
+
</svg>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* setIconSet(bootstrapIconSet);
|
|
11
11
|
*/
|
|
12
12
|
import * as Icons from 'svelte-bootstrap-icons';
|
|
13
|
-
const { ChevronExpand, CaretUpFill, CaretDownFill, Funnel, FunnelFill, Plus, Eye, PencilSquare, Trash3, HouseDoor, Folder, EyeSlash, } = Icons;
|
|
13
|
+
const { ChevronExpand, CaretUpFill, CaretDownFill, Funnel, FunnelFill, Plus, Eye, PencilSquare, Trash3, HouseDoor, Folder, EyeSlash, X, } = Icons;
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
15
|
function asIcon(c) { return c; }
|
|
16
16
|
export const bootstrapIconSet = {
|
|
@@ -19,6 +19,7 @@ export const bootstrapIconSet = {
|
|
|
19
19
|
sortDesc: asIcon(CaretDownFill),
|
|
20
20
|
filter: asIcon(Funnel),
|
|
21
21
|
filterActive: asIcon(FunnelFill),
|
|
22
|
+
clear: asIcon(X),
|
|
22
23
|
create: asIcon(Plus),
|
|
23
24
|
view: asIcon(Eye),
|
|
24
25
|
edit: asIcon(PencilSquare),
|
|
@@ -3,6 +3,7 @@ import SortAsc from '../defaults/SortAsc.svelte';
|
|
|
3
3
|
import SortDesc from '../defaults/SortDesc.svelte';
|
|
4
4
|
import Filter from '../defaults/Filter.svelte';
|
|
5
5
|
import FilterActive from '../defaults/FilterActive.svelte';
|
|
6
|
+
import Clear from '../defaults/Clear.svelte';
|
|
6
7
|
import Create from '../defaults/Create.svelte';
|
|
7
8
|
import View from '../defaults/View.svelte';
|
|
8
9
|
import Edit from '../defaults/Edit.svelte';
|
|
@@ -17,6 +18,7 @@ export const defaultIconSet = {
|
|
|
17
18
|
sortDesc: SortDesc,
|
|
18
19
|
filter: Filter,
|
|
19
20
|
filterActive: FilterActive,
|
|
21
|
+
clear: Clear,
|
|
20
22
|
create: Create,
|
|
21
23
|
view: View,
|
|
22
24
|
edit: Edit,
|
package/dist/icons/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "runeforge",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "SvelteKit toolkit for building metadata-driven CRUD interfaces with tables, forms, and actions",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ezequiel Puerta",
|
|
@@ -37,6 +37,9 @@
|
|
|
37
37
|
"svelte": "^5.0.0",
|
|
38
38
|
"tailwindcss": "^4.0.0"
|
|
39
39
|
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"cally": "^0.9.2"
|
|
42
|
+
},
|
|
40
43
|
"devDependencies": {
|
|
41
44
|
"@eslint/js": "^10.0.1",
|
|
42
45
|
"@playwright/test": "^1.60.0",
|