@humandialog/forms.svelte 1.3.10 → 1.3.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.
- package/components/Fab.svelte +103 -31
- package/components/Grid.menu.svelte.d.ts +2 -2
- package/components/combo/combo.svelte +25 -22
- package/components/date.svelte +40 -30
- package/components/document/editor.svelte +10 -4
- package/components/document/internal/Document_command.d.ts +1 -0
- package/components/document/internal/Document_command.js +1 -0
- package/components/document/internal/palette.svelte +16 -10
- package/components/kanban/internal/kanban.card.svelte +5 -3
- package/components/list/internal/list.element.props.svelte +2 -2
- package/components/list/internal/list.element.svelte +13 -11
- package/components/sidebar/sidebar.group.svelte +2 -2
- package/components/sidebar/sidebar.item.svelte +52 -29
- package/components/sidebar/sidebar.list.svelte +4 -2
- package/components/table/table.svelte +6 -3
- package/components/tag.svelte +12 -9
- package/components/tags.svelte +13 -11
- package/desk.svelte +58 -26
- package/horizontal.toolbar.svelte +3 -3
- package/operations.svelte +37 -8
- package/package.json +2 -2
- package/page.svelte +7 -2
- package/tenant.members.svelte +69 -39
- package/updates.js +29 -2
- package/utils.js +37 -8
- package/vertical.toolbar.svelte +1 -1
package/components/Fab.svelte
CHANGED
|
@@ -11,17 +11,26 @@ let toolboxOperations = [];
|
|
|
11
11
|
let isExpandable = false;
|
|
12
12
|
let vToolboxExpanded = false;
|
|
13
13
|
let hToolboxExpanded = false;
|
|
14
|
-
let
|
|
14
|
+
let isDirectPositioningMode = false;
|
|
15
15
|
function update(...args) {
|
|
16
|
-
|
|
16
|
+
isDirectPositioningMode = false;
|
|
17
|
+
if ($contextToolbarOperations && Array.isArray($contextToolbarOperations) && $contextToolbarOperations.length > 0)
|
|
17
18
|
operations = $contextToolbarOperations;
|
|
18
|
-
else
|
|
19
|
-
operations = $
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
else if ($contextToolbarOperations && $contextToolbarOperations.operations && $contextToolbarOperations.operations.length > 0) {
|
|
20
|
+
operations = $contextToolbarOperations.operations;
|
|
21
|
+
if ($contextToolbarOperations.opver && $contextToolbarOperations.opver == 1)
|
|
22
|
+
isDirectPositioningMode = true;
|
|
22
23
|
} else {
|
|
23
|
-
|
|
24
|
+
if (Array.isArray($pageToolbarOperations))
|
|
25
|
+
operations = $pageToolbarOperations;
|
|
26
|
+
else {
|
|
27
|
+
operations = $pageToolbarOperations.operations;
|
|
28
|
+
if ($pageToolbarOperations.opver && $pageToolbarOperations.opver == 1)
|
|
29
|
+
isDirectPositioningMode = true;
|
|
30
|
+
}
|
|
24
31
|
}
|
|
32
|
+
if (isDirectPositioningMode)
|
|
33
|
+
return;
|
|
25
34
|
if (operations.length > 0)
|
|
26
35
|
mainOperation = operations[0];
|
|
27
36
|
else
|
|
@@ -46,7 +55,6 @@ export function activateMainOperation() {
|
|
|
46
55
|
const mainOperationButton = document.getElementById("__hd_fab_mainOperation");
|
|
47
56
|
if (!mainOperationButton)
|
|
48
57
|
return;
|
|
49
|
-
console.log("activateMainOperation");
|
|
50
58
|
mainOperationButton.click();
|
|
51
59
|
}
|
|
52
60
|
function on_click(e, operation) {
|
|
@@ -100,33 +108,97 @@ function getSelectionPos() {
|
|
|
100
108
|
return 0;
|
|
101
109
|
}
|
|
102
110
|
function calculatePosition(operation) {
|
|
103
|
-
|
|
104
|
-
let result =
|
|
111
|
+
const isLeftHanded = false;
|
|
112
|
+
let result = "";
|
|
113
|
+
const fab = operation.fab;
|
|
114
|
+
if (fab.length != 3)
|
|
115
|
+
return "";
|
|
116
|
+
const section = fab[0];
|
|
117
|
+
const col_no = parseInt(fab[1]);
|
|
118
|
+
const row_no = parseInt(fab[2]);
|
|
119
|
+
if (col_no == NaN || row_no == NaN)
|
|
120
|
+
return "";
|
|
121
|
+
const width = 55;
|
|
122
|
+
const height = 55;
|
|
123
|
+
const margin = 10;
|
|
124
|
+
if (!isLeftHanded) {
|
|
125
|
+
switch (section) {
|
|
126
|
+
case "M":
|
|
127
|
+
result = `right: ${margin + col_no * width}px; bottom: ${margin + row_no * height}px`;
|
|
128
|
+
break;
|
|
129
|
+
case "S":
|
|
130
|
+
result = `left: ${margin + col_no * width}px; bottom: ${margin + row_no * height}px`;
|
|
131
|
+
break;
|
|
132
|
+
case "A":
|
|
133
|
+
result = `right: ${margin + col_no * width}px; top: calc(50vh - ${row_no * height}px)`;
|
|
134
|
+
break;
|
|
135
|
+
case "C":
|
|
136
|
+
result = `left: ${margin + col_no * width}px; top: calc(50vh - ${row_no * height}px)`;
|
|
137
|
+
break;
|
|
138
|
+
case "T":
|
|
139
|
+
result = `right: ${margin + col_no * width}px; top: ${margin + row_no * height}px`;
|
|
140
|
+
break;
|
|
141
|
+
case "F":
|
|
142
|
+
result = `left: ${margin + col_no * width}px; top: ${margin + row_no * height}px`;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
} else {
|
|
146
|
+
switch (section) {
|
|
147
|
+
case "M":
|
|
148
|
+
result = `left: ${margin + col_no * width}px; bottom: ${margin + row_no * height}px`;
|
|
149
|
+
break;
|
|
150
|
+
case "S":
|
|
151
|
+
result = `right: ${margin + col_no * width}px; bottom: ${margin + row_no * height}px`;
|
|
152
|
+
break;
|
|
153
|
+
case "A":
|
|
154
|
+
result = `left: ${margin + col_no * width}px; top: calc(50vh - ${row_no * height}px)`;
|
|
155
|
+
break;
|
|
156
|
+
case "C":
|
|
157
|
+
result = `right: ${margin + col_no * width}px; top: calc(50vh - ${row_no * height}px)`;
|
|
158
|
+
break;
|
|
159
|
+
case "T":
|
|
160
|
+
result = `left: ${margin + col_no * width}px; top: ${margin + row_no * height}px`;
|
|
161
|
+
break;
|
|
162
|
+
case "F":
|
|
163
|
+
result = `right: ${margin + col_no * width}px; top: ${margin + row_no * height}px`;
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
105
167
|
return result;
|
|
106
168
|
}
|
|
107
169
|
function operationVisible(operation) {
|
|
108
|
-
|
|
170
|
+
if (!operation.fab)
|
|
171
|
+
return false;
|
|
172
|
+
return true;
|
|
109
173
|
}
|
|
110
174
|
</script>
|
|
111
175
|
|
|
112
|
-
{#if
|
|
176
|
+
{#if isDirectPositioningMode}
|
|
113
177
|
{#if operations && operations.length > 0}
|
|
114
|
-
{#each operations as
|
|
115
|
-
{#if
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
178
|
+
{#each operations as group}
|
|
179
|
+
{#if group.operations && group.operations.length > 0}
|
|
180
|
+
{#each group.operations as operation}
|
|
181
|
+
{#if operationVisible(operation)}
|
|
182
|
+
{@const position = calculatePosition(operation)}
|
|
183
|
+
{#if position}
|
|
184
|
+
<button
|
|
185
|
+
class="text-white bg-blue-700/70 hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300
|
|
186
|
+
font-medium rounded-full text-sm text-center shadow-md
|
|
187
|
+
w-[35px] h-[35px]
|
|
188
|
+
fixed m-0
|
|
189
|
+
dark:bg-blue-600/50 dark:hover:bg-blue-700 dark:focus:ring-blue-800
|
|
190
|
+
flex items-center justify-center
|
|
191
|
+
disable-dbl-tap-zoom
|
|
192
|
+
cursor-pointer z-10"
|
|
193
|
+
style={position}
|
|
194
|
+
on:click|stopPropagation={(e) => {on_click(e, operation)}}
|
|
195
|
+
on:mousedown={mousedown} >
|
|
196
|
+
<div class="w-5 h-5"><svelte:component this={operation.icon}/></div>
|
|
197
|
+
</button>
|
|
198
|
+
{/if}
|
|
199
|
+
{/if}
|
|
200
|
+
{/each}
|
|
201
|
+
{/if}
|
|
130
202
|
{/each}
|
|
131
203
|
{/if}
|
|
132
204
|
{:else}
|
|
@@ -138,7 +210,7 @@ function operationVisible(operation) {
|
|
|
138
210
|
class="text-white bg-blue-700 hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300
|
|
139
211
|
font-medium rounded-full text-sm text-center shadow-md
|
|
140
212
|
w-[55px] h-[55px]
|
|
141
|
-
fixed m-0
|
|
213
|
+
fixed m-0 bottom-0 right-[0px]
|
|
142
214
|
dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800
|
|
143
215
|
flex items-center justify-center
|
|
144
216
|
disable-dbl-tap-zoom"
|
|
@@ -151,7 +223,7 @@ function operationVisible(operation) {
|
|
|
151
223
|
{#if secondaryOperation || isExpandable}
|
|
152
224
|
|
|
153
225
|
<!-- horizontal container -->
|
|
154
|
-
<div class="flex flex-row m-0
|
|
226
|
+
<div class="flex flex-row m-0 fixed bottom-[10px] right-[60px]">
|
|
155
227
|
|
|
156
228
|
{#if isExpandable}
|
|
157
229
|
<!-- Expander -->
|
|
@@ -238,7 +310,7 @@ function operationVisible(operation) {
|
|
|
238
310
|
|
|
239
311
|
{#if operations.length > 2} <!-- has vertical operations -->
|
|
240
312
|
<!-- vertical tools container -->
|
|
241
|
-
<ul class="list-none m-0
|
|
313
|
+
<ul class="list-none m-0 fixed bottom-[70px] right-0">
|
|
242
314
|
{#if (isExpandable && vToolboxExpanded) || !isExpandable}
|
|
243
315
|
{@const verticalOperations = operations.slice(2).reverse()}
|
|
244
316
|
{#each verticalOperations as operation}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} GridEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} GridSlots */
|
|
4
4
|
export default class Grid extends SvelteComponentTyped<{
|
|
5
|
-
onHide?: any;
|
|
6
5
|
operations?: any[] | undefined;
|
|
6
|
+
onHide?: any;
|
|
7
7
|
}, {
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
9
9
|
}, {}> {
|
|
@@ -14,8 +14,8 @@ export type GridSlots = typeof __propDef.slots;
|
|
|
14
14
|
import { SvelteComponentTyped } from "svelte";
|
|
15
15
|
declare const __propDef: {
|
|
16
16
|
props: {
|
|
17
|
-
onHide?: any;
|
|
18
17
|
operations?: any[] | undefined;
|
|
18
|
+
onHide?: any;
|
|
19
19
|
};
|
|
20
20
|
events: {
|
|
21
21
|
[evt: string]: CustomEvent<any>;
|
|
@@ -54,8 +54,8 @@ switch (s) {
|
|
|
54
54
|
label_mb = "mb-2";
|
|
55
55
|
input_pt = "pt-2.5";
|
|
56
56
|
input_pb = "pb-2.5";
|
|
57
|
-
font_size = "text-
|
|
58
|
-
line_h = "h-
|
|
57
|
+
font_size = "text-base";
|
|
58
|
+
line_h = "h-5 sm:h-5";
|
|
59
59
|
chevron_mt = "mt-2 sm:mt-1";
|
|
60
60
|
break;
|
|
61
61
|
case "xs":
|
|
@@ -75,11 +75,11 @@ switch (s) {
|
|
|
75
75
|
chevron_mt = "";
|
|
76
76
|
break;
|
|
77
77
|
default:
|
|
78
|
-
label_mb = "
|
|
79
|
-
input_pt = "
|
|
80
|
-
input_pb = "
|
|
81
|
-
font_size = "
|
|
82
|
-
line_h = "
|
|
78
|
+
label_mb = "";
|
|
79
|
+
input_pt = "";
|
|
80
|
+
input_pb = "";
|
|
81
|
+
font_size = "";
|
|
82
|
+
line_h = "";
|
|
83
83
|
chevron_mt = "";
|
|
84
84
|
}
|
|
85
85
|
let background_class = is_compact && !icon ? "" : "";
|
|
@@ -153,7 +153,7 @@ let on_hide_callback = void 0;
|
|
|
153
153
|
export function show(event, hide_callback) {
|
|
154
154
|
if (!can_be_activated)
|
|
155
155
|
return;
|
|
156
|
-
if (!
|
|
156
|
+
if (!textbox)
|
|
157
157
|
return;
|
|
158
158
|
if (is_dropdown_open)
|
|
159
159
|
return;
|
|
@@ -171,7 +171,7 @@ export function show(event, hide_callback) {
|
|
|
171
171
|
client_rect.y = 0;
|
|
172
172
|
client_rect.width = window.innerWidth;
|
|
173
173
|
client_rect.height = window.innerHeight;
|
|
174
|
-
let rect =
|
|
174
|
+
let rect = textbox.getBoundingClientRect();
|
|
175
175
|
let top_space = rect.y;
|
|
176
176
|
let bottom_space = client_rect.height - (rect.y + rect.height);
|
|
177
177
|
let palette_max_height_px = 500;
|
|
@@ -579,13 +579,14 @@ function on_focus_out(e) {
|
|
|
579
579
|
{/if}
|
|
580
580
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
581
581
|
<div bind:this={combo}
|
|
582
|
-
on:click={(e) => { show(e, undefined) }}
|
|
583
|
-
class:cursor-pointer={can_be_activated && is_compact}
|
|
584
582
|
class="max-w-full {appearance_class} flex flex-row content-between items-center"
|
|
585
583
|
>
|
|
586
584
|
|
|
587
|
-
<
|
|
588
|
-
{
|
|
585
|
+
<p class="max-w-full flex-1 flex flex-row items-center"
|
|
586
|
+
on:click={(e) => { show(e, undefined) }}
|
|
587
|
+
class:cursor-pointer={can_be_activated && is_compact}>
|
|
588
|
+
|
|
589
|
+
{#if true || !is_dropdown_open}
|
|
589
590
|
{#if icon && sel_item}
|
|
590
591
|
{#if sel_item.Color}
|
|
591
592
|
<Icon size={5} circle={true} color={sel_item.Color}/>
|
|
@@ -600,7 +601,7 @@ function on_focus_out(e) {
|
|
|
600
601
|
{/if}
|
|
601
602
|
|
|
602
603
|
|
|
603
|
-
<
|
|
604
|
+
<span bind:this={textbox}
|
|
604
605
|
class="dark:text-stone-300 {line_h} truncate pl-0 pr-2.5 {background_class} min-w-[2.5rem]"
|
|
605
606
|
class:ml-2={icon}
|
|
606
607
|
class:text-stone-400={ (!is_dropdown_open) && (!sel_item)}
|
|
@@ -609,18 +610,20 @@ function on_focus_out(e) {
|
|
|
609
610
|
contenteditable={is_dropdown_open && filtered}
|
|
610
611
|
on:keydown={on_keydown}
|
|
611
612
|
tabindex="0">
|
|
612
|
-
{combo_text}</
|
|
613
|
-
|
|
613
|
+
{combo_text}</span>
|
|
614
|
+
|
|
615
|
+
{#if can_be_activated }
|
|
616
|
+
<div class="w-3 h-3 no-print flex-none text-stone-700 dark:text-stone-300 {chevron_mt}">
|
|
617
|
+
<FaChevronDown/>
|
|
618
|
+
</div>
|
|
619
|
+
{/if}
|
|
620
|
+
</p>
|
|
621
|
+
|
|
614
622
|
|
|
615
|
-
{#if can_be_activated }
|
|
616
|
-
<div class="w-3 h-3 no-print flex-none text-stone-700 dark:text-stone-300 {chevron_mt}">
|
|
617
|
-
<FaChevronDown/>
|
|
618
|
-
</div>
|
|
619
|
-
{/if}
|
|
620
623
|
</div>
|
|
621
624
|
|
|
622
625
|
<div hidden={!is_dropdown_open}
|
|
623
|
-
class="{cs} bg-white dark:bg-stone-800 text-stone-500 dark:text-stone-400 rounded-lg border border-stone-200 dark:border-stone-700 shadow-md overflow-y-auto cursor-pointer z-30"
|
|
626
|
+
class="not-prose {cs} bg-white dark:bg-stone-800 text-stone-500 dark:text-stone-400 rounded-lg border border-stone-200 dark:border-stone-700 shadow-md overflow-y-auto cursor-pointer z-30"
|
|
624
627
|
style={dropdown_position}
|
|
625
628
|
use:dropdown_action>
|
|
626
629
|
<ul class="py-1">
|
package/components/date.svelte
CHANGED
|
@@ -73,6 +73,12 @@ switch (s) {
|
|
|
73
73
|
line_h = "h-6 sm:h-6";
|
|
74
74
|
chevron_mt = "mt-1.5 sm:mt-0.5";
|
|
75
75
|
break;
|
|
76
|
+
default:
|
|
77
|
+
input_pt = "";
|
|
78
|
+
input_pb = "";
|
|
79
|
+
font_size = "";
|
|
80
|
+
line_h = "";
|
|
81
|
+
chevron_mt = "";
|
|
76
82
|
}
|
|
77
83
|
let item = null;
|
|
78
84
|
let user_class = $$restProps.class ?? "";
|
|
@@ -291,40 +297,44 @@ function blur(e) {
|
|
|
291
297
|
</script>
|
|
292
298
|
|
|
293
299
|
{#if is_compact}
|
|
294
|
-
<div class="inline-block
|
|
300
|
+
<div class="inline-block {line_h}">
|
|
295
301
|
<div class="dark:text-stone-300 {font_size} truncate
|
|
296
302
|
pl-0 pr-0
|
|
297
|
-
h-full
|
|
298
|
-
<
|
|
299
|
-
|
|
300
|
-
|
|
303
|
+
h-full " >
|
|
304
|
+
<p >
|
|
305
|
+
<span class="inline-block relative flex flex-row items-center">
|
|
306
|
+
<span class="grow-1 pr-2.5 ">
|
|
307
|
+
{pretty_value}
|
|
308
|
+
</span>
|
|
301
309
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
310
|
+
{#if can_be_activated}
|
|
311
|
+
<div class="no-print ml-auto w-3 h-3 {chevron_mt} text-stone-700 dark:text-stone-300">
|
|
312
|
+
<FaChevronDown/>
|
|
313
|
+
</div>
|
|
314
|
+
{/if}
|
|
315
|
+
|
|
316
|
+
{#if can_be_activated}
|
|
317
|
+
{#if type == "datetime-local"}
|
|
318
|
+
<input type="datetime-local"
|
|
319
|
+
class="datepicker-input"
|
|
320
|
+
tabindex="-1"
|
|
321
|
+
on:change={on_changed}
|
|
322
|
+
bind:value={rValue}
|
|
323
|
+
bind:this={input_element}>
|
|
324
|
+
{:else}
|
|
325
|
+
<input type="date"
|
|
326
|
+
class="datepicker-input"
|
|
327
|
+
tabindex="-1"
|
|
328
|
+
on:change={on_changed}
|
|
329
|
+
bind:value={rValue}
|
|
330
|
+
bind:this={input_element}
|
|
331
|
+
on:blur={blur}>
|
|
332
|
+
{/if}
|
|
333
|
+
{/if}
|
|
334
|
+
|
|
335
|
+
</span>
|
|
336
|
+
</p>
|
|
325
337
|
|
|
326
|
-
|
|
327
|
-
{/if}
|
|
328
338
|
</div>
|
|
329
339
|
|
|
330
340
|
|
|
@@ -186,6 +186,7 @@ const suggestion = {
|
|
|
186
186
|
editor.commands.blur();
|
|
187
187
|
palette.set_current_editor_range(props.range);
|
|
188
188
|
const cursorRect = props.clientRect();
|
|
189
|
+
palette.filter("");
|
|
189
190
|
setTimeout(() => show_command_palette(cursorRect), 100);
|
|
190
191
|
} else {
|
|
191
192
|
const cursorRect = props.clientRect();
|
|
@@ -585,10 +586,12 @@ function show_command_palette(cursor_rect) {
|
|
|
585
586
|
show_big_command_palette(cursor_rect, client_rect);
|
|
586
587
|
}
|
|
587
588
|
function show_small_command_palette(client_rect) {
|
|
588
|
-
|
|
589
|
-
palette.
|
|
590
|
-
|
|
591
|
-
let
|
|
589
|
+
const margin = 5;
|
|
590
|
+
palette.max_height_px = client_rect.height / 2 - margin;
|
|
591
|
+
palette.width_px = client_rect.width - 2 * margin;
|
|
592
|
+
let x = margin;
|
|
593
|
+
let y = client_rect.bottom - margin;
|
|
594
|
+
let show_above = true;
|
|
592
595
|
palette.show(x, y, show_above);
|
|
593
596
|
}
|
|
594
597
|
function show_big_command_palette(cursor_rect, client_rect) {
|
|
@@ -661,6 +664,9 @@ function handleImagesChanges(transaction) {
|
|
|
661
664
|
}
|
|
662
665
|
let commands = [
|
|
663
666
|
//{ caption: 'Styles', separator: true },
|
|
667
|
+
{ caption: "Back to edit", description: "Escape", icon: FaArrowLeft, on_choice: () => {
|
|
668
|
+
editor?.commands.focus();
|
|
669
|
+
}, is_visible: () => isDeviceSmallerThan("sm") },
|
|
664
670
|
{ caption: "Normal", description: "This is normal text style", tags: "text", icon: FaRemoveFormat, on_choice: (range) => {
|
|
665
671
|
if (range)
|
|
666
672
|
editor.chain().focus().deleteRange(range).setParagraph().run();
|
|
@@ -78,19 +78,25 @@ export function execute_selected_command() {
|
|
|
78
78
|
export function filter(key) {
|
|
79
79
|
if (!filtered_commands)
|
|
80
80
|
return filtered_commands;
|
|
81
|
+
let was_any_items_before = filtered_commands.length > 0;
|
|
81
82
|
if (!key) {
|
|
82
83
|
filtered_commands = [...commands];
|
|
83
|
-
|
|
84
|
+
} else {
|
|
85
|
+
filtered_commands = [];
|
|
86
|
+
commands.forEach((cmd) => {
|
|
87
|
+
if (cmd.separator)
|
|
88
|
+
filtered_commands.push(cmd);
|
|
89
|
+
else if (cmd.caption.toLowerCase().includes(key.toLowerCase()))
|
|
90
|
+
filtered_commands.push(cmd);
|
|
91
|
+
else if (cmd.tags && cmd.tags.toLowerCase().includes(key.toLowerCase()))
|
|
92
|
+
filtered_commands.push(cmd);
|
|
93
|
+
});
|
|
84
94
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
else if (cmd.caption.toLowerCase().includes(key.toLowerCase()))
|
|
91
|
-
filtered_commands.push(cmd);
|
|
92
|
-
else if (cmd.tags && cmd.tags.toLowerCase().includes(key.toLowerCase()))
|
|
93
|
-
filtered_commands.push(cmd);
|
|
95
|
+
filtered_commands = filtered_commands.filter((c) => {
|
|
96
|
+
if (c.is_visible)
|
|
97
|
+
return c.is_visible();
|
|
98
|
+
else
|
|
99
|
+
return true;
|
|
94
100
|
});
|
|
95
101
|
if (!current_command || filtered_commands.every((v) => v != current_command)) {
|
|
96
102
|
if (filtered_commands.length)
|
|
@@ -43,13 +43,15 @@ export function activate(e) {
|
|
|
43
43
|
activateItem("props", item, operations);
|
|
44
44
|
}
|
|
45
45
|
function getOperations() {
|
|
46
|
-
let operations = [];
|
|
47
46
|
const getCustomOperations = definition.getCardOperations;
|
|
48
47
|
if (getCustomOperations) {
|
|
49
48
|
const cutomOperations = getCustomOperations(item);
|
|
50
|
-
|
|
49
|
+
if (Array.isArray(cutomOperations)) {
|
|
50
|
+
return [...cutomOperations];
|
|
51
|
+
} else {
|
|
52
|
+
return { ...cutomOperations };
|
|
53
|
+
}
|
|
51
54
|
}
|
|
52
|
-
return operations;
|
|
53
55
|
}
|
|
54
56
|
let card;
|
|
55
57
|
export function _scrollViewToCard() {
|
|
@@ -78,7 +78,7 @@ async function edit_date(field, prop_idx) {
|
|
|
78
78
|
a={prop.a}
|
|
79
79
|
compact={true}
|
|
80
80
|
onSelect={prop.onSelect}
|
|
81
|
-
s=""
|
|
81
|
+
s="sm"
|
|
82
82
|
inContext="props sel"
|
|
83
83
|
bind:this={props[prop_index]}
|
|
84
84
|
changed={(value)=>{on_date_changed(value, prop.a)}}
|
|
@@ -95,7 +95,7 @@ async function edit_date(field, prop_idx) {
|
|
|
95
95
|
bind:this={props[prop_index]}
|
|
96
96
|
definition={prop.combo_definition}
|
|
97
97
|
changed={(key,name)=>{on_combo_changed(key, name, prop)}}
|
|
98
|
-
s=""/>
|
|
98
|
+
s="sm"/>
|
|
99
99
|
{:else if prop.type == rList_property_type.Static}
|
|
100
100
|
<span class="dark:text-white text-stone-400 truncate bg-stone-900/10 dark:bg-stone-100/10 rounded-lg">
|
|
101
101
|
{item[prop.a]}
|
|
@@ -238,7 +238,7 @@ export function scrollToView() {
|
|
|
238
238
|
{#if item}
|
|
239
239
|
{@const element_title = item[title]}
|
|
240
240
|
|
|
241
|
-
<section class="my-1 flex flex-row
|
|
241
|
+
<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]"
|
|
242
242
|
on:contextmenu={on_contextmenu}
|
|
243
243
|
role="menu"
|
|
244
244
|
tabindex="-1"
|
|
@@ -271,7 +271,7 @@ export function scrollToView() {
|
|
|
271
271
|
onSoftEnter: (text) => {change_name(text); editProperty('Summary')}
|
|
272
272
|
}}
|
|
273
273
|
>
|
|
274
|
-
{element_title}
|
|
274
|
+
{element_title}
|
|
275
275
|
</p>
|
|
276
276
|
{:else}
|
|
277
277
|
<p class=" text-base font-semibold
|
|
@@ -283,7 +283,7 @@ export function scrollToView() {
|
|
|
283
283
|
active: true,
|
|
284
284
|
readonly: definition.title_readonly,
|
|
285
285
|
}}>
|
|
286
|
-
{element_title}
|
|
286
|
+
{element_title}
|
|
287
287
|
|
|
288
288
|
{#if definition.onOpen}
|
|
289
289
|
<button class="ml-3 w-5 h-5 sm:w-3 sm:h-3"
|
|
@@ -299,7 +299,7 @@ export function scrollToView() {
|
|
|
299
299
|
|
|
300
300
|
whitespace-nowrap overflow-clip w-full sm:flex-none sm:{name_w}"
|
|
301
301
|
id="__hd_list_ctrl_{item[item_key]}_Title">
|
|
302
|
-
{element_title}
|
|
302
|
+
{element_title}
|
|
303
303
|
</p>
|
|
304
304
|
{/if}
|
|
305
305
|
|
|
@@ -309,12 +309,16 @@ export function scrollToView() {
|
|
|
309
309
|
</section>
|
|
310
310
|
</div>
|
|
311
311
|
|
|
312
|
+
<section class="block sm:hidden w-full">
|
|
313
|
+
<Properties {definition} {item} {placeholder} bind:this={props_sm}/>
|
|
314
|
+
</section>
|
|
315
|
+
|
|
312
316
|
{#if summary && (item[summary] || placeholder=='Summary')}
|
|
313
317
|
{@const element_id = `__hd_list_ctrl_${item[item_key]}_Summary`}
|
|
314
318
|
{#key item[summary] }
|
|
315
319
|
{#if is_row_active}
|
|
316
320
|
<p id={element_id}
|
|
317
|
-
class=" text-sm
|
|
321
|
+
class=" text-sm mb-2
|
|
318
322
|
text-stone-400"
|
|
319
323
|
use:editable={{
|
|
320
324
|
action: (text) => {change_summary(text)},
|
|
@@ -322,23 +326,21 @@ export function scrollToView() {
|
|
|
322
326
|
onFinish: (d) => {placeholder='';},
|
|
323
327
|
active: true
|
|
324
328
|
}}>
|
|
325
|
-
{item[summary]}
|
|
329
|
+
{item[summary]}
|
|
326
330
|
</p>
|
|
327
331
|
{:else}
|
|
328
332
|
<p id={element_id}
|
|
329
|
-
class=" text-sm
|
|
333
|
+
class=" text-sm mb-2
|
|
330
334
|
text-stone-400"
|
|
331
335
|
on:click={(e) => on_active_row_clicked(e, 'bottom')}>
|
|
332
|
-
{item[summary]}
|
|
336
|
+
{item[summary]}
|
|
333
337
|
</p>
|
|
334
338
|
{/if}
|
|
335
339
|
{/key}
|
|
336
340
|
|
|
337
341
|
{/if}
|
|
338
342
|
|
|
339
|
-
|
|
340
|
-
<Properties {definition} {item} {placeholder} bind:this={props_sm}/>
|
|
341
|
-
</section>
|
|
343
|
+
|
|
342
344
|
|
|
343
345
|
</div>
|
|
344
346
|
</section>
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
{/if}
|
|
37
37
|
|
|
38
38
|
{#if !collapsable}
|
|
39
|
-
<ul class="
|
|
39
|
+
<ul class= "{list_border}">
|
|
40
40
|
<slot/>
|
|
41
41
|
</ul>
|
|
42
42
|
{:else if !collapsed}
|
|
43
|
-
<ul class="
|
|
43
|
+
<ul class="{list_border}">
|
|
44
44
|
<slot/>
|
|
45
45
|
</ul>
|
|
46
46
|
{/if}
|