q2-tecton-elements 1.21.2 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/installCanvasRenderer-b4d10c92.js +38433 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-badge_2.cjs.entry.js +5 -3
- package/dist/cjs/q2-calendar.cjs.entry.js +75 -55
- package/dist/cjs/q2-carousel.cjs.entry.js +3 -3
- package/dist/cjs/q2-chart-bar.cjs.entry.js +4679 -0
- package/dist/cjs/q2-chart-donut.cjs.entry.js +357 -35592
- package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +1 -1
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/q2-calendar/index.js +43 -2
- package/dist/collection/components/q2-chart-bar/index.js +466 -0
- package/dist/collection/components/q2-chart-bar/styles.css +85 -0
- package/dist/collection/components/q2-chart-donut/index.js +3 -3
- package/dist/collection/components/q2-checkbox/styles.css +5 -1
- package/dist/collection/components/q2-editable-field/styles.css +1 -1
- package/dist/collection/components/q2-input/formatting/phone.js +2 -2
- package/dist/collection/components/q2-input/index.js +21 -0
- package/dist/collection/components/q2-input/styles.css +2 -2
- package/dist/collection/components/q2-radio/styles.css +1 -1
- package/dist/collection/utils/charting.js +182 -0
- package/dist/components/click-elsewhere.d.ts +11 -0
- package/dist/components/click-elsewhere.js +6 -0
- package/dist/components/index.d.ts +62 -0
- package/dist/components/index.js +42 -0
- package/dist/components/index10.js +84 -0
- package/dist/components/index11.js +383 -0
- package/dist/components/index12.js +125 -0
- package/dist/components/index13.js +602 -0
- package/dist/components/index2.js +100 -0
- package/dist/components/index3.js +90 -0
- package/dist/components/index4.js +62 -0
- package/dist/components/index5.js +146 -0
- package/dist/components/index6.js +145 -0
- package/dist/components/index7.js +2960 -0
- package/dist/components/index8.js +3356 -0
- package/dist/components/index9.js +101 -0
- package/dist/components/installCanvasRenderer.js +38282 -0
- package/dist/components/q2-avatar.d.ts +11 -0
- package/dist/components/q2-avatar.js +6 -0
- package/dist/components/q2-badge.d.ts +11 -0
- package/dist/components/q2-badge.js +6 -0
- package/dist/components/q2-btn.d.ts +11 -0
- package/dist/components/q2-btn.js +6 -0
- package/dist/components/q2-calendar.d.ts +11 -0
- package/dist/components/q2-calendar.js +3755 -0
- package/dist/components/q2-card.d.ts +11 -0
- package/dist/components/q2-card.js +187 -0
- package/dist/components/q2-carousel-pane.d.ts +11 -0
- package/dist/components/q2-carousel-pane.js +97 -0
- package/dist/components/q2-carousel.d.ts +11 -0
- package/dist/components/q2-carousel.js +5379 -0
- package/dist/components/q2-chart-bar.d.ts +11 -0
- package/dist/components/q2-chart-bar.js +4710 -0
- package/dist/components/q2-chart-donut.d.ts +11 -0
- package/dist/components/q2-chart-donut.js +4887 -0
- package/dist/components/q2-checkbox-group.d.ts +11 -0
- package/dist/components/q2-checkbox-group.js +114 -0
- package/dist/components/q2-checkbox.d.ts +11 -0
- package/dist/components/q2-checkbox.js +138 -0
- package/dist/components/q2-dropdown-item.d.ts +11 -0
- package/dist/components/q2-dropdown-item.js +6 -0
- package/dist/components/q2-dropdown.d.ts +11 -0
- package/dist/components/q2-dropdown.js +345 -0
- package/dist/components/q2-editable-field.d.ts +11 -0
- package/dist/components/q2-editable-field.js +220 -0
- package/dist/components/q2-icon.d.ts +11 -0
- package/dist/components/q2-icon.js +6 -0
- package/dist/components/q2-input.d.ts +11 -0
- package/dist/components/q2-input.js +6 -0
- package/dist/components/q2-loading-element.d.ts +11 -0
- package/dist/components/q2-loading-element.js +52 -0
- package/dist/components/q2-loading.d.ts +11 -0
- package/dist/components/q2-loading.js +6 -0
- package/dist/components/q2-loc.d.ts +11 -0
- package/dist/components/q2-loc.js +40 -0
- package/dist/components/q2-message.d.ts +11 -0
- package/dist/components/q2-message.js +6 -0
- package/dist/components/q2-month-picker.d.ts +11 -0
- package/dist/components/q2-month-picker.js +189 -0
- package/dist/components/q2-optgroup.d.ts +11 -0
- package/dist/components/q2-optgroup.js +75 -0
- package/dist/components/q2-option-list.d.ts +11 -0
- package/dist/components/q2-option-list.js +6 -0
- package/dist/components/q2-option.d.ts +11 -0
- package/dist/components/q2-option.js +81 -0
- package/dist/components/q2-pagination.d.ts +11 -0
- package/dist/components/q2-pagination.js +184 -0
- package/dist/components/q2-pill.d.ts +11 -0
- package/dist/components/q2-pill.js +216 -0
- package/dist/components/q2-popover.d.ts +11 -0
- package/dist/components/q2-popover.js +6 -0
- package/dist/components/q2-radio-group.d.ts +11 -0
- package/dist/components/q2-radio-group.js +191 -0
- package/dist/components/q2-radio.d.ts +11 -0
- package/dist/components/q2-radio.js +105 -0
- package/dist/components/q2-section.d.ts +11 -0
- package/dist/components/q2-section.js +218 -0
- package/dist/components/q2-select.d.ts +11 -0
- package/dist/components/q2-select.js +817 -0
- package/dist/components/q2-stepper-pane.d.ts +11 -0
- package/dist/components/q2-stepper-pane.js +92 -0
- package/dist/components/q2-stepper-vertical.d.ts +11 -0
- package/dist/components/q2-stepper-vertical.js +311 -0
- package/dist/components/q2-stepper.d.ts +11 -0
- package/dist/components/q2-stepper.js +252 -0
- package/dist/components/q2-tab-container.d.ts +11 -0
- package/dist/components/q2-tab-container.js +288 -0
- package/dist/components/q2-tab-pane.d.ts +11 -0
- package/dist/components/q2-tab-pane.js +58 -0
- package/dist/components/q2-tag.d.ts +11 -0
- package/dist/components/q2-tag.js +156 -0
- package/dist/components/q2-textarea.d.ts +11 -0
- package/dist/components/q2-textarea.js +265 -0
- package/dist/components/q2-tooltip.d.ts +11 -0
- package/dist/components/q2-tooltip.js +112 -0
- package/dist/components/shapes.js +91 -0
- package/dist/components/tecton-tab-pane.d.ts +11 -0
- package/dist/components/tecton-tab-pane.js +111 -0
- package/dist/esm/installCanvasRenderer-0143b52d.js +38282 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-badge_2.entry.js +5 -3
- package/dist/esm/q2-calendar.entry.js +75 -55
- package/dist/esm/q2-carousel.entry.js +3 -3
- package/dist/esm/q2-chart-bar.entry.js +4675 -0
- package/dist/esm/q2-chart-donut.entry.js +171 -35406
- package/dist/esm/q2-checkbox.entry.js +1 -1
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +1 -1
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/q2-tecton-elements/p-1f85cced.js +39 -0
- package/dist/q2-tecton-elements/{p-89608314.entry.js → p-4625184b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9772b15f.entry.js → p-520c40f6.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-6b52a262.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c4640b55.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-7e8f43d1.entry.js → p-cf41970f.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-e4dc9ac0.entry.js +1 -0
- package/dist/q2-tecton-elements/p-f35bf6a3.entry.js +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/types/components/q2-calendar/index.d.ts +3 -0
- package/dist/types/components/q2-chart-bar/index.d.ts +40 -0
- package/dist/types/components/q2-chart-donut/index.d.ts +7 -10
- package/dist/types/components/q2-input/index.d.ts +1 -0
- package/dist/types/components.d.ts +50 -3
- package/dist/types/utils/charting.d.ts +14 -0
- package/package.json +6 -3
- package/dist/q2-tecton-elements/p-0766a694.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5f064e1e.entry.js +0 -39
- package/dist/q2-tecton-elements/p-8d25ec52.entry.js +0 -1
- /package/dist/types/workspace/workspace/{tecton-production_release_1.21.x → tecton-production_release_1.22.x}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
|
|
2
|
+
import { a as atoms } from './shapes.js';
|
|
3
|
+
|
|
4
|
+
const stylesCss = "q2-loading-element{display:block}.skeleton-shape.rectangle:not(.no-margin){margin:var(--tct-loading-skeleton-vertical-gap, var(--tct-scale-2, 10px)) var(--tct-loading-skeleton-horizontal-gap, var(--tct-scale-2, 10px))}.skeleton-shape.circle,.skeleton-shape.rectangle{background-color:var(--tct-loading-skeleton-element-bg, var(--tct-gray-l3, var(--t-gray-14, #f2f2f2)))}.skeleton-shape.circle{border-radius:50%;padding-top:100%}";
|
|
5
|
+
|
|
6
|
+
const Q2Loading = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.shape = undefined;
|
|
11
|
+
this.width = undefined;
|
|
12
|
+
this.height = undefined;
|
|
13
|
+
this.borderRadius = undefined;
|
|
14
|
+
}
|
|
15
|
+
get shapeMarkup() {
|
|
16
|
+
return atoms[this.shape]
|
|
17
|
+
? atoms[this.shape]({
|
|
18
|
+
width: this.width,
|
|
19
|
+
height: this.height,
|
|
20
|
+
borderRadius: this.borderRadius,
|
|
21
|
+
})
|
|
22
|
+
: '';
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
return this.shapeMarkup;
|
|
26
|
+
}
|
|
27
|
+
static get style() { return stylesCss; }
|
|
28
|
+
}, [0, "q2-loading-element", {
|
|
29
|
+
"shape": [513],
|
|
30
|
+
"width": [513],
|
|
31
|
+
"height": [513],
|
|
32
|
+
"borderRadius": [513, "border-radius"]
|
|
33
|
+
}]);
|
|
34
|
+
function defineCustomElement$1() {
|
|
35
|
+
if (typeof customElements === "undefined") {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const components = ["q2-loading-element"];
|
|
39
|
+
components.forEach(tagName => { switch (tagName) {
|
|
40
|
+
case "q2-loading-element":
|
|
41
|
+
if (!customElements.get(tagName)) {
|
|
42
|
+
customElements.define(tagName, Q2Loading);
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
} });
|
|
46
|
+
}
|
|
47
|
+
defineCustomElement$1();
|
|
48
|
+
|
|
49
|
+
const Q2LoadingElement = Q2Loading;
|
|
50
|
+
const defineCustomElement = defineCustomElement$1;
|
|
51
|
+
|
|
52
|
+
export { Q2LoadingElement, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2Loading extends Components.Q2Loading, HTMLElement {}
|
|
4
|
+
export const Q2Loading: {
|
|
5
|
+
prototype: Q2Loading;
|
|
6
|
+
new (): Q2Loading;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2Loc extends Components.Q2Loc, HTMLElement {}
|
|
4
|
+
export const Q2Loc: {
|
|
5
|
+
prototype: Q2Loc;
|
|
6
|
+
new (): Q2Loc;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { l as loc } from './index13.js';
|
|
3
|
+
|
|
4
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:inline}";
|
|
5
|
+
|
|
6
|
+
const Q2Loc$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.value = undefined;
|
|
12
|
+
this.substitutions = undefined;
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return h("span", null, loc(this.value, this.substitutions));
|
|
16
|
+
}
|
|
17
|
+
static get style() { return stylesCss; }
|
|
18
|
+
}, [1, "q2-loc", {
|
|
19
|
+
"value": [513],
|
|
20
|
+
"substitutions": [16]
|
|
21
|
+
}]);
|
|
22
|
+
function defineCustomElement$1() {
|
|
23
|
+
if (typeof customElements === "undefined") {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const components = ["q2-loc"];
|
|
27
|
+
components.forEach(tagName => { switch (tagName) {
|
|
28
|
+
case "q2-loc":
|
|
29
|
+
if (!customElements.get(tagName)) {
|
|
30
|
+
customElements.define(tagName, Q2Loc$1);
|
|
31
|
+
}
|
|
32
|
+
break;
|
|
33
|
+
} });
|
|
34
|
+
}
|
|
35
|
+
defineCustomElement$1();
|
|
36
|
+
|
|
37
|
+
const Q2Loc = Q2Loc$1;
|
|
38
|
+
const defineCustomElement = defineCustomElement$1;
|
|
39
|
+
|
|
40
|
+
export { Q2Loc, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2Message extends Components.Q2Message, HTMLElement {}
|
|
4
|
+
export const Q2Message: {
|
|
5
|
+
prototype: Q2Message;
|
|
6
|
+
new (): Q2Message;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2MonthPicker extends Components.Q2MonthPicker, HTMLElement {}
|
|
4
|
+
export const Q2MonthPicker: {
|
|
5
|
+
prototype: Q2MonthPicker;
|
|
6
|
+
new (): Q2MonthPicker;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { l as loc, o as overrideFocus } from './index13.js';
|
|
3
|
+
import { d as defineCustomElement$4 } from './index5.js';
|
|
4
|
+
import { d as defineCustomElement$3 } from './index7.js';
|
|
5
|
+
import { d as defineCustomElement$2 } from './index9.js';
|
|
6
|
+
|
|
7
|
+
const q2MonthPickerCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}.month-container{--comp-month-primary-bg:var(--tct-btn-primary-bg, var(--t-btn-primary-bg, #2e2e2e));--comp-month-primary-font-color:var(--tct-btn-primary-font-color, var(--t-btn-primary-font-color, var(--tct-white, var(--app-white, #ffffff))));--comp-month-secondary-bg:var(--tct-btn-secondary-bg, var(--t-button-default-bg, #cccccc));--comp-month-secondary-font-color:var(--tct-btn-secondary-font-color, var(--t-btn-secondary-font-color, var(--t-button-default-font-color, #2e2e2e)))}.month-container .navigation{display:flex;justify-content:space-between;flex-direction:row}.month-container .navigation .year-btn{padding:0 1rem;display:flex;align-items:center}.month-container .navigation .year-btn .year{margin-right:0.2rem}.month-container .navigation .year-btn .year-icon{--t-icon-stroke-width:2px;width:16px;height:16px;transition:all 0.3s ease-in-out}.month-container .navigation .year-btn .year-icon.on{transform:rotate(-180deg)}.month-container .navigation .month-controller{display:flex;align-items:center}.month-container .month-list{display:grid;grid-template-columns:auto auto auto}.month-container .month-list .month{display:flex;justify-content:center;align-items:center;padding:0.5rem 0}.month-container .month-list .month .month-button{border-radius:50%;aspect-ratio:1;width:50px;display:flex;justify-content:center;align-items:center}.month-container .month-list .month .month-button:hover{background-color:var(--comp-month-secondary-bg);color:var(--comp-month-secondary-font-color);cursor:pointer}.month-container .month-list .month .month-button:active,.month-container .month-list .month .month-button.active{background-color:var(--comp-month-primary-bg);color:var(--comp-month-primary-font-color)}.month-container .today-label{padding:0.5rem 0;color:var(--tct-calendar-day-selected-outline-color, var(--t-calendar-day-selected-outline-color, var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1))))}";
|
|
8
|
+
|
|
9
|
+
const Q2MonthPicker$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.__registerHost();
|
|
13
|
+
this.__attachShadow();
|
|
14
|
+
this.viewChange = createEvent(this, "viewChange", 7);
|
|
15
|
+
this.toggleChange = createEvent(this, "toggleChange", 7);
|
|
16
|
+
this.scheduledAfterRender = [];
|
|
17
|
+
this.monthGrid = [
|
|
18
|
+
[0, 1, 2],
|
|
19
|
+
[3, 4, 5],
|
|
20
|
+
[6, 7, 8],
|
|
21
|
+
[9, 10, 11],
|
|
22
|
+
];
|
|
23
|
+
this.months = [
|
|
24
|
+
'January',
|
|
25
|
+
'February',
|
|
26
|
+
'March',
|
|
27
|
+
'April',
|
|
28
|
+
'May',
|
|
29
|
+
'June',
|
|
30
|
+
'July',
|
|
31
|
+
'August',
|
|
32
|
+
'September',
|
|
33
|
+
'October',
|
|
34
|
+
'November',
|
|
35
|
+
'December',
|
|
36
|
+
].map(mon => ({
|
|
37
|
+
label: loc(`tecton.element.calendar.months.${mon}`),
|
|
38
|
+
abbr: loc(`tecton.element.calendar.months.abbr.${mon}`),
|
|
39
|
+
}));
|
|
40
|
+
this.onMonthSelection = (event) => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
const targetElement = event.target.closest('.month-button');
|
|
43
|
+
if ((_a = targetElement === null || targetElement === void 0 ? void 0 : targetElement.dataset) === null || _a === void 0 ? void 0 : _a.index) {
|
|
44
|
+
this.selectMonth(Number((_b = targetElement === null || targetElement === void 0 ? void 0 : targetElement.dataset) === null || _b === void 0 ? void 0 : _b.index));
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
this.onMonthKeydown = (event) => {
|
|
48
|
+
if (event.key === 'Escape' || event.key === 'Esc') {
|
|
49
|
+
this.toggleChange.emit({ close: true });
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const monthIndex = event.target.dataset.index;
|
|
53
|
+
if (!monthIndex)
|
|
54
|
+
return;
|
|
55
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
event.stopPropagation();
|
|
58
|
+
this.selectMonth(Number(monthIndex));
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
const nextMonthIndex = this.moveMonth(this.monthGrid, Number(monthIndex), event);
|
|
62
|
+
this.focusMonth(nextMonthIndex);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
this.moveMonth = (grid, index, event) => {
|
|
66
|
+
const rows = grid.length;
|
|
67
|
+
const cols = grid[0].length;
|
|
68
|
+
const row = Math.floor(index / cols);
|
|
69
|
+
const col = index % cols;
|
|
70
|
+
const current = [row, col];
|
|
71
|
+
if (event.key === 'ArrowUp') {
|
|
72
|
+
event.stopPropagation();
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
return grid[Math.max(0, current[0] - 1)][current[1]];
|
|
75
|
+
}
|
|
76
|
+
else if (event.key === 'ArrowDown') {
|
|
77
|
+
event.stopPropagation();
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
return grid[Math.min(rows - 1, current[0] + 1)][current[1]];
|
|
80
|
+
}
|
|
81
|
+
else if (event.key === 'ArrowLeft') {
|
|
82
|
+
event.stopPropagation();
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
return Math.max(0, index - 1);
|
|
85
|
+
}
|
|
86
|
+
else if (event.key === 'ArrowRight') {
|
|
87
|
+
event.stopPropagation();
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
return Math.min(this.months.length - 1, index + 1);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
return grid[current[0]][current[1]];
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
this.focusMonth = (index) => {
|
|
96
|
+
const nextMonth = this.hostElement.shadowRoot.querySelector(`.month-button[data-index="${index}"]`);
|
|
97
|
+
if (nextMonth) {
|
|
98
|
+
this.focusedIndex = index;
|
|
99
|
+
nextMonth.focus();
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
this.selectMonth = (index) => {
|
|
103
|
+
var _a, _b, _c;
|
|
104
|
+
this.selectedIndex = index;
|
|
105
|
+
this.focusedIndex = index;
|
|
106
|
+
const nextMonth = this.hostElement.shadowRoot.querySelector(`.month-button[data-index="${index}"]`);
|
|
107
|
+
(_a = this.hostElement.shadowRoot
|
|
108
|
+
.querySelectorAll(`.month-button`)) === null || _a === void 0 ? void 0 : _a.forEach(el => el.classList.remove('active'));
|
|
109
|
+
nextMonth === null || nextMonth === void 0 ? void 0 : nextMonth.classList.add('active');
|
|
110
|
+
nextMonth === null || nextMonth === void 0 ? void 0 : nextMonth.focus();
|
|
111
|
+
const value = {
|
|
112
|
+
view: 'day',
|
|
113
|
+
monthIndex: index,
|
|
114
|
+
selectedYear: this.year,
|
|
115
|
+
};
|
|
116
|
+
(_c = (_b = this.hostElement).onchange) === null || _c === void 0 ? void 0 : _c.call(_b, new CustomEvent('click', {
|
|
117
|
+
bubbles: true,
|
|
118
|
+
detail: value,
|
|
119
|
+
}));
|
|
120
|
+
this.viewChange.emit(value);
|
|
121
|
+
};
|
|
122
|
+
this.selectYear = (year) => {
|
|
123
|
+
this.year = Math.max(1970, year);
|
|
124
|
+
};
|
|
125
|
+
this.year = Number(new Date().toLocaleString('en-US', { year: 'numeric' }));
|
|
126
|
+
this.disabledMonths = undefined;
|
|
127
|
+
this.today = undefined;
|
|
128
|
+
this.selectedIndex = 0;
|
|
129
|
+
this.focusedIndex = 0;
|
|
130
|
+
this.showYearLayer = false;
|
|
131
|
+
}
|
|
132
|
+
componentDidRender() {
|
|
133
|
+
var _a;
|
|
134
|
+
(_a = this.scheduledAfterRender) === null || _a === void 0 ? void 0 : _a.forEach(fn => fn());
|
|
135
|
+
this.scheduledAfterRender = [];
|
|
136
|
+
}
|
|
137
|
+
componentDidLoad() {
|
|
138
|
+
overrideFocus(this.hostElement);
|
|
139
|
+
}
|
|
140
|
+
render() {
|
|
141
|
+
return (h("div", { class: "month-container", onKeyDown: this.onMonthKeydown }, h("div", { class: "navigation" }, h("q2-btn", { class: "year-btn", onClick: () => this.viewChange.emit({
|
|
142
|
+
view: 'year',
|
|
143
|
+
selectedYear: this.year,
|
|
144
|
+
}) }, h("span", { class: "year" }, this.year), h("q2-icon", { class: "year-icon off", type: "chevron-down" })), h("div", { class: "month-controller" }, h("div", { class: "cal-year-prev-next" }, h("q2-btn", { label: loc('tecton.element.calendar.previousYear'), "hide-label": true, class: "cal-nav-btn prev-year", "test-id": "previousYearButton", onClick: () => this.selectYear(this.year - 1) }, h("q2-icon", { type: "arrow-left" })), h("q2-btn", { label: loc('tecton.element.calendar.nextYear'), "hide-label": true, class: "cal-nav-btn next-year", "test-id": "nextYearButton", onClick: () => this.selectYear(this.year + 1) }, h("q2-icon", { type: "arrow-right" }))))), h("div", { class: "month-list", onClick: this.onMonthSelection }, this.months.map((month, index) => (h("div", { class: "month" }, h("span", { role: "button", class: "month-button", "data-index": index, "aria-label": month.label, tabindex: index === this.focusedIndex ? 0 : -1 }, month.abbr))))), this.today && (h("div", { class: "today-label" }, loc('tecton.element.calendar.today'), ": ", this.today))));
|
|
145
|
+
}
|
|
146
|
+
get hostElement() { return this; }
|
|
147
|
+
static get style() { return q2MonthPickerCss; }
|
|
148
|
+
}, [1, "q2-month-picker", {
|
|
149
|
+
"year": [1538],
|
|
150
|
+
"disabledMonths": [16],
|
|
151
|
+
"today": [1],
|
|
152
|
+
"selectedIndex": [32],
|
|
153
|
+
"focusedIndex": [32],
|
|
154
|
+
"showYearLayer": [32]
|
|
155
|
+
}]);
|
|
156
|
+
function defineCustomElement$1() {
|
|
157
|
+
if (typeof customElements === "undefined") {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const components = ["q2-month-picker", "q2-btn", "q2-icon", "q2-loading"];
|
|
161
|
+
components.forEach(tagName => { switch (tagName) {
|
|
162
|
+
case "q2-month-picker":
|
|
163
|
+
if (!customElements.get(tagName)) {
|
|
164
|
+
customElements.define(tagName, Q2MonthPicker$1);
|
|
165
|
+
}
|
|
166
|
+
break;
|
|
167
|
+
case "q2-btn":
|
|
168
|
+
if (!customElements.get(tagName)) {
|
|
169
|
+
defineCustomElement$4();
|
|
170
|
+
}
|
|
171
|
+
break;
|
|
172
|
+
case "q2-icon":
|
|
173
|
+
if (!customElements.get(tagName)) {
|
|
174
|
+
defineCustomElement$3();
|
|
175
|
+
}
|
|
176
|
+
break;
|
|
177
|
+
case "q2-loading":
|
|
178
|
+
if (!customElements.get(tagName)) {
|
|
179
|
+
defineCustomElement$2();
|
|
180
|
+
}
|
|
181
|
+
break;
|
|
182
|
+
} });
|
|
183
|
+
}
|
|
184
|
+
defineCustomElement$1();
|
|
185
|
+
|
|
186
|
+
const Q2MonthPicker = Q2MonthPicker$1;
|
|
187
|
+
const defineCustomElement = defineCustomElement$1;
|
|
188
|
+
|
|
189
|
+
export { Q2MonthPicker, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2Optgroup extends Components.Q2Optgroup, HTMLElement {}
|
|
4
|
+
export const Q2Optgroup: {
|
|
5
|
+
prototype: Q2Optgroup;
|
|
6
|
+
new (): Q2Optgroup;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as createGuid, l as loc } from './index13.js';
|
|
3
|
+
|
|
4
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block}.q2-optgroup-header{--comp-header-padding:var(--tct-scale-1, var(--app-scale-1x, 5px)) var(--tct-scale-2, var(--app-scale-2x, 10px));background:var(--tct-optgroup-header-bg, var(--t-optgroup-header-bg, var(--tct-gray-13, var(--t-gray-13, var(--tct-gray-l2, var(--app-gray-l2, #e6e6e6))))));padding:var(--tct-optgroup-header-padding, var(--t-optgroup-header-padding, var(--comp-header-padding)));font-weight:var(--tct-optgroup-header-font-weight, var(--t-optgroup-header-font-weight, 600));text-transform:var(--tct-optgroup-header-text-transform, var(--t-optgroup-header-text-transform, uppercase));position:sticky;top:var(--comp-multi-select-header-height, 0);z-index:1}";
|
|
5
|
+
|
|
6
|
+
const Q2Optgroup$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.guid = createGuid();
|
|
12
|
+
this.setHidden = () => {
|
|
13
|
+
this.hidden = this.options.every(opt => opt.hidden || opt._multiSelectHidden);
|
|
14
|
+
};
|
|
15
|
+
this.disabled = false;
|
|
16
|
+
this.label = undefined;
|
|
17
|
+
this.hidden = false;
|
|
18
|
+
}
|
|
19
|
+
/// LIFECYCLE HOOKS ///
|
|
20
|
+
componentWillLoad() {
|
|
21
|
+
const observer = new MutationObserver(this.setHidden);
|
|
22
|
+
observer.observe(this.hostElement, { childList: true, attributes: true, subtree: true });
|
|
23
|
+
this.mutationObserver = observer;
|
|
24
|
+
// set initially
|
|
25
|
+
this.setHidden();
|
|
26
|
+
this.disabledWatcher(this.disabled);
|
|
27
|
+
}
|
|
28
|
+
disconnectedCallback() {
|
|
29
|
+
this.mutationObserver.disconnect();
|
|
30
|
+
this.mutationObserver = null;
|
|
31
|
+
}
|
|
32
|
+
get headerId() {
|
|
33
|
+
return `q2-optgroup-header-${this.guid}`;
|
|
34
|
+
}
|
|
35
|
+
get options() {
|
|
36
|
+
return Array.from(this.hostElement.querySelectorAll('q2-option'));
|
|
37
|
+
}
|
|
38
|
+
///// OBSERVERS ///////
|
|
39
|
+
disabledWatcher(disabled) {
|
|
40
|
+
this.options.forEach(opt => {
|
|
41
|
+
opt.disabledGroup = !!disabled;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
return (h("div", { class: "q2-optgroup-container", hidden: this.hidden, "aria-labelledby": this.headerId, role: "group" }, h("div", { class: "q2-optgroup-header", id: this.headerId }, (this.label && loc(this.label)) || ''), h("div", { class: "q2-optgroup-options" }, h("slot", null))));
|
|
46
|
+
}
|
|
47
|
+
get hostElement() { return this; }
|
|
48
|
+
static get watchers() { return {
|
|
49
|
+
"disabled": ["disabledWatcher"]
|
|
50
|
+
}; }
|
|
51
|
+
static get style() { return stylesCss; }
|
|
52
|
+
}, [1, "q2-optgroup", {
|
|
53
|
+
"disabled": [516],
|
|
54
|
+
"label": [513],
|
|
55
|
+
"hidden": [32]
|
|
56
|
+
}]);
|
|
57
|
+
function defineCustomElement$1() {
|
|
58
|
+
if (typeof customElements === "undefined") {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const components = ["q2-optgroup"];
|
|
62
|
+
components.forEach(tagName => { switch (tagName) {
|
|
63
|
+
case "q2-optgroup":
|
|
64
|
+
if (!customElements.get(tagName)) {
|
|
65
|
+
customElements.define(tagName, Q2Optgroup$1);
|
|
66
|
+
}
|
|
67
|
+
break;
|
|
68
|
+
} });
|
|
69
|
+
}
|
|
70
|
+
defineCustomElement$1();
|
|
71
|
+
|
|
72
|
+
const Q2Optgroup = Q2Optgroup$1;
|
|
73
|
+
const defineCustomElement = defineCustomElement$1;
|
|
74
|
+
|
|
75
|
+
export { Q2Optgroup, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2OptionList extends Components.Q2OptionList, HTMLElement {}
|
|
4
|
+
export const Q2OptionList: {
|
|
5
|
+
prototype: Q2OptionList;
|
|
6
|
+
new (): Q2OptionList;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2Option extends Components.Q2Option, HTMLElement {}
|
|
4
|
+
export const Q2Option: {
|
|
5
|
+
prototype: Q2Option;
|
|
6
|
+
new (): Q2Option;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$2 } from './index7.js';
|
|
3
|
+
|
|
4
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{--comp-padding:0 var(--app-scale-2x, 10px);--comp-selected-icon-size:var(--tct-option-selected-icon-size, var(--t-option-selected-icon-size, var(--tct-scale-3, var(--app-scale-3x, 15px))));padding:var(--tct-option-padding, var(--t-option-padding, var(--comp-padding)));min-height:44px;align-items:center;cursor:pointer;grid-template-columns:var(--comp-selected-icon-size) 1fr;align-items:center;grid-template-areas:\"icon content\";gap:var(--tct-scale-1, var(--app-scale-1x, 5px))}:host([multiline]){--comp-padding:var(--app-scale-2, 10px) var(--app-scale-2, 10px);--comp-selected-icon-size:var(--tct-option-selected-icon-size, var(--t-option-selected-icon-size, 26px))}:host([_no-select]){grid-template-columns:1fr;grid-template-areas:\"content\"}:host([aria-disabled]){cursor:not-allowed;opacity:var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4));pointer-events:none}:host([aria-hidden]){display:none}:host(:not([hidden]):not([aria-hidden])){display:grid}:host(:not([aria-disabled]):hover),:host([active]),:host(:focus){background-color:var(--tct-option-active-bg, var(--tct-gray-14, var(--t-gray-14, var(--tct-gray-l3, var(--app-gray-l3, #f2f2f2)))))}:host(:focus){border:1px solid #33b4ff}q2-icon{grid-area:icon;--tct-icon-size:var(--comp-selected-icon-size)}.content{display:block;grid-area:content}:host(:not([multiline])) .content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}";
|
|
5
|
+
|
|
6
|
+
const Q2Option$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.role = 'option';
|
|
12
|
+
this.tabindex = '-1';
|
|
13
|
+
this.display = undefined;
|
|
14
|
+
this.value = undefined;
|
|
15
|
+
this.disabled = undefined;
|
|
16
|
+
this.optionId = undefined;
|
|
17
|
+
this.disabledGroup = undefined;
|
|
18
|
+
this.selected = undefined;
|
|
19
|
+
this.hidden = undefined;
|
|
20
|
+
this.multiline = undefined;
|
|
21
|
+
this.active = undefined;
|
|
22
|
+
this.noSelect = undefined;
|
|
23
|
+
this._multiSelectHidden = false;
|
|
24
|
+
}
|
|
25
|
+
componentWillLoad() {
|
|
26
|
+
this.handleDisplay();
|
|
27
|
+
}
|
|
28
|
+
handleDisplay() {
|
|
29
|
+
if (this.display || this.multiline)
|
|
30
|
+
return;
|
|
31
|
+
this.display = this.hostElement.textContent.trim();
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
const { disabled, disabledGroup, selected, _multiSelectHidden } = this;
|
|
35
|
+
const isDisabled = disabled || disabledGroup;
|
|
36
|
+
return (h(Host, { "aria-disabled": isDisabled ? 'true' : undefined, "aria-selected": selected ? 'true' : undefined, "aria-hidden": _multiSelectHidden ? 'true' : undefined }, this.selected && h("q2-icon", { type: "checkmark" }), h("div", { class: "content" }, h("slot", null))));
|
|
37
|
+
}
|
|
38
|
+
get hostElement() { return this; }
|
|
39
|
+
static get watchers() { return {
|
|
40
|
+
"display": ["handleDisplay"]
|
|
41
|
+
}; }
|
|
42
|
+
static get style() { return stylesCss; }
|
|
43
|
+
}, [1, "q2-option", {
|
|
44
|
+
"role": [513],
|
|
45
|
+
"tabindex": [513],
|
|
46
|
+
"display": [1025],
|
|
47
|
+
"value": [513],
|
|
48
|
+
"disabled": [516],
|
|
49
|
+
"optionId": [513, "option-id"],
|
|
50
|
+
"disabledGroup": [516, "disabled-group"],
|
|
51
|
+
"selected": [516],
|
|
52
|
+
"hidden": [516],
|
|
53
|
+
"multiline": [516],
|
|
54
|
+
"active": [516],
|
|
55
|
+
"noSelect": [516, "_no-select"],
|
|
56
|
+
"_multiSelectHidden": [516, "_multiselecthidden"]
|
|
57
|
+
}]);
|
|
58
|
+
function defineCustomElement$1() {
|
|
59
|
+
if (typeof customElements === "undefined") {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const components = ["q2-option", "q2-icon"];
|
|
63
|
+
components.forEach(tagName => { switch (tagName) {
|
|
64
|
+
case "q2-option":
|
|
65
|
+
if (!customElements.get(tagName)) {
|
|
66
|
+
customElements.define(tagName, Q2Option$1);
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
case "q2-icon":
|
|
70
|
+
if (!customElements.get(tagName)) {
|
|
71
|
+
defineCustomElement$2();
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
74
|
+
} });
|
|
75
|
+
}
|
|
76
|
+
defineCustomElement$1();
|
|
77
|
+
|
|
78
|
+
const Q2Option = Q2Option$1;
|
|
79
|
+
const defineCustomElement = defineCustomElement$1;
|
|
80
|
+
|
|
81
|
+
export { Q2Option, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2Pagination extends Components.Q2Pagination, HTMLElement {}
|
|
4
|
+
export const Q2Pagination: {
|
|
5
|
+
prototype: Q2Pagination;
|
|
6
|
+
new (): Q2Pagination;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|