@dou-ui/dashboard 0.0.0-stage → 0.1.0-alpha.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 (188) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -2
  3. package/dist/chart/chart-settings.js +6 -0
  4. package/dist/chart/chart-settings.js.map +1 -0
  5. package/dist/chart/chart-settings.vue_vue_type_script_setup_true_lang.js +122 -0
  6. package/dist/chart/chart-settings.vue_vue_type_script_setup_true_lang.js.map +1 -0
  7. package/dist/chart/chart.js +6 -0
  8. package/dist/chart/chart.js.map +1 -0
  9. package/dist/chart/chart.vue_vue_type_script_setup_true_lang.js +99 -0
  10. package/dist/chart/chart.vue_vue_type_script_setup_true_lang.js.map +1 -0
  11. package/dist/chart/index.js +33 -0
  12. package/dist/chart/index.js.map +1 -0
  13. package/dist/collaboration/index.js +281 -0
  14. package/dist/collaboration/index.js.map +1 -0
  15. package/dist/collaboration/order.js +88 -0
  16. package/dist/collaboration/order.js.map +1 -0
  17. package/dist/core/document.js +128 -0
  18. package/dist/core/document.js.map +1 -0
  19. package/dist/core/history.js +66 -0
  20. package/dist/core/history.js.map +1 -0
  21. package/dist/core/transaction.js +218 -0
  22. package/dist/core/transaction.js.map +1 -0
  23. package/dist/dashboard/dashboard.js +6 -0
  24. package/dist/dashboard/dashboard.js.map +1 -0
  25. package/dist/dashboard/dashboard.vue_vue_type_script_setup_true_lang.js +1072 -0
  26. package/dist/dashboard/dashboard.vue_vue_type_script_setup_true_lang.js.map +1 -0
  27. package/dist/dashboard/export.js +77 -0
  28. package/dist/dashboard/export.js.map +1 -0
  29. package/dist/dashboard/filter-bar.js +6 -0
  30. package/dist/dashboard/filter-bar.js.map +1 -0
  31. package/dist/dashboard/filter-bar.vue_vue_type_script_setup_true_lang.js +150 -0
  32. package/dist/dashboard/filter-bar.vue_vue_type_script_setup_true_lang.js.map +1 -0
  33. package/dist/dashboard/frame-context.js +5 -0
  34. package/dist/dashboard/frame-context.js.map +1 -0
  35. package/dist/dashboard/observers.js +48 -0
  36. package/dist/dashboard/observers.js.map +1 -0
  37. package/dist/dashboard/palette.js +6 -0
  38. package/dist/dashboard/palette.js.map +1 -0
  39. package/dist/dashboard/palette.vue_vue_type_script_setup_true_lang.js +54 -0
  40. package/dist/dashboard/palette.vue_vue_type_script_setup_true_lang.js.map +1 -0
  41. package/dist/dashboard/widget-body.js +6 -0
  42. package/dist/dashboard/widget-body.js.map +1 -0
  43. package/dist/dashboard/widget-body.vue_vue_type_script_setup_true_lang.js +96 -0
  44. package/dist/dashboard/widget-body.vue_vue_type_script_setup_true_lang.js.map +1 -0
  45. package/dist/dashboard/widget-frame.js +6 -0
  46. package/dist/dashboard/widget-frame.js.map +1 -0
  47. package/dist/dashboard/widget-frame.vue_vue_type_script_setup_true_lang.js +300 -0
  48. package/dist/dashboard/widget-frame.vue_vue_type_script_setup_true_lang.js.map +1 -0
  49. package/dist/dashboard/widget-settings.js +6 -0
  50. package/dist/dashboard/widget-settings.js.map +1 -0
  51. package/dist/dashboard/widget-settings.vue_vue_type_script_setup_true_lang.js +36 -0
  52. package/dist/dashboard/widget-settings.vue_vue_type_script_setup_true_lang.js.map +1 -0
  53. package/dist/data/context.js +5 -0
  54. package/dist/data/context.js.map +1 -0
  55. package/dist/data/filters.js +31 -0
  56. package/dist/data/filters.js.map +1 -0
  57. package/dist/data/store.js +214 -0
  58. package/dist/data/store.js.map +1 -0
  59. package/dist/grid/grid-handle.js +6 -0
  60. package/dist/grid/grid-handle.js.map +1 -0
  61. package/dist/grid/grid-handle.vue_vue_type_script_setup_true_lang.js +21 -0
  62. package/dist/grid/grid-handle.vue_vue_type_script_setup_true_lang.js.map +1 -0
  63. package/dist/grid/grid-item.js +80 -0
  64. package/dist/grid/grid-item.js.map +1 -0
  65. package/dist/grid/grid-layout.js +6 -0
  66. package/dist/grid/grid-layout.js.map +1 -0
  67. package/dist/grid/grid-layout.vue_vue_type_script_setup_true_lang.js +767 -0
  68. package/dist/grid/grid-layout.vue_vue_type_script_setup_true_lang.js.map +1 -0
  69. package/dist/grid/tiers.js +31 -0
  70. package/dist/grid/tiers.js.map +1 -0
  71. package/dist/index.js +23 -0
  72. package/dist/index.js.map +1 -0
  73. package/dist/layout/engine.js +284 -0
  74. package/dist/layout/engine.js.map +1 -0
  75. package/dist/layout/index.js +1 -0
  76. package/dist/locale.js +245 -0
  77. package/dist/locale.js.map +1 -0
  78. package/dist/pivot/index.js +47 -0
  79. package/dist/pivot/index.js.map +1 -0
  80. package/dist/pivot/pivot-settings.js +6 -0
  81. package/dist/pivot/pivot-settings.js.map +1 -0
  82. package/dist/pivot/pivot-settings.vue_vue_type_script_setup_true_lang.js +64 -0
  83. package/dist/pivot/pivot-settings.vue_vue_type_script_setup_true_lang.js.map +1 -0
  84. package/dist/pivot/pivot.js +6 -0
  85. package/dist/pivot/pivot.js.map +1 -0
  86. package/dist/pivot/pivot.vue_vue_type_script_setup_true_lang.js +76 -0
  87. package/dist/pivot/pivot.vue_vue_type_script_setup_true_lang.js.map +1 -0
  88. package/dist/style.css +1 -0
  89. package/dist/style.d.ts +1 -0
  90. package/dist/style.js +12 -0
  91. package/dist/types/chart/chart-settings.vue.d.ts +11 -0
  92. package/dist/types/chart/chart.vue.d.ts +3 -0
  93. package/dist/types/chart/index.d.ts +9 -0
  94. package/dist/types/chart/types.d.ts +23 -0
  95. package/dist/types/collaboration/index.d.ts +53 -0
  96. package/dist/types/collaboration/order.d.ts +20 -0
  97. package/dist/types/core/collaboration.d.ts +51 -0
  98. package/dist/types/core/document.d.ts +35 -0
  99. package/dist/types/core/history.d.ts +15 -0
  100. package/dist/types/core/transaction.d.ts +86 -0
  101. package/dist/types/core/types.d.ts +27 -0
  102. package/dist/types/dashboard/dashboard.vue.d.ts +33 -0
  103. package/dist/types/dashboard/export.d.ts +11 -0
  104. package/dist/types/dashboard/filter-bar.vue.d.ts +19 -0
  105. package/dist/types/dashboard/frame-context.d.ts +54 -0
  106. package/dist/types/dashboard/observers.d.ts +15 -0
  107. package/dist/types/dashboard/palette.vue.d.ts +20 -0
  108. package/dist/types/dashboard/types.d.ts +190 -0
  109. package/dist/types/dashboard/widget-body.vue.d.ts +19 -0
  110. package/dist/types/dashboard/widget-frame.vue.d.ts +6 -0
  111. package/dist/types/dashboard/widget-settings.vue.d.ts +16 -0
  112. package/dist/types/data/context.d.ts +18 -0
  113. package/dist/types/data/filters.d.ts +9 -0
  114. package/dist/types/data/store.d.ts +48 -0
  115. package/dist/types/data/types.d.ts +67 -0
  116. package/dist/types/grid/grid-handle.vue.d.ts +18 -0
  117. package/dist/types/grid/grid-item.d.ts +78 -0
  118. package/dist/types/grid/grid-layout.vue.d.ts +46 -0
  119. package/dist/types/grid/tiers.d.ts +12 -0
  120. package/dist/types/grid/types.d.ts +113 -0
  121. package/dist/types/index.d.ts +295 -0
  122. package/dist/types/layout/engine.d.ts +50 -0
  123. package/dist/types/layout/index.d.ts +2 -0
  124. package/dist/types/layout/types.d.ts +39 -0
  125. package/dist/types/locale.d.ts +117 -0
  126. package/dist/types/pivot/index.d.ts +14 -0
  127. package/dist/types/pivot/pivot-settings.vue.d.ts +16 -0
  128. package/dist/types/pivot/pivot.vue.d.ts +7 -0
  129. package/dist/types/pivot/types.d.ts +11 -0
  130. package/dist/types/widget/context.d.ts +91 -0
  131. package/dist/types/widget/define.d.ts +50 -0
  132. package/dist/types/widgets/field-select.vue.d.ts +18 -0
  133. package/dist/types/widgets/index.d.ts +15 -0
  134. package/dist/types/widgets/settings-field.vue.d.ts +17 -0
  135. package/dist/types/widgets/shared.d.ts +20 -0
  136. package/dist/types/widgets/source-field.vue.d.ts +15 -0
  137. package/dist/types/widgets/stat-settings.vue.d.ts +11 -0
  138. package/dist/types/widgets/stat.vue.d.ts +3 -0
  139. package/dist/types/widgets/table-settings.vue.d.ts +11 -0
  140. package/dist/types/widgets/table.vue.d.ts +3 -0
  141. package/dist/types/widgets/text-settings.vue.d.ts +11 -0
  142. package/dist/types/widgets/text.vue.d.ts +3 -0
  143. package/dist/types/widgets/types.d.ts +38 -0
  144. package/dist/widget/context.js +88 -0
  145. package/dist/widget/context.js.map +1 -0
  146. package/dist/widget/define.js +32 -0
  147. package/dist/widget/define.js.map +1 -0
  148. package/dist/widgets/field-select.js +6 -0
  149. package/dist/widgets/field-select.js.map +1 -0
  150. package/dist/widgets/field-select.vue_vue_type_script_setup_true_lang.js +54 -0
  151. package/dist/widgets/field-select.vue_vue_type_script_setup_true_lang.js.map +1 -0
  152. package/dist/widgets/index.js +74 -0
  153. package/dist/widgets/index.js.map +1 -0
  154. package/dist/widgets/settings-field.js +6 -0
  155. package/dist/widgets/settings-field.js.map +1 -0
  156. package/dist/widgets/settings-field.vue_vue_type_script_setup_true_lang.js +28 -0
  157. package/dist/widgets/settings-field.vue_vue_type_script_setup_true_lang.js.map +1 -0
  158. package/dist/widgets/shared.js +68 -0
  159. package/dist/widgets/shared.js.map +1 -0
  160. package/dist/widgets/source-field.js +6 -0
  161. package/dist/widgets/source-field.js.map +1 -0
  162. package/dist/widgets/source-field.vue_vue_type_script_setup_true_lang.js +47 -0
  163. package/dist/widgets/source-field.vue_vue_type_script_setup_true_lang.js.map +1 -0
  164. package/dist/widgets/stat-settings.js +6 -0
  165. package/dist/widgets/stat-settings.js.map +1 -0
  166. package/dist/widgets/stat-settings.vue_vue_type_script_setup_true_lang.js +107 -0
  167. package/dist/widgets/stat-settings.vue_vue_type_script_setup_true_lang.js.map +1 -0
  168. package/dist/widgets/stat.js +6 -0
  169. package/dist/widgets/stat.js.map +1 -0
  170. package/dist/widgets/stat.vue_vue_type_script_setup_true_lang.js +72 -0
  171. package/dist/widgets/stat.vue_vue_type_script_setup_true_lang.js.map +1 -0
  172. package/dist/widgets/table-settings.js +6 -0
  173. package/dist/widgets/table-settings.js.map +1 -0
  174. package/dist/widgets/table-settings.vue_vue_type_script_setup_true_lang.js +90 -0
  175. package/dist/widgets/table-settings.vue_vue_type_script_setup_true_lang.js.map +1 -0
  176. package/dist/widgets/table.js +6 -0
  177. package/dist/widgets/table.js.map +1 -0
  178. package/dist/widgets/table.vue_vue_type_script_setup_true_lang.js +91 -0
  179. package/dist/widgets/table.vue_vue_type_script_setup_true_lang.js.map +1 -0
  180. package/dist/widgets/text-settings.js +6 -0
  181. package/dist/widgets/text-settings.js.map +1 -0
  182. package/dist/widgets/text-settings.vue_vue_type_script_setup_true_lang.js +63 -0
  183. package/dist/widgets/text-settings.vue_vue_type_script_setup_true_lang.js.map +1 -0
  184. package/dist/widgets/text.js +6 -0
  185. package/dist/widgets/text.js.map +1 -0
  186. package/dist/widgets/text.vue_vue_type_script_setup_true_lang.js +16 -0
  187. package/dist/widgets/text.vue_vue_type_script_setup_true_lang.js.map +1 -0
  188. package/package.json +98 -4
@@ -0,0 +1,295 @@
1
+ export declare const DouGridLayout: import("dou-ui").WithInstall<{
2
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{
3
+ resize?: boolean | import("./index.js").GridResizeHandle[] | undefined;
4
+ columns?: (number | Record<string, number>) | undefined;
5
+ editable?: boolean | undefined;
6
+ label?: string | undefined;
7
+ breakpoints?: Record<string, number> | undefined;
8
+ rowHeight?: number | undefined;
9
+ gap?: number | [number, number] | undefined;
10
+ compact?: import("./layout").GridCompact | undefined;
11
+ handle?: boolean | undefined;
12
+ itemLabel?: ((item: import("./layout").GridItem) => string) | undefined;
13
+ messages?: import("./locale").DashboardMessagesOverride | undefined;
14
+ } & {
15
+ modelValue?: import("./layout").GridItem[];
16
+ layouts?: Partial<Record<string, import("./index.js").GridPlace[]>>;
17
+ }> & Readonly<{
18
+ onDrop?: ((event: import("./index.js").GridDropEvent) => any) | undefined;
19
+ onChange?: ((event: import("./index.js").GridChangeEvent) => any) | undefined;
20
+ "onUpdate:modelValue"?: ((value: import("./layout").GridItem[]) => any) | undefined;
21
+ "onUpdate:layouts"?: ((value: Partial<Record<string, import("./index.js").GridPlace[]>>) => any) | undefined;
22
+ onDragStart?: ((event: import("./index.js").GridDragEvent) => any) | undefined;
23
+ onDragEnd?: ((event: import("./index.js").GridDragEndEvent) => any) | undefined;
24
+ onBreakpointChange?: ((breakpoint: string) => any) | undefined;
25
+ }>, import("./index.js").GridLayoutExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
+ drop: (event: import("./index.js").GridDropEvent) => any;
27
+ change: (event: import("./index.js").GridChangeEvent) => any;
28
+ "update:modelValue": (value: import("./layout").GridItem[]) => any;
29
+ "update:layouts": (value: Partial<Record<string, import("./index.js").GridPlace[]>>) => any;
30
+ dragStart: (event: import("./index.js").GridDragEvent) => any;
31
+ dragEnd: (event: import("./index.js").GridDragEndEvent) => any;
32
+ breakpointChange: (breakpoint: string) => any;
33
+ }, import("vue").PublicProps, {
34
+ resize: boolean | import("./index.js").GridResizeHandle[];
35
+ columns: number | Record<string, number>;
36
+ breakpoints: Record<string, number>;
37
+ rowHeight: number;
38
+ gap: number | [number, number];
39
+ compact: import("./layout").GridCompact;
40
+ }, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
41
+ P: {};
42
+ B: {};
43
+ D: {};
44
+ C: {};
45
+ M: {};
46
+ Defaults: {};
47
+ }, Readonly<{
48
+ resize?: boolean | import("./index.js").GridResizeHandle[] | undefined;
49
+ columns?: (number | Record<string, number>) | undefined;
50
+ editable?: boolean | undefined;
51
+ label?: string | undefined;
52
+ breakpoints?: Record<string, number> | undefined;
53
+ rowHeight?: number | undefined;
54
+ gap?: number | [number, number] | undefined;
55
+ compact?: import("./layout").GridCompact | undefined;
56
+ handle?: boolean | undefined;
57
+ itemLabel?: ((item: import("./layout").GridItem) => string) | undefined;
58
+ messages?: import("./locale").DashboardMessagesOverride | undefined;
59
+ } & {
60
+ modelValue?: import("./layout").GridItem[];
61
+ layouts?: Partial<Record<string, import("./index.js").GridPlace[]>>;
62
+ }> & Readonly<{
63
+ onDrop?: ((event: import("./index.js").GridDropEvent) => any) | undefined;
64
+ onChange?: ((event: import("./index.js").GridChangeEvent) => any) | undefined;
65
+ "onUpdate:modelValue"?: ((value: import("./layout").GridItem[]) => any) | undefined;
66
+ "onUpdate:layouts"?: ((value: Partial<Record<string, import("./index.js").GridPlace[]>>) => any) | undefined;
67
+ onDragStart?: ((event: import("./index.js").GridDragEvent) => any) | undefined;
68
+ onDragEnd?: ((event: import("./index.js").GridDragEndEvent) => any) | undefined;
69
+ onBreakpointChange?: ((breakpoint: string) => any) | undefined;
70
+ }>, import("./index.js").GridLayoutExpose, {}, {}, {}, {
71
+ resize: boolean | import("./index.js").GridResizeHandle[];
72
+ columns: number | Record<string, number>;
73
+ breakpoints: Record<string, number>;
74
+ rowHeight: number;
75
+ gap: number | [number, number];
76
+ compact: import("./layout").GridCompact;
77
+ }>;
78
+ __isFragment?: never;
79
+ __isTeleport?: never;
80
+ __isSuspense?: never;
81
+ } & import("vue").ComponentOptionsBase<Readonly<{
82
+ resize?: boolean | import("./index.js").GridResizeHandle[] | undefined;
83
+ columns?: (number | Record<string, number>) | undefined;
84
+ editable?: boolean | undefined;
85
+ label?: string | undefined;
86
+ breakpoints?: Record<string, number> | undefined;
87
+ rowHeight?: number | undefined;
88
+ gap?: number | [number, number] | undefined;
89
+ compact?: import("./layout").GridCompact | undefined;
90
+ handle?: boolean | undefined;
91
+ itemLabel?: ((item: import("./layout").GridItem) => string) | undefined;
92
+ messages?: import("./locale").DashboardMessagesOverride | undefined;
93
+ } & {
94
+ modelValue?: import("./layout").GridItem[];
95
+ layouts?: import("./index.js").GridLayouts;
96
+ }> & Readonly<{
97
+ onDrop?: ((event: import("./index.js").GridDropEvent) => any) | undefined;
98
+ onChange?: ((event: import("./index.js").GridChangeEvent) => any) | undefined;
99
+ "onUpdate:modelValue"?: ((value: import("./layout").GridItem[]) => any) | undefined;
100
+ "onUpdate:layouts"?: ((value: Partial<Record<string, import("./index.js").GridPlace[]>>) => any) | undefined;
101
+ onDragStart?: ((event: import("./index.js").GridDragEvent) => any) | undefined;
102
+ onDragEnd?: ((event: import("./index.js").GridDragEndEvent) => any) | undefined;
103
+ onBreakpointChange?: ((breakpoint: string) => any) | undefined;
104
+ }>, import("./index.js").GridLayoutExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
105
+ drop: (event: import("./index.js").GridDropEvent) => any;
106
+ change: (event: import("./index.js").GridChangeEvent) => any;
107
+ "update:modelValue": (value: import("./layout").GridItem[]) => any;
108
+ "update:layouts": (value: Partial<Record<string, import("./index.js").GridPlace[]>>) => any;
109
+ dragStart: (event: import("./index.js").GridDragEvent) => any;
110
+ dragEnd: (event: import("./index.js").GridDragEndEvent) => any;
111
+ breakpointChange: (breakpoint: string) => any;
112
+ }, string, {
113
+ resize: boolean | import("./index.js").GridResizeHandle[];
114
+ columns: number | Record<string, number>;
115
+ breakpoints: Record<string, number>;
116
+ rowHeight: number;
117
+ gap: number | [number, number];
118
+ compact: import("./layout").GridCompact;
119
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
120
+ $slots: {
121
+ item?: (props: import("./index.js").GridItemSlotProps) => unknown;
122
+ placeholder?: (props: {
123
+ item: import("./layout").GridItem;
124
+ }) => unknown;
125
+ };
126
+ }), import("vue").HTMLAttributes>;
127
+ export declare const DouGridLayoutHandle: import("dou-ui").WithInstall<{
128
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{
129
+ as?: string;
130
+ }> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
131
+ as: string;
132
+ }, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
133
+ P: {};
134
+ B: {};
135
+ D: {};
136
+ C: {};
137
+ M: {};
138
+ Defaults: {};
139
+ }, Readonly<{
140
+ as?: string;
141
+ }> & Readonly<{}>, {}, {}, {}, {}, {
142
+ as: string;
143
+ }>;
144
+ __isFragment?: never;
145
+ __isTeleport?: never;
146
+ __isSuspense?: never;
147
+ } & import("vue").ComponentOptionsBase<Readonly<{
148
+ as?: string;
149
+ }> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
150
+ as: string;
151
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
152
+ $slots: {
153
+ default?: () => unknown;
154
+ };
155
+ }), import("vue").HTMLAttributes>;
156
+ export declare const DouDashboard: import("dou-ui").WithInstall<import("vue").DefineComponent<{
157
+ columns?: (number | Record<string, number>) | undefined;
158
+ editable?: boolean | undefined;
159
+ label?: string | undefined;
160
+ breakpoints?: Record<string, number> | undefined;
161
+ rowHeight?: number | undefined;
162
+ gap?: number | [number, number] | undefined;
163
+ compact?: import("./layout").GridCompact | undefined;
164
+ messages?: import("./locale").DashboardMessagesOverride | undefined;
165
+ widgets?: import("./index.js").DashboardWidgetType<any>[] | undefined;
166
+ sources?: import("./index.js").DashboardSources | undefined;
167
+ createId?: ((type: string) => string) | undefined;
168
+ collaboration?: import("./index.js").DashboardCollaboration | undefined;
169
+ exporters?: readonly import("@dou-ui/sheet").SheetExporter[] | undefined;
170
+ } & {
171
+ modelValue?: import("./index.js").DashboardDocument;
172
+ filters?: import("./index.js").DashboardFilters;
173
+ }, import("./index.js").DashboardExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
174
+ change: (transaction: import("./index.js").DashboardTransaction) => any;
175
+ "update:modelValue": (value: import("./index.js").DashboardDocument) => any;
176
+ breakpointChange: (breakpoint: string) => any;
177
+ "update:filters": (value: import("./index.js").DashboardFilters) => any;
178
+ exportError: (event: import("./index.js").DashboardExportErrorEvent) => any;
179
+ }, string, import("vue").PublicProps, Readonly<{
180
+ columns?: (number | Record<string, number>) | undefined;
181
+ editable?: boolean | undefined;
182
+ label?: string | undefined;
183
+ breakpoints?: Record<string, number> | undefined;
184
+ rowHeight?: number | undefined;
185
+ gap?: number | [number, number] | undefined;
186
+ compact?: import("./layout").GridCompact | undefined;
187
+ messages?: import("./locale").DashboardMessagesOverride | undefined;
188
+ widgets?: import("./index.js").DashboardWidgetType<any>[] | undefined;
189
+ sources?: import("./index.js").DashboardSources | undefined;
190
+ createId?: ((type: string) => string) | undefined;
191
+ collaboration?: import("./index.js").DashboardCollaboration | undefined;
192
+ exporters?: readonly import("@dou-ui/sheet").SheetExporter[] | undefined;
193
+ } & {
194
+ modelValue?: import("./index.js").DashboardDocument;
195
+ filters?: import("./index.js").DashboardFilters;
196
+ }> & Readonly<{
197
+ onChange?: ((transaction: import("./index.js").DashboardTransaction) => any) | undefined;
198
+ "onUpdate:modelValue"?: ((value: import("./index.js").DashboardDocument) => any) | undefined;
199
+ onBreakpointChange?: ((breakpoint: string) => any) | undefined;
200
+ "onUpdate:filters"?: ((value: import("./index.js").DashboardFilters) => any) | undefined;
201
+ onExportError?: ((event: import("./index.js").DashboardExportErrorEvent) => any) | undefined;
202
+ }>, {
203
+ columns: number | Record<string, number>;
204
+ breakpoints: Record<string, number>;
205
+ rowHeight: number;
206
+ gap: number | [number, number];
207
+ compact: import("./layout").GridCompact;
208
+ widgets: import("./index.js").DashboardWidgetType<any>[];
209
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, import("vue").HTMLAttributes>;
210
+ export declare const DouDashboardPalette: import("dou-ui").WithInstall<{
211
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./index.js").DashboardPaletteProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
212
+ direction: "vertical" | "horizontal";
213
+ for: import("./index.js").DashboardExpose | null;
214
+ }, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
215
+ P: {};
216
+ B: {};
217
+ D: {};
218
+ C: {};
219
+ M: {};
220
+ Defaults: {};
221
+ }, Readonly<import("./index.js").DashboardPaletteProps> & Readonly<{}>, {}, {}, {}, {}, {
222
+ direction: "vertical" | "horizontal";
223
+ for: import("./index.js").DashboardExpose | null;
224
+ }>;
225
+ __isFragment?: never;
226
+ __isTeleport?: never;
227
+ __isSuspense?: never;
228
+ } & import("vue").ComponentOptionsBase<Readonly<import("./index.js").DashboardPaletteProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
229
+ direction: "vertical" | "horizontal";
230
+ for: import("./index.js").DashboardExpose | null;
231
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
232
+ $slots: {
233
+ default?: (props: {
234
+ type: import("./index.js").DashboardWidgetType<any>;
235
+ }) => unknown;
236
+ };
237
+ }), import("vue").HTMLAttributes>;
238
+ export declare const DouDashboardFilterBar: import("dou-ui").WithInstall<{
239
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./index.js").DashboardFilterBarProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
240
+ clearable: boolean;
241
+ for: import("./index.js").DashboardExpose | null;
242
+ fields: import("./index.js").DashboardFilterField[];
243
+ }, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
244
+ P: {};
245
+ B: {};
246
+ D: {};
247
+ C: {};
248
+ M: {};
249
+ Defaults: {};
250
+ }, Readonly<import("./index.js").DashboardFilterBarProps> & Readonly<{}>, {}, {}, {}, {}, {
251
+ clearable: boolean;
252
+ for: import("./index.js").DashboardExpose | null;
253
+ fields: import("./index.js").DashboardFilterField[];
254
+ }>;
255
+ __isFragment?: never;
256
+ __isTeleport?: never;
257
+ __isSuspense?: never;
258
+ } & import("vue").ComponentOptionsBase<Readonly<import("./index.js").DashboardFilterBarProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
259
+ clearable: boolean;
260
+ for: import("./index.js").DashboardExpose | null;
261
+ fields: import("./index.js").DashboardFilterField[];
262
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
263
+ $slots: {
264
+ default?: () => unknown;
265
+ };
266
+ }), import("vue").HTMLAttributes>;
267
+ export type { DashboardAddOptions, DashboardEmits, DashboardExportErrorEvent, DashboardExportOptions, DashboardSaveOptions, DashboardExpose, DashboardFilterBarProps, DashboardPaletteProps, DashboardProps, } from './dashboard/types';
268
+ export type { DashboardDocument, DashboardPlace, DashboardWidget } from './core/types';
269
+ export { checkDocument, emptyDocument, isDashboardPlace, migrateDocument } from './core/document';
270
+ export type { CheckDocumentOptions, DocumentProblem } from './core/document';
271
+ export { applySteps, DashboardTransaction, replaceWidgets, sameValue } from './core/transaction';
272
+ export type { DashboardCollaboration, DashboardCollaborationHost, DashboardPeer, DashboardPresence, DashboardPresenceAction, } from './core/collaboration';
273
+ export type { DashboardStep, DashboardTransactionMeta, DashboardWidgetPatch, } from './core/transaction';
274
+ export { DashboardHistory } from './core/history';
275
+ export { defineDashboardWidget } from './widget/define';
276
+ export type { DashboardWidgetSize, DashboardWidgetType } from './widget/define';
277
+ export { useDashboardWidget } from './widget/context';
278
+ export { isEmptyFilter } from './data/filters';
279
+ export type { DashboardImageOptions } from './dashboard/export';
280
+ export type { DashboardDateRangeFilterField, DashboardFilterField, DashboardFilters, DashboardLinkedFilter, DashboardSearchFilterField, DashboardSelectFilterField, DashboardSetFilterOptions, DashboardSourceContext, DashboardSourceLoad, DashboardSourceOptions, DashboardSources, } from './data/types';
281
+ export type { DashboardWidgetContext, DashboardWidgetState, DashboardWidgetStatus, } from './widget/context';
282
+ export type { GridChangeEvent, GridChangeReason, GridDragEndEvent, GridDragEvent, GridDropEvent, GridDropItem, GridItemSlotProps, GridLayoutEmits, GridLayoutExpose, GridLayoutProps, GridLayouts, GridPlace, GridResizeHandle, } from './grid/types';
283
+ export { compactLayout, deriveLayout, findPlace, fitItem, layoutHeight, moveItem, moveItemBy, normalizeLayout, overlaps, resizeItem, resizeItemBy, } from './layout';
284
+ export type { GridCompact, GridItem, GridLayoutOptions, GridPosition, GridSize } from './layout';
285
+ export { dashboardLocales, useDashboardMessages } from './locale';
286
+ export type { DashboardMessages, DashboardMessagesOverride } from './locale';
287
+ declare module 'vue' {
288
+ interface GlobalComponents {
289
+ DouGridLayout: typeof DouGridLayout;
290
+ DouGridLayoutHandle: typeof DouGridLayoutHandle;
291
+ DouDashboard: typeof DouDashboard;
292
+ DouDashboardPalette: typeof DouDashboardPalette;
293
+ DouDashboardFilterBar: typeof DouDashboardFilterBar;
294
+ }
295
+ }
@@ -0,0 +1,50 @@
1
+ import type { GridItem, GridLayoutOptions, GridPosition, GridSize } from './types';
2
+ type Box = Pick<GridItem, 'x' | 'y' | 'w' | 'h'>;
3
+ /** Whether two boxes share at least one cell. */
4
+ export declare function overlaps(a: Box, b: Box): boolean;
5
+ /** The row just below the lowest item: how many rows the layout takes up. */
6
+ export declare function layoutHeight(items: readonly Box[]): number;
7
+ /**
8
+ * The item with its size inside its limits and the grid's width, and its
9
+ * position on the grid, in whole cells. Returns the item itself when it fits.
10
+ */
11
+ export declare function fitItem(item: GridItem, columns: number): GridItem;
12
+ /**
13
+ * The layout fitted to the grid: sizes inside their limits, nothing past
14
+ * the last column, no two items on the same cell and, when compacting,
15
+ * no gaps above items. Returns `items` itself when it is already settled.
16
+ */
17
+ export declare function normalizeLayout(items: readonly GridItem[], options: GridLayoutOptions): readonly GridItem[];
18
+ /** Floats every item up as far as it goes (ignores `compact`). */
19
+ export declare function compactLayout(items: readonly GridItem[], columns: number): GridItem[];
20
+ /**
21
+ * Moves an item to a cell; the items it lands on make way. Locked items
22
+ * and unknown ids leave the layout as it is.
23
+ */
24
+ export declare function moveItem(items: readonly GridItem[], id: string, to: GridPosition, options: GridLayoutOptions): readonly GridItem[];
25
+ /**
26
+ * Gives an item a new size, keeping its top-left corner; the items it now
27
+ * covers make way. A size that would cover a locked item is refused.
28
+ */
29
+ export declare function resizeItem(items: readonly GridItem[], id: string, to: GridSize, options: GridLayoutOptions): readonly GridItem[];
30
+ /**
31
+ * Moves an item by whole cells, as the arrow keys do. Moving up or down
32
+ * goes on past rows where the item would only settle back where it was,
33
+ * so one press always moves it, to the next place it can take.
34
+ */
35
+ export declare function moveItemBy(items: readonly GridItem[], id: string, dx: number, dy: number, options: GridLayoutOptions): readonly GridItem[];
36
+ /** Resizes an item by whole cells, as Shift and the arrow keys do. */
37
+ export declare function resizeItemBy(items: readonly GridItem[], id: string, dw: number, dh: number, options: GridLayoutOptions): readonly GridItem[];
38
+ /**
39
+ * Where a new item of `size` fits: the first free spot reading from the top
40
+ * left, or below everything when no row has room.
41
+ */
42
+ export declare function findPlace(items: readonly GridItem[], size: GridSize, options: GridLayoutOptions): GridPosition;
43
+ /**
44
+ * The layout worked out for a grid of another width: positions and widths
45
+ * scaled by the ratio of the columns, then settled. On a single column the
46
+ * items are stacked in reading order (top to bottom, then left to right),
47
+ * each keeping its height.
48
+ */
49
+ export declare function deriveLayout(items: readonly GridItem[], from: number, options: GridLayoutOptions): readonly GridItem[];
50
+ export {};
@@ -0,0 +1,2 @@
1
+ export { compactLayout, deriveLayout, findPlace, fitItem, layoutHeight, moveItem, moveItemBy, normalizeLayout, overlaps, resizeItem, resizeItemBy, } from './engine';
2
+ export type { GridCompact, GridItem, GridLayoutOptions, GridPosition, GridSize } from './types';
@@ -0,0 +1,39 @@
1
+ /** One item on the grid, placed in whole columns and rows. */
2
+ export interface GridItem {
3
+ id: string;
4
+ /** The column of its left edge, from 0. */
5
+ x: number;
6
+ /** The row of its top edge, from 0. */
7
+ y: number;
8
+ /** Its width in columns. */
9
+ w: number;
10
+ /** Its height in rows. */
11
+ h: number;
12
+ minW?: number;
13
+ maxW?: number;
14
+ minH?: number;
15
+ maxH?: number;
16
+ /** Can't be moved or resized, and stays where it is: the other items go around it. */
17
+ locked?: boolean;
18
+ }
19
+ /**
20
+ * How items settle after a change:
21
+ *
22
+ * - `'vertical'`: every item floats up as far as it can, so there are no gaps above it;
23
+ * - `false`: items stay where they are put, and only move down out of each other's way.
24
+ */
25
+ export type GridCompact = 'vertical' | false;
26
+ export interface GridLayoutOptions {
27
+ /** How many columns the grid has. */
28
+ columns: number;
29
+ /** Defaults to `'vertical'`. */
30
+ compact?: GridCompact;
31
+ }
32
+ export interface GridPosition {
33
+ x: number;
34
+ y: number;
35
+ }
36
+ export interface GridSize {
37
+ w: number;
38
+ h: number;
39
+ }
@@ -0,0 +1,117 @@
1
+ import { type MaybeRefOrGetter } from 'vue';
2
+ export interface DashboardMessages {
3
+ /** The grid layout's accessible name. */
4
+ layout: string;
5
+ /** What an item of the grid is called by a screen reader. */
6
+ item: string;
7
+ /** Read after an item's name while the layout can be edited. */
8
+ itemHint: string;
9
+ /** An item that can't be moved: `{item}`. */
10
+ locked: string;
11
+ /** An item's place: `{x}` `{y}` (from 1), `{w}` `{h}` (in columns and rows). */
12
+ position: string;
13
+ /** An item's place when the grid has one column: `{n}` of `{count}` (from 1). */
14
+ order: string;
15
+ /** An item picked up with the keyboard: `{item}` and `{position}`. */
16
+ grabbed: string;
17
+ /** An item put down, with the keyboard or the pointer: `{item}` and `{position}`. */
18
+ dropped: string;
19
+ /** A move or resize undone with Escape (or a drop outside the grid): `{item}`. */
20
+ cancelled: string;
21
+ /** The handle in an item's corner. */
22
+ resize: string;
23
+ /** The dashboard's accessible name. */
24
+ dashboard: string;
25
+ /** The menu button in a widget's title bar. */
26
+ widgetMenu: string;
27
+ /** Menu items. */
28
+ settings: string;
29
+ fullscreen: string;
30
+ /** The menu of file types a widget's content can be exported as. */
31
+ export: string;
32
+ /** A failed export, over the widget's content: `{name}` (the file), `{reason}`. */
33
+ exportFailed: string;
34
+ /** Read out once the file is saved: `{name}`. */
35
+ exported: string;
36
+ /** Why a widget can't be exported: it has no data, such as a chart without its fields. */
37
+ nothingToExport: string;
38
+ duplicate: string;
39
+ remove: string;
40
+ /** The settings drawer's title: `{title}`. */
41
+ settingsTitle: string;
42
+ /** The title field in the settings drawer. */
43
+ titleField: string;
44
+ /** Read when a widget is added, copied or removed: `{item}`. */
45
+ added: string;
46
+ removed: string;
47
+ /** A widget whose type isn't registered: `{type}`. */
48
+ unknownType: string;
49
+ /** A widget's status. */
50
+ loading: string;
51
+ error: string;
52
+ empty: string;
53
+ retry: string;
54
+ /** A dashboard without widgets, while editing. */
55
+ emptyTitle: string;
56
+ emptyHint: string;
57
+ /** The list of widgets to add. */
58
+ palette: string;
59
+ /** A widget in that list: `{label}`. */
60
+ paletteItem: string;
61
+ /** In the title bar of a widget that set a filter: `{value}`. */
62
+ filteredBy: string;
63
+ peerMoving: string;
64
+ peerResizing: string;
65
+ peerSettings: string;
66
+ /** The button clearing that filter: `{value}`. */
67
+ clearFilter: string;
68
+ /** The filter bar's accessible name. */
69
+ filterBar: string;
70
+ /** A filter set by a widget, in the filter bar: `{title}` and `{value}`. */
71
+ linkedFilter: string;
72
+ /** Clears every filter. */
73
+ clearFilters: string;
74
+ /** Settings of the built-in widgets. */
75
+ source: string;
76
+ noSource: string;
77
+ field: string;
78
+ value: string;
79
+ prefix: string;
80
+ suffix: string;
81
+ precision: string;
82
+ trend: string;
83
+ delta: string;
84
+ /** The change under a number: `{value}`, e.g. `+12.5%`. */
85
+ deltaText: string;
86
+ text: string;
87
+ textSize: string;
88
+ sizeSmall: string;
89
+ sizeMedium: string;
90
+ sizeLarge: string;
91
+ columns: string;
92
+ /** The title of a table column, while it has none: `{field}`. */
93
+ columnTitle: string;
94
+ chartKind: string;
95
+ chartLine: string;
96
+ chartArea: string;
97
+ chartBar: string;
98
+ chartPie: string;
99
+ xField: string;
100
+ yFields: string;
101
+ stacked: string;
102
+ horizontal: string;
103
+ /** The filter set by clicking a chart. */
104
+ chartFilter: string;
105
+ chartFilterHint: string;
106
+ /** Whether clicking a pivot table's cell filters the other widgets. */
107
+ pivotFilter: string;
108
+ }
109
+ export declare const dashboardLocales: Record<string, DashboardMessages>;
110
+ export type DashboardMessagesOverride = Partial<DashboardMessages>;
111
+ /**
112
+ * The dashboard's texts, picked by the name of DouUI's current locale.
113
+ * Pass `messages` to override any of them.
114
+ */
115
+ export declare function useDashboardMessages(override?: MaybeRefOrGetter<DashboardMessagesOverride | undefined>): import("vue").ComputedRef<DashboardMessages>;
116
+ /** Fills `{name}` placeholders. */
117
+ export declare const format: (text: string, params: Record<string, string | number>) => string;
@@ -0,0 +1,14 @@
1
+ import type { PivotField } from '@dou-ui/pivot';
2
+ import type { WidgetOverrides } from '../widgets';
3
+ import type { PivotWidgetProps } from './types';
4
+ export type { PivotWidgetProps } from './types';
5
+ export interface PivotWidgetOptions extends WidgetOverrides<PivotWidgetProps> {
6
+ /** What the fields hold and how to show them, as `DouPivot`'s `fields`; worked out from the records when left out. */
7
+ fields?: readonly PivotField[];
8
+ }
9
+ /**
10
+ * A pivot table of a source's records, drawn with `@dou-ui/pivot`; its
11
+ * settings lay the fields out, and clicking a cell can filter the other
12
+ * widgets. Needs `@dou-ui/pivot` and its styles.
13
+ */
14
+ export declare function pivotWidget(options?: PivotWidgetOptions): import("..").DashboardWidgetType<PivotWidgetProps>;
@@ -0,0 +1,16 @@
1
+ import type { PivotField } from '@dou-ui/pivot';
2
+ import type { PivotWidgetProps } from './types';
3
+ type __VLS_Props = {
4
+ fields?: readonly PivotField[];
5
+ };
6
+ type __VLS_ModelProps = {
7
+ modelValue: PivotWidgetProps;
8
+ };
9
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ "update:modelValue": (value: PivotWidgetProps) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
+ "onUpdate:modelValue"?: ((value: PivotWidgetProps) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import type { PivotField } from '@dou-ui/pivot';
2
+ type __VLS_Props = {
3
+ fields?: readonly PivotField[];
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { PivotConfig } from '@dou-ui/pivot';
2
+ /** The `props` of a `pivot` widget. */
3
+ export interface PivotWidgetProps {
4
+ source?: string;
5
+ /** Where the records are, when the data isn't the list itself. */
6
+ path?: string;
7
+ /** Which fields go where, as `DouPivot`'s `config`. */
8
+ config?: PivotConfig;
9
+ /** Clicking a cell filters the other widgets by its row and column groups, one filter per field. */
10
+ filter?: boolean;
11
+ }
@@ -0,0 +1,91 @@
1
+ import type { SheetWorkbook } from '@dou-ui/sheet/core';
2
+ import type { ComputedRef, InjectionKey, Ref } from 'vue';
3
+ import type { DashboardWidget } from '../core/types';
4
+ import type { DashboardFilters, DashboardSetFilterOptions } from '../data/types';
5
+ /** What a widget shows instead of, or over, its content. */
6
+ export type DashboardWidgetState = 'ready' | 'loading' | 'error' | 'empty';
7
+ export interface DashboardWidgetStatus {
8
+ state: DashboardWidgetState;
9
+ /** For `error` and `empty`: the line shown. */
10
+ message?: string;
11
+ /** For `error`: what the retry button does; without it there is no button. */
12
+ retry?: () => void;
13
+ }
14
+ export interface DashboardWidgetContext<P extends object = Record<string, unknown>, D = unknown> {
15
+ /** The widget as stored in the document. */
16
+ widget: ComputedRef<DashboardWidget<P>>;
17
+ /** Its `props`, `{}` when it has none. */
18
+ props: ComputedRef<P>;
19
+ /** Whether the dashboard is being edited. */
20
+ editing: ComputedRef<boolean>;
21
+ /** Whether this is the full-screen view of the widget. */
22
+ fullscreen: ComputedRef<boolean>;
23
+ /** The size of the widget's content area, in px; updated once a frame at most. */
24
+ size: {
25
+ width: Ref<number>;
26
+ height: Ref<number>;
27
+ };
28
+ /**
29
+ * Merges keys into the widget's `props`, as one undoable change. Changes
30
+ * with the same `group` within a second undo together.
31
+ */
32
+ setProps: (patch: Partial<P>, options?: {
33
+ group?: string;
34
+ }) => void;
35
+ /**
36
+ * What the frame shows: a loading mark over the content, an error, or an
37
+ * empty notice. Loading and failing to load `props.source` come first.
38
+ */
39
+ status: Readonly<Ref<DashboardWidgetStatus>>;
40
+ setStatus: (state: DashboardWidgetState, options?: Omit<DashboardWidgetStatus, 'state'>) => void;
41
+ /**
42
+ * The data of the source named in `props.source`, loaded with the filters
43
+ * in effect. While new data loads, the last data stays.
44
+ */
45
+ data: Readonly<Ref<D | undefined>>;
46
+ /** Why the source failed to load, if it did. */
47
+ error: Readonly<Ref<unknown>>;
48
+ /** The filters in effect for this widget: all of them but those it set itself. */
49
+ filters: ComputedRef<DashboardFilters>;
50
+ /**
51
+ * Sets a filter for the other widgets, e.g. when a bar of a chart is
52
+ * clicked; an empty value (`undefined`, `null`, `''`, `[]`) clears it.
53
+ * The widget itself keeps showing everything, and its title bar shows
54
+ * the filter with a button to clear it.
55
+ */
56
+ setFilter: (key: string, value: unknown, options?: DashboardSetFilterOptions) => void;
57
+ /** The filters this widget set itself and that are still in effect, e.g. to mark the picked bar. */
58
+ ownFilters: ComputedRef<DashboardFilters>;
59
+ /** Loads the widget's source again. */
60
+ refresh: () => void;
61
+ /** The names of the dashboard's sources, e.g. to pick one in a settings form. */
62
+ sources: ComputedRef<string[]>;
63
+ /**
64
+ * Gives the dashboard the widget's content as a workbook, read when it is
65
+ * exported with one of the dashboard's `exporters`; a sheet without a
66
+ * name takes the widget's title. Returning `undefined` fails the export
67
+ * with "no data to export"; `null` takes the export menu away, such as
68
+ * while the widget isn't set up. A widget that never calls it has no
69
+ * export menu. Undone when the widget goes.
70
+ */
71
+ setWorkbook: (get: (() => SheetWorkbook | undefined) | null) => void;
72
+ }
73
+ export declare const widgetContextKey: InjectionKey<DashboardWidgetContext<any, any>>;
74
+ /** The widget a component is drawn in, for widget types' `component` and `settings`. */
75
+ export declare function useDashboardWidget<P extends object = Record<string, unknown>, D = unknown>(): DashboardWidgetContext<P, D>;
76
+ interface ContextSource {
77
+ widget: () => DashboardWidget;
78
+ editing: () => boolean;
79
+ fullscreen: () => boolean;
80
+ size: {
81
+ width: Ref<number>;
82
+ height: Ref<number>;
83
+ };
84
+ setProps: (id: string, patch: Record<string, unknown>, options?: {
85
+ group?: string;
86
+ }) => void;
87
+ setWorkbook?: (id: string, get: () => SheetWorkbook | undefined) => () => void;
88
+ }
89
+ /** Makes the context of one widget and provides it to the components below. */
90
+ export declare function provideWidgetContext(source: ContextSource): DashboardWidgetContext;
91
+ export {};