@humandialog/forms.svelte 0.5.24 → 0.6.1

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.
@@ -93,8 +93,6 @@ function setup(...args) {
93
93
  typename = s2[1];
94
94
  }
95
95
  }
96
- if (!label)
97
- label = a;
98
96
  tick_request_internal = tick_request_internal + 1;
99
97
  if (is_compact) {
100
98
  can_be_activated = false;
@@ -549,7 +547,7 @@ function on_focus_out(e) {
549
547
  <div class="{cs} max-w-full inline-block"
550
548
  on:focusout={on_focus_out}
551
549
  bind:this={root_element}>
552
- {#if !is_compact}
550
+ {#if !is_compact && label.length > 0}
553
551
  <label for="name" class="block {label_mb} text-xs font-small text-stone-900 dark:text-white">{label}</label>
554
552
  {/if}
555
553
  <!-- svelte-ignore a11y-click-events-have-key-events -->
@@ -47,14 +47,20 @@ switch (s) {
47
47
  input_pt = "pt-2.5";
48
48
  input_pb = "pb-2.5";
49
49
  font_size = "text-lg sm:text-sm";
50
- line_h = "h-7 sm:h-5";
50
+ if (!is_compact)
51
+ line_h = "h-12 sm:h-10";
52
+ else
53
+ line_h = "h-7 sm:h-5";
51
54
  chevron_mt = "mt-2 sm:mt-1";
52
55
  break;
53
56
  case "xs":
54
57
  input_pt = "pt-0.5";
55
58
  input_pb = "pb-0.5";
56
59
  font_size = "text-base sm:text-xs";
57
- line_h = "h-6 sm:h-4";
60
+ if (!is_compact)
61
+ line_h = "h-7 sm:h-7";
62
+ else
63
+ line_h = "h-6 sm:h-6";
58
64
  chevron_mt = "mt-1.5 sm:mt-0.5";
59
65
  break;
60
66
  }
@@ -78,8 +84,11 @@ let can_be_activated = true;
78
84
  let last_tick = -1;
79
85
  $:
80
86
  setup($data_tick_store, $contextItemsStore);
87
+ export function refresh() {
88
+ setup();
89
+ }
81
90
  function setup(...args) {
82
- last_tick = data_tick_store;
91
+ last_tick = $data_tick_store;
83
92
  if (!date) {
84
93
  item = self ?? $contextItemsStore[ctx];
85
94
  if (!typename)
@@ -320,7 +329,7 @@ function blur(e) {
320
329
  bind:this={input_element}
321
330
  />
322
331
  {:else}
323
- <input class=" dark:text-white {cs} {style} {line_h} px-2.5 {background_class} {user_class}"
332
+ <input class=" dark:text-white {cs} {style} {line_h} px-2.5 {user_class}"
324
333
  type="date"
325
334
  on:change={on_changed}
326
335
  bind:value={rValue}
@@ -16,6 +16,7 @@ declare const __propDef: {
16
16
  inContext?: string | undefined;
17
17
  pushChangesImmediately?: boolean | undefined;
18
18
  show?: ((event: any, hide_callback: any) => void) | undefined;
19
+ refresh?: (() => void) | undefined;
19
20
  };
20
21
  events: {
21
22
  [evt: string]: CustomEvent<any>;
@@ -27,5 +28,6 @@ export type DateEvents = typeof __propDef.events;
27
28
  export type DateSlots = typeof __propDef.slots;
28
29
  export default class Date extends SvelteComponentTyped<DateProps, DateEvents, DateSlots> {
29
30
  get show(): (event: any, hide_callback: any) => void;
31
+ get refresh(): () => void;
30
32
  }
31
33
  export {};
package/modal.svelte CHANGED
@@ -6,7 +6,8 @@ export let content = "";
6
6
  export let icon = void 0;
7
7
  export const OK = 0;
8
8
  export const OKCancel = 1;
9
- export const Custom = 2;
9
+ export const Cancel = 2;
10
+ export const Custom = 3;
10
11
  export let mode = OKCancel;
11
12
  export let okCaption = "OK";
12
13
  export let cancelCaption = "Cancel";
@@ -106,6 +107,10 @@ function on_cancel(event) {
106
107
  <button type="button" class="mt-3 inline-flex w-full justify-center rounded-md bg-white dark:bg-stone-400 px-3 py-2 text-sm font-semibold text-stone-900 shadow-sm hover:bg-stone-50 sm:mt-0 sm:w-auto"
107
108
  on:click={on_cancel}>
108
109
  {cancelCaption}</button>
110
+ {:else if mode == Cancel}
111
+ <button type="button" class="mt-3 inline-flex w-full justify-center rounded-md bg-white dark:bg-stone-400 px-3 py-2 text-sm font-semibold text-stone-900 shadow-sm hover:bg-stone-50 sm:mt-0 sm:w-auto"
112
+ on:click={on_cancel}>
113
+ {cancelCaption}</button>
109
114
  {:else if mode == Custom}
110
115
  <slot name="footer"/>
111
116
  {/if}
package/modal.svelte.d.ts CHANGED
@@ -7,7 +7,8 @@ declare const __propDef: {
7
7
  icon?: undefined;
8
8
  OK?: 0 | undefined;
9
9
  OKCancel?: 1 | undefined;
10
- Custom?: 2 | undefined;
10
+ Cancel?: 2 | undefined;
11
+ Custom?: 3 | undefined;
11
12
  mode?: number | undefined;
12
13
  okCaption?: string | undefined;
13
14
  cancelCaption?: string | undefined;
@@ -30,7 +31,8 @@ export type ModalSlots = typeof __propDef.slots;
30
31
  export default class Modal extends SvelteComponentTyped<ModalProps, ModalEvents, ModalSlots> {
31
32
  get OK(): 0;
32
33
  get OKCancel(): 1;
33
- get Custom(): 2;
34
+ get Cancel(): 2;
35
+ get Custom(): 3;
34
36
  get show(): (on_close_callback?: Function | undefined) => void;
35
37
  get hide(): () => void;
36
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humandialog/forms.svelte",
3
- "version": "0.5.24",
3
+ "version": "0.6.1",
4
4
  "description": "Basic Svelte UI components for Object Reef applications",
5
5
  "devDependencies": {
6
6
  "@playwright/test": "^1.28.1",
@@ -27,9 +27,9 @@
27
27
  "type": "module",
28
28
  "dependencies": {
29
29
  "@humandialog/auth.svelte": "^1.5.5",
30
- "flowbite-svelte": "^0.29.13",
30
+ "flowbite-svelte": "^0.44.4",
31
31
  "svelte-icons": "^2.1.0",
32
- "svelte-spa-router": "^3.3.0"
32
+ "svelte-spa-router": "^4.0.1"
33
33
  },
34
34
  "keywords": [
35
35
  "svelte",