ooxml-ui 1.52.1 → 1.53.0
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/custom-elements.json +5 -1
- package/dist/base.d.ts +0 -1
- package/dist/building-block-styles.d.ts +1 -0
- package/dist/chart/data-sheet-keys.d.ts +0 -1
- package/dist/chart/format-pane-advanced-space.d.ts +5 -2
- package/dist/chart/format-pane-advanced-space.d.ts.map +1 -1
- package/dist/chart/format-pane-analysis.d.ts +1 -0
- package/dist/chart/format-pane-analysis.d.ts.map +1 -1
- package/dist/chart/format-pane-fields.d.ts +0 -1
- package/dist/chart/format-pane-fill-kinds.d.ts +1 -0
- package/dist/chart/format-pane-locales/de.d.ts +1 -0
- package/dist/chart/format-pane-locales/de.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/en.d.ts +0 -1
- package/dist/chart/format-pane-locales/en.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/es.d.ts +1 -0
- package/dist/chart/format-pane-locales/es.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/fr.d.ts +1 -0
- package/dist/chart/format-pane-locales/fr.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/index.d.ts +1 -0
- package/dist/chart/format-pane-locales/ja.d.ts +1 -0
- package/dist/chart/format-pane-locales/ja.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/ko.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/zh-CN.d.ts +1 -0
- package/dist/chart/format-pane-locales/zh-CN.d.ts.map +1 -1
- package/dist/chart/format-pane-model.d.ts +0 -1
- package/dist/chart/format-pane-space.d.ts +10 -3
- package/dist/chart/format-pane-space.d.ts.map +1 -1
- package/dist/chart/format-pane-targets.d.ts +1 -0
- package/dist/chart/format-pane-trendlines.d.ts +17 -0
- package/dist/chart/format-pane-trendlines.d.ts.map +1 -0
- package/dist/chart/format-pane-types.d.ts +1 -0
- package/dist/chart/format-pane-view.d.ts +10 -1
- package/dist/chart/format-pane-view.d.ts.map +1 -1
- package/dist/chart/format-pane.d.ts +1 -2
- package/dist/chart-format-locales.js +1 -1
- package/dist/chrome/backstage.d.ts +1 -2
- package/dist/chrome/find-replace-fields.d.ts +0 -1
- package/dist/chrome/print-preview.d.ts +2 -1
- package/dist/chrome/ruler.d.ts +1 -2
- package/dist/chrome/tab-strip.d.ts +1 -2
- package/dist/chrome/title-bar.d.ts +1 -2
- package/dist/{chunk-ELVHRXWE.js → chunk-2EBZ6IV6.js} +3 -3
- package/dist/{chunk-2N6QBIKM.js → chunk-J36LIYGS.js} +1 -1
- package/dist/{chunk-GSO4HLIY.js → chunk-JI4ZNPEK.js} +42 -7
- package/dist/{chunk-3TF5IIIJ.js → chunk-NSBQACCO.js} +241 -149
- package/dist/{chunk-QDU4GLWK.js → chunk-X464LPTR.js} +152 -47
- package/dist/{chunk-FP45SLBV.js → chunk-XQIZWJEV.js} +1 -1
- package/dist/{chunk-QGRJJUH7.js → chunk-Y535PPSZ.js} +1 -1
- package/dist/comments/comments-pane.d.ts +1 -2
- package/dist/comments/types.d.ts +1 -0
- package/dist/controls.js +2 -2
- package/dist/dialog/message-dialog.d.ts +2 -1
- package/dist/dialog/progress-dialog.d.ts +1 -2
- package/dist/docx.js +36 -42
- package/dist/embedding/region-host.d.ts +1 -0
- package/dist/export/pdf-font-faces.d.ts +1 -0
- package/dist/export/pdf-image.d.ts +0 -1
- package/dist/export/pdf-path.d.ts +0 -1
- package/dist/export/pdf-svg-notes.d.ts +0 -1
- package/dist/export/pdf-svg-text.d.ts +1 -0
- package/dist/files/cloud-files-labels.d.ts +0 -1
- package/dist/files/cloud-files.d.ts +2 -1
- package/dist/files/connected-services.d.ts +1 -2
- package/dist/fonts/webfonts.d.ts +1 -0
- package/dist/form/checkable.d.ts +0 -1
- package/dist/form/checkbox.d.ts +2 -1
- package/dist/form/color-swatches.d.ts +1 -0
- package/dist/form/switch.d.ts +1 -2
- package/dist/glyph.d.ts +1 -0
- package/dist/icons.d.ts +1 -0
- package/dist/image-native-size.d.ts +0 -1
- package/dist/index.js +6 -6
- package/dist/look.d.ts +1 -0
- package/dist/menu/menu-button.d.ts +1 -2
- package/dist/menu/menu-model.d.ts +0 -1
- package/dist/notices/paste-options.d.ts +2 -1
- package/dist/notices/read-only-banner.d.ts +2 -1
- package/dist/notices/toasts.d.ts +1 -2
- package/dist/picture-artistic-preview.d.ts +1 -0
- package/dist/picture-effects.d.ts +1 -0
- package/dist/picture-pixels.d.ts +1 -0
- package/dist/picture-standard-filter.d.ts +1 -0
- package/dist/pptx/{chunk-FQGG3DGL.mjs → chunk-5PL3ZZV4.mjs} +1 -1
- package/dist/pptx/{chunk-4K4DO7RJ.mjs → chunk-75MKMQP5.mjs} +69 -7
- package/dist/pptx/{chunk-JVCSVLFU.cjs → chunk-O33ER4AJ.cjs} +69 -7
- package/dist/pptx/{chunk-OFXOF5ZX.mjs → chunk-OS2SX33G.mjs} +2791 -1318
- package/dist/pptx/{chunk-SWJV6FQN.cjs → chunk-STQTJXYQ.cjs} +2824 -1316
- package/dist/pptx/{chunk-OATLMHQL.cjs → chunk-TJPRGVT4.cjs} +42 -42
- package/dist/pptx/dom/index.cjs +377 -377
- package/dist/pptx/dom/index.mjs +6 -6
- package/dist/pptx/i18n/index.cjs +6 -6
- package/dist/pptx/i18n/index.mjs +1 -1
- package/dist/pptx/i18n/translations-en-galleries-data.d.ts.map +1 -1
- package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
- package/dist/pptx/index.cjs +3410 -3270
- package/dist/pptx/index.mjs +2 -2
- package/dist/pptx/render/controller/index.d.ts +6 -0
- package/dist/pptx/render/controller/index.d.ts.map +1 -1
- package/dist/pptx/render/controller/presentation-ink-controller.d.ts +121 -0
- package/dist/pptx/render/controller/presentation-ink-controller.d.ts.map +1 -0
- package/dist/pptx/render/controller/presentation-rehearsal-controller.d.ts +71 -0
- package/dist/pptx/render/controller/presentation-rehearsal-controller.d.ts.map +1 -0
- package/dist/pptx/render/controller/presenter-session-controller.d.ts +85 -0
- package/dist/pptx/render/controller/presenter-session-controller.d.ts.map +1 -0
- package/dist/pptx/render/editor-chrome/ribbon-css.d.ts +1 -1
- package/dist/pptx/render/editor-chrome/ribbon-css.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +1 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/inspector/index.d.ts +6 -0
- package/dist/pptx/render/inspector/index.d.ts.map +1 -1
- package/dist/pptx/render/inspector/shape-fill-actions.d.ts +109 -0
- package/dist/pptx/render/inspector/shape-fill-actions.d.ts.map +1 -0
- package/dist/pptx/render/inspector/shape-fill-fields.d.ts +54 -0
- package/dist/pptx/render/inspector/shape-fill-fields.d.ts.map +1 -0
- package/dist/pptx/render/inspector/shape-fill-stops.d.ts +21 -0
- package/dist/pptx/render/inspector/shape-fill-stops.d.ts.map +1 -0
- package/dist/pptx/render/ribbon-galleries/smartart-colors-gallery.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/smartart-gallery-patch.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/smartart-native-entries.d.ts +36 -0
- package/dist/pptx/render/ribbon-galleries/smartart-native-entries.d.ts.map +1 -0
- package/dist/pptx/render/ribbon-galleries/smartart-styles-gallery.d.ts +0 -11
- package/dist/pptx/render/ribbon-galleries/smartart-styles-gallery.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-tab-row.d.ts +61 -0
- package/dist/pptx/render/ribbon-tab-row.d.ts.map +1 -0
- package/dist/pptx/{smartart-insert-preview-DF6KSG3D.mjs → smartart-insert-preview-FJFP4JJ5.mjs} +3 -3
- package/dist/pptx/{smartart-insert-preview-BYPU325G.cjs → smartart-insert-preview-XNHOSN3T.cjs} +4 -4
- package/dist/pptx/web-components/index.d.ts +2 -0
- package/dist/pptx/web-components/index.d.ts.map +1 -1
- package/dist/pptx/web-components/office-token-bridge.d.ts +1 -1
- package/dist/pptx/web-components/office-token-bridge.d.ts.map +1 -1
- package/dist/pptx/web-components/ribbon-tabs-styles.d.ts +8 -0
- package/dist/pptx/web-components/ribbon-tabs-styles.d.ts.map +1 -0
- package/dist/pptx/web-components/ribbon-tabs.d.ts +25 -0
- package/dist/pptx/web-components/ribbon-tabs.d.ts.map +1 -0
- package/dist/presence.d.ts +1 -0
- package/dist/ribbon/auto-collapse.d.ts +1 -0
- package/dist/ribbon/ribbon-actions.d.ts +1 -2
- package/dist/ribbon/ribbon-group.d.ts +2 -1
- package/dist/ribbon/ribbon-section.d.ts +1 -2
- package/dist/ribbon/ribbon-tabs.d.ts +24 -2
- package/dist/ribbon/ribbon-tabs.d.ts.map +1 -1
- package/dist/ribbon/ribbon-toggle.d.ts +2 -1
- package/dist/ribbon/ribbon-toolbar.d.ts +1 -2
- package/dist/ribbon/scroll-more.d.ts +1 -0
- package/dist/ribbon/svg-preview.d.ts +1 -0
- package/dist/smartart/definition-tiles.d.ts +21 -0
- package/dist/smartart/definition-tiles.d.ts.map +1 -0
- package/dist/smartart/galleries.d.ts +12 -9
- package/dist/smartart.d.ts +1 -0
- package/dist/smartart.js +1 -1
- package/dist/styles.d.ts +1 -0
- package/dist/teams.js +3 -3
- package/dist/touch-targets.d.ts +0 -1
- package/dist/visio.js +5 -5
- package/dist/xlsx/chart-format-source.d.ts +4 -3
- package/dist/xlsx.js +46 -26
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createIconSvg, paintIcon, getIcon } from './chunk-M6GF5ED2.js';
|
|
2
|
-
import { CHART_FORMAT_STRINGS, CHART_FORMAT_LOCALES } from './chunk-
|
|
2
|
+
import { CHART_FORMAT_STRINGS, CHART_FORMAT_LOCALES } from './chunk-JI4ZNPEK.js';
|
|
3
3
|
import { initialsOf } from './chunk-FQN4XNEF.js';
|
|
4
4
|
import { parseSvgPreview } from './chunk-FN7IF6M6.js';
|
|
5
5
|
import { OfficeElement, controlStyles, definer, valueOn, flag, present, emit, triState, withTokens } from './chunk-4W4QZF4C.js';
|
|
@@ -10,7 +10,7 @@ import { repeat } from 'lit/directives/repeat.js';
|
|
|
10
10
|
import { normalizeLocale } from 'ooxml-core/i18n';
|
|
11
11
|
import { unsafeStatic, html as html$1 } from 'lit/static-html.js';
|
|
12
12
|
import { live } from 'lit/directives/live.js';
|
|
13
|
-
import { applyChartDataSheetEdits, chartDataSheetCellEdit, chartDataSheetPasteEdits, chartSeriesEntries, chartLabelPositions, chartGroupPaintsLine, chartTargetShape, chartSeriesSecondaryAxisSupported, chartTargetHasText, chartFormatTargetKey, chartDrawingColorFromHex, chartSeriesOnSecondaryAxis, chartSeriesMarkersSupported, chartSeriesAnalysisSupported, resolveChartGradient, chartTargetEffects, chartTargetTextFormatting, CHART_MARKER_SYMBOLS, chartPointsToEmu, chartEffectEditsFromAppearance, chartThreeDFromAppearance, chartDrawingGradientFrom, chartTargetThreeD } from 'ooxml-core/chart';
|
|
13
|
+
import { applyChartDataSheetEdits, chartDataSheetCellEdit, chartDataSheetPasteEdits, chartSeriesEntries, chartLabelPositions, chartGroupPaintsLine, chartTargetShape, chartSeriesSecondaryAxisSupported, chartTargetHasText, chartFormatTargetKey, chartDrawingColorFromHex, chartSeriesOnSecondaryAxis, chartSeriesMarkersSupported, chartSeriesAnalysisSupported, chartSpaceRangeNumbers, resolveChartGradient, chartTargetEffects, chartTargetTextFormatting, CHART_MARKER_SYMBOLS, chartErrorBarSourceFromText, chartPointsToEmu, chartEffectEditsFromAppearance, chartThreeDFromAppearance, chartDrawingGradientFrom, chartTargetThreeD, chartErrorBarSourceText } from 'ooxml-core/chart';
|
|
14
14
|
import { resolveDrawingColor } from 'ooxml-core/drawingml';
|
|
15
15
|
import { keyed } from 'lit/directives/keyed.js';
|
|
16
16
|
import { OFFICE_STANDARD_COLORS, normalizePaletteHex, buildThemePalette, hslToRgb, toHex, hexToRgbChannels, rgbToHsl } from 'ooxml-core/color';
|
|
@@ -2286,16 +2286,16 @@ function control(field, ctx, label) {
|
|
|
2286
2286
|
@change=${commit}
|
|
2287
2287
|
></${tag}>`;
|
|
2288
2288
|
}
|
|
2289
|
-
const
|
|
2289
|
+
const number2 = field.kind === "number" ? field : void 0;
|
|
2290
2290
|
return html`<input
|
|
2291
|
-
type=${field.kind === "color" ? "color" :
|
|
2291
|
+
type=${field.kind === "color" ? "color" : number2 ? "number" : "text"}
|
|
2292
2292
|
aria-label=${label}
|
|
2293
2293
|
data-value=${String(field.value)}
|
|
2294
|
-
min=${
|
|
2295
|
-
max=${
|
|
2296
|
-
step=${
|
|
2297
|
-
placeholder=${
|
|
2298
|
-
inputmode=${
|
|
2294
|
+
min=${number2?.min ?? nothing}
|
|
2295
|
+
max=${number2?.max ?? nothing}
|
|
2296
|
+
step=${number2 ? number2.step ?? "any" : nothing}
|
|
2297
|
+
placeholder=${number2?.auto ? ctx.autoLabel : nothing}
|
|
2298
|
+
inputmode=${number2 ? "decimal" : nothing}
|
|
2299
2299
|
?disabled=${disabled}
|
|
2300
2300
|
@change=${commit}
|
|
2301
2301
|
/>`;
|
|
@@ -2566,7 +2566,9 @@ function effectsSections(view) {
|
|
|
2566
2566
|
...view.support.threeD && view.threeD ? [threeDSection(view.threeD)] : []
|
|
2567
2567
|
];
|
|
2568
2568
|
}
|
|
2569
|
-
|
|
2569
|
+
|
|
2570
|
+
// src/chart/format-pane-trendlines.ts
|
|
2571
|
+
var CHART_TRENDLINE_TYPES = [
|
|
2570
2572
|
["linear", "Linear"],
|
|
2571
2573
|
["exp", "Exponential"],
|
|
2572
2574
|
["log", "Logarithmic"],
|
|
@@ -2574,111 +2576,128 @@ var TYPES = [
|
|
|
2574
2576
|
["power", "Power"],
|
|
2575
2577
|
["movingAvg", "Moving average"]
|
|
2576
2578
|
];
|
|
2577
|
-
var
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
["stdDev", "Standard deviation"],
|
|
2581
|
-
["stdErr", "Standard error"]
|
|
2582
|
-
];
|
|
2583
|
-
var number = (id, key, fallback, value, min, max, auto2 = false) => ({
|
|
2584
|
-
id,
|
|
2585
|
-
kind: "number",
|
|
2586
|
-
label: t(key, fallback),
|
|
2587
|
-
value,
|
|
2588
|
-
min,
|
|
2589
|
-
max,
|
|
2590
|
-
step: 1,
|
|
2591
|
-
...auto2 ? { auto: true } : {}
|
|
2592
|
-
});
|
|
2593
|
-
function chartAnalysisSections(series) {
|
|
2594
|
-
const sections = [];
|
|
2595
|
-
if (series.marker)
|
|
2596
|
-
sections.push({
|
|
2597
|
-
id: "markers",
|
|
2598
|
-
title: t("section.markers", "Markers"),
|
|
2599
|
-
fields: [
|
|
2600
|
-
{
|
|
2601
|
-
id: "marker.symbol",
|
|
2602
|
-
kind: "select",
|
|
2603
|
-
label: t("marker.symbol", "Marker"),
|
|
2604
|
-
value: series.marker.symbol ?? "auto",
|
|
2605
|
-
choices: CHART_MARKER_SYMBOLS.map((symbol) => choice(symbol, `marker.${symbol}`, symbol))
|
|
2606
|
-
},
|
|
2607
|
-
number("marker.size", "marker.size", "Marker size", series.marker.size ?? 5, 2, 72)
|
|
2608
|
-
]
|
|
2609
|
-
});
|
|
2610
|
-
const analysis = series.analysis;
|
|
2611
|
-
if (!analysis) return sections;
|
|
2612
|
-
const trend = analysis.trendline;
|
|
2613
|
-
const error = analysis.errorBars;
|
|
2579
|
+
var typeChoices = () => CHART_TRENDLINE_TYPES.map(([value, label]) => choice(value, `trendline.${value}`, label));
|
|
2580
|
+
var chartFormatNumberField = (id, key, fallback, value, min, max) => ({ id, kind: "number", label: t(key, fallback), value, min, max, step: 1 });
|
|
2581
|
+
function trendlineFields(prefix, trend) {
|
|
2614
2582
|
const fields = [
|
|
2615
2583
|
{
|
|
2616
|
-
id:
|
|
2584
|
+
id: `${prefix}type`,
|
|
2617
2585
|
kind: "select",
|
|
2618
2586
|
label: t("trendline.type", "Trendline"),
|
|
2619
2587
|
value: trend?.trendlineType ?? "none",
|
|
2620
|
-
|
|
2621
|
-
choices: [
|
|
2622
|
-
choice("none", "marker.none", "None"),
|
|
2623
|
-
...TYPES.map(([value, label]) => choice(value, `trendline.${value}`, label))
|
|
2624
|
-
]
|
|
2588
|
+
choices: [choice("none", "marker.none", "None"), ...typeChoices()]
|
|
2625
2589
|
}
|
|
2626
2590
|
];
|
|
2627
|
-
if (trend
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2591
|
+
if (!trend) return fields;
|
|
2592
|
+
const number2 = (key, fallback, value, min, max) => chartFormatNumberField(`${prefix}${key}`, `trendline.${key}`, fallback, value, min, max);
|
|
2593
|
+
if (trend.trendlineType === "poly")
|
|
2594
|
+
fields.push(number2("order", "Polynomial order", trend.order ?? 2, 2, 6));
|
|
2595
|
+
if (trend.trendlineType === "movingAvg")
|
|
2596
|
+
fields.push(number2("period", "Period", trend.period ?? 2, 2, 1e5));
|
|
2597
|
+
fields.push(
|
|
2598
|
+
number2("forward", "Forecast forward", trend.forward ?? 0, 0, 1e5),
|
|
2599
|
+
number2("backward", "Forecast backward", trend.backward ?? 0, 0, 1e5)
|
|
2600
|
+
);
|
|
2601
|
+
if (trend.trendlineType !== "movingAvg")
|
|
2636
2602
|
fields.push(
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
"
|
|
2640
|
-
"
|
|
2641
|
-
trend.
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
"trendline.
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
trend.backward ?? 0,
|
|
2650
|
-
0,
|
|
2651
|
-
1e5
|
|
2652
|
-
)
|
|
2603
|
+
{
|
|
2604
|
+
id: `${prefix}equation`,
|
|
2605
|
+
kind: "checkbox",
|
|
2606
|
+
label: t("trendline.equation", "Display equation"),
|
|
2607
|
+
value: trend.displayEquation ?? false
|
|
2608
|
+
},
|
|
2609
|
+
{
|
|
2610
|
+
id: `${prefix}rSquared`,
|
|
2611
|
+
kind: "checkbox",
|
|
2612
|
+
label: t("trendline.rSquared", "Display R-squared"),
|
|
2613
|
+
value: trend.displayRSquared ?? false
|
|
2614
|
+
}
|
|
2653
2615
|
);
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2616
|
+
return fields;
|
|
2617
|
+
}
|
|
2618
|
+
function chartTrendlineSections(trends) {
|
|
2619
|
+
const sections = [
|
|
2620
|
+
{
|
|
2621
|
+
id: "trendlines",
|
|
2622
|
+
title: t("section.trendlines", "Trendlines"),
|
|
2623
|
+
fields: trendlineFields("trendline.", trends[0])
|
|
2624
|
+
}
|
|
2625
|
+
];
|
|
2626
|
+
trends.slice(1).forEach(
|
|
2627
|
+
(trend, i) => sections.push({
|
|
2628
|
+
id: `trendline-${i + 1}`,
|
|
2629
|
+
title: {
|
|
2630
|
+
key: "chartFormat.section.trendlineN",
|
|
2631
|
+
fallback: "Trendline {{n}}",
|
|
2632
|
+
params: { n: i + 2 }
|
|
2633
|
+
},
|
|
2634
|
+
fields: trendlineFields(`trendline.${i + 1}.`, trend)
|
|
2635
|
+
})
|
|
2636
|
+
);
|
|
2637
|
+
if (trends.length > 0)
|
|
2638
|
+
sections[sections.length - 1].fields.push({
|
|
2639
|
+
id: "trendline.add",
|
|
2640
|
+
kind: "select",
|
|
2641
|
+
label: t("trendline.add", "Add trendline"),
|
|
2642
|
+
value: "none",
|
|
2643
|
+
choices: [choice("none", "marker.none", "None"), ...typeChoices()]
|
|
2644
|
+
});
|
|
2645
|
+
return sections;
|
|
2646
|
+
}
|
|
2647
|
+
function chartTrendlineFieldIntent(trends, seriesIndex, field, value) {
|
|
2648
|
+
const text2 = String(value);
|
|
2649
|
+
const isType = CHART_TRENDLINE_TYPES.some(([type]) => type === text2);
|
|
2650
|
+
if (field === "trendline.add")
|
|
2651
|
+
return isType ? {
|
|
2652
|
+
op: "trendline",
|
|
2653
|
+
seriesIndex,
|
|
2654
|
+
index: trends.length,
|
|
2655
|
+
edit: { type: text2 }
|
|
2656
|
+
} : null;
|
|
2657
|
+
const match = /^trendline\.(?:(\d+)\.)?(\w+)$/u.exec(field);
|
|
2658
|
+
if (!match) return null;
|
|
2659
|
+
const index = match[1] === void 0 ? 0 : Number(match[1]);
|
|
2660
|
+
const key = match[2];
|
|
2661
|
+
const wrap = (edit) => ({
|
|
2662
|
+
op: "trendline",
|
|
2663
|
+
seriesIndex,
|
|
2664
|
+
index,
|
|
2665
|
+
edit
|
|
2680
2666
|
});
|
|
2681
|
-
const
|
|
2667
|
+
const trend = trends[index];
|
|
2668
|
+
if (key === "type") {
|
|
2669
|
+
if (text2 === "none") return trend ? wrap(null) : null;
|
|
2670
|
+
return isType && (trend || index === trends.length) ? wrap({ type: text2 }) : null;
|
|
2671
|
+
}
|
|
2672
|
+
if (!trend) return null;
|
|
2673
|
+
if (key === "equation") return wrap({ displayEquation: Boolean(value) });
|
|
2674
|
+
if (key === "rSquared") return wrap({ displayRSquared: Boolean(value) });
|
|
2675
|
+
const n = value === "" || typeof value === "boolean" ? NaN : Number(value);
|
|
2676
|
+
if (!["order", "period", "forward", "backward"].includes(key) || !Number.isFinite(n) || n < 0)
|
|
2677
|
+
return null;
|
|
2678
|
+
return wrap({ [key]: n });
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
// src/chart/format-pane-analysis.ts
|
|
2682
|
+
var ERRORS = [
|
|
2683
|
+
["fixedVal", "Fixed value"],
|
|
2684
|
+
["percentage", "Percentage"],
|
|
2685
|
+
["stdDev", "Standard deviation"],
|
|
2686
|
+
["stdErr", "Standard error"],
|
|
2687
|
+
["cust", "Custom source"]
|
|
2688
|
+
];
|
|
2689
|
+
var sourceField = (side, error) => ({
|
|
2690
|
+
id: `errorBars.${side}Values`,
|
|
2691
|
+
kind: "text",
|
|
2692
|
+
label: t(
|
|
2693
|
+
`errorBars.${side}Values`,
|
|
2694
|
+
side === "plus" ? "Positive error value" : "Negative error value"
|
|
2695
|
+
),
|
|
2696
|
+
value: chartErrorBarSourceText(error[side])
|
|
2697
|
+
});
|
|
2698
|
+
function errorBarSection(analysis) {
|
|
2699
|
+
const error = analysis.errorBars;
|
|
2700
|
+
const fields = [
|
|
2682
2701
|
{
|
|
2683
2702
|
id: "errorBars.type",
|
|
2684
2703
|
kind: "select",
|
|
@@ -2687,13 +2706,14 @@ function chartAnalysisSections(series) {
|
|
|
2687
2706
|
disabled: analysis.multipleErrorBars,
|
|
2688
2707
|
choices: [
|
|
2689
2708
|
choice("none", "marker.none", "None"),
|
|
2690
|
-
...ERRORS.map(
|
|
2691
|
-
|
|
2709
|
+
...ERRORS.map(
|
|
2710
|
+
([value, label]) => choice(value, value === "cust" ? "errorBars.custom" : `errorBars.${value}`, label)
|
|
2711
|
+
)
|
|
2692
2712
|
]
|
|
2693
2713
|
}
|
|
2694
2714
|
];
|
|
2695
2715
|
if (error && !analysis.multipleErrorBars) {
|
|
2696
|
-
|
|
2716
|
+
fields.push(
|
|
2697
2717
|
{
|
|
2698
2718
|
id: "errorBars.side",
|
|
2699
2719
|
kind: "select",
|
|
@@ -2712,24 +2732,54 @@ function chartAnalysisSections(series) {
|
|
|
2712
2732
|
value: !error.noEndCap
|
|
2713
2733
|
}
|
|
2714
2734
|
);
|
|
2715
|
-
if (error.valueType
|
|
2716
|
-
|
|
2717
|
-
|
|
2735
|
+
if (error.valueType === "cust") {
|
|
2736
|
+
if (error.barType !== "minus") fields.push(sourceField("plus", error));
|
|
2737
|
+
if (error.barType !== "plus") fields.push(sourceField("minus", error));
|
|
2738
|
+
} else if (error.valueType !== "stdErr")
|
|
2739
|
+
fields.push(
|
|
2740
|
+
chartFormatNumberField("errorBars.value", "errorBars.value", "Error value", error.value ?? 1, 0, 1e5)
|
|
2718
2741
|
);
|
|
2719
2742
|
}
|
|
2720
|
-
|
|
2743
|
+
const note = analysis.multipleErrorBars ? t(
|
|
2744
|
+
"analysis.multipleErrorBars",
|
|
2745
|
+
"Ambiguous error bars are preserved and cannot be edited here."
|
|
2746
|
+
) : error?.valueType === "cust" ? analysis.workbookRanges ? t(
|
|
2747
|
+
"errorBars.customHint",
|
|
2748
|
+
"Enter values such as 1, 2, 3 or a range such as Sheet1!$C$2:$C$4."
|
|
2749
|
+
) : t(
|
|
2750
|
+
"errorBars.customCachedHint",
|
|
2751
|
+
"Enter values such as 1, 2, 3, or a range of cells this chart already plots."
|
|
2752
|
+
) : void 0;
|
|
2753
|
+
return {
|
|
2721
2754
|
id: "errorBars",
|
|
2722
2755
|
title: t("section.errorBars", "Error bars"),
|
|
2723
|
-
fields
|
|
2724
|
-
...
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2756
|
+
fields,
|
|
2757
|
+
...note ? { note } : {}
|
|
2758
|
+
};
|
|
2759
|
+
}
|
|
2760
|
+
function chartAnalysisSections(series) {
|
|
2761
|
+
const sections = [];
|
|
2762
|
+
if (series.marker)
|
|
2763
|
+
sections.push({
|
|
2764
|
+
id: "markers",
|
|
2765
|
+
title: t("section.markers", "Markers"),
|
|
2766
|
+
fields: [
|
|
2767
|
+
{
|
|
2768
|
+
id: "marker.symbol",
|
|
2769
|
+
kind: "select",
|
|
2770
|
+
label: t("marker.symbol", "Marker"),
|
|
2771
|
+
value: series.marker.symbol ?? "auto",
|
|
2772
|
+
choices: CHART_MARKER_SYMBOLS.map((symbol) => choice(symbol, `marker.${symbol}`, symbol))
|
|
2773
|
+
},
|
|
2774
|
+
chartFormatNumberField("marker.size", "marker.size", "Marker size", series.marker.size ?? 5, 2, 72)
|
|
2775
|
+
]
|
|
2776
|
+
});
|
|
2777
|
+
const analysis = series.analysis;
|
|
2778
|
+
if (!analysis) return sections;
|
|
2779
|
+
sections.push(...chartTrendlineSections(analysis.trendlines ?? []), errorBarSection(analysis));
|
|
2731
2780
|
return sections;
|
|
2732
2781
|
}
|
|
2782
|
+
var ones = (count) => chartErrorBarSourceFromText("1", { pointCount: count });
|
|
2733
2783
|
function chartAnalysisFieldIntent(series, target, field, value) {
|
|
2734
2784
|
if (!/^(marker|trendline|errorBars)\./u.test(field)) return void 0;
|
|
2735
2785
|
if (!series || target.kind !== "series") return null;
|
|
@@ -2744,19 +2794,8 @@ function chartAnalysisFieldIntent(series, target, field, value) {
|
|
|
2744
2794
|
}
|
|
2745
2795
|
const analysis = series.analysis;
|
|
2746
2796
|
if (!analysis) return null;
|
|
2747
|
-
if (field.startsWith("trendline."))
|
|
2748
|
-
|
|
2749
|
-
const wrap2 = (edit) => ({ op: "trendline", seriesIndex, index: 0, edit });
|
|
2750
|
-
if (field === "trendline.type")
|
|
2751
|
-
return text2 === "none" ? analysis.trendline ? wrap2(null) : null : TYPES.some(([type]) => type === text2) ? wrap2({ type: text2 }) : null;
|
|
2752
|
-
if (!analysis.trendline) return null;
|
|
2753
|
-
if (field === "trendline.equation") return wrap2({ displayEquation: Boolean(value) });
|
|
2754
|
-
if (field === "trendline.rSquared") return wrap2({ displayRSquared: Boolean(value) });
|
|
2755
|
-
const key = field.slice(10);
|
|
2756
|
-
if (!["order", "period", "forward", "backward"].includes(key) || !Number.isFinite(n) || n < 0)
|
|
2757
|
-
return null;
|
|
2758
|
-
return wrap2({ [key]: n });
|
|
2759
|
-
}
|
|
2797
|
+
if (field.startsWith("trendline."))
|
|
2798
|
+
return chartTrendlineFieldIntent(analysis.trendlines ?? [], seriesIndex, field, value);
|
|
2760
2799
|
if (analysis.multipleErrorBars) return null;
|
|
2761
2800
|
const wrap = (edit) => ({
|
|
2762
2801
|
op: "errorBars",
|
|
@@ -2764,12 +2803,34 @@ function chartAnalysisFieldIntent(series, target, field, value) {
|
|
|
2764
2803
|
direction: "y",
|
|
2765
2804
|
edit
|
|
2766
2805
|
});
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
if (
|
|
2806
|
+
const error = analysis.errorBars;
|
|
2807
|
+
const count = analysis.pointCount ?? 1;
|
|
2808
|
+
if (field === "errorBars.type") {
|
|
2809
|
+
if (text2 === "none") return error ? wrap(null) : null;
|
|
2810
|
+
if (!ERRORS.some(([type]) => type === text2)) return null;
|
|
2811
|
+
return text2 === "cust" ? error?.valueType === "cust" ? null : wrap({ valueType: "cust", plus: ones(count), minus: ones(count) }) : wrap({ valueType: text2 });
|
|
2812
|
+
}
|
|
2813
|
+
if (!error) return null;
|
|
2770
2814
|
if (field === "errorBars.cap") return wrap({ noEndCap: !value });
|
|
2771
|
-
if (field === "errorBars.side")
|
|
2772
|
-
|
|
2815
|
+
if (field === "errorBars.side") {
|
|
2816
|
+
if (!["both", "plus", "minus"].includes(text2)) return null;
|
|
2817
|
+
const edit = {
|
|
2818
|
+
barType: text2
|
|
2819
|
+
};
|
|
2820
|
+
if (error.valueType === "cust") {
|
|
2821
|
+
if (text2 !== "minus" && !error.plus) edit.plus = ones(count);
|
|
2822
|
+
if (text2 !== "plus" && !error.minus) edit.minus = ones(count);
|
|
2823
|
+
}
|
|
2824
|
+
return wrap(edit);
|
|
2825
|
+
}
|
|
2826
|
+
if (field === "errorBars.plusValues" || field === "errorBars.minusValues") {
|
|
2827
|
+
if (error.valueType !== "cust") return null;
|
|
2828
|
+
const source = chartErrorBarSourceFromText(text2, {
|
|
2829
|
+
pointCount: count,
|
|
2830
|
+
...analysis.resolveRange ? { resolveRange: analysis.resolveRange } : {}
|
|
2831
|
+
});
|
|
2832
|
+
return source ? wrap(field === "errorBars.plusValues" ? { plus: source } : { minus: source }) : null;
|
|
2833
|
+
}
|
|
2773
2834
|
return field === "errorBars.value" && Number.isFinite(n) && n >= 0 ? wrap({ value: n }) : null;
|
|
2774
2835
|
}
|
|
2775
2836
|
|
|
@@ -2959,7 +3020,7 @@ function chartAdvancedFieldIntent(view, target, field, value) {
|
|
|
2959
3020
|
return null;
|
|
2960
3021
|
}
|
|
2961
3022
|
}
|
|
2962
|
-
var
|
|
3023
|
+
var number = (value) => {
|
|
2963
3024
|
if (value === "" || typeof value === "boolean") return null;
|
|
2964
3025
|
const n = typeof value === "number" ? value : Number(value);
|
|
2965
3026
|
return Number.isFinite(n) ? n : null;
|
|
@@ -2994,13 +3055,13 @@ function gradientEdit(current, part, value) {
|
|
|
2994
3055
|
return { ...current, stops };
|
|
2995
3056
|
}
|
|
2996
3057
|
default: {
|
|
2997
|
-
const n =
|
|
3058
|
+
const n = number(value);
|
|
2998
3059
|
return n === null ? null : { ...current, stops, angle: (n % 360 + 360) % 360 };
|
|
2999
3060
|
}
|
|
3000
3061
|
}
|
|
3001
3062
|
}
|
|
3002
3063
|
function paintIntent(view, target, field, value) {
|
|
3003
|
-
const n =
|
|
3064
|
+
const n = number(value);
|
|
3004
3065
|
const text2 = String(value);
|
|
3005
3066
|
const gradient = GRADIENT.exec(field);
|
|
3006
3067
|
if (gradient) {
|
|
@@ -3089,7 +3150,7 @@ var one = (key, value) => {
|
|
|
3089
3150
|
return edit;
|
|
3090
3151
|
};
|
|
3091
3152
|
function axisEdit(field, value) {
|
|
3092
|
-
const n =
|
|
3153
|
+
const n = number(value);
|
|
3093
3154
|
const text2 = String(value);
|
|
3094
3155
|
switch (field) {
|
|
3095
3156
|
case "axis.title":
|
|
@@ -3175,7 +3236,7 @@ function chartFormatFieldIntent(view, target, field, value) {
|
|
|
3175
3236
|
}
|
|
3176
3237
|
const spacing = SPACING[field];
|
|
3177
3238
|
if (spacing && target.kind === "series") {
|
|
3178
|
-
const n =
|
|
3239
|
+
const n = number(value);
|
|
3179
3240
|
const [key, min, max] = spacing;
|
|
3180
3241
|
if (n === null || !Number.isInteger(n) || n < min || n > max) return null;
|
|
3181
3242
|
const edit = {};
|
|
@@ -4166,7 +4227,7 @@ function buildChartFormatModel(source, targetKey, tab = "fillLine", mode = "char
|
|
|
4166
4227
|
}
|
|
4167
4228
|
var transparency2 = (alpha) => Math.round((1 - alpha) * 100);
|
|
4168
4229
|
var chartGroupFormatType = (group) => group.element.replace(/Chart$/u, "");
|
|
4169
|
-
function chartSeriesOptionsView(space, entry, seriesIndex, advanced) {
|
|
4230
|
+
function chartSeriesOptionsView(space, entry, seriesIndex, advanced, workbookRanges) {
|
|
4170
4231
|
const group = entry?.group;
|
|
4171
4232
|
if (!entry || !group) return void 0;
|
|
4172
4233
|
const view = { chartType: chartGroupFormatType(group) };
|
|
@@ -4181,9 +4242,15 @@ function chartSeriesOptionsView(space, entry, seriesIndex, advanced) {
|
|
|
4181
4242
|
const errors = (entry.series.errorBars ?? []).filter(
|
|
4182
4243
|
(error) => (error.direction ?? "y") === "y"
|
|
4183
4244
|
);
|
|
4245
|
+
const values = entry.series.values ?? entry.series.yValues;
|
|
4246
|
+
const cached = chartSpaceRangeNumbers(space);
|
|
4184
4247
|
view.analysis = {
|
|
4185
4248
|
multipleTrendlines: trends.length > 1,
|
|
4186
4249
|
multipleErrorBars: errors.length > 1,
|
|
4250
|
+
trendlines: structuredClone(trends),
|
|
4251
|
+
pointCount: Math.max(1, values?.cache?.pointCount ?? values?.cache?.points.length ?? 1),
|
|
4252
|
+
resolveRange: workbookRanges ? (formula) => workbookRanges(formula) ?? cached(formula) : cached,
|
|
4253
|
+
...workbookRanges ? { workbookRanges: true } : {},
|
|
4187
4254
|
...trends[0] ? { trendline: structuredClone(trends[0]) } : {},
|
|
4188
4255
|
...errors[0] ? { errorBars: structuredClone(errors[0]) } : {}
|
|
4189
4256
|
};
|
|
@@ -4371,7 +4438,13 @@ function chartSpaceFormatSource(space, options = {}) {
|
|
|
4371
4438
|
};
|
|
4372
4439
|
const entries = chartSeriesEntries(space);
|
|
4373
4440
|
const advanced = options.advanced !== false;
|
|
4374
|
-
const seriesOptions2 = (seriesIndex) => chartSeriesOptionsView(
|
|
4441
|
+
const seriesOptions2 = (seriesIndex) => chartSeriesOptionsView(
|
|
4442
|
+
space,
|
|
4443
|
+
entries[seriesIndex],
|
|
4444
|
+
seriesIndex,
|
|
4445
|
+
advanced,
|
|
4446
|
+
options.resolveRange
|
|
4447
|
+
);
|
|
4375
4448
|
const describe = {
|
|
4376
4449
|
axis: (axisIndex) => {
|
|
4377
4450
|
const axis = space.plotArea.axes[axisIndex];
|
|
@@ -4901,6 +4974,7 @@ var OfficeUiRibbon = class extends OfficeElement {
|
|
|
4901
4974
|
collapsed: flag,
|
|
4902
4975
|
peek: flag,
|
|
4903
4976
|
collapseLabel: { attribute: "collapse-label", type: String },
|
|
4977
|
+
items: { attribute: false },
|
|
4904
4978
|
tabs: { state: true }
|
|
4905
4979
|
};
|
|
4906
4980
|
chosen = null;
|
|
@@ -4915,9 +4989,13 @@ var OfficeUiRibbon = class extends OfficeElement {
|
|
|
4915
4989
|
this.collapsed = false;
|
|
4916
4990
|
this.peek = false;
|
|
4917
4991
|
this.collapseLabel = null;
|
|
4992
|
+
this.items = null;
|
|
4918
4993
|
this.tabs = [];
|
|
4919
4994
|
}
|
|
4920
4995
|
get selected() {
|
|
4996
|
+
if (this.items) {
|
|
4997
|
+
return this.items.some((item) => item.id === this.chosen) ? this.chosen ?? "" : "";
|
|
4998
|
+
}
|
|
4921
4999
|
const shown = this.shown();
|
|
4922
5000
|
const chosen = shown.find((panel) => panel.dataset.ribbonTab === this.chosen);
|
|
4923
5001
|
return chosen?.dataset.ribbonTab ?? shown[0]?.dataset.ribbonTab ?? "";
|
|
@@ -4968,6 +5046,16 @@ var OfficeUiRibbon = class extends OfficeElement {
|
|
|
4968
5046
|
}
|
|
4969
5047
|
/** Read the tabs off the panels (on connection and whenever the slotted panels change). */
|
|
4970
5048
|
build() {
|
|
5049
|
+
if (this.items) {
|
|
5050
|
+
this.tabs = this.items.map((item) => ({
|
|
5051
|
+
id: item.id,
|
|
5052
|
+
label: item.label,
|
|
5053
|
+
contextual: item.contextual === true,
|
|
5054
|
+
...item.keytip ? { keytip: item.keytip } : {},
|
|
5055
|
+
...item.title ? { title: item.title } : {}
|
|
5056
|
+
}));
|
|
5057
|
+
return;
|
|
5058
|
+
}
|
|
4971
5059
|
this.tabs = this.shown().map((panel) => {
|
|
4972
5060
|
const id = panel.dataset.ribbonTab;
|
|
4973
5061
|
panel.setAttribute("role", "tabpanel");
|
|
@@ -5016,6 +5104,7 @@ var OfficeUiRibbon = class extends OfficeElement {
|
|
|
5016
5104
|
this.peek = false;
|
|
5017
5105
|
}
|
|
5018
5106
|
willUpdate(changed) {
|
|
5107
|
+
if (changed.has("items")) this.build();
|
|
5019
5108
|
if (changed.has("collapsible")) this.applyAuto();
|
|
5020
5109
|
if (changed.has("peek")) {
|
|
5021
5110
|
const doc = this.ownerDocument;
|
|
@@ -5025,7 +5114,7 @@ var OfficeUiRibbon = class extends OfficeElement {
|
|
|
5025
5114
|
}
|
|
5026
5115
|
choose(tab) {
|
|
5027
5116
|
if (this.collapsible && this.collapsed) this.peek = true;
|
|
5028
|
-
if (tab === this.selected) return;
|
|
5117
|
+
if (tab === this.selected && !this.items) return;
|
|
5029
5118
|
if (this.fire("office-ribbon-select", { tab }, true)) this.selected = tab;
|
|
5030
5119
|
}
|
|
5031
5120
|
onTabClick(event) {
|
|
@@ -5048,7 +5137,8 @@ var OfficeUiRibbon = class extends OfficeElement {
|
|
|
5048
5137
|
if (!next2) return;
|
|
5049
5138
|
event.preventDefault();
|
|
5050
5139
|
this.choose(next2.dataset.tab);
|
|
5051
|
-
this.
|
|
5140
|
+
if (this.items) next2.focus();
|
|
5141
|
+
else this.focusTab();
|
|
5052
5142
|
}
|
|
5053
5143
|
/** Rebuild the tab row when a panel's label or visibility flag changes. */
|
|
5054
5144
|
watcher;
|
|
@@ -5079,8 +5169,9 @@ var OfficeUiRibbon = class extends OfficeElement {
|
|
|
5079
5169
|
updated() {
|
|
5080
5170
|
const selected = this.selected;
|
|
5081
5171
|
const hideAll = this.collapsed && !this.peek;
|
|
5082
|
-
|
|
5083
|
-
|
|
5172
|
+
if (!this.items)
|
|
5173
|
+
for (const panel of this.panels())
|
|
5174
|
+
panel.hidden = hideAll || panel.dataset.ribbonTab !== selected;
|
|
5084
5175
|
const active2 = this.tabButton(selected);
|
|
5085
5176
|
const list2 = active2?.parentElement;
|
|
5086
5177
|
if (active2 && list2 && list2.scrollWidth > list2.clientWidth) {
|
|
@@ -5123,6 +5214,7 @@ var OfficeUiRibbon = class extends OfficeElement {
|
|
|
5123
5214
|
data-contextual=${ifDefined(tab.contextual ? "" : void 0)}
|
|
5124
5215
|
data-keytip=${ifDefined(tab.keytip)}
|
|
5125
5216
|
data-keytip-panel=${ifDefined(tab.keytipPanel)}
|
|
5217
|
+
title=${ifDefined(tab.title)}
|
|
5126
5218
|
aria-selected=${String(tab.id === selected)}
|
|
5127
5219
|
tabindex=${tab.id === selected ? 0 : -1}
|
|
5128
5220
|
>${tab.label}</button
|