@internetarchive/histogram-date-range 0.1.6 → 0.1.7-a1
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/demo/index.html +11 -11
- package/demo/js/app-root.ts +59 -0
- package/dist/demo/js/app-root.d.ts +19 -0
- package/dist/demo/js/app-root.js +58 -0
- package/dist/demo/js/app-root.js.map +1 -0
- package/docs/_snowpack/pkg/@internetarchive/ia-activity-indicator/ia-activity-indicator.js +2 -2
- package/docs/_snowpack/pkg/common/lit-element-2ebaea62.js +22 -0
- package/docs/_snowpack/pkg/common/lit-html-ab4365d1.js +8 -0
- package/docs/_snowpack/pkg/lit/directives/live.js +3 -3
- package/docs/_snowpack/pkg/lit.js +2 -2
- package/docs/demo/index.html +11 -11
- package/docs/dist/demo/js/app-root.js +79 -0
- package/package.json +3 -3
- package/snowpack.config.js +1 -1
- package/demo/app-root.ts +0 -21
- package/dist/demo/app-root.d.ts +0 -9
- package/dist/demo/app-root.js +0 -25
- package/dist/demo/app-root.js.map +0 -1
- package/docs/_snowpack/pkg/common/lit-element-3254fb50.js +0 -22
- package/docs/_snowpack/pkg/common/lit-html-1d707ff6.js +0 -8
- package/docs/demo/app-root.js +0 -29
package/demo/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<script type="module">
|
|
10
10
|
import '../dist/src/histogram-date-range.js';
|
|
11
11
|
let eventCount = 0;
|
|
12
|
-
import '../dist/demo/app-root.js';
|
|
12
|
+
import '../dist/demo/js/app-root.js';
|
|
13
13
|
// listen to events from the component and display the data received from them
|
|
14
14
|
document.addEventListener('histogramDateRangeUpdated', e => {
|
|
15
15
|
document.querySelector('.received-events').innerHTML =
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
<div class="container">
|
|
45
45
|
<div class="description">range spanning negative to positive years</div>
|
|
46
46
|
<histogram-date-range
|
|
47
|
-
|
|
47
|
+
minDate="-1050" maxDate="2200"
|
|
48
48
|
bins="[ 74, 67, 17, 66, 49, 93, 47, 61, 32, 46, 53, 2,
|
|
49
49
|
13, 45, 28, 1, 8, 70, 37, 74, 67, 17, 66, 49, 93,
|
|
50
50
|
47, 61, 70, 37, 74, 67, 17, 66, 49, 93, 47, 61, 32,
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
<histogram-date-range
|
|
61
61
|
width="175"
|
|
62
62
|
tooltipwidth="120"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
dateFormat="YYYY"
|
|
64
|
+
updateDelay="1000"
|
|
65
|
+
missingDataMessage="..."
|
|
66
|
+
minSelectedDate="1987"
|
|
67
|
+
maxSelectedDate="2016"
|
|
68
|
+
minDate="1987"
|
|
69
|
+
maxDate="2016"
|
|
70
70
|
bins="[1519,1643,1880,2046,1973,2085,2148,2152,2349,2304,2314,2484,2590,2450,2495,2475,2392,2631,2504,2619,2519,2552,2462,2217,2171,2132,2127,2041,1638,1441]"
|
|
71
71
|
>
|
|
72
72
|
</histogram-date-range>
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
<div class="container">
|
|
76
76
|
<div class="description">small year range and few bins</div>
|
|
77
77
|
<histogram-date-range width="175" tooltipwidth="120"
|
|
78
|
-
|
|
78
|
+
minDate="2008" maxDate="2016" bins="[76104,866978,1151617,986331,218672,107410,3324]">
|
|
79
79
|
</histogram-date-range>
|
|
80
80
|
</div>
|
|
81
81
|
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<div class="description">
|
|
147
147
|
single bin
|
|
148
148
|
</div>
|
|
149
|
-
<histogram-date-range
|
|
149
|
+
<histogram-date-range minDate="1926" maxDate="1926" bins="[8]">
|
|
150
150
|
</histogram-date-range>
|
|
151
151
|
</div>
|
|
152
152
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { LitElement, html, TemplateResult } from 'lit';
|
|
2
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
3
|
+
import '../../src/histogram-date-range';
|
|
4
|
+
|
|
5
|
+
interface DataSource {
|
|
6
|
+
minDate: unknown;
|
|
7
|
+
maxDate: unknown;
|
|
8
|
+
minSelectedDate: unknown;
|
|
9
|
+
maxSelectedDate: unknown;
|
|
10
|
+
bins: number[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* This is mainly to test the histogram-date-range within
|
|
15
|
+
* a lit-element.
|
|
16
|
+
*/
|
|
17
|
+
@customElement('app-root')
|
|
18
|
+
export class AppRoot extends LitElement {
|
|
19
|
+
@state() dataSource: DataSource = {
|
|
20
|
+
minDate: 1955,
|
|
21
|
+
maxDate: 2000,
|
|
22
|
+
minSelectedDate: 1955,
|
|
23
|
+
maxSelectedDate: 2000,
|
|
24
|
+
bins: [
|
|
25
|
+
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
render(): TemplateResult {
|
|
30
|
+
return html`
|
|
31
|
+
<histogram-date-range
|
|
32
|
+
.minDate=${this.dataSource?.minDate}
|
|
33
|
+
.maxDate=${this.dataSource?.maxDate}
|
|
34
|
+
.minSelectedDate=${this.dataSource?.minSelectedDate}
|
|
35
|
+
.maxSelectedDate=${this.dataSource?.maxSelectedDate}
|
|
36
|
+
.updateDelay=${1000}
|
|
37
|
+
.bins=${this.dataSource?.bins}
|
|
38
|
+
></histogram-date-range>
|
|
39
|
+
|
|
40
|
+
<button @click=${this.randomize}>Randomize</button>
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private randomize() {
|
|
45
|
+
const minDate = Math.round(Math.random() * 1000);
|
|
46
|
+
const maxDate = minDate + Math.round(Math.random() * 1000);
|
|
47
|
+
// generate random bins
|
|
48
|
+
const bins = Array.from({ length: 20 }, () =>
|
|
49
|
+
Math.floor(Math.random() * minDate)
|
|
50
|
+
);
|
|
51
|
+
this.dataSource = {
|
|
52
|
+
minDate,
|
|
53
|
+
maxDate,
|
|
54
|
+
minSelectedDate: minDate,
|
|
55
|
+
maxSelectedDate: maxDate,
|
|
56
|
+
bins: bins,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
+
import '../../src/histogram-date-range';
|
|
3
|
+
interface DataSource {
|
|
4
|
+
minDate: unknown;
|
|
5
|
+
maxDate: unknown;
|
|
6
|
+
minSelectedDate: unknown;
|
|
7
|
+
maxSelectedDate: unknown;
|
|
8
|
+
bins: number[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* This is mainly to test the histogram-date-range within
|
|
12
|
+
* a lit-element.
|
|
13
|
+
*/
|
|
14
|
+
export declare class AppRoot extends LitElement {
|
|
15
|
+
dataSource: DataSource;
|
|
16
|
+
render(): TemplateResult;
|
|
17
|
+
private randomize;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, html } from 'lit';
|
|
3
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
4
|
+
import '../../src/histogram-date-range';
|
|
5
|
+
/**
|
|
6
|
+
* This is mainly to test the histogram-date-range within
|
|
7
|
+
* a lit-element.
|
|
8
|
+
*/
|
|
9
|
+
let AppRoot = class AppRoot extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.dataSource = {
|
|
13
|
+
minDate: 1955,
|
|
14
|
+
maxDate: 2000,
|
|
15
|
+
minSelectedDate: 1955,
|
|
16
|
+
maxSelectedDate: 2000,
|
|
17
|
+
bins: [
|
|
18
|
+
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
var _a, _b, _c, _d, _e;
|
|
24
|
+
return html `
|
|
25
|
+
<histogram-date-range
|
|
26
|
+
.minDate=${(_a = this.dataSource) === null || _a === void 0 ? void 0 : _a.minDate}
|
|
27
|
+
.maxDate=${(_b = this.dataSource) === null || _b === void 0 ? void 0 : _b.maxDate}
|
|
28
|
+
.minSelectedDate=${(_c = this.dataSource) === null || _c === void 0 ? void 0 : _c.minSelectedDate}
|
|
29
|
+
.maxSelectedDate=${(_d = this.dataSource) === null || _d === void 0 ? void 0 : _d.maxSelectedDate}
|
|
30
|
+
.updateDelay=${1000}
|
|
31
|
+
.bins=${(_e = this.dataSource) === null || _e === void 0 ? void 0 : _e.bins}
|
|
32
|
+
></histogram-date-range>
|
|
33
|
+
|
|
34
|
+
<button @click=${this.randomize}>Randomize</button>
|
|
35
|
+
`;
|
|
36
|
+
}
|
|
37
|
+
randomize() {
|
|
38
|
+
const minDate = Math.round(Math.random() * 1000);
|
|
39
|
+
const maxDate = minDate + Math.round(Math.random() * 1000);
|
|
40
|
+
// generate random bins
|
|
41
|
+
const bins = Array.from({ length: 20 }, () => Math.floor(Math.random() * minDate));
|
|
42
|
+
this.dataSource = {
|
|
43
|
+
minDate,
|
|
44
|
+
maxDate,
|
|
45
|
+
minSelectedDate: minDate,
|
|
46
|
+
maxSelectedDate: maxDate,
|
|
47
|
+
bins: bins,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
__decorate([
|
|
52
|
+
state()
|
|
53
|
+
], AppRoot.prototype, "dataSource", void 0);
|
|
54
|
+
AppRoot = __decorate([
|
|
55
|
+
customElement('app-root')
|
|
56
|
+
], AppRoot);
|
|
57
|
+
export { AppRoot };
|
|
58
|
+
//# sourceMappingURL=app-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-root.js","sourceRoot":"","sources":["../../../demo/js/app-root.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,gCAAgC,CAAC;AAUxC;;;GAGG;AAEH,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,UAAU;IAAvC;;QACW,eAAU,GAAe;YAChC,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,IAAI;YACb,eAAe,EAAE,IAAI;YACrB,eAAe,EAAE,IAAI;YACrB,IAAI,EAAE;gBACJ,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;aACtE;SACF,CAAC;IAgCJ,CAAC;IA9BC,MAAM;;QACJ,OAAO,IAAI,CAAA;;mBAEI,MAAA,IAAI,CAAC,UAAU,0CAAE,OAAO;mBACxB,MAAA,IAAI,CAAC,UAAU,0CAAE,OAAO;2BAChB,MAAA,IAAI,CAAC,UAAU,0CAAE,eAAe;2BAChC,MAAA,IAAI,CAAC,UAAU,0CAAE,eAAe;uBACpC,IAAI;gBACX,MAAA,IAAI,CAAC,UAAU,0CAAE,IAAI;;;uBAGd,IAAI,CAAC,SAAS;KAChC,CAAC;IACJ,CAAC;IAEO,SAAS;QACf,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;QAC3D,uBAAuB;QACvB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAC3C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,CACpC,CAAC;QACF,IAAI,CAAC,UAAU,GAAG;YAChB,OAAO;YACP,OAAO;YACP,eAAe,EAAE,OAAO;YACxB,eAAe,EAAE,OAAO;YACxB,IAAI,EAAE,IAAI;SACX,CAAC;IACJ,CAAC;CACF,CAAA;AAxCU;IAAR,KAAK,EAAE;2CAQN;AATS,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAyCnB;SAzCY,OAAO","sourcesContent":["import { LitElement, html, TemplateResult } from 'lit';\nimport { customElement, state } from 'lit/decorators.js';\nimport '../../src/histogram-date-range';\n\ninterface DataSource {\n minDate: unknown;\n maxDate: unknown;\n minSelectedDate: unknown;\n maxSelectedDate: unknown;\n bins: number[];\n}\n\n/**\n * This is mainly to test the histogram-date-range within\n * a lit-element.\n */\n@customElement('app-root')\nexport class AppRoot extends LitElement {\n @state() dataSource: DataSource = {\n minDate: 1955,\n maxDate: 2000,\n minSelectedDate: 1955,\n maxSelectedDate: 2000,\n bins: [\n 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n ],\n };\n\n render(): TemplateResult {\n return html`\n <histogram-date-range\n .minDate=${this.dataSource?.minDate}\n .maxDate=${this.dataSource?.maxDate}\n .minSelectedDate=${this.dataSource?.minSelectedDate}\n .maxSelectedDate=${this.dataSource?.maxSelectedDate}\n .updateDelay=${1000}\n .bins=${this.dataSource?.bins}\n ></histogram-date-range>\n\n <button @click=${this.randomize}>Randomize</button>\n `;\n }\n\n private randomize() {\n const minDate = Math.round(Math.random() * 1000);\n const maxDate = minDate + Math.round(Math.random() * 1000);\n // generate random bins\n const bins = Array.from({ length: 20 }, () =>\n Math.floor(Math.random() * minDate)\n );\n this.dataSource = {\n minDate,\n maxDate,\n minSelectedDate: minDate,\n maxSelectedDate: maxDate,\n bins: bins,\n };\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s, r } from '../../common/lit-element-
|
|
2
|
-
import { $ } from '../../common/lit-html-
|
|
1
|
+
import { s, r } from '../../common/lit-element-2ebaea62.js';
|
|
2
|
+
import { $ } from '../../common/lit-html-ab4365d1.js';
|
|
3
3
|
|
|
4
4
|
const IAActivityIndicatorMode = Object.freeze({
|
|
5
5
|
processing: 'processing',
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { T, b } from './lit-html-ab4365d1.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2019 Google LLC
|
|
6
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
const t=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e=Symbol(),n=new WeakMap;class s{constructor(t,n,s){if(this._$cssResult$=!0,s!==e)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n;}get styleSheet(){let e=this.o;const s=this.t;if(t&&void 0===e){const t=void 0!==s&&1===s.length;t&&(e=n.get(s)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&n.set(s,e));}return e}toString(){return this.cssText}}const o=t=>new s("string"==typeof t?t:t+"",void 0,e),r=(t,...n)=>{const o=1===t.length?t[0]:n.reduce(((e,n,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1]),t[0]);return new s(o,t,e)},i=(e,n)=>{t?e.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((t=>{const n=document.createElement("style"),s=window.litNonce;void 0!==s&&n.setAttribute("nonce",s),n.textContent=t.cssText,e.appendChild(n);}));},S=t?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return o(e)})(t):t;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @license
|
|
12
|
+
* Copyright 2017 Google LLC
|
|
13
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
14
|
+
*/var s$1;const e$1=window.trustedTypes,r$1=e$1?e$1.emptyScript:"",h=window.reactiveElementPolyfillSupport,o$1={toAttribute(t,i){switch(i){case Boolean:t=t?r$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,i){let s=t;switch(i){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t);}catch(t){s=null;}}return s}},n$1=(t,i)=>i!==t&&(i==i||t==t),l={attribute:!0,type:String,converter:o$1,reflect:!1,hasChanged:n$1};class a extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u();}static addInitializer(t){var i;null!==(i=this.h)&&void 0!==i||(this.h=[]),this.h.push(t);}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,s)=>{const e=this._$Ep(s,i);void 0!==e&&(this._$Ev.set(e,s),t.push(e));})),t}static createProperty(t,i=l){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,e=this.getPropertyDescriptor(t,s,i);void 0!==e&&Object.defineProperty(this.prototype,t,e);}}static getPropertyDescriptor(t,i,s){return {get(){return this[i]},set(e){const r=this[t];this[i]=e,this.requestUpdate(t,r,s);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||l}static finalize(){if(this.hasOwnProperty("finalized"))return !1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of i)this.createProperty(s,t[s]);}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(i){const s=[];if(Array.isArray(i)){const e=new Set(i.flat(1/0).reverse());for(const i of e)s.unshift(S(i));}else void 0!==i&&s.push(S(i));return s}static _$Ep(t,i){const s=i.attribute;return !1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)));}addController(t){var i,s;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t));}removeController(t){var i;null===(i=this._$ES)||void 0===i||i.splice(this._$ES.indexOf(t)>>>0,1);}_$Eg(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i]);}));}createRenderRoot(){var t;const s=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return i(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}));}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}));}attributeChangedCallback(t,i,s){this._$AK(t,s);}_$EO(t,i,s=l){var e,r;const h=this.constructor._$Ep(t,s);if(void 0!==h&&!0===s.reflect){const n=(null!==(r=null===(e=s.converter)||void 0===e?void 0:e.toAttribute)&&void 0!==r?r:o$1.toAttribute)(i,s.type);this._$El=t,null==n?this.removeAttribute(h):this.setAttribute(h,n),this._$El=null;}}_$AK(t,i){var s,e;const r=this.constructor,h=r._$Ev.get(t);if(void 0!==h&&this._$El!==h){const t=r.getPropertyOptions(h),n=t.converter,l=null!==(e=null!==(s=null==n?void 0:n.fromAttribute)&&void 0!==s?s:"function"==typeof n?n:null)&&void 0!==e?e:o$1.fromAttribute;this._$El=h,this[h]=l(i,t.type),this._$El=null;}}requestUpdate(t,i,s){let e=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||n$1)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):e=!1),!this.isUpdatePending&&e&&(this._$E_=this._$Ej());}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,i)=>this[i]=t)),this._$Ei=void 0);let i=!1;const s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(s)):this._$Ek();}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(s);}willUpdate(t){}_$AE(t){var i;null===(i=this._$ES)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return !0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$EO(i,this[i],t))),this._$EC=void 0),this._$Ek();}updated(t){}firstUpdated(t){}}a.finalized=!0,a.elementProperties=new Map,a.elementStyles=[],a.shadowRootOptions={mode:"open"},null==h||h({ReactiveElement:a}),(null!==(s$1=globalThis.reactiveElementVersions)&&void 0!==s$1?s$1:globalThis.reactiveElementVersions=[]).push("1.3.4");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @license
|
|
18
|
+
* Copyright 2017 Google LLC
|
|
19
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
20
|
+
*/var l$1,o$2;class s$2 extends a{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=T(i,this.renderRoot,this.renderOptions);}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0);}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1);}render(){return b}}s$2.finalized=!0,s$2._$litElement$=!0,null===(l$1=globalThis.litElementHydrateSupport)||void 0===l$1||l$1.call(globalThis,{LitElement:s$2});const n$2=globalThis.litElementPolyfillSupport;null==n$2||n$2({LitElement:s$2});(null!==(o$2=globalThis.litElementVersions)&&void 0!==o$2?o$2:globalThis.litElementVersions=[]).push("3.2.2");
|
|
21
|
+
|
|
22
|
+
export { r, s$2 as s };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
var t;const i=globalThis.trustedTypes,s=i?i.createPolicy("lit-html",{createHTML:t=>t}):void 0,e=`lit$${(Math.random()+"").slice(9)}$`,o="?"+e,n=`<${o}>`,l=document,h=(t="")=>l.createComment(t),r=t=>null===t||"object"!=typeof t&&"function"!=typeof t,d=Array.isArray,u=t=>d(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),c=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,a=/>/g,f=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),_=/'/g,g=/"/g,m=/^(?:script|style|textarea|title)$/i,p=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),$=p(1),y=p(2),b=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),x=new WeakMap,T=(t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new N(i.insertBefore(h(),t),t,void 0,null!=s?s:{});}return l._$AI(t),l},A=l.createTreeWalker(l,129,null,!1),E=(t,i)=>{const o=t.length-1,l=[];let h,r=2===i?"<svg>":"",d=c;for(let i=0;i<o;i++){const s=t[i];let o,u,p=-1,$=0;for(;$<s.length&&(d.lastIndex=$,u=d.exec(s),null!==u);)$=d.lastIndex,d===c?"!--"===u[1]?d=v:void 0!==u[1]?d=a:void 0!==u[2]?(m.test(u[2])&&(h=RegExp("</"+u[2],"g")),d=f):void 0!==u[3]&&(d=f):d===f?">"===u[0]?(d=null!=h?h:c,p=-1):void 0===u[1]?p=-2:(p=d.lastIndex-u[2].length,o=u[1],d=void 0===u[3]?f:'"'===u[3]?g:_):d===g||d===_?d=f:d===v||d===a?d=c:(d=f,h=void 0);const y=d===f&&t[i+1].startsWith("/>")?" ":"";r+=d===c?s+n:p>=0?(l.push(o),s.slice(0,p)+"$lit$"+s.slice(p)+e+y):s+e+(-2===p?(l.push(void 0),i):y);}const u=r+(t[o]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return [void 0!==s?s.createHTML(u):u,l]};class C{constructor({strings:t,_$litType$:s},n){let l;this.parts=[];let r=0,d=0;const u=t.length-1,c=this.parts,[v,a]=E(t,s);if(this.el=C.createElement(v,n),A.currentNode=this.el.content,2===s){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes);}for(;null!==(l=A.nextNode())&&c.length<u;){if(1===l.nodeType){if(l.hasAttributes()){const t=[];for(const i of l.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(e)){const s=a[d++];if(t.push(i),void 0!==s){const t=l.getAttribute(s.toLowerCase()+"$lit$").split(e),i=/([.?@])?(.*)/.exec(s);c.push({type:1,index:r,name:i[2],strings:t,ctor:"."===i[1]?M:"?"===i[1]?k:"@"===i[1]?H:S});}else c.push({type:6,index:r});}for(const i of t)l.removeAttribute(i);}if(m.test(l.tagName)){const t=l.textContent.split(e),s=t.length-1;if(s>0){l.textContent=i?i.emptyScript:"";for(let i=0;i<s;i++)l.append(t[i],h()),A.nextNode(),c.push({type:2,index:++r});l.append(t[s],h());}}}else if(8===l.nodeType)if(l.data===o)c.push({type:2,index:r});else {let t=-1;for(;-1!==(t=l.data.indexOf(e,t+1));)c.push({type:7,index:r}),t+=e.length-1;}r++;}}static createElement(t,i){const s=l.createElement("template");return s.innerHTML=t,s}}function P(t,i,s=t,e){var o,n,l,h;if(i===b)return i;let d=void 0!==e?null===(o=s._$Cl)||void 0===o?void 0:o[e]:s._$Cu;const u=r(i)?void 0:i._$litDirective$;return (null==d?void 0:d.constructor)!==u&&(null===(n=null==d?void 0:d._$AO)||void 0===n||n.call(d,!1),void 0===u?d=void 0:(d=new u(t),d._$AT(t,s,e)),void 0!==e?(null!==(l=(h=s)._$Cl)&&void 0!==l?l:h._$Cl=[])[e]=d:s._$Cu=d),void 0!==d&&(i=P(t,d._$AS(t,i.values),d,e)),i}class V{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:l).importNode(s,!0);A.currentNode=o;let n=A.nextNode(),h=0,r=0,d=e[0];for(;void 0!==d;){if(h===d.index){let i;2===d.type?i=new N(n,n.nextSibling,this,t):1===d.type?i=new d.ctor(n,d.name,d.strings,this,t):6===d.type&&(i=new I(n,this,t)),this.v.push(i),d=e[++r];}h!==(null==d?void 0:d.index)&&(n=A.nextNode(),h++);}return o}m(t){let i=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class N{constructor(t,i,s,e){var o;this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$C_=null===(o=null==e?void 0:e.isConnected)||void 0===o||o;}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$C_}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=P(this,t,i),r(t)?t===w||null==t||""===t?(this._$AH!==w&&this._$AR(),this._$AH=w):t!==this._$AH&&t!==b&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):u(t)?this.S(t):this.T(t);}j(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.j(t));}T(t){this._$AH!==w&&r(this._$AH)?this._$AA.nextSibling.data=t:this.k(l.createTextNode(t)),this._$AH=t;}$(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=C.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.m(s);else {const t=new V(o,this),i=t.p(this.options);t.m(s),this.k(i),this._$AH=t;}}_$AC(t){let i=x.get(t.strings);return void 0===i&&x.set(t.strings,i=new C(t)),i}S(t){d(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new N(this.j(h()),this.j(h()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){var i;void 0===this._$AM&&(this._$C_=t,null===(i=this._$AP)||void 0===i||i.call(this,t));}}class S{constructor(t,i,s,e,o){this.type=1,this._$AH=w,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=w;}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=P(this,t,i,0),n=!r(t)||t!==this._$AH&&t!==b,n&&(this._$AH=t);else {const e=t;let l,h;for(t=o[0],l=0;l<o.length-1;l++)h=P(this,e[s+l],i,l),h===b&&(h=this._$AH[l]),n||(n=!r(h)||h!==this._$AH[l]),h===w?t=w:t!==w&&(t+=(null!=h?h:"")+o[l+1]),this._$AH[l]=h;}n&&!e&&this.P(t);}P(t){t===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"");}}class M extends S{constructor(){super(...arguments),this.type=3;}P(t){this.element[this.name]=t===w?void 0:t;}}const R=i?i.emptyScript:"";class k extends S{constructor(){super(...arguments),this.type=4;}P(t){t&&t!==w?this.element.setAttribute(this.name,R):this.element.removeAttribute(this.name);}}class H extends S{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5;}_$AI(t,i=this){var s;if((t=null!==(s=P(this,t,i,0))&&void 0!==s?s:w)===b)return;const e=this._$AH,o=t===w&&e!==w||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==w&&(e===w||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t);}}class I{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){P(this,t);}}const z=window.litHtmlPolyfillSupport;null==z||z(C,N),(null!==(t=globalThis.litHtmlVersions)&&void 0!==t?t:globalThis.litHtmlVersions=[]).push("2.2.7");
|
|
7
|
+
|
|
8
|
+
export { $, T, b, w, y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b, w } from '../../common/lit-html-
|
|
1
|
+
import { b, w } from '../../common/lit-html-ab4365d1.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @license
|
|
@@ -11,12 +11,12 @@ const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e
|
|
|
11
11
|
* @license
|
|
12
12
|
* Copyright 2020 Google LLC
|
|
13
13
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
14
|
-
*/const
|
|
14
|
+
*/const e$1=o=>void 0===o.strings,f={},s=(o,l=f)=>o._$AH=l;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @license
|
|
18
18
|
* Copyright 2020 Google LLC
|
|
19
19
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
20
|
-
*/const l=e(class extends i{constructor(r
|
|
20
|
+
*/const l=e(class extends i{constructor(r){if(super(r),r.type!==t.PROPERTY&&r.type!==t.ATTRIBUTE&&r.type!==t.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!e$1(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(i,[t$1]){if(t$1===b||t$1===w)return t$1;const o=i.element,l=i.name;if(i.type===t.PROPERTY){if(t$1===o[l])return b}else if(i.type===t.BOOLEAN_ATTRIBUTE){if(!!t$1===o.hasAttribute(l))return b}else if(i.type===t.ATTRIBUTE&&o.getAttribute(l)===t$1+"")return b;return s(i),t$1}});
|
|
21
21
|
|
|
22
22
|
export { l as live };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { s as LitElement, r as css } from './common/lit-element-
|
|
2
|
-
export { $ as html, w as nothing, y as svg } from './common/lit-html-
|
|
1
|
+
export { s as LitElement, r as css } from './common/lit-element-2ebaea62.js';
|
|
2
|
+
export { $ as html, w as nothing, y as svg } from './common/lit-html-ab4365d1.js';
|
package/docs/demo/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<script type="module">
|
|
10
10
|
import '../dist/src/histogram-date-range.js';
|
|
11
11
|
let eventCount = 0;
|
|
12
|
-
import '../dist/demo/app-root.js';
|
|
12
|
+
import '../dist/demo/js/app-root.js';
|
|
13
13
|
// listen to events from the component and display the data received from them
|
|
14
14
|
document.addEventListener('histogramDateRangeUpdated', e => {
|
|
15
15
|
document.querySelector('.received-events').innerHTML =
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
<div class="container">
|
|
45
45
|
<div class="description">range spanning negative to positive years</div>
|
|
46
46
|
<histogram-date-range
|
|
47
|
-
|
|
47
|
+
minDate="-1050" maxDate="2200"
|
|
48
48
|
bins="[ 74, 67, 17, 66, 49, 93, 47, 61, 32, 46, 53, 2,
|
|
49
49
|
13, 45, 28, 1, 8, 70, 37, 74, 67, 17, 66, 49, 93,
|
|
50
50
|
47, 61, 70, 37, 74, 67, 17, 66, 49, 93, 47, 61, 32,
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
<histogram-date-range
|
|
61
61
|
width="175"
|
|
62
62
|
tooltipwidth="120"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
dateFormat="YYYY"
|
|
64
|
+
updateDelay="1000"
|
|
65
|
+
missingDataMessage="..."
|
|
66
|
+
minSelectedDate="1987"
|
|
67
|
+
maxSelectedDate="2016"
|
|
68
|
+
minDate="1987"
|
|
69
|
+
maxDate="2016"
|
|
70
70
|
bins="[1519,1643,1880,2046,1973,2085,2148,2152,2349,2304,2314,2484,2590,2450,2495,2475,2392,2631,2504,2619,2519,2552,2462,2217,2171,2132,2127,2041,1638,1441]"
|
|
71
71
|
>
|
|
72
72
|
</histogram-date-range>
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
<div class="container">
|
|
76
76
|
<div class="description">small year range and few bins</div>
|
|
77
77
|
<histogram-date-range width="175" tooltipwidth="120"
|
|
78
|
-
|
|
78
|
+
minDate="2008" maxDate="2016" bins="[76104,866978,1151617,986331,218672,107410,3324]">
|
|
79
79
|
</histogram-date-range>
|
|
80
80
|
</div>
|
|
81
81
|
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<div class="description">
|
|
147
147
|
single bin
|
|
148
148
|
</div>
|
|
149
|
-
<histogram-date-range
|
|
149
|
+
<histogram-date-range minDate="1926" maxDate="1926" bins="[8]">
|
|
150
150
|
</histogram-date-range>
|
|
151
151
|
</div>
|
|
152
152
|
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorate = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result)
|
|
9
|
+
__defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import {LitElement, html} from "../../../_snowpack/pkg/lit.js";
|
|
13
|
+
import {customElement, state} from "../../../_snowpack/pkg/lit/decorators.js";
|
|
14
|
+
import "../../src/histogram-date-range.js";
|
|
15
|
+
export let AppRoot = class extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.dataSource = {
|
|
19
|
+
minDate: 1955,
|
|
20
|
+
maxDate: 2e3,
|
|
21
|
+
minSelectedDate: 1955,
|
|
22
|
+
maxSelectedDate: 2e3,
|
|
23
|
+
bins: [
|
|
24
|
+
1,
|
|
25
|
+
2,
|
|
26
|
+
3,
|
|
27
|
+
4,
|
|
28
|
+
5,
|
|
29
|
+
6,
|
|
30
|
+
7,
|
|
31
|
+
8,
|
|
32
|
+
9,
|
|
33
|
+
10,
|
|
34
|
+
11,
|
|
35
|
+
12,
|
|
36
|
+
13,
|
|
37
|
+
14,
|
|
38
|
+
15,
|
|
39
|
+
16,
|
|
40
|
+
17,
|
|
41
|
+
18,
|
|
42
|
+
19,
|
|
43
|
+
20
|
|
44
|
+
]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
render() {
|
|
48
|
+
return html`
|
|
49
|
+
<histogram-date-range
|
|
50
|
+
.minDate=${this.dataSource?.minDate}
|
|
51
|
+
.maxDate=${this.dataSource?.maxDate}
|
|
52
|
+
.minSelectedDate=${this.dataSource?.minSelectedDate}
|
|
53
|
+
.maxSelectedDate=${this.dataSource?.maxSelectedDate}
|
|
54
|
+
.updateDelay=${1e3}
|
|
55
|
+
.bins=${this.dataSource?.bins}
|
|
56
|
+
></histogram-date-range>
|
|
57
|
+
|
|
58
|
+
<button @click=${this.randomize}>Randomize</button>
|
|
59
|
+
`;
|
|
60
|
+
}
|
|
61
|
+
randomize() {
|
|
62
|
+
const minDate = Math.round(Math.random() * 1e3);
|
|
63
|
+
const maxDate = minDate + Math.round(Math.random() * 1e3);
|
|
64
|
+
const bins = Array.from({length: 20}, () => Math.floor(Math.random() * minDate));
|
|
65
|
+
this.dataSource = {
|
|
66
|
+
minDate,
|
|
67
|
+
maxDate,
|
|
68
|
+
minSelectedDate: minDate,
|
|
69
|
+
maxSelectedDate: maxDate,
|
|
70
|
+
bins
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
__decorate([
|
|
75
|
+
state()
|
|
76
|
+
], AppRoot.prototype, "dataSource", 2);
|
|
77
|
+
AppRoot = __decorate([
|
|
78
|
+
customElement("app-root")
|
|
79
|
+
], AppRoot);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@internetarchive/histogram-date-range",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7-a1",
|
|
4
4
|
"description": "Internet Archive histogram date range picker",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@internetarchive/ia-activity-indicator": "^0.0.
|
|
23
|
+
"@internetarchive/ia-activity-indicator": "^0.0.3",
|
|
24
24
|
"dayjs": "^1.10.7",
|
|
25
|
-
"lit": "^2.
|
|
25
|
+
"lit": "^2.2.7"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@open-wc/eslint-config": "^7.0.0",
|
package/snowpack.config.js
CHANGED
package/demo/app-root.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, TemplateResult } from 'lit';
|
|
2
|
-
import { customElement } from 'lit/decorators.js';
|
|
3
|
-
import '../src/histogram-date-range';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* This is mainly to test the histogram-date-range within
|
|
7
|
-
* a lit-element.
|
|
8
|
-
*/
|
|
9
|
-
@customElement('app-root')
|
|
10
|
-
export class AppRoot extends LitElement {
|
|
11
|
-
render(): TemplateResult {
|
|
12
|
-
return html`
|
|
13
|
-
<histogram-date-range
|
|
14
|
-
.minDate=${1400}
|
|
15
|
-
.maxDate=${2021}
|
|
16
|
-
.updateDelay=${1000}
|
|
17
|
-
.bins=${[74, 67, 17, 66, 49, 93]}
|
|
18
|
-
></histogram-date-range>
|
|
19
|
-
`;
|
|
20
|
-
}
|
|
21
|
-
}
|
package/dist/demo/app-root.d.ts
DELETED
package/dist/demo/app-root.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { LitElement, html } from 'lit';
|
|
3
|
-
import { customElement } from 'lit/decorators.js';
|
|
4
|
-
import '../src/histogram-date-range';
|
|
5
|
-
/**
|
|
6
|
-
* This is mainly to test the histogram-date-range within
|
|
7
|
-
* a lit-element.
|
|
8
|
-
*/
|
|
9
|
-
let AppRoot = class AppRoot extends LitElement {
|
|
10
|
-
render() {
|
|
11
|
-
return html `
|
|
12
|
-
<histogram-date-range
|
|
13
|
-
.minDate=${1400}
|
|
14
|
-
.maxDate=${2021}
|
|
15
|
-
.updateDelay=${1000}
|
|
16
|
-
.bins=${[74, 67, 17, 66, 49, 93]}
|
|
17
|
-
></histogram-date-range>
|
|
18
|
-
`;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
AppRoot = __decorate([
|
|
22
|
-
customElement('app-root')
|
|
23
|
-
], AppRoot);
|
|
24
|
-
export { AppRoot };
|
|
25
|
-
//# sourceMappingURL=app-root.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-root.js","sourceRoot":"","sources":["../../demo/app-root.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,6BAA6B,CAAC;AAErC;;;GAGG;AAEH,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,UAAU;IACrC,MAAM;QACJ,OAAO,IAAI,CAAA;;mBAEI,IAAI;mBACJ,IAAI;uBACA,IAAI;gBACX,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;;KAEnC,CAAC;IACJ,CAAC;CACF,CAAA;AAXY,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAWnB;SAXY,OAAO","sourcesContent":["import { LitElement, html, TemplateResult } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport '../src/histogram-date-range';\n\n/**\n * This is mainly to test the histogram-date-range within\n * a lit-element.\n */\n@customElement('app-root')\nexport class AppRoot extends LitElement {\n render(): TemplateResult {\n return html`\n <histogram-date-range\n .minDate=${1400}\n .maxDate=${2021}\n .updateDelay=${1000}\n .bins=${[74, 67, 17, 66, 49, 93]}\n ></histogram-date-range>\n `;\n }\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { x, b } from './lit-html-1d707ff6.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright 2019 Google LLC
|
|
6
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
-
*/
|
|
8
|
-
const t=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e=Symbol(),n=new Map;class s{constructor(t,n){if(this._$cssResult$=!0,n!==e)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t;}get styleSheet(){let e=n.get(this.cssText);return t&&void 0===e&&(n.set(this.cssText,e=new CSSStyleSheet),e.replaceSync(this.cssText)),e}toString(){return this.cssText}}const o=t=>new s("string"==typeof t?t:t+"",e),r=(t,...n)=>{const o=1===t.length?t[0]:n.reduce(((e,n,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1]),t[0]);return new s(o,e)},i=(e,n)=>{t?e.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((t=>{const n=document.createElement("style"),s=window.litNonce;void 0!==s&&n.setAttribute("nonce",s),n.textContent=t.cssText,e.appendChild(n);}));},S=t?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return o(e)})(t):t;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @license
|
|
12
|
-
* Copyright 2017 Google LLC
|
|
13
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
14
|
-
*/var s$1;const e$1=window.trustedTypes,r$1=e$1?e$1.emptyScript:"",h=window.reactiveElementPolyfillSupport,o$1={toAttribute(t,i){switch(i){case Boolean:t=t?r$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,i){let s=t;switch(i){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t);}catch(t){s=null;}}return s}},n$1=(t,i)=>i!==t&&(i==i||t==t),l={attribute:!0,type:String,converter:o$1,reflect:!1,hasChanged:n$1};class a extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o();}static addInitializer(t){var i;null!==(i=this.l)&&void 0!==i||(this.l=[]),this.l.push(t);}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,s)=>{const e=this._$Eh(s,i);void 0!==e&&(this._$Eu.set(e,s),t.push(e));})),t}static createProperty(t,i=l){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,e=this.getPropertyDescriptor(t,s,i);void 0!==e&&Object.defineProperty(this.prototype,t,e);}}static getPropertyDescriptor(t,i,s){return {get(){return this[i]},set(e){const r=this[t];this[i]=e,this.requestUpdate(t,r,s);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||l}static finalize(){if(this.hasOwnProperty("finalized"))return !1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of i)this.createProperty(s,t[s]);}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(i){const s=[];if(Array.isArray(i)){const e=new Set(i.flat(1/0).reverse());for(const i of e)s.unshift(S(i));}else void 0!==i&&s.push(S(i));return s}static _$Eh(t,i){const s=i.attribute;return !1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)));}addController(t){var i,s;(null!==(i=this._$Eg)&&void 0!==i?i:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t));}removeController(t){var i;null===(i=this._$Eg)||void 0===i||i.splice(this._$Eg.indexOf(t)>>>0,1);}_$Em(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Et.set(i,this[i]),delete this[i]);}));}createRenderRoot(){var t;const s=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return i(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}));}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}));}attributeChangedCallback(t,i,s){this._$AK(t,s);}_$ES(t,i,s=l){var e,r;const h=this.constructor._$Eh(t,s);if(void 0!==h&&!0===s.reflect){const n=(null!==(r=null===(e=s.converter)||void 0===e?void 0:e.toAttribute)&&void 0!==r?r:o$1.toAttribute)(i,s.type);this._$Ei=t,null==n?this.removeAttribute(h):this.setAttribute(h,n),this._$Ei=null;}}_$AK(t,i){var s,e,r;const h=this.constructor,n=h._$Eu.get(t);if(void 0!==n&&this._$Ei!==n){const t=h.getPropertyOptions(n),l=t.converter,a=null!==(r=null!==(e=null===(s=l)||void 0===s?void 0:s.fromAttribute)&&void 0!==e?e:"function"==typeof l?l:null)&&void 0!==r?r:o$1.fromAttribute;this._$Ei=n,this[n]=a(i,t.type),this._$Ei=null;}}requestUpdate(t,i,s){let e=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||n$1)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===s.reflect&&this._$Ei!==t&&(void 0===this._$E_&&(this._$E_=new Map),this._$E_.set(t,s))):e=!1),!this.isUpdatePending&&e&&(this._$Ep=this._$EC());}async _$EC(){this.isUpdatePending=!0;try{await this._$Ep;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,i)=>this[i]=t)),this._$Et=void 0);let i=!1;const s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(s)):this._$EU();}catch(t){throw i=!1,this._$EU(),t}i&&this._$AE(s);}willUpdate(t){}_$AE(t){var i;null===(i=this._$Eg)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$EU(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return !0}update(t){void 0!==this._$E_&&(this._$E_.forEach(((t,i)=>this._$ES(i,this[i],t))),this._$E_=void 0),this._$EU();}updated(t){}firstUpdated(t){}}a.finalized=!0,a.elementProperties=new Map,a.elementStyles=[],a.shadowRootOptions={mode:"open"},null==h||h({ReactiveElement:a}),(null!==(s$1=globalThis.reactiveElementVersions)&&void 0!==s$1?s$1:globalThis.reactiveElementVersions=[]).push("1.1.2");
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @license
|
|
18
|
-
* Copyright 2017 Google LLC
|
|
19
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
20
|
-
*/var l$1,o$2;class s$2 extends a{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0;}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=x(i,this.renderRoot,this.renderOptions);}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0);}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1);}render(){return b}}s$2.finalized=!0,s$2._$litElement$=!0,null===(l$1=globalThis.litElementHydrateSupport)||void 0===l$1||l$1.call(globalThis,{LitElement:s$2});const n$2=globalThis.litElementPolyfillSupport;null==n$2||n$2({LitElement:s$2});(null!==(o$2=globalThis.litElementVersions)&&void 0!==o$2?o$2:globalThis.litElementVersions=[]).push("3.1.1");
|
|
21
|
-
|
|
22
|
-
export { r, s$2 as s };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/
|
|
6
|
-
var t;const i=globalThis.trustedTypes,s=i?i.createPolicy("lit-html",{createHTML:t=>t}):void 0,e=`lit$${(Math.random()+"").slice(9)}$`,o="?"+e,n=`<${o}>`,l=document,h=(t="")=>l.createComment(t),r=t=>null===t||"object"!=typeof t&&"function"!=typeof t,d=Array.isArray,u=t=>{var i;return d(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])},c=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,a=/>/g,f=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,_=/'/g,m=/"/g,g=/^(?:script|style|textarea)$/i,p=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),$=p(1),y=p(2),b=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),T=new WeakMap,x=(t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new N(i.insertBefore(h(),t),t,void 0,null!=s?s:{});}return l._$AI(t),l},A=l.createTreeWalker(l,129,null,!1),C=(t,i)=>{const o=t.length-1,l=[];let h,r=2===i?"<svg>":"",d=c;for(let i=0;i<o;i++){const s=t[i];let o,u,p=-1,$=0;for(;$<s.length&&(d.lastIndex=$,u=d.exec(s),null!==u);)$=d.lastIndex,d===c?"!--"===u[1]?d=v:void 0!==u[1]?d=a:void 0!==u[2]?(g.test(u[2])&&(h=RegExp("</"+u[2],"g")),d=f):void 0!==u[3]&&(d=f):d===f?">"===u[0]?(d=null!=h?h:c,p=-1):void 0===u[1]?p=-2:(p=d.lastIndex-u[2].length,o=u[1],d=void 0===u[3]?f:'"'===u[3]?m:_):d===m||d===_?d=f:d===v||d===a?d=c:(d=f,h=void 0);const y=d===f&&t[i+1].startsWith("/>")?" ":"";r+=d===c?s+n:p>=0?(l.push(o),s.slice(0,p)+"$lit$"+s.slice(p)+e+y):s+e+(-2===p?(l.push(void 0),i):y);}const u=r+(t[o]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return [void 0!==s?s.createHTML(u):u,l]};class E{constructor({strings:t,_$litType$:s},n){let l;this.parts=[];let r=0,d=0;const u=t.length-1,c=this.parts,[v,a]=C(t,s);if(this.el=E.createElement(v,n),A.currentNode=this.el.content,2===s){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes);}for(;null!==(l=A.nextNode())&&c.length<u;){if(1===l.nodeType){if(l.hasAttributes()){const t=[];for(const i of l.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(e)){const s=a[d++];if(t.push(i),void 0!==s){const t=l.getAttribute(s.toLowerCase()+"$lit$").split(e),i=/([.?@])?(.*)/.exec(s);c.push({type:1,index:r,name:i[2],strings:t,ctor:"."===i[1]?M:"?"===i[1]?H:"@"===i[1]?I:S});}else c.push({type:6,index:r});}for(const i of t)l.removeAttribute(i);}if(g.test(l.tagName)){const t=l.textContent.split(e),s=t.length-1;if(s>0){l.textContent=i?i.emptyScript:"";for(let i=0;i<s;i++)l.append(t[i],h()),A.nextNode(),c.push({type:2,index:++r});l.append(t[s],h());}}}else if(8===l.nodeType)if(l.data===o)c.push({type:2,index:r});else {let t=-1;for(;-1!==(t=l.data.indexOf(e,t+1));)c.push({type:7,index:r}),t+=e.length-1;}r++;}}static createElement(t,i){const s=l.createElement("template");return s.innerHTML=t,s}}function P(t,i,s=t,e){var o,n,l,h;if(i===b)return i;let d=void 0!==e?null===(o=s._$Cl)||void 0===o?void 0:o[e]:s._$Cu;const u=r(i)?void 0:i._$litDirective$;return (null==d?void 0:d.constructor)!==u&&(null===(n=null==d?void 0:d._$AO)||void 0===n||n.call(d,!1),void 0===u?d=void 0:(d=new u(t),d._$AT(t,s,e)),void 0!==e?(null!==(l=(h=s)._$Cl)&&void 0!==l?l:h._$Cl=[])[e]=d:s._$Cu=d),void 0!==d&&(i=P(t,d._$AS(t,i.values),d,e)),i}class V{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:l).importNode(s,!0);A.currentNode=o;let n=A.nextNode(),h=0,r=0,d=e[0];for(;void 0!==d;){if(h===d.index){let i;2===d.type?i=new N(n,n.nextSibling,this,t):1===d.type?i=new d.ctor(n,d.name,d.strings,this,t):6===d.type&&(i=new L(n,this,t)),this.v.push(i),d=e[++r];}h!==(null==d?void 0:d.index)&&(n=A.nextNode(),h++);}return o}m(t){let i=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class N{constructor(t,i,s,e){var o;this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cg=null===(o=null==e?void 0:e.isConnected)||void 0===o||o;}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=P(this,t,i),r(t)?t===w||null==t||""===t?(this._$AH!==w&&this._$AR(),this._$AH=w):t!==this._$AH&&t!==b&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):u(t)?this.A(t):this.$(t);}M(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t));}$(t){this._$AH!==w&&r(this._$AH)?this._$AA.nextSibling.data=t:this.S(l.createTextNode(t)),this._$AH=t;}T(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=E.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.m(s);else {const t=new V(o,this),i=t.p(this.options);t.m(s),this.S(i),this._$AH=t;}}_$AC(t){let i=T.get(t.strings);return void 0===i&&T.set(t.strings,i=new E(t)),i}A(t){d(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new N(this.M(h()),this.M(h()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t));}}class S{constructor(t,i,s,e,o){this.type=1,this._$AH=w,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=w;}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=P(this,t,i,0),n=!r(t)||t!==this._$AH&&t!==b,n&&(this._$AH=t);else {const e=t;let l,h;for(t=o[0],l=0;l<o.length-1;l++)h=P(this,e[s+l],i,l),h===b&&(h=this._$AH[l]),n||(n=!r(h)||h!==this._$AH[l]),h===w?t=w:t!==w&&(t+=(null!=h?h:"")+o[l+1]),this._$AH[l]=h;}n&&!e&&this.k(t);}k(t){t===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"");}}class M extends S{constructor(){super(...arguments),this.type=3;}k(t){this.element[this.name]=t===w?void 0:t;}}const k=i?i.emptyScript:"";class H extends S{constructor(){super(...arguments),this.type=4;}k(t){t&&t!==w?this.element.setAttribute(this.name,k):this.element.removeAttribute(this.name);}}class I extends S{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5;}_$AI(t,i=this){var s;if((t=null!==(s=P(this,t,i,0))&&void 0!==s?s:w)===b)return;const e=this._$AH,o=t===w&&e!==w||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==w&&(e===w||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t);}}class L{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){P(this,t);}}const z=window.litHtmlPolyfillSupport;null==z||z(E,N),(null!==(t=globalThis.litHtmlVersions)&&void 0!==t?t:globalThis.litHtmlVersions=[]).push("2.1.1");
|
|
7
|
-
|
|
8
|
-
export { $, b, w, x, y };
|
package/docs/demo/app-root.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __decorate = (decorators, target, key, kind) => {
|
|
4
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
-
if (decorator = decorators[i])
|
|
7
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
-
if (kind && result)
|
|
9
|
-
__defProp(target, key, result);
|
|
10
|
-
return result;
|
|
11
|
-
};
|
|
12
|
-
import {LitElement, html} from "../_snowpack/pkg/lit.js";
|
|
13
|
-
import {customElement} from "../_snowpack/pkg/lit/decorators.js";
|
|
14
|
-
import "../dist/src/histogram-date-range.js";
|
|
15
|
-
export let AppRoot = class extends LitElement {
|
|
16
|
-
render() {
|
|
17
|
-
return html`
|
|
18
|
-
<histogram-date-range
|
|
19
|
-
.minDate=${1400}
|
|
20
|
-
.maxDate=${2021}
|
|
21
|
-
.updateDelay=${1e3}
|
|
22
|
-
.bins=${[74, 67, 17, 66, 49, 93]}
|
|
23
|
-
></histogram-date-range>
|
|
24
|
-
`;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
AppRoot = __decorate([
|
|
28
|
-
customElement("app-root")
|
|
29
|
-
], AppRoot);
|