wj-elements 0.1.160 → 0.1.162

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 (41) hide show
  1. package/dist/{infinite-scroll.element-Cj53cbpC.js → infinite-scroll.element-DXzh2umi.js} +4 -2
  2. package/dist/{infinite-scroll.element-Cj53cbpC.js.map → infinite-scroll.element-DXzh2umi.js.map} +1 -1
  3. package/dist/light.css +14 -1
  4. package/dist/packages/wje-accordion/accordion.test.d.ts +0 -0
  5. package/dist/packages/wje-color-picker/color-picker.test.d.ts +1 -0
  6. package/dist/packages/wje-dialog/dialog.element.d.ts +11 -0
  7. package/dist/packages/wje-element/element.d.ts +1 -1
  8. package/dist/packages/wje-element/service/universal-service.d.ts +6 -6
  9. package/dist/packages/wje-options/options.element.d.ts +38 -5
  10. package/dist/packages/wje-select/select.element.d.ts +81 -12
  11. package/dist/packages/wje-stepper/stepper.element.d.ts +1 -0
  12. package/dist/packages/wje-store/pubsub.d.ts +5 -4
  13. package/dist/packages/wje-tab/tab.element.d.ts +23 -0
  14. package/dist/packages/wje-tab-group/tab-group.element.d.ts +5 -0
  15. package/dist/wje-breadcrumb.js +0 -2
  16. package/dist/wje-breadcrumb.js.map +1 -1
  17. package/dist/wje-copy-button.js +0 -1
  18. package/dist/wje-copy-button.js.map +1 -1
  19. package/dist/wje-dialog.js +19 -3
  20. package/dist/wje-dialog.js.map +1 -1
  21. package/dist/wje-element.js +17 -28
  22. package/dist/wje-element.js.map +1 -1
  23. package/dist/wje-icon-picker.js +1 -1
  24. package/dist/wje-infinite-scroll.js +1 -1
  25. package/dist/wje-master.js +1 -1
  26. package/dist/wje-options.js +48 -16
  27. package/dist/wje-options.js.map +1 -1
  28. package/dist/wje-select.js +32 -3
  29. package/dist/wje-select.js.map +1 -1
  30. package/dist/wje-split-view.js +0 -10
  31. package/dist/wje-split-view.js.map +1 -1
  32. package/dist/wje-stepper.js +52 -36
  33. package/dist/wje-stepper.js.map +1 -1
  34. package/dist/wje-store.js +7 -6
  35. package/dist/wje-store.js.map +1 -1
  36. package/dist/wje-tab-group.js +71 -12
  37. package/dist/wje-tab-group.js.map +1 -1
  38. package/dist/wje-tab-panel.js +1 -1
  39. package/dist/wje-tab.js +146 -1
  40. package/dist/wje-tab.js.map +1 -1
  41. package/package.json +1 -1
package/dist/wje-tab.js CHANGED
@@ -2,7 +2,113 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import WJElement, { event } from "./wje-element.js";
5
- const styles = "/*\n[ WJ Tab ]\n*/\n\n:host {\n display: block;\n position: relative;\n .native-tab {\n display: flex;\n align-items: center;\n white-space: nowrap;\n font-family: var(--wje-tab-font-family);\n font-size: var(--wje-tab-font-size);\n letter-spacing: var(--wje-tab-letter-spacing);\n text-transform: var(--wje-tab-text-transfrom);\n font-weight: var(--wje-tab-font-weight);\n text-decoration: none;\n padding-inline: var(--wje-tab-padding-inline);\n padding-top: var(--wje-tab-padding-top);\n padding-bottom: var(--wje-tab-padding-bottom);\n border-radius: var(--wje-tab-border-radius);\n color: var(--wje-color);\n line-height: var(--wje-tab-line-height);\n & > svg {\n inline-size: 1.5em;\n pointer-events: none;\n }\n\n &:hover {\n background: var(--wje-tab-color-hover);\n &:after {\n display: block;\n }\n }\n\n &:after {\n content: ' ';\n display: none;\n block-size: 0.15rem;\n writing-mode: var(--wje-tab-writing-mode);\n background: var(--wje-tab-color-active);\n position: absolute;\n bottom: var(--wje-tab-bottom);\n left: var(--wje-tab-start);\n right: var(--wje-tab-end);\n top: var(--wje-tab-top);\n }\n }\n}\n\n:host([disabled]) a {\n opacity: 0.5;\n cursor: not-allowed;\n background: inherit;\n &:after {\n display: none;\n }\n}\n\n:host([active]) a:after {\n display: block;\n}\n";
5
+ import { b as bindRouterLinks } from "./router-links-CJnOdbas.js";
6
+ const styles = `/*
7
+ [ WJ Tab ]
8
+ */
9
+
10
+ :host(:not([slot="more"])) {
11
+ display: block;
12
+ position: relative;
13
+ .native-tab {
14
+ display: flex;
15
+ align-items: center;
16
+ white-space: nowrap;
17
+ font-family: var(--wje-tab-font-family);
18
+ font-size: var(--wje-tab-font-size);
19
+ letter-spacing: var(--wje-tab-letter-spacing);
20
+ text-transform: var(--wje-tab-text-transfrom);
21
+ font-weight: var(--wje-tab-font-weight);
22
+ text-decoration: none;
23
+ padding-inline: var(--wje-tab-padding-inline);
24
+ padding-top: var(--wje-tab-padding-top);
25
+ padding-bottom: var(--wje-tab-padding-bottom);
26
+ border-radius: var(--wje-tab-border-radius);
27
+ color: var(--wje-color);
28
+ line-height: var(--wje-tab-line-height);
29
+ & > svg {
30
+ inline-size: 1.5em;
31
+ pointer-events: none;
32
+ }
33
+
34
+ &:hover {
35
+ background: var(--wje-tab-color-hover);
36
+ &:after {
37
+ display: block;
38
+ }
39
+ }
40
+
41
+ &:after {
42
+ content: ' ';
43
+ display: none;
44
+ block-size: 0.15rem;
45
+ writing-mode: var(--wje-tab-writing-mode);
46
+ background: var(--wje-tab-color-active);
47
+ position: absolute;
48
+ bottom: var(--wje-tab-bottom);
49
+ left: var(--wje-tab-start);
50
+ right: var(--wje-tab-end);
51
+ top: var(--wje-tab-top);
52
+ }
53
+ }
54
+ }
55
+
56
+ :host([slot="more"]) {
57
+ --wje-menu-item-safe-triangle-cursor-x: 0;
58
+ --wje-menu-item-safe-triangle-cursor-y: 0;
59
+ --wje-menu-item-safe-triangle-submenu-start-x: 0;
60
+ --wje-menu-item-safe-triangle-submenu-start-y: 0;
61
+ --wje-menu-item-safe-triangle-submenu-end-x: 0;
62
+ --wje-menu-item-safe-triangle-submenu-end-y: 0;
63
+
64
+ display: block;
65
+ .native-tab {
66
+ background: var(--wje-menu-item-background);
67
+ position: relative;
68
+ display: block;
69
+ flex-wrap: nowrap;
70
+ align-items: center;
71
+ justify-content: center;
72
+ color: var(--wje-menu-item-color);
73
+ padding-top: var(--wje-menu-item-padding-top);
74
+ padding-bottom: var(--wje-menu-item-padding-bottom);
75
+ padding-inline: var(--wje-spacing-large);
76
+ transition: var(--wje-transition-fast) fill;
77
+ user-select: none;
78
+ white-space: nowrap;
79
+ cursor: pointer;
80
+ text-decoration: none;
81
+
82
+ &:hover {
83
+ color: var(--wje-menu-item-color-hover);
84
+ background: var(--wje-menu-item-background-hover);
85
+ }
86
+
87
+ &:focus {
88
+ color: var(--wje-menu-item-color-focus);
89
+ background: var(--wje-menu-item-background-focus);
90
+ }
91
+
92
+ &:active {
93
+ color: var(--wje-menu-item-color-active);
94
+ background: var(--wje-menu-item-background-active);
95
+ }
96
+ }
97
+ }
98
+
99
+ :host([disabled]) a {
100
+ opacity: 0.5;
101
+ cursor: not-allowed;
102
+ background: inherit;
103
+ &:after {
104
+ display: none;
105
+ }
106
+ }
107
+
108
+ :host(:not([slot="more"]).active) a:after {
109
+ display: block;
110
+ }
111
+ `;
6
112
  class Tab extends WJElement {
7
113
  /**
8
114
  * Creates an instance of Tab.
@@ -14,6 +120,36 @@ class Tab extends WJElement {
14
120
  */
15
121
  __publicField(this, "className", "Tab");
16
122
  this.last = false;
123
+ this._hasPanel = false;
124
+ }
125
+ /**
126
+ * Sets the panel attribute to the specified value.
127
+ * @param {string} value The value to set for the panel attribute.
128
+ */
129
+ set panel(value) {
130
+ this.setAttribute("panel", value);
131
+ }
132
+ /**
133
+ * Retrieves the value of the 'panel' attribute of the element.
134
+ * @returns {string|null} Returns the 'panel' attribute value if it exists; otherwise, returns null.
135
+ */
136
+ get panel() {
137
+ return this.getAttribute("panel") || null;
138
+ }
139
+ /**
140
+ * Sets the value of the 'route' attribute for the current object.
141
+ * @param {string} value The new value to set for the 'route' attribute.
142
+ */
143
+ set route(value) {
144
+ this.setAttribute("route", value);
145
+ }
146
+ /**
147
+ * Retrieves the value of the 'route' attribute.
148
+ * If the 'route' attribute is not set, it returns null.
149
+ * @returns {string|null} The value of the 'route' attribute or null if not set.
150
+ */
151
+ get route() {
152
+ return this.getAttribute("route") || null;
17
153
  }
18
154
  /**
19
155
  * Returns the CSS styles for the component.
@@ -28,6 +164,7 @@ class Tab extends WJElement {
28
164
  */
29
165
  setupAttributes() {
30
166
  this.isShadowRoot = "open";
167
+ this.setAttribute("active-class", "active");
31
168
  }
32
169
  /**
33
170
  * Draws the component for the tab.
@@ -49,8 +186,16 @@ class Tab extends WJElement {
49
186
  * // @fires wje-tab:change - Dispatched when the component is clicked, indicating a tab change.
50
187
  */
51
188
  afterDraw() {
189
+ this.unbindRouterLinks = bindRouterLinks(this.parentElement, { selector: false });
52
190
  event.addListener(this, "click", "wje-tab:change");
53
191
  }
192
+ /**
193
+ * Cleans up before the component is disconnected.
194
+ */
195
+ beforeDisconnect() {
196
+ var _a;
197
+ (_a = this.unbindRouterLinks) == null ? void 0 : _a.call(this);
198
+ }
54
199
  }
55
200
  Tab.define("wje-tab", Tab);
56
201
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"wje-tab.js","sources":["../packages/wje-tab/tab.element.js","../packages/wje-tab/tab.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Tab` is a custom web component that represents a tab.\n * @summary This element represents a tab.\n * @documentation https://elements.webjet.sk/components/tab\n * @status stable\n * @augments {WJElement}\n * @cssproperty [--wje-tab-text-transform=uppercase] - The text transformation for the tab (e.g., uppercase, lowercase).\n * @cssproperty [--wje-tab-font-weight=500] - The font weight of the tab text.\n * @cssproperty [--wje-tab-letter-spacing=0.06em] - The letter spacing of the tab text.\n * @cssproperty [--wje-tab-padding-inline=1rem] - The horizontal padding of the tab.\n * @cssproperty [--wje-tab-padding-top=.75rem] - The top padding of the tab text.\n * @cssproperty [--wje-tab-padding-bottom=.75rem] - The bottom padding of the tab text.\n * @cssproperty [--wje-tab-color-active=var(--wje-color-primary-11)] - The text color of the active tab.\n * @cssproperty [--wje-tab-color-hover=var(--wje-color-primary-1)] - The text color of the tab when hovered.\n * //@fires wje-tab:change - Dispatched when the tab is changed.\n * @tag wje-tab\n */\nexport default class Tab extends WJElement {\n /**\n * Creates an instance of Tab.\n */\n constructor() {\n super();\n\n /**\n * Indicates whether this is the last tab.\n * @type {boolean}\n */\n this.last = false;\n }\n\n /**\n * The class name for the component.\n */\n className = 'Tab';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the component for the tab.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let slot = document.createElement('slot');\n\n let a = document.createElement('a');\n a.setAttribute('href', '#' + this.panel);\n a.setAttribute('part', 'native');\n a.classList.add('native-tab');\n a.appendChild(slot);\n\n fragment.appendChild(a);\n\n return fragment;\n }\n\n /**\n * Sets up event listeners after the component is rendered.\n * // @fires wje-tab:change - Dispatched when the component is clicked, indicating a tab change.\n */\n afterDraw() {\n event.addListener(this, 'click', 'wje-tab:change');\n }\n}\n","import Tab from './tab.element.js';\n\nexport default Tab;\n\nTab.define('wje-tab', Tab);\n"],"names":[],"mappings":";;;;;AAoBe,MAAM,YAAY,UAAU;AAAA;AAAA;AAAA;AAAA,EAIvC,cAAc;AACV,UAAO;AAYX;AAAA;AAAA;AAAA,qCAAY;AANR,SAAK,OAAO;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,OAAO;AACH,QAAI,WAAW,SAAS,uBAAwB;AAEhD,QAAI,OAAO,SAAS,cAAc,MAAM;AAExC,QAAI,IAAI,SAAS,cAAc,GAAG;AAClC,MAAE,aAAa,QAAQ,MAAM,KAAK,KAAK;AACvC,MAAE,aAAa,QAAQ,QAAQ;AAC/B,MAAE,UAAU,IAAI,YAAY;AAC5B,MAAE,YAAY,IAAI;AAElB,aAAS,YAAY,CAAC;AAEtB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,YAAY;AACR,UAAM,YAAY,MAAM,SAAS,gBAAgB;AAAA,EACzD;AACA;AC9EA,IAAI,OAAO,WAAW,GAAG;"}
1
+ {"version":3,"file":"wje-tab.js","sources":["../packages/wje-tab/tab.element.js","../packages/wje-tab/tab.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport { bindRouterLinks } from 'slick-router/middlewares/router-links.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Tab` is a custom web component that represents a tab.\n * @summary This element represents a tab.\n * @documentation https://elements.webjet.sk/components/tab\n * @status stable\n * @augments {WJElement}\n * @cssproperty [--wje-tab-text-transform=uppercase] - The text transformation for the tab (e.g., uppercase, lowercase).\n * @cssproperty [--wje-tab-font-weight=500] - The font weight of the tab text.\n * @cssproperty [--wje-tab-letter-spacing=0.06em] - The letter spacing of the tab text.\n * @cssproperty [--wje-tab-padding-inline=1rem] - The horizontal padding of the tab.\n * @cssproperty [--wje-tab-padding-top=.75rem] - The top padding of the tab text.\n * @cssproperty [--wje-tab-padding-bottom=.75rem] - The bottom padding of the tab text.\n * @cssproperty [--wje-tab-color-active=var(--wje-color-primary-11)] - The text color of the active tab.\n * @cssproperty [--wje-tab-color-hover=var(--wje-color-primary-1)] - The text color of the tab when hovered.\n * //@fires wje-tab:change - Dispatched when the tab is changed.\n * @tag wje-tab\n */\nexport default class Tab extends WJElement {\n /**\n * Creates an instance of Tab.\n */\n constructor() {\n super();\n\n /**\n * Indicates whether this is the last tab.\n * @type {boolean}\n */\n this.last = false;\n this._hasPanel = false;\n }\n\n /**\n * Sets the panel attribute to the specified value.\n * @param {string} value The value to set for the panel attribute.\n */\n set panel(value) {\n this.setAttribute('panel', value);\n }\n\n /**\n * Retrieves the value of the 'panel' attribute of the element.\n * @returns {string|null} Returns the 'panel' attribute value if it exists; otherwise, returns null.\n */\n get panel() {\n return this.getAttribute('panel') || null;\n }\n\n /**\n * Sets the value of the 'route' attribute for the current object.\n * @param {string} value The new value to set for the 'route' attribute.\n */\n set route(value) {\n this.setAttribute('route', value);\n }\n\n /**\n * Retrieves the value of the 'route' attribute.\n * If the 'route' attribute is not set, it returns null.\n * @returns {string|null} The value of the 'route' attribute or null if not set.\n */\n get route() {\n return this.getAttribute('route') || null;\n }\n\n /**\n * The class name for the component.\n */\n className = 'Tab';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.setAttribute('active-class', 'active');\n }\n\n /**\n * Draws the component for the tab.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let slot = document.createElement('slot');\n\n let a = document.createElement('a');\n a.setAttribute('href', '#' + this.panel);\n a.setAttribute('part', 'native');\n a.classList.add('native-tab');\n a.appendChild(slot);\n\n fragment.appendChild(a);\n\n return fragment;\n }\n\n /**\n * Sets up event listeners after the component is rendered.\n * // @fires wje-tab:change - Dispatched when the component is clicked, indicating a tab change.\n */\n afterDraw() {\n this.unbindRouterLinks = bindRouterLinks(this.parentElement, { selector: false });\n event.addListener(this, 'click', 'wje-tab:change');\n }\n\n /**\n * Cleans up before the component is disconnected.\n */\n beforeDisconnect() {\n this.unbindRouterLinks?.();\n }\n}\n","import Tab from './tab.element.js';\n\nexport default Tab;\n\nTab.define('wje-tab', Tab);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AAAA;AAAA;AAAA;AAAA,EAKI,mBAAmB;;AACf,eAAK,sBAAL;AAAA,EACR;AACA;AC1HA,IAAI,OAAO,WAAW,GAAG;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wj-elements",
3
3
  "description": "WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development.",
4
- "version": "0.1.160",
4
+ "version": "0.1.162",
5
5
  "homepage": "https://github.com/lencys/wj-elements",
6
6
  "author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
7
7
  "license": "MIT",