@cratis/components 0.1.9 → 0.1.12
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/cjs/CommandForm/CommandFormFields.js +9 -3
- package/dist/cjs/CommandForm/CommandFormFields.js.map +1 -1
- package/dist/cjs/CommandForm/ValidationMessage.js +24 -0
- package/dist/cjs/CommandForm/ValidationMessage.js.map +1 -0
- package/dist/cjs/CommandForm/asCommandFormField.js +47 -0
- package/dist/cjs/CommandForm/asCommandFormField.js.map +1 -0
- package/dist/cjs/CommandForm/fields/CheckboxField.js +13 -0
- package/dist/cjs/CommandForm/fields/CheckboxField.js.map +1 -0
- package/dist/cjs/CommandForm/fields/DropdownField.js +13 -0
- package/dist/cjs/CommandForm/fields/DropdownField.js.map +1 -0
- package/dist/cjs/CommandForm/fields/InputTextField.js +13 -0
- package/dist/cjs/CommandForm/fields/InputTextField.js.map +1 -0
- package/dist/cjs/CommandForm/fields/NumberField.js +13 -0
- package/dist/cjs/CommandForm/fields/NumberField.js.map +1 -0
- package/dist/cjs/CommandForm/fields/SliderField.js +17 -0
- package/dist/cjs/CommandForm/fields/SliderField.js.map +1 -0
- package/dist/cjs/CommandForm/fields/TextAreaField.js +13 -0
- package/dist/cjs/CommandForm/fields/TextAreaField.js.map +1 -0
- package/dist/cjs/CommandForm/index.js +15 -7
- package/dist/cjs/CommandForm/index.js.map +1 -1
- package/dist/cjs/PivotViewer/PivotViewer.css +1258 -0
- package/dist/cjs/PivotViewer/PivotViewer.js +14 -0
- package/dist/cjs/PivotViewer/PivotViewer.js.map +1 -1
- package/dist/cjs/PivotViewer/components/PivotCanvas.js +33 -10
- package/dist/cjs/PivotViewer/components/PivotCanvas.js.map +1 -1
- package/dist/cjs/PivotViewer/components/PivotViewerMain.js +1 -1
- package/dist/cjs/PivotViewer/components/PivotViewerMain.js.map +1 -1
- package/dist/cjs/PivotViewer/components/Spinner.css +77 -0
- package/dist/cjs/PivotViewer/components/pivot/sprites.js +79 -15
- package/dist/cjs/PivotViewer/components/pivot/sprites.js.map +1 -1
- package/dist/cjs/PivotViewer/components/pivot/visibility.js +36 -10
- package/dist/cjs/PivotViewer/components/pivot/visibility.js.map +1 -1
- package/dist/cjs/PivotViewer/engine/layout.js +2 -1
- package/dist/cjs/PivotViewer/engine/layout.js.map +1 -1
- package/dist/cjs/PivotViewer/hooks/usePivotEngine.js +37 -2
- package/dist/cjs/PivotViewer/hooks/usePivotEngine.js.map +1 -1
- package/dist/cjs/PivotViewer/index.js +3 -0
- package/dist/cjs/PivotViewer/index.js.map +1 -1
- package/dist/cjs/PivotViewer/types.js +22 -0
- package/dist/cjs/PivotViewer/types.js.map +1 -0
- package/dist/cjs/TimeMachine/EventsView.css +213 -0
- package/dist/cjs/TimeMachine/TimeMachine.css +567 -0
- package/dist/cjs/TimeMachine/TimeMachine.js +8 -3
- package/dist/cjs/TimeMachine/TimeMachine.js.map +1 -1
- package/dist/esm/CommandForm/CommandForm.stories.d.ts +1 -0
- package/dist/esm/CommandForm/CommandForm.stories.d.ts.map +1 -1
- package/dist/esm/CommandForm/CommandForm.stories.js +34 -1
- package/dist/esm/CommandForm/CommandForm.stories.js.map +1 -1
- package/dist/esm/CommandForm/CommandFormFields.d.ts.map +1 -1
- package/dist/esm/CommandForm/CommandFormFields.js +9 -3
- package/dist/esm/CommandForm/CommandFormFields.js.map +1 -1
- package/dist/esm/CommandForm/UserRegistrationCommand.d.ts +63 -0
- package/dist/esm/CommandForm/UserRegistrationCommand.d.ts.map +1 -0
- package/dist/esm/CommandForm/UserRegistrationCommand.js +143 -0
- package/dist/esm/CommandForm/UserRegistrationCommand.js.map +1 -0
- package/dist/esm/CommandForm/ValidationMessage.d.ts +8 -0
- package/dist/esm/CommandForm/ValidationMessage.d.ts.map +1 -0
- package/dist/esm/CommandForm/ValidationMessage.js +22 -0
- package/dist/esm/CommandForm/ValidationMessage.js.map +1 -0
- package/dist/esm/CommandForm/asCommandFormField.d.ts +32 -0
- package/dist/esm/CommandForm/asCommandFormField.d.ts.map +1 -0
- package/dist/esm/CommandForm/asCommandFormField.js +45 -0
- package/dist/esm/CommandForm/asCommandFormField.js.map +1 -0
- package/dist/esm/CommandForm/fields/CheckboxField.d.ts +10 -0
- package/dist/esm/CommandForm/fields/CheckboxField.d.ts.map +1 -0
- package/dist/esm/CommandForm/fields/CheckboxField.js +11 -0
- package/dist/esm/CommandForm/fields/CheckboxField.js.map +1 -0
- package/dist/esm/CommandForm/fields/DropdownField.d.ts +15 -0
- package/dist/esm/CommandForm/fields/DropdownField.d.ts.map +1 -0
- package/dist/esm/CommandForm/fields/DropdownField.js +11 -0
- package/dist/esm/CommandForm/fields/DropdownField.js.map +1 -0
- package/dist/esm/CommandForm/fields/InputTextField.d.ts +11 -0
- package/dist/esm/CommandForm/fields/InputTextField.d.ts.map +1 -0
- package/dist/esm/CommandForm/fields/InputTextField.js +11 -0
- package/dist/esm/CommandForm/fields/InputTextField.js.map +1 -0
- package/dist/esm/CommandForm/fields/NumberField.d.ts +13 -0
- package/dist/esm/CommandForm/fields/NumberField.d.ts.map +1 -0
- package/dist/esm/CommandForm/fields/NumberField.js +11 -0
- package/dist/esm/CommandForm/fields/NumberField.js.map +1 -0
- package/dist/esm/CommandForm/fields/SliderField.d.ts +12 -0
- package/dist/esm/CommandForm/fields/SliderField.d.ts.map +1 -0
- package/dist/esm/CommandForm/fields/SliderField.js +15 -0
- package/dist/esm/CommandForm/fields/SliderField.js.map +1 -0
- package/dist/esm/CommandForm/fields/TextAreaField.d.ts +12 -0
- package/dist/esm/CommandForm/fields/TextAreaField.d.ts.map +1 -0
- package/dist/esm/CommandForm/fields/TextAreaField.js +11 -0
- package/dist/esm/CommandForm/fields/TextAreaField.js.map +1 -0
- package/dist/esm/CommandForm/fields/index.d.ts +7 -0
- package/dist/esm/CommandForm/fields/index.d.ts.map +1 -0
- package/dist/esm/CommandForm/fields/index.js +7 -0
- package/dist/esm/CommandForm/fields/index.js.map +1 -0
- package/dist/esm/CommandForm/index.d.ts +3 -4
- package/dist/esm/CommandForm/index.d.ts.map +1 -1
- package/dist/esm/CommandForm/index.js +8 -4
- package/dist/esm/CommandForm/index.js.map +1 -1
- package/dist/esm/PivotViewer/PivotViewer.css +1258 -0
- package/dist/esm/PivotViewer/PivotViewer.d.ts.map +1 -1
- package/dist/esm/PivotViewer/PivotViewer.js +14 -0
- package/dist/esm/PivotViewer/PivotViewer.js.map +1 -1
- package/dist/esm/PivotViewer/PivotViewer.stories.d.ts +1 -0
- package/dist/esm/PivotViewer/PivotViewer.stories.d.ts.map +1 -1
- package/dist/esm/PivotViewer/PivotViewer.stories.js +43 -3
- package/dist/esm/PivotViewer/PivotViewer.stories.js.map +1 -1
- package/dist/esm/PivotViewer/components/PivotCanvas.d.ts.map +1 -1
- package/dist/esm/PivotViewer/components/PivotCanvas.js +33 -10
- package/dist/esm/PivotViewer/components/PivotCanvas.js.map +1 -1
- package/dist/esm/PivotViewer/components/PivotViewerMain.js +1 -1
- package/dist/esm/PivotViewer/components/PivotViewerMain.js.map +1 -1
- package/dist/esm/PivotViewer/components/Spinner.css +77 -0
- package/dist/esm/PivotViewer/components/pivot/sprites.d.ts.map +1 -1
- package/dist/esm/PivotViewer/components/pivot/sprites.js +79 -15
- package/dist/esm/PivotViewer/components/pivot/sprites.js.map +1 -1
- package/dist/esm/PivotViewer/components/pivot/visibility.d.ts.map +1 -1
- package/dist/esm/PivotViewer/components/pivot/visibility.js +36 -10
- package/dist/esm/PivotViewer/components/pivot/visibility.js.map +1 -1
- package/dist/esm/PivotViewer/engine/layout.js +2 -1
- package/dist/esm/PivotViewer/engine/layout.js.map +1 -1
- package/dist/esm/PivotViewer/engine/pivot.worker.d.ts.map +1 -1
- package/dist/esm/PivotViewer/engine/pivot.worker.js +22 -7
- package/dist/esm/PivotViewer/engine/pivot.worker.js.map +1 -1
- package/dist/esm/PivotViewer/hooks/useFilteredData.d.ts +2 -2
- package/dist/esm/PivotViewer/hooks/useFilteredData.d.ts.map +1 -1
- package/dist/esm/PivotViewer/hooks/useFilteredData.js +4 -2
- package/dist/esm/PivotViewer/hooks/useFilteredData.js.map +1 -1
- package/dist/esm/PivotViewer/hooks/usePivotEngine.d.ts.map +1 -1
- package/dist/esm/PivotViewer/hooks/usePivotEngine.js +37 -2
- package/dist/esm/PivotViewer/hooks/usePivotEngine.js.map +1 -1
- package/dist/esm/PivotViewer/index.d.ts +2 -1
- package/dist/esm/PivotViewer/index.d.ts.map +1 -1
- package/dist/esm/PivotViewer/index.js +1 -0
- package/dist/esm/PivotViewer/index.js.map +1 -1
- package/dist/esm/PivotViewer/types.d.ts +4 -1
- package/dist/esm/PivotViewer/types.d.ts.map +1 -1
- package/dist/esm/PivotViewer/types.js +19 -2
- package/dist/esm/PivotViewer/types.js.map +1 -1
- package/dist/esm/TimeMachine/EventsView.css +213 -0
- package/dist/esm/TimeMachine/TimeMachine.css +567 -0
- package/dist/esm/TimeMachine/TimeMachine.d.ts.map +1 -1
- package/dist/esm/TimeMachine/TimeMachine.js +8 -3
- package/dist/esm/TimeMachine/TimeMachine.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -32
- package/.storybook/main.ts +0 -24
- package/CommandDialog/CommandDialog.stories.tsx +0 -25
- package/CommandDialog/CommandDialog.tsx +0 -161
- package/CommandDialog/index.ts +0 -4
- package/CommandForm/CommandForm.stories.tsx +0 -24
- package/CommandForm/CommandForm.tsx +0 -266
- package/CommandForm/CommandFormField.tsx +0 -27
- package/CommandForm/CommandFormFields.tsx +0 -142
- package/CommandForm/DatePickerField.tsx +0 -57
- package/CommandForm/DropdownField.tsx +0 -65
- package/CommandForm/InputTextField.tsx +0 -62
- package/CommandForm/SliderField.tsx +0 -68
- package/CommandForm/index.ts +0 -10
- package/Common/ErrorBoundary.stories.tsx +0 -10
- package/Common/ErrorBoundary.tsx +0 -41
- package/Common/FormElement.stories.tsx +0 -10
- package/Common/FormElement.tsx +0 -20
- package/Common/Page.stories.tsx +0 -10
- package/Common/Page.tsx +0 -21
- package/Common/index.ts +0 -6
- package/DataPage/DataPage.stories.tsx +0 -10
- package/DataPage/DataPage.tsx +0 -191
- package/DataPage/index.ts +0 -4
- package/DataTables/DataTableForObservableQuery.stories.tsx +0 -10
- package/DataTables/DataTableForObservableQuery.tsx +0 -97
- package/DataTables/DataTableForQuery.stories.tsx +0 -10
- package/DataTables/DataTableForQuery.tsx +0 -97
- package/DataTables/index.ts +0 -5
- package/Dialogs/BusyIndicatorDialog.stories.tsx +0 -26
- package/Dialogs/BusyIndicatorDialog.tsx +0 -26
- package/Dialogs/ConfirmationDialog.stories.tsx +0 -36
- package/Dialogs/ConfirmationDialog.tsx +0 -75
- package/Dialogs/index.ts +0 -5
- package/Dropdown/Dropdown.tsx +0 -23
- package/Dropdown/index.ts +0 -4
- package/PivotViewer/PivotViewer.stories.tsx +0 -24
- package/PivotViewer/PivotViewer.tsx +0 -791
- package/PivotViewer/components/AxisLabels.tsx +0 -69
- package/PivotViewer/components/DetailPanel.tsx +0 -108
- package/PivotViewer/components/FilterPanel.tsx +0 -189
- package/PivotViewer/components/FilterPanelContainer.tsx +0 -10
- package/PivotViewer/components/PivotCanvas.tsx +0 -660
- package/PivotViewer/components/PivotViewerMain.tsx +0 -229
- package/PivotViewer/components/RangeHistogramFilter.tsx +0 -220
- package/PivotViewer/components/Spinner.tsx +0 -21
- package/PivotViewer/components/Toolbar.tsx +0 -130
- package/PivotViewer/components/ToolbarContainer.tsx +0 -10
- package/PivotViewer/components/index.ts +0 -12
- package/PivotViewer/components/pivot/animation.ts +0 -108
- package/PivotViewer/components/pivot/buckets.ts +0 -152
- package/PivotViewer/components/pivot/colorResolver.ts +0 -67
- package/PivotViewer/components/pivot/constants.ts +0 -46
- package/PivotViewer/components/pivot/sprites.ts +0 -265
- package/PivotViewer/components/pivot/visibility.ts +0 -319
- package/PivotViewer/constants.ts +0 -9
- package/PivotViewer/engine/layout.ts +0 -149
- package/PivotViewer/engine/pivot.worker.ts +0 -86
- package/PivotViewer/engine/store.ts +0 -437
- package/PivotViewer/engine/types.ts +0 -255
- package/PivotViewer/hooks/index.ts +0 -13
- package/PivotViewer/hooks/useContainerDimensions.ts +0 -45
- package/PivotViewer/hooks/useDimensionState.ts +0 -53
- package/PivotViewer/hooks/useFilterOptions.ts +0 -36
- package/PivotViewer/hooks/useFilterPanelDrag.ts +0 -49
- package/PivotViewer/hooks/useFilterState.ts +0 -106
- package/PivotViewer/hooks/useFilteredData.ts +0 -119
- package/PivotViewer/hooks/usePanning.ts +0 -163
- package/PivotViewer/hooks/usePivotEngine.ts +0 -252
- package/PivotViewer/hooks/useSelectedItem.ts +0 -402
- package/PivotViewer/hooks/useWheelZoom.ts +0 -114
- package/PivotViewer/hooks/useZoomState.ts +0 -34
- package/PivotViewer/index.ts +0 -7
- package/PivotViewer/types.ts +0 -59
- package/PivotViewer/utils/animations.ts +0 -249
- package/PivotViewer/utils/constants.ts +0 -20
- package/PivotViewer/utils/index.ts +0 -6
- package/PivotViewer/utils/selection.ts +0 -292
- package/PivotViewer/utils/utils.ts +0 -259
- package/TimeMachine/EventsView.stories.tsx +0 -10
- package/TimeMachine/EventsView.tsx +0 -119
- package/TimeMachine/Properties.stories.tsx +0 -10
- package/TimeMachine/Properties.tsx +0 -98
- package/TimeMachine/ReadModelView.stories.tsx +0 -10
- package/TimeMachine/ReadModelView.tsx +0 -143
- package/TimeMachine/TimeMachine.stories.tsx +0 -10
- package/TimeMachine/TimeMachine.tsx +0 -244
- package/TimeMachine/index.ts +0 -8
- package/TimeMachine/types.ts +0 -23
- package/dist/cjs/CommandForm/DatePickerField.js +0 -31
- package/dist/cjs/CommandForm/DatePickerField.js.map +0 -1
- package/dist/cjs/CommandForm/DropdownField.js +0 -31
- package/dist/cjs/CommandForm/DropdownField.js.map +0 -1
- package/dist/cjs/CommandForm/InputTextField.js +0 -32
- package/dist/cjs/CommandForm/InputTextField.js.map +0 -1
- package/dist/cjs/CommandForm/SliderField.js +0 -34
- package/dist/cjs/CommandForm/SliderField.js.map +0 -1
- package/dist/esm/CommandForm/DatePickerField.d.ts +0 -20
- package/dist/esm/CommandForm/DatePickerField.d.ts.map +0 -1
- package/dist/esm/CommandForm/DatePickerField.js +0 -29
- package/dist/esm/CommandForm/DatePickerField.js.map +0 -1
- package/dist/esm/CommandForm/DropdownField.d.ts +0 -24
- package/dist/esm/CommandForm/DropdownField.d.ts.map +0 -1
- package/dist/esm/CommandForm/DropdownField.js +0 -29
- package/dist/esm/CommandForm/DropdownField.js.map +0 -1
- package/dist/esm/CommandForm/InputTextField.d.ts +0 -20
- package/dist/esm/CommandForm/InputTextField.d.ts.map +0 -1
- package/dist/esm/CommandForm/InputTextField.js +0 -30
- package/dist/esm/CommandForm/InputTextField.js.map +0 -1
- package/dist/esm/CommandForm/SliderField.d.ts +0 -23
- package/dist/esm/CommandForm/SliderField.d.ts.map +0 -1
- package/dist/esm/CommandForm/SliderField.js +0 -32
- package/dist/esm/CommandForm/SliderField.js.map +0 -1
- package/global.d.ts +0 -11
- package/index.ts +0 -22
- package/useOverlayZIndex.ts +0 -32
- package/vite.config.ts +0 -80
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var slider = require('primereact/slider');
|
|
6
|
-
var CommandForm = require('./CommandForm.js');
|
|
7
|
-
|
|
8
|
-
const SliderField = (props) => {
|
|
9
|
-
const [localValue, setLocalValue] = React.useState(props.currentValue ?? 0);
|
|
10
|
-
const required = props.required ?? true;
|
|
11
|
-
const min = props.min ?? 0;
|
|
12
|
-
const max = props.max ?? 1;
|
|
13
|
-
const step = props.step ?? 0.01;
|
|
14
|
-
const isValid = !required || (localValue >= min && localValue <= max);
|
|
15
|
-
const { setFieldValidity } = CommandForm.useCommandFormContext();
|
|
16
|
-
React.useEffect(() => {
|
|
17
|
-
setLocalValue(props.currentValue ?? 0);
|
|
18
|
-
}, [props.currentValue]);
|
|
19
|
-
React.useEffect(() => {
|
|
20
|
-
if (props.fieldName) {
|
|
21
|
-
setFieldValidity(props.fieldName, isValid);
|
|
22
|
-
}
|
|
23
|
-
}, [isValid, props.fieldName, setFieldValidity]);
|
|
24
|
-
const handleChange = (e) => {
|
|
25
|
-
const newValue = e.value;
|
|
26
|
-
setLocalValue(newValue);
|
|
27
|
-
props.onValueChange?.(newValue);
|
|
28
|
-
};
|
|
29
|
-
return (jsxRuntime.jsxs("div", { className: "p-inputtext w-full flex align-items-center gap-3", style: { display: 'flex', alignItems: 'center', borderTopLeftRadius: 0, borderBottomLeftRadius: 0 }, children: [jsxRuntime.jsx(slider.Slider, { value: localValue, onChange: handleChange, min: min, max: max, step: step, className: "flex-1 ml-2" }), jsxRuntime.jsx("span", { className: "font-semibold", style: { minWidth: '3rem', textAlign: 'right' }, children: localValue.toFixed(2) })] }));
|
|
30
|
-
};
|
|
31
|
-
SliderField.displayName = 'CommandFormField';
|
|
32
|
-
|
|
33
|
-
exports.SliderField = SliderField;
|
|
34
|
-
//# sourceMappingURL=SliderField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SliderField.js","sources":["../../../CommandForm/SliderField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PropertyAccessor } from '@cratis/fundamentals';\nimport { PropertyDescriptor } from '@cratis/arc/reflection';\nimport React, { useState, useEffect } from 'react';\nimport { Slider, SliderChangeEvent } from 'primereact/slider';\nimport { useCommandFormContext } from './CommandForm';\n\nexport interface SliderFieldProps<TCommand> {\n icon?: React.ReactElement;\n value: PropertyAccessor<TCommand>;\n onChange?: (value: unknown) => void;\n currentValue?: number;\n onValueChange?: (value: number) => void;\n required?: boolean;\n title?: string;\n description?: string;\n propertyDescriptor?: PropertyDescriptor;\n fieldName?: string;\n min?: number;\n max?: number;\n step?: number;\n}\n\nexport const SliderField = <TCommand,>(props: SliderFieldProps<TCommand>) => {\n const [localValue, setLocalValue] = useState(props.currentValue ?? 0);\n const required = props.required ?? true;\n const min = props.min ?? 0;\n const max = props.max ?? 1;\n const step = props.step ?? 0.01;\n const isValid = !required || (localValue >= min && localValue <= max);\n const { setFieldValidity } = useCommandFormContext();\n\n useEffect(() => {\n setLocalValue(props.currentValue ?? 0);\n }, [props.currentValue]);\n\n useEffect(() => {\n if (props.fieldName) {\n setFieldValidity(props.fieldName, isValid);\n }\n }, [isValid, props.fieldName, setFieldValidity]);\n\n const handleChange = (e: SliderChangeEvent) => {\n const newValue = e.value as number;\n setLocalValue(newValue);\n props.onValueChange?.(newValue);\n };\n\n return (\n <div className=\"p-inputtext w-full flex align-items-center gap-3\" style={{ display: 'flex', alignItems: 'center', borderTopLeftRadius: 0, borderBottomLeftRadius: 0 }}>\n <Slider\n value={localValue}\n onChange={handleChange}\n min={min}\n max={max}\n step={step}\n className=\"flex-1 ml-2\"\n />\n <span className=\"font-semibold\" style={{ minWidth: '3rem', textAlign: 'right' }}>\n {localValue.toFixed(2)}\n </span>\n </div>\n );\n};\n\nSliderField.displayName = 'CommandFormField';\n"],"names":["useState","useCommandFormContext","useEffect","_jsxs","_jsx","Slider"],"mappings":";;;;;;;AAyBO,MAAM,WAAW,GAAG,CAAY,KAAiC,KAAI;AACxE,IAAA,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,CAAC;AACrE,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,IAAI;AACvC,IAAA,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC;AAC1B,IAAA,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC;AAC1B,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,IAAI;AAC/B,IAAA,MAAM,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU,IAAI,GAAG,IAAI,UAAU,IAAI,GAAG,CAAC;AACrE,IAAA,MAAM,EAAE,gBAAgB,EAAE,GAAGC,iCAAqB,EAAE;IAEpDC,eAAS,CAAC,MAAK;AACX,QAAA,aAAa,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,CAAC;AAC1C,IAAA,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAExBA,eAAS,CAAC,MAAK;AACX,QAAA,IAAI,KAAK,CAAC,SAAS,EAAE;AACjB,YAAA,gBAAgB,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC;QAC9C;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;AAEhD,IAAA,MAAM,YAAY,GAAG,CAAC,CAAoB,KAAI;AAC1C,QAAA,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAe;QAClC,aAAa,CAAC,QAAQ,CAAC;AACvB,QAAA,KAAK,CAAC,aAAa,GAAG,QAAQ,CAAC;AACnC,IAAA,CAAC;AAED,IAAA,QACIC,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,kDAAkD,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC,EAAE,sBAAsB,EAAE,CAAC,EAAE,EAAA,QAAA,EAAA,CACjKC,eAACC,aAAM,EAAA,EACH,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,SAAS,EAAC,aAAa,GACzB,EACFD,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,eAAe,EAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAA,QAAA,EAC1E,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAA,CACnB,CAAA,EAAA,CACL;AAEd;AAEA,WAAW,CAAC,WAAW,GAAG,kBAAkB;;;;"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { PropertyAccessor } from '@cratis/fundamentals';
|
|
2
|
-
import { PropertyDescriptor } from '@cratis/arc/reflection';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
export interface DatePickerFieldProps<TCommand> {
|
|
5
|
-
icon?: React.ReactElement;
|
|
6
|
-
value: PropertyAccessor<TCommand>;
|
|
7
|
-
onChange?: (value: unknown) => void;
|
|
8
|
-
currentValue?: string;
|
|
9
|
-
onValueChange?: (value: string) => void;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
title?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
propertyDescriptor?: PropertyDescriptor;
|
|
14
|
-
fieldName?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare const DatePickerField: {
|
|
17
|
-
<TCommand>(props: DatePickerFieldProps<TCommand>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
displayName: string;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=DatePickerField.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerField.d.ts","sourceRoot":"","sources":["../../../CommandForm/DatePickerField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,MAAM,WAAW,oBAAoB,CAAC,QAAQ;IAC1C,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,eAAe;KAAI,QAAQ,SAAU,oBAAoB,CAAC,QAAQ,CAAC;;CAgC/E,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { InputText } from 'primereact/inputtext';
|
|
4
|
-
import { useCommandFormContext } from './CommandForm.js';
|
|
5
|
-
|
|
6
|
-
const DatePickerField = (props) => {
|
|
7
|
-
const [localValue, setLocalValue] = useState(props.currentValue || '');
|
|
8
|
-
const required = props.required ?? true;
|
|
9
|
-
const isValid = !required || localValue.trim().length > 0;
|
|
10
|
-
const { setFieldValidity } = useCommandFormContext();
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
setLocalValue(props.currentValue || '');
|
|
13
|
-
}, [props.currentValue]);
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (props.fieldName) {
|
|
16
|
-
setFieldValidity(props.fieldName, isValid);
|
|
17
|
-
}
|
|
18
|
-
}, [isValid, props.fieldName, setFieldValidity]);
|
|
19
|
-
const handleChange = (e) => {
|
|
20
|
-
const newValue = e.target.value;
|
|
21
|
-
setLocalValue(newValue);
|
|
22
|
-
props.onValueChange?.(newValue);
|
|
23
|
-
};
|
|
24
|
-
return (jsx(InputText, { type: "date", value: localValue, onChange: handleChange, required: required, invalid: !isValid, placeholder: props.title }));
|
|
25
|
-
};
|
|
26
|
-
DatePickerField.displayName = 'CommandFormField';
|
|
27
|
-
|
|
28
|
-
export { DatePickerField };
|
|
29
|
-
//# sourceMappingURL=DatePickerField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerField.js","sources":["../../../CommandForm/DatePickerField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PropertyAccessor } from '@cratis/fundamentals';\nimport { PropertyDescriptor } from '@cratis/arc/reflection';\nimport React, { useState, useEffect } from 'react';\nimport { InputText } from 'primereact/inputtext';\nimport { useCommandFormContext } from './CommandForm';\n\nexport interface DatePickerFieldProps<TCommand> {\n icon?: React.ReactElement;\n value: PropertyAccessor<TCommand>;\n onChange?: (value: unknown) => void;\n currentValue?: string;\n onValueChange?: (value: string) => void;\n required?: boolean;\n title?: string;\n description?: string;\n propertyDescriptor?: PropertyDescriptor;\n fieldName?: string;\n}\n\nexport const DatePickerField = <TCommand,>(props: DatePickerFieldProps<TCommand>) => {\n const [localValue, setLocalValue] = useState(props.currentValue || '');\n const required = props.required ?? true;\n const isValid = !required || localValue.trim().length > 0;\n const { setFieldValidity } = useCommandFormContext();\n\n useEffect(() => {\n setLocalValue(props.currentValue || '');\n }, [props.currentValue]);\n\n useEffect(() => {\n if (props.fieldName) {\n setFieldValidity(props.fieldName, isValid);\n }\n }, [isValid, props.fieldName, setFieldValidity]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setLocalValue(newValue);\n props.onValueChange?.(newValue);\n };\n\n return (\n <InputText\n type=\"date\"\n value={localValue}\n onChange={handleChange}\n required={required}\n invalid={!isValid}\n placeholder={props.title}\n />\n );\n};\n\nDatePickerField.displayName = 'CommandFormField';\n"],"names":["_jsx"],"mappings":";;;;;AAsBO,MAAM,eAAe,GAAG,CAAY,KAAqC,KAAI;AAChF,IAAA,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC;AACtE,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,IAAI;AACvC,IAAA,MAAM,OAAO,GAAG,CAAC,QAAQ,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;AACzD,IAAA,MAAM,EAAE,gBAAgB,EAAE,GAAG,qBAAqB,EAAE;IAEpD,SAAS,CAAC,MAAK;AACX,QAAA,aAAa,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC;AAC3C,IAAA,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAExB,SAAS,CAAC,MAAK;AACX,QAAA,IAAI,KAAK,CAAC,SAAS,EAAE;AACjB,YAAA,gBAAgB,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC;QAC9C;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;AAEhD,IAAA,MAAM,YAAY,GAAG,CAAC,CAAsC,KAAI;AAC5D,QAAA,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK;QAC/B,aAAa,CAAC,QAAQ,CAAC;AACvB,QAAA,KAAK,CAAC,aAAa,GAAG,QAAQ,CAAC;AACnC,IAAA,CAAC;AAED,IAAA,QACIA,GAAA,CAAC,SAAS,EAAA,EACN,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,CAAC,OAAO,EACjB,WAAW,EAAE,KAAK,CAAC,KAAK,EAAA,CAC1B;AAEV;AAEA,eAAe,CAAC,WAAW,GAAG,kBAAkB;;;;"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { PropertyAccessor } from '@cratis/fundamentals';
|
|
2
|
-
import { PropertyDescriptor } from '@cratis/arc/reflection';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
export interface DropdownFieldProps<TCommand, TOption> {
|
|
5
|
-
icon?: React.ReactElement;
|
|
6
|
-
value: PropertyAccessor<TCommand>;
|
|
7
|
-
options: TOption[];
|
|
8
|
-
optionIdField: keyof TOption;
|
|
9
|
-
optionLabelField: keyof TOption;
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
onChange?: (value: unknown) => void;
|
|
12
|
-
currentValue?: unknown;
|
|
13
|
-
onValueChange?: (value: unknown) => void;
|
|
14
|
-
required?: boolean;
|
|
15
|
-
title?: string;
|
|
16
|
-
description?: string;
|
|
17
|
-
propertyDescriptor?: PropertyDescriptor;
|
|
18
|
-
fieldName?: string;
|
|
19
|
-
}
|
|
20
|
-
export declare const DropdownField: {
|
|
21
|
-
<TCommand, TOption>(props: DropdownFieldProps<TCommand, TOption>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
displayName: string;
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=DropdownField.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownField.d.ts","sourceRoot":"","sources":["../../../CommandForm/DropdownField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,MAAM,WAAW,kBAAkB,CAAC,QAAQ,EAAE,OAAO;IACjD,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAClC,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,aAAa,EAAE,MAAM,OAAO,CAAC;IAC7B,gBAAgB,EAAE,MAAM,OAAO,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,aAAa;KAAI,QAAQ,EAAE,OAAO,SAAS,kBAAkB,CAAC,QAAQ,EAAE,OAAO,CAAC;;CAmC5F,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { Dropdown } from '../Dropdown/Dropdown.js';
|
|
4
|
-
import { useCommandFormContext } from './CommandForm.js';
|
|
5
|
-
|
|
6
|
-
const DropdownField = (props) => {
|
|
7
|
-
const [localValue, setLocalValue] = useState(props.currentValue);
|
|
8
|
-
const required = props.required ?? true;
|
|
9
|
-
const isValid = !required || localValue !== null && localValue !== undefined;
|
|
10
|
-
const { setFieldValidity } = useCommandFormContext();
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
setLocalValue(props.currentValue);
|
|
13
|
-
}, [props.currentValue]);
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (props.fieldName) {
|
|
16
|
-
setFieldValidity(props.fieldName, isValid);
|
|
17
|
-
}
|
|
18
|
-
}, [isValid, props.fieldName, setFieldValidity]);
|
|
19
|
-
const handleChange = (e) => {
|
|
20
|
-
const newValue = e.value;
|
|
21
|
-
setLocalValue(newValue);
|
|
22
|
-
props.onValueChange?.(newValue);
|
|
23
|
-
};
|
|
24
|
-
return (jsx(Dropdown, { value: localValue, onChange: handleChange, options: props.options, optionLabel: props.optionLabelField, optionValue: props.optionIdField, placeholder: props.placeholder || props.title, required: required, invalid: !isValid, className: "w-full" }));
|
|
25
|
-
};
|
|
26
|
-
DropdownField.displayName = 'CommandFormField';
|
|
27
|
-
|
|
28
|
-
export { DropdownField };
|
|
29
|
-
//# sourceMappingURL=DropdownField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownField.js","sources":["../../../CommandForm/DropdownField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PropertyAccessor } from '@cratis/fundamentals';\nimport { PropertyDescriptor } from '@cratis/arc/reflection';\nimport React, { useState, useEffect } from 'react';\nimport { DropdownChangeEvent } from 'primereact/dropdown';\nimport { Dropdown } from '../Dropdown';\nimport { useCommandFormContext } from './CommandForm';\n\nexport interface DropdownFieldProps<TCommand, TOption> {\n icon?: React.ReactElement;\n value: PropertyAccessor<TCommand>;\n options: TOption[];\n optionIdField: keyof TOption;\n optionLabelField: keyof TOption;\n placeholder?: string;\n onChange?: (value: unknown) => void;\n currentValue?: unknown;\n onValueChange?: (value: unknown) => void;\n required?: boolean;\n title?: string;\n description?: string;\n propertyDescriptor?: PropertyDescriptor;\n fieldName?: string;\n}\n\nexport const DropdownField = <TCommand, TOption>(props: DropdownFieldProps<TCommand, TOption>) => {\n const [localValue, setLocalValue] = useState(props.currentValue);\n const required = props.required ?? true;\n const isValid = !required || localValue !== null && localValue !== undefined;\n const { setFieldValidity } = useCommandFormContext();\n\n useEffect(() => {\n setLocalValue(props.currentValue);\n }, [props.currentValue]);\n\n useEffect(() => {\n if (props.fieldName) {\n setFieldValidity(props.fieldName, isValid);\n }\n }, [isValid, props.fieldName, setFieldValidity]);\n\n const handleChange = (e: DropdownChangeEvent) => {\n const newValue = e.value;\n setLocalValue(newValue);\n props.onValueChange?.(newValue);\n };\n\n return (\n <Dropdown\n value={localValue}\n onChange={handleChange}\n options={props.options}\n optionLabel={props.optionLabelField as string}\n optionValue={props.optionIdField as string}\n placeholder={props.placeholder || props.title}\n required={required}\n invalid={!isValid}\n className=\"w-full\"\n />\n );\n};\n\nDropdownField.displayName = 'CommandFormField';\n"],"names":["_jsx"],"mappings":";;;;;AA2BO,MAAM,aAAa,GAAG,CAAoB,KAA4C,KAAI;AAC7F,IAAA,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC;AAChE,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,IAAI;AACvC,IAAA,MAAM,OAAO,GAAG,CAAC,QAAQ,IAAI,UAAU,KAAK,IAAI,IAAI,UAAU,KAAK,SAAS;AAC5E,IAAA,MAAM,EAAE,gBAAgB,EAAE,GAAG,qBAAqB,EAAE;IAEpD,SAAS,CAAC,MAAK;AACX,QAAA,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC;AACrC,IAAA,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAExB,SAAS,CAAC,MAAK;AACX,QAAA,IAAI,KAAK,CAAC,SAAS,EAAE;AACjB,YAAA,gBAAgB,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC;QAC9C;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;AAEhD,IAAA,MAAM,YAAY,GAAG,CAAC,CAAsB,KAAI;AAC5C,QAAA,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK;QACxB,aAAa,CAAC,QAAQ,CAAC;AACvB,QAAA,KAAK,CAAC,aAAa,GAAG,QAAQ,CAAC;AACnC,IAAA,CAAC;IAED,QACIA,GAAA,CAAC,QAAQ,EAAA,EACL,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,WAAW,EAAE,KAAK,CAAC,gBAA0B,EAC7C,WAAW,EAAE,KAAK,CAAC,aAAuB,EAC1C,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,KAAK,EAC7C,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,CAAC,OAAO,EACjB,SAAS,EAAC,QAAQ,EAAA,CACpB;AAEV;AAEA,aAAa,CAAC,WAAW,GAAG,kBAAkB;;;;"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { PropertyAccessor } from '@cratis/fundamentals';
|
|
2
|
-
import { PropertyDescriptor } from '@cratis/arc/reflection';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
export interface InputTextFieldProps<TCommand> {
|
|
5
|
-
icon?: React.ReactElement;
|
|
6
|
-
value: PropertyAccessor<TCommand>;
|
|
7
|
-
onChange?: (value: unknown) => void;
|
|
8
|
-
currentValue?: string;
|
|
9
|
-
onValueChange?: (value: string) => void;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
title?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
propertyDescriptor?: PropertyDescriptor;
|
|
14
|
-
fieldName?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare const InputTextField: {
|
|
17
|
-
<TCommand>(props: InputTextFieldProps<TCommand>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
displayName: string;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=InputTextField.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InputTextField.d.ts","sourceRoot":"","sources":["../../../CommandForm/InputTextField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,MAAM,WAAW,mBAAmB,CAAC,QAAQ;IACzC,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,cAAc;KAAI,QAAQ,SAAU,mBAAmB,CAAC,QAAQ,CAAC;;CAqC7E,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { InputText } from 'primereact/inputtext';
|
|
4
|
-
import { useCommandFormContext } from './CommandForm.js';
|
|
5
|
-
|
|
6
|
-
const InputTextField = (props) => {
|
|
7
|
-
const [localValue, setLocalValue] = useState(props.currentValue || '');
|
|
8
|
-
const required = props.required ?? true;
|
|
9
|
-
const isValid = !required || localValue.trim().length > 0;
|
|
10
|
-
const { setFieldValidity } = useCommandFormContext();
|
|
11
|
-
const inputType = props.propertyDescriptor?.type === Number ? 'number' : 'text';
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
setLocalValue(props.currentValue || '');
|
|
14
|
-
}, [props.currentValue]);
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
if (props.fieldName) {
|
|
17
|
-
setFieldValidity(props.fieldName, isValid);
|
|
18
|
-
}
|
|
19
|
-
}, [isValid, props.fieldName, setFieldValidity]);
|
|
20
|
-
const handleChange = (e) => {
|
|
21
|
-
const newValue = e.target.value;
|
|
22
|
-
setLocalValue(newValue);
|
|
23
|
-
props.onValueChange?.(newValue);
|
|
24
|
-
};
|
|
25
|
-
return (jsx(InputText, { type: inputType, value: localValue, onChange: handleChange, required: required, invalid: !isValid, placeholder: props.title }));
|
|
26
|
-
};
|
|
27
|
-
InputTextField.displayName = 'CommandFormField';
|
|
28
|
-
|
|
29
|
-
export { InputTextField };
|
|
30
|
-
//# sourceMappingURL=InputTextField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InputTextField.js","sources":["../../../CommandForm/InputTextField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PropertyAccessor } from '@cratis/fundamentals';\nimport { PropertyDescriptor } from '@cratis/arc/reflection';\nimport React, { useState, useEffect } from 'react';\nimport { InputText } from 'primereact/inputtext';\nimport { useCommandFormContext } from './CommandForm';\n\nexport interface InputTextFieldProps<TCommand> {\n icon?: React.ReactElement;\n value: PropertyAccessor<TCommand>;\n onChange?: (value: unknown) => void;\n currentValue?: string;\n onValueChange?: (value: string) => void;\n required?: boolean;\n title?: string;\n description?: string;\n propertyDescriptor?: PropertyDescriptor;\n fieldName?: string;\n}\n\nexport const InputTextField = <TCommand,>(props: InputTextFieldProps<TCommand>) => {\n const [localValue, setLocalValue] = useState(props.currentValue || '');\n const required = props.required ?? true;\n const isValid = !required || localValue.trim().length > 0;\n const { setFieldValidity } = useCommandFormContext();\n\n // Determine input type based on property descriptor\n const inputType = props.propertyDescriptor?.type === Number ? 'number' : 'text';\n\n // Update local value when prop changes from outside\n useEffect(() => {\n setLocalValue(props.currentValue || '');\n }, [props.currentValue]);\n\n // Report validity changes\n useEffect(() => {\n if (props.fieldName) {\n setFieldValidity(props.fieldName, isValid);\n }\n }, [isValid, props.fieldName, setFieldValidity]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setLocalValue(newValue);\n props.onValueChange?.(newValue);\n };\n\n return (\n <InputText\n type={inputType}\n value={localValue}\n onChange={handleChange}\n required={required}\n invalid={!isValid}\n placeholder={props.title}\n />\n );\n};\n\nInputTextField.displayName = 'CommandFormField';\n"],"names":["_jsx"],"mappings":";;;;;AAsBO,MAAM,cAAc,GAAG,CAAY,KAAoC,KAAI;AAC9E,IAAA,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC;AACtE,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,IAAI;AACvC,IAAA,MAAM,OAAO,GAAG,CAAC,QAAQ,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;AACzD,IAAA,MAAM,EAAE,gBAAgB,EAAE,GAAG,qBAAqB,EAAE;AAGpD,IAAA,MAAM,SAAS,GAAG,KAAK,CAAC,kBAAkB,EAAE,IAAI,KAAK,MAAM,GAAG,QAAQ,GAAG,MAAM;IAG/E,SAAS,CAAC,MAAK;AACX,QAAA,aAAa,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC;AAC3C,IAAA,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAGxB,SAAS,CAAC,MAAK;AACX,QAAA,IAAI,KAAK,CAAC,SAAS,EAAE;AACjB,YAAA,gBAAgB,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC;QAC9C;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;AAEhD,IAAA,MAAM,YAAY,GAAG,CAAC,CAAsC,KAAI;AAC5D,QAAA,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK;QAC/B,aAAa,CAAC,QAAQ,CAAC;AACvB,QAAA,KAAK,CAAC,aAAa,GAAG,QAAQ,CAAC;AACnC,IAAA,CAAC;AAED,IAAA,QACIA,GAAA,CAAC,SAAS,EAAA,EACN,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,CAAC,OAAO,EACjB,WAAW,EAAE,KAAK,CAAC,KAAK,EAAA,CAC1B;AAEV;AAEA,cAAc,CAAC,WAAW,GAAG,kBAAkB;;;;"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { PropertyAccessor } from '@cratis/fundamentals';
|
|
2
|
-
import { PropertyDescriptor } from '@cratis/arc/reflection';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
export interface SliderFieldProps<TCommand> {
|
|
5
|
-
icon?: React.ReactElement;
|
|
6
|
-
value: PropertyAccessor<TCommand>;
|
|
7
|
-
onChange?: (value: unknown) => void;
|
|
8
|
-
currentValue?: number;
|
|
9
|
-
onValueChange?: (value: number) => void;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
title?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
propertyDescriptor?: PropertyDescriptor;
|
|
14
|
-
fieldName?: string;
|
|
15
|
-
min?: number;
|
|
16
|
-
max?: number;
|
|
17
|
-
step?: number;
|
|
18
|
-
}
|
|
19
|
-
export declare const SliderField: {
|
|
20
|
-
<TCommand>(props: SliderFieldProps<TCommand>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
displayName: string;
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=SliderField.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SliderField.d.ts","sourceRoot":"","sources":["../../../CommandForm/SliderField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,MAAM,WAAW,gBAAgB,CAAC,QAAQ;IACtC,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,WAAW;KAAI,QAAQ,SAAU,gBAAgB,CAAC,QAAQ,CAAC;;CAwCvE,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { Slider } from 'primereact/slider';
|
|
4
|
-
import { useCommandFormContext } from './CommandForm.js';
|
|
5
|
-
|
|
6
|
-
const SliderField = (props) => {
|
|
7
|
-
const [localValue, setLocalValue] = useState(props.currentValue ?? 0);
|
|
8
|
-
const required = props.required ?? true;
|
|
9
|
-
const min = props.min ?? 0;
|
|
10
|
-
const max = props.max ?? 1;
|
|
11
|
-
const step = props.step ?? 0.01;
|
|
12
|
-
const isValid = !required || (localValue >= min && localValue <= max);
|
|
13
|
-
const { setFieldValidity } = useCommandFormContext();
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
setLocalValue(props.currentValue ?? 0);
|
|
16
|
-
}, [props.currentValue]);
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (props.fieldName) {
|
|
19
|
-
setFieldValidity(props.fieldName, isValid);
|
|
20
|
-
}
|
|
21
|
-
}, [isValid, props.fieldName, setFieldValidity]);
|
|
22
|
-
const handleChange = (e) => {
|
|
23
|
-
const newValue = e.value;
|
|
24
|
-
setLocalValue(newValue);
|
|
25
|
-
props.onValueChange?.(newValue);
|
|
26
|
-
};
|
|
27
|
-
return (jsxs("div", { className: "p-inputtext w-full flex align-items-center gap-3", style: { display: 'flex', alignItems: 'center', borderTopLeftRadius: 0, borderBottomLeftRadius: 0 }, children: [jsx(Slider, { value: localValue, onChange: handleChange, min: min, max: max, step: step, className: "flex-1 ml-2" }), jsx("span", { className: "font-semibold", style: { minWidth: '3rem', textAlign: 'right' }, children: localValue.toFixed(2) })] }));
|
|
28
|
-
};
|
|
29
|
-
SliderField.displayName = 'CommandFormField';
|
|
30
|
-
|
|
31
|
-
export { SliderField };
|
|
32
|
-
//# sourceMappingURL=SliderField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SliderField.js","sources":["../../../CommandForm/SliderField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PropertyAccessor } from '@cratis/fundamentals';\nimport { PropertyDescriptor } from '@cratis/arc/reflection';\nimport React, { useState, useEffect } from 'react';\nimport { Slider, SliderChangeEvent } from 'primereact/slider';\nimport { useCommandFormContext } from './CommandForm';\n\nexport interface SliderFieldProps<TCommand> {\n icon?: React.ReactElement;\n value: PropertyAccessor<TCommand>;\n onChange?: (value: unknown) => void;\n currentValue?: number;\n onValueChange?: (value: number) => void;\n required?: boolean;\n title?: string;\n description?: string;\n propertyDescriptor?: PropertyDescriptor;\n fieldName?: string;\n min?: number;\n max?: number;\n step?: number;\n}\n\nexport const SliderField = <TCommand,>(props: SliderFieldProps<TCommand>) => {\n const [localValue, setLocalValue] = useState(props.currentValue ?? 0);\n const required = props.required ?? true;\n const min = props.min ?? 0;\n const max = props.max ?? 1;\n const step = props.step ?? 0.01;\n const isValid = !required || (localValue >= min && localValue <= max);\n const { setFieldValidity } = useCommandFormContext();\n\n useEffect(() => {\n setLocalValue(props.currentValue ?? 0);\n }, [props.currentValue]);\n\n useEffect(() => {\n if (props.fieldName) {\n setFieldValidity(props.fieldName, isValid);\n }\n }, [isValid, props.fieldName, setFieldValidity]);\n\n const handleChange = (e: SliderChangeEvent) => {\n const newValue = e.value as number;\n setLocalValue(newValue);\n props.onValueChange?.(newValue);\n };\n\n return (\n <div className=\"p-inputtext w-full flex align-items-center gap-3\" style={{ display: 'flex', alignItems: 'center', borderTopLeftRadius: 0, borderBottomLeftRadius: 0 }}>\n <Slider\n value={localValue}\n onChange={handleChange}\n min={min}\n max={max}\n step={step}\n className=\"flex-1 ml-2\"\n />\n <span className=\"font-semibold\" style={{ minWidth: '3rem', textAlign: 'right' }}>\n {localValue.toFixed(2)}\n </span>\n </div>\n );\n};\n\nSliderField.displayName = 'CommandFormField';\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;AAyBO,MAAM,WAAW,GAAG,CAAY,KAAiC,KAAI;AACxE,IAAA,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,CAAC;AACrE,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,IAAI;AACvC,IAAA,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC;AAC1B,IAAA,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC;AAC1B,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,IAAI;AAC/B,IAAA,MAAM,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU,IAAI,GAAG,IAAI,UAAU,IAAI,GAAG,CAAC;AACrE,IAAA,MAAM,EAAE,gBAAgB,EAAE,GAAG,qBAAqB,EAAE;IAEpD,SAAS,CAAC,MAAK;AACX,QAAA,aAAa,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,CAAC;AAC1C,IAAA,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAExB,SAAS,CAAC,MAAK;AACX,QAAA,IAAI,KAAK,CAAC,SAAS,EAAE;AACjB,YAAA,gBAAgB,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC;QAC9C;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;AAEhD,IAAA,MAAM,YAAY,GAAG,CAAC,CAAoB,KAAI;AAC1C,QAAA,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAe;QAClC,aAAa,CAAC,QAAQ,CAAC;AACvB,QAAA,KAAK,CAAC,aAAa,GAAG,QAAQ,CAAC;AACnC,IAAA,CAAC;AAED,IAAA,QACIA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,kDAAkD,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC,EAAE,sBAAsB,EAAE,CAAC,EAAE,EAAA,QAAA,EAAA,CACjKC,IAAC,MAAM,EAAA,EACH,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,SAAS,EAAC,aAAa,GACzB,EACFA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,eAAe,EAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAA,QAAA,EAC1E,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAA,CACnB,CAAA,EAAA,CACL;AAEd;AAEA,WAAW,CAAC,WAAW,GAAG,kBAAkB;;;;"}
|
package/global.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
-
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
|
|
6
|
-
declare global {
|
|
7
|
-
namespace JSX {
|
|
8
|
-
interface Element extends React.ReactElement {}
|
|
9
|
-
// Add additional JSX-related overrides if necessary.
|
|
10
|
-
}
|
|
11
|
-
}
|
package/index.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
-
|
|
4
|
-
import * as CommandDialog from './CommandDialog';
|
|
5
|
-
import * as CommandForm from './CommandForm';
|
|
6
|
-
import * as DataPage from './DataPage';
|
|
7
|
-
import * as dataTables from './DataTables';
|
|
8
|
-
import * as dialogs from './Dialogs';
|
|
9
|
-
import * as Dropdown from './Dropdown';
|
|
10
|
-
import * as PivotViewer from './PivotViewer';
|
|
11
|
-
import * as TimeMachine from './TimeMachine';
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
CommandDialog,
|
|
15
|
-
CommandForm,
|
|
16
|
-
DataPage,
|
|
17
|
-
dataTables,
|
|
18
|
-
dialogs,
|
|
19
|
-
Dropdown,
|
|
20
|
-
PivotViewer,
|
|
21
|
-
TimeMachine,
|
|
22
|
-
};
|
package/useOverlayZIndex.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
-
|
|
4
|
-
import { useEffect } from 'react';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Hook to force a specific z-index on PrimeReact overlay components.
|
|
8
|
-
* This is a workaround for PrimeReact's automatic z-index calculation
|
|
9
|
-
* which can cause overlays to appear behind dialogs.
|
|
10
|
-
*
|
|
11
|
-
* @param className - The CSS class name to target (e.g., 'location-autocomplete-overlay')
|
|
12
|
-
* @param zIndex - The desired z-index value (default: 10000)
|
|
13
|
-
*/
|
|
14
|
-
export function useOverlayZIndex(className: string, zIndex: number = 10000): void {
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
const observer = new MutationObserver(() => {
|
|
17
|
-
const panel = document.querySelector(`.${className}`);
|
|
18
|
-
if (panel instanceof HTMLElement && panel.style.zIndex !== zIndex.toString()) {
|
|
19
|
-
panel.style.zIndex = zIndex.toString();
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
observer.observe(document.body, {
|
|
24
|
-
childList: true,
|
|
25
|
-
subtree: true,
|
|
26
|
-
attributes: true,
|
|
27
|
-
attributeFilter: ['style']
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
return () => observer.disconnect();
|
|
31
|
-
}, [className, zIndex]);
|
|
32
|
-
}
|
package/vite.config.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
-
|
|
4
|
-
import { defineConfig } from 'vitest/config';
|
|
5
|
-
import react from "@vitejs/plugin-react";
|
|
6
|
-
import path from 'path';
|
|
7
|
-
import { EmitMetadataPlugin } from '@cratis/arc.vite';
|
|
8
|
-
import tailwindcss from "@tailwindcss/vite";
|
|
9
|
-
|
|
10
|
-
export default defineConfig({
|
|
11
|
-
optimizeDeps: {
|
|
12
|
-
exclude: ['tslib']
|
|
13
|
-
},
|
|
14
|
-
esbuild: {
|
|
15
|
-
supported: {
|
|
16
|
-
'top-level-await': true,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
build: {
|
|
20
|
-
outDir: './wwwroot',
|
|
21
|
-
assetsDir: '',
|
|
22
|
-
modulePreload: false,
|
|
23
|
-
target: 'esnext',
|
|
24
|
-
minify: false,
|
|
25
|
-
cssCodeSplit: false,
|
|
26
|
-
rollupOptions: {
|
|
27
|
-
external: [
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
test: {
|
|
32
|
-
globals: true,
|
|
33
|
-
environment: 'node',
|
|
34
|
-
isolate: false,
|
|
35
|
-
fileParallelism: false,
|
|
36
|
-
pool: 'threads',
|
|
37
|
-
coverage: {
|
|
38
|
-
provider: 'v8',
|
|
39
|
-
exclude: [
|
|
40
|
-
'**/for_*/**',
|
|
41
|
-
'**/wwwroot/**',
|
|
42
|
-
'**/api/**',
|
|
43
|
-
'**/Api/**',
|
|
44
|
-
'**/dist/**',
|
|
45
|
-
'**/*.test.tsx',
|
|
46
|
-
'**/*.d.ts',
|
|
47
|
-
'**/declarations.ts',
|
|
48
|
-
],
|
|
49
|
-
},
|
|
50
|
-
exclude: ['**/dist/**', '**/node_modules/**', 'node_modules/**', '**/wwwroot/**', 'wwwroot/**', '**/given/**'],
|
|
51
|
-
include: ['**/for_*/when_*/**/*.ts', '**/for_*/**/when_*.ts'],
|
|
52
|
-
setupFiles: `${__dirname}/vitest.setup.ts`
|
|
53
|
-
},
|
|
54
|
-
plugins: [
|
|
55
|
-
react(),
|
|
56
|
-
tailwindcss(),
|
|
57
|
-
EmitMetadataPlugin() as any
|
|
58
|
-
],
|
|
59
|
-
server: {
|
|
60
|
-
port: process.env.PORT ? parseInt(process.env.PORT) : 9000,
|
|
61
|
-
open: false,
|
|
62
|
-
proxy: {
|
|
63
|
-
'/api': {
|
|
64
|
-
target: 'http://localhost:5000',
|
|
65
|
-
ws: true
|
|
66
|
-
},
|
|
67
|
-
'/swagger': {
|
|
68
|
-
target: 'http://localhost:5000'
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
resolve: {
|
|
73
|
-
alias: {
|
|
74
|
-
'Api': path.resolve('./Api'),
|
|
75
|
-
'Components': path.resolve('./Components'),
|
|
76
|
-
'Layout': path.resolve('./Layout'),
|
|
77
|
-
'Features': path.resolve('./Features')
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
});
|