q2-tecton-elements 1.23.0 → 1.25.0
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/action-sheet-4b366e9a.js +84 -0
- package/dist/cjs/{index-0648c2ec.js → index-dc92e71f.js} +32 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-action-sheet.cjs.entry.js +218 -0
- package/dist/cjs/q2-badge_2.cjs.entry.js +46 -17
- package/dist/cjs/q2-btn_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +2 -4
- package/dist/cjs/q2-card.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-area.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-bar.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-donut.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-icon.cjs.entry.js +1 -1
- package/dist/cjs/q2-loc.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +1 -1
- package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
- package/dist/cjs/q2-optgroup_2.cjs.entry.js +93 -0
- package/dist/cjs/q2-option-list_2.cjs.entry.js +226 -86
- package/dist/cjs/q2-pagination.cjs.entry.js +1 -1
- package/dist/cjs/q2-pill.cjs.entry.js +57 -18
- package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +1 -1
- package/dist/cjs/q2-section.cjs.entry.js +1 -1
- package/dist/cjs/q2-select.cjs.entry.js +148 -409
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js +1 -1
- package/dist/cjs/q2-tab-container.cjs.entry.js +1 -1
- package/dist/cjs/q2-tag.cjs.entry.js +21 -7
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/q2-action-sheet/index.js +345 -0
- package/dist/collection/components/q2-action-sheet/styles.css +215 -0
- package/dist/collection/components/q2-calendar/index.js +2 -4
- package/dist/collection/components/q2-checkbox/index.js +2 -2
- package/dist/collection/components/q2-dropdown/index.js +1 -1
- package/dist/collection/components/q2-input/index.js +46 -17
- package/dist/collection/components/q2-loading/index.js +1 -1
- package/dist/collection/components/q2-optgroup/styles.css +2 -2
- package/dist/collection/components/q2-option/index.js +3 -58
- package/dist/collection/components/q2-option/styles.css +7 -0
- package/dist/collection/components/q2-option-list/index.js +290 -102
- package/dist/collection/components/q2-pill/index.js +79 -18
- package/dist/collection/components/q2-pill/styles.css +1 -2
- package/dist/collection/components/q2-popover/index.js +17 -3
- package/dist/collection/components/q2-popover/styles.css +10 -67
- package/dist/collection/components/q2-radio/index.js +2 -2
- package/dist/collection/components/q2-select/index.js +179 -427
- package/dist/collection/components/q2-select/styles.css +5 -11
- package/dist/collection/components/q2-tag/index.js +33 -19
- package/dist/collection/utils/action-sheet.js +79 -0
- package/dist/collection/utils/index.js +29 -5
- package/dist/components/action-sheet.js +81 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index10.js +1 -1
- package/dist/components/index11.js +42 -353
- package/dist/components/index12.js +44 -99
- package/dist/components/index13.js +495 -583
- package/dist/components/index14.js +137 -0
- package/dist/components/index15.js +629 -0
- package/dist/components/index5.js +1 -1
- package/dist/components/index6.js +1 -1
- package/dist/components/index7.js +1 -1
- package/dist/components/index8.js +46 -17
- package/dist/components/index9.js +2 -2
- package/dist/components/q2-action-sheet.d.ts +11 -0
- package/dist/components/q2-action-sheet.js +282 -0
- package/dist/components/q2-calendar.js +2 -4
- package/dist/components/q2-card.js +1 -1
- package/dist/components/q2-carousel-pane.js +1 -1
- package/dist/components/q2-carousel.js +1 -1
- package/dist/components/q2-chart-area.js +1 -1
- package/dist/components/q2-chart-bar.js +1 -1
- package/dist/components/q2-chart-donut.js +1 -1
- package/dist/components/q2-checkbox-group.js +1 -1
- package/dist/components/q2-checkbox.js +1 -1
- package/dist/components/q2-dropdown.js +2 -2
- package/dist/components/q2-editable-field.js +1 -1
- package/dist/components/q2-loc.js +1 -1
- package/dist/components/q2-month-picker.js +1 -1
- package/dist/components/q2-optgroup.js +1 -70
- package/dist/components/q2-option-list.js +1 -1
- package/dist/components/q2-option.js +1 -76
- package/dist/components/q2-pagination.js +1 -1
- package/dist/components/q2-pill.js +62 -21
- package/dist/components/q2-popover.js +1 -1
- package/dist/components/q2-radio-group.js +1 -1
- package/dist/components/q2-radio.js +3 -3
- package/dist/components/q2-section.js +1 -1
- package/dist/components/q2-select.js +179 -427
- package/dist/components/q2-stepper-pane.js +1 -1
- package/dist/components/q2-stepper-vertical.js +1 -1
- package/dist/components/q2-stepper.js +1 -1
- package/dist/components/q2-tab-container.js +1 -1
- package/dist/components/q2-tag.js +25 -11
- package/dist/components/q2-textarea.js +1 -1
- package/dist/docs.d.ts +148 -0
- package/dist/docs.json +8755 -0
- package/dist/esm/action-sheet-a9597b32.js +81 -0
- package/dist/esm/{index-501fd22e.js → index-d4a87058.js} +30 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-action-sheet.entry.js +214 -0
- package/dist/esm/q2-badge_2.entry.js +46 -17
- package/dist/esm/q2-btn_2.entry.js +1 -1
- package/dist/esm/q2-calendar.entry.js +2 -4
- package/dist/esm/q2-card.entry.js +1 -1
- package/dist/esm/q2-carousel-pane.entry.js +1 -1
- package/dist/esm/q2-carousel.entry.js +1 -1
- package/dist/esm/q2-chart-area.entry.js +1 -1
- package/dist/esm/q2-chart-bar.entry.js +1 -1
- package/dist/esm/q2-chart-donut.entry.js +1 -1
- package/dist/esm/q2-checkbox-group.entry.js +1 -1
- package/dist/esm/q2-checkbox.entry.js +1 -1
- package/dist/esm/q2-dropdown-item.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +1 -1
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-icon.entry.js +1 -1
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +1 -1
- package/dist/esm/q2-month-picker.entry.js +1 -1
- package/dist/esm/q2-optgroup_2.entry.js +88 -0
- package/dist/esm/q2-option-list_2.entry.js +226 -86
- package/dist/esm/q2-pagination.entry.js +1 -1
- package/dist/esm/q2-pill.entry.js +57 -18
- package/dist/esm/q2-radio-group.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +1 -1
- package/dist/esm/q2-section.entry.js +1 -1
- package/dist/esm/q2-select.entry.js +148 -409
- package/dist/esm/q2-stepper-pane.entry.js +1 -1
- package/dist/esm/q2-stepper-vertical.entry.js +1 -1
- package/dist/esm/q2-stepper.entry.js +1 -1
- package/dist/esm/q2-tab-container.entry.js +1 -1
- package/dist/esm/q2-tag.entry.js +22 -8
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +1 -1
- package/dist/q2-tecton-elements/p-059065e4.js +1 -0
- package/dist/q2-tecton-elements/{p-9b101e22.entry.js → p-1a744921.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-3fd5d010.entry.js → p-1b95e43f.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-3603fcdc.entry.js → p-1ea4b8bd.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-53be87c8.entry.js → p-1f3eb04c.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-25839309.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-38a33baa.entry.js → p-274ec152.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-6be86940.entry.js → p-2ba9e1a2.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-ebd7efa5.entry.js → p-2c309c54.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-3e9a30c4.entry.js → p-2cc70f49.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-604b22a8.entry.js → p-2ceb41c4.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-2e938b20.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-5b1aba1a.entry.js → p-306a4bc7.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-32f44993.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-d7b27803.entry.js → p-3a9aac19.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-3c73ce3f.entry.js +1 -0
- package/dist/q2-tecton-elements/p-4a95f78e.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-6b7e1ebd.entry.js → p-4b48a49d.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-4b92e44e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-5ecb9c27.entry.js +1 -0
- package/dist/q2-tecton-elements/p-6779270e.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-70b01387.entry.js → p-72fc58e7.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-7ac02ae5.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-78fac0fa.entry.js → p-7c168977.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-d27b2caa.entry.js → p-7c9bf80a.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-83d678c7.entry.js +1 -0
- package/dist/q2-tecton-elements/p-a1926e65.js +1 -0
- package/dist/q2-tecton-elements/{p-24f4571d.entry.js → p-a3a5b57b.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-a6296870.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-45d61789.entry.js → p-a64e7eb1.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-8dea9a0c.entry.js → p-ad83984e.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-bf41e71b.entry.js → p-bf0ed24a.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-a2add94e.entry.js → p-bff85959.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7aa80653.entry.js → p-c4a9ab25.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-ea5383ba.entry.js +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/helpers.js +3 -2
- package/dist/types/components/q2-action-sheet/index.d.ts +52 -0
- package/dist/types/components/q2-checkbox/index.d.ts +4 -1
- package/dist/types/components/q2-input/index.d.ts +5 -0
- package/dist/types/components/q2-option/index.d.ts +1 -4
- package/dist/types/components/q2-option-list/index.d.ts +16 -8
- package/dist/types/components/q2-pill/index.d.ts +10 -1
- package/dist/types/components/q2-popover/index.d.ts +2 -0
- package/dist/types/components/q2-select/index.d.ts +45 -47
- package/dist/types/components/q2-tag/index.d.ts +3 -3
- package/dist/types/components.d.ts +44 -17
- package/dist/types/global.d.ts +9 -2
- package/dist/types/utils/action-sheet.d.ts +12 -0
- package/dist/types/utils/index.d.ts +4 -1
- package/dist/types/workspace/workspace/Tecton_tecton-production_master/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -1
- package/package.json +4 -2
- package/dist/cjs/q2-optgroup.cjs.entry.js +0 -56
- package/dist/cjs/q2-option.cjs.entry.js +0 -46
- package/dist/esm/q2-optgroup.entry.js +0 -52
- package/dist/esm/q2-option.entry.js +0 -42
- package/dist/q2-tecton-elements/p-18629cbf.entry.js +0 -1
- package/dist/q2-tecton-elements/p-2c20fc43.entry.js +0 -1
- package/dist/q2-tecton-elements/p-3813f51d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-68ef0786.entry.js +0 -1
- package/dist/q2-tecton-elements/p-a510290a.js +0 -1
- package/dist/q2-tecton-elements/p-acc77332.entry.js +0 -1
- package/dist/q2-tecton-elements/p-ba73ee1f.entry.js +0 -1
- package/dist/q2-tecton-elements/p-ba76ecfd.entry.js +0 -1
- package/dist/q2-tecton-elements/p-bbdae095.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d68b5eb3.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d88e4383.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f1d06917.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f6e868c1.entry.js +0 -1
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* It contains typing information for all components that exist in this project.
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
+
import { ActionSheetData, ActionSheetListCloseData } from "q2-tecton-common/lib/utility/action-sheet";
|
|
8
9
|
import { IChartData } from "src/utils/charting";
|
|
9
10
|
import { IDonutChartData } from "./components/q2-chart-donut/index";
|
|
10
11
|
import { IEventDetail } from "./components/q2-input/types";
|
|
@@ -14,6 +15,12 @@ import { IStepperPaneEvent } from "./components/q2-stepper-pane/index";
|
|
|
14
15
|
export namespace Components {
|
|
15
16
|
interface ClickElsewhere {
|
|
16
17
|
}
|
|
18
|
+
interface Q2ActionSheet {
|
|
19
|
+
"data": ActionSheetData;
|
|
20
|
+
"hide": (data?: ActionSheetListCloseData) => Promise<void>;
|
|
21
|
+
"hideClose": boolean;
|
|
22
|
+
"show": () => Promise<void>;
|
|
23
|
+
}
|
|
17
24
|
interface Q2Avatar {
|
|
18
25
|
"icon": string;
|
|
19
26
|
"initials": string;
|
|
@@ -303,18 +310,16 @@ export namespace Components {
|
|
|
303
310
|
"display": string;
|
|
304
311
|
"hidden": boolean;
|
|
305
312
|
"multiline": boolean;
|
|
306
|
-
"
|
|
307
|
-
"optionId": string;
|
|
308
|
-
"role": string;
|
|
313
|
+
"role": 'option' | 'menuitem';
|
|
309
314
|
"selected": boolean;
|
|
310
|
-
"tabindex": string;
|
|
311
315
|
"value": string;
|
|
312
316
|
}
|
|
313
317
|
interface Q2OptionList {
|
|
314
318
|
"align": 'left' | 'right';
|
|
315
319
|
"customSearch": boolean;
|
|
316
|
-
"direction": 'up' | 'down';
|
|
317
320
|
"disabled": boolean;
|
|
321
|
+
"getContents": () => Promise<(HTMLQ2OptgroupElement | HTMLQ2OptionElement)[]>;
|
|
322
|
+
"getOptions": () => Promise<HTMLQ2OptionElement[]>;
|
|
318
323
|
"handleExternalKeydown": (event: KeyboardEvent) => Promise<void>;
|
|
319
324
|
"multiple": boolean;
|
|
320
325
|
"noSelect": boolean;
|
|
@@ -322,6 +327,7 @@ export namespace Components {
|
|
|
322
327
|
"selectedOptions": IOptionValue[];
|
|
323
328
|
"setActiveElement": (index: number) => Promise<void>;
|
|
324
329
|
"setDefaultActiveElement": () => Promise<void>;
|
|
330
|
+
"showSelected": boolean;
|
|
325
331
|
"type": 'menu' | 'listbox';
|
|
326
332
|
}
|
|
327
333
|
interface Q2Pagination {
|
|
@@ -336,6 +342,7 @@ export namespace Components {
|
|
|
336
342
|
interface Q2Pill {
|
|
337
343
|
"active": boolean;
|
|
338
344
|
"disabled": boolean;
|
|
345
|
+
"hoist": boolean;
|
|
339
346
|
"label": string;
|
|
340
347
|
"maxLength": number;
|
|
341
348
|
"multiple": boolean;
|
|
@@ -390,6 +397,7 @@ export namespace Components {
|
|
|
390
397
|
"disabled": boolean;
|
|
391
398
|
"errors": string[];
|
|
392
399
|
"hideLabel": boolean;
|
|
400
|
+
"hoist": boolean;
|
|
393
401
|
"invalid": boolean;
|
|
394
402
|
"label": string;
|
|
395
403
|
"minRows": number;
|
|
@@ -400,7 +408,7 @@ export namespace Components {
|
|
|
400
408
|
"popDirection": 'up' | 'down';
|
|
401
409
|
"readonly": boolean;
|
|
402
410
|
"searchable": boolean;
|
|
403
|
-
"selectedOptions":
|
|
411
|
+
"selectedOptions": string[];
|
|
404
412
|
"value": string;
|
|
405
413
|
}
|
|
406
414
|
interface Q2Stepper {
|
|
@@ -436,11 +444,11 @@ export namespace Components {
|
|
|
436
444
|
"value": string;
|
|
437
445
|
}
|
|
438
446
|
interface Q2Tag {
|
|
447
|
+
"hoist": boolean;
|
|
439
448
|
"label": string;
|
|
440
449
|
"open": boolean;
|
|
441
450
|
"popoverDirection": 'up' | 'down';
|
|
442
451
|
"popoverMinHeight": number;
|
|
443
|
-
"role": string;
|
|
444
452
|
"theme": 'primary' | 'secondary' | 'tertiary';
|
|
445
453
|
}
|
|
446
454
|
interface Q2Textarea {
|
|
@@ -489,6 +497,10 @@ export interface ClickElsewhereCustomEvent<T> extends CustomEvent<T> {
|
|
|
489
497
|
detail: T;
|
|
490
498
|
target: HTMLClickElsewhereElement;
|
|
491
499
|
}
|
|
500
|
+
export interface Q2ActionSheetCustomEvent<T> extends CustomEvent<T> {
|
|
501
|
+
detail: T;
|
|
502
|
+
target: HTMLQ2ActionSheetElement;
|
|
503
|
+
}
|
|
492
504
|
export interface Q2CalendarCustomEvent<T> extends CustomEvent<T> {
|
|
493
505
|
detail: T;
|
|
494
506
|
target: HTMLQ2CalendarElement;
|
|
@@ -604,6 +616,12 @@ declare global {
|
|
|
604
616
|
prototype: HTMLClickElsewhereElement;
|
|
605
617
|
new (): HTMLClickElsewhereElement;
|
|
606
618
|
};
|
|
619
|
+
interface HTMLQ2ActionSheetElement extends Components.Q2ActionSheet, HTMLStencilElement {
|
|
620
|
+
}
|
|
621
|
+
var HTMLQ2ActionSheetElement: {
|
|
622
|
+
prototype: HTMLQ2ActionSheetElement;
|
|
623
|
+
new (): HTMLQ2ActionSheetElement;
|
|
624
|
+
};
|
|
607
625
|
interface HTMLQ2AvatarElement extends Components.Q2Avatar, HTMLStencilElement {
|
|
608
626
|
}
|
|
609
627
|
var HTMLQ2AvatarElement: {
|
|
@@ -852,6 +870,7 @@ declare global {
|
|
|
852
870
|
};
|
|
853
871
|
interface HTMLElementTagNameMap {
|
|
854
872
|
"click-elsewhere": HTMLClickElsewhereElement;
|
|
873
|
+
"q2-action-sheet": HTMLQ2ActionSheetElement;
|
|
855
874
|
"q2-avatar": HTMLQ2AvatarElement;
|
|
856
875
|
"q2-badge": HTMLQ2BadgeElement;
|
|
857
876
|
"q2-btn": HTMLQ2BtnElement;
|
|
@@ -899,6 +918,12 @@ declare namespace LocalJSX {
|
|
|
899
918
|
interface ClickElsewhere {
|
|
900
919
|
"onChange"?: (event: ClickElsewhereCustomEvent<any>) => void;
|
|
901
920
|
}
|
|
921
|
+
interface Q2ActionSheet {
|
|
922
|
+
"data"?: ActionSheetData;
|
|
923
|
+
"hideClose"?: boolean;
|
|
924
|
+
"onClose"?: (event: Q2ActionSheetCustomEvent<ActionSheetListCloseData>) => void;
|
|
925
|
+
"onReady"?: (event: Q2ActionSheetCustomEvent<any>) => void;
|
|
926
|
+
}
|
|
902
927
|
interface Q2Avatar {
|
|
903
928
|
"icon"?: string;
|
|
904
929
|
"initials"?: string;
|
|
@@ -1061,7 +1086,7 @@ declare namespace LocalJSX {
|
|
|
1061
1086
|
"indeterminate"?: boolean;
|
|
1062
1087
|
"label"?: string;
|
|
1063
1088
|
"name"?: string;
|
|
1064
|
-
"onChange"?: (event: Q2CheckboxCustomEvent<
|
|
1089
|
+
"onChange"?: (event: Q2CheckboxCustomEvent<{ value: string; checked: boolean }>) => void;
|
|
1065
1090
|
"readonly"?: boolean;
|
|
1066
1091
|
"type"?: string;
|
|
1067
1092
|
"value"?: string;
|
|
@@ -1202,24 +1227,22 @@ declare namespace LocalJSX {
|
|
|
1202
1227
|
"display"?: string;
|
|
1203
1228
|
"hidden"?: boolean;
|
|
1204
1229
|
"multiline"?: boolean;
|
|
1205
|
-
"
|
|
1206
|
-
"optionId"?: string;
|
|
1207
|
-
"role"?: string;
|
|
1230
|
+
"role"?: 'option' | 'menuitem';
|
|
1208
1231
|
"selected"?: boolean;
|
|
1209
|
-
"tabindex"?: string;
|
|
1210
1232
|
"value"?: string;
|
|
1211
1233
|
}
|
|
1212
1234
|
interface Q2OptionList {
|
|
1213
1235
|
"align"?: 'left' | 'right';
|
|
1214
1236
|
"customSearch"?: boolean;
|
|
1215
|
-
"direction"?: 'up' | 'down';
|
|
1216
1237
|
"disabled"?: boolean;
|
|
1217
1238
|
"multiple"?: boolean;
|
|
1218
1239
|
"noSelect"?: boolean;
|
|
1219
1240
|
"onChange"?: (event: Q2OptionListCustomEvent<{ value: string; values: IOptionValue[] }>) => void;
|
|
1220
|
-
"onPopoverState"?: (event: Q2OptionListCustomEvent<{ open: boolean }>) => void;
|
|
1241
|
+
"onPopoverState"?: (event: Q2OptionListCustomEvent<{ open: boolean; action: 'close' | 'select' | 'open' }>) => void;
|
|
1242
|
+
"onReady"?: (event: Q2OptionListCustomEvent<any>) => void;
|
|
1221
1243
|
"role"?: 'listbox' | 'menu';
|
|
1222
1244
|
"selectedOptions"?: IOptionValue[];
|
|
1245
|
+
"showSelected"?: boolean;
|
|
1223
1246
|
"type"?: 'menu' | 'listbox';
|
|
1224
1247
|
}
|
|
1225
1248
|
interface Q2Pagination {
|
|
@@ -1235,6 +1258,7 @@ declare namespace LocalJSX {
|
|
|
1235
1258
|
interface Q2Pill {
|
|
1236
1259
|
"active"?: boolean;
|
|
1237
1260
|
"disabled"?: boolean;
|
|
1261
|
+
"hoist"?: boolean;
|
|
1238
1262
|
"label"?: string;
|
|
1239
1263
|
"maxLength"?: number;
|
|
1240
1264
|
"multiple"?: boolean;
|
|
@@ -1293,19 +1317,20 @@ declare namespace LocalJSX {
|
|
|
1293
1317
|
"disabled"?: boolean;
|
|
1294
1318
|
"errors"?: string[];
|
|
1295
1319
|
"hideLabel"?: boolean;
|
|
1320
|
+
"hoist"?: boolean;
|
|
1296
1321
|
"invalid"?: boolean;
|
|
1297
1322
|
"label"?: string;
|
|
1298
1323
|
"minRows"?: number;
|
|
1299
1324
|
"multilineOptions"?: boolean;
|
|
1300
1325
|
"multiple"?: boolean;
|
|
1301
|
-
"onChange"?: (event: Q2SelectCustomEvent<
|
|
1326
|
+
"onChange"?: (event: Q2SelectCustomEvent<{ value: string; selectedOptions: string[] }>) => void;
|
|
1302
1327
|
"onInput"?: (event: Q2SelectCustomEvent<any>) => void;
|
|
1303
1328
|
"optional"?: boolean;
|
|
1304
1329
|
"placeholder"?: string;
|
|
1305
1330
|
"popDirection"?: 'up' | 'down';
|
|
1306
1331
|
"readonly"?: boolean;
|
|
1307
1332
|
"searchable"?: boolean;
|
|
1308
|
-
"selectedOptions"?:
|
|
1333
|
+
"selectedOptions"?: string[];
|
|
1309
1334
|
"value"?: string;
|
|
1310
1335
|
}
|
|
1311
1336
|
interface Q2Stepper {
|
|
@@ -1348,12 +1373,12 @@ declare namespace LocalJSX {
|
|
|
1348
1373
|
"value"?: string;
|
|
1349
1374
|
}
|
|
1350
1375
|
interface Q2Tag {
|
|
1376
|
+
"hoist"?: boolean;
|
|
1351
1377
|
"label"?: string;
|
|
1352
1378
|
"onClick"?: (event: Q2TagCustomEvent<{ value: string }>) => void;
|
|
1353
1379
|
"open"?: boolean;
|
|
1354
1380
|
"popoverDirection"?: 'up' | 'down';
|
|
1355
1381
|
"popoverMinHeight"?: number;
|
|
1356
|
-
"role"?: string;
|
|
1357
1382
|
"theme"?: 'primary' | 'secondary' | 'tertiary';
|
|
1358
1383
|
}
|
|
1359
1384
|
interface Q2Textarea {
|
|
@@ -1402,6 +1427,7 @@ declare namespace LocalJSX {
|
|
|
1402
1427
|
}
|
|
1403
1428
|
interface IntrinsicElements {
|
|
1404
1429
|
"click-elsewhere": ClickElsewhere;
|
|
1430
|
+
"q2-action-sheet": Q2ActionSheet;
|
|
1405
1431
|
"q2-avatar": Q2Avatar;
|
|
1406
1432
|
"q2-badge": Q2Badge;
|
|
1407
1433
|
"q2-btn": Q2Btn;
|
|
@@ -1450,6 +1476,7 @@ declare module "@stencil/core" {
|
|
|
1450
1476
|
export namespace JSX {
|
|
1451
1477
|
interface IntrinsicElements {
|
|
1452
1478
|
"click-elsewhere": LocalJSX.ClickElsewhere & JSXBase.HTMLAttributes<HTMLClickElsewhereElement>;
|
|
1479
|
+
"q2-action-sheet": LocalJSX.Q2ActionSheet & JSXBase.HTMLAttributes<HTMLQ2ActionSheetElement>;
|
|
1453
1480
|
"q2-avatar": LocalJSX.Q2Avatar & JSXBase.HTMLAttributes<HTMLQ2AvatarElement>;
|
|
1454
1481
|
"q2-badge": LocalJSX.Q2Badge & JSXBase.HTMLAttributes<HTMLQ2BadgeElement>;
|
|
1455
1482
|
"q2-btn": LocalJSX.Q2Btn & JSXBase.HTMLAttributes<HTMLQ2BtnElement>;
|
package/dist/types/global.d.ts
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShowActionSheetFn } from 'q2-tecton-common/lib/utility/action-sheet';
|
|
2
|
+
import { LocFn, ResizeIframeFn, ResolveMenuFn, NavigateToFn, ShowOverpanelFn } from './util';
|
|
2
3
|
|
|
3
4
|
declare global {
|
|
4
5
|
interface Window {
|
|
6
|
+
tecton: {
|
|
7
|
+
actions: Record<string, any>;
|
|
8
|
+
sources: Record<string, any>;
|
|
9
|
+
};
|
|
5
10
|
TectonElements?: {
|
|
6
11
|
loc: LocFn;
|
|
7
12
|
resizeIframe: ResizeIframeFn;
|
|
8
13
|
resolveMenu: ResolveMenuFn;
|
|
9
14
|
navigateTo: NavigateToFn;
|
|
10
15
|
showOverpanel: ShowOverpanelFn;
|
|
16
|
+
showActionSheet?: ShowActionSheetFn;
|
|
11
17
|
};
|
|
12
18
|
Tecton?: {
|
|
13
19
|
inMobileApp: boolean;
|
|
14
20
|
noStrings: boolean;
|
|
15
21
|
platformUrl: string;
|
|
16
|
-
platformDimensions:
|
|
22
|
+
platformDimensions: Record<string, any>;
|
|
23
|
+
useActionSheets?: boolean;
|
|
17
24
|
};
|
|
18
25
|
__forceSmoothScrollPolyfill__: boolean;
|
|
19
26
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ActionSheetListCloseData, ActionSheetListData } from 'q2-tecton-common/lib/utility/action-sheet';
|
|
2
|
+
interface IActionSheetComponent {
|
|
3
|
+
hoist: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const shouldShowActionSheet: (component: IActionSheetComponent, event?: KeyboardEvent | MouseEvent) => boolean;
|
|
6
|
+
export declare const buildListData: (component: IActionSheetListComponent, event?: MouseEvent | KeyboardEvent) => Promise<ActionSheetListData>;
|
|
7
|
+
interface IActionSheetListComponent {
|
|
8
|
+
optionList: HTMLQ2OptionListElement;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const showActionSheetList: (component: IActionSheetListComponent, event?: MouseEvent | KeyboardEvent) => Promise<ActionSheetListCloseData>;
|
|
12
|
+
export {};
|
|
@@ -10,6 +10,8 @@ import { Q2Loading } from 'src/components/q2-loading';
|
|
|
10
10
|
import { Q2Radio } from 'src/components/q2-radio';
|
|
11
11
|
import { Q2Select } from 'src/components/q2-select';
|
|
12
12
|
import { FormFieldTypes, IDict } from 'src/util';
|
|
13
|
+
export declare function isMobile(): boolean;
|
|
14
|
+
export declare function isHostLosingFocus(event: FocusEvent, hostElement: HTMLElement): boolean;
|
|
13
15
|
export declare function isRelatedTargetWithinHost(event: FocusEvent, element: HTMLElement): boolean;
|
|
14
16
|
export declare function isEventFromElement(event: Event, element: HTMLElement): boolean;
|
|
15
17
|
export declare function overrideFocus(hostElement: HTMLElement): void;
|
|
@@ -18,7 +20,8 @@ export declare function isFirefox(): boolean;
|
|
|
18
20
|
export declare function isTouchDevice(): boolean;
|
|
19
21
|
export declare function isSafari(): boolean;
|
|
20
22
|
export declare function createGuid(): number;
|
|
21
|
-
export declare function nextPaint(fn: () => void
|
|
23
|
+
export declare function nextPaint(fn: (value?: unknown) => void): void;
|
|
24
|
+
export declare function waitForNextPaint(): Promise<unknown>;
|
|
22
25
|
export declare function capitalize(value: string): string;
|
|
23
26
|
export declare function pick(props: string[]): (obj: object) => object;
|
|
24
27
|
export declare function loc(key: string, subs?: IDict<any> | string[]): string;
|
|
@@ -11,6 +11,6 @@ export declare function setWindowHeight(height: number): void;
|
|
|
11
11
|
export declare function makeDomRect(customAttributes: any): any;
|
|
12
12
|
export declare const base64Image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=";
|
|
13
13
|
export declare function getActiveElementTestId(page: E2EPage): Promise<string>;
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const getFocusedOptionValue: (page: E2EPage) => Promise<string>;
|
|
15
15
|
export declare const getFocusedTagName: (page: E2EPage) => Promise<string>;
|
|
16
16
|
export declare function getFocusedAttribute(page: E2EPage, attribute: string): Promise<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "q2-tecton-elements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "Q2 Tecton Custom Elements",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"build:prod": "stencil build",
|
|
23
23
|
"build:elements": "stencil build",
|
|
24
24
|
"build:local": "stencil build --dev --watch --serve",
|
|
25
|
+
"build:docs-json": "stencil build --docs-json dist/docs.json",
|
|
25
26
|
"test": "stencil test --spec --e2e",
|
|
26
27
|
"test:dev": "stencil test --spec --e2e --watchAll",
|
|
27
28
|
"clean": "rm -rf dist tmp",
|
|
@@ -49,8 +50,9 @@
|
|
|
49
50
|
"dependencies": {
|
|
50
51
|
"@stencil/core": "2.19.2",
|
|
51
52
|
"puppeteer": "^10.4.0",
|
|
53
|
+
"q2-tecton-common": "^1.25.0",
|
|
52
54
|
"smoothscroll-polyfill": "^0.4.4",
|
|
53
55
|
"swiper": "8.4.4"
|
|
54
56
|
},
|
|
55
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "e2c4b205d38e2411a417a5afa4903e58a308e9ad"
|
|
56
58
|
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-734296a7.js');
|
|
6
|
-
const index$1 = require('./index-0648c2ec.js');
|
|
7
|
-
|
|
8
|
-
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}";
|
|
9
|
-
|
|
10
|
-
const Q2Optgroup = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
this.guid = index$1.createGuid();
|
|
14
|
-
this.setHidden = () => {
|
|
15
|
-
this.hidden = this.options.every(opt => opt.hidden || opt._multiSelectHidden);
|
|
16
|
-
};
|
|
17
|
-
this.disabled = false;
|
|
18
|
-
this.label = undefined;
|
|
19
|
-
this.hidden = false;
|
|
20
|
-
}
|
|
21
|
-
/// LIFECYCLE HOOKS ///
|
|
22
|
-
componentWillLoad() {
|
|
23
|
-
const observer = new MutationObserver(this.setHidden);
|
|
24
|
-
observer.observe(this.hostElement, { childList: true, attributes: true, subtree: true });
|
|
25
|
-
this.mutationObserver = observer;
|
|
26
|
-
// set initially
|
|
27
|
-
this.setHidden();
|
|
28
|
-
this.disabledWatcher(this.disabled);
|
|
29
|
-
}
|
|
30
|
-
disconnectedCallback() {
|
|
31
|
-
this.mutationObserver.disconnect();
|
|
32
|
-
this.mutationObserver = null;
|
|
33
|
-
}
|
|
34
|
-
get headerId() {
|
|
35
|
-
return `q2-optgroup-header-${this.guid}`;
|
|
36
|
-
}
|
|
37
|
-
get options() {
|
|
38
|
-
return Array.from(this.hostElement.querySelectorAll('q2-option'));
|
|
39
|
-
}
|
|
40
|
-
///// OBSERVERS ///////
|
|
41
|
-
disabledWatcher(disabled) {
|
|
42
|
-
this.options.forEach(opt => {
|
|
43
|
-
opt.disabledGroup = !!disabled;
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
render() {
|
|
47
|
-
return (index.h("div", { class: "q2-optgroup-container", hidden: this.hidden, "aria-labelledby": this.headerId, role: "group" }, index.h("div", { class: "q2-optgroup-header", id: this.headerId }, (this.label && index$1.loc(this.label)) || ''), index.h("div", { class: "q2-optgroup-options" }, index.h("slot", null))));
|
|
48
|
-
}
|
|
49
|
-
get hostElement() { return index.getElement(this); }
|
|
50
|
-
static get watchers() { return {
|
|
51
|
-
"disabled": ["disabledWatcher"]
|
|
52
|
-
}; }
|
|
53
|
-
};
|
|
54
|
-
Q2Optgroup.style = stylesCss;
|
|
55
|
-
|
|
56
|
-
exports.q2_optgroup = Q2Optgroup;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-734296a7.js');
|
|
6
|
-
|
|
7
|
-
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}";
|
|
8
|
-
|
|
9
|
-
const Q2Option = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.role = 'option';
|
|
13
|
-
this.tabindex = '-1';
|
|
14
|
-
this.display = undefined;
|
|
15
|
-
this.value = undefined;
|
|
16
|
-
this.disabled = undefined;
|
|
17
|
-
this.optionId = undefined;
|
|
18
|
-
this.disabledGroup = undefined;
|
|
19
|
-
this.selected = undefined;
|
|
20
|
-
this.hidden = undefined;
|
|
21
|
-
this.multiline = undefined;
|
|
22
|
-
this.active = undefined;
|
|
23
|
-
this.noSelect = undefined;
|
|
24
|
-
this._multiSelectHidden = false;
|
|
25
|
-
}
|
|
26
|
-
componentWillLoad() {
|
|
27
|
-
this.handleDisplay();
|
|
28
|
-
}
|
|
29
|
-
handleDisplay() {
|
|
30
|
-
if (this.display || this.multiline)
|
|
31
|
-
return;
|
|
32
|
-
this.display = this.hostElement.textContent.trim();
|
|
33
|
-
}
|
|
34
|
-
render() {
|
|
35
|
-
const { disabled, disabledGroup, selected, _multiSelectHidden } = this;
|
|
36
|
-
const isDisabled = disabled || disabledGroup;
|
|
37
|
-
return (index.h(index.Host, { "aria-disabled": isDisabled ? 'true' : undefined, "aria-selected": selected ? 'true' : undefined, "aria-hidden": _multiSelectHidden ? 'true' : undefined }, this.selected && index.h("q2-icon", { type: "checkmark" }), index.h("div", { class: "content" }, index.h("slot", null))));
|
|
38
|
-
}
|
|
39
|
-
get hostElement() { return index.getElement(this); }
|
|
40
|
-
static get watchers() { return {
|
|
41
|
-
"display": ["handleDisplay"]
|
|
42
|
-
}; }
|
|
43
|
-
};
|
|
44
|
-
Q2Option.style = stylesCss;
|
|
45
|
-
|
|
46
|
-
exports.q2_option = Q2Option;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement } from './index-bb1c8c7f.js';
|
|
2
|
-
import { c as createGuid, l as loc } from './index-501fd22e.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 = class {
|
|
7
|
-
constructor(hostRef) {
|
|
8
|
-
registerInstance(this, hostRef);
|
|
9
|
-
this.guid = createGuid();
|
|
10
|
-
this.setHidden = () => {
|
|
11
|
-
this.hidden = this.options.every(opt => opt.hidden || opt._multiSelectHidden);
|
|
12
|
-
};
|
|
13
|
-
this.disabled = false;
|
|
14
|
-
this.label = undefined;
|
|
15
|
-
this.hidden = false;
|
|
16
|
-
}
|
|
17
|
-
/// LIFECYCLE HOOKS ///
|
|
18
|
-
componentWillLoad() {
|
|
19
|
-
const observer = new MutationObserver(this.setHidden);
|
|
20
|
-
observer.observe(this.hostElement, { childList: true, attributes: true, subtree: true });
|
|
21
|
-
this.mutationObserver = observer;
|
|
22
|
-
// set initially
|
|
23
|
-
this.setHidden();
|
|
24
|
-
this.disabledWatcher(this.disabled);
|
|
25
|
-
}
|
|
26
|
-
disconnectedCallback() {
|
|
27
|
-
this.mutationObserver.disconnect();
|
|
28
|
-
this.mutationObserver = null;
|
|
29
|
-
}
|
|
30
|
-
get headerId() {
|
|
31
|
-
return `q2-optgroup-header-${this.guid}`;
|
|
32
|
-
}
|
|
33
|
-
get options() {
|
|
34
|
-
return Array.from(this.hostElement.querySelectorAll('q2-option'));
|
|
35
|
-
}
|
|
36
|
-
///// OBSERVERS ///////
|
|
37
|
-
disabledWatcher(disabled) {
|
|
38
|
-
this.options.forEach(opt => {
|
|
39
|
-
opt.disabledGroup = !!disabled;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
render() {
|
|
43
|
-
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))));
|
|
44
|
-
}
|
|
45
|
-
get hostElement() { return getElement(this); }
|
|
46
|
-
static get watchers() { return {
|
|
47
|
-
"disabled": ["disabledWatcher"]
|
|
48
|
-
}; }
|
|
49
|
-
};
|
|
50
|
-
Q2Optgroup.style = stylesCss;
|
|
51
|
-
|
|
52
|
-
export { Q2Optgroup as q2_optgroup };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-bb1c8c7f.js';
|
|
2
|
-
|
|
3
|
-
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}";
|
|
4
|
-
|
|
5
|
-
const Q2Option = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.role = 'option';
|
|
9
|
-
this.tabindex = '-1';
|
|
10
|
-
this.display = undefined;
|
|
11
|
-
this.value = undefined;
|
|
12
|
-
this.disabled = undefined;
|
|
13
|
-
this.optionId = undefined;
|
|
14
|
-
this.disabledGroup = undefined;
|
|
15
|
-
this.selected = undefined;
|
|
16
|
-
this.hidden = undefined;
|
|
17
|
-
this.multiline = undefined;
|
|
18
|
-
this.active = undefined;
|
|
19
|
-
this.noSelect = undefined;
|
|
20
|
-
this._multiSelectHidden = false;
|
|
21
|
-
}
|
|
22
|
-
componentWillLoad() {
|
|
23
|
-
this.handleDisplay();
|
|
24
|
-
}
|
|
25
|
-
handleDisplay() {
|
|
26
|
-
if (this.display || this.multiline)
|
|
27
|
-
return;
|
|
28
|
-
this.display = this.hostElement.textContent.trim();
|
|
29
|
-
}
|
|
30
|
-
render() {
|
|
31
|
-
const { disabled, disabledGroup, selected, _multiSelectHidden } = this;
|
|
32
|
-
const isDisabled = disabled || disabledGroup;
|
|
33
|
-
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))));
|
|
34
|
-
}
|
|
35
|
-
get hostElement() { return getElement(this); }
|
|
36
|
-
static get watchers() { return {
|
|
37
|
-
"display": ["handleDisplay"]
|
|
38
|
-
}; }
|
|
39
|
-
};
|
|
40
|
-
Q2Option.style = stylesCss;
|
|
41
|
-
|
|
42
|
-
export { Q2Option as q2_option };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as s,g as a}from"./p-926a3e80.js";import{g as e,o,n as r,i}from"./p-a510290a.js";const n=class{constructor(s){t(this,s),this.type="info",this.appearance="standard",this.description=!1,this.presentToggle=void 0}get isFirefox(){return e()}componentDidLoad(){o(this.hostElement)}async present(){const{isFirefox:t}=this;this.presentToggle=!this.presentToggle,t&&r((()=>{this.presentToggle=!1}))}delegateFocus(t){i(t,this.hostElement)&&this.hostElement.shadowRoot.querySelector(".message").focus()}render(){const{isFirefox:t}=this,a=t&&this.presentToggle,e=!t&&this.presentToggle,{description:o}=this;return s("div",{tabindex:"-1",class:"message",role:o?void 0:"alert","aria-live":o?void 0:"assertive","aria-atomic":o?void 0:"true","aria-relevant":o?void 0:"all"},"standard"===this.appearance?function(t){const a={success:"success",warning:"warning",danger:"error",error:"error",info:"info"};return s("q2-icon",{type:a[t]||a.info,class:"message-icon"})}(this.type):"",e&&s("div",{class:"sr"}),s("div",{class:"message-content","aria-hidden":a?"true":void 0},s("slot",null)))}get hostElement(){return a(this)}};n.style="*{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}:host([hidden]){display:none}.message{border-left-width:var(--tct-message-bar-width, var(--t-message-bar-width, var(--app-scale-1x, 5px)));border-left-style:solid;--comp-line-height:var(--tct-message-line-height, var(--t-message-line-height, var(--app-line-height, 1.428571429em)));display:grid;gap:var(--tct-scale-1, var(--app-scale-1x, 5px));align-items:flex-start;background:var(--tct-message-bg, var(--t-message-bg, var(--tct-gray-14, var(--t-gray-14, var(--tct-gray-l3, var(--app-gray-l3, #f2f2f2))))));color:var(--tct-message-font-color, var(--t-message-font-color, inherit));box-shadow:var(--tct-message-box-shadow, var(--t-message-box-shadow, inherit));border-radius:var(--tct-message-border-radius, var(--t-message-border-radius, inherit))}.message:focus{box-shadow:var(--const-global-focus)}.message-icon{--comp-top-offset:calc(calc(var(--comp-line-height) - var(--comp-icon-size)) / 2);--tct-icon-size:var(--comp-icon-size);top:var(--comp-top-offset);margin-bottom:calc(var(--comp-top-offset) * -1)}.message-content{flex:1;line-height:var(--comp-line-height)}::slotted(ul){padding-left:var(--tct-scale-l3, var(--app-scale-3x, 15px))}:host(:not([appearance])),:host([appearance=standard]){margin:var(--tct-scale-l3, var(--app-scale-3x, 15px)) 0}:host(:not([appearance])) .message,:host([appearance=standard]) .message{--comp-icon-size:var(--tct-message-icon-size, var(--t-message-icon-size, 24px));--comp-padding:var(--tct-message-padding, var(--t-message-padding, var(--app-scale-3x, 15px)));grid-template-columns:var(--comp-icon-size) 1fr;padding:var(--comp-padding);padding-left:calc(var(--comp-padding) - var(--tct-scale-2, var(--app-scale-2x, 10px)));padding-bottom:calc(var(--comp-padding) - var(--tct-scale-1, var(--app-scale-1x, 5px)))}:host(:not([appearance])) ::slotted(ul),:host([appearance=standard]) ::slotted(ul){margin:var(--tct-scale-l3, var(--app-scale-3x, 15px)) 0}:host([appearance=minimal]){margin:0}:host([appearance=minimal]) .message{padding:var(--tct-message-minimal-padding, var(--t-message-minimal-padding, var(--app-scale-2x, 10px)));grid-template-columns:1fr}:host([appearance=minimal]) ::slotted(ul){margin:var(--tct-scale-1, var(--app-scale-1x, 5px)) 0}:host(:not([type])) .message,:host([type=info]) .message{border-left-color:var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1))}:host(:not([type])) .message-icon,:host([type=info]) .message-icon{--tct-icon-stroke-primary:var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1));--tct-icon-stroke-secondary:var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1))}:host([type=success]) .message{border-left-color:var(--tct-stoplight-success, var(--const-stoplight-success, #0e8a00))}:host([type=success]) .message-icon{--tct-icon-stroke-primary:var(--tct-stoplight-success, var(--const-stoplight-success, #0e8a00));--tct-icon-stroke-secondary:var(--tct-stoplight-success, var(--const-stoplight-success, #0e8a00))}:host([type=warning]) .message{border-left-color:var(--tct-stoplight-warning, var(--const-stoplight-warning, #f0b400))}:host([type=warning]) .message-icon{--tct-icon-stroke-primary:var(--tct-stoplight-warning, var(--const-stoplight-warning, #f0b400));--tct-icon-stroke-secondary:var(--tct-stoplight-warning, var(--const-stoplight-warning, #f0b400))}:host([type=error]) .message,:host([type=danger]) .message{border-left-color:var(--tct-stoplight-error, var(--const-stoplight-alert, #c30000))}:host([type=error]) .message-icon,:host([type=danger]) .message-icon{--tct-icon-stroke-primary:var(--tct-stoplight-error, var(--const-stoplight-alert, #c30000));--tct-icon-stroke-secondary:var(--tct-stoplight-error, var(--const-stoplight-alert, #c30000))}";export{n as q2_message}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,H as e,g as s}from"./p-926a3e80.js";import{o as n,i as r}from"./p-a510290a.js";const a=class{constructor(o){t(this,o),this.change=i(this,"change",7),this.popoverState=i(this,"popoverState",7),this.scheduledAfterRender=[],this.keydownHandler=(t,i)=>{t.stopPropagation();const{activeIndex:o,customSearch:e,allOptions:s}=this,{key:n,shiftKey:r}=t;let a;switch(n){case" ":case"Enter":if(i){this.setDefaultActiveElement();break}if(t.preventDefault(),a=s.find((t=>t.active)),!a||a.disabled)break;this.selectOption(a.value);break;case"ArrowUp":if(t.preventDefault(),0===o)break;if(void 0===o)this.setDefaultActiveElement();else{const t=this.getNextVisibleIndex(-1);if(-1===t)break;this.adjustActiveOptionAndScroll(t-o)}break;case"ArrowDown":if(t.preventDefault(),o===s.length-1)break;if(void 0===o)this.setDefaultActiveElement();else{const t=this.getNextVisibleIndex(1);if(-1===t)break;this.adjustActiveOptionAndScroll(t-o)}break;case"Home":t.preventDefault(),this.openDropdownWithActiveElement(0);break;case"End":t.preventDefault(),this.openDropdownWithActiveElement(s.length-1);break;case"PageUp":t.preventDefault(),this.openDropdownWithActiveElement(Math.max(o-10,0));break;case"PageDown":t.preventDefault(),this.openDropdownWithActiveElement(Math.min(o+10,s.length-1));break;case"Tab":if(i)break;if(r)break;if(a=s.find((t=>t.active)),!a||a.disabled)return;this.selectOption(a.value);break;case"Esc":case"Escape":this.noSelect&&this.setActiveElement(null),this.popoverState.emit({open:!1});break;default:if(e)break;if(!n.match(/^[A-Za-z0-9]$/))break;this.searchAndFocus(n)}},this.focusoutHandler=t=>{const{relatedTarget:i}=t,o=this.allOptions.includes(i),e=!o&&this.hostElement.contains(i);(o||e)&&t.stopPropagation()},this.clickHandler=t=>{const i=t.target;"q2-option"!==i.localName||i.disabled||this.selectOption(i.value)},this.role="listbox",this.direction="down",this.customSearch=void 0,this.noSelect=void 0,this.align=void 0,this.selectedOptions=[],this.multiple=void 0,this.disabled=void 0,this.type=void 0,this.hasOptions=void 0}componentWillLoad(){this.hasOptions=!!this.hostElement.querySelectorAll("q2-option").length}componentDidLoad(){n(this.hostElement),this.checkOptions(),this.selectedOptionsUpdated()}componentDidRender(){this.scheduledAfterRender.forEach((t=>t())),this.scheduledAfterRender=[]}get allOptions(){return this.getRootSlot(this.hostElement)}checkOptions(){const{noSelect:t,type:i,allOptions:o}=this;if(!t&&!i)return;const e="menu"===i?"menuitem":"option";o.forEach((o=>{t&&(o.noSelect=!0),i&&(o.role=e)}))}getRootSlot(t){var i;const o=t.querySelector("slot"),e=null!==(i=null==o?void 0:o.assignedElements())&&void 0!==i?i:Array.from(t.children);return e.length&&"SLOT"===e[0].tagName?this.getRootSlot(e[0]):e}scrollToActiveOption(){const t=this.allOptions[this.activeIndex];null==t||t.scrollIntoView({block:"nearest"})}resizeIframe(){var t,i;return null===(i=null===(t=window.TectonElements)||void 0===t?void 0:t.resizeIframe)||void 0===i?void 0:i.call(t)}openDropdownWithActiveElement(t){this.disabled||(this.activeIndex=t,this.popoverState.emit({open:!0}),this.setActiveOption(),this.setFocusedOption(),this.scheduledAfterRender.push((()=>{this.scrollToActiveOption(),this.resizeIframe()})))}getDefaultActiveIndex(){const{allOptions:t}=this,i=t.findIndex((t=>t.selected));if(i>-1)return i;const o=t.findIndex((t=>!t.hidden));return o>-1?o:0}updateSingleOptionAttrs(){var t,i;const{allOptions:o,selectedOptions:e}=this,s=null!==(i=null===(t=e[0])||void 0===t?void 0:t.value)&&void 0!==i?i:void 0;o.forEach((t=>{t.selected=t.value===s}))}updateMultipleOptionAttrs(){const{allOptions:t,selectedOptions:i}=this,o=i.map((t=>t.value));t.forEach((t=>{t.selected=o.includes(t.value)}))}setActiveOption(){const t=this.activeIndex;this.allOptions.forEach(((i,o)=>{i.active=t===o}))}setFocusedOption(){const t=this.allOptions[this.activeIndex];t&&setTimeout((()=>{t.focus()}),25)}getNextVisibleIndex(t){let i=this.activeIndex+t;for(;i>=0&&i<=this.allOptions.length-1;){const{display:o,visibility:e}=window.getComputedStyle(this.allOptions[i]);if("none"!==o&&"hidden"!==e)return i;i+=t}return-1}selectOption(t){const i=this.allOptions.find((({value:i})=>i===t)),o={value:t,display:i.display||i.innerText.trim()},{multiple:e,noSelect:s}=this;let n;if(e){const{selectedOptions:i=[]}=this;n=i.find((({value:i})=>i===t))?i.filter((({value:i})=>i!==t)):[...i,o]}else n=[o];s?this.setActiveElement(null):this.selectedOptions=n,this.change.emit({value:t,values:n}),e||this.popoverState.emit({open:!1})}adjustActiveOptionAndScroll(t){this.activeIndex+=t,this.setActiveOption(),this.setFocusedOption(),this.scrollToActiveOption()}resetTimer(){this.searchStringTimer&&clearTimeout(this.searchStringTimer),this.searchStringTimer=window.setTimeout((()=>{this.searchString=null}),2e3)}searchAndFocus(t){this.resetTimer();let i=this.searchString?`${this.searchString}${t}`:t;i=i.replace(/[^0-9a-z]/gi,""),this.searchString=i;const o=new RegExp(i,"i"),e=this.allOptions.findIndex((t=>t.value===i||t.textContent.match(o)));-1!==e&&this.setActiveElement(e)}selectedOptionsUpdated(){this.multiple?this.updateMultipleOptionAttrs():this.updateSingleOptionAttrs()}delegateFocus(t){r(t,this.hostElement)&&(this.popoverState.emit({open:!0}),this.setDefaultActiveElement())}handleClick(t){t.stopPropagation()}async setDefaultActiveElement(){this.activeIndex=this.getDefaultActiveIndex(),this.setActiveOption(),this.setFocusedOption()}async setActiveElement(t){this.activeIndex=t,this.setActiveOption(),this.setFocusedOption()}async handleExternalKeydown(t){["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"].includes(t.key)&&this.popoverState.emit({open:!0}),["ArrowDown","ArrowUp"].includes(t.key)?(t.preventDefault(),this.setDefaultActiveElement()):this.keydownHandler(t,!0)}render(){return o(e,null,o("div",{class:"content",ref:t=>this.contentElement=t,onFocusout:this.focusoutHandler},o("div",{class:"options",role:this.type||"listbox",onKeyDown:this.keydownHandler,onClick:this.clickHandler},o("slot",null))))}get hostElement(){return s(this)}static get watchers(){return{selectedOptions:["selectedOptionsUpdated"]}}};a.style="*{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{position:relative;width:100%;display:block;line-height:var(--tct-option-list-line-height, var(--t-option-list-line-height, var(--app-line-height, 1.428571429em)))}.content{text-align:start}:host([is-sizeable]) .content{display:block;height:auto}";const h=class{constructor(o){t(this,o),this.popoverStateChanged=i(this,"popoverStateChanged",7),this.privateDirection="down",this.direction=void 0,this.align=void 0,this.open=void 0,this.block=void 0,this.minHeight=void 0,this.controlElement=void 0}componentDidLoad(){this.open&&this.determinePopDirection()}componentWillRender(){this.containerElement&&this.containerElement&&this.open&&this.determinePopDirection()}async toggle(){this.open=!this.open}openChanged(t){this.popoverStateChanged.emit({open:t})}popoverStateHandler(t){const{detail:{open:i}}=t;i!==this.open&&(this.open=i,t.stopPropagation())}determinePopDirection(){var t,i,o,e,s;const{containerElement:n,contentElement:r,direction:a,controlElement:h}=this;if(n&&(n.style.maxHeight=null),a)return this.privateDirection=a;const l=r.clientHeight,{top:d,height:c}=null!==(t=null==h?void 0:h.getBoundingClientRect())&&void 0!==t?t:{top:0,height:0},p=((null===(o=null===(i=window.Tecton)||void 0===i?void 0:i.platformDimensions)||void 0===o?void 0:o.scrollY)||0)+((null===(s=null===(e=window.Tecton)||void 0===e?void 0:e.platformDimensions)||void 0===s?void 0:s.innerHeight)||window.innerHeight)-d-c,v=l<=d;if(p>l)return this.privateDirection="down";if(v||!this.minHeight)return this.determinePopOffset(),this.privateDirection="up";const{minHeight:u=150}=this;if(p>=u+5){const t=Math.max(p-5,u);return n.style.setProperty("--comp-pop-max-height",`${t}px`),this.privateDirection="down"}{const t=Math.max(d,u);return n.style.setProperty("--comp-pop-max-height",`${t}px`),this.determinePopOffset(),this.privateDirection="up"}}determinePopOffset(){var t;const{controlElement:i,containerElement:o}=this,e=null!==(t=null==i?void 0:i.getBoundingClientRect().height)&&void 0!==t?t:0;o.style.setProperty("--comp-pop-offset",`${e}px`)}render(){return o("div",{ref:t=>this.containerElement=t,class:["container",this.privateDirection].join(" "),role:"menu"},o("div",{ref:t=>this.contentElement=t,class:"content"},o("slot",null)))}get hostElement(){return s(this)}static get watchers(){return{open:["openChanged"]}}};h.style="*{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}*{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-flex;width:100%}.container{display:block;overflow:hidden;opacity:0;height:0;position:absolute;visibility:hidden;background-color:var(--tct-popover-background-color, var(--t-popover-background-color, var(--app-white, #ffffff)));color:var(--tct-popover-text-color, var(--t-popover-text-color, var(--t-text, #4d4d4d)));z-index:var(--tct-popover-z-index, var(--t-popover-z-index, 100));width:max-content;min-width:var(--tct-popover-min-width, var(--t-popover-min-width, 135px));box-shadow:var(--tct-popover-box-shadow, var(--t-popover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))));text-align:start;left:0;transition:opacity var(--app-tween-1, 0.2s ease);border-radius:var(--tct-popover-border-radius, var(--t-popover-border-radius, 0));max-height:var(--comp-pop-max-height);--comp-scrollbar-size:var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));--comp-scrollbar-border-radius:var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));--comp-scrollbar-color:var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));scrollbar-width:thin;scrollbar-color:var(--comp-scrollbar-color) transparent}.container::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}.container::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}.container::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}:host([block]) .container{left:unset;right:unset;width:100%}:host([align=right]) .container{right:0;text-align:end;left:unset}:host([open]) .container{display:block;height:auto;overflow:auto;opacity:1;visibility:visible}.container.up{bottom:var(--comp-pop-offset)}click-elsewhere{position:relative;display:block}.content{height:auto}";export{a as q2_option_list,h as q2_popover}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as a,g as o}from"./p-926a3e80.js";import{o as e,i as r,l as s}from"./p-a510290a.js";const n=class{constructor(a){t(this,a),this.click=i(this,"click",7),this.activateFirstOption=!1,this.determineHasOptions=()=>{const t=!!this.hostElement.querySelectorAll("q2-option").length;this.hasOptions=t},this.onClickElsewhere=t=>{"click-elsewhere"===t.target.localName&&(t.stopPropagation(),this.popoverElement.open=!1)},this.handleChange=t=>{if(t.stopPropagation(),!this.hasOptions)return;const{value:i}=t.detail;this.click.emit({value:i})},this.handleClick=t=>{t.stopPropagation(),this.activateFirstOption=!1,this.popoverElement.toggle()},this.handleKeydown=t=>{this.activateFirstOption=!0,this.optionList.handleExternalKeydown(t)},this.handleButtonFocusout=t=>{var i;const a=t.relatedTarget;null!==(i="Q2-OPTION"===(null==a?void 0:a.tagName))&&void 0!==i&&i||(this.open=!1)},this.handleWrapperClick=()=>{this.dropdownBtn.focus(),this.dropdownBtn.click()},this.open=void 0,this.role="listitem",this.label=void 0,this.theme=void 0,this.popoverMinHeight=150,this.popoverDirection=void 0,this.hasOptions=void 0}componentWillLoad(){const t=new MutationObserver(this.determineHasOptions);t.observe(this.hostElement,{childList:!0,attributes:!0}),this.mutationObserver=t}componentDidLoad(){e(this.hostElement)}disconnectedCallback(){this.mutationObserver.disconnect(),this.mutationObserver=null}delegateFocus(t){r(t,this.hostElement)&&this.hasOptions&&this.dropdownBtn.focus()}popoverStateHandler({detail:{open:t}}){this.open!==t&&(this.open=t),t&&this.activateFirstOption?(this.optionList.focus(),this.activateFirstOption=!1):(this.optionList.setActiveElement(null),this.dropdownBtn.focus())}render(){const{hasOptions:t,open:i}=this,o=["tag-wrapper"];return t&&o.push("has-options"),a("click-elsewhere",{onChange:this.onClickElsewhere},a("div",{class:o.join(" "),onClick:t=>t.stopPropagation()},a("div",{class:"tag"},this.label),this.hasOptions&&a("div",{class:"btn-wrapper",onClick:this.handleWrapperClick},a("button",{ref:t=>this.dropdownBtn=t,"test-id":"btn-control",onClick:this.handleClick,onKeyDown:this.handleKeydown,onFocusout:this.handleButtonFocusout,"aria-controls":"option-list","aria-haspopup":"true","aria-expanded":i?"true":"false","aria-label":s("tecton.element.tag.viewOptions")},a("q2-icon",{type:"options"})))),this.hasOptions&&a("q2-popover",{ref:t=>this.popoverElement=t,controlElement:this.dropdownBtn,open:this.open,minHeight:this.popoverMinHeight,direction:this.popoverDirection},a("q2-option-list",{id:"option-list",ref:t=>this.optionList=t,onChange:this.handleChange,align:"right",type:"menu","no-select":!0},a("slot",null))))}get hostElement(){return o(this)}};n.style="*{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-block;position:relative;line-height:0}:host(:not(:last-child)){margin-inline-end:var(--tct-tag-margin, var(--t-tag-margin, var(--app-scale-2x, 10px)))}.tag-wrapper{--comp-tag-btn-size:var(--tct-tag-btn-size, var(--t-tag-btn-size, var(--app-scale-6x, 30px)));--comp-tag-background:var(--tct-tag-background, var(--t-tag-background, var(--t-gray-13, #e6e6e6)));--comp-tag-color:var(--tct-tag-color, var(--t-tag-color, var(--t-gray-3, #262626)));position:relative}:host([theme=primary]) .tag-wrapper{--comp-tag-background:var(--t-primary-l5, #61c4ff);--comp-tag-color:var(--t-primary-text, #ffffff)}:host([theme=secondary]) .tag-wrapper{--comp-tag-background:var(--t-secondary-l5, #d9e1e6);--comp-tag-color:var(--t-secondary-text, #000000)}:host([theme=tertiary]) .tag-wrapper{--comp-tag-background:var(--t-tertiary-l5, #f4fafe);--comp-tag-color:var(--t-tertiary-text, #000000)}.tag{height:var(--tct-tag-height, var(--t-tag-height, var(--app-scale-6x, 30px)));line-height:var(--tct-tag-height, var(--t-tag-height, var(--app-scale-6x, 30px)));padding-inline:var(--tct-tag-padding-inline, var(--t-tag-padding-inline, var(--app-scale-3x, 15px)));background:var(--comp-tag-background);color:var(--comp-tag-color);border-radius:var(--tct-tag-border-radius, var(--t-tag-border-radius, var(--app-border-radius-1, 3px)))}.has-options .tag{padding-right:var(--comp-tag-btn-size)}.btn-wrapper{--comp-tag-clickable-size:var(--tct-tag-clickable-size, var(--t-tag-clickable-size, 44px));--comp-tag-btn-offset:calc(calc(calc(var(--comp-tag-clickable-size) - var(--comp-tag-btn-size)) / 2) * -1);height:var(--comp-tag-clickable-size);width:var(--comp-tag-clickable-size);display:flex;align-items:center;justify-content:center;position:absolute;right:var(--comp-tag-btn-offset);top:var(--comp-tag-btn-offset);cursor:pointer}button{width:var(--comp-tag-btn-size);height:var(--comp-tag-btn-size);stroke:var(--comp-tag-color);--tct-icon-stroke-primary:var(--comp-tag-color);cursor:pointer;border:0;background:transparent;display:flex;align-items:center;justify-content:center;padding:0;--tct-icon-size:18px}";export{n as q2_tag}
|