@revenexx/studio-shared 0.3.2 → 0.4.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 (166) hide show
  1. package/dist/module.d.mts +6 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +12 -1
  4. package/dist/runtime/components/Dashboard/DashboardConfirmDialog.d.vue.ts +16 -0
  5. package/dist/runtime/components/Dashboard/DashboardConfirmDialog.vue +39 -0
  6. package/dist/runtime/components/Dashboard/DashboardConfirmDialog.vue.d.ts +16 -0
  7. package/dist/runtime/components/Dashboard/DashboardControls.d.vue.ts +58 -0
  8. package/dist/runtime/components/Dashboard/DashboardControls.vue +209 -0
  9. package/dist/runtime/components/Dashboard/DashboardControls.vue.d.ts +58 -0
  10. package/dist/runtime/components/Dashboard/DashboardGrid.d.vue.ts +17 -0
  11. package/dist/runtime/components/Dashboard/DashboardGrid.vue +87 -0
  12. package/dist/runtime/components/Dashboard/DashboardGrid.vue.d.ts +17 -0
  13. package/dist/runtime/components/Dashboard/DashboardNameDialog.d.vue.ts +19 -0
  14. package/dist/runtime/components/Dashboard/DashboardNameDialog.vue +61 -0
  15. package/dist/runtime/components/Dashboard/DashboardNameDialog.vue.d.ts +19 -0
  16. package/dist/runtime/components/Dashboard/DashboardPickerDialog.d.vue.ts +15 -0
  17. package/dist/runtime/components/Dashboard/DashboardPickerDialog.vue +100 -0
  18. package/dist/runtime/components/Dashboard/DashboardPickerDialog.vue.d.ts +15 -0
  19. package/dist/runtime/components/Dashboard/DashboardShareDialog.d.vue.ts +28 -0
  20. package/dist/runtime/components/Dashboard/DashboardShareDialog.vue +155 -0
  21. package/dist/runtime/components/Dashboard/DashboardShareDialog.vue.d.ts +28 -0
  22. package/dist/runtime/components/Dashboard/DashboardTopBar.d.vue.ts +64 -0
  23. package/dist/runtime/components/Dashboard/DashboardTopBar.vue +79 -0
  24. package/dist/runtime/components/Dashboard/DashboardTopBar.vue.d.ts +64 -0
  25. package/dist/runtime/components/Dashboard/DashboardWidgetConfigDialog.d.vue.ts +44 -0
  26. package/dist/runtime/components/Dashboard/DashboardWidgetConfigDialog.vue +153 -0
  27. package/dist/runtime/components/Dashboard/DashboardWidgetConfigDialog.vue.d.ts +44 -0
  28. package/dist/runtime/components/Dashboard/DashboardWidgetFrame.d.vue.ts +28 -0
  29. package/dist/runtime/components/Dashboard/DashboardWidgetFrame.vue +80 -0
  30. package/dist/runtime/components/Dashboard/DashboardWidgetFrame.vue.d.ts +28 -0
  31. package/dist/runtime/components/Dashboard/DashboardWidgetHost.d.vue.ts +7 -0
  32. package/dist/runtime/components/Dashboard/DashboardWidgetHost.vue +30 -0
  33. package/dist/runtime/components/Dashboard/DashboardWidgetHost.vue.d.ts +7 -0
  34. package/dist/runtime/components/Dashboard/DashboardWidgetIcon.d.vue.ts +9 -0
  35. package/dist/runtime/components/Dashboard/DashboardWidgetIcon.vue +13 -0
  36. package/dist/runtime/components/Dashboard/DashboardWidgetIcon.vue.d.ts +9 -0
  37. package/dist/runtime/components/Dashboard/DashboardWidgetLibrary.d.vue.ts +24 -0
  38. package/dist/runtime/components/Dashboard/DashboardWidgetLibrary.vue +140 -0
  39. package/dist/runtime/components/Dashboard/DashboardWidgetLibrary.vue.d.ts +24 -0
  40. package/dist/runtime/components/Dashboard/DashboardWidgetPreview.d.vue.ts +23 -0
  41. package/dist/runtime/components/Dashboard/DashboardWidgetPreview.vue +124 -0
  42. package/dist/runtime/components/Dashboard/DashboardWidgetPreview.vue.d.ts +23 -0
  43. package/dist/runtime/components/DataTable/ColumnsMenu.d.vue.ts +2 -1
  44. package/dist/runtime/components/DataTable/ColumnsMenu.vue.d.ts +2 -1
  45. package/dist/runtime/components/DataTable/DataTable.d.vue.ts +105 -28
  46. package/dist/runtime/components/DataTable/DataTable.vue +403 -38
  47. package/dist/runtime/components/DataTable/DataTable.vue.d.ts +105 -28
  48. package/dist/runtime/components/DataTable/FacetChips.d.vue.ts +17 -0
  49. package/dist/runtime/components/DataTable/FacetChips.vue +72 -0
  50. package/dist/runtime/components/DataTable/FacetChips.vue.d.ts +17 -0
  51. package/dist/runtime/components/DataTable/FacetPanel.d.vue.ts +21 -0
  52. package/dist/runtime/components/DataTable/FacetPanel.vue +359 -0
  53. package/dist/runtime/components/DataTable/FacetPanel.vue.d.ts +21 -0
  54. package/dist/runtime/components/DataTable/FilterMenu.d.vue.ts +6 -5
  55. package/dist/runtime/components/DataTable/FilterMenu.vue.d.ts +6 -5
  56. package/dist/runtime/components/DataTable/SavedViewsMenu.d.vue.ts +6 -1
  57. package/dist/runtime/components/DataTable/SavedViewsMenu.vue +83 -63
  58. package/dist/runtime/components/DataTable/SavedViewsMenu.vue.d.ts +6 -1
  59. package/dist/runtime/components/DataTable/SortMenu.d.vue.ts +9 -3
  60. package/dist/runtime/components/DataTable/SortMenu.vue +40 -12
  61. package/dist/runtime/components/DataTable/SortMenu.vue.d.ts +9 -3
  62. package/dist/runtime/components/DataTable/ViewModeSwitch.d.vue.ts +4 -2
  63. package/dist/runtime/components/DataTable/ViewModeSwitch.vue.d.ts +4 -2
  64. package/dist/runtime/components/Form/FieldCell.d.vue.ts +32 -0
  65. package/dist/runtime/components/Form/FieldCell.vue +46 -0
  66. package/dist/runtime/components/Form/FieldCell.vue.d.ts +32 -0
  67. package/dist/runtime/components/Form/FieldGrid.d.vue.ts +13 -0
  68. package/dist/runtime/components/Form/FieldGrid.vue +11 -0
  69. package/dist/runtime/components/Form/FieldGrid.vue.d.ts +13 -0
  70. package/dist/runtime/components/Form/FormContextCard.d.vue.ts +33 -0
  71. package/dist/runtime/components/Form/FormContextCard.vue +56 -0
  72. package/dist/runtime/components/Form/FormContextCard.vue.d.ts +33 -0
  73. package/dist/runtime/components/Form/FormLayout.d.vue.ts +47 -0
  74. package/dist/runtime/components/Form/FormLayout.vue +169 -0
  75. package/dist/runtime/components/Form/FormLayout.vue.d.ts +47 -0
  76. package/dist/runtime/components/Form/FormSection.d.vue.ts +25 -0
  77. package/dist/runtime/components/Form/FormSection.vue +48 -0
  78. package/dist/runtime/components/Form/FormSection.vue.d.ts +25 -0
  79. package/dist/runtime/components/Form/SaveBar.d.vue.ts +44 -0
  80. package/dist/runtime/components/Form/SaveBar.vue +71 -0
  81. package/dist/runtime/components/Form/SaveBar.vue.d.ts +44 -0
  82. package/dist/runtime/components/Media/MediaFolderTree.d.vue.ts +2 -1
  83. package/dist/runtime/components/Media/MediaFolderTree.vue.d.ts +2 -1
  84. package/dist/runtime/components/Media/MediaPickerDialog.d.vue.ts +4 -3
  85. package/dist/runtime/components/Media/MediaPickerDialog.vue.d.ts +4 -3
  86. package/dist/runtime/components/Media/MediaUploader.d.vue.ts +4 -3
  87. package/dist/runtime/components/Media/MediaUploader.vue.d.ts +4 -3
  88. package/dist/runtime/components/Shared/AppIcon.d.vue.ts +21 -0
  89. package/dist/runtime/components/Shared/AppIcon.vue +47 -0
  90. package/dist/runtime/components/Shared/AppIcon.vue.d.ts +21 -0
  91. package/dist/runtime/components/Shared/BuildLogsFlyout.d.vue.ts +2 -1
  92. package/dist/runtime/components/Shared/BuildLogsFlyout.vue.d.ts +2 -1
  93. package/dist/runtime/components/Shared/DetailSheet.d.vue.ts +60 -0
  94. package/dist/runtime/components/Shared/DetailSheet.vue +207 -0
  95. package/dist/runtime/components/Shared/DetailSheet.vue.d.ts +60 -0
  96. package/dist/runtime/components/Shared/FloatingPanel.d.vue.ts +7 -6
  97. package/dist/runtime/components/Shared/FloatingPanel.vue.d.ts +7 -6
  98. package/dist/runtime/components/Shared/GitDeploymentSettings.d.vue.ts +2 -1
  99. package/dist/runtime/components/Shared/GitDeploymentSettings.vue.d.ts +2 -1
  100. package/dist/runtime/components/Shared/KpiTile.d.vue.ts +2 -1
  101. package/dist/runtime/components/Shared/KpiTile.vue.d.ts +2 -1
  102. package/dist/runtime/components/Shared/ListSurface.d.vue.ts +3 -2
  103. package/dist/runtime/components/Shared/ListSurface.vue.d.ts +3 -2
  104. package/dist/runtime/components/Shared/PageHeader.d.vue.ts +7 -6
  105. package/dist/runtime/components/Shared/PageHeader.vue.d.ts +7 -6
  106. package/dist/runtime/components/Shared/RecordLayout.d.vue.ts +8 -7
  107. package/dist/runtime/components/Shared/RecordLayout.vue.d.ts +8 -7
  108. package/dist/runtime/components/Shared/RecordRailCard.d.vue.ts +3 -2
  109. package/dist/runtime/components/Shared/RecordRailCard.vue.d.ts +3 -2
  110. package/dist/runtime/components/Shared/SidebarNav.d.vue.ts +3 -2
  111. package/dist/runtime/components/Shared/SidebarNav.vue.d.ts +3 -2
  112. package/dist/runtime/components/Shared/SidebarNavLink.d.vue.ts +2 -1
  113. package/dist/runtime/components/Shared/SidebarNavLink.vue.d.ts +2 -1
  114. package/dist/runtime/components/Shared/SortHeader.d.vue.ts +3 -2
  115. package/dist/runtime/components/Shared/SortHeader.vue +6 -2
  116. package/dist/runtime/components/Shared/SortHeader.vue.d.ts +3 -2
  117. package/dist/runtime/components/Shared/StateCard.d.vue.ts +6 -5
  118. package/dist/runtime/components/Shared/StateCard.vue.d.ts +6 -5
  119. package/dist/runtime/components/Shared/StudioCard.d.vue.ts +5 -4
  120. package/dist/runtime/components/Shared/StudioCard.vue.d.ts +5 -4
  121. package/dist/runtime/components/Shared/TabBar.d.vue.ts +9 -10
  122. package/dist/runtime/components/Shared/TabBar.vue +26 -7
  123. package/dist/runtime/components/Shared/TabBar.vue.d.ts +9 -10
  124. package/dist/runtime/components/Shared/ViewTab.d.vue.ts +2 -1
  125. package/dist/runtime/components/Shared/ViewTab.vue.d.ts +2 -1
  126. package/dist/runtime/components/Shared/Wizard.d.vue.ts +10 -7
  127. package/dist/runtime/components/Shared/Wizard.vue.d.ts +10 -7
  128. package/dist/runtime/composables/useDashboards.d.ts +27 -0
  129. package/dist/runtime/composables/useDashboards.js +143 -0
  130. package/dist/runtime/composables/useDetailSheet.d.ts +20 -0
  131. package/dist/runtime/composables/useDetailSheet.js +50 -0
  132. package/dist/runtime/composables/usePlatformTenant.d.ts +6 -0
  133. package/dist/runtime/composables/useSavedViews.d.ts +44 -0
  134. package/dist/runtime/composables/useSavedViews.js +44 -0
  135. package/dist/runtime/composables/useStickyListView.d.ts +60 -0
  136. package/dist/runtime/composables/useStickyListView.js +32 -0
  137. package/dist/runtime/lib/activeTenant.d.ts +58 -0
  138. package/dist/runtime/lib/activeTenant.js +45 -0
  139. package/dist/runtime/lib/appIcon.d.ts +48 -0
  140. package/dist/runtime/lib/appIcon.js +27 -0
  141. package/dist/runtime/lib/canonicalJson.d.ts +43 -0
  142. package/dist/runtime/lib/canonicalJson.js +38 -0
  143. package/dist/runtime/lib/dashboardIcons.d.ts +4 -0
  144. package/dist/runtime/lib/dashboardIcons.js +50 -0
  145. package/dist/runtime/lib/detailSheet.d.ts +43 -0
  146. package/dist/runtime/lib/detailSheet.js +34 -0
  147. package/dist/runtime/lib/facets.d.ts +200 -0
  148. package/dist/runtime/lib/facets.js +171 -0
  149. package/dist/runtime/lib/formLayout.d.ts +94 -0
  150. package/dist/runtime/lib/formLayout.js +70 -0
  151. package/dist/runtime/lib/formLayoutContext.d.ts +26 -0
  152. package/dist/runtime/lib/formLayoutContext.js +1 -0
  153. package/dist/runtime/lib/gridTracks.d.ts +55 -0
  154. package/dist/runtime/lib/gridTracks.js +29 -0
  155. package/dist/runtime/lib/rowMove.d.ts +38 -0
  156. package/dist/runtime/lib/rowMove.js +20 -0
  157. package/dist/runtime/lib/solarIconMap.d.ts +15 -0
  158. package/dist/runtime/lib/solarIconMap.js +280 -0
  159. package/dist/runtime/lib/solarIcons.d.ts +37 -0
  160. package/dist/runtime/lib/solarIcons.js +25 -0
  161. package/dist/runtime/lib/widgetRegistry.d.ts +124 -0
  162. package/dist/runtime/lib/widgetRegistry.js +66 -0
  163. package/dist/runtime/types/dashboard.d.ts +95 -0
  164. package/dist/runtime/types/dashboard.js +2 -0
  165. package/dist/types.d.mts +12 -0
  166. package/package.json +3 -2
@@ -1,16 +1,9 @@
1
- import type { DataTableColumn, DataTableFilter, DataTableRail, DataTableSavedViews, DataTableState, DataTableViewMode, RowKey, SortState } from './types.js';
2
- declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
- props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
- readonly "onUpdate:sort"?: ((value: SortState) => any) | undefined;
5
- readonly "onUpdate:page"?: ((value: number) => any) | undefined;
6
- readonly "onUpdate:viewMode"?: ((value: string) => any) | undefined;
7
- readonly "onUpdate:railOpen"?: ((value: boolean) => any) | undefined;
8
- readonly onRowClick?: ((row: T) => any) | undefined;
9
- readonly onStateChange?: ((state: DataTableState) => any) | undefined;
10
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:sort" | "onUpdate:page" | "onUpdate:viewMode" | "onUpdate:railOpen" | "onRowClick" | "onStateChange"> & ({
1
+ import { Eye } from '#solar-icons';
2
+ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<({
11
4
  data: T[];
12
- columns: DataTableColumn<T>[];
13
- rowKey: RowKey<T>;
5
+ columns: Eye<T>[];
6
+ rowKey: Eye<T>;
14
7
  /** `label` is the field's accessible name; it defaults to the placeholder
15
8
  * where the surface wrote one (see `searchLabel`). */
16
9
  search?: boolean | {
@@ -27,15 +20,34 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
27
20
  };
28
21
  /** Built-in status/dimension filter pills (static mode). One dimension, or
29
22
  * several (each renders as its own sub-menu). */
30
- filterTabs?: DataTableFilter<T> | DataTableFilter<T>[];
23
+ filterTabs?: Eye<T> | Eye<T>[];
24
+ /**
25
+ * The surface's declared dimensions, as one facet model (PE-6xx).
26
+ *
27
+ * The THIRD filter path, and the one the others are being folded into. It
28
+ * differs from `filterTabs` in who does the work: those are filtered in
29
+ * memory here, which a server-paged list cannot use — a facet count taken
30
+ * over one page of fifty rows out of twenty-three thousand is a number
31
+ * nobody can reconcile with the table under it. Here the surface owns the
32
+ * query and the counts, and this component only draws the control and hands
33
+ * back a committed selection (`v-model:facet-selection`).
34
+ *
35
+ * EVERY declared dimension lives in this one panel, committed together, and
36
+ * reads back in one chip strip under the toolbar. There is deliberately no
37
+ * second placement: a tree pinned in a left column beside a panel is two
38
+ * places to look and two commit rules for one question.
39
+ */
40
+ facets?: Eye[];
41
+ /** Say which facet each chip belongs to (see `FacetChips.showFacet`). */
42
+ chipFacetLabels?: boolean;
31
43
  /** Saved views control — the surface supplies snapshot/apply, the table
32
44
  * owns the control, the storage and the dialogs. */
33
- savedViews?: DataTableSavedViews | null;
45
+ savedViews?: Eye | null;
34
46
  /** View-mode switch (e.g. List | Gallery). Any mode other than `list`
35
47
  * renders the `#view` slot in place of the table body. */
36
- viewModes?: DataTableViewMode[] | null;
48
+ viewModes?: Eye[] | null;
37
49
  /** Collapse handle for the surface's left rail (see `ListSurface`). */
38
- rail?: boolean | DataTableRail;
50
+ rail?: boolean | Eye;
39
51
  /**
40
52
  * Scroll the ROWS inside the table instead of the page.
41
53
  *
@@ -52,8 +64,13 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
52
64
  * sitting above it. That is not a detail: a scrollbar takes width from the
53
65
  * scrolling box, so a header outside it stays wider than the rows and every
54
66
  * column drifts by however wide the scrollbar is.
67
+ *
68
+ * `'fit'` measures instead of guessing: the rows get whatever height is left
69
+ * in the surrounding scroll container, so the table ends where the page ends
70
+ * and nothing below it is pushed out of sight. A short list still ends after
71
+ * its last row — the measurement is a MAXIMUM, not a height.
55
72
  */
56
- scrollBody?: boolean | {
73
+ scrollBody?: boolean | "fit" | {
57
74
  maxHeight?: string;
58
75
  };
59
76
  pagination?: boolean | {
@@ -69,18 +86,66 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
69
86
  emptyText?: string;
70
87
  groupBy?: ((row: T) => string[]) | null;
71
88
  groupEmptyLabel?: string;
89
+ /** The row whose record is open beside the table (a DetailSheet), marked so
90
+ * reading down the list keeps the place visible (PE-690). */
91
+ activeRowKey?: string | number | null;
92
+ /**
93
+ * A row's own tint — a quantity tier set apart under the SKU it belongs to.
94
+ * Replaces the row's default ground rather than stacking on it: two
95
+ * translucent backgrounds on one element are whichever Tailwind emitted last.
96
+ */
97
+ rowClass?: ((row: T) => string | null | undefined) | null;
98
+ /**
99
+ * Rows the operator orders by dragging (PE-952). Draws a handle in a leading
100
+ * column; a drop — or the arrow keys on a focused handle — emits `rowMove`
101
+ * with the new order. The table writes nothing: what a position MEANS, and
102
+ * which rows have to be written for it, is the surface's to decide.
103
+ */
104
+ reorderable?: boolean;
105
+ /**
106
+ * Why the handles are off right now, or null when they are on. The surface
107
+ * knows the cases this component cannot see — a sort that is not the
108
+ * sequence, a write still in flight. The table adds its own: a search, a
109
+ * filter or a grouping, under any of which "the row above" is not the row
110
+ * above in the sequence.
111
+ */
112
+ reorderDisabled?: string | null;
72
113
  } & {
73
- sort?: SortState;
114
+ sort?: Eye;
74
115
  page?: number;
75
116
  viewMode?: string;
76
117
  railOpen?: boolean;
77
- }) & Partial<{}>> & import("vue").PublicProps;
78
- expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
118
+ /**
119
+ * The committed facet selection. Two-way so a chip removed under the toolbar,
120
+ * a facet picked in the surface's pinned rail and the panel's own Apply all
121
+ * write to one place — and so the surface can seed it from a saved view or a
122
+ * URL without this component holding a second copy to drift from.
123
+ */
124
+ facetSelection?: Eye;
125
+ }) & {
126
+ onRowClick?: ((row: T) => any) | undefined;
127
+ onStateChange?: ((state: DataTableState) => any) | undefined;
128
+ onOrderChange?: ((keys: (string | number)[]) => any) | undefined;
129
+ onRowMove?: ((move: {
130
+ key: string | number;
131
+ from: number;
132
+ to: number;
133
+ keys: (string | number)[];
134
+ }) => any) | undefined;
135
+ "onUpdate:sort"?: ((value: SortState) => any) | undefined;
136
+ "onUpdate:page"?: ((value: number) => any) | undefined;
137
+ "onUpdate:viewMode"?: ((value: string) => any) | undefined;
138
+ "onUpdate:railOpen"?: ((value: boolean) => any) | undefined;
139
+ "onUpdate:facetSelection"?: ((value: FacetSelection) => any) | undefined;
140
+ }> & (typeof globalThis extends {
141
+ __VLS_PROPS_FALLBACK: infer P;
142
+ } ? P : {});
143
+ expose: (exposed: {}) => void;
79
144
  attrs: any;
80
145
  slots: {
81
- [x: string]: ((props: {}) => any) | undefined;
146
+ [x: `header-${any}`]: ((props: {}) => any) | undefined;
82
147
  } & {
83
- [x: string]: ((props: {
148
+ [x: `cell-${any}`]: ((props: {
84
149
  row: any;
85
150
  }) => any) | undefined;
86
151
  } & {
@@ -96,16 +161,28 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
96
161
  } & {
97
162
  view?: (props: {
98
163
  rows: any;
99
- loading: any;
164
+ loading: boolean;
100
165
  }) => any;
101
166
  } & {
102
- empty?: (props: {}) => any;
167
+ empty?: (props: {
168
+ query: any;
169
+ filters: any;
170
+ clear: () => void;
171
+ }) => any;
103
172
  };
104
- emit: (((evt: "rowClick", row: T) => void) & ((evt: "stateChange", state: DataTableState) => void)) & (((evt: "update:sort", value: SortState) => void) & ((evt: "update:page", value: number) => void) & ((evt: "update:viewMode", value: string) => void) & ((evt: "update:railOpen", value: boolean) => void));
173
+ emit: (((evt: "rowClick", row: T) => void) & ((evt: "stateChange", state: DataTableState) => void) & ((evt: "orderChange", keys: (string | number)[]) => void) & ((evt: "rowMove", move: {
174
+ key: string | number;
175
+ from: number;
176
+ to: number;
177
+ keys: (string | number)[];
178
+ }) => void)) & (((event: "update:sort", value: SortState) => void) & ((event: "update:page", value: number) => void) & ((event: "update:viewMode", value: string) => void) & ((event: "update:railOpen", value: boolean) => void) & ((event: "update:facetSelection", value: FacetSelection) => void));
105
179
  }>) => import("vue").VNode & {
106
- __ctx?: Awaited<typeof __VLS_setup>;
180
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
107
181
  };
182
+ declare const _default: typeof __VLS_export;
108
183
  export default _default;
109
- type __VLS_PrettifyLocal<T> = {
184
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
110
185
  [K in keyof T]: T[K];
111
- } & {};
186
+ } : {
187
+ [K in keyof T as K]: T[K];
188
+ }) & {};
@@ -0,0 +1,17 @@
1
+ import type { Facet, FacetSelection } from '../../lib/facets.js';
2
+ type __VLS_Props = {
3
+ facets: Facet[];
4
+ modelValue: FacetSelection;
5
+ /**
6
+ * Say which facet each chip belongs to. On where "Draft" could be a status or
7
+ * a lifecycle; off where the values speak for themselves.
8
+ */
9
+ showFacet?: boolean;
10
+ };
11
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ "update:modelValue": (value: FacetSelection) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ "onUpdate:modelValue"?: ((value: FacetSelection) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
@@ -0,0 +1,72 @@
1
+ <script setup>
2
+ import { computed } from "vue";
3
+ import { CloseCircle } from "#solar-icons";
4
+ import { dateTimeFormat } from "../../lib/formatBridge";
5
+ import { appliedFacets, clearFacetValue } from "../../lib/facets";
6
+ const props = defineProps({
7
+ facets: { type: Array, required: true },
8
+ modelValue: { type: Object, required: true },
9
+ showFacet: { type: Boolean, required: false }
10
+ });
11
+ const emit = defineEmits(["update:modelValue"]);
12
+ const t = useT();
13
+ function formatRange(range) {
14
+ const fmt = dateTimeFormat({ dateStyle: "medium" });
15
+ const one = (value) => {
16
+ if (!value) return null;
17
+ const date = new Date(value);
18
+ return Number.isNaN(date.getTime()) ? value : fmt.format(date);
19
+ };
20
+ const from = one(range.from);
21
+ const to = one(range.to);
22
+ if (from && to) return `${from} \u2013 ${to}`;
23
+ if (from) return t("shared.facetchips.range.since", { date: from });
24
+ return t("shared.facetchips.range.until", { date: to ?? "" });
25
+ }
26
+ const chips = computed(() => appliedFacets(props.facets, props.modelValue, {
27
+ range: formatRange,
28
+ text: (value) => `\u201C${value}\u201D`
29
+ }));
30
+ function remove(chip) {
31
+ emit("update:modelValue", clearFacetValue(props.modelValue, chip.facetKey, chip.value));
32
+ }
33
+ function clearAll() {
34
+ emit("update:modelValue", {});
35
+ }
36
+ </script>
37
+
38
+ <template>
39
+ <div
40
+ v-if="chips.length"
41
+ class="flex flex-wrap items-center gap-1.5 border-t border-black/[0.04] bg-white px-4 py-2.5"
42
+ role="group"
43
+ :aria-label="t('shared.facetchips.aria')"
44
+ >
45
+ <span
46
+ v-for="chip in chips"
47
+ :key="chip.id"
48
+ class="inline-flex items-center gap-1.5 rounded-full bg-primary/10 py-0.5 pr-1 pl-2.5 text-xs font-medium text-primary"
49
+ >
50
+ <span v-if="showFacet" class="font-normal opacity-60">{{ chip.facetLabel }}</span>
51
+ <span class="max-w-60 truncate">{{ chip.label }}</span>
52
+ <button
53
+ type="button"
54
+ class="cursor-pointer rounded-full opacity-60 transition-opacity hover:opacity-100"
55
+ :aria-label="t('shared.facetchips.remove', { facet: chip.facetLabel, value: chip.label })"
56
+ @click="remove(chip)"
57
+ >
58
+ <CloseCircle :size="13" weight="Bold" />
59
+ </button>
60
+ </span>
61
+ <!-- Only past two. With one chip beside it, "clear all" is a second control
62
+ for what the cross next to it already does. -->
63
+ <button
64
+ v-if="chips.length > 1"
65
+ type="button"
66
+ class="ml-1 cursor-pointer text-xs text-muted-foreground underline decoration-from-font underline-offset-2 hover:text-foreground"
67
+ @click="clearAll"
68
+ >
69
+ {{ t("shared.facetchips.clearAll") }}
70
+ </button>
71
+ </div>
72
+ </template>
@@ -0,0 +1,17 @@
1
+ import type { Facet, FacetSelection } from '../../lib/facets.js';
2
+ type __VLS_Props = {
3
+ facets: Facet[];
4
+ modelValue: FacetSelection;
5
+ /**
6
+ * Say which facet each chip belongs to. On where "Draft" could be a status or
7
+ * a lifecycle; off where the values speak for themselves.
8
+ */
9
+ showFacet?: boolean;
10
+ };
11
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ "update:modelValue": (value: FacetSelection) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ "onUpdate:modelValue"?: ((value: FacetSelection) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import type { Facet, FacetSelection } from '../../lib/facets.js';
2
+ type __VLS_Props = {
3
+ /** Every dimension this list can be narrowed by. All of them live here. */
4
+ facets: Facet[];
5
+ /** What is applied right now. */
6
+ modelValue: FacetSelection;
7
+ size?: 'sm' | 'default';
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ reset: () => any;
11
+ "update:modelValue": (value: FacetSelection) => any;
12
+ apply: (value: FacetSelection) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ onReset?: (() => any) | undefined;
15
+ "onUpdate:modelValue"?: ((value: FacetSelection) => any) | undefined;
16
+ onApply?: ((value: FacetSelection) => any) | undefined;
17
+ }>, {
18
+ size: "sm" | "default";
19
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;