@everymatrix/lottery-bullet 1.32.4 → 1.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-5dd252d5.js +1178 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/lottery-bullet.cjs.entry.js +73 -0
- package/dist/cjs/lottery-bullet.cjs.js +19 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/lottery-bullet/lottery-bullet.css +136 -0
- package/dist/collection/components/lottery-bullet/lottery-bullet.js +185 -0
- package/dist/collection/components/lottery-bullet/lottery-bullet.types.js +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/utils.js +0 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/components/lottery-bullet.d.ts +11 -0
- package/dist/components/lottery-bullet.js +94 -0
- package/dist/esm/index-fae2cc33.js +1152 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/lottery-bullet.entry.js +69 -0
- package/dist/esm/lottery-bullet.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/lottery-bullet/index.esm.js +0 -0
- package/dist/lottery-bullet/lottery-bullet.esm.js +1 -0
- package/dist/lottery-bullet/p-685e27bc.entry.js +1 -0
- package/dist/lottery-bullet/p-78954f38.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/lottery-bullet/.stencil/packages/lottery-bullet/stencil.config.d.ts +2 -0
- package/dist/types/components/lottery-bullet/lottery-bullet.d.ts +35 -0
- package/dist/types/components/lottery-bullet/lottery-bullet.types.d.ts +4 -0
- package/dist/types/components.d.ts +82 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/utils.d.ts +0 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +2 -3
- package/LICENSE +0 -21
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-5dd252d5.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
const patchEsm = () => {
|
|
11
|
+
return index.promiseResolve();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const defineCustomElements = (win, options) => {
|
|
15
|
+
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
|
+
return patchEsm().then(() => {
|
|
17
|
+
return index.bootstrapLazy([["lottery-bullet.cjs",[[1,"lottery-bullet",{"value":[513],"selectable":[516],"isSelected":[516,"is-selected"],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"limitStylingAppends":[32]}]]]], options);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-5dd252d5.js');
|
|
6
|
+
|
|
7
|
+
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:#000000;display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px #ffffff;background:radial-gradient(circle at top, white 0%, white 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, white 0%, #f1f1f1 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#D4D4D4;border:solid 2px #D4D4D4;cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #D4D4D4;cursor:default}";
|
|
8
|
+
|
|
9
|
+
const LotteryBullet = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.bulletEvent = index.createEvent(this, "lotteryBulletSelection", 7);
|
|
13
|
+
/**
|
|
14
|
+
* Value of the bullet
|
|
15
|
+
*/
|
|
16
|
+
this.value = '0';
|
|
17
|
+
/**
|
|
18
|
+
* Marks if the bullet should be selectable
|
|
19
|
+
*/
|
|
20
|
+
this.selectable = true;
|
|
21
|
+
/**
|
|
22
|
+
* Marks if the bullet should be selected
|
|
23
|
+
*/
|
|
24
|
+
this.isSelected = false;
|
|
25
|
+
/**
|
|
26
|
+
* Client custom styling via string
|
|
27
|
+
*/
|
|
28
|
+
this.clientStyling = '';
|
|
29
|
+
/**
|
|
30
|
+
* Client custom styling via url content
|
|
31
|
+
*/
|
|
32
|
+
this.clientStylingUrlContent = '';
|
|
33
|
+
this.limitStylingAppends = false;
|
|
34
|
+
this.select = () => {
|
|
35
|
+
if (this.selectable) {
|
|
36
|
+
this.isSelected = !this.isSelected;
|
|
37
|
+
this.bulletEvent.emit({
|
|
38
|
+
value: this.value,
|
|
39
|
+
selected: this.isSelected
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
this.setClientStyling = () => {
|
|
44
|
+
let sheet = document.createElement('style');
|
|
45
|
+
sheet.innerHTML = this.clientStyling;
|
|
46
|
+
this.stylingContainer.prepend(sheet);
|
|
47
|
+
};
|
|
48
|
+
this.setClientStylingURL = () => {
|
|
49
|
+
let cssFile = document.createElement('style');
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
52
|
+
this.stylingContainer.prepend(cssFile);
|
|
53
|
+
}, 1);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
componentDidRender() {
|
|
57
|
+
// start custom styling area
|
|
58
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
59
|
+
if (this.clientStyling)
|
|
60
|
+
this.setClientStyling();
|
|
61
|
+
if (this.clientStylingUrlContent)
|
|
62
|
+
this.setClientStylingURL();
|
|
63
|
+
this.limitStylingAppends = true;
|
|
64
|
+
}
|
|
65
|
+
// end custom styling area
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
return (index.h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
LotteryBullet.style = lotteryBulletCss;
|
|
72
|
+
|
|
73
|
+
exports.lottery_bullet = LotteryBullet;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-5dd252d5.js');
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
const patchBrowser = () => {
|
|
9
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('lottery-bullet.cjs.js', document.baseURI).href));
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== '') {
|
|
12
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return index.promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(options => {
|
|
18
|
+
return index.bootstrapLazy([["lottery-bullet.cjs",[[1,"lottery-bullet",{"value":[513],"selectable":[516],"isSelected":[516,"is-selected"],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"limitStylingAppends":[32]}]]]], options);
|
|
19
|
+
});
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
font-family: "Roboto", sans-serif;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/*** Animation - Show */
|
|
8
|
+
@-webkit-keyframes Circle {
|
|
9
|
+
0% {
|
|
10
|
+
-webkit-transform: scale(0.5);
|
|
11
|
+
transform: scale(0.5);
|
|
12
|
+
}
|
|
13
|
+
100% {
|
|
14
|
+
-webkit-transform: scale(1);
|
|
15
|
+
transform: scale(1);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
@keyframes Circle {
|
|
19
|
+
0% {
|
|
20
|
+
-webkit-transform: scale(0.5);
|
|
21
|
+
transform: scale(0.5);
|
|
22
|
+
}
|
|
23
|
+
100% {
|
|
24
|
+
-webkit-transform: scale(1);
|
|
25
|
+
transform: scale(1);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/*** Animation - Hover */
|
|
29
|
+
@-webkit-keyframes hover-rotate {
|
|
30
|
+
0% {
|
|
31
|
+
-webkit-transform: scale(1) rotateZ(0);
|
|
32
|
+
transform: scale(1) rotateZ(0);
|
|
33
|
+
}
|
|
34
|
+
50% {
|
|
35
|
+
-webkit-transform: scale(1.2) rotateZ(180deg);
|
|
36
|
+
transform: scale(1.22) rotateZ(180deg);
|
|
37
|
+
}
|
|
38
|
+
100% {
|
|
39
|
+
-webkit-transform: scale(1) rotateZ(360deg);
|
|
40
|
+
transform: scale(1) rotateZ(360deg);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
@keyframes hover-rotate {
|
|
44
|
+
0% {
|
|
45
|
+
-webkit-transform: scale(1) rotateZ(0);
|
|
46
|
+
transform: scale(1) rotateZ(0);
|
|
47
|
+
}
|
|
48
|
+
50% {
|
|
49
|
+
-webkit-transform: scale(1.2) rotateZ(180deg);
|
|
50
|
+
transform: scale(1.2) rotateZ(180deg);
|
|
51
|
+
}
|
|
52
|
+
100% {
|
|
53
|
+
-webkit-transform: scale(1) rotateZ(360deg);
|
|
54
|
+
transform: scale(1) rotateZ(360deg);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/*** Animation - Selected */
|
|
58
|
+
@-webkit-keyframes selected-scaleUp {
|
|
59
|
+
0% {
|
|
60
|
+
-webkit-transform: scale(0.5);
|
|
61
|
+
transform: scale(0.5);
|
|
62
|
+
}
|
|
63
|
+
100% {
|
|
64
|
+
-webkit-transform: scale(1.2);
|
|
65
|
+
transform: scale(1.2);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
@keyframes selected-scaleUp {
|
|
69
|
+
0% {
|
|
70
|
+
-webkit-transform: scale(0.5);
|
|
71
|
+
transform: scale(0.5);
|
|
72
|
+
}
|
|
73
|
+
100% {
|
|
74
|
+
-webkit-transform: scale(1);
|
|
75
|
+
transform: scale(1);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
.Circle {
|
|
79
|
+
-webkit-animation: Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;
|
|
80
|
+
animation: Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
color: #000000;
|
|
83
|
+
display: block;
|
|
84
|
+
height: 30px;
|
|
85
|
+
width: 30px;
|
|
86
|
+
margin: 0;
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
align-items: center;
|
|
92
|
+
border: solid 2px #ffffff;
|
|
93
|
+
background: radial-gradient(circle at top, white 0%, white 100%);
|
|
94
|
+
font-weight: bold;
|
|
95
|
+
border-radius: 50%;
|
|
96
|
+
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.5);
|
|
97
|
+
user-select: none;
|
|
98
|
+
font-size: 16px;
|
|
99
|
+
line-height: 16px;
|
|
100
|
+
font-weight: 600;
|
|
101
|
+
position: relative;
|
|
102
|
+
}
|
|
103
|
+
.Circle:hover {
|
|
104
|
+
-webkit-animation: hover-rotate 0.4s linear both;
|
|
105
|
+
animation: hover-rotate 0.4s linear both;
|
|
106
|
+
background: radial-gradient(circle at top, white 0%, #f1f1f1 100%);
|
|
107
|
+
}
|
|
108
|
+
.Circle.Selected {
|
|
109
|
+
-webkit-animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;
|
|
110
|
+
animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;
|
|
111
|
+
color: #ffffff;
|
|
112
|
+
background: #9EC258;
|
|
113
|
+
background: -webkit-radial-gradient(top, #00958f, #004D4A);
|
|
114
|
+
background: -moz-radial-gradient(top, #00958f, #004D4A);
|
|
115
|
+
background: radial-gradient(to bottom, #00958f, #004D4A);
|
|
116
|
+
border: solid 2px #00958f;
|
|
117
|
+
}
|
|
118
|
+
.Circle.Disabled {
|
|
119
|
+
-webkit-animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;
|
|
120
|
+
animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;
|
|
121
|
+
color: #f1f1f1;
|
|
122
|
+
background: #D4D4D4;
|
|
123
|
+
border: solid 2px #D4D4D4;
|
|
124
|
+
cursor: default;
|
|
125
|
+
}
|
|
126
|
+
.Circle.DisabledSelected {
|
|
127
|
+
-webkit-animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;
|
|
128
|
+
animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;
|
|
129
|
+
color: #f1f1f1;
|
|
130
|
+
background: #9EC258;
|
|
131
|
+
background: -webkit-radial-gradient(top, #00958f, #004D4A);
|
|
132
|
+
background: -moz-radial-gradient(top, #00958f, #004D4A);
|
|
133
|
+
background: radial-gradient(to bottom, #00958f, #004D4A);
|
|
134
|
+
border: solid 2px #D4D4D4;
|
|
135
|
+
cursor: default;
|
|
136
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { Component, h, Prop, Event, State } from '@stencil/core';
|
|
2
|
+
export class LotteryBullet {
|
|
3
|
+
constructor() {
|
|
4
|
+
/**
|
|
5
|
+
* Value of the bullet
|
|
6
|
+
*/
|
|
7
|
+
this.value = '0';
|
|
8
|
+
/**
|
|
9
|
+
* Marks if the bullet should be selectable
|
|
10
|
+
*/
|
|
11
|
+
this.selectable = true;
|
|
12
|
+
/**
|
|
13
|
+
* Marks if the bullet should be selected
|
|
14
|
+
*/
|
|
15
|
+
this.isSelected = false;
|
|
16
|
+
/**
|
|
17
|
+
* Client custom styling via string
|
|
18
|
+
*/
|
|
19
|
+
this.clientStyling = '';
|
|
20
|
+
/**
|
|
21
|
+
* Client custom styling via url content
|
|
22
|
+
*/
|
|
23
|
+
this.clientStylingUrlContent = '';
|
|
24
|
+
this.limitStylingAppends = false;
|
|
25
|
+
this.select = () => {
|
|
26
|
+
if (this.selectable) {
|
|
27
|
+
this.isSelected = !this.isSelected;
|
|
28
|
+
this.bulletEvent.emit({
|
|
29
|
+
value: this.value,
|
|
30
|
+
selected: this.isSelected
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
this.setClientStyling = () => {
|
|
35
|
+
let sheet = document.createElement('style');
|
|
36
|
+
sheet.innerHTML = this.clientStyling;
|
|
37
|
+
this.stylingContainer.prepend(sheet);
|
|
38
|
+
};
|
|
39
|
+
this.setClientStylingURL = () => {
|
|
40
|
+
let cssFile = document.createElement('style');
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
43
|
+
this.stylingContainer.prepend(cssFile);
|
|
44
|
+
}, 1);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
componentDidRender() {
|
|
48
|
+
// start custom styling area
|
|
49
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
50
|
+
if (this.clientStyling)
|
|
51
|
+
this.setClientStyling();
|
|
52
|
+
if (this.clientStylingUrlContent)
|
|
53
|
+
this.setClientStylingURL();
|
|
54
|
+
this.limitStylingAppends = true;
|
|
55
|
+
}
|
|
56
|
+
// end custom styling area
|
|
57
|
+
}
|
|
58
|
+
render() {
|
|
59
|
+
return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
|
|
60
|
+
}
|
|
61
|
+
static get is() { return "lottery-bullet"; }
|
|
62
|
+
static get encapsulation() { return "shadow"; }
|
|
63
|
+
static get originalStyleUrls() { return {
|
|
64
|
+
"$": ["lottery-bullet.scss"]
|
|
65
|
+
}; }
|
|
66
|
+
static get styleUrls() { return {
|
|
67
|
+
"$": ["lottery-bullet.css"]
|
|
68
|
+
}; }
|
|
69
|
+
static get properties() { return {
|
|
70
|
+
"value": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"mutable": false,
|
|
73
|
+
"complexType": {
|
|
74
|
+
"original": "string",
|
|
75
|
+
"resolved": "string",
|
|
76
|
+
"references": {}
|
|
77
|
+
},
|
|
78
|
+
"required": false,
|
|
79
|
+
"optional": false,
|
|
80
|
+
"docs": {
|
|
81
|
+
"tags": [],
|
|
82
|
+
"text": "Value of the bullet"
|
|
83
|
+
},
|
|
84
|
+
"attribute": "value",
|
|
85
|
+
"reflect": true,
|
|
86
|
+
"defaultValue": "'0'"
|
|
87
|
+
},
|
|
88
|
+
"selectable": {
|
|
89
|
+
"type": "boolean",
|
|
90
|
+
"mutable": false,
|
|
91
|
+
"complexType": {
|
|
92
|
+
"original": "boolean",
|
|
93
|
+
"resolved": "boolean",
|
|
94
|
+
"references": {}
|
|
95
|
+
},
|
|
96
|
+
"required": false,
|
|
97
|
+
"optional": false,
|
|
98
|
+
"docs": {
|
|
99
|
+
"tags": [],
|
|
100
|
+
"text": "Marks if the bullet should be selectable"
|
|
101
|
+
},
|
|
102
|
+
"attribute": "selectable",
|
|
103
|
+
"reflect": true,
|
|
104
|
+
"defaultValue": "true"
|
|
105
|
+
},
|
|
106
|
+
"isSelected": {
|
|
107
|
+
"type": "boolean",
|
|
108
|
+
"mutable": false,
|
|
109
|
+
"complexType": {
|
|
110
|
+
"original": "boolean",
|
|
111
|
+
"resolved": "boolean",
|
|
112
|
+
"references": {}
|
|
113
|
+
},
|
|
114
|
+
"required": false,
|
|
115
|
+
"optional": false,
|
|
116
|
+
"docs": {
|
|
117
|
+
"tags": [],
|
|
118
|
+
"text": "Marks if the bullet should be selected"
|
|
119
|
+
},
|
|
120
|
+
"attribute": "is-selected",
|
|
121
|
+
"reflect": true,
|
|
122
|
+
"defaultValue": "false"
|
|
123
|
+
},
|
|
124
|
+
"clientStyling": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"mutable": false,
|
|
127
|
+
"complexType": {
|
|
128
|
+
"original": "string",
|
|
129
|
+
"resolved": "string",
|
|
130
|
+
"references": {}
|
|
131
|
+
},
|
|
132
|
+
"required": false,
|
|
133
|
+
"optional": false,
|
|
134
|
+
"docs": {
|
|
135
|
+
"tags": [],
|
|
136
|
+
"text": "Client custom styling via string"
|
|
137
|
+
},
|
|
138
|
+
"attribute": "client-styling",
|
|
139
|
+
"reflect": true,
|
|
140
|
+
"defaultValue": "''"
|
|
141
|
+
},
|
|
142
|
+
"clientStylingUrlContent": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"mutable": false,
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "string",
|
|
147
|
+
"resolved": "string",
|
|
148
|
+
"references": {}
|
|
149
|
+
},
|
|
150
|
+
"required": false,
|
|
151
|
+
"optional": false,
|
|
152
|
+
"docs": {
|
|
153
|
+
"tags": [],
|
|
154
|
+
"text": "Client custom styling via url content"
|
|
155
|
+
},
|
|
156
|
+
"attribute": "client-styling-url-content",
|
|
157
|
+
"reflect": true,
|
|
158
|
+
"defaultValue": "''"
|
|
159
|
+
}
|
|
160
|
+
}; }
|
|
161
|
+
static get states() { return {
|
|
162
|
+
"limitStylingAppends": {}
|
|
163
|
+
}; }
|
|
164
|
+
static get events() { return [{
|
|
165
|
+
"method": "bulletEvent",
|
|
166
|
+
"name": "lotteryBulletSelection",
|
|
167
|
+
"bubbles": true,
|
|
168
|
+
"cancelable": true,
|
|
169
|
+
"composed": true,
|
|
170
|
+
"docs": {
|
|
171
|
+
"tags": [],
|
|
172
|
+
"text": "When a bullet is selected/deselected this event is emmited"
|
|
173
|
+
},
|
|
174
|
+
"complexType": {
|
|
175
|
+
"original": "BulletEvent",
|
|
176
|
+
"resolved": "BulletEvent",
|
|
177
|
+
"references": {
|
|
178
|
+
"BulletEvent": {
|
|
179
|
+
"location": "import",
|
|
180
|
+
"path": "./lottery-bullet.types"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}]; }
|
|
185
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* LotteryBullet custom elements */
|
|
2
|
+
|
|
3
|
+
import type { Components, JSX } from "../types/components";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Used to manually set the base path where assets can be found.
|
|
7
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
8
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
9
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
10
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
11
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
12
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
13
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
14
|
+
*/
|
|
15
|
+
export declare const setAssetPath: (path: string) => void;
|
|
16
|
+
|
|
17
|
+
export interface SetPlatformOptions {
|
|
18
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
19
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
+
|
|
24
|
+
export type { Components, JSX };
|
|
25
|
+
|
|
26
|
+
export * from '../types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface LotteryBullet extends Components.LotteryBullet, HTMLElement {}
|
|
4
|
+
export const LotteryBullet: {
|
|
5
|
+
prototype: LotteryBullet;
|
|
6
|
+
new (): LotteryBullet;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:#000000;display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px #ffffff;background:radial-gradient(circle at top, white 0%, white 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, white 0%, #f1f1f1 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#D4D4D4;border:solid 2px #D4D4D4;cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #D4D4D4;cursor:default}";
|
|
4
|
+
|
|
5
|
+
const LotteryBullet$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
this.bulletEvent = createEvent(this, "lotteryBulletSelection", 7);
|
|
11
|
+
/**
|
|
12
|
+
* Value of the bullet
|
|
13
|
+
*/
|
|
14
|
+
this.value = '0';
|
|
15
|
+
/**
|
|
16
|
+
* Marks if the bullet should be selectable
|
|
17
|
+
*/
|
|
18
|
+
this.selectable = true;
|
|
19
|
+
/**
|
|
20
|
+
* Marks if the bullet should be selected
|
|
21
|
+
*/
|
|
22
|
+
this.isSelected = false;
|
|
23
|
+
/**
|
|
24
|
+
* Client custom styling via string
|
|
25
|
+
*/
|
|
26
|
+
this.clientStyling = '';
|
|
27
|
+
/**
|
|
28
|
+
* Client custom styling via url content
|
|
29
|
+
*/
|
|
30
|
+
this.clientStylingUrlContent = '';
|
|
31
|
+
this.limitStylingAppends = false;
|
|
32
|
+
this.select = () => {
|
|
33
|
+
if (this.selectable) {
|
|
34
|
+
this.isSelected = !this.isSelected;
|
|
35
|
+
this.bulletEvent.emit({
|
|
36
|
+
value: this.value,
|
|
37
|
+
selected: this.isSelected
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
this.setClientStyling = () => {
|
|
42
|
+
let sheet = document.createElement('style');
|
|
43
|
+
sheet.innerHTML = this.clientStyling;
|
|
44
|
+
this.stylingContainer.prepend(sheet);
|
|
45
|
+
};
|
|
46
|
+
this.setClientStylingURL = () => {
|
|
47
|
+
let cssFile = document.createElement('style');
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
50
|
+
this.stylingContainer.prepend(cssFile);
|
|
51
|
+
}, 1);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
componentDidRender() {
|
|
55
|
+
// start custom styling area
|
|
56
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
57
|
+
if (this.clientStyling)
|
|
58
|
+
this.setClientStyling();
|
|
59
|
+
if (this.clientStylingUrlContent)
|
|
60
|
+
this.setClientStylingURL();
|
|
61
|
+
this.limitStylingAppends = true;
|
|
62
|
+
}
|
|
63
|
+
// end custom styling area
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
|
|
67
|
+
}
|
|
68
|
+
static get style() { return lotteryBulletCss; }
|
|
69
|
+
}, [1, "lottery-bullet", {
|
|
70
|
+
"value": [513],
|
|
71
|
+
"selectable": [516],
|
|
72
|
+
"isSelected": [516, "is-selected"],
|
|
73
|
+
"clientStyling": [513, "client-styling"],
|
|
74
|
+
"clientStylingUrlContent": [513, "client-styling-url-content"],
|
|
75
|
+
"limitStylingAppends": [32]
|
|
76
|
+
}]);
|
|
77
|
+
function defineCustomElement$1() {
|
|
78
|
+
if (typeof customElements === "undefined") {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const components = ["lottery-bullet"];
|
|
82
|
+
components.forEach(tagName => { switch (tagName) {
|
|
83
|
+
case "lottery-bullet":
|
|
84
|
+
if (!customElements.get(tagName)) {
|
|
85
|
+
customElements.define(tagName, LotteryBullet$1);
|
|
86
|
+
}
|
|
87
|
+
break;
|
|
88
|
+
} });
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const LotteryBullet = LotteryBullet$1;
|
|
92
|
+
const defineCustomElement = defineCustomElement$1;
|
|
93
|
+
|
|
94
|
+
export { LotteryBullet, defineCustomElement };
|