@macrostrat/data-sheet 4.8.0 → 4.9.1
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.
- package/CHANGELOG.md +42 -0
- package/README.md +60 -19
- package/dist/actions/context.cjs +10 -1
- package/dist/actions/context.cjs.map +1 -1
- package/dist/actions/context.js +10 -1
- package/dist/actions/context.js.map +1 -1
- package/dist/actions/types.d.ts +4 -0
- package/dist/components/data-editor.cjs +527 -0
- package/dist/components/data-editor.cjs.map +1 -0
- package/dist/components/data-editor.d.ts +142 -0
- package/dist/components/data-editor.js +524 -0
- package/dist/components/data-editor.js.map +1 -0
- package/dist/components/editor-actions.cjs +167 -0
- package/dist/components/editor-actions.cjs.map +1 -0
- package/dist/components/editor-actions.d.ts +37 -0
- package/dist/components/editor-actions.js +165 -0
- package/dist/components/editor-actions.js.map +1 -0
- package/dist/components/editor-popup.cjs +11 -1
- package/dist/components/editor-popup.cjs.map +1 -1
- package/dist/components/editor-popup.js +11 -1
- package/dist/components/editor-popup.js.map +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/indicators/selection.cjs +10 -4
- package/dist/components/indicators/selection.cjs.map +1 -1
- package/dist/components/indicators/selection.js +10 -4
- package/dist/components/indicators/selection.js.map +1 -1
- package/dist/components/row-editor.cjs +351 -0
- package/dist/components/row-editor.cjs.map +1 -0
- package/dist/components/row-editor.d.ts +181 -0
- package/dist/components/row-editor.js +349 -0
- package/dist/components/row-editor.js.map +1 -0
- package/dist/components/row-editor.module.sass.cjs +51 -0
- package/dist/components/row-editor.module.sass.cjs.map +1 -0
- package/dist/components/row-editor.module.sass.js +49 -0
- package/dist/components/row-editor.module.sass.js.map +1 -0
- package/dist/components/toolbars/actions-toolbar.cjs +1 -1
- package/dist/components/toolbars/actions-toolbar.cjs.map +1 -1
- package/dist/components/toolbars/actions-toolbar.js +1 -1
- package/dist/components/toolbars/actions-toolbar.js.map +1 -1
- package/dist/data-sheet.css +208 -20
- package/dist/index.cjs +27 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +29 -2
- package/dist/index.js.map +1 -1
- package/dist/main.module.sass.cjs +14 -13
- package/dist/main.module.sass.cjs.map +1 -1
- package/dist/main.module.sass.js +14 -13
- package/dist/main.module.sass.js.map +1 -1
- package/dist/provider/column-spec.cjs +8 -1
- package/dist/provider/column-spec.cjs.map +1 -1
- package/dist/provider/column-spec.d.ts +105 -1
- package/dist/provider/column-spec.js +8 -1
- package/dist/provider/column-spec.js.map +1 -1
- package/dist/provider/core.cjs +16 -4
- package/dist/provider/core.cjs.map +1 -1
- package/dist/provider/core.d.ts +4 -0
- package/dist/provider/core.js +16 -4
- package/dist/provider/core.js.map +1 -1
- package/dist/provider/types.cjs.map +1 -1
- package/dist/provider/types.d.ts +6 -1
- package/dist/provider/types.js.map +1 -1
- package/dist/provider/zustand-store.cjs +55 -33
- package/dist/provider/zustand-store.cjs.map +1 -1
- package/dist/provider/zustand-store.js +44 -22
- package/dist/provider/zustand-store.js.map +1 -1
- package/dist/renderers/cell-renderer.cjs +15 -4
- package/dist/renderers/cell-renderer.cjs.map +1 -1
- package/dist/renderers/cell-renderer.js +13 -4
- package/dist/renderers/cell-renderer.js.map +1 -1
- package/dist/renderers/column-header-cell.cjs +12 -1
- package/dist/renderers/column-header-cell.cjs.map +1 -1
- package/dist/renderers/column-header-cell.js +11 -1
- package/dist/renderers/column-header-cell.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.ts +5 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
- package/src/actions/context.ts +13 -2
- package/src/actions/types.ts +5 -0
- package/src/components/data-editor.ts +741 -0
- package/src/components/editor-actions.ts +228 -0
- package/src/components/editor-popup.ts +16 -3
- package/src/components/index.ts +3 -0
- package/src/components/indicators/selection.ts +12 -4
- package/src/components/row-editor.module.sass +161 -0
- package/src/components/row-editor.ts +620 -0
- package/src/components/toolbars/actions-toolbar.ts +3 -2
- package/src/main.module.sass +19 -0
- package/src/provider/column-spec.ts +94 -16
- package/src/provider/core.ts +19 -4
- package/src/provider/types.ts +6 -1
- package/src/provider/zustand-store.ts +78 -26
- package/src/renderers/cell-renderer.ts +18 -3
- package/src/renderers/column-header-cell.ts +10 -0
- package/src/types.ts +5 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import h$1 from "@macrostrat/hyper";
|
|
2
|
+
const panel = "_panel_kma62_39";
|
|
3
|
+
const edited = "_edited_kma62_87";
|
|
4
|
+
const derived = "_derived_kma62_90";
|
|
5
|
+
const inline = "_inline_kma62_98";
|
|
6
|
+
const empty = "_empty_kma62_139";
|
|
7
|
+
const selected = "_selected_kma62_151";
|
|
8
|
+
const styles = {
|
|
9
|
+
"row-editor": "_row-editor_kma62_1",
|
|
10
|
+
"field-actions": "_field-actions_kma62_8",
|
|
11
|
+
"editor-action-form": "_editor-action-form_kma62_19",
|
|
12
|
+
"data-editor-footer": "_data-editor-footer_kma62_27",
|
|
13
|
+
"data-editor-footer-spacer": "_data-editor-footer-spacer_kma62_35",
|
|
14
|
+
panel,
|
|
15
|
+
"row-editor-body": "_row-editor-body_kma62_44",
|
|
16
|
+
"row-editor-title-bar": "_row-editor-title-bar_kma62_65",
|
|
17
|
+
"row-editor-fields": "_row-editor-fields_kma62_74",
|
|
18
|
+
"row-editor-field": "_row-editor-field_kma62_74",
|
|
19
|
+
edited,
|
|
20
|
+
"field-name": "_field-name_kma62_87",
|
|
21
|
+
derived,
|
|
22
|
+
"field-value": "_field-value_kma62_90",
|
|
23
|
+
"read-only": "_read-only_kma62_94",
|
|
24
|
+
inline,
|
|
25
|
+
"field-label": "_field-label_kma62_102",
|
|
26
|
+
"field-marker": "_field-marker_kma62_115",
|
|
27
|
+
"required-marker": "_required-marker_kma62_122",
|
|
28
|
+
"reset-field": "_reset-field_kma62_126",
|
|
29
|
+
empty,
|
|
30
|
+
"field-surface": "_field-surface_kma62_143",
|
|
31
|
+
"cell-detail": "_cell-detail_kma62_143",
|
|
32
|
+
"row-editor-non-ideal": "_row-editor-non-ideal_kma62_147",
|
|
33
|
+
selected,
|
|
34
|
+
"mixed-values": "_mixed-values_kma62_163",
|
|
35
|
+
"selection-summary": "_selection-summary_kma62_168",
|
|
36
|
+
"row-editor-field-target": "_row-editor-field-target_kma62_174"
|
|
37
|
+
};
|
|
38
|
+
let h = h$1.styled(styles);
|
|
39
|
+
Object.assign(h, styles);
|
|
40
|
+
export {
|
|
41
|
+
h as default,
|
|
42
|
+
derived,
|
|
43
|
+
edited,
|
|
44
|
+
empty,
|
|
45
|
+
inline,
|
|
46
|
+
panel,
|
|
47
|
+
selected
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=row-editor.module.sass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row-editor.module.sass.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -47,7 +47,7 @@ function ActionsToolbar({
|
|
|
47
47
|
if (!toolbarIsShown && children == null) {
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
|
-
const isGlobal = (a) => (a.targets.includes(table.RegionCardinality.FULL_TABLE) || a.targets.includes("none")) && a.requiresEditable;
|
|
50
|
+
const isGlobal = (a) => a.placement === "end" || (a.targets.includes(table.RegionCardinality.FULL_TABLE) || a.targets.includes("none")) && a.requiresEditable;
|
|
51
51
|
const contextual = shownActions.filter((a) => !isGlobal(a));
|
|
52
52
|
const globalActions = shownActions.filter(isGlobal);
|
|
53
53
|
return actionsToolbar_module.default("div.actions-toolbar", { className }, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions-toolbar.cjs","sources":["../../../src/components/toolbars/actions-toolbar.ts"],"sourcesContent":["import { Button, ButtonGroup, PopoverNext } from \"@blueprintjs/core\";\nimport { type ReactNode, useCallback, useMemo, useState } from \"react\";\nimport h from \"./actions-toolbar.module.sass\";\nimport { ctx, selectionAtom, useSelector } from \"../../provider\";\nimport {\n getApplicableActions,\n getSelectionCardinality,\n mergeColumnActions,\n buildActionContext,\n TableActionContext,\n runActionWrapper,\n type TableAction,\n} from \"../../actions\";\nimport { RegionCardinality } from \"@blueprintjs/table\";\nimport { useToaster } from \"../../notifications.ts\";\nimport type { ColumnSpec } from \"../../provider\";\nimport { SelectionIndicator } from \"../index.ts\";\n\n/** Toolbar that renders the actions/controls applicable to the current\n * selection cardinality (modal by selection) and edit mode. Actions with a\n * `render` show their live control; others show a button (with an optional\n * `detailsForm` popover). Column-specific actions from `ColumnSpec.actions`\n * are merged when their columns are selected. A capsule on the left shows the\n * current selection polarity. */\nexport function ActionsToolbar<T>({\n actions: _actions,\n children,\n className,\n compact = false,\n}: {\n actions: TableAction<T>[];\n tableName?: string;\n children: ReactNode;\n className?: string;\n compact: boolean;\n}) {\n const selection = ctx.useValue(selectionAtom);\n const editable = useSelector((state) => state.editable);\n const columnSpec = useSelector((state) => state.columnSpec);\n\n const actionIDs = new Set(_actions.map((a) => a.id));\n const actions = useMemo(() => _actions, [actionIDs]);\n\n const cardinality = useMemo(\n () => getSelectionCardinality(selection) ?? RegionCardinality.FULL_TABLE,\n [selection],\n );\n\n // Merge global actions with column-specific actions from the selection\n const allActions = useMemo(\n () => mergeColumnActions(actions, columnSpec, selection),\n [actions, columnSpec, selection],\n );\n\n const applicableActions = useMemo(\n () => getApplicableActions(allActions, cardinality, editable),\n [allActions, cardinality, editable],\n );\n\n const store = ctx.useStore();\n // Context for `render`-style controls (they subscribe to the store\n // themselves; this resolves the selected column/rows).\n const actionContext = useMemo(() => {\n return buildActionContext(store.get, store.set);\n }, [allActions]);\n\n // The toolbar is for actions that AREN'T keyboard-accessible: any action\n // with a `hotkey` (copy/cut/paste, etc.) is reachable from the keyboard and\n // is omitted here (it still works via its shortcut). Then refine by selection\n // shape beyond cardinality (e.g. single column only).\n const shownActions = applicableActions.filter(\n (action: TableAction<T, any>) =>\n action.hotkey == null &&\n (action.appliesTo?.(actionContext as any) ?? true),\n );\n\n const toolbarIsShown = useMemo(\n () => hasAnyDisplayableActions(actions, columnSpec),\n [actions, columnSpec],\n );\n\n // Render whenever there are displayable actions OR the consumer supplied\n // custom toolbar chrome (`children`) — a facet-less panel (e.g. a card list\n // with only a search box) still needs its toolbar slot to appear.\n if (!toolbarIsShown && children == null) {\n return null;\n }\n\n // Order left→right by generality: actions that require editing\n // are \"global\" and sit after a spacer on the right (Save /\n // Reset); everything else is contextual and stays on the left. So the left\n // edge tracks the selection and the right edge is constant.\n const isGlobal = (a: TableAction<T>) =>\n (a.targets.includes(RegionCardinality.FULL_TABLE) ||\n a.targets.includes(\"none\" as any)) &&\n a.requiresEditable;\n const contextual = shownActions.filter((a) => !isGlobal(a));\n // Order the built-in global actions least→most impactful, left→right: reset\n // changes, then save. Any other global actions keep their natural order to\n // the left of these (stable sort, rank 0).\n\n const globalActions = shownActions.filter(isGlobal);\n\n return h(\"div.actions-toolbar\", { className }, [\n h(SelectionIndicator, { minimal: compact }),\n h(\n \"div.toolbar-group.contextual\",\n contextual.map((action) =>\n h(ActionButton, { key: action.id, action, ctx: actionContext }),\n ),\n ),\n children,\n h(\"div.toolbar-spacer\", { style: { flex: 1 } }),\n h(\n ButtonGroup,\n { minimal: true },\n globalActions.map((action) =>\n h(ActionButton, { key: action.id, action, ctx: actionContext }),\n ),\n ),\n ]);\n}\n\nfunction isActionDisabled(action: TableAction, state: any): boolean {\n if (typeof action.disabled === \"boolean\") return action.disabled;\n if (typeof action.disabled === \"function\") {\n return action.disabled(state);\n }\n return false;\n}\n\n/** Dispatcher: a live control (`action.render`) or a run/detailsForm button.\n * Kept hook-free so the two paths don't share a hook order. */\nfunction ActionButton<T>({\n action,\n ctx,\n}: {\n action: TableAction<T>;\n ctx: TableActionContext<T>;\n}) {\n if (action.render != null) {\n return action.render(ctx) as any;\n }\n return h(RunActionButton, { action });\n}\n\n/** A run/detailsForm action rendered as a button. */\nfunction RunActionButton<T>({ action }: { action: TableAction<T> }) {\n const store = ctx.useStore();\n const toaster = useToaster();\n\n // Reactive disabled check — re-renders when relevant state changes\n const isDisabled = useSelector((state) => {\n return isActionDisabled(action, state);\n });\n\n const runAction = useCallback(\n (configState?: any) => {\n runActionWrapper(action, store.get, store.set, toaster, configState);\n },\n [action, toaster],\n );\n\n if (action.detailsForm != null) {\n return h(ActionButtonWithForm, { action, runAction, isDisabled });\n }\n\n return h(\n Button,\n {\n // Minimal + small to match the toolbar's other controls (scroll-to-row,\n // sort/filter tags) — the compact, minimal house style.\n minimal: true,\n small: true,\n icon: action.icon,\n intent: action.intent,\n disabled: isDisabled,\n onClick() {\n runAction();\n },\n },\n action.name,\n );\n}\n\n/** Action button that opens a popover for pre-run configuration. */\nfunction ActionButtonWithForm<T, S>({\n action,\n runAction,\n isDisabled,\n}: {\n action: TableAction<T, S>;\n runAction: (configState?: S) => void;\n isDisabled: boolean;\n}) {\n const [configState, setConfigState] = useState<S>(\n action.defaultState ?? (null as S),\n );\n const [isOpen, setIsOpen] = useState(false);\n\n let ready = true;\n if (action.isReady != null) {\n ready = action.isReady(configState);\n }\n\n return h(\n PopoverNext,\n {\n isOpen,\n onClose: () => setIsOpen(false),\n content: h(\"div.action-popover-content\", [\n h.if(action.description != null)(\"p.description\", action.description),\n h(action.detailsForm as any, {\n state: configState,\n setState: setConfigState,\n }),\n h(\n Button,\n {\n className: \"run-button\",\n intent: action.intent ?? \"primary\",\n icon: \"play\",\n disabled: !ready,\n fill: true,\n onClick() {\n runAction(configState);\n setIsOpen(false);\n },\n },\n \"Run\",\n ),\n ]),\n placement: \"bottom-start\",\n enforceFocus: false,\n autoFocus: false,\n },\n h(\n Button,\n {\n minimal: true,\n small: true,\n icon: action.icon,\n intent: action.intent,\n disabled: isDisabled,\n onClick: () => setIsOpen(!isOpen),\n },\n action.name,\n ),\n );\n}\n\nfunction hasAnyDisplayableActions(\n actions: TableAction[],\n columnSpec: ColumnSpec[],\n) {\n /** Check whether there are any actions that can be displayed in the toolbar.\n * for the entire table. This is used to determine whether the toolbar should\n * be rendered. If any actions are available, the toolbar is rendered in ALL\n * selection modes to avoid flickering\n */\n const allActions = [\n ...actions,\n ...columnSpec.flatMap((c) => c.actions ?? []),\n ];\n\n if (allActions.length === 0) {\n return false;\n }\n // Check whether any action doesn't have hotkey and is not disabled\n return allActions.some(\n (action) => action.hotkey == null && !isActionDisabled(action, {}),\n );\n}\n"],"names":["selection","ctx","selectionAtom","useSelector","useMemo","getSelectionCardinality","RegionCardinality","mergeColumnActions","getApplicableActions","buildActionContext","h","SelectionIndicator","ButtonGroup","useToaster","useCallback","runActionWrapper","Button","useState","PopoverNext"],"mappings":";;;;;;;;;;;;AAwBO,SAAS,eAAkB;AAAA,EAChC,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,UAAU;AACZ,GAMG;AACD,QAAMA,cAAYC,KAAAA,IAAI,SAASC,uBAAa;AAC5C,QAAM,WAAWC,KAAAA,YAAY,CAAC,UAAU,MAAM,QAAQ;AACtD,QAAM,aAAaA,KAAAA,YAAY,CAAC,UAAU,MAAM,UAAU;AAE1D,QAAM,YAAY,IAAI,IAAI,SAAS,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;AACnD,QAAM,UAAUC,MAAAA,QAAQ,MAAM,UAAU,CAAC,SAAS,CAAC;AAEnD,QAAM,cAAcA,MAAAA;AAAAA,IAClB,MAAMC,oCAAwBL,WAAS,KAAKM,MAAAA,kBAAkB;AAAA,IAC9D,CAACN,WAAS;AAAA,EAAA;AAIZ,QAAM,aAAaI,MAAAA;AAAAA,IACjB,MAAMG,+BAAmB,SAAS,YAAYP,WAAS;AAAA,IACvD,CAAC,SAAS,YAAYA,WAAS;AAAA,EAAA;AAGjC,QAAM,oBAAoBI,MAAAA;AAAAA,IACxB,MAAMI,iCAAqB,YAAY,aAAa,QAAQ;AAAA,IAC5D,CAAC,YAAY,aAAa,QAAQ;AAAA,EAAA;AAGpC,QAAM,QAAQP,KAAAA,IAAI,SAAA;AAGlB,QAAM,gB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IAChB,CAAC,WAAW,OAAO,UAAU,QAAQ,CAAC,iBAAiB,QAAQ,CAAA,CAAE;AAAA,EAAA;AAErE;;"}
|
|
1
|
+
{"version":3,"file":"actions-toolbar.cjs","sources":["../../../src/components/toolbars/actions-toolbar.ts"],"sourcesContent":["import { Button, ButtonGroup, PopoverNext } from \"@blueprintjs/core\";\nimport { type ReactNode, useCallback, useMemo, useState } from \"react\";\nimport h from \"./actions-toolbar.module.sass\";\nimport { ctx, selectionAtom, useSelector } from \"../../provider\";\nimport {\n getApplicableActions,\n getSelectionCardinality,\n mergeColumnActions,\n buildActionContext,\n TableActionContext,\n runActionWrapper,\n type TableAction,\n} from \"../../actions\";\nimport { RegionCardinality } from \"@blueprintjs/table\";\nimport { useToaster } from \"../../notifications.ts\";\nimport type { ColumnSpec } from \"../../provider\";\nimport { SelectionIndicator } from \"../index.ts\";\n\n/** Toolbar that renders the actions/controls applicable to the current\n * selection cardinality (modal by selection) and edit mode. Actions with a\n * `render` show their live control; others show a button (with an optional\n * `detailsForm` popover). Column-specific actions from `ColumnSpec.actions`\n * are merged when their columns are selected. A capsule on the left shows the\n * current selection polarity. */\nexport function ActionsToolbar<T>({\n actions: _actions,\n children,\n className,\n compact = false,\n}: {\n actions: TableAction<T>[];\n tableName?: string;\n children: ReactNode;\n className?: string;\n compact: boolean;\n}) {\n const selection = ctx.useValue(selectionAtom);\n const editable = useSelector((state) => state.editable);\n const columnSpec = useSelector((state) => state.columnSpec);\n\n const actionIDs = new Set(_actions.map((a) => a.id));\n const actions = useMemo(() => _actions, [actionIDs]);\n\n const cardinality = useMemo(\n () => getSelectionCardinality(selection) ?? RegionCardinality.FULL_TABLE,\n [selection],\n );\n\n // Merge global actions with column-specific actions from the selection\n const allActions = useMemo(\n () => mergeColumnActions(actions, columnSpec, selection),\n [actions, columnSpec, selection],\n );\n\n const applicableActions = useMemo(\n () => getApplicableActions(allActions, cardinality, editable),\n [allActions, cardinality, editable],\n );\n\n const store = ctx.useStore();\n // Context for `render`-style controls (they subscribe to the store\n // themselves; this resolves the selected column/rows).\n const actionContext = useMemo(() => {\n return buildActionContext(store.get, store.set);\n }, [allActions]);\n\n // The toolbar is for actions that AREN'T keyboard-accessible: any action\n // with a `hotkey` (copy/cut/paste, etc.) is reachable from the keyboard and\n // is omitted here (it still works via its shortcut). Then refine by selection\n // shape beyond cardinality (e.g. single column only).\n const shownActions = applicableActions.filter(\n (action: TableAction<T, any>) =>\n action.hotkey == null &&\n (action.appliesTo?.(actionContext as any) ?? true),\n );\n\n const toolbarIsShown = useMemo(\n () => hasAnyDisplayableActions(actions, columnSpec),\n [actions, columnSpec],\n );\n\n // Render whenever there are displayable actions OR the consumer supplied\n // custom toolbar chrome (`children`) — a facet-less panel (e.g. a card list\n // with only a search box) still needs its toolbar slot to appear.\n if (!toolbarIsShown && children == null) {\n return null;\n }\n\n // Order left→right by generality: actions that require editing\n // are \"global\" and sit after a spacer on the right (Save /\n // Reset); everything else is contextual and stays on the left. So the left\n // edge tracks the selection and the right edge is constant.\n const isGlobal = (a: TableAction<T>) =>\n a.placement === \"end\" ||\n ((a.targets.includes(RegionCardinality.FULL_TABLE) ||\n a.targets.includes(\"none\" as any)) &&\n a.requiresEditable);\n const contextual = shownActions.filter((a) => !isGlobal(a));\n // Order the built-in global actions least→most impactful, left→right: reset\n // changes, then save. Any other global actions keep their natural order to\n // the left of these (stable sort, rank 0).\n\n const globalActions = shownActions.filter(isGlobal);\n\n return h(\"div.actions-toolbar\", { className }, [\n h(SelectionIndicator, { minimal: compact }),\n h(\n \"div.toolbar-group.contextual\",\n contextual.map((action) =>\n h(ActionButton, { key: action.id, action, ctx: actionContext }),\n ),\n ),\n children,\n h(\"div.toolbar-spacer\", { style: { flex: 1 } }),\n h(\n ButtonGroup,\n { minimal: true },\n globalActions.map((action) =>\n h(ActionButton, { key: action.id, action, ctx: actionContext }),\n ),\n ),\n ]);\n}\n\nfunction isActionDisabled(action: TableAction, state: any): boolean {\n if (typeof action.disabled === \"boolean\") return action.disabled;\n if (typeof action.disabled === \"function\") {\n return action.disabled(state);\n }\n return false;\n}\n\n/** Dispatcher: a live control (`action.render`) or a run/detailsForm button.\n * Kept hook-free so the two paths don't share a hook order. */\nfunction ActionButton<T>({\n action,\n ctx,\n}: {\n action: TableAction<T>;\n ctx: TableActionContext<T>;\n}) {\n if (action.render != null) {\n return action.render(ctx) as any;\n }\n return h(RunActionButton, { action });\n}\n\n/** A run/detailsForm action rendered as a button. */\nfunction RunActionButton<T>({ action }: { action: TableAction<T> }) {\n const store = ctx.useStore();\n const toaster = useToaster();\n\n // Reactive disabled check — re-renders when relevant state changes\n const isDisabled = useSelector((state) => {\n return isActionDisabled(action, state);\n });\n\n const runAction = useCallback(\n (configState?: any) => {\n runActionWrapper(action, store.get, store.set, toaster, configState);\n },\n [action, toaster],\n );\n\n if (action.detailsForm != null) {\n return h(ActionButtonWithForm, { action, runAction, isDisabled });\n }\n\n return h(\n Button,\n {\n // Minimal + small to match the toolbar's other controls (scroll-to-row,\n // sort/filter tags) — the compact, minimal house style.\n minimal: true,\n small: true,\n icon: action.icon,\n intent: action.intent,\n disabled: isDisabled,\n onClick() {\n runAction();\n },\n },\n action.name,\n );\n}\n\n/** Action button that opens a popover for pre-run configuration. */\nfunction ActionButtonWithForm<T, S>({\n action,\n runAction,\n isDisabled,\n}: {\n action: TableAction<T, S>;\n runAction: (configState?: S) => void;\n isDisabled: boolean;\n}) {\n const [configState, setConfigState] = useState<S>(\n action.defaultState ?? (null as S),\n );\n const [isOpen, setIsOpen] = useState(false);\n\n let ready = true;\n if (action.isReady != null) {\n ready = action.isReady(configState);\n }\n\n return h(\n PopoverNext,\n {\n isOpen,\n onClose: () => setIsOpen(false),\n content: h(\"div.action-popover-content\", [\n h.if(action.description != null)(\"p.description\", action.description),\n h(action.detailsForm as any, {\n state: configState,\n setState: setConfigState,\n }),\n h(\n Button,\n {\n className: \"run-button\",\n intent: action.intent ?? \"primary\",\n icon: \"play\",\n disabled: !ready,\n fill: true,\n onClick() {\n runAction(configState);\n setIsOpen(false);\n },\n },\n \"Run\",\n ),\n ]),\n placement: \"bottom-start\",\n enforceFocus: false,\n autoFocus: false,\n },\n h(\n Button,\n {\n minimal: true,\n small: true,\n icon: action.icon,\n intent: action.intent,\n disabled: isDisabled,\n onClick: () => setIsOpen(!isOpen),\n },\n action.name,\n ),\n );\n}\n\nfunction hasAnyDisplayableActions(\n actions: TableAction[],\n columnSpec: ColumnSpec[],\n) {\n /** Check whether there are any actions that can be displayed in the toolbar.\n * for the entire table. This is used to determine whether the toolbar should\n * be rendered. If any actions are available, the toolbar is rendered in ALL\n * selection modes to avoid flickering\n */\n const allActions = [\n ...actions,\n ...columnSpec.flatMap((c) => c.actions ?? []),\n ];\n\n if (allActions.length === 0) {\n return false;\n }\n // Check whether any action doesn't have hotkey and is not disabled\n return allActions.some(\n (action) => action.hotkey == null && !isActionDisabled(action, {}),\n );\n}\n"],"names":["selection","ctx","selectionAtom","useSelector","useMemo","getSelectionCardinality","RegionCardinality","mergeColumnActions","getApplicableActions","buildActionContext","h","SelectionIndicator","ButtonGroup","useToaster","useCallback","runActionWrapper","Button","useState","PopoverNext"],"mappings":";;;;;;;;;;;;AAwBO,SAAS,eAAkB;AAAA,EAChC,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,UAAU;AACZ,GAMG;AACD,QAAMA,cAAYC,KAAAA,IAAI,SAASC,uBAAa;AAC5C,QAAM,WAAWC,KAAAA,YAAY,CAAC,UAAU,MAAM,QAAQ;AACtD,QAAM,aAAaA,KAAAA,YAAY,CAAC,UAAU,MAAM,UAAU;AAE1D,QAAM,YAAY,IAAI,IAAI,SAAS,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;AACnD,QAAM,UAAUC,MAAAA,QAAQ,MAAM,UAAU,CAAC,SAAS,CAAC;AAEnD,QAAM,cAAcA,MAAAA;AAAAA,IAClB,MAAMC,oCAAwBL,WAAS,KAAKM,MAAAA,kBAAkB;AAAA,IAC9D,CAACN,WAAS;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f,UAAU;AAAA,QACV,SAAS,MAAM,UAAU,CAAC,MAAM;AAAA,MAAA;AAAA,MAElC,OAAO;AAAA,IAAA;AAAA,EACT;AAEJ;AAEA,SAAS,yBACP,SACA,YACA;AAMA,QAAM,aAAa;AAAA,IACjB,GAAG;AAAA,IACH,GAAG,WAAW,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA,CAAE;AAAA,EAAA;AAG9C,MAAI,WAAW,WAAW,GAAG;AAC3B,WAAO;AAAA,EACT;AAEA,SAAO,WAAW;AAAA,IAChB,CAAC,WAAW,OAAO,UAAU,QAAQ,CAAC,iBAAiB,QAAQ,CAAA,CAAE;AAAA,EAAA;AAErE;;"}
|
|
@@ -45,7 +45,7 @@ function ActionsToolbar({
|
|
|
45
45
|
if (!toolbarIsShown && children == null) {
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
|
-
const isGlobal = (a) => (a.targets.includes(RegionCardinality.FULL_TABLE) || a.targets.includes("none")) && a.requiresEditable;
|
|
48
|
+
const isGlobal = (a) => a.placement === "end" || (a.targets.includes(RegionCardinality.FULL_TABLE) || a.targets.includes("none")) && a.requiresEditable;
|
|
49
49
|
const contextual = shownActions.filter((a) => !isGlobal(a));
|
|
50
50
|
const globalActions = shownActions.filter(isGlobal);
|
|
51
51
|
return h("div.actions-toolbar", { className }, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions-toolbar.js","sources":["../../../src/components/toolbars/actions-toolbar.ts"],"sourcesContent":["import { Button, ButtonGroup, PopoverNext } from \"@blueprintjs/core\";\nimport { type ReactNode, useCallback, useMemo, useState } from \"react\";\nimport h from \"./actions-toolbar.module.sass\";\nimport { ctx, selectionAtom, useSelector } from \"../../provider\";\nimport {\n getApplicableActions,\n getSelectionCardinality,\n mergeColumnActions,\n buildActionContext,\n TableActionContext,\n runActionWrapper,\n type TableAction,\n} from \"../../actions\";\nimport { RegionCardinality } from \"@blueprintjs/table\";\nimport { useToaster } from \"../../notifications.ts\";\nimport type { ColumnSpec } from \"../../provider\";\nimport { SelectionIndicator } from \"../index.ts\";\n\n/** Toolbar that renders the actions/controls applicable to the current\n * selection cardinality (modal by selection) and edit mode. Actions with a\n * `render` show their live control; others show a button (with an optional\n * `detailsForm` popover). Column-specific actions from `ColumnSpec.actions`\n * are merged when their columns are selected. A capsule on the left shows the\n * current selection polarity. */\nexport function ActionsToolbar<T>({\n actions: _actions,\n children,\n className,\n compact = false,\n}: {\n actions: TableAction<T>[];\n tableName?: string;\n children: ReactNode;\n className?: string;\n compact: boolean;\n}) {\n const selection = ctx.useValue(selectionAtom);\n const editable = useSelector((state) => state.editable);\n const columnSpec = useSelector((state) => state.columnSpec);\n\n const actionIDs = new Set(_actions.map((a) => a.id));\n const actions = useMemo(() => _actions, [actionIDs]);\n\n const cardinality = useMemo(\n () => getSelectionCardinality(selection) ?? RegionCardinality.FULL_TABLE,\n [selection],\n );\n\n // Merge global actions with column-specific actions from the selection\n const allActions = useMemo(\n () => mergeColumnActions(actions, columnSpec, selection),\n [actions, columnSpec, selection],\n );\n\n const applicableActions = useMemo(\n () => getApplicableActions(allActions, cardinality, editable),\n [allActions, cardinality, editable],\n );\n\n const store = ctx.useStore();\n // Context for `render`-style controls (they subscribe to the store\n // themselves; this resolves the selected column/rows).\n const actionContext = useMemo(() => {\n return buildActionContext(store.get, store.set);\n }, [allActions]);\n\n // The toolbar is for actions that AREN'T keyboard-accessible: any action\n // with a `hotkey` (copy/cut/paste, etc.) is reachable from the keyboard and\n // is omitted here (it still works via its shortcut). Then refine by selection\n // shape beyond cardinality (e.g. single column only).\n const shownActions = applicableActions.filter(\n (action: TableAction<T, any>) =>\n action.hotkey == null &&\n (action.appliesTo?.(actionContext as any) ?? true),\n );\n\n const toolbarIsShown = useMemo(\n () => hasAnyDisplayableActions(actions, columnSpec),\n [actions, columnSpec],\n );\n\n // Render whenever there are displayable actions OR the consumer supplied\n // custom toolbar chrome (`children`) — a facet-less panel (e.g. a card list\n // with only a search box) still needs its toolbar slot to appear.\n if (!toolbarIsShown && children == null) {\n return null;\n }\n\n // Order left→right by generality: actions that require editing\n // are \"global\" and sit after a spacer on the right (Save /\n // Reset); everything else is contextual and stays on the left. So the left\n // edge tracks the selection and the right edge is constant.\n const isGlobal = (a: TableAction<T>) =>\n (a.targets.includes(RegionCardinality.FULL_TABLE) ||\n a.targets.includes(\"none\" as any)) &&\n a.requiresEditable;\n const contextual = shownActions.filter((a) => !isGlobal(a));\n // Order the built-in global actions least→most impactful, left→right: reset\n // changes, then save. Any other global actions keep their natural order to\n // the left of these (stable sort, rank 0).\n\n const globalActions = shownActions.filter(isGlobal);\n\n return h(\"div.actions-toolbar\", { className }, [\n h(SelectionIndicator, { minimal: compact }),\n h(\n \"div.toolbar-group.contextual\",\n contextual.map((action) =>\n h(ActionButton, { key: action.id, action, ctx: actionContext }),\n ),\n ),\n children,\n h(\"div.toolbar-spacer\", { style: { flex: 1 } }),\n h(\n ButtonGroup,\n { minimal: true },\n globalActions.map((action) =>\n h(ActionButton, { key: action.id, action, ctx: actionContext }),\n ),\n ),\n ]);\n}\n\nfunction isActionDisabled(action: TableAction, state: any): boolean {\n if (typeof action.disabled === \"boolean\") return action.disabled;\n if (typeof action.disabled === \"function\") {\n return action.disabled(state);\n }\n return false;\n}\n\n/** Dispatcher: a live control (`action.render`) or a run/detailsForm button.\n * Kept hook-free so the two paths don't share a hook order. */\nfunction ActionButton<T>({\n action,\n ctx,\n}: {\n action: TableAction<T>;\n ctx: TableActionContext<T>;\n}) {\n if (action.render != null) {\n return action.render(ctx) as any;\n }\n return h(RunActionButton, { action });\n}\n\n/** A run/detailsForm action rendered as a button. */\nfunction RunActionButton<T>({ action }: { action: TableAction<T> }) {\n const store = ctx.useStore();\n const toaster = useToaster();\n\n // Reactive disabled check — re-renders when relevant state changes\n const isDisabled = useSelector((state) => {\n return isActionDisabled(action, state);\n });\n\n const runAction = useCallback(\n (configState?: any) => {\n runActionWrapper(action, store.get, store.set, toaster, configState);\n },\n [action, toaster],\n );\n\n if (action.detailsForm != null) {\n return h(ActionButtonWithForm, { action, runAction, isDisabled });\n }\n\n return h(\n Button,\n {\n // Minimal + small to match the toolbar's other controls (scroll-to-row,\n // sort/filter tags) — the compact, minimal house style.\n minimal: true,\n small: true,\n icon: action.icon,\n intent: action.intent,\n disabled: isDisabled,\n onClick() {\n runAction();\n },\n },\n action.name,\n );\n}\n\n/** Action button that opens a popover for pre-run configuration. */\nfunction ActionButtonWithForm<T, S>({\n action,\n runAction,\n isDisabled,\n}: {\n action: TableAction<T, S>;\n runAction: (configState?: S) => void;\n isDisabled: boolean;\n}) {\n const [configState, setConfigState] = useState<S>(\n action.defaultState ?? (null as S),\n );\n const [isOpen, setIsOpen] = useState(false);\n\n let ready = true;\n if (action.isReady != null) {\n ready = action.isReady(configState);\n }\n\n return h(\n PopoverNext,\n {\n isOpen,\n onClose: () => setIsOpen(false),\n content: h(\"div.action-popover-content\", [\n h.if(action.description != null)(\"p.description\", action.description),\n h(action.detailsForm as any, {\n state: configState,\n setState: setConfigState,\n }),\n h(\n Button,\n {\n className: \"run-button\",\n intent: action.intent ?? \"primary\",\n icon: \"play\",\n disabled: !ready,\n fill: true,\n onClick() {\n runAction(configState);\n setIsOpen(false);\n },\n },\n \"Run\",\n ),\n ]),\n placement: \"bottom-start\",\n enforceFocus: false,\n autoFocus: false,\n },\n h(\n Button,\n {\n minimal: true,\n small: true,\n icon: action.icon,\n intent: action.intent,\n disabled: isDisabled,\n onClick: () => setIsOpen(!isOpen),\n },\n action.name,\n ),\n );\n}\n\nfunction hasAnyDisplayableActions(\n actions: TableAction[],\n columnSpec: ColumnSpec[],\n) {\n /** Check whether there are any actions that can be displayed in the toolbar.\n * for the entire table. This is used to determine whether the toolbar should\n * be rendered. If any actions are available, the toolbar is rendered in ALL\n * selection modes to avoid flickering\n */\n const allActions = [\n ...actions,\n ...columnSpec.flatMap((c) => c.actions ?? []),\n ];\n\n if (allActions.length === 0) {\n return false;\n }\n // Check whether any action doesn't have hotkey and is not disabled\n return allActions.some(\n (action) => action.hotkey == null && !isActionDisabled(action, {}),\n );\n}\n"],"names":["ctx"],"mappings":";;;;;;;;;;AAwBO,SAAS,eAAkB;AAAA,EAChC,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,UAAU;AACZ,GAMG;AACD,QAAM,YAAY,IAAI,SAAS,aAAa;AAC5C,QAAM,WAAW,YAAY,CAAC,UAAU,MAAM,QAAQ;AACtD,QAAM,aAAa,YAAY,CAAC,UAAU,MAAM,UAAU;AAE1D,QAAM,YAAY,IAAI,IAAI,SAAS,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;AACnD,QAAM,UAAU,QAAQ,MAAM,UAAU,CAAC,SAAS,CAAC;AAEnD,QAAM,cAAc;AAAA,IAClB,MAAM,wBAAwB,SAAS,KAAK,kBAAkB;AAAA,IAC9D,CAAC,SAAS;AAAA,EAAA;AAIZ,QAAM,aAAa;AAAA,IACjB,MAAM,mBAAmB,SAAS,YAAY,SAAS;AAAA,IACvD,CAAC,SAAS,YAAY,SAAS;AAAA,EAAA;AAGjC,QAAM,oBAAoB;AAAA,IACxB,MAAM,qBAAqB,YAAY,aAAa,QAAQ;AAAA,IAC5D,CAAC,YAAY,aAAa,QAAQ;AAAA,EAAA;AAGpC,QAAM,QAAQ,IAAI,SAAA;AAGlB,QAAM,gBAAgB,QAAQ,MAAM;AAClC,WAAO,mBAAmB,MAAM,KAAK,MAAM,GAAG;AAAA,EAChD,GAAG,CAAC,UAAU,CAAC;AAMf,QAAM,eAAe,kBAAkB;AAAA,IACrC,CAAC,WACC,OAAO,UAAU,SAChB,OAAO,YAAY,aAAoB,KAAK;AAAA,EAAA;AAGjD,QAAM,iBAAiB;AAAA,IACrB,MAAM,yBAAyB,SAAS,UAAU;AAAA,IAClD,CAAC,SAAS,UAAU;AAAA,EAAA;AAMtB,MAAI,CAAC,kBAAkB,YAAY,MAAM;AACvC,WAAO;AAAA,EACT;AAMA,QAAM,WAAW,CAAC,OACf,EAAE,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A;AAAA,UAEF;AAAA,QAAA;AAAA,MACF,CACD;AAAA,MACD,WAAW;AAAA,MACX,cAAc;AAAA,MACd,WAAW;AAAA,IAAA;AAAA,IAEb;AAAA,MACE;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,OAAO;AAAA,QACP,MAAM,OAAO;AAAA,QACb,QAAQ,OAAO;AAAA,QACf,UAAU;AAAA,QACV,SAAS,MAAM,UAAU,CAAC,MAAM;AAAA,MAAA;AAAA,MAElC,OAAO;AAAA,IAAA;AAAA,EACT;AAEJ;AAEA,SAAS,yBACP,SACA,YACA;AAMA,QAAM,aAAa;AAAA,IACjB,GAAG;AAAA,IACH,GAAG,WAAW,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA,CAAE;AAAA,EAAA;AAG9C,MAAI,WAAW,WAAW,GAAG;AAC3B,WAAO;AAAA,EACT;AAEA,SAAO,WAAW;AAAA,IAChB,CAAC,WAAW,OAAO,UAAU,QAAQ,CAAC,iBAAiB,QAAQ,CAAA,CAAE;AAAA,EAAA;AAErE;"}
|
|
1
|
+
{"version":3,"file":"actions-toolbar.js","sources":["../../../src/components/toolbars/actions-toolbar.ts"],"sourcesContent":["import { Button, ButtonGroup, PopoverNext } from \"@blueprintjs/core\";\nimport { type ReactNode, useCallback, useMemo, useState } from \"react\";\nimport h from \"./actions-toolbar.module.sass\";\nimport { ctx, selectionAtom, useSelector } from \"../../provider\";\nimport {\n getApplicableActions,\n getSelectionCardinality,\n mergeColumnActions,\n buildActionContext,\n TableActionContext,\n runActionWrapper,\n type TableAction,\n} from \"../../actions\";\nimport { RegionCardinality } from \"@blueprintjs/table\";\nimport { useToaster } from \"../../notifications.ts\";\nimport type { ColumnSpec } from \"../../provider\";\nimport { SelectionIndicator } from \"../index.ts\";\n\n/** Toolbar that renders the actions/controls applicable to the current\n * selection cardinality (modal by selection) and edit mode. Actions with a\n * `render` show their live control; others show a button (with an optional\n * `detailsForm` popover). Column-specific actions from `ColumnSpec.actions`\n * are merged when their columns are selected. A capsule on the left shows the\n * current selection polarity. */\nexport function ActionsToolbar<T>({\n actions: _actions,\n children,\n className,\n compact = false,\n}: {\n actions: TableAction<T>[];\n tableName?: string;\n children: ReactNode;\n className?: string;\n compact: boolean;\n}) {\n const selection = ctx.useValue(selectionAtom);\n const editable = useSelector((state) => state.editable);\n const columnSpec = useSelector((state) => state.columnSpec);\n\n const actionIDs = new Set(_actions.map((a) => a.id));\n const actions = useMemo(() => _actions, [actionIDs]);\n\n const cardinality = useMemo(\n () => getSelectionCardinality(selection) ?? RegionCardinality.FULL_TABLE,\n [selection],\n );\n\n // Merge global actions with column-specific actions from the selection\n const allActions = useMemo(\n () => mergeColumnActions(actions, columnSpec, selection),\n [actions, columnSpec, selection],\n );\n\n const applicableActions = useMemo(\n () => getApplicableActions(allActions, cardinality, editable),\n [allActions, cardinality, editable],\n );\n\n const store = ctx.useStore();\n // Context for `render`-style controls (they subscribe to the store\n // themselves; this resolves the selected column/rows).\n const actionContext = useMemo(() => {\n return buildActionContext(store.get, store.set);\n }, [allActions]);\n\n // The toolbar is for actions that AREN'T keyboard-accessible: any action\n // with a `hotkey` (copy/cut/paste, etc.) is reachable from the keyboard and\n // is omitted here (it still works via its shortcut). Then refine by selection\n // shape beyond cardinality (e.g. single column only).\n const shownActions = applicableActions.filter(\n (action: TableAction<T, any>) =>\n action.hotkey == null &&\n (action.appliesTo?.(actionContext as any) ?? true),\n );\n\n const toolbarIsShown = useMemo(\n () => hasAnyDisplayableActions(actions, columnSpec),\n [actions, columnSpec],\n );\n\n // Render whenever there are displayable actions OR the consumer supplied\n // custom toolbar chrome (`children`) — a facet-less panel (e.g. a card list\n // with only a search box) still needs its toolbar slot to appear.\n if (!toolbarIsShown && children == null) {\n return null;\n }\n\n // Order left→right by generality: actions that require editing\n // are \"global\" and sit after a spacer on the right (Save /\n // Reset); everything else is contextual and stays on the left. So the left\n // edge tracks the selection and the right edge is constant.\n const isGlobal = (a: TableAction<T>) =>\n a.placement === \"end\" ||\n ((a.targets.includes(RegionCardinality.FULL_TABLE) ||\n a.targets.includes(\"none\" as any)) &&\n a.requiresEditable);\n const contextual = shownActions.filter((a) => !isGlobal(a));\n // Order the built-in global actions least→most impactful, left→right: reset\n // changes, then save. Any other global actions keep their natural order to\n // the left of these (stable sort, rank 0).\n\n const globalActions = shownActions.filter(isGlobal);\n\n return h(\"div.actions-toolbar\", { className }, [\n h(SelectionIndicator, { minimal: compact }),\n h(\n \"div.toolbar-group.contextual\",\n contextual.map((action) =>\n h(ActionButton, { key: action.id, action, ctx: actionContext }),\n ),\n ),\n children,\n h(\"div.toolbar-spacer\", { style: { flex: 1 } }),\n h(\n ButtonGroup,\n { minimal: true },\n globalActions.map((action) =>\n h(ActionButton, { key: action.id, action, ctx: actionContext }),\n ),\n ),\n ]);\n}\n\nfunction isActionDisabled(action: TableAction, state: any): boolean {\n if (typeof action.disabled === \"boolean\") return action.disabled;\n if (typeof action.disabled === \"function\") {\n return action.disabled(state);\n }\n return false;\n}\n\n/** Dispatcher: a live control (`action.render`) or a run/detailsForm button.\n * Kept hook-free so the two paths don't share a hook order. */\nfunction ActionButton<T>({\n action,\n ctx,\n}: {\n action: TableAction<T>;\n ctx: TableActionContext<T>;\n}) {\n if (action.render != null) {\n return action.render(ctx) as any;\n }\n return h(RunActionButton, { action });\n}\n\n/** A run/detailsForm action rendered as a button. */\nfunction RunActionButton<T>({ action }: { action: TableAction<T> }) {\n const store = ctx.useStore();\n const toaster = useToaster();\n\n // Reactive disabled check — re-renders when relevant state changes\n const isDisabled = useSelector((state) => {\n return isActionDisabled(action, state);\n });\n\n const runAction = useCallback(\n (configState?: any) => {\n runActionWrapper(action, store.get, store.set, toaster, configState);\n },\n [action, toaster],\n );\n\n if (action.detailsForm != null) {\n return h(ActionButtonWithForm, { action, runAction, isDisabled });\n }\n\n return h(\n Button,\n {\n // Minimal + small to match the toolbar's other controls (scroll-to-row,\n // sort/filter tags) — the compact, minimal house style.\n minimal: true,\n small: true,\n icon: action.icon,\n intent: action.intent,\n disabled: isDisabled,\n onClick() {\n runAction();\n },\n },\n action.name,\n );\n}\n\n/** Action button that opens a popover for pre-run configuration. */\nfunction ActionButtonWithForm<T, S>({\n action,\n runAction,\n isDisabled,\n}: {\n action: TableAction<T, S>;\n runAction: (configState?: S) => void;\n isDisabled: boolean;\n}) {\n const [configState, setConfigState] = useState<S>(\n action.defaultState ?? (null as S),\n );\n const [isOpen, setIsOpen] = useState(false);\n\n let ready = true;\n if (action.isReady != null) {\n ready = action.isReady(configState);\n }\n\n return h(\n PopoverNext,\n {\n isOpen,\n onClose: () => setIsOpen(false),\n content: h(\"div.action-popover-content\", [\n h.if(action.description != null)(\"p.description\", action.description),\n h(action.detailsForm as any, {\n state: configState,\n setState: setConfigState,\n }),\n h(\n Button,\n {\n className: \"run-button\",\n intent: action.intent ?? \"primary\",\n icon: \"play\",\n disabled: !ready,\n fill: true,\n onClick() {\n runAction(configState);\n setIsOpen(false);\n },\n },\n \"Run\",\n ),\n ]),\n placement: \"bottom-start\",\n enforceFocus: false,\n autoFocus: false,\n },\n h(\n Button,\n {\n minimal: true,\n small: true,\n icon: action.icon,\n intent: action.intent,\n disabled: isDisabled,\n onClick: () => setIsOpen(!isOpen),\n },\n action.name,\n ),\n );\n}\n\nfunction hasAnyDisplayableActions(\n actions: TableAction[],\n columnSpec: ColumnSpec[],\n) {\n /** Check whether there are any actions that can be displayed in the toolbar.\n * for the entire table. This is used to determine whether the toolbar should\n * be rendered. If any actions are available, the toolbar is rendered in ALL\n * selection modes to avoid flickering\n */\n const allActions = [\n ...actions,\n ...columnSpec.flatMap((c) => c.actions ?? []),\n ];\n\n if (allActions.length === 0) {\n return false;\n }\n // Check whether any action doesn't have hotkey and is not disabled\n return allActions.some(\n (action) => action.hotkey == null && !isActionDisabled(action, {}),\n );\n}\n"],"names":["ctx"],"mappings":";;;;;;;;;;AAwBO,SAAS,eAAkB;AAAA,EAChC,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,UAAU;AACZ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,QACT,OAAO;AAAA,QACP,MAAM,OAAO;AAAA,QACb,QAAQ,OAAO;AAAA,QACf,UAAU;AAAA,QACV,SAAS,MAAM,UAAU,CAAC,MAAM;AAAA,MAAA;AAAA,MAElC,OAAO;AAAA,IAAA;AAAA,EACT;AAEJ;AAEA,SAAS,yBACP,SACA,YACA;AAMA,QAAM,aAAa;AAAA,IACjB,GAAG;AAAA,IACH,GAAG,WAAW,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA,CAAE;AAAA,EAAA;AAG9C,MAAI,WAAW,WAAW,GAAG;AAC3B,WAAO;AAAA,EACT;AAEA,SAAO,WAAW;AAAA,IAChB,CAAC,WAAW,OAAO,UAAU,QAAQ,CAAC,iBAAiB,QAAQ,CAAA,CAAE;AAAA,EAAA;AAErE;"}
|
package/dist/data-sheet.css
CHANGED
|
@@ -1094,31 +1094,35 @@
|
|
|
1094
1094
|
.bp6-table-no-layout{
|
|
1095
1095
|
display:inline-block;
|
|
1096
1096
|
position:absolute;
|
|
1097
|
-
}._data-sheet-
|
|
1097
|
+
}._data-sheet-container_1xwuq_1, ._data-sheet-holder_1xwuq_1 {
|
|
1098
1098
|
flex: 1;
|
|
1099
1099
|
min-height: 0;
|
|
1100
1100
|
font-size: var(--data-sheet-font-size, 12px);
|
|
1101
1101
|
line-height: var(--data-sheet-row-height, 20px);
|
|
1102
1102
|
--data-sheet-cell-padding: 0px 8px;
|
|
1103
1103
|
}
|
|
1104
|
-
._data-sheet-
|
|
1104
|
+
._data-sheet-container_1xwuq_1 .bp6-table-cell, ._data-sheet-holder_1xwuq_1 .bp6-table-cell {
|
|
1105
|
+
--tag-line-height: 1.25;
|
|
1106
|
+
--tag-picker-height: calc(var(--data-sheet-row-height) - 1px);
|
|
1107
|
+
--tag-picker-overflow: hidden;
|
|
1108
|
+
--tag-row-wrap: nowrap;
|
|
1105
1109
|
padding: var(--data-sheet-cell-padding);
|
|
1106
1110
|
}
|
|
1107
|
-
._data-sheet-
|
|
1111
|
+
._data-sheet-container_1xwuq_1 .bp6-table-cell:not([class*=bp6-intent-]):not(.bp6-loading), ._data-sheet-holder_1xwuq_1 .bp6-table-cell:not([class*=bp6-intent-]):not(.bp6-loading) {
|
|
1108
1112
|
color: var(--text-color);
|
|
1109
1113
|
}
|
|
1110
|
-
._data-sheet-
|
|
1114
|
+
._data-sheet-container_1xwuq_1 .bp6-table-cell, ._data-sheet-container_1xwuq_1 .bp6-table-row-name, ._data-sheet-holder_1xwuq_1 .bp6-table-cell, ._data-sheet-holder_1xwuq_1 .bp6-table-row-name {
|
|
1111
1115
|
font-size: var(--data-sheet-font-size);
|
|
1112
1116
|
line-height: var(--data-sheet-row-height);
|
|
1113
1117
|
}
|
|
1114
|
-
._data-sheet-
|
|
1118
|
+
._data-sheet-container_1xwuq_1 .bp6-table-row-name, ._data-sheet-holder_1xwuq_1 .bp6-table-row-name {
|
|
1115
1119
|
color: var(--secondary-color);
|
|
1116
1120
|
}
|
|
1117
|
-
._data-sheet-
|
|
1121
|
+
._data-sheet-container_1xwuq_1 .bp6-table-column-name, ._data-sheet-holder_1xwuq_1 .bp6-table-column-name {
|
|
1118
1122
|
font-size: 1.2em;
|
|
1119
1123
|
}
|
|
1120
1124
|
|
|
1121
|
-
._data-sheet-
|
|
1125
|
+
._data-sheet-container_1xwuq_1 {
|
|
1122
1126
|
display: flex;
|
|
1123
1127
|
position: relative;
|
|
1124
1128
|
height: 100%;
|
|
@@ -1127,14 +1131,14 @@
|
|
|
1127
1131
|
max-width: 100%;
|
|
1128
1132
|
}
|
|
1129
1133
|
|
|
1130
|
-
._data-
|
|
1134
|
+
._data-sheet_1xwuq_1 {
|
|
1131
1135
|
height: 100%;
|
|
1132
1136
|
}
|
|
1133
|
-
._data-
|
|
1137
|
+
._data-sheet_1xwuq_1 .bp6-table-quadrant {
|
|
1134
1138
|
background-color: var(--panel-secondary-background-color);
|
|
1135
1139
|
}
|
|
1136
1140
|
|
|
1137
|
-
._input-
|
|
1141
|
+
._input-cell_1xwuq_45 input {
|
|
1138
1142
|
width: 100%;
|
|
1139
1143
|
height: 100%;
|
|
1140
1144
|
padding: 0;
|
|
@@ -1147,11 +1151,16 @@
|
|
|
1147
1151
|
font-family: inherit;
|
|
1148
1152
|
font-size: inherit;
|
|
1149
1153
|
}
|
|
1150
|
-
._input-
|
|
1154
|
+
._input-cell_1xwuq_45 input:focus {
|
|
1151
1155
|
outline: none;
|
|
1152
1156
|
}
|
|
1153
1157
|
|
|
1154
|
-
.
|
|
1158
|
+
._derived-cell_1xwuq_62 {
|
|
1159
|
+
color: var(--pz-text-subtle-color, var(--secondary-color)) !important;
|
|
1160
|
+
font-style: italic;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
._value-viewer-cell_1xwuq_67 .bp6-popover-target {
|
|
1155
1164
|
width: 100%;
|
|
1156
1165
|
height: var(--data-sheet-row-height);
|
|
1157
1166
|
position: relative;
|
|
@@ -1159,7 +1168,11 @@
|
|
|
1159
1168
|
margin: calc(var(--data-sheet-cell-padding) * -1);
|
|
1160
1169
|
}
|
|
1161
1170
|
|
|
1162
|
-
._editor-
|
|
1171
|
+
._editor-cell_1xwuq_75 {
|
|
1172
|
+
--tag-outline: 0 0 0 1px rgba(128, 128, 128, 0.35);
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
._editor-cell_1xwuq_75 .bp6-popover-target {
|
|
1163
1176
|
position: absolute;
|
|
1164
1177
|
top: 0;
|
|
1165
1178
|
left: 0;
|
|
@@ -1167,20 +1180,20 @@
|
|
|
1167
1180
|
height: 100%;
|
|
1168
1181
|
}
|
|
1169
1182
|
|
|
1170
|
-
._hidden-
|
|
1183
|
+
._hidden-input_1xwuq_87 {
|
|
1171
1184
|
opacity: 0;
|
|
1172
1185
|
position: absolute;
|
|
1173
1186
|
width: 0;
|
|
1174
1187
|
}
|
|
1175
1188
|
|
|
1176
|
-
._data-editor-
|
|
1189
|
+
._data-editor-anchor_1xwuq_93 {
|
|
1177
1190
|
width: 100%;
|
|
1178
1191
|
height: 100%;
|
|
1179
1192
|
margin: 0;
|
|
1180
1193
|
pointer-events: none;
|
|
1181
1194
|
}
|
|
1182
1195
|
|
|
1183
|
-
._corner-drag-
|
|
1196
|
+
._corner-drag-handle_1xwuq_100 {
|
|
1184
1197
|
position: absolute;
|
|
1185
1198
|
bottom: 0;
|
|
1186
1199
|
right: 0;
|
|
@@ -1190,23 +1203,23 @@
|
|
|
1190
1203
|
background-color: dodgerblue;
|
|
1191
1204
|
}
|
|
1192
1205
|
|
|
1193
|
-
._data-sheet-
|
|
1206
|
+
._data-sheet-toolbar_1xwuq_110 {
|
|
1194
1207
|
display: flex;
|
|
1195
1208
|
flex-direction: row;
|
|
1196
1209
|
margin-bottom: 4px;
|
|
1197
1210
|
}
|
|
1198
1211
|
|
|
1199
|
-
.
|
|
1212
|
+
._spacer_1xwuq_116 {
|
|
1200
1213
|
flex-grow: 1;
|
|
1201
1214
|
}
|
|
1202
1215
|
|
|
1203
|
-
._table-
|
|
1216
|
+
._table-control_1xwuq_120 {
|
|
1204
1217
|
display: flex;
|
|
1205
1218
|
flex-direction: row;
|
|
1206
1219
|
margin-bottom: 0.25em;
|
|
1207
1220
|
}
|
|
1208
1221
|
|
|
1209
|
-
._status-
|
|
1222
|
+
._status-bar_1xwuq_126 {
|
|
1210
1223
|
display: flex;
|
|
1211
1224
|
flex-direction: row;
|
|
1212
1225
|
padding: 0.2em 0.5em;
|
|
@@ -1736,4 +1749,179 @@ span._sep_1r3aw_9:first-child, span._sep_1r3aw_9:last-child {
|
|
|
1736
1749
|
flex-direction: column;
|
|
1737
1750
|
gap: var(--data-panel-masonry-row-gap, var(--data-panel-item-gap, 8px));
|
|
1738
1751
|
margin-top: var(--data-panel-masonry-row-gap, var(--data-panel-item-gap, 8px));
|
|
1752
|
+
}._row-editor_kma62_1 {
|
|
1753
|
+
display: flex;
|
|
1754
|
+
flex-direction: column;
|
|
1755
|
+
min-width: 0;
|
|
1756
|
+
min-height: 0;
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
._field-actions_kma62_8 {
|
|
1760
|
+
display: inline-flex;
|
|
1761
|
+
gap: 0.1em;
|
|
1762
|
+
margin-left: 0.2em;
|
|
1763
|
+
}
|
|
1764
|
+
._field-actions_kma62_8 .bp6-button {
|
|
1765
|
+
min-height: 0;
|
|
1766
|
+
min-width: 0;
|
|
1767
|
+
padding: 0 3px;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
._editor-action-form_kma62_19 {
|
|
1771
|
+
display: flex;
|
|
1772
|
+
flex-direction: column;
|
|
1773
|
+
gap: 0.5em;
|
|
1774
|
+
padding: 0.6em;
|
|
1775
|
+
min-width: 14em;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
._data-editor-footer_kma62_27 {
|
|
1779
|
+
flex: none;
|
|
1780
|
+
display: flex;
|
|
1781
|
+
align-items: center;
|
|
1782
|
+
gap: 0.3em;
|
|
1783
|
+
padding-top: 0.5em;
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
._data-editor-footer-spacer_kma62_35 {
|
|
1787
|
+
flex: 1;
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
._row-editor_kma62_1._panel_kma62_39 ._data-editor-footer_kma62_27 {
|
|
1791
|
+
padding: 0.4em 0.6em;
|
|
1792
|
+
border-top: 1px solid var(--pz-border-color, rgba(128, 128, 128, 0.3));
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
._row-editor-body_kma62_44 {
|
|
1796
|
+
display: flex;
|
|
1797
|
+
flex-direction: column;
|
|
1798
|
+
gap: 0.25em;
|
|
1799
|
+
min-width: 0;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
._row-editor_kma62_1._panel_kma62_39 {
|
|
1803
|
+
max-height: 100%;
|
|
1804
|
+
border: 1px solid var(--pz-border-color, rgba(128, 128, 128, 0.3));
|
|
1805
|
+
border-radius: 4px;
|
|
1806
|
+
background: var(--panel-background-color, var(--background-color, transparent));
|
|
1807
|
+
overflow: hidden;
|
|
1808
|
+
}
|
|
1809
|
+
._row-editor_kma62_1._panel_kma62_39 ._row-editor-body_kma62_44 {
|
|
1810
|
+
flex: 1 1 auto;
|
|
1811
|
+
min-height: 0;
|
|
1812
|
+
overflow-y: auto;
|
|
1813
|
+
padding: 0.75em 0.9em;
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
._row-editor-title-bar_kma62_65 {
|
|
1817
|
+
flex: none;
|
|
1818
|
+
min-height: 36px !important;
|
|
1819
|
+
padding-left: 0.9em !important;
|
|
1820
|
+
border-radius: 0 !important;
|
|
1821
|
+
font-weight: 600;
|
|
1822
|
+
box-shadow: inset 0 -1px 0 var(--pz-border-color, rgba(128, 128, 128, 0.3));
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
._row-editor-fields_kma62_74 {
|
|
1826
|
+
display: flex;
|
|
1827
|
+
flex-direction: column;
|
|
1828
|
+
gap: 0.1em;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
._row-editor-field_kma62_74 {
|
|
1832
|
+
margin-bottom: 0.4em;
|
|
1833
|
+
min-width: 0;
|
|
1834
|
+
}
|
|
1835
|
+
._row-editor-field_kma62_74 .bp6-label {
|
|
1836
|
+
margin-bottom: 0.15em;
|
|
1837
|
+
}
|
|
1838
|
+
._row-editor-field_kma62_74._edited_kma62_87 ._field-name_kma62_87 {
|
|
1839
|
+
color: var(--pz-intent-success, #0f9960);
|
|
1840
|
+
}
|
|
1841
|
+
._row-editor-field_kma62_74._derived_kma62_90 ._field-value_kma62_90 {
|
|
1842
|
+
color: var(--pz-text-subtle-color, var(--secondary-color));
|
|
1843
|
+
font-style: italic;
|
|
1844
|
+
}
|
|
1845
|
+
._row-editor-field_kma62_74._read-only_kma62_94 .bp6-form-content {
|
|
1846
|
+
padding: 0.15em 0;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
._row-editor_kma62_1._inline_kma62_98 ._row-editor-field_kma62_74 {
|
|
1850
|
+
align-items: baseline;
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
._field-label_kma62_102 {
|
|
1854
|
+
display: inline-flex;
|
|
1855
|
+
align-items: center;
|
|
1856
|
+
gap: 0.35em;
|
|
1857
|
+
min-height: 1.4em;
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
._field-name_kma62_87 {
|
|
1861
|
+
font-weight: 600;
|
|
1862
|
+
font-size: 0.85em;
|
|
1863
|
+
color: var(--secondary-color);
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
._field-marker_kma62_115 {
|
|
1867
|
+
font-size: 0.7em;
|
|
1868
|
+
line-height: 1;
|
|
1869
|
+
padding: 0 0.4em;
|
|
1870
|
+
min-height: 1.4em;
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
._required-marker_kma62_122 {
|
|
1874
|
+
color: var(--pz-intent-danger, #cd4246);
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
._reset-field_kma62_126 {
|
|
1878
|
+
margin-left: -0.15em;
|
|
1879
|
+
min-height: 0;
|
|
1880
|
+
}
|
|
1881
|
+
._reset-field_kma62_126 .bp6-icon {
|
|
1882
|
+
color: var(--pz-text-subtle-color, var(--secondary-color));
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
._field-value_kma62_90 {
|
|
1886
|
+
display: inline-block;
|
|
1887
|
+
min-width: 0;
|
|
1888
|
+
overflow-wrap: anywhere;
|
|
1889
|
+
}
|
|
1890
|
+
._field-value_kma62_90._empty_kma62_139 {
|
|
1891
|
+
color: var(--pz-text-subtle-color, var(--secondary-color));
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
._field-surface_kma62_143._cell-detail_kma62_143 {
|
|
1895
|
+
min-width: 0;
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
._row-editor-non-ideal_kma62_147 {
|
|
1899
|
+
padding: 1.5em 0;
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
._row-editor-field_kma62_74._selected_kma62_151 {
|
|
1903
|
+
margin: -0.3em -0.4em 0.1em;
|
|
1904
|
+
padding: 0.3em 0.4em;
|
|
1905
|
+
border-radius: 3px;
|
|
1906
|
+
background: color-mix(in srgb, var(--pz-intent-primary, #2d72d2) 4%, transparent);
|
|
1907
|
+
box-shadow: inset 0 0 0 1px var(--pz-intent-primary, #2d72d2);
|
|
1908
|
+
--tag-outline: 0 0 0 1px rgba(128, 128, 128, 0.35);
|
|
1909
|
+
}
|
|
1910
|
+
._row-editor-field_kma62_74._selected_kma62_151 ._field-name_kma62_87 {
|
|
1911
|
+
color: var(--pz-intent-primary, #2d72d2);
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
._mixed-values_kma62_163 {
|
|
1915
|
+
color: var(--pz-text-subtle-color, var(--secondary-color));
|
|
1916
|
+
font-style: italic;
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
._selection-summary_kma62_168 {
|
|
1920
|
+
font-size: 0.85em;
|
|
1921
|
+
color: var(--pz-text-subtle-color, var(--secondary-color));
|
|
1922
|
+
margin-bottom: 0.5em;
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
._row-editor-field-target_kma62_174 {
|
|
1926
|
+
display: contents;
|
|
1739
1927
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -16,12 +16,15 @@ const debugOverlay = require("./utils/debug-overlay.cjs");
|
|
|
16
16
|
const colors = require("./components/colors.cjs");
|
|
17
17
|
const filterAndSort = require("./components/indicators/filter-and-sort.cjs");
|
|
18
18
|
const types = require("./provider/types.cjs");
|
|
19
|
+
const dataEditor = require("./components/data-editor.cjs");
|
|
19
20
|
const core = require("./provider/core.cjs");
|
|
20
21
|
const interactions = require("./provider/interactions.cjs");
|
|
21
22
|
const textAreas = require("./components/text-areas.cjs");
|
|
23
|
+
const editorActions = require("./components/editor-actions.cjs");
|
|
22
24
|
const editorPopup = require("./components/editor-popup.cjs");
|
|
23
25
|
const viewInfo = require("./components/indicators/view-info.cjs");
|
|
24
26
|
const clipboard = require("./actions/clipboard.cjs");
|
|
27
|
+
const rowEditor = require("./components/row-editor.cjs");
|
|
25
28
|
const selection = require("./components/indicators/selection.cjs");
|
|
26
29
|
const builtin = require("./actions/builtin.cjs");
|
|
27
30
|
const selection$1 = require("./provider/selection.cjs");
|
|
@@ -92,6 +95,14 @@ exports.resolveColumnFilter = filterAndSort.resolveColumnFilter;
|
|
|
92
95
|
exports.DEFAULT_ROW_STATUS_STYLES = types.DEFAULT_ROW_STATUS_STYLES;
|
|
93
96
|
exports.DS_ROW_ID = types.DS_ROW_ID;
|
|
94
97
|
exports.TableElementStatus = types.TableElementStatus;
|
|
98
|
+
exports.DataEditor = dataEditor.DataEditor;
|
|
99
|
+
exports.DataEditorField = dataEditor.DataEditorField;
|
|
100
|
+
exports.DataEditorFields = dataEditor.DataEditorFields;
|
|
101
|
+
exports.DataEditorFrame = dataEditor.DataEditorFrame;
|
|
102
|
+
exports.FieldValue = dataEditor.FieldValue;
|
|
103
|
+
exports.MixedValues = dataEditor.MixedValues;
|
|
104
|
+
exports.sharedValue = dataEditor.sharedValue;
|
|
105
|
+
exports.valueToken = dataEditor.valueToken;
|
|
95
106
|
exports.DataSheetProvider = core.DataSheetProvider;
|
|
96
107
|
exports.DataSheetProviderInner = core.DataSheetProviderInner;
|
|
97
108
|
exports.capitalize = core.capitalize;
|
|
@@ -99,6 +110,7 @@ exports.columnSpecAtom = core.columnSpecAtom;
|
|
|
99
110
|
exports.ctx = core.ctx;
|
|
100
111
|
exports.dataProviderAtom = core.dataProviderAtom;
|
|
101
112
|
exports.itemLabelAtom = core.itemLabelAtom;
|
|
113
|
+
exports.pluralFormOf = core.pluralFormOf;
|
|
102
114
|
exports.pluralize = core.pluralize;
|
|
103
115
|
exports.splitDataProviderProps = core.splitDataProviderProps;
|
|
104
116
|
exports.storeAPIAtom = core.storeAPIAtom;
|
|
@@ -120,6 +132,9 @@ exports.interactionOptionsKeys = interactions.interactionOptionsKeys;
|
|
|
120
132
|
exports.resolveInteractionOptions = interactions.resolveInteractionOptions;
|
|
121
133
|
exports.selectionModeActiveAtom = interactions.selectionModeActiveAtom;
|
|
122
134
|
exports.EditableTextArea = textAreas.EditableTextArea;
|
|
135
|
+
exports.EditorActionButton = editorActions.EditorActionButton;
|
|
136
|
+
exports.editorActionContext = editorActions.editorActionContext;
|
|
137
|
+
exports.editorActionsFor = editorActions.editorActionsFor;
|
|
123
138
|
exports.EditorPopup = editorPopup.EditorPopup;
|
|
124
139
|
exports.LoadProgressIndicator = viewInfo.LoadProgressIndicator;
|
|
125
140
|
exports.LoadProgressLabel = viewInfo.LoadProgressLabel;
|
|
@@ -129,6 +144,17 @@ exports.copyAction = clipboard.copyAction;
|
|
|
129
144
|
exports.cutAction = clipboard.cutAction;
|
|
130
145
|
exports.pasteAction = clipboard.pasteAction;
|
|
131
146
|
exports.serializeSelectionToTSV = clipboard.serializeSelectionToTSV;
|
|
147
|
+
exports.RowEditor = rowEditor.RowEditor;
|
|
148
|
+
exports.RowEditorField = rowEditor.RowEditorField;
|
|
149
|
+
exports.RowEditorFrame = rowEditor.RowEditorFrame;
|
|
150
|
+
exports.SelectedDataEditor = rowEditor.SelectedDataEditor;
|
|
151
|
+
exports.SelectedRowEditor = rowEditor.SelectedRowEditor;
|
|
152
|
+
exports.ShowRowEditor = rowEditor.ShowRowEditor;
|
|
153
|
+
exports.rowEditorOpenAtom = rowEditor.rowEditorOpenAtom;
|
|
154
|
+
exports.showRowEditorAction = rowEditor.showRowEditorAction;
|
|
155
|
+
exports.useRowEditorOpen = rowEditor.useRowEditorOpen;
|
|
156
|
+
exports.useSelectedRow = rowEditor.useSelectedRow;
|
|
157
|
+
exports.useSelectedRows = rowEditor.useSelectedRows;
|
|
132
158
|
exports.SelectionIndicator = selection.SelectionIndicator;
|
|
133
159
|
exports.toggleModalSelectionAtom = selection.toggleModalSelectionAtom;
|
|
134
160
|
exports.addRowAction = builtin.addRowAction;
|
|
@@ -185,6 +211,7 @@ exports.multiLineTextKeyHandler = keyHandling.multiLineTextKeyHandler;
|
|
|
185
211
|
exports.tableHotkeysAtom = keyHandling.tableHotkeysAtom;
|
|
186
212
|
exports.generateColumnSpec = columnSpec.generateColumnSpec;
|
|
187
213
|
exports.generateDefaultColumnSpec = columnSpec.generateDefaultColumnSpec;
|
|
214
|
+
exports.isColumnWritable = columnSpec.isColumnWritable;
|
|
188
215
|
exports.postprocessColumnSpec = columnSpec.postprocessColumnSpec;
|
|
189
216
|
exports.passThroughGet = atoms.passThroughGet;
|
|
190
217
|
exports.passThroughSet = atoms.passThroughSet;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|