@redvars/peacock 3.10.1 → 3.11.0
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/BaseInput-CV0pZgSb.js +58 -0
- package/dist/BaseInput-CV0pZgSb.js.map +1 -0
- package/dist/app-bar.js +16 -16
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/assets/theme.d.ts +66 -0
- package/dist/assets/theme.js +134 -0
- package/dist/assets/tokens.css +1 -1
- package/dist/assets/tokens.css.map +1 -1
- package/dist/base-progress-CLZTRveO.js +33 -0
- package/dist/base-progress-CLZTRveO.js.map +1 -0
- package/dist/bottom-sheet.js +1 -1
- package/dist/button-group.js +9 -7
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +225 -187
- package/dist/button.js.map +1 -1
- package/dist/{chart-bar-CapLbc2e.js → chart-bar-D5dGFJfK.js} +2 -2
- package/dist/{chart-bar-CapLbc2e.js.map → chart-bar-D5dGFJfK.js.map} +1 -1
- package/dist/chart-bar.js +1 -1
- package/dist/chart-stacked-bar.js +1 -1
- package/dist/checkbox.js +78 -53
- package/dist/checkbox.js.map +1 -1
- package/dist/chip-set.js +52 -0
- package/dist/chip-set.js.map +1 -0
- package/dist/chip.js +8 -6
- package/dist/chip.js.map +1 -1
- package/dist/circular-progress.js +177 -0
- package/dist/circular-progress.js.map +1 -0
- package/dist/code-editor.js +129 -72
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +2 -38
- package/dist/code-highlighter.js.map +1 -1
- package/dist/color-field.js +309 -0
- package/dist/color-field.js.map +1 -0
- package/dist/color-picker.js +26 -15
- package/dist/color-picker.js.map +1 -1
- package/dist/copy-to-clipboard-upGx-Ueo.js +39 -0
- package/dist/copy-to-clipboard-upGx-Ueo.js.map +1 -0
- package/dist/custom-elements-jsdocs.json +1044 -382
- package/dist/custom-elements.json +8615 -4726
- package/dist/date-picker.js +241 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/{element-internals-2CMts_0M.js → delegate-py-Ets8N.js} +2 -43
- package/dist/delegate-py-Ets8N.js.map +1 -0
- package/dist/element-internals-QME0yEz4.js +43 -0
- package/dist/element-internals-QME0yEz4.js.map +1 -0
- package/dist/fab.js +51 -49
- package/dist/fab.js.map +1 -1
- package/dist/field.js +25 -0
- package/dist/field.js.map +1 -1
- package/dist/flow.js +5 -5
- package/dist/form-associated-Bhwwr6dT.js +162 -0
- package/dist/form-associated-Bhwwr6dT.js.map +1 -0
- package/dist/{form-associated-BXADnjOB.js → form-submitter-DPI4L6gj.js} +3 -159
- package/dist/form-submitter-DPI4L6gj.js.map +1 -0
- package/dist/html-editor.js +3 -1
- package/dist/html-editor.js.map +1 -1
- package/dist/icon-button.js +195 -156
- package/dist/icon-button.js.map +1 -1
- package/dist/image.js +2 -2
- package/dist/index.js +32 -8
- package/dist/index.js.map +1 -1
- package/dist/input.js +259 -0
- package/dist/input.js.map +1 -0
- package/dist/item.js +2 -1
- package/dist/item.js.map +1 -1
- package/dist/linear-progress.js +192 -0
- package/dist/linear-progress.js.map +1 -0
- package/dist/{list-AdO-PUq_.js → list-item.js} +12 -222
- package/dist/list-item.js.map +1 -0
- package/dist/list.js +225 -6
- package/dist/list.js.map +1 -1
- package/dist/loader-full.js +31 -8
- package/dist/loader-full.js.map +1 -1
- package/dist/loader.js +52 -12
- package/dist/loader.js.map +1 -1
- package/dist/markdown-editor.js +5 -3
- package/dist/markdown-editor.js.map +1 -1
- package/dist/menu-item.js +30 -30
- package/dist/navigation-bar-item.js +41 -0
- package/dist/navigation-bar-item.js.map +1 -0
- package/dist/navigation-bar.js +128 -0
- package/dist/navigation-bar.js.map +1 -0
- package/dist/navigation-drawer-item.js +236 -0
- package/dist/navigation-drawer-item.js.map +1 -0
- package/dist/navigation-drawer.js +293 -0
- package/dist/navigation-drawer.js.map +1 -0
- package/dist/navigation-rail.js +1 -1
- package/dist/number-field.js +280 -0
- package/dist/number-field.js.map +1 -0
- package/dist/pagination.js +1 -1
- package/dist/radio-group.js +209 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/radio.js +47 -37
- package/dist/radio.js.map +1 -1
- package/dist/segmented-button-group.js +12 -0
- package/dist/segmented-button-group.js.map +1 -1
- package/dist/segmented-button.js +10 -6
- package/dist/segmented-button.js.map +1 -1
- package/dist/select.js +653 -0
- package/dist/select.js.map +1 -0
- package/dist/side-sheet.js +1 -1
- package/dist/sidebar-menu-item.js +273 -0
- package/dist/sidebar-menu-item.js.map +1 -0
- package/dist/sidebar-menu.js +193 -0
- package/dist/sidebar-menu.js.map +1 -0
- package/dist/sidebar-sub-menu.js +301 -0
- package/dist/sidebar-sub-menu.js.map +1 -0
- package/dist/slider.js +76 -24
- package/dist/slider.js.map +1 -1
- package/dist/snackbar.js +3 -3
- package/dist/snackbar.js.map +1 -1
- package/dist/split-button.js +2 -2
- package/dist/src/__internal/utils/size.d.ts +9 -0
- package/dist/src/button/ButtonTypes.d.ts +1 -1
- package/dist/src/checkbox/checkbox.d.ts +28 -22
- package/dist/src/chip/chip/chip.d.ts +3 -0
- package/dist/src/chip/tag/tag.d.ts +5 -1
- package/dist/src/code-editor/code-editor.d.ts +37 -10
- package/dist/src/color-field/color-field.d.ts +55 -0
- package/dist/src/color-field/index.d.ts +1 -0
- package/dist/src/color-picker/color-picker.d.ts +1 -1
- package/dist/src/date-picker/date-picker.d.ts +0 -1
- package/dist/src/index.d.ts +4 -3
- package/dist/src/input/BaseInput.d.ts +21 -3
- package/dist/src/input/input.d.ts +15 -7
- package/dist/src/navigation-bar/index.d.ts +2 -0
- package/dist/src/navigation-bar/navigation-bar-item.d.ts +23 -0
- package/dist/src/navigation-bar/navigation-bar.d.ts +44 -0
- package/dist/src/navigation-drawer/index.d.ts +2 -0
- package/dist/src/navigation-drawer/navigation-drawer-item.d.ts +48 -0
- package/dist/src/navigation-drawer/navigation-drawer.d.ts +70 -0
- package/dist/src/number-field/number-field.d.ts +0 -1
- package/dist/src/radio/index.d.ts +1 -0
- package/dist/src/radio/radio-group.d.ts +50 -0
- package/dist/src/radio/radio.d.ts +18 -18
- package/dist/src/segmented-button/segmented-button-group.d.ts +5 -0
- package/dist/src/segmented-button/segmented-button.d.ts +2 -1
- package/dist/src/select/select.d.ts +6 -0
- package/dist/src/slider/slider.d.ts +14 -5
- package/dist/src/switch/switch.d.ts +22 -26
- package/dist/src/tabs/tabs.d.ts +3 -0
- package/dist/src/textarea/textarea.d.ts +0 -1
- package/dist/src/time-picker/time-picker.d.ts +0 -1
- package/dist/src/toolbar/toolbar.d.ts +7 -4
- package/dist/src/url-field/url-field.d.ts +0 -1
- package/dist/svg.js +5 -5
- package/dist/switch.js +413 -0
- package/dist/switch.js.map +1 -0
- package/dist/tab.js +2 -1
- package/dist/tab.js.map +1 -1
- package/dist/tabs.js +10 -8
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +349 -0
- package/dist/tag.js.map +1 -0
- package/dist/test/code-editor.test.d.ts +1 -0
- package/dist/test/color-field.test.d.ts +1 -0
- package/dist/test/color-picker.test.d.ts +1 -0
- package/dist/test/field.test.d.ts +1 -0
- package/dist/test/form-controls.test.d.ts +1 -0
- package/dist/test/icon.test.d.ts +1 -1
- package/dist/test/input.test.d.ts +1 -0
- package/dist/test/navigation.test.d.ts +1 -0
- package/dist/test/segmented-button.test.d.ts +1 -0
- package/dist/test/slider.test.d.ts +1 -0
- package/dist/textarea.js +237 -0
- package/dist/textarea.js.map +1 -0
- package/dist/time-picker.js +241 -0
- package/dist/time-picker.js.map +1 -0
- package/dist/toolbar.js +26 -9
- package/dist/toolbar.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/url-field.js +298 -0
- package/dist/url-field.js.map +1 -0
- package/package.json +29 -8
- package/readme.md +2 -2
- package/scss/tokens.css +175 -18
- package/src/__internal/utils/size.ts +23 -0
- package/src/app-bar/app-bar.scss +4 -16
- package/src/bottom-sheet/bottom-sheet.scss +1 -1
- package/src/button/ButtonTypes.ts +2 -0
- package/src/button/button/button-base.scss +84 -84
- package/src/button/button/button-colors.scss +14 -2
- package/src/button/button/button-layers.scss +71 -71
- package/src/button/button/button-shapes.scss +2 -2
- package/src/button/button/button-sizes.scss +35 -35
- package/src/button/button/button.scss +1 -1
- package/src/button/button/button.ts +1 -2
- package/src/button/button-group/button-group.scss +5 -5
- package/src/button/fab/fab-sizes.scss +15 -15
- package/src/button/fab/fab.scss +32 -32
- package/src/button/icon-button/icon-button-sizes.scss +7 -7
- package/src/chart-bar/chart-bar.scss +1 -1
- package/src/checkbox/checkbox.scss +7 -6
- package/src/checkbox/checkbox.ts +92 -40
- package/src/chip/chip/chip.ts +8 -5
- package/src/chip/chip-set/chip-set.ts +2 -0
- package/src/chip/tag/tag-colors.scss +1 -1
- package/src/chip/tag/tag-sizes.scss +9 -0
- package/src/chip/tag/tag.scss +1 -1
- package/src/chip/tag/tag.ts +20 -9
- package/src/code-editor/code-editor.scss +8 -3
- package/src/code-editor/code-editor.ts +148 -79
- package/src/code-highlighter/code-highlighter.scss +1 -1
- package/src/color-field/color-field.scss +48 -0
- package/src/color-field/color-field.ts +239 -0
- package/src/color-field/index.ts +1 -0
- package/src/color-picker/color-picker.scss +33 -15
- package/src/color-picker/color-picker.ts +2 -1
- package/src/date-picker/date-picker.ts +2 -3
- package/src/field/field.scss +31 -0
- package/src/flow/flow.scss +5 -5
- package/src/image/image.scss +2 -2
- package/src/index.ts +7 -3
- package/src/input/BaseInput.ts +54 -4
- package/src/input/input.ts +104 -79
- package/src/list/list-item.ts +2 -0
- package/src/loader.ts +28 -6
- package/src/markdown-editor/markdown-editor.scss +2 -2
- package/src/menu/menu-item/menu-item.scss +30 -30
- package/src/navigation-bar/index.ts +2 -0
- package/src/navigation-bar/navigation-bar-item.ts +25 -0
- package/src/navigation-bar/navigation-bar.scss +27 -0
- package/src/navigation-bar/navigation-bar.ts +96 -0
- package/src/navigation-drawer/index.ts +2 -0
- package/src/navigation-drawer/navigation-drawer-item.scss +82 -0
- package/src/navigation-drawer/navigation-drawer-item.ts +133 -0
- package/src/navigation-drawer/navigation-drawer.scss +99 -0
- package/src/navigation-drawer/navigation-drawer.ts +196 -0
- package/src/navigation-rail/navigation-rail.scss +1 -1
- package/src/number-field/number-field.ts +2 -3
- package/src/pagination/pagination.scss +1 -1
- package/src/progress/circular-progress/circular-progress.ts +2 -0
- package/src/progress/linear-progress/linear-progress.ts +2 -0
- package/src/radio/index.ts +1 -0
- package/src/radio/radio-group.scss +39 -0
- package/src/radio/radio-group.ts +167 -0
- package/src/radio/radio.ts +74 -31
- package/src/segmented-button/segmented-button-group.ts +12 -0
- package/src/segmented-button/segmented-button.ts +12 -6
- package/src/select/select.ts +21 -1
- package/src/side-sheet/side-sheet.scss +1 -1
- package/src/sidebar-menu/sidebar-menu-item.scss +1 -1
- package/src/sidebar-menu/sidebar-menu-item.ts +2 -0
- package/src/sidebar-menu/sidebar-menu.ts +2 -0
- package/src/sidebar-menu/sidebar-sub-menu.scss +1 -1
- package/src/sidebar-menu/sidebar-sub-menu.ts +2 -0
- package/src/slider/slider.scss +3 -3
- package/src/slider/slider.ts +119 -31
- package/src/snackbar/snackbar.ts +3 -3
- package/src/split-button/split-button-colors.scss +2 -2
- package/src/svg/svg.scss +5 -5
- package/src/switch/switch.scss +0 -1
- package/src/switch/switch.ts +82 -47
- package/src/tabs/tab.scss +2 -1
- package/src/tabs/tabs.ts +14 -8
- package/src/textarea/textarea.ts +2 -3
- package/src/time-picker/time-picker.ts +2 -3
- package/src/toolbar/toolbar.scss +4 -4
- package/src/toolbar/toolbar.ts +12 -5
- package/src/url-field/url-field.ts +2 -3
- package/dist/BaseInput-CU1zZYKc.js +0 -27
- package/dist/BaseInput-CU1zZYKc.js.map +0 -1
- package/dist/brand-loader.js +0 -358
- package/dist/brand-loader.js.map +0 -1
- package/dist/element-internals-2CMts_0M.js.map +0 -1
- package/dist/form-associated-BXADnjOB.js.map +0 -1
- package/dist/list-AdO-PUq_.js.map +0 -1
- package/dist/select-DkyRqUTI.js +0 -3955
- package/dist/select-DkyRqUTI.js.map +0 -1
- package/dist/src/brand-loader/brand-loader.d.ts +0 -33
- package/dist/src/brand-loader/index.d.ts +0 -2
- package/src/brand-loader/brand-loader.scss +0 -270
- package/src/brand-loader/brand-loader.ts +0 -115
- package/src/brand-loader/index.ts +0 -2
- /package/dist/test/{brand-loader.test.d.ts → button.test.d.ts} +0 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { i, _ as __decorate, I as IndividualComponent, b } from './IndividualComponent-Bdwyrvd6.js';
|
|
2
|
+
import { n } from './property-B49QQ8pS.js';
|
|
3
|
+
import { r } from './state-DkTK9EGF.js';
|
|
4
|
+
import { e } from './query-CHb9Ft_d.js';
|
|
5
|
+
import { r as redispatchEvent } from './dispatch-event-utils-CuEqjlPT.js';
|
|
6
|
+
import { s as spread } from './spread-B5cgadZl.js';
|
|
7
|
+
import { B as BaseInput } from './BaseInput-CV0pZgSb.js';
|
|
8
|
+
import './base-Cl6v8-BZ.js';
|
|
9
|
+
import './directive-ZPhl09Yt.js';
|
|
10
|
+
import './element-internals-QME0yEz4.js';
|
|
11
|
+
import './form-associated-Bhwwr6dT.js';
|
|
12
|
+
|
|
13
|
+
var css_248z = i`* {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
-webkit-tap-highlight-color: transparent;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.screen-reader-only {
|
|
19
|
+
display: none !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[hidden] {
|
|
23
|
+
display: none !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host {
|
|
27
|
+
display: block;
|
|
28
|
+
width: 100%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.input-element {
|
|
32
|
+
border: none;
|
|
33
|
+
outline: none;
|
|
34
|
+
margin: 0;
|
|
35
|
+
padding: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.input-wrapper .input {
|
|
39
|
+
flex: 1;
|
|
40
|
+
width: 100%;
|
|
41
|
+
background: none;
|
|
42
|
+
cursor: inherit;
|
|
43
|
+
}
|
|
44
|
+
.input-wrapper .input::-webkit-inner-spin-button,
|
|
45
|
+
.input-wrapper .input::-webkit-calendar-picker-indicator {
|
|
46
|
+
display: none;
|
|
47
|
+
-webkit-appearance: none;
|
|
48
|
+
}`;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @label Time Picker
|
|
52
|
+
* @tag wc-time-picker
|
|
53
|
+
* @rawTag time-picker
|
|
54
|
+
* @summary The Time Picker component is used to capture time user input.
|
|
55
|
+
* @tags input
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```html
|
|
59
|
+
* <wc-time-picker label="Time" placeholder="Select a time"></wc-time-picker>
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
let TimePicker = class TimePicker extends BaseInput {
|
|
63
|
+
constructor() {
|
|
64
|
+
super(...arguments);
|
|
65
|
+
this.value = '';
|
|
66
|
+
this.placeholder = '';
|
|
67
|
+
this.label = '';
|
|
68
|
+
this.inline = false;
|
|
69
|
+
this.size = 'md';
|
|
70
|
+
this.autocomplete = 'off';
|
|
71
|
+
this.configAria = {};
|
|
72
|
+
this.variant = 'default';
|
|
73
|
+
/**
|
|
74
|
+
* Helper text to display below the input.
|
|
75
|
+
*/
|
|
76
|
+
this.helperText = '';
|
|
77
|
+
this.error = false;
|
|
78
|
+
this.errorText = '';
|
|
79
|
+
this.warning = false;
|
|
80
|
+
this.warningText = '';
|
|
81
|
+
this.focused = false;
|
|
82
|
+
this.passwordVisible = false;
|
|
83
|
+
/**
|
|
84
|
+
* Returns true when the text field has been interacted with. Native
|
|
85
|
+
* validation errors only display in response to user interactions.
|
|
86
|
+
*/
|
|
87
|
+
this.dirty = false;
|
|
88
|
+
}
|
|
89
|
+
connectedCallback() {
|
|
90
|
+
super.connectedCallback();
|
|
91
|
+
this.handleInitialAttributes();
|
|
92
|
+
}
|
|
93
|
+
handleInitialAttributes() {
|
|
94
|
+
if (this.hasAttribute('tabindex')) {
|
|
95
|
+
this.tabindex = this.getAttribute('tabindex') || undefined;
|
|
96
|
+
this.removeAttribute('tabindex');
|
|
97
|
+
}
|
|
98
|
+
Array.from(this.attributes).forEach(attr => {
|
|
99
|
+
if (attr.name.startsWith('aria-')) {
|
|
100
|
+
this.configAria[attr.name] = attr.value;
|
|
101
|
+
this.removeAttribute(attr.name);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
__handleInput(event) {
|
|
106
|
+
this.dirty = true;
|
|
107
|
+
this.value = event.target.value;
|
|
108
|
+
}
|
|
109
|
+
focus() {
|
|
110
|
+
this.inputElement?.focus();
|
|
111
|
+
}
|
|
112
|
+
blur() {
|
|
113
|
+
this.inputElement?.blur();
|
|
114
|
+
}
|
|
115
|
+
__handleFocusChange() {
|
|
116
|
+
// When calling focus() or reportValidity() during change, it's possible
|
|
117
|
+
// for blur to be called after the new focus event. Rather than set
|
|
118
|
+
// `this.focused` to true/false on focus/blur, we always set it to whether
|
|
119
|
+
// or not the input itself is focused.
|
|
120
|
+
this.focused = this.inputElement?.matches(':focus') ?? false;
|
|
121
|
+
}
|
|
122
|
+
__redispatchEvent(event) {
|
|
123
|
+
redispatchEvent(this, event);
|
|
124
|
+
}
|
|
125
|
+
render() {
|
|
126
|
+
return b `
|
|
127
|
+
<wc-field
|
|
128
|
+
?required=${this.required}
|
|
129
|
+
?disabled=${this.disabled}
|
|
130
|
+
?readonly=${this.readonly}
|
|
131
|
+
?skeleton=${this.skeleton}
|
|
132
|
+
helper-text=${this.helperText}
|
|
133
|
+
?error=${this.error}
|
|
134
|
+
error-text=${this.errorText}
|
|
135
|
+
?warning=${this.warning}
|
|
136
|
+
variant=${this.variant}
|
|
137
|
+
?populated=${!!this.value}
|
|
138
|
+
warning-text=${this.warningText}
|
|
139
|
+
label=${this.label}
|
|
140
|
+
?focused=${this.focused}
|
|
141
|
+
.host=${this}
|
|
142
|
+
class="input-wrapper"
|
|
143
|
+
>
|
|
144
|
+
<slot name="start" slot="field-start"></slot>
|
|
145
|
+
|
|
146
|
+
<input
|
|
147
|
+
class="input input-element"
|
|
148
|
+
name=${this.name}
|
|
149
|
+
type="time"
|
|
150
|
+
placeholder=${this.placeholder}
|
|
151
|
+
autocomplete=${this.autocomplete}
|
|
152
|
+
.value=${this.value}
|
|
153
|
+
?tabindex=${this.tabindex}
|
|
154
|
+
?readonly=${this.readonly}
|
|
155
|
+
?required=${this.required}
|
|
156
|
+
?disabled=${this.disabled}
|
|
157
|
+
@input=${this.__handleInput}
|
|
158
|
+
@change=${this.__redispatchEvent}
|
|
159
|
+
@focus=${this.__handleFocusChange}
|
|
160
|
+
@blur=${this.__handleFocusChange}
|
|
161
|
+
${spread(this.configAria)}
|
|
162
|
+
/>
|
|
163
|
+
|
|
164
|
+
<slot name="end" slot="field-end"></slot>
|
|
165
|
+
|
|
166
|
+
<wc-icon-button
|
|
167
|
+
slot="field-end"
|
|
168
|
+
color="secondary"
|
|
169
|
+
variant="text"
|
|
170
|
+
?disabled=${this.disabled}
|
|
171
|
+
@click=${() => {
|
|
172
|
+
setTimeout(() => {
|
|
173
|
+
// @ts-ignore
|
|
174
|
+
this.inputElement.showPicker();
|
|
175
|
+
});
|
|
176
|
+
}}
|
|
177
|
+
>
|
|
178
|
+
<wc-icon name="calendar_today"></wc-icon>
|
|
179
|
+
</wc-icon-button>
|
|
180
|
+
</wc-field>
|
|
181
|
+
`;
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
TimePicker.styles = [css_248z];
|
|
185
|
+
__decorate([
|
|
186
|
+
n({ type: String })
|
|
187
|
+
], TimePicker.prototype, "value", void 0);
|
|
188
|
+
__decorate([
|
|
189
|
+
n({ type: String })
|
|
190
|
+
], TimePicker.prototype, "placeholder", void 0);
|
|
191
|
+
__decorate([
|
|
192
|
+
n({ type: String })
|
|
193
|
+
], TimePicker.prototype, "label", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
n({ type: Boolean, reflect: true })
|
|
196
|
+
], TimePicker.prototype, "inline", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
n({ type: String, reflect: true })
|
|
199
|
+
], TimePicker.prototype, "size", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
n({ type: String })
|
|
202
|
+
], TimePicker.prototype, "autocomplete", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
n({ type: Object })
|
|
205
|
+
], TimePicker.prototype, "configAria", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
n({ type: String })
|
|
208
|
+
], TimePicker.prototype, "variant", void 0);
|
|
209
|
+
__decorate([
|
|
210
|
+
n({ type: String, attribute: 'helper-text' })
|
|
211
|
+
], TimePicker.prototype, "helperText", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
n({ type: Boolean })
|
|
214
|
+
], TimePicker.prototype, "error", void 0);
|
|
215
|
+
__decorate([
|
|
216
|
+
n({ type: String, attribute: 'error-text' })
|
|
217
|
+
], TimePicker.prototype, "errorText", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
n({ type: Boolean })
|
|
220
|
+
], TimePicker.prototype, "warning", void 0);
|
|
221
|
+
__decorate([
|
|
222
|
+
n({ type: String, attribute: 'warning-text' })
|
|
223
|
+
], TimePicker.prototype, "warningText", void 0);
|
|
224
|
+
__decorate([
|
|
225
|
+
r()
|
|
226
|
+
], TimePicker.prototype, "focused", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
r()
|
|
229
|
+
], TimePicker.prototype, "passwordVisible", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
r()
|
|
232
|
+
], TimePicker.prototype, "dirty", void 0);
|
|
233
|
+
__decorate([
|
|
234
|
+
e('.input-element')
|
|
235
|
+
], TimePicker.prototype, "inputElement", void 0);
|
|
236
|
+
TimePicker = __decorate([
|
|
237
|
+
IndividualComponent
|
|
238
|
+
], TimePicker);
|
|
239
|
+
|
|
240
|
+
export { TimePicker };
|
|
241
|
+
//# sourceMappingURL=time-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-picker.js","sources":["../../src/time-picker/time-picker.ts"],"sourcesContent":["import { html } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\n\nimport { redispatchEvent } from '@/__internal/utils/dispatch-event-utils.js';\nimport { spread } from '@/__internal/directive/spread.js';\n\nimport IndividualComponent from '@/IndividualComponent.js';\nimport BaseInput from '../input/BaseInput.js';\nimport styles from './time-picker.scss';\n\n/**\n * @label Time Picker\n * @tag wc-time-picker\n * @rawTag time-picker\n * @summary The Time Picker component is used to capture time user input.\n * @tags input\n *\n * @example\n * ```html\n * <wc-time-picker label=\"Time\" placeholder=\"Select a time\"></wc-time-picker>\n * ```\n */\n@IndividualComponent\nexport class TimePicker extends BaseInput {\n static styles = [styles];\n\n @property({ type: String })\n value = '';\n\n @property({ type: String }) placeholder = '';\n\n @property({ type: String }) label = '';\n\n @property({ type: Boolean, reflect: true }) inline = false;\n\n @property({ type: String, reflect: true }) size: 'sm' | 'md' | 'lg' = 'md';\n\n @property({ type: String }) autocomplete: 'on' | 'off' = 'off';\n\n @property({ type: Object }) configAria: Record<string, string> = {};\n\n @property({ type: String })\n variant: 'filled' | 'outlined' | 'default' = 'default';\n\n /**\n * Helper text to display below the input.\n */\n @property({ type: String, attribute: 'helper-text' })\n helperText: string = '';\n\n @property({ type: Boolean })\n error: boolean = false;\n\n @property({ type: String, attribute: 'error-text' })\n errorText: string = '';\n\n @property({ type: Boolean })\n warning: boolean = false;\n\n @property({ type: String, attribute: 'warning-text' })\n warningText: string = '';\n\n @state()\n private focused = false;\n\n @state()\n private passwordVisible = false;\n\n /**\n * Returns true when the text field has been interacted with. Native\n * validation errors only display in response to user interactions.\n */\n @state() private dirty = false;\n\n @query('.input-element')\n private inputElement?: HTMLInputElement;\n\n private tabindex?: string;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleInitialAttributes();\n }\n\n private handleInitialAttributes() {\n if (this.hasAttribute('tabindex')) {\n this.tabindex = this.getAttribute('tabindex') || undefined;\n this.removeAttribute('tabindex');\n }\n\n Array.from(this.attributes).forEach(attr => {\n if (attr.name.startsWith('aria-')) {\n this.configAria[attr.name] = attr.value;\n this.removeAttribute(attr.name);\n }\n });\n }\n\n private __handleInput(event: InputEvent) {\n this.dirty = true;\n this.value = (event.target as HTMLInputElement).value;\n }\n\n override focus() {\n this.inputElement?.focus();\n }\n\n override blur() {\n this.inputElement?.blur();\n }\n\n private __handleFocusChange() {\n // When calling focus() or reportValidity() during change, it's possible\n // for blur to be called after the new focus event. Rather than set\n // `this.focused` to true/false on focus/blur, we always set it to whether\n // or not the input itself is focused.\n this.focused = this.inputElement?.matches(':focus') ?? false;\n }\n\n private __redispatchEvent(event: Event) {\n redispatchEvent(this, event);\n }\n\n render() {\n return html`\n <wc-field\n ?required=${this.required}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?skeleton=${this.skeleton}\n helper-text=${this.helperText}\n ?error=${this.error}\n error-text=${this.errorText}\n ?warning=${this.warning}\n variant=${this.variant}\n ?populated=${!!this.value}\n warning-text=${this.warningText}\n label=${this.label}\n ?focused=${this.focused}\n .host=${this}\n class=\"input-wrapper\"\n >\n <slot name=\"start\" slot=\"field-start\"></slot>\n\n <input\n class=\"input input-element\"\n name=${this.name}\n type=\"time\"\n placeholder=${this.placeholder}\n autocomplete=${this.autocomplete}\n .value=${this.value}\n ?tabindex=${this.tabindex}\n ?readonly=${this.readonly}\n ?required=${this.required}\n ?disabled=${this.disabled}\n @input=${this.__handleInput}\n @change=${this.__redispatchEvent}\n @focus=${this.__handleFocusChange}\n @blur=${this.__handleFocusChange}\n ${spread(this.configAria)}\n />\n\n <slot name=\"end\" slot=\"field-end\"></slot>\n\n <wc-icon-button\n slot=\"field-end\"\n color=\"secondary\"\n variant=\"text\"\n ?disabled=${this.disabled}\n @click=${() => {\n setTimeout(() => {\n // @ts-ignore\n this.inputElement.showPicker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AAE,YAAY,EAAE;AAC5B,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAGvB,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;AACF,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAGzB,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE;AAC5B,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAGjB,UAAA,CAAA;AADP,IAAAC,CAAK;AACkB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAGhB,UAAA,CAAA;AADP,IAAAA,CAAK;AAC0B,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,MAAA,CAAA;AAMf,UAAA,CAAA;AAAhB,IAAAA,CAAK;AAAyB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAGvB,UAAA,CAAA;IADPC,CAAK,CAAC,gBAAgB;AACiB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AApD7B,UAAU,GAAA,UAAA,CAAA;IADtB;AACY,CAAA,EAAA,UAAU,CA8JtB;;;;"}
|
package/dist/toolbar.js
CHANGED
|
@@ -3,6 +3,21 @@ import { n } from './property-B49QQ8pS.js';
|
|
|
3
3
|
import { e } from './class-map-DG7CA1et.js';
|
|
4
4
|
import './directive-ZPhl09Yt.js';
|
|
5
5
|
|
|
6
|
+
const LEGACY_SIZES = {
|
|
7
|
+
small: 'sm',
|
|
8
|
+
medium: 'md',
|
|
9
|
+
large: 'lg',
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Maps a size attribute onto the `sm|md|lg` scale, accepting the deprecated long names.
|
|
13
|
+
* Unknown values fall back to `fallback`.
|
|
14
|
+
*/
|
|
15
|
+
function normalizeSize(size, fallback = 'md') {
|
|
16
|
+
if (size === 'sm' || size === 'md' || size === 'lg')
|
|
17
|
+
return size;
|
|
18
|
+
return LEGACY_SIZES[size] ?? fallback;
|
|
19
|
+
}
|
|
20
|
+
|
|
6
21
|
var css_248z$1 = i`* {
|
|
7
22
|
box-sizing: border-box;
|
|
8
23
|
-webkit-tap-highlight-color: transparent;
|
|
@@ -90,17 +105,17 @@ var css_248z$1 = i`* {
|
|
|
90
105
|
.toolbar.variant-docked {
|
|
91
106
|
/* Size variants */
|
|
92
107
|
}
|
|
93
|
-
.toolbar.variant-docked.size-
|
|
108
|
+
.toolbar.variant-docked.size-sm {
|
|
94
109
|
--toolbar-height: 5rem;
|
|
95
110
|
}
|
|
96
|
-
.toolbar.variant-docked.size-
|
|
111
|
+
.toolbar.variant-docked.size-md {
|
|
97
112
|
--toolbar-height: 6rem;
|
|
98
113
|
}
|
|
99
|
-
.toolbar.variant-docked.size-
|
|
114
|
+
.toolbar.variant-docked.size-lg {
|
|
100
115
|
--toolbar-height: 7rem;
|
|
101
116
|
}
|
|
102
117
|
.toolbar.variant-docked.elevated {
|
|
103
|
-
--toolbar-shadow: var(--elevation-
|
|
118
|
+
--toolbar-shadow: var(--elevation-level3);
|
|
104
119
|
}
|
|
105
120
|
|
|
106
121
|
/* ---- Floating variant ---- */
|
|
@@ -245,11 +260,13 @@ let Toolbar = Toolbar_1 = class Toolbar extends i$1 {
|
|
|
245
260
|
this.orientation = 'horizontal';
|
|
246
261
|
/**
|
|
247
262
|
* Size of the docked toolbar.
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
263
|
+
* - `"sm"`: 80dp height (default).
|
|
264
|
+
* - `"md"`: 96dp height.
|
|
265
|
+
* - `"lg"`: 112dp height.
|
|
266
|
+
*
|
|
267
|
+
* The long names `"small"`, `"medium"` and `"large"` still work but are deprecated.
|
|
251
268
|
*/
|
|
252
|
-
this.size = '
|
|
269
|
+
this.size = 'sm';
|
|
253
270
|
/**
|
|
254
271
|
* Whether the toolbar is visually elevated (adds a shadow).
|
|
255
272
|
*/
|
|
@@ -260,7 +277,7 @@ let Toolbar = Toolbar_1 = class Toolbar extends i$1 {
|
|
|
260
277
|
toolbar: true,
|
|
261
278
|
[`variant-${this.variant}`]: true,
|
|
262
279
|
[`orientation-${this.orientation}`]: true,
|
|
263
|
-
[`size-${this.size}`]: true,
|
|
280
|
+
[`size-${normalizeSize(this.size, 'sm')}`]: true,
|
|
264
281
|
elevated: this.elevated,
|
|
265
282
|
};
|
|
266
283
|
if (this.variant === 'floating') {
|
package/dist/toolbar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.js","sources":["../../src/toolbar/toolbar.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport styles from './toolbar.scss';\nimport colorStyles from './toolbar-colors.scss';\n\n/**\n * @label Toolbar\n * @tag wc-toolbar\n * @rawTag toolbar\n *\n * @summary A toolbar / app bar for navigation and actions.\n * @overview\n * <p>The toolbar component implements the app bar pattern. It supports a\n * docked (attached) variant for bottom-panel navigation and a floating (detached pill-shaped)\n * variant. The floating variant supports both horizontal and vertical orientations.</p>\n *\n * <p>Render toolbar actions directly as children of the component. The docked variant is\n * optimized for a horizontal action row, while the floating variant supports both horizontal\n * and vertical layouts.</p>\n *\n * @cssprop --toolbar-container-color - Background color of the toolbar.\n * @cssprop --toolbar-container-shape - Border radius of the toolbar. Relevant for the floating variant.\n * @cssprop --toolbar-height - Height of the toolbar (docked horizontal / floating horizontal).\n * @cssprop --toolbar-padding-inline - Inline padding of the toolbar.\n * @cssprop --toolbar-gap - Gap between toolbar sections.\n * @cssprop --toolbar-icon-color - Color of icon slots.\n * @cssprop --toolbar-title-color - Color of the title (default slot) text.\n * @cssprop --toolbar-shadow - Box-shadow of the toolbar.\n *\n * @example\n * ```html\n * <!-- Docked toolbar -->\n * <wc-toolbar>\n * <wc-icon-button variant=\"text\" color=\"surface\"><wc-icon name=\"home\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"tonal\"><wc-icon name=\"search\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\" color=\"surface\"><wc-icon name=\"favorite\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\" color=\"surface\"><wc-icon name=\"account_circle\"></wc-icon></wc-icon-button>\n * </wc-toolbar>\n * ```\n *\n * @example\n * ```html\n * <!-- Floating horizontal toolbar -->\n * <wc-toolbar variant=\"floating\" orientation=\"horizontal\">\n * <wc-icon-button variant=\"tonal\"><wc-icon name=\"home\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"search\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"favorite\"></wc-icon></wc-icon-button>\n * </wc-toolbar>\n * ```\n *\n * @example\n * ```html\n * <!-- Floating vertical toolbar -->\n * <wc-toolbar variant=\"floating\" orientation=\"vertical\">\n * <wc-icon-button variant=\"tonal\"><wc-icon name=\"home\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"search\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"favorite\"></wc-icon></wc-icon-button>\n * </wc-toolbar>\n * ```\n * @tags display navigation\n */\n@IndividualComponent\nexport class Toolbar extends LitElement {\n static styles = [styles, colorStyles];\n\n /**\n * Visual and layout variant of the toolbar.\n * - `\"docked\"`: A full-width bar attached to the edge of the screen (default).\n * - `\"floating\"`: A detached pill-shaped toolbar that floats over content.\n */\n @property({ type: String, reflect: true })\n variant: 'docked' | 'floating' = 'docked';\n\n /**\n * Orientation of the toolbar content.\n * - `\"horizontal\"`: Items are laid out left to right (default).\n * - `\"vertical\"`: Items are stacked top to bottom. Primarily useful for the floating variant.\n */\n @property({ type: String, reflect: true })\n orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Size of the docked toolbar.\n
|
|
1
|
+
{"version":3,"file":"toolbar.js","sources":["../../src/__internal/utils/size.ts","../../src/toolbar/toolbar.ts"],"sourcesContent":["/** The size scale components share. Only button-like components add `xs` and `xl`. */\nexport type Size = 'sm' | 'md' | 'lg';\n\n/** Long size names some components accepted before the `sm|md|lg` scale. Deprecated. */\nexport type LegacySize = 'small' | 'medium' | 'large';\n\nconst LEGACY_SIZES: Record<LegacySize, Size> = {\n small: 'sm',\n medium: 'md',\n large: 'lg',\n};\n\n/**\n * Maps a size attribute onto the `sm|md|lg` scale, accepting the deprecated long names.\n * Unknown values fall back to `fallback`.\n */\nexport function normalizeSize(\n size: string | null | undefined,\n fallback: Size = 'md',\n): Size {\n if (size === 'sm' || size === 'md' || size === 'lg') return size;\n return LEGACY_SIZES[size as LegacySize] ?? fallback;\n}\n","import { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport {\n type LegacySize,\n normalizeSize,\n type Size,\n} from '@/__internal/utils/size.js';\nimport styles from './toolbar.scss';\nimport colorStyles from './toolbar-colors.scss';\n\n/**\n * @label Toolbar\n * @tag wc-toolbar\n * @rawTag toolbar\n *\n * @summary A toolbar / app bar for navigation and actions.\n * @overview\n * <p>The toolbar component implements the app bar pattern. It supports a\n * docked (attached) variant for bottom-panel navigation and a floating (detached pill-shaped)\n * variant. The floating variant supports both horizontal and vertical orientations.</p>\n *\n * <p>Render toolbar actions directly as children of the component. The docked variant is\n * optimized for a horizontal action row, while the floating variant supports both horizontal\n * and vertical layouts.</p>\n *\n * @cssprop --toolbar-container-color - Background color of the toolbar.\n * @cssprop --toolbar-container-shape - Border radius of the toolbar. Relevant for the floating variant.\n * @cssprop --toolbar-height - Height of the toolbar (docked horizontal / floating horizontal).\n * @cssprop --toolbar-padding-inline - Inline padding of the toolbar.\n * @cssprop --toolbar-gap - Gap between toolbar sections.\n * @cssprop --toolbar-icon-color - Color of icon slots.\n * @cssprop --toolbar-title-color - Color of the title (default slot) text.\n * @cssprop --toolbar-shadow - Box-shadow of the toolbar.\n *\n * @example\n * ```html\n * <!-- Docked toolbar -->\n * <wc-toolbar>\n * <wc-icon-button variant=\"text\" color=\"surface\"><wc-icon name=\"home\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"tonal\"><wc-icon name=\"search\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\" color=\"surface\"><wc-icon name=\"favorite\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\" color=\"surface\"><wc-icon name=\"account_circle\"></wc-icon></wc-icon-button>\n * </wc-toolbar>\n * ```\n *\n * @example\n * ```html\n * <!-- Floating horizontal toolbar -->\n * <wc-toolbar variant=\"floating\" orientation=\"horizontal\">\n * <wc-icon-button variant=\"tonal\"><wc-icon name=\"home\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"search\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"favorite\"></wc-icon></wc-icon-button>\n * </wc-toolbar>\n * ```\n *\n * @example\n * ```html\n * <!-- Floating vertical toolbar -->\n * <wc-toolbar variant=\"floating\" orientation=\"vertical\">\n * <wc-icon-button variant=\"tonal\"><wc-icon name=\"home\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"search\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"favorite\"></wc-icon></wc-icon-button>\n * </wc-toolbar>\n * ```\n * @tags display navigation\n */\n@IndividualComponent\nexport class Toolbar extends LitElement {\n static styles = [styles, colorStyles];\n\n /**\n * Visual and layout variant of the toolbar.\n * - `\"docked\"`: A full-width bar attached to the edge of the screen (default).\n * - `\"floating\"`: A detached pill-shaped toolbar that floats over content.\n */\n @property({ type: String, reflect: true })\n variant: 'docked' | 'floating' = 'docked';\n\n /**\n * Orientation of the toolbar content.\n * - `\"horizontal\"`: Items are laid out left to right (default).\n * - `\"vertical\"`: Items are stacked top to bottom. Primarily useful for the floating variant.\n */\n @property({ type: String, reflect: true })\n orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Size of the docked toolbar.\n * - `\"sm\"`: 80dp height (default).\n * - `\"md\"`: 96dp height.\n * - `\"lg\"`: 112dp height.\n *\n * The long names `\"small\"`, `\"medium\"` and `\"large\"` still work but are deprecated.\n */\n @property({ type: String, reflect: true })\n size: Size | LegacySize = 'sm';\n\n /**\n * Whether the toolbar is visually elevated (adds a shadow).\n */\n @property({ type: Boolean, reflect: true })\n elevated: boolean = false;\n\n override render() {\n const cssClasses = {\n toolbar: true,\n [`variant-${this.variant}`]: true,\n [`orientation-${this.orientation}`]: true,\n [`size-${normalizeSize(this.size, 'sm')}`]: true,\n elevated: this.elevated,\n };\n\n if (this.variant === 'floating') {\n return Toolbar.__renderFloating(cssClasses);\n }\n\n return Toolbar.__renderDocked(cssClasses);\n }\n\n private static __renderDocked(cssClasses: Record<string, boolean>) {\n return html`\n <div class=${classMap(cssClasses)} role=\"toolbar\">\n <div class=\"background\"></div>\n <div class=\"toolbar-content\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n private static __renderFloating(cssClasses: Record<string, boolean>) {\n return html`\n <div class=${classMap(cssClasses)} role=\"toolbar\">\n <wc-elevation class=\"elevation\"></wc-elevation>\n <div class=\"background\"></div>\n <div class=\"toolbar-content\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","styles","colorStyles","property"],"mappings":";;;;;AAMA,MAAM,YAAY,GAA6B;AAC7C,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,KAAK,EAAE,IAAI;CACZ;AAED;;;AAGG;SACa,aAAa,CAC3B,IAA+B,EAC/B,WAAiB,IAAI,EAAA;IAErB,I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