@humandialog/forms.svelte 1.4.7 → 1.4.9

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.
package/modal.svelte CHANGED
@@ -19,7 +19,7 @@ export let onCancelCallback = void 0;
19
19
  export function show(on_close_callback = void 0) {
20
20
  open = true;
21
21
  close_callback = on_close_callback;
22
- if (isDeviceSmallerThan("sm")) {
22
+ if (false) {
23
23
  pushToolsActionsOperations({
24
24
  opver: 1,
25
25
  operations: [
@@ -44,7 +44,6 @@ export function hide() {
44
44
  if (!open)
45
45
  return;
46
46
  open = false;
47
- popToolsActionsOperations();
48
47
  }
49
48
  let root;
50
49
  afterUpdate(
@@ -75,7 +74,7 @@ function on_cancel(event) {
75
74
  </script>
76
75
 
77
76
  {#if open}
78
- <div class="relative z-20" aria-labelledby="modal-title" role="dialog" aria-modal="true" bind:this={root}>
77
+ <div class="relative z-30" aria-labelledby="modal-title" role="dialog" aria-modal="true" bind:this={root}>
79
78
  <!--
80
79
  Background backdrop, show/hide based on modal state.
81
80
 
@@ -88,7 +87,7 @@ function on_cancel(event) {
88
87
  -->
89
88
  <div class="fixed w-screen h-screen inset-0 bg-stone-500 dark:bg-stone-800 bg-opacity-75 dark:bg-opacity-75 transition-opacity"></div>
90
89
 
91
- <div class="fixed z-20 inset-0 w-screen overflow-y-auto">
90
+ <div class="fixed z-30 inset-0 w-screen overflow-y-auto">
92
91
  <div class="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0">
93
92
  <!--
94
93
  Modal panel, show/hide based on modal state.
package/operations.svelte CHANGED
@@ -200,7 +200,7 @@ function isOperationDisabled(operation) {
200
200
  </button>
201
201
  {/each}
202
202
  {:else}
203
- {@const enabledLightColors ='text-stone-600 hover:text-stone-800 hover:bg-stone-200 active:bg-stone-200 border-stone-200'}
203
+ {@const enabledLightColors ='text-stone-600 hover:text-stone-800 hover:bg-stone-200 active:bg-stone-100 border-stone-200'}
204
204
  {@const disabledLightColors ='text-stone-400 border-stone-200'}
205
205
 
206
206
  {@const enabledDarkColors ='dark:text-stone-300 dark:hover:text-white dark:hover:bg-stone-800 dark:active:bg-stone-600 dark:border-stone-600'}
@@ -216,7 +216,7 @@ function isOperationDisabled(operation) {
216
216
  focus:outline-none
217
217
  inline-flex items-center
218
218
  {colors}"
219
- class:bg-stone-700={isActive}
219
+ class:bg-stone-200={isActive}
220
220
  class:dark:bg-stone-800={isActive}
221
221
  disabled={isDisabled}
222
222
  on:mousedown={(e) => mousedown(e, operation)}
@@ -258,7 +258,7 @@ function isOperationDisabled(operation) {
258
258
  {colors}
259
259
  focus:outline-none
260
260
  inline-flex items-center"
261
- class:bg-stone-700={isActive}
261
+ class:bg-stone-200={isActive}
262
262
  class:dark:bg-stone-800={isActive}
263
263
  disabled={isDisabled}
264
264
  on:mousedown={(e) => mousedown(e, operation)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humandialog/forms.svelte",
3
- "version": "1.4.7",
3
+ "version": "1.4.9",
4
4
  "description": "Basic Svelte UI components for Object Reef applications",
5
5
  "devDependencies": {
6
6
  "@playwright/test": "^1.28.1",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "type": "module",
28
28
  "dependencies": {
29
- "@humandialog/auth.svelte": "^1.8.12",
29
+ "@humandialog/auth.svelte": "^1.8.14",
30
30
  "@tiptap/core": "^2.11.0",
31
31
  "@tiptap/extension-bullet-list": "^2.11.5",
32
32
  "@tiptap/extension-code-block": "^2.11.5",
@@ -45,6 +45,7 @@
45
45
  "pdfjs-dist": "^4.10.38",
46
46
  "qs": "^6.14.0",
47
47
  "svelte-icons": "^2.1.0",
48
+ "svelte-share-buttons-component": "^3.0.0",
48
49
  "svelte-spa-router": "^4.0.1"
49
50
  },
50
51
  "keywords": [
@@ -67,6 +68,8 @@
67
68
  "homepage": "https://github.com/HumanDialog/forms.svelte#readme",
68
69
  "exports": {
69
70
  "./package.json": "./package.json",
71
+ "./components/breadcrumb.svelte": "./components/breadcrumb.svelte",
72
+ "./components/breadcrumb_utils": "./components/breadcrumb_utils.js",
70
73
  "./components/button.svelte": "./components/button.svelte",
71
74
  "./components/checkbox.svelte": "./components/checkbox.svelte",
72
75
  "./components/combo/combo.item.svelte": "./components/combo/combo.item.svelte",
@@ -130,6 +133,7 @@
130
133
  "./components/list/list.title.svelte": "./components/list/list.title.svelte",
131
134
  "./components/list/List": "./components/list/List.js",
132
135
  "./components/menu": "./components/menu.js",
136
+ "./components/paginator.svelte": "./components/paginator.svelte",
133
137
  "./components/radio.svelte": "./components/radio.svelte",
134
138
  "./components/sidebar/sidebar.brand.svelte": "./components/sidebar/sidebar.brand.svelte",
135
139
  "./components/sidebar/sidebar.group.svelte": "./components/sidebar/sidebar.group.svelte",
package/stores.d.ts CHANGED
@@ -49,3 +49,5 @@ export const bottom_bar_visible_store: import("svelte/store").Writable<any>;
49
49
  export const right_sidebar_visible_store: import("svelte/store").Writable<boolean>;
50
50
  export const visible_property_tab_store: import("svelte/store").Writable<string>;
51
51
  export const fabCollapsed: import("svelte/store").Writable<any>;
52
+ export const showFABAlways: import("svelte/store").Writable<any>;
53
+ export const leftHandedFAB: import("svelte/store").Writable<any>;
package/stores.js CHANGED
@@ -160,6 +160,12 @@ export const visible_property_tab_store = writable('');
160
160
  export const fabCollapsed = writable( (localStorage.fabCollapsed && localStorage.fabCollapsed == 'true') || false )
161
161
  fabCollapsed.subscribe( (value) => { localStorage.fabCollapsed = (value ? 'true' : '') } );
162
162
 
163
+ export const showFABAlways = writable( (localStorage.showFABAlways && localStorage.showFABAlways == 'true') || false )
164
+ showFABAlways.subscribe( (value) => { localStorage.showFABAlways = (value ? 'true' : '') } );
165
+
166
+ export const leftHandedFAB = writable( (localStorage.leftHandedFAB && localStorage.leftHandedFAB == 'true') || false )
167
+ leftHandedFAB.subscribe( (value) => { localStorage.leftHandedFAB = (value ? 'true' : '') } );
168
+
163
169
  export function restore_defults()
164
170
  {
165
171
 
@@ -169,6 +175,8 @@ export function restore_defults()
169
175
  right_sidebar_visible_store.set(false);
170
176
  visible_property_tab_store.set('');
171
177
  fabCollapsed.set(false)
178
+ showFABAlways.set(false)
179
+ leftHandedFAB.set(false)
172
180
  }
173
181
 
174
182
  export function toggle_sidebar(index)
package/updates.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export function informModification(itm: any, field_name: any, type_name?: undefined): boolean;
2
2
  export function informModificationEx(typeName: any, itemId: any, attribName: any, attribValue: any): boolean;
3
+ export function hasModifications(): boolean;
3
4
  export function informItem(itm: any, type_name?: undefined): boolean;
4
- export function pushChanges(): void;
5
+ export function pushChanges(afterPushCallback?: undefined): void;
package/updates.js CHANGED
@@ -51,6 +51,12 @@ export function informModificationEx(typeName, itemId, attribName, attribValue)
51
51
  return true;
52
52
  }
53
53
 
54
+ export function hasModifications()
55
+ {
56
+ //console.log('hasModifications', modified_items_map.size)
57
+ return modified_items_map.size > 0
58
+ }
59
+
54
60
  export function informItem(itm, type_name=undefined)
55
61
  {
56
62
  if(type_name == undefined)
@@ -81,8 +87,15 @@ export function informItem(itm, type_name=undefined)
81
87
 
82
88
  const update_request_ticket = writable(0);
83
89
  let last_update_ticket = 0;
84
- export function pushChanges()
90
+ let afterPushCallbacks = []
91
+
92
+ export function pushChanges(afterPushCallback=undefined)
85
93
  {
94
+ //console.trace()
95
+
96
+ if(afterPushCallback)
97
+ afterPushCallbacks.push(afterPushCallback);
98
+
86
99
  update_request_ticket.update(n => n + 1);
87
100
  }
88
101
 
@@ -140,13 +153,18 @@ update_request_ticket.subscribe(async (v) => {
140
153
  body: JSON.stringify( { Items: changes } )
141
154
  })
142
155
  if (res.ok) {
156
+
143
157
  modified_items_map.clear();
158
+ afterPushCallbacks.forEach( cb => cb())
159
+ afterPushCallbacks = []
144
160
  }
145
161
  else
146
162
  {
147
163
  if(res.status == 400) // basic exception like access rights
148
164
  {
149
165
  modified_items_map.clear();
166
+ afterPushCallbacks.forEach( cb => cb())
167
+ afterPushCallbacks = []
150
168
  }
151
169
 
152
170
  const err = await res.text()
package/utils.js CHANGED
@@ -84,21 +84,32 @@ export function clearActiveItem(context_level)
84
84
 
85
85
  export function refreshToolbarOperations()
86
86
  {
87
+
88
+ let refreshed = false
89
+
87
90
  const contextOperations = get(contextToolbarOperations)
88
91
  if(contextOperations)
89
92
  {
93
+
90
94
  if(Array.isArray(contextOperations))
91
95
  {
92
- if(contextOperations.length)
96
+ if(contextOperations.length > 0)
97
+ {
93
98
  contextToolbarOperations.set([...contextOperations])
99
+ refreshed = true
100
+ }
94
101
  }
95
102
  else
96
103
  {
97
- if(contextOperations.operations.length)
104
+ if(contextOperations.operations && contextOperations.operations.length > 0)
105
+ {
98
106
  contextToolbarOperations.set({...contextOperations})
107
+ refreshed = true
108
+ }
99
109
  }
100
110
  }
101
- else
111
+
112
+ if(!refreshed)
102
113
  {
103
114
  const pageOperations = get(pageToolbarOperations);
104
115
  if(pageOperations)
@@ -108,6 +119,7 @@ export function refreshToolbarOperations()
108
119
  if(pageOperations.length > 0)
109
120
  {
110
121
  pageToolbarOperations.set([...pageOperations])
122
+ refreshed = true
111
123
  }
112
124
  }
113
125
  else
@@ -115,6 +127,7 @@ export function refreshToolbarOperations()
115
127
  if(pageOperations.operations && pageOperations.operations.length > 0)
116
128
  {
117
129
  pageToolbarOperations.set({...pageOperations})
130
+ refreshed = true
118
131
  }
119
132
  }
120
133
  }
@@ -159,6 +172,7 @@ export function editable(node, params)
159
172
  let onRemove = undefined;
160
173
  let onFinish = undefined;
161
174
  let onSoftEnter = undefined;
175
+ let onSingleChange = undefined
162
176
  if(params instanceof Object)
163
177
  {
164
178
  action = params.action ?? params;
@@ -166,6 +180,7 @@ export function editable(node, params)
166
180
  onRemove = params.remove ?? undefined
167
181
  onFinish = params.onFinish ?? undefined
168
182
  onSoftEnter = params.onSoftEnter ?? undefined;
183
+ onSingleChange = params.onSingleChange ?? undefined
169
184
 
170
185
  if(params.readonly)
171
186
  return;
@@ -323,7 +338,12 @@ export function editable(node, params)
323
338
  currentEditable = node;
324
339
  node.addEventListener("save", save_listener)
325
340
 
326
- observer = new MutationObserver(() => { has_changed = true; });
341
+ observer = new MutationObserver(() => {
342
+ has_changed = true;
343
+ if(onSingleChange)
344
+ onSingleChange(node.textContent)
345
+ });
346
+
327
347
  observer.observe( node, {
328
348
  childList: true,
329
349
  attributes: true,
@@ -19,13 +19,15 @@
19
19
  context_info_store,
20
20
  contextToolbarOperations,
21
21
  data_tick_store,
22
- reloadWholeApp
22
+ reloadWholeApp,
23
+ showFABAlways,
24
+ leftHandedFAB
23
25
  } from "./stores.js";
24
26
  import Icon from './components/icon.svelte';
25
27
  import {session, signInHRef, signOutHRef} from '@humandialog/auth.svelte'
26
28
  import { pop, push } from 'svelte-spa-router';
27
29
  import { tick } from 'svelte';
28
- import { popNavigationPage } from './utils';
30
+ import { isDeviceSmallerThan, popNavigationPage } from './utils';
29
31
 
30
32
 
31
33
  export let appConfig = undefined;
@@ -218,6 +220,22 @@
218
220
  });
219
221
  }
220
222
 
223
+ if(!isDeviceSmallerThan("sm"))
224
+ {
225
+ options.push({
226
+ caption: 'Floating actions',
227
+ icon: $showFABAlways ? FaToggleOn : FaToggleOff,
228
+ action: (f) => { $showFABAlways = !$showFABAlways; }
229
+ })
230
+
231
+ options.push({
232
+ caption: 'Left-handed floating actions',
233
+ icon: $leftHandedFAB ? FaToggleOn : FaToggleOff,
234
+ disabled: !$showFABAlways,
235
+ action: (f) => { $leftHandedFAB = !$leftHandedFAB; }
236
+ })
237
+ }
238
+
221
239
  if(has_selection_details)
222
240
  {
223
241
  options.push( {