@redvars/peacock 3.6.2 → 3.7.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/ButtonConstants-D06bY4uy.js +114 -0
- package/dist/ButtonConstants-D06bY4uy.js.map +1 -0
- package/dist/{BaseHyperlinkMixin-BNuwbiEf.js → NativeHyperlinkMixin-DrYXyfMQ.js} +8 -10
- package/dist/NativeHyperlinkMixin-DrYXyfMQ.js.map +1 -0
- package/dist/assets/components.css +1 -1
- package/dist/assets/components.css.map +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/button-colors-Dwnez1tR.js +586 -0
- package/dist/button-colors-Dwnez1tR.js.map +1 -0
- package/dist/button-group.js +8 -8
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +236 -133
- package/dist/button.js.map +1 -1
- package/dist/calendar-column-view.js +0 -1
- package/dist/calendar-column-view.js.map +1 -1
- package/dist/calendar-month-view.js +0 -1
- package/dist/calendar-month-view.js.map +1 -1
- package/dist/canvas.js +126 -107
- package/dist/canvas.js.map +1 -1
- package/dist/card-content.js +0 -1
- package/dist/card-content.js.map +1 -1
- package/dist/card.js +96 -90
- package/dist/card.js.map +1 -1
- package/dist/cb-compound-expression.js +4 -1
- package/dist/cb-compound-expression.js.map +1 -1
- package/dist/cb-divider.js +0 -1
- package/dist/cb-divider.js.map +1 -1
- package/dist/cb-expression.js +0 -2
- package/dist/cb-expression.js.map +1 -1
- package/dist/cb-predicate.js +0 -1
- package/dist/cb-predicate.js.map +1 -1
- package/dist/code-highlighter.js +23 -6
- package/dist/code-highlighter.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +5079 -17882
- package/dist/custom-elements.json +19272 -19314
- package/dist/fab.js +181 -117
- package/dist/fab.js.map +1 -1
- package/dist/flow-designer.js +4 -4
- package/dist/icon-button-DJ0kZXYr.js +318 -0
- package/dist/icon-button-DJ0kZXYr.js.map +1 -0
- package/dist/index.js +7 -7
- package/dist/{navigation-rail-CD7IrqbN.js → navigation-rail-CM_svs5_.js} +1311 -730
- package/dist/navigation-rail-CM_svs5_.js.map +1 -0
- package/dist/observe-slot-change-D8Xg-kSS.js +60 -0
- package/dist/observe-slot-change-D8Xg-kSS.js.map +1 -0
- package/dist/peacock-loader.js +10 -7
- package/dist/peacock-loader.js.map +1 -1
- package/dist/popover-content.js +0 -1
- package/dist/popover-content.js.map +1 -1
- package/dist/search.js +15 -15
- package/dist/search.js.map +1 -1
- package/dist/src/__controllers/attachable-controller.d.ts +109 -0
- package/dist/src/__mixins/{BaseButtonMixin.d.ts → NativeButtonMixin.d.ts} +3 -3
- package/dist/src/__mixins/{BaseHyperlinkMixin.d.ts → NativeHyperlinkMixin.d.ts} +3 -4
- package/dist/src/__utils/is-link.d.ts +1 -0
- package/dist/src/__utils/observe-slot-change.d.ts +1 -1
- package/dist/src/accordion/accordion-item.d.ts +0 -1
- package/dist/src/breadcrumb/breadcrumb-item/breadcrumb-item.d.ts +0 -1
- package/dist/src/button/ButtonConstants.d.ts +1 -0
- package/dist/src/button/GroupButtonInterface.d.ts +4 -0
- package/dist/src/button/button/button.d.ts +32 -7
- package/dist/src/button/button-group/button-group.d.ts +2 -1
- package/dist/src/button/icon-button/icon-button.d.ts +26 -5
- package/dist/src/button/index.d.ts +1 -1
- package/dist/src/calendar/calendar-column-view.d.ts +0 -1
- package/dist/src/calendar/calendar-month-view.d.ts +0 -1
- package/dist/src/canvas/canvas.d.ts +3 -3
- package/dist/src/card/card-content.d.ts +0 -1
- package/dist/src/card/card.d.ts +9 -6
- package/dist/src/chip/chip/chip.d.ts +22 -3
- package/dist/src/condition-builder/cb-compound-expression.d.ts +0 -1
- package/dist/src/condition-builder/cb-divider.d.ts +0 -1
- package/dist/src/condition-builder/cb-expression.d.ts +0 -1
- package/dist/src/condition-builder/cb-predicate.d.ts +0 -1
- package/dist/src/fab/fab.d.ts +20 -6
- package/dist/src/field/field.d.ts +1 -0
- package/dist/src/focus-ring/focus-ring.d.ts +26 -20
- package/dist/src/image/image.d.ts +2 -2
- package/dist/src/index.d.ts +1 -0
- package/dist/src/input/input.d.ts +1 -3
- package/dist/src/item/index.d.ts +1 -0
- package/dist/src/item/item.d.ts +49 -0
- package/dist/src/link/link.d.ts +1 -1
- package/dist/src/list/list-item.d.ts +1 -2
- package/dist/src/menu/menu-item/menu-item.d.ts +9 -11
- package/dist/src/menu/sub-menu/sub-menu.d.ts +1 -1
- package/dist/src/navigation-rail/navigation-rail-item.d.ts +0 -2
- package/dist/src/navigation-rail/navigation-rail.d.ts +2 -6
- package/dist/src/popover/popover-content.d.ts +0 -1
- package/dist/src/ripple/ripple.d.ts +9 -1
- package/dist/src/search/search.d.ts +2 -6
- package/dist/src/segmented-button/segmented-button.d.ts +0 -1
- package/dist/src/select/option.d.ts +0 -1
- package/dist/src/sidebar-menu/sidebar-menu-item.d.ts +0 -1
- package/dist/src/sidebar-menu/sidebar-sub-menu.d.ts +0 -1
- package/dist/src/tabs/tab-panel.d.ts +0 -1
- package/dist/src/tabs/tab.d.ts +4 -6
- package/dist/test/item.test.d.ts +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -2
- package/readme.md +2 -2
- package/scss/components.scss +0 -1
- package/scss/mixin.scss +33 -13
- package/scss/styles.scss +1 -3
- package/src/__controllers/attachable-controller.ts +198 -0
- package/src/__mixins/NativeButtonMixin.ts +87 -0
- package/src/__mixins/{BaseHyperlinkMixin.ts → NativeHyperlinkMixin.ts} +15 -15
- package/src/__utils/is-link.ts +3 -0
- package/src/__utils/observe-slot-change.ts +46 -14
- package/src/accordion/accordion-item.scss +1 -1
- package/src/accordion/accordion-item.ts +0 -1
- package/src/breadcrumb/breadcrumb-item/breadcrumb-item.ts +0 -1
- package/src/button/ButtonConstants.ts +1 -0
- package/src/button/GroupButtonInterface.ts +4 -0
- package/src/button/button/button-colors.scss +2 -2
- package/src/button/button/button-layers.scss +124 -0
- package/src/button/button/button-sizes.scss +31 -53
- package/src/button/button/button.scss +139 -262
- package/src/button/button/button.ts +260 -106
- package/src/button/button/only-button.scss +13 -0
- package/src/button/button-group/button-group.ts +59 -17
- package/src/button/icon-button/icon-button-sizes.scss +12 -27
- package/src/button/icon-button/icon-button.ts +191 -83
- package/src/button/index.ts +1 -1
- package/src/calendar/calendar-column-view.ts +0 -1
- package/src/calendar/calendar-month-view.ts +0 -1
- package/src/canvas/canvas.scss +18 -6
- package/src/canvas/canvas.ts +125 -103
- package/src/card/card-content.ts +2 -3
- package/src/card/card.scss +87 -95
- package/src/card/card.ts +62 -60
- package/src/chip/chip/chip.scss +66 -71
- package/src/chip/chip/chip.ts +155 -56
- package/src/code-highlighter/code-highlighter.scss +1 -1
- package/src/code-highlighter/code-highlighter.ts +20 -5
- package/src/condition-builder/cb-compound-expression.scss +4 -0
- package/src/condition-builder/cb-compound-expression.ts +0 -1
- package/src/condition-builder/cb-divider.ts +0 -1
- package/src/condition-builder/cb-expression.scss +0 -1
- package/src/condition-builder/cb-expression.ts +0 -1
- package/src/condition-builder/cb-predicate.ts +0 -1
- package/src/elevation/elevation.scss +5 -1
- package/src/empty-state/empty-state.scss +1 -0
- package/src/fab/fab-colors.scss +2 -2
- package/src/fab/fab-sizes.scss +24 -34
- package/src/fab/fab.scss +77 -71
- package/src/fab/fab.ts +141 -65
- package/src/field/field.ts +6 -0
- package/src/focus-ring/focus-ring.ts +81 -72
- package/src/image/image.scss +21 -16
- package/src/image/image.ts +13 -14
- package/src/index.ts +1 -0
- package/src/input/input.ts +16 -25
- package/src/item/index.ts +1 -0
- package/src/item/item.scss +195 -0
- package/src/item/item.ts +362 -0
- package/src/link/link.scss +1 -10
- package/src/link/link.ts +4 -2
- package/src/list/list-item.ts +8 -8
- package/src/menu/menu/menu.ts +5 -9
- package/src/menu/menu-item/menu-item.scss +30 -108
- package/src/menu/menu-item/menu-item.ts +102 -133
- package/src/menu/sub-menu/sub-menu.ts +6 -3
- package/src/navigation-rail/navigation-rail-item.scss +5 -0
- package/src/navigation-rail/navigation-rail-item.ts +10 -15
- package/src/navigation-rail/navigation-rail.ts +2 -6
- package/src/peacock-loader.ts +5 -1
- package/src/popover/popover-content.ts +0 -1
- package/src/ripple/ripple.ts +52 -20
- package/src/search/search.scss +3 -0
- package/src/search/search.ts +11 -16
- package/src/segmented-button/segmented-button.ts +0 -1
- package/src/select/option.ts +1 -2
- package/src/select/select.scss +1 -10
- package/src/select/select.ts +2 -0
- package/src/sidebar-menu/sidebar-menu-item.ts +0 -1
- package/src/sidebar-menu/sidebar-sub-menu.ts +0 -1
- package/src/skeleton/skeleton.scss +5 -1
- package/src/tabs/tab-panel.ts +0 -1
- package/src/tabs/tab.ts +60 -70
- package/src/text/text.css-component.scss +3 -21
- package/src/tooltip/tooltip.scss +5 -8
- package/src/tooltip/tooltip.ts +1 -2
- package/dist/BaseButton-BNFAYn-S.js +0 -219
- package/dist/BaseButton-BNFAYn-S.js.map +0 -1
- package/dist/BaseHyperlinkMixin-BNuwbiEf.js.map +0 -1
- package/dist/button-colors-AvGh22Zn.js +0 -561
- package/dist/button-colors-AvGh22Zn.js.map +0 -1
- package/dist/icon-button-ohxHhy4t.js +0 -247
- package/dist/icon-button-ohxHhy4t.js.map +0 -1
- package/dist/navigation-rail-CD7IrqbN.js.map +0 -1
- package/dist/observe-slot-change-BGJfgg2E.js +0 -31
- package/dist/observe-slot-change-BGJfgg2E.js.map +0 -1
- package/dist/src/button/BaseButton.d.ts +0 -28
- package/dist/src/focus-ring/FocusAttachableController.d.ts +0 -8
- package/src/__mixins/BaseButtonMixin.ts +0 -83
- package/src/button/BaseButton.ts +0 -113
- package/src/focus-ring/FocusAttachableController.ts +0 -28
- package/src/popover/tooltip.css-component.scss +0 -19
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import { property } from 'lit/decorators.js';
|
|
1
|
+
import { html, LitElement, nothing } from 'lit';
|
|
2
|
+
import { property, query } from 'lit/decorators.js';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
+
import { when } from 'lit/directives/when.js';
|
|
6
|
+
import buttonLayers from '../button/button-layers.scss';
|
|
5
7
|
import styles from '../button/button.scss';
|
|
6
8
|
import colorStyles from '../button/button-colors.scss';
|
|
7
9
|
import sizeStyles from './icon-button-sizes.scss';
|
|
8
10
|
import { spread } from '@/__directive/spread.js';
|
|
9
11
|
import { throttle } from '@/__utils/throttle.js';
|
|
10
|
-
import {
|
|
12
|
+
import { isLink } from '@/__utils/is-link.js';
|
|
13
|
+
import { observerSlotChangesWithCallback } from '@/__utils/observe-slot-change.js';
|
|
14
|
+
import {
|
|
15
|
+
dispatchActivationClick,
|
|
16
|
+
isActivationClick,
|
|
17
|
+
} from '@/__utils/dispatch-event-utils.js';
|
|
18
|
+
import NativeButtonMixin from '@/__mixins/NativeButtonMixin.js';
|
|
19
|
+
import NativeHyperlinkMixin from '@/__mixins/NativeHyperlinkMixin.js';
|
|
20
|
+
import { GroupButtonInterface } from '@/button/GroupButtonInterface.js';
|
|
21
|
+
import { DISABLED_REASON_ID } from '@/button/ButtonConstants.js';
|
|
11
22
|
|
|
12
23
|
/**
|
|
13
24
|
* @label Icon Button
|
|
@@ -52,8 +63,11 @@ import { BaseButton } from '../BaseButton.js';
|
|
|
52
63
|
* ```
|
|
53
64
|
* @tags display
|
|
54
65
|
*/
|
|
55
|
-
export class IconButton
|
|
56
|
-
|
|
66
|
+
export class IconButton
|
|
67
|
+
extends NativeButtonMixin(NativeHyperlinkMixin(LitElement))
|
|
68
|
+
implements GroupButtonInterface
|
|
69
|
+
{
|
|
70
|
+
static override styles = [buttonLayers, styles, colorStyles, sizeStyles];
|
|
57
71
|
|
|
58
72
|
/**
|
|
59
73
|
* Button size.
|
|
@@ -62,39 +76,39 @@ export class IconButton extends BaseButton {
|
|
|
62
76
|
@property({ reflect: true }) size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'sm';
|
|
63
77
|
|
|
64
78
|
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
79
|
+
* Type is preset of color and variant. Type will be only applied.
|
|
80
|
+
*
|
|
81
|
+
*/
|
|
82
|
+
@property({ type: String }) type?: 'primary' | 'secondary' | 'tertiary';
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The visual style of the button.
|
|
86
|
+
*
|
|
87
|
+
* Possible variant values:
|
|
88
|
+
* `"filled"` is a filled button.
|
|
89
|
+
* `"outlined"` is an outlined button.
|
|
90
|
+
* `"text"` is a transparent button.
|
|
91
|
+
* `"tonal"` is a light color button.
|
|
92
|
+
* `"elevated"` is elevated button
|
|
93
|
+
*/
|
|
94
|
+
@property({ reflect: true }) variant:
|
|
95
|
+
| 'elevated'
|
|
96
|
+
| 'filled'
|
|
97
|
+
| 'tonal'
|
|
98
|
+
| 'outlined'
|
|
99
|
+
| 'text'
|
|
100
|
+
| 'neo' = 'filled';
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Defines the primary color of the button. This can be set to predefined color names to apply specific color themes.
|
|
104
|
+
*/
|
|
105
|
+
@property({ reflect: true }) color:
|
|
106
|
+
| 'primary'
|
|
107
|
+
| 'success'
|
|
108
|
+
| 'danger'
|
|
109
|
+
| 'warning'
|
|
110
|
+
| 'surface'
|
|
111
|
+
| 'on-surface' = 'primary';
|
|
98
112
|
|
|
99
113
|
/**
|
|
100
114
|
* Additional ARIA attributes to pass to the inner button/anchor element.
|
|
@@ -102,6 +116,92 @@ export class IconButton extends BaseButton {
|
|
|
102
116
|
@property({ reflect: true })
|
|
103
117
|
configAria?: { [key: string]: any };
|
|
104
118
|
|
|
119
|
+
@property({ type: Boolean, reflect: true }) skeleton: boolean = false;
|
|
120
|
+
|
|
121
|
+
@property({ type: Boolean, reflect: true }) toggle: boolean = false;
|
|
122
|
+
|
|
123
|
+
@property({ type: Boolean, reflect: true }) selected: boolean = false;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds.
|
|
127
|
+
*/
|
|
128
|
+
@property() throttleDelay = 200;
|
|
129
|
+
|
|
130
|
+
@property() tooltip?: string;
|
|
131
|
+
|
|
132
|
+
@property({ type: Boolean, reflect: true })
|
|
133
|
+
pressed = false;
|
|
134
|
+
|
|
135
|
+
@query('.button') readonly buttonElement!: HTMLElement | null;
|
|
136
|
+
|
|
137
|
+
override connectedCallback() {
|
|
138
|
+
super.connectedCallback();
|
|
139
|
+
this.addEventListener('click', this.__dispatchClickWithThrottle);
|
|
140
|
+
window.addEventListener('mouseup', this.__handlePress);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
override disconnectedCallback() {
|
|
144
|
+
window.removeEventListener('mouseup', this.__handlePress);
|
|
145
|
+
this.removeEventListener('click', this.__dispatchClickWithThrottle);
|
|
146
|
+
super.disconnectedCallback();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
__handlePress = (event: KeyboardEvent | MouseEvent) => {
|
|
150
|
+
if (this.disabled || this.skeleton || this.softDisabled) return;
|
|
151
|
+
this.pressed =
|
|
152
|
+
(event instanceof KeyboardEvent &&
|
|
153
|
+
event.type === 'keydown' &&
|
|
154
|
+
(event.key === 'Enter' || event.key === ' ')) ||
|
|
155
|
+
event.type === 'mousedown';
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
__dispatchClickWithThrottle: (event: MouseEvent | KeyboardEvent) => void =
|
|
159
|
+
event => {
|
|
160
|
+
this.__dispatchClick(event);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
__dispatchClick = (event: MouseEvent | KeyboardEvent) => {
|
|
164
|
+
// If the button is soft-disabled or a disabled link, we need to explicitly
|
|
165
|
+
// prevent the click from propagating to other event listeners as well as
|
|
166
|
+
// prevent the default action.
|
|
167
|
+
if (this.softDisabled || (this.disabled && this.href) || this.skeleton) {
|
|
168
|
+
event.stopImmediatePropagation();
|
|
169
|
+
event.preventDefault();
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (!isActivationClick(event) || !this.buttonElement) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (this.toggle) {
|
|
178
|
+
this.selected = !this.selected;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
this.focus();
|
|
182
|
+
dispatchActivationClick(this.buttonElement);
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
__renderDisabledReason(softDisabled: boolean) {
|
|
186
|
+
if (softDisabled)
|
|
187
|
+
return html`<div
|
|
188
|
+
id=${DISABLED_REASON_ID}
|
|
189
|
+
role="tooltip"
|
|
190
|
+
aria-label=${this.disabledReason}
|
|
191
|
+
class="screen-reader-only"
|
|
192
|
+
>
|
|
193
|
+
${this.disabledReason}
|
|
194
|
+
</div>`;
|
|
195
|
+
return nothing;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
__renderTooltip() {
|
|
199
|
+
if (this.tooltip) {
|
|
200
|
+
return html`<wc-tooltip class="tooltip" for="button">${this.tooltip}</wc-tooltip>`;
|
|
201
|
+
}
|
|
202
|
+
return nothing;
|
|
203
|
+
}
|
|
204
|
+
|
|
105
205
|
override focus() {
|
|
106
206
|
this.buttonElement?.focus();
|
|
107
207
|
}
|
|
@@ -109,7 +209,7 @@ export class IconButton extends BaseButton {
|
|
|
109
209
|
override blur() {
|
|
110
210
|
this.buttonElement?.blur();
|
|
111
211
|
}
|
|
112
|
-
|
|
212
|
+
|
|
113
213
|
override firstUpdated() {
|
|
114
214
|
this.__dispatchClickWithThrottle = throttle(
|
|
115
215
|
this.__dispatchClick,
|
|
@@ -135,8 +235,26 @@ export class IconButton extends BaseButton {
|
|
|
135
235
|
}
|
|
136
236
|
|
|
137
237
|
override render() {
|
|
138
|
-
|
|
238
|
+
return html`
|
|
239
|
+
<wc-focus-ring class="focus-ring" for="button"></wc-focus-ring>
|
|
240
|
+
<wc-elevation class="elevation"></wc-elevation>
|
|
241
|
+
${when(
|
|
242
|
+
this.variant === 'neo',
|
|
243
|
+
() => html`<div class="neo-background"></div>`,
|
|
244
|
+
)}
|
|
245
|
+
<div class="background"></div>
|
|
246
|
+
${when(
|
|
247
|
+
this.variant === 'outlined' || this.variant === 'neo',
|
|
248
|
+
() => html`<div class="outline"></div>`,
|
|
249
|
+
)}
|
|
250
|
+
<wc-ripple class="ripple" for="button"></wc-ripple>
|
|
251
|
+
<wc-skeleton class="skeleton"></wc-skeleton>
|
|
139
252
|
|
|
253
|
+
${this.renderButtonElement()} ${this.__renderTooltip()}
|
|
254
|
+
`;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
renderButtonElement() {
|
|
140
258
|
const cssClasses = {
|
|
141
259
|
button: true,
|
|
142
260
|
'button-element': true,
|
|
@@ -144,66 +262,56 @@ export class IconButton extends BaseButton {
|
|
|
144
262
|
[`variant-${this.variant}`]: true,
|
|
145
263
|
[`color-${this.color}`]: true,
|
|
146
264
|
disabled: this.disabled || this.softDisabled,
|
|
147
|
-
pressed: this.
|
|
265
|
+
pressed: this.pressed,
|
|
148
266
|
skeleton: this.skeleton,
|
|
149
267
|
};
|
|
150
268
|
|
|
151
|
-
if (!isLink) {
|
|
269
|
+
if (!isLink(this)) {
|
|
270
|
+
cssClasses['native-button'] = true;
|
|
152
271
|
return html`<button
|
|
153
|
-
class=${classMap(cssClasses)}
|
|
154
|
-
id="button"
|
|
155
|
-
type=${this.htmlType}
|
|
156
|
-
@click=${this.__dispatchClickWithThrottle}
|
|
157
|
-
@mousedown=${this.__handlePress}
|
|
158
|
-
@keydown=${this.__handlePress}
|
|
159
|
-
@keyup=${this.__handlePress}
|
|
160
|
-
|
|
161
|
-
aria-describedby=${ifDefined(this.softDisabled ? BaseButton.DISABLED_REASON_ID : undefined)}
|
|
162
|
-
?aria-disabled=${this.softDisabled}
|
|
163
|
-
|
|
164
|
-
?disabled=${this.disabled}
|
|
165
|
-
${spread(this.configAria)}
|
|
166
|
-
>
|
|
167
|
-
${this.renderButtonContent()}
|
|
168
|
-
</button>
|
|
169
|
-
${this.__renderTooltip()}`;
|
|
170
|
-
}
|
|
171
|
-
return html`<a
|
|
172
272
|
class=${classMap(cssClasses)}
|
|
173
273
|
id="button"
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
tabindex=${this.disabled ? '-1' : '0'}
|
|
177
|
-
@click=${this.__dispatchClick}
|
|
274
|
+
type=${this.htmlType}
|
|
275
|
+
@click=${this.__dispatchClickWithThrottle}
|
|
178
276
|
@mousedown=${this.__handlePress}
|
|
179
277
|
@keydown=${this.__handlePress}
|
|
180
278
|
@keyup=${this.__handlePress}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
279
|
+
aria-describedby=${ifDefined(
|
|
280
|
+
this.softDisabled ? DISABLED_REASON_ID : undefined,
|
|
281
|
+
)}
|
|
184
282
|
?aria-disabled=${this.softDisabled}
|
|
185
|
-
|
|
283
|
+
?disabled=${this.disabled}
|
|
186
284
|
${spread(this.configAria)}
|
|
187
285
|
>
|
|
188
286
|
${this.renderButtonContent()}
|
|
189
|
-
</
|
|
190
|
-
|
|
287
|
+
</button>`;
|
|
288
|
+
}
|
|
289
|
+
cssClasses['native-link'] = true;
|
|
290
|
+
return html`<a
|
|
291
|
+
class=${classMap(cssClasses)}
|
|
292
|
+
id="button"
|
|
293
|
+
href=${this.href}
|
|
294
|
+
target=${this.target}
|
|
295
|
+
tabindex=${this.disabled ? '-1' : '0'}
|
|
296
|
+
@click=${this.__dispatchClick}
|
|
297
|
+
@mousedown=${this.__handlePress}
|
|
298
|
+
@keydown=${this.__handlePress}
|
|
299
|
+
@keyup=${this.__handlePress}
|
|
300
|
+
role="button"
|
|
301
|
+
aria-describedby=${ifDefined(
|
|
302
|
+
this.softDisabled ? DISABLED_REASON_ID : undefined,
|
|
303
|
+
)}
|
|
304
|
+
?aria-disabled=${this.softDisabled}
|
|
305
|
+
${spread(this.configAria)}
|
|
306
|
+
>
|
|
307
|
+
${this.renderButtonContent()}
|
|
308
|
+
</a>`;
|
|
191
309
|
}
|
|
192
310
|
|
|
193
311
|
renderButtonContent() {
|
|
194
312
|
return html`
|
|
195
|
-
<
|
|
196
|
-
<
|
|
197
|
-
<div class="neo-background"></div>
|
|
198
|
-
<div class="background"></div>
|
|
199
|
-
<div class="outline"></div>
|
|
200
|
-
<wc-ripple class="ripple"></wc-ripple>
|
|
201
|
-
<wc-skeleton class="skeleton"></wc-skeleton>
|
|
202
|
-
|
|
203
|
-
<div class="button-content">
|
|
204
|
-
<slot></slot>
|
|
205
|
-
</div>
|
|
206
|
-
|
|
313
|
+
<slot class="icon-slot"></slot>
|
|
314
|
+
<div class="touch"></div>
|
|
207
315
|
${this.__renderDisabledReason(this.softDisabled)}
|
|
208
316
|
`;
|
|
209
317
|
}
|
package/src/button/index.ts
CHANGED
|
@@ -22,7 +22,6 @@ import styles from './calendar-column-view.scss';
|
|
|
22
22
|
* @label Calendar Column View
|
|
23
23
|
* @tag wc-calendar-column-view
|
|
24
24
|
* @rawTag calendar-column-view
|
|
25
|
-
* @parentRawTag calendar
|
|
26
25
|
* @summary Internal column view component for the calendar (day/week views).
|
|
27
26
|
*/
|
|
28
27
|
@IndividualComponent
|
|
@@ -21,7 +21,6 @@ import styles from './calendar-month-view.scss';
|
|
|
21
21
|
* @label Calendar Month View
|
|
22
22
|
* @tag wc-calendar-month-view
|
|
23
23
|
* @rawTag calendar-month-view
|
|
24
|
-
* @parentRawTag calendar
|
|
25
24
|
* @summary Internal month view component for the calendar.
|
|
26
25
|
*/
|
|
27
26
|
@IndividualComponent
|
package/src/canvas/canvas.scss
CHANGED
|
@@ -12,8 +12,22 @@
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.canvas-wrapper {
|
|
15
|
+
position: relative;
|
|
15
16
|
background: var(--canvas-background);
|
|
16
|
-
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.canvas {
|
|
20
|
+
display: block;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.canvas-background,
|
|
24
|
+
.canvas-shapes {
|
|
25
|
+
position: absolute;
|
|
26
|
+
inset: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.canvas-background {
|
|
30
|
+
pointer-events: none;
|
|
17
31
|
}
|
|
18
32
|
|
|
19
33
|
#canvas-background circle {
|
|
@@ -22,16 +36,14 @@
|
|
|
22
36
|
|
|
23
37
|
#endarrow polyline {
|
|
24
38
|
fill: none;
|
|
25
|
-
stroke:
|
|
39
|
+
stroke: context-stroke;
|
|
26
40
|
vector-effect: non-scaling-stroke;
|
|
27
41
|
stroke-width: 2;
|
|
42
|
+
stroke-linejoin: round;
|
|
43
|
+
stroke-linecap: round;
|
|
28
44
|
}
|
|
29
45
|
|
|
30
46
|
.line {
|
|
31
|
-
&.no-color {
|
|
32
|
-
stroke: var(--canvas-line-color);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
47
|
&.variant-dashed {
|
|
36
48
|
stroke-dasharray: 6 6;
|
|
37
49
|
}
|