@humandialog/forms.svelte 0.4.15 → 0.4.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/button.svelte +5 -11
- package/components/combo/combo.svelte +9 -9
- package/desk.svelte +1 -1
- package/package.json +2 -2
- package/updates.js +3 -7
package/components/button.svelte
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import { Button } from "flowbite-svelte";
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
3
|
import { data_tick_store, context_items_store, context_types_store } from "../stores.js";
|
|
4
|
-
import {
|
|
4
|
+
import { reef } from "@humandialog/auth.svelte/dist/index.js";
|
|
5
5
|
export let self = null;
|
|
6
6
|
export let operation = "";
|
|
7
7
|
export let params = null;
|
|
@@ -43,16 +43,10 @@ async function click() {
|
|
|
43
43
|
} else if (item && operation && typename) {
|
|
44
44
|
try {
|
|
45
45
|
let res;
|
|
46
|
-
if (params)
|
|
47
|
-
res = await
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
method: "POST",
|
|
51
|
-
body: JSON.stringify(params)
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
} else
|
|
55
|
-
res = await Auth.fetch(`json/yav1/${typename}/${item.Id}/${operation}`);
|
|
46
|
+
if (params)
|
|
47
|
+
res = await reef.post(`/${typename}/${item.Id}/${operation}`, params);
|
|
48
|
+
else
|
|
49
|
+
res = await reef.get(`/${typename}/${item.Id}/${operation}`);
|
|
56
50
|
if (res.ok)
|
|
57
51
|
$data_tick_store = $data_tick_store + 1;
|
|
58
52
|
} catch (err) {
|
|
@@ -5,7 +5,7 @@ import { afterUpdate, getContext, onMount, setContext } from "svelte";
|
|
|
5
5
|
import { rCombo_definition, rCombo_item, cached_sources } from "./combo";
|
|
6
6
|
import FaChevronDown from "svelte-icons/fa/FaChevronDown.svelte";
|
|
7
7
|
import Icon from "../icon.svelte";
|
|
8
|
-
import {
|
|
8
|
+
import { reef } from "@humandialog/auth.svelte/dist/index.js";
|
|
9
9
|
export let label = "";
|
|
10
10
|
export let self = null;
|
|
11
11
|
export let a = "";
|
|
@@ -267,7 +267,7 @@ async function on_choose(itm) {
|
|
|
267
267
|
let fields = calc_path_fields_param();
|
|
268
268
|
if (fields)
|
|
269
269
|
path += fields;
|
|
270
|
-
let result = await
|
|
270
|
+
let result = await reef.post(`/${path}`, body);
|
|
271
271
|
if (result) {
|
|
272
272
|
let result_typename = Object.keys(result)[0];
|
|
273
273
|
item[a] = result[result_typename];
|
|
@@ -276,10 +276,10 @@ async function on_choose(itm) {
|
|
|
276
276
|
} else {
|
|
277
277
|
let path;
|
|
278
278
|
if (item.$ref)
|
|
279
|
-
path =
|
|
279
|
+
path = `/${item.$ref}/set`;
|
|
280
280
|
else if (typename && item.Id)
|
|
281
|
-
path =
|
|
282
|
-
let result = await
|
|
281
|
+
path = `/${typename}/${item.Id}/set`;
|
|
282
|
+
let result = await reef.post(
|
|
283
283
|
path,
|
|
284
284
|
{
|
|
285
285
|
[a]: {
|
|
@@ -300,14 +300,14 @@ async function on_choose(itm) {
|
|
|
300
300
|
if (choice_callback) {
|
|
301
301
|
let path;
|
|
302
302
|
if (item.$ref)
|
|
303
|
-
path =
|
|
303
|
+
path = `/${item.$ref}/${choice_callback}`;
|
|
304
304
|
else
|
|
305
|
-
path =
|
|
305
|
+
path = `/${typename}/${item.Id}/${choice_callback}`;
|
|
306
306
|
let fields = calc_path_fields_param();
|
|
307
307
|
if (fields)
|
|
308
308
|
path += fields;
|
|
309
309
|
let value = itm.Key ?? itm.Name;
|
|
310
|
-
let result = await
|
|
310
|
+
let result = await reef.post(path, { choice: value });
|
|
311
311
|
if (result) {
|
|
312
312
|
item[a] = result;
|
|
313
313
|
tick_request_internal = tick_request_internal + 1;
|
|
@@ -438,7 +438,7 @@ async function get_source_collection(path, cache_key) {
|
|
|
438
438
|
let fields = calc_path_fields_param();
|
|
439
439
|
if (fields)
|
|
440
440
|
path += fields;
|
|
441
|
-
let res = await
|
|
441
|
+
let res = await reef.get(path);
|
|
442
442
|
resolve(res);
|
|
443
443
|
});
|
|
444
444
|
if (!cached)
|
package/desk.svelte
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
set_default_tools_visible,
|
|
16
16
|
set_dark_mode_default } from './stores.js'
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import { AuthorizedView} from '@humandialog/auth.svelte'
|
|
19
19
|
import { handle_select, is_device_smaller_than } from './utils'
|
|
20
20
|
import { onMount } from 'svelte';
|
|
21
21
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humandialog/forms.svelte",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.16",
|
|
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.0
|
|
29
|
+
"@humandialog/auth.svelte": "^1.1.0",
|
|
30
30
|
"flowbite-svelte": "^0.29.13",
|
|
31
31
|
"svelte-icons": "^2.1.0",
|
|
32
32
|
"svelte-spa-router": "^3.3.0"
|
package/updates.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {writable} from 'svelte/store';
|
|
2
|
-
import {
|
|
2
|
+
import {reef} from '@humandialog/auth.svelte/dist/index'
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
const modified_item_store = writable(null);
|
|
@@ -75,12 +75,8 @@ update_request_ticket.subscribe(async (v) => {
|
|
|
75
75
|
|
|
76
76
|
try
|
|
77
77
|
{
|
|
78
|
-
console.log('push: ', changes);
|
|
79
|
-
const res = await
|
|
80
|
-
{
|
|
81
|
-
method: "POST",
|
|
82
|
-
body: JSON.stringify({ Items: changes }),
|
|
83
|
-
});
|
|
78
|
+
//console.log('push: ', changes);
|
|
79
|
+
const res = await reef.post('/Push', { Items: changes });
|
|
84
80
|
|
|
85
81
|
if(res)
|
|
86
82
|
{
|