@dosgato/dialog 1.1.22 → 1.1.23
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/dist/Container.svelte.d.ts +1 -1
- package/dist/FieldRadio.svelte +1 -1
- package/dist/FieldStandard.svelte.d.ts +1 -1
- package/dist/FieldText.svelte +2 -1
- package/dist/FieldText.svelte.d.ts +1 -0
- package/dist/FieldTextArea.svelte +2 -1
- package/dist/FieldTextArea.svelte.d.ts +1 -0
- package/dist/Input.svelte +2 -1
- package/dist/Input.svelte.d.ts +1 -0
- package/dist/imageposition/FieldImagePosition.svelte +41 -11
- package/dist/imageposition/FieldImagePosition.svelte.d.ts +0 -1
- package/package.json +2 -2
package/dist/FieldRadio.svelte
CHANGED
|
@@ -45,5 +45,5 @@ onMount(reactToChoices);
|
|
|
45
45
|
|
|
46
46
|
<Field {path} {defaultValue} {conditional} {notNull} {number} {date} {datetime} {boolean} {serialize} {deserialize} let:value let:valid let:invalid let:onBlur let:onChange let:messages let:serialize let:deserialize>
|
|
47
47
|
{@const _ = updateDeserialize(deserialize)}
|
|
48
|
-
<Switcher bind:id {path} class={className} name={
|
|
48
|
+
<Switcher bind:id {path} class={className} name={finalPath} {horizontal} {label} iptValue={value} {valid} {invalid} {required} {related} {extradescid} {helptext} {messages} on:change={onChange} {onBlur} choices={choices.map(c => ({ ...c, value: serialize(c.value) }))} />
|
|
49
49
|
</Field>
|
|
@@ -34,7 +34,7 @@ declare const __propDef: {
|
|
|
34
34
|
setVal: (val: string | number | boolean | object | Date | undefined, notDirty?: boolean | undefined) => void;
|
|
35
35
|
valid: boolean;
|
|
36
36
|
invalid: boolean;
|
|
37
|
-
messagesid:
|
|
37
|
+
messagesid: string | undefined;
|
|
38
38
|
helptextid: string | undefined;
|
|
39
39
|
serialize: (value: any) => string;
|
|
40
40
|
deserialize: (value: string) => any;
|
package/dist/FieldText.svelte
CHANGED
|
@@ -8,6 +8,7 @@ export { className as class };
|
|
|
8
8
|
export let id = undefined;
|
|
9
9
|
export let path;
|
|
10
10
|
export let label = '';
|
|
11
|
+
export let placeholder = undefined;
|
|
11
12
|
export let notNull = false;
|
|
12
13
|
export let defaultValue = notNull ? '' : undefined;
|
|
13
14
|
export let type = 'text';
|
|
@@ -24,7 +25,7 @@ export let helptext = undefined;
|
|
|
24
25
|
</script>
|
|
25
26
|
|
|
26
27
|
<FieldStandard bind:id {label} {path} {required} {defaultValue} {conditional} {related} {helptext} serialize={!notNull ? nullableSerialize : undefined} deserialize={!notNull ? nullableDeserialize : undefined} let:value let:valid let:invalid let:id let:onBlur let:onChange let:messagesid let:helptextid>
|
|
27
|
-
<Input bind:inputelement {type} {autocomplete} name={path} {value} {id} class="dialog-input {className}" {allowlastpass} {onChange} {onBlur} {valid} {invalid} {messagesid} {helptextid} {extradescid} {use}></Input>
|
|
28
|
+
<Input bind:inputelement {type} {placeholder} {autocomplete} name={path} {value} {id} class="dialog-input {className}" {allowlastpass} {onChange} {onBlur} {valid} {invalid} {messagesid} {helptextid} {extradescid} {use}></Input>
|
|
28
29
|
{#if isNotNull(maxlength)}
|
|
29
30
|
<MaxLength {value} {maxlength}/>
|
|
30
31
|
{/if}
|
|
@@ -9,6 +9,7 @@ export { className as class };
|
|
|
9
9
|
export let id = undefined;
|
|
10
10
|
export let path;
|
|
11
11
|
export let label = '';
|
|
12
|
+
export let placeholder = undefined;
|
|
12
13
|
export let notNull = false;
|
|
13
14
|
export let defaultValue = notNull ? '' : undefined;
|
|
14
15
|
export let maxlength = undefined;
|
|
@@ -23,7 +24,7 @@ export let helptext = undefined;
|
|
|
23
24
|
</script>
|
|
24
25
|
|
|
25
26
|
<FieldStandard bind:id {label} {path} {required} {defaultValue} {conditional} {related} {helptext} serialize={!notNull ? nullableSerialize : undefined} deserialize={!notNull ? nullableDeserialize : undefined} let:value let:valid let:invalid let:id let:onBlur let:onChange let:messagesid let:helptextid>
|
|
26
|
-
<textarea bind:this={inputelement} name={path} {value} {id} {rows} class="dialog-input dialog-textarea {className}" class:valid class:invalid aria-invalid={invalid} aria-describedby={getDescribedBy([messagesid, helptextid, extradescid])} on:change={onChange} on:blur={onBlur} on:keyup={onChange} on:paste use:passActions={use}></textarea>
|
|
27
|
+
<textarea bind:this={inputelement} {placeholder} name={path} {value} {id} {rows} class="dialog-input dialog-textarea {className}" class:valid class:invalid aria-invalid={invalid} aria-describedby={getDescribedBy([messagesid, helptextid, extradescid])} on:change={onChange} on:blur={onBlur} on:keyup={onChange} on:paste use:passActions={use}></textarea>
|
|
27
28
|
{#if isNotNull(maxlength)}
|
|
28
29
|
<MaxLength {value} {maxlength}/>
|
|
29
30
|
{/if}
|
package/dist/Input.svelte
CHANGED
|
@@ -7,6 +7,7 @@ export let name;
|
|
|
7
7
|
export let value;
|
|
8
8
|
export let type = 'text';
|
|
9
9
|
export let allowlastpass = false;
|
|
10
|
+
export let placeholder = undefined;
|
|
10
11
|
export let maxlength = undefined;
|
|
11
12
|
export let min = undefined;
|
|
12
13
|
export let max = undefined;
|
|
@@ -39,4 +40,4 @@ $: maxStr = resolveMinMax(max);
|
|
|
39
40
|
</script>
|
|
40
41
|
|
|
41
42
|
<!-- svelte-ignore a11y-autocomplete-valid -->
|
|
42
|
-
<input bind:this={inputelement} {type} {id} {autocomplete} class={className} data-lpignore={!allowlastpass} {name} {value} {disabled} {maxlength} min={minStr} max={maxStr} {step} class:valid class:invalid aria-invalid={invalid} aria-describedby={isNotBlank(descby) ? descby : null} on:change={onChange} on:select={onSelect} on:blur={onBlur} on:keyup={onChange} use:passActions={use}>
|
|
43
|
+
<input bind:this={inputelement} {type} {id} {autocomplete} {placeholder} class={className} data-lpignore={!allowlastpass} {name} {value} {disabled} {maxlength} min={minStr} max={maxStr} {step} class:valid class:invalid aria-invalid={invalid} aria-describedby={isNotBlank(descby) ? descby : null} on:change={onChange} on:select={onSelect} on:blur={onBlur} on:keyup={onChange} use:passActions={use}>
|
package/dist/Input.svelte.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export let label = '';
|
|
|
11
11
|
export let required = false;
|
|
12
12
|
export let conditional = undefined;
|
|
13
13
|
export let helptext = undefined;
|
|
14
|
-
export let info = undefined;
|
|
15
14
|
export let defaultValue = { x: 50, y: 50 };
|
|
16
15
|
let initialVal;
|
|
17
16
|
function init(v) {
|
|
@@ -108,6 +107,10 @@ function onDialogOpen() {
|
|
|
108
107
|
dialogWasOpened = true;
|
|
109
108
|
}
|
|
110
109
|
}
|
|
110
|
+
function resetPosition() {
|
|
111
|
+
x = 2;
|
|
112
|
+
y = 2;
|
|
113
|
+
}
|
|
111
114
|
</script>
|
|
112
115
|
|
|
113
116
|
<FieldStandard bind:id {label} {path} {required} {defaultValue} conditional={conditional && isNotBlank(imageSrc)} {helptext} {descid} let:value let:setVal let:helptextid>
|
|
@@ -117,17 +120,19 @@ function onDialogOpen() {
|
|
|
117
120
|
{#if modalOpen}
|
|
118
121
|
<Dialog size="large" title={label} on:escape={hideModal} continueText="Save" cancelText="Cancel" on:continue={() => onSave(setVal)} {labelid}>
|
|
119
122
|
{@const _dialogopen = onDialogOpen()}
|
|
120
|
-
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
<section class="info">
|
|
124
|
+
<p>This image is in a responsive layout, meaning the size and shape of the image may change based on the viewer’s browser window and device.</p>
|
|
125
|
+
<div class="warning">
|
|
126
|
+
<div class="icon">
|
|
127
|
+
<svg width="100%" height="100%" viewBox="0 0 24 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
128
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.7931 17.9114C22.0668 18.4197 22.0668 19.0061 21.7931 19.4752C21.5195 19.9834 21.0112 20.2571 20.4639 20.2571H3.57518C2.98876 20.2571 2.48054 19.9834 2.20688 19.4752C1.93322 19.0061 1.93322 18.4197 2.20688 17.9114L10.6512 3.52473C10.9249 3.05559 11.4331 2.74284 12.0195 2.74284C12.5669 2.74284 13.0751 3.05559 13.3488 3.52473L21.7931 17.9114ZM15.0762 2.51348L15.0777 2.51616L23.538 16.93L23.5555 16.9625C24.1294 18.0283 24.1722 19.3444 23.5393 20.454C22.8879 21.637 21.6838 22.2587 20.4639 22.2587H3.57518C2.34516 22.2587 1.12477 21.6603 0.460681 20.4539C-0.172198 19.3444 -0.129382 18.0282 0.444499 16.9625L0.461978 16.93L8.92228 2.51616L8.92396 2.51329C9.54626 1.44877 10.7019 0.741211 12.0195 0.741211C13.326 0.741211 14.4684 1.47375 15.0762 2.51348ZM12.9067 13.3785C12.9398 13.2815 12.9578 13.1759 12.9578 13.0637V8.68517C12.9578 8.17695 12.5278 7.74691 12.0195 7.74691C11.4722 7.74691 11.0813 8.17695 11.0813 8.68517V13.0637C11.0813 13.1745 11.0973 13.2788 11.1274 13.3748C11.2459 13.7532 11.583 14.002 12.0195 14.002C12.4236 14.002 12.7783 13.7548 12.9067 13.3785ZM10.9757 15.8208C10.8443 16.0203 10.7685 16.2567 10.7685 16.504C10.7685 17.2077 11.3158 17.7551 12.0195 17.7551C12.6842 17.7551 13.2706 17.2077 13.2706 16.504C13.2706 16.2554 13.1885 16.0178 13.051 15.8177C12.8209 15.4828 12.4355 15.253 12.0195 15.253C11.5777 15.253 11.1975 15.4842 10.9757 15.8208Z" fill="black"/>
|
|
129
|
+
</svg>
|
|
130
|
+
</div>
|
|
131
|
+
<p>If there is sensitive content in the image that should never be visible to the audience, crop or edit the file in an editing software before uploading. </p>
|
|
132
|
+
</div>
|
|
133
|
+
<p>Using the grid overlays, select a focal point in your image to determine how Gato will align, position, and scale your image in the section. This will help ensure the focal point of your image is always in frame. By default, Gato will use the center of the image.</p>
|
|
134
|
+
</section>
|
|
125
135
|
<section class="position">
|
|
126
|
-
<p>
|
|
127
|
-
Using the grid overlays, select a focal point in your image to determine how Gato will align, position, and scale your image
|
|
128
|
-
in the section. This will help ensure the focal point of your image is always in frame. By default, Gato will
|
|
129
|
-
use the center of the image.
|
|
130
|
-
</p>
|
|
131
136
|
<div class="image-container">
|
|
132
137
|
<img class="crop-image" src={imageSrc} alt="" />
|
|
133
138
|
<div class="overlay" role="radiogroup" aria-labelledby={labelid}>
|
|
@@ -146,6 +151,9 @@ function onDialogOpen() {
|
|
|
146
151
|
{/each}
|
|
147
152
|
</div>
|
|
148
153
|
</div>
|
|
154
|
+
<div class="button-container">
|
|
155
|
+
<Button type="button" class="reset-position" on:click={resetPosition}>Reset Position</Button>
|
|
156
|
+
</div>
|
|
149
157
|
</section>
|
|
150
158
|
</Dialog>
|
|
151
159
|
{/if}
|
|
@@ -153,6 +161,17 @@ function onDialogOpen() {
|
|
|
153
161
|
</FieldStandard>
|
|
154
162
|
|
|
155
163
|
<style>
|
|
164
|
+
.warning {
|
|
165
|
+
display: flex;
|
|
166
|
+
gap: 1.5em;
|
|
167
|
+
background-color: #F3D690;
|
|
168
|
+
padding: 0.5em;
|
|
169
|
+
border-radius: 6px;
|
|
170
|
+
}
|
|
171
|
+
.warning .icon {
|
|
172
|
+
font-size: 3em;
|
|
173
|
+
width: 1em;
|
|
174
|
+
}
|
|
156
175
|
section.position {
|
|
157
176
|
border: 1px dashed #767676;
|
|
158
177
|
padding: 1em;
|
|
@@ -163,6 +182,7 @@ function onDialogOpen() {
|
|
|
163
182
|
.image-container {
|
|
164
183
|
width: 75%;
|
|
165
184
|
position: relative;
|
|
185
|
+
margin-bottom: 1em;
|
|
166
186
|
}
|
|
167
187
|
.crop-image {
|
|
168
188
|
width: 100%;
|
|
@@ -192,6 +212,16 @@ function onDialogOpen() {
|
|
|
192
212
|
.overlay .box.bottom {
|
|
193
213
|
border-bottom-width: 0;
|
|
194
214
|
}
|
|
215
|
+
.button-container {
|
|
216
|
+
width: 100%;
|
|
217
|
+
}
|
|
218
|
+
:global(button.reset-position.reset-position) {
|
|
219
|
+
background-color: var(--dg-button-cancel-bg, #808080);
|
|
220
|
+
color: var(--dg-button-cancel-text, #fff);
|
|
221
|
+
}
|
|
222
|
+
:global(button.reset-position.reset-position):not([disabled]):hover {
|
|
223
|
+
background-color: var(--dg-button-cancel-hover-bg, #595959);
|
|
224
|
+
}
|
|
195
225
|
|
|
196
226
|
</style>
|
|
197
227
|
|
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": "1.1.
|
|
4
|
+
"version": "1.1.23",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prepublishOnly": "svelte-package",
|
|
7
7
|
"dev": "vite dev --force",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@iconify-icons/mdi": "^1.2.22",
|
|
28
28
|
"@iconify-icons/ph": "^1.2.2",
|
|
29
29
|
"@txstate-mws/svelte-components": "^1.6.2",
|
|
30
|
-
"@txstate-mws/svelte-forms": "^1.
|
|
30
|
+
"@txstate-mws/svelte-forms": "^1.5.5",
|
|
31
31
|
"codemirror": "^6.0.1",
|
|
32
32
|
"txstate-utils": "^1.8.0"
|
|
33
33
|
},
|