@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260722101954

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.
Files changed (60) hide show
  1. package/dist/CopyButton-UPJPMJUB.mjs +57 -0
  2. package/dist/CopyButton-XONTQQW7.mjs +55 -0
  3. package/dist/DateTimeViewClient-22GW4AD7.mjs +14 -0
  4. package/dist/DateTimeViewClient-K5FE5VSN.mjs +14 -0
  5. package/dist/DateTimeViewClient-M7V35KUW.mjs +16 -0
  6. package/dist/DateTimeViewClient-R3M6ISVK.mjs +16 -0
  7. package/dist/DateViewClient-4CTEMOMJ.mjs +7 -0
  8. package/dist/DateViewClient-ELEHLGWS.mjs +7 -0
  9. package/dist/DateViewClient-JBS5UXMD.mjs +9 -0
  10. package/dist/DateViewClient-VLTRN47D.mjs +9 -0
  11. package/dist/EnterAnimationClient-4OKXLKSA.mjs +45 -0
  12. package/dist/EnterAnimationClient-ZN3NLFNO.mjs +47 -0
  13. package/dist/HlsPlayer-57543DTW.mjs +599 -0
  14. package/dist/HlsPlayer-5AWFZ2P6.mjs +601 -0
  15. package/dist/IframeClient-J22NMEVY.mjs +96 -0
  16. package/dist/IframeClient-RGJFZ5P2.mjs +98 -0
  17. package/dist/InputControlClient-7NS4QUWO.mjs +677 -0
  18. package/dist/InputControlClient-AZRPSTUZ.mjs +677 -0
  19. package/dist/InputControlClient-BUOYZNWQ.mjs +675 -0
  20. package/dist/InputControlClient-HIZOJLKW.mjs +677 -0
  21. package/dist/LinkNodeButton-AOEDCCL7.mjs +227 -0
  22. package/dist/LinkNodeButton-BIZA2NPE.mjs +225 -0
  23. package/dist/LinkNodeButton-LX3KKGZY.mjs +173 -0
  24. package/dist/LinkNodeButton-U7T2NP22.mjs +374 -0
  25. package/dist/Pagination-6OFACRMQ.mjs +229 -0
  26. package/dist/Pagination-NCJCOYHF.mjs +181 -0
  27. package/dist/Pagination-OQT7Q2XO.mjs +183 -0
  28. package/dist/Pagination-T7YN2OMV.mjs +183 -0
  29. package/dist/Slider-554BKC7N.mjs +322 -0
  30. package/dist/Slider-PEIVH6A5.mjs +320 -0
  31. package/dist/chunk-23WJE3YB.mjs +253 -0
  32. package/dist/chunk-3GWLDT7C.mjs +204 -0
  33. package/dist/chunk-3R4VVVNK.mjs +903 -0
  34. package/dist/chunk-56HSDML5.mjs +22 -0
  35. package/dist/chunk-5GHPW7SJ.mjs +111 -0
  36. package/dist/chunk-7ZFZLN56.mjs +903 -0
  37. package/dist/chunk-DBHUCH4B.mjs +109 -0
  38. package/dist/chunk-DKW4DXCU.mjs +120 -0
  39. package/dist/chunk-FI2KJBK2.mjs +110 -0
  40. package/dist/chunk-IMNQO57B.mjs +25 -0
  41. package/dist/chunk-JKP4XOZB.mjs +214 -0
  42. package/dist/chunk-OGGIS4AN.mjs +201 -0
  43. package/dist/chunk-RHVNJMS4.mjs +251 -0
  44. package/dist/chunk-SPRVN5IM.mjs +118 -0
  45. package/dist/chunk-TVL6KVD5.mjs +229 -0
  46. package/dist/chunk-UFKPTMM7.mjs +199 -0
  47. package/dist/chunk-WEV5U33G.mjs +207 -0
  48. package/dist/chunk-X3YSXTD2.mjs +201 -0
  49. package/dist/chunk-XG6SXZWP.mjs +115 -0
  50. package/dist/chunk-YBNWT4TV.mjs +123 -0
  51. package/dist/chunk-YG6FKKQJ.mjs +900 -0
  52. package/dist/index.d.mts +456 -0
  53. package/dist/index.d.ts +456 -0
  54. package/dist/index.js +8566 -0
  55. package/dist/index.mjs +4285 -0
  56. package/dist/server.d.mts +113 -0
  57. package/dist/server.d.ts +113 -0
  58. package/dist/server.js +5179 -0
  59. package/dist/server.mjs +2736 -0
  60. package/package.json +95 -0
@@ -0,0 +1,201 @@
1
+ "use client";
2
+
3
+ import {
4
+ Constants
5
+ } from "./chunk-5GHPW7SJ.mjs";
6
+
7
+ // src/clients/OdataBuilder.tsx
8
+ var OdataBuilder = class {
9
+ constructor(url) {
10
+ this.baseUrl = url;
11
+ this.top = Constants.pagesize.toString();
12
+ this.skip = "0";
13
+ this.keyword = "";
14
+ this.filterBy = "";
15
+ this.orderBy = "";
16
+ }
17
+ // parseSearchParams(ReadonlyUrlSearchParams): DataQuery {
18
+ // this.top = top;
19
+ // return this;
20
+ // }
21
+ setQuery(odata) {
22
+ if (odata) {
23
+ for (const key in odata) {
24
+ if (odata[key] != null && odata[key] != "") {
25
+ if (key == "$skip") {
26
+ this.setSkip(odata[key]);
27
+ }
28
+ if (key == "$filter") {
29
+ this.setFilter(odata[key]);
30
+ }
31
+ if (key == "$top") {
32
+ this.setTop(odata[key]);
33
+ }
34
+ if (key == "$orderby") {
35
+ this.setOrderBy(odata[key]);
36
+ }
37
+ if (key == "searchTerm") {
38
+ this.searchTerm = odata[key];
39
+ }
40
+ if (key == "searchCols") {
41
+ this.searchCols = odata[key];
42
+ }
43
+ }
44
+ }
45
+ }
46
+ return this;
47
+ }
48
+ // parseKeyValuePairs(inputString: string): { [key: string]: string } {
49
+ // return inputString.split('$')
50
+ // .map((pair) => pair.split('='))
51
+ // .reduce((result: { [key: string]: string }, [key, value]) => {
52
+ // if (key && value) {
53
+ // result[key.trim()] = value.trim();
54
+ // }
55
+ // return result;
56
+ // }, {});
57
+ // }
58
+ static getOdataQueryString(obj, defaultOrder) {
59
+ let queryString = "";
60
+ let skip = (obj && obj["$skip"]) ?? "0";
61
+ let top = (obj && obj["$top"]) ?? Constants.pagesize.toString();
62
+ queryString = `$skip=${skip}&$top=${top}&$count=true`;
63
+ if (obj?.["searchTerm"] && obj["searchTerm"].trim() !== "") {
64
+ queryString += `&searchTerm=${encodeURIComponent(obj["searchTerm"])}`;
65
+ }
66
+ if (obj?.["searchCols"] && obj["searchCols"].trim() !== "") {
67
+ queryString += `&searchCols=${encodeURIComponent(obj["searchCols"])}`;
68
+ }
69
+ if (obj) {
70
+ if (obj["$filter"] && obj["$filter"] !== null && obj["$filter"] !== "") {
71
+ queryString = queryString + `&$filter=${encodeURIComponent(obj["$filter"])}`;
72
+ }
73
+ if (obj["$orderby"] && obj["$orderby"] !== null && obj["$orderby"] !== "") {
74
+ queryString = queryString + `&$orderby=${encodeURIComponent(obj["$orderby"])}`;
75
+ } else if (defaultOrder) {
76
+ queryString = queryString + `&$orderby=${encodeURIComponent(defaultOrder)}`;
77
+ }
78
+ } else {
79
+ if (defaultOrder) {
80
+ queryString = queryString + `&$orderby=${encodeURIComponent(defaultOrder)}`;
81
+ }
82
+ }
83
+ return queryString;
84
+ }
85
+ setTop(top) {
86
+ this.top = top;
87
+ return this;
88
+ }
89
+ setSkip(skip) {
90
+ this.skip = skip;
91
+ return this;
92
+ }
93
+ setKeyword(keyword) {
94
+ this.keyword = keyword;
95
+ return this;
96
+ }
97
+ setFilter(filterBy) {
98
+ this.filterBy = filterBy;
99
+ return this;
100
+ }
101
+ setOrderBy(orderBy) {
102
+ this.orderBy = orderBy;
103
+ return this;
104
+ }
105
+ getPageNumber(pageSize) {
106
+ let pageNumber = 1;
107
+ if (this.skip && this.top) {
108
+ const skip = parseInt(this.skip);
109
+ const top = parseInt(this.top);
110
+ if (!isNaN(skip) && !isNaN(top)) {
111
+ pageNumber = skip / pageSize + 1;
112
+ }
113
+ }
114
+ return pageNumber;
115
+ }
116
+ getUrl() {
117
+ let url = `${this.baseUrl}?$skip=${this.skip}&$top=${this.top}&$count=true`;
118
+ if (this.filterBy !== null && this.filterBy !== "") {
119
+ url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
120
+ }
121
+ if (this.orderBy !== null && this.orderBy !== "") {
122
+ url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
123
+ }
124
+ if (this.searchTerm) {
125
+ url += `&searchTerm=${encodeURIComponent(this.searchTerm)}`;
126
+ }
127
+ if (this.searchCols) {
128
+ url += `&searchCols=${encodeURIComponent(this.searchCols)}`;
129
+ }
130
+ console.log(url);
131
+ return url;
132
+ }
133
+ getNewOrderByUrl(orderBy) {
134
+ let url = `${this.baseUrl}?$skip=${0}&$top=${this.top}&$count=true`;
135
+ if (this.filterBy !== null && this.filterBy !== "") {
136
+ url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
137
+ }
138
+ if (this.searchTerm) {
139
+ url += `&searchTerm=${encodeURIComponent(this.searchTerm)}`;
140
+ }
141
+ if (this.searchCols) {
142
+ url += `&searchCols=${encodeURIComponent(this.searchCols)}`;
143
+ }
144
+ url = url + `&$orderby=${encodeURIComponent(orderBy)}`;
145
+ return url;
146
+ }
147
+ getNewFilterUrl(filterBy) {
148
+ let url = `${this.baseUrl}?$skip=${0}&$top=${this.top}&$count=true`;
149
+ if (filterBy !== null && filterBy !== "") {
150
+ url = url + `&$filter=${encodeURIComponent(filterBy)}`;
151
+ }
152
+ if (this.orderBy !== null && this.orderBy !== "") {
153
+ url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
154
+ }
155
+ if (this.searchTerm) {
156
+ url += `&searchTerm=${encodeURIComponent(this.searchTerm)}`;
157
+ }
158
+ if (this.searchCols) {
159
+ url += `&searchCols=${encodeURIComponent(this.searchCols)}`;
160
+ }
161
+ return url;
162
+ }
163
+ getNewPageUrl(page) {
164
+ let skip = page * Constants.pagesize - Constants.pagesize;
165
+ let url = `${this.baseUrl}?$skip=${skip}&$top=${this.top}&$count=true`;
166
+ if (this.filterBy !== null && this.filterBy !== "") {
167
+ url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
168
+ }
169
+ if (this.orderBy !== null && this.orderBy !== "") {
170
+ url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
171
+ }
172
+ if (this.searchTerm) {
173
+ url += `&searchTerm=${encodeURIComponent(this.searchTerm)}`;
174
+ }
175
+ if (this.searchCols) {
176
+ url += `&searchCols=${encodeURIComponent(this.searchCols)}`;
177
+ }
178
+ return url;
179
+ }
180
+ getNewPageSizeUrl(pageSize) {
181
+ const currentPage = this.getPageNumber(
182
+ parseInt(this.top || Constants.pagesize.toString())
183
+ );
184
+ const skip = (currentPage - 1) * pageSize;
185
+ let url = `${this.baseUrl}?$skip=${skip}&$top=${pageSize}&$count=true`;
186
+ if (this.filterBy !== null && this.filterBy !== "") {
187
+ url = url + `&$filter=${encodeURIComponent(this.filterBy)}`;
188
+ }
189
+ if (this.orderBy !== null && this.orderBy !== "") {
190
+ url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
191
+ }
192
+ return url;
193
+ }
194
+ getOrderBy() {
195
+ return this.orderBy;
196
+ }
197
+ };
198
+
199
+ export {
200
+ OdataBuilder
201
+ };
@@ -0,0 +1,115 @@
1
+ // src/components/controls/view/DateViewClient.tsx
2
+ import { useEffect, useState } from "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ var DateViewClient = (props) => {
5
+ const [timeZoneAbbr, setTimeZoneAbbr] = useState("");
6
+ useEffect(() => {
7
+ const parts = new Intl.DateTimeFormat("en", {
8
+ timeZoneName: "short"
9
+ }).formatToParts(/* @__PURE__ */ new Date());
10
+ const abbr = parts.find((part) => part.type === "timeZoneName")?.value || "";
11
+ setTimeZoneAbbr(abbr);
12
+ }, []);
13
+ const toUtcDate = (dateString) => {
14
+ const s = dateString.trim();
15
+ if (!s) {
16
+ throw new Error("Empty date string");
17
+ }
18
+ const iso = s.replace(" ", "T");
19
+ const hasTimeZone = /Z$/i.test(iso) || /[+-]\d{2}:\d{2}$/.test(iso);
20
+ const utc = hasTimeZone ? iso : `${iso}Z`;
21
+ const date = new Date(utc);
22
+ if (Number.isNaN(date.getTime())) {
23
+ throw new Error(`Invalid date: ${dateString}`);
24
+ }
25
+ return date;
26
+ };
27
+ const formatDate = (date) => {
28
+ return new Intl.DateTimeFormat("en", {
29
+ day: "2-digit",
30
+ month: "short",
31
+ year: "numeric"
32
+ }).format(date);
33
+ };
34
+ const formatTime = (date) => {
35
+ return date.getSeconds() === 0 ? new Intl.DateTimeFormat("en", {
36
+ hour: "2-digit",
37
+ minute: "2-digit"
38
+ }).format(date) : new Intl.DateTimeFormat("en", {
39
+ hour: "2-digit",
40
+ minute: "2-digit",
41
+ second: "2-digit"
42
+ }).format(date);
43
+ };
44
+ const formatDateTime = (date) => {
45
+ return date.getSeconds() === 0 ? new Intl.DateTimeFormat("en", {
46
+ day: "2-digit",
47
+ month: "short",
48
+ year: "numeric",
49
+ hour: "2-digit",
50
+ minute: "2-digit"
51
+ }).format(date) : new Intl.DateTimeFormat("en", {
52
+ day: "2-digit",
53
+ month: "short",
54
+ year: "numeric",
55
+ hour: "2-digit",
56
+ minute: "2-digit",
57
+ second: "2-digit"
58
+ }).format(date);
59
+ };
60
+ const getTimePeriod = (date) => {
61
+ const hours = date.getHours();
62
+ if (hours >= 5 && hours < 8) return "Early Morning";
63
+ if (hours >= 8 && hours < 12) return "Morning";
64
+ if (hours >= 12 && hours < 14) return "Noon";
65
+ if (hours >= 14 && hours < 17) return "Afternoon";
66
+ if (hours >= 17 && hours < 20) return "Evening";
67
+ if (hours >= 20 && hours < 22) return "Late Evening";
68
+ return "Night";
69
+ };
70
+ const getRelativeTime = (dateString) => {
71
+ const now = /* @__PURE__ */ new Date();
72
+ const utcDate = toUtcDate(dateString);
73
+ const diffMs = now.getTime() - utcDate.getTime();
74
+ const diffSec = Math.floor(diffMs / 1e3);
75
+ const diffMin = Math.floor(diffSec / 60);
76
+ const diffHr = Math.floor(diffMin / 60);
77
+ const diffDay = Math.floor(diffHr / 24);
78
+ if (diffSec < 60) return "Just now";
79
+ if (diffMin < 60) return `${diffMin} minute${diffMin > 1 ? "s" : ""} ago`;
80
+ if (diffHr < 24) return `${diffHr} hour${diffHr > 1 ? "s" : ""} ago`;
81
+ if (diffDay < 7) return `${diffDay} day${diffDay > 1 ? "s" : ""} ago`;
82
+ return formatDate(utcDate);
83
+ };
84
+ const parseAndFormatDate = (dateString, format) => {
85
+ if (format === "relative") {
86
+ return getRelativeTime(dateString);
87
+ }
88
+ const utcDate = toUtcDate(dateString);
89
+ switch (props.controlType) {
90
+ case "date":
91
+ return formatDate(utcDate);
92
+ case "time":
93
+ return `${formatTime(utcDate)} ${timeZoneAbbr} (${getTimePeriod(
94
+ utcDate
95
+ )})`;
96
+ default:
97
+ return formatDateTime(utcDate);
98
+ }
99
+ };
100
+ let localDateTime = "";
101
+ try {
102
+ localDateTime = parseAndFormatDate(props.value, props.format);
103
+ } catch (error) {
104
+ console.error("Error parsing date:", props.value, error);
105
+ }
106
+ return /* @__PURE__ */ jsxs("div", { className: "inline-flex flex-wrap gap-1", children: [
107
+ /* @__PURE__ */ jsx("span", { children: localDateTime }),
108
+ !props.format && props.controlType !== "date" && props.controlType !== "datetime" && timeZoneAbbr && /* @__PURE__ */ jsx("span", { children: timeZoneAbbr })
109
+ ] });
110
+ };
111
+ var DateViewClient_default = DateViewClient;
112
+
113
+ export {
114
+ DateViewClient_default
115
+ };
@@ -0,0 +1,123 @@
1
+ "use client";
2
+
3
+
4
+ // src/components/controls/view/DateViewClient.tsx
5
+ import { useEffect, useState } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ var dateFormatter = new Intl.DateTimeFormat("en", {
8
+ day: "2-digit",
9
+ month: "short",
10
+ year: "numeric"
11
+ });
12
+ var timeFormatterNoSeconds = new Intl.DateTimeFormat("en", {
13
+ hour: "2-digit",
14
+ minute: "2-digit"
15
+ });
16
+ var timeFormatterWithSeconds = new Intl.DateTimeFormat("en", {
17
+ hour: "2-digit",
18
+ minute: "2-digit",
19
+ second: "2-digit"
20
+ });
21
+ var dateTimeFormatterNoSeconds = new Intl.DateTimeFormat("en", {
22
+ day: "2-digit",
23
+ month: "short",
24
+ year: "numeric",
25
+ hour: "2-digit",
26
+ minute: "2-digit"
27
+ });
28
+ var dateTimeFormatterWithSeconds = new Intl.DateTimeFormat("en", {
29
+ day: "2-digit",
30
+ month: "short",
31
+ year: "numeric",
32
+ hour: "2-digit",
33
+ minute: "2-digit",
34
+ second: "2-digit"
35
+ });
36
+ var DateViewClient = (props) => {
37
+ const [timeZoneAbbr, setTimeZoneAbbr] = useState("");
38
+ useEffect(() => {
39
+ const parts = new Intl.DateTimeFormat("en", {
40
+ timeZoneName: "short"
41
+ }).formatToParts(/* @__PURE__ */ new Date());
42
+ const abbr = parts.find((part) => part.type === "timeZoneName")?.value || "";
43
+ setTimeZoneAbbr(abbr);
44
+ }, []);
45
+ const toUtcDate = (dateString) => {
46
+ const s = dateString.trim();
47
+ if (!s) {
48
+ throw new Error("Empty date string");
49
+ }
50
+ const iso = s.replace(" ", "T");
51
+ const hasTimeZone = /Z$/i.test(iso) || /[+-]\d{2}:\d{2}$/.test(iso);
52
+ const utc = hasTimeZone ? iso : `${iso}Z`;
53
+ const date = new Date(utc);
54
+ if (Number.isNaN(date.getTime())) {
55
+ throw new Error(`Invalid date: ${dateString}`);
56
+ }
57
+ return date;
58
+ };
59
+ const formatDate = (date) => {
60
+ return dateFormatter.format(date);
61
+ };
62
+ const formatTime = (date) => {
63
+ return date.getSeconds() === 0 ? timeFormatterNoSeconds.format(date) : timeFormatterWithSeconds.format(date);
64
+ };
65
+ const formatDateTime = (date) => {
66
+ return date.getSeconds() === 0 ? dateTimeFormatterNoSeconds.format(date) : dateTimeFormatterWithSeconds.format(date);
67
+ };
68
+ const getTimePeriod = (date) => {
69
+ const hours = date.getHours();
70
+ if (hours >= 5 && hours < 8) return "Early Morning";
71
+ if (hours >= 8 && hours < 12) return "Morning";
72
+ if (hours >= 12 && hours < 14) return "Noon";
73
+ if (hours >= 14 && hours < 17) return "Afternoon";
74
+ if (hours >= 17 && hours < 20) return "Evening";
75
+ if (hours >= 20 && hours < 22) return "Late Evening";
76
+ return "Night";
77
+ };
78
+ const getRelativeTime = (dateString) => {
79
+ const now = /* @__PURE__ */ new Date();
80
+ const utcDate = toUtcDate(dateString);
81
+ const diffMs = now.getTime() - utcDate.getTime();
82
+ const diffSec = Math.floor(diffMs / 1e3);
83
+ const diffMin = Math.floor(diffSec / 60);
84
+ const diffHr = Math.floor(diffMin / 60);
85
+ const diffDay = Math.floor(diffHr / 24);
86
+ if (diffSec < 60) return "Just now";
87
+ if (diffMin < 60) return `${diffMin} minute${diffMin > 1 ? "s" : ""} ago`;
88
+ if (diffHr < 24) return `${diffHr} hour${diffHr > 1 ? "s" : ""} ago`;
89
+ if (diffDay < 7) return `${diffDay} day${diffDay > 1 ? "s" : ""} ago`;
90
+ return formatDate(utcDate);
91
+ };
92
+ const parseAndFormatDate = (dateString, format) => {
93
+ if (format === "relative") {
94
+ return getRelativeTime(dateString);
95
+ }
96
+ const utcDate = toUtcDate(dateString);
97
+ switch (props.controlType) {
98
+ case "date":
99
+ return formatDate(utcDate);
100
+ case "time":
101
+ return `${formatTime(utcDate)} ${timeZoneAbbr} (${getTimePeriod(
102
+ utcDate
103
+ )})`;
104
+ default:
105
+ return formatDateTime(utcDate);
106
+ }
107
+ };
108
+ let localDateTime = "";
109
+ try {
110
+ localDateTime = parseAndFormatDate(props.value, props.format);
111
+ } catch (error) {
112
+ console.error("Error parsing date:", props.value, error);
113
+ }
114
+ return /* @__PURE__ */ jsxs("div", { className: "inline-flex flex-wrap gap-1", children: [
115
+ /* @__PURE__ */ jsx("span", { children: localDateTime }),
116
+ !props.format && props.controlType !== "date" && props.controlType !== "datetime" && timeZoneAbbr && /* @__PURE__ */ jsx("span", { children: timeZoneAbbr })
117
+ ] });
118
+ };
119
+ var DateViewClient_default = DateViewClient;
120
+
121
+ export {
122
+ DateViewClient_default
123
+ };