@humandialog/forms.svelte 1.3.17 → 1.4.1

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 (43) hide show
  1. package/components/Fab.svelte +99 -48
  2. package/components/combo/combo.svelte +18 -15
  3. package/components/combo/combo.svelte.d.ts +1 -0
  4. package/components/contextmenu.svelte +54 -16
  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 +22 -0
  13. package/components/kanban/internal/kanban.card.svelte +2 -2
  14. package/components/kanban/internal/kanban.props.svelte +1 -1
  15. package/components/list/List.d.ts +6 -0
  16. package/components/list/List.js +6 -0
  17. package/components/list/internal/list.element.props.svelte +23 -8
  18. package/components/list/internal/list.element.svelte +20 -8
  19. package/components/list/list.combo.svelte +6 -0
  20. package/components/list/list.combo.svelte.d.ts +3 -0
  21. package/components/list/list.date.svelte +8 -0
  22. package/components/list/list.date.svelte.d.ts +4 -0
  23. package/components/list/list.static.svelte +6 -0
  24. package/components/list/list.static.svelte.d.ts +3 -0
  25. package/components/list/list.tags.svelte +32 -0
  26. package/components/list/list.tags.svelte.d.ts +24 -0
  27. package/components/menu.js +4 -0
  28. package/components/sidebar/sidebar.item.svelte +15 -11
  29. package/components/tags.svelte +15 -7
  30. package/components/tags.svelte.d.ts +2 -0
  31. package/desk.svelte +5 -5
  32. package/horizontal.toolbar.svelte +41 -14
  33. package/horizontal.toolbar.svelte.d.ts +6 -2
  34. package/index.d.ts +8 -2
  35. package/index.js +8 -2
  36. package/operations.svelte +71 -19
  37. package/package.json +4 -2
  38. package/stores.d.ts +3 -0
  39. package/stores.js +25 -2
  40. package/tenant.members.svelte +63 -59
  41. package/tenant.members.svelte.d.ts +2 -0
  42. package/vertical.toolbar.svelte +51 -23
  43. package/vertical.toolbar.svelte.d.ts +6 -2
@@ -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 {};
@@ -39,6 +39,8 @@ afterUpdate(
39
39
  visible && paletteElement
40
40
  ) {
41
41
  let layoutRoot = document.getElementById("__hd_svelte_layout_root");
42
+ if (!layoutRoot)
43
+ layoutRoot = document.getElementById("app");
42
44
  if (!!layoutRoot && paletteElement.parentElement != layoutRoot) {
43
45
  await tick();
44
46
  layoutRoot.appendChild(paletteElement);
@@ -98,6 +100,26 @@ export function filter(key) {
98
100
  else
99
101
  return true;
100
102
  });
103
+ let lastSeparatorIdx = -1;
104
+ let commandsNo = filtered_commands.length;
105
+ for (let i = 0; i < commandsNo; i++) {
106
+ if (filtered_commands[i].separator == true) {
107
+ if (i == 0) {
108
+ filtered_commands.splice(i, 1);
109
+ commandsNo--;
110
+ i--;
111
+ } else if (lastSeparatorIdx < 0)
112
+ lastSeparatorIdx = i;
113
+ else if (lastSeparatorIdx == i - 1) {
114
+ filtered_commands.splice(i, 1);
115
+ commandsNo--;
116
+ i--;
117
+ } else
118
+ lastSeparatorIdx = i;
119
+ }
120
+ }
121
+ if (filtered_commands[commandsNo - 1].separator == true)
122
+ filtered_commands.splice(commandsNo - 1, 1);
101
123
  if (!current_command || filtered_commands.every((v) => v != current_command)) {
102
124
  if (filtered_commands.length)
103
125
  current_command = get_operation_or_next_valid(0);
@@ -263,7 +263,7 @@ function showAttachementIcon() {
263
263
  {#if isCardActive}
264
264
  <p class=" text-sm sm:text-sm
265
265
 
266
- text-stone-400
266
+ text-stone-600 dark:text-stone-400
267
267
 
268
268
  overflow-hidden"
269
269
  use:editable={{
@@ -277,7 +277,7 @@ function showAttachementIcon() {
277
277
  {:else}
278
278
  <p class=" text-sm sm:text-sm
279
279
 
280
- text-stone-400
280
+ text-stone-600 dark:text-stone-400
281
281
 
282
282
  overflow-hidden">
283
283
  {item[definition.summaryAttrib]}
@@ -118,7 +118,7 @@ async function editTags(field, propIdx) {
118
118
  class=" h-6
119
119
  text-sm sm:min-h-[1rem]
120
120
  text-base-sm min-h-[1.5rem]
121
- text-stone-400
121
+ text-stone-600 dark:text-stone-400
122
122
  text-right"
123
123
  bind:this={propElements[idx]}>
124
124
  {item[prop.a]}
@@ -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;
@@ -253,11 +252,10 @@ export function scrollToView() {
253
252
  {#if item}
254
253
  {@const element_title = item[title]}
255
254
 
256
- <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}
255
+ <section class="my-1 flex flex-row w-full text-stone-900 dark:text-stone-300 cursor-default rounded-md border border-transparent {selected_class} {focused_class} scroll-mt-[50px] sm:scroll-mt-[40px]"
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
 
@@ -334,7 +332,7 @@ export function scrollToView() {
334
332
  {#if is_row_active}
335
333
  <p id={element_id}
336
334
  class=" text-sm
337
- text-stone-400"
335
+ text-stone-600 dark:text-stone-400"
338
336
  use:editable={{
339
337
  action: (text) => {change_summary(text)},
340
338
  readonly: definition.summary_readonly,
@@ -346,7 +344,7 @@ export function scrollToView() {
346
344
  {:else}
347
345
  <p id={element_id}
348
346
  class=" text-sm
349
- text-stone-400"
347
+ text-stone-600 dark:text-stone-400"
350
348
  on:click={(e) => on_active_row_clicked(e, 'bottom')}>
351
349
  {item[summary]}
352
350
  </p>
@@ -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 {};
@@ -7,6 +7,8 @@ export function showMenu(around, operations) {
7
7
  let menu_element = document.getElementById("__hd_svelte_contextmenu");
8
8
  if (!menu_element) {
9
9
  let app_div = document.getElementById("__hd_svelte_layout_root");
10
+ if (!app_div)
11
+ app_div = document.getElementById("app");
10
12
  menu_comopnent = new Menu({
11
13
  target: app_div,
12
14
  props: {}
@@ -32,6 +34,8 @@ export function showFloatingToolbar(around, toolbar, props = {}) {
32
34
  let floating_container = document.getElementById("__hd_svelte_floating_container");
33
35
  if (!floating_container) {
34
36
  let app_div = document.getElementById("__hd_svelte_layout_root");
37
+ if (!app_div)
38
+ app_div = document.getElementById("app");
35
39
  toolbar_component = new Floating_container({
36
40
  target: app_div,
37
41
  props: {}
@@ -1,7 +1,7 @@
1
1
  <script>import { getContext, tick } from "svelte";
2
2
  import Icon from "../icon.svelte";
3
3
  import { contextItemsStore, auto_hide_sidebar, contextToolbarOperations } from "../../stores";
4
- import { FaBars, FaEllipsisH } from "svelte-icons/fa";
4
+ import { FaBars, FaEllipsisV } from "svelte-icons/fa";
5
5
  import { link, push } from "svelte-spa-router";
6
6
  import {
7
7
  selectable as _selectable,
@@ -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;
@@ -179,9 +184,9 @@ function activateRow(e) {
179
184
  caption: "View",
180
185
  operations: [
181
186
  {
182
- icon: FaEllipsisH,
187
+ icon: FaEllipsisV,
183
188
  menu: operationsList,
184
- fab: "M10"
189
+ fab: "M00"
185
190
  }
186
191
  ]
187
192
  }
@@ -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}>