MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / render

Method render

core/src/components/spinner/spinner.tsx:51–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49 }
50
51 render() {
52 const self = this;
53 const mode = getIonMode(self);
54 const spinnerName = self.getName();
55 const spinner = SPINNERS[spinnerName] ?? SPINNERS['lines'];
56 const duration = typeof self.duration === 'number' && self.duration > 10 ? self.duration : spinner.dur;
57 const svgs: SVGElement[] = [];
58
59 if (spinner.circles !== undefined) {
60 for (let i = 0; i < spinner.circles; i++) {
61 svgs.push(buildCircle(spinner, duration, i, spinner.circles));
62 }
63 } else if (spinner.lines !== undefined) {
64 for (let i = 0; i < spinner.lines; i++) {
65 svgs.push(buildLine(spinner, duration, i, spinner.lines));
66 }
67 }
68
69 return (
70 <Host
71 class={createColorClasses(self.color, {
72 [mode]: true,
73 [`spinner-${spinnerName}`]: true,
74 'spinner-paused': self.paused || config.getBoolean('_testing'),
75 })}
76 role="progressbar"
77 style={spinner.elmDuration ? { animationDuration: duration + 'ms' } : {}}
78 >
79 {svgs}
80 </Host>
81 );
82 }
83}
84
85const buildCircle = (spinner: SpinnerConfig, duration: number, index: number, total: number) => {

Callers

nothing calls this directly

Calls 7

getIonModeFunction · 0.90
createColorClassesFunction · 0.90
buildCircleFunction · 0.85
buildLineFunction · 0.85
getNameMethod · 0.80
pushMethod · 0.45
getBooleanMethod · 0.45

Tested by

no test coverage detected