@humandialog/forms.svelte 0.5.5 → 0.5.7

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.
@@ -143,6 +143,19 @@ const on_keyup = () => {
143
143
  selection_changed();
144
144
  };
145
145
  const on_keydown = (event) => {
146
+ const sel = window.getSelection();
147
+ if (sel.focusNode == editable_div) {
148
+ let next_text_editable_node = find_next_editable_node(null, editable_div);
149
+ if (!next_text_editable_node) {
150
+ event.preventDefault();
151
+ return;
152
+ }
153
+ let range = new Range();
154
+ range.collapse(true);
155
+ range.setStart(next_text_editable_node, 0);
156
+ range.setEnd(next_text_editable_node, 0);
157
+ set_selection(range);
158
+ }
146
159
  switch (event.key) {
147
160
  case "Enter":
148
161
  if (is_command_palette_visible) {
@@ -650,7 +663,11 @@ function is_non_editable_element(node) {
650
663
  if (node.nodeType != node.ELEMENT_NODE)
651
664
  return false;
652
665
  let element = node;
653
- return element.isContentEditable;
666
+ if (element.isContentEditable)
667
+ return false;
668
+ if (element.contentEditable == "false")
669
+ return true;
670
+ return false;
654
671
  }
655
672
  function find_next_editable_node(after, parent, check_upper_nodes = false) {
656
673
  let node;
@@ -983,6 +1000,7 @@ let commands = [
983
1000
  outline: 0px solid transparent;
984
1001
  }
985
1002
 
1003
+
986
1004
  /*
987
1005
  :global(.doc-code) {
988
1006
  margin-left: 3rem;
@@ -109,7 +109,7 @@
109
109
  </script>
110
110
 
111
111
  {#if itype == 'text'}
112
- {@const border_style = invalid ? "border-red-300 dark:border-red-600" : "border-stone-300 dark:border-stone-600" }
112
+ {@const border_style = invalid ? "border-red-300 dark:border-red-600" : "border-stone-300 dark:border-stone-500" }
113
113
  <div class={cs}>
114
114
  <label for="name" class="block {label_mb} text-xs font-small text-stone-900 dark:text-white">{label}</label>
115
115
 
@@ -203,7 +203,7 @@ export async function editProperty(field) {
203
203
  {#if item[definition.summaryAttrib] || summaryPlaceholder}
204
204
  {#key item[definition.summaryAttrib]}
205
205
  {#if isCardActive}
206
- <summary class=" sm:text-xs sm:min-h-[1rem]
206
+ <p class=" sm:text-xs sm:min-h-[1rem]
207
207
  text-base min-h-[1.5rem]
208
208
  text-stone-400
209
209
  max-h-[75px] sm:max-h-[64px]
@@ -215,15 +215,15 @@ export async function editProperty(field) {
215
215
  onFinish: (d) => {summaryPlaceholder = false}}}
216
216
  bind:this={summaryElement}>
217
217
  {item[definition.summaryAttrib]}
218
- </summary>
218
+ </p>
219
219
  {:else}
220
- <summary class=" sm:text-xs sm:min-h-[1rem]
220
+ <p class=" sm:text-xs sm:min-h-[1rem]
221
221
  text-base min-h-[1.5rem]
222
222
  text-stone-400
223
223
  max-h-[75px] sm:max-h-[64px]
224
224
  overflow-hidden">
225
225
  {item[definition.summaryAttrib]}
226
- </summary>
226
+ </p>
227
227
  {/if}
228
228
  {/key}
229
229
  {/if}
@@ -86,55 +86,55 @@ async function editTags(field, propIdx) {
86
86
  });
87
87
  }
88
88
  }
89
- </script>
90
-
91
- <section class="flex flex-row justify-between">
92
- {#each properties as prop, idx}
93
- {#if item[prop.a] || placeholder==prop.name}
94
- {#if prop.type == rList_property_type.Date}
95
- <DatePicker
96
- self={item}
97
- a={prop.a}
98
- compact={true}
99
- s="xs"
100
- inContext="props"
101
- bind:this={propElements[idx]}/>
102
- {:else if prop.type == rList_property_type.Combo}
103
- <Combo
104
- compact={true}
105
- inContext="props"
106
- self={item}
107
- a={prop.a}
108
- onSelect={prop.onSelect}
109
- isAssociation={prop.association}
110
- icon={false}
111
- definition={prop.combo_definition}
112
- s="xs"
113
- bind:this={propElements[idx]}/>
114
- {:else if prop.type == rList_property_type.Static}
115
- <p
116
- class=" h-6
117
- sm:text-xs sm:min-h-[1rem]
118
- text-base min-h-[1.5rem]
119
- text-stone-400
120
- text-right"
121
- bind:this={propElements[idx]}>
122
- {item[prop.a]}
123
- </p>
124
- {:else if prop.type == rList_property_type.Tags}
125
- <Tags
126
- class="mt-2"
127
- compact
128
- inContext="props"
129
- self={item}
130
- a={prop.a}
131
- globalTags={prop.allTags}
132
- s="xs"
133
- onSelect={prop.onSelect}
134
- onCreate={prop.onCreate}
135
- bind:this={propElements[idx]}
136
- />
137
- {/if}
138
- {/if}
139
- {/each}
89
+ </script>
90
+
91
+ <section class="flex flex-row justify-between">
92
+ {#each properties as prop, idx}
93
+ {#if item[prop.a] || placeholder==prop.name}
94
+ {#if prop.type == rList_property_type.Date}
95
+ <DatePicker
96
+ self={item}
97
+ a={prop.a}
98
+ compact={true}
99
+ s="xs"
100
+ inContext="props"
101
+ bind:this={propElements[idx]}/>
102
+ {:else if prop.type == rList_property_type.Combo}
103
+ <Combo
104
+ compact={true}
105
+ inContext="props"
106
+ self={item}
107
+ a={prop.a}
108
+ onSelect={prop.onSelect}
109
+ isAssociation={prop.association}
110
+ icon={false}
111
+ definition={prop.combo_definition}
112
+ s="xs"
113
+ bind:this={propElements[idx]}/>
114
+ {:else if prop.type == rList_property_type.Static}
115
+ <p
116
+ class=" h-6
117
+ sm:text-xs sm:min-h-[1rem]
118
+ text-base min-h-[1.5rem]
119
+ text-stone-400
120
+ text-right"
121
+ bind:this={propElements[idx]}>
122
+ {item[prop.a]}
123
+ </p>
124
+ {:else if prop.type == rList_property_type.Tags}
125
+ <Tags
126
+ class="mt-2"
127
+ compact
128
+ inContext="props"
129
+ self={item}
130
+ a={prop.a}
131
+ getGlobalTags={prop.getAllTags}
132
+ s="xs"
133
+ onSelect={prop.onSelect}
134
+ onCreate={prop.onCreate}
135
+ bind:this={propElements[idx]}
136
+ />
137
+ {/if}
138
+ {/if}
139
+ {/each}
140
140
  </section>
@@ -3,7 +3,7 @@ import { KanbanCardTop, KanbanCardMiddle, KanbanCardBottom } from "./Kanban";
3
3
  import { rList_property_tags } from "../list/List";
4
4
  export let name = "";
5
5
  export let a = "";
6
- export let allTags = "";
6
+ export let getAllTags = void 0;
7
7
  export let onCreate = void 0;
8
8
  export let onSelect = void 0;
9
9
  export let top = false;
@@ -23,7 +23,7 @@ if (!a && name) {
23
23
  }
24
24
  tagsProperty.onSelect = onSelect;
25
25
  tagsProperty.onCreate = onCreate;
26
- tagsProperty.allTags = allTags;
26
+ tagsProperty.getAllTags = getAllTags;
27
27
  if (top)
28
28
  tagsProperty.position = KanbanCardTop;
29
29
  else if (bottom)
@@ -31,4 +31,4 @@ else if (bottom)
31
31
  else
32
32
  tagsProperty.position = KanbanCardMiddle;
33
33
  definition.properties.push(tagsProperty);
34
- </script>
34
+ </script>
@@ -3,7 +3,7 @@ declare const __propDef: {
3
3
  props: {
4
4
  name?: string | undefined;
5
5
  a?: string | undefined;
6
- allTags?: string | undefined;
6
+ getAllTags?: Function | undefined;
7
7
  onCreate?: Function | undefined;
8
8
  onSelect?: Function | undefined;
9
9
  top?: boolean | undefined;
@@ -23,7 +23,7 @@ export declare class rList_property_combo extends rList_property {
23
23
  export declare class rList_property_tags extends rList_property {
24
24
  constructor();
25
25
  onCreate: Function | undefined;
26
- allTags: string;
26
+ getAllTags: Function | undefined;
27
27
  }
28
28
  export declare class rList_definition {
29
29
  title: string;
@@ -39,5 +39,6 @@ export declare class rList_definition {
39
39
  can_insert: boolean;
40
40
  onInsert: Function | undefined;
41
41
  inserter_icon: boolean;
42
+ onOpen: Function | undefined;
42
43
  properties: rList_property[];
43
44
  }
@@ -31,7 +31,7 @@ export class rList_property_tags extends rList_property {
31
31
  super(rList_property_type.Tags);
32
32
  }
33
33
  onCreate = undefined;
34
- allTags = '';
34
+ getAllTags = undefined;
35
35
  }
36
36
  export class rList_definition {
37
37
  title = '';
@@ -47,5 +47,6 @@ export class rList_definition {
47
47
  can_insert = false;
48
48
  onInsert = undefined;
49
49
  inserter_icon = false;
50
+ onOpen = undefined;
50
51
  properties = [];
51
52
  }
@@ -7,7 +7,6 @@ export let text = "";
7
7
  export let placeholder = false;
8
8
  export let active = false;
9
9
  export let editable;
10
- export let clickEdit;
11
10
  let user_class = $$props.class ?? "";
12
11
  </script>
13
12
 
@@ -47,7 +46,10 @@ let user_class = $$props.class ?? "";
47
46
  text-base min-h-[1.5rem]
48
47
  text-stone-400
49
48
  {user_class}"
50
- use:_editable={editable}
49
+ use:_editable={{
50
+ action: editable,
51
+ active: true
52
+ }}
51
53
  on:click>
52
54
  </p>
53
55
  {/if}
@@ -8,7 +8,6 @@ declare const __propDef: {
8
8
  placeholder?: boolean | undefined;
9
9
  active?: boolean | undefined;
10
10
  editable: any;
11
- clickEdit: any;
12
11
  };
13
12
  events: {
14
13
  click: MouseEvent;
@@ -15,6 +15,8 @@ import Properties from "./list.element.props.svelte";
15
15
  import { isDeviceSmallerThan } from "../../../utils";
16
16
  import { rList_definition, rList_property_type } from "../List";
17
17
  import { push } from "svelte-spa-router";
18
+ import { FaExternalLinkAlt } from "svelte-icons/fa/";
19
+ import { readonly } from "svelte/store";
18
20
  export let item;
19
21
  export let title = "";
20
22
  export let summary = "";
@@ -123,10 +125,6 @@ function on_active_row_clicked(e, part) {
123
125
  if (link)
124
126
  push(link);
125
127
  } else {
126
- if (part == "top" && !definition.title_readonly)
127
- force_editing("Title");
128
- else if (part == "bottom" && !definition.summary_readonly)
129
- force_editing("Summary");
130
128
  }
131
129
  } else {
132
130
  }
@@ -176,9 +174,20 @@ async function force_editing(field) {
176
174
  if (!element_node.classList.contains("editable")) {
177
175
  return;
178
176
  }
179
- startEditing(element_node, () => {
180
- placeholder = "";
181
- });
177
+ element_node.focus();
178
+ setSelectionAtEnd(element_node);
179
+ }
180
+ function setSelectionAtEnd(element) {
181
+ const textNode = element.childNodes[0];
182
+ const text = textNode.textContent;
183
+ let range = document.createRange();
184
+ let end_offset = text.length;
185
+ let end_container = textNode;
186
+ range.setStart(end_container, end_offset);
187
+ range.setEnd(end_container, end_offset);
188
+ let sel = window.getSelection();
189
+ sel.removeAllRanges();
190
+ sel.addRange(range);
182
191
  }
183
192
  </script>
184
193
 
@@ -213,6 +222,13 @@ async function force_editing(field) {
213
222
  readonly: definition.title_readonly,
214
223
  }}>
215
224
  {element_title}
225
+
226
+ {#if definition.onOpen}
227
+ <button class="ml-3 w-5 h-5 sm:w-3 sm:h-3"
228
+ on:click={(e) => definition.onOpen(item)}>
229
+ <FaExternalLinkAlt/>
230
+ </button>
231
+ {/if}
216
232
  </p>
217
233
  {/key}
218
234
  {:else}
@@ -233,16 +249,43 @@ async function force_editing(field) {
233
249
 
234
250
  {#if summary && (item[summary] || placeholder=='Summary')}
235
251
  {@const element_id = `__hd_list_ctrl_${item[item_key]}_Summary`}
236
- <Summary
252
+ {#key item[summary]}
253
+
254
+ <!--Summary
237
255
  id={element_id}
238
256
  on:click={(e) => on_active_row_clicked(e, 'bottom')}
239
257
  text={item[summary]}
240
258
  readonly={definition.summary_readonly}
241
259
  placeholder={placeholder == 'Summary'}
242
260
  editable={(text) => {change_summary(text)}}
243
- clickEdit={edit}
244
261
  active={is_row_active}
245
- />
262
+ /-->
263
+
264
+
265
+ {#if is_row_active}
266
+ <p id={element_id}
267
+ class=" sm:text-xs sm:min-h-[1rem]
268
+ text-base min-h-[1.5rem]
269
+ text-stone-400"
270
+ use:editable={{
271
+ action: (text) => {change_summary(text)},
272
+ readonly: definition.summary_readonly,
273
+ onFinish: (d) => {placeholder='';},
274
+ active: true
275
+ }}>
276
+ {item[summary]}
277
+ </p>
278
+ {:else}
279
+ <p id={element_id}
280
+ class=" sm:text-xs sm:min-h-[1rem]
281
+ text-base min-h-[1.5rem]
282
+ text-stone-400"
283
+ on:click={(e) => on_active_row_clicked(e, 'bottom')}>
284
+ {item[summary]}
285
+ </p>
286
+ {/if}
287
+ {/key}
288
+
246
289
  {/if}
247
290
 
248
291
  <section class="block sm:hidden w-full sm:flex-none sm:w-2/3">
@@ -84,7 +84,7 @@ export function reload(data, selectElement = KEEP_SELECTION) {
84
84
  selectElementId = 0;
85
85
  break;
86
86
  case KEEP_SELECTION:
87
- selectElementId = currentSelectedItem.Id ?? 0;
87
+ selectElementId = currentSelectedItem?.Id ?? 0;
88
88
  break;
89
89
  case SELECT_PREVIOUS:
90
90
  if (currentSelectedItem) {
@@ -2,6 +2,7 @@
2
2
  export let a;
3
3
  export let editable = false;
4
4
  export let onChange = void 0;
5
+ export let onOpen = void 0;
5
6
  export let readonly = false;
6
7
  export let href = void 0;
7
8
  export let hrefFunc = void 0;
@@ -12,4 +13,5 @@ definition.on_title_changed = onChange;
12
13
  definition.title_readonly = readonly;
13
14
  definition.title_href = href;
14
15
  definition.title_href_func = hrefFunc;
16
+ definition.onOpen = onOpen;
15
17
  </script>
@@ -4,6 +4,7 @@ declare const __propDef: {
4
4
  a: string;
5
5
  editable?: boolean | undefined;
6
6
  onChange?: Function | undefined;
7
+ onOpen?: Function | undefined;
7
8
  readonly?: boolean | undefined;
8
9
  href?: string | undefined;
9
10
  hrefFunc?: Function | undefined;
@@ -6,7 +6,7 @@ import ComboItem from "./combo/combo.item.svelte";
6
6
  import { contextItemsStore, data_tick_store, contextTypesStore } from "../stores.js";
7
7
  import { informModification, pushChanges } from "../updates.js";
8
8
  export let tags = "";
9
- export let globalTags = "";
9
+ export let getGlobalTags;
10
10
  export let self = null;
11
11
  export let a = "";
12
12
  export let context = "";
@@ -27,6 +27,7 @@ let isEditable = true;
27
27
  $:
28
28
  setup($data_tick_store, $contextItemsStore);
29
29
  function setup(...args) {
30
+ const globalTags = getGlobalTags();
30
31
  globalTagsTable = decomposeTags(globalTags);
31
32
  if (!tags) {
32
33
  item = self ?? $contextItemsStore[ctx];
@@ -104,6 +105,7 @@ function onRemoveTag(tag) {
104
105
  }
105
106
  function onNewTagCreated(key, name) {
106
107
  tags += `#${key} `;
108
+ let globalTags = getGlobalTags();
107
109
  globalTags += `#${key} `;
108
110
  globalTagsTable = decomposeTags(globalTags);
109
111
  tagsTable = decomposeTags(tags, globalTagsTable);
@@ -143,6 +145,8 @@ function decomposeTags(tags2, referenceTable = void 0) {
143
145
  return table;
144
146
  }
145
147
  function getNotUsedTags() {
148
+ const globalTags = getGlobalTags();
149
+ globalTagsTable = decomposeTags(globalTags);
146
150
  let result = globalTagsTable.filter((e) => {
147
151
  const label = e.label;
148
152
  let idx = tagsTable.findIndex((f) => f.label == label);
@@ -165,39 +169,39 @@ switch (s) {
165
169
  gap = "gap-2 sm:gap-1";
166
170
  break;
167
171
  }
168
- </script>
169
-
170
- <div class="{userClass} flex flex-row {gap} flex-wrap mr-1 sm:mr-0">
171
- {#each tagsTable as tag}
172
- {#if isEditable}
173
- <Tag name={tag.label} color={tag.color} {s}
174
- onRemove={(e) => {onRemoveTag(tag.label)}}/>
175
- {:else}
176
- <Tag name={tag.label} color={tag.color} {s}/>
177
- {/if}
178
- {/each}
179
-
180
- {#if isEditable}
181
- {#if !addComboVisible}
182
- {#if !compact}
183
- <button class="mt-1 pl-0 pr-1 rounded text-stone-500 flex flex-row border-stone-500 border hover:cursor-pointer"
184
- on:click={(e) => { show(e, undefined)} }>
185
- <div class="ml-1 mt-1 w-3 h-3"><FaPlus/></div>
186
- </button>
187
- {/if}
188
- {:else}
189
- <Combo compact={true}
190
- inContext='data'
191
- onSelect={onSelectTag}
192
- onNewItemCreated={onNewTagCreated}
193
- s={s}
194
- filtered
195
- bind:this={addCombo}>
196
- {@const not_used_tags = getNotUsedTags()}
197
- {#each not_used_tags as tag}
198
- <ComboItem key={tag.label}/>
199
- {/each}
200
- </Combo>
201
- {/if}
202
- {/if}
172
+ </script>
173
+
174
+ <div class="{userClass} flex flex-row {gap} flex-wrap mr-1 sm:mr-0">
175
+ {#each tagsTable as tag}
176
+ {#if isEditable}
177
+ <Tag name={tag.label} color={tag.color} {s}
178
+ onRemove={(e) => {onRemoveTag(tag.label)}}/>
179
+ {:else}
180
+ <Tag name={tag.label} color={tag.color} {s}/>
181
+ {/if}
182
+ {/each}
183
+
184
+ {#if isEditable}
185
+ {#if !addComboVisible}
186
+ {#if !compact}
187
+ <button class="mt-1 pl-0 pr-1 rounded text-stone-500 flex flex-row border-stone-500 border hover:cursor-pointer"
188
+ on:click={(e) => { show(e, undefined)} }>
189
+ <div class="ml-1 mt-1 w-3 h-3"><FaPlus/></div>
190
+ </button>
191
+ {/if}
192
+ {:else}
193
+ <Combo compact={true}
194
+ inContext='data'
195
+ onSelect={onSelectTag}
196
+ onNewItemCreated={onNewTagCreated}
197
+ s={s}
198
+ filtered
199
+ bind:this={addCombo}>
200
+ {@const not_used_tags = getNotUsedTags()}
201
+ {#each not_used_tags as tag}
202
+ <ComboItem key={tag.label}/>
203
+ {/each}
204
+ </Combo>
205
+ {/if}
206
+ {/if}
203
207
  </div>
@@ -3,7 +3,7 @@ declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
5
  tags?: string | undefined;
6
- globalTags?: string | undefined;
6
+ getGlobalTags: Function;
7
7
  self?: null | undefined;
8
8
  a?: string | undefined;
9
9
  context?: string | undefined;
package/desk.svelte CHANGED
@@ -118,9 +118,9 @@
118
118
  content_top = 'top-[50px] sm:top-[40px]'
119
119
 
120
120
  if(bottom_bar_visible)
121
- content_height = `h-[calc(100vh-290px)] sm:h-[calc(100vh-280px)]`
121
+ content_height = `min-h-[calc(100vh-290px)] sm:min-h-[calc(100vh-280px)]`
122
122
  else
123
- content_height = `h-[calc(100vh-50px)] sm:h-[calc(100vh-40px)]`
123
+ content_height = `min-h-[calc(100vh-50px)] sm:min-h-[calc(100vh-40px)]`
124
124
 
125
125
  }
126
126
  else
@@ -128,9 +128,9 @@
128
128
  tools_visibility = "hidden"
129
129
  content_top = `top-[50px] sm:top-0`
130
130
  if(bottom_bar_visible)
131
- content_height = `h-[calc(100vh-290px)] sm:h-[calc(100vh-240px)]`
131
+ content_height = `min-h-[calc(100vh-290px)] sm:min-h-[calc(100vh-240px)]`
132
132
  else
133
- content_height = `h-[calc(100vh-50px)] sm:h-screen`
133
+ content_height = `min-h-[calc(100vh-50px)] sm:min-h-screen`
134
134
  }
135
135
 
136
136
 
@@ -161,11 +161,11 @@
161
161
  on:click={handleSelect}
162
162
  on:contextmenu={handleSelect}>
163
163
 
164
- <div class="bg-white dark:bg-stone-900 dark:text-white min-h-screen h-screen">
164
+ <div class="bg-white dark:bg-stone-900 dark:text-white min-h-screen">
165
165
  <!--###########################################################-->
166
166
  <!--## HORIZONTAL TOOLBAR (FOR PHONES) ######################-->
167
167
  <!--###########################################################-->
168
- <header class="fixed sm:hidden w-screen top-0 h-[50px] sm:h-[40px] z-20 overflow-auto shadow shadow-stone-900/5 dark:shadow-none" >
168
+ <header class="fixed sm:hidden w-screen top-0 h-[50px] sm:h-[40px] z-20 shadow shadow-stone-900/5 dark:shadow-none overflow-auto" >
169
169
  <div class=" flex flex-row justify-between h-full bg-stone-950 text-stone-100 ">
170
170
  <HorizontalToolbar appConfig={layout}/>
171
171
  <div>
@@ -230,7 +230,8 @@
230
230
  <!--#######################################################-->
231
231
  <!--## CONTENT ##################-->
232
232
  <!--#######################################################-->
233
- <div class="fixed left-0 w-screen
233
+ <!-- fixed => relative, content-height => min content height -- -->
234
+ <div class="relative left-0 w-screen
234
235
  sm:left-[40px] sm:w-[calc(100vw-40px)]
235
236
  {content_top}
236
237
  {content_height}
package/modal.svelte CHANGED
@@ -70,9 +70,9 @@ function on_cancel(event) {
70
70
  From: "opacity-100 translate-y-0 sm:scale-100"
71
71
  To: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
72
72
  -->
73
- <div class=" transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all
73
+ <div class=" transform overflow-hidden rounded-lg bg-white dark:bg-stone-700 text-left shadow-xl transition-all
74
74
  sm:my-8 w-full sm:max-w-lg">
75
- <div class="bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4">
75
+ <div class="bg-white dark:bg-stone-700 px-4 pb-4 pt-5 sm:p-6 sm:pb-4">
76
76
  <div class="sm:flex sm:items-start">
77
77
  <div class="mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-blue-100 sm:mx-0 sm:h-10 sm:w-10">
78
78
  {#if icon}
@@ -80,7 +80,7 @@ function on_cancel(event) {
80
80
  {/if}
81
81
  </div>
82
82
  <div class="grow mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left">
83
- <h3 class="text-base font-semibold leading-6 text-stone-900" id="modal-title">{title}</h3>
83
+ <h3 class="text-base font-semibold leading-6 text-stone-900 dark:text-stone-100" id="modal-title">{title}</h3>
84
84
  <div class="mt-2">
85
85
  {#if content}
86
86
  <p class="text-sm text-stone-500">{content}</p>
@@ -91,16 +91,16 @@ function on_cancel(event) {
91
91
  </div>
92
92
  </div>
93
93
  </div>
94
- <div class="bg-stone-50 px-4 py-3 sm:flex sm:flex-row-reverse sm:px-6">
94
+ <div class="bg-stone-50 dark:bg-stone-700 px-4 py-3 sm:flex sm:flex-row-reverse sm:px-6">
95
95
  {#if mode == OK}
96
- <button type="button" class="inline-flex w-full justify-center rounded-md bg-blue-700 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-800 sm:ml-3 sm:w-auto"
96
+ <button type="button" class="inline-flex w-full justify-center rounded-md bg-blue-700 dark:bg-blue-700 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-800 sm:ml-3 sm:w-auto"
97
97
  on:click={on_ok}>
98
98
  {okCaption}</button>
99
99
  {:else if mode == OKCancel}
100
- <button type="button" class="inline-flex w-full justify-center rounded-md bg-blue-700 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-800 sm:ml-3 sm:w-auto"
100
+ <button type="button" class="inline-flex w-full justify-center rounded-md bg-blue-700 dark:bg-blue-700 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-800 sm:ml-3 sm:w-auto"
101
101
  on:click={on_ok}>
102
102
  {okCaption}</button>
103
- <button type="button" class="mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-stone-900 shadow-sm ring-1 ring-inset ring-stone-300 hover:bg-stone-50 sm:mt-0 sm:w-auto"
103
+ <button type="button" class="mt-3 inline-flex w-full justify-center rounded-md bg-white dark:bg-stone-400 px-3 py-2 text-sm font-semibold text-stone-900 shadow-sm hover:bg-stone-50 sm:mt-0 sm:w-auto"
104
104
  on:click={on_cancel}>
105
105
  {cancelCaption}</button>
106
106
  {:else if mode == Custom}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humandialog/forms.svelte",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "Basic Svelte UI components for Object Reef applications",
5
5
  "devDependencies": {
6
6
  "@playwright/test": "^1.28.1",
@@ -53,6 +53,7 @@
53
53
  {
54
54
  reef_users.push(
55
55
  {
56
+ Id: new_reef_user_id++,
56
57
  [nameAttrib]: u[nameAttrib],
57
58
  [emailAttrib]: u[emailAttrib],
58
59
  [refAttrib]: u[refAttrib],
@@ -63,8 +64,7 @@
63
64
  avatar_url : "",
64
65
  invitation_not_accepted: false,
65
66
  removed: false,
66
- membership_tag: "",
67
- __hd_internal_item_id: new_reef_user_id++
67
+ membership_tag: ""
68
68
  }
69
69
  )
70
70
  })
@@ -90,9 +90,9 @@
90
90
  handled_no++;
91
91
  if(handled_no == reef_users.length)
92
92
  {
93
+ //console.log('reload', reef_users)
93
94
 
94
-
95
- list?.updateObjects(reef_users);
95
+ list?.reload(reef_users);
96
96
  }
97
97
  } )
98
98
  }
@@ -114,7 +114,7 @@
114
114
  else
115
115
  user.membership_tag = "";
116
116
 
117
- user.__hd_internal_item_id = new_reef_user_id++;
117
+ user.Id = new_reef_user_id++;
118
118
  }
119
119
 
120
120
  /*onMount(
@@ -362,10 +362,10 @@
362
362
  {
363
363
  reef_users.push(
364
364
  {
365
+ Id: 1000+i,
365
366
  [nameAttrib]: names[i],
366
367
  [emailAttrib]: 'u@fake.com',
367
- [refAttrib]: `./User/${1000+i}`,
368
- __hd_internal_item_id: 1000+i
368
+ [refAttrib]: `./User/${1000+i}`
369
369
  }
370
370
  )
371
371
  }
@@ -402,7 +402,7 @@
402
402
  set_user_info(new_reef_user, details);
403
403
 
404
404
  reef_users = [...reef_users, new_reef_user]
405
- list?.updateObjects(reef_users);
405
+ list?.reload(reef_users);
406
406
  }
407
407
 
408
408
 
@@ -424,7 +424,7 @@
424
424
  </script>
425
425
 
426
426
  <Page self={data_item}
427
- cl="!bg-white dark:!bg-stone-900 w-full h-full flex flex-col overflow-y-auto overflow-x-hidden py-1 px-1 border-0"
427
+ cl="!bg-white dark:!bg-stone-900 w-full flex flex-col overflow-x-hidden py-1 px-1 border-0"
428
428
  toolbarOperations={page_operations}
429
429
  clearsContext='props sel'>
430
430
  <!--a href="/" class="underline text-sm font-semibold ml-3"> &lt; Back to root</a-->
@@ -434,7 +434,6 @@
434
434
  title='Members'
435
435
  toolbarOperations={user_operations}
436
436
  contextMenu={user_context_menu}
437
- key='__hd_internal_item_id'
438
437
  bind:this={list}>
439
438
  <ListTitle a={nameAttrib} onChange={on_name_changed}/>
440
439
  <ListSummary a={emailAttrib} readonly/>
@@ -487,7 +486,7 @@
487
486
  <div class="flex flex-row items-center">
488
487
  <span class="">Maintainer</span>
489
488
  <Icon id="b1" size={4} component={FaInfoCircle} class="text-stone-400 ml-5 pt-0 mt-1"/>
490
- <Popover class="w-64 text-sm font-light " title="Maintainer" triggeredBy="#b1">
489
+ <Popover class="w-64 text-sm font-light" title="Maintainer" triggeredBy="#b1" color="dropdown">
491
490
  Means that the invited user will be able to add and remove others and manage permissions in this organization.
492
491
  </Popover>
493
492
  </div>