@txstate-mws/svelte-components 1.2.0 → 1.2.3
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.
|
@@ -9,7 +9,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
10
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
11
|
};
|
|
12
|
-
var _ElementQueries_instances, _ElementQueries_watchlist, _ElementQueries_busy, _ElementQueries_hasInit, _ElementQueries_mutationobserver, _ElementQueries_boundRefresh,
|
|
12
|
+
var _ElementQueries_instances, _ElementQueries_watchlist, _ElementQueries_busy, _ElementQueries_hasInit, _ElementQueries_mutationobserver, _ElementQueries_boundRefresh, _ElementQueries_subscribers, _ElementQueries_stores, _ElementQueries_processwidths, _ElementQueries_finddepth, _ElementQueries_collecttargets, _ElementQueries_gotoanchor, _ElementQueries_activate, _ElementQueries_activateRaw, _ElementQueries_deactivate;
|
|
13
13
|
class ElementQueries {
|
|
14
14
|
constructor() {
|
|
15
15
|
_ElementQueries_instances.add(this);
|
|
@@ -18,7 +18,6 @@ class ElementQueries {
|
|
|
18
18
|
_ElementQueries_hasInit.set(this, false);
|
|
19
19
|
_ElementQueries_mutationobserver.set(this, void 0);
|
|
20
20
|
_ElementQueries_boundRefresh.set(this, this.refresh.bind(this));
|
|
21
|
-
_ElementQueries_lastw.set(this, void 0);
|
|
22
21
|
_ElementQueries_subscribers.set(this, 0);
|
|
23
22
|
_ElementQueries_stores.set(this, new Map());
|
|
24
23
|
}
|
|
@@ -47,10 +46,7 @@ class ElementQueries {
|
|
|
47
46
|
__classPrivateFieldGet(this, _ElementQueries_stores, "f").set(el, store);
|
|
48
47
|
else
|
|
49
48
|
__classPrivateFieldGet(this, _ElementQueries_stores, "f").delete(el);
|
|
50
|
-
|
|
51
|
-
__classPrivateFieldSet(this, _ElementQueries_hasInit, true, "f");
|
|
52
|
-
__classPrivateFieldGet(this, _ElementQueries_instances, "m", _ElementQueries_activateRaw).call(this);
|
|
53
|
-
}
|
|
49
|
+
__classPrivateFieldGet(this, _ElementQueries_instances, "m", _ElementQueries_activateRaw).call(this);
|
|
54
50
|
return () => {
|
|
55
51
|
var _a;
|
|
56
52
|
if (__classPrivateFieldSet(this, _ElementQueries_subscribers, (_a = __classPrivateFieldGet(this, _ElementQueries_subscribers, "f"), --_a), "f") === 0)
|
|
@@ -58,7 +54,7 @@ class ElementQueries {
|
|
|
58
54
|
};
|
|
59
55
|
}
|
|
60
56
|
}
|
|
61
|
-
_ElementQueries_watchlist = new WeakMap(), _ElementQueries_busy = new WeakMap(), _ElementQueries_hasInit = new WeakMap(), _ElementQueries_mutationobserver = new WeakMap(), _ElementQueries_boundRefresh = new WeakMap(),
|
|
57
|
+
_ElementQueries_watchlist = new WeakMap(), _ElementQueries_busy = new WeakMap(), _ElementQueries_hasInit = new WeakMap(), _ElementQueries_mutationobserver = new WeakMap(), _ElementQueries_boundRefresh = new WeakMap(), _ElementQueries_subscribers = new WeakMap(), _ElementQueries_stores = new WeakMap(), _ElementQueries_instances = new WeakSet(), _ElementQueries_processwidths = function _ElementQueries_processwidths() {
|
|
62
58
|
for (let i = 0; i < __classPrivateFieldGet(this, _ElementQueries_watchlist, "f").length; i++) {
|
|
63
59
|
const widths = [];
|
|
64
60
|
const attrs = [];
|
|
@@ -81,9 +77,8 @@ _ElementQueries_watchlist = new WeakMap(), _ElementQueries_busy = new WeakMap(),
|
|
|
81
77
|
}
|
|
82
78
|
if (attrstr !== attrs[j])
|
|
83
79
|
el.setAttribute('data-eq', attrstr);
|
|
84
|
-
if (__classPrivateFieldGet(this,
|
|
85
|
-
__classPrivateFieldGet(this, _ElementQueries_stores, "f").get(el).update(v =>
|
|
86
|
-
__classPrivateFieldSet(this, _ElementQueries_lastw, finalw, "f");
|
|
80
|
+
if (__classPrivateFieldGet(this, _ElementQueries_stores, "f").has(el)) {
|
|
81
|
+
__classPrivateFieldGet(this, _ElementQueries_stores, "f").get(el).update(v => v.width === finalw ? v : { ...v, width: finalw });
|
|
87
82
|
}
|
|
88
83
|
}
|
|
89
84
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script >import { onDestroy, tick, setContext, onMount } from 'svelte';
|
|
2
2
|
import { writable } from 'svelte/store';
|
|
3
|
-
import { browser } from '$app/env';
|
|
4
3
|
import { resize } from '../actions';
|
|
5
4
|
import { CARDLAYOUT } from '../types';
|
|
6
5
|
export let maxwidth = 500;
|
|
7
6
|
export let preserveorder = false;
|
|
8
7
|
export let gutter = 10;
|
|
9
8
|
export let className = '';
|
|
9
|
+
const ssr = navigator.userAgent.includes('jsdom');
|
|
10
10
|
const blocks = [];
|
|
11
11
|
const gutterstore = writable(gutter);
|
|
12
12
|
let defaultOrder = 0;
|
|
@@ -177,7 +177,7 @@ function onResize(e) {
|
|
|
177
177
|
onMount(() => triggerrecalc(layoutelement.clientWidth));
|
|
178
178
|
</script>
|
|
179
179
|
|
|
180
|
-
<ul class="cardlayout {className}" class:ssr
|
|
180
|
+
<ul class="cardlayout {className}" class:ssr style:height={ssr ? undefined : `${fullheight + gutter}px`} bind:this={layoutelement} use:resize on:resize={onResize}>
|
|
181
181
|
<slot></slot>
|
|
182
182
|
</ul>
|
|
183
183
|
|
|
@@ -5,6 +5,7 @@ import DefaultPopupMenu from './PopupMenu.svelte';
|
|
|
5
5
|
import { debouncedPromise, modifierKey, selectionIsLeft } from '../util';
|
|
6
6
|
export let id = randomid();
|
|
7
7
|
export let name;
|
|
8
|
+
export let disabled = false;
|
|
8
9
|
export let getOptions;
|
|
9
10
|
export let menuContainerClass = undefined;
|
|
10
11
|
export let menuClass = undefined;
|
|
@@ -101,17 +102,17 @@ $: dispatch('change', selected);
|
|
|
101
102
|
</script>
|
|
102
103
|
|
|
103
104
|
<fieldset>
|
|
104
|
-
<ul class="multiselect-selected" role="listbox">
|
|
105
|
+
<ul class="multiselect-selected" class:disabled role="listbox">
|
|
105
106
|
{#each selected as option, i}
|
|
106
107
|
<li id={id + option.value} role="option" tabindex="-1" class="multiselect-pill" class:hilited={hilitedpill === option.value}
|
|
107
|
-
on:click|preventDefault|stopPropagation={() => removeSelection(option, i, 1)}
|
|
108
|
+
on:click|preventDefault|stopPropagation={() => !disabled && removeSelection(option, i, 1)} on:mousedown={e => disabled && e.preventDefault()}
|
|
108
109
|
aria-selected="true">
|
|
109
110
|
{option.label || option.value}
|
|
110
111
|
<ScreenReaderOnly>, click to remove</ScreenReaderOnly>
|
|
111
112
|
</li>
|
|
112
113
|
{/each}
|
|
113
114
|
<li class="input">
|
|
114
|
-
<input type="text" id={id} name={name} placeholder={placeholder}
|
|
115
|
+
<input type="text" id={id} name={name} {disabled} placeholder={placeholder}
|
|
115
116
|
bind:this={inputelement} bind:value={inputvalue}
|
|
116
117
|
on:focus={inputfocus} on:keydown={inputkeydown}
|
|
117
118
|
autocomplete="off" autocorrect="off" spellcheck="false" aria-autocomplete="list"
|
|
@@ -172,6 +173,12 @@ $: dispatch('change', selected);
|
|
|
172
173
|
color: var(--multiselect-pill-text, black);
|
|
173
174
|
padding: var(--multiselect-pill-padding, 0.3em 0.5em);
|
|
174
175
|
}
|
|
176
|
+
.multiselect-selected.disabled {
|
|
177
|
+
opacity: 0.5;
|
|
178
|
+
}
|
|
179
|
+
.multiselect-selected.disabled .multiselect-pill {
|
|
180
|
+
cursor: default;
|
|
181
|
+
}
|
|
175
182
|
.multiselect-pill.hilited {
|
|
176
183
|
outline: 0;
|
|
177
184
|
background-color: var(--multiselect-pill-selected, gray);
|