@area8975/ui 0.2.2-dev.43 → 0.2.2-dev.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.
@@ -2548,6 +2548,7 @@ var UiPieChartComponent = class UiPieChartComponent extends UiAxisChartBase {
2548
2548
  maximumFractionDigits: 1
2549
2549
  });
2550
2550
  totalLabel = input("Total", ...ngDevMode ? [{ debugName: "totalLabel" }] : /* istanbul ignore next */ []);
2551
+ sliceColours = input([], ...ngDevMode ? [{ debugName: "sliceColours" }] : /* istanbul ignore next */ []);
2551
2552
  values = computed(() => this.series()[0]?.data ?? [], ...ngDevMode ? [{ debugName: "values" }] : /* istanbul ignore next */ []);
2552
2553
  isEmpty = computed(() => !this.values().some((value) => value !== null && value > 0), ...ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []);
2553
2554
  isMuted = computed(() => {
@@ -2557,10 +2558,18 @@ var UiPieChartComponent = class UiPieChartComponent extends UiAxisChartBase {
2557
2558
  styles = computed(() => {
2558
2559
  const highlight = this.highlight();
2559
2560
  const muted = this.isMuted();
2560
- return this.categories().map((name, index) => muted[index] ? {
2561
- colour: this.ink().context,
2562
- dashed: false
2563
- } : chartSeriesStyle(highlight ? highlight.indexOf(name) : index, false, this.dark()));
2561
+ const given = this.sliceColours();
2562
+ return this.categories().map((name, index) => {
2563
+ if (muted[index]) return {
2564
+ colour: this.ink().context,
2565
+ dashed: false
2566
+ };
2567
+ const style = chartSeriesStyle(highlight ? highlight.indexOf(name) : index, false, this.dark());
2568
+ return {
2569
+ ...style,
2570
+ colour: given[index] ?? style.colour
2571
+ };
2572
+ });
2564
2573
  }, ...ngDevMode ? [{ debugName: "styles" }] : /* istanbul ignore next */ []);
2565
2574
  legendItems = computed(() => {
2566
2575
  const highlight = this.highlight();
@@ -2682,6 +2691,13 @@ var UiPieChartComponent = class UiPieChartComponent extends UiAxisChartBase {
2682
2691
  isSignal: true,
2683
2692
  isRequired: false,
2684
2693
  transformFunction: null
2694
+ },
2695
+ sliceColours: {
2696
+ classPropertyName: "sliceColours",
2697
+ publicName: "sliceColours",
2698
+ isSignal: true,
2699
+ isRequired: false,
2700
+ transformFunction: null
2685
2701
  }
2686
2702
  },
2687
2703
  host: { classAttribute: "block w-full min-w-0" },
@@ -2745,6 +2761,14 @@ i0.ɵɵngDeclareClassMetadata({
2745
2761
  alias: "totalLabel",
2746
2762
  required: false
2747
2763
  }]
2764
+ }],
2765
+ sliceColours: [{
2766
+ type: i0.Input,
2767
+ args: [{
2768
+ isSignal: true,
2769
+ alias: "sliceColours",
2770
+ required: false
2771
+ }]
2748
2772
  }]
2749
2773
  }
2750
2774
  });