@decidables/detectable-elements 0.1.1 → 0.1.2
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/CHANGELOG.md +10 -0
- package/lib/detectableElements.esm.js +29 -65
- package/lib/detectableElements.esm.js.map +1 -1
- package/lib/detectableElements.esm.min.js +50 -54
- package/lib/detectableElements.esm.min.js.map +1 -1
- package/lib/detectableElements.umd.js +29 -65
- package/lib/detectableElements.umd.js.map +1 -1
- package/lib/detectableElements.umd.min.js +58 -62
- package/lib/detectableElements.umd.min.js.map +1 -1
- package/package.json +3 -3
- package/src/components/detectable-control.js +5 -5
- package/src/components/rdk-task.js +3 -5
- package/src/components/roc-space.js +3 -5
- package/src/components/sdt-model.js +3 -5
- package/src/examples/sdt-example.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [0.1.2](https://github.com/decidables/decidables/compare/@decidables/detectable-elements@0.1.1...@decidables/detectable-elements@0.1.2) (2022-03-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **detectable-elements,prospectable-elements:** remove IE 11 CSS hack ([dd920ac](https://github.com/decidables/decidables/commit/dd920ac9934cc74a4303a9753771818273aecf71))
|
|
12
|
+
* **detectable-elements:** remove dependence on DecidablesElement.uniqueId ([938e286](https://github.com/decidables/decidables/commit/938e286521cac27302716c63fdcb3fec2d078031))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
### [0.1.1](https://github.com/decidables/decidables/compare/@decidables/detectable-elements@0.1.0...@decidables/detectable-elements@0.1.1) (2022-03-21)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @decidables/detectable-elements
|
|
@@ -6478,28 +6478,8 @@ let _$m = t => t,
|
|
|
6478
6478
|
*/
|
|
6479
6479
|
|
|
6480
6480
|
class DecidablesElement extends s {
|
|
6481
|
-
// HACK: Create a unique ID for each DecidablesElement
|
|
6482
|
-
// This is needed because Edge/IE11 don't have real Shadow DOM, so IDs leak
|
|
6483
|
-
// out of elements and collide if there is more than one of an element on a
|
|
6484
|
-
// page. Known issue for checkbox/switches and the id/for pattern on <input>
|
|
6485
|
-
// and <label>
|
|
6486
|
-
static get uniqueId() {
|
|
6487
|
-
DecidablesElement.ID += 1;
|
|
6488
|
-
return DecidablesElement.ID;
|
|
6489
|
-
}
|
|
6490
|
-
|
|
6491
|
-
constructor() {
|
|
6492
|
-
super();
|
|
6493
|
-
this.uniqueId = `decidables-${DecidablesElement.uniqueId}`;
|
|
6494
|
-
}
|
|
6495
|
-
|
|
6496
6481
|
getComputedStyleValue(property) {
|
|
6497
|
-
|
|
6498
|
-
if (window.ShadyCSS) {
|
|
6499
|
-
return window.ShadyCSS.getComputedStyleValue(this, property);
|
|
6500
|
-
}
|
|
6501
|
-
|
|
6502
|
-
return getComputedStyle(this).getPropertyValue(property);
|
|
6482
|
+
return getComputedStyle(this).getPropertyValue(property).trim();
|
|
6503
6483
|
}
|
|
6504
6484
|
|
|
6505
6485
|
firstUpdated(changedProperties) {
|
|
@@ -6671,7 +6651,6 @@ class DecidablesElement extends s {
|
|
|
6671
6651
|
static get svgFilters() {
|
|
6672
6652
|
const shadows = DecidablesElement.shadows; // eslint-disable-line prefer-destructuring
|
|
6673
6653
|
|
|
6674
|
-
const erodeRadius = 1;
|
|
6675
6654
|
const filters = shadows.elevations.map(z => {
|
|
6676
6655
|
return y$1(_t$m || (_t$m = _$m`
|
|
6677
6656
|
<filter id=${0} x="-250%" y="-250%" width="600%" height="600%">
|
|
@@ -6693,8 +6672,7 @@ class DecidablesElement extends s {
|
|
|
6693
6672
|
<feComposite in="opU" in2="blurU" result="shU" operator="in" />
|
|
6694
6673
|
<feComposite in="opP" in2="blurP" result="shP" operator="in" />
|
|
6695
6674
|
<feComposite in="opA" in2="blurA" result="shA" operator="in" />
|
|
6696
|
-
|
|
6697
|
-
<feMorphology in="solid" result="smaller" operator="erode" radius=${0} />
|
|
6675
|
+
<feMorphology in="solid" result="smaller" operator="erode" radius="1" />
|
|
6698
6676
|
<feComposite in="shU" in2="smaller" result="finalU" operator="out" />
|
|
6699
6677
|
<feComposite in="shP" in2="smaller" result="finalP" operator="out" />
|
|
6700
6678
|
<feComposite in="shA" in2="smaller" result="finalA" operator="out" />
|
|
@@ -6704,7 +6682,7 @@ class DecidablesElement extends s {
|
|
|
6704
6682
|
<feMergeNode in="finalA" />
|
|
6705
6683
|
<feMergeNode in="SourceGraphic" />
|
|
6706
6684
|
</feMerge>
|
|
6707
|
-
</filter>`), `shadow-${z}`, shadows.mapUmbra[z].y / 2, shadows.mapUmbra[z].y, shadows.mapPenumbra[z].y / 2, shadows.mapPenumbra[z].y, shadows.mapAmbient[z].y / 2, shadows.mapAmbient[z].y, shadows.mapUmbra[z].s === 0 ? y$1(_t2$k || (_t2$k = _$m``)) : y$1(_t3$a || (_t3$a = _$m`<feMorphology in="offU" result="spreadU" operator=${0} radius=${0} />`), shadows.mapUmbra[z].s > 0 ? 'dilate' : 'erode', Math.abs(shadows.mapUmbra[z].s)), shadows.mapPenumbra[z].s === 0 ? y$1(_t4$a || (_t4$a = _$m``)) : y$1(_t5$a || (_t5$a = _$m`<feMorphology in="offP" result="spreadP" operator=${0} radius=${0} />`), shadows.mapPenumbra[z].s > 0 ? 'dilate' : 'erode', Math.abs(shadows.mapPenumbra[z].s)), shadows.mapAmbient[z].s === 0 ? y$1(_t6$a || (_t6$a = _$m``)) : y$1(_t7$a || (_t7$a = _$m`<feMorphology in="offA" result="spreadA" operator=${0} radius=${0} />`), shadows.mapAmbient[z].s > 0 ? 'dilate' : 'erode', Math.abs(shadows.mapAmbient[z].s)), shadows.mapUmbra[z].s === 0 ? 'offU' : 'spreadU', shadows.mapUmbra[z].b / 2, shadows.mapPenumbra[z].s === 0 ? 'offP' : 'spreadP', shadows.mapPenumbra[z].b / 2, shadows.mapAmbient[z].s === 0 ? 'offA' : 'spreadA', shadows.mapAmbient[z].b / 2, shadows.baselineColor, shadows.opacityUmbra + shadows.opacityBoost, shadows.baselineColor, shadows.opacityPenumbra + shadows.opacityBoost, shadows.baselineColor, shadows.opacityAmbient + shadows.opacityBoost
|
|
6685
|
+
</filter>`), `shadow-${z}`, shadows.mapUmbra[z].y / 2, shadows.mapUmbra[z].y, shadows.mapPenumbra[z].y / 2, shadows.mapPenumbra[z].y, shadows.mapAmbient[z].y / 2, shadows.mapAmbient[z].y, shadows.mapUmbra[z].s === 0 ? y$1(_t2$k || (_t2$k = _$m``)) : y$1(_t3$a || (_t3$a = _$m`<feMorphology in="offU" result="spreadU" operator=${0} radius=${0} />`), shadows.mapUmbra[z].s > 0 ? 'dilate' : 'erode', Math.abs(shadows.mapUmbra[z].s)), shadows.mapPenumbra[z].s === 0 ? y$1(_t4$a || (_t4$a = _$m``)) : y$1(_t5$a || (_t5$a = _$m`<feMorphology in="offP" result="spreadP" operator=${0} radius=${0} />`), shadows.mapPenumbra[z].s > 0 ? 'dilate' : 'erode', Math.abs(shadows.mapPenumbra[z].s)), shadows.mapAmbient[z].s === 0 ? y$1(_t6$a || (_t6$a = _$m``)) : y$1(_t7$a || (_t7$a = _$m`<feMorphology in="offA" result="spreadA" operator=${0} radius=${0} />`), shadows.mapAmbient[z].s > 0 ? 'dilate' : 'erode', Math.abs(shadows.mapAmbient[z].s)), shadows.mapUmbra[z].s === 0 ? 'offU' : 'spreadU', shadows.mapUmbra[z].b / 2, shadows.mapPenumbra[z].s === 0 ? 'offP' : 'spreadP', shadows.mapPenumbra[z].b / 2, shadows.mapAmbient[z].s === 0 ? 'offA' : 'spreadA', shadows.mapAmbient[z].b / 2, shadows.baselineColor, shadows.opacityUmbra + shadows.opacityBoost, shadows.baselineColor, shadows.opacityPenumbra + shadows.opacityBoost, shadows.baselineColor, shadows.opacityAmbient + shadows.opacityBoost);
|
|
6708
6686
|
});
|
|
6709
6687
|
return y$1(_t8$8 || (_t8$8 = _$m`
|
|
6710
6688
|
<svg class="defs">
|
|
@@ -6774,9 +6752,7 @@ class DecidablesElement extends s {
|
|
|
6774
6752
|
`), o$3(this.cssBoxShadow(0)), o$3(this.cssBoxShadow(2)), o$3(this.cssBoxShadow(4)), o$3(this.cssBoxShadow(8)), o$3(this.greys.white), o$3(this.greys.light75), o$3(this.greys.dark75), o$3(this.greys.white), o$3(this.greys.dark25), o$3(this.greys.light75), o$3(this.greys.light50), o$3(this.greys.grey), o$3(this.greys.dark25), o$3(this.greys.dark50), o$3(this.greys.dark75));
|
|
6775
6753
|
}
|
|
6776
6754
|
|
|
6777
|
-
}
|
|
6778
|
-
|
|
6779
|
-
DecidablesElement.ID = 0;
|
|
6755
|
+
}
|
|
6780
6756
|
|
|
6781
6757
|
let _$l = t => t,
|
|
6782
6758
|
_t$l,
|
|
@@ -7188,14 +7164,14 @@ class DecidablesSlider extends DecidablesElement {
|
|
|
7188
7164
|
|
|
7189
7165
|
render() {
|
|
7190
7166
|
return $(_t2$i || (_t2$i = _$k`
|
|
7191
|
-
<label for
|
|
7167
|
+
<label for="slider">
|
|
7192
7168
|
<slot></slot>
|
|
7193
7169
|
</label>
|
|
7194
7170
|
<div class="range">
|
|
7195
|
-
<input type="range" id
|
|
7171
|
+
<input type="range" id="slider" min=${0} max=${0} step=${0} .value=${0} @change=${0} @input=${0}>
|
|
7196
7172
|
</div>
|
|
7197
7173
|
<decidables-spinner min=${0} max=${0} step=${0} .value=${0} @input=${0}></decidables-spinner>
|
|
7198
|
-
`),
|
|
7174
|
+
`), l(this.min), l(this.max), l(this.step), this.value, this.changed.bind(this), this.inputted.bind(this), l(this.min), l(this.max), l(this.step), this.value, this.inputted.bind(this));
|
|
7199
7175
|
}
|
|
7200
7176
|
|
|
7201
7177
|
}
|
|
@@ -7505,14 +7481,14 @@ class DecidablesSwitch extends DecidablesElement {
|
|
|
7505
7481
|
|
|
7506
7482
|
render() {
|
|
7507
7483
|
return $(_t2$g || (_t2$g = _$i`
|
|
7508
|
-
<input type="checkbox" id
|
|
7509
|
-
<label for
|
|
7484
|
+
<input type="checkbox" id="switch" ?checked=${0} ?disabled=${0} @change=${0}>
|
|
7485
|
+
<label for="switch">
|
|
7510
7486
|
<slot name="off-label"></slot>
|
|
7511
7487
|
</label>
|
|
7512
|
-
<label for
|
|
7488
|
+
<label for="switch">
|
|
7513
7489
|
<slot></slot>
|
|
7514
7490
|
</label>
|
|
7515
|
-
`),
|
|
7491
|
+
`), this.checked, this.disabled, this.changed.bind(this));
|
|
7516
7492
|
}
|
|
7517
7493
|
|
|
7518
7494
|
}
|
|
@@ -7719,11 +7695,11 @@ class DecidablesToggleOption extends DecidablesElement {
|
|
|
7719
7695
|
|
|
7720
7696
|
render() {
|
|
7721
7697
|
return $(_t2$e || (_t2$e = _$g`
|
|
7722
|
-
<input type="radio" id
|
|
7723
|
-
<label for
|
|
7698
|
+
<input type="radio" id="toggle-option" name=${0} value=${0} .checked=${0} @change=${0}>
|
|
7699
|
+
<label for="toggle-option">
|
|
7724
7700
|
<slot></slot>
|
|
7725
7701
|
</label>
|
|
7726
|
-
`),
|
|
7702
|
+
`), this.name, this.value, this.checked, this.changed.bind(this));
|
|
7727
7703
|
}
|
|
7728
7704
|
|
|
7729
7705
|
}
|
|
@@ -8036,7 +8012,7 @@ class RDKTask extends DetectableElement {
|
|
|
8036
8012
|
}
|
|
8037
8013
|
|
|
8038
8014
|
.dot {
|
|
8039
|
-
|
|
8015
|
+
r: 2px;
|
|
8040
8016
|
}
|
|
8041
8017
|
|
|
8042
8018
|
.dots.coherent {
|
|
@@ -8082,9 +8058,8 @@ class RDKTask extends DetectableElement {
|
|
|
8082
8058
|
|
|
8083
8059
|
firstUpdated(changedProperties) {
|
|
8084
8060
|
super.firstUpdated(changedProperties); // Get the width and height after initial render/update has occurred
|
|
8085
|
-
// HACK Edge: Edge doesn't have width/height until after a 0ms timeout
|
|
8086
8061
|
|
|
8087
|
-
|
|
8062
|
+
this.getDimensions();
|
|
8088
8063
|
}
|
|
8089
8064
|
|
|
8090
8065
|
update(changedProperties) {
|
|
@@ -8372,9 +8347,7 @@ class RDKTask extends DetectableElement {
|
|
|
8372
8347
|
return datum;
|
|
8373
8348
|
}); // ENTER
|
|
8374
8349
|
|
|
8375
|
-
const dotEnter = dotUpdate.enter().append('circle').classed('dot', true)
|
|
8376
|
-
/* HACK: Firefox does not support CSS SVG Geometry Properties */
|
|
8377
|
-
// MERGE
|
|
8350
|
+
const dotEnter = dotUpdate.enter().append('circle').classed('dot', true); // MERGE
|
|
8378
8351
|
|
|
8379
8352
|
dotEnter.merge(dotUpdate).attr('cx', datum => {
|
|
8380
8353
|
return datum.x;
|
|
@@ -13595,7 +13568,7 @@ class ROCSpace extends DetectableElement {
|
|
|
13595
13568
|
.point .circle {
|
|
13596
13569
|
fill: var(---color-element-emphasis);
|
|
13597
13570
|
|
|
13598
|
-
|
|
13571
|
+
r: 6px;
|
|
13599
13572
|
}
|
|
13600
13573
|
|
|
13601
13574
|
.point .label {
|
|
@@ -13634,9 +13607,8 @@ class ROCSpace extends DetectableElement {
|
|
|
13634
13607
|
|
|
13635
13608
|
firstUpdated(changedProperties) {
|
|
13636
13609
|
super.firstUpdated(changedProperties); // Get the width and height after initial render/update has occurred
|
|
13637
|
-
// HACK Edge: Edge doesn't have width/height until after a 0ms timeout
|
|
13638
13610
|
|
|
13639
|
-
|
|
13611
|
+
this.getDimensions();
|
|
13640
13612
|
}
|
|
13641
13613
|
|
|
13642
13614
|
update(changedProperties) {
|
|
@@ -14027,9 +13999,7 @@ class ROCSpace extends DetectableElement {
|
|
|
14027
13999
|
}); // ENTER
|
|
14028
14000
|
|
|
14029
14001
|
const pointEnter = pointUpdate.enter().append('g').classed('point', true);
|
|
14030
|
-
pointEnter.append('circle').classed('circle', true)
|
|
14031
|
-
/* HACK: Firefox does not support CSS SVG Geometry Properties */
|
|
14032
|
-
|
|
14002
|
+
pointEnter.append('circle').classed('circle', true);
|
|
14033
14003
|
pointEnter.append('text').classed('label', true); // MERGE
|
|
14034
14004
|
|
|
14035
14005
|
const pointMerge = pointEnter.merge(pointUpdate);
|
|
@@ -14391,13 +14361,13 @@ class DetectableControl extends DetectableElement {
|
|
|
14391
14361
|
</div>`), this.trials ? $(_t3$9 || (_t3$9 = _$c`<decidables-slider min="1" max="100" step="1" .value=${0} @change=${0} @input=${0}>Trials</decidables-slider>`), this.trials, this.setTrials.bind(this), this.setTrials.bind(this)) : $(_t4$9 || (_t4$9 = _$c``)), this.duration ? $(_t5$9 || (_t5$9 = _$c`<decidables-slider min="10" max="2000" step="10" .value=${0} @change=${0} @input=${0}>Duration</decidables-slider>`), this.duration, this.setDuration.bind(this), this.setDuration.bind(this)) : $(_t6$9 || (_t6$9 = _$c``)), this.coherence ? $(_t7$9 || (_t7$9 = _$c`<decidables-slider min="0" max="1" step=".01" .value=${0} @change=${0} @input=${0}>Coherence</decidables-slider>`), this.coherence, this.setCoherence.bind(this), this.setCoherence.bind(this)) : $(_t8$7 || (_t8$7 = _$c``)), this.payoff ? $(_t9$7 || (_t9$7 = _$c`<decidables-slider class="payoff" min="0" max="100" step="1" .value=${0} @change=${0} @input=${0}>Payoff</decidables-slider>`), this.payoff, this.setPayoff.bind(this), this.setPayoff.bind(this)) : $(_t10$7 || (_t10$7 = _$c``)), this.color !== undefined ? $(_t11$7 || (_t11$7 = _$c`
|
|
14392
14362
|
<decidables-toggle @change=${0}>
|
|
14393
14363
|
<span slot="label">Emphasis</span>
|
|
14394
|
-
<decidables-toggle-option name
|
|
14395
|
-
<decidables-toggle-option name
|
|
14396
|
-
<decidables-toggle-option name
|
|
14397
|
-
<decidables-toggle-option name
|
|
14398
|
-
<decidables-toggle-option name
|
|
14364
|
+
<decidables-toggle-option name="toggle" value="none" ?checked=${0}>None</decidables-toggle-option>
|
|
14365
|
+
<decidables-toggle-option name="toggle" value="accuracy" ?checked=${0}>Accuracy</decidables-toggle-option>
|
|
14366
|
+
<decidables-toggle-option name="toggle" value="stimulus" ?checked=${0}>Stimulus</decidables-toggle-option>
|
|
14367
|
+
<decidables-toggle-option name="toggle" value="response" ?checked=${0}>Response</decidables-toggle-option>
|
|
14368
|
+
<decidables-toggle-option name="toggle" value="outcome" ?checked=${0}>Outcome</decidables-toggle-option>
|
|
14399
14369
|
</decidables-toggle>
|
|
14400
|
-
`), this.chooseColor.bind(this),
|
|
14370
|
+
`), this.chooseColor.bind(this), this.color === 'none', this.color === 'accuracy', this.color === 'stimulus', this.color === 'response', this.color === 'outcome') : $(_t12$2 || (_t12$2 = _$c``)), this.zRoc !== undefined ? $(_t13$2 || (_t13$2 = _$c`
|
|
14401
14371
|
<decidables-switch ?checked=${0} @change=${0}>
|
|
14402
14372
|
<span class="math-var">z</span>ROC
|
|
14403
14373
|
<span slot="off-label">ROC</span>
|
|
@@ -14841,7 +14811,7 @@ class SDTModel extends DetectableElement {
|
|
|
14841
14811
|
.threshold .handle {
|
|
14842
14812
|
fill: var(---color-element-emphasis);
|
|
14843
14813
|
|
|
14844
|
-
|
|
14814
|
+
r: 6px;
|
|
14845
14815
|
}
|
|
14846
14816
|
|
|
14847
14817
|
/* Make a larger target for touch users */
|
|
@@ -14940,9 +14910,8 @@ class SDTModel extends DetectableElement {
|
|
|
14940
14910
|
|
|
14941
14911
|
firstUpdated(changedProperties) {
|
|
14942
14912
|
super.firstUpdated(changedProperties); // Get the width and height after initial render/update has occurred
|
|
14943
|
-
// HACK Edge: Edge doesn't have width/height until after a 0ms timeout
|
|
14944
14913
|
|
|
14945
|
-
|
|
14914
|
+
this.getDimensions();
|
|
14946
14915
|
}
|
|
14947
14916
|
|
|
14948
14917
|
update(changedProperties) {
|
|
@@ -15575,9 +15544,7 @@ class SDTModel extends DetectableElement {
|
|
|
15575
15544
|
|
|
15576
15545
|
const thresholdEnter = thresholdUpdate.enter().append('g').classed('threshold', true);
|
|
15577
15546
|
thresholdEnter.append('line').classed('line', true);
|
|
15578
|
-
thresholdEnter.append('circle').classed('handle', true)
|
|
15579
|
-
/* HACK: Firefox does not support CSS SVG Geometry Properties */
|
|
15580
|
-
// MERGE
|
|
15547
|
+
thresholdEnter.append('circle').classed('handle', true); // MERGE
|
|
15581
15548
|
|
|
15582
15549
|
const thresholdMerge = thresholdEnter.merge(thresholdUpdate).attr('tabindex', this.interactive ? 0 : null).classed('interactive', this.interactive);
|
|
15583
15550
|
|
|
@@ -18204,9 +18171,6 @@ class SDTExample extends DetectableElement {
|
|
|
18204
18171
|
---border: var(--border, 1px solid var(---color-border));
|
|
18205
18172
|
display: inline-block;
|
|
18206
18173
|
|
|
18207
|
-
/* This makes IE11 happy */
|
|
18208
|
-
width: 100%;
|
|
18209
|
-
|
|
18210
18174
|
margin-bottom: 1rem;
|
|
18211
18175
|
}
|
|
18212
18176
|
|