@ultraviolet/ui 3.18.2 → 3.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/Radio/index.js +1 -0
- package/dist/components/SelectInput/components/SelectBar/selectBar.css.d.ts.map +1 -1
- package/dist/composition.js +5 -1
- package/dist/compositions/Filters/Filters.d.ts +9 -0
- package/dist/compositions/Filters/Filters.d.ts.map +1 -0
- package/dist/compositions/Filters/Filters.js +36 -0
- package/dist/compositions/Filters/filterTypes/FilterDatetimeRange/Dropdown.d.ts +16 -0
- package/dist/compositions/Filters/filterTypes/FilterDatetimeRange/Dropdown.d.ts.map +1 -0
- package/dist/compositions/Filters/filterTypes/FilterDatetimeRange/Dropdown.js +137 -0
- package/dist/compositions/Filters/filterTypes/FilterDatetimeRange/FilterDatetimeRange.d.ts +6 -0
- package/dist/compositions/Filters/filterTypes/FilterDatetimeRange/FilterDatetimeRange.d.ts.map +1 -0
- package/dist/compositions/Filters/filterTypes/FilterDatetimeRange/FilterDatetimeRange.js +74 -0
- package/dist/compositions/Filters/filterTypes/FilterDatetimeRange/filterDatetimeRange.styles.css.d.ts +5 -0
- package/dist/compositions/Filters/filterTypes/FilterDatetimeRange/filterDatetimeRange.styles.css.d.ts.map +1 -0
- package/dist/compositions/Filters/filterTypes/FilterDatetimeRange/filterDatetimeRange.styles.css.js +16 -0
- package/dist/compositions/Filters/filterTypes/FilterDatetimeRange/filterDatetimeRange.styles.css.ts.vanilla.js +8 -0
- package/dist/compositions/Filters/filterTypes/FilterDatetimeRange/type.d.ts +16 -0
- package/dist/compositions/Filters/filterTypes/FilterDatetimeRange/type.d.ts.map +1 -0
- package/dist/compositions/Filters/filterTypes/FilterMultiSelect.d.ts +5 -0
- package/dist/compositions/Filters/filterTypes/FilterMultiSelect.d.ts.map +1 -0
- package/dist/compositions/Filters/filterTypes/FilterMultiSelect.js +53 -0
- package/dist/compositions/Filters/filterTypes/FilterNumber.d.ts +5 -0
- package/dist/compositions/Filters/filterTypes/FilterNumber.d.ts.map +1 -0
- package/dist/compositions/Filters/filterTypes/FilterNumber.js +24 -0
- package/dist/compositions/Filters/filterTypes/FilterSearch.d.ts +5 -0
- package/dist/compositions/Filters/filterTypes/FilterSearch.d.ts.map +1 -0
- package/dist/compositions/Filters/filterTypes/FilterSearch.js +42 -0
- package/dist/compositions/Filters/filterTypes/FilterSelect.d.ts +6 -0
- package/dist/compositions/Filters/filterTypes/FilterSelect.d.ts.map +1 -0
- package/dist/compositions/Filters/filterTypes/FilterSelect.js +46 -0
- package/dist/compositions/Filters/filterTypes/FilterSlider.d.ts +5 -0
- package/dist/compositions/Filters/filterTypes/FilterSlider.d.ts.map +1 -0
- package/dist/compositions/Filters/filterTypes/FilterSlider.js +31 -0
- package/dist/compositions/Filters/filterTypes/FilterText.d.ts +5 -0
- package/dist/compositions/Filters/filterTypes/FilterText.d.ts.map +1 -0
- package/dist/compositions/Filters/filterTypes/FilterText.js +42 -0
- package/dist/compositions/Filters/index.d.ts +7 -0
- package/dist/compositions/Filters/index.d.ts.map +1 -0
- package/dist/compositions/Filters/index.js +12 -0
- package/dist/compositions/Filters/parts/AbstractFilter.d.ts +8 -0
- package/dist/compositions/Filters/parts/AbstractFilter.d.ts.map +1 -0
- package/dist/compositions/Filters/parts/AbstractFilter.js +54 -0
- package/dist/compositions/Filters/parts/ExpandableFilterGroup.d.ts +9 -0
- package/dist/compositions/Filters/parts/ExpandableFilterGroup.d.ts.map +1 -0
- package/dist/compositions/Filters/parts/ExpandableFilterGroup.js +59 -0
- package/dist/compositions/Filters/parts/FiltersDrawer.d.ts +13 -0
- package/dist/compositions/Filters/parts/FiltersDrawer.d.ts.map +1 -0
- package/dist/compositions/Filters/parts/FiltersDrawer.js +100 -0
- package/dist/compositions/Filters/parts/FiltersMainRow.d.ts +19 -0
- package/dist/compositions/Filters/parts/FiltersMainRow.d.ts.map +1 -0
- package/dist/compositions/Filters/parts/FiltersMainRow.js +85 -0
- package/dist/compositions/Filters/parts/FiltersProvider.d.ts +17 -0
- package/dist/compositions/Filters/parts/FiltersProvider.d.ts.map +1 -0
- package/dist/compositions/Filters/parts/FiltersProvider.js +55 -0
- package/dist/compositions/Filters/parts/helpers.d.ts +5 -0
- package/dist/compositions/Filters/parts/helpers.d.ts.map +1 -0
- package/dist/compositions/Filters/parts/helpers.js +38 -0
- package/dist/compositions/Filters/parts/reducer.d.ts +40 -0
- package/dist/compositions/Filters/parts/reducer.d.ts.map +1 -0
- package/dist/compositions/Filters/parts/reducer.js +50 -0
- package/dist/compositions/Filters/parts/styles.css.d.ts +4 -0
- package/dist/compositions/Filters/parts/styles.css.d.ts.map +1 -0
- package/dist/compositions/Filters/parts/styles.css.js +13 -0
- package/dist/compositions/Filters/parts/styles.css.ts.vanilla.js +8 -0
- package/dist/compositions/Filters/parts/useFilters.d.ts +28 -0
- package/dist/compositions/Filters/parts/useFilters.d.ts.map +1 -0
- package/dist/compositions/Filters/parts/useFilters.js +100 -0
- package/dist/compositions/Filters/types.d.ts +80 -0
- package/dist/compositions/Filters/types.d.ts.map +1 -0
- package/dist/compositions/OfferList/components/Row.d.ts +1 -1
- package/dist/compositions/OfferList/components/Row.d.ts.map +1 -1
- package/dist/compositions/OfferList/components/Row.js +3 -2
- package/dist/compositions/OfferList/index.d.ts +1 -1
- package/dist/compositions/index.d.ts +2 -0
- package/dist/compositions/index.d.ts.map +1 -1
- package/dist/compositions/index.js +6 -0
- package/dist/ui.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Radio/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAQ5C,KAAK,UAAU,GAAG;IAChB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,GAAG,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,CAAC,GACnE,IAAI,CACF,mBAAmB,CAAC,gBAAgB,CAAC,EACnC,SAAS,GACT,QAAQ,GACR,UAAU,GACV,WAAW,GACX,WAAW,GACX,IAAI,GACJ,MAAM,GACN,UAAU,GACV,UAAU,GACV,SAAS,GACT,SAAS,GACT,OAAO,GACP,kBAAkB,CACrB,GACD,SAAS,CAAA;AAEX;;GAEG;AACH,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Radio/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAQ5C,KAAK,UAAU,GAAG;IAChB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,GAAG,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,CAAC,GACnE,IAAI,CACF,mBAAmB,CAAC,gBAAgB,CAAC,EACnC,SAAS,GACT,QAAQ,GACR,UAAU,GACV,WAAW,GACX,WAAW,GACX,IAAI,GACJ,MAAM,GACN,UAAU,GACV,UAAU,GACV,SAAS,GACT,SAAS,GACT,OAAO,GACP,kBAAkB,CACrB,GACD,SAAS,CAAA;AAEX;;GAEG;AACH,eAAO,MAAM,KAAK,yGA4FjB,CAAA"}
|
|
@@ -67,6 +67,7 @@ var init_Radio = __esmMin(() => {
|
|
|
67
67
|
className: cn(radioStyle.textLabel[size], radioStyle.label),
|
|
68
68
|
htmlFor: localId,
|
|
69
69
|
prominence: "default",
|
|
70
|
+
sentiment: "neutral",
|
|
70
71
|
variant: size === "small" ? "bodySmall" : "body",
|
|
71
72
|
children: label
|
|
72
73
|
}) : /* @__PURE__ */ jsx("label", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectBar.css.d.ts","sourceRoot":"","sources":["../../../../../src/components/SelectInput/components/SelectBar/selectBar.css.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,oBAItB,CAAA;AACF,eAAO,MAAM,WAAW,oBAItB,CAAA;AAEF,eAAO,MAAM,cAAc,mCASzB,CAAA;AAEF,eAAO,MAAM,WAAW,QAGtB,CAAA;AA+BF,eAAO,MAAM,aAAa,QAuCxB,CAAA;AAEF,eAAO,MAAM,SAAS;;;;;;;gBAoCZ,SAAS;oBACP,WAAW;;;;;;QAMjB,IAAI;YACF,WAAW;;;;;;;;;gBAUT,SAAS;oBACP,WAAW;;;;;;QAMjB,KAAK;YACH,MAAM;YACN,aAAa;;QAEf,MAAM;YACJ,MAAM;YACN,aAAa;;QAEf,KAAK;YACH,MAAM;YACN,OAAO;YACP,aAAa;;;;QAIf,MAAM;;gBA1IN,+BAA+B;oBAC7B,MAAM;;gBAER,kEAAkE;oBAChE,WAAW;oBACX,SAAS,EAEJ,MAAM;;gBAEb,yEAAyE;oBACvE,OAAO;;gBAET,iEAAiE;oBAC/D,WAAW;oBACX,OAAO;;;;QA6HT,OAAO;;;;;;;;;;;;;;;;;;QACP,OAAO;;;;;;;;;;;;;;;;;;;EAGX,CAAA;
|
|
1
|
+
{"version":3,"file":"selectBar.css.d.ts","sourceRoot":"","sources":["../../../../../src/components/SelectInput/components/SelectBar/selectBar.css.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,oBAItB,CAAA;AACF,eAAO,MAAM,WAAW,oBAItB,CAAA;AAEF,eAAO,MAAM,cAAc,mCASzB,CAAA;AAEF,eAAO,MAAM,WAAW,QAGtB,CAAA;AA+BF,eAAO,MAAM,aAAa,QAuCxB,CAAA;AAEF,eAAO,MAAM,SAAS;;;;;;;gBAoCZ,SAAS;oBACP,WAAW;;;;;;QAMjB,IAAI;YACF,WAAW;;;;;;;;;gBAUT,SAAS;oBACP,WAAW;;;;;;QAMjB,KAAK;YACH,MAAM;YACN,aAAa;;QAEf,MAAM;YACJ,MAAM;YACN,aAAa;;QAEf,KAAK;YACH,MAAM;YACN,OAAO;YACP,aAAa;;;;QAIf,MAAM;;gBA1IN,+BAA+B;oBAC7B,MAAM;;gBAER,kEAAkE;oBAChE,WAAW;oBACX,SAAS,EAEJ,MAAM;;gBAEb,yEAAyE;oBACvE,OAAO;;gBAET,iEAAiE;oBAC/D,WAAW;oBACX,OAAO;;;;QA6HT,OAAO;;;;;;;;;;;;;;;;;;QACP,OAAO;;;;;;;;;;;;;;;;;;;EAGX,CAAA;AAQF,eAAO,MAAM,aAAa,sCAGxB,CAAA;AAEF,eAAO,MAAM,cAAc,QAKzB,CAAA;AAEF,eAAO,MAAM,OAAO,QAAsC,CAAA;AAE1D,eAAO,MAAM,gBAAgB,QAI3B,CAAA"}
|
package/dist/composition.js
CHANGED
|
@@ -112,6 +112,10 @@ import { init_styles_css as init_styles_css$12, plansStyle } from "./composition
|
|
|
112
112
|
import { Plans, init_Plans } from "./compositions/Plans/index.js";
|
|
113
113
|
import { init_styles_css as init_styles_css$13, steppedListCardStyle } from "./compositions/SteppedListCard/styles.css.js";
|
|
114
114
|
import { SteppedListCard, init_SteppedListCard } from "./compositions/SteppedListCard/index.js";
|
|
115
|
+
import { FiltersProvider, init_FiltersProvider, useFiltersContext } from "./compositions/Filters/parts/FiltersProvider.js";
|
|
116
|
+
import { FiltersDrawer, init_FiltersDrawer } from "./compositions/Filters/parts/FiltersDrawer.js";
|
|
117
|
+
import { FiltersMainRow, init_FiltersMainRow } from "./compositions/Filters/parts/FiltersMainRow.js";
|
|
118
|
+
import { Filters, init_Filters } from "./compositions/Filters/Filters.js";
|
|
115
119
|
import { init_compositions } from "./compositions/index.js";
|
|
116
120
|
import { init_styles } from "./compositions/styles.js";
|
|
117
121
|
|
|
@@ -124,4 +128,4 @@ var init_composition = __esmMin(() => {
|
|
|
124
128
|
|
|
125
129
|
//#endregion
|
|
126
130
|
init_composition();
|
|
127
|
-
export { ActionBar, Alert, Avatar, Badge, Banner, BarChart, BarStack, Breadcrumbs, Bullet, Button, Card, Carousel, Checkbox, CheckboxGroup, CheckboxGroupCheckbox, Chip, CodeEditor, ContentCard, ContentCardGroup, Conversation, CopyButton, CustomerSatisfaction, DateInput, Dialog, Drawer, EmptyState, EstimateCost, Expandable, ExpandableCard, FAQ, FileInput, GlobalAlert, InfiniteScroll, InfoTable, Key, Label, LineChart, Link, List, Loader, Menu, Meter, Modal, Navigation, NavigationProvider, Notice, NotificationContainer, NumberInput, OfferList, OptionSelector, OrderSummary, Pagination, PasswordCheck, PhoneInput, PieChart, Plans, Popover, Popup, ProgressBar, Radio, RadioGroup, RichTextInput, Row, SearchInput, SelectInput, SelectableCard, SelectableCardGroup, SelectableCardOptionGroup, Separator, Skeleton, Slider, Snippet, Stack, Status, StepList, SteppedListCard, Stepper, SwitchButton, Table, Tabs, Tag, TagInput, TagList, Text, TextArea, TextInput, TimeInput, Toast, ToastContainer, Toggle, ToggleGroup, Tooltip, TreeMapChart, UnitInput, VerificationCode, codeEditorStyle, contentCardGroupStyle, contentCardStyle, conversationStyle, customerSatisfactionStyle, en_default as estimateCostDefaultLocales, estimateCostStyle, faqStyle, infoTableStyle, navigationStyle, notification, offerListStyle, optionSelectorStyle, orderSummaryStyle, plansStyle, steppedListCardStyle, toast, useNavigation };
|
|
131
|
+
export { ActionBar, Alert, Avatar, Badge, Banner, BarChart, BarStack, Breadcrumbs, Bullet, Button, Card, Carousel, Checkbox, CheckboxGroup, CheckboxGroupCheckbox, Chip, CodeEditor, ContentCard, ContentCardGroup, Conversation, CopyButton, CustomerSatisfaction, DateInput, Dialog, Drawer, EmptyState, EstimateCost, Expandable, ExpandableCard, FAQ, FileInput, Filters, FiltersDrawer, FiltersMainRow, FiltersProvider, GlobalAlert, InfiniteScroll, InfoTable, Key, Label, LineChart, Link, List, Loader, Menu, Meter, Modal, Navigation, NavigationProvider, Notice, NotificationContainer, NumberInput, OfferList, OptionSelector, OrderSummary, Pagination, PasswordCheck, PhoneInput, PieChart, Plans, Popover, Popup, ProgressBar, Radio, RadioGroup, RichTextInput, Row, SearchInput, SelectInput, SelectableCard, SelectableCardGroup, SelectableCardOptionGroup, Separator, Skeleton, Slider, Snippet, Stack, Status, StepList, SteppedListCard, Stepper, SwitchButton, Table, Tabs, Tag, TagInput, TagList, Text, TextArea, TextInput, TimeInput, Toast, ToastContainer, Toggle, ToggleGroup, Tooltip, TreeMapChart, UnitInput, VerificationCode, codeEditorStyle, contentCardGroupStyle, contentCardStyle, conversationStyle, customerSatisfactionStyle, en_default as estimateCostDefaultLocales, estimateCostStyle, faqStyle, infoTableStyle, navigationStyle, notification, offerListStyle, optionSelectorStyle, orderSummaryStyle, plansStyle, steppedListCardStyle, toast, useFiltersContext, useNavigation };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DrawerProps } from './parts/FiltersDrawer';
|
|
2
|
+
import type { MainRowProps } from './parts/FiltersMainRow';
|
|
3
|
+
import type { FiltersProviderProps } from './parts/FiltersProvider';
|
|
4
|
+
import type { AnyObject } from './types';
|
|
5
|
+
export type FiltersProps<V extends AnyObject = AnyObject> = MainRowProps<V> & {
|
|
6
|
+
labels: Partial<DrawerProps<V>['labels']>;
|
|
7
|
+
} & FiltersProviderProps<V>;
|
|
8
|
+
export declare const Filters: <V extends AnyObject>({ config, defaultValues, initialValues, onChange, onSubmit, onDrawerOpen, layout, components, labels, className, }: FiltersProps<V>) => import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=Filters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filters.d.ts","sourceRoot":"","sources":["../../../src/compositions/Filters/Filters.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAE1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG;IAC5E,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;CAC1C,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAA;AAK3B,eAAO,MAAM,OAAO,GAAI,CAAC,SAAS,SAAS,sHAWxC,YAAY,CAAC,CAAC,CAAC,gCAWjB,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { FiltersProvider, init_FiltersProvider } from "./parts/FiltersProvider.js";
|
|
3
|
+
import { FiltersDrawer, init_FiltersDrawer } from "./parts/FiltersDrawer.js";
|
|
4
|
+
import { FiltersMainRow, init_FiltersMainRow } from "./parts/FiltersMainRow.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/compositions/Filters/Filters.tsx
|
|
8
|
+
var hasFullDrawerLabels, Filters;
|
|
9
|
+
var init_Filters = __esmMin(() => {
|
|
10
|
+
init_FiltersDrawer();
|
|
11
|
+
init_FiltersMainRow();
|
|
12
|
+
init_FiltersProvider();
|
|
13
|
+
hasFullDrawerLabels = (labels) => !!labels.clear && !!labels.submit && !!labels.drawerHeader;
|
|
14
|
+
Filters = ({ config, defaultValues, initialValues, onChange, onSubmit, onDrawerOpen, layout, components, labels, className }) => /* @__PURE__ */ jsxs(FiltersProvider, {
|
|
15
|
+
defaultValues,
|
|
16
|
+
initialValues,
|
|
17
|
+
onChange,
|
|
18
|
+
onSubmit,
|
|
19
|
+
onDrawerOpen,
|
|
20
|
+
children: [/* @__PURE__ */ jsx(FiltersMainRow, {
|
|
21
|
+
config,
|
|
22
|
+
components,
|
|
23
|
+
labels,
|
|
24
|
+
layout,
|
|
25
|
+
className
|
|
26
|
+
}), hasFullDrawerLabels(labels) ? /* @__PURE__ */ jsx(FiltersDrawer, {
|
|
27
|
+
config,
|
|
28
|
+
components,
|
|
29
|
+
labels
|
|
30
|
+
}) : null]
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
init_Filters();
|
|
36
|
+
export { Filters, init_Filters };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import { DateInput } from '../../../../components/DateInput';
|
|
3
|
+
import type { FilterConfigItemDatetimeRange } from '../../types';
|
|
4
|
+
import type { DatetimeRangeInputValue, DatetimeRangeLocales } from './type';
|
|
5
|
+
type Props = {
|
|
6
|
+
onApply: (newValue: DatetimeRangeInputValue) => void;
|
|
7
|
+
minDate?: Date;
|
|
8
|
+
maxDate?: Date;
|
|
9
|
+
value: DatetimeRangeInputValue;
|
|
10
|
+
dateInputLocale: ComponentProps<typeof DateInput>['locale'];
|
|
11
|
+
relativePresets: FilterConfigItemDatetimeRange['relativePresets'];
|
|
12
|
+
localeTexts: DatetimeRangeLocales;
|
|
13
|
+
};
|
|
14
|
+
export declare const Dropdown: ({ onApply, minDate, maxDate, value, dateInputLocale, relativePresets, localeTexts, }: Props) => import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=Dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../../src/compositions/Filters/filterTypes/FilterDatetimeRange/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG3C,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAM5D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAA;AAE3E,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,CAAC,QAAQ,EAAE,uBAAuB,KAAK,IAAI,CAAA;IACpD,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,KAAK,EAAE,uBAAuB,CAAA;IAC9B,eAAe,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAA;IAC3D,eAAe,EAAE,6BAA6B,CAAC,iBAAiB,CAAC,CAAA;IACjE,WAAW,EAAE,oBAAoB,CAAA;CAClC,CAAA;AAED,eAAO,MAAM,QAAQ,yFAQlB,KAAK,gCA4GP,CAAA"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { __esmMin, __name } from "../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { Stack, init_Stack } from "../../../../components/Stack/index.js";
|
|
3
|
+
import { Button, init_Button } from "../../../../components/Button/index.js";
|
|
4
|
+
import { Row, init_Row } from "../../../../components/Row/index.js";
|
|
5
|
+
import { DateInput, init_DateInput } from "../../../../components/DateInput/index.js";
|
|
6
|
+
import { RadioGroup, init_RadioGroup } from "../../../../components/RadioGroup/index.js";
|
|
7
|
+
import { SwitchButton, init_SwitchButton } from "../../../../components/SwitchButton/index.js";
|
|
8
|
+
import { TimeInput, init_TimeInput } from "../../../../components/TimeInput/index.js";
|
|
9
|
+
import { useState } from "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
|
|
12
|
+
//#region src/compositions/Filters/filterTypes/FilterDatetimeRange/Dropdown.tsx
|
|
13
|
+
var Dropdown;
|
|
14
|
+
var init_Dropdown = __esmMin(() => {
|
|
15
|
+
init_Button();
|
|
16
|
+
init_DateInput();
|
|
17
|
+
init_RadioGroup();
|
|
18
|
+
init_Row();
|
|
19
|
+
init_Stack();
|
|
20
|
+
init_SwitchButton();
|
|
21
|
+
init_TimeInput();
|
|
22
|
+
Dropdown = ({ onApply, minDate, maxDate, value, dateInputLocale, relativePresets, localeTexts }) => {
|
|
23
|
+
const [localPreset, setLocalPreset] = useState(value.preset);
|
|
24
|
+
const [localDateRange, setLocalDateRange] = useState([value.startAt, value.endAt]);
|
|
25
|
+
const [localTimeStart, setLocalTimeStart] = useState(() => {
|
|
26
|
+
if (value.startAt) return value.startAt;
|
|
27
|
+
const newDate = /* @__PURE__ */ new Date();
|
|
28
|
+
newDate.setHours(0);
|
|
29
|
+
newDate.setMinutes(0);
|
|
30
|
+
newDate.setSeconds(0);
|
|
31
|
+
return newDate;
|
|
32
|
+
});
|
|
33
|
+
const [localTimeEnd, setLocalTimeEnd] = useState(() => {
|
|
34
|
+
if (value.endAt) return value.endAt;
|
|
35
|
+
const newDate = /* @__PURE__ */ new Date();
|
|
36
|
+
newDate.setHours(23);
|
|
37
|
+
newDate.setMinutes(59);
|
|
38
|
+
newDate.setSeconds(59);
|
|
39
|
+
return newDate;
|
|
40
|
+
});
|
|
41
|
+
const handleApply = () => {
|
|
42
|
+
if (localPreset) onApply({
|
|
43
|
+
endAt: value.endAt,
|
|
44
|
+
preset: localPreset,
|
|
45
|
+
startAt: value.startAt
|
|
46
|
+
});
|
|
47
|
+
else {
|
|
48
|
+
const startAt = localDateRange[0] ? new Date(localDateRange[0]) : null;
|
|
49
|
+
if (startAt && localTimeStart) {
|
|
50
|
+
startAt.setHours(localTimeStart.getHours());
|
|
51
|
+
startAt.setMinutes(localTimeStart.getMinutes());
|
|
52
|
+
startAt.setSeconds(localTimeStart.getSeconds());
|
|
53
|
+
}
|
|
54
|
+
const endAt = localDateRange[1] ? new Date(localDateRange[1]) : null;
|
|
55
|
+
if (endAt && localTimeEnd) {
|
|
56
|
+
endAt.setHours(localTimeEnd.getHours());
|
|
57
|
+
endAt.setMinutes(localTimeEnd.getMinutes());
|
|
58
|
+
endAt.setSeconds(localTimeEnd.getSeconds());
|
|
59
|
+
}
|
|
60
|
+
onApply({
|
|
61
|
+
endAt,
|
|
62
|
+
preset: null,
|
|
63
|
+
startAt
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
68
|
+
gap: 1,
|
|
69
|
+
width: "100%",
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsxs(SwitchButton, {
|
|
72
|
+
name: "timeType",
|
|
73
|
+
onChange: (event) => {
|
|
74
|
+
if (event.target.value === "relative") setLocalPreset(relativePresets[0].value);
|
|
75
|
+
else setLocalPreset(null);
|
|
76
|
+
},
|
|
77
|
+
value: localPreset ? "relative" : "absolute",
|
|
78
|
+
children: [/* @__PURE__ */ jsx(SwitchButton.Option, {
|
|
79
|
+
value: "relative",
|
|
80
|
+
children: localeTexts.relative
|
|
81
|
+
}), /* @__PURE__ */ jsx(SwitchButton.Option, {
|
|
82
|
+
value: "absolute",
|
|
83
|
+
children: localeTexts.absolute
|
|
84
|
+
})]
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ jsx(Stack, { children: localPreset ? /* @__PURE__ */ jsx(Stack, {
|
|
87
|
+
gap: 1,
|
|
88
|
+
children: /* @__PURE__ */ jsx(RadioGroup, {
|
|
89
|
+
onChange: (event) => {
|
|
90
|
+
setLocalPreset(event.target.value);
|
|
91
|
+
},
|
|
92
|
+
value: localPreset,
|
|
93
|
+
children: relativePresets.map((presetObj) => /* @__PURE__ */ jsx(RadioGroup.Radio, {
|
|
94
|
+
label: presetObj.label,
|
|
95
|
+
value: presetObj.value
|
|
96
|
+
}, presetObj.value))
|
|
97
|
+
})
|
|
98
|
+
}) : /* @__PURE__ */ jsxs(Stack, {
|
|
99
|
+
gap: 1,
|
|
100
|
+
children: [/* @__PURE__ */ jsx(DateInput, {
|
|
101
|
+
endDate: localDateRange[1],
|
|
102
|
+
input: "calendar",
|
|
103
|
+
locale: dateInputLocale,
|
|
104
|
+
maxDate,
|
|
105
|
+
minDate,
|
|
106
|
+
onChange: (newDateRange) => {
|
|
107
|
+
setLocalDateRange([newDateRange[0], newDateRange[1]]);
|
|
108
|
+
},
|
|
109
|
+
selectsRange: true,
|
|
110
|
+
startDate: localDateRange[0]
|
|
111
|
+
}), /* @__PURE__ */ jsxs(Row, {
|
|
112
|
+
gap: 2,
|
|
113
|
+
templateColumns: "1fr 1fr",
|
|
114
|
+
children: [/* @__PURE__ */ jsx(TimeInput, {
|
|
115
|
+
label: localeTexts.timeStart,
|
|
116
|
+
onChange: setLocalTimeStart,
|
|
117
|
+
value: localTimeStart
|
|
118
|
+
}), /* @__PURE__ */ jsx(TimeInput, {
|
|
119
|
+
label: localeTexts.timeEnd,
|
|
120
|
+
onChange: setLocalTimeEnd,
|
|
121
|
+
value: localTimeEnd
|
|
122
|
+
})]
|
|
123
|
+
})]
|
|
124
|
+
}) }),
|
|
125
|
+
/* @__PURE__ */ jsx(Button, {
|
|
126
|
+
onClick: handleApply,
|
|
127
|
+
size: "medium",
|
|
128
|
+
children: localeTexts.apply
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
//#endregion
|
|
136
|
+
init_Dropdown();
|
|
137
|
+
export { Dropdown, init_Dropdown };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FilterConfigItemDatetimeRange, FilterComponentProps } from '../../types';
|
|
2
|
+
import type { DatetimeRangeInputValue } from './type';
|
|
3
|
+
type FilterDatetimeRangeProps = FilterComponentProps<DatetimeRangeInputValue, FilterConfigItemDatetimeRange>;
|
|
4
|
+
export declare const FilterDatetimeRange: ({ onChange, value, hideLabel, config, size }: FilterDatetimeRangeProps) => import("react").JSX.Element;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=FilterDatetimeRange.d.ts.map
|
package/dist/compositions/Filters/filterTypes/FilterDatetimeRange/FilterDatetimeRange.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterDatetimeRange.d.ts","sourceRoot":"","sources":["../../../../../src/compositions/Filters/filterTypes/FilterDatetimeRange/FilterDatetimeRange.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAEtF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAA;AAGrD,KAAK,wBAAwB,GAAG,oBAAoB,CAAC,uBAAuB,EAAE,6BAA6B,CAAC,CAAA;AAE5G,eAAO,MAAM,mBAAmB,iDAAkD,wBAAwB,gCAoDzG,CAAA"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { __esmMin, __name } from "../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { Stack, init_Stack } from "../../../../components/Stack/index.js";
|
|
3
|
+
import { Button, init_Button } from "../../../../components/Button/index.js";
|
|
4
|
+
import { Label, init_Label } from "../../../../components/Label/index.js";
|
|
5
|
+
import { Popover, init_Popover } from "../../../../components/Popover/index.js";
|
|
6
|
+
import { Dropdown, init_Dropdown } from "./Dropdown.js";
|
|
7
|
+
import { filterDatetimeRangeStyles, init_filterDatetimeRange_styles_css } from "./filterDatetimeRange.styles.css.js";
|
|
8
|
+
import { useMemo, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
//#region src/compositions/Filters/filterTypes/FilterDatetimeRange/FilterDatetimeRange.tsx
|
|
12
|
+
var FilterDatetimeRange;
|
|
13
|
+
var init_FilterDatetimeRange = __esmMin(() => {
|
|
14
|
+
init_Button();
|
|
15
|
+
init_Label();
|
|
16
|
+
init_Popover();
|
|
17
|
+
init_Stack();
|
|
18
|
+
init_Dropdown();
|
|
19
|
+
init_filterDatetimeRange_styles_css();
|
|
20
|
+
FilterDatetimeRange = ({ onChange, value, hideLabel, config, size }) => {
|
|
21
|
+
const [isPopupVisible, setIsPopupVisible] = useState(false);
|
|
22
|
+
const formattedValue = useMemo(() => {
|
|
23
|
+
if (value.preset) {
|
|
24
|
+
var _config$relativePrese;
|
|
25
|
+
var _config$relativePrese2;
|
|
26
|
+
return (_config$relativePrese = (_config$relativePrese2 = config.relativePresets.find((item) => item.value === value.preset)) === null || _config$relativePrese2 === void 0 ? void 0 : _config$relativePrese2.label) !== null && _config$relativePrese !== void 0 ? _config$relativePrese : value.preset;
|
|
27
|
+
}
|
|
28
|
+
return `${value.startAt ? config.dateFormatter(value.startAt) : "-"} -> ${value.endAt ? config.dateFormatter(value.endAt) : "Today"}`;
|
|
29
|
+
}, [value, config]);
|
|
30
|
+
return /* @__PURE__ */ jsx(Popover, {
|
|
31
|
+
className: filterDatetimeRangeStyles.popover,
|
|
32
|
+
content: /* @__PURE__ */ jsx(Dropdown, {
|
|
33
|
+
dateInputLocale: config.dateInputLocale,
|
|
34
|
+
localeTexts: config.texts,
|
|
35
|
+
maxDate: config.maxDate,
|
|
36
|
+
minDate: config.minDate,
|
|
37
|
+
onApply: (newValue) => {
|
|
38
|
+
onChange(newValue);
|
|
39
|
+
setIsPopupVisible(false);
|
|
40
|
+
},
|
|
41
|
+
relativePresets: config.relativePresets,
|
|
42
|
+
value
|
|
43
|
+
}),
|
|
44
|
+
onClose: () => {
|
|
45
|
+
setIsPopupVisible(false);
|
|
46
|
+
},
|
|
47
|
+
placement: "bottom",
|
|
48
|
+
title: config.texts.dropdownTitle,
|
|
49
|
+
visible: isPopupVisible,
|
|
50
|
+
children: /* @__PURE__ */ jsxs(Stack, {
|
|
51
|
+
gap: .5,
|
|
52
|
+
width: "100%",
|
|
53
|
+
children: [hideLabel ? null : /* @__PURE__ */ jsx(Label, {
|
|
54
|
+
size,
|
|
55
|
+
children: config.label
|
|
56
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
57
|
+
className: filterDatetimeRangeStyles.button,
|
|
58
|
+
size,
|
|
59
|
+
fullWidth: true,
|
|
60
|
+
onClick: () => {
|
|
61
|
+
setIsPopupVisible(true);
|
|
62
|
+
},
|
|
63
|
+
sentiment: "neutral",
|
|
64
|
+
variant: "outlined",
|
|
65
|
+
children: formattedValue
|
|
66
|
+
})]
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
init_FilterDatetimeRange();
|
|
74
|
+
export { FilterDatetimeRange, init_FilterDatetimeRange };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterDatetimeRange.styles.css.d.ts","sourceRoot":"","sources":["../../../../../src/compositions/Filters/filterTypes/FilterDatetimeRange/filterDatetimeRange.styles.css.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,yBAAyB;;;CAGrC,CAAA"}
|
package/dist/compositions/Filters/filterTypes/FilterDatetimeRange/filterDatetimeRange.styles.css.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __esmMin } from "../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { init_filterDatetimeRange_styles_css_ts_vanilla } from "./filterDatetimeRange.styles.css.ts.vanilla.js";
|
|
3
|
+
|
|
4
|
+
//#region src/compositions/Filters/filterTypes/FilterDatetimeRange/filterDatetimeRange.styles.css.ts
|
|
5
|
+
var filterDatetimeRangeStyles;
|
|
6
|
+
var init_filterDatetimeRange_styles_css = __esmMin(() => {
|
|
7
|
+
init_filterDatetimeRange_styles_css_ts_vanilla();
|
|
8
|
+
filterDatetimeRangeStyles = {
|
|
9
|
+
popover: "uv_1yrgjra0",
|
|
10
|
+
button: "uv_1yrgjra1"
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
init_filterDatetimeRange_styles_css();
|
|
16
|
+
export { filterDatetimeRangeStyles, init_filterDatetimeRange_styles_css };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { __esmMin } from "../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
|
|
3
|
+
//#region src/compositions/Filters/filterTypes/FilterDatetimeRange/filterDatetimeRange.styles.css.ts.vanilla.css
|
|
4
|
+
var init_filterDatetimeRange_styles_css_ts_vanilla = __esmMin(() => {});
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
init_filterDatetimeRange_styles_css_ts_vanilla();
|
|
8
|
+
export { init_filterDatetimeRange_styles_css_ts_vanilla };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type DatetimeRangeInputValue = {
|
|
2
|
+
preset: string | null;
|
|
3
|
+
startAt: Date | null;
|
|
4
|
+
endAt: Date | null;
|
|
5
|
+
};
|
|
6
|
+
export type DatetimeRangeLocales = {
|
|
7
|
+
from: string;
|
|
8
|
+
to: string;
|
|
9
|
+
relative: string;
|
|
10
|
+
absolute: string;
|
|
11
|
+
apply: string;
|
|
12
|
+
timeStart: string;
|
|
13
|
+
timeEnd: string;
|
|
14
|
+
dropdownTitle: string;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../../src/compositions/Filters/filterTypes/FilterDatetimeRange/type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAA;IACpB,KAAK,EAAE,IAAI,GAAG,IAAI,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FilterConfigItemMultiSelect, AnyObject, FilterComponentProps } from '../types';
|
|
2
|
+
type FilterMultiSelectProps<Values extends AnyObject> = FilterComponentProps<string[], FilterConfigItemMultiSelect, Values>;
|
|
3
|
+
export declare const FilterMultiSelect: <V extends AnyObject>({ hideLabel, directionContext, config, value, onChange, values, size, }: FilterMultiSelectProps<V>) => import("react").JSX.Element;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=FilterMultiSelect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterMultiSelect.d.ts","sourceRoot":"","sources":["../../../../src/compositions/Filters/filterTypes/FilterMultiSelect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,2BAA2B,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAG5F,KAAK,sBAAsB,CAAC,MAAM,SAAS,SAAS,IAAI,oBAAoB,CAC1E,MAAM,EAAE,EACR,2BAA2B,EAC3B,MAAM,CACP,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,SAAS,2EAQlD,sBAAsB,CAAC,CAAC,CAAC,gCA+C3B,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { __esmMin, __name } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { Label, init_Label } from "../../../components/Label/index.js";
|
|
3
|
+
import { SelectInput, init_SelectInput } from "../../../components/SelectInput/index.js";
|
|
4
|
+
import { CheckboxGroup, init_CheckboxGroup } from "../../../components/CheckboxGroup/index.js";
|
|
5
|
+
import { init_FilterSelect } from "./FilterSelect.js";
|
|
6
|
+
import { useMemo } from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/compositions/Filters/filterTypes/FilterMultiSelect.tsx
|
|
10
|
+
var FilterMultiSelect;
|
|
11
|
+
var init_FilterMultiSelect = __esmMin(() => {
|
|
12
|
+
init_CheckboxGroup();
|
|
13
|
+
init_Label();
|
|
14
|
+
init_SelectInput();
|
|
15
|
+
init_FilterSelect();
|
|
16
|
+
FilterMultiSelect = ({ hideLabel, directionContext, config, value, onChange, values, size }) => {
|
|
17
|
+
const configOptions = config.options;
|
|
18
|
+
const options = useMemo(() => typeof configOptions === "function" ? configOptions(values) : configOptions, [values, configOptions]);
|
|
19
|
+
if (directionContext === "column" && Array.isArray(options) && options.length < 10) return /* @__PURE__ */ jsx(CheckboxGroup, {
|
|
20
|
+
description: hideLabel ? void 0 : /* @__PURE__ */ jsx(Label, { children: config.label }),
|
|
21
|
+
name: config.name,
|
|
22
|
+
onChange: (event) => {
|
|
23
|
+
if (value.includes(event.currentTarget.value)) onChange(value.filter((currentValue) => currentValue !== event.currentTarget.value));
|
|
24
|
+
else onChange([...value, event.currentTarget.value]);
|
|
25
|
+
},
|
|
26
|
+
value,
|
|
27
|
+
children: options.map((option) => /* @__PURE__ */ jsx(CheckboxGroup.Checkbox, {
|
|
28
|
+
name: config.name,
|
|
29
|
+
value: option.value,
|
|
30
|
+
children: option.label
|
|
31
|
+
}, option.value))
|
|
32
|
+
});
|
|
33
|
+
return /* @__PURE__ */ jsx(SelectInput, {
|
|
34
|
+
"aria-label": hideLabel ? config.label : void 0,
|
|
35
|
+
label: hideLabel ? void 0 : config.label,
|
|
36
|
+
multiselect: true,
|
|
37
|
+
name: config.name,
|
|
38
|
+
size,
|
|
39
|
+
clearable: config.clearable,
|
|
40
|
+
onChange,
|
|
41
|
+
options,
|
|
42
|
+
placeholder: config.placeholder,
|
|
43
|
+
searchable: config.searchable,
|
|
44
|
+
selectAll: config.selectAll,
|
|
45
|
+
selectAllGroup: config.selectAllGroup,
|
|
46
|
+
value
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
init_FilterMultiSelect();
|
|
53
|
+
export { FilterMultiSelect, init_FilterMultiSelect };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FilterComponentProps, FilterConfigItemNumber } from '../types';
|
|
2
|
+
type FilterNumberProps = FilterComponentProps<number | null, FilterConfigItemNumber>;
|
|
3
|
+
export declare const FilterNumber: ({ config, hideLabel, onChange, value, size }: FilterNumberProps) => import("react").JSX.Element;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=FilterNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterNumber.d.ts","sourceRoot":"","sources":["../../../../src/compositions/Filters/filterTypes/FilterNumber.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAE5E,KAAK,iBAAiB,GAAG,oBAAoB,CAAC,MAAM,GAAG,IAAI,EAAE,sBAAsB,CAAC,CAAA;AAEpF,eAAO,MAAM,YAAY,iDAAkD,iBAAiB,gCAY3F,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __esmMin, __name } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { NumberInput, init_NumberInput } from "../../../components/NumberInput/index.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/compositions/Filters/filterTypes/FilterNumber.tsx
|
|
6
|
+
var FilterNumber;
|
|
7
|
+
var init_FilterNumber = __esmMin(() => {
|
|
8
|
+
init_NumberInput();
|
|
9
|
+
FilterNumber = ({ config, hideLabel, onChange, value, size }) => /* @__PURE__ */ jsx(NumberInput, {
|
|
10
|
+
max: config.max,
|
|
11
|
+
min: config.min,
|
|
12
|
+
"aria-label": hideLabel ? config.label : void 0,
|
|
13
|
+
label: hideLabel ? void 0 : config.label,
|
|
14
|
+
size,
|
|
15
|
+
name: config.name,
|
|
16
|
+
onChange,
|
|
17
|
+
placeholder: config.placeholder,
|
|
18
|
+
value
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
init_FilterNumber();
|
|
24
|
+
export { FilterNumber, init_FilterNumber };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FilterConfigItemSearch, FilterComponentProps } from '../types';
|
|
2
|
+
type FilterSearchProps = FilterComponentProps<string, FilterConfigItemSearch>;
|
|
3
|
+
export declare const FilterSearch: ({ config, hideLabel, onChange, value, size }: FilterSearchProps) => import("react").JSX.Element;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=FilterSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterSearch.d.ts","sourceRoot":"","sources":["../../../../src/compositions/Filters/filterTypes/FilterSearch.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE5E,KAAK,iBAAiB,GAAG,oBAAoB,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAA;AAE7E,eAAO,MAAM,YAAY,iDAAkD,iBAAiB,gCA8B3F,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { __esmMin, __name } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { SearchInput, init_SearchInput } from "../../../components/SearchInput/index.js";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { useDebouncedCallback } from "@ultraviolet/utils";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/compositions/Filters/filterTypes/FilterSearch.tsx
|
|
8
|
+
var FilterSearch;
|
|
9
|
+
var init_FilterSearch = __esmMin(() => {
|
|
10
|
+
init_SearchInput();
|
|
11
|
+
FilterSearch = ({ config, hideLabel, onChange, value, size }) => {
|
|
12
|
+
var _config$debounceDurat;
|
|
13
|
+
const [tempValue, setTempValue] = useState(value);
|
|
14
|
+
const onSetValueLater = useDebouncedCallback(onChange, (_config$debounceDurat = config.debounceDuration) !== null && _config$debounceDurat !== void 0 ? _config$debounceDurat : 600);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
setTempValue(value);
|
|
17
|
+
}, [value]);
|
|
18
|
+
return /* @__PURE__ */ jsx(SearchInput, {
|
|
19
|
+
"aria-label": hideLabel ? config.label : void 0,
|
|
20
|
+
label: hideLabel ? void 0 : config.label,
|
|
21
|
+
loading: tempValue !== value,
|
|
22
|
+
name: config.name,
|
|
23
|
+
size,
|
|
24
|
+
onSearch: (searchString) => {
|
|
25
|
+
setTempValue(searchString);
|
|
26
|
+
onSetValueLater(searchString);
|
|
27
|
+
},
|
|
28
|
+
onKeyDown: (event) => {
|
|
29
|
+
if (event.key === "Enter") {
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
event.stopPropagation();
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
placeholder: config.placeholder,
|
|
35
|
+
value: tempValue
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
init_FilterSearch();
|
|
42
|
+
export { FilterSearch, init_FilterSearch };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FilterConfigItemSelect, AnyObject, FilterComponentProps } from '../types';
|
|
2
|
+
export declare const SELECT_DISPLAY_THRESHOLD = 10;
|
|
3
|
+
type FilterSelectProps<Values extends AnyObject> = FilterComponentProps<string, FilterConfigItemSelect, Values>;
|
|
4
|
+
export declare const FilterSelect: <V extends AnyObject>({ hideLabel, directionContext, config, value, onChange, values, size, }: FilterSelectProps<V>) => import("react").JSX.Element;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=FilterSelect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterSelect.d.ts","sourceRoot":"","sources":["../../../../src/compositions/Filters/filterTypes/FilterSelect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAEvF,eAAO,MAAM,wBAAwB,KAAK,CAAA;AAE1C,KAAK,iBAAiB,CAAC,MAAM,SAAS,SAAS,IAAI,oBAAoB,CAAC,MAAM,EAAE,sBAAsB,EAAE,MAAM,CAAC,CAAA;AAE/G,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,SAAS,2EAQ7C,iBAAiB,CAAC,CAAC,CAAC,gCAqCtB,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { __esmMin, __name } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { Label, init_Label } from "../../../components/Label/index.js";
|
|
3
|
+
import { SelectInput, init_SelectInput } from "../../../components/SelectInput/index.js";
|
|
4
|
+
import { RadioGroup, init_RadioGroup } from "../../../components/RadioGroup/index.js";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/compositions/Filters/filterTypes/FilterSelect.tsx
|
|
9
|
+
var SELECT_DISPLAY_THRESHOLD, FilterSelect;
|
|
10
|
+
var init_FilterSelect = __esmMin(() => {
|
|
11
|
+
init_Label();
|
|
12
|
+
init_RadioGroup();
|
|
13
|
+
init_SelectInput();
|
|
14
|
+
SELECT_DISPLAY_THRESHOLD = 10;
|
|
15
|
+
FilterSelect = ({ hideLabel, directionContext, config, value, onChange, values, size }) => {
|
|
16
|
+
const configOptions = config.options;
|
|
17
|
+
const options = useMemo(() => typeof configOptions === "function" ? configOptions(values) : configOptions, [values, configOptions]);
|
|
18
|
+
if (directionContext === "column" && Array.isArray(options) && options.length < 10) return /* @__PURE__ */ jsx(RadioGroup, {
|
|
19
|
+
description: hideLabel ? void 0 : /* @__PURE__ */ jsx(Label, { children: config.label }),
|
|
20
|
+
name: config.name,
|
|
21
|
+
onChange: (event) => {
|
|
22
|
+
onChange === null || onChange === void 0 || onChange(event.target.value);
|
|
23
|
+
},
|
|
24
|
+
value,
|
|
25
|
+
children: options.map((option) => /* @__PURE__ */ jsx(RadioGroup.Radio, {
|
|
26
|
+
label: option.label,
|
|
27
|
+
value: option.value
|
|
28
|
+
}, option.value))
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ jsx(SelectInput, {
|
|
31
|
+
"aria-label": hideLabel ? config.label : void 0,
|
|
32
|
+
clearable: config.clearable,
|
|
33
|
+
label: hideLabel ? void 0 : config.label,
|
|
34
|
+
size,
|
|
35
|
+
name: config.name,
|
|
36
|
+
onChange,
|
|
37
|
+
options,
|
|
38
|
+
placeholder: config.placeholder,
|
|
39
|
+
value
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
init_FilterSelect();
|
|
46
|
+
export { FilterSelect, init_FilterSelect };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FilterConfigItemSlider, FilterComponentProps } from '../types';
|
|
2
|
+
type FilterSliderProps = FilterComponentProps<number | number[], FilterConfigItemSlider>;
|
|
3
|
+
export declare const FilterSlider: ({ value, onChange, config, hideLabel }: FilterSliderProps) => import("react").JSX.Element;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=FilterSlider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterSlider.d.ts","sourceRoot":"","sources":["../../../../src/compositions/Filters/filterTypes/FilterSlider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE5E,KAAK,iBAAiB,GAAG,oBAAoB,CAAC,MAAM,GAAG,MAAM,EAAE,EAAE,sBAAsB,CAAC,CAAA;AAExF,eAAO,MAAM,YAAY,2CAA4C,iBAAiB,gCAmBrF,CAAA"}
|