@spectrum-web-components/action-bar 0.4.7-express.9 → 0.4.8
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-bar",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -44,17 +44,17 @@
|
|
|
44
44
|
"lit-html"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@spectrum-web-components/base": "^0.5.
|
|
48
|
-
"@spectrum-web-components/popover": "^0.11.
|
|
47
|
+
"@spectrum-web-components/base": "^0.5.3",
|
|
48
|
+
"@spectrum-web-components/popover": "^0.11.8",
|
|
49
49
|
"tslib": "^2.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@spectrum-css/actionbar": "^3.0.
|
|
52
|
+
"@spectrum-css/actionbar": "^3.0.18"
|
|
53
53
|
},
|
|
54
54
|
"types": "./src/index.d.ts",
|
|
55
55
|
"customElements": "custom-elements.json",
|
|
56
56
|
"sideEffects": [
|
|
57
57
|
"./sp-*.js"
|
|
58
58
|
],
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "90109a167310260905a734919249c225a404bc74"
|
|
60
60
|
}
|
package/src/ActionBar.d.ts
CHANGED
package/src/ActionBar.js
CHANGED
|
@@ -12,6 +12,7 @@ governing permissions and limitations under the License.
|
|
|
12
12
|
import { __decorate } from "tslib";
|
|
13
13
|
import { html, SpectrumElement, } from '@spectrum-web-components/base';
|
|
14
14
|
import { property } from '@spectrum-web-components/base/src/decorators.js';
|
|
15
|
+
import '@spectrum-web-components/popover/sp-popover.js';
|
|
15
16
|
import actionBarStyles from './action-bar.css.js';
|
|
16
17
|
export const actionBarVariants = ['sticky', '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EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CACnB;AAGxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCACvB;AASpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAYzC","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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport actionBarStyles from './action-bar.css.js';\nexport const actionBarVariants = ['sticky', 'fixed'];\n\n/**\n * @element sp-action-bar\n * @slot - Content to display with the Action Bar\n */\nexport class ActionBar extends SpectrumElement {\n public static get styles(): CSSResultArray {\n return [actionBarStyles];\n }\n\n /**\n * When `flexible` the action bar sizes itself to its content\n * rather than a specific width.\n *\n * @param {Boolean} flexible\n */\n @property({ type: Boolean, reflect: true })\n public flexible = false;\n\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * The variant applies specific styling when set to `sticky` or `fixed`.\n * `variant` attribute is removed when not matching one of the above.\n *\n * @param {String} variant\n */\n @property({ type: String, reflect: true })\n public set variant(variant: string) {\n if (variant === this.variant) {\n return;\n }\n if (actionBarVariants.includes(variant)) {\n this.setAttribute('variant', variant);\n this._variant = variant;\n return;\n }\n this.removeAttribute('variant');\n this._variant = '';\n }\n\n public get variant(): string {\n return this._variant;\n }\n\n private _variant = '';\n\n public render(): TemplateResult {\n return html`\n <sp-popover ?open=${this.open} id=\"popover\">\n <slot></slot>\n </sp-popover>\n `;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ActionBar.js","sourceRoot":"","sources":["ActionBar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,EACJ,eAAe,GAElB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,gDAAgD,CAAC;AACxD,OAAO,eAAe,MAAM,qBAAqB,CAAC;AAClD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAErD;;;GAGG;AACH,MAAM,OAAO,SAAU,SAAQ,eAAe;IAA9C;;QAKI;;;;;WAKG;QAEI,aAAQ,GAAG,KAAK,CAAC;QAGjB,SAAI,GAAG,KAAK,CAAC;QA0BZ,aAAQ,GAAG,EAAE,CAAC;IAS1B,CAAC;IAjDU,MAAM,KAAK,MAAM;QACpB,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7B,CAAC;IAcD;;;;;OAKG;IAEH,IAAW,OAAO,CAAC,OAAe;QAC9B,IAAI,OAAO,KAAK,IAAI,CAAC,OAAO,EAAE;YAC1B,OAAO;SACV;QACD,IAAI,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YACrC,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YACtC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,OAAO;SACV;QACD,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACvB,CAAC;IAED,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAIM,MAAM;QACT,OAAO,IAAI,CAAA;gCACa,IAAI,CAAC,IAAI;;;SAGhC,CAAC;IACN,CAAC;CACJ;AAtCG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CACnB;AAGxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCACvB;AASpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAYzC","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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport actionBarStyles from './action-bar.css.js';\nexport const actionBarVariants = ['sticky', 'fixed'];\n\n/**\n * @element sp-action-bar\n * @slot - Content to display with the Action Bar\n */\nexport class ActionBar extends SpectrumElement {\n public static get styles(): CSSResultArray {\n return [actionBarStyles];\n }\n\n /**\n * When `flexible` the action bar sizes itself to its content\n * rather than a specific width.\n *\n * @param {Boolean} flexible\n */\n @property({ type: Boolean, reflect: true })\n public flexible = false;\n\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * The variant applies specific styling when set to `sticky` or `fixed`.\n * `variant` attribute is removed when not matching one of the above.\n *\n * @param {String} variant\n */\n @property({ type: String, reflect: true })\n public set variant(variant: string) {\n if (variant === this.variant) {\n return;\n }\n if (actionBarVariants.includes(variant)) {\n this.setAttribute('variant', variant);\n this._variant = variant;\n return;\n }\n this.removeAttribute('variant');\n this._variant = '';\n }\n\n public get variant(): string {\n return this._variant;\n }\n\n private _variant = '';\n\n public render(): TemplateResult {\n return html`\n <sp-popover ?open=${this.open} id=\"popover\">\n <slot></slot>\n </sp-popover>\n `;\n }\n}\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
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 * as stories from '../stories/action-bar.stories.js';
|
|
13
|
-
import { regressVisuals } from '../../../test/visual/test.js';
|
|
14
|
-
regressVisuals('ActionBarStories', stories);
|
|
15
|
-
//# sourceMappingURL=action-bar.test-vrt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action-bar.test-vrt.js","sourceRoot":"","sources":["action-bar.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,kBAAkB,EAAE,OAAO,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 * as stories from '../stories/action-bar.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ActionBarStories', stories);\n"]}
|
package/test/action-bar.test.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
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 { elementUpdated, expect, fixture, html } from '@open-wc/testing';
|
|
13
|
-
import '../sp-action-bar.js';
|
|
14
|
-
import { Default } from '../stories/action-bar.stories.js';
|
|
15
|
-
describe('ActionBar', () => {
|
|
16
|
-
it('loads', async () => {
|
|
17
|
-
const el = await fixture(Default());
|
|
18
|
-
await elementUpdated(el);
|
|
19
|
-
expect(el).to.not.be.undefined;
|
|
20
|
-
await expect(el).to.be.accessible();
|
|
21
|
-
});
|
|
22
|
-
it('accepts variants', async () => {
|
|
23
|
-
const el = await fixture(html `
|
|
24
|
-
<sp-action-bar variant="sticky">Help text.</sp-action-bar>
|
|
25
|
-
`);
|
|
26
|
-
await elementUpdated(el);
|
|
27
|
-
expect(el.variant).to.equal('sticky');
|
|
28
|
-
expect(el.getAttribute('variant')).to.equal('sticky');
|
|
29
|
-
el.variant = 'fixed';
|
|
30
|
-
await elementUpdated(el);
|
|
31
|
-
expect(el.variant).to.equal('fixed');
|
|
32
|
-
expect(el.getAttribute('variant')).to.equal('fixed');
|
|
33
|
-
el.setAttribute('variant', 'sticky');
|
|
34
|
-
await elementUpdated(el);
|
|
35
|
-
expect(el.variant).to.equal('sticky');
|
|
36
|
-
expect(el.getAttribute('variant')).to.equal('sticky');
|
|
37
|
-
el.removeAttribute('variant');
|
|
38
|
-
await elementUpdated(el);
|
|
39
|
-
expect(el.variant).to.equal('');
|
|
40
|
-
expect(el.hasAttribute('variant')).to.be.false;
|
|
41
|
-
});
|
|
42
|
-
it('validates variants', async () => {
|
|
43
|
-
const el = await fixture(html `
|
|
44
|
-
<sp-action-bar variant="other">Help text.</sp-action-bar>
|
|
45
|
-
`);
|
|
46
|
-
await elementUpdated(el);
|
|
47
|
-
expect(el.variant).to.equal('');
|
|
48
|
-
expect(el.hasAttribute('variant')).to.be.false;
|
|
49
|
-
el.variant = 'fixed';
|
|
50
|
-
await elementUpdated(el);
|
|
51
|
-
expect(el.variant).to.equal('fixed');
|
|
52
|
-
expect(el.getAttribute('variant')).to.equal('fixed');
|
|
53
|
-
el.variant = 'fixed';
|
|
54
|
-
await elementUpdated(el);
|
|
55
|
-
expect(el.variant).to.equal('fixed');
|
|
56
|
-
expect(el.getAttribute('variant')).to.equal('fixed');
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
//# sourceMappingURL=action-bar.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action-bar.test.js","sourceRoot":"","sources":["action-bar.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACvB,EAAE,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;QACnB,MAAM,EAAE,GAAG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AO,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACP,CAAC,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 { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\nimport '../sp-action-bar.js';\nimport { ActionBar } from '..';\nimport { Default } from '../stories/action-bar.stories.js';\n\ndescribe('ActionBar', () => {\n it('loads', async () => {\n const el = await fixture<ActionBar>(Default());\n\n await elementUpdated(el);\n\n expect(el).to.not.be.undefined;\n\n await expect(el).to.be.accessible();\n });\n\n it('accepts variants', async () => {\n const el = await fixture<ActionBar>(\n html`\n <sp-action-bar variant=\"sticky\">Help text.</sp-action-bar>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.variant).to.equal('sticky');\n expect(el.getAttribute('variant')).to.equal('sticky');\n\n el.variant = 'fixed';\n\n await elementUpdated(el);\n\n expect(el.variant).to.equal('fixed');\n expect(el.getAttribute('variant')).to.equal('fixed');\n\n el.setAttribute('variant', 'sticky');\n\n await elementUpdated(el);\n\n expect(el.variant).to.equal('sticky');\n expect(el.getAttribute('variant')).to.equal('sticky');\n\n el.removeAttribute('variant');\n\n await elementUpdated(el);\n\n expect(el.variant).to.equal('');\n expect(el.hasAttribute('variant')).to.be.false;\n });\n it('validates variants', async () => {\n const el = await fixture<ActionBar>(\n html`\n <sp-action-bar variant=\"other\">Help text.</sp-action-bar>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.variant).to.equal('');\n expect(el.hasAttribute('variant')).to.be.false;\n\n el.variant = 'fixed';\n\n await elementUpdated(el);\n\n expect(el.variant).to.equal('fixed');\n expect(el.getAttribute('variant')).to.equal('fixed');\n\n el.variant = 'fixed';\n\n await elementUpdated(el);\n\n expect(el.variant).to.equal('fixed');\n expect(el.getAttribute('variant')).to.equal('fixed');\n });\n});\n"]}
|