minerva-design 1.17.2 → 1.19.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.
Files changed (98) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/custom-elements.json +10 -6
  3. package/dist/angular/fesm2022/minerva-angular.mjs +173 -70
  4. package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
  5. package/dist/angular/types/minerva-angular.d.ts +33 -21
  6. package/dist/charts/core.cjs +1 -1
  7. package/dist/charts/core.d.cts +1 -0
  8. package/dist/charts/core.d.ts +1 -0
  9. package/dist/charts/core.js +22 -21
  10. package/dist/charts/engine/chart.cjs +1 -1
  11. package/dist/charts/engine/chart.cjs.map +1 -1
  12. package/dist/charts/engine/chart.js +414 -376
  13. package/dist/charts/engine/chart.js.map +1 -1
  14. package/dist/charts/engine/overlay.cjs +1 -1
  15. package/dist/charts/engine/overlay.cjs.map +1 -1
  16. package/dist/charts/engine/overlay.d.cts +5 -0
  17. package/dist/charts/engine/overlay.d.ts +5 -0
  18. package/dist/charts/engine/overlay.js +94 -69
  19. package/dist/charts/engine/overlay.js.map +1 -1
  20. package/dist/charts/engine/quadrant-card.cjs +2 -0
  21. package/dist/charts/engine/quadrant-card.cjs.map +1 -0
  22. package/dist/charts/engine/quadrant-card.d.cts +83 -0
  23. package/dist/charts/engine/quadrant-card.d.ts +83 -0
  24. package/dist/charts/engine/quadrant-card.js +154 -0
  25. package/dist/charts/engine/quadrant-card.js.map +1 -0
  26. package/dist/charts/engine/scene.cjs +1 -1
  27. package/dist/charts/engine/scene.cjs.map +1 -1
  28. package/dist/charts/engine/scene.d.cts +5 -0
  29. package/dist/charts/engine/scene.d.ts +5 -0
  30. package/dist/charts/engine/scene.js +32 -32
  31. package/dist/charts/engine/scene.js.map +1 -1
  32. package/dist/charts/engine/types.d.cts +14 -0
  33. package/dist/charts/engine/types.d.ts +14 -0
  34. package/dist/charts/index.cjs +1 -1
  35. package/dist/charts/index.js +28 -27
  36. package/dist/charts/react/Chart.cjs +1 -1
  37. package/dist/charts/react/Chart.cjs.map +1 -1
  38. package/dist/charts/react/Chart.d.cts +4 -2
  39. package/dist/charts/react/Chart.d.ts +4 -2
  40. package/dist/charts/react/Chart.js +42 -42
  41. package/dist/charts/react/Chart.js.map +1 -1
  42. package/dist/charts/react/charts.cjs +1 -1
  43. package/dist/charts/react/charts.cjs.map +1 -1
  44. package/dist/charts/react/charts.js +395 -391
  45. package/dist/charts/react/charts.js.map +1 -1
  46. package/dist/charts/react/types.d.cts +8 -2
  47. package/dist/charts/react/types.d.ts +8 -2
  48. package/dist/core/contracts.cjs +1 -1
  49. package/dist/core/contracts.cjs.map +1 -1
  50. package/dist/core/contracts.js +1 -1
  51. package/dist/core/contracts.js.map +1 -1
  52. package/dist/native/charts/src/engine/overlay.cjs +1 -1
  53. package/dist/native/charts/src/engine/overlay.cjs.map +1 -1
  54. package/dist/native/charts/src/engine/overlay.js +89 -65
  55. package/dist/native/charts/src/engine/overlay.js.map +1 -1
  56. package/dist/native/charts/src/engine/scene.cjs +1 -1
  57. package/dist/native/charts/src/engine/scene.cjs.map +1 -1
  58. package/dist/native/charts/src/engine/scene.js +32 -32
  59. package/dist/native/charts/src/engine/scene.js.map +1 -1
  60. package/dist/react/components/QuadrantTaskBoard/QuadrantTaskBoard.cjs +1 -1
  61. package/dist/react/components/QuadrantTaskBoard/QuadrantTaskBoard.cjs.map +1 -1
  62. package/dist/react/components/QuadrantTaskBoard/QuadrantTaskBoard.js +14 -8
  63. package/dist/react/components/QuadrantTaskBoard/QuadrantTaskBoard.js.map +1 -1
  64. package/dist/react/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss.cjs +1 -1
  65. package/dist/react/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss.cjs.map +1 -1
  66. package/dist/react/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss.js +16 -15
  67. package/dist/react/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss.js.map +1 -1
  68. package/dist/react/style.css +1 -1
  69. package/dist/react/styles/quadrant-task-board.css +1 -1
  70. package/dist/taro/index.js +1521 -1496
  71. package/dist/taro/style.css +22 -0
  72. package/dist/uni/manifest.d.ts +34 -34
  73. package/dist/uni/manifest.js +34 -39
  74. package/dist/uni/style.css +22 -0
  75. package/dist/vue/components/Chart/QuadrantChart.vue.d.ts +4 -3
  76. package/dist/vue/components/Chart/QuadrantChart.vue.js.map +1 -1
  77. package/dist/vue/components/Chart/QuadrantChart.vue_vue_type_script_setup_true_lang.js +186 -142
  78. package/dist/vue/components/Chart/QuadrantChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
  79. package/dist/vue/components/Chart/cartesian.d.ts +5 -1
  80. package/dist/vue/components/Chart/cartesian.js +2 -0
  81. package/dist/vue/components/Chart/cartesian.js.map +1 -1
  82. package/dist/vue/components/QuadrantTaskBoard/QuadrantTaskBoard.vue.js.map +1 -1
  83. package/dist/vue/components/QuadrantTaskBoard/QuadrantTaskBoard.vue_vue_type_script_setup_true_lang.js +18 -12
  84. package/dist/vue/components/QuadrantTaskBoard/QuadrantTaskBoard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  85. package/dist/weapp/charts/canvas.js +48 -11
  86. package/dist/weapp/controls.wxss +22 -0
  87. package/dist/web-components/components/chart/chart.d.ts +4 -1
  88. package/dist/web-components/components/chart/chart.js +3 -1
  89. package/dist/web-components/components/chart/chart.js.map +1 -1
  90. package/dist/web-components/components/chart/charts.d.ts +34 -14
  91. package/dist/web-components/components/chart/charts.js +145 -98
  92. package/dist/web-components/components/chart/charts.js.map +1 -1
  93. package/dist/web-components/components/quadrant-task-board/quadrant-task-board.d.ts +8 -8
  94. package/dist/web-components/components/quadrant-task-board/quadrant-task-board.js +16 -12
  95. package/dist/web-components/components/quadrant-task-board/quadrant-task-board.js.map +1 -1
  96. package/dist/web-components/styles/QuadrantTaskBoard/quadrantTaskBoard.css.js +1 -1
  97. package/dist/web-components/styles/QuadrantTaskBoard/quadrantTaskBoard.css.js.map +1 -1
  98. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { ChartAnnotation, ChartAxisOptions, ChartCurve, ChartDragEvent, ChartHoverEvent, ChartInteractionOptions, ChartLegendOptions, ChartOptions, ChartPadding, ChartPlotClickEvent, ChartRect, ChartRendererKind, ChartRendererPreference, ChartSeries, ChartSeriesType, ChartTooltipOptions, ChartView } from '../../../charts/core.js';
1
+ import { ChartAnnotation, ChartAxisOptions, ChartCurve, ChartDragEndEvent, ChartDragEvent, ChartHoverEvent, ChartInteractionOptions, ChartLegendOptions, ChartOptions, ChartPadding, ChartPlotClickEvent, ChartRect, ChartRendererKind, ChartRendererPreference, ChartSeries, ChartSeriesType, ChartTooltipOptions, ChartView } from '../../../charts/core.js';
2
2
  import { ChartHandle } from './types.js';
3
3
  /** The common props read by `engineOptions` */
4
4
  interface CommonProps {
@@ -32,8 +32,12 @@ export interface CartesianHandlers {
32
32
  plotClick?: (event: ChartPlotClickEvent) => void;
33
33
  zoom?: (view: ChartView) => void;
34
34
  renderer?: (renderer: ChartRendererKind) => void;
35
+ /** A point starts moving with the pointer */
36
+ dragStart?: (event: ChartDragEvent) => void;
35
37
  drag?: (event: ChartDragEvent) => void;
36
38
  drop?: (event: ChartDragEvent) => void;
39
+ /** The drag is over (after `drop`, or cancelled) */
40
+ dragEnd?: (event: ChartDragEndEvent) => void;
37
41
  /** The plot area moved or was resized */
38
42
  layout?: (rect: ChartRect) => void;
39
43
  }
@@ -36,8 +36,10 @@ function o(e, i, a, o = 320) {
36
36
  e.on("plotClick", (e) => a.plotClick?.(e)),
37
37
  e.on("zoom", (e) => a.zoom?.(e)),
38
38
  e.on("renderer", (e) => a.renderer?.(e)),
39
+ e.on("dragStart", (e) => a.dragStart?.(e)),
39
40
  e.on("drag", (e) => a.drag?.(e)),
40
41
  e.on("drop", (e) => a.drop?.(e)),
42
+ e.on("dragEnd", (e) => a.dragEnd?.(e)),
41
43
  e.on("layout", (e) => a.layout?.(e))
42
44
  ]);
43
45
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"cartesian.js","names":["engineOptions","raw","props","withSeriesType","series","s","item","t","type","stack","curve","useCartesianChart","useChartEngine","createChart","build","chart","handlers","event","view","renderer","rect","useRootStyle","defaultHeight","instance"],"sources":["../../../../../vue/src/components/Chart/cartesian.ts"],"sourcesContent":["import {\n createChart,\n type ChartAnnotation,\n type ChartAxisOptions,\n type ChartCurve,\n type ChartDragEvent,\n type ChartHoverEvent,\n type ChartInstance,\n type ChartInteractionOptions,\n type ChartLegendOptions,\n type ChartOptions,\n type ChartPadding,\n type ChartPlotClickEvent,\n type ChartRect,\n type ChartRendererKind,\n type ChartRendererPreference,\n type ChartSeries,\n type ChartSeriesType,\n type ChartTooltipOptions,\n type ChartView,\n} from \"minerva-design/charts/core\";\nimport { raw, useChartEngine, useRootStyle } from \"./engine\";\nimport type { ChartHandle } from \"./types\";\n\n/** The common props read by `engineOptions` */\ninterface CommonProps {\n xAxis?: ChartAxisOptions;\n yAxis?: ChartAxisOptions;\n renderer?: ChartRendererPreference;\n legend?: boolean | ChartLegendOptions;\n tooltip?: boolean | ChartTooltipOptions;\n crosshair?: boolean;\n annotations?: readonly ChartAnnotation[];\n interaction?: boolean | ChartInteractionOptions;\n padding?: ChartPadding;\n palette?: readonly string[];\n ariaLabel?: string;\n locale?: string;\n labels?: ChartOptions[\"labels\"] | boolean;\n yAxis2?: ChartAxisOptions;\n orientation?: ChartOptions[\"orientation\"];\n}\n\n/** Engine options of the common props */\nexport const engineOptions = (\n props: CommonProps,\n series: readonly ChartSeries[],\n stackMode?: ChartOptions[\"stackMode\"],\n): ChartOptions => ({\n series,\n xAxis: raw(props.xAxis),\n yAxis: raw(props.yAxis),\n renderer: props.renderer,\n legend: raw(props.legend),\n tooltip: raw(props.tooltip),\n crosshair: props.crosshair,\n annotations: raw(props.annotations),\n interaction: raw(props.interaction),\n padding: raw(props.padding),\n palette: raw(props.palette),\n ariaLabel: props.ariaLabel,\n locale: props.locale,\n // BarChart / WaterfallChart: `labels` writes the values (a boolean)\n labels: typeof props.labels === \"object\" ? raw(props.labels) : undefined,\n yAxis2: raw(props.yAxis2),\n orientation: props.orientation,\n stackMode,\n});\n\n/**\n * Gives the series without a `type` the type of the component: `stack` /\n * `curve` apply to the series of that type that do not set their own.\n */\nexport const withSeriesType = (\n series: readonly ChartSeries[],\n type: ChartSeriesType,\n stack?: string,\n curve?: ChartCurve,\n): ChartSeries[] =>\n raw(series).map((item) => {\n const s = raw(item);\n const t = s.type ?? type;\n return {\n ...s,\n data: raw(s.data),\n type: t,\n ...(stack !== undefined && t === type ? { stack: s.stack ?? stack } : {}),\n ...(curve !== undefined && (t === \"line\" || t === \"area\")\n ? { curve: s.curve ?? curve }\n : {}),\n };\n });\n\n/** Engine events forwarded by a cartesian chart */\nexport interface CartesianHandlers {\n hover?: (event: ChartHoverEvent | null) => void;\n click?: (event: ChartHoverEvent) => void;\n plotClick?: (event: ChartPlotClickEvent) => void;\n zoom?: (view: ChartView) => void;\n renderer?: (renderer: ChartRendererKind) => void;\n drag?: (event: ChartDragEvent) => void;\n drop?: (event: ChartDragEvent) => void;\n /** The plot area moved or was resized */\n layout?: (rect: ChartRect) => void;\n}\n\n/** Engine (`createChart`), root style and template handle of a cartesian chart */\nexport function useCartesianChart(\n props: object & {\n deep?: boolean;\n width?: number | string;\n height?: number | string;\n },\n build: () => ChartOptions | null,\n handlers: CartesianHandlers,\n defaultHeight = 320,\n) {\n const { setContainer, instance } = useChartEngine<\n ChartOptions,\n ChartInstance\n >(createChart, props, build, (chart) => [\n chart.on(\"hover\", (event) => handlers.hover?.(event)),\n chart.on(\"click\", (event) => handlers.click?.(event)),\n chart.on(\"plotClick\", (event) => handlers.plotClick?.(event)),\n chart.on(\"zoom\", (view) => handlers.zoom?.(view)),\n chart.on(\"renderer\", (renderer) => handlers.renderer?.(renderer)),\n chart.on(\"drag\", (event) => handlers.drag?.(event)),\n chart.on(\"drop\", (event) => handlers.drop?.(event)),\n chart.on(\"layout\", (rect) => handlers.layout?.(rect)),\n ]);\n const handle: ChartHandle = {\n resetZoom: () => instance.value?.resetZoom(),\n getView: () => instance.value?.getView() ?? null,\n setView: (view) => instance.value?.setView(view),\n getRenderer: () => instance.value?.getRenderer() ?? null,\n getInstance: () => instance.value,\n };\n return {\n setContainer,\n rootStyle: useRootStyle(props, defaultHeight),\n handle,\n };\n}\n"],"mappings":";;;AA4CA,IAAaA,KACX,GACA,GACA,OACkB;CAClB;CACA,OAAOC,EAAIC,EAAM,KAAK;CACtB,OAAOD,EAAIC,EAAM,KAAK;CACtB,UAAUA,EAAM;CAChB,QAAQD,EAAIC,EAAM,MAAM;CACxB,SAASD,EAAIC,EAAM,OAAO;CAC1B,WAAWA,EAAM;CACjB,aAAaD,EAAIC,EAAM,WAAW;CAClC,aAAaD,EAAIC,EAAM,WAAW;CAClC,SAASD,EAAIC,EAAM,OAAO;CAC1B,SAASD,EAAIC,EAAM,OAAO;CAC1B,WAAWA,EAAM;CACjB,QAAQA,EAAM;CAEd,QAAQ,OAAOA,EAAM,UAAW,WAAWD,EAAIC,EAAM,MAAM,IAAI,KAAA;CAC/D,QAAQD,EAAIC,EAAM,MAAM;CACxB,aAAaA,EAAM;CACnB;AACF,IAMaC,KACX,GACA,GACA,GACA,MAEAF,EAAIG,CAAM,CAAC,CAAC,KAAK,MAAS;CACxB,IAAMC,IAAIJ,EAAIK,CAAI,GACZC,IAAIF,EAAE,QAAQG;CACpB,OAAO;EACL,GAAGH;EACH,MAAMJ,EAAII,EAAE,IAAI;EAChB,MAAME;EACN,GAAIE,MAAU,KAAA,KAAaF,MAAMC,IAAO,EAAE,OAAOH,EAAE,SAASI,EAAM,IAAI,CAAC;EACvE,GAAIC,MAAU,KAAA,MAAcH,MAAM,UAAUA,MAAM,UAC9C,EAAE,OAAOF,EAAE,SAASK,EAAM,IAC1B,CAAC;CACP;AACF,CAAC;AAgBH,SAAgBC,EACd,GAKA,GACA,GACA,IAAgB,KAChB;CACA,IAAM,EAAE,iBAAc,gBAAaC,EAGjCC,GAAaX,GAAOY,IAAQ,MAAU;EACtCC,EAAM,GAAG,UAAU,MAAUC,EAAS,QAAQC,CAAK,CAAC;EACpDF,EAAM,GAAG,UAAU,MAAUC,EAAS,QAAQC,CAAK,CAAC;EACpDF,EAAM,GAAG,cAAc,MAAUC,EAAS,YAAYC,CAAK,CAAC;EAC5DF,EAAM,GAAG,SAAS,MAASC,EAAS,OAAOE,CAAI,CAAC;EAChDH,EAAM,GAAG,aAAa,MAAaC,EAAS,WAAWG,CAAQ,CAAC;EAChEJ,EAAM,GAAG,SAAS,MAAUC,EAAS,OAAOC,CAAK,CAAC;EAClDF,EAAM,GAAG,SAAS,MAAUC,EAAS,OAAOC,CAAK,CAAC;EAClDF,EAAM,GAAG,WAAW,MAASC,EAAS,SAASI,CAAI,CAAC;CACtD,CAAC;CAQD,OAAO;EACL;EACA,WAAWC,EAAanB,GAAOoB,CAAa;EAC5C,QAAA;GATA,iBAAiBC,EAAS,OAAO,UAAU;GAC3C,eAAeA,EAAS,OAAO,QAAQ,KAAK;GAC5C,UAAU,MAASA,EAAS,OAAO,QAAQL,CAAI;GAC/C,mBAAmBK,EAAS,OAAO,YAAY,KAAK;GACpD,mBAAmBA,EAAS;EAK5B;CACF;AACF"}
1
+ {"version":3,"file":"cartesian.js","names":["engineOptions","raw","props","withSeriesType","series","s","item","t","type","stack","curve","useCartesianChart","useChartEngine","createChart","build","chart","handlers","event","view","renderer","rect","useRootStyle","defaultHeight","instance"],"sources":["../../../../../vue/src/components/Chart/cartesian.ts"],"sourcesContent":["import {\n createChart,\n type ChartAnnotation,\n type ChartAxisOptions,\n type ChartCurve,\n type ChartDragEndEvent,\n type ChartDragEvent,\n type ChartHoverEvent,\n type ChartInstance,\n type ChartInteractionOptions,\n type ChartLegendOptions,\n type ChartOptions,\n type ChartPadding,\n type ChartPlotClickEvent,\n type ChartRect,\n type ChartRendererKind,\n type ChartRendererPreference,\n type ChartSeries,\n type ChartSeriesType,\n type ChartTooltipOptions,\n type ChartView,\n} from \"minerva-design/charts/core\";\nimport { raw, useChartEngine, useRootStyle } from \"./engine\";\nimport type { ChartHandle } from \"./types\";\n\n/** The common props read by `engineOptions` */\ninterface CommonProps {\n xAxis?: ChartAxisOptions;\n yAxis?: ChartAxisOptions;\n renderer?: ChartRendererPreference;\n legend?: boolean | ChartLegendOptions;\n tooltip?: boolean | ChartTooltipOptions;\n crosshair?: boolean;\n annotations?: readonly ChartAnnotation[];\n interaction?: boolean | ChartInteractionOptions;\n padding?: ChartPadding;\n palette?: readonly string[];\n ariaLabel?: string;\n locale?: string;\n labels?: ChartOptions[\"labels\"] | boolean;\n yAxis2?: ChartAxisOptions;\n orientation?: ChartOptions[\"orientation\"];\n}\n\n/** Engine options of the common props */\nexport const engineOptions = (\n props: CommonProps,\n series: readonly ChartSeries[],\n stackMode?: ChartOptions[\"stackMode\"],\n): ChartOptions => ({\n series,\n xAxis: raw(props.xAxis),\n yAxis: raw(props.yAxis),\n renderer: props.renderer,\n legend: raw(props.legend),\n tooltip: raw(props.tooltip),\n crosshair: props.crosshair,\n annotations: raw(props.annotations),\n interaction: raw(props.interaction),\n padding: raw(props.padding),\n palette: raw(props.palette),\n ariaLabel: props.ariaLabel,\n locale: props.locale,\n // BarChart / WaterfallChart: `labels` writes the values (a boolean)\n labels: typeof props.labels === \"object\" ? raw(props.labels) : undefined,\n yAxis2: raw(props.yAxis2),\n orientation: props.orientation,\n stackMode,\n});\n\n/**\n * Gives the series without a `type` the type of the component: `stack` /\n * `curve` apply to the series of that type that do not set their own.\n */\nexport const withSeriesType = (\n series: readonly ChartSeries[],\n type: ChartSeriesType,\n stack?: string,\n curve?: ChartCurve,\n): ChartSeries[] =>\n raw(series).map((item) => {\n const s = raw(item);\n const t = s.type ?? type;\n return {\n ...s,\n data: raw(s.data),\n type: t,\n ...(stack !== undefined && t === type ? { stack: s.stack ?? stack } : {}),\n ...(curve !== undefined && (t === \"line\" || t === \"area\")\n ? { curve: s.curve ?? curve }\n : {}),\n };\n });\n\n/** Engine events forwarded by a cartesian chart */\nexport interface CartesianHandlers {\n hover?: (event: ChartHoverEvent | null) => void;\n click?: (event: ChartHoverEvent) => void;\n plotClick?: (event: ChartPlotClickEvent) => void;\n zoom?: (view: ChartView) => void;\n renderer?: (renderer: ChartRendererKind) => void;\n /** A point starts moving with the pointer */\n dragStart?: (event: ChartDragEvent) => void;\n drag?: (event: ChartDragEvent) => void;\n drop?: (event: ChartDragEvent) => void;\n /** The drag is over (after `drop`, or cancelled) */\n dragEnd?: (event: ChartDragEndEvent) => void;\n /** The plot area moved or was resized */\n layout?: (rect: ChartRect) => void;\n}\n\n/** Engine (`createChart`), root style and template handle of a cartesian chart */\nexport function useCartesianChart(\n props: object & {\n deep?: boolean;\n width?: number | string;\n height?: number | string;\n },\n build: () => ChartOptions | null,\n handlers: CartesianHandlers,\n defaultHeight = 320,\n) {\n const { setContainer, instance } = useChartEngine<\n ChartOptions,\n ChartInstance\n >(createChart, props, build, (chart) => [\n chart.on(\"hover\", (event) => handlers.hover?.(event)),\n chart.on(\"click\", (event) => handlers.click?.(event)),\n chart.on(\"plotClick\", (event) => handlers.plotClick?.(event)),\n chart.on(\"zoom\", (view) => handlers.zoom?.(view)),\n chart.on(\"renderer\", (renderer) => handlers.renderer?.(renderer)),\n chart.on(\"dragStart\", (event) => handlers.dragStart?.(event)),\n chart.on(\"drag\", (event) => handlers.drag?.(event)),\n chart.on(\"drop\", (event) => handlers.drop?.(event)),\n chart.on(\"dragEnd\", (event) => handlers.dragEnd?.(event)),\n chart.on(\"layout\", (rect) => handlers.layout?.(rect)),\n ]);\n const handle: ChartHandle = {\n resetZoom: () => instance.value?.resetZoom(),\n getView: () => instance.value?.getView() ?? null,\n setView: (view) => instance.value?.setView(view),\n getRenderer: () => instance.value?.getRenderer() ?? null,\n getInstance: () => instance.value,\n };\n return {\n setContainer,\n rootStyle: useRootStyle(props, defaultHeight),\n handle,\n };\n}\n"],"mappings":";;;AA6CA,IAAaA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S,OAAOE,CAAI,CAAC;EAChDH,EAAM,GAAG,aAAa,MAAaC,EAAS,WAAWG,CAAQ,CAAC;EAChEJ,EAAM,GAAG,cAAc,MAAUC,EAAS,YAAYC,CAAK,CAAC;EAC5DF,EAAM,GAAG,SAAS,MAAUC,EAAS,OAAOC,CAAK,CAAC;EAClDF,EAAM,GAAG,SAAS,MAAUC,EAAS,OAAOC,CAAK,CAAC;EAClDF,EAAM,GAAG,YAAY,MAAUC,EAAS,UAAUC,CAAK,CAAC;EACxDF,EAAM,GAAG,WAAW,MAASC,EAAS,SAASI,CAAI,CAAC;CACtD,CAAC;CAQD,OAAO;EACL;EACA,WAAWC,EAAanB,GAAOoB,CAAa;EAC5C,QAAA;GATA,iBAAiBC,EAAS,OAAO,UAAU;GAC3C,eAAeA,EAAS,OAAO,QAAQ,KAAK;GAC5C,UAAU,MAASA,EAAS,OAAO,QAAQL,CAAI;GAC/C,mBAAmBK,EAAS,OAAO,YAAY,KAAK;GACpD,mBAAmBA,EAAS;EAK5B;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"QuadrantTaskBoard.vue.js","names":["_sfc_main","QuadrantTaskBoard_vue_vue_type_script_setup_true_lang_default","QuadrantTaskBoard_default"],"sources":["../../../../../vue/src/components/QuadrantTaskBoard/QuadrantTaskBoard.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * QuadrantTaskBoard: a task board on a four-quadrant matrix (QuadrantChart):\n * an add button per quadrant, edit and delete buttons on the active task, an\n * inline panel anchored at the button or the task to name a task and pick its\n * quadrant, an inline confirmation before a delete, drag and drop and\n * keyboard moves (Shift + arrows). Controlled:\n * `points` in, `update:points` / `pointsChange` out (`v-model:points`).\n * Every other prop goes to the QuadrantChart.\n */\nimport {\n computed,\n h,\n ref,\n shallowRef,\n useId,\n watch,\n type FunctionalComponent,\n type PropType,\n} from \"vue\";\nimport {\n QUADRANT_CORNERS,\n QUADRANT_TASK_ICONS,\n applyQuadrantTaskDraft,\n canSaveQuadrantTask,\n editQuadrantTaskDraft,\n moveQuadrantTask,\n newQuadrantTaskDraft,\n placeQuadrantTaskPanel,\n quadrantCountText,\n quadrantLabels,\n quadrantTaskColor,\n quadrantTaskDeleteText,\n quadrantTaskLabels,\n removeQuadrantTask,\n selectionAfterRemove,\n type ChartHoverEvent,\n type ChartRendererKind,\n type ChartView,\n type QuadrantCorner,\n type QuadrantPoint,\n type QuadrantTaskBox,\n type QuadrantTaskDraft,\n type QuadrantTaskLabels,\n} from \"minerva-design/charts/core\";\nimport styles from \"@react-styles/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss\";\nimport QuadrantChart from \"../Chart/QuadrantChart.vue\";\nimport { quadrantChartProps } from \"../Chart/props\";\nimport type { ChartHandle, QuadrantDropTarget } from \"../Chart/types\";\nimport { Button } from \"../Button\";\nimport { IconButton } from \"../IconButton\";\nimport { Input } from \"../Input\";\nimport { useI18n } from \"../../config/useI18n\";\n\ndefineOptions({ name: \"QuadrantTaskBoard\", inheritAttrs: false });\n\nconst props = defineProps({\n ...quadrantChartProps,\n /** Texts of the buttons and panels (localized by default) */\n labels: Object as PropType<Partial<QuadrantTaskLabels>>,\n});\nconst emit = defineEmits<{\n /**\n * The next list of tasks after an add, an edit, a delete, a drag and drop\n * or a keyboard move (`v-model:points`)\n */\n \"update:points\": [points: QuadrantPoint[]];\n /** Same as `update:points` */\n pointsChange: [points: QuadrantPoint[]];\n /** The hovered (or keyboard-focused) point changed (`null`: none) */\n hover: [event: ChartHoverEvent | null];\n /** A point was clicked (it becomes the active task) */\n pointClick: [point: QuadrantPoint, index: number];\n /** A point is being dragged (on every move, with the quadrant under the pointer) */\n pointDrag: [point: QuadrantPoint, index: number, target: QuadrantDropTarget];\n /** The user zoomed or panned */\n zoom: [view: ChartView];\n /** The backend is ready (or fell back after a GPU loss) */\n rendererChange: [renderer: ChartRendererKind];\n}>();\n\nconst ActionIcon: FunctionalComponent<{\n kind: keyof typeof QUADRANT_TASK_ICONS;\n}> = ({ kind }) =>\n h(\n \"svg\",\n {\n width: 16,\n height: 16,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": 1.8,\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n },\n [h(\"path\", { d: QUADRANT_TASK_ICONS[kind] })],\n );\nActionIcon.props = [\"kind\"];\n\n/** The inline panel: the add / edit form, or the delete confirmation */\ntype Panel =\n | { kind: \"draft\"; draft: QuadrantTaskDraft; anchor: QuadrantTaskBox }\n | { kind: \"delete\"; index: number; anchor: QuadrantTaskBox };\n\n/** Half the size of the box around a task the panel keeps clear */\nconst DOT = 10;\nconst NO_BOX: QuadrantTaskBox = { x: 0, y: 0, width: 0, height: 0 };\n\nconst { language } = useI18n();\nconst locale = computed(() => props.locale ?? language.value);\nconst texts = computed(() => quadrantTaskLabels(locale.value, props.labels));\nconst defaults = computed(() => quadrantLabels(locale.value));\nconst title = (corner: QuadrantCorner) =>\n props.quadrants?.[corner]?.label || defaults.value[corner];\nconst geometry = () => ({\n xDomain: props.xDomain,\n yDomain: props.yDomain,\n xSplit: props.xSplit,\n ySplit: props.ySplit,\n reverseX: props.reverseX,\n});\n// the props of the chart (`labels` are the texts of the board)\nconst chartProps = computed(() => {\n const {\n labels: _labels,\n points: _points,\n locale: _locale,\n selectedIndex: _selectedIndex,\n ...rest\n } = props;\n return rest;\n});\n\nconst id = useId();\nconst board = ref<HTMLDivElement | null>(null);\nconst panelEl = ref<HTMLDivElement | null>(null);\nconst panel = ref<Panel | null>(null);\nconst selection = ref<number | null>(null);\nconst selected = computed(() =>\n props.selectedIndex !== undefined ? props.selectedIndex : selection.value,\n);\nlet lastPointer: QuadrantTaskBox | null = null;\nlet returnFocus: HTMLElement | null = null;\n\nconst change = (points: QuadrantPoint[]) => {\n emit(\"update:points\", points);\n emit(\"pointsChange\", points);\n};\nconst color = (corner: QuadrantCorner) =>\n quadrantTaskColor(props.quadrants, corner);\n\n/** Box of an element, relative to the board */\nconst boxOf = (el: Element | null | undefined): QuadrantTaskBox | null => {\n const root = board.value;\n if (!el || !root) return null;\n const b = root.getBoundingClientRect();\n const r = el.getBoundingClientRect();\n return {\n x: r.left - b.left,\n y: r.top - b.top,\n width: r.width,\n height: r.height,\n };\n};\n/** Box around a task (its anchor in the chart), else the last pointer */\nconst pointBox = (index: number): QuadrantTaskBox => {\n const box = boxOf(\n board.value?.querySelector(\n `.minerva-chart-quadrant-point[data-point-index=\"${index}\"]`,\n ),\n );\n if (box)\n return {\n x: box.x - DOT,\n y: box.y - DOT,\n width: 2 * DOT,\n height: 2 * DOT,\n };\n return lastPointer ?? NO_BOX;\n};\nconst trackPointer = (event: PointerEvent) => {\n const root = board.value;\n if (!root) return;\n const b = root.getBoundingClientRect();\n lastPointer = {\n x: event.clientX - b.left,\n y: event.clientY - b.top,\n width: 0,\n height: 0,\n };\n};\n\nconst open = (next: Panel) => {\n if (!panel.value) {\n const active = document.activeElement;\n returnFocus = active instanceof HTMLElement ? active : null;\n }\n panel.value = next;\n};\nconst close = () => {\n panel.value = null;\n const target = returnFocus;\n returnFocus = null;\n if (target?.isConnected) target.focus();\n};\nconst add = (corner: QuadrantCorner, event: MouseEvent) =>\n open({\n kind: \"draft\",\n draft: newQuadrantTaskDraft(geometry(), corner),\n anchor: boxOf(event.currentTarget as Element | null) ?? NO_BOX,\n });\nconst addAt = (corner: QuadrantCorner, at: { x: number; y: number }) =>\n open({\n kind: \"draft\",\n draft: newQuadrantTaskDraft(geometry(), corner, at),\n anchor: lastPointer ?? NO_BOX,\n });\nconst edit = (index: number, anchor = pointBox(index)) => {\n const draft = editQuadrantTaskDraft(geometry(), props.points, index);\n if (draft) open({ kind: \"draft\", draft, anchor });\n};\nconst confirmRemove = (index: number) =>\n open({ kind: \"delete\", index, anchor: pointBox(index) });\nconst setDraft = (patch: Partial<QuadrantTaskDraft>) => {\n const old = panel.value;\n if (old?.kind === \"draft\")\n panel.value = { ...old, draft: { ...old.draft, ...patch } };\n};\n\nconst draft = computed(() =>\n panel.value?.kind === \"draft\" ? panel.value.draft : null,\n);\nconst deleting = computed(() =>\n panel.value?.kind === \"delete\" ? panel.value.index : null,\n);\nconst shown = computed(() => {\n if (!panel.value) return false;\n if (draft.value)\n return draft.value.index === null || !!props.points[draft.value.index];\n return deleting.value !== null && !!props.points[deleting.value];\n});\nconst anchor = computed(() => (shown.value ? panel.value!.anchor : null));\nconst kind = computed(() => (shown.value ? panel.value!.kind : null));\nconst canSave = computed(() => canSaveQuadrantTask(draft.value, props.points));\n\nconst save = () => {\n const saved = applyQuadrantTaskDraft(geometry(), props.points, draft.value);\n if (!saved) return;\n change(saved.points);\n selection.value = saved.index;\n close();\n};\nconst remove = () => {\n const index = deleting.value;\n if (index !== null && props.points[index]) {\n change(removeQuadrantTask(props.points, index));\n selection.value = selectionAfterRemove(selection.value, index);\n }\n close();\n};\nconst onPanelKeydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n event.preventDefault();\n event.stopPropagation();\n close();\n};\n\n// next to its anchor, inside the board, once rendered; then the first field\n// (or Cancel) takes the focus\nwatch(\n [anchor, kind],\n ([box]) => {\n const el = panelEl.value;\n const root = board.value;\n if (!el || !root || !box) return;\n const place = placeQuadrantTaskPanel(\n box,\n { width: el.offsetWidth, height: el.offsetHeight },\n { width: root.clientWidth, height: root.clientHeight },\n );\n el.style.left = `${place.x}px`;\n el.style.top = `${place.y}px`;\n el.style.transformOrigin = `${place.origin.x}px ${place.origin.y}px`;\n el.dataset.placement = place.placement;\n el.querySelector<HTMLElement>(\"[data-autofocus]\")?.focus({\n preventScroll: true,\n });\n },\n { flush: \"post\" },\n);\n\n// a press outside the panel closes it, like a popover\nwatch(\n shown,\n (isShown, _old, onCleanup) => {\n if (!isShown) return;\n const onDown = (event: PointerEvent) => {\n const target = event.target as Node | null;\n if (target && panelEl.value?.contains(target)) return;\n panel.value = null;\n returnFocus = null;\n };\n document.addEventListener(\"pointerdown\", onDown, true);\n onCleanup(() => document.removeEventListener(\"pointerdown\", onDown, true));\n },\n { flush: \"post\" },\n);\n\nconst onPointClick = (point: QuadrantPoint, index: number) => {\n selection.value = index;\n emit(\"pointClick\", point, index);\n};\nconst onPointDrop = (\n _point: QuadrantPoint,\n index: number,\n target: QuadrantDropTarget,\n) => {\n change(moveQuadrantTask(props.points, index, target));\n selection.value = index;\n};\n\nconst chart = shallowRef<ChartHandle | null>(null);\nconst handle: ChartHandle = {\n resetZoom: () => chart.value?.resetZoom(),\n getView: () => chart.value?.getView() ?? null,\n setView: (view) => chart.value?.setView(view),\n getRenderer: () => chart.value?.getRenderer() ?? null,\n getInstance: () => chart.value?.getInstance() ?? null,\n};\ndefineExpose(handle);\n</script>\n\n<template>\n <div\n ref=\"board\"\n :class=\"styles.board\"\n :data-panel=\"kind ?? undefined\"\n @pointerdown.capture=\"trackPointer\"\n >\n <QuadrantChart\n ref=\"chart\"\n v-bind=\"{ ...chartProps, ...$attrs }\"\n :points=\"points\"\n :locale=\"locale\"\n :selected-index=\"selected\"\n @hover=\"emit('hover', $event)\"\n @point-click=\"onPointClick\"\n @point-double-click=\"(_point, index) => edit(index)\"\n @point-drag=\"\n (point, index, target) => emit('pointDrag', point, index, target)\n \"\n @point-drop=\"onPointDrop\"\n @quadrant-click=\"addAt\"\n @zoom=\"emit('zoom', $event)\"\n @renderer-change=\"emit('rendererChange', $event)\"\n >\n <template #point-actions=\"{ index }\">\n <div\n role=\"toolbar\"\n :aria-label=\"texts.actions\"\n :class=\"styles.actions\"\n @pointerdown.stop\n >\n <IconButton\n size=\"small\"\n variant=\"ghost\"\n :label=\"texts.edit\"\n @click=\"edit(index)\"\n >\n <ActionIcon kind=\"edit\" />\n </IconButton>\n <IconButton\n size=\"small\"\n variant=\"ghost\"\n color=\"danger\"\n :label=\"texts.delete\"\n @click=\"confirmRemove(index)\"\n >\n <ActionIcon kind=\"delete\" />\n </IconButton>\n </div>\n </template>\n <template #quadrant-header=\"{ corner, info }\">\n <div :class=\"styles.header\" :data-corner=\"corner\">\n <span v-if=\"info.region?.badge\" :class=\"styles.badge\">{{\n info.region.badge\n }}</span>\n <span :class=\"styles.title\">{{ title(corner) }}</span>\n <span v-if=\"showCounts !== false\" :class=\"styles.count\">{{\n quadrantCountText(showCounts ?? true, info.points, locale)\n }}</span>\n <IconButton\n size=\"xsmall\"\n variant=\"ghost\"\n :class=\"styles.add\"\n :label=\"`${texts.add} · ${title(corner)}`\"\n :aria-expanded=\"\n shown && draft?.index === null && draft.quadrant === corner\n \"\n @click=\"(event: MouseEvent) => add(corner, event)\"\n >\n <ActionIcon kind=\"add\" />\n </IconButton>\n </div>\n </template>\n </QuadrantChart>\n <div\n v-if=\"shown && draft\"\n ref=\"panelEl\"\n role=\"dialog\"\n :aria-labelledby=\"`${id}-title`\"\n :class=\"styles.panel\"\n :data-quadrant-task-panel=\"draft.index === null ? 'add' : 'edit'\"\n @keydown=\"onPanelKeydown\"\n >\n <form :class=\"styles.form\" @submit.prevent=\"save\">\n <h3 :id=\"`${id}-title`\" :class=\"styles.panelTitle\">\n {{ draft.index === null ? texts.add : texts.edit }}\n </h3>\n <label :class=\"styles.field\">\n <span>{{ texts.name }}</span>\n <Input\n required\n size=\"small\"\n data-autofocus=\"\"\n :model-value=\"draft.label\"\n :aria-label=\"texts.name\"\n @update:model-value=\"(label: string) => setDraft({ label })\"\n />\n </label>\n <fieldset :class=\"styles.quadrants\">\n <legend>{{ texts.quadrant }}</legend>\n <div :class=\"styles.quadrantGrid\">\n <label\n v-for=\"corner in QUADRANT_CORNERS\"\n :key=\"corner\"\n :class=\"styles.quadrant\"\n :data-corner=\"corner\"\n >\n <input\n type=\"radio\"\n :name=\"`${id}-quadrant`\"\n :value=\"corner\"\n :checked=\"draft.quadrant === corner\"\n @change=\"setDraft({ quadrant: corner })\"\n />\n <span\n :class=\"styles.swatch\"\n :style=\"{ background: color(corner) }\"\n aria-hidden=\"true\"\n />\n <span :class=\"styles.quadrantName\">{{ title(corner) }}</span>\n </label>\n </div>\n </fieldset>\n <div :class=\"styles.footer\">\n <Button size=\"small\" color=\"neutral\" variant=\"ghost\" @click=\"close\">\n {{ texts.cancel }}\n </Button>\n <Button size=\"small\" type=\"submit\" :disabled=\"!canSave\">\n {{ texts.save }}\n </Button>\n </div>\n </form>\n </div>\n <div\n v-else-if=\"shown && deleting !== null\"\n ref=\"panelEl\"\n role=\"alertdialog\"\n :aria-labelledby=\"`${id}-title`\"\n :aria-describedby=\"`${id}-text`\"\n :class=\"styles.panel\"\n data-quadrant-task-panel=\"delete\"\n @keydown=\"onPanelKeydown\"\n >\n <h3 :id=\"`${id}-title`\" :class=\"styles.panelTitle\">\n {{ texts.delete }}\n </h3>\n <p :id=\"`${id}-text`\" :class=\"styles.panelText\">\n {{ quadrantTaskDeleteText(texts, points[deleting]) }}\n </p>\n <div :class=\"styles.footer\">\n <Button\n size=\"small\"\n color=\"neutral\"\n variant=\"ghost\"\n data-autofocus=\"\"\n @click=\"close\"\n >\n {{ texts.cancel }}\n </Button>\n <Button size=\"small\" color=\"danger\" @click=\"remove\">\n {{ texts.confirmDelete }}\n </Button>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"QuadrantTaskBoard.vue.js","names":["_sfc_main","QuadrantTaskBoard_vue_vue_type_script_setup_true_lang_default","QuadrantTaskBoard_default"],"sources":["../../../../../vue/src/components/QuadrantTaskBoard/QuadrantTaskBoard.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * QuadrantTaskBoard: a task board on a four-quadrant matrix (QuadrantChart):\n * an add button per quadrant, edit and delete buttons on the active task, an\n * inline panel anchored at the button or the task to name a task and pick its\n * quadrant, an inline confirmation before a delete, drag and drop and\n * keyboard moves (Shift + arrows). Controlled:\n * `points` in, `update:points` / `pointsChange` out (`v-model:points`).\n * Every other prop goes to the QuadrantChart.\n */\nimport {\n computed,\n h,\n ref,\n shallowRef,\n useId,\n watch,\n type FunctionalComponent,\n type PropType,\n} from \"vue\";\nimport {\n QUADRANT_CORNERS,\n QUADRANT_TASK_ICONS,\n applyQuadrantTaskDraft,\n canSaveQuadrantTask,\n editQuadrantTaskDraft,\n moveQuadrantTask,\n newQuadrantTaskDraft,\n placeQuadrantTaskPanel,\n quadrantCountText,\n quadrantLabels,\n quadrantTaskColor,\n quadrantTaskDeleteText,\n quadrantTaskLabels,\n removeQuadrantTask,\n selectionAfterRemove,\n type ChartHoverEvent,\n type ChartRendererKind,\n type ChartView,\n type QuadrantCorner,\n type QuadrantPoint,\n type QuadrantTaskBox,\n type QuadrantTaskDraft,\n type QuadrantTaskLabels,\n} from \"minerva-design/charts/core\";\nimport styles from \"@react-styles/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss\";\nimport QuadrantChart from \"../Chart/QuadrantChart.vue\";\nimport { quadrantChartProps } from \"../Chart/props\";\nimport type { ChartHandle, QuadrantDropTarget } from \"../Chart/types\";\nimport { Button } from \"../Button\";\nimport { IconButton } from \"../IconButton\";\nimport { Input } from \"../Input\";\nimport { useI18n } from \"../../config/useI18n\";\n\ndefineOptions({ name: \"QuadrantTaskBoard\", inheritAttrs: false });\n\nconst props = defineProps({\n ...quadrantChartProps,\n /** Texts of the buttons and panels (localized by default) */\n labels: Object as PropType<Partial<QuadrantTaskLabels>>,\n});\nconst emit = defineEmits<{\n /**\n * The next list of tasks after an add, an edit, a delete, a drag and drop\n * or a keyboard move (`v-model:points`)\n */\n \"update:points\": [points: QuadrantPoint[]];\n /** Same as `update:points` */\n pointsChange: [points: QuadrantPoint[]];\n /** The hovered (or keyboard-focused) point changed (`null`: none) */\n hover: [event: ChartHoverEvent | null];\n /** A point was clicked (it becomes the active task) */\n pointClick: [point: QuadrantPoint, index: number];\n /** A point is being dragged (on every move, with the quadrant under the pointer) */\n pointDrag: [point: QuadrantPoint, index: number, target: QuadrantDropTarget];\n /** The user zoomed or panned */\n zoom: [view: ChartView];\n /** The backend is ready (or fell back after a GPU loss) */\n rendererChange: [renderer: ChartRendererKind];\n}>();\n\nconst ActionIcon: FunctionalComponent<{\n kind: keyof typeof QUADRANT_TASK_ICONS;\n size?: number;\n}> = ({ kind, size = 16 }) =>\n h(\n \"svg\",\n {\n width: size,\n height: size,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": 1.8,\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n },\n [h(\"path\", { d: QUADRANT_TASK_ICONS[kind] })],\n );\nActionIcon.props = [\"kind\", \"size\"];\n\n/** The inline panel: the add / edit form, or the delete confirmation */\ntype Panel =\n | { kind: \"draft\"; draft: QuadrantTaskDraft; anchor: QuadrantTaskBox }\n | { kind: \"delete\"; index: number; anchor: QuadrantTaskBox };\n\n/** Half the size of the box around a task the panel keeps clear */\nconst DOT = 10;\nconst NO_BOX: QuadrantTaskBox = { x: 0, y: 0, width: 0, height: 0 };\n\nconst { language } = useI18n();\nconst locale = computed(() => props.locale ?? language.value);\nconst texts = computed(() => quadrantTaskLabels(locale.value, props.labels));\nconst defaults = computed(() => quadrantLabels(locale.value));\nconst title = (corner: QuadrantCorner) =>\n props.quadrants?.[corner]?.label || defaults.value[corner];\nconst geometry = () => ({\n xDomain: props.xDomain,\n yDomain: props.yDomain,\n xSplit: props.xSplit,\n ySplit: props.ySplit,\n reverseX: props.reverseX,\n});\n// the props of the chart (`labels` are the texts of the board)\nconst chartProps = computed(() => {\n const {\n labels: _labels,\n points: _points,\n locale: _locale,\n selectedIndex: _selectedIndex,\n ...rest\n } = props;\n return rest;\n});\n\nconst id = useId();\nconst board = ref<HTMLDivElement | null>(null);\nconst panelEl = ref<HTMLDivElement | null>(null);\nconst panel = ref<Panel | null>(null);\nconst selection = ref<number | null>(null);\nconst selected = computed(() =>\n props.selectedIndex !== undefined ? props.selectedIndex : selection.value,\n);\nlet lastPointer: QuadrantTaskBox | null = null;\nlet returnFocus: HTMLElement | null = null;\n\nconst change = (points: QuadrantPoint[]) => {\n emit(\"update:points\", points);\n emit(\"pointsChange\", points);\n};\nconst color = (corner: QuadrantCorner) =>\n quadrantTaskColor(props.quadrants, corner);\n\n/** Box of an element, relative to the board */\nconst boxOf = (el: Element | null | undefined): QuadrantTaskBox | null => {\n const root = board.value;\n if (!el || !root) return null;\n const b = root.getBoundingClientRect();\n const r = el.getBoundingClientRect();\n return {\n x: r.left - b.left,\n y: r.top - b.top,\n width: r.width,\n height: r.height,\n };\n};\n/** Box around a task (the dot of its point card), else the last pointer */\nconst pointBox = (index: number): QuadrantTaskBox => {\n const box = boxOf(\n board.value?.querySelector(\n `.minerva-chart-quadrant-card[data-point-preview=\"${index}\"] [data-card-dot]`,\n ),\n );\n if (box)\n return {\n x: box.x + box.width / 2 - DOT,\n y: box.y + box.height / 2 - DOT,\n width: 2 * DOT,\n height: 2 * DOT,\n };\n return lastPointer ?? NO_BOX;\n};\nconst trackPointer = (event: PointerEvent) => {\n const root = board.value;\n if (!root) return;\n const b = root.getBoundingClientRect();\n lastPointer = {\n x: event.clientX - b.left,\n y: event.clientY - b.top,\n width: 0,\n height: 0,\n };\n};\n\nconst open = (next: Panel) => {\n if (!panel.value) {\n const active = document.activeElement;\n returnFocus = active instanceof HTMLElement ? active : null;\n }\n panel.value = next;\n};\nconst close = () => {\n panel.value = null;\n const target = returnFocus;\n returnFocus = null;\n if (target?.isConnected) target.focus();\n};\nconst add = (corner: QuadrantCorner, event: MouseEvent) =>\n open({\n kind: \"draft\",\n draft: newQuadrantTaskDraft(geometry(), corner),\n anchor: boxOf(event.currentTarget as Element | null) ?? NO_BOX,\n });\nconst addAt = (corner: QuadrantCorner, at: { x: number; y: number }) =>\n open({\n kind: \"draft\",\n draft: newQuadrantTaskDraft(geometry(), corner, at),\n anchor: lastPointer ?? NO_BOX,\n });\nconst edit = (index: number, anchor = pointBox(index)) => {\n const draft = editQuadrantTaskDraft(geometry(), props.points, index);\n if (draft) open({ kind: \"draft\", draft, anchor });\n};\nconst confirmRemove = (index: number) =>\n open({ kind: \"delete\", index, anchor: pointBox(index) });\nconst setDraft = (patch: Partial<QuadrantTaskDraft>) => {\n const old = panel.value;\n if (old?.kind === \"draft\")\n panel.value = { ...old, draft: { ...old.draft, ...patch } };\n};\n\nconst draft = computed(() =>\n panel.value?.kind === \"draft\" ? panel.value.draft : null,\n);\nconst deleting = computed(() =>\n panel.value?.kind === \"delete\" ? panel.value.index : null,\n);\nconst shown = computed(() => {\n if (!panel.value) return false;\n if (draft.value)\n return draft.value.index === null || !!props.points[draft.value.index];\n return deleting.value !== null && !!props.points[deleting.value];\n});\nconst anchor = computed(() => (shown.value ? panel.value!.anchor : null));\nconst kind = computed(() => (shown.value ? panel.value!.kind : null));\nconst canSave = computed(() => canSaveQuadrantTask(draft.value, props.points));\n\nconst save = () => {\n const saved = applyQuadrantTaskDraft(geometry(), props.points, draft.value);\n if (!saved) return;\n change(saved.points);\n selection.value = saved.index;\n close();\n};\nconst remove = () => {\n const index = deleting.value;\n if (index !== null && props.points[index]) {\n change(removeQuadrantTask(props.points, index));\n selection.value = selectionAfterRemove(selection.value, index);\n }\n close();\n};\nconst onPanelKeydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n event.preventDefault();\n event.stopPropagation();\n close();\n};\n\n// next to its anchor, inside the board, once rendered; then the first field\n// (or Cancel) takes the focus\nwatch(\n [anchor, kind],\n ([box]) => {\n const el = panelEl.value;\n const root = board.value;\n if (!el || !root || !box) return;\n const place = placeQuadrantTaskPanel(\n box,\n { width: el.offsetWidth, height: el.offsetHeight },\n { width: root.clientWidth, height: root.clientHeight },\n );\n el.style.left = `${place.x}px`;\n el.style.top = `${place.y}px`;\n el.style.transformOrigin = `${place.origin.x}px ${place.origin.y}px`;\n el.dataset.placement = place.placement;\n el.querySelector<HTMLElement>(\"[data-autofocus]\")?.focus({\n preventScroll: true,\n });\n },\n { flush: \"post\" },\n);\n\n// a press outside the panel closes it, like a popover\nwatch(\n shown,\n (isShown, _old, onCleanup) => {\n if (!isShown) return;\n const onDown = (event: PointerEvent) => {\n const target = event.target as Node | null;\n if (target && panelEl.value?.contains(target)) return;\n panel.value = null;\n returnFocus = null;\n };\n document.addEventListener(\"pointerdown\", onDown, true);\n onCleanup(() => document.removeEventListener(\"pointerdown\", onDown, true));\n },\n { flush: \"post\" },\n);\n\nconst onPointClick = (point: QuadrantPoint, index: number) => {\n selection.value = index;\n emit(\"pointClick\", point, index);\n};\nconst onPointDrop = (\n _point: QuadrantPoint,\n index: number,\n target: QuadrantDropTarget,\n) => {\n change(moveQuadrantTask(props.points, index, target));\n selection.value = index;\n};\n\nconst chart = shallowRef<ChartHandle | null>(null);\nconst handle: ChartHandle = {\n resetZoom: () => chart.value?.resetZoom(),\n getView: () => chart.value?.getView() ?? null,\n setView: (view) => chart.value?.setView(view),\n getRenderer: () => chart.value?.getRenderer() ?? null,\n getInstance: () => chart.value?.getInstance() ?? null,\n};\ndefineExpose(handle);\n</script>\n\n<template>\n <div\n ref=\"board\"\n :class=\"styles.board\"\n :data-panel=\"kind ?? undefined\"\n @pointerdown.capture=\"trackPointer\"\n >\n <QuadrantChart\n ref=\"chart\"\n v-bind=\"{ ...chartProps, ...$attrs }\"\n :points=\"points\"\n :locale=\"locale\"\n :selected-index=\"selected\"\n @hover=\"emit('hover', $event)\"\n @point-click=\"onPointClick\"\n @point-double-click=\"(_point, index) => edit(index)\"\n @point-drag=\"\n (point, index, target) => emit('pointDrag', point, index, target)\n \"\n @point-drop=\"onPointDrop\"\n @quadrant-click=\"addAt\"\n @zoom=\"emit('zoom', $event)\"\n @renderer-change=\"emit('rendererChange', $event)\"\n >\n <template #point-actions=\"{ index }\">\n <!-- compact, in the card of the active task (beside its name) -->\n <div\n role=\"toolbar\"\n :aria-label=\"texts.actions\"\n :class=\"styles.cardActions\"\n @pointerdown.stop\n >\n <IconButton\n size=\"xsmall\"\n variant=\"ghost\"\n :label=\"texts.edit\"\n @click=\"edit(index)\"\n >\n <ActionIcon kind=\"edit\" :size=\"14\" />\n </IconButton>\n <IconButton\n size=\"xsmall\"\n variant=\"ghost\"\n color=\"danger\"\n :label=\"texts.delete\"\n @click=\"confirmRemove(index)\"\n >\n <ActionIcon kind=\"delete\" :size=\"14\" />\n </IconButton>\n </div>\n </template>\n <template #quadrant-header=\"{ corner, info }\">\n <div :class=\"styles.header\" :data-corner=\"corner\">\n <span v-if=\"info.region?.badge\" :class=\"styles.badge\">{{\n info.region.badge\n }}</span>\n <span :class=\"styles.title\">{{ title(corner) }}</span>\n <span v-if=\"showCounts !== false\" :class=\"styles.count\">{{\n quadrantCountText(showCounts ?? true, info.points, locale)\n }}</span>\n <IconButton\n size=\"xsmall\"\n variant=\"ghost\"\n :class=\"styles.add\"\n :label=\"`${texts.add} · ${title(corner)}`\"\n :aria-expanded=\"\n shown && draft?.index === null && draft.quadrant === corner\n \"\n @click=\"(event: MouseEvent) => add(corner, event)\"\n >\n <ActionIcon kind=\"add\" />\n </IconButton>\n </div>\n </template>\n </QuadrantChart>\n <div\n v-if=\"shown && draft\"\n ref=\"panelEl\"\n role=\"dialog\"\n :aria-labelledby=\"`${id}-title`\"\n :class=\"styles.panel\"\n :data-quadrant-task-panel=\"draft.index === null ? 'add' : 'edit'\"\n @keydown=\"onPanelKeydown\"\n >\n <form :class=\"styles.form\" @submit.prevent=\"save\">\n <h3 :id=\"`${id}-title`\" :class=\"styles.panelTitle\">\n {{ draft.index === null ? texts.add : texts.edit }}\n </h3>\n <label :class=\"styles.field\">\n <span>{{ texts.name }}</span>\n <Input\n required\n size=\"small\"\n data-autofocus=\"\"\n :model-value=\"draft.label\"\n :aria-label=\"texts.name\"\n @update:model-value=\"(label: string) => setDraft({ label })\"\n />\n </label>\n <fieldset :class=\"styles.quadrants\">\n <legend>{{ texts.quadrant }}</legend>\n <div :class=\"styles.quadrantGrid\">\n <label\n v-for=\"corner in QUADRANT_CORNERS\"\n :key=\"corner\"\n :class=\"styles.quadrant\"\n :data-corner=\"corner\"\n >\n <input\n type=\"radio\"\n :name=\"`${id}-quadrant`\"\n :value=\"corner\"\n :checked=\"draft.quadrant === corner\"\n @change=\"setDraft({ quadrant: corner })\"\n />\n <span\n :class=\"styles.swatch\"\n :style=\"{ background: color(corner) }\"\n aria-hidden=\"true\"\n />\n <span :class=\"styles.quadrantName\">{{ title(corner) }}</span>\n </label>\n </div>\n </fieldset>\n <div :class=\"styles.footer\">\n <Button size=\"small\" color=\"neutral\" variant=\"ghost\" @click=\"close\">\n {{ texts.cancel }}\n </Button>\n <Button size=\"small\" type=\"submit\" :disabled=\"!canSave\">\n {{ texts.save }}\n </Button>\n </div>\n </form>\n </div>\n <div\n v-else-if=\"shown && deleting !== null\"\n ref=\"panelEl\"\n role=\"alertdialog\"\n :aria-labelledby=\"`${id}-title`\"\n :aria-describedby=\"`${id}-text`\"\n :class=\"styles.panel\"\n data-quadrant-task-panel=\"delete\"\n @keydown=\"onPanelKeydown\"\n >\n <h3 :id=\"`${id}-title`\" :class=\"styles.panelTitle\">\n {{ texts.delete }}\n </h3>\n <p :id=\"`${id}-text`\" :class=\"styles.panelText\">\n {{ quadrantTaskDeleteText(texts, points[deleting]) }}\n </p>\n <div :class=\"styles.footer\">\n <Button\n size=\"small\"\n color=\"neutral\"\n variant=\"ghost\"\n data-autofocus=\"\"\n @click=\"close\"\n >\n {{ texts.cancel }}\n </Button>\n <Button size=\"small\" color=\"danger\" @click=\"remove\">\n {{ texts.confirmDelete }}\n </Button>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":""}
@@ -34,9 +34,9 @@ var be = ["data-panel"], xe = ["aria-label"], Se = ["data-corner"], Ce = ["aria-
34
34
  "rendererChange"
35
35
  ],
36
36
  setup(i, { expose: d, emit: T }) {
37
- let E = i, D = T, O = ({ kind: e }) => f("svg", {
38
- width: 16,
39
- height: 16,
37
+ let E = i, D = T, O = ({ kind: e, size: t = 16 }) => f("svg", {
38
+ width: t,
39
+ height: t,
40
40
  viewBox: "0 0 24 24",
41
41
  fill: "none",
42
42
  stroke: "currentColor",
@@ -45,7 +45,7 @@ var be = ["data-panel"], xe = ["aria-label"], Se = ["data-corner"], Ce = ["aria-
45
45
  "stroke-linejoin": "round",
46
46
  "aria-hidden": "true"
47
47
  }, [f("path", { d: se[e] })]);
48
- O.props = ["kind"];
48
+ O.props = ["kind", "size"];
49
49
  let k = {
50
50
  x: 0,
51
51
  y: 0,
@@ -73,10 +73,10 @@ var be = ["data-panel"], xe = ["aria-label"], Se = ["data-corner"], Ce = ["aria-
73
73
  height: r.height
74
74
  };
75
75
  }, U = (e) => {
76
- let t = H(F.value?.querySelector(`.minerva-chart-quadrant-point[data-point-index="${e}"]`));
76
+ let t = H(F.value?.querySelector(`.minerva-chart-quadrant-card[data-point-preview="${e}"] [data-card-dot]`));
77
77
  return t ? {
78
- x: t.x - w,
79
- y: t.y - w,
78
+ x: t.x + t.width / 2 - w,
79
+ y: t.y + t.height / 2 - w,
80
80
  width: 20,
81
81
  height: 20
82
82
  } : z ?? k;
@@ -195,24 +195,30 @@ var be = ["data-panel"], xe = ["aria-label"], Se = ["data-corner"], Ce = ["aria-
195
195
  "point-actions": y(({ index: e }) => [c("div", {
196
196
  role: "toolbar",
197
197
  "aria-label": j.value.actions,
198
- class: p(_(C).actions),
198
+ class: p(_(C).cardActions),
199
199
  onPointerdown: i[0] ||= b(() => {}, ["stop"])
200
200
  }, [u(_(r), {
201
- size: "small",
201
+ size: "xsmall",
202
202
  variant: "ghost",
203
203
  label: j.value.edit,
204
204
  onClick: (t) => K(e)
205
205
  }, {
206
- default: y(() => [u(O, { kind: "edit" })]),
206
+ default: y(() => [u(O, {
207
+ kind: "edit",
208
+ size: 14
209
+ })]),
207
210
  _: 1
208
211
  }, 8, ["label", "onClick"]), u(_(r), {
209
- size: "small",
212
+ size: "xsmall",
210
213
  variant: "ghost",
211
214
  color: "danger",
212
215
  label: j.value.delete,
213
216
  onClick: (t) => Re(e)
214
217
  }, {
215
- default: y(() => [u(O, { kind: "delete" })]),
218
+ default: y(() => [u(O, {
219
+ kind: "delete",
220
+ size: 14
221
+ })]),
216
222
  _: 1
217
223
  }, 8, ["label", "onClick"])], 42, xe)]),
218
224
  "quadrant-header": y(({ corner: e, info: n }) => [c("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"QuadrantTaskBoard.vue_vue_type_script_setup_true_lang.js","names":["$attrs","points","showCounts","_openBlock","_createElementBlock","_normalizeClass","_unref","_createVNode","QuadrantChart","_mergeProps","_withCtx","_createElementVNode","_withModifiers","IconButton","_toDisplayString","_createCommentVNode","Input","_Fragment","_renderList","_normalizeStyle","Button","_createTextVNode","Button_default","Input_default","IconButton_default","QuadrantChart_default","styles","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","DOT","QuadrantTaskBoard_vue_vue_type_script_setup_true_lang_default","quadrantChartProps","__expose","__emit","props","__props","emit","ActionIcon","h","QUADRANT_TASK_ICONS","kind","NO_BOX","useI18n","locale","computed","language","texts","quadrantTaskLabels","defaults","quadrantLabels","title","corner","geometry","chartProps","_labels","_points","_locale","_selectedIndex","rest","id","useId","board","ref","panelEl","panel","selection","selected","lastPointer","returnFocus","change","points","color","quadrantTaskColor","boxOf","root","el","b","pointBox","box","index","trackPointer","event","open","active","next","close","target","add","newQuadrantTaskDraft","addAt","at","edit","draft","editQuadrantTaskDraft","confirmRemove","setDraft","old","patch","deleting","shown","anchor","canSave","canSaveQuadrantTask","save","saved","applyQuadrantTaskDraft","remove","removeQuadrantTask","selectionAfterRemove","onPanelKeydown","watch","place","placeQuadrantTaskPanel","isShown","onDown","onCleanup","onPointClick","point","onPointDrop","moveQuadrantTask","chart","shallowRef","view","openBlock","createElementBlock","normalizeClass","unref","createVNode","mergeProps","_ctx","_cache","$event","withCtx","createElementVNode","withModifiers","info","toDisplayString","createCommentVNode","quadrantCountText","Fragment","renderList","QUADRANT_CORNERS","normalizeStyle","createTextVNode","quadrantTaskDeleteText"],"sources":["../../../../../vue/src/components/QuadrantTaskBoard/QuadrantTaskBoard.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * QuadrantTaskBoard: a task board on a four-quadrant matrix (QuadrantChart):\n * an add button per quadrant, edit and delete buttons on the active task, an\n * inline panel anchored at the button or the task to name a task and pick its\n * quadrant, an inline confirmation before a delete, drag and drop and\n * keyboard moves (Shift + arrows). Controlled:\n * `points` in, `update:points` / `pointsChange` out (`v-model:points`).\n * Every other prop goes to the QuadrantChart.\n */\nimport {\n computed,\n h,\n ref,\n shallowRef,\n useId,\n watch,\n type FunctionalComponent,\n type PropType,\n} from \"vue\";\nimport {\n QUADRANT_CORNERS,\n QUADRANT_TASK_ICONS,\n applyQuadrantTaskDraft,\n canSaveQuadrantTask,\n editQuadrantTaskDraft,\n moveQuadrantTask,\n newQuadrantTaskDraft,\n placeQuadrantTaskPanel,\n quadrantCountText,\n quadrantLabels,\n quadrantTaskColor,\n quadrantTaskDeleteText,\n quadrantTaskLabels,\n removeQuadrantTask,\n selectionAfterRemove,\n type ChartHoverEvent,\n type ChartRendererKind,\n type ChartView,\n type QuadrantCorner,\n type QuadrantPoint,\n type QuadrantTaskBox,\n type QuadrantTaskDraft,\n type QuadrantTaskLabels,\n} from \"minerva-design/charts/core\";\nimport styles from \"@react-styles/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss\";\nimport QuadrantChart from \"../Chart/QuadrantChart.vue\";\nimport { quadrantChartProps } from \"../Chart/props\";\nimport type { ChartHandle, QuadrantDropTarget } from \"../Chart/types\";\nimport { Button } from \"../Button\";\nimport { IconButton } from \"../IconButton\";\nimport { Input } from \"../Input\";\nimport { useI18n } from \"../../config/useI18n\";\n\ndefineOptions({ name: \"QuadrantTaskBoard\", inheritAttrs: false });\n\nconst props = defineProps({\n ...quadrantChartProps,\n /** Texts of the buttons and panels (localized by default) */\n labels: Object as PropType<Partial<QuadrantTaskLabels>>,\n});\nconst emit = defineEmits<{\n /**\n * The next list of tasks after an add, an edit, a delete, a drag and drop\n * or a keyboard move (`v-model:points`)\n */\n \"update:points\": [points: QuadrantPoint[]];\n /** Same as `update:points` */\n pointsChange: [points: QuadrantPoint[]];\n /** The hovered (or keyboard-focused) point changed (`null`: none) */\n hover: [event: ChartHoverEvent | null];\n /** A point was clicked (it becomes the active task) */\n pointClick: [point: QuadrantPoint, index: number];\n /** A point is being dragged (on every move, with the quadrant under the pointer) */\n pointDrag: [point: QuadrantPoint, index: number, target: QuadrantDropTarget];\n /** The user zoomed or panned */\n zoom: [view: ChartView];\n /** The backend is ready (or fell back after a GPU loss) */\n rendererChange: [renderer: ChartRendererKind];\n}>();\n\nconst ActionIcon: FunctionalComponent<{\n kind: keyof typeof QUADRANT_TASK_ICONS;\n}> = ({ kind }) =>\n h(\n \"svg\",\n {\n width: 16,\n height: 16,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": 1.8,\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n },\n [h(\"path\", { d: QUADRANT_TASK_ICONS[kind] })],\n );\nActionIcon.props = [\"kind\"];\n\n/** The inline panel: the add / edit form, or the delete confirmation */\ntype Panel =\n | { kind: \"draft\"; draft: QuadrantTaskDraft; anchor: QuadrantTaskBox }\n | { kind: \"delete\"; index: number; anchor: QuadrantTaskBox };\n\n/** Half the size of the box around a task the panel keeps clear */\nconst DOT = 10;\nconst NO_BOX: QuadrantTaskBox = { x: 0, y: 0, width: 0, height: 0 };\n\nconst { language } = useI18n();\nconst locale = computed(() => props.locale ?? language.value);\nconst texts = computed(() => quadrantTaskLabels(locale.value, props.labels));\nconst defaults = computed(() => quadrantLabels(locale.value));\nconst title = (corner: QuadrantCorner) =>\n props.quadrants?.[corner]?.label || defaults.value[corner];\nconst geometry = () => ({\n xDomain: props.xDomain,\n yDomain: props.yDomain,\n xSplit: props.xSplit,\n ySplit: props.ySplit,\n reverseX: props.reverseX,\n});\n// the props of the chart (`labels` are the texts of the board)\nconst chartProps = computed(() => {\n const {\n labels: _labels,\n points: _points,\n locale: _locale,\n selectedIndex: _selectedIndex,\n ...rest\n } = props;\n return rest;\n});\n\nconst id = useId();\nconst board = ref<HTMLDivElement | null>(null);\nconst panelEl = ref<HTMLDivElement | null>(null);\nconst panel = ref<Panel | null>(null);\nconst selection = ref<number | null>(null);\nconst selected = computed(() =>\n props.selectedIndex !== undefined ? props.selectedIndex : selection.value,\n);\nlet lastPointer: QuadrantTaskBox | null = null;\nlet returnFocus: HTMLElement | null = null;\n\nconst change = (points: QuadrantPoint[]) => {\n emit(\"update:points\", points);\n emit(\"pointsChange\", points);\n};\nconst color = (corner: QuadrantCorner) =>\n quadrantTaskColor(props.quadrants, corner);\n\n/** Box of an element, relative to the board */\nconst boxOf = (el: Element | null | undefined): QuadrantTaskBox | null => {\n const root = board.value;\n if (!el || !root) return null;\n const b = root.getBoundingClientRect();\n const r = el.getBoundingClientRect();\n return {\n x: r.left - b.left,\n y: r.top - b.top,\n width: r.width,\n height: r.height,\n };\n};\n/** Box around a task (its anchor in the chart), else the last pointer */\nconst pointBox = (index: number): QuadrantTaskBox => {\n const box = boxOf(\n board.value?.querySelector(\n `.minerva-chart-quadrant-point[data-point-index=\"${index}\"]`,\n ),\n );\n if (box)\n return {\n x: box.x - DOT,\n y: box.y - DOT,\n width: 2 * DOT,\n height: 2 * DOT,\n };\n return lastPointer ?? NO_BOX;\n};\nconst trackPointer = (event: PointerEvent) => {\n const root = board.value;\n if (!root) return;\n const b = root.getBoundingClientRect();\n lastPointer = {\n x: event.clientX - b.left,\n y: event.clientY - b.top,\n width: 0,\n height: 0,\n };\n};\n\nconst open = (next: Panel) => {\n if (!panel.value) {\n const active = document.activeElement;\n returnFocus = active instanceof HTMLElement ? active : null;\n }\n panel.value = next;\n};\nconst close = () => {\n panel.value = null;\n const target = returnFocus;\n returnFocus = null;\n if (target?.isConnected) target.focus();\n};\nconst add = (corner: QuadrantCorner, event: MouseEvent) =>\n open({\n kind: \"draft\",\n draft: newQuadrantTaskDraft(geometry(), corner),\n anchor: boxOf(event.currentTarget as Element | null) ?? NO_BOX,\n });\nconst addAt = (corner: QuadrantCorner, at: { x: number; y: number }) =>\n open({\n kind: \"draft\",\n draft: newQuadrantTaskDraft(geometry(), corner, at),\n anchor: lastPointer ?? NO_BOX,\n });\nconst edit = (index: number, anchor = pointBox(index)) => {\n const draft = editQuadrantTaskDraft(geometry(), props.points, index);\n if (draft) open({ kind: \"draft\", draft, anchor });\n};\nconst confirmRemove = (index: number) =>\n open({ kind: \"delete\", index, anchor: pointBox(index) });\nconst setDraft = (patch: Partial<QuadrantTaskDraft>) => {\n const old = panel.value;\n if (old?.kind === \"draft\")\n panel.value = { ...old, draft: { ...old.draft, ...patch } };\n};\n\nconst draft = computed(() =>\n panel.value?.kind === \"draft\" ? panel.value.draft : null,\n);\nconst deleting = computed(() =>\n panel.value?.kind === \"delete\" ? panel.value.index : null,\n);\nconst shown = computed(() => {\n if (!panel.value) return false;\n if (draft.value)\n return draft.value.index === null || !!props.points[draft.value.index];\n return deleting.value !== null && !!props.points[deleting.value];\n});\nconst anchor = computed(() => (shown.value ? panel.value!.anchor : null));\nconst kind = computed(() => (shown.value ? panel.value!.kind : null));\nconst canSave = computed(() => canSaveQuadrantTask(draft.value, props.points));\n\nconst save = () => {\n const saved = applyQuadrantTaskDraft(geometry(), props.points, draft.value);\n if (!saved) return;\n change(saved.points);\n selection.value = saved.index;\n close();\n};\nconst remove = () => {\n const index = deleting.value;\n if (index !== null && props.points[index]) {\n change(removeQuadrantTask(props.points, index));\n selection.value = selectionAfterRemove(selection.value, index);\n }\n close();\n};\nconst onPanelKeydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n event.preventDefault();\n event.stopPropagation();\n close();\n};\n\n// next to its anchor, inside the board, once rendered; then the first field\n// (or Cancel) takes the focus\nwatch(\n [anchor, kind],\n ([box]) => {\n const el = panelEl.value;\n const root = board.value;\n if (!el || !root || !box) return;\n const place = placeQuadrantTaskPanel(\n box,\n { width: el.offsetWidth, height: el.offsetHeight },\n { width: root.clientWidth, height: root.clientHeight },\n );\n el.style.left = `${place.x}px`;\n el.style.top = `${place.y}px`;\n el.style.transformOrigin = `${place.origin.x}px ${place.origin.y}px`;\n el.dataset.placement = place.placement;\n el.querySelector<HTMLElement>(\"[data-autofocus]\")?.focus({\n preventScroll: true,\n });\n },\n { flush: \"post\" },\n);\n\n// a press outside the panel closes it, like a popover\nwatch(\n shown,\n (isShown, _old, onCleanup) => {\n if (!isShown) return;\n const onDown = (event: PointerEvent) => {\n const target = event.target as Node | null;\n if (target && panelEl.value?.contains(target)) return;\n panel.value = null;\n returnFocus = null;\n };\n document.addEventListener(\"pointerdown\", onDown, true);\n onCleanup(() => document.removeEventListener(\"pointerdown\", onDown, true));\n },\n { flush: \"post\" },\n);\n\nconst onPointClick = (point: QuadrantPoint, index: number) => {\n selection.value = index;\n emit(\"pointClick\", point, index);\n};\nconst onPointDrop = (\n _point: QuadrantPoint,\n index: number,\n target: QuadrantDropTarget,\n) => {\n change(moveQuadrantTask(props.points, index, target));\n selection.value = index;\n};\n\nconst chart = shallowRef<ChartHandle | null>(null);\nconst handle: ChartHandle = {\n resetZoom: () => chart.value?.resetZoom(),\n getView: () => chart.value?.getView() ?? null,\n setView: (view) => chart.value?.setView(view),\n getRenderer: () => chart.value?.getRenderer() ?? null,\n getInstance: () => chart.value?.getInstance() ?? null,\n};\ndefineExpose(handle);\n</script>\n\n<template>\n <div\n ref=\"board\"\n :class=\"styles.board\"\n :data-panel=\"kind ?? undefined\"\n @pointerdown.capture=\"trackPointer\"\n >\n <QuadrantChart\n ref=\"chart\"\n v-bind=\"{ ...chartProps, ...$attrs }\"\n :points=\"points\"\n :locale=\"locale\"\n :selected-index=\"selected\"\n @hover=\"emit('hover', $event)\"\n @point-click=\"onPointClick\"\n @point-double-click=\"(_point, index) => edit(index)\"\n @point-drag=\"\n (point, index, target) => emit('pointDrag', point, index, target)\n \"\n @point-drop=\"onPointDrop\"\n @quadrant-click=\"addAt\"\n @zoom=\"emit('zoom', $event)\"\n @renderer-change=\"emit('rendererChange', $event)\"\n >\n <template #point-actions=\"{ index }\">\n <div\n role=\"toolbar\"\n :aria-label=\"texts.actions\"\n :class=\"styles.actions\"\n @pointerdown.stop\n >\n <IconButton\n size=\"small\"\n variant=\"ghost\"\n :label=\"texts.edit\"\n @click=\"edit(index)\"\n >\n <ActionIcon kind=\"edit\" />\n </IconButton>\n <IconButton\n size=\"small\"\n variant=\"ghost\"\n color=\"danger\"\n :label=\"texts.delete\"\n @click=\"confirmRemove(index)\"\n >\n <ActionIcon kind=\"delete\" />\n </IconButton>\n </div>\n </template>\n <template #quadrant-header=\"{ corner, info }\">\n <div :class=\"styles.header\" :data-corner=\"corner\">\n <span v-if=\"info.region?.badge\" :class=\"styles.badge\">{{\n info.region.badge\n }}</span>\n <span :class=\"styles.title\">{{ title(corner) }}</span>\n <span v-if=\"showCounts !== false\" :class=\"styles.count\">{{\n quadrantCountText(showCounts ?? true, info.points, locale)\n }}</span>\n <IconButton\n size=\"xsmall\"\n variant=\"ghost\"\n :class=\"styles.add\"\n :label=\"`${texts.add} · ${title(corner)}`\"\n :aria-expanded=\"\n shown && draft?.index === null && draft.quadrant === corner\n \"\n @click=\"(event: MouseEvent) => add(corner, event)\"\n >\n <ActionIcon kind=\"add\" />\n </IconButton>\n </div>\n </template>\n </QuadrantChart>\n <div\n v-if=\"shown && draft\"\n ref=\"panelEl\"\n role=\"dialog\"\n :aria-labelledby=\"`${id}-title`\"\n :class=\"styles.panel\"\n :data-quadrant-task-panel=\"draft.index === null ? 'add' : 'edit'\"\n @keydown=\"onPanelKeydown\"\n >\n <form :class=\"styles.form\" @submit.prevent=\"save\">\n <h3 :id=\"`${id}-title`\" :class=\"styles.panelTitle\">\n {{ draft.index === null ? texts.add : texts.edit }}\n </h3>\n <label :class=\"styles.field\">\n <span>{{ texts.name }}</span>\n <Input\n required\n size=\"small\"\n data-autofocus=\"\"\n :model-value=\"draft.label\"\n :aria-label=\"texts.name\"\n @update:model-value=\"(label: string) => setDraft({ label })\"\n />\n </label>\n <fieldset :class=\"styles.quadrants\">\n <legend>{{ texts.quadrant }}</legend>\n <div :class=\"styles.quadrantGrid\">\n <label\n v-for=\"corner in QUADRANT_CORNERS\"\n :key=\"corner\"\n :class=\"styles.quadrant\"\n :data-corner=\"corner\"\n >\n <input\n type=\"radio\"\n :name=\"`${id}-quadrant`\"\n :value=\"corner\"\n :checked=\"draft.quadrant === corner\"\n @change=\"setDraft({ quadrant: corner })\"\n />\n <span\n :class=\"styles.swatch\"\n :style=\"{ background: color(corner) }\"\n aria-hidden=\"true\"\n />\n <span :class=\"styles.quadrantName\">{{ title(corner) }}</span>\n </label>\n </div>\n </fieldset>\n <div :class=\"styles.footer\">\n <Button size=\"small\" color=\"neutral\" variant=\"ghost\" @click=\"close\">\n {{ texts.cancel }}\n </Button>\n <Button size=\"small\" type=\"submit\" :disabled=\"!canSave\">\n {{ texts.save }}\n </Button>\n </div>\n </form>\n </div>\n <div\n v-else-if=\"shown && deleting !== null\"\n ref=\"panelEl\"\n role=\"alertdialog\"\n :aria-labelledby=\"`${id}-title`\"\n :aria-describedby=\"`${id}-text`\"\n :class=\"styles.panel\"\n data-quadrant-task-panel=\"delete\"\n @keydown=\"onPanelKeydown\"\n >\n <h3 :id=\"`${id}-title`\" :class=\"styles.panelTitle\">\n {{ texts.delete }}\n </h3>\n <p :id=\"`${id}-text`\" :class=\"styles.panelText\">\n {{ quadrantTaskDeleteText(texts, points[deleting]) }}\n </p>\n <div :class=\"styles.footer\">\n <Button\n size=\"small\"\n color=\"neutral\"\n variant=\"ghost\"\n data-autofocus=\"\"\n @click=\"close\"\n >\n {{ texts.cancel }}\n </Button>\n <Button size=\"small\" color=\"danger\" @click=\"remove\">\n {{ texts.confirmDelete }}\n </Button>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;2EA2GMqC,IAAM;;;;;;;;;;;;;;;;;;EAnDZ,IAAMK,IAAQC,GAKRC,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SAAQ;IACR,kBAAe;IACd,SAAOyE;;IAER,SAAAnF,QAAkB,CAAfW,EAAAP,EAAAwC,EAAA,MAAM,MAAM,GAAA,CAAA,CAAA,CAAA;;GAEjB/C,CAAAA,GAAAA,EAESD,EAAAc,CAAA,GAAA;IAFD,MAAK;IAAQ,OAAM;IAAU,SAAO8F;;IAC1C,SAAAxG,QAAyB,CAAtBW,EAAAP,EAAAwC,EAAA,MAAM,aAAa,GAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"QuadrantTaskBoard.vue_vue_type_script_setup_true_lang.js","names":["$attrs","points","showCounts","_openBlock","_createElementBlock","_normalizeClass","_unref","_createVNode","QuadrantChart","_mergeProps","_withCtx","_createElementVNode","_withModifiers","IconButton","_toDisplayString","_createCommentVNode","Input","_Fragment","_renderList","_normalizeStyle","Button","_createTextVNode","Button_default","Input_default","IconButton_default","QuadrantChart_default","styles","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","DOT","QuadrantTaskBoard_vue_vue_type_script_setup_true_lang_default","quadrantChartProps","__expose","__emit","props","__props","emit","ActionIcon","h","size","QUADRANT_TASK_ICONS","kind","NO_BOX","useI18n","locale","computed","language","texts","quadrantTaskLabels","defaults","quadrantLabels","title","corner","geometry","chartProps","_labels","_points","_locale","_selectedIndex","rest","id","useId","board","ref","panelEl","panel","selection","selected","lastPointer","returnFocus","change","points","color","quadrantTaskColor","boxOf","root","el","b","pointBox","box","index","trackPointer","event","open","active","next","close","target","add","newQuadrantTaskDraft","addAt","at","edit","draft","editQuadrantTaskDraft","confirmRemove","setDraft","old","patch","deleting","shown","anchor","canSave","canSaveQuadrantTask","save","saved","applyQuadrantTaskDraft","remove","removeQuadrantTask","selectionAfterRemove","onPanelKeydown","watch","place","placeQuadrantTaskPanel","isShown","onDown","onCleanup","onPointClick","point","onPointDrop","moveQuadrantTask","chart","shallowRef","view","openBlock","createElementBlock","normalizeClass","unref","createVNode","mergeProps","_ctx","_cache","$event","withCtx","createElementVNode","withModifiers","info","toDisplayString","createCommentVNode","quadrantCountText","Fragment","renderList","QUADRANT_CORNERS","normalizeStyle","createTextVNode","quadrantTaskDeleteText"],"sources":["../../../../../vue/src/components/QuadrantTaskBoard/QuadrantTaskBoard.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * QuadrantTaskBoard: a task board on a four-quadrant matrix (QuadrantChart):\n * an add button per quadrant, edit and delete buttons on the active task, an\n * inline panel anchored at the button or the task to name a task and pick its\n * quadrant, an inline confirmation before a delete, drag and drop and\n * keyboard moves (Shift + arrows). Controlled:\n * `points` in, `update:points` / `pointsChange` out (`v-model:points`).\n * Every other prop goes to the QuadrantChart.\n */\nimport {\n computed,\n h,\n ref,\n shallowRef,\n useId,\n watch,\n type FunctionalComponent,\n type PropType,\n} from \"vue\";\nimport {\n QUADRANT_CORNERS,\n QUADRANT_TASK_ICONS,\n applyQuadrantTaskDraft,\n canSaveQuadrantTask,\n editQuadrantTaskDraft,\n moveQuadrantTask,\n newQuadrantTaskDraft,\n placeQuadrantTaskPanel,\n quadrantCountText,\n quadrantLabels,\n quadrantTaskColor,\n quadrantTaskDeleteText,\n quadrantTaskLabels,\n removeQuadrantTask,\n selectionAfterRemove,\n type ChartHoverEvent,\n type ChartRendererKind,\n type ChartView,\n type QuadrantCorner,\n type QuadrantPoint,\n type QuadrantTaskBox,\n type QuadrantTaskDraft,\n type QuadrantTaskLabels,\n} from \"minerva-design/charts/core\";\nimport styles from \"@react-styles/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss\";\nimport QuadrantChart from \"../Chart/QuadrantChart.vue\";\nimport { quadrantChartProps } from \"../Chart/props\";\nimport type { ChartHandle, QuadrantDropTarget } from \"../Chart/types\";\nimport { Button } from \"../Button\";\nimport { IconButton } from \"../IconButton\";\nimport { Input } from \"../Input\";\nimport { useI18n } from \"../../config/useI18n\";\n\ndefineOptions({ name: \"QuadrantTaskBoard\", inheritAttrs: false });\n\nconst props = defineProps({\n ...quadrantChartProps,\n /** Texts of the buttons and panels (localized by default) */\n labels: Object as PropType<Partial<QuadrantTaskLabels>>,\n});\nconst emit = defineEmits<{\n /**\n * The next list of tasks after an add, an edit, a delete, a drag and drop\n * or a keyboard move (`v-model:points`)\n */\n \"update:points\": [points: QuadrantPoint[]];\n /** Same as `update:points` */\n pointsChange: [points: QuadrantPoint[]];\n /** The hovered (or keyboard-focused) point changed (`null`: none) */\n hover: [event: ChartHoverEvent | null];\n /** A point was clicked (it becomes the active task) */\n pointClick: [point: QuadrantPoint, index: number];\n /** A point is being dragged (on every move, with the quadrant under the pointer) */\n pointDrag: [point: QuadrantPoint, index: number, target: QuadrantDropTarget];\n /** The user zoomed or panned */\n zoom: [view: ChartView];\n /** The backend is ready (or fell back after a GPU loss) */\n rendererChange: [renderer: ChartRendererKind];\n}>();\n\nconst ActionIcon: FunctionalComponent<{\n kind: keyof typeof QUADRANT_TASK_ICONS;\n size?: number;\n}> = ({ kind, size = 16 }) =>\n h(\n \"svg\",\n {\n width: size,\n height: size,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": 1.8,\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n },\n [h(\"path\", { d: QUADRANT_TASK_ICONS[kind] })],\n );\nActionIcon.props = [\"kind\", \"size\"];\n\n/** The inline panel: the add / edit form, or the delete confirmation */\ntype Panel =\n | { kind: \"draft\"; draft: QuadrantTaskDraft; anchor: QuadrantTaskBox }\n | { kind: \"delete\"; index: number; anchor: QuadrantTaskBox };\n\n/** Half the size of the box around a task the panel keeps clear */\nconst DOT = 10;\nconst NO_BOX: QuadrantTaskBox = { x: 0, y: 0, width: 0, height: 0 };\n\nconst { language } = useI18n();\nconst locale = computed(() => props.locale ?? language.value);\nconst texts = computed(() => quadrantTaskLabels(locale.value, props.labels));\nconst defaults = computed(() => quadrantLabels(locale.value));\nconst title = (corner: QuadrantCorner) =>\n props.quadrants?.[corner]?.label || defaults.value[corner];\nconst geometry = () => ({\n xDomain: props.xDomain,\n yDomain: props.yDomain,\n xSplit: props.xSplit,\n ySplit: props.ySplit,\n reverseX: props.reverseX,\n});\n// the props of the chart (`labels` are the texts of the board)\nconst chartProps = computed(() => {\n const {\n labels: _labels,\n points: _points,\n locale: _locale,\n selectedIndex: _selectedIndex,\n ...rest\n } = props;\n return rest;\n});\n\nconst id = useId();\nconst board = ref<HTMLDivElement | null>(null);\nconst panelEl = ref<HTMLDivElement | null>(null);\nconst panel = ref<Panel | null>(null);\nconst selection = ref<number | null>(null);\nconst selected = computed(() =>\n props.selectedIndex !== undefined ? props.selectedIndex : selection.value,\n);\nlet lastPointer: QuadrantTaskBox | null = null;\nlet returnFocus: HTMLElement | null = null;\n\nconst change = (points: QuadrantPoint[]) => {\n emit(\"update:points\", points);\n emit(\"pointsChange\", points);\n};\nconst color = (corner: QuadrantCorner) =>\n quadrantTaskColor(props.quadrants, corner);\n\n/** Box of an element, relative to the board */\nconst boxOf = (el: Element | null | undefined): QuadrantTaskBox | null => {\n const root = board.value;\n if (!el || !root) return null;\n const b = root.getBoundingClientRect();\n const r = el.getBoundingClientRect();\n return {\n x: r.left - b.left,\n y: r.top - b.top,\n width: r.width,\n height: r.height,\n };\n};\n/** Box around a task (the dot of its point card), else the last pointer */\nconst pointBox = (index: number): QuadrantTaskBox => {\n const box = boxOf(\n board.value?.querySelector(\n `.minerva-chart-quadrant-card[data-point-preview=\"${index}\"] [data-card-dot]`,\n ),\n );\n if (box)\n return {\n x: box.x + box.width / 2 - DOT,\n y: box.y + box.height / 2 - DOT,\n width: 2 * DOT,\n height: 2 * DOT,\n };\n return lastPointer ?? NO_BOX;\n};\nconst trackPointer = (event: PointerEvent) => {\n const root = board.value;\n if (!root) return;\n const b = root.getBoundingClientRect();\n lastPointer = {\n x: event.clientX - b.left,\n y: event.clientY - b.top,\n width: 0,\n height: 0,\n };\n};\n\nconst open = (next: Panel) => {\n if (!panel.value) {\n const active = document.activeElement;\n returnFocus = active instanceof HTMLElement ? active : null;\n }\n panel.value = next;\n};\nconst close = () => {\n panel.value = null;\n const target = returnFocus;\n returnFocus = null;\n if (target?.isConnected) target.focus();\n};\nconst add = (corner: QuadrantCorner, event: MouseEvent) =>\n open({\n kind: \"draft\",\n draft: newQuadrantTaskDraft(geometry(), corner),\n anchor: boxOf(event.currentTarget as Element | null) ?? NO_BOX,\n });\nconst addAt = (corner: QuadrantCorner, at: { x: number; y: number }) =>\n open({\n kind: \"draft\",\n draft: newQuadrantTaskDraft(geometry(), corner, at),\n anchor: lastPointer ?? NO_BOX,\n });\nconst edit = (index: number, anchor = pointBox(index)) => {\n const draft = editQuadrantTaskDraft(geometry(), props.points, index);\n if (draft) open({ kind: \"draft\", draft, anchor });\n};\nconst confirmRemove = (index: number) =>\n open({ kind: \"delete\", index, anchor: pointBox(index) });\nconst setDraft = (patch: Partial<QuadrantTaskDraft>) => {\n const old = panel.value;\n if (old?.kind === \"draft\")\n panel.value = { ...old, draft: { ...old.draft, ...patch } };\n};\n\nconst draft = computed(() =>\n panel.value?.kind === \"draft\" ? panel.value.draft : null,\n);\nconst deleting = computed(() =>\n panel.value?.kind === \"delete\" ? panel.value.index : null,\n);\nconst shown = computed(() => {\n if (!panel.value) return false;\n if (draft.value)\n return draft.value.index === null || !!props.points[draft.value.index];\n return deleting.value !== null && !!props.points[deleting.value];\n});\nconst anchor = computed(() => (shown.value ? panel.value!.anchor : null));\nconst kind = computed(() => (shown.value ? panel.value!.kind : null));\nconst canSave = computed(() => canSaveQuadrantTask(draft.value, props.points));\n\nconst save = () => {\n const saved = applyQuadrantTaskDraft(geometry(), props.points, draft.value);\n if (!saved) return;\n change(saved.points);\n selection.value = saved.index;\n close();\n};\nconst remove = () => {\n const index = deleting.value;\n if (index !== null && props.points[index]) {\n change(removeQuadrantTask(props.points, index));\n selection.value = selectionAfterRemove(selection.value, index);\n }\n close();\n};\nconst onPanelKeydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n event.preventDefault();\n event.stopPropagation();\n close();\n};\n\n// next to its anchor, inside the board, once rendered; then the first field\n// (or Cancel) takes the focus\nwatch(\n [anchor, kind],\n ([box]) => {\n const el = panelEl.value;\n const root = board.value;\n if (!el || !root || !box) return;\n const place = placeQuadrantTaskPanel(\n box,\n { width: el.offsetWidth, height: el.offsetHeight },\n { width: root.clientWidth, height: root.clientHeight },\n );\n el.style.left = `${place.x}px`;\n el.style.top = `${place.y}px`;\n el.style.transformOrigin = `${place.origin.x}px ${place.origin.y}px`;\n el.dataset.placement = place.placement;\n el.querySelector<HTMLElement>(\"[data-autofocus]\")?.focus({\n preventScroll: true,\n });\n },\n { flush: \"post\" },\n);\n\n// a press outside the panel closes it, like a popover\nwatch(\n shown,\n (isShown, _old, onCleanup) => {\n if (!isShown) return;\n const onDown = (event: PointerEvent) => {\n const target = event.target as Node | null;\n if (target && panelEl.value?.contains(target)) return;\n panel.value = null;\n returnFocus = null;\n };\n document.addEventListener(\"pointerdown\", onDown, true);\n onCleanup(() => document.removeEventListener(\"pointerdown\", onDown, true));\n },\n { flush: \"post\" },\n);\n\nconst onPointClick = (point: QuadrantPoint, index: number) => {\n selection.value = index;\n emit(\"pointClick\", point, index);\n};\nconst onPointDrop = (\n _point: QuadrantPoint,\n index: number,\n target: QuadrantDropTarget,\n) => {\n change(moveQuadrantTask(props.points, index, target));\n selection.value = index;\n};\n\nconst chart = shallowRef<ChartHandle | null>(null);\nconst handle: ChartHandle = {\n resetZoom: () => chart.value?.resetZoom(),\n getView: () => chart.value?.getView() ?? null,\n setView: (view) => chart.value?.setView(view),\n getRenderer: () => chart.value?.getRenderer() ?? null,\n getInstance: () => chart.value?.getInstance() ?? null,\n};\ndefineExpose(handle);\n</script>\n\n<template>\n <div\n ref=\"board\"\n :class=\"styles.board\"\n :data-panel=\"kind ?? undefined\"\n @pointerdown.capture=\"trackPointer\"\n >\n <QuadrantChart\n ref=\"chart\"\n v-bind=\"{ ...chartProps, ...$attrs }\"\n :points=\"points\"\n :locale=\"locale\"\n :selected-index=\"selected\"\n @hover=\"emit('hover', $event)\"\n @point-click=\"onPointClick\"\n @point-double-click=\"(_point, index) => edit(index)\"\n @point-drag=\"\n (point, index, target) => emit('pointDrag', point, index, target)\n \"\n @point-drop=\"onPointDrop\"\n @quadrant-click=\"addAt\"\n @zoom=\"emit('zoom', $event)\"\n @renderer-change=\"emit('rendererChange', $event)\"\n >\n <template #point-actions=\"{ index }\">\n <!-- compact, in the card of the active task (beside its name) -->\n <div\n role=\"toolbar\"\n :aria-label=\"texts.actions\"\n :class=\"styles.cardActions\"\n @pointerdown.stop\n >\n <IconButton\n size=\"xsmall\"\n variant=\"ghost\"\n :label=\"texts.edit\"\n @click=\"edit(index)\"\n >\n <ActionIcon kind=\"edit\" :size=\"14\" />\n </IconButton>\n <IconButton\n size=\"xsmall\"\n variant=\"ghost\"\n color=\"danger\"\n :label=\"texts.delete\"\n @click=\"confirmRemove(index)\"\n >\n <ActionIcon kind=\"delete\" :size=\"14\" />\n </IconButton>\n </div>\n </template>\n <template #quadrant-header=\"{ corner, info }\">\n <div :class=\"styles.header\" :data-corner=\"corner\">\n <span v-if=\"info.region?.badge\" :class=\"styles.badge\">{{\n info.region.badge\n }}</span>\n <span :class=\"styles.title\">{{ title(corner) }}</span>\n <span v-if=\"showCounts !== false\" :class=\"styles.count\">{{\n quadrantCountText(showCounts ?? true, info.points, locale)\n }}</span>\n <IconButton\n size=\"xsmall\"\n variant=\"ghost\"\n :class=\"styles.add\"\n :label=\"`${texts.add} · ${title(corner)}`\"\n :aria-expanded=\"\n shown && draft?.index === null && draft.quadrant === corner\n \"\n @click=\"(event: MouseEvent) => add(corner, event)\"\n >\n <ActionIcon kind=\"add\" />\n </IconButton>\n </div>\n </template>\n </QuadrantChart>\n <div\n v-if=\"shown && draft\"\n ref=\"panelEl\"\n role=\"dialog\"\n :aria-labelledby=\"`${id}-title`\"\n :class=\"styles.panel\"\n :data-quadrant-task-panel=\"draft.index === null ? 'add' : 'edit'\"\n @keydown=\"onPanelKeydown\"\n >\n <form :class=\"styles.form\" @submit.prevent=\"save\">\n <h3 :id=\"`${id}-title`\" :class=\"styles.panelTitle\">\n {{ draft.index === null ? texts.add : texts.edit }}\n </h3>\n <label :class=\"styles.field\">\n <span>{{ texts.name }}</span>\n <Input\n required\n size=\"small\"\n data-autofocus=\"\"\n :model-value=\"draft.label\"\n :aria-label=\"texts.name\"\n @update:model-value=\"(label: string) => setDraft({ label })\"\n />\n </label>\n <fieldset :class=\"styles.quadrants\">\n <legend>{{ texts.quadrant }}</legend>\n <div :class=\"styles.quadrantGrid\">\n <label\n v-for=\"corner in QUADRANT_CORNERS\"\n :key=\"corner\"\n :class=\"styles.quadrant\"\n :data-corner=\"corner\"\n >\n <input\n type=\"radio\"\n :name=\"`${id}-quadrant`\"\n :value=\"corner\"\n :checked=\"draft.quadrant === corner\"\n @change=\"setDraft({ quadrant: corner })\"\n />\n <span\n :class=\"styles.swatch\"\n :style=\"{ background: color(corner) }\"\n aria-hidden=\"true\"\n />\n <span :class=\"styles.quadrantName\">{{ title(corner) }}</span>\n </label>\n </div>\n </fieldset>\n <div :class=\"styles.footer\">\n <Button size=\"small\" color=\"neutral\" variant=\"ghost\" @click=\"close\">\n {{ texts.cancel }}\n </Button>\n <Button size=\"small\" type=\"submit\" :disabled=\"!canSave\">\n {{ texts.save }}\n </Button>\n </div>\n </form>\n </div>\n <div\n v-else-if=\"shown && deleting !== null\"\n ref=\"panelEl\"\n role=\"alertdialog\"\n :aria-labelledby=\"`${id}-title`\"\n :aria-describedby=\"`${id}-text`\"\n :class=\"styles.panel\"\n data-quadrant-task-panel=\"delete\"\n @keydown=\"onPanelKeydown\"\n >\n <h3 :id=\"`${id}-title`\" :class=\"styles.panelTitle\">\n {{ texts.delete }}\n </h3>\n <p :id=\"`${id}-text`\" :class=\"styles.panelText\">\n {{ quadrantTaskDeleteText(texts, points[deleting]) }}\n </p>\n <div :class=\"styles.footer\">\n <Button\n size=\"small\"\n color=\"neutral\"\n variant=\"ghost\"\n data-autofocus=\"\"\n @click=\"close\"\n >\n {{ texts.cancel }}\n </Button>\n <Button size=\"small\" color=\"danger\" @click=\"remove\">\n {{ texts.confirmDelete }}\n </Button>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;2EA4GMqC,IAAM;;;;;;;;;;;;;;;;;;EApDZ,IAAMK,IAAQC,GAKRC,IAAOH,GAoBPI,KAGA,EAAE,SAAM,UAAO,SACnBC,EACE,OACA;GACE,OAAOC;GACP,QAAQA;GACR,SAAS;GACT,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,kBAAkB;GAClB,mBAAmB;GACnB,eAAe;EACjB,GACA,CAACD,EAAE,QAAQ,EAAE,GAAGE,GAAoBC,GAAM,CAAC,CAAC,CAC9C;EACF,EAAW,QAAQ,CAAC,QAAQ,MAAM;EASlC,IAAMC,IAA0B;GAAE,GAAG;GAAG,GAAG;GAAG,OAAO;GAAG,QAAQ;EAAE,GAE5D,EAAE,iBAAaC,EAAQ,GACvBC,IAASC,QAAeX,EAAM,UAAUY,GAAS,KAAK,GACtDC,IAAQF,QAAeG,GAAmBJ,EAAO,OAAOV,EAAM,MAAM,CAAC,GACrEe,KAAWJ,QAAeK,GAAeN,EAAO,KAAK,CAAC,GACtDO,KAAS,MACbjB,EAAM,YAAYkB,EAAO,EAAE,SAASH,GAAS,MAAMG,IAC/CC,WAAkB;GACtB,SAASnB,EAAM;GACf,SAASA,EAAM;GACf,QAAQA,EAAM;GACd,QAAQA,EAAM;GACd,UAAUA,EAAM;EAClB,IAEMoB,KAAaT,QAAe;GAChC,IAAM,EACJ,QAAQU,GACR,QAAQC,GACR,QAAQC,GACR,eAAeC,GACf,GAAGC,MACDzB;GACJ,OAAOyB;EACT,CAAC,GAEKC,IAAKC,GAAM,GACXC,IAAQC,EAA2B,IAAI,GACvCC,IAAUD,EAA2B,IAAI,GACz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EAAA8D,CAAA,EAAE;IAAU,OAAK/D,EAAEC,EAAAoB,CAAA,CAAM,CAAC,SAAS;GACzC,GAAAZ,EAAAR,EAAAmJ,EAAA,CAAsB,CAAClG,EAAA,OAAOtD,EAAAA,OAAO0G,EAAA,MAAQ,CAAA,GAAA,IAAAvE,EAAA;GAElDzB,EAaM,OAAA,EAbA,OAAKN,EAAEC,EAAAoB,CAAA,CAAM,CAAC,MAAM,EAAA,GAAA,CACxBnB,EAQSD,EAAAc,CAAA,GAAA;IAPP,MAAK;IACL,OAAM;IACN,SAAQ;IACR,kBAAe;IACd,SAAO0E;;IAER,SAAApF,QAAkB,CAAfW,EAAAP,EAAAyC,EAAA,MAAM,MAAM,GAAA,CAAA,CAAA,CAAA;;GAEjBhD,CAAAA,GAAAA,EAESD,EAAAc,CAAA,GAAA;IAFD,MAAK;IAAQ,OAAM;IAAU,SAAO+F;;IAC1C,SAAAzG,QAAyB,CAAtBW,EAAAP,EAAAyC,EAAA,MAAM,aAAa,GAAA,CAAA,CAAA,CAAA"}
@@ -1211,14 +1211,24 @@ var insideBox = (label, plot, measure, height) => {
1211
1211
  };
1212
1212
  /** Room kept between a label and the edges of its cell, CSS pixels */
1213
1213
  var CELL_PAD = 2;
1214
+ /** Room kept between two labels of a cell (they never touch), CSS pixels */
1215
+ var LABEL_GAP$1 = {
1216
+ x: 4,
1217
+ y: 2
1218
+ };
1219
+ /** Distance from a point to the nearest point of a box */
1220
+ var distanceTo = (x, y, r) => Math.hypot(Math.max(r.x - x, 0, x - (r.x + r.width)), Math.max(r.y - y, 0, y - (r.y + r.height)));
1214
1221
  /**
1215
1222
  * Box of a label kept inside a cell of the plot (`bounds`): beside the dot
1216
1223
  * on the side with more room in the cell (moved up or down into the cell
1217
- * near its edges), else above or below it (moved sideways into the cell);
1224
+ * near its edges), else above or below it (moved sideways into the cell),
1225
+ * else beside it half a line up or down;
1218
1226
  * cut with an ellipsis to the room left when the whole text fits nowhere;
1219
- * `null` when no free slot is left
1227
+ * `null` when no free slot is left. A slot is free when it keeps a gap to
1228
+ * the other labels and its own dot is the nearest one (it covers no other
1229
+ * dot): a crowded cell never pairs a name with the wrong dot
1220
1230
  */
1221
- var cellBox = (label, bounds, plot, measure, height, occupied) => {
1231
+ var cellBox = (label, bounds, plot, measure, height, occupied, dots = []) => {
1222
1232
  const x0 = Math.max(bounds.x, plot.x) + CELL_PAD;
1223
1233
  const x1 = Math.min(bounds.x + bounds.width, plot.x + plot.width) - CELL_PAD;
1224
1234
  const y0 = Math.max(bounds.y, plot.y) + CELL_PAD;
@@ -1230,7 +1240,22 @@ var cellBox = (label, bounds, plot, measure, height, occupied) => {
1230
1240
  width: x1 - x0 + .02,
1231
1241
  height: y1 - y0 + .02
1232
1242
  };
1233
- const free = (c) => inside$2(c, slack) && !occupied.some((o) => overlaps$1(o, c));
1243
+ const others = dots.filter((d) => Math.abs(d.x - label.x) >= .5 || Math.abs(d.y - label.y) >= .5);
1244
+ const free = (c) => {
1245
+ if (!inside$2(c, slack)) return false;
1246
+ const spaced = {
1247
+ x: c.x - LABEL_GAP$1.x,
1248
+ y: c.y - LABEL_GAP$1.y,
1249
+ width: c.width + LABEL_GAP$1.x * 2,
1250
+ height: c.height + LABEL_GAP$1.y * 2
1251
+ };
1252
+ if (occupied.some((o) => overlaps$1(o, spaced))) return false;
1253
+ const own = distanceTo(label.x, label.y, c);
1254
+ return others.every((d) => {
1255
+ const far = distanceTo(d.x, d.y, c);
1256
+ return far >= d.r + 2 && far > own;
1257
+ });
1258
+ };
1234
1259
  const gap = label.r + 4;
1235
1260
  const sideY = Math.min(Math.max(label.y - height / 2, y0), y1 - height);
1236
1261
  const room = {
@@ -1244,6 +1269,12 @@ var cellBox = (label, bounds, plot, measure, height, occupied) => {
1244
1269
  width: w,
1245
1270
  height
1246
1271
  }];
1272
+ const corners = (side, w) => [label.y - height - 1, label.y + 1].map((y) => ({
1273
+ x: side === "right" ? label.x + gap : label.x - gap - w,
1274
+ y: Math.min(Math.max(y, y0), y1 - height),
1275
+ width: w,
1276
+ height
1277
+ }));
1247
1278
  const stacked = (w) => {
1248
1279
  const x = Math.min(Math.max(label.x - w / 2, x0), x1 - w);
1249
1280
  return [{
@@ -1262,15 +1293,17 @@ var cellBox = (label, bounds, plot, measure, height, occupied) => {
1262
1293
  const box = [
1263
1294
  ...beside(sides[0], w),
1264
1295
  ...beside(sides[1], w),
1265
- ...stacked(w)
1296
+ ...stacked(w),
1297
+ ...corners(sides[0], w),
1298
+ ...corners(sides[1], w)
1266
1299
  ].find(free);
1267
1300
  if (box) return {
1268
1301
  label,
1269
1302
  box
1270
1303
  };
1271
1304
  const cuts = [
1272
- [room[sides[0]], (cw) => beside(sides[0], cw)],
1273
- [room[sides[1]], (cw) => beside(sides[1], cw)],
1305
+ [room[sides[0]], (cw) => [...beside(sides[0], cw), ...corners(sides[0], cw)]],
1306
+ [room[sides[1]], (cw) => [...beside(sides[1], cw), ...corners(sides[1], cw)]],
1274
1307
  [x1 - x0, stacked]
1275
1308
  ];
1276
1309
  let best = null;
@@ -1294,6 +1327,7 @@ var cellBox = (label, bounds, plot, measure, height, occupied) => {
1294
1327
  /** Greedy placement: right, left, above, below the dot; skipped when no slot is free */
1295
1328
  var placeLabels = (labels, plot, measure, height, occupied = []) => {
1296
1329
  const placed = [];
1330
+ const dots = labels.filter((label) => label.bounds);
1297
1331
  for (const label of labels) {
1298
1332
  if (label.placement === "inside") {
1299
1333
  const fit = insideBox(label, plot, measure, height);
@@ -1301,7 +1335,7 @@ var placeLabels = (labels, plot, measure, height, occupied = []) => {
1301
1335
  continue;
1302
1336
  }
1303
1337
  if (label.bounds) {
1304
- const fit = cellBox(label, label.bounds, plot, measure, height, occupied);
1338
+ const fit = cellBox(label, label.bounds, plot, measure, height, occupied, dots);
1305
1339
  if (!fit) continue;
1306
1340
  occupied.push(fit.box);
1307
1341
  placed.push(fit);
@@ -1498,6 +1532,7 @@ var drawForeground = (ctx, input) => {
1498
1532
  const textColor = toCss(theme.text, .85);
1499
1533
  placed = placeLabels(input.pointLabels, plot, (t) => ctx.measureText(t).width, labelHeight - 2, occupied);
1500
1534
  for (const { label, box } of placed) {
1535
+ if (label.hidden) continue;
1501
1536
  const y = box.y + box.height / 2;
1502
1537
  if (label.color) {
1503
1538
  ctx.fillStyle = label.color;
@@ -3329,7 +3364,7 @@ var labelCell = (s, cuts, p) => {
3329
3364
  * `background` (the chart background) picks the color of the labels inside
3330
3365
  * solid bars; `skip` leaves out the label of a point (the dragged one)
3331
3366
  */
3332
- var collectPointLabels = (model, view, s, yTicks, background, skip) => {
3367
+ var collectPointLabels = (model, view, s, yTicks, background, skip, hide) => {
3333
3368
  const labels = [];
3334
3369
  const axisFormat = model.percent ? model.formatValue : yTicks?.formatValue ?? model.formatValue;
3335
3370
  for (const series of model.series) {
@@ -3395,7 +3430,7 @@ var collectPointLabels = (model, view, s, yTicks, background, skip) => {
3395
3430
  if (xi < view.x[0] || xi > view.x[1] || yi < view.y[0] || yi > view.y[1]) continue;
3396
3431
  const d = size && size[i] > 0 ? size[i] : series.pointSize;
3397
3432
  const p = toScreen(s, xi, yi);
3398
- labels.push(series.labelCells ? {
3433
+ const label = series.labelCells ? {
3399
3434
  x: p.x,
3400
3435
  y: p.y,
3401
3436
  r: d / 2,
@@ -3406,7 +3441,9 @@ var collectPointLabels = (model, view, s, yTicks, background, skip) => {
3406
3441
  y: p.y,
3407
3442
  r: d / 2,
3408
3443
  text
3409
- });
3444
+ };
3445
+ if (hide && hide.seriesIndex === series.index && hide.index === i) label.hidden = true;
3446
+ labels.push(label);
3410
3447
  }
3411
3448
  }
3412
3449
  return labels;
@@ -2439,6 +2439,28 @@
2439
2439
  height: 16px;
2440
2440
  flex: none;
2441
2441
  }
2442
+ /* Narrow phones (320px wide): the title comes first. The badge gives way
2443
+ (the 2 x 2 grid already places the quadrants) and the chips get tighter */
2444
+ @media (max-width: 360px) {
2445
+ .mn-quadrant-task-board__headers {
2446
+ gap: 4px;
2447
+ }
2448
+ .mn-quadrant-task-board__header {
2449
+ gap: 2px;
2450
+ padding-left: 8px;
2451
+ }
2452
+ .mn-quadrant-task-board__badge {
2453
+ display: none;
2454
+ }
2455
+ .mn-quadrant-task-board__title,
2456
+ .mn-quadrant-task-board__badge + .mn-quadrant-task-board__title {
2457
+ padding-left: 0;
2458
+ }
2459
+ .mn-quadrant-task-board__count {
2460
+ min-width: 16px;
2461
+ padding: 0 4px;
2462
+ }
2463
+ }
2442
2464
  .mn-quadrant-task-board__panel {
2443
2465
  position: relative;
2444
2466
  z-index: 1;
@@ -1,4 +1,4 @@
1
- import { ChartDragEvent, ChartHoverEvent, ChartInstance, ChartOptions, ChartPlotClickEvent, ChartRendererKind, ChartView } from '../../../charts/core.js';
1
+ import { ChartDragEndEvent, ChartDragEvent, ChartHoverEvent, ChartInstance, ChartOptions, ChartPlotClickEvent, ChartRendererKind, ChartView } from '../../../charts/core.js';
2
2
  import { MinervaEngineElement } from './engine-element.js';
3
3
  /**
4
4
  * Base of the cartesian chart elements (engine `createChart`): forwards the
@@ -17,8 +17,11 @@ export declare abstract class MinervaCartesianChartElement extends MinervaEngine
17
17
  protected bindEngine(chart: ChartInstance): Array<() => void>;
18
18
  protected pointClicked(event: ChartHoverEvent): void;
19
19
  protected plotClicked(event: ChartPlotClickEvent): void;
20
+ protected pointDragStarted?(event: ChartDragEvent): void;
20
21
  protected pointDragged?(event: ChartDragEvent): void;
21
22
  protected pointDropped?(event: ChartDragEvent): void;
23
+ /** The drag is over (after the drop, or cancelled) */
24
+ protected pointDragEnded?(event: ChartDragEndEvent): void;
22
25
  /** Shows the whole data range */
23
26
  resetZoom(): void;
24
27
  /** Visible range, `null` before the engine is created */
@@ -17,8 +17,10 @@ var i = class extends t {
17
17
  e.on("plotClick", (e) => this.plotClicked(e)),
18
18
  e.on("zoom", (e) => this.emit("minerva-zoom", e)),
19
19
  e.on("renderer", (e) => this.emit("minerva-renderer-change", { renderer: e })),
20
+ e.on("dragStart", (e) => this.pointDragStarted?.(e)),
20
21
  e.on("drag", (e) => this.pointDragged?.(e)),
21
- e.on("drop", (e) => this.pointDropped?.(e))
22
+ e.on("drop", (e) => this.pointDropped?.(e)),
23
+ e.on("dragEnd", (e) => this.pointDragEnded?.(e))
22
24
  ];
23
25
  }
24
26
  pointClicked(e) {
@@ -1 +1 @@
1
- {"version":3,"file":"chart.js","names":["_decorate","__decorate","MinervaCartesianChartElement","MinervaEngineElement","_args","createChart","container","options","chart","event","view","property","MinervaChart"],"sources":["../../../../../web-components/src/components/chart/chart.ts"],"sourcesContent":["import { property } from \"lit/decorators.js\";\nimport {\n createChart,\n type ChartDragEvent,\n type ChartHoverEvent,\n type ChartInstance,\n type ChartOptions,\n type ChartPlotClickEvent,\n type ChartRendererKind,\n type ChartView,\n} from \"minerva-design/charts/core\";\nimport { MinervaEngineElement } from \"./engine-element\";\n\n/**\n * Base of the cartesian chart elements (engine `createChart`): forwards the\n * engine events as `minerva-*` events and exposes the zoom methods.\n *\n * @fires minerva-hover - The hovered (or keyboard-focused) points changed; detail: { x, xLabel, items }, `null` when nothing is hovered\n * @fires minerva-point-click - A point or a bar was clicked; detail: { x, xLabel, items }\n * @fires minerva-plot-click - The plot area was clicked where there is no point; detail: { x, y }\n * @fires minerva-zoom - The user zoomed or panned; detail: { x, y } (the visible ranges)\n * @fires minerva-renderer-change - The backend is ready (or fell back after a GPU loss); detail: { renderer }\n */\nexport abstract class MinervaCartesianChartElement extends MinervaEngineElement<\n ChartOptions,\n ChartInstance\n> {\n /** Height of the chart, the legend included: pixels or any CSS length */\n @property()\n override height?: string | number = 320;\n\n protected createEngine(\n container: HTMLElement,\n options: ChartOptions,\n ): ChartInstance {\n return createChart(container, options);\n }\n\n protected override bindEngine(chart: ChartInstance): Array<() => void> {\n return [\n chart.on(\"hover\", (event) => this.emit(\"minerva-hover\", event)),\n chart.on(\"click\", (event) => this.pointClicked(event)),\n chart.on(\"plotClick\", (event) => this.plotClicked(event)),\n chart.on(\"zoom\", (view) => this.emit(\"minerva-zoom\", view)),\n chart.on(\"renderer\", (renderer) =>\n this.emit(\"minerva-renderer-change\", { renderer }),\n ),\n chart.on(\"drag\", (event) => this.pointDragged?.(event)),\n chart.on(\"drop\", (event) => this.pointDropped?.(event)),\n ];\n }\n\n protected pointClicked(event: ChartHoverEvent): void {\n this.emit(\"minerva-point-click\", event);\n }\n\n protected plotClicked(event: ChartPlotClickEvent): void {\n this.emit(\"minerva-plot-click\", event);\n }\n\n protected pointDragged?(event: ChartDragEvent): void;\n\n protected pointDropped?(event: ChartDragEvent): void;\n\n /** Shows the whole data range */\n resetZoom(): void {\n this.instance?.resetZoom();\n }\n\n /** Visible range, `null` before the engine is created */\n getView(): ChartView | null {\n return this.instance?.getView() ?? null;\n }\n\n /** Sets the visible range */\n setView(view: Partial<ChartView>): void {\n this.instance?.setView(view);\n }\n\n /** Backend in use (`webgpu`, `webgl2`, `webgl`, `canvas2d`), `null` until ready */\n getRenderer(): ChartRendererKind | null {\n return this.instance?.getRenderer() ?? null;\n }\n}\n\n/**\n * GPU chart of `minerva-design/charts/core` (WebGPU, then WebGL2, WebGL,\n * Canvas2D) mixing line, area, bar, scatter, candlestick and heatmap\n * series: the `<Chart>` of React. Set the engine options (`ChartOptions`:\n * `series`, `xAxis`, `yAxis`, `legend`, `tooltip`, `annotations`...) as\n * the `options` property; replace the object (or a `data` array) to update\n * the chart. Zoomable, keyboard accessible and themed by the Minerva CSS\n * variables of its scope.\n *\n * Published as the optional entry `minerva-design/web-components/chart`\n * (not part of the all-in-one entry nor the CDN bundle: it loads the chart\n * engine `minerva-design/charts/core`).\n *\n * @summary GPU chart of any mix of series, configured by the engine options.\n * @tag minerva-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaChart extends MinervaCartesianChartElement {\n static override tagName = \"minerva-chart\";\n\n /** Engine options (`ChartOptions` of minerva-design/charts/core); property only */\n @property({ attribute: false })\n options?: ChartOptions;\n\n protected engineOptions(): ChartOptions | null {\n return this.options ?? null;\n }\n}\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,WAAW,GAAM,CAAC,CAAA,GAAAC,EAAA,WAAA,WAAA,KAAA,CAAA"}
1
+ {"version":3,"file":"chart.js","names":["_decorate","__decorate","MinervaCartesianChartElement","MinervaEngineElement","_args","createChart","container","options","chart","event","view","property","MinervaChart"],"sources":["../../../../../web-components/src/components/chart/chart.ts"],"sourcesContent":["import { property } from \"lit/decorators.js\";\nimport {\n createChart,\n type ChartDragEndEvent,\n type ChartDragEvent,\n type ChartHoverEvent,\n type ChartInstance,\n type ChartOptions,\n type ChartPlotClickEvent,\n type ChartRendererKind,\n type ChartView,\n} from \"minerva-design/charts/core\";\nimport { MinervaEngineElement } from \"./engine-element\";\n\n/**\n * Base of the cartesian chart elements (engine `createChart`): forwards the\n * engine events as `minerva-*` events and exposes the zoom methods.\n *\n * @fires minerva-hover - The hovered (or keyboard-focused) points changed; detail: { x, xLabel, items }, `null` when nothing is hovered\n * @fires minerva-point-click - A point or a bar was clicked; detail: { x, xLabel, items }\n * @fires minerva-plot-click - The plot area was clicked where there is no point; detail: { x, y }\n * @fires minerva-zoom - The user zoomed or panned; detail: { x, y } (the visible ranges)\n * @fires minerva-renderer-change - The backend is ready (or fell back after a GPU loss); detail: { renderer }\n */\nexport abstract class MinervaCartesianChartElement extends MinervaEngineElement<\n ChartOptions,\n ChartInstance\n> {\n /** Height of the chart, the legend included: pixels or any CSS length */\n @property()\n override height?: string | number = 320;\n\n protected createEngine(\n container: HTMLElement,\n options: ChartOptions,\n ): ChartInstance {\n return createChart(container, options);\n }\n\n protected override bindEngine(chart: ChartInstance): Array<() => void> {\n return [\n chart.on(\"hover\", (event) => this.emit(\"minerva-hover\", event)),\n chart.on(\"click\", (event) => this.pointClicked(event)),\n chart.on(\"plotClick\", (event) => this.plotClicked(event)),\n chart.on(\"zoom\", (view) => this.emit(\"minerva-zoom\", view)),\n chart.on(\"renderer\", (renderer) =>\n this.emit(\"minerva-renderer-change\", { renderer }),\n ),\n chart.on(\"dragStart\", (event) => this.pointDragStarted?.(event)),\n chart.on(\"drag\", (event) => this.pointDragged?.(event)),\n chart.on(\"drop\", (event) => this.pointDropped?.(event)),\n chart.on(\"dragEnd\", (event) => this.pointDragEnded?.(event)),\n ];\n }\n\n protected pointClicked(event: ChartHoverEvent): void {\n this.emit(\"minerva-point-click\", event);\n }\n\n protected plotClicked(event: ChartPlotClickEvent): void {\n this.emit(\"minerva-plot-click\", event);\n }\n\n protected pointDragStarted?(event: ChartDragEvent): void;\n\n protected pointDragged?(event: ChartDragEvent): void;\n\n protected pointDropped?(event: ChartDragEvent): void;\n\n /** The drag is over (after the drop, or cancelled) */\n protected pointDragEnded?(event: ChartDragEndEvent): void;\n\n /** Shows the whole data range */\n resetZoom(): void {\n this.instance?.resetZoom();\n }\n\n /** Visible range, `null` before the engine is created */\n getView(): ChartView | null {\n return this.instance?.getView() ?? null;\n }\n\n /** Sets the visible range */\n setView(view: Partial<ChartView>): void {\n this.instance?.setView(view);\n }\n\n /** Backend in use (`webgpu`, `webgl2`, `webgl`, `canvas2d`), `null` until ready */\n getRenderer(): ChartRendererKind | null {\n return this.instance?.getRenderer() ?? null;\n }\n}\n\n/**\n * GPU chart of `minerva-design/charts/core` (WebGPU, then WebGL2, WebGL,\n * Canvas2D) mixing line, area, bar, scatter, candlestick and heatmap\n * series: the `<Chart>` of React. Set the engine options (`ChartOptions`:\n * `series`, `xAxis`, `yAxis`, `legend`, `tooltip`, `annotations`...) as\n * the `options` property; replace the object (or a `data` array) to update\n * the chart. Zoomable, keyboard accessible and themed by the Minerva CSS\n * variables of its scope.\n *\n * Published as the optional entry `minerva-design/web-components/chart`\n * (not part of the all-in-one entry nor the CDN bundle: it loads the chart\n * engine `minerva-design/charts/core`).\n *\n * @summary GPU chart of any mix of series, configured by the engine options.\n * @tag minerva-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaChart extends MinervaCartesianChartElement {\n static override tagName = \"minerva-chart\";\n\n /** Engine options (`ChartOptions` of minerva-design/charts/core); property only */\n @property({ attribute: false })\n options?: ChartOptions;\n\n protected engineOptions(): ChartOptions | null {\n return this.options ?? null;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"minerva-chart\": MinervaChart;\n }\n}\n"],"mappings":";;;;;AAwBA,IAAsBE,IAAtB,cAA2DC,EAGzD;;EAGoC,aAAA,KAAA,SAAA;;CAEpC,aACE,GACA,GACe;EACf,OAAOE,EAAYC,GAAWC,CAAO;CACvC;CAEA,WAA8B,GAAyC;EACrE,OAAO;GACLC,EAAM,GAAG,UAAU,MAAU,KAAK,KAAK,iBAAiBC,CAAK,CAAC;GAC9DD,EAAM,GAAG,UAAU,MAAU,KAAK,aAAaC,CAAK,CAAC;GACrDD,EAAM,GAAG,cAAc,MAAU,KAAK,YAAYC,CAAK,CAAC;GACxDD,EAAM,GAAG,SAAS,MAAS,KAAK,KAAK,gBAAgBE,CAAI,CAAC;GAC1DF,EAAM,GAAG,aAAa,MACpB,KAAK,KAAK,2BAA2B,EAAE,YAAS,CAAC,CACnD;GACAA,EAAM,GAAG,cAAc,MAAU,KAAK,mBAAmBC,CAAK,CAAC;GAC/DD,EAAM,GAAG,SAAS,MAAU,KAAK,eAAeC,CAAK,CAAC;GACtDD,EAAM,GAAG,SAAS,MAAU,KAAK,eAAeC,CAAK,CAAC;GACtDD,EAAM,GAAG,YAAY,MAAU,KAAK,iBAAiBC,CAAK,CAAC;EAC7D;CACF;CAEA,aAAuB,GAA8B;EACnD,KAAK,KAAK,uBAAuBA,CAAK;CACxC;CAEA,YAAsB,GAAkC;EACtD,KAAK,KAAK,sBAAsBA,CAAK;CACvC;CAYA,YAAkB;EAChB,KAAK,UAAU,UAAU;CAC3B;CAGA,UAA4B;EAC1B,OAAO,KAAK,UAAU,QAAQ,KAAK;CACrC;CAGA,QAAQ,GAAgC;EACtC,KAAK,UAAU,QAAQC,CAAI;CAC7B;CAGA,cAAwC;EACtC,OAAO,KAAK,UAAU,YAAY,KAAK;CACzC;AACF;AA9DGV,EAAA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