@humandialog/forms.svelte 1.1.2 → 1.1.4

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.
@@ -167,26 +167,42 @@ function activateRow(e) {
167
167
  on:keyup
168
168
  class=" border border-transparent rounded-lg
169
169
  text-lg sm:text-base font-normal
170
- text-stone-900 sm:hover:bg-stone-100
171
- dark:text-white sm:dark:hover:bg-stone-700 {user_class}"
170
+ text-stone-900 dark:text-white {user_class}"
171
+ class:sm:hover:bg-stone-100={!!href}
172
+ class:sm:dark:hover:bg-stone-700={!!href}
172
173
  class:bg-stone-200={isRowActive}
173
174
  class:dark:bg-stone-700={isRowActive}
174
175
  class:selected={selected(selectable, context_data)}>
175
176
  <div class="flex flex-row justify-between">
176
- <a href={href}
177
- on:click={on_link_clicked}
178
- class="flex-1 ml-2 mt-3 sm:mt-2 inline-flex items-center group"
179
- class:mb-3={!summary}
180
- class:sm:mb-2={!summary}
181
- >
182
- {#if icon}
183
- <Icon size={5} component={icon}/>
184
- {/if}
185
- <span class="ml-3 group-hover:underline"
186
- use:editable_if_needed={editable}>
187
- <slot/>
188
- </span>
189
- </a>
177
+ {#if href}
178
+ <a href={href}
179
+ on:click={on_link_clicked}
180
+ class="flex-1 ml-2 mt-3 sm:mt-2 inline-flex items-center group"
181
+ class:mb-3={!summary}
182
+ class:sm:mb-2={!summary}
183
+ >
184
+ {#if icon}
185
+ <Icon size={5} component={icon}/>
186
+ {/if}
187
+ <span class="ml-3 group-hover:underline"
188
+ use:editable_if_needed={editable}>
189
+ <slot/>
190
+ </span>
191
+ </a>
192
+ {:else}
193
+ <p class="flex-1 ml-2 mt-3 sm:mt-2 inline-flex items-center group cursor-default"
194
+ class:mb-3={!summary}
195
+ class:sm:mb-2={!summary}
196
+ use:selectable_if_needed={selectable}>
197
+ {#if icon}
198
+ <Icon size={5} component={icon}/>
199
+ {/if}
200
+ <span class="ml-3"
201
+ use:editable_if_needed={editable}>
202
+ <slot/>
203
+ </span>
204
+ </p>
205
+ {/if}
190
206
 
191
207
  {#if !isOnPage}
192
208
  <section class="flex-0 w-20 sm:w-12 h-10 flex-0 flex flex-row"
package/desk.svelte CHANGED
@@ -321,4 +321,16 @@
321
321
  }
322
322
  #__hd_svelte_layout_root.dark ::-webkit-scrollbar-thumb:hover {
323
323
  background: #57534e;
324
+ }
325
+
326
+ /* bg-white */
327
+ :global(body) {
328
+ --tw-bg-opacity: 1;
329
+ background-color: rgb(255 255 255/var(--tw-bg-opacity));
330
+ }
331
+
332
+ /* dark:bg-gray-900 */
333
+ :global(body.dark) {
334
+ --tw-bg-opacity: 1;
335
+ background-color: rgb(28 25 23/var(--tw-bg-opacity));
324
336
  }</style>
@@ -53,7 +53,7 @@
53
53
  show_sign_in_out_icons = config.signin ? true : false;
54
54
  sign_in_href = $signInHRef;
55
55
  sign_out_href = $signOutHRef;
56
- user_is_in_multiple_groups = $session.tenants.length > 1
56
+ //user_is_in_multiple_groups = $session.tenants.length > 1
57
57
 
58
58
  tabs = Object.keys(appConfig.sidebar);
59
59
  if(tabs.length > 1)
package/index.d.ts CHANGED
@@ -53,7 +53,7 @@ export { default as KanbanTagsProperty } from './components/kanban/kanban.tags.s
53
53
  export { default as KanbanCallbacks } from './components/kanban/kanban.callbacks.svelte';
54
54
  export { KanbanColumnTop, KanbanColumnBottom } from './components/kanban/Kanban';
55
55
  export { selectItem, activateItem, clearActiveItem, isActive, isSelected, getActive, editable, startEditing, saveCurrentEditable, selectable, handleSelect, isDeviceSmallerThan } from './utils';
56
- export { mainContentPageReloader, reloadMainContentPage } from './stores.js';
56
+ export { mainContentPageReloader, reloadMainContentPage, reloadWholeApp } from './stores.js';
57
57
  export { data_tick_store, // tmp
58
58
  hasSelectedItem, hasDataItem, setNavigatorTitle } from "./stores";
59
59
  export { contextToolbarOperations, pageToolbarOperations, contextItemsStore, contextTypesStore } from './stores';
package/index.js CHANGED
@@ -59,7 +59,7 @@ export { default as KanbanTagsProperty } from './components/kanban/kanban.tags.s
59
59
  export { default as KanbanCallbacks } from './components/kanban/kanban.callbacks.svelte';
60
60
  export { KanbanColumnTop, KanbanColumnBottom } from './components/kanban/Kanban';
61
61
  export { selectItem, activateItem, clearActiveItem, isActive, isSelected, getActive, editable, startEditing, saveCurrentEditable, selectable, handleSelect, isDeviceSmallerThan } from './utils';
62
- export { mainContentPageReloader, reloadMainContentPage } from './stores.js';
62
+ export { mainContentPageReloader, reloadMainContentPage, reloadWholeApp } from './stores.js';
63
63
  export { data_tick_store, // tmp
64
64
  hasSelectedItem, hasDataItem, setNavigatorTitle } from "./stores";
65
65
  export { contextToolbarOperations, pageToolbarOperations, contextItemsStore, contextTypesStore } from './stores'; // tmp
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humandialog/forms.svelte",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Basic Svelte UI components for Object Reef applications",
5
5
  "devDependencies": {
6
6
  "@playwright/test": "^1.28.1",
@@ -3,6 +3,7 @@
3
3
  FaUserMinus,
4
4
  FaPen,
5
5
  FaInfoCircle,
6
+ FaUserSlash,
6
7
  FaChevronDown} from 'svelte-icons/fa'
7
8
 
8
9
  import Page from './page.svelte'
@@ -267,8 +268,8 @@
267
268
 
268
269
  function create_new_user()
269
270
  {
270
- if(showAccessRoles)
271
- new_user.acc_role = access_roles[0].name
271
+ if(showAccessRoles && access_roles.length > 0)
272
+ new_user.acc_role = access_roles[0].name ?? ""
272
273
 
273
274
  create_new_user_enabled = true;
274
275
 
@@ -279,6 +280,14 @@
279
280
  icon: FaUserPlus,
280
281
  caption: '',
281
282
  action: (focused) => { create_new_user(); }
283
+ },
284
+ {
285
+ separator: true
286
+ },
287
+ {
288
+ icon: FaUserSlash,
289
+ caption: '',
290
+ action: (f) => {askToDeleteApplicationAccount();}
282
291
  }
283
292
  ]
284
293
 
@@ -586,6 +595,42 @@
586
595
  }
587
596
  }
588
597
 
598
+ let deleteAccountModal;
599
+ function askToDeleteApplicationAccount()
600
+ {
601
+ deleteAccountModal.show()
602
+ }
603
+
604
+ async function deleteApplicationAccount()
605
+ {
606
+ let my_email = $session.user.email ?? ""
607
+ if(!my_email)
608
+ return;
609
+
610
+ try{
611
+
612
+ const res = await reef.fetch(`json/anyv/sys/unregister_user?email=${my_email}`)
613
+ deleteAccountModal.hide();
614
+
615
+ if(res.ok)
616
+ {
617
+ $session.signout();
618
+ window.location.href = $signInHRef;
619
+ }
620
+ else
621
+ {
622
+ const err = await res.text()
623
+ alerts = [err, ...alerts];
624
+ }
625
+ }
626
+ catch(err)
627
+ {
628
+ deleteAccountModal.hide();
629
+
630
+ console.error(err)
631
+ alerts = [err, ...alerts];
632
+ }
633
+ }
589
634
 
590
635
  </script>
591
636
 
@@ -646,6 +691,7 @@
646
691
 
647
692
  </List>
648
693
  {/if}
694
+
649
695
 
650
696
  </Page>
651
697
 
@@ -805,4 +851,12 @@
805
851
  okCaption='Remove'
806
852
  onOkCallback={removeUser}
807
853
  bind:this={removeModal}
854
+ />
855
+
856
+ <Modal title="Delete app account"
857
+ content="Are you sure you want to delete your application account?"
858
+ icon={FaUserSlash}
859
+ okCaption='Delete'
860
+ onOkCallback={deleteApplicationAccount}
861
+ bind:this={deleteAccountModal}
808
862
  />
@@ -76,7 +76,7 @@
76
76
  }
77
77
  }
78
78
 
79
- show_groups_switch_menu = $session.tenants.length > 1
79
+ /*show_groups_switch_menu = $session.tenants.length > 1
80
80
 
81
81
  if($session.configuration.tenant)
82
82
  {
@@ -89,6 +89,7 @@
89
89
  }))
90
90
 
91
91
  }
92
+ */
92
93
 
93
94
  }
94
95