canvasframework 0.5.44 → 0.5.46
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/components/Accordion.js +29 -41
- package/index.js +3 -2
- package/package.json +1 -1
package/components/Accordion.js
CHANGED
|
@@ -34,6 +34,18 @@ class Accordion extends Component {
|
|
|
34
34
|
|
|
35
35
|
this.calculateContentHeight();
|
|
36
36
|
this.height = this.headerHeight + (this.expanded ? this.contentHeight : 0);
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
this.onClick = () => {
|
|
40
|
+
if (this.animating) return;
|
|
41
|
+
|
|
42
|
+
// Ripple centré Material
|
|
43
|
+
if (this.platform === 'material') {
|
|
44
|
+
this.addRipple();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
this.toggle();
|
|
48
|
+
};
|
|
37
49
|
|
|
38
50
|
}
|
|
39
51
|
|
|
@@ -95,58 +107,34 @@ class Accordion extends Component {
|
|
|
95
107
|
|
|
96
108
|
animate();
|
|
97
109
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
this.ripples.push({
|
|
104
|
-
x: localX,
|
|
105
|
-
y: localY,
|
|
110
|
+
addRipple() {
|
|
111
|
+
const ripple = {
|
|
112
|
+
x: this.width / 2,
|
|
113
|
+
y: this.headerHeight / 2,
|
|
106
114
|
radius: 0,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
115
|
+
maxRadius: Math.max(this.width, this.headerHeight) * 1.5,
|
|
116
|
+
opacity: 0.3
|
|
117
|
+
};
|
|
118
|
+
this.ripples.push(ripple);
|
|
119
|
+
this.animateRipples();
|
|
120
|
+
}
|
|
110
121
|
|
|
122
|
+
animateRipples() {
|
|
111
123
|
const animate = () => {
|
|
112
|
-
|
|
113
124
|
let active = false;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
r.radius += r.maxRadius / 12;
|
|
120
|
-
r.opacity *= 0.9;
|
|
125
|
+
for (let ripple of this.ripples) {
|
|
126
|
+
if (ripple.radius < ripple.maxRadius) {
|
|
127
|
+
ripple.radius += ripple.maxRadius / 15;
|
|
128
|
+
ripple.opacity -= 0.03;
|
|
121
129
|
active = true;
|
|
122
|
-
|
|
123
130
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
this.ripples = this.ripples.filter(r => r.opacity > 0.02);
|
|
128
|
-
|
|
131
|
+
}
|
|
132
|
+
this.ripples = this.ripples.filter(r => r.opacity > 0);
|
|
129
133
|
if (active) requestAnimationFrame(animate);
|
|
130
|
-
|
|
131
134
|
};
|
|
132
|
-
|
|
133
135
|
animate();
|
|
134
136
|
}
|
|
135
137
|
|
|
136
|
-
handleClick(x,y){
|
|
137
|
-
|
|
138
|
-
const localX = x - this.x;
|
|
139
|
-
const localY = y - this.y;
|
|
140
|
-
|
|
141
|
-
if(localY <= this.headerHeight){
|
|
142
|
-
|
|
143
|
-
this.addRipple(localX, localY);
|
|
144
|
-
this.toggle();
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
138
|
draw(ctx){
|
|
151
139
|
|
|
152
140
|
ctx.save();
|
package/index.js
CHANGED
|
@@ -115,5 +115,6 @@ export { default as SecurityManager } from './manager/SecurityManager.js';
|
|
|
115
115
|
export { default as FeatureFlags } from './manager/FeatureFlags.js';
|
|
116
116
|
|
|
117
117
|
// Version du framework
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
import pkg from './package.json' assert { type: 'json' };
|
|
119
|
+
// Tu peux maintenant exporter la version directement
|
|
120
|
+
export const VERSION = pkg.version;
|