wj-elements 0.0.28 → 0.0.30

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.
Files changed (79) hide show
  1. package/dist/wj-animation.js +2 -2
  2. package/dist/wj-aside.js +2 -2
  3. package/dist/wj-avatar.js +2 -2
  4. package/dist/wj-badge.js +2 -4
  5. package/dist/wj-breadcrumb.js +2 -1
  6. package/dist/wj-breadcrumbs.js +2 -2
  7. package/dist/wj-button-group.js +2 -2
  8. package/dist/wj-button.js +6 -2
  9. package/dist/wj-card-content.js +2 -2
  10. package/dist/wj-card-controls.js +2 -2
  11. package/dist/wj-card-header.js +2 -2
  12. package/dist/wj-card-subtitle.js +2 -2
  13. package/dist/wj-card-title.js +2 -2
  14. package/dist/wj-card.js +2 -2
  15. package/dist/wj-carousel-item.js +2 -2
  16. package/dist/wj-carousel.js +2 -2
  17. package/dist/wj-checkbox.js +2 -1
  18. package/dist/wj-chip.js +2 -2
  19. package/dist/wj-col.js +2 -2
  20. package/dist/wj-color-picker.js +2 -2
  21. package/dist/wj-container.js +2 -2
  22. package/dist/wj-copy-button.js +3 -3
  23. package/dist/wj-dialog.js +2 -3
  24. package/dist/wj-divider.js +2 -2
  25. package/dist/wj-dropdown.js +2 -2
  26. package/dist/wj-element.js +29 -10
  27. package/dist/wj-file-upload-item.js +2 -2
  28. package/dist/wj-file-upload.js +2 -2
  29. package/dist/wj-footer.js +2 -2
  30. package/dist/wj-form.js +2 -2
  31. package/dist/wj-format-digital.js +2 -2
  32. package/dist/wj-grid.js +2 -2
  33. package/dist/wj-header.js +2 -2
  34. package/dist/wj-icon-picker.js +3 -4
  35. package/dist/wj-icon.js +3 -3
  36. package/dist/wj-img-comparer.js +2 -2
  37. package/dist/wj-img.js +2 -2
  38. package/dist/wj-infinite-scroll.js +2 -2
  39. package/dist/wj-input-file.js +2 -2
  40. package/dist/wj-input.js +2 -2
  41. package/dist/wj-item.js +2 -2
  42. package/dist/wj-label.js +2 -2
  43. package/dist/wj-list.js +2 -2
  44. package/dist/wj-main.js +2 -2
  45. package/dist/wj-masonry.js +2 -2
  46. package/dist/wj-master.js +146 -150
  47. package/dist/wj-menu-button.js +2 -2
  48. package/dist/wj-menu-item.js +61 -30
  49. package/dist/wj-menu-label.js +2 -2
  50. package/dist/wj-menu.js +11 -3
  51. package/dist/wj-option.js +2 -2
  52. package/dist/wj-options.js +2 -2
  53. package/dist/wj-popup.js +2 -2
  54. package/dist/wj-progress-bar.js +2 -2
  55. package/dist/wj-radio-group.js +3 -3
  56. package/dist/wj-radio.js +2 -2
  57. package/dist/wj-rate.js +2 -2
  58. package/dist/wj-relative-time.js +2 -2
  59. package/dist/wj-route.js +2 -2
  60. package/dist/wj-router-link.js +2 -2
  61. package/dist/wj-routerx.js +2 -2
  62. package/dist/wj-row.js +2 -2
  63. package/dist/wj-select.js +2 -2
  64. package/dist/wj-slider.js +2 -2
  65. package/dist/wj-split-view.js +4 -4
  66. package/dist/wj-tab-group.js +2 -2
  67. package/dist/wj-tab-panel.js +2 -2
  68. package/dist/wj-tab.js +2 -2
  69. package/dist/wj-textarea.js +2 -2
  70. package/dist/wj-thumbnail.js +2 -2
  71. package/dist/wj-toast.js +2 -2
  72. package/dist/wj-toggle.js +2 -2
  73. package/dist/wj-toolbar-action.js +2 -2
  74. package/dist/wj-toolbar.js +2 -2
  75. package/dist/wj-tooltip.js +2 -2
  76. package/dist/wj-visually-hidden.js +2 -2
  77. package/package.json +1 -1
  78. package/dist/wj-nav-menu.js +0 -37
  79. package/dist/wj-nav.js +0 -61
@@ -183,7 +183,7 @@ class Masonry extends WJElement {
183
183
  debounce(this.layout, ms, this.debounceId);
184
184
  }
185
185
  }
186
- customElements.get("wj-masonry") || window.customElements.define("wj-masonry", Masonry);
186
+ WJElement.define("wj-masonry", Masonry);
187
187
  export {
188
- Masonry
188
+ Masonry as default
189
189
  };
package/dist/wj-master.js CHANGED
@@ -3,82 +3,80 @@ import { defaultStoreActions, store } from "./wj-store.js";
3
3
  import { b, w } from "./router-links-F7MJWhZi.js";
4
4
  import { fetchAndParseCSS } from "./wj-fetchAndParseCSS.js";
5
5
  import { L as Localizer } from "./localize-DSOailh_.js";
6
- import { Animation } from "./wj-animation.js";
7
- import { Aside } from "./wj-aside.js";
8
- import { Avatar } from "./wj-avatar.js";
9
- import { Badge } from "./wj-badge.js";
10
- import { Breadcrumb } from "./wj-breadcrumb.js";
11
- import { Breadcrumbs } from "./wj-breadcrumbs.js";
12
- import { Button } from "./wj-button.js";
13
- import { ButtonGroup } from "./wj-button-group.js";
14
- import { Card } from "./wj-card.js";
15
- import { CardContent } from "./wj-card-content.js";
16
- import { CardControls } from "./wj-card-controls.js";
17
- import { CardHeader } from "./wj-card-header.js";
18
- import { CardSubtitle } from "./wj-card-subtitle.js";
19
- import { CardTitle } from "./wj-card-title.js";
20
- import { Carousel } from "./wj-carousel.js";
21
- import { CarouselItem } from "./wj-carousel-item.js";
22
- import { Checkbox } from "./wj-checkbox.js";
23
- import { Chip } from "./wj-chip.js";
24
- import { Col } from "./wj-col.js";
25
- import { ColorPicker } from "./wj-color-picker.js";
26
- import { Container } from "./wj-container.js";
27
- import { CopyButton } from "./wj-copy-button.js";
28
- import { Dialog } from "./wj-dialog.js";
29
- import { Divider } from "./wj-divider.js";
30
- import { Dropdown } from "./wj-dropdown.js";
31
- import { FileUpload } from "./wj-file-upload.js";
32
- import { FileUploadItem } from "./wj-file-upload-item.js";
33
- import { Footer } from "./wj-footer.js";
34
- import { FormatDigital } from "./wj-format-digital.js";
35
- import { Grid } from "./wj-grid.js";
36
- import { Header } from "./wj-header.js";
37
- import { Icon } from "./wj-icon.js";
38
- import { IconPicker } from "./wj-icon-picker.js";
39
- import { Img } from "./wj-img.js";
40
- import { ImgComparer } from "./wj-img-comparer.js";
41
- import { InfiniteScroll } from "./wj-infinite-scroll.js";
42
- import { Input } from "./wj-input.js";
43
- import { InputFile } from "./wj-input-file.js";
44
- import { Item } from "./wj-item.js";
45
- import { Label } from "./wj-label.js";
46
- import { List } from "./wj-list.js";
47
- import { Main } from "./wj-main.js";
48
- import { Masonry } from "./wj-masonry.js";
49
- import { Menu } from "./wj-menu.js";
50
- import { MenuButton } from "./wj-menu-button.js";
51
- import { MenuItem } from "./wj-menu-item.js";
52
- import { MenuLabel } from "./wj-menu-label.js";
53
- import { Nav } from "./wj-nav.js";
54
- import { NavMenu } from "./wj-nav-menu.js";
55
- import { Option } from "./wj-option.js";
56
- import { Options } from "./wj-options.js";
57
- import { Popup } from "./wj-popup.js";
58
- import { ProgressBar } from "./wj-progress-bar.js";
59
- import { Radio } from "./wj-radio.js";
60
- import { RadioGroup } from "./wj-radio-group.js";
61
- import { Rate } from "./wj-rate.js";
62
- import { RelativeTime } from "./wj-relative-time.js";
63
- import { Route } from "./wj-route.js";
64
- import { Routerx } from "./wj-routerx.js";
65
- import { RouterLink } from "./wj-router-link.js";
6
+ import { default as default3 } from "./wj-animation.js";
7
+ import { default as default4 } from "./wj-aside.js";
8
+ import { default as default5 } from "./wj-avatar.js";
9
+ import { default as default6 } from "./wj-badge.js";
10
+ import { default as default7 } from "./wj-breadcrumb.js";
11
+ import { default as default8 } from "./wj-breadcrumbs.js";
12
+ import { default as default9 } from "./wj-button.js";
13
+ import { default as default10 } from "./wj-button-group.js";
14
+ import { default as default11 } from "./wj-card.js";
15
+ import { default as default12 } from "./wj-card-content.js";
16
+ import { default as default13 } from "./wj-card-controls.js";
17
+ import { default as default14 } from "./wj-card-header.js";
18
+ import { default as default15 } from "./wj-card-subtitle.js";
19
+ import { default as default16 } from "./wj-card-title.js";
20
+ import { default as default17 } from "./wj-carousel.js";
21
+ import { default as default18 } from "./wj-carousel-item.js";
22
+ import { default as default19 } from "./wj-checkbox.js";
23
+ import { default as default20 } from "./wj-chip.js";
24
+ import { default as default21 } from "./wj-col.js";
25
+ import { default as default22 } from "./wj-color-picker.js";
26
+ import { default as default23 } from "./wj-container.js";
27
+ import { default as default24 } from "./wj-copy-button.js";
28
+ import { default as default25 } from "./wj-dialog.js";
29
+ import { default as default26 } from "./wj-divider.js";
30
+ import { default as default27 } from "./wj-dropdown.js";
31
+ import { default as default28 } from "./wj-file-upload.js";
32
+ import { default as default29 } from "./wj-file-upload-item.js";
33
+ import { default as default30 } from "./wj-footer.js";
34
+ import { default as default31 } from "./wj-format-digital.js";
35
+ import { default as default32 } from "./wj-grid.js";
36
+ import { default as default33 } from "./wj-header.js";
37
+ import { default as default34 } from "./wj-icon.js";
38
+ import { default as default35 } from "./wj-icon-picker.js";
39
+ import { default as default36 } from "./wj-img.js";
40
+ import { default as default37 } from "./wj-img-comparer.js";
41
+ import { default as default38 } from "./wj-infinite-scroll.js";
42
+ import { default as default39 } from "./wj-input.js";
43
+ import { default as default40 } from "./wj-input-file.js";
44
+ import { default as default41 } from "./wj-item.js";
45
+ import { default as default42 } from "./wj-label.js";
46
+ import { default as default43 } from "./wj-list.js";
47
+ import { default as default44 } from "./wj-main.js";
48
+ import { default as default45 } from "./wj-masonry.js";
49
+ import { default as default46 } from "./wj-menu.js";
50
+ import { default as default47 } from "./wj-menu-button.js";
51
+ import { default as default48 } from "./wj-menu-item.js";
52
+ import { default as default49 } from "./wj-menu-label.js";
53
+ import { default as default50 } from "./wj-option.js";
54
+ import { default as default51 } from "./wj-options.js";
55
+ import { default as default52 } from "./wj-popup.js";
56
+ import { default as default53 } from "./wj-progress-bar.js";
57
+ import { default as default54 } from "./wj-radio.js";
58
+ import { default as default55 } from "./wj-radio-group.js";
59
+ import { default as default56 } from "./wj-rate.js";
60
+ import { default as default57 } from "./wj-relative-time.js";
61
+ import { default as default58 } from "./wj-route.js";
62
+ import { default as default59 } from "./wj-routerx.js";
63
+ import { default as default60 } from "./wj-router-link.js";
66
64
  import "./wj-router-outlet.js";
67
- import { Row } from "./wj-row.js";
68
- import { Select } from "./wj-select.js";
69
- import { Slider } from "./wj-slider.js";
70
- import { SplitView } from "./wj-split-view.js";
71
- import { Tab } from "./wj-tab.js";
72
- import { TabGroup } from "./wj-tab-group.js";
73
- import { TabPanel } from "./wj-tab-panel.js";
74
- import { Textarea } from "./wj-textarea.js";
75
- import { Thumbnail } from "./wj-thumbnail.js";
76
- import { Toast } from "./wj-toast.js";
77
- import { Toggle } from "./wj-toggle.js";
78
- import { Toolbar } from "./wj-toolbar.js";
79
- import { ToolbarAction } from "./wj-toolbar-action.js";
80
- import { Tooltip } from "./wj-tooltip.js";
81
- import { VisuallyHidden } from "./wj-visually-hidden.js";
65
+ import { default as default61 } from "./wj-row.js";
66
+ import { default as default62 } from "./wj-select.js";
67
+ import { default as default63 } from "./wj-slider.js";
68
+ import { default as default64 } from "./wj-split-view.js";
69
+ import { default as default65 } from "./wj-tab.js";
70
+ import { default as default66 } from "./wj-tab-group.js";
71
+ import { default as default67 } from "./wj-tab-panel.js";
72
+ import { default as default68 } from "./wj-textarea.js";
73
+ import { default as default69 } from "./wj-thumbnail.js";
74
+ import { default as default70 } from "./wj-toast.js";
75
+ import { default as default71 } from "./wj-toggle.js";
76
+ import { default as default72 } from "./wj-toolbar.js";
77
+ import { default as default73 } from "./wj-toolbar-action.js";
78
+ import { default as default74 } from "./wj-tooltip.js";
79
+ import { default as default75 } from "./wj-visually-hidden.js";
82
80
  const sk = {
83
81
  code: "sk",
84
82
  name: "Slovak",
@@ -100,82 +98,80 @@ const en = {
100
98
  };
101
99
  Localizer.registerTranslation(en);
102
100
  export {
103
- Animation,
104
- Aside,
105
- Avatar,
106
- Badge,
107
- Breadcrumb,
108
- Breadcrumbs,
109
- Button,
110
- ButtonGroup,
111
- Card,
112
- CardContent,
113
- CardControls,
114
- CardHeader,
115
- CardSubtitle,
116
- CardTitle,
117
- Carousel,
118
- CarouselItem,
119
- Checkbox,
120
- Chip,
121
- Col,
122
- ColorPicker,
123
- Container,
124
- CopyButton,
125
- Dialog,
126
- Divider,
127
- Dropdown,
128
- FileUpload,
129
- FileUploadItem,
130
- Footer,
131
- FormatDigital,
132
- Grid,
133
- Header,
134
- Icon,
135
- IconPicker,
136
- Img,
137
- ImgComparer,
138
- InfiniteScroll,
139
- Input,
140
- InputFile,
141
- Item,
142
- Label,
143
- List,
101
+ default3 as Animation,
102
+ default4 as Aside,
103
+ default5 as Avatar,
104
+ default6 as Badge,
105
+ default7 as Breadcrumb,
106
+ default8 as Breadcrumbs,
107
+ default9 as Button,
108
+ default10 as ButtonGroup,
109
+ default11 as Card,
110
+ default12 as CardContent,
111
+ default13 as CardControls,
112
+ default14 as CardHeader,
113
+ default15 as CardSubtitle,
114
+ default16 as CardTitle,
115
+ default17 as Carousel,
116
+ default18 as CarouselItem,
117
+ default19 as Checkbox,
118
+ default20 as Chip,
119
+ default21 as Col,
120
+ default22 as ColorPicker,
121
+ default23 as Container,
122
+ default24 as CopyButton,
123
+ default25 as Dialog,
124
+ default26 as Divider,
125
+ default27 as Dropdown,
126
+ default28 as FileUpload,
127
+ default29 as FileUploadItem,
128
+ default30 as Footer,
129
+ default31 as FormatDigital,
130
+ default32 as Grid,
131
+ default33 as Header,
132
+ default34 as Icon,
133
+ default35 as IconPicker,
134
+ default36 as Img,
135
+ default37 as ImgComparer,
136
+ default38 as InfiniteScroll,
137
+ default39 as Input,
138
+ default40 as InputFile,
139
+ default41 as Item,
140
+ default42 as Label,
141
+ default43 as List,
144
142
  Localizer,
145
- Main,
146
- Masonry,
147
- Menu,
148
- MenuButton,
149
- MenuItem,
150
- MenuLabel,
151
- Nav,
152
- NavMenu,
153
- Option,
154
- Options,
155
- Popup,
156
- ProgressBar,
157
- Radio,
158
- RadioGroup,
159
- Rate,
160
- RelativeTime,
161
- Route,
162
- RouterLink,
163
- Routerx,
164
- Row,
165
- Select,
166
- Slider,
167
- SplitView,
168
- Tab,
169
- TabGroup,
170
- TabPanel,
171
- Textarea,
172
- Thumbnail,
173
- Toast,
174
- Toggle,
175
- Toolbar,
176
- ToolbarAction,
177
- Tooltip,
178
- VisuallyHidden,
143
+ default44 as Main,
144
+ default45 as Masonry,
145
+ default46 as Menu,
146
+ default47 as MenuButton,
147
+ default48 as MenuItem,
148
+ default49 as MenuLabel,
149
+ default50 as Option,
150
+ default51 as Options,
151
+ default52 as Popup,
152
+ default53 as ProgressBar,
153
+ default54 as Radio,
154
+ default55 as RadioGroup,
155
+ default56 as Rate,
156
+ default57 as RelativeTime,
157
+ default58 as Route,
158
+ default60 as RouterLink,
159
+ default59 as Routerx,
160
+ default61 as Row,
161
+ default62 as Select,
162
+ default63 as Slider,
163
+ default64 as SplitView,
164
+ default65 as Tab,
165
+ default66 as TabGroup,
166
+ default67 as TabPanel,
167
+ default68 as Textarea,
168
+ default69 as Thumbnail,
169
+ default70 as Toast,
170
+ default71 as Toggle,
171
+ default72 as Toolbar,
172
+ default73 as ToolbarAction,
173
+ default74 as Tooltip,
174
+ default75 as VisuallyHidden,
179
175
  default2 as WJElement,
180
176
  b as bindRouterLinks,
181
177
  defaultStoreActions,
@@ -32,7 +32,7 @@ class MenuButton extends WJElement {
32
32
  });
33
33
  }
34
34
  }
35
- customElements.get("wj-menu-button") || window.customElements.define("wj-menu-button", MenuButton);
35
+ WJElement.define("wj-menu-button", MenuButton);
36
36
  export {
37
- MenuButton
37
+ MenuButton as default
38
38
  };
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => {
6
6
  };
7
7
  import WJElement, { WjElementUtils, event } from "./wj-element.js";
8
8
  import { b as bindRouterLinks } from "./router-links-F7MJWhZi.js";
9
- const styles = '/*\n[ WJ Menu Item ]\n*/\n:host {\n --wj-menu-item-color: var(--wj-color);\n --wj-menu-item-background: transparent;\n --wj-menu-item-color-hover: var(--wj-color-contrast-8);\n --wj-menu-item-background-hover: var(--wj-border-color);\n --wj-menu-item-color-focus: var(--wj-color-contrast-8);\n --wj-menu-item-background-focus: var(--wj-border-color);\n --wj-menu-item-color-active: var(--wj-color-contrast-8);\n --wj-menu-item-background-active: var(--wj-border-color);\n --wj-menu-item-padding-top: .5rem;\n --wj-menu-item-padding-bottom: .5rem;\n --wj-menu-item-line-height: 1.8rem;\n --wj-menu-item-safe-triangle-cursor-x: 0;\n --wj-menu-item-safe-triangle-cursor-y: 0;\n --wj-menu-item-safe-triangle-submenu-start-x: 0;\n --wj-menu-item-safe-triangle-submenu-start-y: 0;\n --wj-menu-item-safe-triangle-submenu-end-x: 0;\n --wj-menu-item-safe-triangle-submenu-end-y: 0;\n --wj-menu-submenu-offset: 0;\n --wj-menu-item-icon-visibility: hidden;\n display: block;\n}\n:host .native-menu-item {\n background: var(--wj-menu-item-background);\n position: relative;\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n color: var(--wj-menu-item-color);\n padding-top: var(--wj-menu-item-padding-top);\n padding-bottom: var(--wj-menu-item-padding-bottom);\n transition: var(--wj-transition-fast) fill;\n user-select: none;\n white-space: nowrap;\n cursor: pointer;\n width: 100%;\n line-height: var(--wj-menu-item-line-height);\n}\n:host .native-menu-item:hover {\n color: var(--wj-menu-item-color-hover);\n background: var(--wj-menu-item-background-hover);\n}\n:host .native-menu-item:focus {\n color: var(--wj-menu-item-color-focus);\n background: var(--wj-menu-item-background-focus);\n}\n:host .native-menu-item:active {\n color: var(--wj-menu-item-color-active);\n background: var(--wj-menu-item-background-active);\n}\n:host .native-menu-item .label {\n flex: 1 1 auto;\n display: inline-block;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n:host .native-menu-item .check-icon {\n flex: 0 0 auto;\n display: var(--wj-menu-item-check-icon-display, flex);\n align-items: center;\n justify-content: center;\n width: 1.5rem;\n visibility: hidden;\n}\n:host .native-menu-item .check-icon.checked {\n visibility: visible;\n}\n:host .native-menu-item.expanded-submenu {\n color: var(--wj-menu-item-color-active);\n background: var(--wj-menu-item-background-active);\n}\n:host .native-menu-item.expanded-submenu:hover {\n color: var(--wj-menu-item-color-hover);\n background: var(--wj-menu-item-background-hover);\n}\n:host .native-menu-item.expanded-submenu::after {\n content: "";\n position: fixed;\n z-index: 1;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n clip-path: polygon(var(--wj-menu-item-safe-triangle-cursor-x) var(--wj-menu-item-safe-triangle-cursor-y), var(--wj-menu-item-safe-triangle-submenu-start-x) var(--wj-menu-item-safe-triangle-submenu-start-y), var(--wj-menu-item-safe-triangle-submenu-end-x) var(--wj-menu-item-safe-triangle-submenu-end-y));\n}\n\n.submenu-icon {\n --wj-icon-size: 14px !important;\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1.5rem;\n visibility: var(--wj-menu-item-icon-visibility);\n}\n\n.has-submenu .submenu-icon {\n --wj-menu-item-icon-visibility: visible;\n}\n\n.submenu-icon.collapse {\n flex: none;\n right: 10px;\n position: relative;\n}\n\n:host(:focus-visible) {\n outline: none;\n}\n\n::slotted([slot=start]) {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n margin-inline-end: 0.5rem;\n}\n\n::slotted([slot=end]) {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n margin-inline-start: 0.5rem;\n}\n\n:host(.wj-menu-variant-nav) ::slotted([slot=submenu]) {\n --wj-menu-border-width: 0 !important;\n --wj-menu-margin-inline: 2rem 0 !important;\n}\n\n:host ::slotted([slot=start]) {\n width: 1.5rem;\n}\n\n:host(.wj-menu-variant-context) {\n display: block;\n}\n\n:host(.active) {\n color: var(--wj-menu-item-color-active);\n background: var(--wj-menu-item-background-active);\n}\n\n:host(.open) {\n color: var(--wj-menu-item-color-active);\n background: var(--wj-menu-item-background-active);\n}';
9
+ const styles = '/*\n[ WJ Menu Item ]\n*/\n:host {\n --wj-menu-item-color: var(--wj-color);\n --wj-menu-item-background: transparent;\n --wj-menu-item-color-hover: var(--wj-color-contrast-8);\n --wj-menu-item-background-hover: var(--wj-border-color);\n --wj-menu-item-color-focus: var(--wj-color-contrast-8);\n --wj-menu-item-background-focus: var(--wj-border-color);\n --wj-menu-item-color-active: var(--wj-color-contrast-8);\n --wj-menu-item-background-active: var(--wj-border-color);\n --wj-menu-item-padding-top: .5rem;\n --wj-menu-item-padding-bottom: .5rem;\n --wj-menu-item-line-height: 1.8rem;\n --wj-menu-item-safe-triangle-cursor-x: 0;\n --wj-menu-item-safe-triangle-cursor-y: 0;\n --wj-menu-item-safe-triangle-submenu-start-x: 0;\n --wj-menu-item-safe-triangle-submenu-start-y: 0;\n --wj-menu-item-safe-triangle-submenu-end-x: 0;\n --wj-menu-item-safe-triangle-submenu-end-y: 0;\n --wj-menu-submenu-offset: 0;\n --wj-menu-item-icon-visibility: hidden;\n display: block;\n}\n:host .native-menu-item {\n background: var(--wj-menu-item-background);\n position: relative;\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: center;\n color: var(--wj-menu-item-color);\n padding-top: var(--wj-menu-item-padding-top);\n padding-bottom: var(--wj-menu-item-padding-bottom);\n transition: var(--wj-transition-fast) fill;\n user-select: none;\n white-space: nowrap;\n cursor: pointer;\n width: 100%;\n}\n:host .native-menu-item:hover {\n color: var(--wj-menu-item-color-hover);\n background: var(--wj-menu-item-background-hover);\n}\n:host .native-menu-item:focus {\n color: var(--wj-menu-item-color-focus);\n background: var(--wj-menu-item-background-focus);\n}\n:host .native-menu-item:active {\n color: var(--wj-menu-item-color-active);\n background: var(--wj-menu-item-background-active);\n}\n:host .native-menu-item .label {\n flex: 1 1 auto;\n display: inline-block;\n text-overflow: ellipsis;\n overflow: hidden;\n line-height: normal;\n}\n:host .native-menu-item .check-icon {\n flex: 0 0 auto;\n display: var(--wj-menu-item-check-icon-display, flex);\n align-items: center;\n justify-content: center;\n width: var(--wj-menu-check-icon-width, 1.5rem);\n visibility: hidden;\n}\n:host .native-menu-item .check-icon.checked {\n visibility: visible;\n}\n:host .native-menu-item.expanded-submenu {\n color: var(--wj-menu-item-color-active);\n background: var(--wj-menu-item-background-active);\n}\n:host .native-menu-item.expanded-submenu:hover {\n color: var(--wj-menu-item-color-hover);\n background: var(--wj-menu-item-background-hover);\n}\n:host .native-menu-item.expanded-submenu::after {\n content: "";\n position: fixed;\n z-index: 1;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n clip-path: polygon(var(--wj-menu-item-safe-triangle-cursor-x) var(--wj-menu-item-safe-triangle-cursor-y), var(--wj-menu-item-safe-triangle-submenu-start-x) var(--wj-menu-item-safe-triangle-submenu-start-y), var(--wj-menu-item-safe-triangle-submenu-end-x) var(--wj-menu-item-safe-triangle-submenu-end-y));\n}\n\n:host(.collapse) ::slotted([slot=start]) {\n margin: 0;\n width: auto;\n display: contents;\n}\n:host(.collapse) ::slotted([slot=end]) {\n display: none;\n}\n:host(.collapse) .label,\n:host(.collapse) .check-icon,\n:host(.collapse) .submenu-icon {\n display: none;\n}\n\n.submenu-icon {\n --wj-icon-size: 14px !important;\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1.5rem;\n visibility: var(--wj-menu-item-icon-visibility);\n}\n\n.has-submenu .submenu-icon {\n --wj-menu-item-icon-visibility: visible;\n}\n\n.submenu-icon.collapse {\n flex: none;\n right: 10px;\n position: relative;\n}\n\n:host(:focus-visible) {\n outline: none;\n}\n\n::slotted([slot=start]) {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n margin-inline-end: 0.5rem;\n}\n\n::slotted([slot=end]) {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n margin-inline-start: 0.5rem;\n}\n\n:host(.wj-menu-variant-nav) ::slotted([slot=submenu]) {\n --wj-menu-border-width: 0 !important;\n --wj-menu-margin-inline: 2rem 0 !important;\n}\n\n:host ::slotted([slot=start]) {\n width: 1.5rem;\n}\n\n:host(.wj-menu-variant-context) {\n display: block;\n}\n\n:host(.active) {\n color: var(--wj-menu-item-color-active);\n background: var(--wj-menu-item-background-active);\n}\n\n:host(.open) {\n color: var(--wj-menu-item-color-active);\n background: var(--wj-menu-item-background-active);\n}';
10
10
  class MenuItem extends WJElement {
11
11
  constructor() {
12
12
  super();
@@ -51,8 +51,9 @@ class MenuItem extends WJElement {
51
51
  return "CONTEXT";
52
52
  }
53
53
  get collapse() {
54
- var _a;
55
- return (_a = this.parentElement) == null ? void 0 : _a.hasAttribute("collapse");
54
+ if (this.closest("[collapse]"))
55
+ return true;
56
+ return false;
56
57
  }
57
58
  static get cssStyleSheet() {
58
59
  return styles;
@@ -65,12 +66,27 @@ class MenuItem extends WJElement {
65
66
  this.isShadowRoot = "open";
66
67
  this.setAttribute("active-class", "open");
67
68
  }
68
- draw(context, store, params) {
69
+ beforeDraw(context, store, params) {
69
70
  var _a;
71
+ (_a = this.querySelector("wj-menu")) == null ? void 0 : _a.removeAttribute("active");
72
+ }
73
+ draw(context, store, params) {
74
+ var _a, _b, _c;
70
75
  let fragment = document.createDocumentFragment();
71
76
  this.setAttribute("tabindex", "0");
77
+ console.log("DRAW", this.variant, this.collapse);
78
+ this.classList.forEach((className) => {
79
+ if (className.startsWith("wj-menu-variant-")) {
80
+ this.classList.remove(className);
81
+ }
82
+ });
83
+ this.classList.remove("collapse");
72
84
  this.classList.add("wj-menu-variant-" + this.variant.toLowerCase());
73
- (_a = this.querySelector("wj-menu")) == null ? void 0 : _a.setAttribute("variant", this.variant.toLowerCase());
85
+ if (!this.collapse) {
86
+ (_a = this.querySelector("wj-menu")) == null ? void 0 : _a.setAttribute("variant", this.variant.toLowerCase());
87
+ } else if ((_b = this.parentElement) == null ? void 0 : _b.hasAttribute("collapse")) {
88
+ this.classList.add("collapse");
89
+ }
74
90
  let native = document.createElement("div");
75
91
  native.setAttribute("part", "native");
76
92
  native.setAttribute("id", "anchor");
@@ -114,7 +130,7 @@ class MenuItem extends WJElement {
114
130
  fragment.appendChild(popup);
115
131
  isAppend = true;
116
132
  }
117
- if (this.collapse && !this.hasSubmenu) {
133
+ if (((_c = this.parentElement) == null ? void 0 : _c.hasAttribute("collapse")) && !this.hasSubmenu) {
118
134
  fragment.appendChild(this.collapseItem(native));
119
135
  } else if (!isAppend) {
120
136
  fragment.appendChild(native);
@@ -130,33 +146,32 @@ class MenuItem extends WJElement {
130
146
  this.addEventListener("mousemove", this.dispatchMove);
131
147
  this.addEventListener("wj-popup:reposition", this.dispatchReposition);
132
148
  event.addListener(this, "mouseover", null, (e) => {
133
- if (this.hasAttribute("manual") || this.variant === "NAV" && !this.collapse)
134
- return;
135
- e.stopPropagation();
136
- this.showSubmenu();
137
- this.focus();
149
+ if (this.collapse || this.variant === "CONTEXT" && this.hasSubmenu) {
150
+ if (this.hasAttribute("manual") || this.variant === "NAV" && this.collapse)
151
+ return;
152
+ this.submenuActivated(e);
153
+ e.stopPropagation();
154
+ this.showSubmenu();
155
+ this.focus();
156
+ }
138
157
  });
139
158
  event.addListener(this, "focusout", null, (e) => {
140
- if (e.relatedTarget && this.contains(e.relatedTarget) || this.variant === "NAV" && !this.collapse) {
141
- return;
159
+ if (this.collapse || this.variant === "CONTEXT" && this.hasSubmenu) {
160
+ console.log("SOM TU:");
161
+ if (e.relatedTarget && this.contains(e.relatedTarget) || this.variant === "NAV" && !this.collapse) {
162
+ return;
163
+ }
164
+ this.submenuActivated(e);
165
+ this.hideSubmenu();
142
166
  }
143
- this.hideSubmenu();
144
167
  });
145
- if (!this.collapse && this.variant === "NAV" && this.hasSubmenu) {
146
- event.addListener(this, "click", null, (e) => {
147
- let submenuElements = this.submenu.assignedElements({ flatten: true })[0];
148
- if (!submenuElements.hasAttribute("active")) {
149
- submenuElements.setAttribute("active", "");
150
- } else {
151
- if (this === e.target)
152
- submenuElements.removeAttribute("active");
153
- }
168
+ event.addListener(this, "click", null, (e) => {
169
+ if (!this.collapse && this.variant === "NAV" && this.hasSubmenu) {
170
+ this.submenuActivated(e);
171
+ this.hideSubmenu();
154
172
  e.stopPropagation();
155
- });
156
- } else {
157
- event.addListener(this, "click", null, (e) => {
158
- });
159
- }
173
+ }
174
+ });
160
175
  }
161
176
  collapseItem(native) {
162
177
  let tooltip = document.createElement("wj-tooltip");
@@ -167,6 +182,7 @@ class MenuItem extends WJElement {
167
182
  return tooltip;
168
183
  }
169
184
  showSubmenu() {
185
+ console.log("SHOW SUBMENU", this.hasSubmenu);
170
186
  this.tabIndex = -1;
171
187
  if (this.hasSubmenu) {
172
188
  this.popup.setAttribute("active", "");
@@ -175,6 +191,7 @@ class MenuItem extends WJElement {
175
191
  }
176
192
  }
177
193
  hideSubmenu() {
194
+ console.log("HIDE SUBMENU", this);
178
195
  this.tabIndex = 0;
179
196
  if (this.hasSubmenu) {
180
197
  this.popup.removeAttribute("active");
@@ -182,8 +199,22 @@ class MenuItem extends WJElement {
182
199
  this.native.classList.remove("expanded-submenu");
183
200
  }
184
201
  }
202
+ submenuActivated(e) {
203
+ if (this.hasSubmenu) {
204
+ let submenuElements = this.submenu.assignedElements({ flatten: true })[0];
205
+ if (!submenuElements.hasAttribute("active")) {
206
+ submenuElements.setAttribute("active", "");
207
+ } else {
208
+ if (this === e.target)
209
+ submenuElements.removeAttribute("active");
210
+ }
211
+ }
212
+ }
213
+ beforeDisconnect() {
214
+ this.context.innerHTML = "";
215
+ }
185
216
  }
186
- customElements.get("wj-menu-item") || window.customElements.define("wj-menu-item", MenuItem);
217
+ WJElement.define("wj-menu-item", MenuItem);
187
218
  export {
188
- MenuItem
219
+ MenuItem as default
189
220
  };
@@ -30,7 +30,7 @@ class MenuLabel extends WJElement {
30
30
  return fragment;
31
31
  }
32
32
  }
33
- customElements.get("wj-menu-label") || window.customElements.define("wj-menu-label", MenuLabel);
33
+ WJElement.define("wj-menu-label", MenuLabel);
34
34
  export {
35
- MenuLabel
35
+ MenuLabel as default
36
36
  };
package/dist/wj-menu.js CHANGED
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import WJElement from "./wj-element.js";
8
- const styles = "/*\n[ Wj Menu ]\n*/\n:host {\n --wj-menu-background: var(--wj-background);\n --wj-menu-border-width: 1px;\n --wj-menu-border-style: solid;\n --wj-menu-border-color: var(--wj-border-color);\n --wj-menu-border-radius: 4px;\n --wj-menu-padding-top: .5rem;\n --wj-menu-padding-bottom: .5rem;\n --wj-menu-padding-inline: 0;\n --wj-menu-margin-top: ;\n --wj-menu-margin-bottom: 0;\n --wj-menu-margin-inline: 0;\n --wj-menu-z-index: 900;\n display: none;\n background: var(--wj-menu-background);\n position: relative;\n border-width: var(--wj-menu-border-width);\n border-style: var(--wj-menu-border-style);\n border-color: var(--wj-menu-border-color);\n z-index: var(--wj-menu-z-index);\n border-radius: var(--wj-border-radius-small);\n padding-top: var(--wj-menu-padding-top);\n padding-bottom: var(--wj-menu-padding-bottom);\n padding-inline: var(--wj-menu-padding-inline);\n margin-top: var(--wj-menu-margin-top);\n margin-bottom: var(--wj-menu-margin-bottom);\n margin-inline: var(--wj-menu-margin-inline);\n overflow: auto;\n overscroll-behavior: none;\n}\n:host .native-menu {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n:host .native-menu ::slotted(wj-button) {\n margin: 0;\n}\n\n:host(.wj-menu-collapse) {\n max-width: 70px !important;\n}\n\n:host([variant=context]) {\n display: block !important;\n margin-left: var(--wj-menu-submenu-offset);\n}\n\n:host([variant=megamenu]) .native-menu {\n flex-direction: row;\n align-items: end;\n flex-wrap: nowrap;\n}\n:host([variant=megamenu]) .native-menu .check-icon {\n display: none;\n}\n\n:host([active]) {\n display: flex !important;\n}";
8
+ const styles = "/*\n[ Wj Menu ]\n*/\n:host {\n --wj-menu-background: var(--wj-background);\n --wj-menu-border-width: 1px;\n --wj-menu-border-style: solid;\n --wj-menu-border-color: var(--wj-border-color);\n --wj-menu-border-radius: var(--wj-border-radius-small);\n --wj-menu-padding-top: .5rem;\n --wj-menu-padding-bottom: .5rem;\n --wj-menu-padding-inline: 0;\n --wj-menu-margin-top: ;\n --wj-menu-margin-bottom: 0;\n --wj-menu-margin-inline: 0;\n --wj-menu-collapse-width: 65px;\n display: none;\n background: var(--wj-menu-background);\n position: relative;\n border-width: var(--wj-menu-border-width);\n border-style: var(--wj-menu-border-style);\n border-color: var(--wj-menu-border-color);\n z-index: var(--wj-menu-z-index, 8);\n border-radius: var(--wj-menu-border-radius);\n padding-top: var(--wj-menu-padding-top);\n padding-bottom: var(--wj-menu-padding-bottom);\n padding-inline: var(--wj-menu-padding-inline);\n margin-top: var(--wj-menu-margin-top);\n margin-bottom: var(--wj-menu-margin-bottom);\n margin-inline: var(--wj-menu-margin-inline);\n overflow: auto;\n overscroll-behavior: none;\n}\n:host .native-menu {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n:host .native-menu ::slotted(wj-button) {\n margin: 0;\n}\n\n:host(.wj-menu-collapse) {\n width: var(--wj-menu-collapse-width);\n}\n\n:host([variant=context]) {\n display: block !important;\n margin-left: var(--wj-menu-submenu-offset);\n}\n\n:host([variant=megamenu]) .native-menu {\n flex-direction: row;\n align-items: end;\n flex-wrap: nowrap;\n}\n:host([variant=megamenu]) .native-menu .check-icon {\n display: none;\n}\n\n:host([active]) {\n display: flex !important;\n}";
9
9
  class Menu extends WJElement {
10
10
  constructor() {
11
11
  super();
@@ -32,8 +32,16 @@ class Menu extends WJElement {
32
32
  fragment.appendChild(native);
33
33
  return fragment;
34
34
  }
35
+ afterDraw() {
36
+ Array.from(this.children).forEach((child) => {
37
+ child.refresh();
38
+ });
39
+ }
40
+ beforeDisconnect() {
41
+ this.context.innerHTML = "";
42
+ }
35
43
  }
36
- customElements.get("wj-menu") || window.customElements.define("wj-menu", Menu);
44
+ WJElement.define("wj-menu", Menu);
37
45
  export {
38
- Menu
46
+ Menu as default
39
47
  };
package/dist/wj-option.js CHANGED
@@ -52,7 +52,7 @@ class Option extends WJElement {
52
52
  event.addListener(this, "click", "wj:option-change");
53
53
  }
54
54
  }
55
- customElements.get("wj-option") || window.customElements.define("wj-option", Option);
55
+ WJElement.define("wj-option", Option);
56
56
  export {
57
- Option
57
+ Option as default
58
58
  };
@@ -37,7 +37,7 @@ class Options extends WJElement {
37
37
  return data;
38
38
  }
39
39
  }
40
- customElements.get("wj-options") || window.customElements.define("wj-options", Options);
40
+ WJElement.define("wj-options", Options);
41
41
  export {
42
- Options
42
+ Options as default
43
43
  };
package/dist/wj-popup.js CHANGED
@@ -1454,7 +1454,7 @@ class Popup extends WJElement {
1454
1454
  event.removeElement(this.anchorEl);
1455
1455
  }
1456
1456
  }
1457
- customElements.get("wj-popup") || window.customElements.define("wj-popup", Popup);
1457
+ WJElement.define("wj-popup", Popup);
1458
1458
  export {
1459
- Popup
1459
+ Popup as default
1460
1460
  };
@@ -127,7 +127,7 @@ class ProgressBar extends WJElement {
127
127
  return this.getCircleDasharray(radius) * ((100 - progress) / 100);
128
128
  }
129
129
  }
130
- customElements.get("wj-progress-bar") || window.customElements.define("wj-progress-bar", ProgressBar);
130
+ WJElement.define("wj-progress-bar", ProgressBar);
131
131
  export {
132
- ProgressBar
132
+ ProgressBar as default
133
133
  };
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import WJElement from "./wj-element.js";
8
- import { Radio } from "./wj-radio.js";
8
+ import Radio from "./wj-radio.js";
9
9
  const styles = "/*\n[ WJ Radio Group ]\n*/\n.wj-inline {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 0.5rem;\n}";
10
10
  class RadioGroup extends WJElement {
11
11
  constructor() {
@@ -58,7 +58,7 @@ class RadioGroup extends WJElement {
58
58
  return Array.from(this.childNodes);
59
59
  }
60
60
  }
61
- customElements.get("wj-radio-group") || window.customElements.define("wj-radio-group", RadioGroup);
61
+ WJElement.define("wj-radio-group", RadioGroup);
62
62
  export {
63
- RadioGroup
63
+ RadioGroup as default
64
64
  };
package/dist/wj-radio.js CHANGED
@@ -65,7 +65,7 @@ class Radio extends WJElement {
65
65
  event.removeElement(this);
66
66
  }
67
67
  }
68
- customElements.get("wj-radio") || window.customElements.define("wj-radio", Radio);
68
+ WJElement.define("wj-radio", Radio);
69
69
  export {
70
- Radio
70
+ Radio as default
71
71
  };
package/dist/wj-rate.js CHANGED
@@ -170,7 +170,7 @@ class Rate extends WJElement {
170
170
  return Math.ceil(numberToRound * multiplier) / multiplier;
171
171
  }
172
172
  }
173
- customElements.get("wj-rate") || window.customElements.define("wj-rate", Rate);
173
+ WJElement.define("wj-rate", Rate);
174
174
  export {
175
- Rate
175
+ Rate as default
176
176
  };
@@ -67,7 +67,7 @@ class RelativeTime extends WJElement {
67
67
  return regex.test(str);
68
68
  }
69
69
  }
70
- customElements.get("wj-relative-time") || window.customElements.define("wj-relative-time", RelativeTime);
70
+ WJElement.define("wj-relative-time", RelativeTime);
71
71
  export {
72
- RelativeTime
72
+ RelativeTime as default
73
73
  };