@txstate-mws/svelte-components 1.2.3 → 1.2.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.
@@ -6,7 +6,7 @@ export let maxwidth = 500;
6
6
  export let preserveorder = false;
7
7
  export let gutter = 10;
8
8
  export let className = '';
9
- const ssr = navigator.userAgent.includes('jsdom');
9
+ const ssr = typeof navigator === 'undefined' || navigator.userAgent.includes('jsdom');
10
10
  const blocks = [];
11
11
  const gutterstore = writable(gutter);
12
12
  let defaultOrder = 0;
@@ -0,0 +1,43 @@
1
+ <script >import ScreenReaderOnly from './ScreenReaderOnly.svelte';
2
+ import { resize, ResizeStore } from '../actions';
3
+ export let loading;
4
+ export let height = undefined;
5
+ const store = new ResizeStore();
6
+ </script>
7
+
8
+ {#if loading}
9
+ <div class="container" style:height={height} style:position={height ? 'relative' : 'absolute'}>
10
+ <div use:resize={{ store }} class="loader" style:border-width="{$store.offsetWidth * 0.1}px"><ScreenReaderOnly>Loading</ScreenReaderOnly></div>
11
+ </div>
12
+ {:else}
13
+ <slot />
14
+ {/if}
15
+
16
+ <style>
17
+ .container {
18
+ position: absolute;
19
+ top: 0;
20
+ left: 0;
21
+ width: 100%;
22
+ height: 100%;
23
+ background-color: var(--loading-bg, var(--modal-bg, rgba(0, 0, 0, 0.7)));
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ }
28
+ .loader {
29
+ box-sizing: content-box;
30
+ width: var(--loading-size, 10%);
31
+ padding-top: var(--loading-size, 10%);
32
+ border-color: var(--loading-bg-color, #FFFFFF);
33
+ border-top-color: var(--loading-moving-color, #333333);
34
+ border-style: solid;
35
+ border-radius: 50%;
36
+ animation: spin 2s linear infinite;
37
+ }
38
+
39
+ @keyframes spin {
40
+ 0% { transform: rotate(0deg); }
41
+ 100% { transform: rotate(360deg); }
42
+ }
43
+ </style>
@@ -0,0 +1,19 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ loading: boolean | undefined;
5
+ height?: string | undefined;
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {
11
+ default: {};
12
+ };
13
+ };
14
+ export declare type LoadingProps = typeof __propDef.props;
15
+ export declare type LoadingEvents = typeof __propDef.events;
16
+ export declare type LoadingSlots = typeof __propDef.slots;
17
+ export default class Loading extends SvelteComponentTyped<LoadingProps, LoadingEvents, LoadingSlots> {
18
+ }
19
+ export {};
@@ -113,7 +113,7 @@ $: dispatch('change', selected);
113
113
  {/each}
114
114
  <li class="input">
115
115
  <input type="text" id={id} name={name} {disabled} placeholder={placeholder}
116
- bind:this={inputelement} bind:value={inputvalue}
116
+ bind:this={inputelement} bind:value={inputvalue} on:blur
117
117
  on:focus={inputfocus} on:keydown={inputkeydown}
118
118
  autocomplete="off" autocorrect="off" spellcheck="false" aria-autocomplete="list"
119
119
  aria-describedby="{descriptionid}">
@@ -20,6 +20,7 @@ declare const __propDef: {
20
20
  PopupMenu?: typeof DefaultPopupMenu;
21
21
  };
22
22
  events: {
23
+ blur: FocusEvent;
23
24
  change: CustomEvent<any>;
24
25
  } & {
25
26
  [evt: string]: CustomEvent<any>;
@@ -1,8 +1,9 @@
1
1
  export { default as CardLayout } from './CardLayout.svelte';
2
2
  export { default as Card } from './Card.svelte';
3
3
  export { default as CollapsingTable } from './CollapsingTable.svelte';
4
- export { default as FocusLock } from './FocusLock.svelte';
5
4
  export { default as ConditionalWrapper } from './ConditionalWrapper.svelte';
5
+ export { default as FocusLock } from './FocusLock.svelte';
6
+ export { default as Loading } from './Loading.svelte';
6
7
  export { default as Modal } from './Modal.svelte';
7
8
  export { default as MultiSelect } from './MultiSelect.svelte';
8
9
  export { default as PopupMenu } from './PopupMenu.svelte';
@@ -1,8 +1,9 @@
1
1
  export { default as CardLayout } from './CardLayout.svelte';
2
2
  export { default as Card } from './Card.svelte';
3
3
  export { default as CollapsingTable } from './CollapsingTable.svelte';
4
- export { default as FocusLock } from './FocusLock.svelte';
5
4
  export { default as ConditionalWrapper } from './ConditionalWrapper.svelte';
5
+ export { default as FocusLock } from './FocusLock.svelte';
6
+ export { default as Loading } from './Loading.svelte';
6
7
  export { default as Modal } from './Modal.svelte';
7
8
  export { default as MultiSelect } from './MultiSelect.svelte';
8
9
  export { default as PopupMenu } from './PopupMenu.svelte';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@txstate-mws/svelte-components",
3
- "version": "1.2.3",
3
+ "version": "1.2.6",
4
4
  "description": "Svelte components that are generically useful.",
5
5
  "dependencies": {
6
6
  "@txstate-mws/svelte-store": "^1.0.3",
@@ -44,6 +44,7 @@
44
44
  "./components/CollapsingTable.svelte": "./components/CollapsingTable.svelte",
45
45
  "./components/ConditionalWrapper.svelte": "./components/ConditionalWrapper.svelte",
46
46
  "./components/FocusLock.svelte": "./components/FocusLock.svelte",
47
+ "./components/Loading.svelte": "./components/Loading.svelte",
47
48
  "./components/Modal.svelte": "./components/Modal.svelte",
48
49
  "./components/MultiSelect.svelte": "./components/MultiSelect.svelte",
49
50
  "./components/PopupMenu.svelte": "./components/PopupMenu.svelte",