@esri/calcite-components 1.0.0-next.341 → 1.0.0-next.345
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/assets/calcite-icon/explore16.json +1 -0
- package/dist/calcite/assets/calcite-icon/explore24.json +1 -0
- package/dist/calcite/assets/calcite-icon/explore32.json +1 -0
- package/dist/calcite/assets/calcite-icon/partlyCloudy16.json +1 -0
- package/dist/calcite/assets/calcite-icon/partlyCloudy24.json +1 -0
- package/dist/calcite/assets/calcite-icon/partlyCloudy32.json +1 -0
- package/dist/calcite/assets/calcite-icon/screenshotMode16.json +1 -0
- package/dist/calcite/assets/calcite-icon/screenshotMode24.json +1 -0
- package/dist/calcite/assets/calcite-icon/screenshotMode32.json +1 -0
- package/dist/calcite/calcite.esm.js +1 -1
- package/dist/calcite/p-0b2ac5d7.system.entry.js +5 -0
- package/dist/calcite/{p-4e9d072a.system.js → p-11b9e4bb.system.js} +1 -1
- package/dist/calcite/{p-1cbe69ff.system.entry.js → p-11f99edf.system.entry.js} +1 -1
- package/dist/calcite/p-12a2f2d9.entry.js +5 -0
- package/dist/calcite/p-18c4af8f.system.js +5 -0
- package/dist/calcite/p-18d9a261.system.js +1 -1
- package/dist/calcite/p-197226fa.entry.js +5 -0
- package/dist/calcite/{p-456fc41f.system.entry.js → p-224a5f8d.system.entry.js} +1 -1
- package/dist/calcite/p-35aa821f.entry.js +5 -0
- package/dist/calcite/{p-8554d028.system.entry.js → p-41cd5de3.system.entry.js} +1 -1
- package/dist/calcite/{p-6662658a.system.entry.js → p-496a04e4.system.entry.js} +1 -1
- package/dist/calcite/{p-cc247988.entry.js → p-520f90ae.entry.js} +1 -1
- package/dist/calcite/{p-ee5aabd7.entry.js → p-527dfb9d.entry.js} +1 -1
- package/dist/calcite/{p-d3bd900e.js → p-52966b4c.js} +1 -1
- package/dist/calcite/{p-c4b4312c.entry.js → p-531ddede.entry.js} +1 -1
- package/dist/calcite/{p-fbcf0cdb.system.entry.js → p-61c25508.system.entry.js} +1 -1
- package/dist/calcite/p-6436b89b.system.entry.js +5 -0
- package/dist/calcite/p-68c5432f.entry.js +5 -0
- package/dist/calcite/{p-8376e39b.entry.js → p-82d19468.entry.js} +1 -1
- package/dist/calcite/{p-4f7ebefc.system.js → p-834ec82a.system.js} +1 -1
- package/dist/calcite/{p-e7f7b0f8.js → p-8396a2d2.js} +1 -1
- package/dist/calcite/{p-14744d7b.system.entry.js → p-8dc9c530.system.entry.js} +1 -1
- package/dist/calcite/p-91300144.js +5 -0
- package/dist/calcite/{p-5c6f2de9.system.entry.js → p-afd8eb90.system.entry.js} +1 -1
- package/dist/calcite/{p-e7577455.entry.js → p-b28560f2.entry.js} +1 -1
- package/dist/calcite/p-e33346fd.system.entry.js +5 -0
- package/dist/calcite/p-ea59c57b.entry.js +5 -0
- package/dist/cjs/calcite-avatar.cjs.entry.js +1 -1
- package/dist/cjs/calcite-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/calcite-date-picker_4.cjs.entry.js +3 -3
- package/dist/cjs/calcite-input-date-picker.cjs.entry.js +3 -3
- package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/calcite-input.cjs.entry.js +10 -9
- package/dist/cjs/calcite-radio-button.cjs.entry.js +17 -6
- package/dist/cjs/calcite-radio-group_2.cjs.entry.js +0 -45
- package/dist/cjs/calcite-tile-select_2.cjs.entry.js +37 -2
- package/dist/cjs/calcite-tile.cjs.entry.js +1 -1
- package/dist/cjs/{locale-33c458dc.js → locale-ccfa66f6.js} +1 -1
- package/dist/cjs/{number-73f7b474.js → number-f57fd111.js} +13 -6
- package/dist/cjs/{resources-16974e48.js → resources-d3c42dc4.js} +1 -1
- package/dist/collection/components/calcite-avatar/calcite-avatar.css +1 -3
- package/dist/collection/components/calcite-checkbox/calcite-checkbox.js +1 -1
- package/dist/collection/components/calcite-icon/assets/calcite-icon/explore16.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/explore24.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/explore32.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/partlyCloudy16.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/partlyCloudy24.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/partlyCloudy32.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/screenshotMode16.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/screenshotMode24.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/screenshotMode32.json +1 -0
- package/dist/collection/components/calcite-input/calcite-input.js +8 -7
- package/dist/collection/components/calcite-radio-button/calcite-radio-button.css +4 -4
- package/dist/collection/components/calcite-radio-button/calcite-radio-button.js +16 -5
- package/dist/collection/components/calcite-radio-group-item/calcite-radio-group-item.js +0 -45
- package/dist/collection/components/calcite-tile/calcite-tile.css +37 -49
- package/dist/collection/components/calcite-tile-select/calcite-tile-select.css +50 -70
- package/dist/collection/components/calcite-tile-select/calcite-tile-select.js +21 -2
- package/dist/collection/components/calcite-tile-select/resources.js +20 -0
- package/dist/collection/utils/number.js +13 -6
- package/dist/components/calcite-avatar.js +1 -1
- package/dist/components/calcite-checkbox2.js +1 -1
- package/dist/components/calcite-input2.js +8 -7
- package/dist/components/calcite-radio-button.js +17 -6
- package/dist/components/calcite-radio-group-item.js +0 -45
- package/dist/components/calcite-tile-select.js +37 -2
- package/dist/components/calcite-tile2.js +1 -1
- package/dist/components/number.js +13 -6
- package/dist/custom-elements/index.js +333 -323
- package/dist/esm/calcite-avatar.entry.js +1 -1
- package/dist/esm/calcite-checkbox.entry.js +1 -1
- package/dist/esm/calcite-date-picker_4.entry.js +3 -3
- package/dist/esm/calcite-input-date-picker.entry.js +3 -3
- package/dist/esm/calcite-input-time-picker_2.entry.js +1 -1
- package/dist/esm/calcite-input.entry.js +10 -9
- package/dist/esm/calcite-radio-button.entry.js +17 -6
- package/dist/esm/calcite-radio-group_2.entry.js +0 -45
- package/dist/esm/calcite-tile-select_2.entry.js +37 -2
- package/dist/esm/calcite-tile.entry.js +1 -1
- package/dist/esm/{locale-4c38cf6d.js → locale-86b789f9.js} +1 -1
- package/dist/esm/{number-06e8500e.js → number-eb92427e.js} +13 -6
- package/dist/esm/{resources-b4eee1d4.js → resources-421133b2.js} +1 -1
- package/dist/esm-es5/calcite-avatar.entry.js +1 -1
- package/dist/esm-es5/calcite-checkbox.entry.js +1 -1
- package/dist/esm-es5/calcite-date-picker_4.entry.js +1 -1
- package/dist/esm-es5/calcite-input-date-picker.entry.js +1 -1
- package/dist/esm-es5/calcite-input-time-picker_2.entry.js +1 -1
- package/dist/esm-es5/calcite-input.entry.js +1 -1
- package/dist/esm-es5/calcite-radio-button.entry.js +1 -1
- package/dist/esm-es5/calcite-radio-group_2.entry.js +1 -1
- package/dist/esm-es5/calcite-tile-select_2.entry.js +2 -2
- package/dist/esm-es5/calcite-tile.entry.js +1 -1
- package/dist/esm-es5/{locale-4c38cf6d.js → locale-86b789f9.js} +1 -1
- package/dist/esm-es5/number-eb92427e.js +5 -0
- package/dist/esm-es5/{resources-b4eee1d4.js → resources-421133b2.js} +1 -1
- package/dist/extras/docs-json.json +1 -1
- package/dist/types/components/calcite-radio-button/calcite-radio-button.d.ts +1 -0
- package/dist/types/components/calcite-radio-group-item/calcite-radio-group-item.d.ts +0 -6
- package/dist/types/components/calcite-tile-select/resources.d.ts +16 -0
- package/hydrate/index.js +333 -323
- package/package.json +10 -10
- package/dist/calcite/p-04417e11.system.entry.js +0 -5
- package/dist/calcite/p-66146f19.entry.js +0 -5
- package/dist/calcite/p-6ba77bae.entry.js +0 -5
- package/dist/calcite/p-83744979.system.js +0 -5
- package/dist/calcite/p-cc2166e7.system.entry.js +0 -5
- package/dist/calcite/p-d00824e4.system.entry.js +0 -5
- package/dist/calcite/p-d506cebd.entry.js +0 -5
- package/dist/calcite/p-d75a285d.entry.js +0 -5
- package/dist/calcite/p-e81cda9d.entry.js +0 -5
- package/dist/calcite/p-f595d924.js +0 -5
- package/dist/esm-es5/number-06e8500e.js +0 -5
|
@@ -88,46 +88,13 @@
|
|
|
88
88
|
transition-duration: 150ms;
|
|
89
89
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
:host(:not([embed])) {
|
|
93
|
-
padding: 0.75rem;
|
|
94
|
-
box-shadow: 0 0 0 1px var(--calcite-ui-border-2);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
:host(:not([embed])[href]:hover) {
|
|
98
|
-
cursor: pointer;
|
|
99
|
-
box-shadow: 0 0 0 2px var(--calcite-ui-brand);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
:host(:not([embed])[href]:active) {
|
|
103
|
-
box-shadow: 0 0 0 3px var(--calcite-ui-brand);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
:host([icon][heading]:not([description]):not([embed])) {
|
|
107
|
-
padding: 0px;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
:host([icon][heading]:not([description])) .icon {
|
|
111
|
-
display: flex;
|
|
112
|
-
justify-content: center;
|
|
113
|
-
}
|
|
114
|
-
:host([icon][heading]:not([description])) .large-visual {
|
|
115
|
-
text-align: center;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
:host([disabled]) {
|
|
119
|
-
opacity: var(--calcite-ui-opacity-disabled);
|
|
120
|
-
pointer-events: none;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.container {
|
|
91
|
+
:host .container {
|
|
124
92
|
pointer-events: none;
|
|
125
93
|
display: grid;
|
|
126
94
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
127
95
|
gap: 0.5rem;
|
|
128
96
|
}
|
|
129
|
-
|
|
130
|
-
.content {
|
|
97
|
+
:host .content {
|
|
131
98
|
display: flex;
|
|
132
99
|
flex: 1 1 auto;
|
|
133
100
|
flex-direction: column;
|
|
@@ -135,8 +102,7 @@
|
|
|
135
102
|
gap: 0.5rem;
|
|
136
103
|
width: 10%;
|
|
137
104
|
}
|
|
138
|
-
|
|
139
|
-
.content-container {
|
|
105
|
+
:host .content-container {
|
|
140
106
|
display: flex;
|
|
141
107
|
width: 100%;
|
|
142
108
|
flex: 1 1 auto;
|
|
@@ -147,20 +113,18 @@
|
|
|
147
113
|
outline-color: transparent;
|
|
148
114
|
transition: outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;
|
|
149
115
|
}
|
|
150
|
-
|
|
151
|
-
.content-slot-container {
|
|
116
|
+
:host .content-slot-container {
|
|
152
117
|
display: flex;
|
|
153
118
|
align-items: center;
|
|
154
119
|
background-color: var(--calcite-ui-foreground-1);
|
|
155
120
|
}
|
|
156
|
-
.content-slot-container:first-child {
|
|
121
|
+
:host .content-slot-container:first-child {
|
|
157
122
|
padding-right: 0.75rem;
|
|
158
123
|
}
|
|
159
|
-
.content-slot-container:last-child {
|
|
124
|
+
:host .content-slot-container:last-child {
|
|
160
125
|
padding-left: 0.75rem;
|
|
161
126
|
}
|
|
162
|
-
|
|
163
|
-
.heading {
|
|
127
|
+
:host .heading {
|
|
164
128
|
pointer-events: none;
|
|
165
129
|
overflow-wrap: break-word;
|
|
166
130
|
font-size: var(--calcite-font-size--1);
|
|
@@ -170,19 +134,20 @@
|
|
|
170
134
|
transition-duration: 150ms;
|
|
171
135
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
172
136
|
}
|
|
173
|
-
|
|
174
|
-
.large-visual {
|
|
137
|
+
:host .large-visual {
|
|
175
138
|
align-items: center;
|
|
139
|
+
text-align: center;
|
|
176
140
|
min-height: 12rem;
|
|
177
141
|
}
|
|
178
|
-
.large-visual .icon {
|
|
142
|
+
:host .large-visual .icon {
|
|
143
|
+
display: flex;
|
|
144
|
+
justify-content: center;
|
|
179
145
|
align-self: flex-end;
|
|
180
146
|
}
|
|
181
|
-
.large-visual .content-container {
|
|
147
|
+
:host .large-visual .content-container {
|
|
182
148
|
align-self: center;
|
|
183
149
|
}
|
|
184
|
-
|
|
185
|
-
.description {
|
|
150
|
+
:host .description {
|
|
186
151
|
pointer-events: none;
|
|
187
152
|
font-size: var(--calcite-font-size--2);
|
|
188
153
|
line-height: 1.375;
|
|
@@ -191,6 +156,29 @@
|
|
|
191
156
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
192
157
|
}
|
|
193
158
|
|
|
159
|
+
:host(:not([embed])) {
|
|
160
|
+
padding: 0.75rem;
|
|
161
|
+
box-shadow: 0 0 0 1px var(--calcite-ui-border-2);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:host(:not([embed])[href]:hover) {
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
box-shadow: 0 0 0 2px var(--calcite-ui-brand);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
:host(:not([embed])[href]:active) {
|
|
170
|
+
box-shadow: 0 0 0 3px var(--calcite-ui-brand);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
:host([icon][heading]:not([description]):not([embed])) {
|
|
174
|
+
padding: 0px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
:host([disabled]) {
|
|
178
|
+
opacity: var(--calcite-ui-opacity-disabled);
|
|
179
|
+
pointer-events: none;
|
|
180
|
+
}
|
|
181
|
+
|
|
194
182
|
:host(:hover) .heading, :host([active]) .heading {
|
|
195
183
|
color: var(--calcite-ui-text-1);
|
|
196
184
|
}
|
|
@@ -78,7 +78,10 @@
|
|
|
78
78
|
display: none;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
:host {
|
|
82
|
+
display: block;
|
|
83
|
+
}
|
|
84
|
+
:host .container {
|
|
82
85
|
background-color: var(--calcite-ui-foreground-1);
|
|
83
86
|
box-shadow: 0 0 0 1px var(--calcite-ui-border-2);
|
|
84
87
|
box-sizing: border-box;
|
|
@@ -92,47 +95,14 @@
|
|
|
92
95
|
vertical-align: top;
|
|
93
96
|
z-index: 10;
|
|
94
97
|
}
|
|
95
|
-
|
|
96
|
-
:host {
|
|
97
|
-
display: block;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
:host(:hover) .root {
|
|
101
|
-
z-index: 20;
|
|
102
|
-
box-shadow: 0 0 0 1px var(--calcite-ui-border-1);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
:host([checked]) .root {
|
|
106
|
-
z-index: 30;
|
|
107
|
-
box-shadow: 0 0 0 1px var(--calcite-ui-brand);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.root.focused {
|
|
98
|
+
:host .container.checked {
|
|
111
99
|
z-index: 30;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
:host(:not([input-enabled]):hover) .root {
|
|
115
100
|
box-shadow: 0 0 0 1px var(--calcite-ui-brand);
|
|
116
101
|
}
|
|
117
|
-
|
|
118
|
-
:
|
|
119
|
-
box-shadow: 0 0 0 1px var(--calcite-ui-brand), inset 0 0 0 2px var(--calcite-ui-foreground-1), inset 0 0 0 5px var(--calcite-ui-brand);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
:host([width=full]) .root {
|
|
123
|
-
display: flex;
|
|
124
|
-
max-width: none;
|
|
125
|
-
}
|
|
126
|
-
:host([width=full]) calcite-tile {
|
|
127
|
-
flex: 1 1 auto;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
:host([input-alignment=start][width=full]) calcite-tile {
|
|
131
|
-
order: 1;
|
|
132
|
-
margin-inline-start: 0.75rem;
|
|
102
|
+
:host .container.heading-only {
|
|
103
|
+
align-items: center;
|
|
133
104
|
}
|
|
134
|
-
|
|
135
|
-
:host(:not([input-enabled])) ::slotted(calcite-checkbox), :host(:not([input-enabled])) ::slotted(calcite-radio-button) {
|
|
105
|
+
:host .container:not(.input-enabled) ::slotted(calcite-checkbox), :host .container:not(.input-enabled) ::slotted(calcite-radio-button) {
|
|
136
106
|
position: absolute;
|
|
137
107
|
width: 1px;
|
|
138
108
|
height: 1px;
|
|
@@ -143,54 +113,64 @@
|
|
|
143
113
|
white-space: nowrap;
|
|
144
114
|
border-width: 0;
|
|
145
115
|
}
|
|
146
|
-
|
|
147
|
-
:
|
|
148
|
-
align-items: center;
|
|
116
|
+
:host .container.focused:not(.disabled) {
|
|
117
|
+
z-index: 30;
|
|
149
118
|
}
|
|
150
|
-
|
|
151
|
-
:
|
|
152
|
-
|
|
119
|
+
:host .container.focused:not(.disabled):not(.input-enabled) {
|
|
120
|
+
box-shadow: 0 0 0 1px var(--calcite-ui-brand), inset 0 0 0 2px var(--calcite-ui-foreground-1), inset 0 0 0 5px var(--calcite-ui-brand);
|
|
121
|
+
}
|
|
122
|
+
:host .container.input-enabled.input-alignment-start.width-auto.heading-only, :host .container.input-enabled.input-alignment-start.width-auto.icon-only, :host .container.input-enabled.input-alignment-start.width-auto.description-only, :host .container.input-enabled.input-alignment-start.width-auto.heading.description, :host .container.input-enabled.input-alignment-start.width-auto.icon.description, :host .container.input-enabled.input-alignment-start.width-auto.heading.icon.description {
|
|
153
123
|
display: inline-grid;
|
|
154
|
-
grid-gap: 0.75rem;
|
|
155
124
|
grid-template-columns: max-content 1fr;
|
|
156
125
|
}
|
|
157
|
-
:host
|
|
158
|
-
:
|
|
159
|
-
:host([width=auto][input-enabled][input-alignment=start]:not([icon])[heading]:not([description])) ::slotted(calcite-checkbox),
|
|
160
|
-
:host([width=auto][input-enabled][input-alignment=start]:not([icon])[heading]:not([description])) ::slotted(calcite-radio-button) {
|
|
161
|
-
order: 0;
|
|
126
|
+
:host .container.input-enabled.input-alignment-start.heading-only, :host .container.input-enabled.input-alignment-start.icon-only, :host .container.input-enabled.input-alignment-start.description-only, :host .container.input-enabled.input-alignment-start.heading.description, :host .container.input-enabled.input-alignment-start.icon.description, :host .container.input-enabled.input-alignment-start.heading.icon.description {
|
|
127
|
+
gap: 0.75rem;
|
|
162
128
|
}
|
|
163
|
-
:host
|
|
164
|
-
:host([width=auto][input-enabled][input-alignment=start]:not([icon])[heading]:not([description])) calcite-tile {
|
|
129
|
+
:host .container.input-enabled.input-alignment-start calcite-tile {
|
|
165
130
|
order: 1;
|
|
166
131
|
}
|
|
167
|
-
|
|
168
|
-
:host
|
|
169
|
-
:host([input-enabled][input-alignment=start][icon][heading]:not([description])) ::slotted(calcite-radio-button) {
|
|
132
|
+
:host .container.input-enabled.input-alignment-start.large-visual ::slotted(calcite-checkbox),
|
|
133
|
+
:host .container.input-enabled.input-alignment-start.large-visual ::slotted(calcite-radio-button) {
|
|
170
134
|
position: absolute;
|
|
171
|
-
|
|
135
|
+
inset-block-start: 0.75rem;
|
|
172
136
|
inset-inline-start: 0.75rem;
|
|
173
137
|
}
|
|
174
|
-
|
|
175
|
-
:host([input-enabled][input-alignment=end][icon][heading]) ::slotted(calcite-checkbox),
|
|
176
|
-
:host([input-enabled][input-alignment=end][icon][heading]) ::slotted(calcite-radio-button) {
|
|
177
|
-
position: absolute;
|
|
178
|
-
top: 0.75rem;
|
|
179
|
-
inset-inline-end: 0.75rem;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
:host([input-enabled][input-alignment=end][heading]:not([icon]):not([description])) .root {
|
|
138
|
+
:host .container.input-enabled.input-alignment-end.width-auto.heading-only, :host .container.input-enabled.input-alignment-end.width-auto.icon-only {
|
|
183
139
|
display: inline-grid;
|
|
184
140
|
grid-gap: 0.75rem;
|
|
185
141
|
grid-template-columns: max-content 1fr;
|
|
186
142
|
}
|
|
187
|
-
:host
|
|
188
|
-
:
|
|
189
|
-
|
|
143
|
+
:host .container.input-enabled.input-alignment-end.heading-only, :host .container.input-enabled.input-alignment-end.icon-only {
|
|
144
|
+
gap: 0.75rem;
|
|
145
|
+
}
|
|
146
|
+
:host .container.input-enabled.input-alignment-end.description-only ::slotted(calcite-checkbox),
|
|
147
|
+
:host .container.input-enabled.input-alignment-end.description-only ::slotted(calcite-radio-button), :host .container.input-enabled.input-alignment-end.heading.description ::slotted(calcite-checkbox),
|
|
148
|
+
:host .container.input-enabled.input-alignment-end.heading.description ::slotted(calcite-radio-button), :host .container.input-enabled.input-alignment-end.icon.description ::slotted(calcite-checkbox),
|
|
149
|
+
:host .container.input-enabled.input-alignment-end.icon.description ::slotted(calcite-radio-button), :host .container.input-enabled.input-alignment-end.heading.icon.description ::slotted(calcite-checkbox),
|
|
150
|
+
:host .container.input-enabled.input-alignment-end.heading.icon.description ::slotted(calcite-radio-button) {
|
|
151
|
+
position: absolute;
|
|
152
|
+
inset-block-start: 0.75rem;
|
|
153
|
+
inset-inline-end: 0.75rem;
|
|
154
|
+
}
|
|
155
|
+
:host .container.input-enabled.input-alignment-end.large-visual ::slotted(calcite-checkbox),
|
|
156
|
+
:host .container.input-enabled.input-alignment-end.large-visual ::slotted(calcite-radio-button) {
|
|
157
|
+
position: absolute;
|
|
158
|
+
inset-block-start: 0.75rem;
|
|
159
|
+
inset-inline-end: 0.75rem;
|
|
160
|
+
}
|
|
161
|
+
:host .container.width-full {
|
|
162
|
+
display: flex;
|
|
163
|
+
max-width: none;
|
|
164
|
+
}
|
|
165
|
+
:host .container.width-full calcite-tile {
|
|
166
|
+
flex: 1 1 auto;
|
|
190
167
|
}
|
|
191
168
|
|
|
192
|
-
:host(
|
|
193
|
-
|
|
169
|
+
:host(:hover) .container {
|
|
170
|
+
z-index: 20;
|
|
171
|
+
}
|
|
172
|
+
:host(:hover) .container:not(.input-enabled) {
|
|
173
|
+
box-shadow: 0 0 0 1px var(--calcite-ui-brand);
|
|
194
174
|
}
|
|
195
175
|
|
|
196
176
|
:host([disabled]) {
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Component, Element, Event, h, Prop, Listen, Watch, State, Method } from "@stencil/core";
|
|
6
6
|
import { guid } from "../../utils/guid";
|
|
7
|
+
import { CSS } from "./resources";
|
|
7
8
|
/**
|
|
8
9
|
* @slot - A slot for adding custom content.
|
|
9
10
|
*/
|
|
@@ -149,8 +150,26 @@ export class CalciteTileSelect {
|
|
|
149
150
|
this.el.insertAdjacentElement("beforeend", this.input);
|
|
150
151
|
}
|
|
151
152
|
render() {
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
const { checked, description, disabled, focused, heading, icon, inputAlignment, inputEnabled, width } = this;
|
|
154
|
+
return (h("div", { class: {
|
|
155
|
+
checked,
|
|
156
|
+
container: true,
|
|
157
|
+
[CSS.description]: Boolean(description),
|
|
158
|
+
[CSS.descriptionOnly]: Boolean(!heading && !icon && description),
|
|
159
|
+
disabled,
|
|
160
|
+
focused,
|
|
161
|
+
[CSS.heading]: Boolean(heading),
|
|
162
|
+
[CSS.headingOnly]: heading && !icon && !description,
|
|
163
|
+
[CSS.icon]: Boolean(icon),
|
|
164
|
+
[CSS.iconOnly]: !heading && icon && !description,
|
|
165
|
+
[CSS.inputAlignmentEnd]: inputAlignment === "end",
|
|
166
|
+
[CSS.inputAlignmentStart]: inputAlignment === "start",
|
|
167
|
+
[CSS.inputEnabled]: inputEnabled,
|
|
168
|
+
[CSS.largeVisual]: heading && icon && !description,
|
|
169
|
+
[CSS.widthAuto]: width === "auto",
|
|
170
|
+
[CSS.widthFull]: width === "full"
|
|
171
|
+
} },
|
|
172
|
+
h("calcite-tile", { active: checked, description: description, embed: true, heading: heading, icon: icon }),
|
|
154
173
|
h("slot", null)));
|
|
155
174
|
}
|
|
156
175
|
static get is() { return "calcite-tile-select"; }
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
export const CSS = {
|
|
6
|
+
checked: "checked",
|
|
7
|
+
description: "description",
|
|
8
|
+
descriptionOnly: "description-only",
|
|
9
|
+
disabled: "disabled",
|
|
10
|
+
heading: "heading",
|
|
11
|
+
headingOnly: "heading-only",
|
|
12
|
+
icon: "icon",
|
|
13
|
+
iconOnly: "icon-only",
|
|
14
|
+
inputAlignmentEnd: "input-alignment-end",
|
|
15
|
+
inputAlignmentStart: "input-alignment-start",
|
|
16
|
+
inputEnabled: "input-enabled",
|
|
17
|
+
largeVisual: "large-visual",
|
|
18
|
+
widthAuto: "width-auto",
|
|
19
|
+
widthFull: "width-full"
|
|
20
|
+
};
|
|
@@ -8,7 +8,7 @@ export function isValidNumber(numberString) {
|
|
|
8
8
|
}
|
|
9
9
|
export function parseNumberString(numberString) {
|
|
10
10
|
if (!numberString || !stringContainsNumbers(numberString)) {
|
|
11
|
-
return
|
|
11
|
+
return "";
|
|
12
12
|
}
|
|
13
13
|
let containsDecimal = false;
|
|
14
14
|
const result = numberString
|
|
@@ -27,17 +27,24 @@ export function parseNumberString(numberString) {
|
|
|
27
27
|
return isValidNumber(result) ? Number(result).toString() : null;
|
|
28
28
|
}
|
|
29
29
|
export function sanitizeDecimalString(decimalString) {
|
|
30
|
-
|
|
30
|
+
const decimalAtEndOfStringButNotStart = /(?!^\.)\.$/;
|
|
31
|
+
return decimalString.replace(decimalAtEndOfStringButNotStart, "");
|
|
31
32
|
}
|
|
32
33
|
export function sanitizeNegativeString(negativeString) {
|
|
33
|
-
|
|
34
|
+
const allHyphensExceptTheStart = /(?!^-)-/g;
|
|
35
|
+
return negativeString.replace(allHyphensExceptTheStart, "");
|
|
34
36
|
}
|
|
35
37
|
export function sanitizeLeadingZeroString(zeroString) {
|
|
36
|
-
|
|
38
|
+
const allLeadingZerosOptionallyNegative = /^([-0])0+(?=\d)/;
|
|
39
|
+
return zeroString.replace(allLeadingZerosOptionallyNegative, "$1");
|
|
37
40
|
}
|
|
38
41
|
export function sanitizeNumberString(value) {
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
const sanitizedValue = sanitizeNegativeString(sanitizeDecimalString(sanitizeLeadingZeroString(value)));
|
|
43
|
+
const isNegativeDecimalOnlyZeros = /^-\b0\b\.?0*$/;
|
|
44
|
+
return isValidNumber(sanitizedValue)
|
|
45
|
+
? isNegativeDecimalOnlyZeros.test(sanitizedValue)
|
|
46
|
+
? sanitizedValue
|
|
47
|
+
: Number(sanitizedValue).toString()
|
|
41
48
|
: value;
|
|
42
49
|
}
|
|
43
50
|
function stringContainsNumbers(string) {
|
|
@@ -59,7 +59,7 @@ function hexToHue(hex) {
|
|
|
59
59
|
return rgbToHue(hexToRGB(hex));
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
const calciteAvatarCss = "@-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:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.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
|
|
62
|
+
const calciteAvatarCss = "@-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:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.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:inline-block;border-radius:50%;overflow:hidden}:host([scale=s]){height:1.5rem;width:1.5rem;font-size:var(--calcite-font-size--3)}:host([scale=m]){height:2rem;width:2rem;font-size:var(--calcite-font-size--2)}:host([scale=l]){height:2.75rem;width:2.75rem;font-size:var(--calcite-font-size-0)}.icon{display:-ms-flexbox;display:flex}.background{display:-ms-flexbox;display:flex;height:100%;width:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:50%}.initials{font-weight:var(--calcite-font-weight-bold);text-transform:uppercase;color:var(--calcite-ui-text-3)}.thumbnail{height:100%;width:100%;border-radius:50%}";
|
|
63
63
|
|
|
64
64
|
let CalciteAvatar$1 = class extends HTMLElement {
|
|
65
65
|
constructor() {
|
|
@@ -120,7 +120,7 @@ let CalciteCheckbox = class extends HTMLElement {
|
|
|
120
120
|
//
|
|
121
121
|
// --------------------------------------------------------------------------
|
|
122
122
|
render() {
|
|
123
|
-
return (h(Host, { onClick: this.clickHandler, onKeyDown: this.keyDownHandler }, h("div", { "aria-checked": this.checked.toString(), "aria-label": getLabelText(this), class: "toggle", onBlur: this.onToggleBlur, onFocus: this.onToggleFocus, ref: (toggleEl) => (this.toggleEl = toggleEl), role: "checkbox", tabIndex: 0 }, h("svg", { class: "check-svg", viewBox: "0 0 16 16" }, h("path", { d: this.getPath() })), h("slot", null)), h(HiddenFormInputSlot, { component: this })));
|
|
123
|
+
return (h(Host, { onClick: this.clickHandler, onKeyDown: this.keyDownHandler }, h("div", { "aria-checked": this.checked.toString(), "aria-label": getLabelText(this), class: "toggle", onBlur: this.onToggleBlur, onFocus: this.onToggleFocus, ref: (toggleEl) => (this.toggleEl = toggleEl), role: "checkbox", tabIndex: this.disabled ? undefined : 0 }, h("svg", { class: "check-svg", viewBox: "0 0 16 16" }, h("path", { d: this.getPath() })), h("slot", null)), h(HiddenFormInputSlot, { component: this })));
|
|
124
124
|
}
|
|
125
125
|
get el() { return this; }
|
|
126
126
|
static get style() { return calciteCheckboxCss; }
|
|
@@ -262,18 +262,19 @@ let CalciteInput = class extends HTMLElement {
|
|
|
262
262
|
};
|
|
263
263
|
this.setValue = (value, nativeEvent, committing = false) => {
|
|
264
264
|
const previousValue = this.value;
|
|
265
|
-
this.value = this.type === "number" ? sanitizeNumberString(value) : value;
|
|
266
265
|
if (this.type === "number") {
|
|
267
|
-
|
|
266
|
+
const sanitizedValue = sanitizeNumberString(value);
|
|
267
|
+
this.value = sanitizedValue;
|
|
268
|
+
this.setLocalizedValue(sanitizedValue);
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
this.value = value;
|
|
268
272
|
}
|
|
269
273
|
if (nativeEvent) {
|
|
270
|
-
if (this.type === "number") {
|
|
271
|
-
value = sanitizeNumberString(value);
|
|
272
|
-
}
|
|
273
274
|
const calciteInputInputEvent = this.calciteInputInput.emit({
|
|
274
275
|
element: this.childEl,
|
|
275
276
|
nativeEvent,
|
|
276
|
-
value
|
|
277
|
+
value: this.value
|
|
277
278
|
});
|
|
278
279
|
if (calciteInputInputEvent.defaultPrevented) {
|
|
279
280
|
this.value = previousValue;
|
|
@@ -339,7 +340,7 @@ let CalciteInput = class extends HTMLElement {
|
|
|
339
340
|
this.localizedValue = localizeNumberString(this.value, this.locale, this.groupSeparator);
|
|
340
341
|
}
|
|
341
342
|
else {
|
|
342
|
-
this.value =
|
|
343
|
+
this.value = "";
|
|
343
344
|
}
|
|
344
345
|
}
|
|
345
346
|
connectLabel(this);
|
|
@@ -13,7 +13,7 @@ const CSS = {
|
|
|
13
13
|
container: "container"
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
const 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:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.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;cursor:pointer}:host .container{position:relative;outline:2px solid transparent;outline-offset:2px}:host .radio{cursor:pointer;border-radius:9999px;background-color:var(--calcite-ui-foreground-1);-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]){cursor:pointer}: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)}::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}";
|
|
16
|
+
const 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:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.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;cursor:pointer}:host .container{position:relative;outline:2px solid transparent;outline-offset:2px}:host .radio{cursor:pointer;border-radius:9999px;background-color:var(--calcite-ui-foreground-1);-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]:not([disabled])) .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]){cursor:pointer}: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]:not([disabled])) .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]:not([disabled])) .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]:not([disabled])) .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)}::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}";
|
|
17
17
|
|
|
18
18
|
let CalciteRadioButton$1 = class extends HTMLElement {
|
|
19
19
|
constructor() {
|
|
@@ -128,8 +128,10 @@ let CalciteRadioButton$1 = class extends HTMLElement {
|
|
|
128
128
|
this.calciteInternalRadioButtonBlur.emit();
|
|
129
129
|
};
|
|
130
130
|
this.onContainerFocus = () => {
|
|
131
|
-
this.
|
|
132
|
-
|
|
131
|
+
if (!this.disabled) {
|
|
132
|
+
this.focused = true;
|
|
133
|
+
this.calciteInternalRadioButtonFocus.emit();
|
|
134
|
+
}
|
|
133
135
|
};
|
|
134
136
|
}
|
|
135
137
|
checkedChanged(newChecked) {
|
|
@@ -152,7 +154,9 @@ let CalciteRadioButton$1 = class extends HTMLElement {
|
|
|
152
154
|
//--------------------------------------------------------------------------
|
|
153
155
|
/** Sets focus on the component. */
|
|
154
156
|
async setFocus() {
|
|
155
|
-
|
|
157
|
+
if (!this.disabled) {
|
|
158
|
+
focusElement(this.containerEl);
|
|
159
|
+
}
|
|
156
160
|
}
|
|
157
161
|
onLabelClick(event) {
|
|
158
162
|
if (!this.disabled && !this.hidden) {
|
|
@@ -205,6 +209,12 @@ let CalciteRadioButton$1 = class extends HTMLElement {
|
|
|
205
209
|
}
|
|
206
210
|
});
|
|
207
211
|
}
|
|
212
|
+
getTabIndex() {
|
|
213
|
+
if (this.disabled) {
|
|
214
|
+
return undefined;
|
|
215
|
+
}
|
|
216
|
+
return this.checked || this.isDefaultSelectable() ? 0 : -1;
|
|
217
|
+
}
|
|
208
218
|
//--------------------------------------------------------------------------
|
|
209
219
|
//
|
|
210
220
|
// Event Listeners
|
|
@@ -231,7 +241,7 @@ let CalciteRadioButton$1 = class extends HTMLElement {
|
|
|
231
241
|
connectForm(this);
|
|
232
242
|
}
|
|
233
243
|
componentDidLoad() {
|
|
234
|
-
if (this.focused) {
|
|
244
|
+
if (this.focused && !this.disabled) {
|
|
235
245
|
this.setFocus();
|
|
236
246
|
}
|
|
237
247
|
}
|
|
@@ -245,7 +255,8 @@ let CalciteRadioButton$1 = class extends HTMLElement {
|
|
|
245
255
|
//
|
|
246
256
|
// --------------------------------------------------------------------------
|
|
247
257
|
render() {
|
|
248
|
-
|
|
258
|
+
const tabIndex = this.getTabIndex();
|
|
259
|
+
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: tabIndex }, h("div", { class: "radio" })), h(HiddenFormInputSlot, { component: this })));
|
|
249
260
|
}
|
|
250
261
|
get el() { return this; }
|
|
251
262
|
static get watchers() { return {
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { HTMLElement, createEvent, h, Host, proxyCustomElement } from '@stencil/core/internal/client';
|
|
6
6
|
import { g as getElementProp } from './dom.js';
|
|
7
|
-
import { c as createObserver } from './observers.js';
|
|
8
7
|
import { d as defineCustomElement$2 } from './calcite-icon2.js';
|
|
9
8
|
|
|
10
9
|
const SLOTS = {
|
|
@@ -33,30 +32,9 @@ let CalciteRadioGroupItem$1 = class extends HTMLElement {
|
|
|
33
32
|
this.iconFlipRtl = false;
|
|
34
33
|
/** optionally used with icon, select where to position the icon */
|
|
35
34
|
this.iconPosition = "start";
|
|
36
|
-
this.mutationObserver = createObserver("mutation", () => this.syncFromExternalInput());
|
|
37
35
|
}
|
|
38
36
|
handleCheckedChange() {
|
|
39
37
|
this.calciteRadioGroupItemChange.emit();
|
|
40
|
-
this.syncToExternalInput();
|
|
41
|
-
}
|
|
42
|
-
//--------------------------------------------------------------------------
|
|
43
|
-
//
|
|
44
|
-
// Lifecycle
|
|
45
|
-
//
|
|
46
|
-
//--------------------------------------------------------------------------
|
|
47
|
-
connectedCallback() {
|
|
48
|
-
var _a;
|
|
49
|
-
const inputProxy = this.el.querySelector(`input[slot=${SLOTS.input}]`);
|
|
50
|
-
if (inputProxy) {
|
|
51
|
-
this.value = inputProxy.value;
|
|
52
|
-
this.checked = inputProxy.checked;
|
|
53
|
-
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(inputProxy, { attributes: true });
|
|
54
|
-
}
|
|
55
|
-
this.inputProxy = inputProxy;
|
|
56
|
-
}
|
|
57
|
-
disconnectedCallback() {
|
|
58
|
-
var _a;
|
|
59
|
-
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
60
38
|
}
|
|
61
39
|
render() {
|
|
62
40
|
const { checked, value } = this;
|
|
@@ -72,29 +50,6 @@ let CalciteRadioGroupItem$1 = class extends HTMLElement {
|
|
|
72
50
|
"label--outline": appearance === "outline"
|
|
73
51
|
} }, this.icon && this.iconPosition === "start" ? iconEl : null, h("slot", null, value), h("slot", { name: SLOTS.input }), this.icon && this.iconPosition === "end" ? iconEl : null)));
|
|
74
52
|
}
|
|
75
|
-
//--------------------------------------------------------------------------
|
|
76
|
-
//
|
|
77
|
-
// Private Methods
|
|
78
|
-
//
|
|
79
|
-
//--------------------------------------------------------------------------
|
|
80
|
-
syncFromExternalInput() {
|
|
81
|
-
if (this.inputProxy) {
|
|
82
|
-
this.value = this.inputProxy.value;
|
|
83
|
-
this.checked = this.inputProxy.checked;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
syncToExternalInput() {
|
|
87
|
-
if (!this.inputProxy) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
this.inputProxy.value = this.value;
|
|
91
|
-
if (this.checked) {
|
|
92
|
-
this.inputProxy.setAttribute("checked", "");
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
this.inputProxy.removeAttribute("checked");
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
53
|
get el() { return this; }
|
|
99
54
|
static get watchers() { return {
|
|
100
55
|
"checked": ["handleCheckedChange"]
|