@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260903063823 → 0.8.1-dev.20260905065929
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/AvatarViewClient-4GOKYZYT.mjs +108 -0
- package/dist/AvatarViewClient-S3GJZZZS.mjs +106 -0
- package/dist/{DataBindingControls-GWNAJ7PR.mjs → DataBindingControls-UUDERFAD.mjs} +1 -1
- package/dist/{Slider-554BKC7N.mjs → Slider-6GJY6M4D.mjs} +8 -6
- package/dist/{Slider-PEIVH6A5.mjs → Slider-ZA2GRRGS.mjs} +10 -4
- package/dist/{chunk-Q3LFGHLM.mjs → chunk-7JWVEYJY.mjs} +1 -1
- package/dist/index.js +385 -316
- package/dist/index.mjs +303 -349
- package/dist/server.js +298 -229
- package/dist/server.mjs +133 -179
- package/package.json +1 -1
- package/dist/{InputControlClient-GRH7VSJR.mjs → InputControlClient-5NX4CEZB.mjs} +5 -5
- package/dist/{Pagination-PGAK7KDA.mjs → Pagination-CQKMBXXJ.mjs} +1 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
"use client";
|
|
4
|
+
import {
|
|
5
|
+
AssetUtility_default
|
|
6
|
+
} from "./chunk-UPCAOGEY.mjs";
|
|
7
|
+
|
|
8
|
+
// src/components/controls/view/AvatarViewClient.tsx
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var AVATAR_COLORS = [
|
|
12
|
+
"bg-error-strong",
|
|
13
|
+
"bg-accent-base",
|
|
14
|
+
"bg-warning-base",
|
|
15
|
+
"bg-success-base",
|
|
16
|
+
"bg-info-base",
|
|
17
|
+
"bg-primary-base",
|
|
18
|
+
"bg-secondary-base"
|
|
19
|
+
];
|
|
20
|
+
var getAvatarColor = (text) => {
|
|
21
|
+
let hash = 0;
|
|
22
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
23
|
+
hash = hash * 31 + text.charCodeAt(i) >>> 0;
|
|
24
|
+
}
|
|
25
|
+
return AVATAR_COLORS[hash % AVATAR_COLORS.length];
|
|
26
|
+
};
|
|
27
|
+
var getInitials = (text) => {
|
|
28
|
+
const words = text.trim().split(/\s+/).filter(Boolean);
|
|
29
|
+
if (words.length === 0) {
|
|
30
|
+
return "?";
|
|
31
|
+
}
|
|
32
|
+
if (words.length === 1) {
|
|
33
|
+
return words[0].slice(0, 2).toUpperCase();
|
|
34
|
+
}
|
|
35
|
+
return `${words[0][0]}${words[words.length - 1][0]}`.toUpperCase();
|
|
36
|
+
};
|
|
37
|
+
var getContactImageInfo = (text) => {
|
|
38
|
+
if (!text.includes("-")) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const parts = text.split("-");
|
|
42
|
+
if (parts.length <= 1) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const first = parts[0].trim();
|
|
46
|
+
if (!/^\d+$/.test(first)) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
contactId: first,
|
|
51
|
+
name: parts.slice(1).join("-").trim() || text
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
var AvatarViewClient = (props) => {
|
|
55
|
+
const text = props.value === null || props.value === void 0 ? "" : String(props.value).trim();
|
|
56
|
+
const [imageFailed, setImageFailed] = React.useState(false);
|
|
57
|
+
React.useEffect(() => {
|
|
58
|
+
setImageFailed(false);
|
|
59
|
+
}, [text, props.assetBaseUrl]);
|
|
60
|
+
if (!text) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const size = props.width ?? "1.75rem";
|
|
64
|
+
const contactInfo = getContactImageInfo(text);
|
|
65
|
+
const imageUrl = contactInfo ? AssetUtility_default.resolveUrl(
|
|
66
|
+
props.assetBaseUrl,
|
|
67
|
+
`itemassets/contacts/contact-${contactInfo.contactId}`
|
|
68
|
+
) : void 0;
|
|
69
|
+
const displayName = contactInfo?.name ?? text;
|
|
70
|
+
if (imageUrl && !imageFailed) {
|
|
71
|
+
return /* @__PURE__ */ jsx(
|
|
72
|
+
"img",
|
|
73
|
+
{
|
|
74
|
+
className: "avatar-view inline-block flex-shrink-0 rounded-full object-cover select-none",
|
|
75
|
+
src: imageUrl,
|
|
76
|
+
alt: displayName,
|
|
77
|
+
title: displayName,
|
|
78
|
+
"aria-label": displayName,
|
|
79
|
+
loading: "lazy",
|
|
80
|
+
onError: () => setImageFailed(true),
|
|
81
|
+
style: {
|
|
82
|
+
width: size,
|
|
83
|
+
height: size
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
return /* @__PURE__ */ jsx(
|
|
89
|
+
"span",
|
|
90
|
+
{
|
|
91
|
+
className: `avatar-view inline-flex flex-shrink-0 items-center justify-center rounded-full font-semibold uppercase select-none overflow-hidden ${getAvatarColor(displayName)}`,
|
|
92
|
+
title: displayName,
|
|
93
|
+
"aria-label": displayName,
|
|
94
|
+
style: {
|
|
95
|
+
width: size,
|
|
96
|
+
height: size,
|
|
97
|
+
fontSize: "0.6875rem",
|
|
98
|
+
letterSpacing: "0.02em",
|
|
99
|
+
lineHeight: 1
|
|
100
|
+
},
|
|
101
|
+
children: getInitials(displayName)
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
var AvatarViewClient_default = AvatarViewClient;
|
|
106
|
+
export {
|
|
107
|
+
AvatarViewClient_default as default
|
|
108
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
AssetUtility_default
|
|
4
|
+
} from "./chunk-TQ6BXQ3A.mjs";
|
|
5
|
+
|
|
6
|
+
// src/components/controls/view/AvatarViewClient.tsx
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var AVATAR_COLORS = [
|
|
10
|
+
"bg-error-strong",
|
|
11
|
+
"bg-accent-base",
|
|
12
|
+
"bg-warning-base",
|
|
13
|
+
"bg-success-base",
|
|
14
|
+
"bg-info-base",
|
|
15
|
+
"bg-primary-base",
|
|
16
|
+
"bg-secondary-base"
|
|
17
|
+
];
|
|
18
|
+
var getAvatarColor = (text) => {
|
|
19
|
+
let hash = 0;
|
|
20
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
21
|
+
hash = hash * 31 + text.charCodeAt(i) >>> 0;
|
|
22
|
+
}
|
|
23
|
+
return AVATAR_COLORS[hash % AVATAR_COLORS.length];
|
|
24
|
+
};
|
|
25
|
+
var getInitials = (text) => {
|
|
26
|
+
const words = text.trim().split(/\s+/).filter(Boolean);
|
|
27
|
+
if (words.length === 0) {
|
|
28
|
+
return "?";
|
|
29
|
+
}
|
|
30
|
+
if (words.length === 1) {
|
|
31
|
+
return words[0].slice(0, 2).toUpperCase();
|
|
32
|
+
}
|
|
33
|
+
return `${words[0][0]}${words[words.length - 1][0]}`.toUpperCase();
|
|
34
|
+
};
|
|
35
|
+
var getContactImageInfo = (text) => {
|
|
36
|
+
if (!text.includes("-")) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
const parts = text.split("-");
|
|
40
|
+
if (parts.length <= 1) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const first = parts[0].trim();
|
|
44
|
+
if (!/^\d+$/.test(first)) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
contactId: first,
|
|
49
|
+
name: parts.slice(1).join("-").trim() || text
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
var AvatarViewClient = (props) => {
|
|
53
|
+
const text = props.value === null || props.value === void 0 ? "" : String(props.value).trim();
|
|
54
|
+
const [imageFailed, setImageFailed] = React.useState(false);
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
setImageFailed(false);
|
|
57
|
+
}, [text, props.assetBaseUrl]);
|
|
58
|
+
if (!text) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const size = props.width ?? "1.75rem";
|
|
62
|
+
const contactInfo = getContactImageInfo(text);
|
|
63
|
+
const imageUrl = contactInfo ? AssetUtility_default.resolveUrl(
|
|
64
|
+
props.assetBaseUrl,
|
|
65
|
+
`itemassets/contacts/contact-${contactInfo.contactId}`
|
|
66
|
+
) : void 0;
|
|
67
|
+
const displayName = contactInfo?.name ?? text;
|
|
68
|
+
if (imageUrl && !imageFailed) {
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
"img",
|
|
71
|
+
{
|
|
72
|
+
className: "avatar-view inline-block flex-shrink-0 rounded-full object-cover select-none",
|
|
73
|
+
src: imageUrl,
|
|
74
|
+
alt: displayName,
|
|
75
|
+
title: displayName,
|
|
76
|
+
"aria-label": displayName,
|
|
77
|
+
loading: "lazy",
|
|
78
|
+
onError: () => setImageFailed(true),
|
|
79
|
+
style: {
|
|
80
|
+
width: size,
|
|
81
|
+
height: size
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
"span",
|
|
88
|
+
{
|
|
89
|
+
className: `avatar-view inline-flex flex-shrink-0 items-center justify-center rounded-full font-semibold uppercase select-none overflow-hidden ${getAvatarColor(displayName)}`,
|
|
90
|
+
title: displayName,
|
|
91
|
+
"aria-label": displayName,
|
|
92
|
+
style: {
|
|
93
|
+
width: size,
|
|
94
|
+
height: size,
|
|
95
|
+
fontSize: "0.6875rem",
|
|
96
|
+
letterSpacing: "0.02em",
|
|
97
|
+
lineHeight: 1
|
|
98
|
+
},
|
|
99
|
+
children: getInitials(displayName)
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
var AvatarViewClient_default = AvatarViewClient;
|
|
104
|
+
export {
|
|
105
|
+
AvatarViewClient_default as default
|
|
106
|
+
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
"use client";
|
|
4
|
-
|
|
5
3
|
// src/components/Slider.tsx
|
|
6
4
|
import React, { useState, useEffect, Children, cloneElement } from "react";
|
|
7
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -20,7 +18,8 @@ var Slider = ({
|
|
|
20
18
|
dotInactiveClassName = "bg-gray-600",
|
|
21
19
|
gap,
|
|
22
20
|
pillStyle = "cumulative",
|
|
23
|
-
progressPosition = "bottom"
|
|
21
|
+
progressPosition = "bottom",
|
|
22
|
+
scrollByColumns = false
|
|
24
23
|
}) => {
|
|
25
24
|
const [currentSlide, setCurrentSlide] = useState(0);
|
|
26
25
|
const [transition, setTransition] = useState(true);
|
|
@@ -53,7 +52,8 @@ var Slider = ({
|
|
|
53
52
|
return () => clearInterval(timer);
|
|
54
53
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
55
54
|
const totalSlides = Children.count(children);
|
|
56
|
-
const maxSlide = totalSlides - slidesToShowState;
|
|
55
|
+
const maxSlide = Math.max(0, totalSlides - slidesToShowState);
|
|
56
|
+
const step = scrollByColumns ? typeof slidesToShowState === "number" && slidesToShowState > 0 ? Math.floor(slidesToShowState) : 1 : 1;
|
|
57
57
|
const nextSlide = () => {
|
|
58
58
|
if (currentSlide >= maxSlide) {
|
|
59
59
|
if (infinite_scroll) {
|
|
@@ -62,7 +62,8 @@ var Slider = ({
|
|
|
62
62
|
}
|
|
63
63
|
} else {
|
|
64
64
|
setTransition(true);
|
|
65
|
-
|
|
65
|
+
const nextIndex = currentSlide + step;
|
|
66
|
+
setCurrentSlide(nextIndex > maxSlide ? maxSlide : nextIndex);
|
|
66
67
|
}
|
|
67
68
|
};
|
|
68
69
|
const prevSlide = () => {
|
|
@@ -73,7 +74,8 @@ var Slider = ({
|
|
|
73
74
|
}
|
|
74
75
|
} else {
|
|
75
76
|
setTransition(true);
|
|
76
|
-
|
|
77
|
+
const prevIndex = currentSlide - step;
|
|
78
|
+
setCurrentSlide(prevIndex < 0 ? 0 : prevIndex);
|
|
77
79
|
}
|
|
78
80
|
};
|
|
79
81
|
const goToSlide = (index) => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
"use client";
|
|
4
|
+
|
|
3
5
|
// src/components/Slider.tsx
|
|
4
6
|
import React, { useState, useEffect, Children, cloneElement } from "react";
|
|
5
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -18,7 +20,8 @@ var Slider = ({
|
|
|
18
20
|
dotInactiveClassName = "bg-gray-600",
|
|
19
21
|
gap,
|
|
20
22
|
pillStyle = "cumulative",
|
|
21
|
-
progressPosition = "bottom"
|
|
23
|
+
progressPosition = "bottom",
|
|
24
|
+
scrollByColumns = false
|
|
22
25
|
}) => {
|
|
23
26
|
const [currentSlide, setCurrentSlide] = useState(0);
|
|
24
27
|
const [transition, setTransition] = useState(true);
|
|
@@ -51,7 +54,8 @@ var Slider = ({
|
|
|
51
54
|
return () => clearInterval(timer);
|
|
52
55
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
53
56
|
const totalSlides = Children.count(children);
|
|
54
|
-
const maxSlide = totalSlides - slidesToShowState;
|
|
57
|
+
const maxSlide = Math.max(0, totalSlides - slidesToShowState);
|
|
58
|
+
const step = scrollByColumns ? typeof slidesToShowState === "number" && slidesToShowState > 0 ? Math.floor(slidesToShowState) : 1 : 1;
|
|
55
59
|
const nextSlide = () => {
|
|
56
60
|
if (currentSlide >= maxSlide) {
|
|
57
61
|
if (infinite_scroll) {
|
|
@@ -60,7 +64,8 @@ var Slider = ({
|
|
|
60
64
|
}
|
|
61
65
|
} else {
|
|
62
66
|
setTransition(true);
|
|
63
|
-
|
|
67
|
+
const nextIndex = currentSlide + step;
|
|
68
|
+
setCurrentSlide(nextIndex > maxSlide ? maxSlide : nextIndex);
|
|
64
69
|
}
|
|
65
70
|
};
|
|
66
71
|
const prevSlide = () => {
|
|
@@ -71,7 +76,8 @@ var Slider = ({
|
|
|
71
76
|
}
|
|
72
77
|
} else {
|
|
73
78
|
setTransition(true);
|
|
74
|
-
|
|
79
|
+
const prevIndex = currentSlide - step;
|
|
80
|
+
setCurrentSlide(prevIndex < 0 ? 0 : prevIndex);
|
|
75
81
|
}
|
|
76
82
|
};
|
|
77
83
|
const goToSlide = (index) => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
// src/components/controls/edit/InputControl.tsx
|
|
5
5
|
import dynamic from "next/dynamic";
|
|
6
|
-
var InputControl = dynamic(() => import("./InputControlClient-
|
|
6
|
+
var InputControl = dynamic(() => import("./InputControlClient-5NX4CEZB.mjs"), {
|
|
7
7
|
ssr: false
|
|
8
8
|
});
|
|
9
9
|
var InputControl_default = InputControl;
|