@everymatrix/lottery-selection 0.0.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/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-9b8fe4ee.js +1215 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/lottery-selection-3122c2e3.js +214 -0
- package/dist/cjs/lottery-selection.cjs.entry.js +10 -0
- package/dist/cjs/lottery-selection.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/lottery-selection/index.js +1 -0
- package/dist/collection/components/lottery-selection/lottery-selection.css +64 -0
- package/dist/collection/components/lottery-selection/lottery-selection.js +342 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/utils.js +11 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-ab825ca6.js +1188 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/lottery-selection-75fcc811.js +212 -0
- package/dist/esm/lottery-selection.entry.js +2 -0
- package/dist/esm/lottery-selection.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/lottery-selection/app-globals-0f993ce5.js +1 -0
- package/dist/lottery-selection/index-ab825ca6.js +2 -0
- package/dist/lottery-selection/index.esm.js +1 -0
- package/dist/lottery-selection/lottery-selection-75fcc811.js +1 -0
- package/dist/lottery-selection/lottery-selection.entry.js +1 -0
- package/dist/lottery-selection/lottery-selection.esm.js +1 -0
- package/dist/stencil.config.dev.js +19 -0
- package/dist/stencil.config.js +19 -0
- package/dist/storybook/main.js +43 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-selection/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-selection/.stencil/packages/stencil/lottery-selection/stencil.config.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-selection/.stencil/packages/stencil/lottery-selection/stencil.config.dev.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-selection/.stencil/packages/stencil/lottery-selection/storybook/main.d.ts +3 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-selection/.stencil/packages/stencil/lottery-selection/storybook/preview.d.ts +70 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-selection/.stencil/tools/plugins/index.d.ts +4 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-selection/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-selection/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-selection/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-selection/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
- package/dist/types/components/lottery-selection/index.d.ts +1 -0
- package/dist/types/components/lottery-selection/lottery-selection.d.ts +68 -0
- package/dist/types/components.d.ts +149 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +27 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { b as bootstrapLazy } from './index-ab825ca6.js';
|
|
2
|
+
export { s as setNonce } from './index-ab825ca6.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
|
+
|
|
5
|
+
const defineCustomElements = async (win, options) => {
|
|
6
|
+
if (typeof window === 'undefined') return undefined;
|
|
7
|
+
await globalScripts();
|
|
8
|
+
return bootstrapLazy([["lottery-selection",[[1,"lottery-selection",{"value":[520],"text":[513],"idx":[514],"type":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"hasBorder":[516,"has-border"],"hasBackground":[516,"has-background"],"deleteIconSvg":[513,"delete-icon-svg"],"deleteIconWidth":[513,"delete-icon-width"],"deleteIconHeight":[513,"delete-icon-height"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { defineCustomElements };
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-ab825ca6.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @name setClientStyling
|
|
5
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
6
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
7
|
+
* @param {string} clientStyling The style content
|
|
8
|
+
*/
|
|
9
|
+
function setClientStyling(stylingContainer, clientStyling) {
|
|
10
|
+
if (stylingContainer) {
|
|
11
|
+
const sheet = document.createElement('style');
|
|
12
|
+
sheet.innerHTML = clientStyling;
|
|
13
|
+
stylingContainer.appendChild(sheet);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @name setClientStylingURL
|
|
19
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
|
|
20
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
21
|
+
* @param {string} clientStylingUrl The URL of the style content
|
|
22
|
+
*/
|
|
23
|
+
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
24
|
+
if (!stylingContainer || !clientStylingUrl) return;
|
|
25
|
+
|
|
26
|
+
const url = new URL(clientStylingUrl);
|
|
27
|
+
|
|
28
|
+
fetch(url.href)
|
|
29
|
+
.then((res) => res.text())
|
|
30
|
+
.then((data) => {
|
|
31
|
+
const cssFile = document.createElement('style');
|
|
32
|
+
cssFile.innerHTML = data;
|
|
33
|
+
if (stylingContainer) {
|
|
34
|
+
stylingContainer.appendChild(cssFile);
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
.catch((err) => {
|
|
38
|
+
console.error('There was an error while trying to load client styling from URL', err);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @name setStreamLibrary
|
|
44
|
+
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
45
|
+
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
46
|
+
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
47
|
+
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
48
|
+
*/
|
|
49
|
+
function setStreamStyling(stylingContainer, domain, subscription) {
|
|
50
|
+
if (window.emMessageBus) {
|
|
51
|
+
const sheet = document.createElement('style');
|
|
52
|
+
|
|
53
|
+
window.emMessageBus.subscribe(domain, (data) => {
|
|
54
|
+
sheet.innerHTML = data;
|
|
55
|
+
if (stylingContainer) {
|
|
56
|
+
stylingContainer.appendChild(sheet);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// This icon file is generated automatically.
|
|
63
|
+
var DeleteFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-200 0H360v-72h304v72z" } }] }, "name": "delete", "theme": "filled" };
|
|
64
|
+
const DeleteFilled$1 = DeleteFilled;
|
|
65
|
+
|
|
66
|
+
var __assign = (undefined && undefined.__assign) || function () {
|
|
67
|
+
__assign = Object.assign || function(t) {
|
|
68
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
69
|
+
s = arguments[i];
|
|
70
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
71
|
+
t[p] = s[p];
|
|
72
|
+
}
|
|
73
|
+
return t;
|
|
74
|
+
};
|
|
75
|
+
return __assign.apply(this, arguments);
|
|
76
|
+
};
|
|
77
|
+
var defaultColors = {
|
|
78
|
+
primaryColor: '#333',
|
|
79
|
+
secondaryColor: '#E6E6E6'
|
|
80
|
+
};
|
|
81
|
+
function renderIconDefinitionToSVGElement(icond, options) {
|
|
82
|
+
if (options === void 0) { options = {}; }
|
|
83
|
+
if (typeof icond.icon === 'function') {
|
|
84
|
+
// two-tone
|
|
85
|
+
var placeholders = options.placeholders || defaultColors;
|
|
86
|
+
return renderAbstractNodeToSVGElement(icond.icon(placeholders.primaryColor, placeholders.secondaryColor), options);
|
|
87
|
+
}
|
|
88
|
+
// fill, outline
|
|
89
|
+
return renderAbstractNodeToSVGElement(icond.icon, options);
|
|
90
|
+
}
|
|
91
|
+
function renderAbstractNodeToSVGElement(node, options) {
|
|
92
|
+
var targetAttrs = node.tag === 'svg'
|
|
93
|
+
? __assign(__assign({}, node.attrs), (options.extraSVGAttrs || {})) : node.attrs;
|
|
94
|
+
var attrs = Object.keys(targetAttrs).reduce(function (acc, nextKey) {
|
|
95
|
+
var key = nextKey;
|
|
96
|
+
var value = targetAttrs[key];
|
|
97
|
+
var token = "".concat(key, "=\"").concat(value, "\"");
|
|
98
|
+
acc.push(token);
|
|
99
|
+
return acc;
|
|
100
|
+
}, []);
|
|
101
|
+
var attrsToken = attrs.length ? ' ' + attrs.join(' ') : '';
|
|
102
|
+
var children = (node.children || [])
|
|
103
|
+
.map(function (child) { return renderAbstractNodeToSVGElement(child, options); })
|
|
104
|
+
.join('');
|
|
105
|
+
if (children && children.length) {
|
|
106
|
+
return "<".concat(node.tag).concat(attrsToken, ">").concat(children, "</").concat(node.tag, ">");
|
|
107
|
+
}
|
|
108
|
+
return "<".concat(node.tag).concat(attrsToken, " />");
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Basic sanitization method for SVG content
|
|
112
|
+
// This is NOT a complete XSS prevention for SVG, but prevents common attacks.
|
|
113
|
+
function sanitizeSvg(svgString) {
|
|
114
|
+
let sanitized = svgString.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ''); // Remove <script> tags
|
|
115
|
+
sanitized = sanitized.replace(/on[a-z]+=[\"'][^\"']*[\"']/gi, ''); // Remove on* attributes
|
|
116
|
+
sanitized = sanitized.replace(/javascript:/gi, ''); // Remove javascript: URLs
|
|
117
|
+
return sanitized;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const lotterySelectionCss = ":host{display:inline-block}.lottery-selection__button{display:flex;align-items:center;justify-content:center;width:var(--lottery-selection-width, 32px);height:var(--lottery-selection-height, 32px);padding:var(--lottery-selection-padding, 0);box-sizing:border-box;background:var(--lottery-selection-background, var(--emw--color-background, #fff));border:var(--lottery-selection-border-width, 2px) var(--lottery-selection-border-style, solid) var(--lottery-selection-border-color, var(--emw--color-primary, #0d196e));border-radius:var(--lottery-selection-border-radius, var(--emw--border-radius-medium, 8px));color:var(--lottery-selection-color, var(--emw--color-typography, #000));font-weight:var(--lottery-selection-font-weight, bold);font-size:var(--lottery-selection-font-size, 1em);cursor:pointer;user-select:none;}.lottery-selection__button:hover{background:var(--lottery-selection-hover-background, var(--emw--color-background, #fff));border-color:var(--lottery-selection-hover-border-color, var(--emw--color-primary, #0d196e));color:var(--lottery-selection-hover-color, var(--emw--color-typography, #000))}.lottery-selection__button .lottery-selection__delete-icon{display:none}.lottery-selection__button.isDeleteByIcon:hover .lottery-selection__text{display:none}.lottery-selection__button.isDeleteByIcon:hover .lottery-selection__delete-icon{display:flex;align-items:center;justify-content:center;fill:var(--lottery-selection-delete-icon-color, var(--emw--color-typography, #000));vertical-align:middle}.lottery-selection__button.lottery-selection__button--selected{background-color:var(--lottery-selection-selected-background, var(--emw--color-primary, #0d196e));border-color:var(--lottery-selection-selected-border-color, var(--emw--color-primary, #0d196e));color:var(--lottery-selection-selected-color, var(--emw--color-typography-inverse, #fff))}.lottery-selection__button.lottery-selection__button--disabled{background-color:var(--lottery-selection-disabled-background, var(--emw--color-gray-50, #f5f5f5));border-color:var(--lottery-selection-disabled-border-color, var(--emw--color-gray-100, #e6e6e6));color:var(--lottery-selection-disabled-color, var(--emw--color-gray-150, #6f6f6f));cursor:not-allowed;pointer-events:none;}.lottery-selection__button.lottery-selection__button--no-border{border:none}.lottery-selection__button.lottery-selection__button--no-background{background:transparent}";
|
|
121
|
+
const LotterySelectionStyle0 = lotterySelectionCss;
|
|
122
|
+
|
|
123
|
+
const LotterySelection = class {
|
|
124
|
+
constructor(hostRef) {
|
|
125
|
+
registerInstance(this, hostRef);
|
|
126
|
+
this.lotteryBulletClickHandler = createEvent(this, "lotteryBulletClick", 7);
|
|
127
|
+
this.value = 0;
|
|
128
|
+
this.text = undefined;
|
|
129
|
+
this.idx = undefined;
|
|
130
|
+
this.type = 'toggle';
|
|
131
|
+
this.mbSource = undefined;
|
|
132
|
+
this.clientStyling = undefined;
|
|
133
|
+
this.clientStylingUrl = undefined;
|
|
134
|
+
this.hasBorder = true;
|
|
135
|
+
this.hasBackground = true;
|
|
136
|
+
this.deleteIconSvg = '';
|
|
137
|
+
this.deleteIconWidth = '16px';
|
|
138
|
+
this.deleteIconHeight = '16px';
|
|
139
|
+
}
|
|
140
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
141
|
+
if (newValue !== oldValue) {
|
|
142
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
146
|
+
if (newValue !== oldValue) {
|
|
147
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
151
|
+
if (newValue !== oldValue) {
|
|
152
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
componentDidLoad() {
|
|
156
|
+
if (this.stylingContainer) {
|
|
157
|
+
if (this.mbSource)
|
|
158
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
159
|
+
if (this.clientStyling)
|
|
160
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
161
|
+
if (this.clientStylingUrl)
|
|
162
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
disconnectedCallback() {
|
|
166
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
167
|
+
}
|
|
168
|
+
handleClick() {
|
|
169
|
+
if (this.type === 'disabled' || this.type === 'readonly') {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
console.log('bullet clicked', this.type, this.idx, this.text, this.value);
|
|
173
|
+
this.lotteryBulletClickHandler.emit({
|
|
174
|
+
type: this.type,
|
|
175
|
+
idx: this.idx,
|
|
176
|
+
text: this.text,
|
|
177
|
+
value: this.value
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
render() {
|
|
181
|
+
let iconToRender;
|
|
182
|
+
if (this.deleteIconSvg) {
|
|
183
|
+
iconToRender = sanitizeSvg(this.deleteIconSvg);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
iconToRender = renderIconDefinitionToSVGElement(DeleteFilled$1, {
|
|
187
|
+
extraSVGAttrs: {
|
|
188
|
+
width: this.deleteIconWidth,
|
|
189
|
+
height: this.deleteIconHeight,
|
|
190
|
+
fill: 'currentColor'
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
return (h("div", { key: '0d1e8aaa80a907a7467410f6b27b4b6175e82299', class: "lottery-selection", ref: (el) => (this.stylingContainer = el) }, h("button", { key: '11a2402abbc290dc877ad95f3433092c3a0d8419', class: {
|
|
195
|
+
'lottery-selection__button': true,
|
|
196
|
+
'lottery-selection__button--selected': this.value == 1,
|
|
197
|
+
'lottery-selection__button--disabled': this.type === 'disabled',
|
|
198
|
+
'lottery-selection__button--no-border': !this.hasBorder,
|
|
199
|
+
'lottery-selection__button--no-background': !this.hasBackground,
|
|
200
|
+
isDeleteByIcon: this.type === 'delete',
|
|
201
|
+
isCallDialogBtn: this.type === 'input' || this.type === 'readonly'
|
|
202
|
+
}, onClick: this.handleClick.bind(this), disabled: this.type === 'disabled' }, this.type === 'delete' && h("span", { key: 'f99001d936a8f7bdf8adc5c46e82caf730a9442a', class: "lottery-selection__delete-icon", innerHTML: iconToRender }), h("span", { key: '55775e2492a1fe45cc8a457ac0a0d206744461ab', class: "lottery-selection__text" }, this.text))));
|
|
203
|
+
}
|
|
204
|
+
static get watchers() { return {
|
|
205
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
206
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
207
|
+
"mbSource": ["handleMbSourceChange"]
|
|
208
|
+
}; }
|
|
209
|
+
};
|
|
210
|
+
LotterySelection.style = LotterySelectionStyle0;
|
|
211
|
+
|
|
212
|
+
export { LotterySelection as L };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-ab825ca6.js';
|
|
2
|
+
export { s as setNonce } from './index-ab825ca6.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
var patchBrowser = () => {
|
|
9
|
+
const importMeta = import.meta.url;
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== "") {
|
|
12
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(async (options) => {
|
|
18
|
+
await globalScripts();
|
|
19
|
+
return bootstrapLazy([["lottery-selection",[[1,"lottery-selection",{"value":[520],"text":[513],"idx":[514],"type":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"hasBorder":[516,"has-border"],"hasBackground":[516,"has-background"],"deleteIconSvg":[513,"delete-icon-svg"],"deleteIconWidth":[513,"delete-icon-width"],"deleteIconHeight":[513,"delete-icon-height"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./cjs/index.cjs.js');
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './esm/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=()=>{};export{o as g}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>t in e,s=(e,t)=>(0,console.error)(e,t),r=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={l:0,o:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},h=e=>Promise.resolve(e),d=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),p=!1,m=[],y=[],$=(e,t)=>n=>{e.push(n),p||(p=!0,t&&4&f.l?v(w):f.raf(w))},b=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},w=()=>{b(m),b(y),(p=m.length>0)&&f.raf(w)},v=e=>h().then(e),S=$(y,!0),g={},j=e=>"object"==(e=typeof e)||"function"===e;function k(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>E,map:()=>C,ok:()=>O,unwrap:()=>P,unwrapErr:()=>R});var O=e=>({isOk:!0,isErr:!1,value:e}),E=e=>({isOk:!1,isErr:!0,value:e});function C(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>O(e))):O(n)}if(e.isErr)return E(e.value);throw"should never get here"}var M,x,P=e=>{if(e.isOk)return e.value;throw e.value},R=e=>{if(e.isErr)return e.value;throw e.value},T=(e,t,...n)=>{let l=null,o=null,s=!1,r=!1;const i=[],c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!j(l))&&(l+=""),s&&r?i[i.length-1].i+=l:i.push(s?A(null,l):l),r=s)};if(c(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const u=A(e,null);return u.u=t,i.length>0&&(u.h=i),u.p=o,u},A=(e,t)=>({l:0,m:e,i:t,$:null,h:null,u:null,p:null}),F={},L=(e,t,l)=>{const o=(e=>n(e).$hostElement$)(e);return{emit:e=>N(o,t,{bubbles:!!(4&l),composed:!!(2&l),cancelable:!!(1&l),detail:e})}},N=(e,t,n)=>{const l=f.ce(t,n);return e.dispatchEvent(l),l},U=new WeakMap,D=e=>"sc-"+e.v,H=(e,t,n,l,s,r)=>{if(n!==l){let i=o(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=q(n),s=q(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("key"===t);else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const o=j(l);if((i||o&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||s)&&!o&&e.setAttribute(t,l=!0===l?"":l)}else if(t="-"===t[2]?t.slice(3):o(u,c)?c.slice(2):c[2]+t.slice(3),n||l){const o=t.endsWith(G);t=t.replace(V,""),n&&f.rel(e,t,n,o),l&&f.ael(e,t,l,o)}}},W=/\s/,q=e=>e?e.split(W):[],G="Capture",V=RegExp(G+"$"),_=(e,t,n)=>{const l=11===t.$.nodeType&&t.$.host?t.$.host:t.$,o=e&&e.u||g,s=t.u||g;for(const e of z(Object.keys(o)))e in s||H(l,e,o[e],void 0,n,t.l);for(const e of z(Object.keys(s)))H(l,e,o[e],s[e],n,t.l)};function z(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var B=!1,I=(e,t,n)=>{const l=t.h[n];let o,s,r=0;if(null!==l.i)o=l.$=a.createTextNode(l.i);else if(o=l.$=a.createElement(l.m),_(null,l,B),null!=M&&o["s-si"]!==M&&o.classList.add(o["s-si"]=M),l.h)for(r=0;r<l.h.length;++r)s=I(e,l,r),s&&o.appendChild(s);return o["s-hn"]=x,o},J=(e,t,n,l,o,s)=>{let r,i=e;for(i.shadowRoot&&i.tagName===x&&(i=i.shadowRoot);o<=s;++o)l[o]&&(r=I(null,n,o),r&&(l[o].$=r,Z(i,r,t)))},K=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.$;Y(t),e&&e.remove()}}},Q=(e,t,n=!1)=>e.m===t.m&&(!!n||e.p===t.p),X=(e,t,n=!1)=>{const l=t.$=e.$,o=e.h,s=t.h,r=t.i;null===r?(_(e,t,B),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,r,i=0,c=0,u=0,a=0,f=t.length-1,h=t[0],d=t[f],p=l.length-1,m=l[0],y=l[p];for(;i<=f&&c<=p;)if(null==h)h=t[++i];else if(null==d)d=t[--f];else if(null==m)m=l[++c];else if(null==y)y=l[--p];else if(Q(h,m,o))X(h,m,o),h=t[++i],m=l[++c];else if(Q(d,y,o))X(d,y,o),d=t[--f],y=l[--p];else if(Q(h,y,o))X(h,y,o),Z(e,h.$,d.$.nextSibling),h=t[++i],y=l[--p];else if(Q(d,m,o))X(d,m,o),Z(e,d.$,h.$),d=t[--f],m=l[++c];else{for(u=-1,a=i;a<=f;++a)if(t[a]&&null!==t[a].p&&t[a].p===m.p){u=a;break}u>=0?(r=t[u],r.m!==m.m?s=I(t&&t[c],n,u):(X(r,m,o),t[u]=void 0,s=r.$),m=l[++c]):(s=I(t&&t[c],n,c),m=l[++c]),s&&Z(h.$.parentNode,s,h.$)}i>f?J(e,null==l[p+1]?null:l[p+1].$,n,l,c,p):c>p&&K(t,i,f)})(l,o,t,s,n):null!==s?(null!==e.i&&(l.textContent=""),J(l,null,t,s,0,s.length-1)):null!==o&&K(o,0,o.length-1)):e.i!==r&&(l.data=r)},Y=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(Y)},Z=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),ee=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},te=(e,t)=>{if(e.l|=16,!(4&e.l))return ee(e,e.j),S((()=>ne(e,t)));e.l|=512},ne=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);return le(void 0,(()=>se(e,n,t)))},le=(e,t)=>oe(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),oe=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,se=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.k,n=e.$hostElement$,l=t.l,o=((e,t)=>{var n;const l=D(t),o=i.get(l);if(e=11===e.nodeType?e:a,o)if("string"==typeof o){let s,r=U.get(e=e.head||e);if(r||U.set(e,r=new Set),!r.has(l)){{s=a.createElement("style"),s.innerHTML=o;const t=null!=(n=f.O)?n:k(a);null!=t&&s.setAttribute("nonce",t),e.insertBefore(s,e.querySelector("link"))}4&t.l&&(s.innerHTML+=c),r&&r.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);re(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>ie(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},re=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.k,s=e.C||A(null,null),r=(e=>e&&e.m===F)(t)?t:T(null,null,t);if(x=l.tagName,o.M&&(r.u=r.u||{},o.M.map((([e,t])=>r.u[t]=l[e]))),n&&r.u)for(const e of Object.keys(r.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.u[e]=l[e]);r.m=null,r.l|=4,e.C=r,r.$=s.$=l.shadowRoot||l,M=l["s-sc"],X(s,r,n)})(e,t,l)}catch(t){s(t,e.$hostElement$)}return null},ie=e=>{const t=e.$hostElement$,n=e.t,l=e.j;64&e.l||(e.l|=64,ae(t),ue(n,"componentDidLoad"),e.P(t),l||ce()),e.S&&(e.S(),e.S=void 0),512&e.l&&v((()=>te(e,!1))),e.l&=-517},ce=()=>{ae(a.documentElement),v((()=>N(u,"appload",{detail:{namespace:"lottery-selection"}})))},ue=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},ae=e=>e.classList.add("hydrated"),fe=(e,t,l)=>{var o,r;const i=e.prototype;if(t.R||t.T||e.watchers){e.watchers&&!t.T&&(t.T=e.watchers);const c=Object.entries(null!=(o=t.R)?o:{});if(c.map((([e,[o]])=>{(31&o||2&l&&32&o)&&Object.defineProperty(i,e,{get(){return((e,t)=>n(this).A.get(t))(0,e)},set(l){((e,t,l,o)=>{const r=n(e);if(!r)throw Error(`Couldn't find host element for "${o.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=r.$hostElement$,c=r.A.get(t),u=r.l,a=r.t;if(l=((e,t)=>null==e||j(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(l,o.R[t][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(r.A.set(t,l),a)){if(o.T&&128&u){const e=o.T[t];e&&e.map((e=>{try{a[e](l,c,t)}catch(e){s(e,i)}}))}2==(18&u)&&te(r,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;i.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var r;const c=l.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),i=null==l?void 0:l.l;if(i&&!(8&i)&&128&i&&s!==o){const n=l.t,i=null==(r=t.T)?void 0:r[e];null==i||i.forEach((t=>{null!=n[t]&&n[t].call(n,s,o,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.T)?r:{}),...c.filter((([e,t])=>15&t[0])).map((([e,n])=>{var o;const s=n[1]||e;return l.set(s,e),512&n[0]&&(null==(o=t.M)||o.push([e,s])),s}))]))}}return e},he=e=>{ue(e,"disconnectedCallback")},de=(e,l={})=>{var o;const h=[],p=l.exclude||[],m=u.customElements,y=a.head,$=y.querySelector("meta[charset]"),b=a.createElement("style"),w=[];let v,S=!0;Object.assign(f,l),f.o=new URL(l.resourcesUrl||"./",a.baseURI).href;let g=!1;if(e.map((e=>{e[1].map((l=>{var o;const c={l:l[0],v:l[1],R:l[2],F:l[3]};4&c.l&&(g=!0),c.R=l[2],c.M=[],c.T=null!=(o=l[4])?o:{};const u=c.v,a=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,k:n,A:new Map};l.L=new Promise((e=>l.P=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,c),1&c.l)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.v}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),v&&(clearTimeout(v),v=null),S?w.push(this):f.jmp((()=>(e=>{if(!(1&f.l)){const t=n(e),l=t.k,o=()=>{};if(1&t.l)(null==t?void 0:t.t)||(null==t?void 0:t.L)&&t.L.then((()=>{}));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){ee(t,t.j=n);break}}l.R&&Object.entries(l.R).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let l;if(!(32&t.l)){if(t.l|=32,n.N){const e=(e=>{const t=e.v.replace(/-/g,"_"),n=e.N;if(!n)return;const l=r.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(r.set(n,e),e[t])),s)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};l=await e,t()}else l=e;if(!l)throw Error(`Constructor for "${n.v}#${t.U}" was not found`);l.isProxied||(n.T=l.watchers,fe(l,n,2),l.isProxied=!0);const o=()=>{};t.l|=8;try{new l(t)}catch(e){s(e)}t.l&=-9,t.l|=128,o()}else l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(l&&l.style){let e;"string"==typeof l.style&&(e=l.style);const t=D(n);if(!i.has(t)){const l=()=>{};((e,t,n)=>{let l=i.get(e);d&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,i.set(e,l)})(t,e,!!(1&n.l)),l()}}}const o=t.j,c=()=>te(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(e,t,l)}o()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.l)){const e=n(this);(null==e?void 0:e.t)?he(e.t):(null==e?void 0:e.L)&&e.L.then((()=>he(e.t)))}})()))}componentOnReady(){return n(this).L}};c.N=e[0],p.includes(u)||m.get(u)||(h.push(u),m.define(u,fe(a,c,1)))}))})),h.length>0&&(g&&(b.textContent+=c),b.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",b.innerHTML.length)){b.setAttribute("data-styles","");const e=null!=(o=f.O)?o:k(a);null!=e&&b.setAttribute("nonce",e),y.insertBefore(b,$?$.nextSibling:y.firstChild)}S=!1,w.length?w.map((e=>e.connectedCallback())):f.jmp((()=>v=setTimeout(ce,30)))},pe=e=>f.O=e;export{de as b,L as c,T as h,h as p,l as r,pe as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{L as LotterySelection}from"./lottery-selection-75fcc811.js";import"./index-ab825ca6.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as o}from"./index-ab825ca6.js";function r(t,e){if(t){const o=document.createElement("style");o.innerHTML=e,t.appendChild(o)}}function l(t,e){if(!t||!e)return;const o=new URL(e);fetch(o.href).then((t=>t.text())).then((e=>{const o=document.createElement("style");o.innerHTML=e,t&&t.appendChild(o)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function i(t,e){if(window.emMessageBus){const o=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{o.innerHTML=e,t&&t.appendChild(o)}))}}const n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-200 0H360v-72h304v72z"}}]},name:"delete",theme:"filled"};var s=function(){return s=Object.assign||function(t){for(var e,o=1,r=arguments.length;o<r;o++)for(var l in e=arguments[o])Object.prototype.hasOwnProperty.call(e,l)&&(t[l]=e[l]);return t},s.apply(this,arguments)},c={primaryColor:"#333",secondaryColor:"#E6E6E6"};function a(t,e){var o="svg"===t.tag?s(s({},t.attrs),e.extraSVGAttrs||{}):t.attrs,r=Object.keys(o).reduce((function(t,e){var r=o[e],l="".concat(e,'="').concat(r,'"');return t.push(l),t}),[]),l=r.length?" "+r.join(" "):"",i=(t.children||[]).map((function(t){return a(t,e)})).join("");return i&&i.length?"<".concat(t.tag).concat(l,">").concat(i,"</").concat(t.tag,">"):"<".concat(t.tag).concat(l," />")}const d=class{constructor(o){t(this,o),this.lotteryBulletClickHandler=e(this,"lotteryBulletClick",7),this.value=0,this.text=void 0,this.idx=void 0,this.type="toggle",this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.hasBorder=!0,this.hasBackground=!0,this.deleteIconSvg="",this.deleteIconWidth="16px",this.deleteIconHeight="16px"}handleClientStylingChange(t,e){t!==e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!==e&&l(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!==e&&i(this.stylingContainer,`${this.mbSource}.Style`)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&i(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&l(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleClick(){"disabled"!==this.type&&"readonly"!==this.type&&(console.log("bullet clicked",this.type,this.idx,this.text,this.value),this.lotteryBulletClickHandler.emit({type:this.type,idx:this.idx,text:this.text,value:this.value}))}render(){let t;return t=this.deleteIconSvg?function(t){let e=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");return e=e.replace(/on[a-z]+=[\"'][^\"']*[\"']/gi,""),e=e.replace(/javascript:/gi,""),e}(this.deleteIconSvg):function(t,e){if(void 0===e&&(e={}),"function"==typeof t.icon){var o=e.placeholders||c;return a(t.icon(o.primaryColor,o.secondaryColor),e)}return a(t.icon,e)}(n,{extraSVGAttrs:{width:this.deleteIconWidth,height:this.deleteIconHeight,fill:"currentColor"}}),o("div",{key:"0d1e8aaa80a907a7467410f6b27b4b6175e82299",class:"lottery-selection",ref:t=>this.stylingContainer=t},o("button",{key:"11a2402abbc290dc877ad95f3433092c3a0d8419",class:{"lottery-selection__button":!0,"lottery-selection__button--selected":1==this.value,"lottery-selection__button--disabled":"disabled"===this.type,"lottery-selection__button--no-border":!this.hasBorder,"lottery-selection__button--no-background":!this.hasBackground,isDeleteByIcon:"delete"===this.type,isCallDialogBtn:"input"===this.type||"readonly"===this.type},onClick:this.handleClick.bind(this),disabled:"disabled"===this.type},"delete"===this.type&&o("span",{key:"f99001d936a8f7bdf8adc5c46e82caf730a9442a",class:"lottery-selection__delete-icon",innerHTML:t}),o("span",{key:"55775e2492a1fe45cc8a457ac0a0d206744461ab",class:"lottery-selection__text"},this.text)))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};d.style=":host{display:inline-block}.lottery-selection__button{display:flex;align-items:center;justify-content:center;width:var(--lottery-selection-width, 32px);height:var(--lottery-selection-height, 32px);padding:var(--lottery-selection-padding, 0);box-sizing:border-box;background:var(--lottery-selection-background, var(--emw--color-background, #fff));border:var(--lottery-selection-border-width, 2px) var(--lottery-selection-border-style, solid) var(--lottery-selection-border-color, var(--emw--color-primary, #0d196e));border-radius:var(--lottery-selection-border-radius, var(--emw--border-radius-medium, 8px));color:var(--lottery-selection-color, var(--emw--color-typography, #000));font-weight:var(--lottery-selection-font-weight, bold);font-size:var(--lottery-selection-font-size, 1em);cursor:pointer;user-select:none;}.lottery-selection__button:hover{background:var(--lottery-selection-hover-background, var(--emw--color-background, #fff));border-color:var(--lottery-selection-hover-border-color, var(--emw--color-primary, #0d196e));color:var(--lottery-selection-hover-color, var(--emw--color-typography, #000))}.lottery-selection__button .lottery-selection__delete-icon{display:none}.lottery-selection__button.isDeleteByIcon:hover .lottery-selection__text{display:none}.lottery-selection__button.isDeleteByIcon:hover .lottery-selection__delete-icon{display:flex;align-items:center;justify-content:center;fill:var(--lottery-selection-delete-icon-color, var(--emw--color-typography, #000));vertical-align:middle}.lottery-selection__button.lottery-selection__button--selected{background-color:var(--lottery-selection-selected-background, var(--emw--color-primary, #0d196e));border-color:var(--lottery-selection-selected-border-color, var(--emw--color-primary, #0d196e));color:var(--lottery-selection-selected-color, var(--emw--color-typography-inverse, #fff))}.lottery-selection__button.lottery-selection__button--disabled{background-color:var(--lottery-selection-disabled-background, var(--emw--color-gray-50, #f5f5f5));border-color:var(--lottery-selection-disabled-border-color, var(--emw--color-gray-100, #e6e6e6));color:var(--lottery-selection-disabled-color, var(--emw--color-gray-150, #6f6f6f));cursor:not-allowed;pointer-events:none;}.lottery-selection__button.lottery-selection__button--no-border{border:none}.lottery-selection__button.lottery-selection__button--no-background{background:transparent}";export{d as L}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{L as lottery_selection}from"./lottery-selection-75fcc811.js";import"./index-ab825ca6.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,b as t}from"./index-ab825ca6.js";export{s as setNonce}from"./index-ab825ca6.js";import{g as n}from"./app-globals-0f993ce5.js";(()=>{const t=import.meta.url,n={};return""!==t&&(n.resourcesUrl=new URL(".",t).href),e(n)})().then((async e=>(await n(),t([["lottery-selection",[[1,"lottery-selection",{value:[520],text:[513],idx:[514],type:[513],mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],hasBorder:[516,"has-border"],hasBackground:[516,"has-background"],deleteIconSvg:[513,"delete-icon-svg"],deleteIconWidth:[513,"delete-icon-width"],deleteIconHeight:[513,"delete-icon-height"]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}]]]],e))));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { sass } from "@stencil/sass";
|
|
2
|
+
export const config = {
|
|
3
|
+
namespace: 'lottery-selection',
|
|
4
|
+
taskQueue: 'async',
|
|
5
|
+
sourceMap: false,
|
|
6
|
+
minifyJs: true,
|
|
7
|
+
extras: {
|
|
8
|
+
experimentalImportInjection: true
|
|
9
|
+
},
|
|
10
|
+
plugins: [sass()],
|
|
11
|
+
outputTargets: [
|
|
12
|
+
{
|
|
13
|
+
type: 'www'
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
type: 'docs-readme'
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { cleanPackageJsonStencil } from "../../../tools/plugins";
|
|
2
|
+
import { sass } from "@stencil/sass";
|
|
3
|
+
export const config = {
|
|
4
|
+
namespace: 'lottery-selection',
|
|
5
|
+
taskQueue: 'async',
|
|
6
|
+
sourceMap: false,
|
|
7
|
+
minifyJs: true,
|
|
8
|
+
hashFileNames: false,
|
|
9
|
+
extras: {
|
|
10
|
+
experimentalImportInjection: true
|
|
11
|
+
},
|
|
12
|
+
plugins: [cleanPackageJsonStencil(), sass()],
|
|
13
|
+
outputTargets: [
|
|
14
|
+
{
|
|
15
|
+
type: 'dist',
|
|
16
|
+
esmLoaderPath: '../loader'
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { getStoryFiles, detectUsedPackages, parseTsConfig, exec, filterParsedPathsByUsedPackages } from "../../../../libs/common/src/storybook/storybook-utils";
|
|
3
|
+
const config = {
|
|
4
|
+
stories: ['../**/*.@(mdx|stories.@(js|ts|tsx))'],
|
|
5
|
+
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions', 'storybook-dark-mode'],
|
|
6
|
+
docs: {
|
|
7
|
+
defaultName: 'Documentation',
|
|
8
|
+
autodocs: 'tag'
|
|
9
|
+
},
|
|
10
|
+
framework: {
|
|
11
|
+
name: '@storybook/web-components-vite',
|
|
12
|
+
options: {}
|
|
13
|
+
},
|
|
14
|
+
// Async viteFinal to build dependent packages before finalizing configuration.
|
|
15
|
+
viteFinal: async (config) => {
|
|
16
|
+
const storyFiles = getStoryFiles(path.resolve(__dirname, '../'));
|
|
17
|
+
const usedPackages = detectUsedPackages(storyFiles);
|
|
18
|
+
const buildPromises = usedPackages.map(async (pkg) => {
|
|
19
|
+
try {
|
|
20
|
+
console.log(`Building package ${pkg}...`);
|
|
21
|
+
const { stdout, stderr } = await exec(`nx run ${pkg}:build`);
|
|
22
|
+
console.log(`Built package ${pkg}: ${stdout}`);
|
|
23
|
+
if (stderr) {
|
|
24
|
+
console.error(`Build warning/error for package ${pkg}: ${stderr}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error(`Error building package ${pkg}:`, error);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
await Promise.all(buildPromises);
|
|
32
|
+
const parsedPaths = parseTsConfig() || {};
|
|
33
|
+
const filteredParsedPaths = filterParsedPathsByUsedPackages(parsedPaths, usedPackages);
|
|
34
|
+
return Object.assign(Object.assign({}, config), { resolve: {
|
|
35
|
+
alias: Object.assign({}, filteredParsedPaths)
|
|
36
|
+
}, define: {
|
|
37
|
+
process: {
|
|
38
|
+
env: {}
|
|
39
|
+
}
|
|
40
|
+
} });
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
export default config;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { themes } from "@storybook/theming";
|
|
2
|
+
export const parameters = {
|
|
3
|
+
darkMode: {
|
|
4
|
+
dark: Object.assign(Object.assign({}, themes.dark), { appBg: 'black' }),
|
|
5
|
+
light: Object.assign(Object.assign({}, themes.normal), { appBg: 'green' }),
|
|
6
|
+
current: 'light',
|
|
7
|
+
stylePreview: true
|
|
8
|
+
}
|
|
9
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { exec as execCallback } from 'child_process';
|
|
3
|
+
export declare const exec: typeof execCallback.__promisify__;
|
|
4
|
+
/**
|
|
5
|
+
* Recursively retrieves all story files (.stories.ts/.stories.tsx) in a directory.
|
|
6
|
+
* @param dir The directory to search.
|
|
7
|
+
* @returns Array of story file paths.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getStoryFiles: (dir: string) => string[];
|
|
10
|
+
/**
|
|
11
|
+
* Detects which internal packages are used in the provided story files.
|
|
12
|
+
* It looks at every import that starts with the given package alias prefix,
|
|
13
|
+
* then extracts the package name (the segment immediately following the prefix).
|
|
14
|
+
*
|
|
15
|
+
* @param stories Array of story file paths.
|
|
16
|
+
* @returns Array of unique package names (e.g. ['foo', 'bar']).
|
|
17
|
+
*/
|
|
18
|
+
export declare const detectUsedPackages: (stories: string[]) => string[];
|
|
19
|
+
/**
|
|
20
|
+
* Extracts all import paths from a file using the TypeScript compiler API.
|
|
21
|
+
* @param filePath The file path to parse.
|
|
22
|
+
* @returns Array of import strings.
|
|
23
|
+
*/
|
|
24
|
+
export declare const extractImports: (filePath: string) => string[];
|
|
25
|
+
/**
|
|
26
|
+
* Parses the tsconfig paths and resolves them to absolute paths.
|
|
27
|
+
* @param tsconfigPath The path to the tsconfig file.
|
|
28
|
+
* @returns An object mapping alias keys to absolute paths.
|
|
29
|
+
*/
|
|
30
|
+
export declare const parseTsConfig: () => Record<string, string> | null;
|
|
31
|
+
/**
|
|
32
|
+
* Filters the parsed tsconfig alias mapping to only include keys that correspond
|
|
33
|
+
* to the used packages.
|
|
34
|
+
*
|
|
35
|
+
* @param parsedPaths The full alias mapping from tsconfig.
|
|
36
|
+
* @param usedPackages Array of package names that are used (e.g. ['foo', 'bar']).
|
|
37
|
+
* @returns Filtered alias mapping.
|
|
38
|
+
*/
|
|
39
|
+
export declare const filterParsedPathsByUsedPackages: (parsedPaths: Record<string, string>, usedPackages: string[]) => Record<string, string>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const parameters: {
|
|
2
|
+
darkMode: {
|
|
3
|
+
dark: {
|
|
4
|
+
appBg: string;
|
|
5
|
+
base: "light" | "dark";
|
|
6
|
+
colorPrimary: string;
|
|
7
|
+
colorSecondary: string;
|
|
8
|
+
appContentBg: string;
|
|
9
|
+
appPreviewBg: string;
|
|
10
|
+
appBorderColor: string;
|
|
11
|
+
appBorderRadius: number;
|
|
12
|
+
fontBase: string;
|
|
13
|
+
fontCode: string;
|
|
14
|
+
textColor: string;
|
|
15
|
+
textInverseColor: string;
|
|
16
|
+
textMutedColor: string;
|
|
17
|
+
barTextColor: string;
|
|
18
|
+
barHoverColor: string;
|
|
19
|
+
barSelectedColor: string;
|
|
20
|
+
barBg: string;
|
|
21
|
+
buttonBg: string;
|
|
22
|
+
buttonBorder: string;
|
|
23
|
+
booleanBg: string;
|
|
24
|
+
booleanSelectedBg: string;
|
|
25
|
+
inputBg: string;
|
|
26
|
+
inputBorder: string;
|
|
27
|
+
inputTextColor: string;
|
|
28
|
+
inputBorderRadius: number;
|
|
29
|
+
brandTitle?: string;
|
|
30
|
+
brandUrl?: string;
|
|
31
|
+
brandImage?: string;
|
|
32
|
+
brandTarget?: string;
|
|
33
|
+
gridCellSize?: number;
|
|
34
|
+
};
|
|
35
|
+
light: {
|
|
36
|
+
appBg: string;
|
|
37
|
+
base: "light" | "dark";
|
|
38
|
+
colorPrimary: string;
|
|
39
|
+
colorSecondary: string;
|
|
40
|
+
appContentBg: string;
|
|
41
|
+
appPreviewBg: string;
|
|
42
|
+
appBorderColor: string;
|
|
43
|
+
appBorderRadius: number;
|
|
44
|
+
fontBase: string;
|
|
45
|
+
fontCode: string;
|
|
46
|
+
textColor: string;
|
|
47
|
+
textInverseColor: string;
|
|
48
|
+
textMutedColor: string;
|
|
49
|
+
barTextColor: string;
|
|
50
|
+
barHoverColor: string;
|
|
51
|
+
barSelectedColor: string;
|
|
52
|
+
barBg: string;
|
|
53
|
+
buttonBg: string;
|
|
54
|
+
buttonBorder: string;
|
|
55
|
+
booleanBg: string;
|
|
56
|
+
booleanSelectedBg: string;
|
|
57
|
+
inputBg: string;
|
|
58
|
+
inputBorder: string;
|
|
59
|
+
inputTextColor: string;
|
|
60
|
+
inputBorderRadius: number;
|
|
61
|
+
brandTitle?: string;
|
|
62
|
+
brandUrl?: string;
|
|
63
|
+
brandImage?: string;
|
|
64
|
+
brandTarget?: string;
|
|
65
|
+
gridCellSize?: number;
|
|
66
|
+
};
|
|
67
|
+
current: string;
|
|
68
|
+
stylePreview: boolean;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LotterySelection } from './lottery-selection';
|