@usecapsule/core-components 2.0.9 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/capsule-core.css +54 -19
- package/css/capsule-core.css.map +1 -1
- package/dist/capsule/capsule.esm.js +1 -1
- package/dist/capsule/capsule.esm.js.map +1 -1
- package/dist/capsule/index.esm.js +1 -1
- package/dist/capsule/index.esm.js.map +1 -1
- package/dist/capsule/{p-415384b7.entry.js → p-0d0a0037.entry.js} +2 -2
- package/dist/capsule/p-4d8e4d86.entry.js +29 -0
- package/dist/capsule/p-4d8e4d86.entry.js.map +1 -0
- package/dist/capsule/p-86e48e61.js +3 -0
- package/dist/capsule/p-86e48e61.js.map +1 -0
- package/dist/capsule/p-ad14a817.entry.js +2 -0
- package/dist/capsule/p-b6b38e73.js +2 -0
- package/dist/capsule/p-b6b38e73.js.map +1 -0
- package/dist/capsule/p-d28b96ba.entry.js +10 -0
- package/dist/capsule/{p-b76350fd.entry.js.map → p-d28b96ba.entry.js.map} +1 -1
- package/dist/capsule/{p-4d957466.entry.js → p-fa078837.entry.js} +2 -2
- package/dist/capsule/{p-fa4e3c14.entry.js → p-fcead80b.entry.js} +2 -2
- package/dist/cjs/capsule.cjs.js +2 -2
- package/dist/cjs/constants-0869a780.js +29 -0
- package/dist/cjs/constants-0869a780.js.map +1 -0
- package/dist/cjs/{cpsl-alert_18.cjs.entry.js → cpsl-alert_29.cjs.entry.js} +598 -185
- package/dist/cjs/cpsl-alert_29.cjs.entry.js.map +1 -0
- package/dist/cjs/cpsl-animation.cjs.entry.js +2 -2
- package/dist/cjs/cpsl-col.cjs.entry.js +2 -2
- package/dist/cjs/cpsl-grid.cjs.entry.js +3 -3
- package/dist/cjs/cpsl-info-box.cjs.entry.js +2 -2
- package/dist/cjs/cpsl-row.cjs.entry.js +2 -2
- package/dist/cjs/{index-87ba56f9.js → index-5733071e.js} +6 -3
- package/dist/cjs/index-5733071e.js.map +1 -0
- package/dist/cjs/index.cjs.js +53 -24
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/assets/icons/check-circle.svg +3 -0
- package/dist/collection/assets/icons/home.svg +3 -0
- package/dist/collection/assets/icons/index.js +4 -1
- package/dist/collection/assets/icons/index.js.map +1 -1
- package/dist/collection/assets/icons/settings.svg +4 -0
- package/dist/collection/collection-manifest.json +11 -0
- package/dist/collection/components/cpsl-alert/cpsl-alert.css +21 -11
- package/dist/collection/components/cpsl-alert/cpsl-alert.js +34 -26
- package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
- package/dist/collection/components/cpsl-animation/cpsl-animation.js +1 -1
- package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.css +67 -0
- package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js +69 -0
- package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js.map +1 -0
- package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.e2e.js +29 -0
- package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.spec.js +37 -0
- package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.spec.js.map +1 -0
- package/dist/collection/components/cpsl-avatar/cpsl-avatar.css +31 -0
- package/dist/collection/components/cpsl-avatar/cpsl-avatar.js +81 -0
- package/dist/collection/components/cpsl-avatar/cpsl-avatar.js.map +1 -0
- package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.e2e.js +29 -0
- package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.spec.js +37 -0
- package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.spec.js.map +1 -0
- package/dist/collection/components/cpsl-button/cpsl-button.css +175 -51
- package/dist/collection/components/cpsl-button/cpsl-button.js +46 -5
- package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
- package/dist/collection/components/cpsl-button-group/cpsl-button-group.css +88 -0
- package/dist/collection/components/cpsl-button-group/cpsl-button-group.js +78 -0
- package/dist/collection/components/cpsl-button-group/cpsl-button-group.js.map +1 -0
- package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.e2e.js +29 -0
- package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.spec.js +37 -0
- package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.spec.js.map +1 -0
- package/dist/collection/components/cpsl-card/cpsl-card.css +81 -0
- package/dist/collection/components/cpsl-card/cpsl-card.js +19 -0
- package/dist/collection/components/cpsl-card/cpsl-card.js.map +1 -0
- package/dist/collection/components/cpsl-card/test/cpsl-card.e2e.js +29 -0
- package/dist/collection/components/cpsl-card/test/cpsl-card.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-card/test/cpsl-card.spec.js +37 -0
- package/dist/collection/components/cpsl-card/test/cpsl-card.spec.js.map +1 -0
- package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.css +110 -0
- package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js +64 -0
- package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js.map +1 -0
- package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.e2e.js +29 -0
- package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.spec.js +37 -0
- package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.spec.js.map +1 -0
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +1 -1
- package/dist/collection/components/cpsl-col/cpsl-col.js +1 -1
- package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
- package/dist/collection/components/cpsl-drawer/cpsl-drawer.css +90 -0
- package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +149 -0
- package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -0
- package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.e2e.js +29 -0
- package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.spec.js +37 -0
- package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.spec.js.map +1 -0
- package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +1 -1
- package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
- package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
- package/dist/collection/components/cpsl-input/cpsl-input.css +35 -19
- package/dist/collection/components/cpsl-input/cpsl-input.js +47 -6
- package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
- package/dist/collection/components/cpsl-modal/cpsl-modal.css +12 -2
- package/dist/collection/components/cpsl-modal/cpsl-modal.js +20 -2
- package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +1 -1
- package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.css +50 -0
- package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +78 -0
- package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js.map +1 -0
- package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.js +29 -0
- package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.js +37 -0
- package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.js.map +1 -0
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.css +61 -3
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +35 -17
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.js.map +1 -1
- package/dist/collection/components/cpsl-pagination/cpsl-pagination.css +67 -0
- package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +174 -0
- package/dist/collection/components/cpsl-pagination/cpsl-pagination.js.map +1 -0
- package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.e2e.js +29 -0
- package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.spec.js +37 -0
- package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.spec.js.map +1 -0
- package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +1 -1
- package/dist/collection/components/cpsl-radio/cpsl-radio.css +97 -0
- package/dist/collection/components/cpsl-radio/cpsl-radio.js +66 -0
- package/dist/collection/components/cpsl-radio/cpsl-radio.js.map +1 -0
- package/dist/collection/components/cpsl-radio/test/cpsl-radio.e2e.js +29 -0
- package/dist/collection/components/cpsl-radio/test/cpsl-radio.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-radio/test/cpsl-radio.spec.js +37 -0
- package/dist/collection/components/cpsl-radio/test/cpsl-radio.spec.js.map +1 -0
- package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
- package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +2 -2
- package/dist/collection/components/cpsl-switch/cpsl-switch.css +115 -0
- package/dist/collection/components/cpsl-switch/cpsl-switch.js +64 -0
- package/dist/collection/components/cpsl-switch/cpsl-switch.js.map +1 -0
- package/dist/collection/components/cpsl-switch/test/cpsl-switch.e2e.js +29 -0
- package/dist/collection/components/cpsl-switch/test/cpsl-switch.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-switch/test/cpsl-switch.spec.js +37 -0
- package/dist/collection/components/cpsl-switch/test/cpsl-switch.spec.js.map +1 -0
- package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
- package/dist/collection/components/cpsl-table/cpsl-table.css +179 -0
- package/dist/collection/components/cpsl-table/cpsl-table.js +88 -0
- package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -0
- package/dist/collection/components/cpsl-table/table-interface.js +2 -0
- package/dist/collection/components/cpsl-table/table-interface.js.map +1 -0
- package/dist/collection/components/cpsl-table/test/cpsl-table.e2e.js +29 -0
- package/dist/collection/components/cpsl-table/test/cpsl-table.e2e.js.map +1 -0
- package/dist/collection/components/cpsl-table/test/cpsl-table.spec.js +37 -0
- package/dist/collection/components/cpsl-table/test/cpsl-table.spec.js.map +1 -0
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +1 -1
- package/dist/collection/components/cpsl-text/cpsl-text.js +1 -1
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
- package/dist/collection/constants.js +14 -0
- package/dist/collection/constants.js.map +1 -1
- package/dist/collection/interface.js.map +1 -1
- package/dist/collection/utils/theme/generateBorderRadii.js +24 -7
- package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
- package/dist/collection/utils/theme/generatePalette.js +22 -18
- package/dist/collection/utils/theme/generatePalette.js.map +1 -1
- package/dist/collection/utils/theme/utils.js +8 -0
- package/dist/collection/utils/theme/utils.js.map +1 -1
- package/dist/esm/capsule.js +3 -3
- package/dist/esm/constants-6acf4ea8.js +23 -0
- package/dist/esm/constants-6acf4ea8.js.map +1 -0
- package/dist/esm/{cpsl-alert_18.entry.js → cpsl-alert_29.entry.js} +588 -186
- package/dist/esm/cpsl-alert_29.entry.js.map +1 -0
- package/dist/esm/cpsl-animation.entry.js +2 -2
- package/dist/esm/cpsl-col.entry.js +2 -2
- package/dist/esm/cpsl-grid.entry.js +3 -3
- package/dist/esm/cpsl-info-box.entry.js +2 -2
- package/dist/esm/cpsl-row.entry.js +2 -2
- package/dist/esm/{index-fd970ca2.js → index-8fe9f35e.js} +6 -3
- package/dist/esm/index-8fe9f35e.js.map +1 -0
- package/dist/esm/index.js +53 -24
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/assets/icons/index.d.ts +3 -0
- package/dist/types/components/cpsl-alert/cpsl-alert.d.ts +2 -2
- package/dist/types/components/cpsl-app-bar/cpsl-app-bar.d.ts +5 -0
- package/dist/types/components/cpsl-avatar/cpsl-avatar.d.ts +6 -0
- package/dist/types/components/cpsl-button/cpsl-button.d.ts +2 -0
- package/dist/types/components/cpsl-button-group/cpsl-button-group.d.ts +9 -0
- package/dist/types/components/cpsl-card/cpsl-card.d.ts +3 -0
- package/dist/types/components/cpsl-checkbox/cpsl-checkbox.d.ts +7 -0
- package/dist/types/components/cpsl-drawer/cpsl-drawer.d.ts +9 -0
- package/dist/types/components/cpsl-input/cpsl-input.d.ts +4 -0
- package/dist/types/components/cpsl-modal/cpsl-modal.d.ts +1 -0
- package/dist/types/components/cpsl-nav-button-group/cpsl-nav-button-group.d.ts +9 -0
- package/dist/types/components/cpsl-overlay/cpsl-overlay.d.ts +2 -1
- package/dist/types/components/cpsl-pagination/cpsl-pagination.d.ts +14 -0
- package/dist/types/components/cpsl-radio/cpsl-radio.d.ts +7 -0
- package/dist/types/components/cpsl-switch/cpsl-switch.d.ts +7 -0
- package/dist/types/components/cpsl-table/cpsl-table.d.ts +9 -0
- package/dist/types/components/cpsl-table/table-interface.d.ts +19 -0
- package/dist/types/components.d.ts +435 -6
- package/dist/types/constants.d.ts +14 -0
- package/dist/types/interface.d.ts +35 -0
- package/dist/types/utils/theme/utils.d.ts +1 -0
- package/package.json +3 -2
- package/dist/capsule/p-2ce99420.entry.js +0 -29
- package/dist/capsule/p-2ce99420.entry.js.map +0 -1
- package/dist/capsule/p-6b02ea8d.entry.js +0 -2
- package/dist/capsule/p-b2997f3c.js +0 -3
- package/dist/capsule/p-b2997f3c.js.map +0 -1
- package/dist/capsule/p-b76350fd.entry.js +0 -10
- package/dist/capsule/p-c2bf050b.js +0 -2
- package/dist/capsule/p-c2bf050b.js.map +0 -1
- package/dist/cjs/constants-4bb85cc5.js +0 -12
- package/dist/cjs/constants-4bb85cc5.js.map +0 -1
- package/dist/cjs/cpsl-alert_18.cjs.entry.js.map +0 -1
- package/dist/cjs/index-87ba56f9.js.map +0 -1
- package/dist/esm/constants-7b49abd5.js +0 -9
- package/dist/esm/constants-7b49abd5.js.map +0 -1
- package/dist/esm/cpsl-alert_18.entry.js.map +0 -1
- package/dist/esm/index-fd970ca2.js.map +0 -1
- /package/dist/capsule/{p-415384b7.entry.js.map → p-0d0a0037.entry.js.map} +0 -0
- /package/dist/capsule/{p-6b02ea8d.entry.js.map → p-ad14a817.entry.js.map} +0 -0
- /package/dist/capsule/{p-4d957466.entry.js.map → p-fa078837.entry.js.map} +0 -0
- /package/dist/capsule/{p-fa4e3c14.entry.js.map → p-fcead80b.entry.js.map} +0 -0
- /package/dist/types/Users/{vinay → taylorbosch}/Documents/GitHub/Capsule/component-library/core/.stencil/scripts/buildIconLibrary.d.ts +0 -0
@@ -1,11 +1,69 @@
|
|
1
|
+
/**
|
2
|
+
* Convert a font size to a dynamic font size.
|
3
|
+
* Fonts that participate in Dynamic Type should use
|
4
|
+
* dynamic font sizes.
|
5
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
6
|
+
* @param unit (optional) - The unit to convert to. Use this if you want to
|
7
|
+
* convert to a unit other than $baselineUnit.
|
8
|
+
*/
|
9
|
+
/**
|
10
|
+
* Convert a font size to a dynamic font size but impose
|
11
|
+
* a maximum font size.
|
12
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
13
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
14
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
15
|
+
* convert to a unit other than $baselineUnit.
|
16
|
+
*/
|
17
|
+
/**
|
18
|
+
* Convert a font size to a dynamic font size but impose
|
19
|
+
* a minimum font size.
|
20
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
21
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
22
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
23
|
+
* convert to a unit other than $baselineUnit.
|
24
|
+
*/
|
25
|
+
/**
|
26
|
+
* Convert a font size to a dynamic font size but impose
|
27
|
+
* maximum and minimum font sizes.
|
28
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
29
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
30
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
31
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
32
|
+
* convert to a unit other than $baselineUnit.
|
33
|
+
*/
|
34
|
+
/**
|
35
|
+
* A heuristic that applies CSS to tablet
|
36
|
+
* viewports.
|
37
|
+
*
|
38
|
+
* Usage:
|
39
|
+
* @include tablet-viewport() {
|
40
|
+
* :host {
|
41
|
+
* background-color: green;
|
42
|
+
* }
|
43
|
+
* }
|
44
|
+
*/
|
45
|
+
/**
|
46
|
+
* A heuristic that applies CSS to mobile
|
47
|
+
* viewports (i.e. phones, not tablets).
|
48
|
+
*
|
49
|
+
* Usage:
|
50
|
+
* @include mobile-viewport() {
|
51
|
+
* :host {
|
52
|
+
* background-color: blue;
|
53
|
+
* }
|
54
|
+
* }
|
55
|
+
*/
|
1
56
|
:host {
|
2
57
|
position: fixed;
|
3
58
|
width: 100%;
|
4
59
|
height: 100%;
|
5
|
-
|
6
|
-
|
7
|
-
z-index: 999999999999;
|
60
|
+
inset: 0px;
|
61
|
+
z-index: 10001;
|
8
62
|
opacity: 0%;
|
9
63
|
display: none;
|
10
64
|
background-color: var(--cpsl-color-alpha-black-50);
|
65
|
+
}
|
66
|
+
|
67
|
+
:host(.over-modal) {
|
68
|
+
z-index: 10005;
|
11
69
|
}
|
@@ -2,9 +2,10 @@ import { Host, h } from "@stencil/core";
|
|
2
2
|
import gsap from "gsap";
|
3
3
|
export class CpslOverlay {
|
4
4
|
constructor() {
|
5
|
-
this.open = undefined;
|
6
5
|
this.enterTransitionDuration = 0.5;
|
7
6
|
this.exitTransitionDuration = 0.5;
|
7
|
+
this.open = undefined;
|
8
|
+
this.zIndexOverride = undefined;
|
8
9
|
}
|
9
10
|
toggleHeight() {
|
10
11
|
this.open
|
@@ -26,7 +27,7 @@ export class CpslOverlay {
|
|
26
27
|
}
|
27
28
|
}
|
28
29
|
render() {
|
29
|
-
return (h(Host, { key: '
|
30
|
+
return (h(Host, { key: '7e2c644351871bd6d49b477302635ee51b57848b', style: Boolean(this.zIndexOverride) ? { zIndex: `${this.zIndexOverride}` } : {} }, h("slot", { key: 'd21ebec32fbc75066a5fd3c4107ff48fd6a9ee91' })));
|
30
31
|
}
|
31
32
|
static get is() { return "cpsl-overlay"; }
|
32
33
|
static get encapsulation() { return "shadow"; }
|
@@ -42,24 +43,25 @@ export class CpslOverlay {
|
|
42
43
|
}
|
43
44
|
static get properties() {
|
44
45
|
return {
|
45
|
-
"
|
46
|
-
"type": "
|
46
|
+
"enterTransitionDuration": {
|
47
|
+
"type": "number",
|
47
48
|
"mutable": false,
|
48
49
|
"complexType": {
|
49
|
-
"original": "
|
50
|
-
"resolved": "
|
50
|
+
"original": "number",
|
51
|
+
"resolved": "number",
|
51
52
|
"references": {}
|
52
53
|
},
|
53
54
|
"required": false,
|
54
|
-
"optional":
|
55
|
+
"optional": true,
|
55
56
|
"docs": {
|
56
57
|
"tags": [],
|
57
|
-
"text": "
|
58
|
+
"text": "Duration in seconds of the fade out animation.\nDefault is .5."
|
58
59
|
},
|
59
|
-
"attribute": "
|
60
|
-
"reflect": false
|
60
|
+
"attribute": "enter-transition-duration",
|
61
|
+
"reflect": false,
|
62
|
+
"defaultValue": "0.5"
|
61
63
|
},
|
62
|
-
"
|
64
|
+
"exitTransitionDuration": {
|
63
65
|
"type": "number",
|
64
66
|
"mutable": false,
|
65
67
|
"complexType": {
|
@@ -73,11 +75,28 @@ export class CpslOverlay {
|
|
73
75
|
"tags": [],
|
74
76
|
"text": "Duration in seconds of the fade out animation.\nDefault is .5."
|
75
77
|
},
|
76
|
-
"attribute": "
|
78
|
+
"attribute": "exit-transition-duration",
|
77
79
|
"reflect": false,
|
78
80
|
"defaultValue": "0.5"
|
79
81
|
},
|
80
|
-
"
|
82
|
+
"open": {
|
83
|
+
"type": "boolean",
|
84
|
+
"mutable": false,
|
85
|
+
"complexType": {
|
86
|
+
"original": "boolean",
|
87
|
+
"resolved": "boolean",
|
88
|
+
"references": {}
|
89
|
+
},
|
90
|
+
"required": false,
|
91
|
+
"optional": false,
|
92
|
+
"docs": {
|
93
|
+
"tags": [],
|
94
|
+
"text": "Whether or not to show the overlay."
|
95
|
+
},
|
96
|
+
"attribute": "open",
|
97
|
+
"reflect": false
|
98
|
+
},
|
99
|
+
"zIndexOverride": {
|
81
100
|
"type": "number",
|
82
101
|
"mutable": false,
|
83
102
|
"complexType": {
|
@@ -89,11 +108,10 @@ export class CpslOverlay {
|
|
89
108
|
"optional": true,
|
90
109
|
"docs": {
|
91
110
|
"tags": [],
|
92
|
-
"text": "
|
111
|
+
"text": "Override z-index."
|
93
112
|
},
|
94
|
-
"attribute": "
|
95
|
-
"reflect": false
|
96
|
-
"defaultValue": "0.5"
|
113
|
+
"attribute": "z-index-override",
|
114
|
+
"reflect": false
|
97
115
|
}
|
98
116
|
};
|
99
117
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpsl-overlay.js","sourceRoot":"","sources":["../../../../src/components/cpsl-overlay/cpsl-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,IAAI,MAAM,MAAM,CAAC;AAOxB,MAAM,OAAO,WAAW
|
1
|
+
{"version":3,"file":"cpsl-overlay.js","sourceRoot":"","sources":["../../../../src/components/cpsl-overlay/cpsl-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,IAAI,MA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ACH,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE;YACnF,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Element, Watch } from '@stencil/core';\nimport gsap from 'gsap';\n\n@Component({\n tag: 'cpsl-overlay',\n styleUrl: 'cpsl-overlay.scss',\n shadow: true,\n})\nexport class CpslOverlay {\n @Element() el!: HTMLCpslOverlayElement;\n\n /**\n * Duration in seconds of the fade out animation.\n * Default is .5.\n */\n @Prop() enterTransitionDuration?: number = 0.5;\n\n /**\n * Duration in seconds of the fade out animation.\n * Default is .5.\n */\n @Prop() exitTransitionDuration?: number = 0.5;\n\n /**\n * Whether or not to show the overlay.\n */\n @Prop() open: boolean;\n\n /**\n * Override z-index.\n */\n @Prop() zIndexOverride?: number;\n\n @Watch('open')\n toggleHeight() {\n this.open\n ? gsap.timeline({ defaults: { duration: this.enterTransitionDuration } }).to(this.el, { display: 'block', opacity: 1 })\n : gsap.timeline({ defaults: { duration: this.exitTransitionDuration } }).to(this.el, { display: 'none', opacity: 0 });\n\n if (this.open) {\n document.documentElement.style.overflow = 'hidden';\n } else {\n // Setting a timeout here to prevent modal from shifting when the scroll bar appears\n setTimeout(() => {\n document.documentElement.style.overflow = 'auto';\n }, this.exitTransitionDuration * 1000);\n }\n }\n\n componentDidLoad() {\n if (this.open) {\n gsap.timeline({ defaults: { duration: this.enterTransitionDuration } }).to(this.el, { display: 'block', opacity: 1 });\n document.documentElement.style.overflow = 'hidden';\n }\n }\n\n render() {\n return (\n <Host style={Boolean(this.zIndexOverride) ? { zIndex: `${this.zIndexOverride}` } : {}}>\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
/**
|
2
|
+
* Convert a font size to a dynamic font size.
|
3
|
+
* Fonts that participate in Dynamic Type should use
|
4
|
+
* dynamic font sizes.
|
5
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
6
|
+
* @param unit (optional) - The unit to convert to. Use this if you want to
|
7
|
+
* convert to a unit other than $baselineUnit.
|
8
|
+
*/
|
9
|
+
/**
|
10
|
+
* Convert a font size to a dynamic font size but impose
|
11
|
+
* a maximum font size.
|
12
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
13
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
14
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
15
|
+
* convert to a unit other than $baselineUnit.
|
16
|
+
*/
|
17
|
+
/**
|
18
|
+
* Convert a font size to a dynamic font size but impose
|
19
|
+
* a minimum font size.
|
20
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
21
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
22
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
23
|
+
* convert to a unit other than $baselineUnit.
|
24
|
+
*/
|
25
|
+
/**
|
26
|
+
* Convert a font size to a dynamic font size but impose
|
27
|
+
* maximum and minimum font sizes.
|
28
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
29
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
30
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
31
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
32
|
+
* convert to a unit other than $baselineUnit.
|
33
|
+
*/
|
34
|
+
/**
|
35
|
+
* A heuristic that applies CSS to tablet
|
36
|
+
* viewports.
|
37
|
+
*
|
38
|
+
* Usage:
|
39
|
+
* @include tablet-viewport() {
|
40
|
+
* :host {
|
41
|
+
* background-color: green;
|
42
|
+
* }
|
43
|
+
* }
|
44
|
+
*/
|
45
|
+
/**
|
46
|
+
* A heuristic that applies CSS to mobile
|
47
|
+
* viewports (i.e. phones, not tablets).
|
48
|
+
*
|
49
|
+
* Usage:
|
50
|
+
* @include mobile-viewport() {
|
51
|
+
* :host {
|
52
|
+
* background-color: blue;
|
53
|
+
* }
|
54
|
+
* }
|
55
|
+
*/
|
56
|
+
:host {
|
57
|
+
display: block;
|
58
|
+
}
|
59
|
+
|
60
|
+
.icon {
|
61
|
+
--height: 20px;
|
62
|
+
--width: 20px;
|
63
|
+
}
|
64
|
+
|
65
|
+
.start-icon {
|
66
|
+
transform: rotate(180deg);
|
67
|
+
}
|
@@ -0,0 +1,174 @@
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
2
|
+
export class CpslPagination {
|
3
|
+
constructor() {
|
4
|
+
this.handlePrevClick = () => {
|
5
|
+
if (this.currentPage > 0) {
|
6
|
+
this.currentPage--;
|
7
|
+
}
|
8
|
+
};
|
9
|
+
this.handleNextClick = () => {
|
10
|
+
if (this.currentPage < this.totalPages - 1) {
|
11
|
+
this.currentPage++;
|
12
|
+
}
|
13
|
+
};
|
14
|
+
this.handlePageClick = (value) => () => {
|
15
|
+
if (value >= 0 && value <= this.totalPages - 1) {
|
16
|
+
this.currentPage = value;
|
17
|
+
}
|
18
|
+
};
|
19
|
+
this.currentPage = 0;
|
20
|
+
this.initialPage = undefined;
|
21
|
+
this.totalPages = undefined;
|
22
|
+
this.visiblePages = 5;
|
23
|
+
}
|
24
|
+
watchChange() {
|
25
|
+
this.cpslPaginationChanged.emit(this.currentPage);
|
26
|
+
}
|
27
|
+
componentWillLoad() {
|
28
|
+
var _a;
|
29
|
+
this.currentPage = (_a = this.initialPage) !== null && _a !== void 0 ? _a : 0;
|
30
|
+
if (this.visiblePages < 5) {
|
31
|
+
this.visiblePages = 5;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
render() {
|
35
|
+
const filteredPages = this.totalPages <= this.visiblePages ? [...Array(this.totalPages).keys()] : [];
|
36
|
+
if (this.totalPages > this.visiblePages) {
|
37
|
+
filteredPages.push(0);
|
38
|
+
const isFirstSelected = this.currentPage === 0;
|
39
|
+
const isLastSelected = this.currentPage === this.totalPages - 1;
|
40
|
+
const isFirstOrLastSelected = isFirstSelected || isLastSelected;
|
41
|
+
let remainingVisible = this.visiblePages - (isFirstOrLastSelected ? 2 : 3);
|
42
|
+
const halfRemaining = Math.round(remainingVisible / 2);
|
43
|
+
const numberBefore = Math.max(this.currentPage - 1, 0);
|
44
|
+
const numberAfter = Math.max(this.totalPages - 2 - this.currentPage, 0);
|
45
|
+
let beforeHalf = halfRemaining;
|
46
|
+
let afterHalf = remainingVisible - halfRemaining;
|
47
|
+
if (numberBefore >= beforeHalf) {
|
48
|
+
if (numberAfter < afterHalf) {
|
49
|
+
beforeHalf += afterHalf - numberAfter;
|
50
|
+
afterHalf = numberAfter;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
else {
|
54
|
+
afterHalf += beforeHalf - numberBefore;
|
55
|
+
beforeHalf = numberBefore;
|
56
|
+
}
|
57
|
+
while (beforeHalf > 0) {
|
58
|
+
filteredPages.push(this.currentPage - beforeHalf);
|
59
|
+
beforeHalf--;
|
60
|
+
}
|
61
|
+
if (!isFirstSelected) {
|
62
|
+
filteredPages.push(this.currentPage);
|
63
|
+
}
|
64
|
+
const pagesAfter = [];
|
65
|
+
while (afterHalf > 0) {
|
66
|
+
pagesAfter.push(this.currentPage + afterHalf);
|
67
|
+
afterHalf--;
|
68
|
+
}
|
69
|
+
filteredPages.push(...pagesAfter.reverse());
|
70
|
+
if (!isLastSelected) {
|
71
|
+
filteredPages.push(this.totalPages - 1);
|
72
|
+
}
|
73
|
+
}
|
74
|
+
return (h(Host, { key: 'ac3681eabdc35a5c620713a722619b7e5f52e2e3' }, h("cpsl-button-group", { key: '05f7fcfb5ca4edf4de561357ec16fe2fd5bdf9d8', selectedId: `${this.currentPage}` }, h("cpsl-button", { key: '613f70869b90aad3c5973b7c55270e3088335ff9', onClick: this.handlePrevClick }, h("cpsl-icon", { key: '458e036ab72bd2a8fc57bb8bcc0be614ad07aa72', class: { 'icon': true, 'start-icon': true }, icon: "arrowNarrow" })), filteredPages.map(page => (h("cpsl-button", { key: page, variant: "secondary", fullWidth: true, id: `${page}`, onClick: this.handlePageClick(page) }, h("cpsl-text", { variant: "bodyS" }, page + 1)))), h("cpsl-button", { key: '2dc257023f6d4270a79bf88399e3b27ad538b928', onClick: this.handleNextClick }, h("cpsl-icon", { key: '716ad78992c6e56c3855d8dc544fc19fefa01804', class: "icon", icon: "arrowNarrow" })))));
|
75
|
+
}
|
76
|
+
static get is() { return "cpsl-pagination"; }
|
77
|
+
static get encapsulation() { return "shadow"; }
|
78
|
+
static get originalStyleUrls() {
|
79
|
+
return {
|
80
|
+
"$": ["cpsl-pagination.scss"]
|
81
|
+
};
|
82
|
+
}
|
83
|
+
static get styleUrls() {
|
84
|
+
return {
|
85
|
+
"$": ["cpsl-pagination.css"]
|
86
|
+
};
|
87
|
+
}
|
88
|
+
static get properties() {
|
89
|
+
return {
|
90
|
+
"initialPage": {
|
91
|
+
"type": "number",
|
92
|
+
"mutable": false,
|
93
|
+
"complexType": {
|
94
|
+
"original": "number",
|
95
|
+
"resolved": "number",
|
96
|
+
"references": {}
|
97
|
+
},
|
98
|
+
"required": false,
|
99
|
+
"optional": true,
|
100
|
+
"docs": {
|
101
|
+
"tags": [],
|
102
|
+
"text": "The initial page to select.\nDefault is 0."
|
103
|
+
},
|
104
|
+
"attribute": "initial-page",
|
105
|
+
"reflect": false
|
106
|
+
},
|
107
|
+
"totalPages": {
|
108
|
+
"type": "number",
|
109
|
+
"mutable": false,
|
110
|
+
"complexType": {
|
111
|
+
"original": "number",
|
112
|
+
"resolved": "number",
|
113
|
+
"references": {}
|
114
|
+
},
|
115
|
+
"required": false,
|
116
|
+
"optional": false,
|
117
|
+
"docs": {
|
118
|
+
"tags": [],
|
119
|
+
"text": "The total number of pages."
|
120
|
+
},
|
121
|
+
"attribute": "total-pages",
|
122
|
+
"reflect": false
|
123
|
+
},
|
124
|
+
"visiblePages": {
|
125
|
+
"type": "number",
|
126
|
+
"mutable": true,
|
127
|
+
"complexType": {
|
128
|
+
"original": "number",
|
129
|
+
"resolved": "number",
|
130
|
+
"references": {}
|
131
|
+
},
|
132
|
+
"required": false,
|
133
|
+
"optional": true,
|
134
|
+
"docs": {
|
135
|
+
"tags": [],
|
136
|
+
"text": "The number of pages visible to select.\nDefault is 5.\nMin is 5."
|
137
|
+
},
|
138
|
+
"attribute": "visible-pages",
|
139
|
+
"reflect": false,
|
140
|
+
"defaultValue": "5"
|
141
|
+
}
|
142
|
+
};
|
143
|
+
}
|
144
|
+
static get states() {
|
145
|
+
return {
|
146
|
+
"currentPage": {}
|
147
|
+
};
|
148
|
+
}
|
149
|
+
static get events() {
|
150
|
+
return [{
|
151
|
+
"method": "cpslPaginationChanged",
|
152
|
+
"name": "cpslPaginationChanged",
|
153
|
+
"bubbles": true,
|
154
|
+
"cancelable": true,
|
155
|
+
"composed": true,
|
156
|
+
"docs": {
|
157
|
+
"tags": [],
|
158
|
+
"text": "Emitted when exit animation finishes."
|
159
|
+
},
|
160
|
+
"complexType": {
|
161
|
+
"original": "number",
|
162
|
+
"resolved": "number",
|
163
|
+
"references": {}
|
164
|
+
}
|
165
|
+
}];
|
166
|
+
}
|
167
|
+
static get watchers() {
|
168
|
+
return [{
|
169
|
+
"propName": "currentPage",
|
170
|
+
"methodName": "watchChange"
|
171
|
+
}];
|
172
|
+
}
|
173
|
+
}
|
174
|
+
//# sourceMappingURL=cpsl-pagination.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cpsl-pagination.js","sourceRoot":"","sources":["../../../../src/components/cpsl-pagination/cpsl-pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, State, Event, h, EventEmitter, Watch } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-pagination',\n styleUrl: 'cpsl-pagination.scss',\n shadow: true,\n})\nexport class CpslPagination {\n @State() currentPage = 0;\n\n /**\n * The initial page to select.\n * Default is 0.\n */\n @Prop() initialPage?: number;\n\n /**\n * The total number of pages.\n */\n @Prop() totalPages: number;\n\n /**\n * The number of pages visible to select.\n * Default is 5.\n * Min is 5.\n */\n\n // eslint-disable-next-line @stencil-community/strict-mutable\n @Prop({ mutable: true }) visiblePages?: number = 5;\n\n /**\n * Emitted when exit animation finishes.\n */\n @Event() cpslPaginationChanged!: EventEmitter<number>;\n\n @Watch('currentPage')\n watchChange() {\n this.cpslPaginationChanged.emit(this.currentPage);\n }\n\n componentWillLoad() {\n this.currentPage = this.initialPage ?? 0;\n if (this.visiblePages < 5) {\n this.visiblePages = 5;\n }\n }\n\n private handlePrevClick = () => {\n if (this.currentPage > 0) {\n this.currentPage--;\n }\n };\n\n private handleNextClick = () => {\n if (this.currentPage < this.totalPages - 1) {\n this.currentPage++;\n }\n };\n\n private handlePageClick = (value: number) => () => {\n if (value >= 0 && value <= this.totalPages - 1) {\n this.currentPage = value;\n }\n };\n\n render() {\n const filteredPages: number[] = this.totalPages <= this.visiblePages ? [...Array(this.totalPages).keys()] : [];\n\n if (this.totalPages > this.visiblePages) {\n filteredPages.push(0);\n\n const isFirstSelected = this.currentPage === 0;\n const isLastSelected = this.currentPage === this.totalPages - 1;\n const isFirstOrLastSelected = isFirstSelected || isLastSelected;\n\n let remainingVisible = this.visiblePages - (isFirstOrLastSelected ? 2 : 3);\n const halfRemaining = Math.round(remainingVisible / 2);\n const numberBefore = Math.max(this.currentPage - 1, 0);\n const numberAfter = Math.max(this.totalPages - 2 - this.currentPage, 0);\n let beforeHalf = halfRemaining;\n let afterHalf = remainingVisible - halfRemaining;\n\n if (numberBefore >= beforeHalf) {\n if (numberAfter < afterHalf) {\n beforeHalf += afterHalf - numberAfter;\n afterHalf = numberAfter;\n }\n } else {\n afterHalf += beforeHalf - numberBefore;\n beforeHalf = numberBefore;\n }\n\n while (beforeHalf > 0) {\n filteredPages.push(this.currentPage - beforeHalf);\n beforeHalf--;\n }\n\n if (!isFirstSelected) {\n filteredPages.push(this.currentPage);\n }\n\n const pagesAfter: number[] = [];\n while (afterHalf > 0) {\n pagesAfter.push(this.currentPage + afterHalf);\n afterHalf--;\n }\n\n filteredPages.push(...pagesAfter.reverse());\n\n if (!isLastSelected) {\n filteredPages.push(this.totalPages - 1);\n }\n }\n\n return (\n <Host>\n <cpsl-button-group selectedId={`${this.currentPage}`}>\n <cpsl-button onClick={this.handlePrevClick}>\n <cpsl-icon class={{ 'icon': true, 'start-icon': true }} icon=\"arrowNarrow\" />\n </cpsl-button>\n {filteredPages.map(page => (\n <cpsl-button key={page} variant=\"secondary\" fullWidth id={`${page}`} onClick={this.handlePageClick(page)}>\n <cpsl-text variant=\"bodyS\">{page + 1}</cpsl-text>\n </cpsl-button>\n ))}\n <cpsl-button onClick={this.handleNextClick}>\n <cpsl-icon class=\"icon\" icon=\"arrowNarrow\" />\n </cpsl-button>\n </cpsl-button-group>\n </Host>\n );\n }\n}\n"]}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
+
function fulfilled(value) { try {
|
5
|
+
step(generator.next(value));
|
6
|
+
}
|
7
|
+
catch (e) {
|
8
|
+
reject(e);
|
9
|
+
} }
|
10
|
+
function rejected(value) { try {
|
11
|
+
step(generator["throw"](value));
|
12
|
+
}
|
13
|
+
catch (e) {
|
14
|
+
reject(e);
|
15
|
+
} }
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
18
|
+
});
|
19
|
+
};
|
20
|
+
import { newE2EPage } from "@stencil/core/testing";
|
21
|
+
describe('cpsl-pagination', () => {
|
22
|
+
it('renders', () => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
const page = yield newE2EPage();
|
24
|
+
yield page.setContent('<cpsl-pagination></cpsl-pagination>');
|
25
|
+
const element = yield page.find('cpsl-pagination');
|
26
|
+
expect(element).toHaveClass('hydrated');
|
27
|
+
}));
|
28
|
+
});
|
29
|
+
//# sourceMappingURL=cpsl-pagination.e2e.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cpsl-pagination.e2e.js","sourceRoot":"","sources":["../../../../../src/components/cpsl-pagination/test/cpsl-pagination.e2e.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,SAAS,EAAE,GAAS,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,qCAAqC,CAAC,CAAC;QAE7D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACnD,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('cpsl-pagination', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cpsl-pagination></cpsl-pagination>');\n\n const element = await page.find('cpsl-pagination');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
+
function fulfilled(value) { try {
|
5
|
+
step(generator.next(value));
|
6
|
+
}
|
7
|
+
catch (e) {
|
8
|
+
reject(e);
|
9
|
+
} }
|
10
|
+
function rejected(value) { try {
|
11
|
+
step(generator["throw"](value));
|
12
|
+
}
|
13
|
+
catch (e) {
|
14
|
+
reject(e);
|
15
|
+
} }
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
18
|
+
});
|
19
|
+
};
|
20
|
+
import { newSpecPage } from "@stencil/core/testing";
|
21
|
+
import { CpslPagination } from "../cpsl-pagination";
|
22
|
+
describe('cpsl-pagination', () => {
|
23
|
+
it('renders', () => __awaiter(void 0, void 0, void 0, function* () {
|
24
|
+
const page = yield newSpecPage({
|
25
|
+
components: [CpslPagination],
|
26
|
+
html: `<cpsl-pagination></cpsl-pagination>`,
|
27
|
+
});
|
28
|
+
expect(page.root).toEqualHtml(`
|
29
|
+
<cpsl-pagination>
|
30
|
+
<mock:shadow-root>
|
31
|
+
<slot></slot>
|
32
|
+
</mock:shadow-root>
|
33
|
+
</cpsl-pagination>
|
34
|
+
`);
|
35
|
+
}));
|
36
|
+
});
|
37
|
+
//# sourceMappingURL=cpsl-pagination.spec.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cpsl-pagination.spec.js","sourceRoot":"","sources":["../../../../../src/components/cpsl-pagination/test/cpsl-pagination.spec.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,SAAS,EAAE,GAAS,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,cAAc,CAAC;YAC5B,IAAI,EAAE,qCAAqC;SAC5C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;KAM7B,CAAC,CAAC;IACL,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CpslPagination } from '../cpsl-pagination';\n\ndescribe('cpsl-pagination', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CpslPagination],\n html: `<cpsl-pagination></cpsl-pagination>`,\n });\n expect(page.root).toEqualHtml(`\n <cpsl-pagination>\n <mock:shadow-root>\n <slot></slot>\n </mock:shadow-root>\n </cpsl-pagination>\n `);\n });\n});\n"]}
|
@@ -4,7 +4,7 @@ export class CpslPill {
|
|
4
4
|
this.text = undefined;
|
5
5
|
}
|
6
6
|
render() {
|
7
|
-
return (h(Host, { key: '
|
7
|
+
return (h(Host, { key: 'cfb75db6154db11d15a26f253686793fd21beccc' }, h("div", { key: '00381588b8d9e34201b439a7fd4233069a62f2f5', class: "pill-container" }, h("span", { key: '4fa5134cc5f873373ca8a2102d4a88ef6455ff7d' }, this.text))));
|
8
8
|
}
|
9
9
|
static get is() { return "cpsl-pill"; }
|
10
10
|
static get encapsulation() { return "shadow"; }
|
@@ -32,7 +32,7 @@ export class CpslQrCode {
|
|
32
32
|
qrCode.append(container);
|
33
33
|
}
|
34
34
|
render() {
|
35
|
-
return (h(Host, { key: '
|
35
|
+
return (h(Host, { key: '249236c83c51fa7b3bf66c74a3e122f945288313' }, h("div", { key: 'cd899dac84d029d89648572584ffddae0c98ab37', id: "qr-container", class: "qr-container" })));
|
36
36
|
}
|
37
37
|
static get is() { return "cpsl-qr-code"; }
|
38
38
|
static get encapsulation() { return "shadow"; }
|
@@ -0,0 +1,97 @@
|
|
1
|
+
/**
|
2
|
+
* Convert a font size to a dynamic font size.
|
3
|
+
* Fonts that participate in Dynamic Type should use
|
4
|
+
* dynamic font sizes.
|
5
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
6
|
+
* @param unit (optional) - The unit to convert to. Use this if you want to
|
7
|
+
* convert to a unit other than $baselineUnit.
|
8
|
+
*/
|
9
|
+
/**
|
10
|
+
* Convert a font size to a dynamic font size but impose
|
11
|
+
* a maximum font size.
|
12
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
13
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
14
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
15
|
+
* convert to a unit other than $baselineUnit.
|
16
|
+
*/
|
17
|
+
/**
|
18
|
+
* Convert a font size to a dynamic font size but impose
|
19
|
+
* a minimum font size.
|
20
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
21
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
22
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
23
|
+
* convert to a unit other than $baselineUnit.
|
24
|
+
*/
|
25
|
+
/**
|
26
|
+
* Convert a font size to a dynamic font size but impose
|
27
|
+
* maximum and minimum font sizes.
|
28
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
29
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
30
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
31
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
32
|
+
* convert to a unit other than $baselineUnit.
|
33
|
+
*/
|
34
|
+
/**
|
35
|
+
* A heuristic that applies CSS to tablet
|
36
|
+
* viewports.
|
37
|
+
*
|
38
|
+
* Usage:
|
39
|
+
* @include tablet-viewport() {
|
40
|
+
* :host {
|
41
|
+
* background-color: green;
|
42
|
+
* }
|
43
|
+
* }
|
44
|
+
*/
|
45
|
+
/**
|
46
|
+
* A heuristic that applies CSS to mobile
|
47
|
+
* viewports (i.e. phones, not tablets).
|
48
|
+
*
|
49
|
+
* Usage:
|
50
|
+
* @include mobile-viewport() {
|
51
|
+
* :host {
|
52
|
+
* background-color: blue;
|
53
|
+
* }
|
54
|
+
* }
|
55
|
+
*/
|
56
|
+
:host {
|
57
|
+
--container-height: 20px;
|
58
|
+
--container-width: 20px;
|
59
|
+
--container-border-radius: var(--cpsl-border-radius-radio);
|
60
|
+
--container-border-width-default: 2px;
|
61
|
+
--container-border-width-checked: 5px;
|
62
|
+
--container-background-color-default: var(--cpsl-color-radio-surface-default);
|
63
|
+
--container-border-color-default: var(--cpsl-color-radio-border-default);
|
64
|
+
--container-background-color-checked: var(--cpsl-color-radio-surface-checked);
|
65
|
+
--container-border-color-checked: var(--cpsl-color-radio-border-checked);
|
66
|
+
display: block;
|
67
|
+
position: relative;
|
68
|
+
height: var(--container-height);
|
69
|
+
width: var(--container-width);
|
70
|
+
cursor: pointer;
|
71
|
+
}
|
72
|
+
|
73
|
+
input {
|
74
|
+
position: absolute;
|
75
|
+
width: 100%;
|
76
|
+
height: 100%;
|
77
|
+
margin: 0px;
|
78
|
+
opacity: 0;
|
79
|
+
}
|
80
|
+
|
81
|
+
span.container {
|
82
|
+
display: inline-block;
|
83
|
+
position: relative;
|
84
|
+
box-sizing: border-box;
|
85
|
+
width: 100%;
|
86
|
+
height: 100%;
|
87
|
+
border-radius: var(--container-border-radius);
|
88
|
+
border: var(--container-border-width-default) solid;
|
89
|
+
background-color: var(--container-background-color-default);
|
90
|
+
border-color: var(--container-border-color-default);
|
91
|
+
transition: all 0.15s ease-in-out;
|
92
|
+
}
|
93
|
+
span.container.checked {
|
94
|
+
background-color: var(--container-background-color-checked);
|
95
|
+
border-color: var(--container-border-color-checked);
|
96
|
+
border-width: var(--container-border-width-checked);
|
97
|
+
}
|