@flanksource/clicky-ui 0.3.82 → 0.3.84
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/dist/components/DateField.cjs.map +1 -1
- package/dist/components/DateField.d.ts +3 -2
- package/dist/components/DateField.d.ts.map +1 -1
- package/dist/components/DateField.js.map +1 -1
- package/dist/components/DatePicker.cjs +9 -61
- package/dist/components/DatePicker.cjs.map +1 -1
- package/dist/components/DatePicker.d.ts +5 -19
- package/dist/components/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker.js +11 -63
- package/dist/components/DatePicker.js.map +1 -1
- package/dist/components/DateTimePicker.cjs +9 -78
- package/dist/components/DateTimePicker.cjs.map +1 -1
- package/dist/components/DateTimePicker.d.ts +5 -19
- package/dist/components/DateTimePicker.d.ts.map +1 -1
- package/dist/components/DateTimePicker.js +11 -80
- package/dist/components/DateTimePicker.js.map +1 -1
- package/dist/components/calendar-grid.cjs +83 -0
- package/dist/components/calendar-grid.cjs.map +1 -0
- package/dist/components/calendar-grid.d.ts +9 -0
- package/dist/components/calendar-grid.d.ts.map +1 -0
- package/dist/components/calendar-grid.js +83 -0
- package/dist/components/calendar-grid.js.map +1 -0
- package/dist/components/date-input-field.cjs +88 -0
- package/dist/components/date-input-field.cjs.map +1 -0
- package/dist/components/date-input-field.d.ts +37 -0
- package/dist/components/date-input-field.d.ts.map +1 -0
- package/dist/components/date-input-field.js +88 -0
- package/dist/components/date-input-field.js.map +1 -0
- package/dist/components/date-math.cjs +67 -0
- package/dist/components/date-math.cjs.map +1 -0
- package/dist/components/date-math.d.ts +33 -0
- package/dist/components/date-math.d.ts.map +1 -0
- package/dist/components/date-math.js +60 -0
- package/dist/components/date-math.js.map +1 -0
- package/dist/components/date-picker-menu.cjs +129 -0
- package/dist/components/date-picker-menu.cjs.map +1 -0
- package/dist/components/date-picker-menu.d.ts +18 -0
- package/dist/components/date-picker-menu.d.ts.map +1 -0
- package/dist/components/date-picker-menu.js +129 -0
- package/dist/components/date-picker-menu.js.map +1 -0
- package/dist/components/json-schema-form-date-math.cjs +15 -11
- package/dist/components/json-schema-form-date-math.cjs.map +1 -1
- package/dist/components/json-schema-form-date-math.d.ts +3 -0
- package/dist/components/json-schema-form-date-math.d.ts.map +1 -1
- package/dist/components/json-schema-form-date-math.js +15 -12
- package/dist/components/json-schema-form-date-math.js.map +1 -1
- package/dist/components.d.ts +1 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/data/PromptDialog.cjs +19 -5
- package/dist/data/PromptDialog.cjs.map +1 -1
- package/dist/data/PromptDialog.d.ts +15 -1
- package/dist/data/PromptDialog.d.ts.map +1 -1
- package/dist/data/PromptDialog.js +19 -5
- package/dist/data/PromptDialog.js.map +1 -1
- package/dist/data/PromptIndicator.cjs +3 -2
- package/dist/data/PromptIndicator.cjs.map +1 -1
- package/dist/data/PromptIndicator.d.ts +4 -1
- package/dist/data/PromptIndicator.d.ts.map +1 -1
- package/dist/data/PromptIndicator.js +3 -2
- package/dist/data/PromptIndicator.js.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.cjs +155 -110
- package/dist/data/diagnostics/ErrorDetails.cjs.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.d.ts.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.js +155 -110
- package/dist/data/diagnostics/ErrorDetails.js.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.cjs +109 -46
- package/dist/data/test-runner/TestDetailPanel.cjs.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.d.ts.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.js +110 -47
- package/dist/data/test-runner/TestDetailPanel.js.map +1 -1
- package/dist/data/test-runner/TestTreeNode.cjs +84 -63
- package/dist/data/test-runner/TestTreeNode.cjs.map +1 -1
- package/dist/data/test-runner/TestTreeNode.d.ts.map +1 -1
- package/dist/data/test-runner/TestTreeNode.js +84 -63
- package/dist/data/test-runner/TestTreeNode.js.map +1 -1
- package/dist/data/test-runner/adapter.cjs.map +1 -1
- package/dist/data/test-runner/adapter.d.ts +2 -2
- package/dist/data/test-runner/adapter.d.ts.map +1 -1
- package/dist/data/test-runner/adapter.js.map +1 -1
- package/dist/data/test-runner/copy.cjs +62 -10
- package/dist/data/test-runner/copy.cjs.map +1 -1
- package/dist/data/test-runner/copy.d.ts +52 -9
- package/dist/data/test-runner/copy.d.ts.map +1 -1
- package/dist/data/test-runner/copy.js +60 -11
- package/dist/data/test-runner/copy.js.map +1 -1
- package/dist/data/test-runner/index.d.ts +1 -1
- package/dist/data/test-runner/index.d.ts.map +1 -1
- package/dist/data/verification/StepFilesView.cjs +90 -0
- package/dist/data/verification/StepFilesView.cjs.map +1 -0
- package/dist/data/verification/StepFilesView.d.ts +9 -0
- package/dist/data/verification/StepFilesView.d.ts.map +1 -0
- package/dist/data/verification/StepFilesView.js +90 -0
- package/dist/data/verification/StepFilesView.js.map +1 -0
- package/dist/data/verification/adapterViews.cjs +129 -69
- package/dist/data/verification/adapterViews.cjs.map +1 -1
- package/dist/data/verification/adapterViews.d.ts +3 -1
- package/dist/data/verification/adapterViews.d.ts.map +1 -1
- package/dist/data/verification/adapterViews.js +130 -70
- package/dist/data/verification/adapterViews.js.map +1 -1
- package/dist/data/verification/adapters.cjs +9 -0
- package/dist/data/verification/adapters.cjs.map +1 -1
- package/dist/data/verification/adapters.d.ts +2 -0
- package/dist/data/verification/adapters.d.ts.map +1 -1
- package/dist/data/verification/adapters.js +11 -2
- package/dist/data/verification/adapters.js.map +1 -1
- package/dist/data/verification/index.d.ts +2 -1
- package/dist/data/verification/index.d.ts.map +1 -1
- package/dist/data/verification/stepKind.cjs +63 -7
- package/dist/data/verification/stepKind.cjs.map +1 -1
- package/dist/data/verification/stepKind.d.ts +55 -6
- package/dist/data/verification/stepKind.d.ts.map +1 -1
- package/dist/data/verification/stepKind.js +62 -8
- package/dist/data/verification/stepKind.js.map +1 -1
- package/dist/data/verification/stepKindViews.cjs +318 -106
- package/dist/data/verification/stepKindViews.cjs.map +1 -1
- package/dist/data/verification/stepKindViews.d.ts +17 -6
- package/dist/data/verification/stepKindViews.d.ts.map +1 -1
- package/dist/data/verification/stepKindViews.js +319 -108
- package/dist/data/verification/stepKindViews.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/data.cjs +4 -0
- package/dist/data.d.ts +1 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +3 -2
- package/dist/hooks/use-prompts.cjs +52 -30
- package/dist/hooks/use-prompts.cjs.map +1 -1
- package/dist/hooks/use-prompts.d.ts +6 -0
- package/dist/hooks/use-prompts.d.ts.map +1 -1
- package/dist/hooks/use-prompts.js +52 -30
- package/dist/hooks/use-prompts.js.map +1 -1
- package/dist/index.cjs +5 -1
- package/dist/index.js +4 -3
- package/dist/runtime/barrels.json +5874 -5867
- package/dist/runtime/importmap.json +2175 -2170
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.cjs","names":["forwardRef","DateTimePicker","DatePicker"],"sources":["../../src/components/DateField.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { DatePicker } from \"./DatePicker\";\nimport { DateTimePicker } from \"./DateTimePicker\";\nimport type { ClearableFieldProps } from \"./field-clear-button\";\n\nexport type DateFieldMode = \"date\" | \"datetime\";\n\nexport type DateFieldProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n // `prefix` is a global HTML attribute typed as string; omit it so our\n // ReactNode adornment prop below is not intersected down to `string & ReactNode`.\n \"type\" | \"value\" | \"onChange\" | \"prefix\"\n> & ClearableFieldProps & {\n /** Selects native date input or date-time input behavior. */\n mode?: DateFieldMode;\n /** ISO date or datetime-local string shown in the input. */\n value?: string;\n /** Called with the next ISO-like value whenever the input changes. */\n onChange?: (value: string) => void;\n /** Classes applied to the outer picker wrapper. */\n className?: string;\n /** Classes applied to the text input. */\n inputClassName?: string;\n /** Classes applied to the calendar/open button. */\n buttonClassName?: string;\n /** Accessible label for the calendar/open button. */\n openButtonLabel?: string;\n /** Trailing in-field adornment, rendered left of the calendar button. */\n suffix?: ReactNode;\n /** Leading in-field adornment, rendered at the left edge of the input. */\n prefix?: ReactNode;\n};\n\nexport const DateField = forwardRef<HTMLInputElement, DateFieldProps>(\n ({ mode = \"date\", ...props }, ref) => {\n if (mode === \"datetime\") {\n return <DateTimePicker ref={ref} {...props} />;\n }\n\n return <DatePicker ref={ref} {...props} />;\n },\n);\n\nDateField.displayName = \"DateField\";\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"DateField.cjs","names":["forwardRef","DateTimePicker","DatePicker"],"sources":["../../src/components/DateField.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { DatePicker } from \"./DatePicker\";\nimport { DateTimePicker } from \"./DateTimePicker\";\nimport type { DateMathProps } from \"./date-math\";\nimport type { ClearableFieldProps } from \"./field-clear-button\";\n\nexport type DateFieldMode = \"date\" | \"datetime\";\n\nexport type DateFieldProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n // `prefix` is a global HTML attribute typed as string; omit it so our\n // ReactNode adornment prop below is not intersected down to `string & ReactNode`.\n \"type\" | \"value\" | \"onChange\" | \"prefix\"\n> & ClearableFieldProps & DateMathProps & {\n /** Selects native date input or date-time input behavior. */\n mode?: DateFieldMode;\n /** ISO date or datetime-local string shown in the input. */\n value?: string;\n /** Called with the next ISO-like value whenever the input changes. */\n onChange?: (value: string) => void;\n /** Classes applied to the outer picker wrapper. */\n className?: string;\n /** Classes applied to the text input. */\n inputClassName?: string;\n /** Classes applied to the calendar/open button. */\n buttonClassName?: string;\n /** Accessible label for the calendar/open button. */\n openButtonLabel?: string;\n /** Trailing in-field adornment, rendered left of the calendar button. */\n suffix?: ReactNode;\n /** Leading in-field adornment, rendered at the left edge of the input. */\n prefix?: ReactNode;\n};\n\nexport const DateField = forwardRef<HTMLInputElement, DateFieldProps>(\n ({ mode = \"date\", ...props }, ref) => {\n if (mode === \"datetime\") {\n return <DateTimePicker ref={ref} {...props} />;\n }\n\n return <DatePicker ref={ref} {...props} />;\n },\n);\n\nDateField.displayName = \"DateField\";\n"],"mappings":";;;;;AAkCA,IAAa,aAAA,GAAYA,MAAAA,WAAAA,EACtB,EAAE,OAAO,QAAQ,GAAG,SAAS,QAAQ;CACpC,IAAI,SAAS,YACX,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,uBAAAA,gBAAD;EAAqB;EAAK,GAAI;CAAQ,CAAA;CAG/C,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,YAAD;EAAiB;EAAK,GAAI;CAAQ,CAAA;AAC3C,CACF;AAEA,UAAU,cAAc"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { DateMathProps } from './date-math.js';
|
|
2
3
|
import { ClearableFieldProps } from './field-clear-button.js';
|
|
3
4
|
export type DateFieldMode = "date" | "datetime";
|
|
4
|
-
export type DateFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange" | "prefix"> & ClearableFieldProps & {
|
|
5
|
+
export type DateFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange" | "prefix"> & ClearableFieldProps & DateMathProps & {
|
|
5
6
|
/** Selects native date input or date-time input behavior. */
|
|
6
7
|
mode?: DateFieldMode;
|
|
7
8
|
/** ISO date or datetime-local string shown in the input. */
|
|
@@ -21,7 +22,7 @@ export type DateFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type"
|
|
|
21
22
|
/** Leading in-field adornment, rendered at the left edge of the input. */
|
|
22
23
|
prefix?: ReactNode;
|
|
23
24
|
};
|
|
24
|
-
export declare const DateField: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & ClearableFieldProps & {
|
|
25
|
+
export declare const DateField: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & ClearableFieldProps & DateMathProps & {
|
|
25
26
|
/** Selects native date input or date-time input behavior. */
|
|
26
27
|
mode?: DateFieldMode;
|
|
27
28
|
/** ISO date or datetime-local string shown in the input. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.d.ts","sourceRoot":"","sources":["../../src/components/DateField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,mBAAmB,CAAC,gBAAgB,CAAC,EAGrC,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CACzC,GAAG,mBAAmB,GAAG;
|
|
1
|
+
{"version":3,"file":"DateField.d.ts","sourceRoot":"","sources":["../../src/components/DateField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,mBAAmB,CAAC,gBAAgB,CAAC,EAGrC,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CACzC,GAAG,mBAAmB,GAAG,aAAa,GAAG;IACxC,6DAA6D;IAC7D,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mDAAmD;IACnD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qDAAqD;IACrD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,SAAS;IApBpB,6DAA6D;WACtD,aAAa;IACpB,4DAA4D;YACpD,MAAM;IACd,sEAAsE;eAC3D,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;IAClC,mDAAmD;gBACvC,MAAM;IAClB,yCAAyC;qBACxB,MAAM;IACvB,mDAAmD;sBACjC,MAAM;IACxB,qDAAqD;sBACnC,MAAM;IACxB,yEAAyE;aAChE,SAAS;IAClB,0EAA0E;aACjE,SAAS;oDAWnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.js","names":[],"sources":["../../src/components/DateField.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { DatePicker } from \"./DatePicker\";\nimport { DateTimePicker } from \"./DateTimePicker\";\nimport type { ClearableFieldProps } from \"./field-clear-button\";\n\nexport type DateFieldMode = \"date\" | \"datetime\";\n\nexport type DateFieldProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n // `prefix` is a global HTML attribute typed as string; omit it so our\n // ReactNode adornment prop below is not intersected down to `string & ReactNode`.\n \"type\" | \"value\" | \"onChange\" | \"prefix\"\n> & ClearableFieldProps & {\n /** Selects native date input or date-time input behavior. */\n mode?: DateFieldMode;\n /** ISO date or datetime-local string shown in the input. */\n value?: string;\n /** Called with the next ISO-like value whenever the input changes. */\n onChange?: (value: string) => void;\n /** Classes applied to the outer picker wrapper. */\n className?: string;\n /** Classes applied to the text input. */\n inputClassName?: string;\n /** Classes applied to the calendar/open button. */\n buttonClassName?: string;\n /** Accessible label for the calendar/open button. */\n openButtonLabel?: string;\n /** Trailing in-field adornment, rendered left of the calendar button. */\n suffix?: ReactNode;\n /** Leading in-field adornment, rendered at the left edge of the input. */\n prefix?: ReactNode;\n};\n\nexport const DateField = forwardRef<HTMLInputElement, DateFieldProps>(\n ({ mode = \"date\", ...props }, ref) => {\n if (mode === \"datetime\") {\n return <DateTimePicker ref={ref} {...props} />;\n }\n\n return <DatePicker ref={ref} {...props} />;\n },\n);\n\nDateField.displayName = \"DateField\";\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"DateField.js","names":[],"sources":["../../src/components/DateField.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { DatePicker } from \"./DatePicker\";\nimport { DateTimePicker } from \"./DateTimePicker\";\nimport type { DateMathProps } from \"./date-math\";\nimport type { ClearableFieldProps } from \"./field-clear-button\";\n\nexport type DateFieldMode = \"date\" | \"datetime\";\n\nexport type DateFieldProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n // `prefix` is a global HTML attribute typed as string; omit it so our\n // ReactNode adornment prop below is not intersected down to `string & ReactNode`.\n \"type\" | \"value\" | \"onChange\" | \"prefix\"\n> & ClearableFieldProps & DateMathProps & {\n /** Selects native date input or date-time input behavior. */\n mode?: DateFieldMode;\n /** ISO date or datetime-local string shown in the input. */\n value?: string;\n /** Called with the next ISO-like value whenever the input changes. */\n onChange?: (value: string) => void;\n /** Classes applied to the outer picker wrapper. */\n className?: string;\n /** Classes applied to the text input. */\n inputClassName?: string;\n /** Classes applied to the calendar/open button. */\n buttonClassName?: string;\n /** Accessible label for the calendar/open button. */\n openButtonLabel?: string;\n /** Trailing in-field adornment, rendered left of the calendar button. */\n suffix?: ReactNode;\n /** Leading in-field adornment, rendered at the left edge of the input. */\n prefix?: ReactNode;\n};\n\nexport const DateField = forwardRef<HTMLInputElement, DateFieldProps>(\n ({ mode = \"date\", ...props }, ref) => {\n if (mode === \"datetime\") {\n return <DateTimePicker ref={ref} {...props} />;\n }\n\n return <DatePicker ref={ref} {...props} />;\n },\n);\n\nDateField.displayName = \"DateField\";\n"],"mappings":";;;;;AAkCA,IAAa,YAAY,YACtB,EAAE,OAAO,QAAQ,GAAG,SAAS,QAAQ;CACpC,IAAI,SAAS,YACX,OAAO,oBAAC,gBAAD;EAAqB;EAAK,GAAI;CAAQ,CAAA;CAG/C,OAAO,oBAAC,YAAD;EAAiB;EAAK,GAAI;CAAQ,CAAA;AAC3C,CACF;AAEA,UAAU,cAAc"}
|
|
@@ -1,67 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const require_utils = require("../lib/utils.cjs");
|
|
4
|
-
const require_field_clear_button = require("./field-clear-button.cjs");
|
|
1
|
+
const require_date_math = require("./date-math.cjs");
|
|
2
|
+
const require_date_input_field = require("./date-input-field.cjs");
|
|
5
3
|
let react = require("react");
|
|
6
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
5
|
// src/components/DatePicker.tsx
|
|
8
|
-
var DatePicker = (0, react.forwardRef)(({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
17
|
-
"data-jsf-control": true,
|
|
18
|
-
"data-clearable-field": true,
|
|
19
|
-
className: require_utils.cn("relative", className),
|
|
20
|
-
children: [
|
|
21
|
-
prefix && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22
|
-
className: "absolute inset-y-0 left-1.5 flex items-center",
|
|
23
|
-
children: prefix
|
|
24
|
-
}),
|
|
25
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
26
|
-
...props,
|
|
27
|
-
ref: assignRef,
|
|
28
|
-
type: "date",
|
|
29
|
-
value,
|
|
30
|
-
className: require_utils.cn("h-control-h w-full rounded-md border border-input bg-background px-control-px pr-8 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring", "[&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none", prefix && "pl-8", inputClassName, (showClear || suffix) && "pr-16", showClear && suffix && "pr-24"),
|
|
31
|
-
onChange: (event) => onChange?.(event.target.value)
|
|
32
|
-
}),
|
|
33
|
-
suffix && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
34
|
-
className: require_utils.cn("absolute inset-y-0 flex items-center", showClear ? "right-14" : "right-7"),
|
|
35
|
-
children: suffix
|
|
36
|
-
}),
|
|
37
|
-
showClear && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
38
|
-
className: "absolute inset-y-0 right-7 flex items-center",
|
|
39
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_field_clear_button.FieldClearButton, {
|
|
40
|
-
...clearLabel ? { clearLabel } : {},
|
|
41
|
-
onClear: () => {
|
|
42
|
-
if (onClear) onClear();
|
|
43
|
-
else onChange?.("");
|
|
44
|
-
localRef.current?.focus();
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
}),
|
|
48
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
49
|
-
type: "button",
|
|
50
|
-
"aria-label": openButtonLabel,
|
|
51
|
-
disabled: props.disabled || props.readOnly,
|
|
52
|
-
className: require_utils.cn("absolute inset-y-0 right-1 inline-flex items-center text-muted-foreground", buttonClassName),
|
|
53
|
-
onClick: () => {
|
|
54
|
-
localRef.current?.focus();
|
|
55
|
-
localRef.current?.showPicker?.();
|
|
56
|
-
},
|
|
57
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
58
|
-
icon: require_UiCalendar.UiCalendar,
|
|
59
|
-
className: "text-sm"
|
|
60
|
-
})
|
|
61
|
-
})
|
|
62
|
-
]
|
|
63
|
-
});
|
|
64
|
-
});
|
|
6
|
+
var DatePicker = (0, react.forwardRef)(({ openButtonLabel = "Open date picker", dateMathPresets = require_date_math.DATE_PICKER_DATE_MATH_PRESETS, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_date_input_field.DateInputField, {
|
|
7
|
+
...props,
|
|
8
|
+
ref,
|
|
9
|
+
openButtonLabel,
|
|
10
|
+
dateMathPresets,
|
|
11
|
+
withTime: false
|
|
12
|
+
}));
|
|
65
13
|
DatePicker.displayName = "DatePicker";
|
|
66
14
|
exports.DatePicker = DatePicker;
|
|
67
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.cjs","names":["forwardRef","
|
|
1
|
+
{"version":3,"file":"DatePicker.cjs","names":["forwardRef","DATE_PICKER_DATE_MATH_PRESETS","DateInputField"],"sources":["../../src/components/DatePicker.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { DATE_PICKER_DATE_MATH_PRESETS } from \"./date-math\";\nimport { DateInputField, type DateFieldProps } from \"./date-input-field\";\n\nexport type DatePickerProps = DateFieldProps;\n\nexport const DatePicker = forwardRef<HTMLInputElement, DatePickerProps>(\n (\n {\n openButtonLabel = \"Open date picker\",\n dateMathPresets = DATE_PICKER_DATE_MATH_PRESETS,\n ...props\n },\n ref,\n ) => (\n <DateInputField\n {...props}\n ref={ref}\n openButtonLabel={openButtonLabel}\n dateMathPresets={dateMathPresets}\n withTime={false}\n />\n ),\n);\n\nDatePicker.displayName = \"DatePicker\";\n"],"mappings":";;;;;AAMA,IAAa,cAAA,GAAaA,MAAAA,WAAAA,EAEtB,EACE,kBAAkB,oBAClB,kBAAkBC,kBAAAA,+BAClB,GAAG,SAEL,QAEA,iBAAA,GAAA,kBAAA,IAAA,CAACC,yBAAAA,gBAAD;CACE,GAAI;CACC;CACY;CACA;CACjB,UAAU;AACX,CAAA,CAEL;AAEA,WAAW,cAAc"}
|
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { DateFieldProps } from './date-input-field.js';
|
|
2
|
+
export type DatePickerProps = DateFieldProps;
|
|
3
|
+
export declare const DatePicker: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & import('./field-clear-button.js').ClearableFieldProps & import('./date-math.js').DateMathProps & {
|
|
4
4
|
value?: string;
|
|
5
5
|
onChange?: (value: string) => void;
|
|
6
6
|
className?: string;
|
|
7
7
|
inputClassName?: string;
|
|
8
8
|
buttonClassName?: string;
|
|
9
9
|
openButtonLabel?: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/** Leading in-field adornment, rendered at the left edge of the input. */
|
|
13
|
-
prefix?: ReactNode;
|
|
14
|
-
};
|
|
15
|
-
export declare const DatePicker: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & ClearableFieldProps & {
|
|
16
|
-
value?: string;
|
|
17
|
-
onChange?: (value: string) => void;
|
|
18
|
-
className?: string;
|
|
19
|
-
inputClassName?: string;
|
|
20
|
-
buttonClassName?: string;
|
|
21
|
-
openButtonLabel?: string;
|
|
22
|
-
/** Trailing in-field adornment, rendered left of the calendar button. */
|
|
23
|
-
suffix?: ReactNode;
|
|
24
|
-
/** Leading in-field adornment, rendered at the left edge of the input. */
|
|
25
|
-
prefix?: ReactNode;
|
|
10
|
+
suffix?: import('react').ReactNode;
|
|
11
|
+
prefix?: import('react').ReactNode;
|
|
26
12
|
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
27
13
|
//# sourceMappingURL=DatePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../src/components/DatePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../src/components/DatePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC;AAE7C,eAAO,MAAM,UAAU;;;;;;;;;oDAiBtB,CAAC"}
|
|
@@ -1,67 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { forwardRef, useRef } from "react";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { DATE_PICKER_DATE_MATH_PRESETS } from "./date-math.js";
|
|
2
|
+
import { DateInputField } from "./date-input-field.js";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
5
|
// src/components/DatePicker.tsx
|
|
8
|
-
var DatePicker = forwardRef(({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
17
|
-
"data-jsf-control": true,
|
|
18
|
-
"data-clearable-field": true,
|
|
19
|
-
className: cn("relative", className),
|
|
20
|
-
children: [
|
|
21
|
-
prefix && /* @__PURE__ */ jsx("div", {
|
|
22
|
-
className: "absolute inset-y-0 left-1.5 flex items-center",
|
|
23
|
-
children: prefix
|
|
24
|
-
}),
|
|
25
|
-
/* @__PURE__ */ jsx("input", {
|
|
26
|
-
...props,
|
|
27
|
-
ref: assignRef,
|
|
28
|
-
type: "date",
|
|
29
|
-
value,
|
|
30
|
-
className: cn("h-control-h w-full rounded-md border border-input bg-background px-control-px pr-8 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring", "[&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none", prefix && "pl-8", inputClassName, (showClear || suffix) && "pr-16", showClear && suffix && "pr-24"),
|
|
31
|
-
onChange: (event) => onChange?.(event.target.value)
|
|
32
|
-
}),
|
|
33
|
-
suffix && /* @__PURE__ */ jsx("div", {
|
|
34
|
-
className: cn("absolute inset-y-0 flex items-center", showClear ? "right-14" : "right-7"),
|
|
35
|
-
children: suffix
|
|
36
|
-
}),
|
|
37
|
-
showClear && /* @__PURE__ */ jsx("span", {
|
|
38
|
-
className: "absolute inset-y-0 right-7 flex items-center",
|
|
39
|
-
children: /* @__PURE__ */ jsx(FieldClearButton, {
|
|
40
|
-
...clearLabel ? { clearLabel } : {},
|
|
41
|
-
onClear: () => {
|
|
42
|
-
if (onClear) onClear();
|
|
43
|
-
else onChange?.("");
|
|
44
|
-
localRef.current?.focus();
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
}),
|
|
48
|
-
/* @__PURE__ */ jsx("button", {
|
|
49
|
-
type: "button",
|
|
50
|
-
"aria-label": openButtonLabel,
|
|
51
|
-
disabled: props.disabled || props.readOnly,
|
|
52
|
-
className: cn("absolute inset-y-0 right-1 inline-flex items-center text-muted-foreground", buttonClassName),
|
|
53
|
-
onClick: () => {
|
|
54
|
-
localRef.current?.focus();
|
|
55
|
-
localRef.current?.showPicker?.();
|
|
56
|
-
},
|
|
57
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
58
|
-
icon: UiCalendar,
|
|
59
|
-
className: "text-sm"
|
|
60
|
-
})
|
|
61
|
-
})
|
|
62
|
-
]
|
|
63
|
-
});
|
|
64
|
-
});
|
|
6
|
+
var DatePicker = forwardRef(({ openButtonLabel = "Open date picker", dateMathPresets = DATE_PICKER_DATE_MATH_PRESETS, ...props }, ref) => /* @__PURE__ */ jsx(DateInputField, {
|
|
7
|
+
...props,
|
|
8
|
+
ref,
|
|
9
|
+
openButtonLabel,
|
|
10
|
+
dateMathPresets,
|
|
11
|
+
withTime: false
|
|
12
|
+
}));
|
|
65
13
|
DatePicker.displayName = "DatePicker";
|
|
66
14
|
export { DatePicker };
|
|
67
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.js","names":[],"sources":["../../src/components/DatePicker.tsx"],"sourcesContent":["import { forwardRef
|
|
1
|
+
{"version":3,"file":"DatePicker.js","names":[],"sources":["../../src/components/DatePicker.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { DATE_PICKER_DATE_MATH_PRESETS } from \"./date-math\";\nimport { DateInputField, type DateFieldProps } from \"./date-input-field\";\n\nexport type DatePickerProps = DateFieldProps;\n\nexport const DatePicker = forwardRef<HTMLInputElement, DatePickerProps>(\n (\n {\n openButtonLabel = \"Open date picker\",\n dateMathPresets = DATE_PICKER_DATE_MATH_PRESETS,\n ...props\n },\n ref,\n ) => (\n <DateInputField\n {...props}\n ref={ref}\n openButtonLabel={openButtonLabel}\n dateMathPresets={dateMathPresets}\n withTime={false}\n />\n ),\n);\n\nDatePicker.displayName = \"DatePicker\";\n"],"mappings":";;;;;AAMA,IAAa,aAAa,YAEtB,EACE,kBAAkB,oBAClB,kBAAkB,+BAClB,GAAG,SAEL,QAEA,oBAAC,gBAAD;CACE,GAAI;CACC;CACY;CACA;CACjB,UAAU;AACX,CAAA,CAEL;AAEA,WAAW,cAAc"}
|
|
@@ -1,85 +1,16 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const require_utils = require("../lib/utils.cjs");
|
|
4
|
-
const require_field_clear_button = require("./field-clear-button.cjs");
|
|
1
|
+
const require_date_math = require("./date-math.cjs");
|
|
2
|
+
const require_date_input_field = require("./date-input-field.cjs");
|
|
5
3
|
let react = require("react");
|
|
6
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
5
|
// src/components/DateTimePicker.tsx
|
|
8
|
-
var DateTimePicker = (0, react.forwardRef)(({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
else if (ref) ref.current = node;
|
|
16
|
-
}
|
|
17
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
18
|
-
"data-jsf-control": true,
|
|
19
|
-
"data-clearable-field": true,
|
|
20
|
-
className: require_utils.cn("relative", className),
|
|
21
|
-
children: [
|
|
22
|
-
prefix && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23
|
-
className: "absolute inset-y-0 left-1.5 flex items-center",
|
|
24
|
-
children: prefix
|
|
25
|
-
}),
|
|
26
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
27
|
-
...props,
|
|
28
|
-
ref: assignRef,
|
|
29
|
-
type: "text",
|
|
30
|
-
value,
|
|
31
|
-
className: require_utils.cn("h-control-h w-full rounded-md border border-input bg-background px-control-px pr-8 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", prefix && "pl-8", inputClassName, (showClear || suffix) && "pr-16", showClear && suffix && "pr-24"),
|
|
32
|
-
onChange: (event) => onChange?.(event.target.value)
|
|
33
|
-
}),
|
|
34
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
35
|
-
ref: pickerRef,
|
|
36
|
-
type: "datetime-local",
|
|
37
|
-
tabIndex: -1,
|
|
38
|
-
"aria-hidden": "true",
|
|
39
|
-
className: "pointer-events-none absolute left-0 top-0 h-0 w-0 opacity-0",
|
|
40
|
-
value: toDateTimeLocalValue(value),
|
|
41
|
-
onChange: (event) => onChange?.(event.target.value)
|
|
42
|
-
}),
|
|
43
|
-
suffix && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
44
|
-
className: require_utils.cn("absolute inset-y-0 flex items-center", showClear ? "right-14" : "right-7"),
|
|
45
|
-
children: suffix
|
|
46
|
-
}),
|
|
47
|
-
showClear && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48
|
-
className: "absolute inset-y-0 right-7 flex items-center",
|
|
49
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_field_clear_button.FieldClearButton, {
|
|
50
|
-
...clearLabel ? { clearLabel } : {},
|
|
51
|
-
onClear: () => {
|
|
52
|
-
if (onClear) onClear();
|
|
53
|
-
else onChange?.("");
|
|
54
|
-
visibleRef.current?.focus();
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
}),
|
|
58
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
59
|
-
type: "button",
|
|
60
|
-
"aria-label": openButtonLabel,
|
|
61
|
-
disabled: props.disabled || props.readOnly,
|
|
62
|
-
className: require_utils.cn("absolute inset-y-0 right-1 inline-flex items-center text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", buttonClassName),
|
|
63
|
-
onClick: () => {
|
|
64
|
-
visibleRef.current?.focus();
|
|
65
|
-
pickerRef.current?.showPicker?.();
|
|
66
|
-
},
|
|
67
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
68
|
-
icon: require_UiCalendar.UiCalendar,
|
|
69
|
-
className: "text-sm"
|
|
70
|
-
})
|
|
71
|
-
})
|
|
72
|
-
]
|
|
73
|
-
});
|
|
74
|
-
});
|
|
6
|
+
var DateTimePicker = (0, react.forwardRef)(({ openButtonLabel = "Open time picker", dateMathPresets = require_date_math.DATE_TIME_PICKER_DATE_MATH_PRESETS, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_date_input_field.DateInputField, {
|
|
7
|
+
...props,
|
|
8
|
+
ref,
|
|
9
|
+
openButtonLabel,
|
|
10
|
+
dateMathPresets,
|
|
11
|
+
withTime: true
|
|
12
|
+
}));
|
|
75
13
|
DateTimePicker.displayName = "DateTimePicker";
|
|
76
|
-
function toDateTimeLocalValue(value) {
|
|
77
|
-
const trimmed = value.trim();
|
|
78
|
-
if (!trimmed) return "";
|
|
79
|
-
if (trimmed === "now" || trimmed.startsWith("now")) return "";
|
|
80
|
-
const withTime = /^\d{4}-\d{2}-\d{2}$/.test(trimmed) ? `${trimmed}T00:00` : trimmed;
|
|
81
|
-
return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(withTime) ? withTime.slice(0, 16) : "";
|
|
82
|
-
}
|
|
83
14
|
exports.DateTimePicker = DateTimePicker;
|
|
84
15
|
|
|
85
16
|
//# sourceMappingURL=DateTimePicker.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePicker.cjs","names":["forwardRef","
|
|
1
|
+
{"version":3,"file":"DateTimePicker.cjs","names":["forwardRef","DATE_TIME_PICKER_DATE_MATH_PRESETS","DateInputField"],"sources":["../../src/components/DateTimePicker.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { DATE_TIME_PICKER_DATE_MATH_PRESETS } from \"./date-math\";\nimport { DateInputField, type DateFieldProps } from \"./date-input-field\";\n\nexport type DateTimePickerProps = DateFieldProps;\n\nexport const DateTimePicker = forwardRef<HTMLInputElement, DateTimePickerProps>(\n (\n {\n openButtonLabel = \"Open time picker\",\n dateMathPresets = DATE_TIME_PICKER_DATE_MATH_PRESETS,\n ...props\n },\n ref,\n ) => (\n <DateInputField\n {...props}\n ref={ref}\n openButtonLabel={openButtonLabel}\n dateMathPresets={dateMathPresets}\n withTime\n />\n ),\n);\n\nDateTimePicker.displayName = \"DateTimePicker\";\n"],"mappings":";;;;;AAMA,IAAa,kBAAA,GAAiBA,MAAAA,WAAAA,EAE1B,EACE,kBAAkB,oBAClB,kBAAkBC,kBAAAA,oCAClB,GAAG,SAEL,QAEA,iBAAA,GAAA,kBAAA,IAAA,CAACC,yBAAAA,gBAAD;CACE,GAAI;CACC;CACY;CACA;CACjB,UAAA;AACD,CAAA,CAEL;AAEA,eAAe,cAAc"}
|
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { DateFieldProps } from './date-input-field.js';
|
|
2
|
+
export type DateTimePickerProps = DateFieldProps;
|
|
3
|
+
export declare const DateTimePicker: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & import('./field-clear-button.js').ClearableFieldProps & import('./date-math.js').DateMathProps & {
|
|
4
4
|
value?: string;
|
|
5
5
|
onChange?: (value: string) => void;
|
|
6
6
|
className?: string;
|
|
7
7
|
inputClassName?: string;
|
|
8
8
|
buttonClassName?: string;
|
|
9
9
|
openButtonLabel?: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/** Leading in-field adornment, rendered at the left edge of the input. */
|
|
13
|
-
prefix?: ReactNode;
|
|
14
|
-
};
|
|
15
|
-
export declare const DateTimePicker: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & ClearableFieldProps & {
|
|
16
|
-
value?: string;
|
|
17
|
-
onChange?: (value: string) => void;
|
|
18
|
-
className?: string;
|
|
19
|
-
inputClassName?: string;
|
|
20
|
-
buttonClassName?: string;
|
|
21
|
-
openButtonLabel?: string;
|
|
22
|
-
/** Trailing in-field adornment, rendered left of the calendar button. */
|
|
23
|
-
suffix?: ReactNode;
|
|
24
|
-
/** Leading in-field adornment, rendered at the left edge of the input. */
|
|
25
|
-
prefix?: ReactNode;
|
|
10
|
+
suffix?: import('react').ReactNode;
|
|
11
|
+
prefix?: import('react').ReactNode;
|
|
26
12
|
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
27
13
|
//# sourceMappingURL=DateTimePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../src/components/DateTimePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../src/components/DateTimePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAEjD,eAAO,MAAM,cAAc;;;;;;;;;oDAiB1B,CAAC"}
|
|
@@ -1,85 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { forwardRef, useRef } from "react";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { DATE_TIME_PICKER_DATE_MATH_PRESETS } from "./date-math.js";
|
|
2
|
+
import { DateInputField } from "./date-input-field.js";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
5
|
// src/components/DateTimePicker.tsx
|
|
8
|
-
var DateTimePicker = forwardRef(({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
else if (ref) ref.current = node;
|
|
16
|
-
}
|
|
17
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
18
|
-
"data-jsf-control": true,
|
|
19
|
-
"data-clearable-field": true,
|
|
20
|
-
className: cn("relative", className),
|
|
21
|
-
children: [
|
|
22
|
-
prefix && /* @__PURE__ */ jsx("div", {
|
|
23
|
-
className: "absolute inset-y-0 left-1.5 flex items-center",
|
|
24
|
-
children: prefix
|
|
25
|
-
}),
|
|
26
|
-
/* @__PURE__ */ jsx("input", {
|
|
27
|
-
...props,
|
|
28
|
-
ref: assignRef,
|
|
29
|
-
type: "text",
|
|
30
|
-
value,
|
|
31
|
-
className: cn("h-control-h w-full rounded-md border border-input bg-background px-control-px pr-8 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", prefix && "pl-8", inputClassName, (showClear || suffix) && "pr-16", showClear && suffix && "pr-24"),
|
|
32
|
-
onChange: (event) => onChange?.(event.target.value)
|
|
33
|
-
}),
|
|
34
|
-
/* @__PURE__ */ jsx("input", {
|
|
35
|
-
ref: pickerRef,
|
|
36
|
-
type: "datetime-local",
|
|
37
|
-
tabIndex: -1,
|
|
38
|
-
"aria-hidden": "true",
|
|
39
|
-
className: "pointer-events-none absolute left-0 top-0 h-0 w-0 opacity-0",
|
|
40
|
-
value: toDateTimeLocalValue(value),
|
|
41
|
-
onChange: (event) => onChange?.(event.target.value)
|
|
42
|
-
}),
|
|
43
|
-
suffix && /* @__PURE__ */ jsx("div", {
|
|
44
|
-
className: cn("absolute inset-y-0 flex items-center", showClear ? "right-14" : "right-7"),
|
|
45
|
-
children: suffix
|
|
46
|
-
}),
|
|
47
|
-
showClear && /* @__PURE__ */ jsx("span", {
|
|
48
|
-
className: "absolute inset-y-0 right-7 flex items-center",
|
|
49
|
-
children: /* @__PURE__ */ jsx(FieldClearButton, {
|
|
50
|
-
...clearLabel ? { clearLabel } : {},
|
|
51
|
-
onClear: () => {
|
|
52
|
-
if (onClear) onClear();
|
|
53
|
-
else onChange?.("");
|
|
54
|
-
visibleRef.current?.focus();
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
}),
|
|
58
|
-
/* @__PURE__ */ jsx("button", {
|
|
59
|
-
type: "button",
|
|
60
|
-
"aria-label": openButtonLabel,
|
|
61
|
-
disabled: props.disabled || props.readOnly,
|
|
62
|
-
className: cn("absolute inset-y-0 right-1 inline-flex items-center text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", buttonClassName),
|
|
63
|
-
onClick: () => {
|
|
64
|
-
visibleRef.current?.focus();
|
|
65
|
-
pickerRef.current?.showPicker?.();
|
|
66
|
-
},
|
|
67
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
68
|
-
icon: UiCalendar,
|
|
69
|
-
className: "text-sm"
|
|
70
|
-
})
|
|
71
|
-
})
|
|
72
|
-
]
|
|
73
|
-
});
|
|
74
|
-
});
|
|
6
|
+
var DateTimePicker = forwardRef(({ openButtonLabel = "Open time picker", dateMathPresets = DATE_TIME_PICKER_DATE_MATH_PRESETS, ...props }, ref) => /* @__PURE__ */ jsx(DateInputField, {
|
|
7
|
+
...props,
|
|
8
|
+
ref,
|
|
9
|
+
openButtonLabel,
|
|
10
|
+
dateMathPresets,
|
|
11
|
+
withTime: true
|
|
12
|
+
}));
|
|
75
13
|
DateTimePicker.displayName = "DateTimePicker";
|
|
76
|
-
function toDateTimeLocalValue(value) {
|
|
77
|
-
const trimmed = value.trim();
|
|
78
|
-
if (!trimmed) return "";
|
|
79
|
-
if (trimmed === "now" || trimmed.startsWith("now")) return "";
|
|
80
|
-
const withTime = /^\d{4}-\d{2}-\d{2}$/.test(trimmed) ? `${trimmed}T00:00` : trimmed;
|
|
81
|
-
return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(withTime) ? withTime.slice(0, 16) : "";
|
|
82
|
-
}
|
|
83
14
|
export { DateTimePicker };
|
|
84
15
|
|
|
85
16
|
//# sourceMappingURL=DateTimePicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePicker.js","names":[],"sources":["../../src/components/DateTimePicker.tsx"],"sourcesContent":["import { forwardRef
|
|
1
|
+
{"version":3,"file":"DateTimePicker.js","names":[],"sources":["../../src/components/DateTimePicker.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { DATE_TIME_PICKER_DATE_MATH_PRESETS } from \"./date-math\";\nimport { DateInputField, type DateFieldProps } from \"./date-input-field\";\n\nexport type DateTimePickerProps = DateFieldProps;\n\nexport const DateTimePicker = forwardRef<HTMLInputElement, DateTimePickerProps>(\n (\n {\n openButtonLabel = \"Open time picker\",\n dateMathPresets = DATE_TIME_PICKER_DATE_MATH_PRESETS,\n ...props\n },\n ref,\n ) => (\n <DateInputField\n {...props}\n ref={ref}\n openButtonLabel={openButtonLabel}\n dateMathPresets={dateMathPresets}\n withTime\n />\n ),\n);\n\nDateTimePicker.displayName = \"DateTimePicker\";\n"],"mappings":";;;;;AAMA,IAAa,iBAAiB,YAE1B,EACE,kBAAkB,oBAClB,kBAAkB,oCAClB,GAAG,SAEL,QAEA,oBAAC,gBAAD;CACE,GAAI;CACC;CACY;CACA;CACjB,UAAA;AACD,CAAA,CAEL;AAEA,eAAe,cAAc"}
|