@nasa-terra/components 0.0.0 → 0.0.1
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/{dist/chunks/chunk.SZQ6DLHF.js → cdn/chunks/chunk.27YQ2AOA.js} +6 -6
- package/cdn/chunks/{chunk.BHXZEJO5.js → chunk.2B4YBQ5O.js} +1 -1
- package/cdn/chunks/chunk.2I657ASB.js +85 -0
- package/cdn/chunks/{chunk.R5TLD4JZ.js → chunk.2J6CFV4K.js} +1 -1
- package/{dist/chunks/chunk.SJ6OGWI6.js → cdn/chunks/chunk.2O76GCUZ.js} +1 -1
- package/cdn/chunks/chunk.2V4XFMTB.js +7 -0
- package/{dist/chunks/chunk.2RBWEAYS.js → cdn/chunks/chunk.36AVAQOO.js} +4 -4
- package/cdn/chunks/chunk.3ZGFXEAJ.js +273 -0
- package/cdn/chunks/{chunk.D6XFZNUK.js → chunk.4YOL6PQR.js} +4 -4
- package/{dist/chunks/chunk.6ZHGOB2G.js → cdn/chunks/chunk.77L4US7V.js} +1 -1
- package/cdn/chunks/chunk.7DEY3B3N.js +11 -0
- package/cdn/chunks/chunk.7VUSSQRI.js +20 -0
- package/cdn/chunks/chunk.AAWOHDFX.js +259 -0
- package/cdn/chunks/{chunk.34DQXAAA.js → chunk.AEIZVWLR.js} +1 -1
- package/cdn/chunks/{chunk.CI6OSO6M.js → chunk.BB7N2ZYB.js} +1 -1
- package/cdn/chunks/{chunk.Y4CNYLFC.js → chunk.BINGLTII.js} +1 -1
- package/cdn/chunks/chunk.BLNUBLUS.js +289 -0
- package/cdn/chunks/{chunk.AOKHUEZK.js → chunk.D33ZL7ZQ.js} +1 -1
- package/{dist/chunks/chunk.VIV3TUJX.js → cdn/chunks/chunk.DL3FIOYA.js} +1 -1
- package/cdn/chunks/{chunk.E3743HRF.js → chunk.DQGFAA4K.js} +4 -4
- package/cdn/chunks/{chunk.TA3MUOR6.js → chunk.EFAXKQZX.js} +1 -1
- package/cdn/chunks/chunk.FGILL5W6.js +118 -0
- package/cdn/chunks/chunk.FXIUS5TR.js +21 -0
- package/cdn/chunks/{chunk.P2U3GEIK.js → chunk.FZT3BVW7.js} +1 -1
- package/{dist/chunks/chunk.TCOEMJRS.js → cdn/chunks/chunk.GCKJPPGU.js} +1 -1
- package/cdn/chunks/chunk.I2NEFB34.js +99 -0
- package/cdn/chunks/{chunk.RVZES2AU.js → chunk.I32QCWMN.js} +1 -1
- package/cdn/chunks/chunk.IBEKZVOY.js +80 -0
- package/cdn/chunks/{chunk.42A7HENY.js → chunk.IO4MLLEG.js} +1 -1
- package/cdn/chunks/{chunk.P4XRFEY4.js → chunk.IP3XWLQI.js} +1 -1
- package/{dist/chunks/chunk.R4J62P4T.js → cdn/chunks/chunk.IQITDFID.js} +1 -1
- package/cdn/chunks/chunk.ITX3RB2M.js +11 -0
- package/cdn/chunks/{chunk.OEWCLC7K.js → chunk.J576Q62R.js} +1 -1
- package/cdn/chunks/{chunk.4TENYCNW.js → chunk.JCZW2OWI.js} +1 -1
- package/cdn/chunks/chunk.JFU3ZCDL.js +359 -0
- package/{dist/chunks/chunk.36PTCDA5.js → cdn/chunks/chunk.JOVDYQHE.js} +1 -1
- package/cdn/chunks/{chunk.6RAHIA27.js → chunk.JV6B7CXO.js} +2 -1
- package/cdn/chunks/{chunk.5X6SO6J5.js → chunk.KH54YRZ3.js} +1 -1
- package/cdn/chunks/{chunk.7FISIUEV.js → chunk.KVY2Y3KE.js} +1 -1
- package/cdn/chunks/{chunk.ZMCLEFDE.js → chunk.KXLY6BVH.js} +4 -4
- package/cdn/chunks/chunk.LELNKRPW.js +685 -0
- package/cdn/chunks/{chunk.53SMSSCB.js → chunk.M25XJ2VR.js} +6 -6
- package/cdn/chunks/{chunk.X7ARZIFO.js → chunk.MDM7S6E6.js} +1 -1
- package/cdn/chunks/{chunk.253Y3NFH.js → chunk.MIAPAPCI.js} +1 -1
- package/{dist/chunks/chunk.XJ3P4AO2.js → cdn/chunks/chunk.MKXJDRVT.js} +1 -1
- package/{dist/chunks/chunk.LE36I4N2.js → cdn/chunks/chunk.MOJMTJF6.js} +1 -1
- package/{dist/chunks/chunk.NZYKW5Y7.js → cdn/chunks/chunk.MQ5JNQCQ.js} +1 -1
- package/cdn/chunks/chunk.MWHQHPUM.js +54 -0
- package/{dist/chunks/chunk.WJPV6KQS.js → cdn/chunks/chunk.MXAZ646L.js} +1 -1
- package/cdn/chunks/chunk.N2DS7NLI.js +102 -0
- package/{dist/chunks/chunk.A2U7NITY.js → cdn/chunks/chunk.NU4LRV7F.js} +1 -1
- package/cdn/chunks/chunk.NYBJ252W.js +318 -0
- package/cdn/chunks/chunk.OIDMX5LU.js +10 -0
- package/cdn/chunks/{chunk.M366DOLL.js → chunk.OLCGKQR3.js} +1 -1
- package/{dist/chunks/chunk.WBXETWE4.js → cdn/chunks/chunk.OOUCODFZ.js} +2 -1
- package/cdn/chunks/chunk.OQE2USZJ.js +41 -0
- package/cdn/chunks/chunk.OU4UPMYR.js +330 -0
- package/cdn/chunks/{chunk.6PIZJ2ZO.js → chunk.P7W2ODWK.js} +1 -1
- package/cdn/chunks/chunk.PJXIJK2G.js +102 -0
- package/cdn/chunks/{chunk.AURPVGI4.js → chunk.QQ33BJLG.js} +1 -1
- package/cdn/chunks/{chunk.NUMFOBCB.js → chunk.R3AE5AQ5.js} +4 -4
- package/cdn/chunks/{chunk.T3YOGGMB.js → chunk.RBKBAQOH.js} +5 -5
- package/cdn/chunks/{chunk.JSEQXKIQ.js → chunk.RDOXOIYG.js} +1 -1
- package/{dist/chunks/chunk.YNY2FQKA.js → cdn/chunks/chunk.RVJP24KU.js} +1 -1
- package/cdn/chunks/chunk.RYPAZDXE.js +61 -0
- package/cdn/chunks/chunk.SHS42OAD.js +620 -0
- package/cdn/chunks/{chunk.4CAXR33B.js → chunk.SJADWOCY.js} +1 -1
- package/cdn/chunks/{chunk.AY5ZYXPF.js → chunk.SMRM4VEQ.js} +1 -1
- package/{dist/chunks/chunk.DNBHAHKW.js → cdn/chunks/chunk.SQMSSGQI.js} +1 -1
- package/cdn/chunks/chunk.T322FDKI.js +300 -0
- package/cdn/chunks/{chunk.RRCPVEE3.js → chunk.TV2NZLRC.js} +4 -4
- package/cdn/chunks/{chunk.6JYG4IP3.js → chunk.UE4FYVUH.js} +1 -1
- package/cdn/chunks/{chunk.EPEFC6PC.js → chunk.UJBBUYTN.js} +1 -1
- package/cdn/chunks/{chunk.BSSVF7JN.js → chunk.UQVPFKN3.js} +7 -7
- package/cdn/chunks/chunk.UU46CLE7.js +120 -0
- package/cdn/chunks/{chunk.OFCNXAUR.js → chunk.VEUDIPUW.js} +1 -1
- package/cdn/chunks/chunk.WGFD2LHA.js +83 -0
- package/cdn/chunks/chunk.WNRL2JWN.js +21 -0
- package/{dist/chunks/chunk.J6NGZHLF.js → cdn/chunks/chunk.Y3WAKQQ3.js} +1 -1
- package/cdn/chunks/chunk.YOR2OZZR.js +11 -0
- package/{dist/chunks/chunk.YHSKQAEB.js → cdn/chunks/chunk.ZAHTEXVC.js} +1 -1
- package/cdn/chunks/chunk.ZCNMYQP2.js +113 -0
- package/cdn/chunks/chunk.ZGJAUXFV.js +39 -0
- package/cdn/chunks/chunk.ZK7QVWBI.js +37 -0
- package/{dist/chunks/chunk.BEIVIE7M.js → cdn/chunks/chunk.ZPPR6CPT.js} +1 -1
- package/cdn/chunks/chunk.ZQ5WJYY5.js +21 -0
- package/{dist/chunks/chunk.OZ37OLF4.js → cdn/chunks/chunk.ZVKNJQPF.js} +1 -1
- package/cdn/components/button/button.component.js +3 -3
- package/cdn/components/button/button.js +4 -4
- package/cdn/components/chip/chip.component.js +3 -3
- package/cdn/components/chip/chip.js +4 -4
- package/cdn/components/combobox/combobox.component.js +4 -4
- package/cdn/components/combobox/combobox.js +5 -5
- package/cdn/components/date-range-slider/date-range-slider.component.js +2 -2
- package/cdn/components/date-range-slider/date-range-slider.js +3 -3
- package/cdn/components/icon/icon.component.js +4 -4
- package/cdn/components/icon/icon.js +5 -5
- package/cdn/components/loader/loader.component.js +2 -2
- package/cdn/components/loader/loader.js +3 -3
- package/cdn/components/map/map.component.js +4 -4
- package/cdn/components/map/map.js +5 -5
- package/cdn/components/plot/plot.component.js +2 -2
- package/cdn/components/plot/plot.js +3 -3
- package/cdn/components/spatial-picker/spatial-picker.component.js +6 -6
- package/cdn/components/spatial-picker/spatial-picker.js +7 -7
- package/cdn/components/time-series/time-series.component.js +26 -26
- package/cdn/components/time-series/time-series.controller.js +1 -1
- package/cdn/components/time-series/time-series.js +27 -27
- package/cdn/components/variable-combobox/variable-combobox.component.js +12 -12
- package/cdn/components/variable-combobox/variable-combobox.js +13 -13
- package/cdn/custom-elements.json +973 -973
- package/cdn/react/button/index.js +4 -4
- package/cdn/react/chip/index.js +4 -4
- package/cdn/react/combobox/index.js +5 -5
- package/cdn/react/date-range-slider/index.js +3 -3
- package/cdn/react/icon/index.js +5 -5
- package/cdn/react/index.d.ts +3 -3
- package/cdn/react/index.js +50 -50
- package/cdn/react/loader/index.js +3 -3
- package/cdn/react/map/index.js +5 -5
- package/cdn/react/plot/index.js +3 -3
- package/cdn/react/spatial-picker/index.js +7 -7
- package/cdn/react/time-series/index.js +27 -27
- package/cdn/react/variable-combobox/index.js +13 -13
- package/cdn/terra-ui-components.js +54 -54
- package/cdn/types/vue/index.d.ts +98 -98
- package/cdn/utilities/animation.js +3 -3
- package/cdn/vscode.html-custom-data.json +111 -111
- package/cdn/web-types.json +205 -205
- package/dist/chunks/chunk.27YQ2AOA.js +251 -0
- package/dist/chunks/chunk.2O76GCUZ.js +21 -0
- package/dist/chunks/chunk.2WZAYHEX.js +214 -0
- package/dist/chunks/chunk.356SSUTI.js +11 -0
- package/dist/chunks/chunk.36AVAQOO.js +404 -0
- package/dist/chunks/chunk.3D66L46K.js +11 -0
- package/dist/chunks/chunk.3LUNFNDR.js +118 -0
- package/dist/chunks/chunk.4MN2BLJS.js +21 -0
- package/dist/chunks/chunk.5B33QFBB.js +83 -0
- package/dist/chunks/chunk.65A3A43G.js +21 -0
- package/dist/chunks/chunk.BB7N2ZYB.js +21 -0
- package/dist/chunks/chunk.D6FJH7WA.js +21 -0
- package/dist/chunks/chunk.DDPOISEU.js +179 -0
- package/dist/chunks/chunk.EBBV6NVD.js +11 -0
- package/dist/chunks/chunk.EMISRECR.js +214 -0
- package/dist/chunks/chunk.FZT3BVW7.js +21 -0
- package/dist/chunks/chunk.GHCQCYO6.js +179 -0
- package/dist/chunks/chunk.HO5CZIK5.js +11 -0
- package/dist/chunks/chunk.IEU4MULT.js +25 -0
- package/dist/chunks/chunk.IO4MLLEG.js +21 -0
- package/dist/chunks/chunk.IP3XWLQI.js +11 -0
- package/dist/chunks/chunk.J4B6HPXD.js +11 -0
- package/dist/chunks/chunk.J576Q62R.js +11 -0
- package/dist/chunks/chunk.JCZW2OWI.js +11 -0
- package/dist/chunks/chunk.K2HRGRYE.js +11 -0
- package/dist/chunks/chunk.KXNDHJXA.js +404 -0
- package/dist/chunks/chunk.MIAPAPCI.js +21 -0
- package/dist/chunks/chunk.MOJMTJF6.js +24 -0
- package/dist/chunks/chunk.MXAZ646L.js +11 -0
- package/dist/chunks/chunk.NNLAIN52.js +11 -0
- package/dist/chunks/chunk.NO35M7LF.js +21 -0
- package/dist/chunks/chunk.NOEGCTIS.js +194 -0
- package/dist/chunks/chunk.NU4LRV7F.js +21 -0
- package/dist/chunks/chunk.NZIGCRLS.js +11 -0
- package/dist/chunks/chunk.OIGE7CMM.js +11 -0
- package/dist/chunks/chunk.OOUCODFZ.js +179 -0
- package/dist/chunks/chunk.ORZO3BCW.js +102 -0
- package/dist/chunks/chunk.P25SJ6YA.js +478 -0
- package/dist/chunks/chunk.P4QMMCAR.js +24 -0
- package/dist/chunks/chunk.PGNCNTOA.js +21 -0
- package/dist/chunks/chunk.Q7F3GGVA.js +251 -0
- package/dist/chunks/chunk.QSCELHEQ.js +325 -0
- package/dist/chunks/chunk.RDOXOIYG.js +11 -0
- package/dist/chunks/chunk.SBTZE5QZ.js +21 -0
- package/dist/chunks/chunk.SCU5LFS3.js +325 -0
- package/dist/chunks/chunk.SJADWOCY.js +11 -0
- package/dist/chunks/chunk.SMRM4VEQ.js +11 -0
- package/dist/chunks/chunk.T7MOUOBT.js +11 -0
- package/dist/chunks/chunk.UE4FYVUH.js +25 -0
- package/dist/chunks/chunk.UJBBUYTN.js +11 -0
- package/dist/chunks/chunk.WL747XGE.js +194 -0
- package/dist/chunks/chunk.XKDGF53W.js +21 -0
- package/dist/chunks/chunk.XLYZ6HY4.js +179 -0
- package/dist/chunks/chunk.XXV47QL2.js +21 -0
- package/dist/chunks/chunk.Y3WAKQQ3.js +179 -0
- package/dist/chunks/chunk.Y5CHSR6B.js +21 -0
- package/dist/chunks/chunk.YDJ7Z7YW.js +478 -0
- package/dist/chunks/chunk.YDMA4OA3.js +11 -0
- package/dist/chunks/chunk.Z2WXDYZC.js +85 -0
- package/dist/components/button/button.component.js +3 -3
- package/dist/components/button/button.js +4 -4
- package/dist/components/chip/chip.component.js +2 -2
- package/dist/components/chip/chip.js +3 -3
- package/dist/components/combobox/combobox.component.js +4 -4
- package/dist/components/combobox/combobox.js +5 -5
- package/dist/components/date-range-slider/date-range-slider.component.js +2 -2
- package/dist/components/date-range-slider/date-range-slider.js +3 -3
- package/dist/components/icon/icon.component.js +3 -3
- package/dist/components/icon/icon.js +4 -4
- package/dist/components/loader/loader.component.js +2 -2
- package/dist/components/loader/loader.js +3 -3
- package/dist/components/map/map.component.js +4 -4
- package/dist/components/map/map.js +5 -5
- package/dist/components/plot/plot.component.js +2 -2
- package/dist/components/plot/plot.js +3 -3
- package/dist/components/spatial-picker/spatial-picker.component.js +6 -6
- package/dist/components/spatial-picker/spatial-picker.js +7 -7
- package/dist/components/time-series/time-series.component.js +22 -22
- package/dist/components/time-series/time-series.controller.js +1 -1
- package/dist/components/time-series/time-series.js +23 -23
- package/dist/components/variable-combobox/variable-combobox.component.js +9 -9
- package/dist/components/variable-combobox/variable-combobox.js +10 -10
- package/dist/custom-elements.json +973 -973
- package/dist/react/button/index.js +4 -4
- package/dist/react/chip/index.js +3 -3
- package/dist/react/combobox/index.js +5 -5
- package/dist/react/date-range-slider/index.js +3 -3
- package/dist/react/icon/index.js +4 -4
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +47 -47
- package/dist/react/loader/index.js +3 -3
- package/dist/react/map/index.js +5 -5
- package/dist/react/plot/index.js +3 -3
- package/dist/react/spatial-picker/index.js +7 -7
- package/dist/react/time-series/index.js +23 -23
- package/dist/react/variable-combobox/index.js +10 -10
- package/dist/terra-ui-components.js +46 -46
- package/dist/types/vue/index.d.ts +98 -98
- package/dist/vscode.html-custom-data.json +111 -111
- package/dist/web-types.json +205 -205
- package/package.json +1 -1
- package/{dist/chunks/chunk.HKHDBTIC.js → cdn/chunks/chunk.EMISRECR.js} +3 -3
- package/{dist/chunks/chunk.KRXFJQUH.js → cdn/chunks/chunk.GHCQCYO6.js} +3 -3
- package/{dist/chunks/chunk.I7ZPL3IO.js → cdn/chunks/chunk.P25SJ6YA.js} +3 -3
- package/{dist/chunks/chunk.OSC7AN4C.js → cdn/chunks/chunk.SCU5LFS3.js} +3 -3
- package/{dist/chunks/chunk.V3YTQSMP.js → cdn/chunks/chunk.WL747XGE.js} +3 -3
- package/cdn/chunks/{chunk.LQCRC4E2.js → chunk.XR56EMXH.js} +8 -8
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isValidDate
|
|
3
|
+
} from "./chunk.OIDMX5LU.js";
|
|
4
|
+
import {
|
|
5
|
+
date_range_slider_styles_default
|
|
6
|
+
} from "./chunk.OU4UPMYR.js";
|
|
7
|
+
import {
|
|
8
|
+
mergeTooltips
|
|
9
|
+
} from "./chunk.KW4TJM4C.js";
|
|
10
|
+
import {
|
|
11
|
+
watch
|
|
12
|
+
} from "./chunk.ZK7QVWBI.js";
|
|
13
|
+
import {
|
|
14
|
+
TerraElement,
|
|
15
|
+
component_styles_default
|
|
16
|
+
} from "./chunk.ORZO3BCW.js";
|
|
17
|
+
import {
|
|
18
|
+
__decorateClass
|
|
19
|
+
} from "./chunk.RYPAZDXE.js";
|
|
20
|
+
|
|
21
|
+
// src/components/date-range-slider/date-range-slider.component.ts
|
|
22
|
+
import { property, query } from "lit/decorators.js";
|
|
23
|
+
import { html } from "lit";
|
|
24
|
+
import noUiSlider, {
|
|
25
|
+
PipsMode
|
|
26
|
+
} from "nouislider";
|
|
27
|
+
import { format } from "date-fns";
|
|
28
|
+
var TerraDateRangeSlider = class extends TerraElement {
|
|
29
|
+
constructor() {
|
|
30
|
+
super(...arguments);
|
|
31
|
+
this.timeScale = "daily";
|
|
32
|
+
this.disabled = false;
|
|
33
|
+
this.hasPips = true;
|
|
34
|
+
}
|
|
35
|
+
updateSlider() {
|
|
36
|
+
this.renderSlider();
|
|
37
|
+
}
|
|
38
|
+
disabledChanged() {
|
|
39
|
+
var _a, _b, _c, _d;
|
|
40
|
+
this.disabled ? (_b = (_a = this.slider) == null ? void 0 : _a.noUiSlider) == null ? void 0 : _b.disable() : (_d = (_c = this.slider) == null ? void 0 : _c.noUiSlider) == null ? void 0 : _d.enable();
|
|
41
|
+
}
|
|
42
|
+
firstUpdated() {
|
|
43
|
+
this.renderSlider();
|
|
44
|
+
}
|
|
45
|
+
renderSlider() {
|
|
46
|
+
var _a;
|
|
47
|
+
if (!this.slider) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
(_a = this.slider.noUiSlider) == null ? void 0 : _a.destroy();
|
|
51
|
+
if (!isValidDate(this.minDate) || !isValidDate(this.maxDate)) {
|
|
52
|
+
this.renderEmptySlider();
|
|
53
|
+
this.minDate && !isValidDate(this.minDate) && console.error("Invalid min date provided");
|
|
54
|
+
this.maxDate && !isValidDate(this.maxDate) && console.error("Invalid max date provided");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const minDate = new Date(this.minDate);
|
|
58
|
+
const maxDate = new Date(this.maxDate);
|
|
59
|
+
const startDate = new Date(
|
|
60
|
+
isValidDate(this.startDate) ? this.startDate : this.minDate
|
|
61
|
+
);
|
|
62
|
+
const endDate = new Date(
|
|
63
|
+
isValidDate(this.endDate) ? this.endDate : this.maxDate
|
|
64
|
+
);
|
|
65
|
+
minDate.setUTCHours(0, 0, 0, 0);
|
|
66
|
+
startDate.setUTCHours(0, 0, 0, 0);
|
|
67
|
+
maxDate.setUTCHours(23, 59, 59, 999);
|
|
68
|
+
endDate.setUTCHours(23, 59, 59, 999);
|
|
69
|
+
const sliderOptions = {
|
|
70
|
+
range: {
|
|
71
|
+
// convert to milliseconds to define a range
|
|
72
|
+
min: minDate.getTime(),
|
|
73
|
+
max: maxDate.getTime()
|
|
74
|
+
},
|
|
75
|
+
step: this._getStep(),
|
|
76
|
+
start: [startDate.getTime(), endDate.getTime()],
|
|
77
|
+
// defaults to either the given start/end dates or the full date range (min/max date)
|
|
78
|
+
tooltips: [true, true],
|
|
79
|
+
// for each handle, choose whether to show a tooltip
|
|
80
|
+
connect: true,
|
|
81
|
+
// whether to connect the handles with a colorized bar
|
|
82
|
+
pips: {
|
|
83
|
+
mode: PipsMode.Range,
|
|
84
|
+
density: -1,
|
|
85
|
+
format: this._getSliderFormatter()
|
|
86
|
+
},
|
|
87
|
+
format: this._getSliderFormatter()
|
|
88
|
+
};
|
|
89
|
+
noUiSlider.create(this.slider, sliderOptions);
|
|
90
|
+
mergeTooltips(this.slider);
|
|
91
|
+
this.slider.noUiSlider.on("change", (values) => {
|
|
92
|
+
this.emit("terra-date-range-change", {
|
|
93
|
+
detail: {
|
|
94
|
+
startDate: this._formatDate(values[0]),
|
|
95
|
+
endDate: this._formatDate(values[1])
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
renderEmptySlider() {
|
|
101
|
+
noUiSlider.create(this.slider, {
|
|
102
|
+
start: [0, 0],
|
|
103
|
+
range: {
|
|
104
|
+
min: 0,
|
|
105
|
+
max: 0
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
_getStep() {
|
|
110
|
+
const oneMinuteMillis = 60 * 1e3;
|
|
111
|
+
const oneHourMillis = 60 * oneMinuteMillis;
|
|
112
|
+
const oneDayMillis = 24 * oneHourMillis;
|
|
113
|
+
switch (this.timeScale) {
|
|
114
|
+
case "half-hourly":
|
|
115
|
+
return 30 * oneMinuteMillis;
|
|
116
|
+
case "hourly":
|
|
117
|
+
return oneHourMillis;
|
|
118
|
+
default:
|
|
119
|
+
return oneDayMillis;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
_getSliderFormatter() {
|
|
123
|
+
return {
|
|
124
|
+
to: (value) => {
|
|
125
|
+
return this._formatDate(value);
|
|
126
|
+
},
|
|
127
|
+
from: (value) => {
|
|
128
|
+
return Number(value);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
_formatDate(date) {
|
|
133
|
+
const dateFormat = this.timeScale === "daily" ? "yyyy-MM-dd" : "yyyy-MM-dd HH:mm";
|
|
134
|
+
return format(new Date(date).toUTCString(), dateFormat);
|
|
135
|
+
}
|
|
136
|
+
render() {
|
|
137
|
+
const containerClass = "container" + this.hasPips ? " hasPips" : "";
|
|
138
|
+
return html`
|
|
139
|
+
<div class="${containerClass}">
|
|
140
|
+
<div part="slider"></div>
|
|
141
|
+
</div>
|
|
142
|
+
`;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
TerraDateRangeSlider.styles = [component_styles_default, date_range_slider_styles_default];
|
|
146
|
+
__decorateClass([
|
|
147
|
+
query('[part~="slider"]')
|
|
148
|
+
], TerraDateRangeSlider.prototype, "slider", 2);
|
|
149
|
+
__decorateClass([
|
|
150
|
+
property({ attribute: "time-scale" })
|
|
151
|
+
], TerraDateRangeSlider.prototype, "timeScale", 2);
|
|
152
|
+
__decorateClass([
|
|
153
|
+
property({ attribute: "min-date" })
|
|
154
|
+
], TerraDateRangeSlider.prototype, "minDate", 2);
|
|
155
|
+
__decorateClass([
|
|
156
|
+
property({ attribute: "max-date" })
|
|
157
|
+
], TerraDateRangeSlider.prototype, "maxDate", 2);
|
|
158
|
+
__decorateClass([
|
|
159
|
+
property({ attribute: "start-date" })
|
|
160
|
+
], TerraDateRangeSlider.prototype, "startDate", 2);
|
|
161
|
+
__decorateClass([
|
|
162
|
+
property({ attribute: "end-date" })
|
|
163
|
+
], TerraDateRangeSlider.prototype, "endDate", 2);
|
|
164
|
+
__decorateClass([
|
|
165
|
+
property({ type: Boolean, reflect: true })
|
|
166
|
+
], TerraDateRangeSlider.prototype, "disabled", 2);
|
|
167
|
+
__decorateClass([
|
|
168
|
+
property({ type: Boolean, reflect: true, attribute: "has-pips" })
|
|
169
|
+
], TerraDateRangeSlider.prototype, "hasPips", 2);
|
|
170
|
+
__decorateClass([
|
|
171
|
+
watch(["startDate", "endDate", "minDate", "maxDate"])
|
|
172
|
+
], TerraDateRangeSlider.prototype, "updateSlider", 1);
|
|
173
|
+
__decorateClass([
|
|
174
|
+
watch("disabled")
|
|
175
|
+
], TerraDateRangeSlider.prototype, "disabledChanged", 1);
|
|
176
|
+
|
|
177
|
+
export {
|
|
178
|
+
TerraDateRangeSlider
|
|
179
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TerraCombobox
|
|
3
|
+
} from "./chunk.YDJ7Z7YW.js";
|
|
4
|
+
|
|
5
|
+
// src/react/combobox/index.ts
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { createComponent } from "@lit/react";
|
|
8
|
+
var tagName = "terra-combobox";
|
|
9
|
+
TerraCombobox.define("terra-combobox");
|
|
10
|
+
var reactWrapper = createComponent({
|
|
11
|
+
tagName,
|
|
12
|
+
elementClass: TerraCombobox,
|
|
13
|
+
react: React,
|
|
14
|
+
events: {},
|
|
15
|
+
displayName: "TerraCombobox"
|
|
16
|
+
});
|
|
17
|
+
var combobox_default = reactWrapper;
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
combobox_default
|
|
21
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import {
|
|
2
|
+
spatial_picker_styles_default
|
|
3
|
+
} from "./chunk.ZCNMYQP2.js";
|
|
4
|
+
import {
|
|
5
|
+
TerraMap
|
|
6
|
+
} from "./chunk.WL747XGE.js";
|
|
7
|
+
import {
|
|
8
|
+
StringifyBoundingBox,
|
|
9
|
+
parseBoundingBox
|
|
10
|
+
} from "./chunk.3ZGFXEAJ.js";
|
|
11
|
+
import {
|
|
12
|
+
TerraElement,
|
|
13
|
+
component_styles_default
|
|
14
|
+
} from "./chunk.PJXIJK2G.js";
|
|
15
|
+
import {
|
|
16
|
+
__decorateClass
|
|
17
|
+
} from "./chunk.RYPAZDXE.js";
|
|
18
|
+
|
|
19
|
+
// src/components/spatial-picker/spatial-picker.component.ts
|
|
20
|
+
import { html, nothing } from "lit";
|
|
21
|
+
import { property, query, state } from "lit/decorators.js";
|
|
22
|
+
var TerraSpatialPicker = class extends TerraElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.minZoom = 0;
|
|
26
|
+
this.maxZoom = 23;
|
|
27
|
+
this.zoom = 1;
|
|
28
|
+
this.hasNavigation = true;
|
|
29
|
+
this.hasCoordTracker = true;
|
|
30
|
+
this.hasShapeSelector = false;
|
|
31
|
+
this.initialValue = "";
|
|
32
|
+
this.hideLabel = false;
|
|
33
|
+
this.label = "Select Region";
|
|
34
|
+
this.isExpanded = false;
|
|
35
|
+
}
|
|
36
|
+
_blur(e) {
|
|
37
|
+
const inputValue = e.target.value;
|
|
38
|
+
this.mapValue = inputValue === "" ? [] : parseBoundingBox(inputValue);
|
|
39
|
+
}
|
|
40
|
+
_click() {
|
|
41
|
+
this.isExpanded = !this.isExpanded;
|
|
42
|
+
}
|
|
43
|
+
open() {
|
|
44
|
+
this.isExpanded = true;
|
|
45
|
+
}
|
|
46
|
+
close() {
|
|
47
|
+
this.isExpanded = false;
|
|
48
|
+
}
|
|
49
|
+
_handleMapChange(event) {
|
|
50
|
+
switch (event.detail.cause) {
|
|
51
|
+
case "clear":
|
|
52
|
+
this.spatialInput.value = "";
|
|
53
|
+
break;
|
|
54
|
+
case "draw":
|
|
55
|
+
if (event.detail.bounds) {
|
|
56
|
+
this.spatialInput.value = StringifyBoundingBox(
|
|
57
|
+
event.detail.bounds
|
|
58
|
+
);
|
|
59
|
+
} else if (event.detail.latLng) {
|
|
60
|
+
this.spatialInput.value = StringifyBoundingBox(
|
|
61
|
+
event.detail.latLng
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
break;
|
|
65
|
+
default:
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
firstUpdated() {
|
|
70
|
+
if (this.initialValue) {
|
|
71
|
+
this.mapValue = this.initialValue === "" ? [] : parseBoundingBox(this.initialValue);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
renderMap() {
|
|
75
|
+
return html`<terra-map
|
|
76
|
+
exportparts="map, leaflet-bbox, leaflet-point, leaflet-edit, leaflet-remove"
|
|
77
|
+
min-zoom=${this.minZoom}
|
|
78
|
+
max-zoom=${this.maxZoom}
|
|
79
|
+
zoom=${this.zoom}
|
|
80
|
+
?has-coord-tracker=${this.hasCoordTracker}
|
|
81
|
+
.value=${this.mapValue}
|
|
82
|
+
?has-navigation=${this.hasNavigation}
|
|
83
|
+
?has-shape-selector=${this.hasShapeSelector}
|
|
84
|
+
@terra-map-change=${this._handleMapChange}
|
|
85
|
+
>
|
|
86
|
+
</terra-map>`;
|
|
87
|
+
}
|
|
88
|
+
render() {
|
|
89
|
+
return html`
|
|
90
|
+
<div class="spatial-picker">
|
|
91
|
+
<label
|
|
92
|
+
for="spatial-picker__input"
|
|
93
|
+
class=${this.hideLabel ? "sr-only" : "spatial-picker__input_label"}
|
|
94
|
+
>${this.label}</label
|
|
95
|
+
>
|
|
96
|
+
<div class="spatial-picker__input_fields">
|
|
97
|
+
<input
|
|
98
|
+
id="spatial-picker__input"
|
|
99
|
+
value=${this.initialValue}
|
|
100
|
+
type="text"
|
|
101
|
+
class="spatial-picker__input form-control"
|
|
102
|
+
placeholder="-180, -90, 180, 90"
|
|
103
|
+
aria-controls="map"
|
|
104
|
+
aria-expanded=${this.isExpanded}
|
|
105
|
+
@blur=${this._blur}
|
|
106
|
+
/>
|
|
107
|
+
<button
|
|
108
|
+
aria-controls="map"
|
|
109
|
+
aria-expanded=${this.isExpanded}
|
|
110
|
+
aria-label="Spatial picker map"
|
|
111
|
+
class="spatial-picker__input_icon_button"
|
|
112
|
+
@click=${this._click}
|
|
113
|
+
type="button"
|
|
114
|
+
>
|
|
115
|
+
<svg
|
|
116
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
117
|
+
fill="none"
|
|
118
|
+
viewBox="0 0 24 24"
|
|
119
|
+
stroke-width="1.5"
|
|
120
|
+
stroke="currentColor"
|
|
121
|
+
class="w-6 h-6"
|
|
122
|
+
>
|
|
123
|
+
<path
|
|
124
|
+
stroke-linecap="round"
|
|
125
|
+
stroke-linejoin="round"
|
|
126
|
+
d="M9 6.75V15m6-6v8.25m.503 3.498 4.875-2.437c.381-.19.622-.58.622-1.006V4.82c0-.836-.88-1.38-1.628-1.006l-3.869 1.934c-.317.159-.69.159-1.006 0L9.503 3.252a1.125 1.125 0 0 0-1.006 0L3.622 5.689C3.24 5.88 3 6.27 3 6.695V19.18c0 .836.88 1.38 1.628 1.006l3.869-1.934c.317-.159.69-.159 1.006 0l4.994 2.497c.317.158.69.158 1.006 0Z"
|
|
127
|
+
/>
|
|
128
|
+
</svg>
|
|
129
|
+
</button>
|
|
130
|
+
</div>
|
|
131
|
+
${this.isExpanded ? this.renderMap() : nothing}
|
|
132
|
+
</div>
|
|
133
|
+
`;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
TerraSpatialPicker.styles = [component_styles_default, spatial_picker_styles_default];
|
|
137
|
+
TerraSpatialPicker.dependencies = {
|
|
138
|
+
"terra-map": TerraMap
|
|
139
|
+
};
|
|
140
|
+
__decorateClass([
|
|
141
|
+
property({ attribute: "min-zoom", type: Number })
|
|
142
|
+
], TerraSpatialPicker.prototype, "minZoom", 2);
|
|
143
|
+
__decorateClass([
|
|
144
|
+
property({ attribute: "max-zoom", type: Number })
|
|
145
|
+
], TerraSpatialPicker.prototype, "maxZoom", 2);
|
|
146
|
+
__decorateClass([
|
|
147
|
+
property({ type: Number })
|
|
148
|
+
], TerraSpatialPicker.prototype, "zoom", 2);
|
|
149
|
+
__decorateClass([
|
|
150
|
+
property({ attribute: "has-navigation", type: Boolean })
|
|
151
|
+
], TerraSpatialPicker.prototype, "hasNavigation", 2);
|
|
152
|
+
__decorateClass([
|
|
153
|
+
property({ attribute: "has-coord-tracker", type: Boolean })
|
|
154
|
+
], TerraSpatialPicker.prototype, "hasCoordTracker", 2);
|
|
155
|
+
__decorateClass([
|
|
156
|
+
property({ attribute: "has-shape-selector", type: Boolean })
|
|
157
|
+
], TerraSpatialPicker.prototype, "hasShapeSelector", 2);
|
|
158
|
+
__decorateClass([
|
|
159
|
+
property({ attribute: "initial-value" })
|
|
160
|
+
], TerraSpatialPicker.prototype, "initialValue", 2);
|
|
161
|
+
__decorateClass([
|
|
162
|
+
property({ attribute: "hide-label", type: Boolean })
|
|
163
|
+
], TerraSpatialPicker.prototype, "hideLabel", 2);
|
|
164
|
+
__decorateClass([
|
|
165
|
+
property()
|
|
166
|
+
], TerraSpatialPicker.prototype, "label", 2);
|
|
167
|
+
__decorateClass([
|
|
168
|
+
state()
|
|
169
|
+
], TerraSpatialPicker.prototype, "isExpanded", 2);
|
|
170
|
+
__decorateClass([
|
|
171
|
+
state()
|
|
172
|
+
], TerraSpatialPicker.prototype, "mapValue", 2);
|
|
173
|
+
__decorateClass([
|
|
174
|
+
query(".spatial-picker__input")
|
|
175
|
+
], TerraSpatialPicker.prototype, "spatialInput", 2);
|
|
176
|
+
|
|
177
|
+
export {
|
|
178
|
+
TerraSpatialPicker
|
|
179
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TerraLoader
|
|
3
|
+
} from "./chunk.Z2WXDYZC.js";
|
|
4
|
+
|
|
5
|
+
// src/react/loader/index.ts
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { createComponent } from "@lit/react";
|
|
8
|
+
var tagName = "terra-loader";
|
|
9
|
+
TerraLoader.define("terra-loader");
|
|
10
|
+
var reactWrapper = createComponent({
|
|
11
|
+
tagName,
|
|
12
|
+
elementClass: TerraLoader,
|
|
13
|
+
react: React,
|
|
14
|
+
events: {},
|
|
15
|
+
displayName: "TerraLoader"
|
|
16
|
+
});
|
|
17
|
+
var loader_default = reactWrapper;
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
loader_default
|
|
21
|
+
};
|