@seij/common-ui 0.0.1
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/LICENSE +201 -0
- package/README.md +7 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +113 -0
- package/dist/index.js.map +1 -0
- package/dist/init/SeijUIProvider.d.ts +15 -0
- package/dist/init/SeijUIProvider.d.ts.map +1 -0
- package/dist/init/SeijUIProvider.js +20 -0
- package/dist/init/SeijUIProvider.js.map +1 -0
- package/dist/lib/applicationshell/ApplicationShell.d.ts +13 -0
- package/dist/lib/applicationshell/ApplicationShell.d.ts.map +1 -0
- package/dist/lib/applicationshell/ApplicationShell.js +110 -0
- package/dist/lib/applicationshell/ApplicationShell.js.map +1 -0
- package/dist/lib/applicationshell/ApplicationShell.types.d.ts +9 -0
- package/dist/lib/applicationshell/ApplicationShell.types.d.ts.map +1 -0
- package/dist/lib/applicationshell/TitleBar.d.ts +9 -0
- package/dist/lib/applicationshell/TitleBar.d.ts.map +1 -0
- package/dist/lib/applicationshell/TitleBar.js +100 -0
- package/dist/lib/applicationshell/TitleBar.js.map +1 -0
- package/dist/lib/badge/Badge.d.ts +5 -0
- package/dist/lib/badge/Badge.d.ts.map +1 -0
- package/dist/lib/badge/Badge.js +9 -0
- package/dist/lib/badge/Badge.js.map +1 -0
- package/dist/lib/button/Button.d.ts +16 -0
- package/dist/lib/button/Button.d.ts.map +1 -0
- package/dist/lib/button/Button.js +15 -0
- package/dist/lib/button/Button.js.map +1 -0
- package/dist/lib/button_bar/ButtonBar.d.ts +5 -0
- package/dist/lib/button_bar/ButtonBar.d.ts.map +1 -0
- package/dist/lib/button_bar/ButtonBar.js +26 -0
- package/dist/lib/button_bar/ButtonBar.js.map +1 -0
- package/dist/lib/common-ui.d.ts +5 -0
- package/dist/lib/common-ui.d.ts.map +1 -0
- package/dist/lib/common-ui.js +9 -0
- package/dist/lib/common-ui.js.map +1 -0
- package/dist/lib/commons/currencysymbol.d.ts +2 -0
- package/dist/lib/commons/currencysymbol.d.ts.map +1 -0
- package/dist/lib/commons/currencysymbol.js +15 -0
- package/dist/lib/commons/currencysymbol.js.map +1 -0
- package/dist/lib/commons/obfuscatelabel.d.ts +17 -0
- package/dist/lib/commons/obfuscatelabel.d.ts.map +1 -0
- package/dist/lib/commons/obfuscatelabel.js +23 -0
- package/dist/lib/commons/obfuscatelabel.js.map +1 -0
- package/dist/lib/data_table/DataTable.d.ts +32 -0
- package/dist/lib/data_table/DataTable.d.ts.map +1 -0
- package/dist/lib/data_table/DataTable.js +40 -0
- package/dist/lib/data_table/DataTable.js.map +1 -0
- package/dist/lib/datatabledynamic/DataTableDynamic.d.ts +14 -0
- package/dist/lib/datatabledynamic/DataTableDynamic.d.ts.map +1 -0
- package/dist/lib/datatabledynamic/DataTableDynamic.js +18 -0
- package/dist/lib/datatabledynamic/DataTableDynamic.js.map +1 -0
- package/dist/lib/devise/DeviseContext.d.ts +2 -0
- package/dist/lib/devise/DeviseContext.d.ts.map +1 -0
- package/dist/lib/devise/DeviseContext.js +6 -0
- package/dist/lib/devise/DeviseContext.js.map +1 -0
- package/dist/lib/error_notifier/ErrorNotifier.d.ts +6 -0
- package/dist/lib/error_notifier/ErrorNotifier.d.ts.map +1 -0
- package/dist/lib/error_notifier/ErrorNotifier.js +29 -0
- package/dist/lib/error_notifier/ErrorNotifier.js.map +1 -0
- package/dist/lib/errorbox/ErrorBox.d.ts +6 -0
- package/dist/lib/errorbox/ErrorBox.d.ts.map +1 -0
- package/dist/lib/errorbox/ErrorBox.js +26 -0
- package/dist/lib/errorbox/ErrorBox.js.map +1 -0
- package/dist/lib/form_layout/FormLayout.d.ts +23 -0
- package/dist/lib/form_layout/FormLayout.d.ts.map +1 -0
- package/dist/lib/form_layout/FormLayout.js +102 -0
- package/dist/lib/form_layout/FormLayout.js.map +1 -0
- package/dist/lib/i18n/i18n.detect.d.ts +10 -0
- package/dist/lib/i18n/i18n.detect.d.ts.map +1 -0
- package/dist/lib/i18n/i18n.detect.js +30 -0
- package/dist/lib/i18n/i18n.detect.js.map +1 -0
- package/dist/lib/i18n/i18n.factory.d.ts +3 -0
- package/dist/lib/i18n/i18n.factory.d.ts.map +1 -0
- package/dist/lib/i18n/i18n.factory.js +70 -0
- package/dist/lib/i18n/i18n.factory.js.map +1 -0
- package/dist/lib/i18n/i18n.react.d.ts +19 -0
- package/dist/lib/i18n/i18n.react.d.ts.map +1 -0
- package/dist/lib/i18n/i18n.react.js +29 -0
- package/dist/lib/i18n/i18n.react.js.map +1 -0
- package/dist/lib/i18n/i18n.types.d.ts +28 -0
- package/dist/lib/i18n/i18n.types.d.ts.map +1 -0
- package/dist/lib/i18n/index.d.ts +3 -0
- package/dist/lib/i18n/index.d.ts.map +1 -0
- package/dist/lib/info_box/InfoBox.d.ts +7 -0
- package/dist/lib/info_box/InfoBox.d.ts.map +1 -0
- package/dist/lib/info_box/InfoBox.js +13 -0
- package/dist/lib/info_box/InfoBox.js.map +1 -0
- package/dist/lib/inlineedit/InlineEdit.d.ts +9 -0
- package/dist/lib/inlineedit/InlineEdit.d.ts.map +1 -0
- package/dist/lib/inlineedit/InlineEdit.js +47 -0
- package/dist/lib/inlineedit/InlineEdit.js.map +1 -0
- package/dist/lib/listview/ListView.d.ts +16 -0
- package/dist/lib/listview/ListView.d.ts.map +1 -0
- package/dist/lib/listview/ListView.js +100 -0
- package/dist/lib/listview/ListView.js.map +1 -0
- package/dist/lib/loader/Loader.d.ts +4 -0
- package/dist/lib/loader/Loader.d.ts.map +1 -0
- package/dist/lib/loader/Loader.js +9 -0
- package/dist/lib/loader/Loader.js.map +1 -0
- package/dist/lib/localdate/InputLocalDate.d.ts +17 -0
- package/dist/lib/localdate/InputLocalDate.d.ts.map +1 -0
- package/dist/lib/localdate/InputLocalDate.js +61 -0
- package/dist/lib/localdate/InputLocalDate.js.map +1 -0
- package/dist/lib/localdate/LabelLocalDate.d.ts +6 -0
- package/dist/lib/localdate/LabelLocalDate.d.ts.map +1 -0
- package/dist/lib/localdate/LabelLocalDate.js +9 -0
- package/dist/lib/localdate/LabelLocalDate.js.map +1 -0
- package/dist/lib/money/InputMoneyDec.d.ts +20 -0
- package/dist/lib/money/InputMoneyDec.d.ts.map +1 -0
- package/dist/lib/money/InputMoneyDec.js +24 -0
- package/dist/lib/money/InputMoneyDec.js.map +1 -0
- package/dist/lib/money/InputMoneyInt.d.ts +24 -0
- package/dist/lib/money/InputMoneyInt.d.ts.map +1 -0
- package/dist/lib/money/InputMoneyInt.js +24 -0
- package/dist/lib/money/InputMoneyInt.js.map +1 -0
- package/dist/lib/money/LabelMoneyDec.d.ts +33 -0
- package/dist/lib/money/LabelMoneyDec.d.ts.map +1 -0
- package/dist/lib/money/LabelMoneyDec.js +22 -0
- package/dist/lib/money/LabelMoneyDec.js.map +1 -0
- package/dist/lib/money/LabelMoneyInt.d.ts +33 -0
- package/dist/lib/money/LabelMoneyInt.d.ts.map +1 -0
- package/dist/lib/money/LabelMoneyInt.js +22 -0
- package/dist/lib/money/LabelMoneyInt.js.map +1 -0
- package/dist/lib/month/InputDurationMonths.d.ts +9 -0
- package/dist/lib/month/InputDurationMonths.d.ts.map +1 -0
- package/dist/lib/month/InputDurationMonths.js +22 -0
- package/dist/lib/month/InputDurationMonths.js.map +1 -0
- package/dist/lib/month/InputMonth.d.ts +13 -0
- package/dist/lib/month/InputMonth.d.ts.map +1 -0
- package/dist/lib/month/InputMonth.js +15 -0
- package/dist/lib/month/InputMonth.js.map +1 -0
- package/dist/lib/navigation/Navigation.d.ts +9 -0
- package/dist/lib/navigation/Navigation.d.ts.map +1 -0
- package/dist/lib/navigation/Navigation.js +38 -0
- package/dist/lib/navigation/Navigation.js.map +1 -0
- package/dist/lib/navigation/Navigation.types.d.ts +48 -0
- package/dist/lib/navigation/Navigation.types.d.ts.map +1 -0
- package/dist/lib/navigation/NavigationService.d.ts +8 -0
- package/dist/lib/navigation/NavigationService.d.ts.map +1 -0
- package/dist/lib/navigation/NavigationService.js +13 -0
- package/dist/lib/navigation/NavigationService.js.map +1 -0
- package/dist/lib/number/InputNumber.d.ts +22 -0
- package/dist/lib/number/InputNumber.d.ts.map +1 -0
- package/dist/lib/number/InputNumber.js +82 -0
- package/dist/lib/number/InputNumber.js.map +1 -0
- package/dist/lib/number/InputNumberDec.d.ts +16 -0
- package/dist/lib/number/InputNumberDec.d.ts.map +1 -0
- package/dist/lib/number/InputNumberDec.js +21 -0
- package/dist/lib/number/InputNumberDec.js.map +1 -0
- package/dist/lib/number/InputNumberInt.d.ts +19 -0
- package/dist/lib/number/InputNumberInt.d.ts.map +1 -0
- package/dist/lib/number/InputNumberInt.js +21 -0
- package/dist/lib/number/InputNumberInt.js.map +1 -0
- package/dist/lib/number/index.d.ts +4 -0
- package/dist/lib/number/index.d.ts.map +1 -0
- package/dist/lib/percent/InputPercent.d.ts +9 -0
- package/dist/lib/percent/InputPercent.d.ts.map +1 -0
- package/dist/lib/percent/InputPercent.js +29 -0
- package/dist/lib/percent/InputPercent.js.map +1 -0
- package/dist/lib/percent/LabelPercent.d.ts +8 -0
- package/dist/lib/percent/LabelPercent.d.ts.map +1 -0
- package/dist/lib/percent/LabelPercent.js +9 -0
- package/dist/lib/percent/LabelPercent.js.map +1 -0
- package/dist/lib/percent/LabelPercentInt.d.ts +4 -0
- package/dist/lib/percent/LabelPercentInt.d.ts.map +1 -0
- package/dist/lib/percent/LabelPercentInt.js +10 -0
- package/dist/lib/percent/LabelPercentInt.js.map +1 -0
- package/dist/lib/select/InputCombobox.d.ts +49 -0
- package/dist/lib/select/InputCombobox.d.ts.map +1 -0
- package/dist/lib/select/InputCombobox.js +42 -0
- package/dist/lib/select/InputCombobox.js.map +1 -0
- package/dist/lib/select/InputSelect.d.ts +22 -0
- package/dist/lib/select/InputSelect.d.ts.map +1 -0
- package/dist/lib/select/InputSelect.js +31 -0
- package/dist/lib/select/InputSelect.js.map +1 -0
- package/dist/lib/switchbutton/SwitchButton.d.ts +9 -0
- package/dist/lib/switchbutton/SwitchButton.d.ts.map +1 -0
- package/dist/lib/switchbutton/SwitchButton.js +18 -0
- package/dist/lib/switchbutton/SwitchButton.js.map +1 -0
- package/dist/lib/tabs/Tabs.d.ts +18 -0
- package/dist/lib/tabs/Tabs.d.ts.map +1 -0
- package/dist/lib/tabs/Tabs.js +30 -0
- package/dist/lib/tabs/Tabs.js.map +1 -0
- package/dist/lib/tabs/index.d.ts +2 -0
- package/dist/lib/tabs/index.d.ts.map +1 -0
- package/dist/lib/text/InputText.d.ts +12 -0
- package/dist/lib/text/InputText.d.ts.map +1 -0
- package/dist/lib/text/InputText.js +32 -0
- package/dist/lib/text/InputText.js.map +1 -0
- package/dist/lib/typography/description/Description.d.ts +4 -0
- package/dist/lib/typography/description/Description.d.ts.map +1 -0
- package/dist/lib/typography/description/Description.js +9 -0
- package/dist/lib/typography/description/Description.js.map +1 -0
- package/dist/lib/typography/description/index.d.ts +2 -0
- package/dist/lib/typography/description/index.d.ts.map +1 -0
- package/dist/lib/typography/index.d.ts +5 -0
- package/dist/lib/typography/index.d.ts.map +1 -0
- package/dist/lib/typography/label_and_description/LabelAndDescription.d.ts +5 -0
- package/dist/lib/typography/label_and_description/LabelAndDescription.d.ts.map +1 -0
- package/dist/lib/typography/label_and_description/LabelAndDescription.js +16 -0
- package/dist/lib/typography/label_and_description/LabelAndDescription.js.map +1 -0
- package/dist/lib/typography/label_and_description/index.d.ts +2 -0
- package/dist/lib/typography/label_and_description/index.d.ts.map +1 -0
- package/dist/lib/typography/sectiontitle/SectionTitle.d.ts +5 -0
- package/dist/lib/typography/sectiontitle/SectionTitle.d.ts.map +1 -0
- package/dist/lib/typography/sectiontitle/SectionTitle.js +8 -0
- package/dist/lib/typography/sectiontitle/SectionTitle.js.map +1 -0
- package/dist/lib/typography/todo/Todo.d.ts +5 -0
- package/dist/lib/typography/todo/Todo.d.ts.map +1 -0
- package/dist/lib/typography/todo/Todo.js +7 -0
- package/dist/lib/typography/todo/Todo.js.map +1 -0
- package/dist/lib/view_layout/ViewBody.d.ts +8 -0
- package/dist/lib/view_layout/ViewBody.d.ts.map +1 -0
- package/dist/lib/view_layout/ViewBody.js +8 -0
- package/dist/lib/view_layout/ViewBody.js.map +1 -0
- package/dist/lib/view_layout/ViewFooter.d.ts +10 -0
- package/dist/lib/view_layout/ViewFooter.d.ts.map +1 -0
- package/dist/lib/view_layout/ViewFooter.js +8 -0
- package/dist/lib/view_layout/ViewFooter.js.map +1 -0
- package/dist/lib/view_layout/ViewHeader.d.ts +5 -0
- package/dist/lib/view_layout/ViewHeader.d.ts.map +1 -0
- package/dist/lib/view_layout/ViewHeader.js +8 -0
- package/dist/lib/view_layout/ViewHeader.js.map +1 -0
- package/dist/lib/view_layout/ViewLayout.d.ts +16 -0
- package/dist/lib/view_layout/ViewLayout.d.ts.map +1 -0
- package/dist/lib/view_layout/ViewLayout.js +127 -0
- package/dist/lib/view_layout/ViewLayout.js.map +1 -0
- package/dist/lib/view_layout/ViewTitle.d.ts +21 -0
- package/dist/lib/view_layout/ViewTitle.d.ts.map +1 -0
- package/dist/lib/view_layout/ViewTitle.js +71 -0
- package/dist/lib/view_layout/ViewTitle.js.map +1 -0
- package/dist/lib/year/InputDurationYears.d.ts +9 -0
- package/dist/lib/year/InputDurationYears.d.ts.map +1 -0
- package/dist/lib/year/InputDurationYears.js +22 -0
- package/dist/lib/year/InputDurationYears.js.map +1 -0
- package/dist/lib/year/InputYear.d.ts +9 -0
- package/dist/lib/year/InputYear.d.ts.map +1 -0
- package/dist/lib/year/InputYear.js +21 -0
- package/dist/lib/year/InputYear.js.map +1 -0
- package/dist/locales/en.d.ts +8 -0
- package/dist/locales/en.d.ts.map +1 -0
- package/dist/locales/en.js +41 -0
- package/dist/locales/en.js.map +1 -0
- package/dist/locales/fr.d.ts +8 -0
- package/dist/locales/fr.d.ts.map +1 -0
- package/dist/locales/fr.js +41 -0
- package/dist/locales/fr.js.map +1 -0
- package/dist/locales/interfaces.d.ts +11 -0
- package/dist/locales/interfaces.d.ts.map +1 -0
- package/dist/stories/utils/SeijUIProviderDecorator.d.ts +2 -0
- package/dist/stories/utils/SeijUIProviderDecorator.d.ts.map +1 -0
- package/dist/stories/utils/StoryComponentFrame.d.ts +11 -0
- package/dist/stories/utils/StoryComponentFrame.d.ts.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsxs as x, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles as h, tokens as d, Input as b, Caption1 as u, List as v, ListItem as C, Card as L, CardHeader as w, Text as y } from "@fluentui/react-components";
|
|
3
|
+
import { SearchRegular as I, ChevronRightFilled as S } from "@fluentui/react-icons";
|
|
4
|
+
import { isFunction as R } from "lodash-es";
|
|
5
|
+
import { useI18n as N } from "../i18n/i18n.react.js";
|
|
6
|
+
const k = h({
|
|
7
|
+
noresult: {
|
|
8
|
+
textAlign: "center",
|
|
9
|
+
padding: "1em"
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
function z({
|
|
13
|
+
data: i,
|
|
14
|
+
activeId: s,
|
|
15
|
+
searchText: o = "",
|
|
16
|
+
search: n,
|
|
17
|
+
pathFactory: r,
|
|
18
|
+
navigate: t
|
|
19
|
+
}) {
|
|
20
|
+
const m = k(), { t: c } = N(), p = (l) => {
|
|
21
|
+
n && n(l);
|
|
22
|
+
}, g = R(n), a = c("ListView_search"), f = c("ListView_no_result");
|
|
23
|
+
return /* @__PURE__ */ x("div", { children: [
|
|
24
|
+
g && /* @__PURE__ */ e(
|
|
25
|
+
b,
|
|
26
|
+
{
|
|
27
|
+
style: { width: "100%" },
|
|
28
|
+
contentBefore: /* @__PURE__ */ e(I, { "aria-label": a }),
|
|
29
|
+
value: o,
|
|
30
|
+
placeholder: a,
|
|
31
|
+
onChange: (l) => p(l.target.value)
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(V, { activeId: s, items: i, pathFactory: r, navigate: t }) }),
|
|
35
|
+
i.length === 0 ? /* @__PURE__ */ e("div", { className: m.noresult, children: /* @__PURE__ */ e(u, { children: f }) }) : null
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
const M = h({
|
|
39
|
+
root: {
|
|
40
|
+
display: "flex"
|
|
41
|
+
},
|
|
42
|
+
content: {
|
|
43
|
+
flex: 1
|
|
44
|
+
},
|
|
45
|
+
title: {
|
|
46
|
+
fontWeight: "bold"
|
|
47
|
+
},
|
|
48
|
+
description: {
|
|
49
|
+
fontWeight: "normal"
|
|
50
|
+
},
|
|
51
|
+
action: {
|
|
52
|
+
flex: 0
|
|
53
|
+
},
|
|
54
|
+
card: {
|
|
55
|
+
width: "100%",
|
|
56
|
+
borderBottom: "1px solid " + d.colorNeutralStencil1,
|
|
57
|
+
borderRadius: d.borderRadiusNone
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
function V({
|
|
61
|
+
items: i,
|
|
62
|
+
activeId: s,
|
|
63
|
+
pathFactory: o,
|
|
64
|
+
navigate: n
|
|
65
|
+
}) {
|
|
66
|
+
const r = M();
|
|
67
|
+
return i.length === 0 ? null : /* @__PURE__ */ e(v, { navigationMode: "composite", children: i.map((t) => /* @__PURE__ */ e(
|
|
68
|
+
C,
|
|
69
|
+
{
|
|
70
|
+
onAction: () => {
|
|
71
|
+
n(o(t));
|
|
72
|
+
},
|
|
73
|
+
children: /* @__PURE__ */ e(
|
|
74
|
+
L,
|
|
75
|
+
{
|
|
76
|
+
role: "gridcell",
|
|
77
|
+
orientation: "horizontal",
|
|
78
|
+
appearance: "subtle",
|
|
79
|
+
className: r.card,
|
|
80
|
+
onClick: () => {
|
|
81
|
+
n(o(t));
|
|
82
|
+
},
|
|
83
|
+
children: /* @__PURE__ */ e(
|
|
84
|
+
w,
|
|
85
|
+
{
|
|
86
|
+
header: /* @__PURE__ */ e(y, { weight: "regular", children: t.label ?? /* @__PURE__ */ e("span", { children: " " }) }),
|
|
87
|
+
description: /* @__PURE__ */ e(u, { children: t.description ?? /* @__PURE__ */ e("span", { children: " " }) }),
|
|
88
|
+
action: /* @__PURE__ */ e(S, {})
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
},
|
|
94
|
+
t.id
|
|
95
|
+
)) });
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
z as ListView
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=ListView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListView.js","sources":["../../../src/lib/listview/ListView.tsx"],"sourcesContent":["import {\n Caption1,\n Card,\n CardHeader,\n Input,\n List,\n ListItem,\n makeStyles,\n Text,\n tokens,\n} from \"@fluentui/react-components\";\nimport { ChevronRightFilled, SearchRegular } from \"@fluentui/react-icons\";\nimport { isFunction } from \"lodash-es\";\nimport { ReactNode } from \"react\";\nimport { useI18n } from \"../i18n/i18n.react\";\n\nexport interface ListItemData {\n id: string;\n label: ReactNode;\n description: ReactNode | null;\n}\n\nconst useStyles = makeStyles({\n noresult: {\n textAlign: \"center\",\n padding: \"1em\",\n },\n});\nexport interface ListViewProps<T extends ListItemData = ListItemData> {\n data: T[];\n activeId: string;\n searchText?: string;\n search?: (input: string) => void;\n pathFactory: (item: T) => string;\n navigate: (url: string) => void;\n}\nexport function ListView<T extends ListItemData>({\n data,\n activeId,\n searchText = \"\",\n search,\n pathFactory,\n navigate,\n}: ListViewProps<T>) {\n const styles = useStyles();\n const { t } = useI18n();\n const handleChange = (value: string) => {\n if (search) search(value);\n };\n const isSearchEnabled = isFunction(search);\n const searchMessage = t(\"ListView_search\");\n const noResultMessage = t(\"ListView_no_result\");\n return (\n <div>\n {isSearchEnabled && (\n <Input\n style={{ width: \"100%\" }}\n contentBefore={<SearchRegular aria-label={searchMessage} />}\n value={searchText}\n placeholder={searchMessage}\n onChange={(e) => handleChange(e.target.value)}\n />\n )}\n <div>\n <ItemList activeId={activeId} items={data} pathFactory={pathFactory} navigate={navigate} />\n </div>\n {data.length === 0 ? (\n <div className={styles.noresult}>\n <Caption1>{noResultMessage}</Caption1>\n </div>\n ) : null}\n </div>\n );\n}\n\nconst useItemListStyles = makeStyles({\n root: {\n display: \"flex\",\n },\n content: {\n flex: 1,\n },\n title: {\n fontWeight: \"bold\",\n },\n description: {\n fontWeight: \"normal\",\n },\n action: {\n flex: 0,\n },\n\n card: {\n width: \"100%\",\n borderBottom: \"1px solid \" + tokens.colorNeutralStencil1,\n borderRadius: tokens.borderRadiusNone,\n },\n});\n\nfunction ItemList<T extends ListItemData>({\n items,\n activeId,\n pathFactory,\n navigate,\n}: {\n items: T[];\n activeId: string;\n pathFactory: (item: T) => string;\n navigate: (url: string) => void;\n}) {\n const style = useItemListStyles();\n if (items.length === 0) return null;\n return (\n <List navigationMode=\"composite\">\n {items.map((it) => (\n <ListItem\n key={it.id}\n onAction={() => {\n navigate(pathFactory(it));\n }}\n >\n <Card\n role=\"gridcell\"\n orientation=\"horizontal\"\n appearance=\"subtle\"\n className={style.card}\n onClick={() => {\n navigate(pathFactory(it));\n }}\n >\n <CardHeader\n header={<Text weight=\"regular\">{it.label ?? <span> </span>}</Text>}\n description={<Caption1>{it.description ?? <span> </span>}</Caption1>}\n action={<ChevronRightFilled />}\n />\n </Card>\n </ListItem>\n ))}\n </List>\n );\n}\n"],"names":["useStyles","makeStyles","ListView","data","activeId","searchText","search","pathFactory","navigate","styles","t","useI18n","handleChange","value","isSearchEnabled","isFunction","searchMessage","noResultMessage","jsx","Input","SearchRegular","e","ItemList","Caption1","useItemListStyles","tokens","items","style","List","it","ListItem","Card","CardHeader","Text","ChevronRightFilled"],"mappings":";;;;;AAsBA,MAAMA,IAAYC,EAAW;AAAA,EAC3B,UAAU;AAAA,IACR,WAAW;AAAA,IACX,SAAS;AAAA,EAAA;AAEb,CAAC;AASM,SAASC,EAAiC;AAAA,EAC/C,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AACF,GAAqB;AACnB,QAAMC,IAAST,EAAA,GACT,EAAE,GAAAU,EAAA,IAAMC,EAAA,GACRC,IAAe,CAACC,MAAkB;AACtC,IAAIP,OAAeO,CAAK;AAAA,EAC1B,GACMC,IAAkBC,EAAWT,CAAM,GACnCU,IAAgBN,EAAE,iBAAiB,GACnCO,IAAkBP,EAAE,oBAAoB;AAC9C,2BACG,OAAA,EACE,UAAA;AAAA,IAAAI,KACC,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAO,EAAE,OAAO,OAAA;AAAA,QAChB,eAAe,gBAAAD,EAACE,GAAA,EAAc,cAAYJ,EAAA,CAAe;AAAA,QACzD,OAAOX;AAAA,QACP,aAAaW;AAAA,QACb,UAAU,CAACK,MAAMT,EAAaS,EAAE,OAAO,KAAK;AAAA,MAAA;AAAA,IAAA;AAAA,IAGhD,gBAAAH,EAAC,SACC,UAAA,gBAAAA,EAACI,GAAA,EAAS,UAAAlB,GAAoB,OAAOD,GAAM,aAAAI,GAA0B,UAAAC,EAAA,CAAoB,EAAA,CAC3F;AAAA,IACCL,EAAK,WAAW,IACf,gBAAAe,EAAC,OAAA,EAAI,WAAWT,EAAO,UACrB,UAAA,gBAAAS,EAACK,GAAA,EAAU,UAAAN,EAAA,CAAgB,EAAA,CAC7B,IACE;AAAA,EAAA,GACN;AAEJ;AAEA,MAAMO,IAAoBvB,EAAW;AAAA,EACnC,MAAM;AAAA,IACJ,SAAS;AAAA,EAAA;AAAA,EAEX,SAAS;AAAA,IACP,MAAM;AAAA,EAAA;AAAA,EAER,OAAO;AAAA,IACL,YAAY;AAAA,EAAA;AAAA,EAEd,aAAa;AAAA,IACX,YAAY;AAAA,EAAA;AAAA,EAEd,QAAQ;AAAA,IACN,MAAM;AAAA,EAAA;AAAA,EAGR,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,cAAc,eAAewB,EAAO;AAAA,IACpC,cAAcA,EAAO;AAAA,EAAA;AAEzB,CAAC;AAED,SAASH,EAAiC;AAAA,EACxC,OAAAI;AAAA,EACA,UAAAtB;AAAA,EACA,aAAAG;AAAA,EACA,UAAAC;AACF,GAKG;AACD,QAAMmB,IAAQH,EAAA;AACd,SAAIE,EAAM,WAAW,IAAU,yBAE5BE,GAAA,EAAK,gBAAe,aAClB,UAAAF,EAAM,IAAI,CAACG,MACV,gBAAAX;AAAA,IAACY;AAAA,IAAA;AAAA,MAEC,UAAU,MAAM;AACd,QAAAtB,EAASD,EAAYsB,CAAE,CAAC;AAAA,MAC1B;AAAA,MAEA,UAAA,gBAAAX;AAAA,QAACa;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,aAAY;AAAA,UACZ,YAAW;AAAA,UACX,WAAWJ,EAAM;AAAA,UACjB,SAAS,MAAM;AACb,YAAAnB,EAASD,EAAYsB,CAAE,CAAC;AAAA,UAC1B;AAAA,UAEA,UAAA,gBAAAX;AAAA,YAACc;AAAA,YAAA;AAAA,cACC,QAAQ,gBAAAd,EAACe,GAAA,EAAK,QAAO,WAAW,YAAG,SAAS,gBAAAf,EAAC,QAAA,EAAK,UAAA,IAAA,CAAM,EAAA,CAAQ;AAAA,cAChE,+BAAcK,GAAA,EAAU,UAAAM,EAAG,eAAe,gBAAAX,EAAC,QAAA,EAAK,eAAM,EAAA,CAAQ;AAAA,cAC9D,0BAASgB,GAAA,CAAA,CAAmB;AAAA,YAAA;AAAA,UAAA;AAAA,QAC9B;AAAA,MAAA;AAAA,IACF;AAAA,IAnBKL,EAAG;AAAA,EAAA,CAqBX,GACH;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../src/lib/loader/Loader.tsx"],"names":[],"mappings":"AAEA,wBAAgB,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,kDAGvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loader.js","sources":["../../../src/lib/loader/Loader.tsx"],"sourcesContent":["import { Spinner } from \"@fluentui/react-components\";\n\nexport function Loader({ loading }: { loading: boolean }) {\n if (!loading) return null;\n return <Spinner />;\n}\n"],"names":["Loader","loading","Spinner"],"mappings":";;AAEO,SAASA,EAAO,EAAE,SAAAC,KAAiC;AACxD,SAAKA,sBACGC,GAAA,EAAQ,IADK;AAEvB;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LocalDate } from '../../../../common-types/src/index.ts';
|
|
2
|
+
import { InputHTMLAttributes } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Input field for local dates with automatic adding of /
|
|
5
|
+
* Values are in ISO8601 date part only
|
|
6
|
+
*
|
|
7
|
+
* Controlled component only
|
|
8
|
+
*
|
|
9
|
+
* @param props same props as an input
|
|
10
|
+
* @return {JSX.Element}
|
|
11
|
+
*/
|
|
12
|
+
export interface InputLocalDateProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onChange"> {
|
|
13
|
+
value?: string;
|
|
14
|
+
onValueChange?: (value: LocalDate) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const InputLocalDate: import('react').ForwardRefExoticComponent<InputLocalDateProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
17
|
+
//# sourceMappingURL=InputLocalDate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputLocalDate.d.ts","sourceRoot":"","sources":["../../../src/lib/localdate/InputLocalDate.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAc,mBAAmB,EAAoC,MAAM,OAAO,CAAC;AAoC1F;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5G,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CAC5C;AAED,eAAO,MAAM,cAAc,kHA+CzB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles as S, Input as y } from "@fluentui/react-components";
|
|
3
|
+
import { forwardRef as A, useState as h, useEffect as C, useCallback as k } from "react";
|
|
4
|
+
import { Rifm as z } from "rifm";
|
|
5
|
+
import { useI18n as F } from "../i18n/i18n.react.js";
|
|
6
|
+
const N = S({
|
|
7
|
+
root: {
|
|
8
|
+
width: "8em",
|
|
9
|
+
"> input": {
|
|
10
|
+
textAlign: "right"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}), V = (t) => (t.match(/\d+/g) || []).join(""), b = (t) => V(t).split("").reduce((o, n, l) => l === 2 || l === 4 ? `${o}/${n}` : `${o}${n}`, "").substr(0, 10), j = (t) => {
|
|
14
|
+
const e = b(t);
|
|
15
|
+
if (t.endsWith("/")) {
|
|
16
|
+
if (e.length === 2)
|
|
17
|
+
return `${e}/`;
|
|
18
|
+
if (e.length === 5)
|
|
19
|
+
return `${e}/`;
|
|
20
|
+
}
|
|
21
|
+
return e;
|
|
22
|
+
}, w = (t) => t.length === 2 || t.length === 5 ? `${t}/` : t, H = A((t, e) => {
|
|
23
|
+
const { onValueChange: r, value: o = "", children: n, size: l, defaultValue: x, type: O, ...g } = t, D = N(), { localDatePlaceholder: $, localDateFormattedToISO: d, localDateISOToFormattedInput: p } = F(), [u, c] = h(p(o)), [i, m] = h(o);
|
|
24
|
+
C(() => {
|
|
25
|
+
o !== i && (m(o), c(p(o)));
|
|
26
|
+
});
|
|
27
|
+
const I = k(
|
|
28
|
+
(s) => {
|
|
29
|
+
c(s);
|
|
30
|
+
const a = d(s);
|
|
31
|
+
a !== i && (m(a), r && r(a));
|
|
32
|
+
},
|
|
33
|
+
[c, i, m, r, d]
|
|
34
|
+
);
|
|
35
|
+
return /* @__PURE__ */ f(
|
|
36
|
+
z,
|
|
37
|
+
{
|
|
38
|
+
accept: /\d+/g,
|
|
39
|
+
mask: 10 <= u.length,
|
|
40
|
+
format: j,
|
|
41
|
+
append: w,
|
|
42
|
+
value: u,
|
|
43
|
+
onChange: I,
|
|
44
|
+
children: ({ value: s, onChange: a }) => /* @__PURE__ */ f(
|
|
45
|
+
y,
|
|
46
|
+
{
|
|
47
|
+
placeholder: $,
|
|
48
|
+
className: D.root,
|
|
49
|
+
value: s,
|
|
50
|
+
onChange: a,
|
|
51
|
+
ref: e,
|
|
52
|
+
...g
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
export {
|
|
59
|
+
H as InputLocalDate
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=InputLocalDate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputLocalDate.js","sources":["../../../src/lib/localdate/InputLocalDate.tsx"],"sourcesContent":["import { Input, makeStyles } from \"@fluentui/react-components\";\nimport { LocalDate } from \"@seij/common-types\";\nimport { forwardRef, InputHTMLAttributes, useCallback, useEffect, useState } from \"react\";\nimport { Rifm } from \"rifm\";\nimport { useI18n } from \"../i18n/i18n.react\";\n\nconst useStyles = makeStyles({\n root: {\n width: \"8em\",\n \"> input\": {\n textAlign: \"right\",\n },\n },\n});\n\nconst parseDigits = (string: string): string => (string.match(/\\d+/g) || []).join(\"\");\nconst formatDate = (string: string): string => {\n const digits = parseDigits(string);\n const chars = digits.split(\"\");\n return chars.reduce((r, v, index) => (index === 2 || index === 4 ? `${r}/${v}` : `${r}${v}`), \"\").substr(0, 10);\n};\n\nconst formatDateWithAppend = (string: string): string => {\n const res = formatDate(string);\n\n if (string.endsWith(\"/\")) {\n if (res.length === 2) {\n return `${res}/`;\n }\n\n if (res.length === 5) {\n return `${res}/`;\n }\n }\n return res;\n};\nconst appendHyphen = (v: string): string => (v.length === 2 || v.length === 5 ? `${v}/` : v);\n\n/**\n * Input field for local dates with automatic adding of /\n * Values are in ISO8601 date part only\n *\n * Controlled component only\n *\n * @param props same props as an input\n * @return {JSX.Element}\n */\nexport interface InputLocalDateProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"value\" | \"onChange\"> {\n value?: string;\n onValueChange?: (value: LocalDate) => void;\n}\n\nexport const InputLocalDate = forwardRef<HTMLInputElement, InputLocalDateProps>((props, ref) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onValueChange, value = \"\", children, size, defaultValue, type, ...delegatedProps } = props;\n const classNames = useStyles();\n const { localDatePlaceholder, localDateFormattedToISO, localDateISOToFormattedInput } = useI18n();\n const [formattedA, setFormattedA] = useState(localDateISOToFormattedInput(value));\n const [normalizedValue, setNormalizedValue] = useState(value);\n\n useEffect(() => {\n if (value !== normalizedValue) {\n setNormalizedValue(value);\n setFormattedA(localDateISOToFormattedInput(value));\n }\n });\n\n const handleChange = useCallback(\n (inputValue: string) => {\n setFormattedA(inputValue);\n const parsed = localDateFormattedToISO(inputValue);\n if (parsed !== normalizedValue) {\n setNormalizedValue(parsed);\n if (onValueChange) onValueChange(parsed);\n }\n },\n [setFormattedA, normalizedValue, setNormalizedValue, onValueChange, localDateFormattedToISO],\n );\n return (\n <Rifm\n accept={/\\d+/g}\n mask={10 <= formattedA.length}\n format={formatDateWithAppend}\n append={appendHyphen}\n value={formattedA}\n onChange={handleChange}\n >\n {({ value, onChange }) => (\n <Input\n placeholder={localDatePlaceholder}\n className={classNames.root}\n value={value}\n onChange={onChange}\n ref={ref}\n {...delegatedProps}\n />\n )}\n </Rifm>\n );\n});\n"],"names":["useStyles","makeStyles","parseDigits","string","formatDate","r","v","index","formatDateWithAppend","res","appendHyphen","InputLocalDate","forwardRef","props","ref","onValueChange","value","children","size","defaultValue","type","delegatedProps","classNames","localDatePlaceholder","localDateFormattedToISO","localDateISOToFormattedInput","useI18n","formattedA","setFormattedA","useState","normalizedValue","setNormalizedValue","useEffect","handleChange","useCallback","inputValue","parsed","jsx","Rifm","onChange","Input"],"mappings":";;;;;AAMA,MAAMA,IAAYC,EAAW;AAAA,EAC3B,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,WAAW;AAAA,MACT,WAAW;AAAA,IAAA;AAAA,EACb;AAEJ,CAAC,GAEKC,IAAc,CAACC,OAA4BA,EAAO,MAAM,MAAM,KAAK,CAAA,GAAI,KAAK,EAAE,GAC9EC,IAAa,CAACD,MACHD,EAAYC,CAAM,EACZ,MAAM,EAAE,EAChB,OAAO,CAACE,GAAGC,GAAGC,MAAWA,MAAU,KAAKA,MAAU,IAAI,GAAGF,CAAC,IAAIC,CAAC,KAAK,GAAGD,CAAC,GAAGC,CAAC,IAAK,EAAE,EAAE,OAAO,GAAG,EAAE,GAG1GE,IAAuB,CAACL,MAA2B;AACvD,QAAMM,IAAML,EAAWD,CAAM;AAE7B,MAAIA,EAAO,SAAS,GAAG,GAAG;AACxB,QAAIM,EAAI,WAAW;AACjB,aAAO,GAAGA,CAAG;AAGf,QAAIA,EAAI,WAAW;AACjB,aAAO,GAAGA,CAAG;AAAA,EAEjB;AACA,SAAOA;AACT,GACMC,IAAe,CAACJ,MAAuBA,EAAE,WAAW,KAAKA,EAAE,WAAW,IAAI,GAAGA,CAAC,MAAMA,GAgB7EK,IAAiBC,EAAkD,CAACC,GAAOC,MAAQ;AAE9F,QAAM,EAAE,eAAAC,GAAe,OAAAC,IAAQ,IAAI,UAAAC,GAAU,MAAAC,GAAM,cAAAC,GAAc,MAAAC,GAAM,GAAGC,EAAA,IAAmBR,GACvFS,IAAatB,EAAA,GACb,EAAE,sBAAAuB,GAAsB,yBAAAC,GAAyB,8BAAAC,EAAA,IAAiCC,EAAA,GAClF,CAACC,GAAYC,CAAa,IAAIC,EAASJ,EAA6BT,CAAK,CAAC,GAC1E,CAACc,GAAiBC,CAAkB,IAAIF,EAASb,CAAK;AAE5D,EAAAgB,EAAU,MAAM;AACd,IAAIhB,MAAUc,MACZC,EAAmBf,CAAK,GACxBY,EAAcH,EAA6BT,CAAK,CAAC;AAAA,EAErD,CAAC;AAED,QAAMiB,IAAeC;AAAA,IACnB,CAACC,MAAuB;AACtB,MAAAP,EAAcO,CAAU;AACxB,YAAMC,IAASZ,EAAwBW,CAAU;AACjD,MAAIC,MAAWN,MACbC,EAAmBK,CAAM,GACrBrB,OAA6BqB,CAAM;AAAA,IAE3C;AAAA,IACA,CAACR,GAAeE,GAAiBC,GAAoBhB,GAAeS,CAAuB;AAAA,EAAA;AAE7F,SACE,gBAAAa;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,QAAQ;AAAA,MACR,MAAM,MAAMX,EAAW;AAAA,MACvB,QAAQnB;AAAA,MACR,QAAQE;AAAA,MACR,OAAOiB;AAAA,MACP,UAAUM;AAAA,MAET,UAAA,CAAC,EAAE,OAAAjB,GAAO,UAAAuB,QACT,gBAAAF;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,aAAajB;AAAA,UACb,WAAWD,EAAW;AAAA,UACtB,OAAON;AAAAA,UACP,UAAAuB;AAAA,UACA,KAAAzB;AAAA,UACC,GAAGO;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAIR,CAAC;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
export interface LabelLocalDateProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onChange"> {
|
|
3
|
+
value?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const LabelLocalDate: (props: LabelLocalDateProps) => string;
|
|
6
|
+
//# sourceMappingURL=LabelLocalDate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabelLocalDate.d.ts","sourceRoot":"","sources":["../../../src/lib/localdate/LabelLocalDate.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAG5C,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5G,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,WAIxD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabelLocalDate.js","sources":["../../../src/lib/localdate/LabelLocalDate.tsx"],"sourcesContent":["import { InputHTMLAttributes } from \"react\";\nimport { useI18n } from \"../i18n/i18n.react\";\n\nexport interface LabelLocalDateProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"value\" | \"onChange\"> {\n value?: string;\n}\n\nexport const LabelLocalDate = (props: LabelLocalDateProps) => {\n const { value = \"\" } = props;\n const { localDateISOToFormattedInput } = useI18n();\n return localDateISOToFormattedInput(value);\n};\n"],"names":["LabelLocalDate","props","value","localDateISOToFormattedInput","useI18n"],"mappings":";AAOO,MAAMA,IAAiB,CAACC,MAA+B;AAC5D,QAAM,EAAE,OAAAC,IAAQ,GAAA,IAAOD,GACjB,EAAE,8BAAAE,EAAA,IAAiCC,EAAA;AACzC,SAAOD,EAA6BD,CAAK;AAC3C;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { InputNumberProps } from '../number/InputNumber';
|
|
3
|
+
export interface InputMoneyDecProps extends InputNumberProps {
|
|
4
|
+
/**
|
|
5
|
+
* Devise à afficher
|
|
6
|
+
*/
|
|
7
|
+
currency?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Unité de référence pour le montant, indiquant à quoi il s'applique.
|
|
10
|
+
* Exemples : "mois", "colis", "jh", "tranche" → pour afficher "123 € / mois".
|
|
11
|
+
* Optionnelle – à laisser vide si la valeur n'est pas exprimée par unité.
|
|
12
|
+
*/
|
|
13
|
+
per?: string;
|
|
14
|
+
allowNegative?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Un input special annee.
|
|
18
|
+
*/
|
|
19
|
+
export declare const InputMoneyDec: React.FC<InputMoneyDecProps>;
|
|
20
|
+
//# sourceMappingURL=InputMoneyDec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputMoneyDec.d.ts","sourceRoot":"","sources":["../../../src/lib/money/InputMoneyDec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAe,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAItE,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAetD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as m } from "react";
|
|
3
|
+
import { InputNumber as s } from "../number/InputNumber.js";
|
|
4
|
+
import { DeviseContext as p } from "../devise/DeviseContext.js";
|
|
5
|
+
import { createCurrency as u } from "@seij/common-types";
|
|
6
|
+
const y = (e) => {
|
|
7
|
+
const { currency: t, per: o, allowNegative: r, ...n } = e, i = m(p), a = u(t, o, i, "€");
|
|
8
|
+
return /* @__PURE__ */ c(
|
|
9
|
+
s,
|
|
10
|
+
{
|
|
11
|
+
decimalScale: 2,
|
|
12
|
+
allowNegative: r ?? !1,
|
|
13
|
+
inputMode: "decimal",
|
|
14
|
+
thousandSeparator: !1,
|
|
15
|
+
size: 9,
|
|
16
|
+
unit: a,
|
|
17
|
+
...n
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
y as InputMoneyDec
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=InputMoneyDec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputMoneyDec.js","sources":["../../../src/lib/money/InputMoneyDec.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { InputNumber, InputNumberProps } from \"../number/InputNumber\";\nimport { DeviseContext } from \"../devise/DeviseContext\";\nimport { createCurrency } from \"@seij/common-types\";\n\nexport interface InputMoneyDecProps extends InputNumberProps {\n /**\n * Devise à afficher\n */\n currency?: string;\n /**\n * Unité de référence pour le montant, indiquant à quoi il s'applique.\n * Exemples : \"mois\", \"colis\", \"jh\", \"tranche\" → pour afficher \"123 € / mois\".\n * Optionnelle – à laisser vide si la valeur n'est pas exprimée par unité.\n */\n per?: string;\n allowNegative?: boolean;\n}\n\n/**\n * Un input special annee.\n */\nexport const InputMoneyDec: React.FC<InputMoneyDecProps> = (props) => {\n const { currency, per, allowNegative, ...other } = props;\n const deviseContext = useContext(DeviseContext);\n const currencyFinal = createCurrency(currency, per, deviseContext, \"€\");\n return (\n <InputNumber\n decimalScale={2}\n allowNegative={allowNegative ?? false}\n inputMode=\"decimal\"\n thousandSeparator={false}\n size={9}\n unit={currencyFinal}\n {...other}\n />\n );\n};\n"],"names":["InputMoneyDec","props","currency","per","allowNegative","other","deviseContext","useContext","DeviseContext","currencyFinal","createCurrency","jsx","InputNumber"],"mappings":";;;;;AAsBO,MAAMA,IAA8C,CAACC,MAAU;AACpE,QAAM,EAAE,UAAAC,GAAU,KAAAC,GAAK,eAAAC,GAAe,GAAGC,MAAUJ,GAC7CK,IAAgBC,EAAWC,CAAa,GACxCC,IAAgBC,EAAeR,GAAUC,GAAKG,GAAe,GAAG;AACtE,SACE,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,cAAc;AAAA,MACd,eAAeR,KAAiB;AAAA,MAChC,WAAU;AAAA,MACV,mBAAmB;AAAA,MACnB,MAAM;AAAA,MACN,MAAMK;AAAA,MACL,GAAGJ;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { InputNumberProps } from '../number/InputNumber';
|
|
3
|
+
export interface InputMoneyIntProps extends InputNumberProps {
|
|
4
|
+
/**
|
|
5
|
+
* Devise à afficher.
|
|
6
|
+
*
|
|
7
|
+
* Si renseignée, elle est prise en compte sinon on prend la devise du contexte.
|
|
8
|
+
* Pour ne pas afficher du tout la devise, il faut passer une chaîne vide.
|
|
9
|
+
* Exemples : "EUR", "USD", "GBP" → pour afficher "123 €".
|
|
10
|
+
* Si la devise est renseignée, elle est affichée à la fin du montant.
|
|
11
|
+
*/
|
|
12
|
+
currency?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Unité de référence pour le montant, indiquant à quoi il s'applique.
|
|
15
|
+
* Exemples : "mois", "colis", "jh", "tranche" → pour afficher "123 € / mois".
|
|
16
|
+
* Optionnelle – à laisser vide si la valeur n'est pas exprimée par unité.
|
|
17
|
+
*/
|
|
18
|
+
per?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Un input special annee.
|
|
22
|
+
*/
|
|
23
|
+
export declare const InputMoneyInt: React.FC<InputMoneyIntProps>;
|
|
24
|
+
//# sourceMappingURL=InputMoneyInt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputMoneyInt.d.ts","sourceRoot":"","sources":["../../../src/lib/money/InputMoneyInt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAe,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAItE,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAiBtD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as m } from "react";
|
|
3
|
+
import { InputNumber as s } from "../number/InputNumber.js";
|
|
4
|
+
import { DeviseContext as u } from "../devise/DeviseContext.js";
|
|
5
|
+
import { createCurrency as a } from "@seij/common-types";
|
|
6
|
+
const y = (e) => {
|
|
7
|
+
const { currency: t, per: r, ...o } = e, n = m(u), i = a(t, r, n, "€");
|
|
8
|
+
return /* @__PURE__ */ c(
|
|
9
|
+
s,
|
|
10
|
+
{
|
|
11
|
+
decimalScale: 0,
|
|
12
|
+
allowNegative: !1,
|
|
13
|
+
inputMode: "numeric",
|
|
14
|
+
thousandSeparator: !1,
|
|
15
|
+
size: 9,
|
|
16
|
+
unit: i,
|
|
17
|
+
...o
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
y as InputMoneyInt
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=InputMoneyInt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputMoneyInt.js","sources":["../../../src/lib/money/InputMoneyInt.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { InputNumber, InputNumberProps } from \"../number/InputNumber\";\n\nimport { DeviseContext } from \"../devise/DeviseContext\";\nimport { createCurrency } from \"@seij/common-types\";\nexport interface InputMoneyIntProps extends InputNumberProps {\n /**\n * Devise à afficher.\n *\n * Si renseignée, elle est prise en compte sinon on prend la devise du contexte.\n * Pour ne pas afficher du tout la devise, il faut passer une chaîne vide.\n * Exemples : \"EUR\", \"USD\", \"GBP\" → pour afficher \"123 €\".\n * Si la devise est renseignée, elle est affichée à la fin du montant.\n */\n currency?: string;\n /**\n * Unité de référence pour le montant, indiquant à quoi il s'applique.\n * Exemples : \"mois\", \"colis\", \"jh\", \"tranche\" → pour afficher \"123 € / mois\".\n * Optionnelle – à laisser vide si la valeur n'est pas exprimée par unité.\n */\n per?: string;\n}\n\n/**\n * Un input special annee.\n */\nexport const InputMoneyInt: React.FC<InputMoneyIntProps> = (props) => {\n const { currency, per, ...other } = props;\n\n const deviseContext = useContext(DeviseContext);\n const currencyFinal = createCurrency(currency, per, deviseContext, \"€\");\n\n return (\n <InputNumber\n decimalScale={0}\n allowNegative={false}\n inputMode=\"numeric\"\n thousandSeparator={false}\n size={9}\n unit={currencyFinal}\n {...other}\n />\n );\n};\n"],"names":["InputMoneyInt","props","currency","per","other","deviseContext","useContext","DeviseContext","currencyFinal","createCurrency","jsx","InputNumber"],"mappings":";;;;;AA0BO,MAAMA,IAA8C,CAACC,MAAU;AACpE,QAAM,EAAE,UAAAC,GAAU,KAAAC,GAAK,GAAGC,MAAUH,GAE9BI,IAAgBC,EAAWC,CAAa,GACxCC,IAAgBC,EAAeP,GAAUC,GAAKE,GAAe,GAAG;AAEtE,SACE,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,cAAc;AAAA,MACd,eAAe;AAAA,MACf,WAAU;AAAA,MACV,mBAAmB;AAAA,MACnB,MAAM;AAAA,MACN,MAAMH;AAAA,MACL,GAAGJ;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Affiche un montant sous la forme d'un nombre décimal
|
|
3
|
+
*/
|
|
4
|
+
export declare const LabelMoneyDec: ({ value, sign, zeroblank, currency, per, }: {
|
|
5
|
+
/**
|
|
6
|
+
* Valeur à afficher
|
|
7
|
+
*/
|
|
8
|
+
value: number;
|
|
9
|
+
/**
|
|
10
|
+
* Affiche le signe + ou -
|
|
11
|
+
*
|
|
12
|
+
* pas obligatoire, par défaut "auto". Si "auto" affiche un signe uniquement si négatif,
|
|
13
|
+
* sinon affiche toujours le signe + ou -
|
|
14
|
+
*/
|
|
15
|
+
sign?: "auto" | "always";
|
|
16
|
+
/**
|
|
17
|
+
* Affiche ou pas les zero
|
|
18
|
+
*
|
|
19
|
+
* pas oblgatoire, par défaut "false". Si "true" et que la valeur est zero, alors n'affiche rien
|
|
20
|
+
*/
|
|
21
|
+
zeroblank?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Devise à afficher
|
|
24
|
+
*/
|
|
25
|
+
currency?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Unité de référence pour le montant, indiquant à quoi il s'applique.
|
|
28
|
+
* Exemples : "mois", "colis", "jh", "tranche" → pour afficher "123 € / mois".
|
|
29
|
+
* Optionnelle – à laisser vide si la valeur n'est pas exprimée par unité.
|
|
30
|
+
*/
|
|
31
|
+
per?: string;
|
|
32
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
33
|
+
//# sourceMappingURL=LabelMoneyDec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabelMoneyDec.d.ts","sourceRoot":"","sources":["../../../src/lib/money/LabelMoneyDec.tsx"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,4CAM3B;IACD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,mDAOA,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as f, Fragment as s } from "react/jsx-runtime";
|
|
2
|
+
import { createCurrency as l, format as a, NumberFormatDecimal as p } from "@seij/common-types";
|
|
3
|
+
import { isNil as u } from "lodash-es";
|
|
4
|
+
import { useContext as y } from "react";
|
|
5
|
+
import { toCurrencySymbolSafe as x } from "../commons/currencysymbol.js";
|
|
6
|
+
import { DeviseContext as C } from "../devise/DeviseContext.js";
|
|
7
|
+
const g = ({
|
|
8
|
+
value: r,
|
|
9
|
+
sign: o,
|
|
10
|
+
zeroblank: e = !1,
|
|
11
|
+
currency: t,
|
|
12
|
+
per: m
|
|
13
|
+
}) => {
|
|
14
|
+
const n = y(C);
|
|
15
|
+
if (e && r === 0) return null;
|
|
16
|
+
const c = x(t), i = l(c, m, n, "€");
|
|
17
|
+
return /* @__PURE__ */ f(s, { children: u(r) ? "" : a(r, p, i, o) });
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
g as LabelMoneyDec
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=LabelMoneyDec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabelMoneyDec.js","sources":["../../../src/lib/money/LabelMoneyDec.tsx"],"sourcesContent":["import { createCurrency, format, NumberFormatDecimal } from \"@seij/common-types\";\n\nimport { isNil } from \"lodash-es\";\nimport { useContext } from \"react\";\nimport { toCurrencySymbolSafe } from \"../commons/currencysymbol\";\nimport { DeviseContext } from \"../devise/DeviseContext\";\n\n/**\n * Affiche un montant sous la forme d'un nombre décimal\n */\nexport const LabelMoneyDec = ({\n value,\n sign,\n zeroblank = false,\n currency,\n per,\n}: {\n /**\n * Valeur à afficher\n */\n value: number;\n /**\n * Affiche le signe + ou -\n *\n * pas obligatoire, par défaut \"auto\". Si \"auto\" affiche un signe uniquement si négatif,\n * sinon affiche toujours le signe + ou -\n */\n sign?: \"auto\" | \"always\";\n /**\n * Affiche ou pas les zero\n *\n * pas oblgatoire, par défaut \"false\". Si \"true\" et que la valeur est zero, alors n'affiche rien\n */\n zeroblank?: boolean;\n /**\n * Devise à afficher\n */\n currency?: string;\n /**\n * Unité de référence pour le montant, indiquant à quoi il s'applique.\n * Exemples : \"mois\", \"colis\", \"jh\", \"tranche\" → pour afficher \"123 € / mois\".\n * Optionnelle – à laisser vide si la valeur n'est pas exprimée par unité.\n */\n per?: string;\n}) => {\n const deviseContext = useContext(DeviseContext);\n if (zeroblank && value === 0) return null;\n\n const currencySymbol = toCurrencySymbolSafe(currency);\n const currencyFinal = createCurrency(currencySymbol, per, deviseContext, \"€\");\n return <>{isNil(value) ? \"\" : format(value, NumberFormatDecimal, currencyFinal, sign)}</>;\n};\n"],"names":["LabelMoneyDec","value","sign","zeroblank","currency","per","deviseContext","useContext","DeviseContext","currencySymbol","toCurrencySymbolSafe","currencyFinal","createCurrency","jsx","Fragment","isNil","format","NumberFormatDecimal"],"mappings":";;;;;;AAUO,MAAMA,IAAgB,CAAC;AAAA,EAC5B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,KAAAC;AACF,MA4BM;AACJ,QAAMC,IAAgBC,EAAWC,CAAa;AAC9C,MAAIL,KAAaF,MAAU,EAAG,QAAO;AAErC,QAAMQ,IAAiBC,EAAqBN,CAAQ,GAC9CO,IAAgBC,EAAeH,GAAgBJ,GAAKC,GAAe,GAAG;AAC5E,SAAO,gBAAAO,EAAAC,GAAA,EAAG,UAAAC,EAAMd,CAAK,IAAI,KAAKe,EAAOf,GAAOgB,GAAqBN,GAAeT,CAAI,EAAA,CAAE;AACxF;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Affiche un montant sous la forme d'un nombre entier
|
|
3
|
+
*/
|
|
4
|
+
export declare const LabelMoneyInt: ({ value, sign, zeroblank, currency, per, }: {
|
|
5
|
+
/**
|
|
6
|
+
* Valeur à afficher
|
|
7
|
+
*/
|
|
8
|
+
value: number;
|
|
9
|
+
/**
|
|
10
|
+
* Affiche le signe + ou -
|
|
11
|
+
*
|
|
12
|
+
* pas obligatoire, par défaut "auto". Si "auto" affiche un signe uniquement si négatif,
|
|
13
|
+
* sinon affiche toujours le signe + ou -
|
|
14
|
+
*/
|
|
15
|
+
sign?: "auto" | "always";
|
|
16
|
+
/**
|
|
17
|
+
* Affiche ou pas les zero
|
|
18
|
+
*
|
|
19
|
+
* pas oblgatoire, par défaut "false". Si "true" et que la valeur est zero, alors n'affiche rien
|
|
20
|
+
*/
|
|
21
|
+
zeroblank?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Devise à afficher
|
|
24
|
+
*/
|
|
25
|
+
currency?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Unité de référence pour le montant, indiquant à quoi il s'applique.
|
|
28
|
+
* Exemples : "mois", "colis", "jh", "tranche" → pour afficher "123 € / mois".
|
|
29
|
+
* Optionnelle – à laisser vide si la valeur n'est pas exprimée par unité.
|
|
30
|
+
*/
|
|
31
|
+
per?: string;
|
|
32
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
33
|
+
//# sourceMappingURL=LabelMoneyInt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabelMoneyInt.d.ts","sourceRoot":"","sources":["../../../src/lib/money/LabelMoneyInt.tsx"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,4CAM3B;IACD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,mDAKA,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as f, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { createCurrency as s, format as p, NumberFormatInt as a } from "@seij/common-types";
|
|
3
|
+
import { isNil as l } from "lodash-es";
|
|
4
|
+
import { useContext as u } from "react";
|
|
5
|
+
import { DeviseContext as x } from "../devise/DeviseContext.js";
|
|
6
|
+
import { toCurrencySymbolSafe as y } from "../commons/currencysymbol.js";
|
|
7
|
+
const S = ({
|
|
8
|
+
value: r,
|
|
9
|
+
sign: t,
|
|
10
|
+
zeroblank: o = !1,
|
|
11
|
+
currency: e,
|
|
12
|
+
per: n
|
|
13
|
+
}) => {
|
|
14
|
+
const m = u(x);
|
|
15
|
+
if (o && r === 0) return null;
|
|
16
|
+
const i = s(y(e), n, m, "€");
|
|
17
|
+
return /* @__PURE__ */ f(c, { children: l(r) ? "" : p(r, a, i, t) });
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
S as LabelMoneyInt
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=LabelMoneyInt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabelMoneyInt.js","sources":["../../../src/lib/money/LabelMoneyInt.tsx"],"sourcesContent":["import { createCurrency, format, NumberFormatInt } from \"@seij/common-types\";\n\nimport { isNil } from \"lodash-es\";\nimport { useContext } from \"react\";\nimport { DeviseContext } from \"../devise/DeviseContext\";\nimport { toCurrencySymbolSafe } from \"../commons/currencysymbol\";\n\n/**\n * Affiche un montant sous la forme d'un nombre entier\n */\nexport const LabelMoneyInt = ({\n value,\n sign,\n zeroblank = false,\n currency,\n per,\n}: {\n /**\n * Valeur à afficher\n */\n value: number;\n /**\n * Affiche le signe + ou -\n *\n * pas obligatoire, par défaut \"auto\". Si \"auto\" affiche un signe uniquement si négatif,\n * sinon affiche toujours le signe + ou -\n */\n sign?: \"auto\" | \"always\";\n /**\n * Affiche ou pas les zero\n *\n * pas oblgatoire, par défaut \"false\". Si \"true\" et que la valeur est zero, alors n'affiche rien\n */\n zeroblank?: boolean;\n /**\n * Devise à afficher\n */\n currency?: string;\n /**\n * Unité de référence pour le montant, indiquant à quoi il s'applique.\n * Exemples : \"mois\", \"colis\", \"jh\", \"tranche\" → pour afficher \"123 € / mois\".\n * Optionnelle – à laisser vide si la valeur n'est pas exprimée par unité.\n */\n per?: string;\n}) => {\n const deviseContext = useContext(DeviseContext);\n if (zeroblank && value === 0) return null;\n const currencyFinal = createCurrency(toCurrencySymbolSafe(currency), per, deviseContext, \"€\");\n return <>{isNil(value) ? \"\" : format(value, NumberFormatInt, currencyFinal, sign)}</>;\n};\n"],"names":["LabelMoneyInt","value","sign","zeroblank","currency","per","deviseContext","useContext","DeviseContext","currencyFinal","createCurrency","toCurrencySymbolSafe","jsx","Fragment","isNil","format","NumberFormatInt"],"mappings":";;;;;;AAUO,MAAMA,IAAgB,CAAC;AAAA,EAC5B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,KAAAC;AACF,MA4BM;AACJ,QAAMC,IAAgBC,EAAWC,CAAa;AAC9C,MAAIL,KAAaF,MAAU,EAAG,QAAO;AACrC,QAAMQ,IAAgBC,EAAeC,EAAqBP,CAAQ,GAAGC,GAAKC,GAAe,GAAG;AAC5F,SAAO,gBAAAM,EAAAC,GAAA,EAAG,UAAAC,EAAMb,CAAK,IAAI,KAAKc,EAAOd,GAAOe,GAAiBP,GAAeP,CAAI,EAAA,CAAE;AACpF;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { InputNumberProps } from '../number/InputNumber';
|
|
3
|
+
export interface InputDurationMonthsProps extends InputNumberProps {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Permet de saisir une duree en mois.
|
|
7
|
+
*/
|
|
8
|
+
export declare const InputDurationMonths: React.FC<InputDurationMonthsProps>;
|
|
9
|
+
//# sourceMappingURL=InputDurationMonths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputDurationMonths.d.ts","sourceRoot":"","sources":["../../../src/lib/month/InputDurationMonths.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAe,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGtE,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;CAAG;AAErE;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAelE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { InputNumber as u } from "../number/InputNumber.js";
|
|
3
|
+
import { useI18n as i } from "../i18n/i18n.react.js";
|
|
4
|
+
const p = (t) => {
|
|
5
|
+
const { ...o } = t, { t: n } = i(), r = n("InputDurationMonths_unit");
|
|
6
|
+
return /* @__PURE__ */ e(
|
|
7
|
+
u,
|
|
8
|
+
{
|
|
9
|
+
decimalScale: 0,
|
|
10
|
+
allowNegative: !1,
|
|
11
|
+
inputMode: "numeric",
|
|
12
|
+
thousandSeparator: !1,
|
|
13
|
+
size: 4,
|
|
14
|
+
unit: r,
|
|
15
|
+
...o
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
p as InputDurationMonths
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=InputDurationMonths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputDurationMonths.js","sources":["../../../src/lib/month/InputDurationMonths.tsx"],"sourcesContent":["import React from \"react\";\nimport { InputNumber, InputNumberProps } from \"../number/InputNumber\";\nimport { useI18n } from \"../i18n/i18n.react\";\n\nexport interface InputDurationMonthsProps extends InputNumberProps {}\n\n/**\n * Permet de saisir une duree en mois.\n */\nexport const InputDurationMonths: React.FC<InputDurationMonthsProps> = (props) => {\n const { ...other } = props;\n const { t } = useI18n();\n const unit = t(\"InputDurationMonths_unit\");\n return (\n <InputNumber\n decimalScale={0}\n allowNegative={false}\n inputMode=\"numeric\"\n thousandSeparator={false}\n size={4}\n unit={unit}\n {...other}\n />\n );\n};\n"],"names":["InputDurationMonths","props","other","t","useI18n","unit","jsx","InputNumber"],"mappings":";;;AASO,MAAMA,IAA0D,CAACC,MAAU;AAChF,QAAM,EAAE,GAAGC,EAAA,IAAUD,GACf,EAAE,GAAAE,EAAA,IAAMC,EAAA,GACRC,IAAOF,EAAE,0BAA0B;AACzC,SACE,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,cAAc;AAAA,MACd,eAAe;AAAA,MACf,WAAU;AAAA,MACV,mBAAmB;AAAA,MACnB,MAAM;AAAA,MACN,MAAAF;AAAA,MACC,GAAGH;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Month } from '../../../../common-types/src/index.ts';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
type HTMLInputElementCurated = Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "value" | "defaultValue" | "onChange" | "children">;
|
|
4
|
+
export interface InputMonthProps extends HTMLInputElementCurated {
|
|
5
|
+
value: Month;
|
|
6
|
+
onValueChange: (value: Month) => unknown;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Permet de saisir un mois.
|
|
10
|
+
*/
|
|
11
|
+
export declare const InputMonth: React.FC<InputMonthProps>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=InputMonth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputMonth.d.ts","sourceRoot":"","sources":["../../../src/lib/month/InputMonth.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,KAAK,uBAAuB,GAAG,IAAI,CACjC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,UAAU,CACnD,CAAC;AAEF,MAAM,WAAW,eAAgB,SAAQ,uBAAuB;IAC9D,KAAK,EAAE,KAAK,CAAC;IACb,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC;CAC1C;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAYhD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as a } from "react";
|
|
3
|
+
import { useI18n as p } from "../i18n/i18n.react.js";
|
|
4
|
+
import { InputSelect as h } from "../select/InputSelect.js";
|
|
5
|
+
const b = (l) => {
|
|
6
|
+
const { value: r, onValueChange: c, required: i, ...m } = l, { monthList: t, t: o } = p(), s = a(() => {
|
|
7
|
+
const e = t.map((n) => ({ code: "" + n.code, label: n.label }));
|
|
8
|
+
return [{ code: "", label: "-- " + o("InputSelect_select") + " --" }, ...e];
|
|
9
|
+
}, [t, o]);
|
|
10
|
+
return /* @__PURE__ */ u(h, { options: s, value: "" + r, onValueChange: (e) => c(parseInt(e)), ...m });
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
b as InputMonth
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=InputMonth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputMonth.js","sources":["../../../src/lib/month/InputMonth.tsx"],"sourcesContent":["import { Month } from \"@seij/common-types\";\nimport React, { useMemo } from \"react\";\nimport { useI18n } from \"../i18n/i18n.react\";\nimport { InputSelect } from \"../select/InputSelect\";\n\ntype HTMLInputElementCurated = Omit<\n React.SelectHTMLAttributes<HTMLSelectElement>,\n \"value\" | \"defaultValue\" | \"onChange\" | \"children\"\n>;\n\nexport interface InputMonthProps extends HTMLInputElementCurated {\n value: Month;\n onValueChange: (value: Month) => unknown;\n}\n\n/**\n * Permet de saisir un mois.\n */\nexport const InputMonth: React.FC<InputMonthProps> = (props) => {\n const { value, onValueChange, required, ...other } = props;\n const { monthList, t } = useI18n();\n const options = useMemo(() => {\n const months = monthList.map((it) => ({ code: \"\" + it.code, label: it.label }));\n const emptyValueSelect = t(\"InputSelect_select\");\n return [{ code: \"\", label: \"-- \" + emptyValueSelect + \" --\" }, ...months];\n }, [monthList, t]);\n\n return (\n <InputSelect options={options} value={\"\" + value} onValueChange={(v) => onValueChange(parseInt(v))} {...other} />\n );\n};\n"],"names":["InputMonth","props","value","onValueChange","required","other","monthList","t","useI18n","options","useMemo","months","it","jsx","InputSelect","v"],"mappings":";;;;AAkBO,MAAMA,IAAwC,CAACC,MAAU;AAC9D,QAAM,EAAE,OAAAC,GAAO,eAAAC,GAAe,UAAAC,GAAU,GAAGC,MAAUJ,GAC/C,EAAE,WAAAK,GAAW,GAAAC,EAAA,IAAMC,EAAA,GACnBC,IAAUC,EAAQ,MAAM;AAC5B,UAAMC,IAASL,EAAU,IAAI,CAACM,OAAQ,EAAE,MAAM,KAAKA,EAAG,MAAM,OAAOA,EAAG,QAAQ;AAE9E,WAAO,CAAC,EAAE,MAAM,IAAI,OAAO,QADFL,EAAE,oBAAoB,IACO,SAAS,GAAGI,CAAM;AAAA,EAC1E,GAAG,CAACL,GAAWC,CAAC,CAAC;AAEjB,SACE,gBAAAM,EAACC,GAAA,EAAY,SAAAL,GAAkB,OAAO,KAAKP,GAAO,eAAe,CAACa,MAAMZ,EAAc,SAASY,CAAC,CAAC,GAAI,GAAGV,GAAO;AAEnH;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NavigationTreeItem } from './Navigation.types';
|
|
2
|
+
/**
|
|
3
|
+
* Affiche un menu de navigation
|
|
4
|
+
*/
|
|
5
|
+
export declare function Navigation({ items, }: {
|
|
6
|
+
/** Liste des items du menu */
|
|
7
|
+
items: NavigationTreeItem[];
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=Navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Navigation.d.ts","sourceRoot":"","sources":["../../../src/lib/navigation/Navigation.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAEL,kBAAkB,EAInB,MAAM,oBAAoB,CAAC;AAI5B;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,GACN,EAAE;IACD,8BAA8B;IAC9B,KAAK,EAAE,kBAAkB,EAAE,CAAC;CAC7B,2CAYA"}
|