q2-tecton-elements 1.52.1 → 1.53.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/click-elsewhere_2.cjs.entry.js +2 -13
- package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-action-group.cjs.entry.js +38 -14
- package/dist/cjs/q2-action-group.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +18 -15
- package/dist/cjs/q2-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +1 -3
- package/dist/cjs/q2-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-file-picker.cjs.entry.js +236 -0
- package/dist/cjs/q2-file-picker.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-item_3.cjs.entry.js +250 -0
- package/dist/cjs/q2-item_3.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-pill.cjs.entry.js +7 -3
- package/dist/cjs/q2-pill.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-select.cjs.entry.js +4 -4
- package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-tag.cjs.entry.js +3 -2
- package/dist/cjs/q2-tag.cjs.entry.js.map +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-action-group/q2-action-group.js +41 -14
- package/dist/collection/components/q2-action-group/q2-action-group.js.map +1 -1
- package/dist/collection/components/q2-action-group/test/q2-action-group.spec.js +97 -65
- package/dist/collection/components/q2-action-group/test/q2-action-group.spec.js.map +1 -1
- package/dist/collection/components/q2-calendar/q2-calendar.js +22 -17
- package/dist/collection/components/q2-calendar/q2-calendar.js.map +1 -1
- package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js +0 -27
- package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +5 -9
- package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
- package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js +14 -59
- package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-file-picker/q2-file-picker.css +288 -0
- package/dist/collection/components/q2-file-picker/q2-file-picker.js +426 -0
- package/dist/collection/components/q2-file-picker/q2-file-picker.js.map +1 -0
- package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.e2e.js +11 -0
- package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.e2e.js.map +1 -0
- package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.spec.js +435 -0
- package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.spec.js.map +1 -0
- package/dist/collection/components/q2-item/q2-item.css +3 -0
- package/dist/collection/components/q2-list/q2-list.css +6 -0
- package/dist/collection/components/q2-pill/q2-pill.js +11 -4
- package/dist/collection/components/q2-pill/q2-pill.js.map +1 -1
- package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js +108 -49
- package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-popover/q2-popover.js +3 -16
- package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
- package/dist/collection/components/q2-select/q2-select.js +4 -5
- package/dist/collection/components/q2-select/q2-select.js.map +1 -1
- package/dist/collection/components/q2-select/test/q2-select-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-tag/q2-tag.js +7 -4
- package/dist/collection/components/q2-tag/q2-tag.js.map +1 -1
- package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js +0 -49
- package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/q2-action-group.js +40 -14
- package/dist/components/q2-action-group.js.map +1 -1
- package/dist/components/q2-calendar.js +18 -16
- package/dist/components/q2-calendar.js.map +1 -1
- package/dist/components/q2-dropdown.js +1 -4
- package/dist/components/q2-dropdown.js.map +1 -1
- package/dist/components/q2-file-picker.d.ts +11 -0
- package/dist/components/q2-file-picker.js +301 -0
- package/dist/components/q2-file-picker.js.map +1 -0
- package/dist/components/q2-item.js +1 -130
- package/dist/components/q2-item.js.map +1 -1
- package/dist/{esm/q2-item.entry.js → components/q2-item2.js} +29 -11
- package/dist/components/q2-item2.js.map +1 -0
- package/dist/components/q2-link.js +1 -86
- package/dist/components/q2-link.js.map +1 -1
- package/dist/{esm/q2-link.entry.js → components/q2-link2.js} +39 -9
- package/dist/components/q2-link2.js.map +1 -0
- package/dist/components/q2-list.js +1 -94
- package/dist/components/q2-list.js.map +1 -1
- package/dist/{esm/q2-list.entry.js → components/q2-list2.js} +30 -11
- package/dist/components/q2-list2.js.map +1 -0
- package/dist/components/q2-pill.js +7 -3
- package/dist/components/q2-pill.js.map +1 -1
- package/dist/components/q2-popover2.js +3 -15
- package/dist/components/q2-popover2.js.map +1 -1
- package/dist/components/q2-select2.js +4 -5
- package/dist/components/q2-select2.js.map +1 -1
- package/dist/components/q2-tag.js +3 -3
- package/dist/components/q2-tag.js.map +1 -1
- package/dist/esm/click-elsewhere_2.entry.js +2 -13
- package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-action-group.entry.js +38 -14
- package/dist/esm/q2-action-group.entry.js.map +1 -1
- package/dist/esm/q2-calendar.entry.js +18 -15
- package/dist/esm/q2-calendar.entry.js.map +1 -1
- package/dist/esm/q2-dropdown.entry.js +1 -3
- package/dist/esm/q2-dropdown.entry.js.map +1 -1
- package/dist/esm/q2-file-picker.entry.js +232 -0
- package/dist/esm/q2-file-picker.entry.js.map +1 -0
- package/dist/esm/q2-item_3.entry.js +244 -0
- package/dist/esm/q2-item_3.entry.js.map +1 -0
- package/dist/esm/q2-pill.entry.js +7 -3
- package/dist/esm/q2-pill.entry.js.map +1 -1
- package/dist/esm/q2-select.entry.js +4 -4
- package/dist/esm/q2-select.entry.js.map +1 -1
- package/dist/esm/q2-tag.entry.js +3 -2
- package/dist/esm/q2-tag.entry.js.map +1 -1
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/q2-tecton-elements/click-elsewhere_2.entry.js +21 -33
- package/dist/q2-tecton-elements/click-elsewhere_2.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-action-group.entry.js +58 -32
- package/dist/q2-tecton-elements/q2-action-group.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-calendar.entry.js +259 -256
- package/dist/q2-tecton-elements/q2-calendar.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +6 -8
- package/dist/q2-tecton-elements/q2-dropdown.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-file-picker.entry.js +338 -0
- package/dist/q2-tecton-elements/q2-file-picker.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-item_3.entry.js +331 -0
- package/dist/q2-tecton-elements/q2-item_3.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-pill.entry.js +22 -18
- package/dist/q2-tecton-elements/q2-pill.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-select.entry.js +7 -7
- package/dist/q2-tecton-elements/q2-select.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-tag.entry.js +29 -28
- package/dist/q2-tecton-elements/q2-tag.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
- package/dist/types/components/q2-action-group/q2-action-group.d.ts +4 -0
- package/dist/types/components/q2-calendar/q2-calendar.d.ts +10 -5
- package/dist/types/components/q2-dropdown/q2-dropdown.d.ts +6 -2
- package/dist/types/components/q2-file-picker/q2-file-picker.d.ts +98 -0
- package/dist/types/components/q2-pill/q2-pill.d.ts +6 -2
- package/dist/types/components/q2-popover/q2-popover.d.ts +0 -1
- package/dist/types/components/q2-select/q2-select.d.ts +1 -1
- package/dist/types/components/q2-tag/q2-tag.d.ts +6 -2
- package/dist/types/components.d.ts +109 -0
- package/package.json +3 -3
- package/dist/cjs/q2-item.cjs.entry.js +0 -120
- package/dist/cjs/q2-item.cjs.entry.js.map +0 -1
- package/dist/cjs/q2-link.cjs.entry.js +0 -64
- package/dist/cjs/q2-link.cjs.entry.js.map +0 -1
- package/dist/cjs/q2-list.cjs.entry.js +0 -83
- package/dist/cjs/q2-list.cjs.entry.js.map +0 -1
- package/dist/esm/q2-item.entry.js.map +0 -1
- package/dist/esm/q2-link.entry.js.map +0 -1
- package/dist/esm/q2-list.entry.js.map +0 -1
- package/dist/q2-tecton-elements/q2-item.entry.js +0 -158
- package/dist/q2-tecton-elements/q2-item.entry.js.map +0 -1
- package/dist/q2-tecton-elements/q2-link.entry.js +0 -83
- package/dist/q2-tecton-elements/q2-link.entry.js.map +0 -1
- package/dist/q2-tecton-elements/q2-list.entry.js +0 -100
- package/dist/q2-tecton-elements/q2-list.entry.js.map +0 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ComponentInterface, EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
type FileStatus = 'invalid-type' | 'over-size-limit' | 'over-max-files-limit' | 'in-progress' | 'failed' | 'uploaded';
|
|
3
|
+
export type FilesObject = {
|
|
4
|
+
invalidFiles: {
|
|
5
|
+
file: File;
|
|
6
|
+
status: 'invalid-type' | 'over-size-limit' | 'over-max-files-limit' | 'in-progress' | 'failed' | 'uploaded';
|
|
7
|
+
}[];
|
|
8
|
+
validFiles: File[];
|
|
9
|
+
};
|
|
10
|
+
export declare class Q2FilePicker implements ComponentInterface {
|
|
11
|
+
browseButtonInput: HTMLElement;
|
|
12
|
+
dropZone: HTMLElement;
|
|
13
|
+
fileItemsToBeDeleted: any;
|
|
14
|
+
queuedFiles: File[];
|
|
15
|
+
el: HTMLElement;
|
|
16
|
+
areFilesUploading: boolean;
|
|
17
|
+
displayedFiles: {
|
|
18
|
+
file: File;
|
|
19
|
+
status: FileStatus;
|
|
20
|
+
toBeRemoved?: boolean;
|
|
21
|
+
}[];
|
|
22
|
+
isDropZoneHighlighted: boolean;
|
|
23
|
+
refreshCounter: number;
|
|
24
|
+
/**
|
|
25
|
+
* A description of the field. This is announced by screen readers when the field is focused.
|
|
26
|
+
* @localizable
|
|
27
|
+
*/
|
|
28
|
+
description: string;
|
|
29
|
+
/**
|
|
30
|
+
* An array of strings representing the allowed file types based on file extension.
|
|
31
|
+
* Example: ['jpg', 'png', 'pdf']
|
|
32
|
+
*/
|
|
33
|
+
fileTypes: string[] | string;
|
|
34
|
+
/**
|
|
35
|
+
* The label for the field. This is announced by screen readers when the field is focused.
|
|
36
|
+
* @localizable
|
|
37
|
+
*/
|
|
38
|
+
label: string;
|
|
39
|
+
/**
|
|
40
|
+
* The maximum number of files that can be selected.
|
|
41
|
+
*/
|
|
42
|
+
maxFiles: number;
|
|
43
|
+
/**
|
|
44
|
+
* The maximum size (in bytes) of any file that can be selected.
|
|
45
|
+
*/
|
|
46
|
+
maxFileSize: number;
|
|
47
|
+
/**
|
|
48
|
+
* An array of objects representing the status of the files being uploaded.
|
|
49
|
+
* Each object should have a `name` property (the file name) and a `status`
|
|
50
|
+
* property (the status of the file) that equals either 'in-progress',
|
|
51
|
+
* 'failed' or 'uploaded'.
|
|
52
|
+
*/
|
|
53
|
+
status: {
|
|
54
|
+
name: string;
|
|
55
|
+
status: 'in-progress' | 'failed' | 'uploaded';
|
|
56
|
+
}[];
|
|
57
|
+
/**
|
|
58
|
+
* Returns an array of File objects representing the files selected by the
|
|
59
|
+
* user. If no files are selected, the value is an empty array.
|
|
60
|
+
* @readonly
|
|
61
|
+
*/
|
|
62
|
+
value: FilesObject;
|
|
63
|
+
/**
|
|
64
|
+
* Determines if the file picker is a browse button or a drop zone with a
|
|
65
|
+
* browse link.
|
|
66
|
+
*/
|
|
67
|
+
variant: 'browse' | 'browse-drop';
|
|
68
|
+
tctChange: EventEmitter<FilesObject>;
|
|
69
|
+
updateFileList(newValue: {
|
|
70
|
+
name: string;
|
|
71
|
+
status: FileStatus;
|
|
72
|
+
}[]): void;
|
|
73
|
+
get dropZoneClasses(): string;
|
|
74
|
+
get fileTypesArray(): string[];
|
|
75
|
+
get hasDescription(): boolean;
|
|
76
|
+
get hasDescriptionSlotContent(): boolean;
|
|
77
|
+
get hasLabel(): boolean;
|
|
78
|
+
get hasLabelSlotContent(): boolean;
|
|
79
|
+
buildFilesObject(filesToUpload: File[]): FilesObject;
|
|
80
|
+
dimDropZone: (e: DragEvent) => void;
|
|
81
|
+
disableEvent(event: Event): void;
|
|
82
|
+
disableLoaderIfAllFilesUploaded(): void;
|
|
83
|
+
emitChange(filesObject: FilesObject): void;
|
|
84
|
+
extractFilesOfInvalidTypes(files: File[]): any[];
|
|
85
|
+
extractFilesOverMaxFilesLimit(files: File[]): any[];
|
|
86
|
+
extractFilesOverSizeLimit(files: File[]): any[];
|
|
87
|
+
forceRerender(): void;
|
|
88
|
+
getAnimationendHandlerToRemoveFileItem(fileName: string): (e: AnimationEvent) => void;
|
|
89
|
+
getClickHandlerToRemoveFileItem(fileName: string): () => void;
|
|
90
|
+
getFileItemClasses(fileName: string): string;
|
|
91
|
+
getFileItemStatusMessage(status: FileStatus, size: number): string;
|
|
92
|
+
grabDroppedFiles: (e: DragEvent) => void;
|
|
93
|
+
grabSelectedFiles: (e: Event) => void;
|
|
94
|
+
highlightDropZone: (e: DragEvent) => void;
|
|
95
|
+
launchFileBrowser(): void;
|
|
96
|
+
render: () => any;
|
|
97
|
+
}
|
|
98
|
+
export {};
|
|
@@ -43,7 +43,11 @@ export declare class Q2Pill implements ComponentInterface {
|
|
|
43
43
|
* Only applicable when options are provided.
|
|
44
44
|
*/
|
|
45
45
|
multiple: boolean;
|
|
46
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Determine whether the popover is open or closed.
|
|
48
|
+
*
|
|
49
|
+
* @readonly
|
|
50
|
+
*/
|
|
47
51
|
open: boolean;
|
|
48
52
|
/** Determines the label that is applied to the option list for accessibility purposes. */
|
|
49
53
|
optionListLabel: string;
|
|
@@ -119,7 +123,7 @@ export declare class Q2Pill implements ComponentInterface {
|
|
|
119
123
|
determineOptionCount: () => Promise<void>;
|
|
120
124
|
executeActionSheet: (event: MouseEvent | KeyboardEvent) => Promise<void>;
|
|
121
125
|
getOption: (value: string) => Promise<HTMLQ2OptionElement>;
|
|
122
|
-
|
|
126
|
+
handleFocusOut: (event: FocusEvent) => Promise<void>;
|
|
123
127
|
handleChange: (event: any) => void;
|
|
124
128
|
handleClick: (event: MouseEvent) => Promise<void>;
|
|
125
129
|
handleKeydown: (event: KeyboardEvent) => Promise<void>;
|
|
@@ -46,7 +46,6 @@ export declare class Q2Popover implements ComponentInterface {
|
|
|
46
46
|
}>): void;
|
|
47
47
|
scrollContainerTo(options: ScrollToOptions): Promise<void>;
|
|
48
48
|
toggle(): Promise<void>;
|
|
49
|
-
handleControlElement(): void;
|
|
50
49
|
minHeightProvided(): void;
|
|
51
50
|
openChanged(open: boolean): Promise<void>;
|
|
52
51
|
get isModule(): boolean;
|
|
@@ -3,6 +3,7 @@ import { EventEmitter, ComponentInterface } from '../../stencil-public-runtime';
|
|
|
3
3
|
import { IEventDetail, Q2InputCustomEvent, Q2OptionListCustomEvent } from "../../components";
|
|
4
4
|
import { IOptionValue } from '../q2-option-list/q2-option-list';
|
|
5
5
|
export declare class Q2Select implements ComponentInterface {
|
|
6
|
+
inputField?: HTMLQ2InputElement;
|
|
6
7
|
mutationObserver: MutationObserver;
|
|
7
8
|
optionList: HTMLQ2OptionListElement;
|
|
8
9
|
popoverElement?: HTMLQ2PopoverElement;
|
|
@@ -13,7 +14,6 @@ export declare class Q2Select implements ComponentInterface {
|
|
|
13
14
|
hasCustomDisplay: boolean;
|
|
14
15
|
hasPopoverBottom: boolean;
|
|
15
16
|
hasPopoverTop: boolean;
|
|
16
|
-
inputField?: HTMLQ2InputElement;
|
|
17
17
|
inputFocused: boolean;
|
|
18
18
|
open: boolean;
|
|
19
19
|
prioritizeSearch: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ComponentInterface, EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
export declare class Q2Tag implements ComponentInterface {
|
|
3
|
+
dropdownBtn: HTMLButtonElement;
|
|
3
4
|
mutationObserver: MutationObserver;
|
|
4
5
|
optionList: HTMLQ2OptionListElement;
|
|
5
6
|
popoverElement: HTMLQ2PopoverElement;
|
|
6
7
|
hostElement: HTMLElement;
|
|
7
|
-
dropdownBtn: HTMLButtonElement;
|
|
8
8
|
optionCount: number;
|
|
9
9
|
/**
|
|
10
10
|
* Instructs the component to use the action sheet workflow for displaying its options.
|
|
@@ -17,7 +17,11 @@ export declare class Q2Tag implements ComponentInterface {
|
|
|
17
17
|
* @localizable
|
|
18
18
|
*/
|
|
19
19
|
label: string;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Determine whether the popover is open or closed.
|
|
22
|
+
*
|
|
23
|
+
* @readonly
|
|
24
|
+
*/
|
|
21
25
|
open: boolean;
|
|
22
26
|
/** Determines the label that is applied to the option list for accessibility purposes. */
|
|
23
27
|
optionListLabel: string;
|
|
@@ -10,6 +10,7 @@ import { IChartData, IDonutChartData } from "q2-tecton-common/lib/types/element-
|
|
|
10
10
|
import { EChartsCoreOption } from "echarts/types/dist/core";
|
|
11
11
|
import { Q2DataTableHeader, Q2DataTableRow, Q2DataTableSerializedRow } from "./components/q2-data-table/q2-data-table";
|
|
12
12
|
import { Q2Input } from "./components/q2-input/q2-input";
|
|
13
|
+
import { FilesObject } from "./components/q2-file-picker/q2-file-picker";
|
|
13
14
|
import { Q2Badge } from "./components/q2-badge/q2-badge";
|
|
14
15
|
import { Q2Icon } from "./components/q2-icon/q2-icon";
|
|
15
16
|
import { InputType } from "./components/q2-input/q2-input";
|
|
@@ -22,6 +23,7 @@ export { IChartData, IDonutChartData } from "q2-tecton-common/lib/types/element-
|
|
|
22
23
|
export { EChartsCoreOption } from "echarts/types/dist/core";
|
|
23
24
|
export { Q2DataTableHeader, Q2DataTableRow, Q2DataTableSerializedRow } from "./components/q2-data-table/q2-data-table";
|
|
24
25
|
export { Q2Input } from "./components/q2-input/q2-input";
|
|
26
|
+
export { FilesObject } from "./components/q2-file-picker/q2-file-picker";
|
|
25
27
|
export { Q2Badge } from "./components/q2-badge/q2-badge";
|
|
26
28
|
export { Q2Icon } from "./components/q2-icon/q2-icon";
|
|
27
29
|
export { InputType } from "./components/q2-input/q2-input";
|
|
@@ -263,6 +265,7 @@ export namespace Components {
|
|
|
263
265
|
"onsuccess": (e: CustomEvent) => void;
|
|
264
266
|
/**
|
|
265
267
|
* Determine whether the popover is open or closed.
|
|
268
|
+
* @readonly
|
|
266
269
|
*/
|
|
267
270
|
"open": boolean;
|
|
268
271
|
/**
|
|
@@ -1026,6 +1029,7 @@ export namespace Components {
|
|
|
1026
1029
|
"name": string;
|
|
1027
1030
|
/**
|
|
1028
1031
|
* Determine whether the popover is open or closed.
|
|
1032
|
+
* @readonly
|
|
1029
1033
|
*/
|
|
1030
1034
|
"open": boolean;
|
|
1031
1035
|
/**
|
|
@@ -1206,6 +1210,43 @@ export namespace Components {
|
|
|
1206
1210
|
*/
|
|
1207
1211
|
"type": string;
|
|
1208
1212
|
}
|
|
1213
|
+
interface Q2FilePicker {
|
|
1214
|
+
/**
|
|
1215
|
+
* A description of the field. This is announced by screen readers when the field is focused.
|
|
1216
|
+
* @localizable
|
|
1217
|
+
*/
|
|
1218
|
+
"description": string;
|
|
1219
|
+
/**
|
|
1220
|
+
* An array of strings representing the allowed file types based on file extension. Example: ['jpg', 'png', 'pdf']
|
|
1221
|
+
*/
|
|
1222
|
+
"fileTypes": string[] | string;
|
|
1223
|
+
/**
|
|
1224
|
+
* The label for the field. This is announced by screen readers when the field is focused.
|
|
1225
|
+
* @localizable
|
|
1226
|
+
*/
|
|
1227
|
+
"label": string;
|
|
1228
|
+
/**
|
|
1229
|
+
* The maximum size (in bytes) of any file that can be selected.
|
|
1230
|
+
*/
|
|
1231
|
+
"maxFileSize": number;
|
|
1232
|
+
/**
|
|
1233
|
+
* The maximum number of files that can be selected.
|
|
1234
|
+
*/
|
|
1235
|
+
"maxFiles": number;
|
|
1236
|
+
/**
|
|
1237
|
+
* An array of objects representing the status of the files being uploaded. Each object should have a `name` property (the file name) and a `status` property (the status of the file) that equals either 'in-progress', 'failed' or 'uploaded'.
|
|
1238
|
+
*/
|
|
1239
|
+
"status": { name: string; status: 'in-progress' | 'failed' | 'uploaded' }[];
|
|
1240
|
+
/**
|
|
1241
|
+
* Returns an array of File objects representing the files selected by the user. If no files are selected, the value is an empty array.
|
|
1242
|
+
* @readonly
|
|
1243
|
+
*/
|
|
1244
|
+
"value": FilesObject;
|
|
1245
|
+
/**
|
|
1246
|
+
* Determines if the file picker is a browse button or a drop zone with a browse link.
|
|
1247
|
+
*/
|
|
1248
|
+
"variant": 'browse' | 'browse-drop';
|
|
1249
|
+
}
|
|
1209
1250
|
interface Q2FormattedText {
|
|
1210
1251
|
/**
|
|
1211
1252
|
* Formats to the language provided. Accepts multiple locales in an array as sequential fallbacks.
|
|
@@ -1785,6 +1826,7 @@ export namespace Components {
|
|
|
1785
1826
|
"multiple": boolean;
|
|
1786
1827
|
/**
|
|
1787
1828
|
* Determine whether the popover is open or closed.
|
|
1829
|
+
* @readonly
|
|
1788
1830
|
*/
|
|
1789
1831
|
"open": boolean;
|
|
1790
1832
|
/**
|
|
@@ -2319,6 +2361,7 @@ export namespace Components {
|
|
|
2319
2361
|
"label": string;
|
|
2320
2362
|
/**
|
|
2321
2363
|
* Determine whether the popover is open or closed.
|
|
2364
|
+
* @readonly
|
|
2322
2365
|
*/
|
|
2323
2366
|
"open": boolean;
|
|
2324
2367
|
"openPopover": () => Promise<void>;
|
|
@@ -2528,6 +2571,10 @@ export interface Q2ExampleCustomEvent<T> extends CustomEvent<T> {
|
|
|
2528
2571
|
detail: T;
|
|
2529
2572
|
target: HTMLQ2ExampleElement;
|
|
2530
2573
|
}
|
|
2574
|
+
export interface Q2FilePickerCustomEvent<T> extends CustomEvent<T> {
|
|
2575
|
+
detail: T;
|
|
2576
|
+
target: HTMLQ2FilePickerElement;
|
|
2577
|
+
}
|
|
2531
2578
|
export interface Q2InputCustomEvent<T> extends CustomEvent<T> {
|
|
2532
2579
|
detail: T;
|
|
2533
2580
|
target: HTMLQ2InputElement;
|
|
@@ -2921,6 +2968,23 @@ declare global {
|
|
|
2921
2968
|
prototype: HTMLQ2ExampleElement;
|
|
2922
2969
|
new (): HTMLQ2ExampleElement;
|
|
2923
2970
|
};
|
|
2971
|
+
interface HTMLQ2FilePickerElementEventMap {
|
|
2972
|
+
"tctChange": FilesObject;
|
|
2973
|
+
}
|
|
2974
|
+
interface HTMLQ2FilePickerElement extends Components.Q2FilePicker, HTMLStencilElement {
|
|
2975
|
+
addEventListener<K extends keyof HTMLQ2FilePickerElementEventMap>(type: K, listener: (this: HTMLQ2FilePickerElement, ev: Q2FilePickerCustomEvent<HTMLQ2FilePickerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2976
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2977
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
2978
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
2979
|
+
removeEventListener<K extends keyof HTMLQ2FilePickerElementEventMap>(type: K, listener: (this: HTMLQ2FilePickerElement, ev: Q2FilePickerCustomEvent<HTMLQ2FilePickerElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
2980
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2981
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2982
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
2983
|
+
}
|
|
2984
|
+
var HTMLQ2FilePickerElement: {
|
|
2985
|
+
prototype: HTMLQ2FilePickerElement;
|
|
2986
|
+
new (): HTMLQ2FilePickerElement;
|
|
2987
|
+
};
|
|
2924
2988
|
interface HTMLQ2FormattedTextElement extends Components.Q2FormattedText, HTMLStencilElement {
|
|
2925
2989
|
}
|
|
2926
2990
|
var HTMLQ2FormattedTextElement: {
|
|
@@ -3402,6 +3466,7 @@ declare global {
|
|
|
3402
3466
|
"q2-dropdown-item": HTMLQ2DropdownItemElement;
|
|
3403
3467
|
"q2-editable-field": HTMLQ2EditableFieldElement;
|
|
3404
3468
|
"q2-example": HTMLQ2ExampleElement;
|
|
3469
|
+
"q2-file-picker": HTMLQ2FilePickerElement;
|
|
3405
3470
|
"q2-formatted-text": HTMLQ2FormattedTextElement;
|
|
3406
3471
|
"q2-icon": HTMLQ2IconElement;
|
|
3407
3472
|
"q2-input": HTMLQ2InputElement;
|
|
@@ -3696,6 +3761,7 @@ declare namespace LocalJSX {
|
|
|
3696
3761
|
"onsuccess"?: (e: CustomEvent) => void;
|
|
3697
3762
|
/**
|
|
3698
3763
|
* Determine whether the popover is open or closed.
|
|
3764
|
+
* @readonly
|
|
3699
3765
|
*/
|
|
3700
3766
|
"open"?: boolean;
|
|
3701
3767
|
/**
|
|
@@ -4417,6 +4483,7 @@ declare namespace LocalJSX {
|
|
|
4417
4483
|
"name"?: string;
|
|
4418
4484
|
/**
|
|
4419
4485
|
* Determine whether the popover is open or closed.
|
|
4486
|
+
* @readonly
|
|
4420
4487
|
*/
|
|
4421
4488
|
"open"?: boolean;
|
|
4422
4489
|
/**
|
|
@@ -4578,6 +4645,44 @@ declare namespace LocalJSX {
|
|
|
4578
4645
|
*/
|
|
4579
4646
|
"type"?: string;
|
|
4580
4647
|
}
|
|
4648
|
+
interface Q2FilePicker {
|
|
4649
|
+
/**
|
|
4650
|
+
* A description of the field. This is announced by screen readers when the field is focused.
|
|
4651
|
+
* @localizable
|
|
4652
|
+
*/
|
|
4653
|
+
"description"?: string;
|
|
4654
|
+
/**
|
|
4655
|
+
* An array of strings representing the allowed file types based on file extension. Example: ['jpg', 'png', 'pdf']
|
|
4656
|
+
*/
|
|
4657
|
+
"fileTypes"?: string[] | string;
|
|
4658
|
+
/**
|
|
4659
|
+
* The label for the field. This is announced by screen readers when the field is focused.
|
|
4660
|
+
* @localizable
|
|
4661
|
+
*/
|
|
4662
|
+
"label"?: string;
|
|
4663
|
+
/**
|
|
4664
|
+
* The maximum size (in bytes) of any file that can be selected.
|
|
4665
|
+
*/
|
|
4666
|
+
"maxFileSize"?: number;
|
|
4667
|
+
/**
|
|
4668
|
+
* The maximum number of files that can be selected.
|
|
4669
|
+
*/
|
|
4670
|
+
"maxFiles"?: number;
|
|
4671
|
+
"onTctChange"?: (event: Q2FilePickerCustomEvent<FilesObject>) => void;
|
|
4672
|
+
/**
|
|
4673
|
+
* An array of objects representing the status of the files being uploaded. Each object should have a `name` property (the file name) and a `status` property (the status of the file) that equals either 'in-progress', 'failed' or 'uploaded'.
|
|
4674
|
+
*/
|
|
4675
|
+
"status"?: { name: string; status: 'in-progress' | 'failed' | 'uploaded' }[];
|
|
4676
|
+
/**
|
|
4677
|
+
* Returns an array of File objects representing the files selected by the user. If no files are selected, the value is an empty array.
|
|
4678
|
+
* @readonly
|
|
4679
|
+
*/
|
|
4680
|
+
"value"?: FilesObject;
|
|
4681
|
+
/**
|
|
4682
|
+
* Determines if the file picker is a browse button or a drop zone with a browse link.
|
|
4683
|
+
*/
|
|
4684
|
+
"variant"?: 'browse' | 'browse-drop';
|
|
4685
|
+
}
|
|
4581
4686
|
interface Q2FormattedText {
|
|
4582
4687
|
/**
|
|
4583
4688
|
* Formats to the language provided. Accepts multiple locales in an array as sequential fallbacks.
|
|
@@ -5155,6 +5260,7 @@ declare namespace LocalJSX {
|
|
|
5155
5260
|
"onChange"?: (event: Q2PillCustomEvent<{ value: string; values: IOptionValue1[]; active: boolean }>) => void;
|
|
5156
5261
|
/**
|
|
5157
5262
|
* Determine whether the popover is open or closed.
|
|
5263
|
+
* @readonly
|
|
5158
5264
|
*/
|
|
5159
5265
|
"open"?: boolean;
|
|
5160
5266
|
/**
|
|
@@ -5686,6 +5792,7 @@ declare namespace LocalJSX {
|
|
|
5686
5792
|
"onClick"?: (event: Q2TagCustomEvent<{ value: string }>) => void;
|
|
5687
5793
|
/**
|
|
5688
5794
|
* Determine whether the popover is open or closed.
|
|
5795
|
+
* @readonly
|
|
5689
5796
|
*/
|
|
5690
5797
|
"open"?: boolean;
|
|
5691
5798
|
/**
|
|
@@ -5873,6 +5980,7 @@ declare namespace LocalJSX {
|
|
|
5873
5980
|
"q2-dropdown-item": Q2DropdownItem;
|
|
5874
5981
|
"q2-editable-field": Q2EditableField;
|
|
5875
5982
|
"q2-example": Q2Example;
|
|
5983
|
+
"q2-file-picker": Q2FilePicker;
|
|
5876
5984
|
"q2-formatted-text": Q2FormattedText;
|
|
5877
5985
|
"q2-icon": Q2Icon;
|
|
5878
5986
|
"q2-input": Q2Input;
|
|
@@ -5934,6 +6042,7 @@ declare module "@stencil/core" {
|
|
|
5934
6042
|
"q2-dropdown-item": LocalJSX.Q2DropdownItem & JSXBase.HTMLAttributes<HTMLQ2DropdownItemElement>;
|
|
5935
6043
|
"q2-editable-field": LocalJSX.Q2EditableField & JSXBase.HTMLAttributes<HTMLQ2EditableFieldElement>;
|
|
5936
6044
|
"q2-example": LocalJSX.Q2Example & JSXBase.HTMLAttributes<HTMLQ2ExampleElement>;
|
|
6045
|
+
"q2-file-picker": LocalJSX.Q2FilePicker & JSXBase.HTMLAttributes<HTMLQ2FilePickerElement>;
|
|
5937
6046
|
"q2-formatted-text": LocalJSX.Q2FormattedText & JSXBase.HTMLAttributes<HTMLQ2FormattedTextElement>;
|
|
5938
6047
|
"q2-icon": LocalJSX.Q2Icon & JSXBase.HTMLAttributes<HTMLQ2IconElement>;
|
|
5939
6048
|
"q2-input": LocalJSX.Q2Input & JSXBase.HTMLAttributes<HTMLQ2InputElement>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "q2-tecton-elements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.53.0",
|
|
4
4
|
"description": "Q2 Tecton Custom Elements",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Q2 Tecton Team",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@stencil/core": "4.18.0",
|
|
38
|
-
"q2-tecton-common": "1.
|
|
38
|
+
"q2-tecton-common": "1.53.0",
|
|
39
39
|
"swiper": "8.4.4"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"typescript": "5.4.5",
|
|
61
61
|
"typescript-eslint": "^7.11.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "c1c1a3fd469d623971a1081835bfab6fbc56d28c"
|
|
64
64
|
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-e7e68b1e.js');
|
|
6
|
-
const index$1 = require('./index-07285783.js');
|
|
7
|
-
|
|
8
|
-
const q2ItemCss = "*{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 #0066cc)}: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 #0066cc)}: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([clickable]){cursor:pointer;--comp-background:var(--tct-btn-primary-background, var(--tct-btn-primary-bg, var(--t-a11y-active-gray-color-AA, #404040)))}:host([clickable]) .item{--comp-border-radius:var(--tct-item-border-radius, var(--app-border-radius-1, 4px));--comp-btn-tween:var(--tct-btn-tween, var(--t-btn-tween, var(--tct-tween-1, var(--app-tween-1, 0.2s ease))));--comp-btn-fallback-box-shadow:0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);--comp-hover-box-shadow:var(--tct-btn-primary-box-shadow, var(--comp-btn-fallback-box-shadow));--comp-active-box-shadow:var(--tct-btn-primary-active-background, #0063a0);--comp-font-color:var(--tct-btn-primary-font-color, var(--app-white, #ffffff));--comp-hover-outer-ring-color:var(--tct-btn-primary-hover-outer-ring-color, var(--comp-background));--comp-hover-inner-ring-color:var(--tct-btn-primary-hover-inner-ring-color, var(--comp-font-color));--comp-hover-box-shadow:0 0 0 2px var(--comp-hover-inner-ring-color),\n 0 0 0 4px var(--comp-hover-outer-ring-color)}:host([clickable]) .item:hover{box-shadow:var(--comp-hover-box-shadow)}:host([clickable]) .item:active{box-shadow:var(--comp-active-box-shadow)}:host([clickable]) .item:focus-visible{box-shadow:var(--const-double-focus-ring)}.action{--tct-btn-icon-height:var(--tct-item-action-icon-height, var(--app-scale-6x, 30px));--tct-btn-icon-width:var(--tct-item-action-icon-width, var(--app-scale-6x, 30px));--tct-icon-size:var(--tct-item-action-icon-size, var(--app-scale-6x, 30px));--tct-radio-label-hidden-columns:18px;--tct-radio-label-margin-right:0;--tct-radio-margin:0;align-items:center;display:flex;grid-row:1;justify-content:center}.action-no-bullet{grid-column:2}.body{color:var(--tct-item-body-color, var(--t-textA, #747474));font-size:var(--tct-item-body-font-size, var(--app-font-size, 14px));font-weight:var(--tct-item-body-font-weight, 400)}.bullet{--tct-avatar-fallback-height:var(--tct-item-avatar-height, var(--app-scale-7x, 35px));--tct-avatar-fallback-width:var(--tct-item-avatar-width, var(--app-scale-7x, 35px));--tct-avatar-height:var(--tct-item-avatar-height, var(--app-scale-7x, 35px));--tct-avatar-width:var(--tct-item-avatar-width, var(--app-scale-7x, 35px));grid-column:1;grid-row-start:1;grid-row-end:3;padding-top:var(--tct-item-bullet-padding-top, var(--app-scale-1x, 5px));text-align:center}.bullet-no-footer{grid-row-end:2}.footer{grid-column-start:2;grid-column-end:4;grid-row:2}.footer-no-action-nor-bullet{grid-column-start:1;grid-column-end:2}.footer-no-action{grid-column-start:2;grid-column-end:3}.footer-no-bullet{grid-column-start:1;grid-column-end:3}.header{color:var(--tct-item-header-color, var(--t-text, #4d4d4d));font-size:var(--tct-item-header-font-size, 16px);font-weight:var(--tct-item-header-font-weight, 600);line-height:var(--tct-item-header-line-height, 1.5)}.item{border:var(--tct-item-border);border-radius:var(--comp-border-radius);transition:var(--comp-btn-tween);transition-property:box-shadow;column-gap:var(--tct-item-horizontal-spacing, var(--app-scale-3x, 15px));display:grid;grid-template-columns:minmax(var(--app-scale-7x, 35px), auto) minmax(auto, 1fr) minmax(var(--app-scale-5x, 25px), auto);grid-template-rows:auto auto;padding:var(--tct-item-padding, 0);row-gap:var(--tct-item-vertical-spacing, var(--app-scale-2x, 10px))}.item-no-action-nor-bullet{grid-template-columns:auto}.item-no-action{grid-template-columns:minmax(var(--app-scale-7x, 35px), auto) minmax(auto, 1fr)}.item-no-footer{grid-template-rows:auto}.item-no-bullet{grid-template-columns:minmax(auto, 1fr) minmax(var(--app-scale-5x, 25px), auto)}.main{grid-column:2;grid-row:1}.main-no-action-nor-bullet{grid-column:1}.main-no-bullet{grid-column:1}";
|
|
9
|
-
const Q2ItemStyle0 = q2ItemCss;
|
|
10
|
-
|
|
11
|
-
const Q2Item = class {
|
|
12
|
-
constructor(hostRef) {
|
|
13
|
-
index.registerInstance(this, hostRef);
|
|
14
|
-
this.renderTrigger = 0;
|
|
15
|
-
this.clickable = undefined;
|
|
16
|
-
}
|
|
17
|
-
// #endregion
|
|
18
|
-
// #region Component Lifecycle Events
|
|
19
|
-
componentDidLoad() {
|
|
20
|
-
if (typeof MutationObserver !== 'undefined') {
|
|
21
|
-
const observer = new MutationObserver(() => (this.renderTrigger += 1));
|
|
22
|
-
observer.observe(this.hostElement, { childList: true, subtree: true, attributes: true });
|
|
23
|
-
this.mutationObserver = observer;
|
|
24
|
-
}
|
|
25
|
-
index$1.overrideFocus(this.hostElement);
|
|
26
|
-
}
|
|
27
|
-
// #endregion
|
|
28
|
-
// #region Listeners
|
|
29
|
-
delegateFocus(event) {
|
|
30
|
-
var _a;
|
|
31
|
-
if (this.clickable) {
|
|
32
|
-
(_a = this.itemElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
event.preventDefault();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
// #endregion
|
|
39
|
-
// #region Local Methods
|
|
40
|
-
get actionClasses() {
|
|
41
|
-
const classes = ['action'];
|
|
42
|
-
if (!this.hasBulletSlotContent) {
|
|
43
|
-
classes.push(`action-no-bullet`);
|
|
44
|
-
}
|
|
45
|
-
return classes.join(' ');
|
|
46
|
-
}
|
|
47
|
-
get bulletClasses() {
|
|
48
|
-
const classes = ['bullet'];
|
|
49
|
-
if (!this.hasFooterSlotContent) {
|
|
50
|
-
classes.push(`bullet-no-footer`);
|
|
51
|
-
}
|
|
52
|
-
return classes.join(' ');
|
|
53
|
-
}
|
|
54
|
-
get footerClasses() {
|
|
55
|
-
const classes = ['footer'];
|
|
56
|
-
if (!this.hasActionSlotContent && !this.hasBulletSlotContent) {
|
|
57
|
-
classes.push(`footer-no-action-nor-bullet`);
|
|
58
|
-
}
|
|
59
|
-
else if (!this.hasActionSlotContent) {
|
|
60
|
-
classes.push(`footer-no-action`);
|
|
61
|
-
}
|
|
62
|
-
else if (!this.hasBulletSlotContent) {
|
|
63
|
-
classes.push(`footer-no-bullet`);
|
|
64
|
-
}
|
|
65
|
-
return classes.join(' ');
|
|
66
|
-
}
|
|
67
|
-
get hasActionSlotContent() {
|
|
68
|
-
return index$1.hasSlotContent(this.hostElement, 'action');
|
|
69
|
-
}
|
|
70
|
-
get hasBodySlotContent() {
|
|
71
|
-
return index$1.hasSlotContent(this.hostElement, 'body');
|
|
72
|
-
}
|
|
73
|
-
get hasBulletSlotContent() {
|
|
74
|
-
return index$1.hasSlotContent(this.hostElement, 'bullet');
|
|
75
|
-
}
|
|
76
|
-
get hasFooterSlotContent() {
|
|
77
|
-
return index$1.hasSlotContent(this.hostElement, 'footer');
|
|
78
|
-
}
|
|
79
|
-
get hasHeaderSlotContent() {
|
|
80
|
-
return index$1.hasSlotContent(this.hostElement, 'header');
|
|
81
|
-
}
|
|
82
|
-
get itemClasses() {
|
|
83
|
-
const classes = ['item'];
|
|
84
|
-
if (!this.hasActionSlotContent && !this.hasBulletSlotContent) {
|
|
85
|
-
classes.push(`item-no-action-nor-bullet`);
|
|
86
|
-
}
|
|
87
|
-
else if (!this.hasActionSlotContent) {
|
|
88
|
-
classes.push(`item-no-action`);
|
|
89
|
-
}
|
|
90
|
-
else if (!this.hasBulletSlotContent) {
|
|
91
|
-
classes.push(`item-no-bullet`);
|
|
92
|
-
}
|
|
93
|
-
if (!this.hasFooterSlotContent) {
|
|
94
|
-
classes.push(`item-no-footer`);
|
|
95
|
-
}
|
|
96
|
-
return classes.join(' ');
|
|
97
|
-
}
|
|
98
|
-
get mainClasses() {
|
|
99
|
-
const classes = ['main'];
|
|
100
|
-
if (!this.hasActionSlotContent && !this.hasBulletSlotContent) {
|
|
101
|
-
classes.push(`main-no-action-nor-bullet`);
|
|
102
|
-
}
|
|
103
|
-
else if (!this.hasBulletSlotContent) {
|
|
104
|
-
classes.push(`main-no-bullet`);
|
|
105
|
-
}
|
|
106
|
-
return classes.join(' ');
|
|
107
|
-
}
|
|
108
|
-
// #endregion
|
|
109
|
-
// #region Render Methods
|
|
110
|
-
render() {
|
|
111
|
-
const { clickable } = this;
|
|
112
|
-
return (index.h("div", { key: '0829fd5b35d9479ab8a7dae744e8a09e90a1a128', "test-id": "itemContainer", class: this.itemClasses, ref: el => (this.itemElement = el), role: clickable ? 'button' : undefined, tabIndex: clickable ? 0 : undefined }, this.hasBulletSlotContent && (index.h("div", { key: '6fba2ecbbe6fe30121f15cda9cc5026a5c5468c2', class: this.bulletClasses }, index.h("slot", { key: '9bd9880d99124c1102725b5ce6ca49ac1e229cf9', name: "bullet" }))), index.h("div", { key: '0c184236511ba043c91a009c93680858e34de545', class: this.mainClasses }, this.hasHeaderSlotContent && (index.h("div", { key: '2570b5fd60955dbbc97f5f3d941a5d653785fb0e', class: "header" }, index.h("slot", { key: 'a438cafe8aeded03ee814f736ae897852a9f1415', name: "header" }))), this.hasBodySlotContent && (index.h("div", { key: '270585a7a4ca111aedd4baeab101c353814aa72c', class: "body" }, index.h("slot", { key: 'cc95afec425e06c0a9edccedb0420207ccab88a0', name: "body" })))), this.hasActionSlotContent && (index.h("div", { key: 'c6a32baa731bd79c57a625d615058442a5bc764a', class: this.actionClasses }, index.h("slot", { key: '2b3104f1e0b4eed5e605c5784468f608240a881b', name: "action" }))), this.hasFooterSlotContent && (index.h("div", { key: '0a989b6ec5ca51e55fb44d0e90f57fe792a6bf35', class: this.footerClasses }, index.h("slot", { key: '76ae62c0b433f78b187853da2cf40394f7ca315e', name: "footer" })))));
|
|
113
|
-
}
|
|
114
|
-
get hostElement() { return index.getElement(this); }
|
|
115
|
-
};
|
|
116
|
-
Q2Item.style = Q2ItemStyle0;
|
|
117
|
-
|
|
118
|
-
exports.q2_item = Q2Item;
|
|
119
|
-
|
|
120
|
-
//# sourceMappingURL=q2-item.cjs.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"q2-item.entry.cjs.js","mappings":"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","names":["overrideFocus","hasSlotContent","h"],"sources":["src/components/q2-item/q2-item.scss?tag=q2-item&encapsulation=shadow","src/components/q2-item/q2-item.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n@import '../q2-btn/q2-btn-mixins';\n\n:host {\n display: block;\n}\n\n:host([clickable]) {\n cursor: pointer;\n --comp-background: #{var-list(\n --tct-btn-primary-background,\n --tct-btn-primary-bg,\n --t-a11y-active-gray-color-AA,\n #404040\n )};\n .item {\n --comp-border-radius: #{var-list(--tct-item-border-radius, --app-border-radius-1, 4px)};\n --comp-btn-tween: #{var-list(var-prefixer(btn-tween), --tct-tween-1, --app-tween-1, unquote('0.2s ease'))};\n --comp-btn-fallback-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n --comp-hover-box-shadow: #{var-list(--tct-btn-primary-box-shadow, --comp-btn-fallback-box-shadow)};\n --comp-active-box-shadow: var(--tct-btn-primary-active-background, #0063a0);\n --comp-font-color: #{var-list(--tct-btn-primary-font-color, --app-white, #ffffff)};\n @include btn-ring(primary, hover, --comp-background, --comp-font-color, null);\n &:hover {\n box-shadow: var(--comp-hover-box-shadow);\n }\n &:active {\n box-shadow: var(--comp-active-box-shadow);\n }\n &:focus-visible {\n box-shadow: var(--const-double-focus-ring);\n }\n }\n}\n\n.action {\n --tct-btn-icon-height: #{var-list(--tct-item-action-icon-height, --app-scale-6x, 30px)};\n --tct-btn-icon-width: #{var-list(--tct-item-action-icon-width, --app-scale-6x, 30px)};\n --tct-icon-size: #{var-list(--tct-item-action-icon-size, --app-scale-6x, 30px)};\n --tct-radio-label-hidden-columns: 18px;\n --tct-radio-label-margin-right: 0;\n --tct-radio-margin: 0;\n\n align-items: center;\n display: flex;\n grid-row: 1;\n justify-content: center;\n\n &-no-bullet {\n grid-column: 2;\n }\n}\n\n.body {\n color: var-list(--tct-item-body-color, --t-textA, #747474);\n font-size: var-list(--tct-item-body-font-size, --app-font-size, 14px);\n font-weight: var-list(--tct-item-body-font-weight, 400);\n}\n\n.bullet {\n --tct-avatar-fallback-height: #{var-list(--tct-item-avatar-height, --app-scale-7x, 35px)};\n --tct-avatar-fallback-width: #{var-list(--tct-item-avatar-width, --app-scale-7x, 35px)};\n --tct-avatar-height: #{var-list(--tct-item-avatar-height, --app-scale-7x, 35px)};\n --tct-avatar-width: #{var-list(--tct-item-avatar-width, --app-scale-7x, 35px)};\n\n grid-column: 1;\n grid-row-start: 1;\n grid-row-end: 3;\n padding-top: var-list(--tct-item-bullet-padding-top, --app-scale-1x, 5px);\n text-align: center;\n\n &-no-footer {\n grid-row-end: 2;\n }\n}\n\n.footer {\n grid-column-start: 2;\n grid-column-end: 4;\n grid-row: 2;\n\n &-no-action-nor-bullet {\n grid-column-start: 1;\n grid-column-end: 2;\n }\n\n &-no-action {\n grid-column-start: 2;\n grid-column-end: 3;\n }\n\n &-no-bullet {\n grid-column-start: 1;\n grid-column-end: 3;\n }\n}\n\n.header {\n color: var-list(--tct-item-header-color, --t-text, #4d4d4d);\n font-size: var-list(--tct-item-header-font-size, 16px);\n font-weight: var-list(--tct-item-header-font-weight, 600);\n line-height: var-list(--tct-item-header-line-height, 1.5);\n}\n\n.item {\n border: var(--tct-item-border);\n border-radius: var(--comp-border-radius);\n transition: var(--comp-btn-tween);\n transition-property: box-shadow;\n column-gap: var-list(--tct-item-horizontal-spacing, --app-scale-3x, 15px);\n display: grid;\n grid-template-columns: minmax(var(--app-scale-7x, 35px), auto) minmax(auto, 1fr) minmax(\n var(--app-scale-5x, 25px),\n auto\n );\n grid-template-rows: auto auto;\n padding: var(--tct-item-padding, 0);\n row-gap: var(--tct-item-vertical-spacing, var(--app-scale-2x, 10px));\n\n &-no-action-nor-bullet {\n grid-template-columns: auto;\n }\n\n &-no-action {\n grid-template-columns: minmax(var(--app-scale-7x, 35px), auto) minmax(auto, 1fr);\n }\n\n &-no-footer {\n grid-template-rows: auto;\n }\n\n &-no-bullet {\n grid-template-columns: minmax(auto, 1fr) minmax(var(--app-scale-5x, 25px), auto);\n }\n}\n\n.main {\n grid-column: 2;\n grid-row: 1;\n\n &-no-action-nor-bullet {\n grid-column: 1;\n }\n\n &-no-bullet {\n grid-column: 1;\n }\n}\n","import { Component, Element, Listen, h, State, Prop } from '@stencil/core';\nimport { hasSlotContent, overrideFocus } from 'src/utils';\n\n@Component({\n tag: 'q2-item',\n styleUrl: 'q2-item.scss',\n shadow: true,\n})\nexport class Q2Item {\n // #region Own Properties\n\n itemElement: HTMLDivElement;\n mutationObserver: MutationObserver;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n renderTrigger: number = 0;\n\n // #endregion\n // #region Public Property API\n\n /** Makes the item clickable. */\n @Prop({ reflect: true })\n clickable: boolean;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentDidLoad() {\n if (typeof MutationObserver !== 'undefined') {\n const observer = new MutationObserver(() => (this.renderTrigger += 1));\n observer.observe(this.hostElement, { childList: true, subtree: true, attributes: true });\n this.mutationObserver = observer;\n }\n overrideFocus(this.hostElement);\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (this.clickable) {\n this.itemElement?.focus();\n } else {\n event.preventDefault();\n }\n }\n\n // #endregion\n // #region Local Methods\n\n get actionClasses() {\n const classes = ['action'];\n if (!this.hasBulletSlotContent) {\n classes.push(`action-no-bullet`);\n }\n\n return classes.join(' ');\n }\n\n get bulletClasses() {\n const classes = ['bullet'];\n if (!this.hasFooterSlotContent) {\n classes.push(`bullet-no-footer`);\n }\n\n return classes.join(' ');\n }\n\n get footerClasses() {\n const classes = ['footer'];\n if (!this.hasActionSlotContent && !this.hasBulletSlotContent) {\n classes.push(`footer-no-action-nor-bullet`);\n } else if (!this.hasActionSlotContent) {\n classes.push(`footer-no-action`);\n } else if (!this.hasBulletSlotContent) {\n classes.push(`footer-no-bullet`);\n }\n\n return classes.join(' ');\n }\n\n get hasActionSlotContent() {\n return hasSlotContent(this.hostElement, 'action');\n }\n\n get hasBodySlotContent() {\n return hasSlotContent(this.hostElement, 'body');\n }\n\n get hasBulletSlotContent() {\n return hasSlotContent(this.hostElement, 'bullet');\n }\n\n get hasFooterSlotContent() {\n return hasSlotContent(this.hostElement, 'footer');\n }\n\n get hasHeaderSlotContent() {\n return hasSlotContent(this.hostElement, 'header');\n }\n\n get itemClasses() {\n const classes = ['item'];\n if (!this.hasActionSlotContent && !this.hasBulletSlotContent) {\n classes.push(`item-no-action-nor-bullet`);\n } else if (!this.hasActionSlotContent) {\n classes.push(`item-no-action`);\n } else if (!this.hasBulletSlotContent) {\n classes.push(`item-no-bullet`);\n }\n if (!this.hasFooterSlotContent) {\n classes.push(`item-no-footer`);\n }\n\n return classes.join(' ');\n }\n\n get mainClasses() {\n const classes = ['main'];\n if (!this.hasActionSlotContent && !this.hasBulletSlotContent) {\n classes.push(`main-no-action-nor-bullet`);\n } else if (!this.hasBulletSlotContent) {\n classes.push(`main-no-bullet`);\n }\n\n return classes.join(' ');\n }\n\n // #endregion\n // #region Render Methods\n\n render() {\n const { clickable } = this;\n return (\n <div\n test-id=\"itemContainer\"\n class={this.itemClasses}\n ref={el => (this.itemElement = el)}\n role={clickable ? 'button' : undefined}\n tabIndex={clickable ? 0 : undefined}\n >\n {this.hasBulletSlotContent && (\n <div class={this.bulletClasses}>\n <slot name=\"bullet\" />\n </div>\n )}\n <div class={this.mainClasses}>\n {this.hasHeaderSlotContent && (\n <div class=\"header\">\n <slot name=\"header\" />\n </div>\n )}\n {this.hasBodySlotContent && (\n <div class=\"body\">\n <slot name=\"body\" />\n </div>\n )}\n </div>\n {this.hasActionSlotContent && (\n <div class={this.actionClasses}>\n <slot name=\"action\" />\n </div>\n )}\n {this.hasFooterSlotContent && (\n <div class={this.footerClasses}>\n <slot name=\"footer\" />\n </div>\n )}\n </div>\n );\n }\n\n // #endregion\n}\n"],"version":3}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-e7e68b1e.js');
|
|
6
|
-
|
|
7
|
-
const q2LinkCss = "*{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 #0066cc)}: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}:host:active{box-shadow:none}.link-container{--comp-link-font-bold-stroke-width:0.5px;background:transparent;border:none;font-size:var(--tct-link-font-size, inherit);font-weight:var(--tct-link-font-weight, inherit)}.link-container.standalone{--comp-icon-stroke:var(--tct-link-icon-stroke-width, 1.5)}.link-container.standalone .link{color:var(--tct-link-color-standalone, var(--t-primary));height:var(--tct-link-height, 24px);display:flex;align-items:center;--tct-icon-size:16px;text-decoration:none}.link-container.standalone .link q2-icon{margin-left:var(--tct-link-label-icon-gap, 6px)}.link-container.standalone:hover{text-decoration:underline;-webkit-text-stroke-width:var(--tct-link-font-bold-stroke-width, var(--comp-link-font-bold-stroke-width));text-stroke-width:var(--tct-link-font-bold-stroke-width, var(--comp-link-font-bold-stroke-width));--tct-icon-stroke-width:calc(var(--comp-icon-stroke) + 0.5)}.link-container.standalone:active:hover{text-decoration:underline;-webkit-text-stroke-width:var(--tct-link-font-bold-stroke-width, var(--comp-link-font-bold-stroke-width));text-stroke-width:var(--tct-link-font-bold-stroke-width, var(--comp-link-font-bold-stroke-width));--tct-icon-stroke-width:calc(var(--comp-icon-stroke) + 0.5)}.link-container.standalone:active:hover .link{color:var(--tct-link-color-standalone-active, var(--t-primary-d2));box-shadow:none}.link-container.standalone.disabled .link{cursor:not-allowed;color:var(--tct-link-color-standalone-disabled, var(--t-primary));opacity:0.5;text-decoration:none}.link-container.standalone.disabled:hover{text-decoration:none}.link-container.inline{margin:0 var(--tct-link-side-margin, 6px);text-decoration:underline;color:var(--tct-link-color-inline, var(--t-primary))}.link-container.inline:hover{-webkit-text-stroke-width:var(--tct-link-font-bold-stroke-width, var(--comp-link-font-bold-stroke-width));text-stroke-width:var(--tct-link-font-bold-stroke-width, var(--comp-link-font-bold-stroke-width))}.link-container.inline:active:hover{-webkit-text-stroke-width:var(--tct-link-font-bold-stroke-width, var(--comp-link-font-bold-stroke-width));text-stroke-width:var(--tct-link-font-bold-stroke-width, var(--comp-link-font-bold-stroke-width));color:var(--tct-link-color-inline-active, var(--t-primary-d2));box-shadow:none}.link-container.inline.disabled{cursor:not-allowed;opacity:0.5}.link-container.inline:focus-visible .link-container.inline{box-shadow:var(--const-double-focus-ring)}";
|
|
8
|
-
const Q2LinkStyle0 = q2LinkCss;
|
|
9
|
-
|
|
10
|
-
const Q2Link = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
this.tctClick = index.createEvent(this, "tctClick", 7);
|
|
14
|
-
this.disabled = false;
|
|
15
|
-
this.href = '#';
|
|
16
|
-
this.label = undefined;
|
|
17
|
-
this.referrerpolicy = undefined;
|
|
18
|
-
this.target = undefined;
|
|
19
|
-
this.tctTitle = undefined;
|
|
20
|
-
this.variant = 'inline';
|
|
21
|
-
}
|
|
22
|
-
// #endregion
|
|
23
|
-
// #region Public Methods API
|
|
24
|
-
/**
|
|
25
|
-
* A method for click.
|
|
26
|
-
*
|
|
27
|
-
* @testOnly
|
|
28
|
-
*/
|
|
29
|
-
async clickLink() {
|
|
30
|
-
const anchor = this.hostElement.shadowRoot.querySelector(`[test-id="linkAnchor"]`);
|
|
31
|
-
anchor === null || anchor === void 0 ? void 0 : anchor.click();
|
|
32
|
-
}
|
|
33
|
-
// #endregion
|
|
34
|
-
// #region Local Methods
|
|
35
|
-
get classes() {
|
|
36
|
-
const list = ['link-container'];
|
|
37
|
-
if (this.variant)
|
|
38
|
-
list.push(this.variant);
|
|
39
|
-
if (!!this.disabled)
|
|
40
|
-
list.push('disabled');
|
|
41
|
-
return list.join(' ');
|
|
42
|
-
}
|
|
43
|
-
handleClick(event) {
|
|
44
|
-
event.stopPropagation();
|
|
45
|
-
if (this.disabled)
|
|
46
|
-
return;
|
|
47
|
-
this.tctClick.emit({
|
|
48
|
-
target: this.target,
|
|
49
|
-
referrerpolicy: this.referrerpolicy,
|
|
50
|
-
href: this.href,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
// #endregion
|
|
54
|
-
// #region Render Methods
|
|
55
|
-
render() {
|
|
56
|
-
return this.variant === 'standalone' ? (index.h("div", { class: this.classes, "aria-label": this.label }, index.h("a", { class: "link", onClick: e => this.handleClick(e), href: !!this.disabled ? undefined : this.href, target: this.target || '_self', referrerPolicy: this.referrerpolicy || undefined, title: this.tctTitle || undefined, "test-id": "linkAnchor" }, index.h("span", { class: "label" }, this.label), index.h("q2-icon", { type: "chevron-right" })))) : (index.h("a", { class: this.classes, onClick: e => this.handleClick(e), href: !!this.disabled ? undefined : this.href, target: this.target || '_self', referrerPolicy: this.referrerpolicy || undefined, title: this.tctTitle || undefined, "test-id": "linkAnchor" }, this.label));
|
|
57
|
-
}
|
|
58
|
-
get hostElement() { return index.getElement(this); }
|
|
59
|
-
};
|
|
60
|
-
Q2Link.style = Q2LinkStyle0;
|
|
61
|
-
|
|
62
|
-
exports.q2_link = Q2Link;
|
|
63
|
-
|
|
64
|
-
//# sourceMappingURL=q2-link.cjs.entry.js.map
|