@mieweb/ui 0.7.3-dev.15 → 0.7.3-dev.16

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 (40) hide show
  1. package/dist/brands/index.cjs +12 -12
  2. package/dist/brands/index.js +3 -3
  3. package/dist/{chunk-33TQ25IK.js → chunk-2WLP2ERQ.js} +4 -4
  4. package/dist/{chunk-33TQ25IK.js.map → chunk-2WLP2ERQ.js.map} +1 -1
  5. package/dist/{chunk-I2AHT7JM.js → chunk-CKZX6IQN.js} +27 -2
  6. package/dist/chunk-CKZX6IQN.js.map +1 -0
  7. package/dist/{chunk-MO65V64I.js → chunk-DSSMQH74.js} +2 -2
  8. package/dist/{chunk-MO65V64I.js.map → chunk-DSSMQH74.js.map} +1 -1
  9. package/dist/{chunk-JU62BLDY.cjs → chunk-GJD4OW7P.cjs} +27 -2
  10. package/dist/chunk-GJD4OW7P.cjs.map +1 -0
  11. package/dist/chunk-K6CSD3S7.js +498 -0
  12. package/dist/chunk-K6CSD3S7.js.map +1 -0
  13. package/dist/chunk-PIQBB2JY.cjs +525 -0
  14. package/dist/chunk-PIQBB2JY.cjs.map +1 -0
  15. package/dist/{chunk-JDHIBJ5K.cjs → chunk-RBEQQ4GG.cjs} +2 -2
  16. package/dist/{chunk-JDHIBJ5K.cjs.map → chunk-RBEQQ4GG.cjs.map} +1 -1
  17. package/dist/{chunk-35HHCXWC.cjs → chunk-SETNPK4P.cjs} +4 -4
  18. package/dist/{chunk-35HHCXWC.cjs.map → chunk-SETNPK4P.cjs.map} +1 -1
  19. package/dist/components/CustomizableDashboard/index.cjs +33 -0
  20. package/dist/components/CustomizableDashboard/index.cjs.map +1 -0
  21. package/dist/components/CustomizableDashboard/index.d.cts +121 -0
  22. package/dist/components/CustomizableDashboard/index.d.ts +121 -0
  23. package/dist/components/CustomizableDashboard/index.js +4 -0
  24. package/dist/components/CustomizableDashboard/index.js.map +1 -0
  25. package/dist/esheet.cjs +6 -6
  26. package/dist/esheet.js +3 -3
  27. package/dist/index.cjs +146 -121
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +1 -0
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.js +17 -16
  32. package/dist/index.js.map +1 -1
  33. package/dist/styles.css +1 -1
  34. package/dist/tailwind-preset.cjs +4 -4
  35. package/dist/tailwind-preset.js +1 -1
  36. package/dist/utils/index.cjs +9 -9
  37. package/dist/utils/index.js +1 -1
  38. package/package.json +4 -1
  39. package/dist/chunk-I2AHT7JM.js.map +0 -1
  40. package/dist/chunk-JU62BLDY.cjs.map +0 -1
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ var chunkPIQBB2JY_cjs = require('../../chunk-PIQBB2JY.cjs');
4
+ require('../../chunk-S5RVSXDV.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "CustomizableDashboard", {
9
+ enumerable: true,
10
+ get: function () { return chunkPIQBB2JY_cjs.CustomizableDashboard; }
11
+ });
12
+ Object.defineProperty(exports, "consolidateColumns", {
13
+ enumerable: true,
14
+ get: function () { return chunkPIQBB2JY_cjs.consolidateColumns; }
15
+ });
16
+ Object.defineProperty(exports, "mergeColumnOrder", {
17
+ enumerable: true,
18
+ get: function () { return chunkPIQBB2JY_cjs.mergeColumnOrder; }
19
+ });
20
+ Object.defineProperty(exports, "moveAcrossColumns", {
21
+ enumerable: true,
22
+ get: function () { return chunkPIQBB2JY_cjs.moveAcrossColumns; }
23
+ });
24
+ Object.defineProperty(exports, "reorderOnDrop", {
25
+ enumerable: true,
26
+ get: function () { return chunkPIQBB2JY_cjs.reorderOnDrop; }
27
+ });
28
+ Object.defineProperty(exports, "requiredColumns", {
29
+ enumerable: true,
30
+ get: function () { return chunkPIQBB2JY_cjs.requiredColumns; }
31
+ });
32
+ //# sourceMappingURL=index.cjs.map
33
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,121 @@
1
+ import * as React from 'react';
2
+
3
+ /** A dashboard item: a stable id plus the rendered content. */
4
+ interface PortletItem {
5
+ id: string;
6
+ node: React.ReactNode;
7
+ }
8
+ /** Number of visible columns. */
9
+ type DashboardLayout = 1 | 2 | 3;
10
+ /** Portlet items grouped into three logical columns. */
11
+ type DashboardColumns = [PortletItem[], PortletItem[], PortletItem[]];
12
+ /** Portlet ids grouped into three logical columns. */
13
+ type DashboardOrder = [string[], string[], string[]];
14
+ interface CustomizableDashboardProps {
15
+ /**
16
+ * Portlets grouped into three columns. This is the default arrangement;
17
+ * user reordering (persisted or controlled) takes precedence. Items later
18
+ * removed from props disappear from saved layouts automatically, and new
19
+ * items appear in their props column.
20
+ */
21
+ columns: DashboardColumns;
22
+ /** Toolbar heading rendered before the layout toggle. */
23
+ title?: string;
24
+ /**
25
+ * Base localStorage key used to persist column order and layout mode
26
+ * (`{storageKey}-portlet-order` / `{storageKey}-dashboard-layout`).
27
+ * Omit to disable built-in persistence (e.g. when using `order` /
28
+ * `onOrderChange` with a server-side store). Distinct dashboards must
29
+ * pass distinct keys.
30
+ */
31
+ storageKey?: string;
32
+ /** Accessible label for the dashboard grid region. */
33
+ ariaLabel?: string;
34
+ /**
35
+ * Optional DOM element to portal the toolbar (title + layout toggle)
36
+ * into, e.g. a page header actions row. When omitted, the toolbar
37
+ * renders inline above the grid.
38
+ */
39
+ toolbarSlot?: HTMLElement | null;
40
+ /** Initial column order for uncontrolled usage with external persistence. */
41
+ defaultOrder?: DashboardOrder;
42
+ /** Controlled column order. Changes are reported via `onOrderChange`. */
43
+ order?: DashboardOrder;
44
+ /** Called with the full new order after a drop or layout normalization. */
45
+ onOrderChange?: (order: DashboardOrder) => void;
46
+ /** Initial layout mode for uncontrolled usage (default 3). */
47
+ defaultLayout?: DashboardLayout;
48
+ /** Controlled layout mode. Changes are reported via `onLayoutChange`. */
49
+ layout?: DashboardLayout;
50
+ /** Called when the user changes the column layout (or it auto-shrinks). */
51
+ onLayoutChange?: (layout: DashboardLayout) => void;
52
+ /**
53
+ * CSS selector for the header element inside each portlet that receives
54
+ * the drag handle. Defaults to the `DashboardWidget` header slot. When no
55
+ * header matches, the handle floats over the portlet's top end corner.
56
+ */
57
+ dragHandleSelector?: string;
58
+ /** Additional class name for the grid element. */
59
+ className?: string;
60
+ }
61
+ /**
62
+ * Merge a saved/provided order with the current props columns: saved
63
+ * positions win, unknown saved ids are dropped, and new items are appended
64
+ * to their original props column.
65
+ */
66
+ declare function mergeColumnOrder(columns: DashboardColumns, saved: DashboardOrder | null): DashboardOrder;
67
+ /**
68
+ * Move `activeId` into the column named by `overId` (a column id or an item
69
+ * id), inserted before the hovered item. Returns the same reference when no
70
+ * cross-column move is needed.
71
+ */
72
+ declare function moveAcrossColumns(order: DashboardOrder, activeId: string, overId: string): DashboardOrder;
73
+ /**
74
+ * Final order for a drop. Same-column drags reorder around the hovered
75
+ * item. After a cross-column move, the one position `moveAcrossColumns`
76
+ * already chose — active sitting immediately before the hovered item — is
77
+ * kept (reordering would flip it to the other side of that item), but
78
+ * hovering any other item in the destination column still reorders, so a
79
+ * drag can keep moving after it crosses.
80
+ */
81
+ declare function reorderOnDrop(order: DashboardOrder, activeId: string, overId: string, crossedColumns: boolean): DashboardOrder;
82
+ /**
83
+ * Consolidate columns beyond the visible count into the last visible one.
84
+ * Returns the same reference when nothing needs to move so callers can use
85
+ * reference equality to skip persistence/notification.
86
+ */
87
+ declare function consolidateColumns(order: DashboardOrder, mode: DashboardLayout): DashboardOrder;
88
+ /**
89
+ * Columns needed to show every item: the highest occupied index + 1, so a
90
+ * gap like `[a], [], [c]` still requires three columns.
91
+ */
92
+ declare function requiredColumns(order: DashboardOrder): DashboardLayout;
93
+ /**
94
+ * A user-customizable portlet dashboard: a responsive 1–3 column grid whose
95
+ * items can be dragged between and within columns, with a column-layout
96
+ * toggle and optional persistence.
97
+ *
98
+ * Each portlet's drag handle is appended to the header element matched by
99
+ * `dragHandleSelector` inside its content — `DashboardWidget` headers are
100
+ * matched by default. Portlets without a matching header get a floating
101
+ * handle in their top end corner.
102
+ *
103
+ * Order and layout are persisted to localStorage when `storageKey` is set,
104
+ * or can be controlled via `order`/`onOrderChange` and
105
+ * `layout`/`onLayoutChange` for server-side persistence.
106
+ *
107
+ * @example
108
+ * ```tsx
109
+ * <CustomizableDashboard
110
+ * storageKey="home"
111
+ * columns={[
112
+ * [{ id: 'stats', node: <StatsWidget /> }],
113
+ * [{ id: 'tasks', node: <TasksWidget /> }],
114
+ * [{ id: 'orders', node: <OrdersWidget /> }],
115
+ * ]}
116
+ * />
117
+ * ```
118
+ */
119
+ declare const CustomizableDashboard: React.ForwardRefExoticComponent<CustomizableDashboardProps & React.RefAttributes<HTMLDivElement>>;
120
+
121
+ export { CustomizableDashboard, type CustomizableDashboardProps, type DashboardColumns, type DashboardLayout, type DashboardOrder, type PortletItem, consolidateColumns, mergeColumnOrder, moveAcrossColumns, reorderOnDrop, requiredColumns };
@@ -0,0 +1,121 @@
1
+ import * as React from 'react';
2
+
3
+ /** A dashboard item: a stable id plus the rendered content. */
4
+ interface PortletItem {
5
+ id: string;
6
+ node: React.ReactNode;
7
+ }
8
+ /** Number of visible columns. */
9
+ type DashboardLayout = 1 | 2 | 3;
10
+ /** Portlet items grouped into three logical columns. */
11
+ type DashboardColumns = [PortletItem[], PortletItem[], PortletItem[]];
12
+ /** Portlet ids grouped into three logical columns. */
13
+ type DashboardOrder = [string[], string[], string[]];
14
+ interface CustomizableDashboardProps {
15
+ /**
16
+ * Portlets grouped into three columns. This is the default arrangement;
17
+ * user reordering (persisted or controlled) takes precedence. Items later
18
+ * removed from props disappear from saved layouts automatically, and new
19
+ * items appear in their props column.
20
+ */
21
+ columns: DashboardColumns;
22
+ /** Toolbar heading rendered before the layout toggle. */
23
+ title?: string;
24
+ /**
25
+ * Base localStorage key used to persist column order and layout mode
26
+ * (`{storageKey}-portlet-order` / `{storageKey}-dashboard-layout`).
27
+ * Omit to disable built-in persistence (e.g. when using `order` /
28
+ * `onOrderChange` with a server-side store). Distinct dashboards must
29
+ * pass distinct keys.
30
+ */
31
+ storageKey?: string;
32
+ /** Accessible label for the dashboard grid region. */
33
+ ariaLabel?: string;
34
+ /**
35
+ * Optional DOM element to portal the toolbar (title + layout toggle)
36
+ * into, e.g. a page header actions row. When omitted, the toolbar
37
+ * renders inline above the grid.
38
+ */
39
+ toolbarSlot?: HTMLElement | null;
40
+ /** Initial column order for uncontrolled usage with external persistence. */
41
+ defaultOrder?: DashboardOrder;
42
+ /** Controlled column order. Changes are reported via `onOrderChange`. */
43
+ order?: DashboardOrder;
44
+ /** Called with the full new order after a drop or layout normalization. */
45
+ onOrderChange?: (order: DashboardOrder) => void;
46
+ /** Initial layout mode for uncontrolled usage (default 3). */
47
+ defaultLayout?: DashboardLayout;
48
+ /** Controlled layout mode. Changes are reported via `onLayoutChange`. */
49
+ layout?: DashboardLayout;
50
+ /** Called when the user changes the column layout (or it auto-shrinks). */
51
+ onLayoutChange?: (layout: DashboardLayout) => void;
52
+ /**
53
+ * CSS selector for the header element inside each portlet that receives
54
+ * the drag handle. Defaults to the `DashboardWidget` header slot. When no
55
+ * header matches, the handle floats over the portlet's top end corner.
56
+ */
57
+ dragHandleSelector?: string;
58
+ /** Additional class name for the grid element. */
59
+ className?: string;
60
+ }
61
+ /**
62
+ * Merge a saved/provided order with the current props columns: saved
63
+ * positions win, unknown saved ids are dropped, and new items are appended
64
+ * to their original props column.
65
+ */
66
+ declare function mergeColumnOrder(columns: DashboardColumns, saved: DashboardOrder | null): DashboardOrder;
67
+ /**
68
+ * Move `activeId` into the column named by `overId` (a column id or an item
69
+ * id), inserted before the hovered item. Returns the same reference when no
70
+ * cross-column move is needed.
71
+ */
72
+ declare function moveAcrossColumns(order: DashboardOrder, activeId: string, overId: string): DashboardOrder;
73
+ /**
74
+ * Final order for a drop. Same-column drags reorder around the hovered
75
+ * item. After a cross-column move, the one position `moveAcrossColumns`
76
+ * already chose — active sitting immediately before the hovered item — is
77
+ * kept (reordering would flip it to the other side of that item), but
78
+ * hovering any other item in the destination column still reorders, so a
79
+ * drag can keep moving after it crosses.
80
+ */
81
+ declare function reorderOnDrop(order: DashboardOrder, activeId: string, overId: string, crossedColumns: boolean): DashboardOrder;
82
+ /**
83
+ * Consolidate columns beyond the visible count into the last visible one.
84
+ * Returns the same reference when nothing needs to move so callers can use
85
+ * reference equality to skip persistence/notification.
86
+ */
87
+ declare function consolidateColumns(order: DashboardOrder, mode: DashboardLayout): DashboardOrder;
88
+ /**
89
+ * Columns needed to show every item: the highest occupied index + 1, so a
90
+ * gap like `[a], [], [c]` still requires three columns.
91
+ */
92
+ declare function requiredColumns(order: DashboardOrder): DashboardLayout;
93
+ /**
94
+ * A user-customizable portlet dashboard: a responsive 1–3 column grid whose
95
+ * items can be dragged between and within columns, with a column-layout
96
+ * toggle and optional persistence.
97
+ *
98
+ * Each portlet's drag handle is appended to the header element matched by
99
+ * `dragHandleSelector` inside its content — `DashboardWidget` headers are
100
+ * matched by default. Portlets without a matching header get a floating
101
+ * handle in their top end corner.
102
+ *
103
+ * Order and layout are persisted to localStorage when `storageKey` is set,
104
+ * or can be controlled via `order`/`onOrderChange` and
105
+ * `layout`/`onLayoutChange` for server-side persistence.
106
+ *
107
+ * @example
108
+ * ```tsx
109
+ * <CustomizableDashboard
110
+ * storageKey="home"
111
+ * columns={[
112
+ * [{ id: 'stats', node: <StatsWidget /> }],
113
+ * [{ id: 'tasks', node: <TasksWidget /> }],
114
+ * [{ id: 'orders', node: <OrdersWidget /> }],
115
+ * ]}
116
+ * />
117
+ * ```
118
+ */
119
+ declare const CustomizableDashboard: React.ForwardRefExoticComponent<CustomizableDashboardProps & React.RefAttributes<HTMLDivElement>>;
120
+
121
+ export { CustomizableDashboard, type CustomizableDashboardProps, type DashboardColumns, type DashboardLayout, type DashboardOrder, type PortletItem, consolidateColumns, mergeColumnOrder, moveAcrossColumns, reorderOnDrop, requiredColumns };
@@ -0,0 +1,4 @@
1
+ export { CustomizableDashboard, consolidateColumns, mergeColumnOrder, moveAcrossColumns, reorderOnDrop, requiredColumns } from '../../chunk-K6CSD3S7.js';
2
+ import '../../chunk-TQONQSJO.js';
3
+ //# sourceMappingURL=index.js.map
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/dist/esheet.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunk35HHCXWC_cjs = require('./chunk-35HHCXWC.cjs');
4
- require('./chunk-BSDBI6H7.cjs');
3
+ var chunkSETNPK4P_cjs = require('./chunk-SETNPK4P.cjs');
5
4
  require('./chunk-WWJIW2IH.cjs');
5
+ require('./chunk-BSDBI6H7.cjs');
6
6
  require('./chunk-G7EQ3JPX.cjs');
7
+ require('./chunk-U5TTXN45.cjs');
7
8
  require('./chunk-AIJAFPGJ.cjs');
8
9
  require('./chunk-56QJHQ5C.cjs');
9
10
  require('./chunk-MJWFNV3L.cjs');
10
- require('./chunk-U5TTXN45.cjs');
11
11
  require('./chunk-P2VTQ5AR.cjs');
12
12
  require('./chunk-I44YNYI6.cjs');
13
13
  require('./chunk-Z5S5JEJD.cjs');
@@ -78,7 +78,7 @@ function MedicationListField({
78
78
  return definition.medications ?? [];
79
79
  }, [response?.answer, definition.medications]);
80
80
  return /* @__PURE__ */ jsxRuntime.jsx(
81
- chunk35HHCXWC_cjs.MedicationReconciliation,
81
+ chunkSETNPK4P_cjs.MedicationReconciliation,
82
82
  {
83
83
  medications,
84
84
  onChange: (next) => onResponse({ answer: JSON.stringify({ medications: next }) }),
@@ -135,7 +135,7 @@ function AllergyListField({
135
135
  codeLookup
136
136
  }) {
137
137
  const definition = field.definition;
138
- const ambientCodeLookup = chunk35HHCXWC_cjs.useCodeLookupConfig();
138
+ const ambientCodeLookup = chunkSETNPK4P_cjs.useCodeLookupConfig();
139
139
  const effectiveCodeLookup = codeLookup === false ? void 0 : codeLookup ?? ambientCodeLookup ?? void 0;
140
140
  const value = React__namespace.useMemo(() => {
141
141
  if (response?.answer) return parseValue2(response.answer);
@@ -145,7 +145,7 @@ function AllergyListField({
145
145
  onResponse({ answer: JSON.stringify(next) });
146
146
  };
147
147
  return /* @__PURE__ */ jsxRuntime.jsx(
148
- chunk35HHCXWC_cjs.AllergyManager,
148
+ chunkSETNPK4P_cjs.AllergyManager,
149
149
  {
150
150
  allergies: value.allergies,
151
151
  onChange: (allergies) => commit({
package/dist/esheet.js CHANGED
@@ -1,11 +1,11 @@
1
- import { MedicationReconciliation, useCodeLookupConfig, AllergyManager } from './chunk-33TQ25IK.js';
2
- import './chunk-H3YO5GBM.js';
1
+ import { MedicationReconciliation, useCodeLookupConfig, AllergyManager } from './chunk-2WLP2ERQ.js';
3
2
  import './chunk-FJ7YPVKV.js';
3
+ import './chunk-H3YO5GBM.js';
4
4
  import './chunk-EPSB4WTL.js';
5
+ import './chunk-IILJGFI5.js';
5
6
  import './chunk-I3WGZPI6.js';
6
7
  import './chunk-XBKOZRDO.js';
7
8
  import './chunk-QYSUYB3S.js';
8
- import './chunk-IILJGFI5.js';
9
9
  import './chunk-XMCIXHGH.js';
10
10
  import './chunk-6NZXWKUE.js';
11
11
  import './chunk-3IMM2PM4.js';