@humandialog/forms.svelte 1.3.15 → 1.3.16
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 +3 -6
- package/components/Floating_container.svelte +5 -4
- package/components/combo/combo.svelte +15 -6
- package/components/contextmenu.svelte +8 -6
- package/components/document/editor.svelte +5 -4
- package/components/inputbox.ltop.svelte +13 -3
- package/components/inputbox.ltop.svelte.d.ts +3 -0
- package/components/kanban/internal/kanban.card.svelte +3 -1
- package/components/kanban/kanban.callbacks.svelte +2 -0
- package/components/kanban/kanban.callbacks.svelte.d.ts +1 -0
- package/components/kanban/kanban.svelte +41 -25
- package/components/kanban/kanban.svelte.d.ts +2 -2
- package/modal.svelte +9 -6
- package/operations.svelte +4 -7
- package/package.json +1 -1
- package/stores.d.ts +2 -0
- package/stores.js +25 -0
package/components/Fab.svelte
CHANGED
|
@@ -66,15 +66,12 @@ export function activateMainOperation() {
|
|
|
66
66
|
function on_click(e, operation) {
|
|
67
67
|
if (!operation)
|
|
68
68
|
return;
|
|
69
|
-
if (operation.action) {
|
|
70
|
-
let focused_item = null;
|
|
71
|
-
if ($contextItemsStore.focused)
|
|
72
|
-
focused_item = $contextItemsStore[$contextItemsStore.focused];
|
|
73
|
-
operation.action(focused_item);
|
|
74
|
-
}
|
|
75
69
|
let owner = e.target;
|
|
76
70
|
while (owner && (owner.tagName != "BUTTON" && owner.tagName != "LI"))
|
|
77
71
|
owner = owner.parentElement;
|
|
72
|
+
if (operation.action) {
|
|
73
|
+
operation.action(owner);
|
|
74
|
+
}
|
|
78
75
|
if (!owner)
|
|
79
76
|
return;
|
|
80
77
|
let rect = owner.getBoundingClientRect();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { tick, afterUpdate } from "svelte";
|
|
2
2
|
import { isDeviceSmallerThan } from "../utils";
|
|
3
|
-
import {
|
|
3
|
+
import { pushToolsActionsOperations, popToolsActionsOperations } from "../stores";
|
|
4
4
|
import { FaTimes } from "svelte-icons/fa";
|
|
5
5
|
let x;
|
|
6
6
|
let y;
|
|
@@ -35,7 +35,7 @@ export async function show(around, _toolbar, _props = {}) {
|
|
|
35
35
|
hide_window_indicator = 0;
|
|
36
36
|
window.addEventListener("click", on_before_window_click, true);
|
|
37
37
|
if (isDeviceSmallerThan("sm")) {
|
|
38
|
-
|
|
38
|
+
pushToolsActionsOperations({
|
|
39
39
|
opver: 1,
|
|
40
40
|
operations: [
|
|
41
41
|
{
|
|
@@ -52,7 +52,7 @@ export async function show(around, _toolbar, _props = {}) {
|
|
|
52
52
|
]
|
|
53
53
|
}
|
|
54
54
|
]
|
|
55
|
-
};
|
|
55
|
+
});
|
|
56
56
|
}
|
|
57
57
|
await tick();
|
|
58
58
|
if (!was_visible)
|
|
@@ -63,9 +63,10 @@ export function isVisible() {
|
|
|
63
63
|
return visible;
|
|
64
64
|
}
|
|
65
65
|
export function hide() {
|
|
66
|
+
if (visible)
|
|
67
|
+
popToolsActionsOperations();
|
|
66
68
|
visible = false;
|
|
67
69
|
cssPosition = calculatePosition(x, y, around_rect, false, false);
|
|
68
|
-
$toolsActionsOperations = [];
|
|
69
70
|
window.removeEventListener("click", on_before_window_click, true);
|
|
70
71
|
rootElement?.removeEventListener("click", on_before_container_click, true);
|
|
71
72
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import { data_tick_store, contextItemsStore, contextTypesStore,
|
|
1
|
+
<script>import { data_tick_store, contextItemsStore, contextTypesStore, pushToolsActionsOperations, popToolsActionsOperations } from "../../stores.js";
|
|
2
2
|
import { informModification, pushChanges } from "../../updates.js";
|
|
3
3
|
import { isDeviceSmallerThan, parseWidthDirective, shouldBeComapact } from "../../utils.js";
|
|
4
4
|
import { afterUpdate, getContext, onMount, setContext } from "svelte";
|
|
@@ -171,7 +171,11 @@ 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;
|
|
175
|
+
if (is_compact)
|
|
176
|
+
rect = textbox.getBoundingClientRect();
|
|
177
|
+
else
|
|
178
|
+
rect = combo.getBoundingClientRect();
|
|
175
179
|
let top_space = rect.y;
|
|
176
180
|
let bottom_space = client_rect.height - (rect.y + rect.height);
|
|
177
181
|
let palette_max_height_px = 500;
|
|
@@ -216,6 +220,8 @@ export function show(event, hide_callback) {
|
|
|
216
220
|
dropdown_position = `min-width: ${palette_width_px}px; max-height:${palette_max_height_px}px; position: fixed; left:${x}px; top:${y}px;`;
|
|
217
221
|
if (show_above)
|
|
218
222
|
dropdown_position += " transform: translate(0, -100%);";
|
|
223
|
+
if (!is_compact)
|
|
224
|
+
dropdown_position += `width: ${preferred_palette_width}px`;
|
|
219
225
|
}
|
|
220
226
|
is_dropdown_open = true;
|
|
221
227
|
if (filtered) {
|
|
@@ -235,7 +241,7 @@ export function show(event, hide_callback) {
|
|
|
235
241
|
});
|
|
236
242
|
}
|
|
237
243
|
if (isDeviceSmallerThan("sm")) {
|
|
238
|
-
|
|
244
|
+
pushToolsActionsOperations({
|
|
239
245
|
opver: 1,
|
|
240
246
|
operations: [
|
|
241
247
|
{
|
|
@@ -252,14 +258,16 @@ export function show(event, hide_callback) {
|
|
|
252
258
|
]
|
|
253
259
|
}
|
|
254
260
|
]
|
|
255
|
-
};
|
|
261
|
+
});
|
|
256
262
|
}
|
|
257
263
|
}
|
|
258
264
|
export function hide() {
|
|
265
|
+
if (!is_dropdown_open)
|
|
266
|
+
return;
|
|
259
267
|
if (mutation_observer)
|
|
260
268
|
mutation_observer.disconnect();
|
|
261
269
|
is_dropdown_open = false;
|
|
262
|
-
|
|
270
|
+
popToolsActionsOperations();
|
|
263
271
|
dropdown_position = "display: none;";
|
|
264
272
|
combo_text = get_combo_text();
|
|
265
273
|
if (!!textbox)
|
|
@@ -643,7 +651,8 @@ function on_focus_out(e) {
|
|
|
643
651
|
{combo_text}</span>
|
|
644
652
|
|
|
645
653
|
{#if can_be_activated }
|
|
646
|
-
<div class="w-3 h-3 no-print flex-none text-stone-700 dark:text-stone-300 {chevron_mt}"
|
|
654
|
+
<div class="w-3 h-3 no-print flex-none text-stone-700 dark:text-stone-300 {chevron_mt}"
|
|
655
|
+
class:ms-auto={!is_compact}>
|
|
647
656
|
<FaChevronDown/>
|
|
648
657
|
</div>
|
|
649
658
|
{/if}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { afterUpdate, tick } from "svelte";
|
|
2
2
|
import Icon from "./icon.svelte";
|
|
3
|
-
import { contextItemsStore,
|
|
3
|
+
import { contextItemsStore, pushToolsActionsOperations, popToolsActionsOperations } from "../stores";
|
|
4
4
|
import { isDeviceSmallerThan, isOnScreenKeyboardVisible } from "../utils";
|
|
5
5
|
import { hideWholeContextMenu } from "./menu";
|
|
6
6
|
import { FaTimes } from "svelte-icons/fa";
|
|
@@ -109,7 +109,7 @@ export async function show(around, _operations) {
|
|
|
109
109
|
window.addEventListener("click", on_before_window_click, true);
|
|
110
110
|
}
|
|
111
111
|
if (isDeviceSmallerThan("sm")) {
|
|
112
|
-
|
|
112
|
+
pushToolsActionsOperations({
|
|
113
113
|
opver: 1,
|
|
114
114
|
operations: [
|
|
115
115
|
{
|
|
@@ -126,7 +126,7 @@ export async function show(around, _operations) {
|
|
|
126
126
|
]
|
|
127
127
|
}
|
|
128
128
|
]
|
|
129
|
-
};
|
|
129
|
+
});
|
|
130
130
|
}
|
|
131
131
|
await tick();
|
|
132
132
|
css_position = calculatePosition(x, y, around_rect, true, false);
|
|
@@ -139,7 +139,8 @@ export function isVisible() {
|
|
|
139
139
|
return visible;
|
|
140
140
|
}
|
|
141
141
|
export function hide() {
|
|
142
|
-
|
|
142
|
+
if (visible)
|
|
143
|
+
popToolsActionsOperations();
|
|
143
144
|
visible = false;
|
|
144
145
|
css_position = calculatePosition(x, y, around_rect, false, false);
|
|
145
146
|
window.removeEventListener("click", on_before_window_click, true);
|
|
@@ -319,8 +320,9 @@ function mousedown(e) {
|
|
|
319
320
|
<p> {operation.caption}</p>
|
|
320
321
|
{#if operation.description}
|
|
321
322
|
{@const shortcut_width_px = operation.shortcut ? 80 : 0}
|
|
322
|
-
<p class="text-sm font-normal text-stone-900 dark:text-stone-500 truncate inline-block"
|
|
323
|
-
|
|
323
|
+
<p class=" text-sm font-normal text-stone-900 dark:text-stone-500 truncate inline-block">
|
|
324
|
+
{operation.description}
|
|
325
|
+
</p>
|
|
324
326
|
{/if}
|
|
325
327
|
</div>
|
|
326
328
|
{#if has_submenu}
|
|
@@ -26,7 +26,7 @@ import Underline from "@tiptap/extension-underline";
|
|
|
26
26
|
import Dropcursor from "@tiptap/extension-dropcursor";
|
|
27
27
|
import Gapcursor from "@tiptap/extension-gapcursor";
|
|
28
28
|
import History from "@tiptap/extension-history";
|
|
29
|
-
import { data_tick_store, contextItemsStore, contextTypesStore, onErrorShowAlert,
|
|
29
|
+
import { data_tick_store, contextItemsStore, contextTypesStore, onErrorShowAlert, pushToolsActionsOperations, popToolsActionsOperations } from "../../stores.js";
|
|
30
30
|
import { informModification, pushChanges } from "../../updates.js";
|
|
31
31
|
import { isDeviceSmallerThan, parseWidthDirective, refreshToolbarOperations, UI } from "../../utils.js";
|
|
32
32
|
import Palette from "./internal/palette.svelte";
|
|
@@ -591,7 +591,7 @@ function on_palette_mouse_click() {
|
|
|
591
591
|
function on_palette_shown() {
|
|
592
592
|
is_command_palette_visible = true;
|
|
593
593
|
if (isDeviceSmallerThan("sm")) {
|
|
594
|
-
|
|
594
|
+
pushToolsActionsOperations({
|
|
595
595
|
opver: 1,
|
|
596
596
|
operations: [
|
|
597
597
|
{
|
|
@@ -609,12 +609,13 @@ function on_palette_shown() {
|
|
|
609
609
|
]
|
|
610
610
|
}
|
|
611
611
|
]
|
|
612
|
-
};
|
|
612
|
+
});
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
615
|
function on_palette_hidden() {
|
|
616
|
+
if (is_command_palette_visible)
|
|
617
|
+
popToolsActionsOperations();
|
|
616
618
|
is_command_palette_visible = false;
|
|
617
|
-
$toolsActionsOperations = [];
|
|
618
619
|
}
|
|
619
620
|
function show_command_palette(cursor_rect) {
|
|
620
621
|
let client_rect = get_window_box();
|
|
@@ -52,17 +52,27 @@
|
|
|
52
52
|
itype = itype;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
export function refresh(itm=undefined)
|
|
56
|
+
{
|
|
57
|
+
if(itm)
|
|
58
|
+
self = itm;
|
|
59
|
+
|
|
60
|
+
item = self ?? $contextItemsStore[ctx];
|
|
61
|
+
setup()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
let userClass = $$restProps.class ?? '';
|
|
55
65
|
|
|
56
66
|
let item = null
|
|
57
67
|
|
|
58
|
-
let labelMargins = '
|
|
68
|
+
let labelMargins = 'mb-0.5' //
|
|
59
69
|
let input_pt = 'pt-0.5'
|
|
60
70
|
let input_pb = 'pb-1'
|
|
61
71
|
|
|
62
72
|
switch (s)
|
|
63
73
|
{
|
|
64
74
|
case 'md':
|
|
65
|
-
labelMargins = '
|
|
75
|
+
labelMargins = 'mb-1';
|
|
66
76
|
input_pt = 'pt-2.5'
|
|
67
77
|
input_pb = 'pb-2.5';
|
|
68
78
|
break;
|
|
@@ -127,7 +137,7 @@
|
|
|
127
137
|
|
|
128
138
|
{#if itype == 'text'}
|
|
129
139
|
{@const border_style = invalid ? "border-red-300 dark:border-red-600" : "border-stone-300 dark:border-stone-500" }
|
|
130
|
-
<div class={cs}>
|
|
140
|
+
<div class="{cs} {userClass}">
|
|
131
141
|
<label for="name" class="block {labelMargins} text-xs font-small text-stone-900 dark:text-white">{label}</label>
|
|
132
142
|
|
|
133
143
|
<input type=text name="name" id="name"
|
|
@@ -20,11 +20,13 @@ export default class Inputbox extends SvelteComponentTyped<{
|
|
|
20
20
|
validation?: any;
|
|
21
21
|
validate?: (() => boolean) | undefined;
|
|
22
22
|
setReadonly?: ((val: any) => void) | undefined;
|
|
23
|
+
refresh?: ((itm?: undefined) => void) | undefined;
|
|
23
24
|
}, {
|
|
24
25
|
[evt: string]: CustomEvent<any>;
|
|
25
26
|
}, {}> {
|
|
26
27
|
get validate(): () => boolean;
|
|
27
28
|
get setReadonly(): (val: any) => void;
|
|
29
|
+
get refresh(): (itm?: undefined) => void;
|
|
28
30
|
}
|
|
29
31
|
export type InputboxProps = typeof __propDef.props;
|
|
30
32
|
export type InputboxEvents = typeof __propDef.events;
|
|
@@ -50,6 +52,7 @@ declare const __propDef: {
|
|
|
50
52
|
validation?: any;
|
|
51
53
|
validate?: (() => boolean) | undefined;
|
|
52
54
|
setReadonly?: ((val: any) => void) | undefined;
|
|
55
|
+
refresh?: ((itm?: undefined) => void) | undefined;
|
|
53
56
|
};
|
|
54
57
|
events: {
|
|
55
58
|
[evt: string]: CustomEvent<any>;
|
|
@@ -210,7 +210,7 @@ function showAttachementIcon() {
|
|
|
210
210
|
{@const canOpen = isLinkLike || hasOpen}
|
|
211
211
|
{@const openableClass = canOpen ? "sm:hover:cursor-pointer underline" : ""}
|
|
212
212
|
{@const showIcon = showAttachementIcon()}
|
|
213
|
-
<h3 class=" text-base font-semibold pb-1
|
|
213
|
+
<h3 class=" h3 text-base font-semibold pb-1
|
|
214
214
|
whitespace-nowrap overflow-clip truncate w-full sm:flex-none
|
|
215
215
|
relative {openableClass}"
|
|
216
216
|
use:editable={{
|
|
@@ -224,7 +224,9 @@ function showAttachementIcon() {
|
|
|
224
224
|
condition: canOpen,
|
|
225
225
|
callback: performOpen}}
|
|
226
226
|
bind:this={titleElement}>
|
|
227
|
+
<!--a href="#"-->
|
|
227
228
|
{item[definition.titleAttrib]}
|
|
229
|
+
<!--/a-->
|
|
228
230
|
|
|
229
231
|
{#if showIcon}
|
|
230
232
|
<span id="attachement" class="absolute top-1 right-0 w-5 h-5 sm:w-3 sm:h-3">
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script>import { getContext } from "svelte";
|
|
2
2
|
export let onAdd = void 0;
|
|
3
3
|
export let onOpen = void 0;
|
|
4
|
+
export let onReplace = void 0;
|
|
4
5
|
export let getCardOperations = void 0;
|
|
5
6
|
let definition = getContext("rKanban-definition");
|
|
6
7
|
definition.onAdd = onAdd;
|
|
7
8
|
definition.onOpen = onOpen;
|
|
9
|
+
definition.onReplace = onReplace;
|
|
8
10
|
definition.getCardOperations = getCardOperations;
|
|
9
11
|
</script>
|
|
@@ -200,7 +200,7 @@ export function moveDown(item) {
|
|
|
200
200
|
}
|
|
201
201
|
const ORDER_STEP = 64;
|
|
202
202
|
const MIN_ORDER = 0;
|
|
203
|
-
function reorderElements(items, from = null) {
|
|
203
|
+
function reorderElements(items, from = null, pushImediatelly = true) {
|
|
204
204
|
const oa = definition.orderAttrib;
|
|
205
205
|
let fromIdx;
|
|
206
206
|
let fromOrder;
|
|
@@ -218,9 +218,10 @@ function reorderElements(items, from = null) {
|
|
|
218
218
|
informModification(el, oa);
|
|
219
219
|
order += ORDER_STEP;
|
|
220
220
|
}
|
|
221
|
-
|
|
221
|
+
if (pushImediatelly)
|
|
222
|
+
pushChanges();
|
|
222
223
|
}
|
|
223
|
-
export function replace(item, toColumnIdx, afterElement) {
|
|
224
|
+
export async function replace(item, toColumnIdx, afterElement) {
|
|
224
225
|
const fromColumnIdx = getColumnIdx(item);
|
|
225
226
|
let allItems = definition.getItems();
|
|
226
227
|
const oa = definition.orderAttrib;
|
|
@@ -230,18 +231,21 @@ export function replace(item, toColumnIdx, afterElement) {
|
|
|
230
231
|
const toListBottom = allItems.findLast((e) => e[sa] == toColumnState);
|
|
231
232
|
const fromColumn = columns[fromColumnIdx];
|
|
232
233
|
const toColumn = columns[toColumnIdx];
|
|
234
|
+
const propsChanges = {
|
|
235
|
+
order: -1,
|
|
236
|
+
state: -1
|
|
237
|
+
};
|
|
233
238
|
switch (afterElement) {
|
|
234
239
|
case KanbanColumnTop:
|
|
235
240
|
if (!toListTop || toListTop[oa] > item[oa]) {
|
|
236
|
-
|
|
237
|
-
informModification(item, sa);
|
|
241
|
+
propsChanges.state = toColumnState;
|
|
238
242
|
} else {
|
|
239
243
|
const prevItem = getPrev(allItems, toListTop);
|
|
240
244
|
if (!prevItem) {
|
|
241
|
-
item[sa] = toColumnState;
|
|
242
245
|
item[oa] = toListTop[oa] - ORDER_STEP;
|
|
243
|
-
informModification(item, sa);
|
|
244
246
|
informModification(item, oa);
|
|
247
|
+
propsChanges.state = toColumnState;
|
|
248
|
+
propsChanges.order = item[oa];
|
|
245
249
|
remove(allItems, item);
|
|
246
250
|
insertAt(allItems, 0, item);
|
|
247
251
|
} else {
|
|
@@ -249,35 +253,31 @@ export function replace(item, toColumnIdx, afterElement) {
|
|
|
249
253
|
let nextOrder = toListTop[oa];
|
|
250
254
|
let orderSpace = nextOrder - prevOrder;
|
|
251
255
|
if (orderSpace < 2) {
|
|
252
|
-
reorderElements(allItems, prevItem);
|
|
256
|
+
reorderElements(allItems, prevItem, false);
|
|
253
257
|
prevOrder = prevItem[oa];
|
|
254
258
|
nextOrder = toListTop[oa];
|
|
255
259
|
orderSpace = nextOrder - prevOrder;
|
|
256
260
|
}
|
|
257
|
-
item[sa] = toColumnState;
|
|
258
261
|
item[oa] = prevOrder + Math.floor(orderSpace / 2);
|
|
259
|
-
informModification(item, sa);
|
|
260
262
|
informModification(item, oa);
|
|
263
|
+
propsChanges.state = toColumnState;
|
|
264
|
+
propsChanges.order = item[oa];
|
|
261
265
|
remove(allItems, item);
|
|
262
266
|
insertAfter(allItems, prevItem, item);
|
|
263
267
|
}
|
|
264
268
|
}
|
|
265
|
-
|
|
266
|
-
fromColumn.reload();
|
|
267
|
-
toColumn.reload();
|
|
268
|
-
return;
|
|
269
|
+
break;
|
|
269
270
|
case KanbanColumnBottom:
|
|
270
271
|
default:
|
|
271
272
|
if (!toListBottom || item[oa] > toListBottom[oa]) {
|
|
272
|
-
|
|
273
|
-
informModification(item, sa);
|
|
273
|
+
propsChanges.state = toColumnState;
|
|
274
274
|
} else {
|
|
275
275
|
const nextItem = getNext(allItems, toListBottom);
|
|
276
276
|
if (!nextItem) {
|
|
277
|
-
item[sa] = toColumnState;
|
|
278
277
|
item[oa] = toListBottom[oa] + ORDER_STEP;
|
|
279
|
-
informModification(item, sa);
|
|
280
278
|
informModification(item, oa);
|
|
279
|
+
propsChanges.state = toColumnState;
|
|
280
|
+
propsChanges.order = item[oa];
|
|
281
281
|
remove(allItems, item);
|
|
282
282
|
insertAfter(allItems, toListBottom, item);
|
|
283
283
|
} else {
|
|
@@ -285,23 +285,39 @@ export function replace(item, toColumnIdx, afterElement) {
|
|
|
285
285
|
let prevOrder = toListBottom[oa];
|
|
286
286
|
let orderSpace = nextOrder - prevOrder;
|
|
287
287
|
if (orderSpace < 2) {
|
|
288
|
-
reorderElements(allItems, toListBottom);
|
|
288
|
+
reorderElements(allItems, toListBottom, false);
|
|
289
289
|
prevOrder = toListBottom[oa];
|
|
290
290
|
nextOrder = nextItem[oa];
|
|
291
291
|
orderSpace = nextOrder - prevOrder;
|
|
292
292
|
}
|
|
293
|
-
item[sa] = toColumnState;
|
|
294
293
|
item[oa] = prevOrder + Math.floor(orderSpace / 2);
|
|
295
|
-
informModification(item, sa);
|
|
296
294
|
informModification(item, oa);
|
|
295
|
+
propsChanges.state = toColumnState;
|
|
296
|
+
propsChanges.order = item[oa];
|
|
297
297
|
remove(allItems, item);
|
|
298
298
|
insertAfter(allItems, toListBottom, item);
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
if (definition.onReplace) {
|
|
304
|
+
if (propsChanges.state >= 0) {
|
|
301
305
|
pushChanges();
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
306
|
+
}
|
|
307
|
+
const req = {
|
|
308
|
+
[sa]: propsChanges.state,
|
|
309
|
+
item,
|
|
310
|
+
toColumn: toColumnIdx
|
|
311
|
+
};
|
|
312
|
+
await definition.onReplace(req);
|
|
313
|
+
} else {
|
|
314
|
+
if (propsChanges.state >= 0) {
|
|
315
|
+
item[sa] = propsChanges.state;
|
|
316
|
+
informModification(item, sa);
|
|
317
|
+
}
|
|
318
|
+
pushChanges();
|
|
319
|
+
fromColumn.reload();
|
|
320
|
+
toColumn.reload();
|
|
305
321
|
}
|
|
306
322
|
}
|
|
307
323
|
async function onInsert(columnIdx, title2, summary, afterId) {
|
|
@@ -397,7 +413,7 @@ async function onInsert(columnIdx, title2, summary, afterId) {
|
|
|
397
413
|
}
|
|
398
414
|
}
|
|
399
415
|
if (definition.onAdd)
|
|
400
|
-
await definition.onAdd(newElement);
|
|
416
|
+
await definition.onAdd(newElement, columnIdx);
|
|
401
417
|
}
|
|
402
418
|
export function activateColumn(columnIdx) {
|
|
403
419
|
columns[columnIdx].activate();
|
|
@@ -16,7 +16,7 @@ declare const __propDef: {
|
|
|
16
16
|
scrollViewToCard?: ((item: any) => void) | undefined;
|
|
17
17
|
moveUp?: ((item: object) => void) | undefined;
|
|
18
18
|
moveDown?: ((item: object) => void) | undefined;
|
|
19
|
-
replace?: ((item: any, toColumnIdx: any, afterElement: any) => void) | undefined;
|
|
19
|
+
replace?: ((item: any, toColumnIdx: any, afterElement: any) => Promise<void>) | undefined;
|
|
20
20
|
activateColumn?: ((columnIdx: number) => void) | undefined;
|
|
21
21
|
editColumnName?: ((columnIdx: number, onFinish?: Function | undefined) => void) | undefined;
|
|
22
22
|
moveCardsTo?: ((items: object[], toColumnIdx: number) => void) | undefined;
|
|
@@ -55,7 +55,7 @@ export default class Kanban extends SvelteComponentTyped<KanbanProps, KanbanEven
|
|
|
55
55
|
get scrollViewToCard(): (item: any) => void;
|
|
56
56
|
get moveUp(): (item: object) => void;
|
|
57
57
|
get moveDown(): (item: object) => void;
|
|
58
|
-
get replace(): (item: any, toColumnIdx: any, afterElement: any) => void
|
|
58
|
+
get replace(): (item: any, toColumnIdx: any, afterElement: any) => Promise<void>;
|
|
59
59
|
get activateColumn(): (columnIdx: number) => void;
|
|
60
60
|
get editColumnName(): (columnIdx: number, onFinish?: Function | undefined) => void;
|
|
61
61
|
get moveCardsTo(): (items: object[], toColumnIdx: number) => void;
|
package/modal.svelte
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { afterUpdate, onMount, tick } from "svelte";
|
|
2
2
|
import Icon from "./components/icon.svelte";
|
|
3
|
-
import {
|
|
3
|
+
import { pushToolsActionsOperations, popToolsActionsOperations } from "./stores.js";
|
|
4
4
|
import { isDeviceSmallerThan } from "./utils";
|
|
5
5
|
import { FaTimes } from "svelte-icons/fa";
|
|
6
6
|
export let title = "";
|
|
@@ -20,7 +20,7 @@ export function show(on_close_callback = void 0) {
|
|
|
20
20
|
open = true;
|
|
21
21
|
close_callback = on_close_callback;
|
|
22
22
|
if (isDeviceSmallerThan("sm")) {
|
|
23
|
-
|
|
23
|
+
pushToolsActionsOperations({
|
|
24
24
|
opver: 1,
|
|
25
25
|
operations: [
|
|
26
26
|
{
|
|
@@ -37,12 +37,14 @@ export function show(on_close_callback = void 0) {
|
|
|
37
37
|
]
|
|
38
38
|
}
|
|
39
39
|
]
|
|
40
|
-
};
|
|
40
|
+
});
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
export function hide() {
|
|
44
|
+
if (!open)
|
|
45
|
+
return;
|
|
44
46
|
open = false;
|
|
45
|
-
|
|
47
|
+
popToolsActionsOperations();
|
|
46
48
|
}
|
|
47
49
|
let root;
|
|
48
50
|
afterUpdate(
|
|
@@ -98,8 +100,9 @@ function on_cancel(event) {
|
|
|
98
100
|
From: "opacity-100 translate-y-0 sm:scale-100"
|
|
99
101
|
To: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
100
102
|
-->
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
|
|
104
|
+
<div class=" rounded-lg bg-white dark:bg-stone-700 text-left shadow-xl transition-all
|
|
105
|
+
sm:my-8 w-full sm:max-w-lg"> <!-- transform overflow-hidden -->
|
|
103
106
|
<div class="bg-white dark:bg-stone-700 px-4 pb-4 pt-5 sm:p-6 sm:pb-4">
|
|
104
107
|
<div class="sm:flex sm:items-start">
|
|
105
108
|
<div class="mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-blue-100 sm:mx-0 sm:h-10 sm:w-10">
|
package/operations.svelte
CHANGED
|
@@ -46,16 +46,13 @@ function update(...args) {
|
|
|
46
46
|
function on_click(e, operation) {
|
|
47
47
|
if (!operation)
|
|
48
48
|
return;
|
|
49
|
-
if (operation.action) {
|
|
50
|
-
let focused_item = null;
|
|
51
|
-
if ($contextItemsStore.focused)
|
|
52
|
-
focused_item = $contextItemsStore[$contextItemsStore.focused];
|
|
53
|
-
operation.action(focused_item);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
49
|
let owner = e.target;
|
|
57
50
|
while (owner && owner.tagName != "BUTTON")
|
|
58
51
|
owner = owner.parentElement;
|
|
52
|
+
if (operation.action) {
|
|
53
|
+
operation.action(owner);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
59
56
|
if (!owner)
|
|
60
57
|
return;
|
|
61
58
|
let rect = owner.getBoundingClientRect();
|
package/package.json
CHANGED
package/stores.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export function pushToolsActionsOperations(operations: any): void;
|
|
2
|
+
export function popToolsActionsOperations(): void;
|
|
1
3
|
export function setNavigatorTitle(key: any, title: any): void;
|
|
2
4
|
export function hasSelectedItem(): boolean;
|
|
3
5
|
export function hasDataItem(): boolean;
|
package/stores.js
CHANGED
|
@@ -15,6 +15,31 @@ export const mainContentPageReloader = writable(1);
|
|
|
15
15
|
export const wholeAppReloader = writable(1)
|
|
16
16
|
export const alerts = writable([])
|
|
17
17
|
|
|
18
|
+
|
|
19
|
+
let toolsActionsOperationsStack = []
|
|
20
|
+
export function pushToolsActionsOperations(operations)
|
|
21
|
+
{
|
|
22
|
+
toolsActionsOperationsStack.push(operations)
|
|
23
|
+
toolsActionsOperations.set(operations)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function popToolsActionsOperations()
|
|
27
|
+
{
|
|
28
|
+
toolsActionsOperationsStack.pop();
|
|
29
|
+
const stackSize = toolsActionsOperationsStack.length;
|
|
30
|
+
if(stackSize == 0)
|
|
31
|
+
{
|
|
32
|
+
//console.log('stack empty')
|
|
33
|
+
toolsActionsOperations.set([])
|
|
34
|
+
}
|
|
35
|
+
else
|
|
36
|
+
{
|
|
37
|
+
const lastElement = toolsActionsOperationsStack[stackSize-1];
|
|
38
|
+
//console.log('stack not empty (stackSize)', lastElement)
|
|
39
|
+
toolsActionsOperations.set(lastElement)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
18
43
|
export const addAlert = (txt) => {
|
|
19
44
|
let al = get(alerts)
|
|
20
45
|
al = [txt, ...al];
|