@humandialog/forms.svelte 0.4.20 → 0.4.21

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.
@@ -28,5 +28,6 @@ export declare class rList_definition {
28
28
  summary_readonly: boolean;
29
29
  can_insert: boolean;
30
30
  oninsert: Function | undefined;
31
+ inserter_icon: boolean;
31
32
  properties: rList_property[];
32
33
  }
@@ -34,5 +34,6 @@ export class rList_definition {
34
34
  summary_readonly = false;
35
35
  can_insert = false;
36
36
  oninsert = undefined;
37
+ inserter_icon = false;
37
38
  properties = [];
38
39
  }
@@ -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
- <slot name='left'/>
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;
@@ -1,6 +1,8 @@
1
1
  <script>import { getContext } from "svelte";
2
2
  export let action;
3
+ export let icon = false;
3
4
  let definition = getContext("rList-definition");
4
5
  definition.can_insert = true;
5
6
  definition.oninsert = action;
7
+ definition.inserter_icon = icon;
6
8
  </script>
@@ -2,6 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
4
  action: Function;
5
+ icon?: boolean | undefined;
5
6
  };
6
7
  events: {
7
8
  [evt: string]: CustomEvent<any>;
@@ -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 = null;
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
- else
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.20",
3
+ "version": "0.4.21",
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.0",
29
+ "@humandialog/auth.svelte": "^1.2.1",
30
30
  "flowbite-svelte": "^0.29.13",
31
31
  "svelte-icons": "^2.1.0",
32
32
  "svelte-spa-router": "^3.3.0"