@esri/calcite-components 1.0.0-next.321 → 1.0.0-next.322
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/calcite/calcite.esm.js +1 -1
- package/dist/calcite/p-414ce3c1.system.entry.js +5 -0
- package/dist/calcite/p-4d4ba7df.entry.js +5 -0
- package/dist/calcite/{p-9be50494.entry.js → p-77600274.entry.js} +1 -1
- package/dist/calcite/p-8e252799.system.js +1 -1
- package/dist/calcite/{p-6c5b849f.system.entry.js → p-ac417011.system.entry.js} +1 -1
- package/dist/cjs/calcite-label.cjs.entry.js +1 -1
- package/dist/cjs/{calcite-radio_2.cjs.entry.js → calcite-radio-button.cjs.entry.js} +2 -43
- package/dist/cjs/calcite.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +5 -7
- package/dist/collection/components/calcite-label/calcite-label.css +0 -1
- package/dist/collection/components/calcite-radio-button/calcite-radio-button.css +69 -0
- package/dist/collection/components/calcite-radio-button/calcite-radio-button.js +1 -1
- package/dist/components/calcite-label2.js +1 -1
- package/dist/components/calcite-radio-button.js +3 -9
- package/dist/custom-elements/index.d.ts +0 -6
- package/dist/custom-elements/index.js +4 -48
- package/dist/esm/calcite-label.entry.js +1 -1
- package/dist/esm/{calcite-radio_2.entry.js → calcite-radio-button.entry.js} +4 -44
- package/dist/esm/calcite.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/calcite-label.entry.js +1 -1
- package/dist/esm-es5/calcite-radio-button.entry.js +5 -0
- package/dist/esm-es5/calcite.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/extras/docs-json.json +3 -112
- package/dist/types/components.d.ts +0 -53
- package/dist/types/preact.d.ts +0 -2
- package/hydrate/index.js +3 -59
- package/package.json +1 -1
- package/readme.md +2 -2
- package/dist/calcite/p-1e4955d7.entry.js +0 -5
- package/dist/calcite/p-4af85388.system.entry.js +0 -5
- package/dist/collection/components/calcite-radio/calcite-radio.css +0 -162
- package/dist/collection/components/calcite-radio/calcite-radio.js +0 -169
- package/dist/components/calcite-radio.d.ts +0 -11
- package/dist/components/calcite-radio.js +0 -10
- package/dist/components/calcite-radio2.js +0 -71
- package/dist/esm-es5/calcite-radio_2.entry.js +0 -5
- package/dist/types/components/calcite-radio/calcite-radio.d.ts +0 -22
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
|
-
*/
|
|
5
|
-
import { Component, h, Prop } from "@stencil/core";
|
|
6
|
-
export class CalciteRadio {
|
|
7
|
-
constructor() {
|
|
8
|
-
//--------------------------------------------------------------------------
|
|
9
|
-
//
|
|
10
|
-
// Properties
|
|
11
|
-
//
|
|
12
|
-
//--------------------------------------------------------------------------
|
|
13
|
-
/** The checked state of the radio. */
|
|
14
|
-
this.checked = false;
|
|
15
|
-
/** The disabled state of the radio. */
|
|
16
|
-
this.disabled = false;
|
|
17
|
-
/**
|
|
18
|
-
* The focused state of the radio.
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
this.focused = false;
|
|
22
|
-
/** The radio's hidden status. */
|
|
23
|
-
this.hidden = false;
|
|
24
|
-
/**
|
|
25
|
-
* The hovered state of the radio.
|
|
26
|
-
* @internal
|
|
27
|
-
*/
|
|
28
|
-
this.hovered = false;
|
|
29
|
-
/** The scale (size) of the radio. */
|
|
30
|
-
this.scale = "m";
|
|
31
|
-
}
|
|
32
|
-
// --------------------------------------------------------------------------
|
|
33
|
-
//
|
|
34
|
-
// Render Methods
|
|
35
|
-
//
|
|
36
|
-
// --------------------------------------------------------------------------
|
|
37
|
-
render() {
|
|
38
|
-
return h("div", { class: "radio" });
|
|
39
|
-
}
|
|
40
|
-
static get is() { return "calcite-radio"; }
|
|
41
|
-
static get encapsulation() { return "shadow"; }
|
|
42
|
-
static get originalStyleUrls() { return {
|
|
43
|
-
"$": ["calcite-radio.scss"]
|
|
44
|
-
}; }
|
|
45
|
-
static get styleUrls() { return {
|
|
46
|
-
"$": ["calcite-radio.css"]
|
|
47
|
-
}; }
|
|
48
|
-
static get properties() { return {
|
|
49
|
-
"checked": {
|
|
50
|
-
"type": "boolean",
|
|
51
|
-
"mutable": false,
|
|
52
|
-
"complexType": {
|
|
53
|
-
"original": "boolean",
|
|
54
|
-
"resolved": "boolean",
|
|
55
|
-
"references": {}
|
|
56
|
-
},
|
|
57
|
-
"required": false,
|
|
58
|
-
"optional": false,
|
|
59
|
-
"docs": {
|
|
60
|
-
"tags": [],
|
|
61
|
-
"text": "The checked state of the radio."
|
|
62
|
-
},
|
|
63
|
-
"attribute": "checked",
|
|
64
|
-
"reflect": true,
|
|
65
|
-
"defaultValue": "false"
|
|
66
|
-
},
|
|
67
|
-
"disabled": {
|
|
68
|
-
"type": "boolean",
|
|
69
|
-
"mutable": false,
|
|
70
|
-
"complexType": {
|
|
71
|
-
"original": "boolean",
|
|
72
|
-
"resolved": "boolean",
|
|
73
|
-
"references": {}
|
|
74
|
-
},
|
|
75
|
-
"required": false,
|
|
76
|
-
"optional": false,
|
|
77
|
-
"docs": {
|
|
78
|
-
"tags": [],
|
|
79
|
-
"text": "The disabled state of the radio."
|
|
80
|
-
},
|
|
81
|
-
"attribute": "disabled",
|
|
82
|
-
"reflect": true,
|
|
83
|
-
"defaultValue": "false"
|
|
84
|
-
},
|
|
85
|
-
"focused": {
|
|
86
|
-
"type": "boolean",
|
|
87
|
-
"mutable": false,
|
|
88
|
-
"complexType": {
|
|
89
|
-
"original": "boolean",
|
|
90
|
-
"resolved": "boolean",
|
|
91
|
-
"references": {}
|
|
92
|
-
},
|
|
93
|
-
"required": false,
|
|
94
|
-
"optional": false,
|
|
95
|
-
"docs": {
|
|
96
|
-
"tags": [{
|
|
97
|
-
"name": "internal",
|
|
98
|
-
"text": undefined
|
|
99
|
-
}],
|
|
100
|
-
"text": "The focused state of the radio."
|
|
101
|
-
},
|
|
102
|
-
"attribute": "focused",
|
|
103
|
-
"reflect": true,
|
|
104
|
-
"defaultValue": "false"
|
|
105
|
-
},
|
|
106
|
-
"hidden": {
|
|
107
|
-
"type": "boolean",
|
|
108
|
-
"mutable": false,
|
|
109
|
-
"complexType": {
|
|
110
|
-
"original": "boolean",
|
|
111
|
-
"resolved": "boolean",
|
|
112
|
-
"references": {}
|
|
113
|
-
},
|
|
114
|
-
"required": false,
|
|
115
|
-
"optional": false,
|
|
116
|
-
"docs": {
|
|
117
|
-
"tags": [],
|
|
118
|
-
"text": "The radio's hidden status."
|
|
119
|
-
},
|
|
120
|
-
"attribute": "hidden",
|
|
121
|
-
"reflect": true,
|
|
122
|
-
"defaultValue": "false"
|
|
123
|
-
},
|
|
124
|
-
"hovered": {
|
|
125
|
-
"type": "boolean",
|
|
126
|
-
"mutable": false,
|
|
127
|
-
"complexType": {
|
|
128
|
-
"original": "boolean",
|
|
129
|
-
"resolved": "boolean",
|
|
130
|
-
"references": {}
|
|
131
|
-
},
|
|
132
|
-
"required": false,
|
|
133
|
-
"optional": false,
|
|
134
|
-
"docs": {
|
|
135
|
-
"tags": [{
|
|
136
|
-
"name": "internal",
|
|
137
|
-
"text": undefined
|
|
138
|
-
}],
|
|
139
|
-
"text": "The hovered state of the radio."
|
|
140
|
-
},
|
|
141
|
-
"attribute": "hovered",
|
|
142
|
-
"reflect": true,
|
|
143
|
-
"defaultValue": "false"
|
|
144
|
-
},
|
|
145
|
-
"scale": {
|
|
146
|
-
"type": "string",
|
|
147
|
-
"mutable": false,
|
|
148
|
-
"complexType": {
|
|
149
|
-
"original": "Scale",
|
|
150
|
-
"resolved": "\"l\" | \"m\" | \"s\"",
|
|
151
|
-
"references": {
|
|
152
|
-
"Scale": {
|
|
153
|
-
"location": "import",
|
|
154
|
-
"path": "../interfaces"
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
"required": false,
|
|
159
|
-
"optional": false,
|
|
160
|
-
"docs": {
|
|
161
|
-
"tags": [],
|
|
162
|
-
"text": "The scale (size) of the radio."
|
|
163
|
-
},
|
|
164
|
-
"attribute": "scale",
|
|
165
|
-
"reflect": true,
|
|
166
|
-
"defaultValue": "\"m\""
|
|
167
|
-
}
|
|
168
|
-
}; }
|
|
169
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface CalciteRadio extends Components.CalciteRadio, HTMLElement {}
|
|
4
|
-
export const CalciteRadio: {
|
|
5
|
-
prototype: CalciteRadio;
|
|
6
|
-
new (): CalciteRadio;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
|
-
*/
|
|
5
|
-
import { C as CalciteRadio$1, d as defineCustomElement$1 } from './calcite-radio2.js';
|
|
6
|
-
|
|
7
|
-
const CalciteRadio = CalciteRadio$1;
|
|
8
|
-
const defineCustomElement = defineCustomElement$1;
|
|
9
|
-
|
|
10
|
-
export { CalciteRadio, defineCustomElement };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
|
-
*/
|
|
5
|
-
import { HTMLElement, h, proxyCustomElement } from '@stencil/core/internal/client';
|
|
6
|
-
|
|
7
|
-
const calciteRadioCss = "@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:300ms}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:150ms ease-in-out}:host([hidden]){display:none}:host{display:block}:host .radio{background-color:var(--calcite-ui-foreground-1);border-radius:9999px;cursor:pointer;-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:150ms;transition-duration:150ms;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-box-shadow:inset 0 0 0 1px var(--calcite-ui-border-input);box-shadow:inset 0 0 0 1px var(--calcite-ui-border-input)}:host([hovered]) .radio,:host(:not([checked])[focused]) .radio{-webkit-box-shadow:inset 0 0 0 2px var(--calcite-ui-brand);box-shadow:inset 0 0 0 2px var(--calcite-ui-brand)}:host([disabled]) .radio{cursor:default;opacity:var(--calcite-ui-opacity-disabled)}:host([hovered][disabled]) .radio{-webkit-box-shadow:inset 0 0 0 1px var(--calcite-ui-border-input);box-shadow:inset 0 0 0 1px var(--calcite-ui-border-input)}:host([scale=s]){--calcite-radio-size:var(--calcite-font-size--2)}:host([scale=m]){--calcite-radio-size:var(--calcite-font-size--1)}:host([scale=l]){--calcite-radio-size:var(--calcite-font-size-0)}.radio{height:var(--calcite-radio-size);max-width:var(--calcite-radio-size);min-width:var(--calcite-radio-size)}:host([scale=s][checked]) .radio,:host([hovered][scale=s][checked][disabled]) .radio{-webkit-box-shadow:inset 0 0 0 4px var(--calcite-ui-brand);box-shadow:inset 0 0 0 4px var(--calcite-ui-brand)}:host([scale=s][focused][checked]) .radio{-webkit-box-shadow:inset 0 0 0 4px var(--calcite-ui-brand), 0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand);box-shadow:inset 0 0 0 4px var(--calcite-ui-brand), 0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand)}:host([scale=m][checked]) .radio,:host([hovered][scale=m][checked][disabled]) .radio{-webkit-box-shadow:inset 0 0 0 5px var(--calcite-ui-brand);box-shadow:inset 0 0 0 5px var(--calcite-ui-brand)}:host([scale=m][focused][checked]) .radio{-webkit-box-shadow:inset 0 0 0 5px var(--calcite-ui-brand), 0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand);box-shadow:inset 0 0 0 5px var(--calcite-ui-brand), 0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand)}:host([scale=l][checked]) .radio,:host([hovered][scale=l][checked][disabled]) .radio{-webkit-box-shadow:inset 0 0 0 6px var(--calcite-ui-brand);box-shadow:inset 0 0 0 6px var(--calcite-ui-brand)}:host([scale=l][focused][checked]) .radio{-webkit-box-shadow:inset 0 0 0 6px var(--calcite-ui-brand), 0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand);box-shadow:inset 0 0 0 6px var(--calcite-ui-brand), 0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand)}:host([hidden]){display:none}";
|
|
8
|
-
|
|
9
|
-
let CalciteRadio = class extends HTMLElement {
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
this.__registerHost();
|
|
13
|
-
this.__attachShadow();
|
|
14
|
-
//--------------------------------------------------------------------------
|
|
15
|
-
//
|
|
16
|
-
// Properties
|
|
17
|
-
//
|
|
18
|
-
//--------------------------------------------------------------------------
|
|
19
|
-
/** The checked state of the radio. */
|
|
20
|
-
this.checked = false;
|
|
21
|
-
/** The disabled state of the radio. */
|
|
22
|
-
this.disabled = false;
|
|
23
|
-
/**
|
|
24
|
-
* The focused state of the radio.
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
this.focused = false;
|
|
28
|
-
/** The radio's hidden status. */
|
|
29
|
-
this.hidden = false;
|
|
30
|
-
/**
|
|
31
|
-
* The hovered state of the radio.
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
this.hovered = false;
|
|
35
|
-
/** The scale (size) of the radio. */
|
|
36
|
-
this.scale = "m";
|
|
37
|
-
}
|
|
38
|
-
// --------------------------------------------------------------------------
|
|
39
|
-
//
|
|
40
|
-
// Render Methods
|
|
41
|
-
//
|
|
42
|
-
// --------------------------------------------------------------------------
|
|
43
|
-
render() {
|
|
44
|
-
return h("div", { class: "radio" });
|
|
45
|
-
}
|
|
46
|
-
static get style() { return calciteRadioCss; }
|
|
47
|
-
};
|
|
48
|
-
CalciteRadio = /*@__PURE__*/ proxyCustomElement(CalciteRadio, [1, "calcite-radio", {
|
|
49
|
-
"checked": [516],
|
|
50
|
-
"disabled": [516],
|
|
51
|
-
"focused": [516],
|
|
52
|
-
"hidden": [516],
|
|
53
|
-
"hovered": [516],
|
|
54
|
-
"scale": [513]
|
|
55
|
-
}]);
|
|
56
|
-
function defineCustomElement() {
|
|
57
|
-
if (typeof customElements === "undefined") {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const components = ["calcite-radio"];
|
|
61
|
-
components.forEach(tagName => { switch (tagName) {
|
|
62
|
-
case "calcite-radio":
|
|
63
|
-
if (!customElements.get(tagName)) {
|
|
64
|
-
customElements.define(tagName, CalciteRadio);
|
|
65
|
-
}
|
|
66
|
-
break;
|
|
67
|
-
} });
|
|
68
|
-
}
|
|
69
|
-
defineCustomElement();
|
|
70
|
-
|
|
71
|
-
export { CalciteRadio as C, defineCustomElement as d };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,a,i){function n(t){return t instanceof a?t:new a((function(e){e(t)}))}return new(a||(a=Promise))((function(a,o){function r(t){try{s(i.next(t))}catch(t){o(t)}}function c(t){try{s(i["throw"](t))}catch(t){o(t)}}function s(t){t.done?a(t.value):n(t.value).then(r,c)}s((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,r;return r={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function c(t){return function(e){return s([t,e])}}function s(r){if(i)throw new TypeError("Generator is already executing.");while(a)try{if(i=1,n&&(o=r[0]&2?n["return"]:r[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,r[1])).done)return o;if(n=0,o)r=[r[0]&2,o.value];switch(r[0]){case 0:case 1:o=r;break;case 4:a.label++;return{value:r[1],done:false};case 5:a.label++;n=r[1];r=[0];continue;case 7:r=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(r[0]===6||r[0]===2)){a=0;continue}if(r[0]===3&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(r[0]===6&&a.label<o[1]){a.label=o[1];o=r;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(r);break}if(o[2])a.ops.pop();a.trys.pop();continue}r=e.call(t,a)}catch(t){r=[6,t];n=0}finally{i=o=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};
|
|
2
|
-
/*!
|
|
3
|
-
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
4
|
-
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
5
|
-
*/import{r as registerInstance,h,c as createEvent,H as Host,g as getElement}from"./index-9de00868.js";import{g as guid}from"./guid-196bd5ea.js";import{a as getElementStyleDir,f as focusElement}from"./dom-dc012a45.js";import{c as connectLabel,d as disconnectLabel,g as getLabelText}from"./label-0d804a87.js";import{c as connectForm,d as disconnectForm,H as HiddenFormInputSlot}from"./form-6b717ce8.js";import{g as getRoundRobinIndex}from"./array-91a648e2.js";var calciteRadioCss="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:300ms}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:150ms ease-in-out}:host([hidden]){display:none}:host{display:block}:host .radio{background-color:var(--calcite-ui-foreground-1);border-radius:9999px;cursor:pointer;-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:150ms;transition-duration:150ms;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-box-shadow:inset 0 0 0 1px var(--calcite-ui-border-input);box-shadow:inset 0 0 0 1px var(--calcite-ui-border-input)}:host([hovered]) .radio,:host(:not([checked])[focused]) .radio{-webkit-box-shadow:inset 0 0 0 2px var(--calcite-ui-brand);box-shadow:inset 0 0 0 2px var(--calcite-ui-brand)}:host([disabled]) .radio{cursor:default;opacity:var(--calcite-ui-opacity-disabled)}:host([hovered][disabled]) .radio{-webkit-box-shadow:inset 0 0 0 1px var(--calcite-ui-border-input);box-shadow:inset 0 0 0 1px var(--calcite-ui-border-input)}:host([scale=s]){--calcite-radio-size:var(--calcite-font-size--2)}:host([scale=m]){--calcite-radio-size:var(--calcite-font-size--1)}:host([scale=l]){--calcite-radio-size:var(--calcite-font-size-0)}.radio{height:var(--calcite-radio-size);max-width:var(--calcite-radio-size);min-width:var(--calcite-radio-size)}:host([scale=s][checked]) .radio,:host([hovered][scale=s][checked][disabled]) .radio{-webkit-box-shadow:inset 0 0 0 4px var(--calcite-ui-brand);box-shadow:inset 0 0 0 4px var(--calcite-ui-brand)}:host([scale=s][focused][checked]) .radio{-webkit-box-shadow:inset 0 0 0 4px var(--calcite-ui-brand), 0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand);box-shadow:inset 0 0 0 4px var(--calcite-ui-brand), 0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand)}:host([scale=m][checked]) .radio,:host([hovered][scale=m][checked][disabled]) .radio{-webkit-box-shadow:inset 0 0 0 5px var(--calcite-ui-brand);box-shadow:inset 0 0 0 5px var(--calcite-ui-brand)}:host([scale=m][focused][checked]) .radio{-webkit-box-shadow:inset 0 0 0 5px var(--calcite-ui-brand), 0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand);box-shadow:inset 0 0 0 5px var(--calcite-ui-brand), 0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand)}:host([scale=l][checked]) .radio,:host([hovered][scale=l][checked][disabled]) .radio{-webkit-box-shadow:inset 0 0 0 6px var(--calcite-ui-brand);box-shadow:inset 0 0 0 6px var(--calcite-ui-brand)}:host([scale=l][focused][checked]) .radio{-webkit-box-shadow:inset 0 0 0 6px var(--calcite-ui-brand), 0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand);box-shadow:inset 0 0 0 6px var(--calcite-ui-brand), 0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand)}:host([hidden]){display:none}";var CalciteRadio=function(){function t(t){registerInstance(this,t);this.checked=false;this.disabled=false;this.focused=false;this.hidden=false;this.hovered=false;this.scale="m"}t.prototype.render=function(){return h("div",{class:"radio"})};return t}();CalciteRadio.style=calciteRadioCss;var CSS={container:"container"};var calciteRadioButtonCss="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:300ms}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:150ms ease-in-out}:host([hidden]){display:none}:host{cursor:pointer;display:block}:host .container{position:relative;outline:2px solid transparent;outline-offset:2px}:host([disabled]){cursor:pointer}::slotted(input[slot=hidden-form-input]){bottom:0 !important;left:0 !important;margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;right:0 !important;top:0 !important;-webkit-transform:none !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}";var CalciteRadioButton=function(){function t(t){var e=this;registerInstance(this,t);this.calciteInternalRadioButtonBlur=createEvent(this,"calciteInternalRadioButtonBlur",7);this.calciteRadioButtonChange=createEvent(this,"calciteRadioButtonChange",7);this.calciteInternalRadioButtonCheckedChange=createEvent(this,"calciteInternalRadioButtonCheckedChange",7);this.calciteInternalRadioButtonFocus=createEvent(this,"calciteInternalRadioButtonFocus",7);this.checked=false;this.disabled=false;this.focused=false;this.hidden=false;this.hovered=false;this.required=false;this.scale="m";this.selectItem=function(t,e){t[e].click()};this.queryButtons=function(){return Array.from(e.rootNode.querySelectorAll("calcite-radio-button:not([hidden]")).filter((function(t){return t.name===e.name}))};this.isDefaultSelectable=function(){var t=e.queryButtons();return!t.some((function(t){return t.checked}))&&t[0]===e.el};this.check=function(){if(e.disabled){return}e.uncheckAllRadioButtonsInGroup();e.checked=true;e.calciteRadioButtonChange.emit();e.setFocus()};this.clickHandler=function(){e.check()};this.setContainerEl=function(t){e.containerEl=t};this.handleKeyDown=function(t){var a=["ArrowLeft","ArrowUp","ArrowRight","ArrowDown"," "];var i=t.key;var n=e.el;if(a.indexOf(i)===-1){return}if(i===" "){e.check();return}var o=i;if(getElementStyleDir(n)==="rtl"){if(i==="ArrowRight"){o="ArrowLeft"}if(i==="ArrowLeft"){o="ArrowRight"}}var r=Array.from(e.rootNode.querySelectorAll("calcite-radio-button:not([hidden]")).filter((function(t){return t.name===e.name}));var c=0;var s=r.length;r.some((function(t,e){if(t.checked){c=e;return true}}));switch(o){case"ArrowLeft":case"ArrowUp":t.preventDefault();e.selectItem(r,getRoundRobinIndex(Math.max(c-1,-1),s));return;case"ArrowRight":case"ArrowDown":t.preventDefault();e.selectItem(r,getRoundRobinIndex(c+1,s));return;default:return}};this.onContainerBlur=function(){e.focused=false;e.calciteInternalRadioButtonBlur.emit()};this.onContainerFocus=function(){e.focused=true;e.calciteInternalRadioButtonFocus.emit()}}t.prototype.checkedChanged=function(t){if(t){this.uncheckOtherRadioButtonsInGroup()}this.calciteInternalRadioButtonCheckedChange.emit(t)};t.prototype.nameChanged=function(){this.checkLastRadioButton();var t=this.rootNode.querySelector('input[name="'+this.name+'"]:checked');if(!(t===null||t===void 0?void 0:t.value)){this.uncheckAllRadioButtonsInGroup()}};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){focusElement(this.containerEl);return[2]}))}))};t.prototype.onLabelClick=function(t){if(!this.disabled&&!this.hidden){this.uncheckOtherRadioButtonsInGroup();var e=t.currentTarget;var a=e.for?this.rootNode.querySelector('calcite-radio-button[id="'+e.for+'"]'):e.querySelector('calcite-radio-button[name="'+this.name+'"]');if(a){a.checked=true;a.focused=true}this.calciteRadioButtonChange.emit();this.setFocus()}};t.prototype.checkLastRadioButton=function(){var t=this.queryButtons();var e=t.filter((function(t){return t.checked}));if((e===null||e===void 0?void 0:e.length)>1){var a=e[e.length-1];e.filter((function(t){return t!==a})).forEach((function(t){t.checked=false;t.emitCheckedChange()}))}};t.prototype.emitCheckedChange=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.calciteInternalRadioButtonCheckedChange.emit();return[2]}))}))};t.prototype.uncheckAllRadioButtonsInGroup=function(){var t=this.queryButtons();t.forEach((function(t){if(t.checked){t.checked=false;t.focused=false}}))};t.prototype.uncheckOtherRadioButtonsInGroup=function(){var t=this;var e=this.queryButtons();var a=e.filter((function(e){return e.guid!==t.guid}));a.forEach((function(t){if(t.checked){t.checked=false;t.focused=false}}))};t.prototype.mouseenter=function(){this.hovered=true};t.prototype.mouseleave=function(){this.hovered=false};t.prototype.connectedCallback=function(){this.rootNode=this.el.getRootNode();this.guid=this.el.id||"calcite-radio-button-"+guid();if(this.name){this.checkLastRadioButton()}connectLabel(this);connectForm(this)};t.prototype.componentDidLoad=function(){if(this.focused){this.setFocus()}};t.prototype.disconnectedCallback=function(){disconnectLabel(this);disconnectForm(this)};t.prototype.render=function(){return h(Host,{onClick:this.clickHandler,onKeyDown:this.handleKeyDown},h("div",{"aria-checked":this.checked.toString(),"aria-label":getLabelText(this),class:CSS.container,onBlur:this.onContainerBlur,onFocus:this.onContainerFocus,ref:this.setContainerEl,role:"radio",tabIndex:this.checked||this.isDefaultSelectable()?0:-1},h("calcite-radio",{checked:this.checked,disabled:this.disabled,focused:this.focused,hidden:this.hidden,hovered:this.hovered,scale:this.scale})),h(HiddenFormInputSlot,{component:this}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{checked:["checkedChanged"],name:["nameChanged"]}},enumerable:false,configurable:true});return t}();CalciteRadioButton.style=calciteRadioButtonCss;export{CalciteRadio as calcite_radio,CalciteRadioButton as calcite_radio_button};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Scale } from "../interfaces";
|
|
2
|
-
export declare class CalciteRadio {
|
|
3
|
-
/** The checked state of the radio. */
|
|
4
|
-
checked: boolean;
|
|
5
|
-
/** The disabled state of the radio. */
|
|
6
|
-
disabled: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* The focused state of the radio.
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
focused: boolean;
|
|
12
|
-
/** The radio's hidden status. */
|
|
13
|
-
hidden: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* The hovered state of the radio.
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
hovered: boolean;
|
|
19
|
-
/** The scale (size) of the radio. */
|
|
20
|
-
scale: Scale;
|
|
21
|
-
render(): any;
|
|
22
|
-
}
|