@saasquatch/mint-components 1.3.2-4 → 1.3.2-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-big-stat.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-divided-layout_27.cjs.entry.js → sqm-divided-layout_28.cjs.entry.js} +939 -368
- package/dist/cjs/{useDemoBigStat-17e61803.js → useDemoBigStat-ade0e873.js} +90 -20
- package/dist/collection/components/sqm-big-stat/BigStat.stories.js +8 -1
- package/dist/collection/components/sqm-big-stat/sqm-big-stat.js +1 -1
- package/dist/collection/components/sqm-big-stat/useBigStat.js +89 -20
- package/dist/collection/components/sqm-big-stat/useDemoBigStat.js +1 -0
- package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +5 -14
- package/dist/collection/components/sqm-reward-exchange-list/progressBar.js +5 -4
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +55 -43
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +2 -1
- package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +2 -1
- package/dist/collection/components/sqm-stencilbook/CucumberAddon.js +3 -1
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +4 -0
- package/dist/collection/components/sqm-task-card/SVGs.js +0 -6
- package/dist/collection/components/sqm-task-card/TaskCard.stories.js +74 -243
- package/dist/collection/components/sqm-task-card/UseTaskCard.stories.js +41 -0
- package/dist/collection/components/sqm-task-card/progress-bar/SVGs.js +7 -0
- package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +311 -0
- package/dist/collection/components/sqm-task-card/progress-bar/progress-bar.stories.js +53 -0
- package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +14 -307
- package/dist/collection/components/sqm-task-card/sqm-task-card.js +110 -26
- package/dist/collection/stories/NewPortal.stories.js +15 -15
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-big-stat.entry.js +1 -1
- package/dist/esm/{sqm-divided-layout_27.entry.js → sqm-divided-layout_28.entry.js} +903 -333
- package/dist/esm/{useDemoBigStat-b71fe122.js → useDemoBigStat-256c096f.js} +90 -20
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-big-stat.entry.js +1 -1
- package/dist/esm-es5/sqm-divided-layout_28.entry.js +1 -0
- package/dist/esm-es5/useDemoBigStat-256c096f.js +1 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-29523e7f.entry.js +288 -0
- package/dist/mint-components/{p-e22eed7b.entry.js → p-52f23baa.entry.js} +1 -1
- package/dist/mint-components/p-7766f602.system.js +1 -0
- package/dist/mint-components/p-7d486e02.system.entry.js +1 -0
- package/dist/mint-components/p-917488e5.js +227 -0
- package/dist/mint-components/p-91d39961.system.js +1 -1
- package/dist/mint-components/p-a6156ea3.system.entry.js +1 -0
- package/dist/types/components/sqm-big-stat/sqm-big-stat-view.d.ts +1 -0
- package/dist/types/components/sqm-big-stat/useBigStat.d.ts +4 -1
- package/dist/types/components/sqm-reward-exchange-list/SVGs.d.ts +1 -0
- package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +1 -0
- package/dist/types/components/sqm-task-card/SVGs.d.ts +0 -1
- package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +3 -1
- package/dist/types/components/sqm-task-card/UseTaskCard.stories.d.ts +10 -0
- package/dist/types/components/sqm-task-card/progress-bar/SVGs.d.ts +1 -0
- package/dist/types/components/sqm-task-card/progress-bar/progress-bar-view.d.ts +9 -0
- package/dist/types/components/sqm-task-card/progress-bar/progress-bar.stories.d.ts +12 -0
- package/dist/types/components/sqm-task-card/sqm-task-card-view.d.ts +13 -22
- package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +27 -11
- package/dist/types/components.d.ts +52 -30
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/sqm-task-card-view-791797ac.js +0 -475
- package/dist/cjs/sqm-task-card.cjs.entry.js +0 -53
- package/dist/collection/components/sqm-task-card/useTaskCard.js +0 -0
- package/dist/esm/sqm-task-card-view-5cce0847.js +0 -473
- package/dist/esm/sqm-task-card.entry.js +0 -49
- package/dist/esm-es5/sqm-divided-layout_27.entry.js +0 -1
- package/dist/esm-es5/sqm-task-card-view-5cce0847.js +0 -1
- package/dist/esm-es5/sqm-task-card.entry.js +0 -1
- package/dist/esm-es5/useDemoBigStat-b71fe122.js +0 -1
- package/dist/mint-components/p-2b3a99df.js +0 -1
- package/dist/mint-components/p-32918497.entry.js +0 -288
- package/dist/mint-components/p-405a9253.js +0 -227
- package/dist/mint-components/p-4e5a2105.system.entry.js +0 -1
- package/dist/mint-components/p-6198d500.system.entry.js +0 -1
- package/dist/mint-components/p-6932204f.system.js +0 -1
- package/dist/mint-components/p-bbdafe3b.entry.js +0 -1
- package/dist/mint-components/p-c9c4f31b.system.entry.js +0 -1
- package/dist/mint-components/p-f87d8f53.system.js +0 -1
- package/dist/types/components/sqm-task-card/useTaskCard.d.ts +0 -0
|
@@ -1,475 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-b0129cd6.js');
|
|
4
|
-
const jssPresetDefault_esm = require('./jss-preset-default.esm-6304d24f.js');
|
|
5
|
-
const mixins = require('./mixins-7b7c59fe.js');
|
|
6
|
-
|
|
7
|
-
const checkmark_circle = () => {
|
|
8
|
-
return (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18" },
|
|
9
|
-
index.h("path", { fill: "currentColor", "fill-rule": "evenodd", d: "M1.636 9a7.364 7.364 0 1114.728 0A7.364 7.364 0 011.636 9zM9 0a9 9 0 100 18A9 9 0 009 0zm5.192 6.266a.982.982 0 00-1.548-1.208l-4.787 6.137-2.58-2.58a.982.982 0 00-1.39 1.388l3.367 3.366a.982.982 0 001.468-.09l5.47-7.013z", "clip-rule": "evenodd" })));
|
|
10
|
-
};
|
|
11
|
-
const arrow_left_right = () => {
|
|
12
|
-
return (index.h("svg", { width: 11, height: 12, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
13
|
-
index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10.265 2.789a.346.346 0 000-.489L8.066.101a.346.346 0 10-.489.489l1.61 1.609H2.073a.691.691 0 00-.69.691v1.728a.346.346 0 00.69 0V2.89h7.114L7.577 4.5a.346.346 0 10.49.488l2.198-2.2zM.101 9.21a.346.346 0 000 .489l2.2 2.199a.346.346 0 00.488-.489l-1.61-1.609h7.114c.382 0 .691-.31.691-.691V7.382a.346.346 0 00-.691 0V9.11H1.18L2.789 7.5a.346.346 0 10-.489-.488l-2.199 2.2z", fill: "currentColor" })));
|
|
14
|
-
};
|
|
15
|
-
const gift = () => {
|
|
16
|
-
return (index.h("svg", { width: 16, height: 16, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
17
|
-
index.h("path", { d: "M15 5H9v11h4.5a1 1 0 001-1V9h.5a1 1 0 001-1V6a1 1 0 00-1-1zM1.5 9v6a1 1 0 001 1H7V5H1a1 1 0 00-1 1v2a1 1 0 001 1h.5z", fill: "var(--sl-color-primary-200)" }),
|
|
18
|
-
index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.5 9v1h13V9h-13z", fill: "var(--sl-color-primary-300)" }),
|
|
19
|
-
index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M14 2.71c0 .886-1.33 2.227-2 2.29H9v11H7.002V5H4.588C3.212 4.702 2 3.645 2 2.52 2 1.426 2.476.558 3.342.183 4.169-.176 5.125.02 5.88.545c.927.643 1.447 1.851 1.919 2.947l.123.286.12-.272C8.51 2.45 9.045 1.243 9.94.596c.793-.573 1.801-.79 2.672-.397.9.405 1.388 1.336 1.388 2.51zM10.612 1.5c.48-.347 1.056-.41 1.548 0 .428.357.45.525.506.93l.01.07c0 .599-.516 1.5-1.032 1.5-.366 0-.653-.003-.922-.006-.49-.005-.92-.01-1.657.006.14-.272.252-.533.36-.782.285-.667.534-1.246 1.187-1.718zm-5.673 0c-.233-.161-.766-.09-.987.006-.183.08-.456.32-.456 1.015 0 .674 1.092 1.257 1.092 1.257S5.454 4 7.002 4c-.527-1.305-1.273-1.951-2.063-2.5z", fill: "var(--sl-color-primary-600)" })));
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// @ts-expect-error -- unused
|
|
23
|
-
function TaskCardView(props, children) {
|
|
24
|
-
const { points = 0, cardTitle = "Title Text", description = "Description Text", showProgressBar = false, progress = 0, goal = 1, repeatable = false, expire = false, dateExpire = "", buttonText = "Button Text", buttonLink = "www.example.com", } = props;
|
|
25
|
-
const checkmark_circle$1 = checkmark_circle();
|
|
26
|
-
const arrow_left_right$1 = arrow_left_right();
|
|
27
|
-
const style = {
|
|
28
|
-
HostBlock: mixins.HostBlock,
|
|
29
|
-
TaskCard: {
|
|
30
|
-
"& .main > div": {
|
|
31
|
-
margin: "var(--sl-spacing-medium)",
|
|
32
|
-
},
|
|
33
|
-
"& .main": {
|
|
34
|
-
position: "relative",
|
|
35
|
-
boxSizing: "border-box",
|
|
36
|
-
minWidth: "347px",
|
|
37
|
-
background: "var(--sl-color-white)",
|
|
38
|
-
border: "1px solid var(--sl-color-gray-300)",
|
|
39
|
-
borderRadius: "var(--sl-border-radius-medium)",
|
|
40
|
-
fontSize: "var(--sl-font-size-small)",
|
|
41
|
-
lineHeight: "var(--sl-line-height-dense)",
|
|
42
|
-
},
|
|
43
|
-
"& .main.complete": {
|
|
44
|
-
background: "var(--sl-color-primary-50)",
|
|
45
|
-
borderColor: "var(--sl-color-primary-700)",
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
Header: {
|
|
49
|
-
display: "flex",
|
|
50
|
-
"& .icon": {
|
|
51
|
-
alignSelf: "center",
|
|
52
|
-
lineHeight: "0",
|
|
53
|
-
color: "var(--sl-color-primary-700)",
|
|
54
|
-
fontSize: "var(--sl-font-size-large)",
|
|
55
|
-
marginRight: "var(--sl-spacing-x-small)",
|
|
56
|
-
},
|
|
57
|
-
"& .value": {
|
|
58
|
-
alignSelf: "center",
|
|
59
|
-
color: "var(--sl-color-black)",
|
|
60
|
-
fontSize: "var(--sl-font-size-x-large)",
|
|
61
|
-
fontWeight: "var(--sl-font-weight-semibold)",
|
|
62
|
-
lineHeight: "100%",
|
|
63
|
-
marginRight: "var(--sl-spacing-xx-small)",
|
|
64
|
-
},
|
|
65
|
-
"& .text": {
|
|
66
|
-
alignSelf: "end",
|
|
67
|
-
textTransform: "uppercase",
|
|
68
|
-
color: "var(--sl-color-gray-600)",
|
|
69
|
-
fontSize: "var(--sl-font-size-x-small)",
|
|
70
|
-
lineHeight: "var(--sl-font-size-medium)",
|
|
71
|
-
marginRight: "var(--sl-spacing-xx-small)",
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
Title: {
|
|
75
|
-
color: "var(--sl-color-black)",
|
|
76
|
-
fontSize: "var(--sl-font-size-small)",
|
|
77
|
-
},
|
|
78
|
-
Footer: {
|
|
79
|
-
display: "flex",
|
|
80
|
-
"& .icon": {
|
|
81
|
-
fontSize: "var(--sl-font-size-xx-small)",
|
|
82
|
-
marginRight: "var(--sl-spacing-xx-small)",
|
|
83
|
-
},
|
|
84
|
-
"& .text": {
|
|
85
|
-
marginTop: "auto",
|
|
86
|
-
fontSize: "var(--sl-font-size-x-small)",
|
|
87
|
-
color: "var(--sl-color-gray-600)",
|
|
88
|
-
},
|
|
89
|
-
"& .action": {
|
|
90
|
-
marginTop: "auto",
|
|
91
|
-
marginLeft: "auto",
|
|
92
|
-
},
|
|
93
|
-
"& sl-button.action::part(base) ": {
|
|
94
|
-
color: "var(--sl-color-white)",
|
|
95
|
-
background: "var(--sl-color-primary-500)",
|
|
96
|
-
border: "1px solid var(--sl-color-primary-500)",
|
|
97
|
-
borderRadius: "var(--sl-border-radius-medium)",
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
|
|
102
|
-
const sheet = jssPresetDefault_esm.jss.createStyleSheet(style);
|
|
103
|
-
const styleString = sheet.toString();
|
|
104
|
-
// if showProgressBar is false: progress >= goal
|
|
105
|
-
// if true
|
|
106
|
-
const showComplete = progress >= goal;
|
|
107
|
-
const repetitions = showProgressBar ? Math.floor(progress / goal) : progress;
|
|
108
|
-
return (index.h("div", { class: sheet.classes.TaskCard },
|
|
109
|
-
index.h("div", { class: showComplete ? "main complete" : "main" },
|
|
110
|
-
index.h("style", { type: "text/css" }, styleString),
|
|
111
|
-
index.h("div", { class: sheet.classes.Header },
|
|
112
|
-
showComplete && (index.h("span", { class: "icon" }, checkmark_circle$1)),
|
|
113
|
-
index.h("span", { class: "value" }, points),
|
|
114
|
-
index.h("span", { class: "text" }, "saasquatch points")),
|
|
115
|
-
index.h("div", { class: sheet.classes.Title }, cardTitle),
|
|
116
|
-
showProgressBar && index.h(ProgressBar, Object.assign({}, props)),
|
|
117
|
-
index.h(Details, { description: description }),
|
|
118
|
-
index.h("div", { class: sheet.classes.Footer },
|
|
119
|
-
index.h("span", { class: "text" },
|
|
120
|
-
repeatable && (index.h("div", null,
|
|
121
|
-
index.h("span", { class: "icon" }, arrow_left_right$1),
|
|
122
|
-
index.h("span", null,
|
|
123
|
-
"Completed ",
|
|
124
|
-
repetitions,
|
|
125
|
-
" times"),
|
|
126
|
-
index.h("br", null),
|
|
127
|
-
index.h("span", null,
|
|
128
|
-
"Earned ",
|
|
129
|
-
points * repetitions,
|
|
130
|
-
" SaaSquatch Points"))),
|
|
131
|
-
expire && (index.h("span", null,
|
|
132
|
-
index.h("br", null),
|
|
133
|
-
"Ends ",
|
|
134
|
-
" ",
|
|
135
|
-
dateExpire))),
|
|
136
|
-
index.h("sl-button", { class: "action", size: "small", onClick: () => alert(buttonLink), disabled: showComplete }, showComplete ? "Complete" : buttonText)))));
|
|
137
|
-
}
|
|
138
|
-
function Details(props) {
|
|
139
|
-
const style = {
|
|
140
|
-
HostBlock: mixins.HostBlock,
|
|
141
|
-
Description: {
|
|
142
|
-
"& input[type=checkbox]": {
|
|
143
|
-
display: "none",
|
|
144
|
-
},
|
|
145
|
-
"& input:checked ~ .details": {
|
|
146
|
-
transform: "rotate(-180deg)",
|
|
147
|
-
},
|
|
148
|
-
"& .details": {
|
|
149
|
-
position: "absolute",
|
|
150
|
-
top: "var(--sl-spacing-medium)",
|
|
151
|
-
right: "var(--sl-spacing-medium)",
|
|
152
|
-
color: "var(--sl-color-gray-700)",
|
|
153
|
-
fontSize: "var(--sl-font-size-large)",
|
|
154
|
-
"& :hover": {
|
|
155
|
-
color: "var(--sl-color-primary-700)",
|
|
156
|
-
},
|
|
157
|
-
transformOrigin: "50% 37%",
|
|
158
|
-
transition: "transform var(--sl-transition-medium) ease",
|
|
159
|
-
},
|
|
160
|
-
"& input:checked ~ .summary": {
|
|
161
|
-
transition: "max-height var(--sl-transition-medium) ease",
|
|
162
|
-
maxHeight: "300px",
|
|
163
|
-
},
|
|
164
|
-
"& .summary": {
|
|
165
|
-
display: "block",
|
|
166
|
-
overflow: "hidden",
|
|
167
|
-
color: "var(--sl-color-gray-700)",
|
|
168
|
-
fontSize: "var(--sl-font-size-x-small)",
|
|
169
|
-
maxHeight: "0px",
|
|
170
|
-
transition: "max-height var(--sl-transition-fast) ease-out",
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
};
|
|
174
|
-
jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
|
|
175
|
-
const sheet = jssPresetDefault_esm.jss.createStyleSheet(style);
|
|
176
|
-
const styleString = sheet.toString();
|
|
177
|
-
const rid = Math.random().toString(36).slice(2);
|
|
178
|
-
return (index.h("div", null,
|
|
179
|
-
index.h("style", { type: "text/css" }, styleString),
|
|
180
|
-
index.h("span", { class: sheet.classes.Description },
|
|
181
|
-
index.h("input", { type: "checkbox", id: "details-" + rid }),
|
|
182
|
-
index.h("label", { class: "details", htmlFor: "details-" + rid },
|
|
183
|
-
index.h("sl-icon", { name: "chevron-down" })),
|
|
184
|
-
index.h("span", { class: "summary" }, props.description))));
|
|
185
|
-
}
|
|
186
|
-
function ProgressBar(props) {
|
|
187
|
-
const { goal, progress, steps, unit = "", repeatable } = props;
|
|
188
|
-
const gift1 = gift();
|
|
189
|
-
const gift2 = gift();
|
|
190
|
-
const gift3 = gift();
|
|
191
|
-
// if progress and goal are not provided, there cannot be a progress bar
|
|
192
|
-
// if (!showProgressBar) return;
|
|
193
|
-
const items = [];
|
|
194
|
-
var columns = "";
|
|
195
|
-
var repetitions = Math.floor(progress / goal);
|
|
196
|
-
if (repeatable) {
|
|
197
|
-
if (steps) {
|
|
198
|
-
addStepsRepeatable();
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
addLinearRepeatable();
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
// non repetable
|
|
205
|
-
else {
|
|
206
|
-
if (steps) {
|
|
207
|
-
addSteps();
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
addLinear();
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
const style = {
|
|
214
|
-
HostBlock: mixins.HostBlock,
|
|
215
|
-
ProgressBar: {
|
|
216
|
-
"& .progress-bar": {
|
|
217
|
-
height: "20px",
|
|
218
|
-
marginTop: "var(--sl-spacing-large)",
|
|
219
|
-
marginRight: "var(--sl-spacing-x-small)",
|
|
220
|
-
marginBottom: "var(--sl-spacing-large)",
|
|
221
|
-
fontSize: "var(--sl-font-size-x-small)",
|
|
222
|
-
display: "grid",
|
|
223
|
-
gridTemplateColumns: columns,
|
|
224
|
-
lineHeight: "45px",
|
|
225
|
-
userSelect: "none",
|
|
226
|
-
},
|
|
227
|
-
"& .progress-bar.repeatable-steps": {
|
|
228
|
-
marginLeft: "var(--sl-spacing-x-small)",
|
|
229
|
-
},
|
|
230
|
-
"& .filled:after": {
|
|
231
|
-
content: '""',
|
|
232
|
-
display: "flex",
|
|
233
|
-
width: "100%",
|
|
234
|
-
height: "4px",
|
|
235
|
-
borderRadius: "4px",
|
|
236
|
-
backgroundColor: "var(--sl-color-primary-500)",
|
|
237
|
-
},
|
|
238
|
-
"& .progress": {
|
|
239
|
-
display: "block",
|
|
240
|
-
textAlign: "center",
|
|
241
|
-
marginLeft: "-100px",
|
|
242
|
-
marginRight: "-100px",
|
|
243
|
-
},
|
|
244
|
-
"& .progress::after": {
|
|
245
|
-
content: '""',
|
|
246
|
-
width: "12px",
|
|
247
|
-
height: "12px",
|
|
248
|
-
display: "flex",
|
|
249
|
-
backgroundColor: "var(--sl-color-primary-500)",
|
|
250
|
-
borderRadius: "50%",
|
|
251
|
-
position: "relative",
|
|
252
|
-
left: "47%",
|
|
253
|
-
top: "-85%",
|
|
254
|
-
},
|
|
255
|
-
"& .progress.bg:after": {
|
|
256
|
-
width: "0",
|
|
257
|
-
height: "0",
|
|
258
|
-
border: "none",
|
|
259
|
-
},
|
|
260
|
-
"& .empty": {
|
|
261
|
-
display: "block",
|
|
262
|
-
textAlign: "center",
|
|
263
|
-
marginLeft: "-100px",
|
|
264
|
-
marginRight: "-100px",
|
|
265
|
-
},
|
|
266
|
-
"& .empty::after": {
|
|
267
|
-
content: '""',
|
|
268
|
-
width: "12px",
|
|
269
|
-
height: "12px",
|
|
270
|
-
border: "2px solid #E0E0E0",
|
|
271
|
-
margin: "-2px",
|
|
272
|
-
display: "flex",
|
|
273
|
-
backgroundColor: "white",
|
|
274
|
-
borderRadius: "50%",
|
|
275
|
-
position: "relative",
|
|
276
|
-
left: "47%",
|
|
277
|
-
top: "-85%",
|
|
278
|
-
},
|
|
279
|
-
"& .empty.bg:after": {
|
|
280
|
-
width: "0",
|
|
281
|
-
height: "0",
|
|
282
|
-
border: "none",
|
|
283
|
-
},
|
|
284
|
-
"& .remain:after": {
|
|
285
|
-
content: '""',
|
|
286
|
-
display: "flex",
|
|
287
|
-
width: "100%",
|
|
288
|
-
height: "4px",
|
|
289
|
-
borderRadius: "4px",
|
|
290
|
-
backgroundColor: "#E0E0E0",
|
|
291
|
-
},
|
|
292
|
-
"& .end.bw": {
|
|
293
|
-
filter: "grayscale(100%)",
|
|
294
|
-
},
|
|
295
|
-
"& .end.start": {
|
|
296
|
-
transform: "scale(80%)",
|
|
297
|
-
top: "-20px",
|
|
298
|
-
},
|
|
299
|
-
"& .end": {
|
|
300
|
-
textAlign: "center",
|
|
301
|
-
marginLeft: "-100px",
|
|
302
|
-
marginRight: "-100px",
|
|
303
|
-
position: "relative",
|
|
304
|
-
display: "list-item",
|
|
305
|
-
listStyleType: "none",
|
|
306
|
-
top: "-18px",
|
|
307
|
-
filter: goal <= progress ? "" : "grayscale(100%)",
|
|
308
|
-
zIndex: "1",
|
|
309
|
-
},
|
|
310
|
-
},
|
|
311
|
-
};
|
|
312
|
-
jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
|
|
313
|
-
const sheet = jssPresetDefault_esm.jss.createStyleSheet(style);
|
|
314
|
-
const styleString = sheet.toString();
|
|
315
|
-
return (index.h("div", { class: sheet.classes.ProgressBar },
|
|
316
|
-
index.h("style", { type: "text/css" }, styleString),
|
|
317
|
-
index.h("div", { class: repetitions > 1 ? "progress-bar repeatable-steps" : "progress-bar" }, items)));
|
|
318
|
-
function addLinear() {
|
|
319
|
-
columns =
|
|
320
|
-
Math.min(Math.max(progress / goal, 0), 1) +
|
|
321
|
-
"fr 0fr " +
|
|
322
|
-
Math.min(Math.max(1 - progress / goal, 0), 1) +
|
|
323
|
-
"fr 0fr";
|
|
324
|
-
items.push(index.h("div", { class: "filled" }));
|
|
325
|
-
items.push(index.h("div", { class: progress == goal ? "progress bg" : "progress" }, unit + progress));
|
|
326
|
-
items.push(index.h("div", { class: "remain" }));
|
|
327
|
-
items.push(index.h("div", { class: "end" }, gift1));
|
|
328
|
-
}
|
|
329
|
-
function addSteps() {
|
|
330
|
-
let step_math = steps / goal;
|
|
331
|
-
for (let i = 1; i < goal; i += steps) {
|
|
332
|
-
columns += step_math + "fr 0fr ";
|
|
333
|
-
if (i > progress) {
|
|
334
|
-
items.push(index.h("div", { class: "remain" }));
|
|
335
|
-
items.push(index.h("div", { class: "empty" }, unit + i));
|
|
336
|
-
}
|
|
337
|
-
else {
|
|
338
|
-
items.push(index.h("div", { class: "filled" }));
|
|
339
|
-
items.push(index.h("div", { class: "progress" }, unit + i));
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
columns += step_math + "fr 0fr ";
|
|
343
|
-
// reward success
|
|
344
|
-
if (goal <= progress) {
|
|
345
|
-
columns += "0fr ";
|
|
346
|
-
items.push(index.h("div", { class: "filled" }));
|
|
347
|
-
items.push(index.h("div", { class: "progress bg" }, unit + goal));
|
|
348
|
-
items.push(index.h("div", { class: "end" }, gift1));
|
|
349
|
-
}
|
|
350
|
-
// reward fail
|
|
351
|
-
else {
|
|
352
|
-
columns += "0fr ";
|
|
353
|
-
items.push(index.h("div", { class: "remain" }));
|
|
354
|
-
items.push(index.h("div", { class: "empty bg" }, unit + goal));
|
|
355
|
-
items.push(index.h("div", { class: "end" }, gift1));
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
function addLinearRepeatable() {
|
|
359
|
-
let position = progress % goal;
|
|
360
|
-
let remainder = (position / goal) * 0.5;
|
|
361
|
-
let repetitions = Math.floor(progress / goal);
|
|
362
|
-
// 0 repetition
|
|
363
|
-
if (repetitions == 0) {
|
|
364
|
-
columns = remainder + "fr 0fr " + (0.5 - remainder) + "fr 0fr 0.5fr 0fr";
|
|
365
|
-
items.push(index.h("div", { class: "filled" }));
|
|
366
|
-
items.push(index.h("div", { class: progress == goal ? "progress bg" : "progress" }, unit + progress));
|
|
367
|
-
items.push(index.h("div", { class: "remain" }));
|
|
368
|
-
items.push(index.h("div", { class: "end" }, gift1));
|
|
369
|
-
items.push(index.h("div", { class: "remain" }));
|
|
370
|
-
items.push(index.h("div", { class: "end bw" }, gift2));
|
|
371
|
-
}
|
|
372
|
-
// single repetition
|
|
373
|
-
else if (repetitions == 1) {
|
|
374
|
-
columns =
|
|
375
|
-
"0.5fr 0fr " + remainder + "fr 0fr " + (0.5 - remainder) + "fr 0fr";
|
|
376
|
-
items.push(index.h("div", { class: "filled" }));
|
|
377
|
-
items.push(index.h("div", { class: "end" }, gift1));
|
|
378
|
-
items.push(index.h("div", { class: "filled" }));
|
|
379
|
-
items.push(index.h("div", { class: progress == goal ? "progress bg" : "progress" }, unit + progress));
|
|
380
|
-
items.push(index.h("div", { class: "remain" }));
|
|
381
|
-
items.push(index.h("div", { class: "end bw" }, gift2));
|
|
382
|
-
}
|
|
383
|
-
// multiple repetitions
|
|
384
|
-
else {
|
|
385
|
-
columns =
|
|
386
|
-
"0fr 0.5fr 0fr " + remainder + "fr 0fr " + (0.5 - remainder) + "fr 0fr";
|
|
387
|
-
items.push(index.h("div", { class: "end start" }, gift1));
|
|
388
|
-
items.push(index.h("div", { class: "filled" }));
|
|
389
|
-
items.push(index.h("div", { class: "end" }, gift2));
|
|
390
|
-
items.push(index.h("div", { class: "filled" }));
|
|
391
|
-
items.push(index.h("div", { class: progress == goal * repetitions ? "progress bg" : "progress" }, unit + progress));
|
|
392
|
-
items.push(index.h("div", { class: "remain" }));
|
|
393
|
-
items.push(index.h("div", { class: "end bw" }, gift3));
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
function addStepsRepeatable() {
|
|
397
|
-
let repetitions = Math.floor(progress / goal);
|
|
398
|
-
// no or single repetition
|
|
399
|
-
if (repetitions < 2) {
|
|
400
|
-
let step_math = steps / goal;
|
|
401
|
-
for (let i = 1; i < goal * 2 + 1; i += steps) {
|
|
402
|
-
columns += step_math + "fr 0fr ";
|
|
403
|
-
if (i > progress) {
|
|
404
|
-
if (i == goal) {
|
|
405
|
-
columns += "0fr ";
|
|
406
|
-
items.push(index.h("div", { class: "remain" }));
|
|
407
|
-
items.push(index.h("div", { class: "empty bg" }, unit + goal));
|
|
408
|
-
items.push(index.h("div", { class: "end bw" }, gift1));
|
|
409
|
-
}
|
|
410
|
-
else if (i == goal * 2) {
|
|
411
|
-
columns += "0fr 0fr";
|
|
412
|
-
items.push(index.h("div", { class: "remain" }));
|
|
413
|
-
items.push(index.h("div", { class: "empty bg" }, unit + (goal * 2)));
|
|
414
|
-
items.push(index.h("div", { class: "end bw" }, gift2));
|
|
415
|
-
}
|
|
416
|
-
else {
|
|
417
|
-
items.push(index.h("div", { class: "remain" }));
|
|
418
|
-
items.push(index.h("div", { class: "empty" }, unit + i));
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
else if (i == goal) {
|
|
422
|
-
columns += "0fr ";
|
|
423
|
-
items.push(index.h("div", { class: "filled" }));
|
|
424
|
-
items.push(index.h("div", { class: "progress bg" }, unit + i));
|
|
425
|
-
items.push(index.h("div", { class: "end" }, gift3));
|
|
426
|
-
}
|
|
427
|
-
else {
|
|
428
|
-
items.push(index.h("div", { class: "filled" }));
|
|
429
|
-
items.push(index.h("div", { class: "progress" }, unit + i));
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
// case repetition many
|
|
434
|
-
else {
|
|
435
|
-
let position = (progress % goal) + goal;
|
|
436
|
-
let step_math = steps / goal;
|
|
437
|
-
columns += "0fr 0fr ";
|
|
438
|
-
items.push(index.h("div", { class: "progress bg" }, unit + goal * (repetitions - 1)));
|
|
439
|
-
items.push(index.h("div", { class: "end start" }, gift1));
|
|
440
|
-
for (let i = 1; i < goal * 2 + 1; i += steps) {
|
|
441
|
-
columns += step_math + "fr 0fr ";
|
|
442
|
-
if (i <= goal) {
|
|
443
|
-
if (i == goal) {
|
|
444
|
-
columns += "0fr ";
|
|
445
|
-
items.push(index.h("div", { class: "filled" }));
|
|
446
|
-
items.push(index.h("div", { class: "progress bg" }, unit + (i + goal * (repetitions - 1))));
|
|
447
|
-
items.push(index.h("div", { class: "end" }, gift2));
|
|
448
|
-
}
|
|
449
|
-
else {
|
|
450
|
-
items.push(index.h("div", { class: "filled" }));
|
|
451
|
-
items.push(index.h("div", { class: "progress" }, unit + (i + goal * (repetitions - 1))));
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
else if (i > position) {
|
|
455
|
-
if (i == goal * 2) {
|
|
456
|
-
columns += "0fr 0fr";
|
|
457
|
-
items.push(index.h("div", { class: "remain" }));
|
|
458
|
-
items.push(index.h("div", { class: "empty bg" }, unit + (i + goal * (repetitions - 1))));
|
|
459
|
-
items.push(index.h("div", { class: "end bw" }, gift3));
|
|
460
|
-
}
|
|
461
|
-
else {
|
|
462
|
-
items.push(index.h("div", { class: "remain" }));
|
|
463
|
-
items.push(index.h("div", { class: "empty" }, unit + (i + goal * (repetitions - 1))));
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
else {
|
|
467
|
-
items.push(index.h("div", { class: "filled" }));
|
|
468
|
-
items.push(index.h("div", { class: "progress" }, unit + (i + goal * (repetitions - 1))));
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
exports.TaskCardView = TaskCardView;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-b0129cd6.js');
|
|
6
|
-
const _extends = require('./extends-0302d27d.js');
|
|
7
|
-
require('./jss-preset-default.esm-6304d24f.js');
|
|
8
|
-
const utils = require('./utils-95e5317c.js');
|
|
9
|
-
require('./mixins-7b7c59fe.js');
|
|
10
|
-
const sqmTaskCardView = require('./sqm-task-card-view-791797ac.js');
|
|
11
|
-
|
|
12
|
-
const TaskCard = class {
|
|
13
|
-
constructor(hostRef) {
|
|
14
|
-
index.registerInstance(this, hostRef);
|
|
15
|
-
this.ignored = true;
|
|
16
|
-
/**
|
|
17
|
-
* @uiName Reward Points
|
|
18
|
-
*/
|
|
19
|
-
this.points = 0;
|
|
20
|
-
/**
|
|
21
|
-
* @uiName Title Text
|
|
22
|
-
*/
|
|
23
|
-
this.cardTitle = "Title Text";
|
|
24
|
-
/**
|
|
25
|
-
* @uiName Description Text
|
|
26
|
-
*/
|
|
27
|
-
this.description = "Description Text";
|
|
28
|
-
/**
|
|
29
|
-
* @uiName Set Repeatable
|
|
30
|
-
*/
|
|
31
|
-
this.repeatable = false;
|
|
32
|
-
/**
|
|
33
|
-
* @uiName Show Progress Bar
|
|
34
|
-
*/
|
|
35
|
-
this.showProgressBar = false;
|
|
36
|
-
/**
|
|
37
|
-
* @uiName Progress Bar Goal
|
|
38
|
-
*/
|
|
39
|
-
this.goal = 1;
|
|
40
|
-
/**
|
|
41
|
-
* @uiName Show Expiry
|
|
42
|
-
*/
|
|
43
|
-
this.expire = false;
|
|
44
|
-
_extends.h$1(this);
|
|
45
|
-
}
|
|
46
|
-
disconnectedCallback() { }
|
|
47
|
-
render() {
|
|
48
|
-
//const progress = useTaskCard(); progress={progress}
|
|
49
|
-
return index.h(sqmTaskCardView.TaskCardView, Object.assign({}, utils.getProps(this)));
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
exports.sqm_task_card = TaskCard;
|
|
File without changes
|