@humandialog/forms.svelte 1.3.17 → 1.4.0

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.
Files changed (36) hide show
  1. package/components/Fab.svelte +77 -46
  2. package/components/combo/combo.svelte +18 -15
  3. package/components/combo/combo.svelte.d.ts +1 -0
  4. package/components/contextmenu.svelte +25 -6
  5. package/components/date.svelte +10 -4
  6. package/components/date.svelte.d.ts +1 -0
  7. package/components/date_utils.d.ts +1 -0
  8. package/components/date_utils.js +10 -0
  9. package/components/delayed.spinner.svelte +1 -2
  10. package/components/document/editor.svelte +419 -46
  11. package/components/document/editor.svelte.d.ts +115 -0
  12. package/components/document/internal/palette.svelte +20 -0
  13. package/components/list/List.d.ts +6 -0
  14. package/components/list/List.js +6 -0
  15. package/components/list/internal/list.element.props.svelte +23 -8
  16. package/components/list/internal/list.element.svelte +17 -5
  17. package/components/list/list.combo.svelte +6 -0
  18. package/components/list/list.combo.svelte.d.ts +3 -0
  19. package/components/list/list.date.svelte +8 -0
  20. package/components/list/list.date.svelte.d.ts +4 -0
  21. package/components/list/list.static.svelte +6 -0
  22. package/components/list/list.static.svelte.d.ts +3 -0
  23. package/components/list/list.tags.svelte +32 -0
  24. package/components/list/list.tags.svelte.d.ts +24 -0
  25. package/components/sidebar/sidebar.item.svelte +12 -8
  26. package/components/tags.svelte +15 -7
  27. package/components/tags.svelte.d.ts +2 -0
  28. package/desk.svelte +5 -5
  29. package/index.d.ts +7 -2
  30. package/index.js +7 -2
  31. package/operations.svelte +61 -12
  32. package/package.json +4 -2
  33. package/stores.d.ts +3 -0
  34. package/stores.js +25 -2
  35. package/tenant.members.svelte +61 -59
  36. package/tenant.members.svelte.d.ts +2 -0
@@ -16,9 +16,69 @@ declare const __propDef: {
16
16
  onRemoveImage?: undefined;
17
17
  c?: string | undefined;
18
18
  pushChangesImmediately?: boolean | undefined;
19
+ chat?: object | undefined;
20
+ readOnly?: boolean | undefined;
21
+ extraFrontPaletteCommands?: any[] | undefined;
22
+ extraBackPaletteCommands?: any[] | undefined;
23
+ extraInsertPaletteCommands?: any[] | undefined;
19
24
  run?: ((onStop?: undefined) => void) | undefined;
20
25
  getFormattingOperations?: ((withCaptions?: boolean) => any[]) | undefined;
26
+ getMarksOperations?: ((tbr?: string) => {
27
+ caption: string;
28
+ operations: any[];
29
+ preAction: (f: any) => void;
30
+ tbr: string;
31
+ }) | undefined;
32
+ getStylesOperations?: ((tbr?: string) => {
33
+ caption: string;
34
+ operations: any[];
35
+ preAction: (f: any) => void;
36
+ tbr: string;
37
+ }) | undefined;
38
+ getInsertOperations?: ((tbr?: string) => {
39
+ caption: string;
40
+ operations: any[];
41
+ preAction: (f: any) => void;
42
+ tbr: string;
43
+ }) | undefined;
44
+ scrollIntoView?: ((param: any) => void) | undefined;
21
45
  save?: (() => void) | undefined;
46
+ addTemporaryImage?: ((src: any) => void) | undefined;
47
+ replaceTemporaryImage?: ((temporarySrc: any, dataPath: any) => void) | undefined;
48
+ removeTemporaryImage?: ((temporarySrc: any) => void) | undefined;
49
+ getInnerHtml?: (() => any) | undefined;
50
+ setInnerHtml?: ((content: any) => void) | undefined;
51
+ setBold?: (() => void) | undefined;
52
+ setItalic?: (() => void) | undefined;
53
+ setUnderline?: (() => void) | undefined;
54
+ setStrikethrough?: (() => void) | undefined;
55
+ setNormal?: (() => void) | undefined;
56
+ setHeading?: ((level: any) => void) | undefined;
57
+ setCode?: (() => void) | undefined;
58
+ setComment?: (() => void) | undefined;
59
+ setQuote?: (() => void) | undefined;
60
+ setWarning?: (() => void) | undefined;
61
+ setInfo?: (() => void) | undefined;
62
+ setBulletList?: (() => void) | undefined;
63
+ setImage?: (() => void) | undefined;
64
+ setTable?: (() => void) | undefined;
65
+ setHorizontalRule?: (() => void) | undefined;
66
+ isActiveBold?: (() => any) | undefined;
67
+ isActiveItalic?: (() => any) | undefined;
68
+ isActiveUnderlie?: (() => any) | undefined;
69
+ isActiveStrikethrough?: (() => any) | undefined;
70
+ isActiveNormal?: (() => any) | undefined;
71
+ isActiveHeading?: ((level: any) => any) | undefined;
72
+ isActiveCode?: (() => any) | undefined;
73
+ isActiveComment?: (() => any) | undefined;
74
+ isActiveQuote?: (() => any) | undefined;
75
+ isActiveWarning?: (() => any) | undefined;
76
+ isActiveInfo?: (() => any) | undefined;
77
+ isActiveBulletList?: (() => any) | undefined;
78
+ isActiveImage?: (() => boolean) | undefined;
79
+ isActiveTable?: (() => void) | undefined;
80
+ isActiveHorizontalRule?: (() => boolean) | undefined;
81
+ preventBlur?: (() => void) | undefined;
22
82
  };
23
83
  events: {
24
84
  [evt: string]: CustomEvent<any>;
@@ -31,6 +91,61 @@ export type EditorSlots = typeof __propDef.slots;
31
91
  export default class Editor extends SvelteComponentTyped<EditorProps, EditorEvents, EditorSlots> {
32
92
  get run(): (onStop?: undefined) => void;
33
93
  get getFormattingOperations(): (withCaptions?: boolean) => any[];
94
+ get getMarksOperations(): (tbr?: string) => {
95
+ caption: string;
96
+ operations: any[];
97
+ preAction: (f: any) => void;
98
+ tbr: string;
99
+ };
100
+ get getStylesOperations(): (tbr?: string) => {
101
+ caption: string;
102
+ operations: any[];
103
+ preAction: (f: any) => void;
104
+ tbr: string;
105
+ };
106
+ get getInsertOperations(): (tbr?: string) => {
107
+ caption: string;
108
+ operations: any[];
109
+ preAction: (f: any) => void;
110
+ tbr: string;
111
+ };
112
+ get scrollIntoView(): (param: any) => void;
34
113
  get save(): () => void;
114
+ get addTemporaryImage(): (src: any) => void;
115
+ get replaceTemporaryImage(): (temporarySrc: any, dataPath: any) => void;
116
+ get removeTemporaryImage(): (temporarySrc: any) => void;
117
+ get getInnerHtml(): () => any;
118
+ get setInnerHtml(): (content: any) => void;
119
+ get setBold(): () => void;
120
+ get setItalic(): () => void;
121
+ get setUnderline(): () => void;
122
+ get setStrikethrough(): () => void;
123
+ get setNormal(): () => void;
124
+ get setHeading(): (level: any) => void;
125
+ get setCode(): () => void;
126
+ get setComment(): () => void;
127
+ get setQuote(): () => void;
128
+ get setWarning(): () => void;
129
+ get setInfo(): () => void;
130
+ get setBulletList(): () => void;
131
+ get setImage(): () => void;
132
+ get setTable(): () => void;
133
+ get setHorizontalRule(): () => void;
134
+ get isActiveBold(): () => any;
135
+ get isActiveItalic(): () => any;
136
+ get isActiveUnderlie(): () => any;
137
+ get isActiveStrikethrough(): () => any;
138
+ get isActiveNormal(): () => any;
139
+ get isActiveHeading(): (level: any) => any;
140
+ get isActiveCode(): () => any;
141
+ get isActiveComment(): () => any;
142
+ get isActiveQuote(): () => any;
143
+ get isActiveWarning(): () => any;
144
+ get isActiveInfo(): () => any;
145
+ get isActiveBulletList(): () => any;
146
+ get isActiveImage(): () => boolean;
147
+ get isActiveTable(): () => void;
148
+ get isActiveHorizontalRule(): () => boolean;
149
+ get preventBlur(): () => void;
35
150
  }
36
151
  export {};
@@ -98,6 +98,26 @@ export function filter(key) {
98
98
  else
99
99
  return true;
100
100
  });
101
+ let lastSeparatorIdx = -1;
102
+ let commandsNo = filtered_commands.length;
103
+ for (let i = 0; i < commandsNo; i++) {
104
+ if (filtered_commands[i].separator == true) {
105
+ if (i == 0) {
106
+ filtered_commands.splice(i, 1);
107
+ commandsNo--;
108
+ i--;
109
+ } else if (lastSeparatorIdx < 0)
110
+ lastSeparatorIdx = i;
111
+ else if (lastSeparatorIdx == i - 1) {
112
+ filtered_commands.splice(i, 1);
113
+ commandsNo--;
114
+ i--;
115
+ } else
116
+ lastSeparatorIdx = i;
117
+ }
118
+ }
119
+ if (filtered_commands[commandsNo - 1].separator == true)
120
+ filtered_commands.splice(commandsNo - 1, 1);
101
121
  if (!current_command || filtered_commands.every((v) => v != current_command)) {
102
122
  if (filtered_commands.length)
103
123
  current_command = get_operation_or_next_valid(0);
@@ -14,6 +14,11 @@ export declare class rList_property {
14
14
  a: string;
15
15
  onSelect: Function | undefined;
16
16
  position: number | string | undefined;
17
+ readOnly: boolean;
18
+ detailed: boolean;
19
+ prefix: string;
20
+ postfix: string;
21
+ getter: Function | undefined;
17
22
  }
18
23
  export declare class rList_property_combo extends rList_property {
19
24
  constructor();
@@ -44,4 +49,5 @@ export declare class rList_definition {
44
49
  inserter_icon: boolean;
45
50
  onOpen: Function | undefined;
46
51
  properties: rList_property[];
52
+ tags: rList_property_tags | null;
47
53
  }
@@ -17,6 +17,11 @@ export class rList_property {
17
17
  a = '';
18
18
  onSelect = undefined;
19
19
  position = undefined;
20
+ readOnly = false;
21
+ detailed = false;
22
+ prefix = '';
23
+ postfix = '';
24
+ getter = undefined;
20
25
  }
21
26
  export class rList_property_combo extends rList_property {
22
27
  constructor() {
@@ -52,4 +57,5 @@ export class rList_definition {
52
57
  inserter_icon = false;
53
58
  onOpen = undefined;
54
59
  properties = [];
60
+ tags = null;
55
61
  }
@@ -70,10 +70,11 @@ async function edit_date(field, prop_idx) {
70
70
 
71
71
  <div class="text-base grid-{definition.properties.length}">
72
72
  {#each definition.properties as prop, prop_index}
73
- <p class="col-span-1 w-full mr-auto mt-0.5">
74
- {#if item[prop.a] || placeholder == prop.name}
75
- <span role="gridcell" tabindex="0">
73
+ <div class="col-span-1 w-full mr-auto mt-0.5">
74
+ {#if item[prop.a] || placeholder == prop.name || prop.getter}
75
+ <div role="gridcell" tabindex="0">
76
76
  {#if prop.type == rList_property_type.Date}
77
+ {@const pickerType = prop.detailed ? 'datetime-local' : 'date'}
77
78
  <DatePicker self={item}
78
79
  a={prop.a}
79
80
  compact={true}
@@ -82,6 +83,8 @@ async function edit_date(field, prop_idx) {
82
83
  inContext="props sel"
83
84
  bind:this={props[prop_index]}
84
85
  changed={(value)=>{on_date_changed(value, prop.a)}}
86
+ readOnly={prop.readOnly}
87
+ type={pickerType}
85
88
  />
86
89
  {:else if prop.type == rList_property_type.Combo}
87
90
  <Combo self={item}
@@ -95,15 +98,27 @@ async function edit_date(field, prop_idx) {
95
98
  bind:this={props[prop_index]}
96
99
  definition={prop.combo_definition}
97
100
  changed={(key,name)=>{on_combo_changed(key, name, prop)}}
101
+ readOnly={prop.readOnly}
98
102
  s="sm"/>
99
103
  {:else if prop.type == rList_property_type.Static}
100
- <span class="dark:text-white text-stone-400 truncate bg-stone-900/10 dark:bg-stone-100/10 rounded-lg">
101
- {item[prop.a]}
102
- </span>
104
+ {@const value = prop.getter ? prop.getter(item) : item[prop.a]}
105
+ <p class="truncate text-sm">
106
+ {#if prop.prefix}
107
+ <span>{prop.prefix}</span>
108
+ {/if}
109
+
110
+ {value}
111
+
112
+ {#if prop.postfix}
113
+ <span>{prop.postfix}</span>
114
+ {/if}
115
+
116
+ </p>
103
117
  {/if}
104
- </span>
118
+
119
+ </div>
105
120
  {/if}
106
- </p>
121
+ </div>
107
122
  {/each}
108
123
  </div>
109
124
 
@@ -17,7 +17,7 @@ import { isDeviceSmallerThan } from "../../../utils";
17
17
  import { rList_definition, rList_property_type } from "../List";
18
18
  import { push } from "svelte-spa-router";
19
19
  import { FaExternalLinkAlt } from "svelte-icons/fa/";
20
- import { readonly } from "svelte/store";
20
+ import Tags from "../../tags.svelte";
21
21
  export let item;
22
22
  export let title = "";
23
23
  export let summary = "";
@@ -74,7 +74,6 @@ function calculate_active(...args) {
74
74
  const activeKey = getItemKey(activeItem);
75
75
  const itemKey = getItemKey(item);
76
76
  if (activeKey == itemKey) {
77
- console.log("active: ", itemKey);
78
77
  return true;
79
78
  } else
80
79
  return false;
@@ -254,10 +253,9 @@ export function scrollToView() {
254
253
  {@const element_title = item[title]}
255
254
 
256
255
  <section class="my-1 flex flex-row w-full text-stone-700 dark:text-stone-300 cursor-default rounded-md border border-transparent {selected_class} {focused_class} scroll-mt-[50px] sm:scroll-mt-[40px]"
257
- on:contextmenu={on_contextmenu}
258
256
  role="menu"
259
257
  tabindex="-1"
260
- bind:this={rootElement}>
258
+ bind:this={rootElement}> <!-- on:contextmenu={on_contextmenu} -->
261
259
 
262
260
  <slot name="left" element={item}/>
263
261
 
@@ -355,7 +353,21 @@ export function scrollToView() {
355
353
 
356
354
  {/if}
357
355
 
358
-
356
+ {#if definition.tags}
357
+ <Tags
358
+ class="mt-1 mb-1"
359
+ compact
360
+ inContext="props"
361
+ self={item}
362
+ a={definition.tags.a}
363
+ getGlobalTags={definition.tags.getAllTags}
364
+ s="sm"
365
+ onSelect={definition.tags.onSelect}
366
+ onUpdateAllTags={definition.tags.onUpdateAllTags}
367
+ canChangeColor={definition.tags.canChangeColor}
368
+ readOnly={definition.tags.readOnly}
369
+ />
370
+ {/if}
359
371
 
360
372
  </div>
361
373
  </section>
@@ -6,6 +6,9 @@ export let a = "";
6
6
  export let onSelect = void 0;
7
7
  export let association = false;
8
8
  export let hasNone = association;
9
+ export let editable = true;
10
+ export let prefix = "";
11
+ export let postfix = "";
9
12
  let definition = getContext("rList-definition");
10
13
  let combo_property = new rList_property_combo();
11
14
  combo_property.name = name;
@@ -15,6 +18,9 @@ if (!combo_property.a)
15
18
  combo_property.onSelect = onSelect;
16
19
  combo_property.association = association;
17
20
  combo_property.hasNone = hasNone;
21
+ combo_property.readOnly = !editable;
22
+ combo_property.prefix = prefix;
23
+ combo_property.postfix = postfix;
18
24
  definition.properties.push(combo_property);
19
25
  setContext("rCombo-definition", combo_property.combo_definition);
20
26
  </script>
@@ -6,6 +6,9 @@ declare const __propDef: {
6
6
  onSelect?: undefined;
7
7
  association?: boolean | undefined;
8
8
  hasNone?: boolean | undefined;
9
+ editable?: boolean | undefined;
10
+ prefix?: string | undefined;
11
+ postfix?: string | undefined;
9
12
  };
10
13
  events: {
11
14
  [evt: string]: CustomEvent<any>;
@@ -3,6 +3,10 @@ import { rList_property_type, rList_property } from "./List";
3
3
  export let name;
4
4
  export let a = "";
5
5
  export let onSelect = void 0;
6
+ export let editable = true;
7
+ export let detailed = false;
8
+ export let prefix = "";
9
+ export let postfix = "";
6
10
  let definition = getContext("rList-definition");
7
11
  let date_property = new rList_property(rList_property_type.Date);
8
12
  date_property.name = name;
@@ -10,5 +14,9 @@ date_property.a = a;
10
14
  if (!date_property.a)
11
15
  date_property.a = date_property.name;
12
16
  date_property.onSelect = onSelect;
17
+ date_property.readOnly = !editable;
18
+ date_property.detailed = detailed;
19
+ date_property.prefix = prefix;
20
+ date_property.postfix = postfix;
13
21
  definition.properties.push(date_property);
14
22
  </script>
@@ -4,6 +4,10 @@ declare const __propDef: {
4
4
  name: string;
5
5
  a?: string | undefined;
6
6
  onSelect?: undefined;
7
+ editable?: boolean | undefined;
8
+ detailed?: boolean | undefined;
9
+ prefix?: string | undefined;
10
+ postfix?: string | undefined;
7
11
  };
8
12
  events: {
9
13
  [evt: string]: CustomEvent<any>;
@@ -2,11 +2,17 @@
2
2
  import { rList_property_type, rList_property } from "./List";
3
3
  export let name;
4
4
  export let a = "";
5
+ export let prefix = "";
6
+ export let postfix = "";
7
+ export let getter = void 0;
5
8
  let definition = getContext("rList-definition");
6
9
  let date_property = new rList_property(rList_property_type.Static);
7
10
  date_property.name = name;
8
11
  date_property.a = a;
9
12
  if (!date_property.a)
10
13
  date_property.a = date_property.name;
14
+ date_property.prefix = prefix;
15
+ date_property.postfix = postfix;
16
+ date_property.getter = getter;
11
17
  definition.properties.push(date_property);
12
18
  </script>
@@ -3,6 +3,9 @@ declare const __propDef: {
3
3
  props: {
4
4
  name: string;
5
5
  a?: string | undefined;
6
+ prefix?: string | undefined;
7
+ postfix?: string | undefined;
8
+ getter?: Function | undefined;
6
9
  };
7
10
  events: {
8
11
  [evt: string]: CustomEvent<any>;
@@ -0,0 +1,32 @@
1
+ <script>import { getContext } from "svelte";
2
+ import { rList_property_tags } from "./List";
3
+ export let name = "";
4
+ export let a = "";
5
+ export let prefix = "";
6
+ export let postfix = "";
7
+ export let readOnly = false;
8
+ export let getAllTags = void 0;
9
+ export let onUpdateAllTags = void 0;
10
+ export let onSelect = void 0;
11
+ export let canChangeColor = false;
12
+ let definition = getContext("rList-definition");
13
+ let tags = new rList_property_tags();
14
+ tags.prefix = prefix;
15
+ tags.postfix = postfix;
16
+ if (!a && name) {
17
+ tags.a = name;
18
+ tags.name = name;
19
+ } else if (!name && a) {
20
+ tags.a = a;
21
+ tags.name = a;
22
+ } else {
23
+ tags.a = a;
24
+ tags.name = name;
25
+ }
26
+ tags.onSelect = onSelect;
27
+ tags.onUpdateAllTags = onUpdateAllTags;
28
+ tags.canChangeColor = canChangeColor;
29
+ tags.getAllTags = getAllTags;
30
+ tags.readOnly = readOnly;
31
+ definition.tags = tags;
32
+ </script>
@@ -0,0 +1,24 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ name?: string | undefined;
5
+ a?: string | undefined;
6
+ prefix?: string | undefined;
7
+ postfix?: string | undefined;
8
+ readOnly?: boolean | undefined;
9
+ getAllTags?: Function | undefined;
10
+ onUpdateAllTags?: Function | undefined;
11
+ onSelect?: Function | undefined;
12
+ canChangeColor?: boolean | undefined;
13
+ };
14
+ events: {
15
+ [evt: string]: CustomEvent<any>;
16
+ };
17
+ slots: {};
18
+ };
19
+ export type ListProps = typeof __propDef.props;
20
+ export type ListEvents = typeof __propDef.events;
21
+ export type ListSlots = typeof __propDef.slots;
22
+ export default class List extends SvelteComponentTyped<ListProps, ListEvents, ListSlots> {
23
+ }
24
+ export {};
@@ -119,17 +119,22 @@ function on_link_clicked(e) {
119
119
  e.preventDefault();
120
120
  if (isOnPage) {
121
121
  if (isRowActive) {
122
- if (href2) {
123
- push(href2);
124
- }
122
+ redirect_to(href2);
125
123
  }
126
124
  } else {
127
125
  auto_hide_sidebar();
128
- if (href2) {
129
- push(href2);
130
- }
126
+ redirect_to(href2);
131
127
  }
132
128
  }
129
+ function redirect_to(href2) {
130
+ if (!href2)
131
+ return;
132
+ let absolute_pattern = /^https?:\/\//i;
133
+ if (!absolute_pattern.test(href2))
134
+ push(href2);
135
+ else
136
+ window.location.href = href2;
137
+ }
133
138
  function on_contextmenu(e) {
134
139
  if (!operations)
135
140
  return;
@@ -200,7 +205,6 @@ function activateRow(e) {
200
205
  <div
201
206
  on:click
202
207
  on:click={activateRow}
203
- on:contextmenu={on_contextmenu}
204
208
  on:keydown
205
209
  on:keyup
206
210
  class=" mb-2
@@ -210,7 +214,7 @@ function activateRow(e) {
210
214
  class:sm:dark:hover:bg-stone-700={!!href}
211
215
  class:bg-stone-200={isRowActive}
212
216
  class:dark:bg-stone-700={isRowActive}
213
- class:selected={selected(selectable, context_data)}>
217
+ class:selected={selected(selectable, context_data)}> <!-- on:contextmenu={on_contextmenu} -->
214
218
  <div class="flex flex-row justify-between
215
219
  text-base font-semibold">
216
220
  {#if href}
@@ -3,7 +3,7 @@ import Tag from "./tag.svelte";
3
3
  import FaPlus from "svelte-icons/fa/FaPlus.svelte";
4
4
  import Combo from "./combo/combo.svelte";
5
5
  import ComboItem from "./combo/combo.item.svelte";
6
- import { contextItemsStore, data_tick_store, contextTypesStore } from "../stores.js";
6
+ import { contextItemsStore, data_tick_store, contextTypesStore, tagsReloader } from "../stores.js";
7
7
  import { informModification, pushChanges } from "../updates.js";
8
8
  export let tags = "";
9
9
  export let getGlobalTags;
@@ -17,6 +17,8 @@ export let canChangeColor = false;
17
17
  export let compact = true;
18
18
  export let inContext = "";
19
19
  export let pushChangesImmediately = true;
20
+ export let allowNewTags = true;
21
+ export let readOnly = false;
20
22
  export let changed = void 0;
21
23
  export let s = "sm";
22
24
  let userClass = $$props.class ?? "";
@@ -24,9 +26,9 @@ let item = null;
24
26
  let ctx = context ? context : getContext("ctx");
25
27
  let tagsTable = [];
26
28
  let globalTagsTable = [];
27
- let isEditable = true;
29
+ let isEditable = !readOnly;
28
30
  $:
29
- setup($data_tick_store, $contextItemsStore);
31
+ setup($data_tick_store, $contextItemsStore, $tagsReloader);
30
32
  function setup(...args) {
31
33
  const globalTags = getGlobalTags();
32
34
  globalTagsTable = decomposeTags(globalTags);
@@ -51,17 +53,17 @@ function setup(...args) {
51
53
  if (compact) {
52
54
  isEditable = false;
53
55
  if (!inContext)
54
- isEditable = true;
56
+ isEditable = !readOnly;
55
57
  else {
56
58
  let contexts = inContext.split(" ");
57
59
  contexts.forEach((ctx2) => {
58
60
  const selectedItem = $contextItemsStore[ctx2];
59
61
  if (selectedItem && selectedItem.Id == item.Id)
60
- isEditable = true;
62
+ isEditable = !readOnly;
61
63
  });
62
64
  }
63
65
  } else
64
- isEditable = true;
66
+ isEditable = !readOnly;
65
67
  }
66
68
  let addComboVisible = false;
67
69
  let addCombo;
@@ -113,6 +115,12 @@ function onNewTagCreated(key, name) {
113
115
  applyChange();
114
116
  onUpdateAllTags(globalTags);
115
117
  }
118
+ function getCreateTagCallback() {
119
+ if (allowNewTags)
120
+ return onNewTagCreated;
121
+ else
122
+ return void 0;
123
+ }
116
124
  function onColorizeTag(name, color) {
117
125
  let globalTags = getGlobalTags();
118
126
  globalTagsTable = decomposeTags(globalTags);
@@ -218,7 +226,7 @@ switch (s) {
218
226
  <Combo compact={true}
219
227
  inContext='data'
220
228
  onSelect={onSelectTag}
221
- onNewItemCreated={onNewTagCreated}
229
+ onNewItemCreated={getCreateTagCallback()}
222
230
  s={s}
223
231
  filtered
224
232
  bind:this={addCombo}>
@@ -14,6 +14,8 @@ declare const __propDef: {
14
14
  compact?: boolean | undefined;
15
15
  inContext?: string | undefined;
16
16
  pushChangesImmediately?: boolean | undefined;
17
+ allowNewTags?: boolean | undefined;
18
+ readOnly?: boolean | undefined;
17
19
  changed?: undefined;
18
20
  s?: string | undefined;
19
21
  show?: ((event: any, hideCallback: any) => Promise<void>) | undefined;
package/desk.svelte CHANGED
@@ -17,7 +17,7 @@
17
17
  set_dark_mode_default,
18
18
  sidebar_left_pos,
19
19
  wholeAppReloader,
20
- alerts } from './stores.js'
20
+ alerts, removeAlert } from './stores.js'
21
21
 
22
22
  //import { AuthorizedView} from '@humandialog/auth.svelte'
23
23
  import { handleSelect, isDeviceSmallerThan, isOnNavigationPage, isOnScreenKeyboardVisible, removeAt, UI } from './utils'
@@ -271,7 +271,7 @@
271
271
 
272
272
  function onSelectionChanged(e)
273
273
  {
274
- console.log('onSelectionChanged')
274
+ //console.log('onSelectionChanged')
275
275
  determineFABVisibilityAsync();
276
276
  }
277
277
 
@@ -459,14 +459,14 @@
459
459
  {#each $alerts as alert, idx}
460
460
  <Alert class="bg-red-900/40 shadow-lg shadow-stone-400 dark:shadow-black flex flex-row">
461
461
  <button class="sm:hidden font-bold ml-auto"
462
- on:click={() => {$alerts = removeAt($alerts, idx)}}>
462
+ on:click={() => {removeAlert(alert)}}>
463
463
  x
464
464
  </button>
465
465
  <p>
466
- {alert}
466
+ {alert.msg}
467
467
  </p>
468
468
  <button class="hidden sm:block font-bold ml-auto"
469
- on:click={() => {$alerts = removeAt($alerts, idx)}}>
469
+ on:click={() => {removeAlert(alert)}}>
470
470
  x
471
471
  </button>
472
472
  </Alert>
package/index.d.ts CHANGED
@@ -39,6 +39,7 @@ export { default as ListInserter } from './components/list/list.inserter.svelte'
39
39
  export { default as ListDateProperty } from './components/list/list.date.svelte';
40
40
  export { default as ListComboProperty } from './components/list/list.combo.svelte';
41
41
  export { default as ListStaticProperty } from './components/list/list.static.svelte';
42
+ export { default as ListTags } from './components/list/list.tags.svelte';
42
43
  export { default as Modal } from './modal.svelte';
43
44
  export { default as MembersPage } from './tenant.members.svelte';
44
45
  export { default as Console } from './console.svelte';
@@ -56,9 +57,13 @@ export { default as KanbanTagsProperty } from './components/kanban/kanban.tags.s
56
57
  export { default as KanbanCallbacks } from './components/kanban/kanban.callbacks.svelte';
57
58
  export { KanbanColumnTop, KanbanColumnBottom } from './components/kanban/Kanban';
58
59
  export { selectItem, activateItem, clearActiveItem, isActive, isSelected, getActive, editable, startEditing, saveCurrentEditable, selectable, handleSelect, isDeviceSmallerThan, resizeImage, refreshToolbarOperations, isOnScreenKeyboardVisible, randomString, UI, } from './utils';
59
- export { getFormattedStringDate, getNiceStringDate, dayName, monthName } from './components/date_utils';
60
- export { mainContentPageReloader, reloadMainContentPage, reloadWholeApp, alerts, addAlert, onErrorShowAlert, main_sidebar_visible_store } from './stores.js';
60
+ export { getNiceStringDateTime, getFormattedStringDate, getNiceStringDate, dayName, monthName } from './components/date_utils';
61
+ export { mainContentPageReloader, reloadMainContentPage, reloadWholeApp, alerts, addAlert, onErrorShowAlert, main_sidebar_visible_store, tagsReloader, reloadVisibleTags } from './stores.js';
61
62
  export { data_tick_store, // tmp
62
63
  hasSelectedItem, hasDataItem, setNavigatorTitle } from "./stores";
63
64
  export { contextToolbarOperations, pageToolbarOperations, contextItemsStore, contextTypesStore } from './stores';
64
65
  export { informModification, informModificationEx, informItem, pushChanges } from './updates';
66
+ export { default as IcH1 } from './components/document/internal/h1.icon.svelte';
67
+ export { default as IcH2 } from './components/document/internal/h2.icon.svelte';
68
+ export { default as IcH3 } from './components/document/internal/h3.icon.svelte';
69
+ export { default as IcH4 } from './components/document/internal/h4.icon.svelte';