@humandialog/forms.svelte 1.8.10 → 1.8.12

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 (47) hide show
  1. package/components/Floating_container.svelte +30 -23
  2. package/components/combo/combo.svelte +9 -6
  3. package/components/contextmenu.container.svelte +39 -0
  4. package/components/contextmenu.container.svelte.d.ts +21 -0
  5. package/components/contextmenu.svelte +126 -165
  6. package/components/kanban/Kanban.d.ts +1 -0
  7. package/components/kanban/Kanban.js +1 -0
  8. package/components/kanban/internal/kanban.column.svelte +19 -10
  9. package/components/kanban/internal/kanban.column.svelte.d.ts +2 -0
  10. package/components/kanban/kanban.column.svelte +2 -0
  11. package/components/kanban/kanban.column.svelte.d.ts +1 -0
  12. package/components/kanban/kanban.svelte +20 -16
  13. package/components/list/internal/list.element.properties.svelte +76 -4
  14. package/components/list/internal/list.element.svelte +35 -24
  15. package/components/menu.js +1 -1
  16. package/components/r.editable.svelte +10 -4
  17. package/components/r.editable.svelte.d.ts +2 -0
  18. package/components/r.icon.svelte +20 -1
  19. package/components/ricons/bell-off.svelte +13 -0
  20. package/components/ricons/bell-off.svelte.d.ts +27 -0
  21. package/components/ricons/bell.svelte +13 -0
  22. package/components/ricons/bell.svelte.d.ts +27 -0
  23. package/components/ricons/external-link.svelte +21 -0
  24. package/components/ricons/external-link.svelte.d.ts +27 -0
  25. package/components/ricons/eye-off.svelte +13 -0
  26. package/components/ricons/eye-off.svelte.d.ts +27 -0
  27. package/components/ricons/eye.svelte +11 -0
  28. package/components/ricons/eye.svelte.d.ts +27 -0
  29. package/components/ricons/settings.svelte +21 -0
  30. package/components/ricons/settings.svelte.d.ts +27 -0
  31. package/components/ricons/toggle-left.svelte +19 -0
  32. package/components/ricons/toggle-left.svelte.d.ts +27 -0
  33. package/components/ricons/toggle-right.svelte +19 -0
  34. package/components/ricons/toggle-right.svelte.d.ts +27 -0
  35. package/desk.svelte +39 -34
  36. package/horizontal.nav.tabs.svelte +13 -8
  37. package/horizontal.toolbar.svelte +1 -1
  38. package/i18n.js +19 -14
  39. package/index.js +0 -1
  40. package/package.json +11 -1
  41. package/page.svelte +1 -1
  42. package/paper.svelte +8 -9
  43. package/paper.table.svelte +6 -4
  44. package/tenant.members.svelte +54 -49
  45. package/tenant.user.props.svelte +295 -0
  46. package/tenant.user.props.svelte.d.ts +32 -0
  47. package/vertical.toolbar.svelte +13 -9
@@ -43,15 +43,12 @@ export async function show(around, _toolbar, _props = {}) {
43
43
  };
44
44
  props.onSizeChanged = () => onSizeChanged();
45
45
  hide_window_indicator = 0;
46
- window.addEventListener("click", on_before_window_click, true);
47
46
  if (isDeviceSmallerThan("sm"))
48
47
  preventScrollRestorer = usePreventScroll();
49
48
  if (isDeviceSmallerThan("sm")) {
50
49
  $fabHiddenDueToPopup = true;
51
50
  }
52
51
  await tick();
53
- if (!was_visible)
54
- rootElement.addEventListener("click", on_before_container_click, true);
55
52
  cssPosition = calculatePosition(x, y, around_rect, true, false);
56
53
  }
57
54
  export function isVisible() {
@@ -64,8 +61,6 @@ export function hide() {
64
61
  visible = false;
65
62
  toolbar = null;
66
63
  cssPosition = calculatePosition(x, y, around_rect, false, false);
67
- window.removeEventListener("click", on_before_window_click, true);
68
- rootElement?.removeEventListener("click", on_before_container_click, true);
69
64
  if (preventScrollRestorer) {
70
65
  preventScrollRestorer();
71
66
  preventScrollRestorer = null;
@@ -82,7 +77,7 @@ async function onSizeChanged() {
82
77
  cssPosition = calculatePosition(x, y, around_rect, true, false);
83
78
  }
84
79
  let hide_window_indicator = 0;
85
- function on_before_window_click() {
80
+ function on_before_window_click(e) {
86
81
  hide_window_indicator++;
87
82
  setTimeout(() => {
88
83
  if (hide_window_indicator != 0) {
@@ -155,30 +150,42 @@ function calculatePosition(x2, y2, around, visible2, fresh) {
155
150
  }
156
151
  return result;
157
152
  }
153
+ function on_window_click(e) {
154
+ const clickedElement = e.target;
155
+ if (clickedElement.id == "__hd_svelte_floating_container") {
156
+ hide();
157
+ }
158
+ }
158
159
  </script>
159
160
 
161
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
160
162
  <div id="__hd_svelte_floating_container"
161
163
  class=" Floating_container
162
- bg-stone-100 dark:bg-stone-800 rounded-lg shadow-md shadow-stone-500 dark:shadow-black z-40 fixed
164
+ z-40
165
+ fixed inset-0 w-screen overflow-y-auto overscroll-contain
166
+ "
167
+ hidden={!visible}
168
+ on:click={on_window_click}>
169
+ <div class="bg-stone-100 dark:bg-stone-800 rounded-lg shadow-md shadow-stone-500 dark:shadow-black
163
170
  sm:shadow-xl sm:shadow-slate-700/10
164
171
  sm:dark:shadow-black/80
165
- sm:outline sm:outline-1 sm:outline-stone-500"
166
- style={cssPosition}
167
- visible={visible}
168
- bind:this={rootElement}>
169
- {#if closeButtonPos}
170
- <button class=" text-stone-800 dark:text-stone-400
171
- fixed w-6 h-6 flex items-center justify-center
172
- focus:outline-none font-medium text-sm text-center"
173
- style={closeButtonPos}
174
- on:click={ hide }> <!--rounded-full focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800 text-stone-500 bg-stone-200/70 hover:bg-stone-200 dark:text-stone-500 dark:bg-stone-700/80 dark:hover:bg-stone-700 -->
175
- <Icon component={FaTimes} s="md"/>
176
- </button>
177
- {/if}
172
+ sm:outline sm:outline-1 sm:outline-stone-500 fixed"
173
+ style={cssPosition}
174
+ bind:this={rootElement}>
175
+ {#if closeButtonPos}
176
+ <button class=" text-stone-800 dark:text-stone-400
177
+ fixed w-6 h-6 flex items-center justify-center
178
+ focus:outline-none font-medium text-sm text-center"
179
+ style={closeButtonPos}
180
+ on:click={ hide }> <!--rounded-full focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800 text-stone-500 bg-stone-200/70 hover:bg-stone-200 dark:text-stone-500 dark:bg-stone-700/80 dark:hover:bg-stone-700 -->
181
+ <Icon component={FaTimes} s="md"/>
182
+ </button>
183
+ {/if}
178
184
 
179
- {#if toolbar}
180
- <svelte:component this={toolbar} {...props} {maxHeight} bind:this={internalElement} />
181
- {/if}
185
+ {#if toolbar}
186
+ <svelte:component this={toolbar} {...props} {maxHeight} bind:this={internalElement} />
187
+ {/if}
188
+ </div>
182
189
  </div>
183
190
 
184
191
  <!-- use usePreventScroll instead -->
@@ -118,12 +118,15 @@ function setup(...args) {
118
118
  if (readOnly)
119
119
  can_be_activated = false;
120
120
  else if (is_compact) {
121
- can_be_activated = false;
122
- let contexts = inContext.split(" ");
123
- contexts.forEach((ctx2) => {
124
- if ($contextItemsStore[ctx2] == item)
125
- can_be_activated = true;
126
- });
121
+ if (inContext) {
122
+ can_be_activated = false;
123
+ let contexts = inContext.split(" ");
124
+ contexts.forEach((ctx2) => {
125
+ if ($contextItemsStore[ctx2] == item)
126
+ can_be_activated = true;
127
+ });
128
+ } else
129
+ can_be_activated = true;
127
130
  } else
128
131
  can_be_activated = true;
129
132
  }
@@ -0,0 +1,39 @@
1
+ <script>import Menu from "./contextmenu.svelte";
2
+ let visible = false;
3
+ let menu;
4
+ let onOrgHideCallback = void 0;
5
+ export async function show(around, _operations, preference = 0, onHideCallback = void 0) {
6
+ visible = true;
7
+ onOrgHideCallback = onHideCallback;
8
+ menu?.show(around, _operations, preference, onHide);
9
+ }
10
+ export function isVisible() {
11
+ return visible;
12
+ }
13
+ export function hide() {
14
+ visible = false;
15
+ menu?.hide();
16
+ }
17
+ function onHide() {
18
+ if (onOrgHideCallback)
19
+ onOrgHideCallback();
20
+ visible = false;
21
+ }
22
+ function on_window_click(e) {
23
+ const clickedElement = e.target;
24
+ if (clickedElement.id == "__hd_svelte_contextmenu") {
25
+ hide();
26
+ }
27
+ }
28
+ </script>
29
+
30
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
31
+ <div id="__hd_svelte_contextmenu"
32
+ class=" z-40
33
+ fixed inset-0 w-screen overflow-y-auto overscroll-contain"
34
+ hidden={!visible}
35
+ on:click={on_window_click}>
36
+
37
+ <Menu bind:this={menu}/>
38
+
39
+ </div>
@@ -0,0 +1,21 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ show?: ((around: DOMRect | DOMPoint, _operations: any, preference?: number, onHideCallback?: Function | undefined) => Promise<void>) | undefined;
5
+ isVisible?: (() => boolean) | undefined;
6
+ hide?: (() => void) | undefined;
7
+ };
8
+ events: {
9
+ [evt: string]: CustomEvent<any>;
10
+ };
11
+ slots: {};
12
+ };
13
+ export type ContextmenuProps = typeof __propDef.props;
14
+ export type ContextmenuEvents = typeof __propDef.events;
15
+ export type ContextmenuSlots = typeof __propDef.slots;
16
+ export default class Contextmenu extends SvelteComponentTyped<ContextmenuProps, ContextmenuEvents, ContextmenuSlots> {
17
+ get show(): (around: DOMRect | DOMPoint, _operations: any, preference?: number, onHideCallback?: Function | undefined) => Promise<void>;
18
+ get isVisible(): () => boolean;
19
+ get hide(): () => void;
20
+ }
21
+ export {};
@@ -204,7 +204,6 @@ export async function show(around, _operations, preference = 0, onHideCallback =
204
204
  const is_root_menu = owner_menu_item == void 0;
205
205
  if (is_root_menu) {
206
206
  hide_window_indicator = 0;
207
- window.addEventListener("click", on_before_window_click, true);
208
207
  if (isDeviceSmallerThan("sm"))
209
208
  preventScrollRestorer = usePreventScroll();
210
209
  }
@@ -214,7 +213,7 @@ export async function show(around, _operations, preference = 0, onHideCallback =
214
213
  await tick();
215
214
  css_position = calculatePosition(x, y, true, false);
216
215
  if (is_root_menu)
217
- menu_root.addEventListener("click", on_before_container_click, true);
216
+ ;
218
217
  if (menu_items.length && !isDeviceSmallerThan("sm"))
219
218
  focus_menu_item(focused_index);
220
219
  }
@@ -227,8 +226,6 @@ export function hide() {
227
226
  }
228
227
  visible = false;
229
228
  css_position = calculatePosition(x, y, false, false);
230
- window.removeEventListener("click", on_before_window_click, true);
231
- menu_root?.removeEventListener("click", on_before_container_click, true);
232
229
  if (preventScrollRestorer) {
233
230
  preventScrollRestorer();
234
231
  preventScrollRestorer = null;
@@ -417,196 +414,160 @@ function isOperationDisabled(operation) {
417
414
  }
418
415
  </script>
419
416
 
417
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
420
418
 
421
- <div id="__hd_svelte_contextmenu"
422
- class="
423
- bg-stone-100 dark:bg-stone-800 rounded-lg shadow-md shadow-stone-500
419
+ <div class="bg-stone-100 dark:bg-stone-800 rounded-lg shadow-md shadow-stone-500
424
420
  dark:shadow-black z-40 fixed
425
421
  sm:shadow-xl sm:shadow-slate-700/10
426
422
  sm:dark:shadow-black/80
427
423
  sm:outline sm:outline-1 sm:outline-stone-500
428
- z-40 fixed min-w-60 max-h-screen "
424
+ fixed min-w-60 max-h-screen "
425
+ style={css_position}
426
+ bind:this={menu_root}>
427
+ <div class="
428
+ paper w-full sm:w-[24rem]
429
+ prose prose-base prose-zinc dark:prose-invert prose-a:no-underline
430
+ sm:max-w-3xl
429
431
 
430
- style={css_position}
431
- visible={visible}
432
- bind:this={menu_root}>
433
- <div class="
434
- paper w-full sm:w-[24rem]
435
- prose prose-base prose-zinc dark:prose-invert prose-a:no-underline
436
- sm:max-w-3xl
432
+ m-0 pt-3 pb-5 px-2
433
+ sm:rounded
434
+ sm:bg-stone-100 sm:dark:bg-stone-900
435
+ flex flex-col
436
+ ">
437
437
 
438
- m-0 pt-3 pb-5 px-2
439
- sm:rounded
440
- sm:bg-stone-100 sm:dark:bg-stone-900
441
- flex flex-col
442
- ">
438
+ <!-------------------------------------------------------------------->
439
+ <!-- POPUP HEADER ---------------------------------------------------->
440
+ <!-------------------------------------------------------------------->
441
+ {#if closeButtonPos}
442
+ <h3 class = "flex-none">
443
+ <div class="px-2 w-full flex flex-row justify-between">
443
444
 
444
- <!-------------------------------------------------------------------->
445
- <!-- POPUP HEADER ---------------------------------------------------->
446
- <!-------------------------------------------------------------------->
447
- {#if closeButtonPos}
448
- <h3 class = "flex-none">
449
- <div class="px-2 w-full flex flex-row justify-between">
450
-
451
- <div class="grow ">
452
- <span class="px-2 text-left"></span>
453
- </div>
454
- <div class="py-1.5 flex flex-row justify-between">
455
- <button class="ml-4 w-6
456
- hover:bg-stone-200 hover:dark:bg-stone-700
457
- hover:outline hover:outline-8
458
- hover:outline-stone-200 hover:dark:outline-stone-700"
459
- on:click={hide}>
460
- <Ricon icon = 'x' />
461
- </button>
445
+ <div class="grow ">
446
+ <span class="px-2 text-left"></span>
447
+ </div>
448
+ <div class="py-1.5 flex flex-row justify-between">
449
+ <button class="ml-4 w-6
450
+ hover:bg-stone-200 hover:dark:bg-stone-700
451
+ hover:outline hover:outline-8
452
+ hover:outline-stone-200 hover:dark:outline-stone-700"
453
+ on:click={hide}>
454
+ <Ricon icon = 'x' />
455
+ </button>
456
+ </div>
462
457
  </div>
463
- </div>
464
- </h3>
465
- {/if}
458
+ </h3>
459
+ {/if}
466
460
 
467
461
 
468
- <!-------------------------------------------------------------------->
469
- <!-- POPUP CONTENT---------------------------------------------------->
470
- <!-------------------------------------------------------------------->
471
- <div class="px-2 grow max-h-[45dvh] sm:max-h-[75dvh] overflow-y-auto overscroll-contain">
462
+ <!-------------------------------------------------------------------->
463
+ <!-- POPUP CONTENT---------------------------------------------------->
464
+ <!-------------------------------------------------------------------->
465
+ <div class="px-2 grow max-h-[45dvh] sm:max-h-[75dvh] overflow-y-auto overscroll-contain">
472
466
 
473
467
 
474
468
 
475
- {#each operations as operation, index}
469
+ {#each operations as operation, index}
476
470
 
477
- {@const is_separator = operation.separator}
478
- {#if is_separator}
479
- {#if index>0 && index < operations.length-1}
480
- <!--hr class="my-1 mx-4 border-1 border-stone-300 dark:border-stone-700"-->
481
- <hr class="my-4">
482
- {/if}
483
- {:else}
471
+ {@const is_separator = operation.separator}
472
+ {#if is_separator}
473
+ {#if index>0 && index < operations.length-1}
474
+ <!--hr class="my-1 mx-4 border-1 border-stone-300 dark:border-stone-700"-->
475
+ <hr class="my-4">
476
+ {/if}
477
+ {:else}
484
478
 
485
- {@const mobile = isDeviceSmallerThan("sm")}
486
- {@const icon_placeholder_without_desc = mobile ? 12 : 10}
487
- {@const icon_placeholder_with_desc = mobile ? 14 : 12}
488
- {@const icon_placeholder_size = operation.description ? icon_placeholder_with_desc : icon_placeholder_without_desc}
489
- {@const menu_item_id = menu_items_id_prefix + index}
490
- {@const isTop = index==0}
491
- {@const isBottom = index == operations.length-1}
492
- {@const isFocused = index == focused_index}
493
- {@const clipFocusedBorder = isFocused ? (isTop ? 'rounded-t-lg' : (isBottom ? 'rounded-b-lg' : '')) : ''}
494
- {@const active = calculateBackground(isFocused || isOperationActivated(operation), false)}
495
- {@const has_submenu = operation.menu !== undefined && operation.menu.length > 0}
496
- <!--div-->
497
- <div class="pl-4 cursor-pointer {active}"
498
- id={menu_item_id}
499
- bind:this={menu_items[index]}
500
- on:click|stopPropagation={(e) => { execute_action(e, operation, index) } }
501
- on:mouseenter = {(e) => {on_mouse_move(index)}}
502
- on:keydown|stopPropagation={(e) => on_keydown(e, operation, index)}
503
- on:mousedown={mousedown}
504
- disabled={isOperationDisabled(operation)}
505
- class:opacity-60={isOperationDisabled(operation)}>
479
+ {@const mobile = isDeviceSmallerThan("sm")}
480
+ {@const icon_placeholder_without_desc = mobile ? 12 : 10}
481
+ {@const icon_placeholder_with_desc = mobile ? 14 : 12}
482
+ {@const icon_placeholder_size = operation.description ? icon_placeholder_with_desc : icon_placeholder_without_desc}
483
+ {@const menu_item_id = menu_items_id_prefix + index}
484
+ {@const isTop = index==0}
485
+ {@const isBottom = index == operations.length-1}
486
+ {@const isFocused = index == focused_index}
487
+ {@const clipFocusedBorder = isFocused ? (isTop ? 'rounded-t-lg' : (isBottom ? 'rounded-b-lg' : '')) : ''}
488
+ {@const active = calculateBackground(isFocused || isOperationActivated(operation), false)}
489
+ {@const has_submenu = operation.menu !== undefined && operation.menu.length > 0}
490
+ <!--div-->
491
+ <div class="pl-4 cursor-pointer {active}"
492
+ id={menu_item_id}
493
+ bind:this={menu_items[index]}
494
+ on:click|stopPropagation={(e) => { execute_action(e, operation, index) } }
495
+ on:mouseenter = {(e) => {on_mouse_move(index)}}
496
+ on:keydown|stopPropagation={(e) => on_keydown(e, operation, index)}
497
+ on:mousedown={mousedown}
498
+ disabled={isOperationDisabled(operation)}
499
+ class:opacity-60={isOperationDisabled(operation)}>
506
500
 
507
501
 
508
502
 
509
- <h4 class = "font-normal my-0 py-2"> <!-- test -->
510
- <div class=" w-full flex flex-row justify-between">
511
- {#if operation.mricon}
512
- <div class="py-1 mr-1 w-4"><Ricon icon = {operation.mricon} s/></div>
513
- {:else if operation.icon}
514
- <div class="py-1 mr-1 w-4 text-orange-500"><Icon s="md" component={operation.icon}/></div>
515
- {:else}
516
- <div class="py-1 mr-1 w-4"></div>
517
- {/if}
518
- <div class="grow">
519
- <span class="px-2 text-left">{operation.caption}
520
- </span>
521
- </div>
503
+ <h4 class = "font-normal my-0 py-2"> <!-- test -->
504
+ <div class=" w-full flex flex-row justify-between">
505
+ {#if operation.mricon}
506
+ {@const color=operation.color ?? ''}
507
+ <div class="py-1 mr-1 w-4 {color}"><Ricon icon = {operation.mricon} s/></div>
508
+ {:else if operation.toggle !== undefined}
509
+ {#if operation.toggle}
510
+ <div class="py-1 mr-1 w-4 text-orange-800 dark:text-orange-200"><Ricon icon='toggle-right' s/></div>
511
+ {:else}
512
+ <div class="py-1 mr-1 w-4"><Ricon icon='toggle-left' s/></div>
513
+ {/if}
514
+ {:else if operation.icon}
515
+ <div class="py-1 mr-1 w-4 text-orange-500"><Icon s="md" component={operation.icon}/></div>
516
+ {:else}
517
+ <div class="py-1 mr-1 w-4"></div>
518
+ {/if}
519
+ <div class="grow">
520
+ <span class="px-2 text-left">{operation.caption}
521
+ </span>
522
+ </div>
522
523
 
523
- {#if has_submenu}
524
- <div class="py-1 mr-1 w-4"><Ricon icon = 'chevron-right' xs/></div>
525
- <svelte:self bind:this={submenus[index]} menu_items_id_prefix={`${menu_item_id}_`} owner_menu_item={menu_items[index]}/>
526
- {/if}
524
+ {#if has_submenu}
525
+ <div class="py-1 mr-1 w-4"><Ricon icon = 'chevron-right' xs/></div>
526
+ <svelte:self bind:this={submenus[index]} menu_items_id_prefix={`${menu_item_id}_`} owner_menu_item={menu_items[index]}/>
527
+ {/if}
527
528
 
528
- </div>
529
- </h4>
529
+ </div>
530
+ </h4>
530
531
 
531
532
 
532
533
 
533
- <!-- comming soon - top info --
534
- <figcaption>
535
- <div class="grid gap-4 grid-cols-3 grid-rows-1">
536
- <span>OCT-254</span>
537
- <span class="text-center"></span>
538
- <span class="text-right">15 listopad 25</span>
539
- </div>
540
- </figcaption>
541
- -------------------------------->
542
- <!--@el------------------------->
543
- <!-- comming soon - middle info --
544
- <figcaption>
545
- <div class="grid gap-4 grid-cols-3 grid-rows-1">
546
- <span>Andrzej</span>
547
- <span class="text-center"></span>
548
- <span class="text-right">Specyfikacje</span>
549
- </div>
550
- </figcaption>
534
+ <!-- comming soon - top info --
535
+ <figcaption>
536
+ <div class="grid gap-4 grid-cols-3 grid-rows-1">
537
+ <span>OCT-254</span>
538
+ <span class="text-center"></span>
539
+ <span class="text-right">15 listopad 25</span>
540
+ </div>
541
+ </figcaption>
542
+ -------------------------------->
543
+ <!--@el------------------------->
544
+ <!-- comming soon - middle info --
545
+ <figcaption>
546
+ <div class="grid gap-4 grid-cols-3 grid-rows-1">
547
+ <span>Andrzej</span>
548
+ <span class="text-center"></span>
549
+ <span class="text-right">Specyfikacje</span>
550
+ </div>
551
+ </figcaption>
551
552
 
552
553
 
553
- {#if summary && item[summary]}
554
- <figcaption>
555
- {item[summary]}
556
- </figcaption>
557
- {/if}
558
- -------------------------------->
559
- </div>
554
+ {#if summary && item[summary]}
555
+ <figcaption>
556
+ {item[summary]}
557
+ </figcaption>
558
+ {/if}
559
+ -------------------------------->
560
+ </div>
561
+ <!--/div-->
562
+
563
+ {/if}
564
+ {/each}
565
+ </div>
560
566
  <!--/div-->
561
- {#if false}
562
- <button class="block w-full pr-4 text-left flex flex-row cursor-context-menu {active} focus:outline-none items-center"
563
- id={menu_item_id}
564
- bind:this={menu_items[index]}
565
- on:click|stopPropagation={(e) => { execute_action(e, operation, index) } }
566
- on:mouseenter = {(e) => {on_mouse_move(index)}}
567
- on:keydown|stopPropagation={(e) => on_keydown(e, operation, index)}
568
- on:mousedown={mousedown}
569
- disabled={isOperationDisabled(operation)}
570
- class:opacity-60={isOperationDisabled(operation)}>
571
567
 
572
- <div class="flex justify-center space-x-10 px-4 py-2 ml-12 sm:ml-0" >
573
- {#if operation.icon}
574
- {@const cc = mobile ? 7 : 6}
575
- {@const icon_size = icon_placeholder_size - cc}
576
- <Icon s="md" component={operation.icon}/>
577
- {:else if operation.img}
578
- {@const cc = mobile ? 7 : 6}
579
- {@const icon_size = icon_placeholder_size - cc}
580
- <div class="w-4 h-4">
581
- <img src={operation.img} alt=""/>
582
- </div>
583
- {:else}
584
- {@const cc = mobile ? 7 : 6}
585
- {@const icon_size = icon_placeholder_size - cc}
586
- <div class="w-4 h-4"></div>
587
- {/if}
588
- </div>
589
- <div class="">
590
- <p class=""> {operation.caption}</p>
591
- {#if operation.description}
592
- <p class="truncate inline-block text-xs">
593
- {operation.description}
594
- </p>
595
- {/if}
596
- </div>
597
- {#if has_submenu}
598
- <p class="ms-auto pr-1 text-sm font-mono text-stone-500">&rarr;</p>
599
- <svelte:self bind:this={submenus[index]} menu_items_id_prefix={`${menu_item_id}_`} owner_menu_item={menu_items[index]}/>
600
- {/if}
601
- </button>
602
- {/if}
603
- {/if}
604
- {/each}
605
- </div>
606
- <!--/div-->
568
+ </div>
569
+ </div>
607
570
 
608
- </div>
609
- </div>
610
571
 
611
572
  <!-- use usePreventScroll instead -->
612
573
  <!--style>
@@ -10,6 +10,7 @@ export declare class rKanban_column {
10
10
  finishing: boolean;
11
11
  operations: object[] | undefined;
12
12
  onTitleChanged: Function | undefined;
13
+ notVisible: boolean;
13
14
  }
14
15
  export declare class rKanban_definition {
15
16
  columns: rKanban_column[];
@@ -9,6 +9,7 @@ export class rKanban_column {
9
9
  finishing = false;
10
10
  operations = undefined;
11
11
  onTitleChanged = undefined;
12
+ notVisible = false;
12
13
  }
13
14
  export class rKanban_definition {
14
15
  columns = [];
@@ -8,6 +8,7 @@ import { FaPlus, FaCheck } from "svelte-icons/fa";
8
8
  import Icon from "../../r.icon.svelte";
9
9
  export let currentColumnIdx;
10
10
  export let onInsert;
11
+ export let definition;
11
12
  let column_element;
12
13
  export function getHeight() {
13
14
  if (!column_element)
@@ -40,7 +41,6 @@ export function setBorder(what_to_do) {
40
41
  break;
41
42
  }
42
43
  }
43
- let definition = getContext("rKanban-definition");
44
44
  let columnDef = definition.columns[currentColumnIdx];
45
45
  let column_items = void 0;
46
46
  $:
@@ -52,10 +52,16 @@ $:
52
52
  $:
53
53
  selected_class = is_row_selected ? "!border-blue-300 dark:!border-blue-300/50" : "";
54
54
  $:
55
- focused_class = is_row_active ? "bg-stone-50 dark:bg-stone-800" : "";
55
+ focused_class = is_row_active ? "bg-stone-100 dark:bg-stone-800" : "";
56
56
  $:
57
57
  force_rerender($data_tick_store, $contextItemsStore);
58
+ let is_visible = false;
58
59
  export function reload() {
60
+ columnDef = definition.columns[currentColumnIdx];
61
+ if (!columnDef) {
62
+ is_visible = false;
63
+ return;
64
+ }
59
65
  let allItems = definition.getItems();
60
66
  if (definition.stateAttrib) {
61
67
  if (columnDef.state < 0) {
@@ -73,6 +79,7 @@ export function reload() {
73
79
  } else
74
80
  column_items = allItems.filter((e) => e[definition.stateAttrib] == columnDef.state);
75
81
  }
82
+ is_visible = isVisible();
76
83
  }
77
84
  export function isVisible() {
78
85
  if (columnDef.state < 0) {
@@ -81,7 +88,7 @@ export function isVisible() {
81
88
  else
82
89
  return false;
83
90
  } else
84
- return true;
91
+ return !columnDef.notVisible;
85
92
  }
86
93
  function setup_data(...args) {
87
94
  reload();
@@ -180,6 +187,8 @@ let headerElement;
180
187
  export function activate(e) {
181
188
  if (e)
182
189
  e.stopPropagation();
190
+ if (!columnDef)
191
+ return;
183
192
  if (!columnDef.operations)
184
193
  return;
185
194
  if (isActive("props", columnDef)) {
@@ -226,20 +235,20 @@ async function dblclick(e) {
226
235
 
227
236
  <!-- svelte-ignore a11y-click-events-have-key-events -->
228
237
 
229
- {#if (columnDef.state >=0) || ((column_items && column_items.length > 0))}
238
+ {#if is_visible}
230
239
 
231
240
  <div class=" snap-center
232
- sm:snap-start
241
+ xsm:snap-start
242
+ flex-none
233
243
 
234
244
  w-full
235
-
236
- flex-none
237
245
  sm:w-1/2
238
- md:w-1/3
239
- xl:w-1/4
240
- sm:px-4
246
+ lg:w-1/3
247
+ 2xl:w-1/4
241
248
 
249
+ sm:px-4
242
250
 
251
+ xbg-stone-900
243
252
 
244
253
 
245
254
  {selected_class} {focused_class}"
@@ -1,8 +1,10 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+ import type { rKanban_definition } from '../Kanban';
2
3
  declare const __propDef: {
3
4
  props: {
4
5
  currentColumnIdx: number;
5
6
  onInsert: Function;
7
+ definition: rKanban_definition;
6
8
  getHeight?: (() => number) | undefined;
7
9
  editName?: ((onFinish?: Function | undefined) => void) | undefined;
8
10
  SET_LEFT?: 0 | undefined;