@esri/calcite-components 1.0.0-next.317 → 1.0.0-next.320

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.
Files changed (110) hide show
  1. package/dist/calcite/assets/calcite-icon/centerAlign16.json +1 -0
  2. package/dist/calcite/assets/calcite-icon/centerAlign24.json +1 -0
  3. package/dist/calcite/assets/calcite-icon/centerAlign32.json +1 -0
  4. package/dist/calcite/assets/calcite-icon/convert16.json +1 -0
  5. package/dist/calcite/assets/calcite-icon/convert24.json +1 -0
  6. package/dist/calcite/assets/calcite-icon/convert32.json +1 -0
  7. package/dist/calcite/assets/calcite-icon/formDropdown16.json +1 -0
  8. package/dist/calcite/assets/calcite-icon/formDropdown24.json +1 -0
  9. package/dist/calcite/assets/calcite-icon/formDropdown32.json +1 -0
  10. package/dist/calcite/assets/calcite-icon/language16.json +1 -0
  11. package/dist/calcite/assets/calcite-icon/language24.json +1 -0
  12. package/dist/calcite/assets/calcite-icon/language32.json +1 -0
  13. package/dist/calcite/assets/calcite-icon/languageTranslate16.json +1 -0
  14. package/dist/calcite/assets/calcite-icon/languageTranslate24.json +1 -0
  15. package/dist/calcite/assets/calcite-icon/languageTranslate32.json +1 -0
  16. package/dist/calcite/assets/calcite-icon/leftAlign16.json +1 -0
  17. package/dist/calcite/assets/calcite-icon/leftAlign24.json +1 -0
  18. package/dist/calcite/assets/calcite-icon/leftAlign32.json +1 -0
  19. package/dist/calcite/assets/calcite-icon/terminal16.json +1 -0
  20. package/dist/calcite/assets/calcite-icon/terminal24.json +1 -0
  21. package/dist/calcite/assets/calcite-icon/terminal32.json +1 -0
  22. package/dist/calcite/assets/calcite-icon/touch16.json +1 -0
  23. package/dist/calcite/assets/calcite-icon/touch24.json +1 -0
  24. package/dist/calcite/assets/calcite-icon/touch32.json +1 -0
  25. package/dist/calcite/calcite.esm.js +1 -1
  26. package/dist/calcite/p-1480eb2d.entry.js +5 -0
  27. package/dist/calcite/p-2cd9d307.entry.js +5 -0
  28. package/dist/calcite/p-6e050609.entry.js +5 -0
  29. package/dist/calcite/p-8e252799.system.js +1 -1
  30. package/dist/calcite/p-96bbc815.system.entry.js +5 -0
  31. package/dist/calcite/p-cb55c32c.system.entry.js +5 -0
  32. package/dist/calcite/p-e817ded0.entry.js +5 -0
  33. package/dist/calcite/{p-44a07313.system.entry.js → p-f7b5dd98.system.entry.js} +1 -1
  34. package/dist/calcite/p-fa9a1d8f.system.entry.js +5 -0
  35. package/dist/cjs/calcite-action-bar.cjs.entry.js +24 -0
  36. package/dist/cjs/calcite-color-picker_3.cjs.entry.js +3 -3
  37. package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +349 -223
  38. package/dist/cjs/calcite-panel.cjs.entry.js +3 -3
  39. package/dist/cjs/calcite.cjs.js +1 -1
  40. package/dist/cjs/loader.cjs.js +1 -1
  41. package/dist/collection/components/calcite-action-bar/calcite-action-bar.js +3 -0
  42. package/dist/collection/components/calcite-filter/calcite-filter.js +1 -1
  43. package/dist/collection/components/calcite-icon/assets/calcite-icon/centerAlign16.json +1 -0
  44. package/dist/collection/components/calcite-icon/assets/calcite-icon/centerAlign24.json +1 -0
  45. package/dist/collection/components/calcite-icon/assets/calcite-icon/centerAlign32.json +1 -0
  46. package/dist/collection/components/calcite-icon/assets/calcite-icon/convert16.json +1 -0
  47. package/dist/collection/components/calcite-icon/assets/calcite-icon/convert24.json +1 -0
  48. package/dist/collection/components/calcite-icon/assets/calcite-icon/convert32.json +1 -0
  49. package/dist/collection/components/calcite-icon/assets/calcite-icon/formDropdown16.json +1 -0
  50. package/dist/collection/components/calcite-icon/assets/calcite-icon/formDropdown24.json +1 -0
  51. package/dist/collection/components/calcite-icon/assets/calcite-icon/formDropdown32.json +1 -0
  52. package/dist/collection/components/calcite-icon/assets/calcite-icon/language16.json +1 -0
  53. package/dist/collection/components/calcite-icon/assets/calcite-icon/language24.json +1 -0
  54. package/dist/collection/components/calcite-icon/assets/calcite-icon/language32.json +1 -0
  55. package/dist/collection/components/calcite-icon/assets/calcite-icon/languageTranslate16.json +1 -0
  56. package/dist/collection/components/calcite-icon/assets/calcite-icon/languageTranslate24.json +1 -0
  57. package/dist/collection/components/calcite-icon/assets/calcite-icon/languageTranslate32.json +1 -0
  58. package/dist/collection/components/calcite-icon/assets/calcite-icon/leftAlign16.json +1 -0
  59. package/dist/collection/components/calcite-icon/assets/calcite-icon/leftAlign24.json +1 -0
  60. package/dist/collection/components/calcite-icon/assets/calcite-icon/leftAlign32.json +1 -0
  61. package/dist/collection/components/calcite-icon/assets/calcite-icon/terminal16.json +1 -0
  62. package/dist/collection/components/calcite-icon/assets/calcite-icon/terminal24.json +1 -0
  63. package/dist/collection/components/calcite-icon/assets/calcite-icon/terminal32.json +1 -0
  64. package/dist/collection/components/calcite-icon/assets/calcite-icon/touch16.json +1 -0
  65. package/dist/collection/components/calcite-icon/assets/calcite-icon/touch24.json +1 -0
  66. package/dist/collection/components/calcite-icon/assets/calcite-icon/touch32.json +1 -0
  67. package/dist/collection/components/calcite-input-time-picker/calcite-input-time-picker.js +81 -76
  68. package/dist/collection/components/calcite-panel/calcite-panel.js +3 -3
  69. package/dist/collection/components/calcite-time-picker/calcite-time-picker.css +56 -91
  70. package/dist/collection/components/calcite-time-picker/calcite-time-picker.js +254 -289
  71. package/dist/collection/components/calcite-time-picker/resources.js +15 -9
  72. package/dist/collection/utils/conditionalSlot.js +26 -0
  73. package/dist/collection/utils/time.js +144 -36
  74. package/dist/components/calcite-action-bar.js +25 -1
  75. package/dist/components/calcite-color-picker-swatch2.js +3 -3
  76. package/dist/components/calcite-input-time-picker.js +51 -48
  77. package/dist/components/calcite-panel.js +3 -3
  78. package/dist/components/calcite-time-picker2.js +320 -187
  79. package/dist/custom-elements/index.js +381 -231
  80. package/dist/esm/calcite-action-bar.entry.js +25 -1
  81. package/dist/esm/calcite-color-picker_3.entry.js +3 -3
  82. package/dist/esm/calcite-input-time-picker_2.entry.js +349 -223
  83. package/dist/esm/calcite-panel.entry.js +3 -3
  84. package/dist/esm/calcite.js +1 -1
  85. package/dist/esm/loader.js +1 -1
  86. package/dist/esm-es5/calcite-action-bar.entry.js +1 -1
  87. package/dist/esm-es5/calcite-color-picker_3.entry.js +1 -1
  88. package/dist/esm-es5/calcite-input-time-picker_2.entry.js +2 -2
  89. package/dist/esm-es5/calcite-panel.entry.js +1 -1
  90. package/dist/esm-es5/calcite.js +1 -1
  91. package/dist/esm-es5/loader.js +1 -1
  92. package/dist/extras/docs-json.json +23 -101
  93. package/dist/types/components/calcite-action-bar/calcite-action-bar.d.ts +2 -1
  94. package/dist/types/components/calcite-input-time-picker/calcite-input-time-picker.d.ts +12 -4
  95. package/dist/types/components/calcite-panel/calcite-panel.d.ts +1 -1
  96. package/dist/types/components/calcite-time-picker/calcite-time-picker.d.ts +35 -23
  97. package/dist/types/components/calcite-time-picker/resources.d.ts +14 -8
  98. package/dist/types/components.d.ts +17 -41
  99. package/dist/types/utils/conditionalSlot.d.ts +17 -0
  100. package/dist/types/utils/time.d.ts +18 -5
  101. package/hydrate/index.js +399 -239
  102. package/package.json +11 -11
  103. package/readme.md +2 -2
  104. package/dist/calcite/p-12a9599d.system.entry.js +0 -5
  105. package/dist/calcite/p-88784777.system.entry.js +0 -5
  106. package/dist/calcite/p-9634f89d.entry.js +0 -5
  107. package/dist/calcite/p-b37b7b9e.system.entry.js +0 -5
  108. package/dist/calcite/p-e1da1646.entry.js +0 -5
  109. package/dist/calcite/p-e78e743b.entry.js +0 -5
  110. package/dist/calcite/p-f333e31b.entry.js +0 -5
@@ -0,0 +1 @@
1
+ "M12.503 4.142l-.707-.707L13.3 1.932l.707.707zM10 1.134H9v2.833h1zm-2.86 2.3L5.637 1.933l-.707.707 1.503 1.503zm11.835 10.788a1.418 1.418 0 0 0-1.466-1.489 4.475 4.475 0 0 0-.693.064l-.042-.016A1.388 1.388 0 0 0 15.478 12a1.788 1.788 0 0 0-.587.064A1.84 1.84 0 0 0 13 11.06a2.768 2.768 0 0 0-1 .167V6.9a1.905 1.905 0 0 0-2-1.846A1.905 1.905 0 0 0 8 6.9v6.954L6.979 12.64a1.624 1.624 0 0 0-1.066-.733 1.775 1.775 0 0 0-1.264.161 1.478 1.478 0 0 0-.71.968 1.588 1.588 0 0 0 .167 1.137l2.154 4.38 3.32 4.064.773-.635-3.221-3.921-2.144-4.359a.619.619 0 0 1-.074-.446.485.485 0 0 1 .235-.322.796.796 0 0 1 .543-.051.708.708 0 0 1 .47.328L9 16.6V6.9a.908.908 0 0 1 1-.846.908.908 0 0 1 1 .846V14h1v-1.379c0-.373.336-.562 1-.562.374 0 1 .073 1 .562V14h1v-.563c0-.36.111-.47.478-.47.507 0 .522.684.522.762v1.063h1V13.76l-.005.002.005-.008v.006c.011-.005.362-.027.508-.027.129 0 .492.156.492.761.022.245 0 2.992 0 4.093a7.863 7.863 0 0 1-.463 2.657c-.16.421-.56 1.221-.56 1.221l.918.43s.272-.606.398-.925a7.32 7.32 0 0 0 .471-1.57A26.038 26.038 0 0 0 19 17.07z"
@@ -0,0 +1 @@
1
+ "M16.9 6.687l-.707-.707 1.99-1.99.706.707zM15 1h-1v3.953h1zm11 17.814A1.901 1.901 0 0 0 24.1 17a2.791 2.791 0 0 0-1.345.306l-.02-.015A1.903 1.903 0 0 0 20.94 16a2.54 2.54 0 0 0-1.083.207A2.02 2.02 0 0 0 18 15a2.045 2.045 0 0 0-1 .268V9.906a2.002 2.002 0 0 0-4 0v8.976l-2.242-2.993a1.957 1.957 0 0 0-2.657-.652 1.89 1.89 0 0 0-.655 2.573l3.4 6.963 3.45 5.288.839-.547-3.42-5.233-3.364-6.895a.931.931 0 0 1 .25-1.283.968.968 0 0 1 1.354.381L14 21.886V9.906a1.005 1.005 0 0 1 2 0v9.438h1v-2.456a1.005 1.005 0 0 1 2 0v2.456h1.034V17.52c0-.182 0-.521.906-.521a.907.907 0 0 1 .907.906v1.438H23v-.469c0-.505.596-.875 1.1-.875a.906.906 0 0 1 .902.874c.002.03-.002 5.427-.002 5.427a11.653 11.653 0 0 1-.188 2.523 7.87 7.87 0 0 1-1.869 3.586l.725.689a8.122 8.122 0 0 0 2.12-3.962 11.444 11.444 0 0 0 .178-1.24c.036-.417.034-.834.034-.834s.008-6.14 0-6.248zM12.811 5.84l-1.989-1.99-.707.708 1.989 1.989z"
@@ -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 { parseTimeString, formatTimeString, getMeridiem, getMeridiemHour } from "../../utils/time";
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
- /** Format of the hour value (12-hour or 24-hour) (this will be replaced by locale eventually) */
22
- this.hourDisplayFormat = "12";
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 newValue = formatTimeString(this.calciteInputEl.value) || formatTimeString(this.value);
47
- if (newValue !== this.calciteInputEl.value) {
48
- this.setInputValue(newValue);
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
- this.setValue({ value: event.detail.value });
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
- if (this.hourDisplayFormat === "12") {
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 validatedNewValue = formatTimeString(value);
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 && validatedNewValue) ||
82
- (validatedNewValue !== this.previousValidValue && validatedNewValue));
86
+ !!(!this.previousValidValue && newValue) ||
87
+ (newValue !== this.previousValidValue && newValue));
83
88
  if (value) {
84
89
  if (shouldEmit) {
85
- this.previousValidValue = validatedNewValue;
90
+ this.previousValidValue = newValue;
86
91
  }
87
- if (validatedNewValue && validatedNewValue !== this.value) {
88
- this.value = validatedNewValue;
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(validatedNewValue);
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 = validatedNewValue;
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
- if (this.calciteInputEl.value !== this.value) {
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", { hour: hour, "hour-display-format": this.hourDisplayFormat, 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, minute: minute, scale: this.scale, second: second, step: this.step })),
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": "keyup",
611
- "method": "keyUpHandler",
615
+ "name": "click",
616
+ "method": "clickHandler",
612
617
  "target": undefined,
613
618
  "capture": false,
614
619
  "passive": false
615
620
  }, {
616
- "name": "calciteTimePickerBlur",
617
- "method": "timePickerBlurHandler",
621
+ "name": "keyup",
622
+ "method": "keyUpHandler",
618
623
  "target": undefined,
619
624
  "capture": false,
620
625
  "passive": false
621
626
  }, {
622
- "name": "calciteTimePickerChange",
623
- "method": "timePickerChangeHandler",
627
+ "name": "calciteTimePickerBlur",
628
+ "method": "timePickerBlurHandler",
624
629
  "target": undefined,
625
630
  "capture": false,
626
631
  "passive": false
@@ -63,7 +63,7 @@ export class CalcitePanel {
63
63
  this.setBackRef = (node) => {
64
64
  this.backButtonEl = node;
65
65
  };
66
- this.panelKeyUpHandler = (event) => {
66
+ this.panelKeyDownHandler = (event) => {
67
67
  if (event.key === "Escape") {
68
68
  this.dismiss();
69
69
  }
@@ -200,12 +200,12 @@ export class CalcitePanel {
200
200
  h("slot", { name: SLOTS.fab })));
201
201
  }
202
202
  render() {
203
- const { dismissed, disabled, dismissible, el, loading, panelKeyUpHandler } = this;
203
+ const { dismissed, disabled, dismissible, el, loading, panelKeyDownHandler } = this;
204
204
  const rtl = getElementDir(el) === "rtl";
205
205
  const panelNode = (h("article", { "aria-busy": loading.toString(), class: {
206
206
  [CSS.container]: true,
207
207
  [CSS_UTILITY.rtl]: rtl
208
- }, hidden: dismissible && dismissed, onKeyUp: panelKeyUpHandler, ref: this.setContainerRef, tabIndex: dismissible ? 0 : -1 },
208
+ }, hidden: dismissible && dismissed, onKeyDown: panelKeyDownHandler, ref: this.setContainerRef, tabIndex: dismissible ? 0 : -1 },
209
209
  this.renderHeaderNode(),
210
210
  this.renderContent(),
211
211
  this.renderFooterSlottedContent() || this.renderFooterActions()));
@@ -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
- border-radius: var(--calcite-border-radius);
105
+ flex-direction: column;
100
106
  }
101
107
 
102
- span {
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
- span.button {
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
- span.button:active {
122
+ .time-picker .button:active {
123
123
  background-color: var(--calcite-ui-foreground-3);
124
124
  }
125
125
 
126
- span.button.top-left {
126
+ .time-picker .button.top-left {
127
127
  border-top-left-radius: var(--calcite-border-radius);
128
128
  }
129
129
 
130
- span.button.bottom-left {
130
+ .time-picker .button.bottom-left {
131
131
  border-bottom-left-radius: var(--calcite-border-radius);
132
132
  }
133
133
 
134
- span.button.top-right {
134
+ .time-picker .button.top-right {
135
135
  border-top-right-radius: var(--calcite-border-radius);
136
136
  }
137
137
 
138
- span.button.bottom-right {
138
+ .time-picker .button.bottom-right {
139
139
  border-bottom-right-radius: var(--calcite-border-radius);
140
140
  }
141
141
 
142
- span.button calcite-icon {
142
+ .time-picker .button calcite-icon {
143
143
  color: var(--calcite-ui-text-3);
144
144
  }
145
145
 
146
- span.input {
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
- position: relative;
150
+ display: inline-flex;
151
+ align-items: center;
152
+ justify-content: center;
149
153
  }
150
154
 
151
- span.input:hover {
155
+ .time-picker .input:hover {
152
156
  box-shadow: inset 0 0 0 2px var(--calcite-ui-foreground-2);
153
157
  }
154
158
 
155
- span.input:focus, span.input:hover:focus {
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
- :host([scale=s]) {
165
+ .time-picker.scale-s {
162
166
  font-size: var(--calcite-font-size--1);
163
167
  }
164
168
 
165
- :host([scale=s]) span {
166
- height: 24px;
167
- width: 40px;
168
- }
169
-
170
- :host([scale=s]) .delimiter {
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
- :host([scale=s][hour-display-format="24"]) .time-picker {
183
- width: 84.2px;
177
+ .time-picker.scale-s:not(.show-meridiem) .delimiter:last-child {
178
+ padding-inline-end: 0.75rem;
184
179
  }
185
180
 
186
- :host([scale=s][hour-display-format="24"]:not([step="60"])) .time-picker {
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
- :host([scale=m]) span {
195
- height: 32px;
196
- width: 44px;
197
- }
198
-
199
- :host([scale=m]) .delimiter {
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
- :host([scale=m][hour-display-format="12"]:not([step="60"])) .time-picker {
208
- width: 186px;
193
+ .time-picker.scale-m:not(.show-meridiem) .delimiter:last-child {
194
+ padding-inline-end: 1rem;
209
195
  }
210
196
 
211
- :host([scale=m][hour-display-format="24"]) .time-picker {
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
- :host([scale=l]) span {
224
- height: 48px;
225
- width: 64px;
226
- }
227
-
228
- :host([scale=l]) .delimiter {
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
- :host([scale=l][hour-display-format="24"]:not([step="60"])) .time-picker {
245
- width: 204px;
209
+ .time-picker.scale-l:not(.show-meridiem) .delimiter:last-child {
210
+ padding-inline-end: 1.25rem;
246
211
  }