@optiaxiom/proteus 0.3.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/_virtual/_openai-shim-script.js +3 -2
- package/dist/esm/assets/src/proteus-chart/{ProteusChart.css.ts.vanilla-DNE5j3uT.css → ProteusChart.css.ts.vanilla-yGx8JdKz.css} +2 -2
- package/dist/esm/assets/src/proteus-chart/{ProteusChartTooltipContent.css.ts.vanilla-DM8u1icS.css → ProteusChartTooltipContent.css.ts.vanilla-HapBe2oo.css} +2 -2
- package/dist/esm/assets/src/proteus-document/{ProteusDocumentShell.css.ts.vanilla-DjZJuQ2A.css → ProteusDocumentShell.css.ts.vanilla-BPytQ9pT.css} +2 -2
- package/dist/esm/assets/src/proteus-image-carousel/{ProteusImageCarousel.css.ts.vanilla-CIwMJ4Cg.css → ProteusImageCarousel.css.ts.vanilla-DnlXoyv1.css} +2 -2
- package/dist/esm/assets/src/proteus-question/{ProteusQuestion.css.ts.vanilla-DiCe_bxf.css → ProteusQuestion.css.ts.vanilla-CpDgoW0l.css} +2 -2
- package/dist/esm/hooks/useEffectEvent.js +11 -10
- package/dist/esm/hooks/useObserveValue.js +24 -30
- package/dist/esm/icons/IconAngleLeft.js +13 -19
- package/dist/esm/icons/IconAngleRight.js +13 -19
- package/dist/esm/icons/IconX.js +10 -18
- package/dist/esm/icons/withIcon.js +17 -28
- package/dist/esm/index.js +22 -17
- package/dist/esm/proteus-action/ProteusAction.js +44 -39
- package/dist/esm/proteus-bridge/ProteusBridge.js +71 -85
- package/dist/esm/proteus-card-link/ProteusCardLink.js +24 -37
- package/dist/esm/proteus-chart/ProteusChart-css.js +14 -5
- package/dist/esm/proteus-chart/ProteusChart.js +86 -84
- package/dist/esm/proteus-chart/ProteusChartContext.js +3 -3
- package/dist/esm/proteus-chart/ProteusChartTooltipContent-css.js +23 -6
- package/dist/esm/proteus-chart/ProteusChartTooltipContent.js +52 -66
- package/dist/esm/proteus-data-table/ProteusDataTable.js +28 -29
- package/dist/esm/proteus-date-input/ProteusDateInput.js +23 -0
- package/dist/esm/proteus-document/ProteusDocumentContext.js +4 -3
- package/dist/esm/proteus-document/ProteusDocumentPathContext.js +6 -5
- package/dist/esm/proteus-document/ProteusDocumentRenderer.js +25 -33
- package/dist/esm/proteus-document/ProteusDocumentShell-css.js +32 -6
- package/dist/esm/proteus-document/ProteusDocumentShell.js +226 -219
- package/dist/esm/proteus-document/getProteusValue.js +28 -42
- package/dist/esm/proteus-document/resolveProteusProp.js +31 -49
- package/dist/esm/proteus-document/resolveProteusValue.js +73 -136
- package/dist/esm/proteus-document/schemas.js +42 -45
- package/dist/esm/proteus-document/useResolveProteusValues.js +10 -16
- package/dist/esm/proteus-element/ProteusElement.js +114 -180
- package/dist/esm/proteus-federated/ProteusFederated.js +51 -52
- package/dist/esm/proteus-file-icon/ProteusFileIcon.js +29 -38
- package/dist/esm/proteus-file-upload/ProteusFileUpload.js +107 -133
- package/dist/esm/proteus-image/ProteusImage.js +99 -106
- package/dist/esm/proteus-image/downloadFile.js +3 -2
- package/dist/esm/proteus-image-carousel/ProteusImageCarousel-css.js +49 -11
- package/dist/esm/proteus-image-carousel/ProteusImageCarousel.js +151 -163
- package/dist/esm/proteus-input/ProteusInput.js +19 -27
- package/dist/esm/proteus-length/ProteusLength.js +10 -0
- package/dist/esm/proteus-map/ProteusMap.js +18 -31
- package/dist/esm/proteus-map-index/ProteusMapIndex.js +11 -0
- package/dist/esm/proteus-pill-menu/ProteusPillMenu.js +65 -0
- package/dist/esm/proteus-pill-menu/useInputValueChangeInteraction.js +36 -0
- package/dist/esm/proteus-question/ProteusQuestion-css.js +40 -8
- package/dist/esm/proteus-question/ProteusQuestion.js +324 -400
- package/dist/esm/proteus-select/ProteusSelect.js +25 -40
- package/dist/esm/proteus-show/ProteusShow.js +10 -18
- package/dist/esm/proteus-switch/ProteusSwitch.js +33 -36
- package/dist/esm/proteus-textarea/ProteusTextarea.js +18 -27
- package/dist/esm/proteus-value/ProteusValue.js +4 -4
- package/dist/esm/schema/public-schema.js +4537 -0
- package/dist/esm/schema/runtime-schema.js +4460 -0
- package/dist/esm/spec.js +5 -1
- package/dist/esm/use-proteus-value/useProteusValue.js +8 -12
- package/dist/index.d.ts +516 -347
- package/dist/spec.d.ts +5 -9952
- package/package.json +5 -5
- package/dist/esm/icons/IconCalendar.js +0 -20
- package/dist/esm/schema/public-schema.json.js +0 -9041
- package/dist/esm/schema/runtime-schema.json.js +0 -8974
|
@@ -1,44 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
function ProteusSelect({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
...props,
|
|
28
|
-
onValueChange: (value2) => {
|
|
29
|
-
if (readOnly) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (props.name) {
|
|
33
|
-
onDataChange?.(`${parentPath}/${props.name}`, value2);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
options,
|
|
37
|
-
value,
|
|
38
|
-
children
|
|
39
|
-
}
|
|
40
|
-
);
|
|
2
|
+
import { useProteusDocumentContext } from "../proteus-document/ProteusDocumentContext.js";
|
|
3
|
+
import { useProteusDocumentPathContext } from "../proteus-document/ProteusDocumentPathContext.js";
|
|
4
|
+
import { useProteusValue } from "../use-proteus-value/useProteusValue.js";
|
|
5
|
+
import { Select } from "@optiaxiom/react";
|
|
6
|
+
import { useRef } from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
//#region src/proteus-select/ProteusSelect.tsx
|
|
9
|
+
function ProteusSelect({ children, options = [], ...props }) {
|
|
10
|
+
const { onDataChange, readOnly } = useProteusDocumentContext("@optiaxiom/proteus/ProteusSelect");
|
|
11
|
+
const { path: parentPath } = useProteusDocumentPathContext("@optiaxiom/proteus/ProteusSelect");
|
|
12
|
+
const optionsRef = useRef(options);
|
|
13
|
+
optionsRef.current = options;
|
|
14
|
+
const resolved = useProteusValue({ path: props.name ?? "" });
|
|
15
|
+
const value = props.name ? String(resolved ?? options[0]?.value ?? "") : options[0]?.value ?? "";
|
|
16
|
+
return /* @__PURE__ */ jsx(Select, {
|
|
17
|
+
...props,
|
|
18
|
+
onValueChange: (value) => {
|
|
19
|
+
if (readOnly) return;
|
|
20
|
+
if (props.name) onDataChange?.(`${parentPath}/${props.name}`, value);
|
|
21
|
+
},
|
|
22
|
+
options,
|
|
23
|
+
value,
|
|
24
|
+
children
|
|
25
|
+
});
|
|
41
26
|
}
|
|
42
27
|
ProteusSelect.displayName = "@optiaxiom/proteus/ProteusSelect";
|
|
43
|
-
|
|
28
|
+
//#endregion
|
|
44
29
|
export { ProteusSelect };
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
2
|
+
import { useProteusDocumentContext } from "../proteus-document/ProteusDocumentContext.js";
|
|
3
|
+
import { useProteusDocumentPathContext } from "../proteus-document/ProteusDocumentPathContext.js";
|
|
4
|
+
import { evaluateCondition } from "../proteus-document/resolveProteusValue.js";
|
|
5
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/proteus-show/ProteusShow.tsx
|
|
7
7
|
function ProteusShow({ children, when }) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const conditions = Array.isArray(when) ? when : [when];
|
|
13
|
-
const shouldShow = conditions.every(
|
|
14
|
-
(condition) => evaluateCondition(condition, data, parentPath, mapIndices)
|
|
15
|
-
);
|
|
16
|
-
if (!shouldShow) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
8
|
+
const { data } = useProteusDocumentContext("@optiaxiom/proteus/ProteusShow");
|
|
9
|
+
const { mapIndices, path: parentPath } = useProteusDocumentPathContext("@optiaxiom/proteus/ProteusShow");
|
|
10
|
+
if (!(Array.isArray(when) ? when : [when]).every((condition) => evaluateCondition(condition, data, parentPath, mapIndices))) return null;
|
|
11
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
20
12
|
}
|
|
21
13
|
ProteusShow.displayName = "@optiaxiom/proteus/ProteusShow";
|
|
22
|
-
|
|
14
|
+
//#endregion
|
|
23
15
|
export { ProteusShow };
|
|
@@ -1,41 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
2
|
+
import { useProteusDocumentContext } from "../proteus-document/ProteusDocumentContext.js";
|
|
3
|
+
import { useProteusDocumentPathContext } from "../proteus-document/ProteusDocumentPathContext.js";
|
|
4
|
+
import { useProteusValue } from "../use-proteus-value/useProteusValue.js";
|
|
5
|
+
import { Switch } from "@optiaxiom/react";
|
|
6
|
+
import { useEffect } from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
//#region src/proteus-switch/ProteusSwitch.tsx
|
|
9
9
|
function ProteusSwitch(props) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
);
|
|
10
|
+
const { onDataChange, readOnly } = useProteusDocumentContext("@optiaxiom/proteus/ProteusSwitch");
|
|
11
|
+
const { path: parentPath } = useProteusDocumentPathContext("@optiaxiom/proteus/ProteusSwitch");
|
|
12
|
+
const dataValue = useProteusValue({ path: props.name ?? "" });
|
|
13
|
+
const hasValue = props.value !== void 0;
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (hasValue && props.name && (dataValue === null || dataValue === void 0)) onDataChange?.(`${parentPath}/${props.name}`, "No");
|
|
16
|
+
}, [
|
|
17
|
+
dataValue,
|
|
18
|
+
hasValue,
|
|
19
|
+
onDataChange,
|
|
20
|
+
parentPath,
|
|
21
|
+
props.name
|
|
22
|
+
]);
|
|
23
|
+
const checked = hasValue ? dataValue === props.value : Boolean(dataValue);
|
|
24
|
+
return /* @__PURE__ */ jsx(Switch, {
|
|
25
|
+
...props,
|
|
26
|
+
checked: props.name ? checked : false,
|
|
27
|
+
disabled: readOnly,
|
|
28
|
+
onCheckedChange: (newChecked) => {
|
|
29
|
+
if (props.name) {
|
|
30
|
+
const newValue = hasValue ? newChecked ? props.value : "No" : newChecked;
|
|
31
|
+
onDataChange?.(`${parentPath}/${props.name}`, newValue);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
38
35
|
}
|
|
39
36
|
ProteusSwitch.displayName = "@optiaxiom/proteus/ProteusSwitch";
|
|
40
|
-
|
|
37
|
+
//#endregion
|
|
41
38
|
export { ProteusSwitch };
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
2
|
+
import { useProteusDocumentContext } from "../proteus-document/ProteusDocumentContext.js";
|
|
3
|
+
import { useProteusDocumentPathContext } from "../proteus-document/ProteusDocumentPathContext.js";
|
|
4
|
+
import { useProteusValue } from "../use-proteus-value/useProteusValue.js";
|
|
5
|
+
import { Textarea } from "@optiaxiom/react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/proteus-textarea/ProteusTextarea.tsx
|
|
8
8
|
function ProteusTextarea(props) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
onValueChange: (value2) => {
|
|
21
|
-
if (props.name) {
|
|
22
|
-
onDataChange?.(`${parentPath}/${props.name}`, value2);
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
readOnly,
|
|
26
|
-
value: props.name ? String(value ?? "") : void 0
|
|
27
|
-
}
|
|
28
|
-
);
|
|
9
|
+
const { onDataChange, readOnly } = useProteusDocumentContext("@optiaxiom/proteus/ProteusTextarea");
|
|
10
|
+
const { path: parentPath } = useProteusDocumentPathContext("@optiaxiom/proteus/ProteusTextarea");
|
|
11
|
+
const value = useProteusValue({ path: props.name ?? "" });
|
|
12
|
+
return /* @__PURE__ */ jsx(Textarea, {
|
|
13
|
+
...props,
|
|
14
|
+
onValueChange: (value) => {
|
|
15
|
+
if (props.name) onDataChange?.(`${parentPath}/${props.name}`, value);
|
|
16
|
+
},
|
|
17
|
+
readOnly,
|
|
18
|
+
value: props.name ? String(value ?? "") : void 0
|
|
19
|
+
});
|
|
29
20
|
}
|
|
30
21
|
ProteusTextarea.displayName = "@optiaxiom/proteus/ProteusTextarea";
|
|
31
|
-
|
|
22
|
+
//#endregion
|
|
32
23
|
export { ProteusTextarea };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useProteusValue } from
|
|
3
|
-
|
|
2
|
+
import { useProteusValue } from "../use-proteus-value/useProteusValue.js";
|
|
3
|
+
//#region src/proteus-value/ProteusValue.tsx
|
|
4
4
|
function ProteusValue(props) {
|
|
5
|
-
|
|
5
|
+
return useProteusValue(props);
|
|
6
6
|
}
|
|
7
7
|
ProteusValue.displayName = "@optiaxiom/proteus/ProteusValue";
|
|
8
|
-
|
|
8
|
+
//#endregion
|
|
9
9
|
export { ProteusValue };
|