@object-ui/plugin-list 17.7.0 → 18.0.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.
@@ -1,23 +1,25 @@
1
1
  /**
2
- * ViewSettingsPopover
2
+ * ViewSettingsPopover — the list toolbar's "Display" control.
3
3
  *
4
- * UX Sprint 2 (P1-4): consolidates four small toolbar controls that the
5
- * UX audit flagged as "too many top-level chips":
6
- * - Group by
7
- * - Row color
4
+ * Since objectui#12423 this is the DEFAULT desktop shape of the list toolbar:
5
+ * the bar keeps Filter, Sort, Display and Search, and everything else sits
6
+ * here, in this order —
7
+ * - Layout (the visualization switcher; only when the list offers a choice)
8
+ * - Group, Row color, Hide fields
8
9
  * - Density
9
- * - Hide fields
10
+ * - Row numbers (a session-only switch, grid only)
11
+ * - Edit inline (a switch, grid only, when the principal may edit)
12
+ * - footer: Reset to view default · Refresh · Export
10
13
  *
11
- * into a single "View settings" popover keyed by a gear icon. Filter and
12
- * Sort remain top-level because they're primary data operations, but the
13
- * appearance/grouping cluster collapses behind one trigger that opens an
14
- * accordion-style sheet.
14
+ * It began as UX Sprint 2 (P1-4)'s "View settings" gear behind
15
+ * `compactToolbar: true`; the wide form — one toolbar button per control — is
16
+ * what a host gets with `compactToolbar: false`, and ListView.tsx keeps it.
17
+ * Content is duplicated between the two forms: change one, change both.
15
18
  *
16
- * Implementation notes:
17
- * - Each section is collapsible (default open) so users can focus on one.
18
- * - Content is duplicated from the original inline popovers; if you change
19
- * behavior, update both this and the legacy code path in ListView.tsx
20
- * (kept behind `appearance.compactToolbar: false` for back-compat).
19
+ * Every control persists exactly what its wide-form twin persists; this
20
+ * component writes nothing itself. The trigger's count is the number of
21
+ * settings that differ from the view's own (the host computes it), and Reset
22
+ * hands every one of them back.
21
23
  *
22
24
  * @module
23
25
  */
@@ -33,6 +35,14 @@ export interface ViewSettingsDensity {
33
35
  export interface ViewSettingsPopoverProps {
34
36
  t: (key: string, opts?: any) => string;
35
37
  allFields: ViewSettingsField[];
38
+ /**
39
+ * The Layout row: the visualization switcher. The host passes it only when
40
+ * the list offers more than one visualization, as a function of `closeMenu`:
41
+ * choosing a layout completes the choice, so the host's switcher calls
42
+ * `closeMenu` when a layout is picked (objectui#12621). The panel's toggles
43
+ * (row numbers, inline edit, density, hidden fields) never close it.
44
+ */
45
+ layout?: (closeMenu: () => void) => React.ReactNode;
36
46
  showGroup?: boolean;
37
47
  groupingConfig?: any;
38
48
  setGroupingConfig?: (next: any) => void;
@@ -50,10 +60,37 @@ export interface ViewSettingsPopoverProps {
50
60
  showHideFields?: boolean;
51
61
  hiddenFields?: Set<string>;
52
62
  updateHiddenFields?: (next: Set<string>) => void;
53
- /** Record editing — toggle inline cell editing (persists `inlineEdit` on the view). */
63
+ /**
64
+ * Row numbers on the grid's leading cell — a session-only setting the host
65
+ * holds in memory (objectui#12423). Offered only when `setRowNumbers` is.
66
+ */
67
+ rowNumbers?: boolean;
68
+ setRowNumbers?: (next: boolean) => void;
69
+ /**
70
+ * Record editing — toggle the grid's inline-edit mode. `setInlineEdit` hands
71
+ * the change to the host, which decides what it does with it; the console
72
+ * keeps it session-only and writes nothing to the view (objectui#5144,
73
+ * ruling E).
74
+ */
54
75
  showInlineEdit?: boolean;
55
76
  inlineEdit?: boolean;
56
77
  setInlineEdit?: (next: boolean) => void;
78
+ /**
79
+ * How many of the settings above differ from the view's own. Drawn as the
80
+ * trigger's count; zero draws none. The host computes it — only it knows
81
+ * what the view declared.
82
+ */
83
+ changedCount?: number;
84
+ /** Hand every changed setting back to the view's own. Drawn when wired. */
85
+ onReset?: () => void;
86
+ /** Footer: re-fetch the list. Drawn when wired. */
87
+ onRefresh?: () => void;
88
+ refreshing?: boolean;
89
+ /** Footer: one export entry per format. Drawn when there is a format. */
90
+ exportFormats?: string[];
91
+ onExport?: (format: string) => void;
92
+ exportBusy?: boolean;
93
+ exportError?: string | null;
57
94
  }
58
95
  export declare function ViewSettingsPopover(props: ViewSettingsPopoverProps): React.JSX.Element;
59
96
  //# sourceMappingURL=ViewSettingsPopover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ViewSettingsPopover.d.ts","sourceRoot":"","sources":["../../src/components/ViewSettingsPopover.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;IAC7C,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACvC,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;IACvC,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAE/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAExC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,SAAS,CAAC;IAChF,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,SAAS,KAAK,IAAI,CAAC;IAElG,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAE9B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CA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AC,KAAK,EAAE,wBAAwB,qBA2QlE"}
package/dist/index.d.ts CHANGED
@@ -12,5 +12,5 @@ export { evaluateConditionalFormatting, normalizeFilterCondition, normalizeFilte
12
12
  export { LIST_DEFAULT_TRANSLATIONS } from './ListView.js';
13
13
  export type { ListViewProps, ListViewHandle } from './ListView.js';
14
14
  export type { ObjectGalleryProps } from './ObjectGallery.js';
15
- export type { ViewSwitcherProps, ViewType } from './ViewSwitcher.js';
15
+ export type { ListViewSwitcherProps } from './ViewSwitcher.js';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3D,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGvG,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAChE,YAAY,EAAE,kBAAkB,EAAE,MAA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