@humandialog/forms.svelte 0.4.20 → 0.4.22
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/components/list/List.d.ts +1 -0
- package/components/list/List.js +1 -0
- package/components/list/internal/list.inserter.svelte +9 -1
- package/components/list/internal/list.inserter.svelte.d.ts +2 -3
- package/components/list/list.inserter.svelte +2 -0
- package/components/list/list.inserter.svelte.d.ts +1 -0
- package/components/list/list.svelte +5 -2
- package/package.json +2 -2
package/components/list/List.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<script>import { editable, start_editing } from "../../../utils";
|
|
2
|
+
import Icon from "../../icon.svelte";
|
|
3
|
+
import { FaPlus } from "svelte-icons/fa";
|
|
2
4
|
export let oninsert;
|
|
5
|
+
export let icon = false;
|
|
3
6
|
export function run(onclose) {
|
|
4
7
|
start_editing(insertion_paragraph, onclose);
|
|
5
8
|
}
|
|
@@ -7,7 +10,12 @@ let insertion_paragraph;
|
|
|
7
10
|
</script>
|
|
8
11
|
|
|
9
12
|
<section class="flex flex-row my-0 w-full text-sm text-slate-700 dark:text-slate-400 cursor-default rounded-md border-2 border-transparent bg-gray-200 dark:bg-gray-700">
|
|
10
|
-
|
|
13
|
+
{#if icon}
|
|
14
|
+
<!--Icon size={3}
|
|
15
|
+
component={FaPlus}
|
|
16
|
+
class="mt-1.5 ml-2 "/-->
|
|
17
|
+
<div class="h-4 w-4 mt-1.5 ml-2"></div>
|
|
18
|
+
{/if}
|
|
11
19
|
|
|
12
20
|
<p class="ml-3 py-1 font-bold whitespace-nowrap overflow-clip flex-none w-1/2 sm:w-1/3"
|
|
13
21
|
bind:this={insertion_paragraph}
|
|
@@ -2,14 +2,13 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
oninsert: any;
|
|
5
|
+
icon?: boolean | undefined;
|
|
5
6
|
run?: ((onclose: any) => void) | undefined;
|
|
6
7
|
};
|
|
7
8
|
events: {
|
|
8
9
|
[evt: string]: CustomEvent<any>;
|
|
9
10
|
};
|
|
10
|
-
slots: {
|
|
11
|
-
left: {};
|
|
12
|
-
};
|
|
11
|
+
slots: {};
|
|
13
12
|
};
|
|
14
13
|
export type ListProps = typeof __propDef.props;
|
|
15
14
|
export type ListEvents = typeof __propDef.events;
|
|
@@ -17,7 +17,7 @@ let definition = new rList_definition();
|
|
|
17
17
|
setContext("rList-definition", definition);
|
|
18
18
|
setContext("rIs-table-component", true);
|
|
19
19
|
let item = null;
|
|
20
|
-
let items =
|
|
20
|
+
let items = void 0;
|
|
21
21
|
let ctx = context ? context : getContext("ctx");
|
|
22
22
|
let cs = c ? parse_width_directive(c) : "w-full min-w-full";
|
|
23
23
|
let show_insertion_row_after_element = null;
|
|
@@ -33,11 +33,12 @@ $:
|
|
|
33
33
|
function setup(...args) {
|
|
34
34
|
last_tick = $data_tick_store;
|
|
35
35
|
item = self ?? $context_items_store[ctx];
|
|
36
|
+
items = void 0;
|
|
36
37
|
if (objects)
|
|
37
38
|
items = objects;
|
|
38
39
|
else if (item && a)
|
|
39
40
|
items = item[a];
|
|
40
|
-
|
|
41
|
+
if (items == void 0)
|
|
41
42
|
items = [];
|
|
42
43
|
if (items.length > 0) {
|
|
43
44
|
let first_element = items[0];
|
|
@@ -149,6 +150,7 @@ export function edit(element, property_name) {
|
|
|
149
150
|
|
|
150
151
|
{#if show_insertion_row_after_element == element}
|
|
151
152
|
<Inserter oninsert={async (text) => {await insert(text, show_insertion_row_after_element)}}
|
|
153
|
+
icon={definition.inserter_icon}
|
|
152
154
|
bind:this={inserter} />
|
|
153
155
|
{/if}
|
|
154
156
|
{/each}
|
|
@@ -156,6 +158,7 @@ export function edit(element, property_name) {
|
|
|
156
158
|
|
|
157
159
|
{#if show_insertion_row_after_element == END_OF_LIST}
|
|
158
160
|
<Inserter oninsert={async (text) => {await insert(text, null)}}
|
|
161
|
+
icon={definition.inserter_icon}
|
|
159
162
|
bind:this={inserter} />
|
|
160
163
|
{/if}
|
|
161
164
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humandialog/forms.svelte",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.22",
|
|
4
4
|
"description": "Basic Svelte UI components for Object Reef applications",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@playwright/test": "^1.28.1",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@humandialog/auth.svelte": "^1.2.
|
|
29
|
+
"@humandialog/auth.svelte": "^1.2.2",
|
|
30
30
|
"flowbite-svelte": "^0.29.13",
|
|
31
31
|
"svelte-icons": "^2.1.0",
|
|
32
32
|
"svelte-spa-router": "^3.3.0"
|