@dosgato/dialog 0.0.29 → 0.0.30

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.
@@ -1,6 +1,6 @@
1
- <script>import { FORM_CONTEXT } from '@txstate-mws/svelte-forms';
1
+ <script>import { FORM_CONTEXT, FORM_INHERITED_PATH } from '@txstate-mws/svelte-forms';
2
2
  import { getContext } from 'svelte';
3
- import { randomid } from 'txstate-utils';
3
+ import { isNotBlank, randomid } from 'txstate-utils';
4
4
  import { Chooser, ChooserStore, CHOOSER_API_CONTEXT } from './chooser';
5
5
  import Details from './chooser/Details.svelte';
6
6
  import Thumbnail from './chooser/Thumbnail.svelte';
@@ -21,7 +21,9 @@ export let initialSource = undefined;
21
21
  export let initialPath = undefined;
22
22
  export let helptext = undefined;
23
23
  const formStore = getContext(FORM_CONTEXT);
24
- const value = formStore.getField(path);
24
+ const inheritedPath = getContext(FORM_INHERITED_PATH);
25
+ const finalPath = [inheritedPath, path].filter(isNotBlank).join('.');
26
+ const value = formStore.getField(finalPath);
25
27
  const chooserClient = getContext(CHOOSER_API_CONTEXT);
26
28
  const store = new ChooserStore(chooserClient);
27
29
  const descid = randomid();
@@ -55,7 +57,8 @@ async function userUrlEntry() {
55
57
  id: newVal,
56
58
  url
57
59
  };
58
- formStore.setField(path, newVal);
60
+ formStore.setField(finalPath, newVal);
61
+ formStore.dirtyField(finalPath);
59
62
  }
60
63
  let selectedAsset;
61
64
  async function updateSelected(..._) {
@@ -1,7 +1,8 @@
1
1
  <script>import { passActions } from '@txstate-mws/svelte-components';
2
- import { nullableSerialize, nullableDeserialize, FORM_CONTEXT, FormStore } from '@txstate-mws/svelte-forms';
2
+ import { nullableSerialize, nullableDeserialize, FORM_CONTEXT, FormStore, FORM_INHERITED_PATH } from '@txstate-mws/svelte-forms';
3
3
  import CodeFlask from 'codeflask';
4
4
  import { getContext, onMount } from 'svelte';
5
+ import { isNotBlank } from 'txstate-utils';
5
6
  import { getDescribedBy, FieldStandard } from './';
6
7
  let className = '';
7
8
  export { className as class };
@@ -10,7 +11,7 @@ export let path;
10
11
  export let label = '';
11
12
  export let notNull = false;
12
13
  export let defaultValue = notNull ? '' : undefined;
13
- export let rows = undefined;
14
+ export let rows = 8;
14
15
  export let conditional = undefined;
15
16
  export let required = false;
16
17
  export let use = [];
@@ -18,13 +19,13 @@ export let inputelement = undefined;
18
19
  export let helptext = undefined;
19
20
  export let language;
20
21
  const store = getContext(FORM_CONTEXT);
21
- const value = store.getField(path);
22
+ const inheritedPath = getContext(FORM_INHERITED_PATH);
23
+ const finalPath = [inheritedPath, path].filter(isNotBlank).join('.');
24
+ const value = store.getField(finalPath);
22
25
  let editorelement;
23
26
  let flask;
24
- let codeValue = '';
25
27
  onMount(() => {
26
28
  flask = new CodeFlask(editorelement, { language, lineNumbers: true, areaId: id });
27
- flask.onUpdate(code => { codeValue = code; });
28
29
  inputelement = editorelement.querySelector(`#${id}`);
29
30
  if (className)
30
31
  inputelement.classList.add(...className.split(' '));
@@ -60,6 +61,7 @@ function updateValidState(invalidIn, messagesIdIn) {
60
61
 
61
62
  <style>
62
63
  div {
64
+ position: relative;
63
65
  overflow: hidden;
64
66
  resize: vertical;
65
67
  }
@@ -8,7 +8,7 @@ declare const __propDef: {
8
8
  label?: string;
9
9
  notNull?: boolean;
10
10
  defaultValue?: any;
11
- rows?: number | undefined;
11
+ rows?: number;
12
12
  conditional?: boolean | undefined;
13
13
  required?: boolean;
14
14
  use?: HTMLActionEntry[];
@@ -10,7 +10,7 @@ declare const __propDef: {
10
10
  disabled?: boolean;
11
11
  choices: {
12
12
  label?: string;
13
- value: string;
13
+ value: any;
14
14
  disabled?: boolean;
15
15
  }[];
16
16
  defaultValue?: any;
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.29",
4
+ "version": "0.0.30",
5
5
  "dependencies": {
6
6
  "@txstate-mws/svelte-components": "^1.3.5",
7
7
  "@txstate-mws/svelte-forms": "^1.2.1",