spaper 0.5.6 → 0.6.6

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.
@@ -10,8 +10,7 @@
10
10
  bind:this={rangeEl}
11
11
  bind:value
12
12
  class={classes}
13
- {min} {max} {step}
14
- on:input={updateOutput} />
13
+ {min} {max} {step} />
15
14
  {#if !hideValue}
16
15
  <output>
17
16
  {#if $$slots.output}
@@ -42,11 +41,12 @@ let outputValue;
42
41
  onMount(() => {
43
42
  outputValue = rangeEl.value;
44
43
  });
45
- function updateOutput({ target }) {
46
- outputValue = target.value;
47
- }
48
44
  let classes;
49
45
  $: classes = `range-${background} ${computeClasses('input', { block })}`;
46
+ // need to react to programmatic change to `value` as well as slider variations
47
+ $: if (value !== null) {
48
+ outputValue = String(value);
49
+ }
50
50
  $: if (percentage) {
51
51
  outputValue = String(Math.round(Number(outputValue) / Number(max) * 100));
52
52
  }
@@ -25,12 +25,14 @@
25
25
  </div>
26
26
  </div>
27
27
 
28
- <script >import Button from '../Button.svelte';
28
+ <script >import { createEventDispatcher } from 'svelte';
29
+ import Button from '../Button.svelte';
29
30
  import CloseButton from '../CloseButton.svelte';
30
31
  export let active = false;
31
32
  export let title = '';
32
33
  export let subTitle = '';
33
34
  export let closeBtnText = 'Close';
35
+ const dispatch = createEventDispatcher();
34
36
  function close() {
35
37
  active = false;
36
38
  }
@@ -38,6 +40,9 @@ function handleKeydown({ key }) {
38
40
  if (key === 'Escape')
39
41
  close();
40
42
  }
43
+ $: if (active === false) {
44
+ dispatch('close');
45
+ }
41
46
  </script>
42
47
 
43
48
  <style >.modal.active {
@@ -8,6 +8,8 @@ declare const __propDef: {
8
8
  closeBtnText?: string;
9
9
  };
10
10
  events: {
11
+ close: CustomEvent<any>;
12
+ } & {
11
13
  [evt: string]: CustomEvent<any>;
12
14
  };
13
15
  slots: {
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "papercss",
9
9
  "components"
10
10
  ],
11
- "version": "0.5.6",
11
+ "version": "0.6.6",
12
12
  "repository": {
13
13
  "type": "git",
14
14
  "url": "git+https://github.com/Oli8/spaper.git"
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "homepage": "https://github.com/Oli8/spaper#readme",
20
20
  "peerDependencies": {
21
- "papercss": "^1.8.3"
21
+ "papercss": "^1.8.2"
22
22
  },
23
23
  "type": "module",
24
24
  "exports": {