@esri/calcite-components 1.0.0-next.319 → 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-04bce033.entry.js +5 -0
- package/dist/calcite/p-1480eb2d.entry.js +5 -0
- package/dist/calcite/p-414ce3c1.system.entry.js +5 -0
- package/dist/calcite/p-4d4ba7df.entry.js +5 -0
- package/dist/calcite/{p-8b2d4eac.system.entry.js → p-4e95e13d.system.entry.js} +1 -1
- package/dist/calcite/p-58208234.system.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-f97e1a2d.entry.js → p-a57aa5d0.entry.js} +1 -1
- package/dist/calcite/{p-6c5b849f.system.entry.js → p-ac417011.system.entry.js} +1 -1
- package/dist/calcite/p-ad617a5a.entry.js +5 -0
- package/dist/calcite/p-ed82600e.system.entry.js +5 -0
- package/dist/calcite/p-fa9a1d8f.system.entry.js +5 -0
- package/dist/cjs/calcite-button.cjs.entry.js +2 -2
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +4 -1
- package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +349 -223
- package/dist/cjs/calcite-label.cjs.entry.js +1 -1
- package/dist/cjs/calcite-option_3.cjs.entry.js +3 -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-button/calcite-button.js +3 -2
- package/dist/collection/components/calcite-combobox/calcite-combobox.js +4 -1
- package/dist/collection/components/calcite-input-time-picker/calcite-input-time-picker.js +81 -76
- package/dist/collection/components/calcite-label/calcite-label.css +0 -1
- package/dist/collection/components/calcite-option/calcite-option.js +3 -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/collection/components/calcite-time-picker/calcite-time-picker.css +56 -91
- package/dist/collection/components/calcite-time-picker/calcite-time-picker.js +254 -289
- package/dist/collection/components/calcite-time-picker/resources.js +15 -9
- package/dist/collection/utils/time.js +144 -36
- package/dist/components/calcite-button2.js +2 -2
- package/dist/components/calcite-combobox.js +4 -1
- package/dist/components/calcite-input-time-picker.js +51 -48
- package/dist/components/calcite-label2.js +1 -1
- package/dist/components/calcite-option.js +3 -1
- package/dist/components/calcite-radio-button.js +3 -9
- package/dist/components/calcite-time-picker2.js +320 -187
- package/dist/custom-elements/index.d.ts +0 -6
- package/dist/custom-elements/index.js +364 -277
- package/dist/esm/calcite-button.entry.js +2 -2
- package/dist/esm/calcite-combobox_3.entry.js +4 -1
- package/dist/esm/calcite-input-time-picker_2.entry.js +349 -223
- package/dist/esm/calcite-label.entry.js +1 -1
- package/dist/esm/calcite-option_3.entry.js +3 -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-button.entry.js +1 -1
- package/dist/esm-es5/calcite-combobox_3.entry.js +1 -1
- package/dist/esm-es5/calcite-input-time-picker_2.entry.js +2 -2
- package/dist/esm-es5/calcite-label.entry.js +1 -1
- package/dist/esm-es5/calcite-option_3.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 +24 -211
- package/dist/types/components/calcite-input-time-picker/calcite-input-time-picker.d.ts +12 -4
- package/dist/types/components/calcite-time-picker/calcite-time-picker.d.ts +35 -23
- package/dist/types/components/calcite-time-picker/resources.d.ts +14 -8
- package/dist/types/components.d.ts +16 -93
- package/dist/types/preact.d.ts +0 -2
- package/dist/types/utils/time.d.ts +18 -5
- package/hydrate/index.js +381 -296
- package/package.json +1 -1
- package/readme.md +2 -2
- package/dist/calcite/p-12a9599d.system.entry.js +0 -5
- package/dist/calcite/p-1e4955d7.entry.js +0 -5
- package/dist/calcite/p-2b137143.system.entry.js +0 -5
- package/dist/calcite/p-35c5e6bd.entry.js +0 -5
- package/dist/calcite/p-4af85388.system.entry.js +0 -5
- package/dist/calcite/p-9634f89d.entry.js +0 -5
- package/dist/calcite/p-a98e5444.system.entry.js +0 -5
- package/dist/calcite/p-fccc1605.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
|
@@ -105,13 +105,14 @@ export class CalciteButton {
|
|
|
105
105
|
render() {
|
|
106
106
|
const dir = getElementDir(this.el);
|
|
107
107
|
const Tag = this.childElType;
|
|
108
|
-
const
|
|
108
|
+
const loaderNode = this.hasLoader ? (h("div", { class: CSS.buttonLoader },
|
|
109
|
+
h("calcite-loader", { active: true, class: this.loading ? CSS.loadingIn : CSS.loadingOut, inline: true, label: this.intlLoading, scale: "m" }))) : null;
|
|
109
110
|
const iconStartEl = (h("calcite-icon", { class: { [CSS.icon]: true, [CSS.iconStart]: true }, flipRtl: this.iconFlipRtl === "start" || this.iconFlipRtl === "both", icon: this.iconStart, scale: "s" }));
|
|
110
111
|
const iconEndEl = (h("calcite-icon", { class: { [CSS.icon]: true, [CSS.iconEnd]: true }, flipRtl: this.iconFlipRtl === "end" || this.iconFlipRtl === "both", icon: this.iconEnd, scale: "s" }));
|
|
111
112
|
const contentEl = (h("span", { class: CSS.content },
|
|
112
113
|
h("slot", null)));
|
|
113
114
|
return (h(Tag, { "aria-label": getLabelText(this), class: { [CSS_UTILITY.rtl]: dir === "rtl", [CSS.contentSlotted]: this.hasContent }, disabled: this.disabled || this.loading, href: this.childElType === "a" && this.href, name: this.childElType === "button" && this.name, onClick: this.handleClick, ref: (el) => (this.childEl = el), rel: this.childElType === "a" && this.rel, tabIndex: this.disabled || this.loading ? -1 : null, target: this.childElType === "a" && this.target, type: this.childElType === "button" && this.type },
|
|
114
|
-
|
|
115
|
+
loaderNode,
|
|
115
116
|
this.iconStart ? iconStartEl : null,
|
|
116
117
|
this.hasContent ? contentEl : null,
|
|
117
118
|
this.iconEnd ? iconEndEl : null));
|
|
@@ -186,7 +186,9 @@ export class CalciteCombobox {
|
|
|
186
186
|
};
|
|
187
187
|
this.setInactiveIfNotContained = (event) => {
|
|
188
188
|
const composedPath = event.composedPath();
|
|
189
|
-
if (!this.active
|
|
189
|
+
if ((!this.active && !this.open) ||
|
|
190
|
+
composedPath.includes(this.el) ||
|
|
191
|
+
composedPath.includes(this.referenceEl)) {
|
|
190
192
|
return;
|
|
191
193
|
}
|
|
192
194
|
if (this.allowCustomValues && this.text) {
|
|
@@ -201,6 +203,7 @@ export class CalciteCombobox {
|
|
|
201
203
|
this.updateActiveItemIndex(-1);
|
|
202
204
|
}
|
|
203
205
|
this.active = false;
|
|
206
|
+
this.open = false;
|
|
204
207
|
};
|
|
205
208
|
this.setMenuEl = (el) => {
|
|
206
209
|
this.menuEl = el;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
4
|
*/
|
|
5
|
-
import { Component, Element, Host, h, Prop, Listen, Event, Method, Watch } from "@stencil/core";
|
|
5
|
+
import { Component, Element, Host, h, Prop, Listen, Event, Method, Watch, State } from "@stencil/core";
|
|
6
6
|
import { guid } from "../../utils/guid";
|
|
7
|
-
import {
|
|
7
|
+
import { formatTimeString, isValidTime, localizeTimeString } from "../../utils/time";
|
|
8
8
|
import { connectLabel, disconnectLabel, getLabelText } from "../../utils/label";
|
|
9
9
|
import { connectForm, disconnectForm, HiddenFormInputSlot } from "../../utils/form";
|
|
10
10
|
export class CalciteInputTimePicker {
|
|
@@ -18,8 +18,11 @@ export class CalciteInputTimePicker {
|
|
|
18
18
|
this.active = false;
|
|
19
19
|
/** The disabled state of the time input */
|
|
20
20
|
this.disabled = false;
|
|
21
|
-
/**
|
|
22
|
-
|
|
21
|
+
/**
|
|
22
|
+
* BCP 47 language tag for desired language and country format
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
this.locale = document.documentElement.lang || navigator.language || "en";
|
|
23
26
|
/**
|
|
24
27
|
* When true, makes the component required for form-submission.
|
|
25
28
|
*
|
|
@@ -43,56 +46,60 @@ export class CalciteInputTimePicker {
|
|
|
43
46
|
//--------------------------------------------------------------------------
|
|
44
47
|
this.calciteInputBlurHandler = () => {
|
|
45
48
|
this.active = false;
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
49
|
+
const shouldIncludeSeconds = this.shouldIncludeSeconds();
|
|
50
|
+
const localizedInputValue = localizeTimeString(this.calciteInputEl.value, this.locale, shouldIncludeSeconds);
|
|
51
|
+
this.setInputValue(localizedInputValue || localizeTimeString(this.value, this.locale, shouldIncludeSeconds));
|
|
50
52
|
};
|
|
51
53
|
this.calciteInputFocusHandler = () => {
|
|
52
54
|
this.active = true;
|
|
53
55
|
};
|
|
54
56
|
this.calciteInputInputHandler = (event) => {
|
|
55
|
-
|
|
57
|
+
const target = event.target;
|
|
58
|
+
this.setValue({ value: target.value });
|
|
59
|
+
};
|
|
60
|
+
this.timePickerChangeHandler = (event) => {
|
|
61
|
+
event.stopPropagation();
|
|
62
|
+
const target = event.target;
|
|
63
|
+
const value = target.value;
|
|
64
|
+
this.setValue({ value, origin: "time-picker" });
|
|
56
65
|
};
|
|
57
66
|
this.setCalciteInputEl = (el) => {
|
|
58
67
|
this.calciteInputEl = el;
|
|
59
68
|
};
|
|
69
|
+
this.setCalciteTimePickerEl = (el) => {
|
|
70
|
+
this.calciteTimePickerEl = el;
|
|
71
|
+
};
|
|
60
72
|
this.setInputValue = (newInputValue) => {
|
|
61
73
|
if (!this.calciteInputEl) {
|
|
62
74
|
return;
|
|
63
75
|
}
|
|
64
|
-
|
|
65
|
-
const { hour, minute, second } = parseTimeString(newInputValue);
|
|
66
|
-
this.calciteInputEl.value = newInputValue
|
|
67
|
-
? `${getMeridiemHour(hour)}:${minute}${this.step !== 60 ? ":" + second : ""} ${getMeridiem(hour)}`
|
|
68
|
-
: null;
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
this.calciteInputEl.value = newInputValue;
|
|
72
|
-
}
|
|
76
|
+
this.calciteInputEl.value = newInputValue;
|
|
73
77
|
};
|
|
74
78
|
this.setValue = ({ value, origin = "input" }) => {
|
|
75
79
|
const previousValue = this.value;
|
|
76
|
-
const
|
|
80
|
+
const newValue = formatTimeString(value);
|
|
81
|
+
const newLocalizedValue = localizeTimeString(newValue, this.locale, this.shouldIncludeSeconds());
|
|
77
82
|
this.internalValueChange = origin !== "external" && origin !== "loading";
|
|
78
83
|
const shouldEmit = origin !== "loading" &&
|
|
79
84
|
origin !== "external" &&
|
|
80
85
|
((value !== this.previousValidValue && !value) ||
|
|
81
|
-
!!(!this.previousValidValue &&
|
|
82
|
-
(
|
|
86
|
+
!!(!this.previousValidValue && newValue) ||
|
|
87
|
+
(newValue !== this.previousValidValue && newValue));
|
|
83
88
|
if (value) {
|
|
84
89
|
if (shouldEmit) {
|
|
85
|
-
this.previousValidValue =
|
|
90
|
+
this.previousValidValue = newValue;
|
|
86
91
|
}
|
|
87
|
-
if (
|
|
88
|
-
this.value =
|
|
92
|
+
if (newValue && newValue !== this.value) {
|
|
93
|
+
this.value = newValue;
|
|
89
94
|
}
|
|
95
|
+
this.localizedValue = newLocalizedValue;
|
|
90
96
|
}
|
|
91
97
|
else {
|
|
92
98
|
this.value = value;
|
|
99
|
+
this.localizedValue = null;
|
|
93
100
|
}
|
|
94
101
|
if (origin === "time-picker" || origin === "external") {
|
|
95
|
-
this.setInputValue(
|
|
102
|
+
this.setInputValue(newLocalizedValue);
|
|
96
103
|
}
|
|
97
104
|
if (shouldEmit) {
|
|
98
105
|
const changeEvent = this.calciteInputTimePickerChange.emit();
|
|
@@ -103,17 +110,26 @@ export class CalciteInputTimePicker {
|
|
|
103
110
|
this.previousValidValue = previousValue;
|
|
104
111
|
}
|
|
105
112
|
else {
|
|
106
|
-
this.previousValidValue =
|
|
113
|
+
this.previousValidValue = newValue;
|
|
107
114
|
}
|
|
108
115
|
}
|
|
109
116
|
};
|
|
110
117
|
}
|
|
118
|
+
localeWatcher(newLocale) {
|
|
119
|
+
this.setInputValue(localizeTimeString(this.value, newLocale, this.shouldIncludeSeconds()));
|
|
120
|
+
}
|
|
111
121
|
valueWatcher(newValue) {
|
|
112
122
|
if (!this.internalValueChange) {
|
|
113
123
|
this.setValue({ value: newValue, origin: "external" });
|
|
114
124
|
}
|
|
115
125
|
this.internalValueChange = false;
|
|
116
126
|
}
|
|
127
|
+
clickHandler(event) {
|
|
128
|
+
if (event.composedPath().includes(this.calciteTimePickerEl)) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
this.setFocus();
|
|
132
|
+
}
|
|
117
133
|
keyUpHandler(event) {
|
|
118
134
|
if (event.key === "Escape" && this.active) {
|
|
119
135
|
this.active = false;
|
|
@@ -124,21 +140,6 @@ export class CalciteInputTimePicker {
|
|
|
124
140
|
event.stopPropagation();
|
|
125
141
|
this.active = false;
|
|
126
142
|
}
|
|
127
|
-
timePickerChangeHandler(event) {
|
|
128
|
-
event.preventDefault();
|
|
129
|
-
event.stopPropagation();
|
|
130
|
-
if (event.detail) {
|
|
131
|
-
const { hour, minute, second } = event.detail;
|
|
132
|
-
let value;
|
|
133
|
-
if (hour && minute) {
|
|
134
|
-
value = second && this.step !== 60 ? `${hour}:${minute}:${second}` : `${hour}:${minute}`;
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
value = "";
|
|
138
|
-
}
|
|
139
|
-
this.setValue({ value, origin: "time-picker" });
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
143
|
timePickerFocusHandler(event) {
|
|
143
144
|
event.preventDefault();
|
|
144
145
|
event.stopPropagation();
|
|
@@ -161,6 +162,9 @@ export class CalciteInputTimePicker {
|
|
|
161
162
|
onLabelClick() {
|
|
162
163
|
this.setFocus();
|
|
163
164
|
}
|
|
165
|
+
shouldIncludeSeconds() {
|
|
166
|
+
return this.step < 60;
|
|
167
|
+
}
|
|
164
168
|
//--------------------------------------------------------------------------
|
|
165
169
|
//
|
|
166
170
|
// Lifecycle
|
|
@@ -168,15 +172,13 @@ export class CalciteInputTimePicker {
|
|
|
168
172
|
//--------------------------------------------------------------------------
|
|
169
173
|
connectedCallback() {
|
|
170
174
|
if (this.value) {
|
|
171
|
-
this.setValue({ value: this.value, origin: "loading" });
|
|
175
|
+
this.setValue({ value: isValidTime(this.value) ? this.value : undefined, origin: "loading" });
|
|
172
176
|
}
|
|
173
177
|
connectLabel(this);
|
|
174
178
|
connectForm(this);
|
|
175
179
|
}
|
|
176
180
|
componentDidLoad() {
|
|
177
|
-
|
|
178
|
-
this.setInputValue(this.value);
|
|
179
|
-
}
|
|
181
|
+
this.setInputValue(this.localizedValue);
|
|
180
182
|
}
|
|
181
183
|
disconnectedCallback() {
|
|
182
184
|
disconnectLabel(this);
|
|
@@ -188,13 +190,12 @@ export class CalciteInputTimePicker {
|
|
|
188
190
|
//
|
|
189
191
|
// --------------------------------------------------------------------------
|
|
190
192
|
render() {
|
|
191
|
-
const { hour, minute, second } = parseTimeString(this.value);
|
|
192
193
|
const popoverId = `${this.referenceElementId}-popover`;
|
|
193
194
|
return (h(Host, null,
|
|
194
195
|
h("div", { "aria-controls": popoverId, "aria-haspopup": "dialog", "aria-label": this.name, "aria-owns": popoverId, id: this.referenceElementId, role: "combobox" },
|
|
195
196
|
h("calcite-input", { disabled: this.disabled, icon: "clock", label: getLabelText(this), onCalciteInputBlur: this.calciteInputBlurHandler, onCalciteInputFocus: this.calciteInputFocusHandler, onCalciteInputInput: this.calciteInputInputHandler, ref: this.setCalciteInputEl, scale: this.scale, step: this.step })),
|
|
196
197
|
h("calcite-popover", { id: popoverId, label: "Time Picker", open: this.active || false, referenceElement: this.referenceElementId },
|
|
197
|
-
h("calcite-time-picker", {
|
|
198
|
+
h("calcite-time-picker", { intlHour: this.intlHour, intlHourDown: this.intlHourDown, intlHourUp: this.intlHourUp, intlMeridiem: this.intlMeridiem, intlMeridiemDown: this.intlMeridiemDown, intlMeridiemUp: this.intlMeridiemUp, intlMinute: this.intlMinute, intlMinuteDown: this.intlMinuteDown, intlMinuteUp: this.intlMinuteUp, intlSecond: this.intlSecond, intlSecondDown: this.intlSecondDown, intlSecondUp: this.intlSecondUp, lang: this.locale, onCalciteTimePickerChange: this.timePickerChangeHandler, ref: this.setCalciteTimePickerEl, scale: this.scale, step: this.step, value: this.value })),
|
|
198
199
|
h(HiddenFormInputSlot, { component: this })));
|
|
199
200
|
}
|
|
200
201
|
static get is() { return "calcite-input-time-picker"; }
|
|
@@ -242,29 +243,6 @@ export class CalciteInputTimePicker {
|
|
|
242
243
|
"reflect": true,
|
|
243
244
|
"defaultValue": "false"
|
|
244
245
|
},
|
|
245
|
-
"hourDisplayFormat": {
|
|
246
|
-
"type": "string",
|
|
247
|
-
"mutable": false,
|
|
248
|
-
"complexType": {
|
|
249
|
-
"original": "HourDisplayFormat",
|
|
250
|
-
"resolved": "\"12\" | \"24\"",
|
|
251
|
-
"references": {
|
|
252
|
-
"HourDisplayFormat": {
|
|
253
|
-
"location": "import",
|
|
254
|
-
"path": "../../utils/time"
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
"required": false,
|
|
259
|
-
"optional": false,
|
|
260
|
-
"docs": {
|
|
261
|
-
"tags": [],
|
|
262
|
-
"text": "Format of the hour value (12-hour or 24-hour) (this will be replaced by locale eventually)"
|
|
263
|
-
},
|
|
264
|
-
"attribute": "hour-display-format",
|
|
265
|
-
"reflect": false,
|
|
266
|
-
"defaultValue": "\"12\""
|
|
267
|
-
},
|
|
268
246
|
"intlHour": {
|
|
269
247
|
"type": "string",
|
|
270
248
|
"mutable": false,
|
|
@@ -469,6 +447,27 @@ export class CalciteInputTimePicker {
|
|
|
469
447
|
"attribute": "intl-second-up",
|
|
470
448
|
"reflect": false
|
|
471
449
|
},
|
|
450
|
+
"locale": {
|
|
451
|
+
"type": "string",
|
|
452
|
+
"mutable": true,
|
|
453
|
+
"complexType": {
|
|
454
|
+
"original": "string",
|
|
455
|
+
"resolved": "string",
|
|
456
|
+
"references": {}
|
|
457
|
+
},
|
|
458
|
+
"required": false,
|
|
459
|
+
"optional": false,
|
|
460
|
+
"docs": {
|
|
461
|
+
"tags": [{
|
|
462
|
+
"name": "internal",
|
|
463
|
+
"text": undefined
|
|
464
|
+
}],
|
|
465
|
+
"text": "BCP 47 language tag for desired language and country format"
|
|
466
|
+
},
|
|
467
|
+
"attribute": "lang",
|
|
468
|
+
"reflect": false,
|
|
469
|
+
"defaultValue": "document.documentElement.lang || navigator.language || \"en\""
|
|
470
|
+
},
|
|
472
471
|
"name": {
|
|
473
472
|
"type": "string",
|
|
474
473
|
"mutable": false,
|
|
@@ -567,6 +566,9 @@ export class CalciteInputTimePicker {
|
|
|
567
566
|
"defaultValue": "null"
|
|
568
567
|
}
|
|
569
568
|
}; }
|
|
569
|
+
static get states() { return {
|
|
570
|
+
"localizedValue": {}
|
|
571
|
+
}; }
|
|
570
572
|
static get events() { return [{
|
|
571
573
|
"method": "calciteInputTimePickerChange",
|
|
572
574
|
"name": "calciteInputTimePickerChange",
|
|
@@ -603,24 +605,27 @@ export class CalciteInputTimePicker {
|
|
|
603
605
|
}; }
|
|
604
606
|
static get elementRef() { return "el"; }
|
|
605
607
|
static get watchers() { return [{
|
|
608
|
+
"propName": "locale",
|
|
609
|
+
"methodName": "localeWatcher"
|
|
610
|
+
}, {
|
|
606
611
|
"propName": "value",
|
|
607
612
|
"methodName": "valueWatcher"
|
|
608
613
|
}]; }
|
|
609
614
|
static get listeners() { return [{
|
|
610
|
-
"name": "
|
|
611
|
-
"method": "
|
|
615
|
+
"name": "click",
|
|
616
|
+
"method": "clickHandler",
|
|
612
617
|
"target": undefined,
|
|
613
618
|
"capture": false,
|
|
614
619
|
"passive": false
|
|
615
620
|
}, {
|
|
616
|
-
"name": "
|
|
617
|
-
"method": "
|
|
621
|
+
"name": "keyup",
|
|
622
|
+
"method": "keyUpHandler",
|
|
618
623
|
"target": undefined,
|
|
619
624
|
"capture": false,
|
|
620
625
|
"passive": false
|
|
621
626
|
}, {
|
|
622
|
-
"name": "
|
|
623
|
-
"method": "
|
|
627
|
+
"name": "calciteTimePickerBlur",
|
|
628
|
+
"method": "timePickerBlurHandler",
|
|
624
629
|
"target": undefined,
|
|
625
630
|
"capture": false,
|
|
626
631
|
"passive": false
|
|
@@ -51,8 +51,10 @@ export class CalciteOption {
|
|
|
51
51
|
var _a;
|
|
52
52
|
this.ensureTextContentDependentProps();
|
|
53
53
|
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(this.el, {
|
|
54
|
+
attributeFilter: ["label", "value"],
|
|
55
|
+
characterData: true,
|
|
54
56
|
childList: true,
|
|
55
|
-
|
|
57
|
+
subtree: true
|
|
56
58
|
});
|
|
57
59
|
}
|
|
58
60
|
disconnectedCallback() {
|
|
@@ -95,10 +95,79 @@
|
|
|
95
95
|
outline-offset: 2px;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
:host .radio {
|
|
99
|
+
background-color: var(--calcite-ui-foreground-1);
|
|
100
|
+
border-radius: 9999px;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
transition-property: all;
|
|
103
|
+
transition-duration: 150ms;
|
|
104
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
105
|
+
box-shadow: inset 0 0 0 1px var(--calcite-ui-border-input);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host([hovered]) .radio,
|
|
109
|
+
:host(:not([checked])[focused]) .radio {
|
|
110
|
+
box-shadow: inset 0 0 0 2px var(--calcite-ui-brand);
|
|
111
|
+
}
|
|
112
|
+
|
|
98
113
|
:host([disabled]) {
|
|
99
114
|
cursor: pointer;
|
|
100
115
|
}
|
|
101
116
|
|
|
117
|
+
:host([disabled]) .radio {
|
|
118
|
+
cursor: default;
|
|
119
|
+
opacity: var(--calcite-ui-opacity-disabled);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:host([hovered][disabled]) .radio {
|
|
123
|
+
box-shadow: inset 0 0 0 1px var(--calcite-ui-border-input);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:host([scale=s]) {
|
|
127
|
+
--calcite-radio-size: var(--calcite-font-size--2);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:host([scale=m]) {
|
|
131
|
+
--calcite-radio-size: var(--calcite-font-size--1);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
:host([scale=l]) {
|
|
135
|
+
--calcite-radio-size: var(--calcite-font-size-0);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.radio {
|
|
139
|
+
height: var(--calcite-radio-size);
|
|
140
|
+
max-width: var(--calcite-radio-size);
|
|
141
|
+
min-width: var(--calcite-radio-size);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:host([scale=s][checked]) .radio,
|
|
145
|
+
:host([hovered][scale=s][checked][disabled]) .radio {
|
|
146
|
+
box-shadow: inset 0 0 0 4px var(--calcite-ui-brand);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
:host([scale=s][focused][checked]) .radio {
|
|
150
|
+
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);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:host([scale=m][checked]) .radio,
|
|
154
|
+
:host([hovered][scale=m][checked][disabled]) .radio {
|
|
155
|
+
box-shadow: inset 0 0 0 5px var(--calcite-ui-brand);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
:host([scale=m][focused][checked]) .radio {
|
|
159
|
+
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);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
:host([scale=l][checked]) .radio,
|
|
163
|
+
:host([hovered][scale=l][checked][disabled]) .radio {
|
|
164
|
+
box-shadow: inset 0 0 0 6px var(--calcite-ui-brand);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:host([scale=l][focused][checked]) .radio {
|
|
168
|
+
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);
|
|
169
|
+
}
|
|
170
|
+
|
|
102
171
|
::slotted(input[slot=hidden-form-input]) {
|
|
103
172
|
bottom: 0 !important;
|
|
104
173
|
left: 0 !important;
|
|
@@ -234,7 +234,7 @@ export class CalciteRadioButton {
|
|
|
234
234
|
render() {
|
|
235
235
|
return (h(Host, { onClick: this.clickHandler, onKeyDown: this.handleKeyDown },
|
|
236
236
|
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 },
|
|
237
|
-
h("
|
|
237
|
+
h("div", { class: "radio" })),
|
|
238
238
|
h(HiddenFormInputSlot, { component: this })));
|
|
239
239
|
}
|
|
240
240
|
static get is() { return "calcite-radio-button"; }
|
|
@@ -85,162 +85,127 @@
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
:host {
|
|
88
|
-
color: var(--calcite-ui-text-1);
|
|
89
88
|
display: inline-block;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.time-picker {
|
|
92
|
+
background-color: var(--calcite-ui-foreground-1);
|
|
93
|
+
display: flex;
|
|
90
94
|
font-weight: var(--calcite-font-weight-medium);
|
|
95
|
+
align-items: center;
|
|
91
96
|
-webkit-user-select: none;
|
|
92
97
|
user-select: none;
|
|
98
|
+
box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);
|
|
99
|
+
color: var(--calcite-ui-text-1);
|
|
100
|
+
border-radius: var(--calcite-border-radius);
|
|
93
101
|
}
|
|
94
102
|
|
|
95
|
-
.time-picker {
|
|
96
|
-
box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);
|
|
97
|
-
align-items: center;
|
|
103
|
+
.time-picker .column {
|
|
98
104
|
display: flex;
|
|
99
|
-
|
|
105
|
+
flex-direction: column;
|
|
100
106
|
}
|
|
101
107
|
|
|
102
|
-
|
|
103
|
-
align-items: center;
|
|
108
|
+
.time-picker .button {
|
|
104
109
|
background-color: var(--calcite-ui-foreground-1);
|
|
110
|
+
cursor: pointer;
|
|
105
111
|
display: inline-flex;
|
|
112
|
+
align-items: center;
|
|
106
113
|
justify-content: center;
|
|
107
114
|
}
|
|
108
115
|
|
|
109
|
-
|
|
110
|
-
cursor: pointer;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
span.button:hover, span.button:focus {
|
|
116
|
+
.time-picker .button:hover, .time-picker .button:focus {
|
|
114
117
|
background-color: var(--calcite-ui-foreground-2);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
span.button:focus {
|
|
118
118
|
outline: 2px solid transparent;
|
|
119
119
|
outline-offset: 2px;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
.time-picker .button:active {
|
|
123
123
|
background-color: var(--calcite-ui-foreground-3);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
.time-picker .button.top-left {
|
|
127
127
|
border-top-left-radius: var(--calcite-border-radius);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
.time-picker .button.bottom-left {
|
|
131
131
|
border-bottom-left-radius: var(--calcite-border-radius);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
.time-picker .button.top-right {
|
|
135
135
|
border-top-right-radius: var(--calcite-border-radius);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
.time-picker .button.bottom-right {
|
|
139
139
|
border-bottom-right-radius: var(--calcite-border-radius);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
.time-picker .button calcite-icon {
|
|
143
143
|
color: var(--calcite-ui-text-3);
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
.time-picker .input {
|
|
147
|
+
background-color: var(--calcite-ui-foreground-1);
|
|
148
|
+
cursor: pointer;
|
|
147
149
|
font-weight: var(--calcite-font-weight-medium);
|
|
148
|
-
|
|
150
|
+
display: inline-flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
justify-content: center;
|
|
149
153
|
}
|
|
150
154
|
|
|
151
|
-
|
|
155
|
+
.time-picker .input:hover {
|
|
152
156
|
box-shadow: inset 0 0 0 2px var(--calcite-ui-foreground-2);
|
|
153
157
|
}
|
|
154
158
|
|
|
155
|
-
|
|
159
|
+
.time-picker .input:focus, .time-picker .input:hover:focus {
|
|
156
160
|
outline: 2px solid transparent;
|
|
157
161
|
outline-offset: 2px;
|
|
158
162
|
box-shadow: inset 0 0 0 2px var(--calcite-ui-brand);
|
|
159
163
|
}
|
|
160
164
|
|
|
161
|
-
|
|
165
|
+
.time-picker.scale-s {
|
|
162
166
|
font-size: var(--calcite-font-size--1);
|
|
163
167
|
}
|
|
164
168
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
:
|
|
171
|
-
height: 72px;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
:host([scale=s][hour-display-format="12"]) .time-picker {
|
|
175
|
-
width: 124.2px;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
:host([scale=s][hour-display-format="12"]:not([step="60"])) .time-picker {
|
|
179
|
-
width: 168px;
|
|
169
|
+
.time-picker.scale-s .button,
|
|
170
|
+
.time-picker.scale-s .input {
|
|
171
|
+
padding-left: 0.75rem;
|
|
172
|
+
padding-right: 0.75rem;
|
|
173
|
+
padding-top: 0.25rem;
|
|
174
|
+
padding-bottom: 0.25rem;
|
|
180
175
|
}
|
|
181
176
|
|
|
182
|
-
:
|
|
183
|
-
|
|
177
|
+
.time-picker.scale-s:not(.show-meridiem) .delimiter:last-child {
|
|
178
|
+
padding-inline-end: 0.75rem;
|
|
184
179
|
}
|
|
185
180
|
|
|
186
|
-
|
|
187
|
-
width: 128.4px;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
:host([scale=m]) {
|
|
181
|
+
.time-picker.scale-m {
|
|
191
182
|
font-size: var(--calcite-font-size-0);
|
|
192
183
|
}
|
|
193
184
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
:
|
|
200
|
-
height: 96px;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
:host([scale=m][hour-display-format="12"]) .time-picker {
|
|
204
|
-
width: 136.8px;
|
|
185
|
+
.time-picker.scale-m .button,
|
|
186
|
+
.time-picker.scale-m .input {
|
|
187
|
+
padding-left: 1rem;
|
|
188
|
+
padding-right: 1rem;
|
|
189
|
+
padding-top: 0.5rem;
|
|
190
|
+
padding-bottom: 0.5rem;
|
|
205
191
|
}
|
|
206
192
|
|
|
207
|
-
|
|
208
|
-
|
|
193
|
+
.time-picker.scale-m:not(.show-meridiem) .delimiter:last-child {
|
|
194
|
+
padding-inline-end: 1rem;
|
|
209
195
|
}
|
|
210
196
|
|
|
211
|
-
|
|
212
|
-
width: 92.8px;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
:host([scale=m][hour-display-format="24"]:not([step="60"])) .time-picker {
|
|
216
|
-
width: 141.6px;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
:host([scale=l]) {
|
|
197
|
+
.time-picker.scale-l {
|
|
220
198
|
font-size: var(--calcite-font-size-1);
|
|
221
199
|
}
|
|
222
200
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
:
|
|
229
|
-
height: 144px;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
:host([scale=l][hour-display-format="12"]) .time-picker {
|
|
233
|
-
width: 198px;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
:host([scale=l][hour-display-format="12"]:not([step="60"])) .time-picker {
|
|
237
|
-
width: 268px;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
:host([scale=l][hour-display-format="24"]) .time-picker {
|
|
241
|
-
width: 134px;
|
|
201
|
+
.time-picker.scale-l .button,
|
|
202
|
+
.time-picker.scale-l .input {
|
|
203
|
+
padding-left: 1.25rem;
|
|
204
|
+
padding-right: 1.25rem;
|
|
205
|
+
padding-top: 0.75rem;
|
|
206
|
+
padding-bottom: 0.75rem;
|
|
242
207
|
}
|
|
243
208
|
|
|
244
|
-
|
|
245
|
-
|
|
209
|
+
.time-picker.scale-l:not(.show-meridiem) .delimiter:last-child {
|
|
210
|
+
padding-inline-end: 1.25rem;
|
|
246
211
|
}
|