@dosgato/dialog 0.0.22 → 0.0.24

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/Button.svelte CHANGED
@@ -74,4 +74,5 @@ export { className as class };
74
74
  background-color: var(--dg-button-delete-hover-bg, rgb(240, 62, 62));
75
75
  color: var(--dg-button-delete-hover-text, white);
76
76
  }
77
+
77
78
  </style>
@@ -71,4 +71,5 @@ function onKeyDown(choice, idx) {
71
71
  background-color: var(--dialog-btngrp-active-bg, #333333);
72
72
  color: var(--dialog-btngrp-active-text, white);
73
73
  }
74
+
74
75
  </style>
package/Checkbox.svelte CHANGED
@@ -67,4 +67,5 @@ input[type="checkbox"]:disabled {
67
67
  color: var(--dialog-checkbox-color);
68
68
  cursor: not-allowed;
69
69
  }
70
+
70
71
  </style>
package/Container.svelte CHANGED
@@ -86,4 +86,5 @@ const helptextid = helptext ? randomid() : undefined;
86
86
  font-size: 0.9em;
87
87
  color: #595959;
88
88
  }
89
+
89
90
  </style>
package/Dialog.svelte CHANGED
@@ -152,4 +152,5 @@ $: describedby = [title ? labelid : undefined, descid].filter(isNotBlank).join('
152
152
  background: none;
153
153
  cursor: pointer;
154
154
  }
155
+
155
156
  </style>
@@ -73,4 +73,5 @@ const descid = randomid();
73
73
  label :global(input[type="checkbox"]) {
74
74
  transform: none;
75
75
  }
76
+
76
77
  </style>
@@ -100,4 +100,5 @@ $: updateSelected($value);
100
100
  input {
101
101
  flex-grow: 1;
102
102
  }
103
+
103
104
  </style>
@@ -111,4 +111,5 @@ function onkeydown(value, setVal) {
111
111
  border: 0;
112
112
  padding: 0;
113
113
  }
114
+
114
115
  </style>
@@ -87,4 +87,5 @@ $: messages = compact ? $messageStore : [];
87
87
  .dialog-multiple-content {
88
88
  flex-grow: 1;
89
89
  }
90
+
90
91
  </style>
@@ -59,4 +59,5 @@ async function reactToValue(value) {
59
59
  .invalid {
60
60
  --multiselect-border: 1px solid red;
61
61
  }
62
+
62
63
  </style>
package/FieldRadio.svelte CHANGED
@@ -54,4 +54,5 @@ const width = '100%';
54
54
  label :global(input[type="checkbox"]) {
55
55
  transform: none;
56
56
  }
57
+
57
58
  </style>
@@ -26,4 +26,5 @@ export let helptext = undefined;
26
26
  textarea {
27
27
  resize: vertical;
28
28
  }
29
+
29
30
  </style>
package/Form.svelte CHANGED
@@ -43,4 +43,5 @@ setContext(CHOOSER_API_CONTEXT, chooserClient);
43
43
  color: var(--dg-danger-bg, #9a3332);
44
44
  padding: 1em;
45
45
  }
46
+
46
47
  </style>
package/FormDialog.svelte CHANGED
@@ -31,4 +31,5 @@ setContext(CHOOSER_API_CONTEXT, chooserClient);
31
31
  :global(:root) {
32
32
  --ck-z-default: var(--popup-z, 3001);
33
33
  }
34
+
34
35
  </style>
@@ -39,4 +39,5 @@ $: icon = icons[message.type] ?? alertCircleOutline;
39
39
  background-color: #218739;
40
40
  color: white;
41
41
  }
42
+
42
43
  </style>
@@ -18,4 +18,5 @@ $: id = messages.length ? savedid : undefined;
18
18
  div {
19
19
  width: 100%;
20
20
  }
21
+
21
22
  </style>
package/Listbox.svelte CHANGED
@@ -164,4 +164,5 @@ function focusListbox() {
164
164
  .listbox-item.disabled {
165
165
  color: rgba(0,0,0,0.6);
166
166
  }
167
+
167
168
  </style>
package/Radio.svelte CHANGED
@@ -65,4 +65,5 @@ input[type="radio"]:disabled {
65
65
  color: var(--dialog-checkbox-color);
66
66
  cursor: not-allowed;
67
67
  }
68
+
68
69
  </style>
package/Tab.svelte CHANGED
@@ -55,4 +55,5 @@ const last = idx === $store.tabs.length - 1;
55
55
  transform: translateY(-50%) rotate(225deg);
56
56
  top: calc(50% + 0.08em);
57
57
  }
58
+
58
59
  </style>
package/Tabs.svelte CHANGED
@@ -150,4 +150,5 @@ onMount(reactToCurrent);
150
150
  transition: none;
151
151
  }
152
152
  }
153
+
153
154
  </style>
@@ -46,7 +46,6 @@ function onDeselect() {
46
46
  store.setPreview(undefined);
47
47
  }
48
48
  async function openRecursive(pathSplit, depth) {
49
- console.log($treeStore.rootItems);
50
49
  let curr = $treeStore.rootItems?.find(itm => itm.name === pathSplit[0]);
51
50
  for (let i = 0; i < depth; i++) {
52
51
  curr = curr?.children?.find(c => c.name === pathSplit[i + 1]);
@@ -80,7 +79,7 @@ async function selectPreview(..._) {
80
79
  }
81
80
  onMount(async () => {
82
81
  await store.init({ images, pages, assets, folders, activeSources, initialSource, initialPath, passthruFilters, filter });
83
- tabStore.activateName($source.name);
82
+ tabStore?.activateName($source.name);
84
83
  await selectPreview();
85
84
  });
86
85
  </script>
@@ -89,7 +88,7 @@ onMount(async () => {
89
88
  <section class="dialog-chooser-window">
90
89
  <header class="dialog-chooser-controls">
91
90
  {#if $sources.length > 1}
92
- <Tabs bind:store={tabStore} tabs={$sources.map(s => ({ id: s.name, title: s.label ?? s.name }))} />
91
+ <Tabs bind:store={tabStore} tabs={$sources.map(s => ({ name: s.name, title: s.label ?? s.name }))} />
93
92
  {/if}
94
93
  </header>
95
94
  <section class="dialog-chooser-chooser">
@@ -145,4 +144,5 @@ onMount(async () => {
145
144
  position: relative;
146
145
  width: 100%;
147
146
  }
147
+
148
148
  </style>
@@ -54,9 +54,7 @@ export class ChooserStore extends Store {
54
54
  return { ...v, sources };
55
55
  });
56
56
  this.setSource(this.value.preview?.source ?? this.options.initialSource, true);
57
- console.log('before initialized', this.value);
58
57
  await tick();
59
- console.log('just before initialized');
60
58
  this.update(v => ({ ...v, initialized: true }));
61
59
  }
62
60
  setPreview(item) {
@@ -26,4 +26,5 @@ export let item;
26
26
  margin: 0;
27
27
  list-style: none;
28
28
  }
29
+
29
30
  </style>
@@ -44,4 +44,5 @@ export let item;
44
44
  left: 50%;
45
45
  transform: translate(-50%, -50%);
46
46
  }
47
+
47
48
  </style>
@@ -1,6 +1,6 @@
1
1
  <script>import FieldStandard from '../FieldStandard.svelte';
2
- import { getDescribedBy, Radio } from '..';
3
- import { randomid } from 'txstate-utils';
2
+ import { Radio } from '..';
3
+ import { randomid, shouldUseWhiteText } from 'txstate-utils';
4
4
  export let id = undefined;
5
5
  let className = '';
6
6
  export { className as class };
@@ -23,17 +23,17 @@ const groupid = randomid();
23
23
  <Radio id={`${path}.alt`} name={path} value="alternating" selected={value === 'alternating'} {onChange} {onBlur} {helptextid}/>
24
24
  <span class="alternating-bg">
25
25
  {#each options as option}
26
- <span style={`background-color: ${option.color}`}></span>
26
+ <span style:background-color={option.color}></span>
27
27
  {/each}
28
28
  </span>
29
- <span class="alternating-text">Alternating</span>
29
+ <span class="picker-text">Alternating</span>
30
30
  </label>
31
31
  {/if}
32
32
  {#each options as option, idx (option.value) }
33
33
  {@const radioid = `${path}.${idx}`}
34
34
  <label for={radioid} class="colorsel">
35
35
  <Radio id={radioid} name={path} value={option.value} selected={value === option.value} {onChange} {onBlur} {helptextid}/>
36
- <span style={`background-color: ${option.color}`}>{option.name || option.value}</span>
36
+ <span class="picker-text" style:background-color={option.color} class:dark={shouldUseWhiteText(option.color)}>{option.name || option.value}</span>
37
37
  </label>
38
38
  {/each}
39
39
  </div>
@@ -59,7 +59,6 @@ const groupid = randomid();
59
59
 
60
60
  label.colorsel :global(input[type="radio"] + span) {
61
61
  display: inline-block;
62
- font-weight: bold;
63
62
  padding: 1rem;
64
63
  width: 100%;
65
64
  text-align: center;
@@ -71,6 +70,10 @@ const groupid = randomid();
71
70
  outline: 5px solid #93BBC4;
72
71
  }
73
72
 
73
+ label.colorsel :global(input[type="radio"]:focus + span) {
74
+ outline: 5px solid blue;
75
+ }
76
+
74
77
  label.colorsel.alternating {
75
78
  position: relative;
76
79
  }
@@ -85,13 +88,22 @@ const groupid = randomid();
85
88
  width: 100%;
86
89
  }
87
90
 
88
- label.colorsel.alternating span.alternating-text {
91
+ label.colorsel.alternating span.picker-text {
89
92
  position: absolute;
90
93
  left: 50%;
91
94
  top: 50%;
92
95
  transform: translate(-50%, -50%);
96
+ }
97
+
98
+ label .picker-text {
93
99
  font-weight: bold;
100
+ letter-spacing: 0.5px;
101
+ color: black;
102
+ text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.6), 1px -1px 1px rgba(255, 255, 255, 0.6), -1px 1px 1px rgba(255, 255, 255, 0.6), -1px -1px 1px rgba(255, 255, 255, 0.6);
103
+ }
104
+ label .picker-text.dark, label.alternating .picker-text {
94
105
  color: white;
95
- text-shadow: 1px 1px 0 #222, 1px -1px 0 #222, -1px 1px 0 #222, -1px -1px 0 #222;
106
+ text-shadow: 1px 1px 1px #222, 1px -1px 1px #222, -1px 1px 1px #222, -1px -1px 1px #222;
96
107
  }
97
- </style>
108
+
109
+ </style>
@@ -255,4 +255,5 @@ function onKeyDown(e) {
255
255
  line-height: 250px;
256
256
  color: #999;
257
257
  }
258
+
258
259
  </style>
package/package.json CHANGED
@@ -1,14 +1,14 @@
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.22",
4
+ "version": "0.0.24",
5
5
  "dependencies": {
6
6
  "@txstate-mws/svelte-components": "^1.3.5",
7
7
  "@txstate-mws/svelte-forms": "^1.1.2",
8
8
  "@iconify/svelte": "^3.0.0",
9
9
  "@iconify-icons/mdi": "^1.2.22",
10
10
  "@iconify-icons/ph": "^1.2.2",
11
- "txstate-utils": "^1.7.12"
11
+ "txstate-utils": "^1.8.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@sveltejs/adapter-auto": "next",
@@ -16,13 +16,15 @@
16
16
  "@sveltejs/package": "^1.0.0-next.5",
17
17
  "eslint-config-standard-with-typescript": "^23.0.0",
18
18
  "eslint-plugin-svelte3": "^4.0.0",
19
- "svelte": "^3.44.0",
20
19
  "svelte-check": "^2.2.6",
21
20
  "svelte-preprocess": "^4.9.4",
22
21
  "svelte2tsx": "^0.5.20",
23
22
  "tslib": "^2.3.1",
24
23
  "typescript": "^4.4.3"
25
24
  },
25
+ "peerDependencies": {
26
+ "svelte": "^3.53.1"
27
+ },
26
28
  "type": "module",
27
29
  "exports": {
28
30
  "./package.json": "./package.json",
@@ -21,4 +21,5 @@
21
21
  0% { transform: rotate(0deg); }
22
22
  100% { transform: rotate(360deg); }
23
23
  }
24
+
24
25
  </style>
package/tree/Tree.svelte CHANGED
@@ -8,6 +8,13 @@ export let headers;
8
8
  export let nodeClass = undefined;
9
9
  export let singleSelect = undefined;
10
10
  export let enableResize = false;
11
+ /**
12
+ * this `itemType` prop is here for typescript only
13
+ *
14
+ * it will allow users to specify T
15
+ *
16
+ * we are able to determine T from the store prop, but not everyone will use the store prop
17
+ */
11
18
  export const itemType = undefined;
12
19
  export let fetchChildren = undefined;
13
20
  export let dragEligible = undefined;
@@ -201,4 +208,5 @@ afterUpdate(() => {
201
208
  :global([data-eq~="650px"]) ul {
202
209
  font-size: 0.8em;
203
210
  }
211
+
204
212
  </style>
@@ -7,7 +7,13 @@ declare class __sveltets_Render<T extends TreeItemFromDB> {
7
7
  nodeClass?: (itm: T) => string;
8
8
  singleSelect?: boolean;
9
9
  enableResize?: boolean;
10
- itemType?: T;
10
+ /**
11
+ * this `itemType` prop is here for typescript only
12
+ *
13
+ * it will allow users to specify T
14
+ *
15
+ * we are able to determine T from the store prop, but not everyone will use the store prop
16
+ */ itemType?: T;
11
17
  fetchChildren?: FetchChildrenFn<T>;
12
18
  dragEligible?: DragEligibleFn<T>;
13
19
  moveHandler?: MoveHandlerFn<T>;
@@ -170,7 +170,6 @@ function onCheckClick(e) {
170
170
  shiftClick();
171
171
  }
172
172
  else {
173
- console.log('onCheckClick', isSelected);
174
173
  if (isSelected)
175
174
  dispatch('deselect', item);
176
175
  store.select(item, { clear: false, toggle: true });
@@ -415,4 +414,5 @@ $: if ($dragging) {
415
414
  animation: none;
416
415
  }
417
416
  }
417
+
418
418
  </style>