@spectrum-web-components/action-menu 0.13.15 → 0.13.16

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/action-menu",
3
- "version": "0.13.15",
3
+ "version": "0.13.16",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -46,12 +46,12 @@
46
46
  "lit-html"
47
47
  ],
48
48
  "dependencies": {
49
- "@spectrum-web-components/action-button": "^0.8.6",
50
- "@spectrum-web-components/base": "^0.5.7",
51
- "@spectrum-web-components/icon": "^0.11.9",
52
- "@spectrum-web-components/icons-workflow": "^0.8.9",
53
- "@spectrum-web-components/picker": "^0.11.3",
54
- "@spectrum-web-components/shared": "^0.14.2",
49
+ "@spectrum-web-components/action-button": "^0.8.7",
50
+ "@spectrum-web-components/base": "^0.5.8",
51
+ "@spectrum-web-components/icon": "^0.11.10",
52
+ "@spectrum-web-components/icons-workflow": "^0.8.10",
53
+ "@spectrum-web-components/picker": "^0.11.4",
54
+ "@spectrum-web-components/shared": "^0.14.3",
55
55
  "tslib": "^2.0.0"
56
56
  },
57
57
  "devDependencies": {
@@ -63,5 +63,5 @@
63
63
  "./sp-*.js",
64
64
  "./sync/sp-*.js"
65
65
  ],
66
- "gitHead": "275ee61b152ac3eed0cd1603d8eab2aec90876a0"
66
+ "gitHead": "e5cd4a0db2201b8126eb9133ac3c24172d086359"
67
67
  }
@@ -24,6 +24,6 @@ export declare class ActionMenu extends ActionMenu_base {
24
24
  private get hasLabel();
25
25
  protected get buttonContent(): TemplateResult[];
26
26
  protected render(): TemplateResult;
27
- protected updated(changedProperties: PropertyValues): void;
27
+ protected update(changedProperties: PropertyValues<this>): void;
28
28
  }
29
29
  export {};
package/src/ActionMenu.js CHANGED
@@ -72,12 +72,12 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') {
72
72
  </sp-action-button>
73
73
  `;
74
74
  }
75
- updated(changedProperties) {
76
- super.updated(changedProperties);
75
+ update(changedProperties) {
77
76
  if (changedProperties.has('invalid')) {
78
77
  this.invalid = false;
79
78
  }
80
79
  this.quiet = true;
80
+ super.update(changedProperties);
81
81
  }
82
82
  }
83
83
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"ActionMenu.js","sourceRoot":"","sources":["ActionMenu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,GAGP,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,4DAA4D,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAC3F,OAAO,+DAA+D,CAAC;AACvE,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,OAAO,UAAW,SAAQ,eAAe,CAAC,UAAU,EAAE,OAAO,CAAC;IAApE;;QAMoB,YAAO,GAAyB,SAAS,CAAC;QAEvC,aAAQ,GAAuB,MAAM,CAAC;QACtC,aAAQ,GAAG,UAAU,CAAC;IA6C7C,CAAC;IArDU,MAAM,KAAc,MAAM;QAC7B,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC9B,CAAC;IAOD,IAAY,QAAQ;QAChB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAuB,aAAa;QAChC,OAAO;YACH,IAAI,CAAA;2DAC2C,CAAC,IAAI,CAAC,QAAQ;;;6CAG5B,CAAC,IAAI,CAAC,QAAQ;aAC9C;SACJ,CAAC;IACN,CAAC;IAEkB,MAAM;QACrB,OAAO,IAAI,CAAA;;;4BAGS,IAAI,CAAC,IAAI;;;gCAGL,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;6BAC/B,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,SAAS,CAAC;;;uBAGxC,IAAI,CAAC,IAAI;wBACR,IAAI,CAAC,YAAY;yBAChB,IAAI,CAAC,aAAa;yBAClB,IAAI,CAAC,aAAa;4BACf,IAAI,CAAC,QAAQ;;kBAEvB,IAAI,CAAC,aAAa;;SAE3B,CAAC;IACN,CAAC;IAEkB,OAAO,CAAC,iBAAiC;QACxD,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACjC,IAAI,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YAClC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;SACxB;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;CACJ;AAhDG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAC+B","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 {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { PickerBase } from '@spectrum-web-components/picker';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js';\nimport actionMenuStyles from './action-menu.css.js';\n\n/**\n * @element sp-action-menu\n *\n * @slot - menu items to be listed in the Action Menu\n * @slot icon - The icon to use for Action Menu\n * @slot label - The label to use on for the Action Menu\n * @attr selects - By default `sp-action-menu` does not manage a selection. If\n * you'd like for a selection to be held by the `sp-menu` that it presents in\n * its overlay, use `selects=\"single\" to activate this functionality.\n */\nexport class ActionMenu extends ObserveSlotText(PickerBase, 'label') {\n public static override get styles(): CSSResultArray {\n return [actionMenuStyles];\n }\n\n @property({ type: String })\n public override selects: undefined | 'single' = undefined;\n\n protected override listRole: 'listbox' | 'menu' = 'menu';\n protected override itemRole = 'menuitem';\n private get hasLabel(): boolean {\n return this.slotHasContent;\n }\n\n protected override get buttonContent(): TemplateResult[] {\n return [\n html`\n <slot name=\"icon\" slot=\"icon\" ?icon-only=${!this.hasLabel}>\n <sp-icon-more class=\"icon\"></sp-icon-more>\n </slot>\n <slot name=\"label\" ?hidden=${!this.hasLabel}></slot>\n `,\n ];\n }\n\n protected override render(): TemplateResult {\n return html`\n <sp-action-button\n quiet\n ?selected=${this.open}\n aria-haspopup=\"true\"\n aria-controls=\"popover\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-label=${ifDefined(this.label || undefined)}\n id=\"button\"\n class=\"button\"\n size=${this.size}\n @blur=${this.onButtonBlur}\n @click=${this.onButtonClick}\n @focus=${this.onButtonFocus}\n ?disabled=${this.disabled}\n >\n ${this.buttonContent}\n </sp-action-button>\n `;\n }\n\n protected override updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('invalid')) {\n this.invalid = false;\n }\n this.quiet = true;\n }\n}\n"]}
1
+ {"version":3,"file":"ActionMenu.js","sourceRoot":"","sources":["ActionMenu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,GAGP,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OA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AI,CAAC;QAClB,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACJ;AAhDG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAC+B","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 {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { PickerBase } from '@spectrum-web-components/picker';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js';\nimport actionMenuStyles from './action-menu.css.js';\n\n/**\n * @element sp-action-menu\n *\n * @slot - menu items to be listed in the Action Menu\n * @slot icon - The icon to use for Action Menu\n * @slot label - The label to use on for the Action Menu\n * @attr selects - By default `sp-action-menu` does not manage a selection. If\n * you'd like for a selection to be held by the `sp-menu` that it presents in\n * its overlay, use `selects=\"single\" to activate this functionality.\n */\nexport class ActionMenu extends ObserveSlotText(PickerBase, 'label') {\n public static override get styles(): CSSResultArray {\n return [actionMenuStyles];\n }\n\n @property({ type: String })\n public override selects: undefined | 'single' = undefined;\n\n protected override listRole: 'listbox' | 'menu' = 'menu';\n protected override itemRole = 'menuitem';\n private get hasLabel(): boolean {\n return this.slotHasContent;\n }\n\n protected override get buttonContent(): TemplateResult[] {\n return [\n html`\n <slot name=\"icon\" slot=\"icon\" ?icon-only=${!this.hasLabel}>\n <sp-icon-more class=\"icon\"></sp-icon-more>\n </slot>\n <slot name=\"label\" ?hidden=${!this.hasLabel}></slot>\n `,\n ];\n }\n\n protected override render(): TemplateResult {\n return html`\n <sp-action-button\n quiet\n ?selected=${this.open}\n aria-haspopup=\"true\"\n aria-controls=\"popover\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-label=${ifDefined(this.label || undefined)}\n id=\"button\"\n class=\"button\"\n size=${this.size}\n @blur=${this.onButtonBlur}\n @click=${this.onButtonClick}\n @focus=${this.onButtonFocus}\n ?disabled=${this.disabled}\n >\n ${this.buttonContent}\n </sp-action-button>\n `;\n }\n\n protected override update(changedProperties: PropertyValues<this>): void {\n if (changedProperties.has('invalid')) {\n this.invalid = false;\n }\n this.quiet = true;\n super.update(changedProperties);\n }\n}\n"]}