@fluentui/web-components 2.1.3 → 2.2.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/CHANGELOG.json +16 -1
- package/CHANGELOG.md +11 -2
- package/dist/dts/component-definitions.d.ts +2 -1
- package/dist/dts/custom-elements.d.ts +4 -2
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/listbox/index.d.ts +3 -6
- package/dist/dts/listbox/listbox.stories.d.ts +1 -1
- package/dist/dts/search/index.d.ts +38 -0
- package/dist/dts/search/search.stories.d.ts +75 -0
- package/dist/dts/search/search.styles.d.ts +4 -0
- package/dist/dts/search/search.template.d.ts +6 -0
- package/dist/esm/component-definitions.js +2 -0
- package/dist/esm/custom-elements.js +3 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/listbox/index.js +3 -6
- package/dist/esm/search/index.js +52 -0
- package/dist/esm/search/search.stories.js +83 -0
- package/dist/esm/search/search.styles.js +108 -0
- package/dist/esm/search/search.template.js +82 -0
- package/dist/esm/search/search.vscode.definition.json +145 -0
- package/dist/fluent-web-components.api.json +270 -5
- package/dist/web-components.d.ts +51 -2
- package/dist/web-components.js +701 -240
- package/dist/web-components.min.js +142 -132
- package/docs/api-report.md +34 -9
- package/package.json +2 -2
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "@fluentui/web-components",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 07 Jan 2022 07:25:58 GMT",
|
|
6
|
+
"tag": "@fluentui/web-components_v2.2.0",
|
|
7
|
+
"version": "2.2.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "jes@microsoft.com",
|
|
12
|
+
"package": "@fluentui/web-components",
|
|
13
|
+
"commit": "ebe29c6b802a65fd6a568d511e067ec4a272f817",
|
|
14
|
+
"comment": "feat: add search web component"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Wed, 15 Dec 2021 07:31:29 GMT",
|
|
6
21
|
"tag": "@fluentui/web-components_v2.1.3",
|
|
7
22
|
"version": "2.1.3",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
# Change Log - @fluentui/web-components
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 07 Jan 2022 07:25:58 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [2.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v2.2.0)
|
|
8
|
+
|
|
9
|
+
Fri, 07 Jan 2022 07:25:58 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v2.1.3..@fluentui/web-components_v2.2.0)
|
|
11
|
+
|
|
12
|
+
### Minor changes
|
|
13
|
+
|
|
14
|
+
- feat: add search web component ([PR #21177](https://github.com/microsoft/fluentui/pull/21177) by jes@microsoft.com)
|
|
15
|
+
|
|
7
16
|
## [2.1.3](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v2.1.3)
|
|
8
17
|
|
|
9
|
-
Wed, 15 Dec 2021 07:
|
|
18
|
+
Wed, 15 Dec 2021 07:31:29 GMT
|
|
10
19
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v2.1.2..@fluentui/web-components_v2.1.3)
|
|
11
20
|
|
|
12
21
|
### Patches
|
|
@@ -26,6 +26,7 @@ import fluentProgressRingDefinition from "./progress/progress-ring/progress-ring
|
|
|
26
26
|
import fluentProgressDefinition from "./progress/progress/progress.vscode.definition.json";
|
|
27
27
|
import fluentRadioDefinition from "./radio/radio.vscode.definition.json";
|
|
28
28
|
import fluentRadioGroupDefinition from "./radio-group/radio-group.vscode.definition.json";
|
|
29
|
+
import fluentSearchDefinition from "./search/search.vscode.definition.json";
|
|
29
30
|
import fluentSelectDefinition from "./select/select.vscode.definition.json";
|
|
30
31
|
import fluentSkeletonDefinition from "./skeleton/skeleton.vscode.definition.json";
|
|
31
32
|
import fluentSliderDefinition from "./slider/slider.vscode.definition.json";
|
|
@@ -39,4 +40,4 @@ import fluentTextFieldDefinition from "./text-field/text-field.vscode.definition
|
|
|
39
40
|
import fluentTooltipDefinition from "./tooltip/tooltip.vscode.definition.json";
|
|
40
41
|
import fluentTreeItemDefinition from "./tree-item/tree-item.vscode.definition.json";
|
|
41
42
|
import fluentTreeViewDefinition from "./tree-view/tree-view.vscode.definition.json";
|
|
42
|
-
export { fluentAccordionItemDefinition, fluentAccordionDefinition, fluentAnchorDefinition, fluentAnchoredRegionDefinition, fluentBadgeDefinition, fluentBreadcrumbDefinition, fluentBreadcrumbItemDefinition, fluentButtonDefinition, fluentCardDefinition, fluentCheckboxDefinition, fluentComboboxDefinition, fluentDataGridDefinition, fluentDataGridCellDefinition, fluentDataGridRowDefinition, fluentDesignSystemProviderDefinition, fluentDialogDefinition, fluentDividerDefinition, fluentFlipperDefinition, fluentHorizontalScrollDefinition, fluentListboxDefinition, fluentListboxOptionDefinition, fluentMenuDefinition, fluentMenuItemDefinition, fluentNumberFieldDefinition, fluentProgressRingDefinition, fluentProgressDefinition, fluentRadioDefinition, fluentRadioGroupDefinition, fluentSelectDefinition, fluentSkeletonDefinition, fluentSliderDefinition, fluentSliderLabelDefinition, fluentSwitchDefinition, fluentTabPanelDefinition, fluentTabDefinition, fluentTabsDefinition, fluentTextAreaDefinition, fluentTextFieldDefinition, fluentTooltipDefinition, fluentTreeItemDefinition, fluentTreeViewDefinition };
|
|
43
|
+
export { fluentAccordionItemDefinition, fluentAccordionDefinition, fluentAnchorDefinition, fluentAnchoredRegionDefinition, fluentBadgeDefinition, fluentBreadcrumbDefinition, fluentBreadcrumbItemDefinition, fluentButtonDefinition, fluentCardDefinition, fluentCheckboxDefinition, fluentComboboxDefinition, fluentDataGridDefinition, fluentDataGridCellDefinition, fluentDataGridRowDefinition, fluentDesignSystemProviderDefinition, fluentDialogDefinition, fluentDividerDefinition, fluentFlipperDefinition, fluentHorizontalScrollDefinition, fluentListboxDefinition, fluentListboxOptionDefinition, fluentMenuDefinition, fluentMenuItemDefinition, fluentNumberFieldDefinition, fluentProgressRingDefinition, fluentProgressDefinition, fluentRadioDefinition, fluentRadioGroupDefinition, fluentSearchDefinition, fluentSelectDefinition, fluentSkeletonDefinition, fluentSliderDefinition, fluentSliderLabelDefinition, fluentSwitchDefinition, fluentTabPanelDefinition, fluentTabDefinition, fluentTabsDefinition, fluentTextAreaDefinition, fluentTextFieldDefinition, fluentTooltipDefinition, fluentTreeItemDefinition, fluentTreeViewDefinition };
|
|
@@ -27,6 +27,7 @@ import { fluentNumberField } from './number-field/index';
|
|
|
27
27
|
import { fluentProgress, fluentProgressRing } from './progress/index';
|
|
28
28
|
import { fluentRadio } from './radio/index';
|
|
29
29
|
import { fluentRadioGroup } from './radio-group/index';
|
|
30
|
+
import { fluentSearch } from './search/index';
|
|
30
31
|
import { fluentSelect } from './select/index';
|
|
31
32
|
import { fluentSkeleton } from './skeleton/index';
|
|
32
33
|
import { fluentSlider } from './slider/index';
|
|
@@ -39,7 +40,7 @@ import { fluentToolbar } from './toolbar/index';
|
|
|
39
40
|
import { fluentTooltip } from './tooltip/index';
|
|
40
41
|
import { fluentTreeView } from './tree-view/index';
|
|
41
42
|
import { fluentTreeItem } from './tree-item/index';
|
|
42
|
-
export { fluentAccordion, fluentAccordionItem, fluentAnchor, fluentAnchoredRegion, fluentBadge, fluentBreadcrumb, fluentBreadcrumbItem, fluentButton, fluentCard, fluentCalendar, fluentCheckbox, fluentCombobox, fluentDataGrid, fluentDataGridCell, fluentDataGridRow, fluentDesignSystemProvider, fluentDialog, fluentDivider, fluentFlipper, fluentHorizontalScroll, fluentListbox, fluentOption, fluentMenu, fluentMenuItem, fluentNumberField, fluentProgress, fluentProgressRing, fluentRadio, fluentRadioGroup, fluentSelect, fluentSkeleton, fluentSlider, fluentSliderLabel, fluentSwitch, fluentTabs, fluentTab, fluentTabPanel, fluentTextArea, fluentTextField, fluentToolbar, fluentTooltip, fluentTreeView, fluentTreeItem, };
|
|
43
|
+
export { fluentAccordion, fluentAccordionItem, fluentAnchor, fluentAnchoredRegion, fluentBadge, fluentBreadcrumb, fluentBreadcrumbItem, fluentButton, fluentCard, fluentCalendar, fluentCheckbox, fluentCombobox, fluentDataGrid, fluentDataGridCell, fluentDataGridRow, fluentDesignSystemProvider, fluentDialog, fluentDivider, fluentFlipper, fluentHorizontalScroll, fluentListbox, fluentOption, fluentMenu, fluentMenuItem, fluentNumberField, fluentProgress, fluentProgressRing, fluentRadio, fluentRadioGroup, fluentSearch, fluentSelect, fluentSkeleton, fluentSlider, fluentSliderLabel, fluentSwitch, fluentTabs, fluentTab, fluentTabPanel, fluentTextArea, fluentTextField, fluentToolbar, fluentTooltip, fluentTreeView, fluentTreeItem, };
|
|
43
44
|
/**
|
|
44
45
|
* All Fluent UI Web Components
|
|
45
46
|
* @public
|
|
@@ -73,7 +74,7 @@ export declare const allComponents: {
|
|
|
73
74
|
fluentDivider: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("@microsoft/fast-foundation").Divider>;
|
|
74
75
|
fluentFlipper: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FlipperOptions> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FlipperOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
|
75
76
|
fluentHorizontalScroll: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").HorizontalScrollOptions> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").HorizontalScrollOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
|
76
|
-
fluentListbox: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("
|
|
77
|
+
fluentListbox: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("./listbox/index").Listbox>;
|
|
77
78
|
fluentOption: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("@microsoft/fast-foundation").ListboxOption>;
|
|
78
79
|
fluentMenu: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("./menu/index").Menu>;
|
|
79
80
|
fluentMenuItem: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").MenuItemOptions> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").MenuItemOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
|
@@ -82,6 +83,7 @@ export declare const allComponents: {
|
|
|
82
83
|
fluentProgressRing: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").ProgressRingOptions> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").ProgressRingOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
|
83
84
|
fluentRadio: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").RadioOptions> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").RadioOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
|
84
85
|
fluentRadioGroup: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("@microsoft/fast-foundation").RadioGroup>;
|
|
86
|
+
fluentSearch: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").SearchOptions> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").SearchOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
|
85
87
|
fluentSelect: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").SelectOptions> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").SelectOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
|
86
88
|
fluentSkeleton: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("@microsoft/fast-foundation").Skeleton>;
|
|
87
89
|
fluentSlider: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").SliderOptions> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").SliderOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { Listbox } from '@microsoft/fast-foundation';
|
|
1
|
+
import { Listbox as FoundationListboxElement } from '@microsoft/fast-foundation';
|
|
2
|
+
export declare class Listbox extends FoundationListboxElement {
|
|
3
|
+
}
|
|
2
4
|
/**
|
|
3
5
|
* The Fluent listbox Custom Element. Implements, {@link @microsoft/fast-foundation#Listbox}
|
|
4
6
|
* {@link @microsoft/fast-foundation#listboxTemplate}
|
|
@@ -15,8 +17,3 @@ export declare const fluentListbox: (overrideDefinition?: import("@microsoft/fas
|
|
|
15
17
|
* @public
|
|
16
18
|
*/
|
|
17
19
|
export declare const listboxStyles: (context: import("@microsoft/fast-foundation").ElementDefinitionContext, definition: import("@microsoft/fast-foundation").FoundationElementDefinition) => import("@microsoft/fast-element").ElementStyles;
|
|
18
|
-
/**
|
|
19
|
-
* Listbox base class
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
export { Listbox };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("
|
|
3
|
+
component: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("./index").Listbox>;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const Listbox: any;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Search as FoundationSearch, SearchOptions } from '@microsoft/fast-foundation';
|
|
2
|
+
/**
|
|
3
|
+
* Search appearances
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare type SearchAppearance = 'filled' | 'outline';
|
|
7
|
+
/**
|
|
8
|
+
* The Fluent search class
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare class Search extends FoundationSearch {
|
|
12
|
+
/**
|
|
13
|
+
* The appearance of the element.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
* @remarks
|
|
17
|
+
* HTML Attribute: appearance
|
|
18
|
+
*/
|
|
19
|
+
appearance: SearchAppearance;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The Fluent Search Custom Element. Implements {@link @microsoft/fast-foundation#Search},
|
|
23
|
+
* {@link @microsoft/fast-foundation#searchTemplate}
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
* @remarks
|
|
28
|
+
* HTML Element: \<fluent-search\>
|
|
29
|
+
*
|
|
30
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/delegatesFocus | delegatesFocus}
|
|
31
|
+
*/
|
|
32
|
+
export declare const fluentSearch: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<SearchOptions> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<SearchOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
|
33
|
+
export * from './search.template';
|
|
34
|
+
/**
|
|
35
|
+
* Styles for Search
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export declare const searchStyles: (context: any, definition: any) => import("@microsoft/fast-element").ElementStyles;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
component: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").SearchOptions> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").SearchOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
|
4
|
+
argTypes: {
|
|
5
|
+
appearance: {
|
|
6
|
+
options: string[];
|
|
7
|
+
defaultValue: string;
|
|
8
|
+
control: {
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
autoFocus: {
|
|
13
|
+
description: string;
|
|
14
|
+
control: {
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
disabled: {
|
|
19
|
+
description: string;
|
|
20
|
+
control: {
|
|
21
|
+
type: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
list: {
|
|
25
|
+
control: {
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
maxlength: {
|
|
30
|
+
control: {
|
|
31
|
+
type: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
name: {
|
|
35
|
+
control: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
minlength: {
|
|
40
|
+
control: {
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
pattern: {
|
|
45
|
+
description: string;
|
|
46
|
+
control: {
|
|
47
|
+
type: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
placeholder: {
|
|
51
|
+
description: string;
|
|
52
|
+
defaultValue: string;
|
|
53
|
+
control: {
|
|
54
|
+
type: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
readonly: {
|
|
58
|
+
control: {
|
|
59
|
+
type: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
required: {
|
|
63
|
+
control: {
|
|
64
|
+
type: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
spellcheck: {
|
|
68
|
+
control: {
|
|
69
|
+
type: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export default _default;
|
|
75
|
+
export declare const Search: any;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ElementStyles } from '@microsoft/fast-element';
|
|
2
|
+
import { ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
3
|
+
export declare const searchFilledStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles;
|
|
4
|
+
export declare const searchStyles: (context: any, definition: any) => ElementStyles;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ViewTemplate } from '@microsoft/fast-element';
|
|
2
|
+
import { ElementDefinitionContext, Search, SearchOptions } from '@microsoft/fast-foundation';
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare const searchTemplate: (context: ElementDefinitionContext, definition: SearchOptions) => ViewTemplate<Search>;
|
|
@@ -54,6 +54,8 @@ import fluentRadioDefinition from './radio/radio.vscode.definition.json';
|
|
|
54
54
|
export { fluentRadioDefinition };
|
|
55
55
|
import fluentRadioGroupDefinition from './radio-group/radio-group.vscode.definition.json';
|
|
56
56
|
export { fluentRadioGroupDefinition };
|
|
57
|
+
import fluentSearchDefinition from './search/search.vscode.definition.json';
|
|
58
|
+
export { fluentSearchDefinition };
|
|
57
59
|
import fluentSelectDefinition from './select/select.vscode.definition.json';
|
|
58
60
|
export { fluentSelectDefinition };
|
|
59
61
|
import fluentSkeletonDefinition from './skeleton/skeleton.vscode.definition.json';
|
|
@@ -23,6 +23,7 @@ import { fluentNumberField } from './number-field/index';
|
|
|
23
23
|
import { fluentProgress, fluentProgressRing } from './progress/index';
|
|
24
24
|
import { fluentRadio } from './radio/index';
|
|
25
25
|
import { fluentRadioGroup } from './radio-group/index';
|
|
26
|
+
import { fluentSearch } from './search/index';
|
|
26
27
|
import { fluentSelect } from './select/index';
|
|
27
28
|
import { fluentSkeleton } from './skeleton/index';
|
|
28
29
|
import { fluentSlider } from './slider/index';
|
|
@@ -35,7 +36,7 @@ import { fluentToolbar } from './toolbar/index';
|
|
|
35
36
|
import { fluentTooltip } from './tooltip/index';
|
|
36
37
|
import { fluentTreeView } from './tree-view/index';
|
|
37
38
|
import { fluentTreeItem } from './tree-item/index';
|
|
38
|
-
export { fluentAccordion, fluentAccordionItem, fluentAnchor, fluentAnchoredRegion, fluentBadge, fluentBreadcrumb, fluentBreadcrumbItem, fluentButton, fluentCard, fluentCalendar, fluentCheckbox, fluentCombobox, fluentDataGrid, fluentDataGridCell, fluentDataGridRow, fluentDesignSystemProvider, fluentDialog, fluentDivider, fluentFlipper, fluentHorizontalScroll, fluentListbox, fluentOption, fluentMenu, fluentMenuItem, fluentNumberField, fluentProgress, fluentProgressRing, fluentRadio, fluentRadioGroup, fluentSelect, fluentSkeleton, fluentSlider, fluentSliderLabel, fluentSwitch, fluentTabs, fluentTab, fluentTabPanel, fluentTextArea, fluentTextField, fluentToolbar, fluentTooltip, fluentTreeView, fluentTreeItem, };
|
|
39
|
+
export { fluentAccordion, fluentAccordionItem, fluentAnchor, fluentAnchoredRegion, fluentBadge, fluentBreadcrumb, fluentBreadcrumbItem, fluentButton, fluentCard, fluentCalendar, fluentCheckbox, fluentCombobox, fluentDataGrid, fluentDataGridCell, fluentDataGridRow, fluentDesignSystemProvider, fluentDialog, fluentDivider, fluentFlipper, fluentHorizontalScroll, fluentListbox, fluentOption, fluentMenu, fluentMenuItem, fluentNumberField, fluentProgress, fluentProgressRing, fluentRadio, fluentRadioGroup, fluentSearch, fluentSelect, fluentSkeleton, fluentSlider, fluentSliderLabel, fluentSwitch, fluentTabs, fluentTab, fluentTabPanel, fluentTextArea, fluentTextField, fluentToolbar, fluentTooltip, fluentTreeView, fluentTreeItem, };
|
|
39
40
|
/**
|
|
40
41
|
* All Fluent UI Web Components
|
|
41
42
|
* @public
|
|
@@ -70,6 +71,7 @@ export const allComponents = {
|
|
|
70
71
|
fluentProgressRing,
|
|
71
72
|
fluentRadio,
|
|
72
73
|
fluentRadioGroup,
|
|
74
|
+
fluentSearch,
|
|
73
75
|
fluentSelect,
|
|
74
76
|
fluentSkeleton,
|
|
75
77
|
fluentSlider,
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { Listbox, listboxTemplate as template } from '@microsoft/fast-foundation';
|
|
1
|
+
import { Listbox as FoundationListboxElement, listboxTemplate as template } from '@microsoft/fast-foundation';
|
|
2
2
|
import { listboxStyles as styles } from './listbox.styles';
|
|
3
|
+
export class Listbox extends FoundationListboxElement {
|
|
4
|
+
}
|
|
3
5
|
/**
|
|
4
6
|
* The Fluent listbox Custom Element. Implements, {@link @microsoft/fast-foundation#Listbox}
|
|
5
7
|
* {@link @microsoft/fast-foundation#listboxTemplate}
|
|
@@ -20,8 +22,3 @@ export const fluentListbox = Listbox.compose({
|
|
|
20
22
|
* @public
|
|
21
23
|
*/
|
|
22
24
|
export const listboxStyles = styles;
|
|
23
|
-
/**
|
|
24
|
-
* Listbox base class
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
export { Listbox };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr } from '@microsoft/fast-element';
|
|
3
|
+
import { Search as FoundationSearch } from '@microsoft/fast-foundation';
|
|
4
|
+
import { searchTemplate as template } from './search.template';
|
|
5
|
+
import { searchStyles as styles } from './search.styles';
|
|
6
|
+
/**
|
|
7
|
+
* The Fluent search class
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export class Search extends FoundationSearch {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/**
|
|
14
|
+
* The appearance of the element.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
* @remarks
|
|
18
|
+
* HTML Attribute: appearance
|
|
19
|
+
*/
|
|
20
|
+
this.appearance = 'outline';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
__decorate([
|
|
24
|
+
attr
|
|
25
|
+
], Search.prototype, "appearance", void 0);
|
|
26
|
+
/**
|
|
27
|
+
* The Fluent Search Custom Element. Implements {@link @microsoft/fast-foundation#Search},
|
|
28
|
+
* {@link @microsoft/fast-foundation#searchTemplate}
|
|
29
|
+
*
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
* @remarks
|
|
33
|
+
* HTML Element: \<fluent-search\>
|
|
34
|
+
*
|
|
35
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/delegatesFocus | delegatesFocus}
|
|
36
|
+
*/
|
|
37
|
+
export const fluentSearch = Search.compose({
|
|
38
|
+
baseName: 'search',
|
|
39
|
+
baseClass: FoundationSearch,
|
|
40
|
+
template,
|
|
41
|
+
styles,
|
|
42
|
+
start: `<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg%22%3E"><path d="M8.5 3a5.5 5.5 0 0 1 4.23 9.02l4.12 4.13a.5.5 0 0 1-.63.76l-.07-.06-4.13-4.12A5.5 5.5 0 1 1 8.5 3Zm0 1a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9Z"/></svg>`,
|
|
43
|
+
shadowOptions: {
|
|
44
|
+
delegatesFocus: true,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
export * from './search.template';
|
|
48
|
+
/**
|
|
49
|
+
* Styles for Search
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export const searchStyles = styles;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { fluentSearch } from './index';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Components/Search',
|
|
4
|
+
component: fluentSearch,
|
|
5
|
+
argTypes: {
|
|
6
|
+
appearance: {
|
|
7
|
+
options: ['filled', 'outline'],
|
|
8
|
+
defaultValue: 'outline',
|
|
9
|
+
control: { type: 'radio' },
|
|
10
|
+
},
|
|
11
|
+
autoFocus: {
|
|
12
|
+
description: 'Automatically focuses the control',
|
|
13
|
+
control: { type: 'boolean' },
|
|
14
|
+
},
|
|
15
|
+
disabled: {
|
|
16
|
+
description: 'The search box should be submitted with the form but should not be editable',
|
|
17
|
+
control: { type: 'boolean' },
|
|
18
|
+
},
|
|
19
|
+
list: {
|
|
20
|
+
control: { type: 'text' },
|
|
21
|
+
},
|
|
22
|
+
maxlength: {
|
|
23
|
+
control: { type: 'number' },
|
|
24
|
+
},
|
|
25
|
+
name: {
|
|
26
|
+
control: { type: 'text' },
|
|
27
|
+
},
|
|
28
|
+
minlength: {
|
|
29
|
+
control: { type: 'number' },
|
|
30
|
+
},
|
|
31
|
+
pattern: {
|
|
32
|
+
description: `A regular expression the input's contents must match in order to be valid`,
|
|
33
|
+
control: { type: 'text' },
|
|
34
|
+
},
|
|
35
|
+
placeholder: {
|
|
36
|
+
description: 'An exemplar value to display in the input field whenever it is empty',
|
|
37
|
+
defaultValue: 'Placeholder',
|
|
38
|
+
control: { type: 'text' },
|
|
39
|
+
},
|
|
40
|
+
readonly: {
|
|
41
|
+
control: { type: 'boolean' },
|
|
42
|
+
},
|
|
43
|
+
required: {
|
|
44
|
+
control: { type: 'boolean' },
|
|
45
|
+
},
|
|
46
|
+
spellcheck: {
|
|
47
|
+
control: { type: 'boolean' },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
const SearchTemplate = ({ appearance, autoFocus, disabled, list, maxlength, name, minlength, pattern, placeholder, readonly, required, size, spellcheck, }) => `<fluent-search
|
|
52
|
+
${appearance ? `appearance="${appearance}"` : ''}
|
|
53
|
+
${autoFocus ? 'autofocus' : ''}
|
|
54
|
+
${disabled ? 'disabled' : ''}
|
|
55
|
+
${list ? `list="${list}"` : ''}
|
|
56
|
+
${maxlength ? `maxlength="${maxlength}"` : ''}
|
|
57
|
+
${name ? `name="${name}"` : ''}
|
|
58
|
+
${minlength ? `minlength="${minlength}"` : ''}
|
|
59
|
+
${pattern ? `pattern="${pattern}"` : ''}
|
|
60
|
+
${placeholder ? `placeholder="${placeholder}"` : ''}
|
|
61
|
+
${readonly ? 'readonly' : ''}
|
|
62
|
+
${required ? 'required' : ''}
|
|
63
|
+
${spellcheck ? `spellcheck="${spellcheck}"` : ''}
|
|
64
|
+
${size ? `size="${size}"` : ''}
|
|
65
|
+
></fluent-search>`;
|
|
66
|
+
export const Search = SearchTemplate.bind({});
|
|
67
|
+
Search.args = {
|
|
68
|
+
placeholder: 'placeholder',
|
|
69
|
+
autoFocus: false,
|
|
70
|
+
disabled: false,
|
|
71
|
+
readonly: false,
|
|
72
|
+
required: false,
|
|
73
|
+
};
|
|
74
|
+
const example = `
|
|
75
|
+
<fluent-search appearance="outline"></fluent-search>
|
|
76
|
+
`;
|
|
77
|
+
Search.parameters = {
|
|
78
|
+
docs: {
|
|
79
|
+
source: {
|
|
80
|
+
code: example,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
import { Button, DesignToken, display, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
|
|
3
|
+
import { heightNumber, inputFilledForcedColorStyles, inputFilledStyles, inputForcedColorStyles, inputStateStyles, inputStyles, } from '../styles';
|
|
4
|
+
import { appearanceBehavior } from '../utilities/behaviors';
|
|
5
|
+
import { bodyFont, controlCornerRadius, density, designUnit, neutralFillInputRecipe, neutralFillStealthRecipe, neutralForegroundRest, typeRampBaseFontSize, typeRampBaseLineHeight } from '../design-tokens';
|
|
6
|
+
const clearButtonHover = DesignToken.create("clear-button-hover").withDefault((target) => {
|
|
7
|
+
const buttonRecipe = neutralFillStealthRecipe.getValueFor(target);
|
|
8
|
+
const inputRecipe = neutralFillInputRecipe.getValueFor(target);
|
|
9
|
+
return buttonRecipe.evaluate(target, inputRecipe.evaluate(target).focus).hover;
|
|
10
|
+
});
|
|
11
|
+
const clearButtonActive = DesignToken.create("clear-button-active").withDefault((target) => {
|
|
12
|
+
const buttonRecipe = neutralFillStealthRecipe.getValueFor(target);
|
|
13
|
+
const inputRecipe = neutralFillInputRecipe.getValueFor(target);
|
|
14
|
+
return buttonRecipe.evaluate(target, inputRecipe.evaluate(target).focus).active;
|
|
15
|
+
});
|
|
16
|
+
export const searchFilledStyles = (context, definition) => css `
|
|
17
|
+
${inputFilledStyles(context, definition, '.root')}
|
|
18
|
+
`.withBehaviors(forcedColorsStylesheetBehavior(css `
|
|
19
|
+
${inputFilledForcedColorStyles(context, definition, '.root')}
|
|
20
|
+
`));
|
|
21
|
+
export const searchStyles = (context, definition) => css `
|
|
22
|
+
${display('inline-block')}
|
|
23
|
+
${inputStyles(context, definition, '.root')}
|
|
24
|
+
${inputStateStyles(context, definition, '.root')}
|
|
25
|
+
.root {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
}
|
|
29
|
+
.control {
|
|
30
|
+
-webkit-appearance: none;
|
|
31
|
+
color: inherit;
|
|
32
|
+
background: transparent;
|
|
33
|
+
border: 0;
|
|
34
|
+
height: calc(100% - 4px);
|
|
35
|
+
margin-top: auto;
|
|
36
|
+
margin-bottom: auto;
|
|
37
|
+
padding: 0 calc(${designUnit} * 2px + 1px);
|
|
38
|
+
font-family: inherit;
|
|
39
|
+
font-size: inherit;
|
|
40
|
+
line-height: inherit;
|
|
41
|
+
}
|
|
42
|
+
.clear-button {
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
margin: 1px;
|
|
46
|
+
height: calc(100% - 2px);
|
|
47
|
+
opacity: 0;
|
|
48
|
+
background: transparent;
|
|
49
|
+
color: ${neutralForegroundRest};
|
|
50
|
+
fill: currentcolor;
|
|
51
|
+
border: none;
|
|
52
|
+
border-radius: calc(${controlCornerRadius} * 1px);
|
|
53
|
+
min-width: calc(${heightNumber} * 1px);
|
|
54
|
+
font-size: ${typeRampBaseFontSize};
|
|
55
|
+
line-height: ${typeRampBaseLineHeight};
|
|
56
|
+
outline: none;
|
|
57
|
+
font-family: ${bodyFont};
|
|
58
|
+
padding: 0 calc((10 + (${designUnit} * 2 * ${density})) * 1px);
|
|
59
|
+
}
|
|
60
|
+
.clear-button:hover {
|
|
61
|
+
background: ${clearButtonHover};
|
|
62
|
+
}
|
|
63
|
+
.clear-button:active {
|
|
64
|
+
background: ${clearButtonActive};
|
|
65
|
+
}
|
|
66
|
+
:host(:hover:not([disabled], [readOnly])) .clear-button,
|
|
67
|
+
:host(:active:not([disabled], [readOnly])) .clear-button,
|
|
68
|
+
:host(:focus-within:not([disabled], [readOnly])) .clear-button {
|
|
69
|
+
opacity: 1;
|
|
70
|
+
}
|
|
71
|
+
:host(:hover:not([disabled], [readOnly])) .clear-button__hidden,
|
|
72
|
+
:host(:active:not([disabled], [readOnly])) .clear-button__hidden,
|
|
73
|
+
:host(:focus-within:not([disabled], [readOnly])) .clear-button__hidden {
|
|
74
|
+
opacity: 0;
|
|
75
|
+
}
|
|
76
|
+
.control::-webkit-search-cancel-button {
|
|
77
|
+
-webkit-appearance: none;
|
|
78
|
+
}
|
|
79
|
+
.input-wrapper {
|
|
80
|
+
display: flex;
|
|
81
|
+
position: relative;
|
|
82
|
+
width: 100%;
|
|
83
|
+
}
|
|
84
|
+
.start,
|
|
85
|
+
.end {
|
|
86
|
+
display: flex;
|
|
87
|
+
margin: 1px;
|
|
88
|
+
align-items: center;
|
|
89
|
+
}
|
|
90
|
+
.start {
|
|
91
|
+
display: flex;
|
|
92
|
+
margin-inline-start: 11px;
|
|
93
|
+
}
|
|
94
|
+
::slotted([slot="end"]) {
|
|
95
|
+
height: 100%
|
|
96
|
+
}
|
|
97
|
+
.clear-button__hidden {
|
|
98
|
+
opacity: 0;
|
|
99
|
+
}
|
|
100
|
+
.end {
|
|
101
|
+
margin-inline-end: 11px;
|
|
102
|
+
}
|
|
103
|
+
::slotted(${context.tagFor(Button)}) {
|
|
104
|
+
margin-inline-end: 1px;
|
|
105
|
+
}
|
|
106
|
+
`.withBehaviors(appearanceBehavior('filled', searchFilledStyles(context, definition)), forcedColorsStylesheetBehavior(css `
|
|
107
|
+
${inputForcedColorStyles(context, definition, '.root')}
|
|
108
|
+
`));
|