@ishibashi0112/spreadsheet-grid 1.10.0 → 1.12.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.
- package/API_REFERENCE.md +195 -18
- package/README.md +2 -2
- package/dist/CellEditorLayer.d.ts +5 -1
- package/dist/ColumnFilterPopover-DObE236Y.cjs +1 -0
- package/dist/{ColumnFilterPopover-BkvL8LdP.js → ColumnFilterPopover-xpVqTNCI.js} +5 -5
- package/dist/DateEditorCalendar-C4DuVjsL.js +128 -0
- package/dist/DateEditorCalendar-Cg4a2Y8d.cjs +1 -0
- package/dist/GridShell.d.ts +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/editors/DateTimeCellEditor.d.ts +25 -0
- package/dist/editors/MultiSelectCellEditor.d.ts +23 -0
- package/dist/features/dateTimeEditors.d.ts +2 -0
- package/dist/features/findReplace.d.ts +2 -0
- package/dist/features/multiSelect.d.ts +2 -0
- package/dist/features/richCopy.d.ts +2 -0
- package/dist/features/types.d.ts +21 -0
- package/dist/hooks/useGridLocaleText.d.ts +1 -1
- package/dist/index.cjs +12 -11
- package/dist/index.js +4947 -4099
- package/dist/lite/CellEditorErrorBubble-BH68ZTcj.js +23 -0
- package/dist/lite/CellEditorErrorBubble-DDoxYBXj.cjs +1 -0
- package/dist/lite/DateCellEditor-BPCZK7xI.js +81 -0
- package/dist/lite/DateCellEditor-BQfImAET.cjs +1 -0
- package/dist/lite/DateEditorCalendar-C4DuVjsL.js +128 -0
- package/dist/lite/DateEditorCalendar-Cg4a2Y8d.cjs +1 -0
- package/dist/lite/createSpreadsheetGrid-C2k5e4f7.js +5185 -0
- package/dist/lite/createSpreadsheetGrid-D3TsGHNb.cjs +12 -0
- package/dist/lite/createSpreadsheetGrid.cjs +1 -1
- package/dist/lite/createSpreadsheetGrid.js +1 -1
- package/dist/lite/dateTimeEditors-BrNH3QkX.cjs +1 -0
- package/dist/lite/dateTimeEditors-CbxvlPg6.js +277 -0
- package/dist/lite/features/dateTimeEditors.cjs +1 -0
- package/dist/lite/features/dateTimeEditors.js +2 -0
- package/dist/lite/features/filtering.cjs +1 -1
- package/dist/lite/features/filtering.js +1 -1
- package/dist/lite/features/find.cjs +1 -1
- package/dist/lite/features/find.js +1 -1
- package/dist/lite/features/findReplace.cjs +1 -0
- package/dist/lite/features/findReplace.js +2 -0
- package/dist/lite/features/multiSelect.cjs +1 -0
- package/dist/lite/features/multiSelect.js +2 -0
- package/dist/lite/features/pinnedRows.cjs +1 -1
- package/dist/lite/features/pinnedRows.js +1 -1
- package/dist/lite/features/richCopy.cjs +1 -0
- package/dist/lite/features/richCopy.js +9 -0
- package/dist/lite/features/selectSearch.cjs +1 -1
- package/dist/lite/features/selectSearch.js +1 -1
- package/dist/lite/features/standard.cjs +1 -1
- package/dist/lite/features/standard.js +2 -2
- package/dist/lite/features/toolPanel.cjs +1 -1
- package/dist/lite/features/toolPanel.js +1 -1
- package/dist/lite/{filtering-c1X_zP3o.js → filtering-DaFmWbBq.js} +145 -142
- package/dist/lite/filtering-DskgJ8zD.cjs +1 -0
- package/dist/lite/find-B3brbyYF.js +112 -0
- package/dist/lite/find-CyoYo6uk.cjs +1 -0
- package/dist/lite/findReplace-Bl26__8E.js +128 -0
- package/dist/lite/findReplace-DqAy-_o3.cjs +1 -0
- package/dist/lite/lazyPopups-Cokq5TOf.cjs +2 -0
- package/dist/lite/{lazyPopups-DV5yAqW8.js → lazyPopups-DlBfI7Iu.js} +13 -9
- package/dist/lite/multiSelect-CcxB2bAd.cjs +1 -0
- package/dist/lite/multiSelect-fz6tgldg.js +296 -0
- package/dist/lite/pinnedRows-Bx5s2ykl.cjs +1 -0
- package/dist/lite/pinnedRows-ibpSVG2h.js +149 -0
- package/dist/lite/selectSearch-UHDjcmLg.cjs +1 -0
- package/dist/lite/{selectSearch-DmFm5bXg.js → selectSearch-n7CsaJiu.js} +2 -1
- package/dist/lite/{toolPanel-DQlOiytT.cjs → toolPanel-BD5l2a18.cjs} +1 -1
- package/dist/lite/{toolPanel-B1e18z68.js → toolPanel-BEzcyMBS.js} +1 -1
- package/dist/lite/useTopAlignedInput-BPhb8DcZ.js +15 -0
- package/dist/lite/useTopAlignedInput-T3k_V2-u.cjs +1 -0
- package/dist/lite.cjs +1 -1
- package/dist/lite.d.ts +4 -0
- package/dist/lite.js +34 -30
- package/dist/style.css +1 -1
- package/dist/style.layer.css +1 -1
- package/dist/{toolPanelViews-Biz2p7sx.js → toolPanelViews-C8Vw3fEC.js} +2 -2
- package/dist/toolPanelViews-GXwba3Zw.cjs +1 -0
- package/dist/useGridLocaleText-CRSWUb4o.cjs +1 -0
- package/dist/useGridLocaleText-CpoTVgyp.js +6 -0
- package/dist/{usePopupLocaleText-DJN10Asc.js → usePopupLocaleText-Cfb4fQ8G.js} +1 -1
- package/dist/{usePopupLocaleText-lEFHqTvJ.cjs → usePopupLocaleText-CmlJsMAf.cjs} +1 -1
- package/dist/usePortalTokens-CeVR4LF2.cjs +1 -0
- package/dist/usePortalTokens-CkjVoVTY.js +45 -0
- package/dist/{useVirtualizerCore-C1k6Aw8p.js → useVirtualizerCore-BKZtPhuo.js} +1 -1
- package/dist/useVirtualizerCore-CA1UYXG3.cjs +1 -0
- package/dist/view/DateEditorCalendar.d.ts +14 -0
- package/dist/view/GridFindBar.d.ts +7 -1
- package/dist/view/GridFindReplace.d.ts +25 -0
- package/dist/view/GridMultiSelectChips.d.ts +6 -0
- package/dist/view/GridPinnedRows.d.ts +2 -1
- package/dist/view/lazyPopups.d.ts +3 -1
- package/package.json +2 -2
- package/skills/spreadsheet-grid/SKILL.md +7 -2
- package/dist/ColumnFilterPopover-cNVxOkoI.cjs +0 -1
- package/dist/lite/createSpreadsheetGrid-BWZbBB_j.js +0 -5065
- package/dist/lite/createSpreadsheetGrid-fhnxS5bQ.cjs +0 -11
- package/dist/lite/filtering-BTAXzOAK.cjs +0 -1
- package/dist/lite/find-CBDk2qXA.cjs +0 -1
- package/dist/lite/find-DtRIqxec.js +0 -105
- package/dist/lite/lazyPopups-B1nKq4RV.cjs +0 -2
- package/dist/lite/pinnedRows-C0z2lLC4.js +0 -144
- package/dist/lite/pinnedRows-CrwRr7W0.cjs +0 -1
- package/dist/lite/selectSearch-CMNy2EOi.cjs +0 -1
- package/dist/lite/useTopAlignedInput-BAL_0rjw.cjs +0 -1
- package/dist/lite/useTopAlignedInput-CAagCTj-.js +0 -37
- package/dist/toolPanelViews-BAy-NXrx.cjs +0 -1
- package/dist/useGridLocaleText-BV4EomZe.cjs +0 -1
- package/dist/useGridLocaleText-Drud4qg0.js +0 -49
- package/dist/useVirtualizerCore-Cif7t8mS.cjs +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useCallback as e, useState as t } from "react";
|
|
2
|
+
import { cx as n } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/cx";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { DEFAULT_ERROR_BUBBLE_PLACEMENT as i, ERROR_BUBBLE_ABOVE_CLASS as a, placeErrorBubble as o } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/errorBubblePlacement";
|
|
5
|
+
//#region src/editors/CellEditorErrorBubble.tsx
|
|
6
|
+
function s({ message: s }) {
|
|
7
|
+
let [c, l] = t(i);
|
|
8
|
+
return /* @__PURE__ */ r("div", {
|
|
9
|
+
ref: e((e) => {
|
|
10
|
+
e && l(o(e));
|
|
11
|
+
}, []),
|
|
12
|
+
role: "alert",
|
|
13
|
+
className: n("ssg-cell-editor-error", c.above && a),
|
|
14
|
+
style: c.shift > 0 || c.wrapWidth !== null ? {
|
|
15
|
+
left: c.shift > 0 ? -c.shift : void 0,
|
|
16
|
+
width: c.wrapWidth ?? void 0,
|
|
17
|
+
whiteSpace: c.wrapWidth === null ? void 0 : "normal"
|
|
18
|
+
} : void 0,
|
|
19
|
+
children: s
|
|
20
|
+
}, s);
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { s as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("react"),t=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/cx"),n=require("react/jsx-runtime"),r=require("@ishibashi0112/spreadsheet-grid-core/internal/utils/errorBubblePlacement");function i({message:i}){let[a,o]=(0,e.useState)(r.DEFAULT_ERROR_BUBBLE_PLACEMENT);return(0,n.jsx)(`div`,{ref:(0,e.useCallback)(e=>{e&&o((0,r.placeErrorBubble)(e))},[]),role:`alert`,className:(0,t.cx)(`ssg-cell-editor-error`,a.above&&r.ERROR_BUBBLE_ABOVE_CLASS),style:a.shift>0||a.wrapWidth!==null?{left:a.shift>0?-a.shift:void 0,width:a.wrapWidth??void 0,whiteSpace:a.wrapWidth===null?void 0:`normal`}:void 0,children:i},i)}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { r as e } from "./useController-zuzvTNo5.js";
|
|
2
|
+
import { i as t } from "./useGridLocaleText-CpoTVgyp.js";
|
|
3
|
+
import { t as n } from "./CellEditorErrorBubble-BH68ZTcj.js";
|
|
4
|
+
import { t as r } from "./useTopAlignedInput-BPhb8DcZ.js";
|
|
5
|
+
import { useCallback as i, useRef as a, useState as o } from "react";
|
|
6
|
+
import { cx as s } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/cx";
|
|
7
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
import { handleEditorKeyDown as d, resolveEnterDirection as f } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys";
|
|
9
|
+
import { readTypedDateCommitValue as p } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart";
|
|
10
|
+
import { resolveShiftIntoView as m } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/editorVisibleBounds";
|
|
11
|
+
//#region src/editors/editorKeyBindings.ts
|
|
12
|
+
var h = (e) => (t) => d({
|
|
13
|
+
key: t.key,
|
|
14
|
+
altKey: t.altKey,
|
|
15
|
+
ctrlKey: t.ctrlKey,
|
|
16
|
+
metaKey: t.metaKey,
|
|
17
|
+
shiftKey: t.shiftKey,
|
|
18
|
+
isComposing: t.nativeEvent.isComposing,
|
|
19
|
+
keyCode: t.nativeEvent.keyCode,
|
|
20
|
+
currentTarget: t.currentTarget,
|
|
21
|
+
preventDefault: () => t.preventDefault()
|
|
22
|
+
}, e);
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/editors/DateCellEditor.tsx
|
|
25
|
+
function g({ ariaLabel: d, initialValue: f, initialText: g, onCommit: _, onCancel: v, onCommitToSelection: y, onRegisterFlush: b, align: x, enterMove: S, cellHeight: C = 0, alignTop: w = !1 }) {
|
|
26
|
+
let T = t(), [E] = o(() => g !== void 0 && g !== ""), [D, O] = o(E ? g ?? "" : f), [k, A] = o(null), [j, M] = o(0), N = a(null);
|
|
27
|
+
r(N, w, C);
|
|
28
|
+
let P = i((e) => {
|
|
29
|
+
if (N.current = e, e) {
|
|
30
|
+
if (e.focus(), e.type === "text") {
|
|
31
|
+
let t = e.value.length;
|
|
32
|
+
e.setSelectionRange(t, t);
|
|
33
|
+
}
|
|
34
|
+
M(m(e));
|
|
35
|
+
}
|
|
36
|
+
}, []), F = (e, t, n = _) => {
|
|
37
|
+
if (!E) return n(e, t);
|
|
38
|
+
let r = p(e);
|
|
39
|
+
return r === null ? {
|
|
40
|
+
status: "rejected",
|
|
41
|
+
message: T.enterDate
|
|
42
|
+
} : n(r, t);
|
|
43
|
+
};
|
|
44
|
+
return e(() => {
|
|
45
|
+
b?.(() => {
|
|
46
|
+
F(D);
|
|
47
|
+
});
|
|
48
|
+
}), /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("input", {
|
|
49
|
+
ref: P,
|
|
50
|
+
type: E ? "text" : "date",
|
|
51
|
+
value: D,
|
|
52
|
+
onChange: (e) => {
|
|
53
|
+
O(e.target.value), A(null);
|
|
54
|
+
},
|
|
55
|
+
onKeyDown: h({
|
|
56
|
+
value: D,
|
|
57
|
+
onCommit: F,
|
|
58
|
+
onCancel: v,
|
|
59
|
+
onRejected: A,
|
|
60
|
+
enterMove: S,
|
|
61
|
+
onCommitToSelection: y === void 0 ? void 0 : (e) => F(e, void 0, (e) => y(e)),
|
|
62
|
+
blockHomeEnd: !E
|
|
63
|
+
}),
|
|
64
|
+
onBlur: () => {
|
|
65
|
+
let e = F(D);
|
|
66
|
+
e && e.status === "rejected" && v();
|
|
67
|
+
},
|
|
68
|
+
"aria-label": d,
|
|
69
|
+
"aria-invalid": k !== null || void 0,
|
|
70
|
+
className: s("ssg-cell-editor-input", k !== null && "ssg-cell-editor-input--invalid"),
|
|
71
|
+
style: x || j > 0 ? {
|
|
72
|
+
...x ? { textAlign: x } : null,
|
|
73
|
+
...j > 0 ? {
|
|
74
|
+
position: "relative",
|
|
75
|
+
left: -j
|
|
76
|
+
} : null
|
|
77
|
+
} : void 0
|
|
78
|
+
}), k === null ? null : /* @__PURE__ */ l(n, { message: k })] });
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { h as n, f as r, g as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./useController-Zlv7BRoY.cjs"),t=require("./useGridLocaleText-CRSWUb4o.cjs"),n=require("./CellEditorErrorBubble-DDoxYBXj.cjs"),r=require("./useTopAlignedInput-T3k_V2-u.cjs");let i=require("react"),a=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/cx"),o=require("react/jsx-runtime"),s=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/editorKeys"),c=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/editorStart"),l=require("@ishibashi0112/spreadsheet-grid-core/internal/utils/editorVisibleBounds");var u=e=>t=>(0,s.handleEditorKeyDown)({key:t.key,altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey,isComposing:t.nativeEvent.isComposing,keyCode:t.nativeEvent.keyCode,currentTarget:t.currentTarget,preventDefault:()=>t.preventDefault()},e);function d({ariaLabel:s,initialValue:d,initialText:f,onCommit:p,onCancel:m,onCommitToSelection:h,onRegisterFlush:g,align:_,enterMove:v,cellHeight:y=0,alignTop:b=!1}){let x=t.i(),[S]=(0,i.useState)(()=>f!==void 0&&f!==``),[C,w]=(0,i.useState)(S?f??``:d),[T,E]=(0,i.useState)(null),[D,O]=(0,i.useState)(0),k=(0,i.useRef)(null);r.t(k,b,y);let A=(0,i.useCallback)(e=>{if(k.current=e,e){if(e.focus(),e.type===`text`){let t=e.value.length;e.setSelectionRange(t,t)}O((0,l.resolveShiftIntoView)(e))}},[]),j=(e,t,n=p)=>{if(!S)return n(e,t);let r=(0,c.readTypedDateCommitValue)(e);return r===null?{status:`rejected`,message:x.enterDate}:n(r,t)};return e.r(()=>{g?.(()=>{j(C)})}),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`input`,{ref:A,type:S?`text`:`date`,value:C,onChange:e=>{w(e.target.value),E(null)},onKeyDown:u({value:C,onCommit:j,onCancel:m,onRejected:E,enterMove:v,onCommitToSelection:h===void 0?void 0:e=>j(e,void 0,e=>h(e)),blockHomeEnd:!S}),onBlur:()=>{let e=j(C);e&&e.status===`rejected`&&m()},"aria-label":s,"aria-invalid":T!==null||void 0,className:(0,a.cx)(`ssg-cell-editor-input`,T!==null&&`ssg-cell-editor-input--invalid`),style:_||D>0?{..._?{textAlign:_}:null,...D>0?{position:`relative`,left:-D}:null}:void 0}),T===null?null:(0,o.jsx)(n.t,{message:T})]})}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { t as e } from "./usePopupLocaleText-Cfb4fQ8G.js";
|
|
2
|
+
import { cx as t } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/cx";
|
|
3
|
+
import { formatLocaleText as n } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
4
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { formatDateKey as o } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
6
|
+
import { buildCalendarDayCells as s, buildYearGrid as c, yearGridStart as l } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/datePickerCalendar";
|
|
7
|
+
//#region src/view/DateEditorCalendar.tsx
|
|
8
|
+
function u({ controller: u, snapshot: d, timeInput: f, timeInputLabel: p, timeInputRef: m, onTimeKeyDown: h, onTimeBlur: g, notice: _ }) {
|
|
9
|
+
let v = e(), { calendarYear: y, calendarMonth: b, calendarView: x, selectedDate: S } = d, C = o(/* @__PURE__ */ new Date()), w = x === "days" ? n(v.calendarTitle, {
|
|
10
|
+
year: y,
|
|
11
|
+
month: b + 1
|
|
12
|
+
}) : x === "months" ? n(v.calendarYear, { year: y }) : `${l(y)} – ${l(y) + 11}`;
|
|
13
|
+
return /* @__PURE__ */ a(r, { children: [
|
|
14
|
+
_,
|
|
15
|
+
/* @__PURE__ */ a("div", {
|
|
16
|
+
className: "ssg-dp-nav",
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ i("button", {
|
|
19
|
+
type: "button",
|
|
20
|
+
tabIndex: -1,
|
|
21
|
+
className: "ssg-dp-nav-btn",
|
|
22
|
+
"aria-label": v.calendarPrevious,
|
|
23
|
+
onClick: () => u.navigate(-1),
|
|
24
|
+
children: "‹"
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ i("button", {
|
|
27
|
+
type: "button",
|
|
28
|
+
tabIndex: -1,
|
|
29
|
+
className: "ssg-dp-nav-title",
|
|
30
|
+
disabled: x === "years",
|
|
31
|
+
"aria-label": v.calendarChangeView,
|
|
32
|
+
onClick: () => u.drillUp(),
|
|
33
|
+
children: w
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ i("button", {
|
|
36
|
+
type: "button",
|
|
37
|
+
tabIndex: -1,
|
|
38
|
+
className: "ssg-dp-nav-btn",
|
|
39
|
+
"aria-label": v.calendarNext,
|
|
40
|
+
onClick: () => u.navigate(1),
|
|
41
|
+
children: "›"
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
}),
|
|
45
|
+
x === "days" ? /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("div", {
|
|
46
|
+
className: "ssg-dp-dow",
|
|
47
|
+
"aria-hidden": "true",
|
|
48
|
+
children: v.calendarWeekdays.map((e, n) => /* @__PURE__ */ i("span", {
|
|
49
|
+
className: t(n === 0 && "ssg-dp-dow--sun", n === 6 && "ssg-dp-dow--sat"),
|
|
50
|
+
children: e
|
|
51
|
+
}, n))
|
|
52
|
+
}), /* @__PURE__ */ i("div", {
|
|
53
|
+
className: "ssg-dp-days",
|
|
54
|
+
children: s(y, b).map((e) => /* @__PURE__ */ i("button", {
|
|
55
|
+
type: "button",
|
|
56
|
+
tabIndex: -1,
|
|
57
|
+
className: t("ssg-dp-day", !e.inCurrentMonth && "ssg-dp-day--out", e.key === C && "ssg-dp-day--today", e.key === S && "ssg-dp-day--selected"),
|
|
58
|
+
"aria-label": e.key,
|
|
59
|
+
"aria-pressed": e.key === S,
|
|
60
|
+
onClick: () => u.chooseDay(e.key),
|
|
61
|
+
children: e.day
|
|
62
|
+
}, e.key))
|
|
63
|
+
})] }) : /* @__PURE__ */ i("div", {
|
|
64
|
+
className: "ssg-dp-grid",
|
|
65
|
+
children: x === "months" ? v.calendarMonths.map((e, n) => /* @__PURE__ */ i("button", {
|
|
66
|
+
type: "button",
|
|
67
|
+
tabIndex: -1,
|
|
68
|
+
className: t("ssg-dp-cell", n === b && "ssg-dp-cell--selected"),
|
|
69
|
+
onClick: () => u.chooseMonth(n),
|
|
70
|
+
children: e
|
|
71
|
+
}, n)) : c(y).map((e) => /* @__PURE__ */ i("button", {
|
|
72
|
+
type: "button",
|
|
73
|
+
tabIndex: -1,
|
|
74
|
+
className: t("ssg-dp-cell", e === y && "ssg-dp-cell--selected"),
|
|
75
|
+
onClick: () => u.chooseYear(e),
|
|
76
|
+
children: e
|
|
77
|
+
}, e))
|
|
78
|
+
}),
|
|
79
|
+
f ? /* @__PURE__ */ a("label", {
|
|
80
|
+
className: "ssg-date-editor-time",
|
|
81
|
+
children: [/* @__PURE__ */ i("span", {
|
|
82
|
+
className: "ssg-date-editor-time-label",
|
|
83
|
+
children: p
|
|
84
|
+
}), /* @__PURE__ */ i("input", {
|
|
85
|
+
ref: m,
|
|
86
|
+
type: "text",
|
|
87
|
+
inputMode: "numeric",
|
|
88
|
+
autoComplete: "off",
|
|
89
|
+
spellCheck: !1,
|
|
90
|
+
className: "ssg-date-editor-time-input",
|
|
91
|
+
value: d.timeText,
|
|
92
|
+
placeholder: "--:--",
|
|
93
|
+
onChange: (e) => u.inputTime(e.target.value, e.nativeEvent.isComposing === !0),
|
|
94
|
+
onCompositionEnd: (e) => u.inputTime(e.currentTarget.value, !1),
|
|
95
|
+
onKeyDown: h,
|
|
96
|
+
onBlur: g
|
|
97
|
+
})]
|
|
98
|
+
}) : null,
|
|
99
|
+
/* @__PURE__ */ a("div", {
|
|
100
|
+
className: "ssg-dp-foot",
|
|
101
|
+
children: [
|
|
102
|
+
x === "days" ? null : /* @__PURE__ */ i("button", {
|
|
103
|
+
type: "button",
|
|
104
|
+
tabIndex: -1,
|
|
105
|
+
className: "ssg-dp-foot-btn",
|
|
106
|
+
onClick: () => u.drillDown(),
|
|
107
|
+
children: v.calendarBack
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ i("button", {
|
|
110
|
+
type: "button",
|
|
111
|
+
tabIndex: -1,
|
|
112
|
+
className: "ssg-dp-foot-btn",
|
|
113
|
+
onClick: () => u.chooseToday(),
|
|
114
|
+
children: v.calendarToday
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ i("button", {
|
|
117
|
+
type: "button",
|
|
118
|
+
tabIndex: -1,
|
|
119
|
+
className: "ssg-dp-foot-btn ssg-dp-foot-btn--muted",
|
|
120
|
+
onClick: () => u.clear(),
|
|
121
|
+
children: v.clear
|
|
122
|
+
})
|
|
123
|
+
]
|
|
124
|
+
})
|
|
125
|
+
] });
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
128
|
+
export { u as DateEditorCalendar, u as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./usePopupLocaleText-CmlJsMAf.cjs");let t=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/cx"),n=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText"),r=require("react/jsx-runtime"),i=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering"),a=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/datePickerCalendar");function o({controller:o,snapshot:s,timeInput:c,timeInputLabel:l,timeInputRef:u,onTimeKeyDown:d,onTimeBlur:f,notice:p}){let m=e.t(),{calendarYear:h,calendarMonth:g,calendarView:_,selectedDate:v}=s,y=(0,i.formatDateKey)(new Date),b=_===`days`?(0,n.formatLocaleText)(m.calendarTitle,{year:h,month:g+1}):_===`months`?(0,n.formatLocaleText)(m.calendarYear,{year:h}):`${(0,a.yearGridStart)(h)} – ${(0,a.yearGridStart)(h)+11}`;return(0,r.jsxs)(r.Fragment,{children:[p,(0,r.jsxs)(`div`,{className:`ssg-dp-nav`,children:[(0,r.jsx)(`button`,{type:`button`,tabIndex:-1,className:`ssg-dp-nav-btn`,"aria-label":m.calendarPrevious,onClick:()=>o.navigate(-1),children:`‹`}),(0,r.jsx)(`button`,{type:`button`,tabIndex:-1,className:`ssg-dp-nav-title`,disabled:_===`years`,"aria-label":m.calendarChangeView,onClick:()=>o.drillUp(),children:b}),(0,r.jsx)(`button`,{type:`button`,tabIndex:-1,className:`ssg-dp-nav-btn`,"aria-label":m.calendarNext,onClick:()=>o.navigate(1),children:`›`})]}),_===`days`?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`div`,{className:`ssg-dp-dow`,"aria-hidden":`true`,children:m.calendarWeekdays.map((e,n)=>(0,r.jsx)(`span`,{className:(0,t.cx)(n===0&&`ssg-dp-dow--sun`,n===6&&`ssg-dp-dow--sat`),children:e},n))}),(0,r.jsx)(`div`,{className:`ssg-dp-days`,children:(0,a.buildCalendarDayCells)(h,g).map(e=>(0,r.jsx)(`button`,{type:`button`,tabIndex:-1,className:(0,t.cx)(`ssg-dp-day`,!e.inCurrentMonth&&`ssg-dp-day--out`,e.key===y&&`ssg-dp-day--today`,e.key===v&&`ssg-dp-day--selected`),"aria-label":e.key,"aria-pressed":e.key===v,onClick:()=>o.chooseDay(e.key),children:e.day},e.key))})]}):(0,r.jsx)(`div`,{className:`ssg-dp-grid`,children:_===`months`?m.calendarMonths.map((e,n)=>(0,r.jsx)(`button`,{type:`button`,tabIndex:-1,className:(0,t.cx)(`ssg-dp-cell`,n===g&&`ssg-dp-cell--selected`),onClick:()=>o.chooseMonth(n),children:e},n)):(0,a.buildYearGrid)(h).map(e=>(0,r.jsx)(`button`,{type:`button`,tabIndex:-1,className:(0,t.cx)(`ssg-dp-cell`,e===h&&`ssg-dp-cell--selected`),onClick:()=>o.chooseYear(e),children:e},e))}),c?(0,r.jsxs)(`label`,{className:`ssg-date-editor-time`,children:[(0,r.jsx)(`span`,{className:`ssg-date-editor-time-label`,children:l}),(0,r.jsx)(`input`,{ref:u,type:`text`,inputMode:`numeric`,autoComplete:`off`,spellCheck:!1,className:`ssg-date-editor-time-input`,value:s.timeText,placeholder:`--:--`,onChange:e=>o.inputTime(e.target.value,e.nativeEvent.isComposing===!0),onCompositionEnd:e=>o.inputTime(e.currentTarget.value,!1),onKeyDown:d,onBlur:f})]}):null,(0,r.jsxs)(`div`,{className:`ssg-dp-foot`,children:[_===`days`?null:(0,r.jsx)(`button`,{type:`button`,tabIndex:-1,className:`ssg-dp-foot-btn`,onClick:()=>o.drillDown(),children:m.calendarBack}),(0,r.jsx)(`button`,{type:`button`,tabIndex:-1,className:`ssg-dp-foot-btn`,onClick:()=>o.chooseToday(),children:m.calendarToday}),(0,r.jsx)(`button`,{type:`button`,tabIndex:-1,className:`ssg-dp-foot-btn ssg-dp-foot-btn--muted`,onClick:()=>o.clear(),children:m.clear})]})]})}exports.DateEditorCalendar=o,exports.default=o;
|