wacom 21.1.18 → 21.1.20
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/fesm2022/wacom.mjs +25 -0
- package/fesm2022/wacom.mjs.map +1 -1
- package/package.json +1 -1
- package/types/wacom.d.ts +8 -4
package/fesm2022/wacom.mjs
CHANGED
|
@@ -4302,7 +4302,10 @@ class ThemeService {
|
|
|
4302
4302
|
this.mode = signal(undefined, ...(ngDevMode ? [{ debugName: "mode" }] : []));
|
|
4303
4303
|
this.modes = signal(['light', 'dark'], ...(ngDevMode ? [{ debugName: "modes" }] : []));
|
|
4304
4304
|
this.density = signal(undefined, ...(ngDevMode ? [{ debugName: "density" }] : []));
|
|
4305
|
+
this.densities = signal(['comfortable', 'compact'], ...(ngDevMode ? [{ debugName: "densities" }] : []));
|
|
4305
4306
|
this.radius = signal(undefined, ...(ngDevMode ? [{ debugName: "radius" }] : []));
|
|
4307
|
+
this.radiuses = signal(['rounded', 'square'], ...(ngDevMode ? [{ debugName: "radiuses" }] : []));
|
|
4308
|
+
this.themeIndex = signal(0, ...(ngDevMode ? [{ debugName: "themeIndex" }] : []));
|
|
4306
4309
|
}
|
|
4307
4310
|
setMode(mode) {
|
|
4308
4311
|
if (this._isBrowser) {
|
|
@@ -4325,6 +4328,25 @@ class ThemeService {
|
|
|
4325
4328
|
}
|
|
4326
4329
|
this.radius.set(radius);
|
|
4327
4330
|
}
|
|
4331
|
+
nextTheme() {
|
|
4332
|
+
const modes = this.modes().length;
|
|
4333
|
+
const densities = this.densities().length;
|
|
4334
|
+
const radiuses = this.radiuses().length;
|
|
4335
|
+
const maxIndex = modes * densities * radiuses;
|
|
4336
|
+
const nextIndex = (this.themeIndex() + 1) % maxIndex;
|
|
4337
|
+
this.themeIndex.set(nextIndex);
|
|
4338
|
+
const block = densities * radiuses;
|
|
4339
|
+
const modeIndex = Math.floor(nextIndex / block);
|
|
4340
|
+
const rem = nextIndex % block;
|
|
4341
|
+
const densityIndex = Math.floor(rem / radiuses);
|
|
4342
|
+
const radiusIndex = rem % radiuses;
|
|
4343
|
+
this.setMode(this.modes()[modeIndex]);
|
|
4344
|
+
this.setDensity(this.densities()[densityIndex]);
|
|
4345
|
+
this.setRadius(this.radiuses()[radiusIndex]);
|
|
4346
|
+
if (this._isBrowser) {
|
|
4347
|
+
localStorage.setItem('theme.index', String(nextIndex));
|
|
4348
|
+
}
|
|
4349
|
+
}
|
|
4328
4350
|
init() {
|
|
4329
4351
|
const mode = this._isBrowser
|
|
4330
4352
|
? localStorage.getItem('theme.mode') || 'light'
|
|
@@ -4339,6 +4361,9 @@ class ThemeService {
|
|
|
4339
4361
|
this.mode.set(mode);
|
|
4340
4362
|
this.density.set(density);
|
|
4341
4363
|
this.radius.set(radius);
|
|
4364
|
+
this.themeIndex.set(this._isBrowser
|
|
4365
|
+
? Number(localStorage.getItem('theme.index')) || 0
|
|
4366
|
+
: 0);
|
|
4342
4367
|
if (this._isBrowser) {
|
|
4343
4368
|
this._doc.documentElement.dataset['mode'] = mode;
|
|
4344
4369
|
this._doc.documentElement.dataset['density'] = density;
|