le-kit 0.1.5 → 0.1.6
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-WzJ78D5H.js +1803 -0
- package/dist/cjs/index-WzJ78D5H.js.map +1 -0
- package/dist/cjs/index.cjs.js +117 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/le-box.cjs.entry.js +184 -0
- package/dist/cjs/le-box.entry.cjs.js.map +1 -0
- package/dist/cjs/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.cjs.js.map +1 -0
- package/dist/cjs/le-button_6.cjs.entry.js +1202 -0
- package/dist/cjs/le-card.cjs.entry.js +29 -0
- package/dist/cjs/le-card.entry.cjs.js.map +1 -0
- package/dist/cjs/le-kit.cjs.js +25 -0
- package/dist/cjs/le-kit.cjs.js.map +1 -0
- package/dist/cjs/le-number-input.cjs.entry.js +202 -0
- package/dist/cjs/le-number-input.entry.cjs.js.map +1 -0
- package/dist/cjs/le-popup.cjs.entry.js +212 -0
- package/dist/cjs/le-popup.entry.cjs.js.map +1 -0
- package/dist/cjs/le-round-progress.cjs.entry.js +106 -0
- package/dist/cjs/le-round-progress.entry.cjs.js.map +1 -0
- package/dist/cjs/le-stack.cjs.entry.js +135 -0
- package/dist/cjs/le-stack.entry.cjs.js.map +1 -0
- package/dist/cjs/le-text.cjs.entry.js +335 -0
- package/dist/cjs/le-text.entry.cjs.js.map +1 -0
- package/dist/cjs/le-turntable.cjs.entry.js +139 -0
- package/dist/cjs/le-turntable.entry.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/utils-CBjH2E8A.js +152 -0
- package/dist/cjs/utils-CBjH2E8A.js.map +1 -0
- package/dist/collection/assets/.gitkeep +1 -0
- package/dist/collection/assets/custom-elements.json +4305 -0
- package/dist/collection/collection-manifest.json +26 -0
- package/dist/collection/components/le-box/le-box.default.css +37 -0
- package/dist/collection/components/le-box/le-box.js +614 -0
- package/dist/collection/components/le-box/le-box.js.map +1 -0
- package/dist/collection/components/le-button/le-button.default.css +263 -0
- package/dist/collection/components/le-button/le-button.js +368 -0
- package/dist/collection/components/le-button/le-button.js.map +1 -0
- package/dist/collection/components/le-card/le-card.default.css +74 -0
- package/dist/collection/components/le-card/le-card.js +102 -0
- package/dist/collection/components/le-card/le-card.js.map +1 -0
- package/dist/collection/components/le-checkbox/le-checkbox.css +93 -0
- package/dist/collection/components/le-checkbox/le-checkbox.js +192 -0
- package/dist/collection/components/le-checkbox/le-checkbox.js.map +1 -0
- package/dist/collection/components/le-component/le-component.css +189 -0
- package/dist/{le-kit/le-component.entry.js → collection/components/le-component/le-component.js} +137 -20
- package/dist/collection/components/le-component/le-component.js.map +1 -0
- package/dist/collection/components/le-number-input/le-number-input.css +135 -0
- package/dist/collection/components/le-number-input/le-number-input.js +515 -0
- package/dist/collection/components/le-number-input/le-number-input.js.map +1 -0
- package/dist/collection/components/le-popover/le-popover.css +143 -0
- package/dist/collection/components/le-popover/le-popover.js +693 -0
- package/dist/collection/components/le-popover/le-popover.js.map +1 -0
- package/dist/collection/components/le-popup/le-popup.api.js +101 -0
- package/dist/collection/components/le-popup/le-popup.api.js.map +1 -0
- package/dist/collection/components/le-popup/le-popup.css +222 -0
- package/dist/collection/components/le-popup/le-popup.js +596 -0
- package/dist/collection/components/le-popup/le-popup.js.map +1 -0
- package/dist/collection/components/le-round-progress/le-round-progress.css +34 -0
- package/dist/collection/components/le-round-progress/le-round-progress.js +184 -0
- package/dist/collection/components/le-round-progress/le-round-progress.js.map +1 -0
- package/dist/collection/components/le-slot/le-slot.default.css +222 -0
- package/dist/{le-kit/le-slot.entry.js → collection/components/le-slot/le-slot.js} +266 -16
- package/dist/collection/components/le-slot/le-slot.js.map +1 -0
- package/dist/collection/components/le-stack/le-stack.default.css +37 -0
- package/dist/collection/components/le-stack/le-stack.js +389 -0
- package/dist/collection/components/le-stack/le-stack.js.map +1 -0
- package/dist/collection/components/le-string-input/le-string-input.css +83 -0
- package/dist/collection/components/le-string-input/le-string-input.js +359 -0
- package/dist/collection/components/le-string-input/le-string-input.js.map +1 -0
- package/dist/collection/components/le-text/le-text.default.css +169 -0
- package/dist/collection/components/le-text/le-text.js +475 -0
- package/dist/collection/components/le-text/le-text.js.map +1 -0
- package/dist/collection/components/le-turntable/le-turntable.css +10 -0
- package/dist/collection/components/le-turntable/le-turntable.js +210 -0
- package/dist/collection/components/le-turntable/le-turntable.js.map +1 -0
- package/dist/collection/global/app.js +130 -0
- package/dist/collection/global/app.js.map +1 -0
- package/dist/collection/index.js +15 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/types/blocks.js +115 -0
- package/dist/collection/types/blocks.js.map +1 -0
- package/dist/collection/types/options.js +2 -0
- package/dist/collection/types/options.js.map +1 -0
- package/dist/collection/utils/utils.js +141 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/index.js +127 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/le-box.js +256 -0
- package/dist/components/le-box.js.map +1 -0
- package/dist/components/le-button.js +9 -0
- package/dist/components/le-button.js.map +1 -0
- package/dist/components/le-button2.js +1411 -0
- package/dist/components/le-button2.js.map +1 -0
- package/dist/components/le-card.js +83 -0
- package/dist/components/le-card.js.map +1 -0
- package/dist/components/le-checkbox.js +9 -0
- package/dist/components/le-checkbox.js.map +1 -0
- package/dist/components/le-component.js +9 -0
- package/dist/components/le-component.js.map +1 -0
- package/dist/components/le-number-input.js +271 -0
- package/dist/components/le-number-input.js.map +1 -0
- package/dist/components/le-popover.js +9 -0
- package/dist/components/le-popover.js.map +1 -0
- package/dist/{le-kit/le-popover.entry.js → components/le-popover2.js} +45 -9
- package/dist/components/le-popover2.js.map +1 -0
- package/dist/components/le-popup.js +279 -0
- package/dist/components/le-popup.js.map +1 -0
- package/dist/components/le-round-progress.js +135 -0
- package/dist/components/le-round-progress.js.map +1 -0
- package/dist/components/le-slot.js +9 -0
- package/dist/components/le-slot.js.map +1 -0
- package/dist/components/le-stack.js +198 -0
- package/dist/components/le-stack.js.map +1 -0
- package/dist/components/le-string-input.js +9 -0
- package/dist/components/le-string-input.js.map +1 -0
- package/dist/components/le-text.js +398 -0
- package/dist/components/le-text.js.map +1 -0
- package/dist/components/le-turntable.js +164 -0
- package/dist/components/le-turntable.js.map +1 -0
- package/dist/docs.d.ts +443 -0
- package/dist/docs.json +5185 -0
- package/dist/esm/index-CdjJ98OT.js +1787 -0
- package/dist/esm/index-CdjJ98OT.js.map +1 -0
- package/dist/esm/index.js +106 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/{le-kit → esm}/le-box.entry.js +3 -3
- package/dist/esm/le-box.entry.js.map +1 -0
- package/dist/esm/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.js.map +1 -0
- package/dist/esm/le-button_6.entry.js +1195 -0
- package/dist/{le-kit → esm}/le-card.entry.js +3 -3
- package/dist/esm/le-card.entry.js.map +1 -0
- package/dist/esm/le-kit.js +21 -0
- package/dist/esm/le-kit.js.map +1 -0
- package/dist/{le-kit → esm}/le-number-input.entry.js +5 -5
- package/dist/esm/le-number-input.entry.js.map +1 -0
- package/dist/{le-kit → esm}/le-popup.entry.js +6 -6
- package/dist/esm/le-popup.entry.js.map +1 -0
- package/dist/{le-kit → esm}/le-round-progress.entry.js +2 -2
- package/dist/esm/le-round-progress.entry.js.map +1 -0
- package/dist/{le-kit → esm}/le-stack.entry.js +3 -3
- package/dist/esm/le-stack.entry.js.map +1 -0
- package/dist/{le-kit → esm}/le-text.entry.js +3 -3
- package/dist/esm/le-text.entry.js.map +1 -0
- package/dist/{le-kit → esm}/le-turntable.entry.js +2 -2
- package/dist/esm/le-turntable.entry.js.map +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/{le-kit/utils-FDOApZ53.js → esm/utils-CzfSUhYB.js} +3 -3
- package/dist/{le-kit/utils-FDOApZ53.js.map → esm/utils-CzfSUhYB.js.map} +1 -1
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/le-kit/index.esm.js +2 -116
- package/dist/le-kit/index.esm.js.map +1 -1
- package/dist/le-kit/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.esm.js.map +1 -0
- package/dist/le-kit/le-kit.css +1 -1010
- package/dist/le-kit/le-kit.esm.js +2 -48
- package/dist/le-kit/le-kit.esm.js.map +1 -1
- package/dist/le-kit/p-0633b3ab.entry.js +2 -0
- package/dist/le-kit/p-0633b3ab.entry.js.map +1 -0
- package/dist/le-kit/p-1452a995.entry.js +2 -0
- package/dist/le-kit/p-1452a995.entry.js.map +1 -0
- package/dist/le-kit/p-220528ee.entry.js +2 -0
- package/dist/le-kit/p-220528ee.entry.js.map +1 -0
- package/dist/le-kit/p-32ff3dbe.entry.js +2 -0
- package/dist/le-kit/p-32ff3dbe.entry.js.map +1 -0
- package/dist/le-kit/p-3551598e.entry.js +2 -0
- package/dist/le-kit/p-3551598e.entry.js.map +1 -0
- package/dist/le-kit/p-722899f0.entry.js +2 -0
- package/dist/le-kit/p-722899f0.entry.js.map +1 -0
- package/dist/le-kit/p-95764888.entry.js +2 -0
- package/dist/le-kit/p-95764888.entry.js.map +1 -0
- package/dist/le-kit/p-CdjJ98OT.js +3 -0
- package/dist/le-kit/p-CdjJ98OT.js.map +1 -0
- package/dist/le-kit/p-CvDc0yWN.js +2 -0
- package/dist/le-kit/p-CvDc0yWN.js.map +1 -0
- package/dist/le-kit/p-bc20e30d.entry.js +2 -0
- package/dist/le-kit/p-bc20e30d.entry.js.map +1 -0
- package/dist/le-kit/p-d32eddad.entry.js +2 -0
- package/dist/le-kit/p-d32eddad.entry.js.map +1 -0
- package/dist/themes/base.css +89 -0
- package/dist/themes/dark.css +100 -0
- package/dist/themes/default.css +108 -0
- package/dist/themes/gradient.css +100 -0
- package/dist/themes/index.css +413 -0
- package/dist/themes/minimal.css +100 -0
- package/dist/themes/warm.css +100 -0
- package/dist/types/components.d.ts +4 -4
- package/package.json +1 -1
- package/dist/le-kit/index-Da-89pOc.js +0 -4522
- package/dist/le-kit/index-Da-89pOc.js.map +0 -1
- package/dist/le-kit/le-button.entry.esm.js.map +0 -1
- package/dist/le-kit/le-button.entry.js +0 -90
- package/dist/le-kit/le-checkbox.entry.esm.js.map +0 -1
- package/dist/le-kit/le-checkbox.entry.js +0 -59
- package/dist/le-kit/le-component.entry.esm.js.map +0 -1
- package/dist/le-kit/le-popover.entry.esm.js.map +0 -1
- package/dist/le-kit/le-slot.entry.esm.js.map +0 -1
- package/dist/le-kit/le-string-input.entry.esm.js.map +0 -1
- package/dist/le-kit/le-string-input.entry.js +0 -93
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class LeRoundProgress {
|
|
3
|
+
// host element
|
|
4
|
+
el;
|
|
5
|
+
// progress value coming from an attribute
|
|
6
|
+
value = 0;
|
|
7
|
+
updateValue(newValue) {
|
|
8
|
+
this.value = parseFloat(newValue);
|
|
9
|
+
}
|
|
10
|
+
// padding value coming from an attribute
|
|
11
|
+
padding = 0;
|
|
12
|
+
updatePadding(newValue) {
|
|
13
|
+
this.padding = parseFloat(newValue);
|
|
14
|
+
this.calcParams();
|
|
15
|
+
}
|
|
16
|
+
// the progress backgrounds can be as many as needed
|
|
17
|
+
// but it should be JSON format: double quotes and strict commas
|
|
18
|
+
paths;
|
|
19
|
+
updateProgressBackgrounds(newValue) {
|
|
20
|
+
this.progressPaths = JSON.parse(newValue);
|
|
21
|
+
}
|
|
22
|
+
progressPaths;
|
|
23
|
+
params;
|
|
24
|
+
/**
|
|
25
|
+
* Component lifecycles
|
|
26
|
+
*
|
|
27
|
+
* Before the component is loaded, we need to calculate and update params
|
|
28
|
+
* using the component size (width of the round progress)
|
|
29
|
+
* and progress width (max of )
|
|
30
|
+
*/
|
|
31
|
+
componentWillLoad() {
|
|
32
|
+
if (typeof this.paths === 'string') {
|
|
33
|
+
this.updateProgressBackgrounds(this.paths);
|
|
34
|
+
}
|
|
35
|
+
this.calcParams();
|
|
36
|
+
}
|
|
37
|
+
calcParams() {
|
|
38
|
+
// get element width
|
|
39
|
+
const width = this.el.getBoundingClientRect().width;
|
|
40
|
+
const diameter = width - this.padding;
|
|
41
|
+
// calc circumference — we'll need it later to calc the stroke paths
|
|
42
|
+
const circumference = Math.PI * diameter;
|
|
43
|
+
this.params = { width, diameter, circumference };
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns the viewPath attribute value for the SVG
|
|
47
|
+
* based on the width of the parent element
|
|
48
|
+
*/
|
|
49
|
+
getViewBox() {
|
|
50
|
+
return '0 0 ' + this.params.width + ' ' + this.params.width;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Returns the circular path for the progress stroke
|
|
54
|
+
* and additional paths in the background
|
|
55
|
+
*/
|
|
56
|
+
getPath() {
|
|
57
|
+
return ('M' +
|
|
58
|
+
this.params.width / 2 +
|
|
59
|
+
' ' +
|
|
60
|
+
(this.params.width - this.params.diameter) / 2 +
|
|
61
|
+
' a ' +
|
|
62
|
+
this.params.diameter / 2 +
|
|
63
|
+
' ' +
|
|
64
|
+
this.params.diameter / 2 +
|
|
65
|
+
' 0 0 1 0 ' +
|
|
66
|
+
this.params.diameter +
|
|
67
|
+
' a ' +
|
|
68
|
+
this.params.diameter / 2 +
|
|
69
|
+
' ' +
|
|
70
|
+
this.params.diameter / 2 +
|
|
71
|
+
' 0 0 1 0 -' +
|
|
72
|
+
this.params.diameter);
|
|
73
|
+
}
|
|
74
|
+
getStrokeDashArray() {
|
|
75
|
+
return (this.value / 100) * this.params.circumference + ', ' + this.params.circumference;
|
|
76
|
+
}
|
|
77
|
+
getPaths() {
|
|
78
|
+
if (!this.progressPaths || !this.progressPaths.length) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
let paths = [];
|
|
82
|
+
this.progressPaths.forEach(bg => {
|
|
83
|
+
paths.push(h("path", { class: "round-progress--path", d: this.getPath(), stroke: bg.color, "stroke-width": bg.width, "stroke-dasharray": bg.dasharray, "stroke-linecap": bg.linecap }));
|
|
84
|
+
});
|
|
85
|
+
return (h("svg", { viewBox: this.getViewBox(), class: "round-progress" }, paths));
|
|
86
|
+
}
|
|
87
|
+
render() {
|
|
88
|
+
return (h("div", { key: '1ffc36704bee5d0822623ac4559ad2d4690095a4', class: "round-progress--container" }, this.getPaths(), h("svg", { key: '12e4dfe5fe2df0cb672d4c001459b8dcc8253591', viewBox: this.getViewBox(), class: "round-progress round-progress--progress" }, h("path", { key: 'd8ce69610687fb578ce2104bd3eccba24951dd96', class: "round-progress--circle", "stroke-dasharray": this.getStrokeDashArray(), d: this.getPath() })), h("slot", { key: '3976b08a7e838579d6af34a778a8756255d98e57' })));
|
|
89
|
+
}
|
|
90
|
+
static get is() { return "le-round-progress"; }
|
|
91
|
+
static get encapsulation() { return "shadow"; }
|
|
92
|
+
static get originalStyleUrls() {
|
|
93
|
+
return {
|
|
94
|
+
"$": ["le-round-progress.css"]
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
static get styleUrls() {
|
|
98
|
+
return {
|
|
99
|
+
"$": ["le-round-progress.css"]
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
static get properties() {
|
|
103
|
+
return {
|
|
104
|
+
"value": {
|
|
105
|
+
"type": "number",
|
|
106
|
+
"mutable": false,
|
|
107
|
+
"complexType": {
|
|
108
|
+
"original": "number",
|
|
109
|
+
"resolved": "number",
|
|
110
|
+
"references": {}
|
|
111
|
+
},
|
|
112
|
+
"required": false,
|
|
113
|
+
"optional": false,
|
|
114
|
+
"docs": {
|
|
115
|
+
"tags": [],
|
|
116
|
+
"text": ""
|
|
117
|
+
},
|
|
118
|
+
"getter": false,
|
|
119
|
+
"setter": false,
|
|
120
|
+
"reflect": false,
|
|
121
|
+
"attribute": "value",
|
|
122
|
+
"defaultValue": "0"
|
|
123
|
+
},
|
|
124
|
+
"padding": {
|
|
125
|
+
"type": "number",
|
|
126
|
+
"mutable": false,
|
|
127
|
+
"complexType": {
|
|
128
|
+
"original": "number",
|
|
129
|
+
"resolved": "number",
|
|
130
|
+
"references": {}
|
|
131
|
+
},
|
|
132
|
+
"required": false,
|
|
133
|
+
"optional": false,
|
|
134
|
+
"docs": {
|
|
135
|
+
"tags": [],
|
|
136
|
+
"text": ""
|
|
137
|
+
},
|
|
138
|
+
"getter": false,
|
|
139
|
+
"setter": false,
|
|
140
|
+
"reflect": false,
|
|
141
|
+
"attribute": "padding",
|
|
142
|
+
"defaultValue": "0"
|
|
143
|
+
},
|
|
144
|
+
"paths": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"mutable": false,
|
|
147
|
+
"complexType": {
|
|
148
|
+
"original": "string",
|
|
149
|
+
"resolved": "string",
|
|
150
|
+
"references": {}
|
|
151
|
+
},
|
|
152
|
+
"required": false,
|
|
153
|
+
"optional": false,
|
|
154
|
+
"docs": {
|
|
155
|
+
"tags": [],
|
|
156
|
+
"text": ""
|
|
157
|
+
},
|
|
158
|
+
"getter": false,
|
|
159
|
+
"setter": false,
|
|
160
|
+
"reflect": false,
|
|
161
|
+
"attribute": "paths"
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
static get states() {
|
|
166
|
+
return {
|
|
167
|
+
"params": {}
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
static get elementRef() { return "el"; }
|
|
171
|
+
static get watchers() {
|
|
172
|
+
return [{
|
|
173
|
+
"propName": "value",
|
|
174
|
+
"methodName": "updateValue"
|
|
175
|
+
}, {
|
|
176
|
+
"propName": "padding",
|
|
177
|
+
"methodName": "updatePadding"
|
|
178
|
+
}, {
|
|
179
|
+
"propName": "paths",
|
|
180
|
+
"methodName": "updateProgressBackgrounds"
|
|
181
|
+
}];
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=le-round-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"le-round-progress.js","sourceRoot":"","sources":["../../../src/components/le-round-progress/le-round-progress.tsx"],"names":[],"mappings":"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","sourcesContent":["import { Component, Element, h, Prop, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'le-round-progress',\n styleUrl: 'le-round-progress.css',\n shadow: true,\n})\nexport class LeRoundProgress {\n // host element\n @Element() el: HTMLElement;\n\n // progress value coming from an attribute\n @Prop() value: number = 0;\n @Watch('value')\n updateValue(newValue: string) {\n this.value = parseFloat(newValue);\n }\n\n // padding value coming from an attribute\n @Prop() padding: number = 0;\n @Watch('padding')\n updatePadding(newValue: string) {\n this.padding = parseFloat(newValue);\n this.calcParams();\n }\n\n // the progress backgrounds can be as many as needed\n // but it should be JSON format: double quotes and strict commas\n @Prop() paths: string;\n @Watch('paths')\n updateProgressBackgrounds(newValue: string) {\n this.progressPaths = JSON.parse(newValue);\n }\n progressPaths: any[];\n\n @State() params: {\n width: number;\n diameter: number;\n circumference: number;\n };\n\n /**\n * Component lifecycles\n *\n * Before the component is loaded, we need to calculate and update params\n * using the component size (width of the round progress)\n * and progress width (max of )\n */\n componentWillLoad() {\n if (typeof this.paths === 'string') {\n this.updateProgressBackgrounds(this.paths);\n }\n this.calcParams();\n }\n\n calcParams() {\n // get element width\n const width = this.el.getBoundingClientRect().width;\n const diameter = width - this.padding;\n // calc circumference — we'll need it later to calc the stroke paths\n const circumference = Math.PI * diameter;\n\n this.params = { width, diameter, circumference };\n }\n\n /**\n * Returns the viewPath attribute value for the SVG\n * based on the width of the parent element\n */\n getViewBox() {\n return '0 0 ' + this.params.width + ' ' + this.params.width;\n }\n\n /**\n * Returns the circular path for the progress stroke\n * and additional paths in the background\n */\n getPath() {\n return (\n 'M' +\n this.params.width / 2 +\n ' ' +\n (this.params.width - this.params.diameter) / 2 +\n ' a ' +\n this.params.diameter / 2 +\n ' ' +\n this.params.diameter / 2 +\n ' 0 0 1 0 ' +\n this.params.diameter +\n ' a ' +\n this.params.diameter / 2 +\n ' ' +\n this.params.diameter / 2 +\n ' 0 0 1 0 -' +\n this.params.diameter\n );\n }\n\n getStrokeDashArray() {\n return (this.value / 100) * this.params.circumference + ', ' + this.params.circumference;\n }\n\n getPaths() {\n if (!this.progressPaths || !this.progressPaths.length) {\n return null;\n }\n let paths = [];\n this.progressPaths.forEach(bg => {\n paths.push(<path class=\"round-progress--path\" d={this.getPath()} stroke={bg.color} stroke-width={bg.width} stroke-dasharray={bg.dasharray} stroke-linecap={bg.linecap} />);\n });\n return (\n <svg viewBox={this.getViewBox()} class=\"round-progress\">\n {paths}\n </svg>\n );\n }\n\n render() {\n return (\n <div class=\"round-progress--container\">\n {this.getPaths()}\n <svg viewBox={this.getViewBox()} class=\"round-progress round-progress--progress\">\n <path class=\"round-progress--circle\" stroke-dasharray={this.getStrokeDashArray()} d={this.getPath()} />\n </svg>\n <slot />\n </div>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Styles for le-slot component
|
|
3
|
+
* Uses :host(.admin-mode) to toggle between default and admin styles
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* ============================================
|
|
7
|
+
DEFAULT MODE - Invisible passthrough
|
|
8
|
+
============================================ */
|
|
9
|
+
:host {
|
|
10
|
+
display: contents;
|
|
11
|
+
--le-slot-border-color: #0088ff;
|
|
12
|
+
--le-slot-bg-color: rgba(0, 136, 255, 0.05);
|
|
13
|
+
--le-slot-header-bg: rgb(218, 238, 255);
|
|
14
|
+
--le-slot-label-color: #0066cc;
|
|
15
|
+
--le-slot-description-color: #666;
|
|
16
|
+
--le-slot-required-color: #e53935;
|
|
17
|
+
--le-slot-dropzone-min-height: 20px;
|
|
18
|
+
--le-slot-dropzone-border-color: #ccc;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.le-slot-container,
|
|
22
|
+
.le-slot-header,
|
|
23
|
+
.le-slot-description,
|
|
24
|
+
.le-slot-dropzone,
|
|
25
|
+
.le-slot-input {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Hidden slot wrapper - keeps slot in DOM but invisible */
|
|
30
|
+
.hidden-slot {
|
|
31
|
+
display: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* ============================================
|
|
35
|
+
ADMIN MODE - Visible placeholder UI
|
|
36
|
+
============================================ */
|
|
37
|
+
:host(.admin-mode) {
|
|
38
|
+
display: block;
|
|
39
|
+
flex: 1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host(.admin-mode) .le-slot-container {
|
|
43
|
+
position: relative;
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
border: 2px dashed var(--le-slot-border-color);
|
|
47
|
+
border-radius: 4px;
|
|
48
|
+
background: var(--le-slot-bg-color);
|
|
49
|
+
margin: 4px 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:host(.admin-mode) .le-slot-header {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: 4px;
|
|
56
|
+
padding: 0 0 0 var(--le-spacing-1, 4px);
|
|
57
|
+
background: var(--le-slot-header-bg);
|
|
58
|
+
border-bottom: 1px solid var(--le-slot-border-color);
|
|
59
|
+
font-size: var(--le-font-size-xs, 11px);
|
|
60
|
+
font-weight: 400;
|
|
61
|
+
text-transform: capitalize;
|
|
62
|
+
}
|
|
63
|
+
:host(.admin-mode) .le-slot-header-no-label {
|
|
64
|
+
justify-content: flex-end;
|
|
65
|
+
height: 16px;
|
|
66
|
+
border: none;
|
|
67
|
+
background-color: transparent;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.le-slot-label {
|
|
71
|
+
color: var(--le-slot-label-color);
|
|
72
|
+
text-align: start;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
width: 0;
|
|
75
|
+
flex: 1 1 0%;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.le-slot-required {
|
|
79
|
+
color: var(--le-slot-required-color);
|
|
80
|
+
font-weight: bold;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host(.admin-mode) .le-slot-description {
|
|
84
|
+
display: block;
|
|
85
|
+
padding: 4px 8px;
|
|
86
|
+
font-size: 12px;
|
|
87
|
+
color: var(--le-slot-description-color);
|
|
88
|
+
font-style: italic;
|
|
89
|
+
}
|
|
90
|
+
:host(.admin-mode) .le-slot-description-icon {
|
|
91
|
+
display: inline-block;
|
|
92
|
+
font-size: 9px;
|
|
93
|
+
line-height: 1;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
color: var(--le-slot-description-color);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:host(.admin-mode) .le-slot-dropzone {
|
|
99
|
+
display: block;
|
|
100
|
+
min-height: var(--le-slot-dropzone-min-height);
|
|
101
|
+
padding: var(--le-spacing-1, 4px);
|
|
102
|
+
position: relative;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host(.admin-mode) .le-slot-dropzone:empty::before {
|
|
106
|
+
content: 'Drop content here';
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
position: absolute;
|
|
111
|
+
inset: 8px;
|
|
112
|
+
border: 2px dashed var(--le-slot-dropzone-border-color);
|
|
113
|
+
border-radius: 4px;
|
|
114
|
+
color: #999;
|
|
115
|
+
font-size: 12px;
|
|
116
|
+
pointer-events: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Highlight when dragging over */
|
|
120
|
+
:host(.admin-mode.drag-over) .le-slot-container {
|
|
121
|
+
border-color: #00cc66;
|
|
122
|
+
background: rgba(0, 204, 102, 0.1);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:host(.admin-mode.drag-over) .le-slot-dropzone:empty::before {
|
|
126
|
+
border-color: #00cc66;
|
|
127
|
+
color: #00cc66;
|
|
128
|
+
content: 'Release to drop';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* ============================================
|
|
132
|
+
TEXT INPUT STYLES (Admin mode)
|
|
133
|
+
============================================ */
|
|
134
|
+
:host(.admin-mode) .le-slot-input {
|
|
135
|
+
display: block;
|
|
136
|
+
padding: var(--le-spacing-1, 4px);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:host(.admin-mode) .le-slot-input input,
|
|
140
|
+
:host(.admin-mode) .le-slot-input textarea {
|
|
141
|
+
display: block;
|
|
142
|
+
width: 100%;
|
|
143
|
+
padding: 8px 10px;
|
|
144
|
+
border: 1px solid var(--le-slot-dropzone-border-color);
|
|
145
|
+
border-radius: 4px;
|
|
146
|
+
font-family: inherit;
|
|
147
|
+
font-size: 14px;
|
|
148
|
+
line-height: 1.4;
|
|
149
|
+
background: #fff;
|
|
150
|
+
color: #333;
|
|
151
|
+
box-sizing: border-box;
|
|
152
|
+
transition: border-color 0.2s, box-shadow 0.2s;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
:host(.admin-mode) .le-slot-input input:focus,
|
|
156
|
+
:host(.admin-mode) .le-slot-input textarea:focus {
|
|
157
|
+
outline: none;
|
|
158
|
+
border-color: var(--le-slot-border-color);
|
|
159
|
+
box-shadow: 0 0 0 3px rgba(0, 136, 255, 0.15);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
:host(.admin-mode) .le-slot-input input::placeholder,
|
|
163
|
+
:host(.admin-mode) .le-slot-input textarea::placeholder {
|
|
164
|
+
color: #999;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:host(.admin-mode) .le-slot-input textarea {
|
|
168
|
+
resize: vertical;
|
|
169
|
+
min-height: 60px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* Hide the slot content in text/textarea mode - it's just for default value */
|
|
173
|
+
:host(.admin-mode) .le-slot-input slot {
|
|
174
|
+
display: none;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* ============================================
|
|
178
|
+
INVALID HTML STATE
|
|
179
|
+
============================================ */
|
|
180
|
+
.le-slot-invalid {
|
|
181
|
+
color: var(--le-slot-required-color);
|
|
182
|
+
font-size: 10px;
|
|
183
|
+
margin-left: auto;
|
|
184
|
+
font-weight: normal;
|
|
185
|
+
text-transform: none;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
:host(.admin-mode) .le-slot-input.has-error input,
|
|
189
|
+
:host(.admin-mode) .le-slot-input.has-error textarea {
|
|
190
|
+
border-color: var(--le-slot-required-color);
|
|
191
|
+
background: rgba(229, 57, 53, 0.05);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
:host(.admin-mode) .le-slot-input.has-error input:focus,
|
|
195
|
+
:host(.admin-mode) .le-slot-input.has-error textarea:focus {
|
|
196
|
+
border-color: var(--le-slot-required-color);
|
|
197
|
+
box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
/* ========================================
|
|
202
|
+
Component Picker (Add Button & Popover)
|
|
203
|
+
======================================== */
|
|
204
|
+
.le-slot-add-btn {
|
|
205
|
+
font-size: 24px;
|
|
206
|
+
line-height: 0px;
|
|
207
|
+
width: 12px;
|
|
208
|
+
height: 12px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.le-slot-header-no-label .le-slot-add-btn {
|
|
212
|
+
font-size: 16px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.le-slot-button {
|
|
216
|
+
width: 20px;
|
|
217
|
+
height: 20px;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:host(.admin-mode) .le-slot-header-no-label.le-slot-header-text {
|
|
221
|
+
height: 0;
|
|
222
|
+
}
|