@nasa-terra/components 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/chunks/{chunk.JV6B7CXO.js → chunk.2LF7SMGQ.js} +11 -13
- package/cdn/chunks/{chunk.MXAZ646L.js → chunk.3JODJSTO.js} +1 -1
- package/cdn/chunks/{chunk.KVY2Y3KE.js → chunk.4D2G6L4V.js} +1 -1
- package/cdn/chunks/{chunk.GCKJPPGU.js → chunk.566BRIWX.js} +1 -1
- package/cdn/chunks/{chunk.JCZW2OWI.js → chunk.74CNHGFN.js} +1 -1
- package/cdn/chunks/{chunk.RBKBAQOH.js → chunk.A3BJQZCH.js} +6 -6
- package/cdn/chunks/{chunk.TV2NZLRC.js → chunk.B2HOKF44.js} +4 -4
- package/cdn/chunks/{chunk.IQITDFID.js → chunk.E2SRXXI6.js} +1 -1
- package/cdn/chunks/{chunk.4YOL6PQR.js → chunk.ELPRRHTE.js} +1 -1
- package/cdn/chunks/{chunk.VEUDIPUW.js → chunk.FS5IKMJD.js} +1 -1
- package/cdn/chunks/{chunk.MOJMTJF6.js → chunk.GR5QBZMP.js} +1 -1
- package/cdn/chunks/{chunk.ITX3RB2M.js → chunk.HCBG34UV.js} +1 -1
- package/cdn/chunks/{chunk.U6DUAIIP.js → chunk.IKBILRIY.js} +21 -0
- package/{dist/chunks/chunk.NZIGCRLS.js → cdn/chunks/chunk.JCBJR2VJ.js} +1 -1
- package/cdn/chunks/{chunk.2B4YBQ5O.js → chunk.JE7ZZRL6.js} +1 -1
- package/cdn/chunks/{chunk.A4PYD2BT.js → chunk.JM6ZF7AP.js} +4 -1
- package/{dist/chunks/chunk.7DEY3B3N.js → cdn/chunks/chunk.JOSFOMOK.js} +1 -1
- package/cdn/chunks/{chunk.NU4LRV7F.js → chunk.JUCL53DU.js} +1 -1
- package/cdn/chunks/{chunk.BINGLTII.js → chunk.K6YHM5TZ.js} +7 -3
- package/cdn/chunks/{chunk.M25XJ2VR.js → chunk.LBKLXTIO.js} +77 -52
- package/cdn/chunks/{chunk.QQ33BJLG.js → chunk.LHW6ZEEG.js} +1 -1
- package/{dist/chunks/chunk.IP3XWLQI.js → cdn/chunks/chunk.LIQU3FGS.js} +1 -1
- package/cdn/chunks/{chunk.MIAPAPCI.js → chunk.LT6GFPPN.js} +1 -1
- package/cdn/chunks/{chunk.FZT3BVW7.js → chunk.M4QB4Z2D.js} +1 -1
- package/cdn/chunks/{chunk.R3AE5AQ5.js → chunk.ON2RU4HZ.js} +4 -4
- package/cdn/chunks/{chunk.UQVPFKN3.js → chunk.ONGS57TV.js} +7 -7
- package/cdn/chunks/{chunk.DQGFAA4K.js → chunk.PDXFKRVY.js} +4 -4
- package/cdn/chunks/{chunk.MQ5JNQCQ.js → chunk.PM3G4HWU.js} +1 -1
- package/{dist/chunks/chunk.IEU4MULT.js → cdn/chunks/chunk.PS5CJCUL.js} +1 -1
- package/cdn/chunks/{chunk.FXIUS5TR.js → chunk.RXDN2NM7.js} +1 -1
- package/cdn/chunks/{chunk.2YI7V6QJ.js → chunk.SBDX4GGT.js} +24 -0
- package/cdn/chunks/{chunk.ZQ5WJYY5.js → chunk.SNTGQTAS.js} +1 -1
- package/cdn/chunks/{chunk.RVJP24KU.js → chunk.U5J3OV4V.js} +1 -1
- package/cdn/chunks/{chunk.2O76GCUZ.js → chunk.X56PW5HS.js} +1 -1
- package/cdn/chunks/{chunk.J576Q62R.js → chunk.XQOP7YET.js} +1 -1
- package/cdn/chunks/{chunk.IO4MLLEG.js → chunk.XZEK52FD.js} +1 -1
- package/cdn/chunks/{chunk.KXLY6BVH.js → chunk.ZO75EFUN.js} +4 -4
- package/cdn/chunks/{chunk.WNRL2JWN.js → chunk.ZUGL2FNZ.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 +3 -3
- package/cdn/components/icon/icon.js +4 -4
- package/cdn/components/loader/loader.component.d.ts +2 -0
- package/cdn/components/loader/loader.component.js +3 -3
- package/cdn/components/loader/loader.js +4 -4
- package/cdn/components/loader/loader.styles.js +1 -1
- 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 +5 -5
- package/cdn/components/spatial-picker/spatial-picker.js +6 -6
- package/cdn/components/time-series/time-series.component.d.ts +4 -0
- package/cdn/components/time-series/time-series.component.js +30 -28
- package/cdn/components/time-series/time-series.controller.d.ts +1 -0
- package/cdn/components/time-series/time-series.controller.js +1 -1
- package/cdn/components/time-series/time-series.js +31 -29
- package/cdn/components/time-series/time-series.styles.js +1 -1
- package/cdn/components/variable-combobox/variable-combobox.component.js +12 -12
- package/cdn/components/variable-combobox/variable-combobox.controller.js +1 -1
- package/cdn/components/variable-combobox/variable-combobox.js +13 -13
- package/cdn/custom-elements.json +352 -326
- 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 +4 -4
- package/cdn/react/index.d.ts +4 -4
- package/cdn/react/index.js +52 -52
- package/cdn/react/loader/index.js +4 -4
- package/cdn/react/map/index.js +5 -5
- package/cdn/react/plot/index.js +3 -3
- package/cdn/react/spatial-picker/index.js +6 -6
- package/cdn/react/time-series/index.d.ts +2 -0
- package/cdn/react/time-series/index.js +31 -29
- package/cdn/react/variable-combobox/index.js +13 -13
- package/cdn/terra-ui-components.js +55 -55
- package/cdn/types/vue/index.d.ts +68 -66
- package/cdn/utilities/animation.js +3 -3
- package/cdn/vscode.html-custom-data.json +74 -69
- package/cdn/web-types.json +152 -142
- package/{cdn/chunks/chunk.OOUCODFZ.js → dist/chunks/chunk.2RJXTLAA.js} +11 -13
- package/{cdn/chunks/chunk.Y3WAKQQ3.js → dist/chunks/chunk.33FFT37R.js} +2 -2
- package/{cdn/chunks/chunk.77L4US7V.js → dist/chunks/chunk.3SRITTYR.js} +1 -1
- package/dist/chunks/{chunk.QSCELHEQ.js → chunk.4GCNO2RC.js} +4 -4
- package/dist/chunks/{chunk.UE4FYVUH.js → chunk.6DRNHPKF.js} +1 -1
- package/{cdn/chunks/chunk.MKXJDRVT.js → dist/chunks/chunk.7DFKM3M3.js} +1 -1
- package/{cdn/chunks/chunk.OLCGKQR3.js → dist/chunks/chunk.AJUYULUM.js} +1 -1
- package/dist/chunks/{chunk.EFAXKQZX.js → chunk.ALFBRTWT.js} +1 -1
- package/dist/chunks/{chunk.Z2WXDYZC.js → chunk.B7L6K56Y.js} +7 -3
- package/dist/chunks/{chunk.I2NEFB34.js → chunk.CL62YJ3N.js} +21 -0
- package/{cdn/chunks/chunk.BB7N2ZYB.js → dist/chunks/chunk.EDKH7GOS.js} +1 -1
- package/{cdn/chunks/chunk.7DEY3B3N.js → dist/chunks/chunk.EPOITANB.js} +1 -1
- package/dist/chunks/{chunk.65A3A43G.js → chunk.FLO6VVGK.js} +1 -1
- package/{cdn/chunks/chunk.27YQ2AOA.js → dist/chunks/chunk.FOD357NT.js} +35 -12
- package/{cdn/chunks/chunk.ZGJAUXFV.js → dist/chunks/chunk.GPUFE4ML.js} +24 -0
- package/dist/chunks/{chunk.MWHQHPUM.js → chunk.GWHZAFS3.js} +4 -1
- package/{cdn/chunks/chunk.ZAHTEXVC.js → dist/chunks/chunk.HSPKB2MG.js} +1 -1
- package/{cdn/chunks/chunk.36AVAQOO.js → dist/chunks/chunk.IOP7DABN.js} +6 -6
- package/dist/chunks/{chunk.P25SJ6YA.js → chunk.JL4ZDCDW.js} +4 -4
- package/{cdn/chunks/chunk.SMRM4VEQ.js → dist/chunks/chunk.KJIDKCTU.js} +1 -1
- package/{cdn/chunks/chunk.P7W2ODWK.js → dist/chunks/chunk.LUYLEISL.js} +1 -1
- package/dist/chunks/{chunk.MOJMTJF6.js → chunk.LXE4USTN.js} +1 -1
- package/{cdn/chunks/chunk.D33ZL7ZQ.js → dist/chunks/chunk.LZWNT5PB.js} +1 -1
- package/{cdn/chunks/chunk.GHCQCYO6.js → dist/chunks/chunk.MMYKMN6B.js} +4 -4
- package/dist/chunks/{chunk.RDOXOIYG.js → chunk.MPA4M3E7.js} +1 -1
- package/{cdn/chunks/chunk.UJBBUYTN.js → dist/chunks/chunk.MVKAIELO.js} +1 -1
- package/dist/chunks/{chunk.PGNCNTOA.js → chunk.NF7CULQM.js} +1 -1
- package/{cdn/chunks/chunk.KH54YRZ3.js → dist/chunks/chunk.OIEDIUMT.js} +1 -1
- package/dist/chunks/{chunk.3LUNFNDR.js → chunk.PRBM2XXL.js} +1 -1
- package/{cdn/chunks/chunk.PJXIJK2G.js → dist/chunks/chunk.PSTXVQB5.js} +1 -1
- package/dist/chunks/{chunk.EMISRECR.js → chunk.PU5MKRJ3.js} +1 -1
- package/dist/chunks/{chunk.FZT3BVW7.js → chunk.Q2BSVCPH.js} +1 -1
- package/{cdn/chunks/chunk.JOVDYQHE.js → dist/chunks/chunk.S2WDTAIJ.js} +1 -1
- package/{cdn/chunks/chunk.YOR2OZZR.js → dist/chunks/chunk.S4JQ7QD5.js} +1 -1
- package/{cdn/chunks/chunk.ZPPR6CPT.js → dist/chunks/chunk.XLQO6OZU.js} +1 -1
- package/{cdn/chunks/chunk.SJADWOCY.js → dist/chunks/chunk.YRZFOIW4.js} +1 -1
- package/dist/chunks/{chunk.NOEGCTIS.js → chunk.YUEY7TCJ.js} +7 -7
- package/dist/chunks/{chunk.5B33QFBB.js → chunk.ZB6UWPGQ.js} +4 -4
- 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 +2 -2
- package/dist/components/icon/icon.js +3 -3
- package/dist/components/loader/loader.component.d.ts +2 -0
- package/dist/components/loader/loader.component.js +3 -3
- package/dist/components/loader/loader.js +4 -4
- package/dist/components/loader/loader.styles.js +1 -1
- 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 +5 -5
- package/dist/components/spatial-picker/spatial-picker.js +6 -6
- package/dist/components/time-series/time-series.component.d.ts +4 -0
- package/dist/components/time-series/time-series.component.js +25 -23
- package/dist/components/time-series/time-series.controller.d.ts +1 -0
- package/dist/components/time-series/time-series.controller.js +1 -1
- package/dist/components/time-series/time-series.js +26 -24
- package/dist/components/time-series/time-series.styles.js +1 -1
- package/dist/components/variable-combobox/variable-combobox.component.js +9 -9
- package/dist/components/variable-combobox/variable-combobox.controller.js +1 -1
- package/dist/components/variable-combobox/variable-combobox.js +10 -10
- package/dist/custom-elements.json +352 -326
- 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 +3 -3
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.js +48 -48
- package/dist/react/loader/index.js +4 -4
- package/dist/react/map/index.js +5 -5
- package/dist/react/plot/index.js +3 -3
- package/dist/react/spatial-picker/index.js +6 -6
- package/dist/react/time-series/index.d.ts +2 -0
- package/dist/react/time-series/index.js +26 -24
- package/dist/react/variable-combobox/index.js +10 -10
- package/dist/terra-ui-components.js +48 -48
- package/dist/types/vue/index.d.ts +68 -66
- package/dist/vscode.html-custom-data.json +74 -69
- package/dist/web-types.json +152 -142
- package/package.json +1 -1
- package/cdn/chunks/chunk.2I657ASB.js +0 -85
- package/cdn/chunks/chunk.2J6CFV4K.js +0 -11
- package/cdn/chunks/chunk.2V4XFMTB.js +0 -7
- package/cdn/chunks/chunk.3ZGFXEAJ.js +0 -273
- package/cdn/chunks/chunk.7VUSSQRI.js +0 -20
- package/cdn/chunks/chunk.AAWOHDFX.js +0 -259
- package/cdn/chunks/chunk.AEIZVWLR.js +0 -24
- package/cdn/chunks/chunk.BLNUBLUS.js +0 -289
- package/cdn/chunks/chunk.DL3FIOYA.js +0 -21
- package/cdn/chunks/chunk.EFAXKQZX.js +0 -11
- package/cdn/chunks/chunk.EMISRECR.js +0 -214
- package/cdn/chunks/chunk.FGILL5W6.js +0 -118
- package/cdn/chunks/chunk.I2NEFB34.js +0 -99
- package/cdn/chunks/chunk.I32QCWMN.js +0 -21
- package/cdn/chunks/chunk.IBEKZVOY.js +0 -80
- package/cdn/chunks/chunk.IP3XWLQI.js +0 -11
- package/cdn/chunks/chunk.JFU3ZCDL.js +0 -359
- package/cdn/chunks/chunk.LELNKRPW.js +0 -685
- package/cdn/chunks/chunk.MDM7S6E6.js +0 -21
- package/cdn/chunks/chunk.MWHQHPUM.js +0 -54
- package/cdn/chunks/chunk.N2DS7NLI.js +0 -102
- package/cdn/chunks/chunk.NYBJ252W.js +0 -318
- package/cdn/chunks/chunk.OIDMX5LU.js +0 -10
- package/cdn/chunks/chunk.OQE2USZJ.js +0 -41
- package/cdn/chunks/chunk.OU4UPMYR.js +0 -330
- package/cdn/chunks/chunk.P25SJ6YA.js +0 -478
- package/cdn/chunks/chunk.RDOXOIYG.js +0 -11
- package/cdn/chunks/chunk.RYPAZDXE.js +0 -61
- package/cdn/chunks/chunk.SCU5LFS3.js +0 -325
- package/cdn/chunks/chunk.SHS42OAD.js +0 -620
- package/cdn/chunks/chunk.SQMSSGQI.js +0 -11
- package/cdn/chunks/chunk.T322FDKI.js +0 -300
- package/cdn/chunks/chunk.UE4FYVUH.js +0 -25
- package/cdn/chunks/chunk.UU46CLE7.js +0 -120
- package/cdn/chunks/chunk.WGFD2LHA.js +0 -83
- package/cdn/chunks/chunk.WL747XGE.js +0 -194
- package/cdn/chunks/chunk.ZCNMYQP2.js +0 -113
- package/cdn/chunks/chunk.ZK7QVWBI.js +0 -37
- package/cdn/chunks/chunk.ZVKNJQPF.js +0 -25
- package/dist/chunks/chunk.27YQ2AOA.js +0 -251
- package/dist/chunks/chunk.2I657ASB.js +0 -85
- package/dist/chunks/chunk.2O76GCUZ.js +0 -21
- package/dist/chunks/chunk.2WZAYHEX.js +0 -214
- package/dist/chunks/chunk.356SSUTI.js +0 -11
- package/dist/chunks/chunk.36AVAQOO.js +0 -404
- package/dist/chunks/chunk.3D66L46K.js +0 -11
- package/dist/chunks/chunk.4MN2BLJS.js +0 -21
- package/dist/chunks/chunk.BB7N2ZYB.js +0 -21
- package/dist/chunks/chunk.D6FJH7WA.js +0 -21
- package/dist/chunks/chunk.DDPOISEU.js +0 -179
- package/dist/chunks/chunk.EBBV6NVD.js +0 -11
- package/dist/chunks/chunk.FGILL5W6.js +0 -118
- package/dist/chunks/chunk.FXIUS5TR.js +0 -21
- package/dist/chunks/chunk.GHCQCYO6.js +0 -179
- package/dist/chunks/chunk.HO5CZIK5.js +0 -11
- package/dist/chunks/chunk.I32QCWMN.js +0 -21
- package/dist/chunks/chunk.IO4MLLEG.js +0 -21
- package/dist/chunks/chunk.J4B6HPXD.js +0 -11
- package/dist/chunks/chunk.J576Q62R.js +0 -11
- package/dist/chunks/chunk.JCZW2OWI.js +0 -11
- package/dist/chunks/chunk.K2HRGRYE.js +0 -11
- package/dist/chunks/chunk.KXNDHJXA.js +0 -404
- package/dist/chunks/chunk.MIAPAPCI.js +0 -21
- package/dist/chunks/chunk.MXAZ646L.js +0 -11
- package/dist/chunks/chunk.NNLAIN52.js +0 -11
- package/dist/chunks/chunk.NO35M7LF.js +0 -21
- package/dist/chunks/chunk.NU4LRV7F.js +0 -21
- package/dist/chunks/chunk.OIGE7CMM.js +0 -11
- package/dist/chunks/chunk.OOUCODFZ.js +0 -179
- package/dist/chunks/chunk.ORZO3BCW.js +0 -102
- package/dist/chunks/chunk.P4QMMCAR.js +0 -24
- package/dist/chunks/chunk.PJXIJK2G.js +0 -102
- package/dist/chunks/chunk.Q7F3GGVA.js +0 -251
- package/dist/chunks/chunk.QQ33BJLG.js +0 -11
- package/dist/chunks/chunk.SBTZE5QZ.js +0 -21
- package/dist/chunks/chunk.SCU5LFS3.js +0 -325
- package/dist/chunks/chunk.SJADWOCY.js +0 -11
- package/dist/chunks/chunk.SMRM4VEQ.js +0 -11
- package/dist/chunks/chunk.T7MOUOBT.js +0 -11
- package/dist/chunks/chunk.UJBBUYTN.js +0 -11
- package/dist/chunks/chunk.WGFD2LHA.js +0 -83
- package/dist/chunks/chunk.WL747XGE.js +0 -194
- package/dist/chunks/chunk.WNRL2JWN.js +0 -21
- package/dist/chunks/chunk.XKDGF53W.js +0 -21
- package/dist/chunks/chunk.XLYZ6HY4.js +0 -179
- package/dist/chunks/chunk.XXV47QL2.js +0 -21
- package/dist/chunks/chunk.Y3WAKQQ3.js +0 -179
- package/dist/chunks/chunk.Y5CHSR6B.js +0 -21
- package/dist/chunks/chunk.YDJ7Z7YW.js +0 -478
- package/dist/chunks/chunk.YDMA4OA3.js +0 -11
- package/dist/chunks/chunk.ZGJAUXFV.js +0 -39
- package/cdn/chunks/{chunk.XR56EMXH.js → chunk.LQCRC4E2.js} +8 -8
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FormControlController,
|
|
3
|
-
validValidityState
|
|
4
|
-
} from "./chunk.NYBJ252W.js";
|
|
5
|
-
import {
|
|
6
|
-
watch
|
|
7
|
-
} from "./chunk.ZK7QVWBI.js";
|
|
8
|
-
import {
|
|
9
|
-
TerraElement,
|
|
10
|
-
component_styles_default
|
|
11
|
-
} from "./chunk.PJXIJK2G.js";
|
|
12
|
-
import {
|
|
13
|
-
button_styles_default
|
|
14
|
-
} from "./chunk.SHS42OAD.js";
|
|
15
|
-
import {
|
|
16
|
-
__decorateClass
|
|
17
|
-
} from "./chunk.RYPAZDXE.js";
|
|
18
|
-
|
|
19
|
-
// src/components/button/button.component.ts
|
|
20
|
-
import { classMap } from "lit/directives/class-map.js";
|
|
21
|
-
|
|
22
|
-
// src/internal/slot.ts
|
|
23
|
-
var HasSlotController = class {
|
|
24
|
-
constructor(host, ...slotNames) {
|
|
25
|
-
this.slotNames = [];
|
|
26
|
-
this.handleSlotChange = (event) => {
|
|
27
|
-
const slot = event.target;
|
|
28
|
-
if (this.slotNames.includes("[default]") && !slot.name || slot.name && this.slotNames.includes(slot.name)) {
|
|
29
|
-
this.host.requestUpdate();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
;
|
|
33
|
-
(this.host = host).addController(this);
|
|
34
|
-
this.slotNames = slotNames;
|
|
35
|
-
}
|
|
36
|
-
hasDefaultSlot() {
|
|
37
|
-
return [...this.host.childNodes].some((node) => {
|
|
38
|
-
if (node.nodeType === node.TEXT_NODE && node.textContent.trim() !== "") {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
if (node.nodeType === node.ELEMENT_NODE) {
|
|
42
|
-
const el = node;
|
|
43
|
-
const tagName = el.tagName.toLowerCase();
|
|
44
|
-
if (tagName === "terra-visually-hidden") {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
if (!el.hasAttribute("slot")) {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return false;
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
hasNamedSlot(name) {
|
|
55
|
-
return this.host.querySelector(`:scope > [slot="${name}"]`) !== null;
|
|
56
|
-
}
|
|
57
|
-
test(slotName) {
|
|
58
|
-
return slotName === "[default]" ? this.hasDefaultSlot() : this.hasNamedSlot(slotName);
|
|
59
|
-
}
|
|
60
|
-
hostConnected() {
|
|
61
|
-
this.host.shadowRoot.addEventListener("slotchange", this.handleSlotChange);
|
|
62
|
-
}
|
|
63
|
-
hostDisconnected() {
|
|
64
|
-
this.host.shadowRoot.removeEventListener("slotchange", this.handleSlotChange);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
// src/components/button/button.component.ts
|
|
69
|
-
import { html, literal } from "lit/static-html.js";
|
|
70
|
-
import { ifDefined } from "lit/directives/if-defined.js";
|
|
71
|
-
import { property, query, state } from "lit/decorators.js";
|
|
72
|
-
var TerraButton = class extends TerraElement {
|
|
73
|
-
constructor() {
|
|
74
|
-
super(...arguments);
|
|
75
|
-
this.formControlController = new FormControlController(this, {
|
|
76
|
-
assumeInteractionOn: ["click"]
|
|
77
|
-
});
|
|
78
|
-
this.hasSlotController = new HasSlotController(
|
|
79
|
-
this,
|
|
80
|
-
"[default]",
|
|
81
|
-
"prefix",
|
|
82
|
-
"suffix"
|
|
83
|
-
);
|
|
84
|
-
this.hasFocus = false;
|
|
85
|
-
this.invalid = false;
|
|
86
|
-
this.title = "";
|
|
87
|
-
this.variant = "default";
|
|
88
|
-
this.size = "medium";
|
|
89
|
-
this.caret = false;
|
|
90
|
-
this.disabled = false;
|
|
91
|
-
this.loading = false;
|
|
92
|
-
this.outline = false;
|
|
93
|
-
this.pill = false;
|
|
94
|
-
this.circle = false;
|
|
95
|
-
this.type = "button";
|
|
96
|
-
this.name = "";
|
|
97
|
-
this.value = "";
|
|
98
|
-
this.href = "";
|
|
99
|
-
this.rel = "noreferrer noopener";
|
|
100
|
-
}
|
|
101
|
-
/** Gets the validity state object */
|
|
102
|
-
get validity() {
|
|
103
|
-
if (this.isButton()) {
|
|
104
|
-
return this.button.validity;
|
|
105
|
-
}
|
|
106
|
-
return validValidityState;
|
|
107
|
-
}
|
|
108
|
-
/** Gets the validation message */
|
|
109
|
-
get validationMessage() {
|
|
110
|
-
if (this.isButton()) {
|
|
111
|
-
return this.button.validationMessage;
|
|
112
|
-
}
|
|
113
|
-
return "";
|
|
114
|
-
}
|
|
115
|
-
firstUpdated() {
|
|
116
|
-
if (this.isButton()) {
|
|
117
|
-
this.formControlController.updateValidity();
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
handleBlur() {
|
|
121
|
-
this.hasFocus = false;
|
|
122
|
-
this.emit("sl-blur");
|
|
123
|
-
}
|
|
124
|
-
handleFocus() {
|
|
125
|
-
this.hasFocus = true;
|
|
126
|
-
this.emit("sl-focus");
|
|
127
|
-
}
|
|
128
|
-
handleClick() {
|
|
129
|
-
if (this.type === "submit") {
|
|
130
|
-
this.formControlController.submit(this);
|
|
131
|
-
}
|
|
132
|
-
if (this.type === "reset") {
|
|
133
|
-
this.formControlController.reset(this);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
handleInvalid(event) {
|
|
137
|
-
this.formControlController.setValidity(false);
|
|
138
|
-
this.formControlController.emitInvalidEvent(event);
|
|
139
|
-
}
|
|
140
|
-
isButton() {
|
|
141
|
-
return this.href ? false : true;
|
|
142
|
-
}
|
|
143
|
-
isLink() {
|
|
144
|
-
return this.href ? true : false;
|
|
145
|
-
}
|
|
146
|
-
handleDisabledChange() {
|
|
147
|
-
if (this.isButton()) {
|
|
148
|
-
this.formControlController.setValidity(this.disabled);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
/** Simulates a click on the button. */
|
|
152
|
-
click() {
|
|
153
|
-
this.button.click();
|
|
154
|
-
}
|
|
155
|
-
/** Sets focus on the button. */
|
|
156
|
-
focus(options) {
|
|
157
|
-
this.button.focus(options);
|
|
158
|
-
}
|
|
159
|
-
/** Removes focus from the button. */
|
|
160
|
-
blur() {
|
|
161
|
-
this.button.blur();
|
|
162
|
-
}
|
|
163
|
-
/** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */
|
|
164
|
-
checkValidity() {
|
|
165
|
-
if (this.isButton()) {
|
|
166
|
-
return this.button.checkValidity();
|
|
167
|
-
}
|
|
168
|
-
return true;
|
|
169
|
-
}
|
|
170
|
-
/** Gets the associated form, if one exists. */
|
|
171
|
-
getForm() {
|
|
172
|
-
return this.formControlController.getForm();
|
|
173
|
-
}
|
|
174
|
-
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
175
|
-
reportValidity() {
|
|
176
|
-
if (this.isButton()) {
|
|
177
|
-
return this.button.reportValidity();
|
|
178
|
-
}
|
|
179
|
-
return true;
|
|
180
|
-
}
|
|
181
|
-
/** Sets a custom validation message. Pass an empty string to restore validity. */
|
|
182
|
-
setCustomValidity(message) {
|
|
183
|
-
if (this.isButton()) {
|
|
184
|
-
;
|
|
185
|
-
this.button.setCustomValidity(message);
|
|
186
|
-
this.formControlController.updateValidity();
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
render() {
|
|
190
|
-
const isLink = this.isLink();
|
|
191
|
-
const tag = isLink ? literal`a` : literal`button`;
|
|
192
|
-
return html`
|
|
193
|
-
<${tag}
|
|
194
|
-
part="base"
|
|
195
|
-
class=${classMap({
|
|
196
|
-
button: true,
|
|
197
|
-
"button--default": this.variant === "default",
|
|
198
|
-
"button--primary": this.variant === "primary",
|
|
199
|
-
"button--success": this.variant === "success",
|
|
200
|
-
"button--neutral": this.variant === "neutral",
|
|
201
|
-
"button--warning": this.variant === "warning",
|
|
202
|
-
"button--danger": this.variant === "danger",
|
|
203
|
-
"button--text": this.variant === "text",
|
|
204
|
-
"button--small": this.size === "small",
|
|
205
|
-
"button--medium": this.size === "medium",
|
|
206
|
-
"button--large": this.size === "large",
|
|
207
|
-
"button--caret": this.caret,
|
|
208
|
-
"button--circle": this.circle,
|
|
209
|
-
"button--disabled": this.disabled,
|
|
210
|
-
"button--focused": this.hasFocus,
|
|
211
|
-
"button--loading": this.loading,
|
|
212
|
-
"button--standard": !this.outline,
|
|
213
|
-
"button--outline": this.outline,
|
|
214
|
-
"button--pill": this.pill,
|
|
215
|
-
"button--has-label": this.hasSlotController.test("[default]"),
|
|
216
|
-
"button--has-prefix": this.hasSlotController.test("prefix"),
|
|
217
|
-
"button--has-suffix": this.hasSlotController.test("suffix")
|
|
218
|
-
})}
|
|
219
|
-
?disabled=${ifDefined(isLink ? void 0 : this.disabled)}
|
|
220
|
-
type=${ifDefined(isLink ? void 0 : this.type)}
|
|
221
|
-
title=${this.title}
|
|
222
|
-
name=${ifDefined(isLink ? void 0 : this.name)}
|
|
223
|
-
value=${ifDefined(isLink ? void 0 : this.value)}
|
|
224
|
-
href=${ifDefined(isLink ? this.href : void 0)}
|
|
225
|
-
target=${ifDefined(isLink ? this.target : void 0)}
|
|
226
|
-
download=${ifDefined(isLink ? this.download : void 0)}
|
|
227
|
-
rel=${ifDefined(isLink ? this.rel : void 0)}
|
|
228
|
-
role=${ifDefined(isLink ? void 0 : "button")}
|
|
229
|
-
aria-disabled=${this.disabled ? "true" : "false"}
|
|
230
|
-
tabindex=${this.disabled ? "-1" : "0"}
|
|
231
|
-
@blur=${this.handleBlur}
|
|
232
|
-
@focus=${this.handleFocus}
|
|
233
|
-
@invalid=${this.isButton() ? this.handleInvalid : null}
|
|
234
|
-
@click=${this.handleClick}
|
|
235
|
-
>
|
|
236
|
-
<slot name="prefix" part="prefix" class="button__prefix"></slot>
|
|
237
|
-
<slot part="label" class="button__label"></slot>
|
|
238
|
-
<slot name="suffix" part="suffix" class="button__suffix"></slot>
|
|
239
|
-
</${tag}>
|
|
240
|
-
`;
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
TerraButton.styles = [component_styles_default, button_styles_default];
|
|
244
|
-
__decorateClass([
|
|
245
|
-
query(".button")
|
|
246
|
-
], TerraButton.prototype, "button", 2);
|
|
247
|
-
__decorateClass([
|
|
248
|
-
state()
|
|
249
|
-
], TerraButton.prototype, "hasFocus", 2);
|
|
250
|
-
__decorateClass([
|
|
251
|
-
state()
|
|
252
|
-
], TerraButton.prototype, "invalid", 2);
|
|
253
|
-
__decorateClass([
|
|
254
|
-
property()
|
|
255
|
-
], TerraButton.prototype, "title", 2);
|
|
256
|
-
__decorateClass([
|
|
257
|
-
property({ reflect: true })
|
|
258
|
-
], TerraButton.prototype, "variant", 2);
|
|
259
|
-
__decorateClass([
|
|
260
|
-
property({ reflect: true })
|
|
261
|
-
], TerraButton.prototype, "size", 2);
|
|
262
|
-
__decorateClass([
|
|
263
|
-
property({ type: Boolean, reflect: true })
|
|
264
|
-
], TerraButton.prototype, "caret", 2);
|
|
265
|
-
__decorateClass([
|
|
266
|
-
property({ type: Boolean, reflect: true })
|
|
267
|
-
], TerraButton.prototype, "disabled", 2);
|
|
268
|
-
__decorateClass([
|
|
269
|
-
property({ type: Boolean, reflect: true })
|
|
270
|
-
], TerraButton.prototype, "loading", 2);
|
|
271
|
-
__decorateClass([
|
|
272
|
-
property({ type: Boolean, reflect: true })
|
|
273
|
-
], TerraButton.prototype, "outline", 2);
|
|
274
|
-
__decorateClass([
|
|
275
|
-
property({ type: Boolean, reflect: true })
|
|
276
|
-
], TerraButton.prototype, "pill", 2);
|
|
277
|
-
__decorateClass([
|
|
278
|
-
property({ type: Boolean, reflect: true })
|
|
279
|
-
], TerraButton.prototype, "circle", 2);
|
|
280
|
-
__decorateClass([
|
|
281
|
-
property()
|
|
282
|
-
], TerraButton.prototype, "type", 2);
|
|
283
|
-
__decorateClass([
|
|
284
|
-
property()
|
|
285
|
-
], TerraButton.prototype, "name", 2);
|
|
286
|
-
__decorateClass([
|
|
287
|
-
property()
|
|
288
|
-
], TerraButton.prototype, "value", 2);
|
|
289
|
-
__decorateClass([
|
|
290
|
-
property()
|
|
291
|
-
], TerraButton.prototype, "href", 2);
|
|
292
|
-
__decorateClass([
|
|
293
|
-
property()
|
|
294
|
-
], TerraButton.prototype, "target", 2);
|
|
295
|
-
__decorateClass([
|
|
296
|
-
property()
|
|
297
|
-
], TerraButton.prototype, "rel", 2);
|
|
298
|
-
__decorateClass([
|
|
299
|
-
property()
|
|
300
|
-
], TerraButton.prototype, "download", 2);
|
|
301
|
-
__decorateClass([
|
|
302
|
-
property()
|
|
303
|
-
], TerraButton.prototype, "form", 2);
|
|
304
|
-
__decorateClass([
|
|
305
|
-
property({ attribute: "formaction" })
|
|
306
|
-
], TerraButton.prototype, "formAction", 2);
|
|
307
|
-
__decorateClass([
|
|
308
|
-
property({ attribute: "formenctype" })
|
|
309
|
-
], TerraButton.prototype, "formEnctype", 2);
|
|
310
|
-
__decorateClass([
|
|
311
|
-
property({ attribute: "formmethod" })
|
|
312
|
-
], TerraButton.prototype, "formMethod", 2);
|
|
313
|
-
__decorateClass([
|
|
314
|
-
property({ attribute: "formnovalidate", type: Boolean })
|
|
315
|
-
], TerraButton.prototype, "formNoValidate", 2);
|
|
316
|
-
__decorateClass([
|
|
317
|
-
property({ attribute: "formtarget" })
|
|
318
|
-
], TerraButton.prototype, "formTarget", 2);
|
|
319
|
-
__decorateClass([
|
|
320
|
-
watch("disabled", { waitUntilFirstUpdate: true })
|
|
321
|
-
], TerraButton.prototype, "handleDisabledChange", 1);
|
|
322
|
-
|
|
323
|
-
export {
|
|
324
|
-
TerraButton
|
|
325
|
-
};
|