@citolab/qti-components 7.0.6-beta.4 → 7.0.6-beta.5
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/cdn/chunks/chunk-EFU4L43Q.js +8 -0
- package/cdn/chunks/chunk-RIXTWE2H.js +8 -0
- package/cdn/chunks/chunk-ROZIP5LG.js +8 -0
- package/cdn/chunks/chunk-RPZVSBLM.js +8 -0
- package/cdn/chunks/chunk-TEYXRLTI.js +8 -0
- package/cdn/chunks/{chunk-SXM25YH3.js → chunk-U2TE6TOV.js} +12 -12
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +1 -1
- package/cdn/qti-components/index.js +1 -1
- package/cdn/qti-test/components/index.js +1 -1
- package/cdn/qti-test/components/test-component.abstract.js +1 -1
- package/cdn/qti-test/components/test-end-attempt.js +1 -1
- package/cdn/qti-test/components/test-item-link.js +1 -1
- package/cdn/qti-test/components/test-next.js +1 -1
- package/cdn/qti-test/components/test-paging-buttons-stamp.js +1 -1
- package/cdn/qti-test/components/test-prev.js +1 -1
- package/cdn/qti-test/components/test-show-correct-response.js +1 -1
- package/cdn/qti-test/components/test-view.js +1 -1
- package/dist/chunks/{chunk-MEQM6M67.js → chunk-6PAEJQSQ.js} +23 -28
- package/dist/chunks/chunk-6PAEJQSQ.js.map +1 -0
- package/dist/index.js +16 -16
- package/dist/qti-components/index.js +1 -1
- package/dist/qti-test/components/index.js +7 -7
- package/dist/qti-test/components/test-component.abstract.js +1 -1
- package/dist/qti-test/components/test-end-attempt.js +3 -3
- package/dist/qti-test/components/test-item-link.js +3 -3
- package/dist/qti-test/components/test-next.js +3 -3
- package/dist/qti-test/components/test-paging-buttons-stamp.js +1 -1
- package/dist/qti-test/components/test-prev.js +3 -3
- package/dist/qti-test/components/test-show-correct-response.js +3 -3
- package/dist/qti-test/components/test-view.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-4MQV5IRV.js +0 -59
- package/dist/chunks/chunk-4MQV5IRV.js.map +0 -1
- package/dist/chunks/chunk-5RTLOB3Q.js +0 -59
- package/dist/chunks/chunk-5RTLOB3Q.js.map +0 -1
- package/dist/chunks/chunk-MEQM6M67.js.map +0 -1
- package/dist/chunks/chunk-NHA53UTY.js +0 -52
- package/dist/chunks/chunk-NHA53UTY.js.map +0 -1
- package/dist/chunks/chunk-VAPB5TN4.js +0 -46
- package/dist/chunks/chunk-VAPB5TN4.js.map +0 -1
- package/dist/chunks/chunk-Z5THRO6Z.js +0 -46
- package/dist/chunks/chunk-Z5THRO6Z.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
QtiAssessmentItemRef,
|
|
3
|
-
QtiAssessmentSection,
|
|
4
|
-
QtiAssessmentTest,
|
|
5
|
-
QtiTest,
|
|
6
|
-
QtiTestPart,
|
|
7
|
-
TestContainer
|
|
8
|
-
} from "./chunks/chunk-ZQXZ6PK7.js";
|
|
9
1
|
import {
|
|
10
2
|
QtiAnd,
|
|
11
3
|
QtiAssessmentItem,
|
|
@@ -91,7 +83,7 @@ import {
|
|
|
91
83
|
QtiVariable,
|
|
92
84
|
qtiAndMixin,
|
|
93
85
|
qtiSubtractMixin
|
|
94
|
-
} from "./chunks/chunk-
|
|
86
|
+
} from "./chunks/chunk-6PAEJQSQ.js";
|
|
95
87
|
import {
|
|
96
88
|
getItemByUri,
|
|
97
89
|
getManifestInfo
|
|
@@ -100,6 +92,14 @@ import {
|
|
|
100
92
|
ItemContainer,
|
|
101
93
|
QtiItem
|
|
102
94
|
} from "./chunks/chunk-XCHS3RTZ.js";
|
|
95
|
+
import {
|
|
96
|
+
QtiAssessmentItemRef,
|
|
97
|
+
QtiAssessmentSection,
|
|
98
|
+
QtiAssessmentTest,
|
|
99
|
+
QtiTest,
|
|
100
|
+
QtiTestPart,
|
|
101
|
+
TestContainer
|
|
102
|
+
} from "./chunks/chunk-ZQXZ6PK7.js";
|
|
103
103
|
import "./chunks/chunk-NZQKGIJP.js";
|
|
104
104
|
import {
|
|
105
105
|
qtiTransformItem,
|
|
@@ -109,35 +109,35 @@ import {
|
|
|
109
109
|
import "./chunks/chunk-HOTNM5DT.js";
|
|
110
110
|
import {
|
|
111
111
|
TestEndAttempt
|
|
112
|
-
} from "./chunks/chunk-
|
|
112
|
+
} from "./chunks/chunk-W4272Q5U.js";
|
|
113
113
|
import {
|
|
114
114
|
TestItemLink
|
|
115
|
-
} from "./chunks/chunk-
|
|
115
|
+
} from "./chunks/chunk-CEXAR7BF.js";
|
|
116
116
|
import {
|
|
117
117
|
TestNext
|
|
118
|
-
} from "./chunks/chunk-
|
|
118
|
+
} from "./chunks/chunk-RX3BRYYI.js";
|
|
119
119
|
import {
|
|
120
120
|
TestPagingButtonsStamp
|
|
121
121
|
} from "./chunks/chunk-YQB6YLNW.js";
|
|
122
122
|
import {
|
|
123
123
|
TestPrev
|
|
124
|
-
} from "./chunks/chunk-
|
|
124
|
+
} from "./chunks/chunk-DNHDFXTV.js";
|
|
125
125
|
import {
|
|
126
126
|
TestShowCorrectResponse
|
|
127
|
-
} from "./chunks/chunk-
|
|
127
|
+
} from "./chunks/chunk-GQ5P3NWC.js";
|
|
128
128
|
import {
|
|
129
129
|
TestView
|
|
130
130
|
} from "./chunks/chunk-WWN5AD6V.js";
|
|
131
|
-
import "./chunks/chunk-4O5F7WV7.js";
|
|
132
131
|
import {
|
|
133
132
|
TestComponent
|
|
134
133
|
} from "./chunks/chunk-MLT7V47R.js";
|
|
134
|
+
import "./chunks/chunk-D3RGDWKP.js";
|
|
135
135
|
import {
|
|
136
136
|
testContext,
|
|
137
137
|
testElement
|
|
138
138
|
} from "./chunks/chunk-AUWATZ65.js";
|
|
139
|
-
import "./chunks/chunk-D3RGDWKP.js";
|
|
140
139
|
import "./chunks/chunk-ELDMXTUQ.js";
|
|
140
|
+
import "./chunks/chunk-4O5F7WV7.js";
|
|
141
141
|
import "./chunks/chunk-OIRWOI3E.js";
|
|
142
142
|
import "./chunks/chunk-DLUJN2FW.js";
|
|
143
143
|
import "./chunks/chunk-XSI6FXGD.js";
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
QtiVariable,
|
|
84
84
|
qtiAndMixin,
|
|
85
85
|
qtiSubtractMixin
|
|
86
|
-
} from "../chunks/chunk-
|
|
86
|
+
} from "../chunks/chunk-6PAEJQSQ.js";
|
|
87
87
|
import "../chunks/chunk-XDMSEAYC.js";
|
|
88
88
|
import "../chunks/chunk-D3RGDWKP.js";
|
|
89
89
|
import "../chunks/chunk-ELDMXTUQ.js";
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import "../../chunks/chunk-HOTNM5DT.js";
|
|
2
2
|
import {
|
|
3
3
|
TestEndAttempt
|
|
4
|
-
} from "../../chunks/chunk-
|
|
4
|
+
} from "../../chunks/chunk-W4272Q5U.js";
|
|
5
5
|
import {
|
|
6
6
|
TestItemLink
|
|
7
|
-
} from "../../chunks/chunk-
|
|
7
|
+
} from "../../chunks/chunk-CEXAR7BF.js";
|
|
8
8
|
import {
|
|
9
9
|
TestNext
|
|
10
|
-
} from "../../chunks/chunk-
|
|
10
|
+
} from "../../chunks/chunk-RX3BRYYI.js";
|
|
11
11
|
import {
|
|
12
12
|
TestPagingButtonsStamp
|
|
13
13
|
} from "../../chunks/chunk-YQB6YLNW.js";
|
|
14
14
|
import {
|
|
15
15
|
TestPrev
|
|
16
|
-
} from "../../chunks/chunk-
|
|
16
|
+
} from "../../chunks/chunk-DNHDFXTV.js";
|
|
17
17
|
import {
|
|
18
18
|
TestShowCorrectResponse
|
|
19
|
-
} from "../../chunks/chunk-
|
|
19
|
+
} from "../../chunks/chunk-GQ5P3NWC.js";
|
|
20
20
|
import {
|
|
21
21
|
TestView
|
|
22
22
|
} from "../../chunks/chunk-WWN5AD6V.js";
|
|
23
|
-
import "../../chunks/chunk-4O5F7WV7.js";
|
|
24
23
|
import {
|
|
25
24
|
TestComponent
|
|
26
25
|
} from "../../chunks/chunk-MLT7V47R.js";
|
|
27
|
-
import "../../chunks/chunk-AUWATZ65.js";
|
|
28
26
|
import "../../chunks/chunk-D3RGDWKP.js";
|
|
27
|
+
import "../../chunks/chunk-AUWATZ65.js";
|
|
29
28
|
import "../../chunks/chunk-ELDMXTUQ.js";
|
|
29
|
+
import "../../chunks/chunk-4O5F7WV7.js";
|
|
30
30
|
import "../../chunks/chunk-H2JE6IVU.js";
|
|
31
31
|
export {
|
|
32
32
|
TestComponent,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TestComponent
|
|
3
3
|
} from "../../chunks/chunk-MLT7V47R.js";
|
|
4
|
-
import "../../chunks/chunk-AUWATZ65.js";
|
|
5
4
|
import "../../chunks/chunk-D3RGDWKP.js";
|
|
5
|
+
import "../../chunks/chunk-AUWATZ65.js";
|
|
6
6
|
import "../../chunks/chunk-ELDMXTUQ.js";
|
|
7
7
|
import "../../chunks/chunk-H2JE6IVU.js";
|
|
8
8
|
export {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TestEndAttempt
|
|
3
|
-
} from "../../chunks/chunk-
|
|
4
|
-
import "../../chunks/chunk-4O5F7WV7.js";
|
|
3
|
+
} from "../../chunks/chunk-W4272Q5U.js";
|
|
5
4
|
import "../../chunks/chunk-MLT7V47R.js";
|
|
6
|
-
import "../../chunks/chunk-AUWATZ65.js";
|
|
7
5
|
import "../../chunks/chunk-D3RGDWKP.js";
|
|
6
|
+
import "../../chunks/chunk-AUWATZ65.js";
|
|
8
7
|
import "../../chunks/chunk-ELDMXTUQ.js";
|
|
8
|
+
import "../../chunks/chunk-4O5F7WV7.js";
|
|
9
9
|
import "../../chunks/chunk-H2JE6IVU.js";
|
|
10
10
|
export {
|
|
11
11
|
TestEndAttempt
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TestItemLink
|
|
3
|
-
} from "../../chunks/chunk-
|
|
4
|
-
import "../../chunks/chunk-4O5F7WV7.js";
|
|
3
|
+
} from "../../chunks/chunk-CEXAR7BF.js";
|
|
5
4
|
import "../../chunks/chunk-MLT7V47R.js";
|
|
6
|
-
import "../../chunks/chunk-AUWATZ65.js";
|
|
7
5
|
import "../../chunks/chunk-D3RGDWKP.js";
|
|
6
|
+
import "../../chunks/chunk-AUWATZ65.js";
|
|
8
7
|
import "../../chunks/chunk-ELDMXTUQ.js";
|
|
8
|
+
import "../../chunks/chunk-4O5F7WV7.js";
|
|
9
9
|
import "../../chunks/chunk-H2JE6IVU.js";
|
|
10
10
|
export {
|
|
11
11
|
TestItemLink
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TestNext
|
|
3
|
-
} from "../../chunks/chunk-
|
|
4
|
-
import "../../chunks/chunk-4O5F7WV7.js";
|
|
3
|
+
} from "../../chunks/chunk-RX3BRYYI.js";
|
|
5
4
|
import "../../chunks/chunk-MLT7V47R.js";
|
|
6
|
-
import "../../chunks/chunk-AUWATZ65.js";
|
|
7
5
|
import "../../chunks/chunk-D3RGDWKP.js";
|
|
6
|
+
import "../../chunks/chunk-AUWATZ65.js";
|
|
8
7
|
import "../../chunks/chunk-ELDMXTUQ.js";
|
|
8
|
+
import "../../chunks/chunk-4O5F7WV7.js";
|
|
9
9
|
import "../../chunks/chunk-H2JE6IVU.js";
|
|
10
10
|
export {
|
|
11
11
|
TestNext
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
TestPagingButtonsStamp
|
|
3
3
|
} from "../../chunks/chunk-YQB6YLNW.js";
|
|
4
4
|
import "../../chunks/chunk-MLT7V47R.js";
|
|
5
|
-
import "../../chunks/chunk-AUWATZ65.js";
|
|
6
5
|
import "../../chunks/chunk-D3RGDWKP.js";
|
|
6
|
+
import "../../chunks/chunk-AUWATZ65.js";
|
|
7
7
|
import "../../chunks/chunk-ELDMXTUQ.js";
|
|
8
8
|
import "../../chunks/chunk-H2JE6IVU.js";
|
|
9
9
|
export {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TestPrev
|
|
3
|
-
} from "../../chunks/chunk-
|
|
4
|
-
import "../../chunks/chunk-4O5F7WV7.js";
|
|
3
|
+
} from "../../chunks/chunk-DNHDFXTV.js";
|
|
5
4
|
import "../../chunks/chunk-MLT7V47R.js";
|
|
6
|
-
import "../../chunks/chunk-AUWATZ65.js";
|
|
7
5
|
import "../../chunks/chunk-D3RGDWKP.js";
|
|
6
|
+
import "../../chunks/chunk-AUWATZ65.js";
|
|
8
7
|
import "../../chunks/chunk-ELDMXTUQ.js";
|
|
8
|
+
import "../../chunks/chunk-4O5F7WV7.js";
|
|
9
9
|
import "../../chunks/chunk-H2JE6IVU.js";
|
|
10
10
|
export {
|
|
11
11
|
TestPrev
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TestShowCorrectResponse
|
|
3
|
-
} from "../../chunks/chunk-
|
|
4
|
-
import "../../chunks/chunk-4O5F7WV7.js";
|
|
3
|
+
} from "../../chunks/chunk-GQ5P3NWC.js";
|
|
5
4
|
import "../../chunks/chunk-MLT7V47R.js";
|
|
6
|
-
import "../../chunks/chunk-AUWATZ65.js";
|
|
7
5
|
import "../../chunks/chunk-D3RGDWKP.js";
|
|
6
|
+
import "../../chunks/chunk-AUWATZ65.js";
|
|
8
7
|
import "../../chunks/chunk-ELDMXTUQ.js";
|
|
8
|
+
import "../../chunks/chunk-4O5F7WV7.js";
|
|
9
9
|
import "../../chunks/chunk-H2JE6IVU.js";
|
|
10
10
|
export {
|
|
11
11
|
TestShowCorrectResponse
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
TestView
|
|
3
3
|
} from "../../chunks/chunk-WWN5AD6V.js";
|
|
4
4
|
import "../../chunks/chunk-MLT7V47R.js";
|
|
5
|
-
import "../../chunks/chunk-AUWATZ65.js";
|
|
6
5
|
import "../../chunks/chunk-D3RGDWKP.js";
|
|
6
|
+
import "../../chunks/chunk-AUWATZ65.js";
|
|
7
7
|
import "../../chunks/chunk-ELDMXTUQ.js";
|
|
8
8
|
import "../../chunks/chunk-H2JE6IVU.js";
|
|
9
9
|
export {
|
package/package.json
CHANGED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
btn,
|
|
3
|
-
dis
|
|
4
|
-
} from "./chunk-4O5F7WV7.js";
|
|
5
|
-
import {
|
|
6
|
-
TestComponent
|
|
7
|
-
} from "./chunk-MLT7V47R.js";
|
|
8
|
-
import {
|
|
9
|
-
__decorateClass
|
|
10
|
-
} from "./chunk-H2JE6IVU.js";
|
|
11
|
-
|
|
12
|
-
// src/lib/qti-test/components/test-prev.ts
|
|
13
|
-
import { css, html } from "lit";
|
|
14
|
-
import { customElement } from "lit/decorators.js";
|
|
15
|
-
var TestPrev = class extends TestComponent {
|
|
16
|
-
constructor() {
|
|
17
|
-
super();
|
|
18
|
-
this._internals.role = "button";
|
|
19
|
-
this._internals.ariaLabel = "Next item";
|
|
20
|
-
this.addEventListener("click", (e) => {
|
|
21
|
-
e.preventDefault();
|
|
22
|
-
if (!this.disabled) this._requestItem(this.items[this.itemIndex - 1].identifier);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
_requestItem(identifier) {
|
|
26
|
-
this.dispatchEvent(
|
|
27
|
-
new CustomEvent("qti-request-test-item", {
|
|
28
|
-
composed: true,
|
|
29
|
-
bubbles: true,
|
|
30
|
-
detail: identifier
|
|
31
|
-
})
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
willUpdate(changedProperties) {
|
|
35
|
-
super.willUpdate(changedProperties);
|
|
36
|
-
if (changedProperties.has("_testContext")) {
|
|
37
|
-
this.disabled = !this._testElement || this.itemIndex === 0 || this.itemIndex === -1;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
render() {
|
|
41
|
-
return html`<slot></slot>`;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
TestPrev.styles = css`
|
|
45
|
-
:host {
|
|
46
|
-
${btn};
|
|
47
|
-
}
|
|
48
|
-
:host([disabled]) {
|
|
49
|
-
${dis};
|
|
50
|
-
}
|
|
51
|
-
`;
|
|
52
|
-
TestPrev = __decorateClass([
|
|
53
|
-
customElement("test-prev")
|
|
54
|
-
], TestPrev);
|
|
55
|
-
|
|
56
|
-
export {
|
|
57
|
-
TestPrev
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=chunk-4MQV5IRV.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-test/components/test-prev.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { TestComponent } from './test-component.abstract';\nimport * as styles from './styles';\n\n/**\n * Represents a custom element for navigating to the previous test item.\n *\n * @remarks\n * This element provides functionality for navigating to the previous test item.\n *\n * @example\n * ```html\n * <test-prev></test-prev>\n * ```\n */\n@customElement('test-prev')\nexport class TestPrev extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n constructor() {\n super();\n this._internals.role = 'button';\n this._internals.ariaLabel = 'Next item';\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this.disabled) this._requestItem(this.items[this.itemIndex - 1].identifier);\n });\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', {\n composed: true,\n bubbles: true,\n detail: identifier\n })\n );\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n this.disabled = !this._testElement || this.itemIndex === 0 || this.itemIndex === -1;\n }\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-previous': TestPrev;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAC1B,SAAS,qBAAqB;AAgBvB,IAAM,WAAN,cAAuB,cAAc;AAAA,EAU1C,cAAc;AACZ,UAAM;AACN,SAAK,WAAW,OAAO;AACvB,SAAK,WAAW,YAAY;AAE5B,SAAK,iBAAiB,SAAS,OAAK;AAClC,QAAE,eAAe;AACjB,UAAI,CAAC,KAAK,SAAU,MAAK,aAAa,KAAK,MAAM,KAAK,YAAY,CAAC,EAAE,UAAU;AAAA,IACjF,CAAC;AAAA,EACH;AAAA,EAEU,aAAa,YAA0B;AAC/C,SAAK;AAAA,MACH,IAAI,YAAY,yBAAyB;AAAA,QACvC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,WAAW,mBAA2D;AACpE,UAAM,WAAW,iBAAiB;AAClC,QAAI,kBAAkB,IAAI,cAAc,GAAG;AACzC,WAAK,WAAW,CAAC,KAAK,gBAAgB,KAAK,cAAc,KAAK,KAAK,cAAc;AAAA,IACnF;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AAzCa,SACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AANL,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":[]}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
btn,
|
|
3
|
-
dis
|
|
4
|
-
} from "./chunk-4O5F7WV7.js";
|
|
5
|
-
import {
|
|
6
|
-
TestComponent
|
|
7
|
-
} from "./chunk-MLT7V47R.js";
|
|
8
|
-
import {
|
|
9
|
-
__decorateClass
|
|
10
|
-
} from "./chunk-H2JE6IVU.js";
|
|
11
|
-
|
|
12
|
-
// src/lib/qti-test/components/test-next.ts
|
|
13
|
-
import { css, html } from "lit";
|
|
14
|
-
import { customElement } from "lit/decorators.js";
|
|
15
|
-
var TestNext = class extends TestComponent {
|
|
16
|
-
constructor() {
|
|
17
|
-
super();
|
|
18
|
-
this._internals.role = "button";
|
|
19
|
-
this._internals.ariaLabel = "Next item";
|
|
20
|
-
this.addEventListener("click", (e) => {
|
|
21
|
-
e.preventDefault();
|
|
22
|
-
if (!this.disabled) this._requestItem(this.items[this.itemIndex + 1].identifier);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
willUpdate(changedProperties) {
|
|
26
|
-
super.willUpdate(changedProperties);
|
|
27
|
-
if (changedProperties.has("_testContext")) {
|
|
28
|
-
this.disabled = !this._testElement || this.itemIndex < 0 || this.itemIndex >= this.items.length - 1;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
_requestItem(identifier) {
|
|
32
|
-
this.dispatchEvent(
|
|
33
|
-
new CustomEvent("qti-request-test-item", {
|
|
34
|
-
composed: true,
|
|
35
|
-
bubbles: true,
|
|
36
|
-
detail: identifier
|
|
37
|
-
})
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
render() {
|
|
41
|
-
return html`<slot></slot>`;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
TestNext.styles = css`
|
|
45
|
-
:host {
|
|
46
|
-
${btn};
|
|
47
|
-
}
|
|
48
|
-
:host([disabled]) {
|
|
49
|
-
${dis};
|
|
50
|
-
}
|
|
51
|
-
`;
|
|
52
|
-
TestNext = __decorateClass([
|
|
53
|
-
customElement("test-next")
|
|
54
|
-
], TestNext);
|
|
55
|
-
|
|
56
|
-
export {
|
|
57
|
-
TestNext
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=chunk-5RTLOB3Q.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-test/components/test-next.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport * as styles from './styles';\nimport { TestComponent } from './test-component.abstract';\n\n/**\n * Represents a custom element for navigating to the next test item.\n *\n * @remarks\n * This element provides functionality for navigating to the next test item.\n *\n * @example\n * ```html\n * <test-next></test-next>\n * ```\n */\n@customElement('test-next')\nexport class TestNext extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n constructor() {\n super();\n this._internals.role = 'button';\n this._internals.ariaLabel = 'Next item';\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this.disabled) this._requestItem(this.items[this.itemIndex + 1].identifier);\n });\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n this.disabled = !this._testElement || this.itemIndex < 0 || this.itemIndex >= this.items.length - 1;\n }\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', {\n composed: true,\n bubbles: true,\n detail: identifier\n })\n );\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-next': TestNext;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAC1B,SAAS,qBAAqB;AAgBvB,IAAM,WAAN,cAAuB,cAAc;AAAA,EAU1C,cAAc;AACZ,UAAM;AACN,SAAK,WAAW,OAAO;AACvB,SAAK,WAAW,YAAY;AAE5B,SAAK,iBAAiB,SAAS,OAAK;AAClC,QAAE,eAAe;AACjB,UAAI,CAAC,KAAK,SAAU,MAAK,aAAa,KAAK,MAAM,KAAK,YAAY,CAAC,EAAE,UAAU;AAAA,IACjF,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,mBAA2D;AACpE,UAAM,WAAW,iBAAiB;AAClC,QAAI,kBAAkB,IAAI,cAAc,GAAG;AACzC,WAAK,WAAW,CAAC,KAAK,gBAAgB,KAAK,YAAY,KAAK,KAAK,aAAa,KAAK,MAAM,SAAS;AAAA,IACpG;AAAA,EACF;AAAA,EAEU,aAAa,YAA0B;AAC/C,SAAK;AAAA,MACH,IAAI,YAAY,yBAAyB;AAAA,QACvC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AAzCa,SACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AANL,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":[]}
|