@genexus/genexus-ide-ui 0.0.37 → 0.0.38
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/cjs/ch-alert.cjs.entry.js +120 -0
- package/dist/cjs/ch-suggest_4.cjs.entry.js +46 -11
- package/dist/cjs/ch-timer.cjs.entry.js +45 -0
- package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
- package/dist/cjs/gx-ide-entity-selector.cjs.entry.js +87 -0
- package/dist/cjs/gx-ide-new-environment.cjs.entry.js +3 -2
- package/dist/cjs/gx-ide-new-object.cjs.entry.js +147 -0
- package/dist/cjs/gx-ide-references.cjs.entry.js +15 -35
- package/dist/cjs/{gx-ide-entity-selector_2.cjs.entry.js → gxg-date-picker.cjs.entry.js} +0 -81
- package/dist/cjs/gxg-list-box_2.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/common/render-suggest.js +4 -1
- package/dist/collection/components/new-environment/new-environment.js +24 -3
- package/dist/collection/components/new-object/gx-ide-assets/new-object/langs/new-object.lang.en.json +13 -0
- package/dist/collection/components/new-object/gx-ide-assets/new-object/langs/new-object.lang.ja.json +11 -0
- package/dist/collection/components/new-object/gx-ide-assets/new-object/langs/new-object.lang.zh.json +11 -0
- package/dist/collection/components/new-object/new-object.css +143 -0
- package/dist/collection/components/new-object/new-object.js +380 -0
- package/dist/collection/components/references/helpers.js +0 -22
- package/dist/collection/components/references/references.js +12 -13
- package/dist/components/ch-alert.js +150 -0
- package/dist/components/ch-suggest-list-item2.js +41 -4
- package/dist/components/ch-suggest2.js +5 -9
- package/dist/components/ch-timer.js +6 -0
- package/dist/components/gx-ide-new-environment.js +4 -2
- package/dist/components/gx-ide-new-object.d.ts +11 -0
- package/dist/components/gx-ide-new-object.js +247 -0
- package/dist/components/gx-ide-references.js +15 -35
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +3 -0
- package/dist/components/list-box-item.js +2 -2
- package/dist/components/timer.js +61 -0
- package/dist/esm/ch-alert.entry.js +116 -0
- package/dist/esm/ch-suggest_4.entry.js +46 -11
- package/dist/esm/ch-timer.entry.js +41 -0
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-entity-selector.entry.js +83 -0
- package/dist/esm/gx-ide-new-environment.entry.js +3 -2
- package/dist/esm/gx-ide-new-object.entry.js +143 -0
- package/dist/esm/gx-ide-references.entry.js +15 -35
- package/dist/esm/{gx-ide-entity-selector_2.entry.js → gxg-date-picker.entry.js} +1 -81
- package/dist/esm/gxg-list-box_2.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
- package/dist/genexus-ide-ui/gx-ide-assets/new-object/langs/new-object.lang.en.json +13 -0
- package/dist/genexus-ide-ui/gx-ide-assets/new-object/langs/new-object.lang.ja.json +11 -0
- package/dist/genexus-ide-ui/gx-ide-assets/new-object/langs/new-object.lang.zh.json +11 -0
- package/dist/genexus-ide-ui/p-04df38d0.entry.js +1 -0
- package/dist/genexus-ide-ui/{p-06ddf2a3.entry.js → p-37ecffdc.entry.js} +1 -1
- package/dist/genexus-ide-ui/p-48412811.entry.js +1 -0
- package/dist/genexus-ide-ui/p-4f02b7bf.entry.js +1 -0
- package/dist/genexus-ide-ui/p-532bf5cb.entry.js +1 -0
- package/dist/genexus-ide-ui/p-5fe59458.entry.js +1 -0
- package/dist/genexus-ide-ui/p-9be97571.entry.js +1 -0
- package/dist/genexus-ide-ui/p-a82042ee.entry.js +1 -0
- package/dist/genexus-ide-ui/p-db4f2732.entry.js +1 -0
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/alert/alert.css +46 -0
- package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/alert/timer/timer.css +13 -0
- package/dist/node_modules/@genexus/gemini/dist/collection/components/list-box-item/list-box-item.css +13 -5
- package/dist/types/common/render-suggest.d.ts +1 -1
- package/dist/types/components/new-environment/new-environment.d.ts +5 -1
- package/dist/types/components/new-object/new-object.d.ts +107 -0
- package/dist/types/components/references/helpers.d.ts +1 -6
- package/dist/types/components/references/references.d.ts +6 -6
- package/dist/types/components.d.ts +110 -4
- package/package.json +3 -3
- package/dist/genexus-ide-ui/p-35bc6e3a.entry.js +0 -1
- package/dist/genexus-ide-ui/p-4aa2885b.entry.js +0 -1
- package/dist/genexus-ide-ui/p-714bd8ea.entry.js +0 -1
- package/dist/genexus-ide-ui/p-74a88934.entry.js +0 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const timerCss = "@keyframes transition{from{width:100%}to{width:0}}.indicator{height:5px;background-color:#cdcd44;animation:var(--animation-time) linear 1 forwards transition}";
|
|
4
|
+
|
|
5
|
+
const ChTimer = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
/**
|
|
11
|
+
* Sets the progress propiety to determine the progress.
|
|
12
|
+
*/
|
|
13
|
+
this.progress = 0;
|
|
14
|
+
/**
|
|
15
|
+
* Sets the accesible name of the timer.
|
|
16
|
+
*/
|
|
17
|
+
this.accessibleName = "timer";
|
|
18
|
+
/**
|
|
19
|
+
* Sets the animationTime to set the custom var for the css animation.
|
|
20
|
+
*/
|
|
21
|
+
this.animationTime = 0;
|
|
22
|
+
/**
|
|
23
|
+
* Sets the presented property to handle the component presentation.
|
|
24
|
+
*/
|
|
25
|
+
this.presented = false;
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
const accessibilityAttributes = {
|
|
29
|
+
role: "timer",
|
|
30
|
+
"aria-live": "true",
|
|
31
|
+
"aria-labelledby": this.accessibleName,
|
|
32
|
+
"aria-valuemin": "0",
|
|
33
|
+
"aria-valuemax": "100",
|
|
34
|
+
"aria-valuenow": this.progress
|
|
35
|
+
};
|
|
36
|
+
return (h(Host, null, this.presented && this.progress >= 0 && (h("div", Object.assign({}, accessibilityAttributes, { part: "indicator", class: "indicator", style: {
|
|
37
|
+
"--animation-time": `${this.animationTime}ms`
|
|
38
|
+
} })))));
|
|
39
|
+
}
|
|
40
|
+
static get style() { return timerCss; }
|
|
41
|
+
}, [1, "ch-timer", {
|
|
42
|
+
"progress": [2],
|
|
43
|
+
"accessibleName": [1, "accessible-name"],
|
|
44
|
+
"animationTime": [2, "animation-time"],
|
|
45
|
+
"presented": [4]
|
|
46
|
+
}]);
|
|
47
|
+
function defineCustomElement() {
|
|
48
|
+
if (typeof customElements === "undefined") {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const components = ["ch-timer"];
|
|
52
|
+
components.forEach(tagName => { switch (tagName) {
|
|
53
|
+
case "ch-timer":
|
|
54
|
+
if (!customElements.get(tagName)) {
|
|
55
|
+
customElements.define(tagName, ChTimer);
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
} });
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { ChTimer as C, defineCustomElement as d };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-0da01575.js';
|
|
2
|
+
|
|
3
|
+
const alertCss = ":host{display:grid;width:100%;height:100%;grid-template:\"img content button\" 1fr \"progress-bar progress-bar progress-bar\" min-content/min-content 1fr min-content}:host(.pause-on-hover:hover) ::part(indicator){animation-play-state:paused}::slotted([slot=button]){pointer-events:none}.image{max-width:40px;height:40px;grid-area:img;align-self:center}.content{grid-area:content}.close-button{grid-area:button}.close-button .close-button-img{-webkit-mask:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.875 18L6.75 16.875L11.25 12.375L6.75 7.875L7.875 6.75L12.375 11.25L16.875 6.75L18 7.875L13.5 12.375L18 16.875L16.875 18L12.375 13.5L7.875 18Z'/%3E%3C/svg%3E\") 50% 50%/24px 24px no-repeat;width:24px;height:24px;background-color:currentColor}.indicator-container{grid-area:progress-bar}:where(button){all:unset;display:flex;align-items:center;cursor:pointer}";
|
|
4
|
+
|
|
5
|
+
const ChAlert = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.close = createEvent(this, "close", 7);
|
|
9
|
+
/** Sets the timer id */
|
|
10
|
+
this.timerId = null;
|
|
11
|
+
/** Sets the desired interval */
|
|
12
|
+
this.timerInterval = 50;
|
|
13
|
+
/**
|
|
14
|
+
* Determine the accessible name of the close button.
|
|
15
|
+
* Important for accessibility.
|
|
16
|
+
*/
|
|
17
|
+
this.closeButtonAccessibleName = "Close";
|
|
18
|
+
/**
|
|
19
|
+
* Specifies the time (ms) for the alert to be displayed.
|
|
20
|
+
* if `dismissTimeout = 0`, the alert will be always visible
|
|
21
|
+
* (unless is dismissed by the closeButton).
|
|
22
|
+
*/
|
|
23
|
+
this.dismissTimeout = 0;
|
|
24
|
+
/**
|
|
25
|
+
* Determine src of the left image.
|
|
26
|
+
*/
|
|
27
|
+
this.leftImgSrc = "";
|
|
28
|
+
/**
|
|
29
|
+
* Determine if the element is displayed or not.
|
|
30
|
+
*/
|
|
31
|
+
this.presented = false;
|
|
32
|
+
/**
|
|
33
|
+
* Determine if the closeButton is displayed or not.
|
|
34
|
+
*/
|
|
35
|
+
this.showCloseButton = false;
|
|
36
|
+
/**
|
|
37
|
+
* If dismissTimeout > 0, a progress bar is displayed at the bottom of the element
|
|
38
|
+
* showing the time left for the alert to show.
|
|
39
|
+
* The progress stops when the element is hovered.
|
|
40
|
+
*/
|
|
41
|
+
this.showTimeoutBar = false;
|
|
42
|
+
/** Toggles the Pause on Hover functionality */
|
|
43
|
+
this.pauseOnHover = true;
|
|
44
|
+
/** Closes the alert when the close button is clicked.
|
|
45
|
+
* Also restarts the counter and sets its value to match dismissTimeout.
|
|
46
|
+
*/
|
|
47
|
+
this.handleAlertClose = () => {
|
|
48
|
+
clearInterval(this.timerId);
|
|
49
|
+
this.presented = false;
|
|
50
|
+
this.close.emit();
|
|
51
|
+
this.countdown = this.dismissTimeout;
|
|
52
|
+
};
|
|
53
|
+
/** Countdown which initial state is dismissTimeout ms. */
|
|
54
|
+
this.countdown = this.dismissTimeout;
|
|
55
|
+
/** Counter decremental function */
|
|
56
|
+
this.counter = () => {
|
|
57
|
+
this.countdown -= this.timerInterval;
|
|
58
|
+
};
|
|
59
|
+
/** Starts a new countdown which interval is set in timerInterval,
|
|
60
|
+
* Only if is presented, dismissTimeout is greater than 0,
|
|
61
|
+
* and countdown is still running.
|
|
62
|
+
*/
|
|
63
|
+
this.start = () => {
|
|
64
|
+
clearInterval(this.timerId);
|
|
65
|
+
if (this.presented && this.dismissTimeout !== 0 && this.countdown >= 0) {
|
|
66
|
+
this.timerId = setInterval(this.counter, this.timerInterval);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
/** Pauses the countdown */
|
|
70
|
+
this.handleMouseEnter = () => {
|
|
71
|
+
clearInterval(this.timerId);
|
|
72
|
+
};
|
|
73
|
+
/** Resumes the countdown */
|
|
74
|
+
this.handleMouseLeave = () => {
|
|
75
|
+
this.start();
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
timeoutWatcher(newValue) {
|
|
79
|
+
if (newValue) {
|
|
80
|
+
this.countdown = newValue;
|
|
81
|
+
this.start();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
presentedWatcher(newValue) {
|
|
85
|
+
if (newValue) {
|
|
86
|
+
this.start();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/** Countdown watcher that hides the alert if dismissTimeout is reached
|
|
90
|
+
* and stops the countdown.
|
|
91
|
+
* See handleAlertClose for more details. */
|
|
92
|
+
countdownWatcher(newValue) {
|
|
93
|
+
if (newValue <= 0) {
|
|
94
|
+
this.handleAlertClose();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
componentDidLoad() {
|
|
98
|
+
this.start();
|
|
99
|
+
}
|
|
100
|
+
render() {
|
|
101
|
+
return (h(Host, { role: "alert", onMouseEnter: this.pauseOnHover && this.handleMouseEnter, onMouseLeave: this.pauseOnHover && this.handleMouseLeave, "aria-hidden": !this.presented ? "true" : "false", class: this.pauseOnHover && "pause-on-hover" }, this.presented && [
|
|
102
|
+
this.leftImgSrc && (h("img", { part: "image", class: "image", src: this.leftImgSrc, alt: "", "aria-hidden": "true", loading: "lazy" })),
|
|
103
|
+
h("div", { part: "content", class: "content" }, h("slot", { name: "content" })),
|
|
104
|
+
this.showCloseButton && (h("button", { part: "close-button", class: "close-button", type: "button", "aria-label": this.closeButtonAccessibleName, onClick: this.handleAlertClose }, h("slot", { name: "button", "aria-hidden": "true" }, h("div", { "aria-hidden": "true", class: "close-button-img" })))),
|
|
105
|
+
this.showTimeoutBar && (h("ch-timer", { part: "indicator-container", class: "indicator-container", exportparts: "indicator", progress: (this.countdown * 100) / this.dismissTimeout, accessibleName: `${this.countdown / 1000} seconds left`, "animation-time": this.dismissTimeout, presented: this.presented }))
|
|
106
|
+
]));
|
|
107
|
+
}
|
|
108
|
+
static get watchers() { return {
|
|
109
|
+
"dismissTimeout": ["timeoutWatcher"],
|
|
110
|
+
"presented": ["presentedWatcher"],
|
|
111
|
+
"countdown": ["countdownWatcher"]
|
|
112
|
+
}; }
|
|
113
|
+
};
|
|
114
|
+
ChAlert.style = alertCss;
|
|
115
|
+
|
|
116
|
+
export { ChAlert as ch_alert };
|
|
@@ -10,7 +10,7 @@ const ARROW_UP$1 = "ArrowUp";
|
|
|
10
10
|
const ChSuggest = class {
|
|
11
11
|
constructor(hostRef) {
|
|
12
12
|
registerInstance(this, hostRef);
|
|
13
|
-
this.
|
|
13
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
14
14
|
this.keyEventsDictionary = {
|
|
15
15
|
ArrowDown: (e) => {
|
|
16
16
|
const newFocusedItem = this.getNewFocusedItem(e.currentFocusedItem, ARROW_DOWN$1);
|
|
@@ -37,7 +37,7 @@ const ChSuggest = class {
|
|
|
37
37
|
/**
|
|
38
38
|
* The debounce amount in milliseconds (This is the time the suggest waits after the user has finished typing, to show the suggestions).
|
|
39
39
|
*/
|
|
40
|
-
this.debounce =
|
|
40
|
+
this.debounce = 300;
|
|
41
41
|
/**
|
|
42
42
|
* The label position
|
|
43
43
|
*/
|
|
@@ -125,7 +125,7 @@ const ChSuggest = class {
|
|
|
125
125
|
*/
|
|
126
126
|
this.handleInput = (e) => {
|
|
127
127
|
const inputValue = e.target.value;
|
|
128
|
-
this.
|
|
128
|
+
this.value = inputValue;
|
|
129
129
|
if (this.timeoutReference) {
|
|
130
130
|
clearTimeout(this.timeoutReference);
|
|
131
131
|
}
|
|
@@ -156,9 +156,7 @@ const ChSuggest = class {
|
|
|
156
156
|
partWindow.scrollTop = partWindow.scrollHeight;
|
|
157
157
|
};
|
|
158
158
|
this.processInputEvent = (inputValue) => {
|
|
159
|
-
this.
|
|
160
|
-
this.caption = inputValue;
|
|
161
|
-
this.value = undefined;
|
|
159
|
+
this.valueChanged.emit(inputValue);
|
|
162
160
|
this.evaluateWindowMaxHeight();
|
|
163
161
|
};
|
|
164
162
|
this.closeWindow = () => {
|
|
@@ -174,7 +172,6 @@ const ChSuggest = class {
|
|
|
174
172
|
// 7.LISTENERS //
|
|
175
173
|
itemSelectedHandler(event) {
|
|
176
174
|
this.value = event.detail.value;
|
|
177
|
-
this.caption = event.detail.caption;
|
|
178
175
|
this.closeWindow();
|
|
179
176
|
}
|
|
180
177
|
focusChangeAttemptHandler(event) {
|
|
@@ -209,7 +206,7 @@ const ChSuggest = class {
|
|
|
209
206
|
}
|
|
210
207
|
// 10.RENDER() FUNCTION //
|
|
211
208
|
render() {
|
|
212
|
-
return (h(Host, null, h("div", { class: "main-wrapper", part: "main-wrapper" }, h("div", { class: "label-input-wrapper", part: "label-input-wrapper" }, this.showLabel && this.label && (h("label", { id: "label", htmlFor: "input", part: "label" }, this.label)), h("input", { type: "text", id: "input", part: "input", class: "input", ref: el => (this.textInput = el), onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: this.onFocusHandler, value: this.
|
|
209
|
+
return (h(Host, null, h("div", { class: "main-wrapper", part: "main-wrapper" }, h("div", { class: "label-input-wrapper", part: "label-input-wrapper" }, this.showLabel && this.label && (h("label", { id: "label", htmlFor: "input", part: "label" }, this.label)), h("input", { type: "text", id: "input", part: "input", class: "input", ref: el => (this.textInput = el), onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: this.onFocusHandler, value: this.value, autocomplete: "off", "aria-controls": "ch-window", "aria-label": !this.showLabel && this.label ? this.label : undefined, "aria-labelledby": this.showLabel && this.label ? "label" : undefined, "aria-expanded": this.windowHidden.toString() })), h("ch-window", { id: "ch-window", container: this.textInput, "close-on-outside-click": true, "close-on-escape": true, xAlign: "inside-start", yAlign: "outside-end", ref: el => (this.chWindow = el), showHeader: this.showHeader, caption: this.suggestTitle, exportparts: "\n header:header, \n caption:title, \n close:close-button,\n window:dropdown" }, h("slot", { onSlotchange: this.evaluateSlotIsEmpty })))));
|
|
213
210
|
}
|
|
214
211
|
static get delegatesFocus() { return true; }
|
|
215
212
|
get el() { return getElement(this); }
|
|
@@ -250,11 +247,49 @@ const ChSuggestListItem = class {
|
|
|
250
247
|
// 7.LISTENERS //
|
|
251
248
|
// 8.PUBLIC METHODS API //
|
|
252
249
|
// 9.LOCAL METHODS //
|
|
250
|
+
this.getItemIndexes = () => {
|
|
251
|
+
const parentElement = this.el.parentElement;
|
|
252
|
+
if (parentElement.nodeName === "CH-SUGGEST") {
|
|
253
|
+
const chSuggest = parentElement;
|
|
254
|
+
let itemIndex = -1;
|
|
255
|
+
const suggestListItemsArray = Array.from(chSuggest.querySelectorAll(":scope > ch-suggest-list-item"));
|
|
256
|
+
for (let index = 0; index < suggestListItemsArray.length; index++) {
|
|
257
|
+
// Then get the item index
|
|
258
|
+
if (suggestListItemsArray[index] === this.el) {
|
|
259
|
+
itemIndex = index;
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return {
|
|
264
|
+
itemIndex: itemIndex,
|
|
265
|
+
listIndex: undefined // the items does not belongs to a list
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
else if (parentElement.nodeName === "CH-SUGGEST-LIST") {
|
|
269
|
+
const chSuggestList = parentElement;
|
|
270
|
+
const chSuggestListsArray = Array.from(chSuggestList.parentElement.querySelectorAll(":scope > ch-suggest-list"));
|
|
271
|
+
const listIndex = chSuggestListsArray.findIndex(list => {
|
|
272
|
+
return list === chSuggestList;
|
|
273
|
+
});
|
|
274
|
+
if (listIndex !== -1) {
|
|
275
|
+
const listItemsArray = Array.from(chSuggestList.querySelectorAll("ch-suggest-list-item"));
|
|
276
|
+
const itemIndex = listItemsArray.findIndex(item => {
|
|
277
|
+
return item === this.el;
|
|
278
|
+
});
|
|
279
|
+
return {
|
|
280
|
+
itemIndex: itemIndex,
|
|
281
|
+
listIndex: listIndex
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
};
|
|
253
286
|
this.handleClick = () => {
|
|
287
|
+
const indexes = this.getItemIndexes();
|
|
254
288
|
this.itemSelected.emit({
|
|
255
289
|
value: this.value || this.el.innerText,
|
|
256
|
-
|
|
257
|
-
|
|
290
|
+
description: this.el.innerText,
|
|
291
|
+
icon: this.iconSrc,
|
|
292
|
+
indexes: indexes
|
|
258
293
|
});
|
|
259
294
|
};
|
|
260
295
|
this.handleKeyDown = (e) => {
|
|
@@ -269,7 +304,7 @@ const ChSuggestListItem = class {
|
|
|
269
304
|
}
|
|
270
305
|
// 10.RENDER() FUNCTION //
|
|
271
306
|
render() {
|
|
272
|
-
return (h(Host, { role: "listitem", onKeyDown: this.handleKeyDown }, h("button", { part: "button", onClick: this.handleClick }, h("slot", { name: "icon" }), h("div", { class: "content-wrapper", part: "content-wrapper" }, h("slot", null)
|
|
307
|
+
return (h(Host, { role: "listitem", onKeyDown: this.handleKeyDown }, h("button", { part: "button", onClick: this.handleClick }, h("slot", { name: "icon" }), h("div", { class: "content-wrapper", part: "content-wrapper" }, h("slot", null)))));
|
|
273
308
|
}
|
|
274
309
|
static get delegatesFocus() { return true; }
|
|
275
310
|
get el() { return getElement(this); }
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-0da01575.js';
|
|
2
|
+
|
|
3
|
+
const timerCss = "@keyframes transition{from{width:100%}to{width:0}}.indicator{height:5px;background-color:#cdcd44;animation:var(--animation-time) linear 1 forwards transition}";
|
|
4
|
+
|
|
5
|
+
const ChTimer = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
/**
|
|
9
|
+
* Sets the progress propiety to determine the progress.
|
|
10
|
+
*/
|
|
11
|
+
this.progress = 0;
|
|
12
|
+
/**
|
|
13
|
+
* Sets the accesible name of the timer.
|
|
14
|
+
*/
|
|
15
|
+
this.accessibleName = "timer";
|
|
16
|
+
/**
|
|
17
|
+
* Sets the animationTime to set the custom var for the css animation.
|
|
18
|
+
*/
|
|
19
|
+
this.animationTime = 0;
|
|
20
|
+
/**
|
|
21
|
+
* Sets the presented property to handle the component presentation.
|
|
22
|
+
*/
|
|
23
|
+
this.presented = false;
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
const accessibilityAttributes = {
|
|
27
|
+
role: "timer",
|
|
28
|
+
"aria-live": "true",
|
|
29
|
+
"aria-labelledby": this.accessibleName,
|
|
30
|
+
"aria-valuemin": "0",
|
|
31
|
+
"aria-valuemax": "100",
|
|
32
|
+
"aria-valuenow": this.progress
|
|
33
|
+
};
|
|
34
|
+
return (h(Host, null, this.presented && this.progress >= 0 && (h("div", Object.assign({}, accessibilityAttributes, { part: "indicator", class: "indicator", style: {
|
|
35
|
+
"--animation-time": `${this.animationTime}ms`
|
|
36
|
+
} })))));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
ChTimer.style = timerCss;
|
|
40
|
+
|
|
41
|
+
export { ChTimer as ch_timer };
|