@dosgato/dialog 0.0.42 → 0.0.44
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/Dialog.svelte +3 -1
- package/FieldHidden.svelte +5 -2
- package/Tab.svelte +9 -5
- package/Tabs.svelte +17 -13
- package/package.json +1 -1
package/Dialog.svelte
CHANGED
|
@@ -55,7 +55,9 @@ $: describedby = [title ? labelid : undefined, descid].filter(isNotBlank).join('
|
|
|
55
55
|
{#if isNotBlank(cancelText)}
|
|
56
56
|
<Button cancel {describedby} on:click={() => dispatch('escape')}>{cancelText}</Button>
|
|
57
57
|
{/if}
|
|
58
|
-
|
|
58
|
+
{#if isNotBlank(continueText)}
|
|
59
|
+
<Button class="primary" disabled={disabled || (hasRequired && !ignoreTabs)} {describedby} on:click={() => dispatch('continue')}><Icon icon={continueIcon} inline />{continueText}</Button>
|
|
60
|
+
{/if}
|
|
59
61
|
{#if nextTitle && !ignoreTabs}
|
|
60
62
|
<Button class="next" disabled={!nextTitle} on:click={onNext}>Next<ScreenReaderOnly> Tab ({nextTitle})</ScreenReaderOnly> <Icon width="1.2em" icon={arrowRightLight} inline /></Button>
|
|
61
63
|
{/if}
|
package/FieldHidden.svelte
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
<script>import { Field, nullableSerialize, nullableDeserialize, FormStore, FORM_CONTEXT } from '@txstate-mws/svelte-forms';
|
|
1
|
+
<script>import { Field, nullableSerialize, nullableDeserialize, FormStore, FORM_CONTEXT, FORM_INHERITED_PATH } from '@txstate-mws/svelte-forms';
|
|
2
2
|
import { getContext } from 'svelte';
|
|
3
|
+
import { isNotBlank } from 'txstate-utils';
|
|
3
4
|
export let id = undefined;
|
|
4
5
|
export let path;
|
|
5
6
|
export let value = '';
|
|
6
7
|
export let notNull = false;
|
|
7
8
|
export let conditional = undefined;
|
|
8
9
|
const store = getContext(FORM_CONTEXT);
|
|
9
|
-
|
|
10
|
+
const inheritedPath = getContext(FORM_INHERITED_PATH);
|
|
11
|
+
const finalPath = [inheritedPath, path].filter(isNotBlank).join('.');
|
|
12
|
+
$: store.setField(finalPath, value);
|
|
10
13
|
</script>
|
|
11
14
|
|
|
12
15
|
<Field {path} {conditional} serialize={!notNull ? nullableSerialize : undefined} deserialize={!notNull ? nullableDeserialize : undefined} let:value>
|
package/Tab.svelte
CHANGED
|
@@ -15,12 +15,16 @@ const idx = $store.tabs.findIndex(t => t.name === name);
|
|
|
15
15
|
const last = idx === $store.tabs.length - 1;
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
|
-
{#if $
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
|
|
18
|
+
{#if $store.tabs.length > 1}
|
|
19
|
+
{#if $accordion}
|
|
20
|
+
<div bind:this={tabelements[idx]} id={$tabid} class="tabs-tab" class:last aria-selected={active} aria-controls={$panelid} role="tab" tabindex={0} on:click={onClick(idx)} on:keydown={onKeyDown(idx)}><Icon icon={$store.tabs[idx].icon} inline />{$title}<i class="tabs-accordion-arrow" aria-hidden="true"></i></div>
|
|
21
|
+
{/if}
|
|
22
|
+
<div id={$panelid} hidden={!active} role="tabpanel" tabindex="-1" aria-labelledby={$tabid} class="tabs-panel" class:accordion={$accordion}>
|
|
23
|
+
<slot />
|
|
24
|
+
</div>
|
|
25
|
+
{:else}
|
|
22
26
|
<slot />
|
|
23
|
-
|
|
27
|
+
{/if}
|
|
24
28
|
|
|
25
29
|
<style>
|
|
26
30
|
.tabs-panel {
|
package/Tabs.svelte
CHANGED
|
@@ -85,20 +85,24 @@ $: reactToCurrent($activeStore);
|
|
|
85
85
|
onMount(reactToCurrent);
|
|
86
86
|
</script>
|
|
87
87
|
|
|
88
|
-
{#if
|
|
89
|
-
|
|
90
|
-
{
|
|
91
|
-
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
{:else}
|
|
99
|
-
<div use:resize={{ store }} class="tabs-container">
|
|
88
|
+
{#if $store.tabs.length > 1}
|
|
89
|
+
{#if !$accordion}
|
|
90
|
+
<ul use:resize={{ store }} class="tabs-buttons" role="tablist">
|
|
91
|
+
{#each $store.tabs as tab, idx (tab.name)}
|
|
92
|
+
{@const active = isActive(idx, $store.current)}
|
|
93
|
+
{@const left = idx % cols === 0}
|
|
94
|
+
<li bind:this={tabelements[idx]} use:offset={{ store: active ? activeStore : undefined }} id={$store.tabids[tab.name]} class="tabs-tab" class:left class:wrapping class:active style:font-size="{scalefactor}em" style:line-height={1.2 / scalefactor} aria-selected={active} aria-controls={$store.panelids[tab.name]} role="tab" tabindex={active ? 0 : -1} on:click={onClick(idx)} on:keydown={onKeyDown(idx)}><span><Icon icon={tab.icon} inline />{tab.title}</span></li>
|
|
95
|
+
{/each}
|
|
96
|
+
</ul>
|
|
97
|
+
<div bind:this={activeelement} class="tabs-active"></div>
|
|
100
98
|
<slot current={$store.current} />
|
|
101
|
-
|
|
99
|
+
{:else}
|
|
100
|
+
<div use:resize={{ store }} class="tabs-container">
|
|
101
|
+
<slot current={$store.current} />
|
|
102
|
+
</div>
|
|
103
|
+
{/if}
|
|
104
|
+
{:else}
|
|
105
|
+
<slot current={$store.current} />
|
|
102
106
|
{/if}
|
|
103
107
|
|
|
104
108
|
<style>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dosgato/dialog",
|
|
3
3
|
"description": "A component library for building forms that edit a JSON document.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.44",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@txstate-mws/svelte-components": "^1.3.9",
|
|
7
7
|
"@txstate-mws/svelte-forms": "^1.3.4",
|