@ishibashi0112/spreadsheet-grid-solid 1.10.0 → 1.11.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 (30) hide show
  1. package/API_REFERENCE.md +125 -13
  2. package/README.md +2 -2
  3. package/dist/{ColumnFilterPopover-mENgY4gl.js → ColumnFilterPopover-t32VGfTq.js} +135 -134
  4. package/dist/DateEditorCalendar-CWaFuibK.js +118 -0
  5. package/dist/devWarnings.d.ts +4 -0
  6. package/dist/editors/CellEditorLayer.d.ts +6 -2
  7. package/dist/editors/DateTimeCellEditor.d.ts +26 -0
  8. package/dist/editors/MultiSelectCellEditor.d.ts +24 -0
  9. package/dist/features/dateTimeEditors.d.ts +2 -0
  10. package/dist/features/multiSelect.d.ts +2 -0
  11. package/dist/features/types.d.ts +13 -0
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.js +4914 -4168
  14. package/dist/localeText-CCqvpkYM.js +10 -0
  15. package/dist/portalTokens-LgUwLYnR.js +47 -0
  16. package/dist/source/chunks/{ColumnFilterPopover-D7INPNVB.jsx → ColumnFilterPopover-JL3HPGXY.jsx} +4 -2
  17. package/dist/source/chunks/DateEditorCalendar-FVUNVD7Y.jsx +170 -0
  18. package/dist/source/chunks/{chunk-RJB7JN2Y.jsx → chunk-AI3CSPI3.jsx} +3 -29
  19. package/dist/source/chunks/chunk-ZW5ET5DO.jsx +28 -0
  20. package/dist/source/chunks/{toolPanelViews-BRH5PCOI.jsx → toolPanelViews-N6TGBFFW.jsx} +4 -2
  21. package/dist/source/index.jsx +1102 -71
  22. package/dist/style.css +1 -1
  23. package/dist/style.layer.css +1 -1
  24. package/dist/{toolPanelViews-DMEVr1KV.js → toolPanelViews-CPYtBTQP.js} +2 -1
  25. package/dist/view/DateEditorCalendar.d.ts +15 -0
  26. package/dist/view/GridMultiSelectChips.d.ts +6 -0
  27. package/dist/view/GridPinnedRows.d.ts +1 -0
  28. package/dist/view/lazyPopups.d.ts +3 -1
  29. package/package.json +3 -3
  30. package/dist/portalTokens-Gz03P3fZ.js +0 -52
@@ -13,18 +13,20 @@ import {
13
13
  runInMountGate
14
14
  } from "./chunks/chunk-ZZTXTW4Z.jsx";
15
15
  import {
16
- GridLocaleTextContext,
17
16
  GridPortalContext,
18
17
  createPortalTokens,
19
- mergeFeatureLocaleDefaults,
20
18
  px,
21
19
  readEventKey,
22
20
  toEditorKeyEvent,
23
21
  toSolidStyle,
24
- useFeatureLocaleText,
25
- useGridLocaleText,
26
22
  useGridPortal
27
- } from "./chunks/chunk-RJB7JN2Y.jsx";
23
+ } from "./chunks/chunk-AI3CSPI3.jsx";
24
+ import {
25
+ GridLocaleTextContext,
26
+ mergeFeatureLocaleDefaults,
27
+ useFeatureLocaleText,
28
+ useGridLocaleText
29
+ } from "./chunks/chunk-ZW5ET5DO.jsx";
28
30
 
29
31
  // src/createSpreadsheetGrid.tsx
30
32
  import { merge } from "solid-js";
@@ -112,6 +114,12 @@ import {
112
114
  peekEditRow,
113
115
  resolveFirstEditableColIndex
114
116
  } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/newRow";
117
+ import {
118
+ hasRowEditor,
119
+ mayHaveEditorType,
120
+ resolveColumnEditor,
121
+ resolveStaticColumnEditor as resolveStaticColumnEditor2
122
+ } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/columnEditor";
115
123
  import { IME_INPUT_ATTRIBUTE, isImeComposingKeyEvent as isImeComposingKeyEvent2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
116
124
  import {
117
125
  createKeyboardController,
@@ -1601,6 +1609,8 @@ import { toDateInputValue } from "@ishibashi0112/spreadsheet-grid-core/internal/
1601
1609
  import { resolveTypedStartText } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
1602
1610
  import { formatLocaleText as formatLocaleText4 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
1603
1611
  import { isSearchSelectEditor } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectEditorState";
1612
+ import { isDateTimeEditor } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/columnEditor";
1613
+ import { isMultiSelectEditor } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/multiSelect";
1604
1614
 
1605
1615
  // src/editors/TextCellEditor.tsx
1606
1616
  import { Show as Show6, createRenderEffect as createRenderEffect3, createSignal as createSignal4, onCleanup as onCleanup3, onSettled as onSettled3, untrack as untrack6 } from "solid-js";
@@ -2292,6 +2302,12 @@ function CellEditorLayer(props) {
2292
2302
  const texts = useGridLocaleText();
2293
2303
  const editor = () => props.editor;
2294
2304
  const kind = createMemo7(() => {
2305
+ if (props.DateTimeEditor && isDateTimeEditor(editor())) {
2306
+ return "dateTime";
2307
+ }
2308
+ if (isMultiSelectEditor(editor())) {
2309
+ return props.MultiSelectEditor ? "multiSelect" : "text";
2310
+ }
2295
2311
  const type = editor()?.type;
2296
2312
  return type === "number" || type === "select" || type === "date" || type === "custom" ? type : "text";
2297
2313
  });
@@ -2403,6 +2419,25 @@ function CellEditorLayer(props) {
2403
2419
  initialText={session ? resolveTypedStartText(initialValue, session.value) : void 0}
2404
2420
  />;
2405
2421
  }
2422
+ case "dateTime": {
2423
+ const session = untrack11(() => props.session);
2424
+ const current = untrack11(editor);
2425
+ const DateTimeEditor = props.DateTimeEditor;
2426
+ if (!DateTimeEditor || !isDateTimeEditor(current)) {
2427
+ return null;
2428
+ }
2429
+ return <DateTimeEditor
2430
+ {...common}
2431
+ editor={current}
2432
+ columnTitle={session ? session.column.title || session.column.key : ""}
2433
+ value={session ? session.value : initialValue}
2434
+ initialValue={initialValue}
2435
+ popoverSlot={props.slots.popover}
2436
+ themeClassName={props.themeClassName}
2437
+ cellTop={props.rect?.top ?? 0}
2438
+ cellLeft={props.rect?.left ?? 0}
2439
+ />;
2440
+ }
2406
2441
  case "select": {
2407
2442
  const session = untrack11(() => props.session);
2408
2443
  const current = untrack11(editor);
@@ -2435,6 +2470,27 @@ function CellEditorLayer(props) {
2435
2470
  initialText={initialText}
2436
2471
  />;
2437
2472
  }
2473
+ case "multiSelect": {
2474
+ const session = untrack11(() => props.session);
2475
+ const current = untrack11(editor);
2476
+ const MultiSelectEditor = props.MultiSelectEditor;
2477
+ if (!MultiSelectEditor || current?.type !== "select") {
2478
+ return null;
2479
+ }
2480
+ const loadOptions = current.loadOptions;
2481
+ return <MultiSelectEditor
2482
+ {...common}
2483
+ popoverSlot={props.slots.popover}
2484
+ themeClassName={props.themeClassName}
2485
+ options={selectOptions()}
2486
+ value={session?.value}
2487
+ search={current.search ?? loadOptions !== void 0}
2488
+ load={loadOptions && session ? (query, signal) => loadOptions({ query, row: session.row, rowKey: session.rowKey, column: session.column, signal }) : void 0}
2489
+ initialText={session ? resolveTypedStartText(initialValue, session.value) : void 0}
2490
+ cellTop={props.rect?.top ?? 0}
2491
+ cellLeft={props.rect?.left ?? 0}
2492
+ />;
2493
+ }
2438
2494
  case "custom": {
2439
2495
  const current = untrack11(editor);
2440
2496
  if (current?.type !== "custom") {
@@ -2665,6 +2721,9 @@ function ColumnHoverOverlay(props) {
2665
2721
  import { createEffect as createEffect3, createMemo as createMemo9 } from "solid-js";
2666
2722
  import { AUTO_HEIGHT_MAX_ROWS } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
2667
2723
  import { isSearchSelectEditor as isSearchSelectEditor2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectEditorState";
2724
+ import { isMultiSelectEditor as isMultiSelectEditor2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/multiSelect";
2725
+ import { isDateTimeEditor as isDateTimeEditor2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/columnEditor";
2726
+ import { resolveStaticColumnEditor } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/columnEditor";
2668
2727
  import {
2669
2728
  resolveExcelShortcuts,
2670
2729
  usesExcelShortcutCommands
@@ -2693,7 +2752,21 @@ var FEATURE_PROPS = {
2693
2752
  selectSearch: [
2694
2753
  {
2695
2754
  prop: "columns[].editor.search / loadOptions / allowFreeText",
2696
- isUsed: (props) => props.columns.some((column) => isSearchSelectEditor2(column.editor))
2755
+ isUsed: (props) => props.columns.some((column) => isSearchSelectEditor2(resolveStaticColumnEditor(column)))
2756
+ }
2757
+ ],
2758
+ // 追加(1.11.0): time / datetime / date の picker: 'calendar' のエディタ(React 版と同じ)。
2759
+ dateTimeEditors: [
2760
+ {
2761
+ prop: "columns[].editor.type 'time' / 'datetime' / picker: 'calendar'",
2762
+ isUsed: (props) => props.columns.some((column) => isDateTimeEditor2(resolveStaticColumnEditor(column)))
2763
+ }
2764
+ ],
2765
+ // 追加(1.11.0 / 複数選択): multiple: true の select(React 版と同じ)。
2766
+ multiSelect: [
2767
+ {
2768
+ prop: "columns[].editor.multiple",
2769
+ isUsed: (props) => props.columns.some((column) => isMultiSelectEditor2(resolveStaticColumnEditor(column)))
2697
2770
  }
2698
2771
  ],
2699
2772
  // 変更の追跡(React 版と同じ)。
@@ -2963,6 +3036,12 @@ function createShellDevWarningsInDev(args) {
2963
3036
  warnOncePerGrid(treeDataWarned, warning.id, warning.message);
2964
3037
  }
2965
3038
  });
3039
+ const multiSelectWarned = /* @__PURE__ */ new Set();
3040
+ createChangeEffect(args.multiSelectWarnings, (warnings) => {
3041
+ for (const warning of warnings) {
3042
+ warnOncePerGrid(multiSelectWarned, warning.id, warning.message);
3043
+ }
3044
+ });
2966
3045
  if (!args.filteringAvailable) {
2967
3046
  createChangeEffect(
2968
3047
  () => args.globalFilterText().trim() !== "" || args.columnFilterCount() > 0,
@@ -3001,6 +3080,11 @@ var warnHandleCallBeforeMount = (warned, method) => {
3001
3080
  };
3002
3081
 
3003
3082
  // src/SpreadsheetGrid.tsx
3083
+ import { formatCellText } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/cellText";
3084
+ import {
3085
+ describeMultiSelectColumnProblems,
3086
+ mayBeMultiSelectColumn
3087
+ } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/multiSelect";
3004
3088
  var EMPTY_ROWS = [];
3005
3089
  var NEVER_EDITABLE = () => false;
3006
3090
  var NO_TREE_DATA_WARNINGS = [];
@@ -3576,6 +3660,8 @@ function GridShellBody(props, features, mountGate, mode) {
3576
3660
  ].filter((name) => name !== null).join(" / ");
3577
3661
  return missing === "" ? null : { missing };
3578
3662
  },
3663
+ // 追加(1.11.0 / 複数選択): 複数選択の列でこの版では効かない書き方(allowFreeText / fillRow / rowGroup。React 版と同じ)。
3664
+ multiSelectWarnings: () => describeMultiSelectColumnProblems(props.columns),
3579
3665
  // 追加(1.9.0 / ツリーデータ): 一緒に使えないもの・効かない理由と、木の形の問題(親のキーが rows に無い行・循環・同じキーの行)。
3580
3666
  treeDataWarnings: () => {
3581
3667
  const parts = treeDataParts;
@@ -3646,6 +3732,7 @@ function GridShellBody(props, features, mountGate, mode) {
3646
3732
  };
3647
3733
  });
3648
3734
  const conditionalFormatFeature2 = features.conditionalFormat;
3735
+ const multiSelectParts = features.multiSelect;
3649
3736
  const conditionalFormatStats = createMemo10(() => engine.resolveConditionalFormatStats(rowModel(), orderedColumns()));
3650
3737
  const totalRowCells = createMemo10(
3651
3738
  () => totalRowEnabled() ? engine.resolveTotalRowCells({
@@ -4578,6 +4665,8 @@ function GridShellBody(props, features, mountGate, mode) {
4578
4665
  // 条件付き書式の機能が無ければチップもデータバーも描かれないので、値の文字を探す(React 版 1.0.2 / QB-1)。
4579
4666
  conditionalFormat: conditionalFormatFeature2 !== void 0,
4580
4667
  toViewRow: findToViewRow(),
4668
+ // 追加(1.11.0 / 複数選択): 複数選択のセルの文字の区切り(チップの印と同じ位置。React 版と同じ)。
4669
+ multiSelectSeparator: localeTexts().multiSelectSeparator,
4581
4670
  // カレントのヒットへ: クリックと同じ 1 セルの選択 + 見える位置へのスクロール(命令的 API と同じ経路)。
4582
4671
  // 変更(1.9.0 の点検 T3-02 / T6-09): 打っている途中の移動('query')で開いた親は、次の文字の移動で閉じ直す(React 版と同じ)。
4583
4672
  onNavigate: (rowIndex, colIndex, cause) => {
@@ -4903,7 +4992,7 @@ function GridShellBody(props, features, mountGate, mode) {
4903
4992
  ) === true,
4904
4993
  startEdit: edit.startEditWithValue,
4905
4994
  // number の列は確定した文字を半角の数値の表記へ直して編集を始めます(読めない変換は捨てる)。
4906
- resolveEditText: (cell, text) => imeFeature ? imeFeature.resolveImeEditText(untrack13(orderedColumns), cell, text) : text
4995
+ resolveEditText: (cell, text) => imeFeature ? imeFeature.resolveImeEditText(untrack13(orderedColumns), cell, text, untrack13(rowModel)) : text
4907
4996
  };
4908
4997
  },
4909
4998
  "effect",
@@ -5570,6 +5659,17 @@ function GridShellBody(props, features, mountGate, mode) {
5570
5659
  value: getCellValue2(row, column)
5571
5660
  };
5572
5661
  });
5662
+ const editingEditor = createMemo10((previous) => {
5663
+ const column = editingColumn();
5664
+ if (column === void 0) {
5665
+ return void 0;
5666
+ }
5667
+ if (!hasRowEditor(column)) {
5668
+ return resolveStaticColumnEditor2(column);
5669
+ }
5670
+ const session = editingSessionInfo();
5671
+ return session ? resolveColumnEditor(column, session.row) : previous;
5672
+ });
5573
5673
  const portalClassName = () => [themeClassName(), resolvedMotion() === "off" ? MOTION_OFF_CLASS_NAME : void 0].filter(Boolean).join(" ") || void 0;
5574
5674
  const writeRenderedCellValue = (rowKey, column, nextValue) => {
5575
5675
  const viewIndex = engine.gridApi.handle.getViewRowIndex(rowKey);
@@ -5608,8 +5708,12 @@ function GridShellBody(props, features, mountGate, mode) {
5608
5708
  </Show12>;
5609
5709
  };
5610
5710
  const cellTextOf = (row, column) => {
5611
- const value = getCellValue2(row, column);
5612
- return column.valueFormatter ? column.valueFormatter({ value, row, column }) : String(value ?? "");
5711
+ return formatCellText(
5712
+ column,
5713
+ getCellValue2(row, column),
5714
+ row,
5715
+ localeTexts().multiSelectSeparator
5716
+ );
5613
5717
  };
5614
5718
  const splitFind = findFeature2?.splitTextByFindRanges;
5615
5719
  const highlightFind = (content, ranges, findCurrentIndex2) => {
@@ -5623,22 +5727,34 @@ function GridShellBody(props, features, mountGate, mode) {
5623
5727
  </mark> : segment.text;
5624
5728
  });
5625
5729
  };
5626
- const isTextCellColumn = (column) => column.key !== ROW_DRAG_HANDLE_COLUMN_KEY2 && !column.renderCell && column.editor?.type !== "checkbox" && !(conditionalFormatFeature2 && (column.conditionalFormat?.chips !== void 0 || column.conditionalFormat?.dataBar?.showValue === false));
5730
+ const isTextCellColumn = (column) => column.key !== ROW_DRAG_HANDLE_COLUMN_KEY2 && !column.renderCell && !mayHaveEditorType(column, "checkbox") && // 追加(1.11.0 / 複数選択): 複数選択になりうる列はチップを描くので外します(機能があり valueFormatter の無い列)。
5731
+ !(multiSelectParts && column.valueFormatter === void 0 && mayBeMultiSelectColumn(column)) && !(conditionalFormatFeature2 && (column.conditionalFormat?.chips !== void 0 || column.conditionalFormat?.dataBar?.showValue === false));
5627
5732
  const cellText = (row, column, ranges, findCurrentIndex2) => highlightFind(cellTextOf(row, column), ranges, findCurrentIndex2);
5628
- const renderDefaultCellContent = (currentRow, column, cell, treeAggregate) => {
5733
+ const renderDefaultCellContent = (currentRow, column, cell, treeAggregate, notCheckbox = false) => {
5629
5734
  if (column.key === ROW_DRAG_HANDLE_COLUMN_KEY2) {
5630
5735
  return renderRowDragHandleCell(currentRow(), cell);
5631
5736
  }
5632
5737
  const unbound = column;
5633
- if (!column.renderCell && column.editor?.type === "checkbox") {
5634
- const editor = column.editor;
5635
- return <CheckboxCell
5636
- slot={slots().checkbox}
5637
- label={column.title || column.key}
5638
- checked={isCheckboxChecked(getCellValue2(currentRow(), unbound), editor)}
5639
- readOnly={cell.readOnly}
5640
- onToggle={() => cells.toggleCheckbox({ row: cell.rowIndex, col: cell.colIndex })}
5641
- />;
5738
+ const renderCheckbox = (editor) => <CheckboxCell
5739
+ slot={slots().checkbox}
5740
+ label={column.title || column.key}
5741
+ checked={isCheckboxChecked(getCellValue2(currentRow(), unbound), editor())}
5742
+ readOnly={cell.readOnly}
5743
+ onToggle={() => cells.toggleCheckbox({ row: cell.rowIndex, col: cell.colIndex })}
5744
+ />;
5745
+ if (!column.renderCell && !notCheckbox && hasRowEditor(column)) {
5746
+ const checkboxEditor = createMemo10(() => {
5747
+ const editor = resolveColumnEditor(unbound, currentRow());
5748
+ return editor?.type === "checkbox" ? editor : void 0;
5749
+ });
5750
+ const otherwise = renderDefaultCellContent(currentRow, column, cell, treeAggregate, true);
5751
+ return <Show12 when={checkboxEditor() !== void 0} fallback={otherwise}>
5752
+ {renderCheckbox(() => checkboxEditor() ?? {})}
5753
+ </Show12>;
5754
+ }
5755
+ const staticEditor = resolveStaticColumnEditor2(column);
5756
+ if (!column.renderCell && staticEditor?.type === "checkbox") {
5757
+ return renderCheckbox(() => staticEditor);
5642
5758
  }
5643
5759
  if (column.renderCell) {
5644
5760
  const cellValue = createMemo10(() => getCellValue2(currentRow(), unbound));
@@ -5725,6 +5841,26 @@ function GridShellBody(props, features, mountGate, mode) {
5725
5841
  textOf(currentRow());
5726
5842
  return null;
5727
5843
  }
5844
+ if (multiSelectParts && unbound.valueFormatter === void 0 && mayBeMultiSelectColumn(unbound)) {
5845
+ const { MultiSelectChips, resolveChipLabels, splitRangesByChips: splitRangesByChips2 } = multiSelectParts;
5846
+ const labels = createMemo10(() => {
5847
+ const row = currentRow();
5848
+ return resolveChipLabels(resolveColumnEditor(unbound, row), getCellValue2(row, unbound), row);
5849
+ });
5850
+ const separator = () => localeTexts().multiSelectSeparator;
5851
+ const chipRanges = createMemo10(() => {
5852
+ const list = labels();
5853
+ const ranges = cell.findRanges;
5854
+ return list && ranges && ranges.length > 0 ? splitRangesByChips2(list, separator().length, ranges) : void 0;
5855
+ });
5856
+ return <Show12 when={labels()} fallback={<span class="ssg-cell-value">{highlightCellFind(textOf(currentRow()))}</span>}>
5857
+ {(list) => <MultiSelectChips
5858
+ labels={list()}
5859
+ separator={separator()}
5860
+ renderLabel={(label, index) => highlightFind(label, chipRanges()?.[index], findCurrentIndex2)}
5861
+ />}
5862
+ </Show12>;
5863
+ }
5728
5864
  const chips = formatRules?.chips;
5729
5865
  if (conditionalFormatFeature2 && chips) {
5730
5866
  const { GridChip: GridChip2, resolveChipSpec: resolveChipSpec2 } = conditionalFormatFeature2;
@@ -5849,6 +5985,7 @@ function GridShellBody(props, features, mountGate, mode) {
5849
5985
  showCellOverflowTooltip={props.showCellOverflowTooltip ?? false}
5850
5986
  conditionalFormat={conditionalFormatFeature2}
5851
5987
  conditionalFormatStats={conditionalFormatStats()}
5988
+ multiSelect={multiSelectParts}
5852
5989
  slots={slots()}
5853
5990
  onPointerEnter={clearHoveredRow}
5854
5991
  />}
@@ -6029,12 +6166,14 @@ function GridShellBody(props, features, mountGate, mode) {
6029
6166
  leadingWidth={leadingWidth()}
6030
6167
  baseOffset={vertical().overlayBaseOffset}
6031
6168
  initialValue={() => view().editorInitialValue ?? store.getViewState().editorInitialValue ?? ""}
6032
- editor={editingColumn()?.editor}
6169
+ editor={editingEditor()}
6033
6170
  session={editingSessionInfo()}
6034
6171
  themeClassName={portalClassName()}
6035
6172
  slots={slots()}
6036
6173
  onCommit={(value, direction, option, forwardText) => edit.commitEdit(value, direction, option, forwardText)}
6037
6174
  SearchSelectEditor={features.selectSearch?.SearchSelectCellEditor}
6175
+ DateTimeEditor={features.dateTimeEditors?.DateTimeCellEditor}
6176
+ MultiSelectEditor={features.multiSelect?.MultiSelectCellEditor}
6038
6177
  onCancel={edit.cancelEdit}
6039
6178
  onCommitToSelection={fillSelectionEnabled() ? engine.excelShortcuts.commitToSelection : void 0}
6040
6179
  onRegisterFlush={edit.registerDraftFlush}
@@ -8116,6 +8255,7 @@ import {
8116
8255
  resolveOpenedFilterColumn
8117
8256
  } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/filterPopoverController";
8118
8257
  import { inferColumnFilterType } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/inferFilterType";
8258
+ import { resolveStaticColumnEditor as resolveStaticColumnEditor3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/columnEditor";
8119
8259
  import { getCellValue as getCellValue3 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
8120
8260
  import { GROUP_AUTO_COLUMN_KEY } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/grouping";
8121
8261
  var NO_GROUP_COLUMNS = [];
@@ -8134,7 +8274,8 @@ function createFilterPopover(inputs) {
8134
8274
  const rows = inputs.rows();
8135
8275
  const isLabelRow = inputs.isLabelRow?.();
8136
8276
  const result = inferColumnFilterType({
8137
- editorType: column.editor?.type,
8277
+ // 変更(1.11.0 / 行ごとのエディタ): 行の無い所なので、列の editor で推定します(editorForRow は見ない)。
8278
+ editorType: resolveStaticColumnEditor3(column)?.type,
8138
8279
  isServerSide: inputs.isServerSide(),
8139
8280
  rowCount: rows.length,
8140
8281
  // ラベル行は空として数えます(見出しの文字で数値の列が文字の列に推定されないように)。
@@ -8359,6 +8500,7 @@ import {
8359
8500
  resolveSyncSelectOptions,
8360
8501
  selectCollectorResult
8361
8502
  } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/selectOptionsCollector";
8503
+ import { resolveMultiSelectFilterOptions } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/multiSelect";
8362
8504
  import {
8363
8505
  createAsyncSelectOptionsSource,
8364
8506
  selectAsyncOptionsResult
@@ -8442,7 +8584,9 @@ function ColumnFilterPopoverHost(props) {
8442
8584
  rowCount: optionRows().length,
8443
8585
  getRawValueAt: getOpenedColumnRawValueAt(),
8444
8586
  numeric: numeric(),
8445
- sourceKey: sourceKey()
8587
+ sourceKey: sourceKey(),
8588
+ // 追加(1.11.0 / 複数選択): 複数選択の列は配列を要素ごとに集める(名前と並びは候補から)。
8589
+ multiOptions: resolveMultiSelectFilterOptions(collectColumn())
8446
8590
  }), "render", "filterValueCollector");
8447
8591
  const collectorSnapshot = createExternalStoreSignal(collector, "filterValueStore");
8448
8592
  const optionsResult = createMemo21(() => {
@@ -8634,10 +8778,11 @@ function GridFilterChipBar(props) {
8634
8778
  import { createEffect as createEffect8, createMemo as createMemo22 } from "solid-js";
8635
8779
  import { createLazyModule } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/lazyModule";
8636
8780
  import { scheduleIdleTask } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/scheduler";
8637
- var filterPopoverModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/ColumnFilterPopover-D7INPNVB.jsx"));
8638
- var toolPanelModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/toolPanelViews-BRH5PCOI.jsx"));
8781
+ var filterPopoverModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/ColumnFilterPopover-JL3HPGXY.jsx"));
8782
+ var toolPanelModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/toolPanelViews-N6TGBFFW.jsx"));
8783
+ var dateEditorCalendarModule = /* @__PURE__ */ createLazyModule(() => import("./chunks/DateEditorCalendar-FVUNVD7Y.jsx"));
8639
8784
  var preloadGridPopups = async () => {
8640
- await Promise.all([filterPopoverModule.load(), toolPanelModule.load()]);
8785
+ await Promise.all([filterPopoverModule.load(), toolPanelModule.load(), dateEditorCalendarModule.load()]);
8641
8786
  };
8642
8787
  var reportLoadError = (error) => {
8643
8788
  console.error("[SpreadsheetGrid] \u30DD\u30C3\u30D7\u30AA\u30FC\u30D0\u30FC\u90E8\u54C1\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\n[SpreadsheetGrid] Failed to load the popup components.", error);
@@ -9409,10 +9554,13 @@ import { For as For13, Show as Show25, createMemo as createMemo27 } from "solid-
9409
9554
  import { resolveSlotProps as resolveSlotProps3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/slotProps";
9410
9555
  import { isSyntheticColumnKey as isSyntheticColumnKey4 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/detailRow";
9411
9556
  import { isCheckboxChecked as isCheckboxChecked2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/checkboxEditor";
9557
+ import { resolveColumnEditor as resolveColumnEditor2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/columnEditor";
9412
9558
  import { formatLocaleText as formatLocaleText14 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
9413
9559
  import { getCellValue as getCellValue5 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/permissions";
9560
+ import { formatCellText as formatCellText2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/cellText";
9414
9561
  var noop4 = () => {
9415
9562
  };
9563
+ var plainLabel = (label) => label;
9416
9564
  var PIN_ICON_PATH = "M9.8 1.5 14.5 6.2l-1.4 1.4-1-.9-2.6 2.6.3 3.2-1.4 1.4-2.6-2.6-3.3 3.3-.7-.7 3.3-3.3L2.5 8l1.4-1.4 3.2.3 2.6-2.6-.9-1z";
9417
9565
  function GridPinnedRows(props) {
9418
9566
  const texts = useFeatureLocaleText();
@@ -9535,11 +9683,12 @@ function GridPinnedRows(props) {
9535
9683
  if (current.renderCell) {
9536
9684
  return current.renderCell({ ...context, tree: void 0, setValue: noop4 });
9537
9685
  }
9538
- if (current.editor?.type === "checkbox") {
9686
+ const cellEditor = resolveColumnEditor2(current, context.row);
9687
+ if (cellEditor?.type === "checkbox") {
9539
9688
  return <CheckboxCell
9540
9689
  slot={props.slots.checkbox}
9541
9690
  label={current.title || current.key}
9542
- checked={isCheckboxChecked2(context.value, current.editor)}
9691
+ checked={isCheckboxChecked2(context.value, cellEditor)}
9543
9692
  readOnly
9544
9693
  onToggle={noop4}
9545
9694
  />;
@@ -9549,7 +9698,16 @@ function GridPinnedRows(props) {
9549
9698
  if (format?.dataBar?.showValue === false) {
9550
9699
  return null;
9551
9700
  }
9552
- const text = current.valueFormatter ? current.valueFormatter({ value: context.value, row: context.row, column: current }) : String(context.value ?? "");
9701
+ const multiSelect = props.multiSelect;
9702
+ const chipLabels = multiSelect && current.valueFormatter === void 0 ? multiSelect.resolveChipLabels(cellEditor, context.value, context.row) : void 0;
9703
+ if (multiSelect && chipLabels !== void 0) {
9704
+ return <multiSelect.MultiSelectChips
9705
+ labels={chipLabels}
9706
+ separator={texts().multiSelectSeparator}
9707
+ renderLabel={plainLabel}
9708
+ />;
9709
+ }
9710
+ const text = formatCellText2(current, context.value, context.row, texts().multiSelectSeparator);
9553
9711
  const chips = unbound().conditionalFormat?.chips;
9554
9712
  const chip = feature && chips ? feature.resolveChipSpec(chips, context) : null;
9555
9713
  if (feature && chip) {
@@ -10327,6 +10485,875 @@ var selectSearchFeature = {
10327
10485
  localeText: DEFAULT_SELECT_SEARCH_LOCALE_TEXT
10328
10486
  };
10329
10487
 
10488
+ // src/features/dateTimeEditors.ts
10489
+ import { DEFAULT_DATE_TIME_EDITORS_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
10490
+
10491
+ // src/editors/DateTimeCellEditor.tsx
10492
+ import { For as For16, Show as Show28, createEffect as createEffect12, createMemo as createMemo31, createRenderEffect as createRenderEffect8, createSignal as createSignal18, createUniqueId as createUniqueId7, onCleanup as onCleanup14, onSettled as onSettled10, untrack as untrack21 } from "solid-js";
10493
+ import { Portal as Portal6 } from "@solidjs/web";
10494
+ import { handleEditorKeyDown as handleEditorKeyDown4 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
10495
+ import { formatLocaleText as formatLocaleText16 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
10496
+ import { isImeComposingKeyEvent as isImeComposingKeyEvent5 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
10497
+ import { toDateInputValue as toDateInputValue2 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorValues";
10498
+ import { toDateTimeValue, toTimeValue } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateTimeValues";
10499
+ import {
10500
+ centerTimeListRow,
10501
+ isCoarsePointer,
10502
+ placeDateTimePopup,
10503
+ resolveDateTimeTypedText,
10504
+ resolveDefaultTime,
10505
+ resolveTimePartRange,
10506
+ resolveTimeStep
10507
+ } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateTimeEditor";
10508
+ import {
10509
+ resolveSelectListWindow as resolveSelectListWindow2,
10510
+ revealSelectListRow as revealSelectListRow2
10511
+ } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectSearch";
10512
+ import {
10513
+ computeSelectPopoverPlacement as computeSelectPopoverPlacement3,
10514
+ resolveSelectOptionRowHeight as resolveSelectOptionRowHeight3
10515
+ } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectEditorState";
10516
+ import { withAnchorVisibility as withAnchorVisibility3 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/editorVisibleBounds";
10517
+ import {
10518
+ createDateTimeEditorController
10519
+ } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/dateTimeEditorController";
10520
+ var TIME_LIST_MIN_WIDTH = 96;
10521
+ function DateTimeCellEditor(props) {
10522
+ const kind = untrack21(() => props.editor.type);
10523
+ const defaultTime = resolveDefaultTime(untrack21(() => props.editor.type === "datetime" ? props.editor.defaultTime : void 0));
10524
+ const typedText = untrack21(() => resolveDateTimeTypedText(kind, props.initialValue, props.value, defaultTime));
10525
+ if (typedText === void 0 && isCoarsePointer()) {
10526
+ if (kind === "date") {
10527
+ return <DateCellEditor
10528
+ ariaLabel={props.ariaLabel}
10529
+ enterMove={props.enterMove}
10530
+ initialValue={toDateInputValue2(untrack21(() => props.value))}
10531
+ onCommit={(value, direction) => props.onCommit(value, direction)}
10532
+ onCancel={() => props.onCancel()}
10533
+ onCommitToSelection={props.onCommitToSelection}
10534
+ onRegisterFlush={(flush) => props.onRegisterFlush?.(flush)}
10535
+ align={props.align}
10536
+ cellHeight={props.cellHeight}
10537
+ alignTop={props.alignTop}
10538
+ />;
10539
+ }
10540
+ return <NativeDateTimeEditor {...props} kind={kind} defaultTime={defaultTime} />;
10541
+ }
10542
+ return <TypedDateTimeEditor {...props} kind={kind} defaultTime={defaultTime} typedText={typedText} />;
10543
+ }
10544
+ function NativeDateTimeEditor(props) {
10545
+ const [input, setInput] = createSignal18();
10546
+ const [error, setError] = createSignal18(null);
10547
+ createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
10548
+ const kind = untrack21(() => props.kind);
10549
+ const startValue = untrack21(
10550
+ () => kind === "time" ? toTimeValue(props.value) : toDateTimeValue(props.value, props.defaultTime)
10551
+ );
10552
+ const step = resolveTimeStep(untrack21(() => props.editor.type === "date" ? void 0 : props.editor.step));
10553
+ let edited = false;
10554
+ const resolveValue = (current) => edited ? current : untrack21(() => props.value);
10555
+ let disposed = false;
10556
+ onCleanup14(() => {
10557
+ disposed = true;
10558
+ });
10559
+ props.onRegisterFlush?.(() => {
10560
+ untrack21(() => {
10561
+ const element = input();
10562
+ if (element && edited) {
10563
+ props.onCommit(element.value);
10564
+ }
10565
+ });
10566
+ });
10567
+ onSettled10(() => {
10568
+ untrack21(input)?.focus();
10569
+ });
10570
+ return <>
10571
+ <input
10572
+ ref={setInput}
10573
+ type={kind === "time" ? "time" : "datetime-local"}
10574
+ step={step * 60}
10575
+ value={startValue}
10576
+ onInput={() => {
10577
+ edited = true;
10578
+ setError(null);
10579
+ }}
10580
+ onKeyDown={(event) => handleEditorKeyDown4(toEditorKeyEvent(event), {
10581
+ value: event.currentTarget.value,
10582
+ onCommit: (current, direction) => props.onCommit(resolveValue(current), direction),
10583
+ onCancel: () => props.onCancel(),
10584
+ onRejected: setError,
10585
+ enterMove: props.enterMove,
10586
+ onCommitToSelection: props.onCommitToSelection === void 0 ? void 0 : (current) => props.onCommitToSelection?.(resolveValue(current)),
10587
+ blockHomeEnd: true
10588
+ })}
10589
+ onBlur={(event) => {
10590
+ if (disposed) {
10591
+ return;
10592
+ }
10593
+ const result = props.onCommit(resolveValue(event.currentTarget.value));
10594
+ if (result && result.status === "rejected") {
10595
+ props.onCancel();
10596
+ }
10597
+ }}
10598
+ aria-label={props.ariaLabel}
10599
+ aria-invalid={error() !== null ? "true" : void 0}
10600
+ class={["ssg-cell-editor-input", { "ssg-cell-editor-input--invalid": error() !== null }]}
10601
+ style={props.align ? { "text-align": props.align } : void 0}
10602
+ />
10603
+ <CellEditorError message={error()} />
10604
+ </>;
10605
+ }
10606
+ var samePlacement = (a, b) => a === b || a !== null && b !== null && a.left === b.left && a.top === b.top && a.width === b.width && a.maxHeight === b.maxHeight && a.hidden === b.hidden;
10607
+ function TypedDateTimeEditor(props) {
10608
+ const texts = useFeatureLocaleText();
10609
+ const portal = useGridPortal();
10610
+ const kind = untrack21(() => props.kind);
10611
+ const editor = untrack21(() => props.editor);
10612
+ const typedText = untrack21(() => props.typedText);
10613
+ const invalidMessage = () => kind === "date" ? texts().enterDate : kind === "time" ? texts().enterTime : texts().enterDateTime;
10614
+ const [input, setInput] = createSignal18();
10615
+ const [popover, setPopover] = createSignal18();
10616
+ const [scroller, setScroller] = createSignal18();
10617
+ createTopAlignedInput(input, () => props.alignTop ?? false, () => props.cellHeight ?? 0);
10618
+ const popupId = createUniqueId7();
10619
+ const handlers = {
10620
+ onCommit: (value, direction) => props.onCommit(value, direction),
10621
+ onCancel: () => props.onCancel(),
10622
+ get onCommitToSelection() {
10623
+ const toSelection = props.onCommitToSelection;
10624
+ return toSelection === void 0 ? void 0 : (value) => toSelection(value);
10625
+ },
10626
+ get invalidMessage() {
10627
+ return invalidMessage();
10628
+ },
10629
+ get invalidTimeMessage() {
10630
+ return texts().enterTime;
10631
+ }
10632
+ };
10633
+ const controller = untrack21(
10634
+ () => createDateTimeEditorController({
10635
+ kind,
10636
+ value: props.value,
10637
+ initialText: typedText,
10638
+ defaultTime: props.defaultTime,
10639
+ step: editor.type === "date" ? void 0 : editor.step,
10640
+ list: editor.type === "time" && editor.picker === "list",
10641
+ invalidMessage: invalidMessage(),
10642
+ onCommit: handlers.onCommit,
10643
+ onCancel: handlers.onCancel
10644
+ })
10645
+ );
10646
+ controller.setHandlers(handlers);
10647
+ const [snapshot2, setSnapshot] = createSignal18(controller.getSnapshot(), { name: "dateTimeEditorSnapshot" });
10648
+ onCleanup14(controller.subscribe(() => setSnapshot(controller.getSnapshot())));
10649
+ props.onRegisterFlush?.(controller.flush);
10650
+ const hasCalendar = kind !== "time";
10651
+ const hasList = editor.type === "time" && editor.picker === "list";
10652
+ const timeInput = editor.type === "datetime" && editor.timeInput === true;
10653
+ const popupWanted = hasCalendar || hasList;
10654
+ const calendarViews = createLazyModuleSignal(
10655
+ dateEditorCalendarModule,
10656
+ { needed: () => hasCalendar, prefetch: () => false },
10657
+ "dateEditorCalendar"
10658
+ );
10659
+ const popupReady = () => hasList || hasCalendar && calendarViews() !== null;
10660
+ const rowHeight = resolveSelectOptionRowHeight3();
10661
+ const listCount = controller.timeList.length;
10662
+ const viewportHeight = Math.min(listCount, 8) * rowHeight;
10663
+ const [placement2, setPlacement] = createSignal18(null);
10664
+ const [scrollTop, setScrollTop] = createSignal18(0);
10665
+ const measure = () => {
10666
+ const anchor = untrack21(input);
10667
+ if (!anchor) {
10668
+ return;
10669
+ }
10670
+ const rect = anchor.getBoundingClientRect();
10671
+ let next;
10672
+ if (hasList) {
10673
+ next = withAnchorVisibility3(
10674
+ anchor,
10675
+ computeSelectPopoverPlacement3(rect, listCount, window.innerWidth, window.innerHeight, rowHeight, TIME_LIST_MIN_WIDTH)
10676
+ );
10677
+ } else {
10678
+ const element = untrack21(popover);
10679
+ if (!element) {
10680
+ return;
10681
+ }
10682
+ next = withAnchorVisibility3(
10683
+ anchor,
10684
+ placeDateTimePopup(rect, { width: element.offsetWidth, height: element.offsetHeight }, window.innerWidth, window.innerHeight)
10685
+ );
10686
+ }
10687
+ if (!samePlacement(untrack21(placement2), next)) {
10688
+ setPlacement(next);
10689
+ }
10690
+ };
10691
+ let disposed = false;
10692
+ onCleanup14(() => {
10693
+ disposed = true;
10694
+ });
10695
+ onSettled10(() => {
10696
+ const element = untrack21(input);
10697
+ if (element) {
10698
+ element.focus();
10699
+ if (typedText === void 0) {
10700
+ element.select();
10701
+ } else {
10702
+ element.setSelectionRange(element.value.length, element.value.length);
10703
+ }
10704
+ }
10705
+ if (!popupWanted) {
10706
+ return void 0;
10707
+ }
10708
+ window.addEventListener("resize", measure);
10709
+ window.addEventListener("scroll", measure, true);
10710
+ return () => {
10711
+ window.removeEventListener("resize", measure);
10712
+ window.removeEventListener("scroll", measure, true);
10713
+ };
10714
+ });
10715
+ createEffect12(
10716
+ () => [popover(), snapshot2(), popupReady(), props.cellTop ?? 0, props.cellLeft ?? 0],
10717
+ outsideGraphApply(([element, , ready]) => {
10718
+ if (popupWanted && ready && (hasList || element)) {
10719
+ measure();
10720
+ }
10721
+ }),
10722
+ { name: "dateTimeEditorMeasure" }
10723
+ );
10724
+ const opened = () => placement2() !== null;
10725
+ let lastAnchor = null;
10726
+ createEffect12(
10727
+ () => [scroller(), opened(), snapshot2().listAnchor],
10728
+ outsideGraphApply(([element, isOpened, anchor]) => {
10729
+ if (!hasList || !isOpened || !element) {
10730
+ return;
10731
+ }
10732
+ const first = lastAnchor === null;
10733
+ if (!first && lastAnchor === anchor) {
10734
+ return;
10735
+ }
10736
+ lastAnchor = anchor;
10737
+ const next = first ? centerTimeListRow(anchor, viewportHeight, rowHeight, listCount) : revealSelectListRow2(anchor, element.scrollTop, viewportHeight, rowHeight);
10738
+ if (next !== element.scrollTop) {
10739
+ element.scrollTop = next;
10740
+ }
10741
+ setScrollTop(next);
10742
+ }),
10743
+ { name: "dateTimeEditorRevealTime" }
10744
+ );
10745
+ const focusInsideEditor = (next) => next instanceof Node && (untrack21(input)?.contains(next) === true || untrack21(popover)?.contains(next) === true);
10746
+ const handleBlur = (event) => {
10747
+ if (!disposed && !focusInsideEditor(event.relatedTarget)) {
10748
+ controller.blur();
10749
+ }
10750
+ };
10751
+ const handleKeyDown = (event, target) => {
10752
+ if (isImeComposingKeyEvent5(event)) {
10753
+ return;
10754
+ }
10755
+ if (target === "time") {
10756
+ controller.keyDownTime(toEditorKeyEvent(event), props.enterMove);
10757
+ } else {
10758
+ controller.keyDown(toEditorKeyEvent(event), props.enterMove);
10759
+ }
10760
+ };
10761
+ const notice = () => snapshot2().notice;
10762
+ const noticeInPopup = () => {
10763
+ const current = placement2();
10764
+ return notice() !== null && popupWanted && popupReady() && current !== null && current.hidden !== true;
10765
+ };
10766
+ const highlight = () => snapshot2().listHighlight;
10767
+ const activeId = () => hasList && opened() && highlight() >= 0 ? `${popupId}-${highlight()}` : void 0;
10768
+ const label = () => formatLocaleText16(hasList ? texts().timeEditorList : texts().dateEditorCalendar, { column: props.columnTitle });
10769
+ const visible = createMemo31(() => {
10770
+ const window_ = resolveSelectListWindow2(scrollTop(), viewportHeight, rowHeight, listCount);
10771
+ return controller.timeList.slice(window_.start, window_.end).map((time, offset) => ({ time, index: window_.start + offset }));
10772
+ });
10773
+ const mount = () => popupWanted && popupReady() ? portal.container() : null;
10774
+ const startText = untrack21(() => snapshot2().text);
10775
+ const noticeNode = () => <Show28 when={notice() !== null}>
10776
+ <div class="ssg-date-editor-notice" role="alert">
10777
+ {notice()}
10778
+ </div>
10779
+ </Show28>;
10780
+ const view = <>
10781
+ <input
10782
+ ref={setInput}
10783
+ type="text"
10784
+ value={startText}
10785
+ inputmode={kind === "time" ? "numeric" : void 0}
10786
+ onInput={(event) => controller.input(event.currentTarget.value, event.isComposing)}
10787
+ onCompositionEnd={(event) => controller.input(event.currentTarget.value, false)}
10788
+ onKeyDown={(event) => handleKeyDown(event, "date")}
10789
+ onBlur={handleBlur}
10790
+ role={popupWanted ? "combobox" : void 0}
10791
+ aria-haspopup={hasCalendar ? "dialog" : hasList ? "listbox" : void 0}
10792
+ aria-expanded={popupWanted ? opened() ? "true" : "false" : void 0}
10793
+ aria-controls={popupWanted && opened() ? popupId : void 0}
10794
+ aria-activedescendant={activeId()}
10795
+ aria-label={props.ariaLabel}
10796
+ aria-invalid={notice() !== null ? "true" : void 0}
10797
+ autocomplete="off"
10798
+ spellcheck="false"
10799
+ class={[
10800
+ "ssg-cell-editor-input",
10801
+ "ssg-cell-editor-input--date-time",
10802
+ { "ssg-cell-editor-input--invalid": notice() !== null }
10803
+ ]}
10804
+ style={props.align ? { "text-align": props.align } : void 0}
10805
+ />
10806
+ <CellEditorError message={noticeInPopup() ? null : notice()} />
10807
+ <Show28 when={mount()}>
10808
+ {(container) => <Portal6 mount={container()}>
10809
+ <div
10810
+ ref={setPopover}
10811
+ id={hasCalendar ? popupId : void 0}
10812
+ role={hasCalendar ? "dialog" : void 0}
10813
+ aria-label={hasCalendar ? label() : void 0}
10814
+ class={[
10815
+ "ssg-select-editor-popover",
10816
+ "ssg-date-editor-popover",
10817
+ hasCalendar ? "ssg-date-editor-popover--calendar" : "ssg-date-editor-popover--times",
10818
+ props.themeClassName,
10819
+ props.popoverSlot?.className
10820
+ ]}
10821
+ style={{
10822
+ ...props.popoverSlot?.style,
10823
+ left: px(placement2()?.left ?? 0),
10824
+ top: px(placement2()?.top ?? 0),
10825
+ width: placement2()?.width !== void 0 ? px(placement2()?.width ?? 0) : void 0,
10826
+ "max-height": placement2()?.maxHeight !== void 0 ? px(placement2()?.maxHeight ?? 0) : void 0,
10827
+ visibility: placement2() === null || placement2()?.hidden ? "hidden" : void 0
10828
+ }}
10829
+ onPointerDown={(event) => {
10830
+ if (!(event.target instanceof HTMLInputElement)) {
10831
+ event.preventDefault();
10832
+ }
10833
+ }}
10834
+ >
10835
+ <Show28
10836
+ when={hasCalendar ? calendarViews() : null}
10837
+ fallback={<Show28 when={hasList}>
10838
+ {noticeNode()}
10839
+ <div
10840
+ ref={setScroller}
10841
+ role="listbox"
10842
+ id={popupId}
10843
+ aria-label={label()}
10844
+ class="ssg-select-editor-scroller"
10845
+ style={{ height: px(viewportHeight) }}
10846
+ onScroll={(event) => setScrollTop(event.currentTarget.scrollTop)}
10847
+ >
10848
+ <div class="ssg-select-editor-rows" role="presentation" style={{ height: px(listCount * rowHeight) }}>
10849
+ <For16 each={visible()} keyed={false}>
10850
+ {(item) => <div
10851
+ id={`${popupId}-${item().index}`}
10852
+ role="option"
10853
+ aria-selected={item().index === highlight() ? "true" : "false"}
10854
+ aria-setsize={listCount}
10855
+ aria-posinset={item().index + 1}
10856
+ class={[
10857
+ "ssg-select-editor-option",
10858
+ { "ssg-select-editor-option--highlighted": item().index === highlight() }
10859
+ ]}
10860
+ style={{ top: px(item().index * rowHeight) }}
10861
+ onClick={() => controller.chooseTime(untrack21(item).index)}
10862
+ >
10863
+ {item().time}
10864
+ </div>}
10865
+ </For16>
10866
+ </div>
10867
+ </div>
10868
+ </Show28>}
10869
+ >
10870
+ {(views) => {
10871
+ const Calendar = untrack21(views).DateEditorCalendar;
10872
+ return <Calendar
10873
+ controller={controller}
10874
+ snapshot={snapshot2()}
10875
+ timeInput={timeInput}
10876
+ timeInputLabel={texts().dateTimeEditorTime}
10877
+ onTimeKeyDown={(event) => handleKeyDown(event, "time")}
10878
+ onTimeBlur={handleBlur}
10879
+ notice={noticeNode()}
10880
+ />;
10881
+ }}
10882
+ </Show28>
10883
+ </div>
10884
+ </Portal6>}
10885
+ </Show28>
10886
+ </>;
10887
+ createPortalTokens(popover, () => props.themeClassName, placement2);
10888
+ createRenderEffect8(
10889
+ () => [input(), snapshot2().text],
10890
+ ([element, text]) => {
10891
+ if (element && element.value !== text) {
10892
+ element.value = text;
10893
+ }
10894
+ },
10895
+ { name: "dateTimeEditorInputText" }
10896
+ );
10897
+ const timeSelection = createMemo31(() => snapshot2().timeSelection);
10898
+ createRenderEffect8(
10899
+ () => [input(), timeSelection()],
10900
+ ([element, timeSelection2]) => {
10901
+ if (!element || timeSelection2 === 0) {
10902
+ return;
10903
+ }
10904
+ const text = untrack21(() => snapshot2().text);
10905
+ if (element.value !== text) {
10906
+ element.value = text;
10907
+ }
10908
+ const range = resolveTimePartRange(text);
10909
+ if (range) {
10910
+ element.setSelectionRange(range[0], range[1]);
10911
+ }
10912
+ },
10913
+ { name: "dateTimeEditorTimeSelection" }
10914
+ );
10915
+ return view;
10916
+ }
10917
+
10918
+ // src/features/dateTimeEditors.ts
10919
+ var dateTimeEditorsFeature = {
10920
+ DateTimeCellEditor,
10921
+ localeText: DEFAULT_DATE_TIME_EDITORS_LOCALE_TEXT
10922
+ };
10923
+
10924
+ // src/features/multiSelect.ts
10925
+ import { DEFAULT_MULTI_SELECT_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
10926
+ import {
10927
+ resolveMultiSelectChipLabels,
10928
+ splitRangesByChips
10929
+ } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/multiSelect";
10930
+
10931
+ // src/editors/MultiSelectCellEditor.tsx
10932
+ import { For as For17, Show as Show29, createEffect as createEffect13, createMemo as createMemo32, createRenderEffect as createRenderEffect9, createSignal as createSignal19, createUniqueId as createUniqueId8, onCleanup as onCleanup15, onSettled as onSettled11, untrack as untrack22 } from "solid-js";
10933
+ import { Portal as Portal7 } from "@solidjs/web";
10934
+ import {
10935
+ computeSelectPopoverPlacement as computeSelectPopoverPlacement4,
10936
+ resolveSelectOptionRowHeight as resolveSelectOptionRowHeight4,
10937
+ SELECT_SEARCH_POPOVER_MIN_WIDTH as SELECT_SEARCH_POPOVER_MIN_WIDTH2,
10938
+ createPointerMoveFilter as createPointerMoveFilter3
10939
+ } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectEditorState";
10940
+ import { withAnchorVisibility as withAnchorVisibility4 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/editorVisibleBounds";
10941
+ import { revealOverflowTitle as revealOverflowTitle3 } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/overflowTitle";
10942
+ import {
10943
+ resolveSelectListWindow as resolveSelectListWindow3,
10944
+ revealSelectListRow as revealSelectListRow3,
10945
+ splitSelectSearchText as splitSelectSearchText2
10946
+ } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectSearch";
10947
+ import { createMultiSelectEditorController } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/multiSelectEditorController";
10948
+ import { MULTI_SELECT_VISIBLE_ROWS } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/multiSelect";
10949
+ import { isImeComposingKeyEvent as isImeComposingKeyEvent6 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
10950
+ import { isCommitToSelectionKey as isCommitToSelectionKey3 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
10951
+ function MatchedText2(props) {
10952
+ const parts = createMemo32(() => splitSelectSearchText2(props.text, props.range));
10953
+ return <For17 each={parts()} keyed={false}>
10954
+ {(part) => <Show29 when={part().match} fallback={part().text}>
10955
+ <mark class="ssg-select-editor-match">{part().text}</mark>
10956
+ </Show29>}
10957
+ </For17>;
10958
+ }
10959
+ var SVG_NOT_FOCUSABLE6 = { focusable: "false" };
10960
+ function CheckIcon() {
10961
+ return <svg
10962
+ viewBox="0 0 12 12"
10963
+ fill="none"
10964
+ stroke="currentColor"
10965
+ stroke-width="1.8"
10966
+ stroke-linecap="round"
10967
+ stroke-linejoin="round"
10968
+ {...SVG_NOT_FOCUSABLE6}
10969
+ >
10970
+ <path d="M2.6 6.3 4.9 8.6 9.4 3.7" />
10971
+ </svg>;
10972
+ }
10973
+ function MultiSelectCellEditor(props) {
10974
+ const texts = useFeatureLocaleText();
10975
+ const portal = useGridPortal();
10976
+ const [box, setBox] = createSignal19();
10977
+ const [input, setInput] = createSignal19();
10978
+ const [scroller, setScroller] = createSignal19();
10979
+ const [popover, setPopover] = createSignal19();
10980
+ const listId = createUniqueId8();
10981
+ const pointerMoved = createPointerMoveFilter3();
10982
+ const [error, setError] = createSignal19(null);
10983
+ const search = untrack22(() => props.search);
10984
+ const hint = () => search ? texts().multiSelectSearchHint : texts().multiSelectHint;
10985
+ const commitWithResult = (committed, direction) => {
10986
+ const result = props.onCommit(committed, direction);
10987
+ if (result && result.status === "rejected") {
10988
+ setError(result.message);
10989
+ }
10990
+ return result;
10991
+ };
10992
+ const controller = untrack22(
10993
+ () => createMultiSelectEditorController({
10994
+ options: props.options,
10995
+ value: props.value,
10996
+ initialText: props.initialText,
10997
+ search,
10998
+ load: props.load ? (query, signal) => props.load(query, signal) : void 0,
10999
+ onCommit: commitWithResult,
11000
+ onCancel: () => props.onCancel()
11001
+ })
11002
+ );
11003
+ const [snapshot2, setSnapshot] = createSignal19(controller.getSnapshot(), { name: "multiSelectSnapshot" });
11004
+ createEffect13(
11005
+ () => props.options,
11006
+ outsideGraphApply((options) => controller.setOptions(options)),
11007
+ { name: "multiSelectOptions" }
11008
+ );
11009
+ props.onRegisterFlush?.(controller.flush);
11010
+ const rowHeight = resolveSelectOptionRowHeight4();
11011
+ const [placement2, setPlacement] = createSignal19(null);
11012
+ const [scrollTop, setScrollTop] = createSignal19(0);
11013
+ const listRows = createMemo32(() => Math.max(snapshot2().results.length, 1));
11014
+ const visibleRows = createMemo32(() => Math.min(listRows(), MULTI_SELECT_VISIBLE_ROWS));
11015
+ const viewportHeight = createMemo32(() => visibleRows() * rowHeight);
11016
+ const measure = () => {
11017
+ const element = untrack22(box);
11018
+ if (!element) {
11019
+ return;
11020
+ }
11021
+ setPlacement(
11022
+ withAnchorVisibility4(
11023
+ element,
11024
+ computeSelectPopoverPlacement4(
11025
+ element.getBoundingClientRect(),
11026
+ untrack22(visibleRows) + 1,
11027
+ window.innerWidth,
11028
+ window.innerHeight,
11029
+ rowHeight,
11030
+ SELECT_SEARCH_POPOVER_MIN_WIDTH2
11031
+ )
11032
+ )
11033
+ );
11034
+ };
11035
+ const reveal = (element, height) => {
11036
+ if (!element) {
11037
+ return;
11038
+ }
11039
+ const current = controller.getSnapshot().highlight;
11040
+ const next = current < 0 ? 0 : revealSelectListRow3(current, element.scrollTop, height, rowHeight);
11041
+ if (next !== element.scrollTop) {
11042
+ element.scrollTop = next;
11043
+ }
11044
+ setScrollTop(next);
11045
+ };
11046
+ let disposed = false;
11047
+ onSettled11(() => {
11048
+ const element = search ? untrack22(input) : untrack22(box);
11049
+ if (element) {
11050
+ element.focus();
11051
+ if (element instanceof HTMLInputElement) {
11052
+ element.setSelectionRange(element.value.length, element.value.length);
11053
+ }
11054
+ }
11055
+ setSnapshot(controller.getSnapshot());
11056
+ const unsubscribe = controller.subscribe(() => setSnapshot(controller.getSnapshot()));
11057
+ const detach = controller.attach();
11058
+ measure();
11059
+ window.addEventListener("resize", measure);
11060
+ window.addEventListener("scroll", measure, true);
11061
+ return () => {
11062
+ window.removeEventListener("resize", measure);
11063
+ window.removeEventListener("scroll", measure, true);
11064
+ detach();
11065
+ unsubscribe();
11066
+ };
11067
+ });
11068
+ onCleanup15(() => {
11069
+ disposed = true;
11070
+ });
11071
+ let measuredKey;
11072
+ createEffect13(
11073
+ () => `${visibleRows()}:${props.cellTop ?? 0}:${props.cellLeft ?? 0}`,
11074
+ outsideGraphApply((key) => {
11075
+ const previous = measuredKey;
11076
+ measuredKey = key;
11077
+ if (previous !== void 0 && previous !== key) {
11078
+ measure();
11079
+ }
11080
+ }),
11081
+ { name: "multiSelectMeasure" }
11082
+ );
11083
+ createEffect13(
11084
+ () => [snapshot2().results, scroller(), viewportHeight()],
11085
+ outsideGraphApply(([, element, height]) => reveal(element, height)),
11086
+ { name: "multiSelectReveal" }
11087
+ );
11088
+ const handleKeyDown = (event) => {
11089
+ if (isImeComposingKeyEvent6(event)) {
11090
+ return;
11091
+ }
11092
+ if (props.onCommitToSelection !== void 0 && isCommitToSelectionKey3(event)) {
11093
+ event.preventDefault();
11094
+ const result = props.onCommitToSelection(controller.valueToCommit());
11095
+ if (result && result.status === "rejected") {
11096
+ setError(result.message);
11097
+ }
11098
+ return;
11099
+ }
11100
+ const before = controller.getSnapshot();
11101
+ if (controller.keyDown(toEditorKeyEvent(event), props.enterMove)) {
11102
+ const after = controller.getSnapshot();
11103
+ if (after.selected !== before.selected) {
11104
+ setError(null);
11105
+ }
11106
+ if (after.highlight !== before.highlight) {
11107
+ reveal(untrack22(scroller), untrack22(viewportHeight));
11108
+ }
11109
+ }
11110
+ };
11111
+ const handleBlur = () => {
11112
+ if (!disposed) {
11113
+ controller.blur();
11114
+ }
11115
+ };
11116
+ const results = () => snapshot2().results;
11117
+ const status = () => snapshot2().status;
11118
+ const visible = createMemo32(() => {
11119
+ const list = results();
11120
+ const window_ = resolveSelectListWindow3(scrollTop(), viewportHeight(), rowHeight, list.length);
11121
+ return list.slice(window_.start, window_.end).map((result, offset) => ({ result, index: window_.start + offset }));
11122
+ });
11123
+ const listShown = () => placement2() !== null && results().length > 0;
11124
+ const activeId = () => {
11125
+ const { highlight } = snapshot2();
11126
+ return listShown() && highlight >= 0 && results()[highlight] ? `${listId}-${highlight}` : void 0;
11127
+ };
11128
+ const mount = () => placement2() !== null ? portal.container() : null;
11129
+ const initialText = untrack22(() => snapshot2().text);
11130
+ const justify = () => props.align === "right" ? "flex-end" : props.align === "center" ? "center" : void 0;
11131
+ const view = <>
11132
+ <div
11133
+ ref={setBox}
11134
+ class={[
11135
+ "ssg-cell-editor-input",
11136
+ "ssg-cell-editor-input--multi",
11137
+ {
11138
+ "ssg-cell-editor-input--multi-search": search,
11139
+ "ssg-cell-editor-input--multi-top": props.alignTop === true,
11140
+ "ssg-cell-editor-input--invalid": error() !== null
11141
+ }
11142
+ ]}
11143
+ style={justify() ? { "justify-content": justify() } : void 0}
11144
+ tabindex={search ? void 0 : 0}
11145
+ role={search ? void 0 : "combobox"}
11146
+ aria-label={search ? void 0 : props.ariaLabel}
11147
+ aria-expanded={search ? void 0 : listShown() ? "true" : "false"}
11148
+ aria-controls={search ? void 0 : listShown() ? listId : void 0}
11149
+ aria-activedescendant={search ? void 0 : activeId()}
11150
+ aria-invalid={search ? void 0 : error() !== null ? "true" : void 0}
11151
+ onKeyDown={search ? void 0 : handleKeyDown}
11152
+ onBlur={search ? void 0 : handleBlur}
11153
+ onPointerDown={(event) => {
11154
+ const field2 = untrack22(input);
11155
+ if (search && event.target !== field2) {
11156
+ event.preventDefault();
11157
+ field2?.focus();
11158
+ }
11159
+ }}
11160
+ >
11161
+ <span class="ssg-multi-select-editor-chips">
11162
+ <For17 each={snapshot2().chips} keyed={(chip) => chip.value}>
11163
+ {(chip) => <span class="ssg-multi-select-chip">
11164
+ <span class="ssg-multi-select-chip-label">{chip().label}</span>
11165
+ <button
11166
+ type="button"
11167
+ tabindex={-1}
11168
+ class="ssg-multi-select-chip-remove"
11169
+ aria-label={chip().label}
11170
+ onPointerDown={(event) => event.preventDefault()}
11171
+ onClick={() => {
11172
+ setError(null);
11173
+ controller.remove(untrack22(chip).value);
11174
+ }}
11175
+ >
11176
+ ×
11177
+ </button>
11178
+ </span>}
11179
+ </For17>
11180
+ </span>
11181
+ <Show29 when={search}>
11182
+ <input
11183
+ ref={setInput}
11184
+ type="text"
11185
+ value={initialText}
11186
+ onInput={(event) => controller.input(event.currentTarget.value, event.isComposing)}
11187
+ onCompositionEnd={(event) => controller.input(event.currentTarget.value, false)}
11188
+ onKeyDown={handleKeyDown}
11189
+ onBlur={handleBlur}
11190
+ role="combobox"
11191
+ aria-autocomplete="list"
11192
+ aria-label={props.ariaLabel}
11193
+ aria-expanded={listShown() ? "true" : "false"}
11194
+ aria-controls={listShown() ? listId : void 0}
11195
+ aria-activedescendant={activeId()}
11196
+ aria-invalid={error() !== null ? "true" : void 0}
11197
+ autocomplete="off"
11198
+ spellcheck="false"
11199
+ class="ssg-multi-select-editor-search"
11200
+ />
11201
+ </Show29>
11202
+ </div>
11203
+ {
11204
+ /* 変更(1.11.0 / レビュー EB-4): 一覧を出している間は、検査で拒まれた知らせを一覧の下(操作の説明の所)に出します
11205
+ (セルの下の吹き出しは一覧に隠れていた)。一覧が隠れているときだけ吹き出し。React 版と同じ。 */
11206
+ }
11207
+ <CellEditorError message={mount() !== null && placement2()?.hidden !== true ? null : error()} />
11208
+ <Show29 when={mount()}>
11209
+ {(container) => <Portal7 mount={container()}>
11210
+ <div
11211
+ ref={setPopover}
11212
+ class={[
11213
+ "ssg-select-editor-popover",
11214
+ "ssg-select-editor-popover--search",
11215
+ "ssg-select-editor-popover--multi",
11216
+ { "ssg-select-editor-popover--loading": status() === "loading" && results().length > 0 },
11217
+ props.themeClassName,
11218
+ props.popoverSlot?.className
11219
+ ]}
11220
+ style={{
11221
+ ...props.popoverSlot?.style,
11222
+ left: px(placement2()?.left ?? 0),
11223
+ top: px(placement2()?.top ?? 0),
11224
+ width: px(placement2()?.width ?? 0),
11225
+ "max-height": px(placement2()?.maxHeight ?? 0),
11226
+ visibility: placement2()?.hidden ? "hidden" : void 0
11227
+ }}
11228
+ onPointerDown={(event) => event.preventDefault()}
11229
+ >
11230
+ <Show29 when={status() === "error"}>
11231
+ <div class="ssg-select-editor-empty ssg-select-editor-error" role="alert">
11232
+ <span class="ssg-select-editor-error-text" title={snapshot2().errorMessage ?? void 0}>
11233
+ {texts().multiSelectFailed}
11234
+ </span>
11235
+ <button type="button" class="ssg-select-editor-retry" tabindex={-1} onClick={() => controller.retry()}>
11236
+ {texts().retry}
11237
+ </button>
11238
+ </div>
11239
+ </Show29>
11240
+ <Show29 when={status() !== "error" && results().length === 0}>
11241
+ <div class="ssg-select-editor-empty" role="status">
11242
+ {status() === "loading" ? texts().multiSelectLoading : snapshot2().filtered ? texts().multiSelectNoMatch : texts().noOptions}
11243
+ </div>
11244
+ </Show29>
11245
+ <Show29 when={results().length > 0}>
11246
+ <div
11247
+ ref={setScroller}
11248
+ role="listbox"
11249
+ id={listId}
11250
+ aria-label={props.ariaLabel}
11251
+ aria-multiselectable="true"
11252
+ aria-busy={status() === "loading" ? "true" : void 0}
11253
+ class="ssg-select-editor-scroller"
11254
+ style={{ height: px(viewportHeight()) }}
11255
+ onScroll={(event) => setScrollTop(event.currentTarget.scrollTop)}
11256
+ >
11257
+ <div class="ssg-select-editor-rows" role="presentation" style={{ height: px(results().length * rowHeight) }}>
11258
+ <For17 each={visible()} keyed={false}>
11259
+ {(item) => {
11260
+ const checked = () => snapshot2().selected.includes(item().result.option.value);
11261
+ return <div
11262
+ id={`${listId}-${item().index}`}
11263
+ role="option"
11264
+ aria-selected={checked() ? "true" : "false"}
11265
+ aria-setsize={results().length}
11266
+ aria-posinset={item().index + 1}
11267
+ class={[
11268
+ "ssg-select-editor-option",
11269
+ {
11270
+ "ssg-select-editor-option--highlighted": item().index === snapshot2().highlight,
11271
+ "ssg-select-editor-option--checked": checked()
11272
+ }
11273
+ ]}
11274
+ style={{ top: px(item().index * rowHeight) }}
11275
+ onClick={() => {
11276
+ setError(null);
11277
+ controller.toggle(untrack22(item).index);
11278
+ }}
11279
+ onPointerEnter={(event) => revealOverflowTitle3(event.currentTarget)}
11280
+ onPointerMove={(event) => {
11281
+ if (pointerMoved(event)) {
11282
+ controller.hover(untrack22(item).index);
11283
+ }
11284
+ }}
11285
+ >
11286
+ <span class="ssg-multi-select-check" aria-hidden="true">
11287
+ <Show29 when={checked()}>
11288
+ <CheckIcon />
11289
+ </Show29>
11290
+ </span>
11291
+ <span class="ssg-select-editor-option-label">
11292
+ <MatchedText2 text={item().result.option.label} range={item().result.labelMatch} />
11293
+ </span>
11294
+ <Show29 when={item().result.option.description}>
11295
+ {(description) => <span class="ssg-select-editor-option-description">
11296
+ <MatchedText2 text={description()} range={item().result.descriptionMatch} />
11297
+ </span>}
11298
+ </Show29>
11299
+ </div>;
11300
+ }}
11301
+ </For17>
11302
+ </div>
11303
+ </div>
11304
+ </Show29>
11305
+ <Show29
11306
+ when={error() === null}
11307
+ fallback={<div class="ssg-multi-select-hint ssg-multi-select-hint--error" role="alert" style={{ "min-height": px(rowHeight) }}>
11308
+ {error()}
11309
+ </div>}
11310
+ >
11311
+ <Show29 when={hint() !== ""}>
11312
+ <div class="ssg-multi-select-hint" aria-hidden="true" style={{ "min-height": px(rowHeight) }}>
11313
+ {hint()}
11314
+ </div>
11315
+ </Show29>
11316
+ </Show29>
11317
+ </div>
11318
+ </Portal7>}
11319
+ </Show29>
11320
+ </>;
11321
+ createPortalTokens(popover, () => props.themeClassName, placement2);
11322
+ createRenderEffect9(
11323
+ () => [input(), snapshot2().text],
11324
+ ([element, text]) => {
11325
+ if (element && element.value !== text) {
11326
+ element.value = text;
11327
+ }
11328
+ },
11329
+ { name: "multiSelectInputText" }
11330
+ );
11331
+ return view;
11332
+ }
11333
+
11334
+ // src/view/GridMultiSelectChips.tsx
11335
+ import { For as For18, Show as Show30 } from "solid-js";
11336
+ function GridMultiSelectChips(props) {
11337
+ return <Show30 when={props.labels.length > 0}>
11338
+ <span class="ssg-multi-select-chips" data-ssg-tooltip-overflow={props.labels.join(props.separator)}>
11339
+ <For18 each={props.labels} keyed={false}>
11340
+ {(label, index) => <span class="ssg-multi-select-chip">
11341
+ <span class="ssg-multi-select-chip-label">{props.renderLabel(label(), index)}</span>
11342
+ </span>}
11343
+ </For18>
11344
+ </span>
11345
+ </Show30>;
11346
+ }
11347
+
11348
+ // src/features/multiSelect.ts
11349
+ var multiSelectFeature = {
11350
+ MultiSelectCellEditor,
11351
+ MultiSelectChips: GridMultiSelectChips,
11352
+ resolveChipLabels: resolveMultiSelectChipLabels,
11353
+ splitRangesByChips,
11354
+ localeText: DEFAULT_MULTI_SELECT_LOCALE_TEXT
11355
+ };
11356
+
10330
11357
  // src/features/changeTracking.ts
10331
11358
  import { createChangeTracker } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/changeTracker";
10332
11359
  import {
@@ -10371,29 +11398,29 @@ import { createTreeStage } from "@ishibashi0112/spreadsheet-grid-core/internal/e
10371
11398
  import { DEFAULT_TREE_DATA_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
10372
11399
 
10373
11400
  // src/view/GridTreeCell.tsx
10374
- import { createMemo as createMemo31, Show as Show28 } from "solid-js";
10375
- import { formatLocaleText as formatLocaleText16 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
11401
+ import { createMemo as createMemo33, Show as Show31 } from "solid-js";
11402
+ import { formatLocaleText as formatLocaleText17 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
10376
11403
  import {
10377
11404
  formatTotalRowCellText as formatTotalRowCellText2,
10378
11405
  resolveTotalRowCaption as resolveTotalRowCaption2
10379
11406
  } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
10380
11407
  function GridTreeCellPrefix(props) {
10381
11408
  const texts = useFeatureLocaleText();
10382
- const label = createMemo31(() => {
11409
+ const label = createMemo33(() => {
10383
11410
  const name = props.rowLabel.trim();
10384
- return formatLocaleText16(props.open ? texts().collapseTreeRow : texts().expandTreeRow, {
10385
- row: name !== "" ? name : formatLocaleText16(texts().treeRowNumber, { row: props.rowNumber })
11411
+ return formatLocaleText17(props.open ? texts().collapseTreeRow : texts().expandTreeRow, {
11412
+ row: name !== "" ? name : formatLocaleText17(texts().treeRowNumber, { row: props.rowNumber })
10386
11413
  });
10387
11414
  });
10388
11415
  return <>
10389
- <Show28 when={props.level > 0}>
11416
+ <Show31 when={props.level > 0}>
10390
11417
  <span
10391
11418
  aria-hidden="true"
10392
11419
  class="ssg-tree-indent"
10393
11420
  style={{ width: `calc(var(--ssg-tree-indent) * ${props.level})` }}
10394
11421
  />
10395
- </Show28>
10396
- <Show28 when={props.hasChildren} fallback={<span aria-hidden="true" class="ssg-tree-spacer" />}>
11422
+ </Show31>
11423
+ <Show31 when={props.hasChildren} fallback={<span aria-hidden="true" class="ssg-tree-spacer" />}>
10397
11424
  <button
10398
11425
  type="button"
10399
11426
  tabindex={-1}
@@ -10414,28 +11441,28 @@ function GridTreeCellPrefix(props) {
10414
11441
  >
10415
11442
  {props.open ? "\u25BE" : "\u25B8"}
10416
11443
  </button>
10417
- </Show28>
11444
+ </Show31>
10418
11445
  </>;
10419
11446
  }
10420
11447
  function GridTreeAggregateValue(props) {
10421
11448
  const texts = useFeatureLocaleText();
10422
- const shown = createMemo31(() => {
11449
+ const shown = createMemo33(() => {
10423
11450
  const column = props.column;
10424
11451
  const kind = typeof column.aggFunc === "string" ? column.aggFunc : "custom";
10425
11452
  const text = formatTotalRowCellText2(column, { value: props.value, kind });
10426
11453
  return text === "" ? null : { text, caption: resolveTotalRowCaption2(kind, texts()) };
10427
11454
  });
10428
- return <Show28 when={shown()}>
11455
+ return <Show31 when={shown()}>
10429
11456
  {(current) => <span
10430
11457
  class="ssg-group-value ssg-tree-aggregate"
10431
11458
  data-ssg-tooltip-overflow={current().caption !== void 0 ? `${current().caption} ${current().text}` : current().text}
10432
11459
  >
10433
- <Show28 when={current().caption !== void 0}>
11460
+ <Show31 when={current().caption !== void 0}>
10434
11461
  <span class="ssg-group-caption">{current().caption}</span>
10435
- </Show28>
11462
+ </Show31>
10436
11463
  {current().text}
10437
11464
  </span>}
10438
- </Show28>;
11465
+ </Show31>;
10439
11466
  }
10440
11467
 
10441
11468
  // src/features/treeData.ts
@@ -10455,7 +11482,7 @@ var treeDataFeature = {
10455
11482
  import { DEFAULT_AGGREGATES_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
10456
11483
 
10457
11484
  // src/primitives/selectionAggregates.ts
10458
- import { createMemo as createMemo32 } from "solid-js";
11485
+ import { createMemo as createMemo34 } from "solid-js";
10459
11486
  import {
10460
11487
  createSelectionAggregatesRunner,
10461
11488
  resolveSyncSelectionAggregates,
@@ -10467,15 +11494,15 @@ import {
10467
11494
  } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
10468
11495
  function createSelectionAggregates(args) {
10469
11496
  const stabilizeTarget = createSelectionAggregateTargetStabilizer();
10470
- const target = createMemo32(() => {
11497
+ const target = createMemo34(() => {
10471
11498
  const current = args();
10472
11499
  return stabilizeTarget(
10473
11500
  current.enabled ? resolveSelectionAggregateTarget(current.selection, current.viewRowCount, current.orderedColumns) : null
10474
11501
  );
10475
11502
  });
10476
- const rowModel = createMemo32(() => args().rowModel);
10477
- const key = createMemo32(() => ({ rowModel: rowModel(), target: target() }));
10478
- const syncResult = createMemo32(() => resolveSyncSelectionAggregates(key()));
11503
+ const rowModel = createMemo34(() => args().rowModel);
11504
+ const key = createMemo34(() => ({ rowModel: rowModel(), target: target() }));
11505
+ const syncResult = createMemo34(() => resolveSyncSelectionAggregates(key()));
10479
11506
  const runner = createSelectionAggregatesRunner();
10480
11507
  connectController(
10481
11508
  runner,
@@ -10484,16 +11511,16 @@ function createSelectionAggregates(args) {
10484
11511
  "selectionAggregates"
10485
11512
  );
10486
11513
  const snapshot2 = createExternalStoreSignal(runner, "selectionAggregatesStore");
10487
- return createMemo32(() => selectSelectionAggregatesResult(syncResult(), snapshot2(), key()));
11514
+ return createMemo34(() => selectSelectionAggregatesResult(syncResult(), snapshot2(), key()));
10488
11515
  }
10489
11516
 
10490
11517
  // src/view/GridSelectionAggregates.tsx
10491
- import { For as For16, Show as Show29, createMemo as createMemo33 } from "solid-js";
11518
+ import { For as For19, Show as Show32, createMemo as createMemo35 } from "solid-js";
10492
11519
  import { formatSelectionAggregateNumber } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionAggregates";
10493
- import { formatLocaleText as formatLocaleText17 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
11520
+ import { formatLocaleText as formatLocaleText18 } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
10494
11521
  function GridSelectionAggregates(props) {
10495
11522
  const texts = useFeatureLocaleText();
10496
- const chips = createMemo33(() => {
11523
+ const chips = createMemo35(() => {
10497
11524
  const aggregates = props.aggregates;
10498
11525
  if (!aggregates) {
10499
11526
  return null;
@@ -10503,7 +11530,7 @@ function GridSelectionAggregates(props) {
10503
11530
  return [
10504
11531
  {
10505
11532
  key: "computing",
10506
- text: formatLocaleText17(localeTexts.aggregateComputing, { percent: Math.floor(aggregates.progress * 100) })
11533
+ text: formatLocaleText18(localeTexts.aggregateComputing, { percent: Math.floor(aggregates.progress * 100) })
10507
11534
  }
10508
11535
  ];
10509
11536
  }
@@ -10526,12 +11553,12 @@ function GridSelectionAggregates(props) {
10526
11553
  }
10527
11554
  return list;
10528
11555
  });
10529
- return <Show29 when={chips()}>
11556
+ return <Show32 when={chips()}>
10530
11557
  {(list) => <div class={["ssg-bar-aggregates", { "ssg-bar-aggregates--trailing": props.trailing }]}>
10531
11558
  <div class="ssg-bar-aggregates-inner" title={list().map((chip) => chip.text).join(" ")}>
10532
11559
  <div class="ssg-bar-aggregates-list">
10533
11560
  <span class="ssg-bar-aggregates-fit" aria-hidden="true" />
10534
- <For16 each={list()} keyed={(chip) => chip.key}>
11561
+ <For19 each={list()} keyed={(chip) => chip.key}>
10535
11562
  {(chip, index) => <span
10536
11563
  class={[
10537
11564
  "ssg-bar-chip",
@@ -10542,16 +11569,16 @@ function GridSelectionAggregates(props) {
10542
11569
  ]}
10543
11570
  style={{ order: String(-index()) }}
10544
11571
  >
10545
- <Show29 when={chip().label !== void 0} fallback={chip().text}>
11572
+ <Show32 when={chip().label !== void 0} fallback={chip().text}>
10546
11573
  {chip().label}
10547
11574
  <b class="ssg-bar-aggregate-value">{chip().value}</b>
10548
- </Show29>
11575
+ </Show32>
10549
11576
  </span>}
10550
- </For16>
11577
+ </For19>
10551
11578
  </div>
10552
11579
  </div>
10553
11580
  </div>}
10554
- </Show29>;
11581
+ </Show32>;
10555
11582
  }
10556
11583
 
10557
11584
  // src/features/selectionAggregates.ts
@@ -10562,7 +11589,7 @@ var selectionAggregatesFeature = {
10562
11589
  };
10563
11590
 
10564
11591
  // src/primitives/toolPanel.ts
10565
- import { createMemo as createMemo34 } from "solid-js";
11592
+ import { createMemo as createMemo36 } from "solid-js";
10566
11593
  import {
10567
11594
  createToolPanelController,
10568
11595
  resolveActiveToolPanelTab,
@@ -10581,7 +11608,7 @@ function createToolPanel(inputs) {
10581
11608
  onSuppressedEscape: inputs.onSuppressedEscape
10582
11609
  }), "render", "toolPanel");
10583
11610
  const snapshot2 = createExternalStoreSignal(controller, "toolPanelStore");
10584
- const availableTabs = createMemo34(
11611
+ const availableTabs = createMemo36(
10585
11612
  () => resolveAvailableToolPanelTabs({
10586
11613
  canUseFilterTab: inputs.canUseFilterTab(),
10587
11614
  canUseColumnsTab: inputs.canUseColumnsTab(),
@@ -10590,10 +11617,10 @@ function createToolPanel(inputs) {
10590
11617
  { equals: sameTabs }
10591
11618
  );
10592
11619
  return {
10593
- activeTab: createMemo34(() => resolveActiveToolPanelTab(snapshot2().requestedTab, availableTabs())),
11620
+ activeTab: createMemo36(() => resolveActiveToolPanelTab(snapshot2().requestedTab, availableTabs())),
10594
11621
  availableTabs,
10595
- layout: createMemo34(() => snapshot2().layout),
10596
- flashTick: createMemo34(() => snapshot2().flashTick),
11622
+ layout: createMemo36(() => snapshot2().layout),
11623
+ flashTick: createMemo36(() => snapshot2().flashTick),
10597
11624
  panelRef: controller.panelRef,
10598
11625
  open: controller.open,
10599
11626
  close: controller.close,
@@ -10617,7 +11644,7 @@ import {
10617
11644
  } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/totalRow";
10618
11645
 
10619
11646
  // src/view/GridTotalRow.tsx
10620
- import { For as For17, Show as Show30, createMemo as createMemo35 } from "solid-js";
11647
+ import { For as For20, Show as Show33, createMemo as createMemo37 } from "solid-js";
10621
11648
  import {
10622
11649
  formatTotalRowCellText as formatTotalRowCellText3,
10623
11650
  resolveTotalRowCaption as resolveTotalRowCaption3
@@ -10644,7 +11671,7 @@ function GridTotalRow(props) {
10644
11671
  ...props.stickyBottom > 0 ? { bottom: px(props.stickyBottom) } : null
10645
11672
  }}
10646
11673
  >
10647
- <Show30 when={props.ownsRowHeader}>
11674
+ <Show33 when={props.ownsRowHeader}>
10648
11675
  <div
10649
11676
  role={rowHeaderIsCell() ? "rowheader" : void 0}
10650
11677
  aria-colindex={rowHeaderIsCell() ? 1 : void 0}
@@ -10659,13 +11686,13 @@ function GridTotalRow(props) {
10659
11686
  >
10660
11687
  {rowHeaderText() === "" ? null : rowHeaderText()}
10661
11688
  </div>
10662
- </Show30>
10663
- <For17 each={props.entries} keyed={(entry) => entry.column.key}>
11689
+ </Show33>
11690
+ <For20 each={props.entries} keyed={(entry) => entry.column.key}>
10664
11691
  {(entry) => {
10665
- const unbound = createMemo35(() => entry().column);
11692
+ const unbound = createMemo37(() => entry().column);
10666
11693
  const cell = () => props.cells.get(unbound().key);
10667
11694
  const isLabelCell = () => unbound().key === props.labelColumnKey;
10668
- const content = createMemo35(() => {
11695
+ const content = createMemo37(() => {
10669
11696
  const total = cell();
10670
11697
  if (total) {
10671
11698
  const column = unbound();
@@ -10717,7 +11744,7 @@ function GridTotalRow(props) {
10717
11744
  {content()}
10718
11745
  </div>;
10719
11746
  }}
10720
- </For17>
11747
+ </For20>
10721
11748
  </div>
10722
11749
  </>;
10723
11750
  }
@@ -10745,6 +11772,8 @@ var fullGridFeatures = {
10745
11772
  find: findFeature,
10746
11773
  imeDirectInput: imeDirectInputFeature,
10747
11774
  selectSearch: selectSearchFeature,
11775
+ dateTimeEditors: dateTimeEditorsFeature,
11776
+ multiSelect: multiSelectFeature,
10748
11777
  changeTracking: changeTrackingFeature,
10749
11778
  excelShortcuts: excelShortcutsFeature,
10750
11779
  newRow: newRowFeature,
@@ -10792,6 +11821,7 @@ export {
10792
11821
  conditionalFormatFeature,
10793
11822
  contextMenuFeature,
10794
11823
  createSpreadsheetGrid,
11824
+ dateTimeEditorsFeature,
10795
11825
  excelShortcutsFeature,
10796
11826
  exportFeature,
10797
11827
  fillHandleFeature,
@@ -10801,6 +11831,7 @@ export {
10801
11831
  imeDirectInputFeature,
10802
11832
  labelRowFeature,
10803
11833
  motionExtrasFeature,
11834
+ multiSelectFeature,
10804
11835
  newRowFeature,
10805
11836
  numberFormatter,
10806
11837
  numberParser,