@vertexvis/ui 0.1.2-canary.0 → 0.1.2-canary.1
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/dist/components/auto-resize-textarea.js +157 -0
- package/dist/components/color-swatch.js +124 -0
- package/dist/components/dom.js +13 -0
- package/dist/components/expandable.js +100 -0
- package/dist/components/icon-button.js +63 -0
- package/dist/components/icon-helper.js +722 -0
- package/dist/components/icon.js +43 -0
- package/dist/components/index.d.ts +71 -0
- package/dist/components/index.js +52 -0
- package/dist/components/index2.js +89 -0
- package/dist/components/menu.js +89 -0
- package/dist/components/popover.js +1737 -0
- package/dist/components/result-list.js +565 -0
- package/dist/components/slots.js +26 -0
- package/dist/components/text-field.js +171 -0
- package/dist/components/tooltip.js +360 -0
- package/dist/components/tslib.es6.js +65 -0
- package/dist/components/vertex-auto-resize-textarea.d.ts +11 -0
- package/dist/components/vertex-auto-resize-textarea.js +6 -0
- package/dist/components/vertex-avatar-group.d.ts +11 -0
- package/dist/components/vertex-avatar-group.js +34 -0
- package/dist/components/vertex-avatar.d.ts +11 -0
- package/dist/components/vertex-avatar.js +68 -0
- package/dist/components/vertex-badge.d.ts +11 -0
- package/dist/components/vertex-badge.js +43 -0
- package/dist/components/vertex-banner.d.ts +11 -0
- package/dist/components/vertex-banner.js +141 -0
- package/dist/components/vertex-button.d.ts +11 -0
- package/dist/components/vertex-button.js +96 -0
- package/dist/components/vertex-card-group.d.ts +11 -0
- package/dist/components/vertex-card-group.js +51 -0
- package/dist/components/vertex-card.d.ts +11 -0
- package/dist/components/vertex-card.js +49 -0
- package/dist/components/vertex-chip.d.ts +11 -0
- package/dist/components/vertex-chip.js +45 -0
- package/dist/components/vertex-click-to-edit-textfield.d.ts +11 -0
- package/dist/components/vertex-click-to-edit-textfield.js +156 -0
- package/dist/components/vertex-collapsible.d.ts +11 -0
- package/dist/components/vertex-collapsible.js +63 -0
- package/dist/components/vertex-color-circle-picker.d.ts +11 -0
- package/dist/components/vertex-color-circle-picker.js +104 -0
- package/dist/components/vertex-color-picker.d.ts +11 -0
- package/dist/components/vertex-color-picker.js +75 -0
- package/dist/components/vertex-color-swatch.d.ts +11 -0
- package/dist/components/vertex-color-swatch.js +6 -0
- package/dist/components/vertex-context-menu.d.ts +11 -0
- package/dist/components/vertex-context-menu.js +125 -0
- package/dist/components/vertex-dialog.d.ts +11 -0
- package/dist/components/vertex-dialog.js +263 -0
- package/dist/components/vertex-draggable-popover.d.ts +11 -0
- package/dist/components/vertex-draggable-popover.js +119 -0
- package/dist/components/vertex-dropdown-menu.d.ts +11 -0
- package/dist/components/vertex-dropdown-menu.js +64 -0
- package/dist/components/vertex-expandable.d.ts +11 -0
- package/dist/components/vertex-expandable.js +6 -0
- package/dist/components/vertex-help-tooltip.d.ts +11 -0
- package/dist/components/vertex-help-tooltip.js +67 -0
- package/dist/components/vertex-icon-button.d.ts +11 -0
- package/dist/components/vertex-icon-button.js +6 -0
- package/dist/components/vertex-icon.d.ts +11 -0
- package/dist/components/vertex-icon.js +6 -0
- package/dist/components/vertex-logo-loading.d.ts +11 -0
- package/dist/components/vertex-logo-loading.js +34 -0
- package/dist/components/vertex-menu-divider.d.ts +11 -0
- package/dist/components/vertex-menu-divider.js +34 -0
- package/dist/components/vertex-menu-item.d.ts +11 -0
- package/dist/components/vertex-menu-item.js +44 -0
- package/dist/components/vertex-menu.d.ts +11 -0
- package/dist/components/vertex-menu.js +6 -0
- package/dist/components/vertex-popover.d.ts +11 -0
- package/dist/components/vertex-popover.js +6 -0
- package/dist/components/vertex-radio-group.d.ts +11 -0
- package/dist/components/vertex-radio-group.js +88 -0
- package/dist/components/vertex-radio.d.ts +11 -0
- package/dist/components/vertex-radio.js +56 -0
- package/dist/components/vertex-resizable.d.ts +11 -0
- package/dist/components/vertex-resizable.js +445 -0
- package/dist/components/vertex-result-list.d.ts +11 -0
- package/dist/components/vertex-result-list.js +6 -0
- package/dist/components/vertex-search-bar.d.ts +11 -0
- package/dist/components/vertex-search-bar.js +568 -0
- package/dist/components/vertex-select.d.ts +11 -0
- package/dist/components/vertex-select.js +200 -0
- package/dist/components/vertex-slider.d.ts +11 -0
- package/dist/components/vertex-slider.js +81 -0
- package/dist/components/vertex-spinner.d.ts +11 -0
- package/dist/components/vertex-spinner.js +49 -0
- package/dist/components/vertex-tab.d.ts +11 -0
- package/dist/components/vertex-tab.js +46 -0
- package/dist/components/vertex-tabs.d.ts +11 -0
- package/dist/components/vertex-tabs.js +133 -0
- package/dist/components/vertex-textfield.d.ts +11 -0
- package/dist/components/vertex-textfield.js +6 -0
- package/dist/components/vertex-toast.d.ts +11 -0
- package/dist/components/vertex-toast.js +127 -0
- package/dist/components/vertex-toggle.d.ts +11 -0
- package/dist/components/vertex-toggle.js +67 -0
- package/dist/components/vertex-tooltip.d.ts +11 -0
- package/dist/components/vertex-tooltip.js +6 -0
- package/package.json +2 -2
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as classnames } from './index2.js';
|
|
3
|
+
import { g as getSvg } from './icon-helper.js';
|
|
4
|
+
|
|
5
|
+
const iconCss = ".container{display:flex;justify-content:center;align-items:center;width:100%;height:100%}.icon{display:flex;justify-content:center;align-items:center;fill:currentColor}.xs{height:var(--icon-size, 0.75rem);width:var(--icon-size, 0.75rem)}.sm{height:var(--icon-size, 1rem);width:var(--icon-size, 1rem)}.md{height:var(--icon-size, 1.5rem);width:var(--icon-size, 1.5rem)}.lg{height:var(--icon-size, 2rem);width:var(--icon-size, 2rem)}svg{position:relative;width:100%}";
|
|
6
|
+
|
|
7
|
+
const Icon = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.name = undefined;
|
|
13
|
+
this.size = 'md';
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return (h("div", { class: "container" }, h("div", { class: classnames('icon', {
|
|
17
|
+
xs: this.size === 'xs',
|
|
18
|
+
sm: this.size === 'sm',
|
|
19
|
+
md: this.size === 'md',
|
|
20
|
+
lg: this.size === 'lg',
|
|
21
|
+
}) }, getSvg(this.name))));
|
|
22
|
+
}
|
|
23
|
+
static get style() { return iconCss; }
|
|
24
|
+
}, [1, "vertex-icon", {
|
|
25
|
+
"name": [1],
|
|
26
|
+
"size": [1]
|
|
27
|
+
}]);
|
|
28
|
+
function defineCustomElement() {
|
|
29
|
+
if (typeof customElements === "undefined") {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const components = ["vertex-icon"];
|
|
33
|
+
components.forEach(tagName => { switch (tagName) {
|
|
34
|
+
case "vertex-icon":
|
|
35
|
+
if (!customElements.get(tagName)) {
|
|
36
|
+
customElements.define(tagName, Icon);
|
|
37
|
+
}
|
|
38
|
+
break;
|
|
39
|
+
} });
|
|
40
|
+
}
|
|
41
|
+
defineCustomElement();
|
|
42
|
+
|
|
43
|
+
export { Icon as I, defineCustomElement as d };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* components custom elements */
|
|
2
|
+
export { AutoResizeTextArea as VertexAutoResizeTextarea } from '../types/components/auto-resize-textarea/auto-resize-textarea';
|
|
3
|
+
export { Avatar as VertexAvatar } from '../types/components/avatar/avatar';
|
|
4
|
+
export { AvatarGroup as VertexAvatarGroup } from '../types/components/avatar-group/avatar-group';
|
|
5
|
+
export { Badge as VertexBadge } from '../types/components/badge/badge';
|
|
6
|
+
export { Banner as VertexBanner } from '../types/components/banner/banner';
|
|
7
|
+
export { Button as VertexButton } from '../types/components/button/button';
|
|
8
|
+
export { Card as VertexCard } from '../types/components/card/card';
|
|
9
|
+
export { CardGroup as VertexCardGroup } from '../types/components/card-group/card-group';
|
|
10
|
+
export { Chip as VertexChip } from '../types/components/chip/chip';
|
|
11
|
+
export { ClickToEditTextField as VertexClickToEditTextfield } from '../types/components/click-to-edit-text-field/click-to-edit-text-field';
|
|
12
|
+
export { Collapsible as VertexCollapsible } from '../types/components/collapsible/collapsible';
|
|
13
|
+
export { ColorCirclePicker as VertexColorCirclePicker } from '../types/components/color-circle-picker/color-circle-picker';
|
|
14
|
+
export { ColorPicker as VertexColorPicker } from '../types/components/color-picker/color-picker';
|
|
15
|
+
export { ColorSwatch as VertexColorSwatch } from '../types/components/color-swatch/color-swatch';
|
|
16
|
+
export { ContextMenu as VertexContextMenu } from '../types/components/context-menu/context-menu';
|
|
17
|
+
export { Dialog as VertexDialog } from '../types/components/dialog/dialog';
|
|
18
|
+
export { DraggablePopover as VertexDraggablePopover } from '../types/components/draggable-popover/draggable-popover';
|
|
19
|
+
export { DropdownMenu as VertexDropdownMenu } from '../types/components/dropdown-menu/dropdown-menu';
|
|
20
|
+
export { Expandable as VertexExpandable } from '../types/components/expandable/expandable';
|
|
21
|
+
export { HelpTooltip as VertexHelpTooltip } from '../types/components/help-tooltip/help-tooltip';
|
|
22
|
+
export { Icon as VertexIcon } from '../types/components/icon/icon';
|
|
23
|
+
export { IconButton as VertexIconButton } from '../types/components/icon-button/icon-button';
|
|
24
|
+
export { LogoLoading as VertexLogoLoading } from '../types/components/logo-loading/logo-loading';
|
|
25
|
+
export { Menu as VertexMenu } from '../types/components/menu/menu';
|
|
26
|
+
export { MenuDivider as VertexMenuDivider } from '../types/components/menu-divider/menu-divider';
|
|
27
|
+
export { MenuItem as VertexMenuItem } from '../types/components/menu-item/menu-item';
|
|
28
|
+
export { Popover as VertexPopover } from '../types/components/popover/popover';
|
|
29
|
+
export { Radio as VertexRadio } from '../types/components/radio/radio';
|
|
30
|
+
export { RadioGroup as VertexRadioGroup } from '../types/components/radio-group/radio-group';
|
|
31
|
+
export { Resizable as VertexResizable } from '../types/components/resizable/resizable';
|
|
32
|
+
export { ResultList as VertexResultList } from '../types/components/result-list/result-list';
|
|
33
|
+
export { SearchBar as VertexSearchBar } from '../types/components/search-bar/search-bar';
|
|
34
|
+
export { Select as VertexSelect } from '../types/components/select/select';
|
|
35
|
+
export { Slider as VertexSlider } from '../types/components/slider/slider';
|
|
36
|
+
export { Spinner as VertexSpinner } from '../types/components/spinner/spinner';
|
|
37
|
+
export { Tab as VertexTab } from '../types/components/tab/tab';
|
|
38
|
+
export { Tabs as VertexTabs } from '../types/components/tabs/tabs';
|
|
39
|
+
export { TextField as VertexTextfield } from '../types/components/text-field/text-field';
|
|
40
|
+
export { Toast as VertexToast } from '../types/components/toast/toast';
|
|
41
|
+
export { Toggle as VertexToggle } from '../types/components/toggle/toggle';
|
|
42
|
+
export { Tooltip as VertexTooltip } from '../types/components/tooltip/tooltip';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Used to manually set the base path where assets can be found.
|
|
46
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
47
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
48
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
49
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
50
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
51
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
52
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
53
|
+
*/
|
|
54
|
+
export declare const setAssetPath: (path: string) => void;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
58
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
59
|
+
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
60
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
61
|
+
* will result in the same behavior.
|
|
62
|
+
*/
|
|
63
|
+
export declare const setNonce: (nonce: string) => void
|
|
64
|
+
|
|
65
|
+
export interface SetPlatformOptions {
|
|
66
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
67
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
68
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
69
|
+
}
|
|
70
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
71
|
+
export * from '../types';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
+
export { A as AutoResizeTextArea, d as defineCustomElement } from './auto-resize-textarea.js';
|
|
3
|
+
export { A as Avatar, VertexAvatar, defineCustomElement as defineCustomElementVertexAvatar } from './vertex-avatar.js';
|
|
4
|
+
export { A as AvatarGroup, VertexAvatarGroup, defineCustomElement as defineCustomElementVertexAvatarGroup } from './vertex-avatar-group.js';
|
|
5
|
+
export { B as Badge, VertexBadge, defineCustomElement as defineCustomElementVertexBadge } from './vertex-badge.js';
|
|
6
|
+
export { B as Banner, VertexBanner, defineCustomElement as defineCustomElementVertexBanner } from './vertex-banner.js';
|
|
7
|
+
export { B as Button, VertexButton, defineCustomElement as defineCustomElementVertexButton } from './vertex-button.js';
|
|
8
|
+
export { C as Card, VertexCard, defineCustomElement as defineCustomElementVertexCard } from './vertex-card.js';
|
|
9
|
+
export { C as CardGroup, VertexCardGroup, defineCustomElement as defineCustomElementVertexCardGroup } from './vertex-card-group.js';
|
|
10
|
+
export { C as Chip, VertexChip, defineCustomElement as defineCustomElementVertexChip } from './vertex-chip.js';
|
|
11
|
+
export { C as ClickToEditTextField, VertexClickToEditTextfield, defineCustomElement as defineCustomElementVertexClickToEditTextfield } from './vertex-click-to-edit-textfield.js';
|
|
12
|
+
export { C as Collapsible, VertexCollapsible, defineCustomElement as defineCustomElementVertexCollapsible } from './vertex-collapsible.js';
|
|
13
|
+
export { C as ColorCirclePicker, VertexColorCirclePicker, defineCustomElement as defineCustomElementVertexColorCirclePicker } from './vertex-color-circle-picker.js';
|
|
14
|
+
export { C as ColorPicker, VertexColorPicker, defineCustomElement as defineCustomElementVertexColorPicker } from './vertex-color-picker.js';
|
|
15
|
+
export { C as ColorSwatch } from './color-swatch.js';
|
|
16
|
+
export { C as ContextMenu, VertexContextMenu, defineCustomElement as defineCustomElementVertexContextMenu } from './vertex-context-menu.js';
|
|
17
|
+
export { D as Dialog, VertexDialog, defineCustomElement as defineCustomElementVertexDialog } from './vertex-dialog.js';
|
|
18
|
+
export { D as DraggablePopover, VertexDraggablePopover, defineCustomElement as defineCustomElementVertexDraggablePopover } from './vertex-draggable-popover.js';
|
|
19
|
+
export { D as DropdownMenu, VertexDropdownMenu, defineCustomElement as defineCustomElementVertexDropdownMenu } from './vertex-dropdown-menu.js';
|
|
20
|
+
export { E as Expandable } from './expandable.js';
|
|
21
|
+
export { H as HelpTooltip, VertexHelpTooltip, defineCustomElement as defineCustomElementVertexHelpTooltip } from './vertex-help-tooltip.js';
|
|
22
|
+
export { I as Icon } from './icon.js';
|
|
23
|
+
export { I as IconButton } from './icon-button.js';
|
|
24
|
+
export { L as LogoLoading, VertexLogoLoading, defineCustomElement as defineCustomElementVertexLogoLoading } from './vertex-logo-loading.js';
|
|
25
|
+
export { M as Menu } from './menu.js';
|
|
26
|
+
export { M as MenuDivider, VertexMenuDivider, defineCustomElement as defineCustomElementVertexMenuDivider } from './vertex-menu-divider.js';
|
|
27
|
+
export { M as MenuItem, VertexMenuItem, defineCustomElement as defineCustomElementVertexMenuItem } from './vertex-menu-item.js';
|
|
28
|
+
export { P as Popover } from './popover.js';
|
|
29
|
+
export { R as Radio, VertexRadio, defineCustomElement as defineCustomElementVertexRadio } from './vertex-radio.js';
|
|
30
|
+
export { R as RadioGroup, VertexRadioGroup, defineCustomElement as defineCustomElementVertexRadioGroup } from './vertex-radio-group.js';
|
|
31
|
+
export { R as Resizable, VertexResizable, defineCustomElement as defineCustomElementVertexResizable } from './vertex-resizable.js';
|
|
32
|
+
export { R as ResultList } from './result-list.js';
|
|
33
|
+
export { S as SearchBar, VertexSearchBar, defineCustomElement as defineCustomElementVertexSearchBar } from './vertex-search-bar.js';
|
|
34
|
+
export { S as Select, VertexSelect, defineCustomElement as defineCustomElementVertexSelect } from './vertex-select.js';
|
|
35
|
+
export { S as Slider, VertexSlider, defineCustomElement as defineCustomElementVertexSlider } from './vertex-slider.js';
|
|
36
|
+
export { S as Spinner, VertexSpinner, defineCustomElement as defineCustomElementVertexSpinner } from './vertex-spinner.js';
|
|
37
|
+
export { T as Tab, VertexTab, defineCustomElement as defineCustomElementVertexTab } from './vertex-tab.js';
|
|
38
|
+
export { T as Tabs, VertexTabs, defineCustomElement as defineCustomElementVertexTabs } from './vertex-tabs.js';
|
|
39
|
+
export { T as TextField } from './text-field.js';
|
|
40
|
+
export { T as Toast, VertexToast, defineCustomElement as defineCustomElementVertexToast } from './vertex-toast.js';
|
|
41
|
+
export { T as Toggle, VertexToggle, defineCustomElement as defineCustomElementVertexToggle } from './vertex-toggle.js';
|
|
42
|
+
export { T as Tooltip } from './tooltip.js';
|
|
43
|
+
export { VertexAutoResizeTextarea, defineCustomElement as defineCustomElementVertexAutoResizeTextarea } from './vertex-auto-resize-textarea.js';
|
|
44
|
+
export { VertexColorSwatch, defineCustomElement as defineCustomElementVertexColorSwatch } from './vertex-color-swatch.js';
|
|
45
|
+
export { VertexExpandable, defineCustomElement as defineCustomElementVertexExpandable } from './vertex-expandable.js';
|
|
46
|
+
export { VertexIcon, defineCustomElement as defineCustomElementVertexIcon } from './vertex-icon.js';
|
|
47
|
+
export { VertexIconButton, defineCustomElement as defineCustomElementVertexIconButton } from './vertex-icon-button.js';
|
|
48
|
+
export { VertexMenu, defineCustomElement as defineCustomElementVertexMenu } from './vertex-menu.js';
|
|
49
|
+
export { VertexPopover, defineCustomElement as defineCustomElementVertexPopover } from './vertex-popover.js';
|
|
50
|
+
export { VertexResultList, defineCustomElement as defineCustomElementVertexResultList } from './vertex-result-list.js';
|
|
51
|
+
export { VertexTextfield, defineCustomElement as defineCustomElementVertexTextfield } from './vertex-textfield.js';
|
|
52
|
+
export { VertexTooltip, defineCustomElement as defineCustomElementVertexTooltip } from './vertex-tooltip.js';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
function createCommonjsModule(fn, basedir, module) {
|
|
2
|
+
return module = {
|
|
3
|
+
path: basedir,
|
|
4
|
+
exports: {},
|
|
5
|
+
require: function (path, base) {
|
|
6
|
+
return commonjsRequire();
|
|
7
|
+
}
|
|
8
|
+
}, fn(module, module.exports), module.exports;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function commonjsRequire () {
|
|
12
|
+
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
var classnames = createCommonjsModule(function (module) {
|
|
16
|
+
/*!
|
|
17
|
+
Copyright (c) 2018 Jed Watson.
|
|
18
|
+
Licensed under the MIT License (MIT), see
|
|
19
|
+
http://jedwatson.github.io/classnames
|
|
20
|
+
*/
|
|
21
|
+
/* global define */
|
|
22
|
+
|
|
23
|
+
(function () {
|
|
24
|
+
|
|
25
|
+
var hasOwn = {}.hasOwnProperty;
|
|
26
|
+
|
|
27
|
+
function classNames () {
|
|
28
|
+
var classes = '';
|
|
29
|
+
|
|
30
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
31
|
+
var arg = arguments[i];
|
|
32
|
+
if (arg) {
|
|
33
|
+
classes = appendClass(classes, parseValue(arg));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return classes;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function parseValue (arg) {
|
|
41
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
42
|
+
return arg;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (typeof arg !== 'object') {
|
|
46
|
+
return '';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (Array.isArray(arg)) {
|
|
50
|
+
return classNames.apply(null, arg);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
54
|
+
return arg.toString();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
var classes = '';
|
|
58
|
+
|
|
59
|
+
for (var key in arg) {
|
|
60
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
61
|
+
classes = appendClass(classes, key);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return classes;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function appendClass (value, newClass) {
|
|
69
|
+
if (!newClass) {
|
|
70
|
+
return value;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (value) {
|
|
74
|
+
return value + ' ' + newClass;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return value + newClass;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (module.exports) {
|
|
81
|
+
classNames.default = classNames;
|
|
82
|
+
module.exports = classNames;
|
|
83
|
+
} else {
|
|
84
|
+
window.classNames = classNames;
|
|
85
|
+
}
|
|
86
|
+
}());
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export { classnames as c };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as classnames } from './index2.js';
|
|
3
|
+
import { d as defineCustomElement$1 } from './popover.js';
|
|
4
|
+
|
|
5
|
+
const menuCss = ":host{--background-color:var(--vertex-ui-white);--menu-padding:0.19em 0}.root{padding:var(--menu-padding);border:1px solid var(--vertex-ui-neutral-400);border-radius:0.25rem;box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%),\n 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%);background-color:var(--background-color);z-index:var(--vertex-ui-context-menu-layer)}.has-header{padding-top:0}";
|
|
6
|
+
|
|
7
|
+
const Menu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.menuClosed = createEvent(this, "menuClosed", 7);
|
|
13
|
+
this.animated = true;
|
|
14
|
+
this.open = false;
|
|
15
|
+
this.placement = undefined;
|
|
16
|
+
this.fallbackPlacements = undefined;
|
|
17
|
+
this.backdrop = true;
|
|
18
|
+
this.position = undefined;
|
|
19
|
+
this.popoverProps = undefined;
|
|
20
|
+
this.handlePopoverDismiss = this.handlePopoverDismiss.bind(this);
|
|
21
|
+
}
|
|
22
|
+
componentDidLoad() {
|
|
23
|
+
var _a;
|
|
24
|
+
this.addEventListeners();
|
|
25
|
+
this.headerSlot =
|
|
26
|
+
((_a = this.hostElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot[name="header"]')) ||
|
|
27
|
+
undefined;
|
|
28
|
+
}
|
|
29
|
+
disconnectedCallback() {
|
|
30
|
+
this.removeEventListeners();
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return (h("vertex-popover", Object.assign({ ref: (element) => {
|
|
34
|
+
this.popoverRef = element;
|
|
35
|
+
}, open: this.open, animated: this.animated, position: this.position, placement: this.placement, backdrop: this.backdrop, flipBehavior: this.fallbackPlacements != null
|
|
36
|
+
? {
|
|
37
|
+
fallbackPlacements: this.fallbackPlacements,
|
|
38
|
+
}
|
|
39
|
+
: undefined }, this.popoverProps), this.position == null && (h("div", { slot: "anchor" }, h("slot", { name: "anchor" }))), h("div", { onClick: () => {
|
|
40
|
+
this.open = false;
|
|
41
|
+
this.menuClosed.emit();
|
|
42
|
+
}, class: classnames('root', {
|
|
43
|
+
'has-header': this.headerSlot != null,
|
|
44
|
+
}) }, h("slot", { name: "header" }), h("slot", null))));
|
|
45
|
+
}
|
|
46
|
+
addEventListeners() {
|
|
47
|
+
var _a;
|
|
48
|
+
(_a = this.popoverRef) === null || _a === void 0 ? void 0 : _a.addEventListener('dismissed', this.handlePopoverDismiss);
|
|
49
|
+
}
|
|
50
|
+
removeEventListeners() {
|
|
51
|
+
var _a;
|
|
52
|
+
(_a = this.popoverRef) === null || _a === void 0 ? void 0 : _a.removeEventListener('dismissed', this.handlePopoverDismiss);
|
|
53
|
+
}
|
|
54
|
+
handlePopoverDismiss() {
|
|
55
|
+
this.open = false;
|
|
56
|
+
this.menuClosed.emit();
|
|
57
|
+
}
|
|
58
|
+
get hostElement() { return this; }
|
|
59
|
+
static get style() { return menuCss; }
|
|
60
|
+
}, [1, "vertex-menu", {
|
|
61
|
+
"animated": [4],
|
|
62
|
+
"open": [1540],
|
|
63
|
+
"placement": [1],
|
|
64
|
+
"fallbackPlacements": [16],
|
|
65
|
+
"backdrop": [4],
|
|
66
|
+
"position": [1040],
|
|
67
|
+
"popoverProps": [16]
|
|
68
|
+
}]);
|
|
69
|
+
function defineCustomElement() {
|
|
70
|
+
if (typeof customElements === "undefined") {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const components = ["vertex-menu", "vertex-popover"];
|
|
74
|
+
components.forEach(tagName => { switch (tagName) {
|
|
75
|
+
case "vertex-menu":
|
|
76
|
+
if (!customElements.get(tagName)) {
|
|
77
|
+
customElements.define(tagName, Menu);
|
|
78
|
+
}
|
|
79
|
+
break;
|
|
80
|
+
case "vertex-popover":
|
|
81
|
+
if (!customElements.get(tagName)) {
|
|
82
|
+
defineCustomElement$1();
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
} });
|
|
86
|
+
}
|
|
87
|
+
defineCustomElement();
|
|
88
|
+
|
|
89
|
+
export { Menu as M, defineCustomElement as d };
|