@agnos-ui/react-bootstrap 0.3.1 → 0.4.0-next.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/{accordion-Bpx0new2.js → accordion-CMbgQzoG.js} +12 -10
- package/{accordion-BaQCaLLI.cjs → accordion-DnlQmoOX.cjs} +9 -7
- package/{alert-DOBOL4nD.cjs → alert-Bn5ooyqK.cjs} +9 -17
- package/{alert-DWq65Emo.js → alert-DKl7HLhb.js} +11 -19
- package/components/accordion/accordion.d.ts +6 -12
- package/components/accordion/accordion.gen.d.ts +343 -0
- package/components/accordion/index.cjs +3 -9
- package/components/accordion/index.js +5 -4
- package/components/alert/alert.d.ts +6 -9
- package/components/alert/alert.gen.d.ts +119 -0
- package/components/alert/index.cjs +2 -9
- package/components/alert/index.js +3 -3
- package/components/modal/index.cjs +10 -8
- package/components/modal/index.js +5 -2
- package/components/modal/modal.d.ts +7 -9
- package/components/modal/modal.gen.d.ts +239 -0
- package/components/pagination/index.cjs +2 -9
- package/components/pagination/index.js +3 -3
- package/components/pagination/pagination.d.ts +4 -7
- package/components/pagination/pagination.gen.d.ts +394 -0
- package/components/progressbar/index.cjs +2 -9
- package/components/progressbar/index.js +3 -3
- package/components/progressbar/progressbar.d.ts +5 -8
- package/components/progressbar/progressbar.gen.d.ts +126 -0
- package/components/rating/index.cjs +2 -9
- package/components/rating/index.js +3 -3
- package/components/rating/rating.d.ts +4 -5
- package/components/rating/rating.gen.d.ts +179 -0
- package/components/select/index.cjs +2 -9
- package/components/select/index.js +3 -3
- package/components/select/select.d.ts +4 -7
- package/components/select/select.gen.d.ts +293 -0
- package/components/slider/index.cjs +2 -9
- package/components/slider/index.js +3 -3
- package/components/slider/slider.d.ts +4 -8
- package/components/slider/slider.gen.d.ts +293 -0
- package/components/toast/index.cjs +2 -9
- package/components/toast/index.js +3 -3
- package/components/toast/toast.d.ts +6 -9
- package/components/toast/toast.gen.d.ts +146 -0
- package/config.d.ts +3 -4
- package/config.gen.d.ts +47 -0
- package/generated/config.cjs +4 -5
- package/generated/services/extendWidget.cjs +4 -5
- package/generated/services/floatingUI.cjs +4 -5
- package/generated/services/focustrack.cjs +4 -5
- package/generated/services/hash.cjs +4 -5
- package/generated/services/intersection.cjs +4 -5
- package/generated/services/matchMedia.cjs +4 -5
- package/generated/services/navManager.cjs +4 -5
- package/generated/services/portal.cjs +4 -5
- package/generated/services/resizeObserver.cjs +4 -5
- package/generated/services/siblingsInert.cjs +4 -5
- package/generated/services/transitions/baseTransitions.cjs +4 -5
- package/generated/services/transitions/bootstrap.cjs +4 -5
- package/generated/services/transitions/collapse.cjs +4 -5
- package/generated/services/transitions/cssTransitions.cjs +4 -5
- package/generated/services/transitions/simpleClassTransition.cjs +4 -5
- package/generated/slot.cjs +4 -5
- package/generated/types.cjs +4 -5
- package/generated/utils/directive.cjs +4 -5
- package/generated/utils/portal.cjs +4 -5
- package/generated/utils/stores.cjs +4 -5
- package/generated/utils/widget.cjs +4 -5
- package/generated/utils/writables.cjs +4 -5
- package/index.cjs +120 -196
- package/index.js +24 -20
- package/{modal-B6rJgzVm.js → modal-B9xclGji.js} +8 -5
- package/{modal-2qAV4Hjl.cjs → modal-Vd0W6U05.cjs} +7 -4
- package/package.json +6 -6
- package/{pagination-X2bugeX-.js → pagination-BGHP7K6U.js} +5 -3
- package/{pagination-CKUbq-OI.cjs → pagination-BO6qrpA6.cjs} +3 -1
- package/{progressbar-D-yo9AHH.cjs → progressbar-Bi9aS9jg.cjs} +4 -2
- package/{progressbar-D1-6Dzrf.js → progressbar-D8_F2wYh.js} +6 -4
- package/{rating-D2Ajh4vg.cjs → rating-DB4Ze-r4.cjs} +3 -2
- package/{rating-Cvad2Z2H.js → rating-DRAx20tg.js} +5 -4
- package/{select-B_Thv-qd.js → select-CEXxOyRB.js} +8 -6
- package/{select-DHik5ocI.cjs → select-CxX_TdVh.cjs} +6 -4
- package/{slider-DLdA-y4u.js → slider-CnK847iw.js} +15 -13
- package/{slider-DUv6gRI9.cjs → slider-Du37lWVJ.cjs} +13 -11
- package/{toast-BUiyh5r_.js → toast-Bvz7Uyrd.js} +12 -10
- package/{toast-Dp_zjIff.cjs → toast-cd5__9Rl.cjs} +10 -8
package/index.js
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as A2, c as c2 } from "./alert-
|
|
3
|
-
import { M, c as c3, o } from "./modal-
|
|
4
|
-
import { D, a as a2, N, b, P, c as c4 } from "./pagination-
|
|
5
|
-
import { P as P2, c as c5 } from "./progressbar-
|
|
6
|
-
import { R, c as c6 } from "./rating-
|
|
7
|
-
import { S, c as c7 } from "./select-
|
|
8
|
-
import { D as D2, a as a3, S as S2, c as c8 } from "./slider-
|
|
9
|
-
import { T, c as c9 } from "./toast-
|
|
10
|
-
|
|
11
|
-
export * from "@agnos-ui/core-bootstrap/components/alert";
|
|
12
|
-
export * from "@agnos-ui/core-bootstrap/components/modal";
|
|
13
|
-
export * from "@agnos-ui/core-bootstrap/components/pagination";
|
|
14
|
-
export * from "@agnos-ui/core-bootstrap/components/progressbar";
|
|
15
|
-
export * from "@agnos-ui/react-headless/components/rating";
|
|
16
|
-
export * from "@agnos-ui/core-bootstrap/components/select";
|
|
17
|
-
export * from "@agnos-ui/core-bootstrap/components/slider";
|
|
18
|
-
export * from "@agnos-ui/core-bootstrap/components/toast";
|
|
1
|
+
import { b, A, c, a, g } from "./accordion-CMbgQzoG.js";
|
|
2
|
+
import { A as A2, c as c2, g as g2 } from "./alert-DKl7HLhb.js";
|
|
3
|
+
import { M, c as c3, g as g3, o } from "./modal-B9xclGji.js";
|
|
4
|
+
import { D, a as a2, N, b as b2, P, c as c4, g as g4 } from "./pagination-BGHP7K6U.js";
|
|
5
|
+
import { P as P2, c as c5, g as g5 } from "./progressbar-D8_F2wYh.js";
|
|
6
|
+
import { R, c as c6, g as g6 } from "./rating-DRAx20tg.js";
|
|
7
|
+
import { S, c as c7, g as g7 } from "./select-CEXxOyRB.js";
|
|
8
|
+
import { D as D2, a as a3, S as S2, c as c8, g as g8 } from "./slider-CnK847iw.js";
|
|
9
|
+
import { T, c as c9, g as g9 } from "./toast-Bvz7Uyrd.js";
|
|
10
|
+
import { modalCloseButtonClick, modalOutsideClick } from "@agnos-ui/react-headless/components/modal";
|
|
19
11
|
export * from "@agnos-ui/react-headless/types";
|
|
20
12
|
export * from "@agnos-ui/react-headless/slot";
|
|
21
13
|
export * from "@agnos-ui/react-headless/config";
|
|
@@ -41,7 +33,7 @@ export * from "@agnos-ui/react-headless/services/transitions/collapse";
|
|
|
41
33
|
export * from "@agnos-ui/react-headless/services/transitions/baseTransitions";
|
|
42
34
|
export * from "@agnos-ui/core-bootstrap/services/transitions";
|
|
43
35
|
export {
|
|
44
|
-
|
|
36
|
+
b as Accordion,
|
|
45
37
|
A as AccordionItem,
|
|
46
38
|
A2 as Alert,
|
|
47
39
|
D as DefaultPages,
|
|
@@ -50,7 +42,7 @@ export {
|
|
|
50
42
|
a2 as DefaultStructure,
|
|
51
43
|
M as Modal,
|
|
52
44
|
N as NavButton,
|
|
53
|
-
|
|
45
|
+
b2 as PageItem,
|
|
54
46
|
P as Pagination,
|
|
55
47
|
P2 as Progressbar,
|
|
56
48
|
R as Rating,
|
|
@@ -59,6 +51,7 @@ export {
|
|
|
59
51
|
T as Toast,
|
|
60
52
|
WidgetsDefaultConfig,
|
|
61
53
|
c as createAccordion,
|
|
54
|
+
a as createAccordionItem,
|
|
62
55
|
c2 as createAlert,
|
|
63
56
|
c3 as createModal,
|
|
64
57
|
c4 as createPagination,
|
|
@@ -67,6 +60,17 @@ export {
|
|
|
67
60
|
c7 as createSelect,
|
|
68
61
|
c8 as createSlider,
|
|
69
62
|
c9 as createToast,
|
|
63
|
+
g as getAccordionDefaultConfig,
|
|
64
|
+
g2 as getAlertDefaultConfig,
|
|
65
|
+
g3 as getModalDefaultConfig,
|
|
66
|
+
g4 as getPaginationDefaultConfig,
|
|
67
|
+
g5 as getProgressbarDefaultConfig,
|
|
68
|
+
g6 as getRatingDefaultConfig,
|
|
69
|
+
g7 as getSelectDefaultConfig,
|
|
70
|
+
g8 as getSliderDefaultConfig,
|
|
71
|
+
g9 as getToastDefaultConfig,
|
|
72
|
+
modalCloseButtonClick,
|
|
73
|
+
modalOutsideClick,
|
|
70
74
|
o as openModal,
|
|
71
75
|
useWidgetContext,
|
|
72
76
|
useWidgetWithConfig,
|
|
@@ -6,19 +6,21 @@ import { useWidgetWithConfig } from "./generated/config.js";
|
|
|
6
6
|
import { useDirectives, classDirective, useDirective } from "@agnos-ui/react-headless/utils/directive";
|
|
7
7
|
import ReactDOM from "react-dom/client";
|
|
8
8
|
import { forwardRef, useImperativeHandle } from "react";
|
|
9
|
-
import { createModal as createModal$1 } from "@agnos-ui/core-bootstrap/components/modal";
|
|
9
|
+
import { createModal as createModal$1, getModalDefaultConfig as getModalDefaultConfig$1 } from "@agnos-ui/core-bootstrap/components/modal";
|
|
10
10
|
import classNames from "classnames";
|
|
11
|
+
import "@agnos-ui/react-headless/components/modal";
|
|
11
12
|
const createModal = createModal$1;
|
|
13
|
+
const getModalDefaultConfig = getModalDefaultConfig$1;
|
|
14
|
+
const CloseButton = ({ directive }) => /* @__PURE__ */ jsx("button", { className: "btn-close", ...useDirective(directive) });
|
|
12
15
|
const DefaultSlotHeader = (slotContext) => {
|
|
13
|
-
const refCloseButton = useDirective(slotContext.widget.directives.closeButtonDirective);
|
|
14
16
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15
17
|
/* @__PURE__ */ jsx("h5", { className: "modal-title", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.slotTitle, props: slotContext }) }),
|
|
16
|
-
slotContext.state.closeButton && /* @__PURE__ */ jsx(
|
|
18
|
+
slotContext.state.closeButton && /* @__PURE__ */ jsx(CloseButton, { directive: slotContext.widget.directives.closeButtonDirective })
|
|
17
19
|
] });
|
|
18
20
|
};
|
|
19
21
|
const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
22
|
slotContext.state.slotTitle && /* @__PURE__ */ jsx("div", { className: "modal-header", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.slotHeader, props: slotContext }) }),
|
|
21
|
-
/* @__PURE__ */ jsx("div", { className: "modal-body", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.
|
|
23
|
+
/* @__PURE__ */ jsx("div", { className: "modal-body", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.children, props: slotContext }) }),
|
|
22
24
|
slotContext.state.slotFooter && /* @__PURE__ */ jsx("div", { className: "modal-footer", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.slotFooter, props: slotContext }) })
|
|
23
25
|
] });
|
|
24
26
|
const defaultConfig = {
|
|
@@ -31,7 +33,7 @@ const ModalElement = (slotContext) => {
|
|
|
31
33
|
return /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "modal d-block"], slotContext.widget.directives.modalDirective), children: /* @__PURE__ */ jsx("div", { className: classNames("modal-dialog", { "modal-fullscreen": fullscreen }), children: /* @__PURE__ */ jsx("div", { className: "modal-content", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.slotStructure, props: slotContext }) }) }) });
|
|
32
34
|
};
|
|
33
35
|
const Modal = forwardRef(function Modal2(props, ref) {
|
|
34
|
-
const [state, widget] = useWidgetWithConfig(createModal, props, "modal",
|
|
36
|
+
const [state, widget] = useWidgetWithConfig(createModal, props, "modal", defaultConfig);
|
|
35
37
|
useImperativeHandle(ref, () => widget.api, []);
|
|
36
38
|
const slotContext = {
|
|
37
39
|
state,
|
|
@@ -56,5 +58,6 @@ async function openModal(options) {
|
|
|
56
58
|
export {
|
|
57
59
|
Modal as M,
|
|
58
60
|
createModal as c,
|
|
61
|
+
getModalDefaultConfig as g,
|
|
59
62
|
openModal as o
|
|
60
63
|
};
|
|
@@ -9,17 +9,19 @@ const ReactDOM = require("react-dom/client");
|
|
|
9
9
|
const React = require("react");
|
|
10
10
|
const modal = require("@agnos-ui/core-bootstrap/components/modal");
|
|
11
11
|
const classNames = require("classnames");
|
|
12
|
+
require("@agnos-ui/react-headless/components/modal");
|
|
12
13
|
const createModal = modal.createModal;
|
|
14
|
+
const getModalDefaultConfig = modal.getModalDefaultConfig;
|
|
15
|
+
const CloseButton = ({ directive: directive$1 }) => /* @__PURE__ */ jsxRuntime.jsx("button", { className: "btn-close", ...directive.useDirective(directive$1) });
|
|
13
16
|
const DefaultSlotHeader = (slotContext) => {
|
|
14
|
-
const refCloseButton = directive.useDirective(slotContext.widget.directives.closeButtonDirective);
|
|
15
17
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16
18
|
/* @__PURE__ */ jsxRuntime.jsx("h5", { className: "modal-title", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.slotTitle, props: slotContext }) }),
|
|
17
|
-
slotContext.state.closeButton && /* @__PURE__ */ jsxRuntime.jsx(
|
|
19
|
+
slotContext.state.closeButton && /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { directive: slotContext.widget.directives.closeButtonDirective })
|
|
18
20
|
] });
|
|
19
21
|
};
|
|
20
22
|
const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
21
23
|
slotContext.state.slotTitle && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-header", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.slotHeader, props: slotContext }) }),
|
|
22
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-body", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.
|
|
24
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-body", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.children, props: slotContext }) }),
|
|
23
25
|
slotContext.state.slotFooter && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-footer", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.slotFooter, props: slotContext }) })
|
|
24
26
|
] });
|
|
25
27
|
const defaultConfig = {
|
|
@@ -32,7 +34,7 @@ const ModalElement = (slotContext) => {
|
|
|
32
34
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "modal d-block"], slotContext.widget.directives.modalDirective), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames("modal-dialog", { "modal-fullscreen": fullscreen }), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-content", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.slotStructure, props: slotContext }) }) }) });
|
|
33
35
|
};
|
|
34
36
|
const Modal = React.forwardRef(function Modal2(props, ref) {
|
|
35
|
-
const [state, widget] = generated_config.useWidgetWithConfig(createModal, props, "modal",
|
|
37
|
+
const [state, widget] = generated_config.useWidgetWithConfig(createModal, props, "modal", defaultConfig);
|
|
36
38
|
React.useImperativeHandle(ref, () => widget.api, []);
|
|
37
39
|
const slotContext = {
|
|
38
40
|
state,
|
|
@@ -56,4 +58,5 @@ async function openModal(options) {
|
|
|
56
58
|
}
|
|
57
59
|
exports.Modal = Modal;
|
|
58
60
|
exports.createModal = createModal;
|
|
61
|
+
exports.getModalDefaultConfig = getModalDefaultConfig;
|
|
59
62
|
exports.openModal = openModal;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agnos-ui/react-bootstrap",
|
|
3
3
|
"description": "Bootstrap-based widget library for React.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0-next.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.cjs",
|
|
7
7
|
"module": "./index.js",
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@agnos-ui/core-bootstrap": "0.
|
|
53
|
-
"@agnos-ui/react-headless": "0.
|
|
52
|
+
"@agnos-ui/core-bootstrap": "0.4.0-next.0",
|
|
53
|
+
"@agnos-ui/react-headless": "0.4.0-next.0",
|
|
54
54
|
"classnames": "^2.5.1"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@amadeus-it-group/tansu": "
|
|
58
|
-
"react": "
|
|
59
|
-
"react-dom": "
|
|
57
|
+
"@amadeus-it-group/tansu": "^1.0.0",
|
|
58
|
+
"react": "^18.3.1",
|
|
59
|
+
"react-dom": "^18.3.1"
|
|
60
60
|
},
|
|
61
61
|
"sideEffects": false,
|
|
62
62
|
"homepage": "https://amadeusitgroup.github.io/AgnosUI/latest/",
|
|
@@ -5,7 +5,7 @@ import { toSlotContextWidget } from "@agnos-ui/react-headless/types";
|
|
|
5
5
|
import classNames from "classnames";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { useDirectives, classDirective } from "@agnos-ui/react-headless/utils/directive";
|
|
8
|
-
import { createPagination as createPagination$1 } from "@agnos-ui/core-bootstrap/components/pagination";
|
|
8
|
+
import { createPagination as createPagination$1, getPaginationDefaultConfig as getPaginationDefaultConfig$1 } from "@agnos-ui/core-bootstrap/components/pagination";
|
|
9
9
|
const PageItem = React.forwardRef(
|
|
10
10
|
({ disabled, active, activeLabel, className, children, directive, page }, ref) => {
|
|
11
11
|
return /* @__PURE__ */ jsx("li", { ref, className: classNames("page-item", { active, disabled }), children: /* @__PURE__ */ jsxs("a", { ...useDirectives([directive, { page }], [classDirective, classNames("page-link", className)]), children: [
|
|
@@ -20,6 +20,7 @@ const NavButton = React.forwardRef(({ disabled, className, children, directive }
|
|
|
20
20
|
});
|
|
21
21
|
NavButton.displayName = "NavButton";
|
|
22
22
|
const createPagination = createPagination$1;
|
|
23
|
+
const getPaginationDefaultConfig = getPaginationDefaultConfig$1;
|
|
23
24
|
function DefaultPages(slotContext) {
|
|
24
25
|
const { widget, state } = slotContext;
|
|
25
26
|
const jsxPages = [];
|
|
@@ -79,7 +80,7 @@ function DefaultStructure(slotContext) {
|
|
|
79
80
|
);
|
|
80
81
|
}
|
|
81
82
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
82
|
-
/* @__PURE__ */ jsxs("ul", { className: classNames("au-pagination", "pagination",
|
|
83
|
+
/* @__PURE__ */ jsxs("ul", { className: classNames("au-pagination", "pagination", { [`pagination-${state.size}`]: !!state.size }, state.className), children: [
|
|
83
84
|
ItemsBefore,
|
|
84
85
|
/* @__PURE__ */ jsx(Slot, { slotContent: state.slotPages, props: slotContext }),
|
|
85
86
|
ItemsAfter
|
|
@@ -98,5 +99,6 @@ export {
|
|
|
98
99
|
Pagination as P,
|
|
99
100
|
DefaultStructure as a,
|
|
100
101
|
PageItem as b,
|
|
101
|
-
createPagination as c
|
|
102
|
+
createPagination as c,
|
|
103
|
+
getPaginationDefaultConfig as g
|
|
102
104
|
};
|
|
@@ -38,6 +38,7 @@ const NavButton = React__namespace.forwardRef(({ disabled, className, children,
|
|
|
38
38
|
});
|
|
39
39
|
NavButton.displayName = "NavButton";
|
|
40
40
|
const createPagination = pagination.createPagination;
|
|
41
|
+
const getPaginationDefaultConfig = pagination.getPaginationDefaultConfig;
|
|
41
42
|
function DefaultPages(slotContext) {
|
|
42
43
|
const { widget, state } = slotContext;
|
|
43
44
|
const jsxPages = [];
|
|
@@ -97,7 +98,7 @@ function DefaultStructure(slotContext) {
|
|
|
97
98
|
);
|
|
98
99
|
}
|
|
99
100
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
100
|
-
/* @__PURE__ */ jsxRuntime.jsxs("ul", { className: classNames("au-pagination", "pagination",
|
|
101
|
+
/* @__PURE__ */ jsxRuntime.jsxs("ul", { className: classNames("au-pagination", "pagination", { [`pagination-${state.size}`]: !!state.size }, state.className), children: [
|
|
101
102
|
ItemsBefore,
|
|
102
103
|
/* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.slotPages, props: slotContext }),
|
|
103
104
|
ItemsAfter
|
|
@@ -116,3 +117,4 @@ exports.NavButton = NavButton;
|
|
|
116
117
|
exports.PageItem = PageItem;
|
|
117
118
|
exports.Pagination = Pagination;
|
|
118
119
|
exports.createPagination = createPagination;
|
|
120
|
+
exports.getPaginationDefaultConfig = getPaginationDefaultConfig;
|
|
@@ -7,18 +7,20 @@ const directive = require("@agnos-ui/react-headless/utils/directive");
|
|
|
7
7
|
const classNames = require("classnames");
|
|
8
8
|
const progressbar = require("@agnos-ui/core-bootstrap/components/progressbar");
|
|
9
9
|
const createProgressbar = progressbar.createProgressbar;
|
|
10
|
+
const getProgressbarDefaultConfig = progressbar.getProgressbarDefaultConfig;
|
|
10
11
|
function DefaultSlotContent(slotContext) {
|
|
11
12
|
const { striped, animated, type } = slotContext.state;
|
|
12
13
|
const classes = classNames("progress-bar", { "progress-bar-striped": striped }, { "progress-bar-animated": animated }, { [`text-bg-${type}`]: !!type });
|
|
13
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "progress", style: { height: slotContext.state.height || void 0 }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, style: { width: `${slotContext.state.percentage}%` }, children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "progress", style: { height: slotContext.state.height || void 0 }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, style: { width: `${slotContext.state.percentage}%` }, children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.children, props: slotContext }) }) });
|
|
14
15
|
}
|
|
15
16
|
const defaultConfig = {
|
|
16
17
|
slotStructure: DefaultSlotContent
|
|
17
18
|
};
|
|
18
19
|
const Progressbar = (props) => {
|
|
19
|
-
const [state, widget] = generated_config.useWidgetWithConfig(createProgressbar, props, "progressbar",
|
|
20
|
+
const [state, widget] = generated_config.useWidgetWithConfig(createProgressbar, props, "progressbar", defaultConfig);
|
|
20
21
|
const slotContext = { state, widget: types.toSlotContextWidget(widget) };
|
|
21
22
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(widget.directives.ariaDirective), className: state.className || void 0, children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.slotStructure, props: slotContext }) });
|
|
22
23
|
};
|
|
23
24
|
exports.Progressbar = Progressbar;
|
|
24
25
|
exports.createProgressbar = createProgressbar;
|
|
26
|
+
exports.getProgressbarDefaultConfig = getProgressbarDefaultConfig;
|
|
@@ -4,22 +4,24 @@ import { toSlotContextWidget } from "@agnos-ui/react-headless/types";
|
|
|
4
4
|
import { Slot } from "@agnos-ui/react-headless/slot";
|
|
5
5
|
import { useDirective } from "@agnos-ui/react-headless/utils/directive";
|
|
6
6
|
import classNames from "classnames";
|
|
7
|
-
import { createProgressbar as createProgressbar$1 } from "@agnos-ui/core-bootstrap/components/progressbar";
|
|
7
|
+
import { createProgressbar as createProgressbar$1, getProgressbarDefaultConfig as getProgressbarDefaultConfig$1 } from "@agnos-ui/core-bootstrap/components/progressbar";
|
|
8
8
|
const createProgressbar = createProgressbar$1;
|
|
9
|
+
const getProgressbarDefaultConfig = getProgressbarDefaultConfig$1;
|
|
9
10
|
function DefaultSlotContent(slotContext) {
|
|
10
11
|
const { striped, animated, type } = slotContext.state;
|
|
11
12
|
const classes = classNames("progress-bar", { "progress-bar-striped": striped }, { "progress-bar-animated": animated }, { [`text-bg-${type}`]: !!type });
|
|
12
|
-
return /* @__PURE__ */ jsx("div", { className: "progress", style: { height: slotContext.state.height || void 0 }, children: /* @__PURE__ */ jsx("div", { className: classes, style: { width: `${slotContext.state.percentage}%` }, children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.
|
|
13
|
+
return /* @__PURE__ */ jsx("div", { className: "progress", style: { height: slotContext.state.height || void 0 }, children: /* @__PURE__ */ jsx("div", { className: classes, style: { width: `${slotContext.state.percentage}%` }, children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.children, props: slotContext }) }) });
|
|
13
14
|
}
|
|
14
15
|
const defaultConfig = {
|
|
15
16
|
slotStructure: DefaultSlotContent
|
|
16
17
|
};
|
|
17
18
|
const Progressbar = (props) => {
|
|
18
|
-
const [state, widget] = useWidgetWithConfig(createProgressbar, props, "progressbar",
|
|
19
|
+
const [state, widget] = useWidgetWithConfig(createProgressbar, props, "progressbar", defaultConfig);
|
|
19
20
|
const slotContext = { state, widget: toSlotContextWidget(widget) };
|
|
20
21
|
return /* @__PURE__ */ jsx("div", { ...useDirective(widget.directives.ariaDirective), className: state.className || void 0, children: /* @__PURE__ */ jsx(Slot, { slotContent: state.slotStructure, props: slotContext }) });
|
|
21
22
|
};
|
|
22
23
|
export {
|
|
23
24
|
Progressbar as P,
|
|
24
|
-
createProgressbar as c
|
|
25
|
+
createProgressbar as c,
|
|
26
|
+
getProgressbarDefaultConfig as g
|
|
25
27
|
};
|
|
@@ -5,8 +5,8 @@ const generated_config = require("./generated/config.cjs");
|
|
|
5
5
|
const directive = require("@agnos-ui/react-headless/utils/directive");
|
|
6
6
|
const React = require("react");
|
|
7
7
|
const rating = require("@agnos-ui/core-bootstrap/components/rating");
|
|
8
|
-
require("@agnos-ui/react-headless/components/rating");
|
|
9
8
|
const createRating = rating.createRating;
|
|
9
|
+
const getRatingDefaultConfig = rating.getRatingDefaultConfig;
|
|
10
10
|
function Star({ star, state, directive: directive$1 }) {
|
|
11
11
|
const arg = { index: star.index };
|
|
12
12
|
return /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
|
|
@@ -15,7 +15,7 @@ function Star({ star, state, directive: directive$1 }) {
|
|
|
15
15
|
star.index < state.visibleRating ? "*" : " ",
|
|
16
16
|
")"
|
|
17
17
|
] }),
|
|
18
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { ...directive.useDirective(directive$1, arg), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.
|
|
18
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { ...directive.useDirective(directive$1, arg), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.star, props: star }) })
|
|
19
19
|
] }, star.index);
|
|
20
20
|
}
|
|
21
21
|
function Rating(props) {
|
|
@@ -27,3 +27,4 @@ function Rating(props) {
|
|
|
27
27
|
}
|
|
28
28
|
exports.Rating = Rating;
|
|
29
29
|
exports.createRating = createRating;
|
|
30
|
+
exports.getRatingDefaultConfig = getRatingDefaultConfig;
|
|
@@ -3,9 +3,9 @@ import { Slot } from "@agnos-ui/react-headless/slot";
|
|
|
3
3
|
import { useWidgetWithConfig } from "./generated/config.js";
|
|
4
4
|
import { useDirectives, classDirective, useDirective } from "@agnos-ui/react-headless/utils/directive";
|
|
5
5
|
import React__default from "react";
|
|
6
|
-
import { createRating as createRating$1 } from "@agnos-ui/core-bootstrap/components/rating";
|
|
7
|
-
import "@agnos-ui/react-headless/components/rating";
|
|
6
|
+
import { createRating as createRating$1, getRatingDefaultConfig as getRatingDefaultConfig$1 } from "@agnos-ui/core-bootstrap/components/rating";
|
|
8
7
|
const createRating = createRating$1;
|
|
8
|
+
const getRatingDefaultConfig = getRatingDefaultConfig$1;
|
|
9
9
|
function Star({ star, state, directive }) {
|
|
10
10
|
const arg = { index: star.index };
|
|
11
11
|
return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
@@ -14,7 +14,7 @@ function Star({ star, state, directive }) {
|
|
|
14
14
|
star.index < state.visibleRating ? "*" : " ",
|
|
15
15
|
")"
|
|
16
16
|
] }),
|
|
17
|
-
/* @__PURE__ */ jsx("span", { ...useDirective(directive, arg), children: /* @__PURE__ */ jsx(Slot, { slotContent: state.
|
|
17
|
+
/* @__PURE__ */ jsx("span", { ...useDirective(directive, arg), children: /* @__PURE__ */ jsx(Slot, { slotContent: state.star, props: star }) })
|
|
18
18
|
] }, star.index);
|
|
19
19
|
}
|
|
20
20
|
function Rating(props) {
|
|
@@ -26,5 +26,6 @@ function Rating(props) {
|
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
28
|
Rating as R,
|
|
29
|
-
createRating as c
|
|
29
|
+
createRating as c,
|
|
30
|
+
getRatingDefaultConfig as g
|
|
30
31
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { createSelect as createSelect$1 } from "@agnos-ui/core-bootstrap/components/select";
|
|
2
|
+
import { createSelect as createSelect$1, getSelectDefaultConfig as getSelectDefaultConfig$1 } from "@agnos-ui/core-bootstrap/components/select";
|
|
3
3
|
import { Slot } from "@agnos-ui/react-headless/slot";
|
|
4
4
|
import { toSlotContextWidget } from "@agnos-ui/react-headless/types";
|
|
5
5
|
import { useDirectives, classDirective, useDirective } from "@agnos-ui/react-headless/utils/directive";
|
|
6
6
|
import classNames from "classnames";
|
|
7
7
|
import { useWidgetWithConfig } from "./generated/config.js";
|
|
8
8
|
const createSelect = createSelect$1;
|
|
9
|
+
const getSelectDefaultConfig = getSelectDefaultConfig$1;
|
|
9
10
|
function DefaultBadge(slotContext) {
|
|
10
11
|
return /* @__PURE__ */ jsx(Fragment, { children: "" + slotContext.itemContext.item });
|
|
11
12
|
}
|
|
@@ -13,7 +14,7 @@ function DefaultItem(slotContext) {
|
|
|
13
14
|
return /* @__PURE__ */ jsx(Fragment, { children: "" + slotContext.itemContext.item });
|
|
14
15
|
}
|
|
15
16
|
function BadgeContainer({ itemContext, slotContext }) {
|
|
16
|
-
return /* @__PURE__ */ jsx("div", { ...useDirective(slotContext.widget.directives.badgeAttributesDirective, itemContext), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.
|
|
17
|
+
return /* @__PURE__ */ jsx("div", { ...useDirective(slotContext.widget.directives.badgeAttributesDirective, itemContext), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.badgeLabel, props: { ...slotContext, itemContext } }) });
|
|
17
18
|
}
|
|
18
19
|
function Badges({ slotContext }) {
|
|
19
20
|
const badges = [];
|
|
@@ -24,7 +25,7 @@ function Badges({ slotContext }) {
|
|
|
24
25
|
}
|
|
25
26
|
function SelectItem({ itemContext, slotContext }) {
|
|
26
27
|
const classname = classNames("dropdown-item", "position-relative", { "text-bg-primary": itemContext === slotContext.state.highlighted });
|
|
27
|
-
return /* @__PURE__ */ jsx("li", { className: classname, ...useDirective(slotContext.widget.directives.itemAttributesDirective, itemContext), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.
|
|
28
|
+
return /* @__PURE__ */ jsx("li", { className: classname, ...useDirective(slotContext.widget.directives.itemAttributesDirective, itemContext), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.itemLabel, props: { ...slotContext, itemContext } }) });
|
|
28
29
|
}
|
|
29
30
|
function Rows({ slotContext }) {
|
|
30
31
|
const {
|
|
@@ -35,8 +36,8 @@ function Rows({ slotContext }) {
|
|
|
35
36
|
}) });
|
|
36
37
|
}
|
|
37
38
|
const defaultConfig = {
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
badgeLabel: DefaultBadge,
|
|
40
|
+
itemLabel: DefaultItem
|
|
40
41
|
};
|
|
41
42
|
function Select(props) {
|
|
42
43
|
const [state, widget] = useWidgetWithConfig(createSelect, props, "select", defaultConfig);
|
|
@@ -71,5 +72,6 @@ function Select(props) {
|
|
|
71
72
|
}
|
|
72
73
|
export {
|
|
73
74
|
Select as S,
|
|
74
|
-
createSelect as c
|
|
75
|
+
createSelect as c,
|
|
76
|
+
getSelectDefaultConfig as g
|
|
75
77
|
};
|
|
@@ -7,6 +7,7 @@ const directive = require("@agnos-ui/react-headless/utils/directive");
|
|
|
7
7
|
const classNames = require("classnames");
|
|
8
8
|
const generated_config = require("./generated/config.cjs");
|
|
9
9
|
const createSelect = select.createSelect;
|
|
10
|
+
const getSelectDefaultConfig = select.getSelectDefaultConfig;
|
|
10
11
|
function DefaultBadge(slotContext) {
|
|
11
12
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: "" + slotContext.itemContext.item });
|
|
12
13
|
}
|
|
@@ -14,7 +15,7 @@ function DefaultItem(slotContext) {
|
|
|
14
15
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: "" + slotContext.itemContext.item });
|
|
15
16
|
}
|
|
16
17
|
function BadgeContainer({ itemContext, slotContext }) {
|
|
17
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.widget.directives.badgeAttributesDirective, itemContext), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.widget.directives.badgeAttributesDirective, itemContext), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.badgeLabel, props: { ...slotContext, itemContext } }) });
|
|
18
19
|
}
|
|
19
20
|
function Badges({ slotContext }) {
|
|
20
21
|
const badges = [];
|
|
@@ -25,7 +26,7 @@ function Badges({ slotContext }) {
|
|
|
25
26
|
}
|
|
26
27
|
function SelectItem({ itemContext, slotContext }) {
|
|
27
28
|
const classname = classNames("dropdown-item", "position-relative", { "text-bg-primary": itemContext === slotContext.state.highlighted });
|
|
28
|
-
return /* @__PURE__ */ jsxRuntime.jsx("li", { className: classname, ...directive.useDirective(slotContext.widget.directives.itemAttributesDirective, itemContext), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", { className: classname, ...directive.useDirective(slotContext.widget.directives.itemAttributesDirective, itemContext), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.itemLabel, props: { ...slotContext, itemContext } }) });
|
|
29
30
|
}
|
|
30
31
|
function Rows({ slotContext }) {
|
|
31
32
|
const {
|
|
@@ -36,8 +37,8 @@ function Rows({ slotContext }) {
|
|
|
36
37
|
}) });
|
|
37
38
|
}
|
|
38
39
|
const defaultConfig = {
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
badgeLabel: DefaultBadge,
|
|
41
|
+
itemLabel: DefaultItem
|
|
41
42
|
};
|
|
42
43
|
function Select(props) {
|
|
43
44
|
const [state, widget] = generated_config.useWidgetWithConfig(createSelect, props, "select", defaultConfig);
|
|
@@ -72,3 +73,4 @@ function Select(props) {
|
|
|
72
73
|
}
|
|
73
74
|
exports.Select = Select;
|
|
74
75
|
exports.createSelect = createSelect;
|
|
76
|
+
exports.getSelectDefaultConfig = getSelectDefaultConfig;
|
|
@@ -4,8 +4,9 @@ import { useWidgetWithConfig } from "./generated/config.js";
|
|
|
4
4
|
import { toSlotContextWidget } from "@agnos-ui/react-headless/types";
|
|
5
5
|
import React__default from "react";
|
|
6
6
|
import { Slot } from "@agnos-ui/react-headless/slot";
|
|
7
|
-
import { createSlider as createSlider$1 } from "@agnos-ui/core-bootstrap/components/slider";
|
|
7
|
+
import { createSlider as createSlider$1, getSliderDefaultConfig as getSliderDefaultConfig$1 } from "@agnos-ui/core-bootstrap/components/slider";
|
|
8
8
|
const createSlider = createSlider$1;
|
|
9
|
+
const getSliderDefaultConfig = getSliderDefaultConfig$1;
|
|
9
10
|
const DefaultSlotHandle = (slotContext) => {
|
|
10
11
|
return /* @__PURE__ */ jsx("button", { ...useDirective(slotContext.widget.directives.handleDirective, { item: slotContext.item }), children: " " });
|
|
11
12
|
};
|
|
@@ -20,17 +21,17 @@ const HandleLabelDisplay = ({
|
|
|
20
21
|
return /* @__PURE__ */ jsx("div", { ...useDirective(directive, { index }), children });
|
|
21
22
|
};
|
|
22
23
|
const MinMaxLabels = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23
|
-
/* @__PURE__ */ jsx("div", { ...useDirective(slotContext.widget.directives.minLabelDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.
|
|
24
|
-
/* @__PURE__ */ jsx("div", { ...useDirective(slotContext.widget.directives.maxLabelDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.
|
|
24
|
+
/* @__PURE__ */ jsx("div", { ...useDirective(slotContext.widget.directives.minLabelDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.min, ...slotContext } }) }),
|
|
25
|
+
/* @__PURE__ */ jsx("div", { ...useDirective(slotContext.widget.directives.maxLabelDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.max, ...slotContext } }) })
|
|
25
26
|
] });
|
|
26
27
|
const CombinedLabel = (slotContext) => /* @__PURE__ */ jsx("div", { ...useDirective(slotContext.widget.directives.combinedHandleLabelDisplayDirective), children: slotContext.state.rtl ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27
|
-
/* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.
|
|
28
|
+
/* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[1], ...slotContext } }),
|
|
28
29
|
" - ",
|
|
29
|
-
/* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.
|
|
30
|
+
/* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[0], ...slotContext } })
|
|
30
31
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
31
|
-
/* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.
|
|
32
|
+
/* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[0], ...slotContext } }),
|
|
32
33
|
" - ",
|
|
33
|
-
/* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.
|
|
34
|
+
/* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[1], ...slotContext } })
|
|
34
35
|
] }) });
|
|
35
36
|
const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36
37
|
slotContext.state.progressDisplayOptions.map((option, index) => /* @__PURE__ */ jsx(ProgressDisplay, { directive: slotContext.widget.directives.progressDisplayDirective, option }, index)),
|
|
@@ -38,22 +39,23 @@ const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { c
|
|
|
38
39
|
slotContext.state.showMinMaxLabels && /* @__PURE__ */ jsx(MinMaxLabels, { ...slotContext }),
|
|
39
40
|
slotContext.state.showValueLabels && slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsx(CombinedLabel, { ...slotContext }),
|
|
40
41
|
slotContext.state.sortedHandles.map((item, i) => /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
41
|
-
/* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.
|
|
42
|
-
slotContext.state.showValueLabels && !slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsx(HandleLabelDisplay, { directive: slotContext.widget.directives.handleLabelDisplayDirective, index: i, children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.
|
|
42
|
+
/* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.handle, props: { item, ...slotContext } }),
|
|
43
|
+
slotContext.state.showValueLabels && !slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsx(HandleLabelDisplay, { directive: slotContext.widget.directives.handleLabelDisplayDirective, index: i, children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.values[i], ...slotContext } }) })
|
|
43
44
|
] }, item.id))
|
|
44
45
|
] });
|
|
45
46
|
const defaultConfig = {
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
structure: DefaultSlotStructure,
|
|
48
|
+
handle: DefaultSlotHandle
|
|
48
49
|
};
|
|
49
50
|
function Slider(props) {
|
|
50
51
|
const [state, widget] = useWidgetWithConfig(createSlider, props, "slider", { ...defaultConfig });
|
|
51
52
|
const slotContext = { state, widget: toSlotContextWidget(widget) };
|
|
52
|
-
return /* @__PURE__ */ jsx("div", { ...useDirective(widget.directives.sliderDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: state.
|
|
53
|
+
return /* @__PURE__ */ jsx("div", { ...useDirective(widget.directives.sliderDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: state.structure, props: slotContext }) });
|
|
53
54
|
}
|
|
54
55
|
export {
|
|
55
56
|
DefaultSlotHandle as D,
|
|
56
57
|
Slider as S,
|
|
57
58
|
DefaultSlotStructure as a,
|
|
58
|
-
createSlider as c
|
|
59
|
+
createSlider as c,
|
|
60
|
+
getSliderDefaultConfig as g
|
|
59
61
|
};
|
|
@@ -7,6 +7,7 @@ const React = require("react");
|
|
|
7
7
|
const slot = require("@agnos-ui/react-headless/slot");
|
|
8
8
|
const slider = require("@agnos-ui/core-bootstrap/components/slider");
|
|
9
9
|
const createSlider = slider.createSlider;
|
|
10
|
+
const getSliderDefaultConfig = slider.getSliderDefaultConfig;
|
|
10
11
|
const DefaultSlotHandle = (slotContext) => {
|
|
11
12
|
return /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirective(slotContext.widget.directives.handleDirective, { item: slotContext.item }), children: " " });
|
|
12
13
|
};
|
|
@@ -21,17 +22,17 @@ const HandleLabelDisplay = ({
|
|
|
21
22
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(directive$1, { index }), children });
|
|
22
23
|
};
|
|
23
24
|
const MinMaxLabels = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
24
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.widget.directives.minLabelDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.
|
|
25
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.widget.directives.maxLabelDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.
|
|
25
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.widget.directives.minLabelDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.min, ...slotContext } }) }),
|
|
26
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.widget.directives.maxLabelDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.max, ...slotContext } }) })
|
|
26
27
|
] });
|
|
27
28
|
const CombinedLabel = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.widget.directives.combinedHandleLabelDisplayDirective), children: slotContext.state.rtl ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
28
|
-
/* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.
|
|
29
|
+
/* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[1], ...slotContext } }),
|
|
29
30
|
" - ",
|
|
30
|
-
/* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.
|
|
31
|
+
/* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[0], ...slotContext } })
|
|
31
32
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
32
|
-
/* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.
|
|
33
|
+
/* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[0], ...slotContext } }),
|
|
33
34
|
" - ",
|
|
34
|
-
/* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.
|
|
35
|
+
/* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[1], ...slotContext } })
|
|
35
36
|
] }) });
|
|
36
37
|
const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
37
38
|
slotContext.state.progressDisplayOptions.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(ProgressDisplay, { directive: slotContext.widget.directives.progressDisplayDirective, option }, index)),
|
|
@@ -39,20 +40,21 @@ const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs(js
|
|
|
39
40
|
slotContext.state.showMinMaxLabels && /* @__PURE__ */ jsxRuntime.jsx(MinMaxLabels, { ...slotContext }),
|
|
40
41
|
slotContext.state.showValueLabels && slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsxRuntime.jsx(CombinedLabel, { ...slotContext }),
|
|
41
42
|
slotContext.state.sortedHandles.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
|
|
42
|
-
/* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.
|
|
43
|
-
slotContext.state.showValueLabels && !slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsxRuntime.jsx(HandleLabelDisplay, { directive: slotContext.widget.directives.handleLabelDisplayDirective, index: i, children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.
|
|
43
|
+
/* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.handle, props: { item, ...slotContext } }),
|
|
44
|
+
slotContext.state.showValueLabels && !slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsxRuntime.jsx(HandleLabelDisplay, { directive: slotContext.widget.directives.handleLabelDisplayDirective, index: i, children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.values[i], ...slotContext } }) })
|
|
44
45
|
] }, item.id))
|
|
45
46
|
] });
|
|
46
47
|
const defaultConfig = {
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
structure: DefaultSlotStructure,
|
|
49
|
+
handle: DefaultSlotHandle
|
|
49
50
|
};
|
|
50
51
|
function Slider(props) {
|
|
51
52
|
const [state, widget] = generated_config.useWidgetWithConfig(createSlider, props, "slider", { ...defaultConfig });
|
|
52
53
|
const slotContext = { state, widget: types.toSlotContextWidget(widget) };
|
|
53
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(widget.directives.sliderDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.
|
|
54
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(widget.directives.sliderDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.structure, props: slotContext }) });
|
|
54
55
|
}
|
|
55
56
|
exports.DefaultSlotHandle = DefaultSlotHandle;
|
|
56
57
|
exports.DefaultSlotStructure = DefaultSlotStructure;
|
|
57
58
|
exports.Slider = Slider;
|
|
58
59
|
exports.createSlider = createSlider;
|
|
60
|
+
exports.getSliderDefaultConfig = getSliderDefaultConfig;
|