@spectrum-web-components/picker 0.10.3 → 0.10.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/picker",
3
- "version": "0.10.3",
3
+ "version": "0.10.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -48,17 +48,17 @@
48
48
  "lit-html"
49
49
  ],
50
50
  "dependencies": {
51
- "@spectrum-web-components/base": "^0.5.3",
52
- "@spectrum-web-components/button": "^0.17.0",
53
- "@spectrum-web-components/icon": "^0.11.4",
54
- "@spectrum-web-components/icons-ui": "^0.8.4",
55
- "@spectrum-web-components/icons-workflow": "^0.8.4",
56
- "@spectrum-web-components/menu": "^0.12.2",
57
- "@spectrum-web-components/overlay": "^0.15.0",
58
- "@spectrum-web-components/popover": "^0.11.7",
59
- "@spectrum-web-components/reactive-controllers": "^0.2.1",
60
- "@spectrum-web-components/shared": "^0.13.5",
61
- "@spectrum-web-components/tray": "^0.3.3",
51
+ "@spectrum-web-components/base": "^0.5.4",
52
+ "@spectrum-web-components/button": "^0.17.1",
53
+ "@spectrum-web-components/icon": "^0.11.5",
54
+ "@spectrum-web-components/icons-ui": "^0.8.5",
55
+ "@spectrum-web-components/icons-workflow": "^0.8.5",
56
+ "@spectrum-web-components/menu": "^0.12.4",
57
+ "@spectrum-web-components/overlay": "^0.15.2",
58
+ "@spectrum-web-components/popover": "^0.11.9",
59
+ "@spectrum-web-components/reactive-controllers": "^0.2.2",
60
+ "@spectrum-web-components/shared": "^0.13.6",
61
+ "@spectrum-web-components/tray": "^0.3.4",
62
62
  "tslib": "^2.0.0"
63
63
  },
64
64
  "devDependencies": {
@@ -71,5 +71,5 @@
71
71
  "./sync/index.js",
72
72
  "./sync/sp-*.js"
73
73
  ],
74
- "gitHead": "57aba8030b6af96af4015a0aa830e342a17dc219"
74
+ "gitHead": "caf12727e7f91dcf961e1fadacc727eea9ece27b"
75
75
  }
package/sp-picker.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { Picker } from './src/Picker.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'sp-picker': Picker;
5
+ }
6
+ }
package/sp-picker.js ADDED
@@ -0,0 +1,14 @@
1
+ /*
2
+ Copyright 2020 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+ import { Picker } from './src/Picker.js';
13
+ customElements.define('sp-picker', Picker);
14
+ //# sourceMappingURL=sp-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sp-picker.js","sourceRoot":"","sources":["sp-picker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Picker } from './src/Picker.js';\n\ncustomElements.define('sp-picker', Picker);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-picker': Picker;\n }\n}\n"]}
@@ -0,0 +1,102 @@
1
+ import { CSSResultArray, PropertyValues, TemplateResult } from '@spectrum-web-components/base';
2
+ import { Focusable } from '@spectrum-web-components/shared/src/focusable.js';
3
+ import '@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js';
4
+ import '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js';
5
+ import '@spectrum-web-components/menu/sp-menu.js';
6
+ import type { Menu, MenuItem, MenuItemAddedOrUpdatedEvent, MenuItemChildren, MenuItemRemovedEvent } from '@spectrum-web-components/menu';
7
+ import '@spectrum-web-components/tray/sp-tray.js';
8
+ import '@spectrum-web-components/popover/sp-popover.js';
9
+ import { OverlayOptions, Placement, TriggerInteractions } from '@spectrum-web-components/overlay';
10
+ import { MatchMediaController } from '@spectrum-web-components/reactive-controllers/src/MatchMedia.js';
11
+ declare const PickerBase_base: typeof Focusable & {
12
+ new (...args: any[]): import("@spectrum-web-components/base").SizedElementInterface;
13
+ prototype: import("@spectrum-web-components/base").SizedElementInterface;
14
+ };
15
+ /**
16
+ * @element sp-picker
17
+ *
18
+ * @slot label - The placeholder content for the Picker
19
+ * @slot - menu items to be listed in the Picker
20
+ * @fires change - Announces that the `value` of the element has changed
21
+ * @fires sp-opened - Announces that the overlay has been opened
22
+ * @fires sp-closed - Announces that the overlay has been closed
23
+ */
24
+ export declare class PickerBase extends PickerBase_base {
25
+ /**
26
+ * @private
27
+ */
28
+ static openOverlay: (target: HTMLElement, interaction: TriggerInteractions, content: HTMLElement, options: OverlayOptions) => Promise<() => void>;
29
+ protected isMobile: MatchMediaController;
30
+ button: HTMLButtonElement;
31
+ get target(): HTMLButtonElement | this;
32
+ disabled: boolean;
33
+ focused: boolean;
34
+ icons?: 'only' | 'none';
35
+ invalid: boolean;
36
+ label?: string;
37
+ open: boolean;
38
+ readonly: boolean;
39
+ selects: undefined | 'single';
40
+ menuItems: MenuItem[];
41
+ private restoreChildren?;
42
+ optionsMenu: Menu;
43
+ /**
44
+ * @type {"auto" | "auto-start" | "auto-end" | "top" | "bottom" | "right" | "left" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | "none"}
45
+ * @attr
46
+ */
47
+ placement: Placement;
48
+ quiet: boolean;
49
+ value: string;
50
+ selectedItem?: MenuItem;
51
+ private closeOverlay?;
52
+ private popover;
53
+ protected listRole: 'listbox' | 'menu';
54
+ protected itemRole: string;
55
+ constructor();
56
+ get focusElement(): HTMLElement;
57
+ forceFocusVisible(): void;
58
+ onButtonBlur(): void;
59
+ protected onButtonClick(): void;
60
+ focus(options?: FocusOptions): void;
61
+ onHelperFocus(): void;
62
+ onButtonFocus(): void;
63
+ handleChange(event: Event): void;
64
+ protected onKeydown: (event: KeyboardEvent) => void;
65
+ setValueFromItem(item: MenuItem, menuChangeEvent?: Event): Promise<void>;
66
+ toggle(target?: boolean): void;
67
+ close(): void;
68
+ overlayCloseCallback: () => void;
69
+ protected onOverlayClosed(): void;
70
+ private popoverFragment;
71
+ private generatePopover;
72
+ private openMenu;
73
+ protected sizePopover(popover: HTMLElement): void;
74
+ private closeMenu;
75
+ protected get selectedItemContent(): MenuItemChildren;
76
+ protected renderLabelContent(content: Node[]): TemplateResult | Node[];
77
+ protected get buttonContent(): TemplateResult[];
78
+ protected render(): TemplateResult;
79
+ protected update(changes: PropertyValues<this>): void;
80
+ protected get dismissHelper(): TemplateResult;
81
+ protected get renderPopover(): TemplateResult;
82
+ private _willUpdateItems;
83
+ protected itemsUpdated: Promise<void>;
84
+ /**
85
+ * Acquire the available MenuItems in the Picker by
86
+ * direct element query or by assuming the list managed
87
+ * by the Menu within the open options overlay.
88
+ */
89
+ protected updateMenuItems(event?: MenuItemAddedOrUpdatedEvent | MenuItemRemovedEvent): void;
90
+ protected updated(changedProperties: PropertyValues): void;
91
+ protected manageSelection(): void;
92
+ private menuStatePromise;
93
+ private menuStateResolver;
94
+ protected getUpdateComplete(): Promise<boolean>;
95
+ connectedCallback(): void;
96
+ disconnectedCallback(): void;
97
+ }
98
+ export declare class Picker extends PickerBase {
99
+ static get styles(): CSSResultArray;
100
+ protected onKeydown: (event: KeyboardEvent) => void;
101
+ }
102
+ export {};