wj-elements 0.1.191 → 0.1.192
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/dark.css +4 -0
- package/dist/light.css +9 -0
- package/dist/packages/index.d.ts +1 -1
- package/dist/packages/wje-sliding-container/sliding-container.d.ts +2 -0
- package/dist/packages/wje-sliding-container/sliding-container.element.d.ts +265 -0
- package/dist/wje-chip.js +1 -1
- package/dist/wje-master.js +36 -36
- package/dist/wje-select.js +10 -0
- package/dist/wje-select.js.map +1 -1
- package/dist/wje-sliding-container.js +195 -110
- package/dist/wje-sliding-container.js.map +1 -1
- package/package.json +1 -1
package/dist/dark.css
CHANGED
|
@@ -218,6 +218,10 @@
|
|
|
218
218
|
--wje-select-background: var(--wje-color-contrast-0);
|
|
219
219
|
--wje-select-color: var(--wje-color);
|
|
220
220
|
|
|
221
|
+
/* Sliding - Container */
|
|
222
|
+
--wje-sliding-container-background: transparent;
|
|
223
|
+
--wje-sliding-container-box-shadow: none;
|
|
224
|
+
|
|
221
225
|
/* Tab */
|
|
222
226
|
--wje-tab-color-active: var(--wje-color-primary-11);
|
|
223
227
|
--wje-tab-color-hover: var(--wje-color-primary-1);
|
package/dist/light.css
CHANGED
|
@@ -316,6 +316,10 @@
|
|
|
316
316
|
--wje-checkbox-border-radius: var(--wje-border-radius-medium);
|
|
317
317
|
|
|
318
318
|
/* Chip */
|
|
319
|
+
--wje-chip-background: var(--wje-color-contrast-3);
|
|
320
|
+
--wje-chip-color: var(--wje-color-contrast-11);
|
|
321
|
+
--wje-chip-background-hover: var(--wje-color-contrast-4);
|
|
322
|
+
--wje-chip-color-hover: var(--wje-color-contrast-11);
|
|
319
323
|
--wje-chip-border-radius: 100px;
|
|
320
324
|
--wje-chip-margin: 0;
|
|
321
325
|
|
|
@@ -525,6 +529,11 @@
|
|
|
525
529
|
--wje-select-find-margin-block: var(--wje-spacing-x-small);
|
|
526
530
|
--wje-select-find-width: calc(100% - var(--wje-select-find-margin-inline) * 2);
|
|
527
531
|
|
|
532
|
+
/* Sliding - Container */
|
|
533
|
+
--wje-sliding-container-background: transparent;
|
|
534
|
+
--wje-sliding-container-box-shadow: none;
|
|
535
|
+
--wje-sliding-container-border-radius: var(--wje-border-radius-large);
|
|
536
|
+
|
|
528
537
|
/* Status */
|
|
529
538
|
--wje-status-size: var(--wje-size-small);
|
|
530
539
|
|
package/dist/packages/index.d.ts
CHANGED
|
@@ -81,6 +81,7 @@ export { default as RouterOutlet } from './wje-router-outlet/router-outlet.js';
|
|
|
81
81
|
export { default as Row } from './wje-row/row.js';
|
|
82
82
|
export { default as Select } from './wje-select/select.js';
|
|
83
83
|
export { default as Slider } from './wje-slider/slider.js';
|
|
84
|
+
export { default as SlidingContainer } from './wje-sliding-container/sliding-container.js';
|
|
84
85
|
export { default as SplitView } from './wje-split-view/split-view.js';
|
|
85
86
|
export { default as Status } from './wje-status/status.js';
|
|
86
87
|
export { default as Step } from './wje-step/step.js';
|
|
@@ -100,7 +101,6 @@ export { default as Tooltip } from './wje-tooltip/tooltip.js';
|
|
|
100
101
|
export { default as Tree } from './wje-tree/tree.js';
|
|
101
102
|
export { default as TreeItem } from './wje-tree-item/tree-item.js';
|
|
102
103
|
export { default as VisuallyHidden } from './wje-visually-hidden/visually-hidden.js';
|
|
103
|
-
export { default as SlidingContainer } from '../experimental-packages/wje-sliding-container/sliding-container.js';
|
|
104
104
|
export { setBasePath, getBasePath } from './utils/base-path.js';
|
|
105
105
|
export { formatDate, toSafeDate } from './utils/date.js';
|
|
106
106
|
export { registerIconLibrary, unregisterIconLibrary } from './utils/icon-library.js';
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { default as WJElement } from '../wje-element/element.js';
|
|
2
|
+
/**
|
|
3
|
+
* @summary SlidingContainer is a custom web component that extends WJElement.
|
|
4
|
+
* @documentation https://elements.webjet.sk/components/SlidingContainer
|
|
5
|
+
* @status stable
|
|
6
|
+
* @augments WJElement
|
|
7
|
+
* @csspart - Styles the element.
|
|
8
|
+
* @slot - The default slot for the SlidingContainer.
|
|
9
|
+
* @property {string} maxWidth - The maximum width of the SlidingContainer.
|
|
10
|
+
* @property {string} maxHeight - The maximum height of the SlidingContainer.
|
|
11
|
+
* @property {string} trigger - The trigger for the SlidingContainer.
|
|
12
|
+
* @property {string} direction - Specifies the sliding direction of the container (e.g., 'left' or 'right').
|
|
13
|
+
* @property {string} variant - Determines how the SlidingContainer behaves, such as 'over' or 'in-place'.
|
|
14
|
+
* @property {string} screenBreakPoint - The width (in pixels) at which the SlidingContainer switches to the "over" variant for smaller screens.
|
|
15
|
+
* @property {boolean} removeChildAfterClose - Removes the child after the SlidingContainer is closed.
|
|
16
|
+
* @property {string} animationDuration - Specifies the duration (in milliseconds) of the sliding animation.
|
|
17
|
+
* @property {string} animationEasing - Specifies the easing function used for the sliding animation (e.g., 'linear', 'ease-in', 'ease-out').
|
|
18
|
+
* @property {boolean} hasOpacity - Sets the opacity of the SlidingContainer.
|
|
19
|
+
* @tag wje-sliding-container
|
|
20
|
+
* @example
|
|
21
|
+
* <wje-sliding-container trigger="test-resize-container-event-right" id="left-in-place" direction="left" max-width="100px" max-height="100%">
|
|
22
|
+
* <wje-card>
|
|
23
|
+
* <wje-card-header>
|
|
24
|
+
* <wje-card-subtitle>CONTENT Subtitle</wje-card-subtitle>
|
|
25
|
+
* <wje-card-title>CONTENT Title</wje-card-title>
|
|
26
|
+
* </wje-card-header>
|
|
27
|
+
* <wje-card-content>
|
|
28
|
+
* CONTENT Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
29
|
+
* </wje-card-content>
|
|
30
|
+
* </wje-card>
|
|
31
|
+
* </wje-sliding-container>
|
|
32
|
+
*/
|
|
33
|
+
export default class SlidingContainer extends WJElement {
|
|
34
|
+
/**
|
|
35
|
+
* Returns the observed attributes for the component.
|
|
36
|
+
* @returns {string[]}
|
|
37
|
+
*/
|
|
38
|
+
static get observedAttributes(): string[];
|
|
39
|
+
/**
|
|
40
|
+
* Returns the CSS styles for the component.
|
|
41
|
+
* @static
|
|
42
|
+
* @returns {CSSStyleSheet}
|
|
43
|
+
*/
|
|
44
|
+
static get cssStyleSheet(): CSSStyleSheet;
|
|
45
|
+
_isOpen: boolean;
|
|
46
|
+
_lastCaller: EventTarget;
|
|
47
|
+
_resizeObserver: ResizeObserver;
|
|
48
|
+
/**
|
|
49
|
+
* Sets the 'variant' attribute to the specified value.
|
|
50
|
+
* @param {string} value The value to set for the 'variant' attribute.
|
|
51
|
+
*/
|
|
52
|
+
set variant(value: string);
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves the value of the "variant" attribute. If the attribute is not set,
|
|
55
|
+
* it returns the default value 'in-place'.
|
|
56
|
+
* @returns {string} The variant value or the default value 'in-place'.
|
|
57
|
+
*/
|
|
58
|
+
get variant(): string;
|
|
59
|
+
/**
|
|
60
|
+
* Sets the maximum width of an element by updating the 'max-width' attribute.
|
|
61
|
+
* @param {string} value The maximum width value to be set (e.g., '100px', '50%', etc.).
|
|
62
|
+
*/
|
|
63
|
+
set maxWidth(value: string);
|
|
64
|
+
/**
|
|
65
|
+
* Gets the maximum width value of the element.
|
|
66
|
+
* Retrieves the value of the 'max-width' attribute. If the attribute is not set, it defaults to 'auto'.
|
|
67
|
+
* @returns {string} The maximum width value of the element or 'auto' if the attribute is not defined.
|
|
68
|
+
*/
|
|
69
|
+
get maxWidth(): string;
|
|
70
|
+
/**
|
|
71
|
+
* Sets the maximum height for the element.
|
|
72
|
+
* @param {string} value The maximum height value to be applied to the element. This can include units such as "px", "em", "%", etc.
|
|
73
|
+
*/
|
|
74
|
+
set maxHeight(value: string);
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves the maximum height value of the element, or returns 'auto' if not set.
|
|
77
|
+
* @returns {string} The maximum height value or 'auto' if the attribute is not specified.
|
|
78
|
+
*/
|
|
79
|
+
get maxHeight(): string;
|
|
80
|
+
/**
|
|
81
|
+
* Sets the 'trigger' attribute for the element.
|
|
82
|
+
* @param {string} value The value to set for the 'trigger' attribute.
|
|
83
|
+
*/
|
|
84
|
+
set trigger(value: string);
|
|
85
|
+
/**
|
|
86
|
+
* Retrieves the value of the 'trigger' attribute. If the attribute is not set, it defaults to 'sliding-container'.
|
|
87
|
+
* @returns {string} The value of the 'trigger' attribute or the default value 'sliding-container' if not defined.
|
|
88
|
+
*/
|
|
89
|
+
get trigger(): string;
|
|
90
|
+
/**
|
|
91
|
+
* Sets the direction attribute for the element.
|
|
92
|
+
* @param {string} value The direction value to be assigned. Possible values are typically 'ltr' (left-to-right), 'rtl' (right-to-left), or 'auto'.
|
|
93
|
+
*/
|
|
94
|
+
set direction(value: string);
|
|
95
|
+
/**
|
|
96
|
+
* Retrieves the direction attribute of the instance.
|
|
97
|
+
* If the direction attribute is not set, it defaults to 'right'.
|
|
98
|
+
* @returns {string} The value of the direction attribute or 'right' if not set.
|
|
99
|
+
*/
|
|
100
|
+
get direction(): string;
|
|
101
|
+
/**
|
|
102
|
+
* Sets the value of the `remove-child-after-close` attribute.
|
|
103
|
+
* This attribute determines if a child element should be removed after a close operation.
|
|
104
|
+
* @param {boolean|string} value The value to set for the `remove-child-after-close` attribute. The value can be a boolean or a string representation of a boolean.
|
|
105
|
+
*/
|
|
106
|
+
set removeChildAfterClose(value: boolean | string);
|
|
107
|
+
/**
|
|
108
|
+
* Gets the value indicating whether the child element should be removed after closing.
|
|
109
|
+
*
|
|
110
|
+
* This property checks the presence of the 'remove-child-after-close' attribute on the element.
|
|
111
|
+
* Returns `false` if the attribute does not exist.
|
|
112
|
+
* @returns {boolean} True if the 'remove-child-after-close' attribute is present, otherwise false.
|
|
113
|
+
*/
|
|
114
|
+
get removeChildAfterClose(): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Sets the screen break point value to determine responsive behavior.
|
|
117
|
+
* @param {string} value The value to set as the screen break point.
|
|
118
|
+
*/
|
|
119
|
+
set screenBreakPoint(value: string);
|
|
120
|
+
/**
|
|
121
|
+
* Retrieves the value of the 'screen-break-point' attribute.
|
|
122
|
+
* @returns {string} The value of the 'screen-break-point' attribute.
|
|
123
|
+
*/
|
|
124
|
+
get screenBreakPoint(): string;
|
|
125
|
+
/**
|
|
126
|
+
* Sets the duration of the animation by updating the `animation-duration` attribute.
|
|
127
|
+
* @param {string} value The duration value for the animation, specified in a format
|
|
128
|
+
* such as seconds (e.g., "2s") or milliseconds (e.g., "200ms").
|
|
129
|
+
*/
|
|
130
|
+
set animationDuration(value: string);
|
|
131
|
+
/**
|
|
132
|
+
* Gets the animation duration for an element.
|
|
133
|
+
* It retrieves the value of the 'animation-duration' attribute if present; otherwise, it defaults to '500'.
|
|
134
|
+
* @returns {string} The value of the animation duration, either from the attribute or the default '500'.
|
|
135
|
+
*/
|
|
136
|
+
get animationDuration(): string;
|
|
137
|
+
/**
|
|
138
|
+
* Sets the easing function for the animation.
|
|
139
|
+
* @param {string} value The easing function to use for the animation. This can be any valid CSS timing function such as "ease", "linear", "ease-in", "ease-out", etc.
|
|
140
|
+
*/
|
|
141
|
+
set animationEasing(value: string);
|
|
142
|
+
/**
|
|
143
|
+
* Retrieves the easing function for the animation.
|
|
144
|
+
* @returns {string} The value of the 'animation-easing' attribute if set, otherwise defaults to 'linear'.
|
|
145
|
+
*/
|
|
146
|
+
get animationEasing(): string;
|
|
147
|
+
/**
|
|
148
|
+
* Determines if the element has an 'has-opacity' attribute.
|
|
149
|
+
* @returns {boolean} True if the element has the 'has-opacity' attribute, otherwise false.
|
|
150
|
+
*/
|
|
151
|
+
get hasOpacity(): boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Sets the value of the 'add-to-height' attribute.
|
|
154
|
+
* This attribute is used to modify or adjust the height dynamically.
|
|
155
|
+
* @param {string} value The value to be assigned to the 'add-to-height' attribute.
|
|
156
|
+
*/
|
|
157
|
+
set addToHeight(value: string);
|
|
158
|
+
/**
|
|
159
|
+
* Retrieves the value of the 'add-to-height' attribute from the element.
|
|
160
|
+
* If the attribute is not set, it defaults to '0'.
|
|
161
|
+
* @returns {string} The value of the 'add-to-height' attribute or '0' if the attribute is not present.
|
|
162
|
+
*/
|
|
163
|
+
get addToHeight(): string;
|
|
164
|
+
/**
|
|
165
|
+
* Determines whether the current state is open.
|
|
166
|
+
* @returns {boolean} True if the state is open, otherwise false.
|
|
167
|
+
*/
|
|
168
|
+
get isOpen(): boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Executes before drawing the element.
|
|
171
|
+
*/
|
|
172
|
+
beforeDraw(): void;
|
|
173
|
+
/**
|
|
174
|
+
* Draws the component.
|
|
175
|
+
* @param {object} context The context for drawing.
|
|
176
|
+
* @param {object} store The store for drawing.
|
|
177
|
+
* @param {object} params The parameters for drawing.
|
|
178
|
+
* @returns {DocumentFragment}
|
|
179
|
+
*/
|
|
180
|
+
draw(context: object, store: object, params: object): DocumentFragment;
|
|
181
|
+
transparentDiv: HTMLDivElement;
|
|
182
|
+
wrapperDiv: HTMLDivElement;
|
|
183
|
+
nativeElement: HTMLDivElement;
|
|
184
|
+
/**
|
|
185
|
+
* Performs actions after the element is drawn on the screen.
|
|
186
|
+
* Attaches an event listener to the document based on the specified trigger.
|
|
187
|
+
* Sets the variant to "over" if the document width is smaller than the screen break point.
|
|
188
|
+
* Calls the checkForVariant method with the current variant.
|
|
189
|
+
*/
|
|
190
|
+
afterDraw(): void;
|
|
191
|
+
/**
|
|
192
|
+
* Creates and returns a styled close button element with an icon,
|
|
193
|
+
* including an event listener to trigger the close method.
|
|
194
|
+
* @returns {HTMLElement} The close button element configured with styles, an icon, and event listener.
|
|
195
|
+
*/
|
|
196
|
+
getCloseButton(): HTMLElement;
|
|
197
|
+
/**
|
|
198
|
+
* Retrieves the parent element of the current element.
|
|
199
|
+
* If the parent element is not found, it attempts to find the root host element.
|
|
200
|
+
* @returns {Element|null} The parent element or the root host element if no parent exists. Returns null if neither is found.
|
|
201
|
+
*/
|
|
202
|
+
getParentElement(): Element | null;
|
|
203
|
+
/**
|
|
204
|
+
* Adjusts the position and dimensions of the current element based on the specified variant.
|
|
205
|
+
*
|
|
206
|
+
* The method handles modifications to the element's positioning style, aligns it relative to its parent,
|
|
207
|
+
* and manages alignment to its siblings based on the specified direction.
|
|
208
|
+
* @param {string} variant The variant to determine how the element should be updated. For example, when set to 'over', specific adjustments to the position and size are performed.
|
|
209
|
+
* @returns {void} No value is returned, the method modifies the element's style properties directly.
|
|
210
|
+
*/
|
|
211
|
+
checkForVariant(variant: string): void;
|
|
212
|
+
/**
|
|
213
|
+
* Triggers the event based on the target element.
|
|
214
|
+
* If the target element is different from the last caller, it refreshes the children by calling the `open` method.
|
|
215
|
+
* If the target element is the same as the last caller, it toggles the state by calling the `toggle` method.
|
|
216
|
+
* @param {Event} e The event object.
|
|
217
|
+
*/
|
|
218
|
+
triggerEvent: (e: Event) => Promise<void>;
|
|
219
|
+
/**
|
|
220
|
+
* Executes before the element is opened.
|
|
221
|
+
*/
|
|
222
|
+
beforeOpen(e: any): void;
|
|
223
|
+
/**
|
|
224
|
+
* Callback function called after the element is opened.
|
|
225
|
+
*/
|
|
226
|
+
afterOpen(e: any): void;
|
|
227
|
+
/**
|
|
228
|
+
* Executes before closing the element.
|
|
229
|
+
*/
|
|
230
|
+
beforeClose(e: any): void;
|
|
231
|
+
/**
|
|
232
|
+
* Callback function that is called after the container is closed.
|
|
233
|
+
*/
|
|
234
|
+
afterClose(e: any): void;
|
|
235
|
+
/**
|
|
236
|
+
* Animates the transition of elements with specified options, toggling the visibility and/or dimensions
|
|
237
|
+
* of the associated elements based on their current state.
|
|
238
|
+
*
|
|
239
|
+
* This method handles both forward and reverse animations for two elements (`transparentDiv` and `nativeElement`)
|
|
240
|
+
* with optional opacity changes. It ensures smooth transitioning by canceling any previous animations on the provided
|
|
241
|
+
* elements before initiating a new animation sequence.
|
|
242
|
+
* @returns {Promise<void>} A promise that resolves when the transition animation is completed.
|
|
243
|
+
*/
|
|
244
|
+
doAnimateTransition(): Promise<void>;
|
|
245
|
+
animation: any;
|
|
246
|
+
nativeAnimation: any;
|
|
247
|
+
/**
|
|
248
|
+
* Opens the sliding container by performing necessary preparatory and transitional operations.
|
|
249
|
+
* @param {Event} e The event that triggered the open operation.
|
|
250
|
+
* @returns {Promise<void>} A promise that resolves when the open operation, including animations and subsequent handlers, is complete.
|
|
251
|
+
*/
|
|
252
|
+
open(e: Event): Promise<void>;
|
|
253
|
+
/**
|
|
254
|
+
* Closes the sliding container and performs associated operations such as animations and event dispatches.
|
|
255
|
+
* @param {Event} e The event object associated with the close action.
|
|
256
|
+
* @returns {Promise<void>} A promise that resolves when the closing operation, including animations and child element removal, is completed.
|
|
257
|
+
*/
|
|
258
|
+
close(e: Event): Promise<void>;
|
|
259
|
+
/**
|
|
260
|
+
* Toggles the state between open and closed.
|
|
261
|
+
* @param {Event} e The event object triggering the toggle.
|
|
262
|
+
* @returns {Promise<void>} A promise that resolves once the toggle operation (open or close) is complete.
|
|
263
|
+
*/
|
|
264
|
+
toggle(e: Event): Promise<void>;
|
|
265
|
+
}
|
package/dist/wje-chip.js
CHANGED
|
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4
4
|
import WJElement from "./wje-element.js";
|
|
5
5
|
import { WjElementUtils } from "./element-utils.js";
|
|
6
6
|
import { event } from "./event.js";
|
|
7
|
-
const styles = "/*\n[ WJ Chip ]\n*/\n\n:host {\n display: inline-flex;\n --wje-chip-round-border-radius: var(--wje-border-radius-large);\n --wje-button-border-radius: var(--wje-chip-round-border-radius);\n}\n\n.native-chip {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n font-size: var(--wje-font-size);\n line-height: 1;\n letter-spacing: -0.006em;\n margin: 0;\n padding: 0 var(--wje-spacing-small);\n text-align: center;\n cursor: pointer;\n white-space: nowrap;\n text-shadow: none;\n box-shadow: none;\n border: 0 none;\n width: 100%;\n height: 28px;\n max-width: fit-content;\n position: relative;\n transition: width 0.15s cubic-bezier(0.4, 0, 0.2, 1);\n border-radius: var(--wje-border-radius-pill);\n overflow: hidden;\n vertical-align: middle;\n box-sizing: border-box;\n}\n\n:host(.focus) {\n box-shadow: none;\n}\n\n:host(.wje-active) .native-chip {\n border: 1px solid var(--wje-color-primary-11);\n background-color: var(--wje-color-contrast-3);\n color: var(--wje-color);\n}\n\n:host(:focus, :active:focus, .wje-active:focus) {\n outline: none !important;\n}\n\n:host([size='small']) .native-chip {\n font-size: var(--wje-font-size-small);\n height: 24px;\n padding: var(--wje-spacing-3x-small) var(--wje-spacing-x-small);\n wje-button {\n --wje-button-margin-inline: var(--wje-spacing-3x-small) calc(-1 * var(--wje-spacing-3x-small));\n }\n}\n\n:host([size='large']) .native-chip {\n font-size: var(--wje-font-size-medium);\n height: 34px;\n padding: var(--wje-spacing-x-small) var(--wje-spacing-small);\n\n}\n\n:host([round]) .native-chip {\n border-radius: var(--wje-chip-round-border-radius);\n}\n\n.check {\n display: none;\n}\n\n:host([active]) {\n .check {\n display: block;\n margin-inline: 4px 0;\n }\n}\n\n:host([disabled]) {\n opacity: 0.5;\n border: 0;\n pointer-events: none;\n cursor: not-allowed;\n}\n\n::slotted(wje-avatar) {\n width: 22px;\n height: 22px;\n}\n\n::slotted(wje-avatar:first-child) {\n margin-inline: -8px 8px;\n margin-top: -4px;\n margin-bottom: -4px;\n}\n\n::slotted(wje-icon:first-child) {\n margin: -4px 8px -4px -4px;\n}\n\n::slotted(wje-icon:last-child) {\n margin: -4px -4px -4px 8px;\n}\n\nslot[name='end'].has-content {\n display: block;\n margin-inline-start: 8px;\n}\n\nwje-button {\n /*--wje-button-border-radius: 50%;*/\n --wje-button-margin-inline: 0.25rem -0.5rem;\n --wje-padding-top: 0.15rem;\n --wje-padding-start: 0.15rem;\n --wje-padding-end: 0.15rem;\n --wje-padding-bottom: 0.15rem;\n}\n\n/*BG - TEXT*/\n.native-chip.wje-color-primary {\n background-color: var(--wje-color-primary-1);\n color: var(--wje-color-primary-9);\n}\n\n.native-chip.wje-color-complete {\n background-color: var(--wje-color-complete-1);\n color: var(--wje-color-complete-9);\n}\n\n.native-chip.wje-color-success {\n background-color: var(--wje-color-success-1);\n color: var(--wje-color-success-9);\n}\n\n.native-chip.wje-color-warning {\n background-color: var(--wje-color-warning-2);\n color: var(--wje-color-warning-11);\n}\n\n.native-chip.wje-color-danger {\n background-color: var(--wje-color-danger-1);\n color: var(--wje-color-danger-9);\n}\n\n.native-chip.wje-color-info {\n background-color: var(--wje-color-info-1);\n color: var(--wje-color-info-9);\n}\n\n
|
|
7
|
+
const styles = "/*\n[ WJ Chip ]\n*/\n\n:host {\n display: inline-flex;\n --wje-chip-round-border-radius: var(--wje-border-radius-large);\n --wje-button-border-radius: var(--wje-chip-round-border-radius);\n}\n\n.native-chip {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n font-size: var(--wje-font-size);\n line-height: 1;\n letter-spacing: -0.006em;\n margin: 0;\n padding: 0 var(--wje-spacing-small);\n text-align: center;\n cursor: pointer;\n white-space: nowrap;\n text-shadow: none;\n box-shadow: none;\n border: 0 none;\n width: 100%;\n height: 28px;\n max-width: fit-content;\n position: relative;\n transition: width 0.15s cubic-bezier(0.4, 0, 0.2, 1);\n border-radius: var(--wje-border-radius-pill);\n overflow: hidden;\n vertical-align: middle;\n box-sizing: border-box;\n background-color: var(--wje-chip-background);\n color: var(--wje-chip-color);\n &:hover {\n background-color: var(--wje-chip-background-hover);\n color: var(--wje-chip-color-hover);\n }\n}\n\n:host(.focus) {\n box-shadow: none;\n}\n\n:host(.wje-active) .native-chip {\n border: 1px solid var(--wje-color-primary-11);\n background-color: var(--wje-color-contrast-3);\n color: var(--wje-color);\n}\n\n:host(:focus, :active:focus, .wje-active:focus) {\n outline: none !important;\n}\n\n:host([size='small']) .native-chip {\n font-size: var(--wje-font-size-small);\n height: 24px;\n padding: var(--wje-spacing-3x-small) var(--wje-spacing-x-small);\n wje-button {\n --wje-button-margin-inline: var(--wje-spacing-3x-small) calc(-1 * var(--wje-spacing-3x-small));\n }\n}\n\n:host([size='large']) .native-chip {\n font-size: var(--wje-font-size-medium);\n height: 34px;\n padding: var(--wje-spacing-x-small) var(--wje-spacing-small);\n\n}\n\n:host([round]) .native-chip {\n border-radius: var(--wje-chip-round-border-radius);\n}\n\n.check {\n display: none;\n}\n\n:host([active]) {\n .check {\n display: block;\n margin-inline: 4px 0;\n }\n}\n\n:host([disabled]) {\n opacity: 0.5;\n border: 0;\n pointer-events: none;\n cursor: not-allowed;\n}\n\n::slotted(wje-avatar) {\n width: 22px;\n height: 22px;\n}\n\n::slotted(wje-avatar:first-child) {\n margin-inline: -8px 8px;\n margin-top: -4px;\n margin-bottom: -4px;\n}\n\n::slotted(wje-icon:first-child) {\n margin: -4px 8px -4px -4px;\n}\n\n::slotted(wje-icon:last-child) {\n margin: -4px -4px -4px 8px;\n}\n\nslot[name='end'].has-content {\n display: block;\n margin-inline-start: 8px;\n}\n\nwje-button {\n /*--wje-button-border-radius: 50%;*/\n --wje-button-margin-inline: 0.25rem -0.5rem;\n --wje-padding-top: 0.15rem;\n --wje-padding-start: 0.15rem;\n --wje-padding-end: 0.15rem;\n --wje-padding-bottom: 0.15rem;\n}\n\n/*BG - TEXT*/\n.native-chip.wje-color-primary {\n background-color: var(--wje-color-primary-1);\n color: var(--wje-color-primary-9);\n}\n\n.native-chip.wje-color-complete {\n background-color: var(--wje-color-complete-1);\n color: var(--wje-color-complete-9);\n}\n\n.native-chip.wje-color-success {\n background-color: var(--wje-color-success-1);\n color: var(--wje-color-success-9);\n}\n\n.native-chip.wje-color-warning {\n background-color: var(--wje-color-warning-2);\n color: var(--wje-color-warning-11);\n}\n\n.native-chip.wje-color-danger {\n background-color: var(--wje-color-danger-1);\n color: var(--wje-color-danger-9);\n}\n\n.native-chip.wje-color-info {\n background-color: var(--wje-color-info-1);\n color: var(--wje-color-info-9);\n}\n\n/*HOVER*/\n@media (any-hover: hover) {\n .native-chip.wje-color-primary:hover {\n background-color: var(--wje-color-primary-4);\n color: var(--wje-color-primary-10);\n }\n\n .native-chip.wje-color-complete:hover {\n background-color: var(--wje-color-complete-4);\n color: var(--wje-color-complete-10);\n }\n\n .native-chip.wje-color-success:hover {\n background-color: var(--wje-color-success-4);\n color: var(--wje-color-success-10);\n }\n\n .native-chip.wje-color-warning:hover {\n background-color: var(--wje-color-warning-4);\n color: var(--wje-color-warning-11);\n }\n\n .native-chip.wje-color-danger:hover {\n background-color: var(--wje-color-danger-4);\n color: var(--wje-color-danger-10);\n }\n\n .native-chip.wje-color-info:hover {\n background-color: var(--wje-color-info-4);\n color: var(--wje-color-info-10);\n }\n}\n";
|
|
8
8
|
class Chip extends WJElement {
|
|
9
9
|
/**
|
|
10
10
|
* Chip constructor method.
|
package/dist/wje-master.js
CHANGED
|
@@ -86,25 +86,25 @@ import { default as default71 } from "./wje-router-outlet.js";
|
|
|
86
86
|
import { default as default72 } from "./wje-row.js";
|
|
87
87
|
import { default as default73 } from "./wje-select.js";
|
|
88
88
|
import { default as default74 } from "./wje-slider.js";
|
|
89
|
-
import { default as default75 } from "./wje-
|
|
90
|
-
import { default as default76 } from "./wje-
|
|
91
|
-
import { default as default77 } from "./wje-
|
|
92
|
-
import { default as default78 } from "./wje-
|
|
89
|
+
import { default as default75 } from "./wje-sliding-container.js";
|
|
90
|
+
import { default as default76 } from "./wje-split-view.js";
|
|
91
|
+
import { default as default77 } from "./wje-status.js";
|
|
92
|
+
import { default as default78 } from "./wje-step.js";
|
|
93
|
+
import { default as default79 } from "./wje-stepper.js";
|
|
93
94
|
import { defaultStoreActions, store } from "./wje-store.js";
|
|
94
|
-
import { default as
|
|
95
|
-
import { default as
|
|
96
|
-
import { default as
|
|
97
|
-
import { default as
|
|
98
|
-
import { default as
|
|
99
|
-
import { default as
|
|
100
|
-
import { default as
|
|
101
|
-
import { default as
|
|
102
|
-
import { default as
|
|
103
|
-
import { default as
|
|
104
|
-
import { default as
|
|
105
|
-
import { default as
|
|
106
|
-
import { default as
|
|
107
|
-
import { default as default92 } from "./wje-sliding-container.js";
|
|
95
|
+
import { default as default80 } from "./wje-tab.js";
|
|
96
|
+
import { default as default81 } from "./wje-tab-group.js";
|
|
97
|
+
import { default as default82 } from "./wje-tab-panel.js";
|
|
98
|
+
import { default as default83 } from "./wje-textarea.js";
|
|
99
|
+
import { default as default84 } from "./wje-thumbnail.js";
|
|
100
|
+
import { default as default85 } from "./wje-toast.js";
|
|
101
|
+
import { default as default86 } from "./wje-toggle.js";
|
|
102
|
+
import { default as default87 } from "./wje-toolbar.js";
|
|
103
|
+
import { default as default88 } from "./wje-toolbar-action.js";
|
|
104
|
+
import { default as default89 } from "./wje-tooltip.js";
|
|
105
|
+
import { default as default90 } from "./wje-tree.js";
|
|
106
|
+
import { default as default91 } from "./wje-tree-item.js";
|
|
107
|
+
import { default as default92 } from "./wje-visually-hidden.js";
|
|
108
108
|
import { P } from "./popup.element-ZX3dWrG0.js";
|
|
109
109
|
const skSk = {
|
|
110
110
|
code: "sk-sk",
|
|
@@ -330,27 +330,27 @@ export {
|
|
|
330
330
|
default72 as Row,
|
|
331
331
|
default73 as Select,
|
|
332
332
|
default74 as Slider,
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
333
|
+
default75 as SlidingContainer,
|
|
334
|
+
default76 as SplitView,
|
|
335
|
+
default77 as Status,
|
|
336
|
+
default78 as Step,
|
|
337
|
+
default79 as Stepper,
|
|
338
|
+
default80 as Tab,
|
|
339
|
+
default81 as TabGroup,
|
|
340
|
+
default82 as TabPanel,
|
|
341
|
+
default83 as Textarea,
|
|
342
|
+
default84 as Thumbnail,
|
|
343
343
|
Timeline,
|
|
344
344
|
TimelineItem,
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
345
|
+
default85 as Toast,
|
|
346
|
+
default86 as Toggle,
|
|
347
|
+
default87 as Toolbar,
|
|
348
|
+
default88 as ToolbarAction,
|
|
349
|
+
default89 as Tooltip,
|
|
350
|
+
default90 as Tree,
|
|
351
|
+
default91 as TreeItem,
|
|
352
352
|
UniversalService,
|
|
353
|
-
|
|
353
|
+
default92 as VisuallyHidden,
|
|
354
354
|
WJElement,
|
|
355
355
|
b as bindRouterLinks,
|
|
356
356
|
defaultStoreActions,
|
package/dist/wje-select.js
CHANGED
|
@@ -539,6 +539,7 @@ class Select extends FormAssociatedElement {
|
|
|
539
539
|
this.clearSelections();
|
|
540
540
|
});
|
|
541
541
|
this.list.addEventListener("wje-options:load", (e) => {
|
|
542
|
+
var _a2;
|
|
542
543
|
this.selectedOptions.forEach((option) => {
|
|
543
544
|
this.getAllOptions().forEach((el) => {
|
|
544
545
|
if (el.value === option.value) {
|
|
@@ -546,6 +547,15 @@ class Select extends FormAssociatedElement {
|
|
|
546
547
|
}
|
|
547
548
|
});
|
|
548
549
|
});
|
|
550
|
+
const attrValue = ((_a2 = this.getAttribute("value")) == null ? void 0 : _a2.split(" ")) || [];
|
|
551
|
+
attrValue.forEach((val) => {
|
|
552
|
+
const existingOption = Array.from(this.getAllOptions()).find((el) => el.value === val);
|
|
553
|
+
if (existingOption) {
|
|
554
|
+
existingOption.selected = true;
|
|
555
|
+
}
|
|
556
|
+
});
|
|
557
|
+
this.selectedOptions = __privateMethod(this, _Select_instances, getSelectedOptions_fn).call(this);
|
|
558
|
+
this.selections(true);
|
|
549
559
|
this.list.scrollTo(0, 0);
|
|
550
560
|
event.dispatchCustomEvent(this.popup, "wje-popup:content-ready");
|
|
551
561
|
});
|