@fluentui/web-components 3.0.0-beta.83 → 3.0.0-beta.84
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/CHANGELOG.md +11 -2
- package/dist/dts/accordion-item/accordion-item.base.d.ts +71 -0
- package/dist/dts/accordion-item/accordion-item.d.ts +1 -71
- package/dist/dts/accordion-item/index.d.ts +2 -1
- package/dist/dts/anchor-button/anchor-button.base.d.ts +144 -0
- package/dist/dts/anchor-button/anchor-button.d.ts +2 -144
- package/dist/dts/anchor-button/index.d.ts +2 -1
- package/dist/dts/avatar/avatar.base.d.ts +42 -0
- package/dist/dts/avatar/avatar.d.ts +2 -42
- package/dist/dts/avatar/index.d.ts +2 -1
- package/dist/dts/button/button.base.d.ts +242 -0
- package/dist/dts/button/button.d.ts +2 -242
- package/dist/dts/button/index.d.ts +2 -1
- package/dist/dts/checkbox/checkbox.base.d.ts +288 -0
- package/dist/dts/checkbox/checkbox.d.ts +1 -288
- package/dist/dts/checkbox/index.d.ts +2 -1
- package/dist/dts/divider/divider.base.d.ts +49 -0
- package/dist/dts/divider/divider.d.ts +2 -49
- package/dist/dts/divider/index.d.ts +2 -1
- package/dist/dts/dropdown/dropdown.base.d.ts +418 -0
- package/dist/dts/dropdown/dropdown.d.ts +2 -418
- package/dist/dts/dropdown/dropdown.options.d.ts +1 -1
- package/dist/dts/dropdown/dropdown.template.d.ts +1 -1
- package/dist/dts/dropdown/index.d.ts +2 -1
- package/dist/dts/field/field.base.d.ts +120 -0
- package/dist/dts/field/field.d.ts +2 -120
- package/dist/dts/field/index.d.ts +2 -1
- package/dist/dts/link/link.d.ts +1 -1
- package/dist/dts/listbox/listbox.d.ts +1 -1
- package/dist/dts/progress-bar/index.d.ts +2 -1
- package/dist/dts/progress-bar/progress-bar.base.d.ts +73 -0
- package/dist/dts/progress-bar/progress-bar.d.ts +2 -73
- package/dist/dts/radio/radio.d.ts +1 -1
- package/dist/dts/rating-display/index.d.ts +2 -1
- package/dist/dts/rating-display/rating-display.base.d.ts +89 -0
- package/dist/dts/rating-display/rating-display.d.ts +1 -89
- package/dist/dts/spinner/index.d.ts +2 -1
- package/dist/dts/spinner/spinner.base.d.ts +14 -0
- package/dist/dts/spinner/spinner.d.ts +1 -14
- package/dist/dts/switch/switch.d.ts +1 -1
- package/dist/dts/tablist/index.d.ts +2 -1
- package/dist/dts/tablist/tablist.base.d.ts +95 -0
- package/dist/dts/tablist/tablist.d.ts +2 -95
- package/dist/dts/tabs/tabs.base.d.ts +90 -0
- package/dist/dts/tabs/tabs.d.ts +2 -90
- package/dist/dts/text-input/index.d.ts +2 -1
- package/dist/dts/text-input/text-input.base.d.ts +393 -0
- package/dist/dts/text-input/text-input.d.ts +2 -393
- package/dist/dts/textarea/index.d.ts +2 -1
- package/dist/dts/textarea/textarea.base.d.ts +347 -0
- package/dist/dts/textarea/textarea.d.ts +2 -347
- package/dist/esm/accordion/accordion.js +1 -1
- package/dist/esm/accordion/accordion.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.base.js +94 -0
- package/dist/esm/accordion-item/accordion-item.base.js.map +1 -0
- package/dist/esm/accordion-item/accordion-item.js +2 -91
- package/dist/esm/accordion-item/accordion-item.js.map +1 -1
- package/dist/esm/accordion-item/index.js +2 -1
- package/dist/esm/accordion-item/index.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.base.js +147 -0
- package/dist/esm/anchor-button/anchor-button.base.js.map +1 -0
- package/dist/esm/anchor-button/anchor-button.js +3 -145
- package/dist/esm/anchor-button/anchor-button.js.map +1 -1
- package/dist/esm/anchor-button/index.js +2 -1
- package/dist/esm/anchor-button/index.js.map +1 -1
- package/dist/esm/avatar/avatar.base.js +28 -0
- package/dist/esm/avatar/avatar.base.js.map +1 -0
- package/dist/esm/avatar/avatar.js +2 -26
- package/dist/esm/avatar/avatar.js.map +1 -1
- package/dist/esm/avatar/index.js +2 -1
- package/dist/esm/avatar/index.js.map +1 -1
- package/dist/esm/button/button.base.js +283 -0
- package/dist/esm/button/button.base.js.map +1 -0
- package/dist/esm/button/button.js +3 -281
- package/dist/esm/button/button.js.map +1 -1
- package/dist/esm/button/button.styles.js +2 -1
- package/dist/esm/button/button.styles.js.map +1 -1
- package/dist/esm/button/index.js +2 -1
- package/dist/esm/button/index.js.map +1 -1
- package/dist/esm/checkbox/checkbox.base.js +366 -0
- package/dist/esm/checkbox/checkbox.base.js.map +1 -0
- package/dist/esm/checkbox/checkbox.js +2 -363
- package/dist/esm/checkbox/checkbox.js.map +1 -1
- package/dist/esm/checkbox/index.js +2 -1
- package/dist/esm/checkbox/index.js.map +1 -1
- package/dist/esm/divider/divider.base.js +61 -0
- package/dist/esm/divider/divider.base.js.map +1 -0
- package/dist/esm/divider/divider.js +3 -58
- package/dist/esm/divider/divider.js.map +1 -1
- package/dist/esm/divider/index.js +2 -1
- package/dist/esm/divider/index.js.map +1 -1
- package/dist/esm/dropdown/dropdown.base.js +677 -0
- package/dist/esm/dropdown/dropdown.base.js.map +1 -0
- package/dist/esm/dropdown/dropdown.js +3 -674
- package/dist/esm/dropdown/dropdown.js.map +1 -1
- package/dist/esm/dropdown/index.js +2 -1
- package/dist/esm/dropdown/index.js.map +1 -1
- package/dist/esm/field/field.base.js +189 -0
- package/dist/esm/field/field.base.js.map +1 -0
- package/dist/esm/field/field.js +3 -187
- package/dist/esm/field/field.js.map +1 -1
- package/dist/esm/field/index.js +2 -1
- package/dist/esm/field/index.js.map +1 -1
- package/dist/esm/link/link.js +1 -1
- package/dist/esm/link/link.js.map +1 -1
- package/dist/esm/progress-bar/index.js +2 -1
- package/dist/esm/progress-bar/index.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.base.js +90 -0
- package/dist/esm/progress-bar/progress-bar.base.js.map +1 -0
- package/dist/esm/progress-bar/progress-bar.js +3 -87
- package/dist/esm/progress-bar/progress-bar.js.map +1 -1
- package/dist/esm/radio/radio.js +1 -1
- package/dist/esm/radio/radio.js.map +1 -1
- package/dist/esm/rating-display/index.js +2 -1
- package/dist/esm/rating-display/index.js.map +1 -1
- package/dist/esm/rating-display/rating-display.base.js +94 -0
- package/dist/esm/rating-display/rating-display.base.js.map +1 -0
- package/dist/esm/rating-display/rating-display.js +2 -92
- package/dist/esm/rating-display/rating-display.js.map +1 -1
- package/dist/esm/spinner/index.js +2 -1
- package/dist/esm/spinner/index.js.map +1 -1
- package/dist/esm/spinner/spinner.base.js +18 -0
- package/dist/esm/spinner/spinner.base.js.map +1 -0
- package/dist/esm/spinner/spinner.js +2 -17
- package/dist/esm/spinner/spinner.js.map +1 -1
- package/dist/esm/switch/switch.js +1 -1
- package/dist/esm/switch/switch.js.map +1 -1
- package/dist/esm/tablist/index.js +2 -1
- package/dist/esm/tablist/index.js.map +1 -1
- package/dist/esm/tablist/tablist.base.js +248 -0
- package/dist/esm/tablist/tablist.base.js.map +1 -0
- package/dist/esm/tablist/tablist.js +3 -245
- package/dist/esm/tablist/tablist.js.map +1 -1
- package/dist/esm/tabs/tabs.base.js +279 -0
- package/dist/esm/tabs/tabs.base.js.map +1 -0
- package/dist/esm/tabs/tabs.js +2 -276
- package/dist/esm/tabs/tabs.js.map +1 -1
- package/dist/esm/text-input/index.js +2 -1
- package/dist/esm/text-input/index.js.map +1 -1
- package/dist/esm/text-input/text-input.base.js +409 -0
- package/dist/esm/text-input/text-input.base.js.map +1 -0
- package/dist/esm/text-input/text-input.js +3 -407
- package/dist/esm/text-input/text-input.js.map +1 -1
- package/dist/esm/textarea/index.js +2 -1
- package/dist/esm/textarea/index.js.map +1 -1
- package/dist/esm/textarea/textarea.base.js +494 -0
- package/dist/esm/textarea/textarea.base.js.map +1 -0
- package/dist/esm/textarea/textarea.js +3 -491
- package/dist/esm/textarea/textarea.js.map +1 -1
- package/dist/web-components.js +682 -555
- package/dist/web-components.min.js +269 -269
- package/package.json +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../../src/accordion/accordion.ts"],"names":[],"m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wBACnC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC;oBACrD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CAkCF;AAhLQ;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;6CACgC;AAyB5D;IADN,UAAU;wDACkC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr, FASTElement, nullableNumberConverter } from '@microsoft/fast-element';
|
|
3
|
+
import { uniqueId } from '@microsoft/fast-web-utilities';
|
|
4
|
+
import { toggleState } from '../utils/element-internals.js';
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @slot start - Content positioned before heading in the collapsed state
|
|
8
|
+
* @slot heading - Content which serves as the accordion item heading and text of the expand button
|
|
9
|
+
* @slot - The default slot for accordion item content
|
|
10
|
+
* @slot marker-expanded - The expanded icon
|
|
11
|
+
* @slot marker-collapsed - The collapsed icon
|
|
12
|
+
* @csspart heading - Wraps the button
|
|
13
|
+
* @csspart button - The button which serves to invoke the item
|
|
14
|
+
* @csspart content - The wrapper for the accordion item content
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export class BaseAccordionItem extends FASTElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
/**
|
|
22
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
this.elementInternals = this.attachInternals();
|
|
27
|
+
/**
|
|
28
|
+
* Configures the {@link https://www.w3.org/TR/wai-aria-1.1/#aria-level | level} of the
|
|
29
|
+
* heading element.
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
* @remarks
|
|
33
|
+
* HTML attribute: heading-level
|
|
34
|
+
*/
|
|
35
|
+
this.headinglevel = 2;
|
|
36
|
+
/**
|
|
37
|
+
* Expands or collapses the item.
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
* @remarks
|
|
41
|
+
* HTML attribute: expanded
|
|
42
|
+
*/
|
|
43
|
+
this.expanded = false;
|
|
44
|
+
/**
|
|
45
|
+
* Disables an accordion item
|
|
46
|
+
*
|
|
47
|
+
* @public
|
|
48
|
+
* @remarks
|
|
49
|
+
* HTML attribute: disabled
|
|
50
|
+
*/
|
|
51
|
+
this.disabled = false;
|
|
52
|
+
/**
|
|
53
|
+
* The item ID
|
|
54
|
+
*
|
|
55
|
+
* @public
|
|
56
|
+
* @remarks
|
|
57
|
+
* HTML Attribute: id
|
|
58
|
+
*/
|
|
59
|
+
this.id = uniqueId('accordion-');
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Handles expanded changes
|
|
63
|
+
* @param prev - previous value
|
|
64
|
+
* @param next - next value
|
|
65
|
+
*/
|
|
66
|
+
expandedChanged(prev, next) {
|
|
67
|
+
toggleState(this.elementInternals, 'expanded', next);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Handles disabled changes
|
|
71
|
+
* @param prev - previous value
|
|
72
|
+
* @param next - next value
|
|
73
|
+
*/
|
|
74
|
+
disabledChanged(prev, next) {
|
|
75
|
+
toggleState(this.elementInternals, 'disabled', next);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
__decorate([
|
|
79
|
+
attr({
|
|
80
|
+
attribute: 'heading-level',
|
|
81
|
+
mode: 'fromView',
|
|
82
|
+
converter: nullableNumberConverter,
|
|
83
|
+
})
|
|
84
|
+
], BaseAccordionItem.prototype, "headinglevel", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
attr({ mode: 'boolean' })
|
|
87
|
+
], BaseAccordionItem.prototype, "expanded", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
attr({ mode: 'boolean' })
|
|
90
|
+
], BaseAccordionItem.prototype, "disabled", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
attr
|
|
93
|
+
], BaseAccordionItem.prototype, "id", void 0);
|
|
94
|
+
//# sourceMappingURL=accordion-item.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion-item.base.js","sourceRoot":"","sources":["../../../src/accordion-item/accordion-item.base.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAAlD;;QACE;;;;WAIG;QACI,qBAAgB,GAAqB,IAAI,CAAC,eAAe,EAAE,CAAC;QAEnE;;;;;;;WAOG;QAMI,iBAAY,GAA0B,CAAC,CAAC;QAE/C;;;;;;WAMG;QAEI,aAAQ,GAAY,KAAK,CAAC;QAWjC;;;;;;WAMG;QAEI,aAAQ,GAAY,KAAK,CAAC;QAWjC;;;;;;WAMG;QAEI,OAAE,GAAW,QAAQ,CAAC,YAAY,CAAC,CAAC;IAM7C,CAAC;IA1CC;;;;OAIG;IACI,eAAe,CAAC,IAAa,EAAE,IAAa;QACjD,WAAW,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IAYD;;;;OAIG;IACI,eAAe,CAAC,IAAa,EAAE,IAAa;QACjD,WAAW,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;CAgBF;AAtDQ;IALN,IAAI,CAAC;QACJ,SAAS,EAAE,eAAe;QAC1B,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,uBAAuB;KACnC,CAAC;uDAC6C;AAUxC;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;mDACO;AAmB1B;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;mDACO;AAmB1B;IADN,IAAI;6CACsC"}
|
|
@@ -1,99 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { attr
|
|
3
|
-
import { uniqueId } from '@microsoft/fast-web-utilities';
|
|
2
|
+
import { attr } from '@microsoft/fast-element';
|
|
4
3
|
import { StartEnd } from '../patterns/index.js';
|
|
5
4
|
import { applyMixins } from '../utils/apply-mixins.js';
|
|
6
5
|
import { swapStates, toggleState } from '../utils/element-internals.js';
|
|
6
|
+
import { BaseAccordionItem } from './accordion-item.base.js';
|
|
7
7
|
import { AccordionItemMarkerPosition, AccordionItemSize } from './accordion-item.options.js';
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @slot start - Content positioned before heading in the collapsed state
|
|
11
|
-
* @slot heading - Content which serves as the accordion item heading and text of the expand button
|
|
12
|
-
* @slot - The default slot for accordion item content
|
|
13
|
-
* @slot marker-expanded - The expanded icon
|
|
14
|
-
* @slot marker-collapsed - The collapsed icon
|
|
15
|
-
* @csspart heading - Wraps the button
|
|
16
|
-
* @csspart button - The button which serves to invoke the item
|
|
17
|
-
* @csspart content - The wrapper for the accordion item content
|
|
18
|
-
*
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
export class BaseAccordionItem extends FASTElement {
|
|
22
|
-
constructor() {
|
|
23
|
-
super(...arguments);
|
|
24
|
-
/**
|
|
25
|
-
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
26
|
-
*
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
this.elementInternals = this.attachInternals();
|
|
30
|
-
/**
|
|
31
|
-
* Configures the {@link https://www.w3.org/TR/wai-aria-1.1/#aria-level | level} of the
|
|
32
|
-
* heading element.
|
|
33
|
-
*
|
|
34
|
-
* @public
|
|
35
|
-
* @remarks
|
|
36
|
-
* HTML attribute: heading-level
|
|
37
|
-
*/
|
|
38
|
-
this.headinglevel = 2;
|
|
39
|
-
/**
|
|
40
|
-
* Expands or collapses the item.
|
|
41
|
-
*
|
|
42
|
-
* @public
|
|
43
|
-
* @remarks
|
|
44
|
-
* HTML attribute: expanded
|
|
45
|
-
*/
|
|
46
|
-
this.expanded = false;
|
|
47
|
-
/**
|
|
48
|
-
* Disables an accordion item
|
|
49
|
-
*
|
|
50
|
-
* @public
|
|
51
|
-
* @remarks
|
|
52
|
-
* HTML attribute: disabled
|
|
53
|
-
*/
|
|
54
|
-
this.disabled = false;
|
|
55
|
-
/**
|
|
56
|
-
* The item ID
|
|
57
|
-
*
|
|
58
|
-
* @public
|
|
59
|
-
* @remarks
|
|
60
|
-
* HTML Attribute: id
|
|
61
|
-
*/
|
|
62
|
-
this.id = uniqueId('accordion-');
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Handles expanded changes
|
|
66
|
-
* @param prev - previous value
|
|
67
|
-
* @param next - next value
|
|
68
|
-
*/
|
|
69
|
-
expandedChanged(prev, next) {
|
|
70
|
-
toggleState(this.elementInternals, 'expanded', next);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Handles disabled changes
|
|
74
|
-
* @param prev - previous value
|
|
75
|
-
* @param next - next value
|
|
76
|
-
*/
|
|
77
|
-
disabledChanged(prev, next) {
|
|
78
|
-
toggleState(this.elementInternals, 'disabled', next);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
__decorate([
|
|
82
|
-
attr({
|
|
83
|
-
attribute: 'heading-level',
|
|
84
|
-
mode: 'fromView',
|
|
85
|
-
converter: nullableNumberConverter,
|
|
86
|
-
})
|
|
87
|
-
], BaseAccordionItem.prototype, "headinglevel", void 0);
|
|
88
|
-
__decorate([
|
|
89
|
-
attr({ mode: 'boolean' })
|
|
90
|
-
], BaseAccordionItem.prototype, "expanded", void 0);
|
|
91
|
-
__decorate([
|
|
92
|
-
attr({ mode: 'boolean' })
|
|
93
|
-
], BaseAccordionItem.prototype, "disabled", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
attr
|
|
96
|
-
], BaseAccordionItem.prototype, "id", void 0);
|
|
97
8
|
/**
|
|
98
9
|
* An Accordion Item Custom HTML Element.
|
|
99
10
|
* Based on BaseAccordionItem and includes style and layout specific attributes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion-item.js","sourceRoot":"","sources":["../../../src/accordion-item/accordion-item.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"accordion-item.js","sourceRoot":"","sources":["../../../src/accordion-item/accordion-item.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAW7F;;;;;GAKG;AACH,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAApD;;QA0CE;;;;;;WAMG;QAEI,UAAK,GAAY,KAAK,CAAC;IAUhC,CAAC;IAjDC;;;;OAIG;IACI,WAAW,CAAC,IAAmC,EAAE,IAAmC;QACzF,UAAU,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC;IACnE,CAAC;IAYD;;;;OAIG;IACI,qBAAqB,CAC1B,IAA6C,EAC7C,IAA6C;QAE7C,UAAU,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,2BAA2B,EAAE,QAAQ,CAAC,CAAC;IACvF,CAAC;IAYD;;;;OAIG;IACI,YAAY,CAAC,IAAa,EAAE,IAAa;QAC9C,WAAW,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;CACF;AAnDQ;IADN,IAAI;2CAC2B;AAmBzB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;qDACa;AAsB7C;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;4CACI;AAoBhC,WAAW,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { BaseAccordionItem } from './accordion-item.base.js';
|
|
2
|
+
export { AccordionItem } from './accordion-item.js';
|
|
2
3
|
export { AccordionItemSize, AccordionItemMarkerPosition } from './accordion-item.options.js';
|
|
3
4
|
export { styles as accordionItemStyles } from './accordion-item.styles.js';
|
|
4
5
|
export { definition as accordionItemDefinition } from './accordion-item.definition.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/accordion-item/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/accordion-item/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,UAAU,IAAI,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,EAAE,QAAQ,IAAI,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr, FASTElement, Observable } from '@microsoft/fast-element';
|
|
3
|
+
import { keyEnter } from '@microsoft/fast-web-utilities';
|
|
4
|
+
import { AnchorAttributes } from './anchor-button.options.js';
|
|
5
|
+
/**
|
|
6
|
+
* An Anchor Custom HTML Element.
|
|
7
|
+
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element }.
|
|
8
|
+
*
|
|
9
|
+
* @slot start - Content which can be provided before the anchor content
|
|
10
|
+
* @slot end - Content which can be provided after the anchor content
|
|
11
|
+
* @slot - The default slot for anchor content
|
|
12
|
+
* @csspart control - The anchor element
|
|
13
|
+
* @csspart content - The element wrapping anchor content
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export class BaseAnchor extends FASTElement {
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
/**
|
|
21
|
+
* Holds a reference to the platform to manage ctrl+click on Windows and cmd+click on Mac
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
this.isMac = navigator.userAgent.includes('Mac');
|
|
25
|
+
/**
|
|
26
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
27
|
+
*
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
this.elementInternals = this.attachInternals();
|
|
31
|
+
/**
|
|
32
|
+
* The proxy anchor element
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
this.internalProxyAnchor = this.createProxyElement();
|
|
36
|
+
this.elementInternals.role = 'link';
|
|
37
|
+
}
|
|
38
|
+
connectedCallback() {
|
|
39
|
+
super.connectedCallback();
|
|
40
|
+
Observable.getNotifier(this).subscribe(this);
|
|
41
|
+
Object.keys(this.$fastController.definition.attributeLookup).forEach(key => {
|
|
42
|
+
this.handleChange(this, key);
|
|
43
|
+
});
|
|
44
|
+
this.append(this.internalProxyAnchor);
|
|
45
|
+
}
|
|
46
|
+
disconnectedCallback() {
|
|
47
|
+
super.disconnectedCallback();
|
|
48
|
+
Observable.getNotifier(this).unsubscribe(this);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Handles changes to observable properties
|
|
52
|
+
* @internal
|
|
53
|
+
* @param source - the source of the change
|
|
54
|
+
* @param propertyName - the property name being changed
|
|
55
|
+
*/
|
|
56
|
+
handleChange(source, propertyName) {
|
|
57
|
+
if (propertyName in AnchorAttributes) {
|
|
58
|
+
const attribute = this.$fastController.definition.attributeLookup[propertyName]?.attribute;
|
|
59
|
+
if (attribute) {
|
|
60
|
+
this.handleProxyAttributeChange(attribute, this[propertyName]);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Handles the anchor click event.
|
|
66
|
+
*
|
|
67
|
+
* @param e - The event object
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
clickHandler(e) {
|
|
71
|
+
if (this.href) {
|
|
72
|
+
const newTab = !this.isMac ? e.ctrlKey : e.metaKey;
|
|
73
|
+
this.handleNavigation(newTab);
|
|
74
|
+
}
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Handles keydown events for the anchor.
|
|
79
|
+
*
|
|
80
|
+
* @param e - the keyboard event
|
|
81
|
+
* @returns - the return value of the click handler
|
|
82
|
+
* @public
|
|
83
|
+
*/
|
|
84
|
+
keydownHandler(e) {
|
|
85
|
+
if (this.href) {
|
|
86
|
+
if (e.key === keyEnter) {
|
|
87
|
+
const newTab = !this.isMac ? e.ctrlKey : e.metaKey || e.ctrlKey;
|
|
88
|
+
this.handleNavigation(newTab);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Handles navigation based on input
|
|
96
|
+
* If the metaKey is pressed, opens the href in a new window, if false, uses the click on the proxy
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
handleNavigation(newTab) {
|
|
100
|
+
newTab ? window.open(this.href, '_blank') : this.internalProxyAnchor.click();
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A method for updating proxy attributes when attributes have changed
|
|
104
|
+
* @internal
|
|
105
|
+
* @param attribute - an attribute to set/remove
|
|
106
|
+
* @param value - the value of the attribute
|
|
107
|
+
*/
|
|
108
|
+
handleProxyAttributeChange(attribute, value) {
|
|
109
|
+
if (value) {
|
|
110
|
+
this.internalProxyAnchor.setAttribute(attribute, value);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
this.internalProxyAnchor.removeAttribute(attribute);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
createProxyElement() {
|
|
117
|
+
const proxy = this.internalProxyAnchor ?? document.createElement('a');
|
|
118
|
+
proxy.ariaHidden = 'true';
|
|
119
|
+
proxy.tabIndex = -1;
|
|
120
|
+
return proxy;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
__decorate([
|
|
124
|
+
attr
|
|
125
|
+
], BaseAnchor.prototype, "download", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
attr
|
|
128
|
+
], BaseAnchor.prototype, "href", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
attr
|
|
131
|
+
], BaseAnchor.prototype, "hreflang", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
attr
|
|
134
|
+
], BaseAnchor.prototype, "ping", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
attr
|
|
137
|
+
], BaseAnchor.prototype, "referrerpolicy", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
attr
|
|
140
|
+
], BaseAnchor.prototype, "rel", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
attr
|
|
143
|
+
], BaseAnchor.prototype, "target", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
attr
|
|
146
|
+
], BaseAnchor.prototype, "type", void 0);
|
|
147
|
+
//# sourceMappingURL=anchor-button.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchor-button.base.js","sourceRoot":"","sources":["../../../src/anchor-button/anchor-button.base.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAqB,MAAM,4BAA4B,CAAC;AAEjF;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,UAAW,SAAQ,WAAW;IA6GzC;QACE,KAAK,EAAE,CAAC;QA7GV;;;WAGG;QACc,UAAK,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAE7D;;;;WAIG;QACI,qBAAgB,GAAqB,IAAI,CAAC,eAAe,EAAE,CAAC;QAEnE;;;WAGG;QACK,wBAAmB,GAAsB,IAAI,CAAC,kBAAkB,EAAE,CAAC;QA8FzE,IAAI,CAAC,gBAAgB,CAAC,IAAI,GAAG,MAAM,CAAC;IACtC,CAAC;IAEM,iBAAiB;QACtB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAE7C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACzE,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACxC,CAAC;IAEM,oBAAoB;QACzB,KAAK,CAAC,o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CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAC;IAC/E,CAAC;IAED;;;;;OAKG;IACK,0BAA0B,CAAC,SAAiB,EAAE,KAAyB;QAC7E,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC1D,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,mBAAmB,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;IAEO,kBAAkB;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,mBAAmB,IAAI,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACtE,KAAK,CAAC,UAAU,GAAG,MAAM,CAAC;QAC1B,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;QACpB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AApLQ;IADN,IAAI;4CACoB;AAWlB;IADN,IAAI;wCACgB;AAWd;IADN,IAAI;4CACoB;AAWlB;IADN,IAAI;wCACgB;AAWd;IADN,IAAI;kDAC0B;AAWxB;IADN,IAAI;uCACe;AAWb;IADN,IAAI;0CACwB;AAWtB;IADN,IAAI;wCACgB"}
|
|
@@ -1,152 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { attr
|
|
3
|
-
import { keyEnter } from '@microsoft/fast-web-utilities';
|
|
2
|
+
import { attr } from '@microsoft/fast-element';
|
|
4
3
|
import { StartEnd } from '../patterns/index.js';
|
|
5
4
|
import { applyMixins } from '../utils/apply-mixins.js';
|
|
6
5
|
import { swapStates, toggleState } from '../utils/element-internals.js';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
* An Anchor Custom HTML Element.
|
|
10
|
-
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element }.
|
|
11
|
-
*
|
|
12
|
-
* @slot start - Content which can be provided before the anchor content
|
|
13
|
-
* @slot end - Content which can be provided after the anchor content
|
|
14
|
-
* @slot - The default slot for anchor content
|
|
15
|
-
* @csspart control - The anchor element
|
|
16
|
-
* @csspart content - The element wrapping anchor content
|
|
17
|
-
*
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
export class BaseAnchor extends FASTElement {
|
|
21
|
-
constructor() {
|
|
22
|
-
super();
|
|
23
|
-
/**
|
|
24
|
-
* Holds a reference to the platform to manage ctrl+click on Windows and cmd+click on Mac
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
this.isMac = navigator.userAgent.includes('Mac');
|
|
28
|
-
/**
|
|
29
|
-
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
30
|
-
*
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
this.elementInternals = this.attachInternals();
|
|
34
|
-
/**
|
|
35
|
-
* The proxy anchor element
|
|
36
|
-
* @internal
|
|
37
|
-
*/
|
|
38
|
-
this.internalProxyAnchor = this.createProxyElement();
|
|
39
|
-
this.elementInternals.role = 'link';
|
|
40
|
-
}
|
|
41
|
-
connectedCallback() {
|
|
42
|
-
super.connectedCallback();
|
|
43
|
-
Observable.getNotifier(this).subscribe(this);
|
|
44
|
-
Object.keys(this.$fastController.definition.attributeLookup).forEach(key => {
|
|
45
|
-
this.handleChange(this, key);
|
|
46
|
-
});
|
|
47
|
-
this.append(this.internalProxyAnchor);
|
|
48
|
-
}
|
|
49
|
-
disconnectedCallback() {
|
|
50
|
-
super.disconnectedCallback();
|
|
51
|
-
Observable.getNotifier(this).unsubscribe(this);
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Handles changes to observable properties
|
|
55
|
-
* @internal
|
|
56
|
-
* @param source - the source of the change
|
|
57
|
-
* @param propertyName - the property name being changed
|
|
58
|
-
*/
|
|
59
|
-
handleChange(source, propertyName) {
|
|
60
|
-
if (propertyName in AnchorAttributes) {
|
|
61
|
-
const attribute = this.$fastController.definition.attributeLookup[propertyName]?.attribute;
|
|
62
|
-
if (attribute) {
|
|
63
|
-
this.handleProxyAttributeChange(attribute, this[propertyName]);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Handles the anchor click event.
|
|
69
|
-
*
|
|
70
|
-
* @param e - The event object
|
|
71
|
-
* @internal
|
|
72
|
-
*/
|
|
73
|
-
clickHandler(e) {
|
|
74
|
-
if (this.href) {
|
|
75
|
-
const newTab = !this.isMac ? e.ctrlKey : e.metaKey;
|
|
76
|
-
this.handleNavigation(newTab);
|
|
77
|
-
}
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Handles keydown events for the anchor.
|
|
82
|
-
*
|
|
83
|
-
* @param e - the keyboard event
|
|
84
|
-
* @returns - the return value of the click handler
|
|
85
|
-
* @public
|
|
86
|
-
*/
|
|
87
|
-
keydownHandler(e) {
|
|
88
|
-
if (this.href) {
|
|
89
|
-
if (e.key === keyEnter) {
|
|
90
|
-
const newTab = !this.isMac ? e.ctrlKey : e.metaKey || e.ctrlKey;
|
|
91
|
-
this.handleNavigation(newTab);
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return true;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Handles navigation based on input
|
|
99
|
-
* If the metaKey is pressed, opens the href in a new window, if false, uses the click on the proxy
|
|
100
|
-
* @internal
|
|
101
|
-
*/
|
|
102
|
-
handleNavigation(newTab) {
|
|
103
|
-
newTab ? window.open(this.href, '_blank') : this.internalProxyAnchor.click();
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* A method for updating proxy attributes when attributes have changed
|
|
107
|
-
* @internal
|
|
108
|
-
* @param attribute - an attribute to set/remove
|
|
109
|
-
* @param value - the value of the attribute
|
|
110
|
-
*/
|
|
111
|
-
handleProxyAttributeChange(attribute, value) {
|
|
112
|
-
if (value) {
|
|
113
|
-
this.internalProxyAnchor.setAttribute(attribute, value);
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
this.internalProxyAnchor.removeAttribute(attribute);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
createProxyElement() {
|
|
120
|
-
const proxy = this.internalProxyAnchor ?? document.createElement('a');
|
|
121
|
-
proxy.ariaHidden = 'true';
|
|
122
|
-
proxy.tabIndex = -1;
|
|
123
|
-
return proxy;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
__decorate([
|
|
127
|
-
attr
|
|
128
|
-
], BaseAnchor.prototype, "download", void 0);
|
|
129
|
-
__decorate([
|
|
130
|
-
attr
|
|
131
|
-
], BaseAnchor.prototype, "href", void 0);
|
|
132
|
-
__decorate([
|
|
133
|
-
attr
|
|
134
|
-
], BaseAnchor.prototype, "hreflang", void 0);
|
|
135
|
-
__decorate([
|
|
136
|
-
attr
|
|
137
|
-
], BaseAnchor.prototype, "ping", void 0);
|
|
138
|
-
__decorate([
|
|
139
|
-
attr
|
|
140
|
-
], BaseAnchor.prototype, "referrerpolicy", void 0);
|
|
141
|
-
__decorate([
|
|
142
|
-
attr
|
|
143
|
-
], BaseAnchor.prototype, "rel", void 0);
|
|
144
|
-
__decorate([
|
|
145
|
-
attr
|
|
146
|
-
], BaseAnchor.prototype, "target", void 0);
|
|
147
|
-
__decorate([
|
|
148
|
-
attr
|
|
149
|
-
], BaseAnchor.prototype, "type", void 0);
|
|
6
|
+
import { BaseAnchor } from './anchor-button.base.js';
|
|
7
|
+
import { AnchorButtonAppearance, AnchorButtonShape, AnchorButtonSize } from './anchor-button.options.js';
|
|
150
8
|
/**
|
|
151
9
|
* An Anchor Custom HTML Element.
|
|
152
10
|
* Based on BaseAnchor and includes style and layout specific attributes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor-button.js","sourceRoot":"","sources":["../../../src/anchor-button/anchor-button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"anchor-button.js","sourceRoot":"","sources":["../../../src/anchor-button/anchor-button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAQzG;;;;;GAKG;AACH,MAAM,OAAO,YAAa,SAAQ,UAAU;IAA5C;;QA0DE;;;;;;WAMG;QAEI,aAAQ,GAAY,KAAK,CAAC;IAUnC,CAAC;IAjEC;;;;OAIG;IACI,iBAAiB,CAAC,IAAwC,EAAE,IAAwC;QACzG,UAAU,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,sBAAsB,CAAC,CAAC;IACxE,CAAC;IAYD;;;;OAIG;IACI,YAAY,CAAC,IAAmC,EAAE,IAAmC;QAC1F,UAAU,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC;IACnE,CAAC;IAYD;;;;OAIG;IACI,WAAW,CAAC,IAAkC,EAAE,IAAkC;QACvF,UAAU,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAClE,CAAC;IAYD;;;;OAIG;IACI,eAAe,CAAC,IAAa,EAAE,IAAa;QACjD,WAAW,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;CACF;AAnEQ;IADN,IAAI;gDACkD;AAmBhD;IADN,IAAI;2CACwC;AAmBtC;IADN,IAAI;0CAC0B;AAmBxB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8CACjB;AAoBnC,WAAW,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { definition as AnchorButtonDefinition } from './anchor-button.definition.js';
|
|
2
|
-
export { BaseAnchor
|
|
2
|
+
export { BaseAnchor } from './anchor-button.base.js';
|
|
3
|
+
export { AnchorButton } from './anchor-button.js';
|
|
3
4
|
export { AnchorButtonAppearance, AnchorButtonShape, AnchorButtonSize, AnchorTarget } from './anchor-button.options.js';
|
|
4
5
|
export { template as AnchorButtonTemplate } from './anchor-button.template.js';
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/anchor-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/anchor-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEvH,OAAO,EAAE,QAAQ,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr, FASTElement } from '@microsoft/fast-element';
|
|
3
|
+
/**
|
|
4
|
+
* The base class used for constructing a fluent-avatar custom element
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export class BaseAvatar extends FASTElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
/**
|
|
11
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
this.elementInternals = this.attachInternals();
|
|
16
|
+
this.elementInternals.role = 'img';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
attr
|
|
21
|
+
], BaseAvatar.prototype, "name", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
attr
|
|
24
|
+
], BaseAvatar.prototype, "initials", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
attr
|
|
27
|
+
], BaseAvatar.prototype, "active", void 0);
|
|
28
|
+
//# sourceMappingURL=avatar.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.base.js","sourceRoot":"","sources":["../../../src/avatar/avatar.base.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG5D;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,WAAW;IAyCzC;QACE,KAAK,EAAE,CAAC;QAzCV;;;;WAIG;QACI,qBAAgB,GAAqB,IAAI,CAAC,eAAe,EAAE,CAAC;QAsCjE,IAAI,CAAC,gBAAgB,CAAC,IAAI,GAAG,KAAK,CAAC;IACrC,CAAC;CACF;AA9BQ;IADN,IAAI;wCAC4B;AAU1B;IADN,IAAI;4CACgC;AAa9B;IADN,IAAI;0CACoC"}
|
|
@@ -1,33 +1,9 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { attr,
|
|
2
|
+
import { attr, nullableNumberConverter, Observable } from '@microsoft/fast-element';
|
|
3
3
|
import { getInitials } from '../utils/get-initials.js';
|
|
4
4
|
import { swapStates } from '../utils/element-internals.js';
|
|
5
|
+
import { BaseAvatar } from './avatar.base.js';
|
|
5
6
|
import { AvatarColor, AvatarNamedColor, } from './avatar.options.js';
|
|
6
|
-
/**
|
|
7
|
-
* The base class used for constructing a fluent-avatar custom element
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export class BaseAvatar extends FASTElement {
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
/**
|
|
14
|
-
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
15
|
-
*
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
this.elementInternals = this.attachInternals();
|
|
19
|
-
this.elementInternals.role = 'img';
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
__decorate([
|
|
23
|
-
attr
|
|
24
|
-
], BaseAvatar.prototype, "name", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
attr
|
|
27
|
-
], BaseAvatar.prototype, "initials", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
attr
|
|
30
|
-
], BaseAvatar.prototype, "active", void 0);
|
|
31
7
|
/**
|
|
32
8
|
* An Avatar Custom HTML Element.
|
|
33
9
|
* Based on BaseAvatar and includes style and layout specific attributes
|