courthive-components 3.2.0 → 3.4.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/components/policy-catalog/editors/scoring/domain/scoringProjections.d.ts +23 -0
- package/dist/components/policy-catalog/editors/scoring/index.d.ts +3 -0
- package/dist/components/policy-catalog/editors/scoring/scoringEditorControl.d.ts +21 -0
- package/dist/components/policy-catalog/editors/scoring/scoringEditorPanel.d.ts +6 -0
- package/dist/components/policy-catalog/editors/scoring/scoringEditorStore.d.ts +33 -0
- package/dist/components/policy-catalog/editors/scoring/sections/allowedFormatsSection.d.ts +6 -0
- package/dist/components/policy-catalog/editors/scoring/sections/defaultsSection.d.ts +6 -0
- package/dist/components/policy-catalog/editors/scoring/sections/matchUpFormatPicker.d.ts +35 -0
- package/dist/components/policy-catalog/editors/scoring/sections/statusCodesSection.d.ts +6 -0
- package/dist/components/policy-catalog/editors/scoring/sections/tagListEditor.d.ts +24 -0
- package/dist/components/policy-catalog/editors/scoring/types.d.ts +60 -0
- package/dist/components/policy-catalog/engine/policyCatalogStore.d.ts +11 -0
- package/dist/components/policy-catalog/index.d.ts +2 -0
- package/dist/components/policy-catalog/types.d.ts +13 -1
- package/dist/components/policy-catalog/ui/editorShell.d.ts +1 -0
- package/dist/components/schedule-page/types.d.ts +7 -1
- package/dist/courthive-components.css +1 -1
- package/dist/courthive-components.es.js +2080 -987
- package/dist/courthive-components.umd.js +14 -14
- package/dist/{dist-CwJOJWf0.mjs → dist-DiYU0jFr.mjs} +529 -487
- package/dist/{range-CBX41Ttl.mjs → range-CRxwaxeo.mjs} +125 -58
- package/dist/types.d.ts +14 -2
- package/package.json +6 -6
|
@@ -1,50 +1,84 @@
|
|
|
1
|
-
//#region node_modules/.pnpm/timepicker-ui@4.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
let
|
|
5
|
-
|
|
6
|
-
hour:
|
|
7
|
-
minutes:
|
|
8
|
-
type:
|
|
9
|
-
};
|
|
10
|
-
|
|
1
|
+
//#region node_modules/.pnpm/timepicker-ui@4.4.0/node_modules/timepicker-ui/dist/plugins/range.js
|
|
2
|
+
var e = /^(1[0-2]|[1-9]):([0-5][0-9])\s*(AM|PM)$/i, t = /^([0-1]?[0-9]|2[0-3]):([0-5][0-9])$/;
|
|
3
|
+
function n(t) {
|
|
4
|
+
let n = t.match(e);
|
|
5
|
+
return n ? {
|
|
6
|
+
hour: n[1],
|
|
7
|
+
minutes: n[2],
|
|
8
|
+
type: n[3].toUpperCase()
|
|
9
|
+
} : null;
|
|
10
|
+
}
|
|
11
|
+
function r(e) {
|
|
12
|
+
let n = e.match(t);
|
|
11
13
|
return n ? {
|
|
12
14
|
hour: n[1],
|
|
13
15
|
minutes: n[2]
|
|
14
16
|
} : null;
|
|
15
17
|
}
|
|
16
|
-
function
|
|
18
|
+
function i(e, t) {
|
|
19
|
+
let n = parseInt(e.hour, 10), r = parseInt(e.minutes, 10);
|
|
20
|
+
if (Number.isNaN(n) || Number.isNaN(r)) return 0;
|
|
21
|
+
if (t === "12h" && e.type) {
|
|
22
|
+
let t = e.type.toUpperCase();
|
|
23
|
+
t === "PM" && n !== 12 && (n += 12), t === "AM" && n === 12 && (n = 0);
|
|
24
|
+
}
|
|
25
|
+
return n * 60 + r;
|
|
26
|
+
}
|
|
27
|
+
function a(e) {
|
|
28
|
+
if (!e || e === "--:--") return null;
|
|
29
|
+
let t = n(e);
|
|
30
|
+
if (t) return {
|
|
31
|
+
hour: t.hour,
|
|
32
|
+
minutes: t.minutes,
|
|
33
|
+
type: t.type
|
|
34
|
+
};
|
|
35
|
+
let i = e.match(/^(\d{1,2}):(\d{2})\s*(AM|PM)$/i);
|
|
36
|
+
if (i) return {
|
|
37
|
+
hour: i[1],
|
|
38
|
+
minutes: i[2],
|
|
39
|
+
type: i[3].toUpperCase()
|
|
40
|
+
};
|
|
41
|
+
let a = r(e);
|
|
42
|
+
if (a) return {
|
|
43
|
+
hour: a.hour,
|
|
44
|
+
minutes: a.minutes
|
|
45
|
+
};
|
|
46
|
+
let o = e.match(/^(\d{1,2}):(\d{2})$/);
|
|
47
|
+
return o ? {
|
|
48
|
+
hour: o[1],
|
|
49
|
+
minutes: o[2]
|
|
50
|
+
} : null;
|
|
51
|
+
}
|
|
52
|
+
function o(e) {
|
|
17
53
|
let t = e.minutes === "--" ? "--" : e.minutes.padStart(2, "0"), n = `${e.hour}:${t}`;
|
|
18
54
|
return e.type ? `${n} ${e.type}` : n;
|
|
19
55
|
}
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
let n = parseInt(e.hour, 10), r = parseInt(e.minutes, 10);
|
|
23
|
-
return t === "12h" && e.type && (e.type === "PM" && n !== 12 && (n += 12), e.type === "AM" && n === 12 && (n = 0)), n * 60 + r;
|
|
56
|
+
function s(e, t) {
|
|
57
|
+
return e ? i(e, t) : 0;
|
|
24
58
|
}
|
|
25
|
-
function
|
|
59
|
+
function c(e, t, n) {
|
|
26
60
|
if (!e || !t) return 0;
|
|
27
|
-
let
|
|
28
|
-
return
|
|
61
|
+
let r = s(e, n);
|
|
62
|
+
return s(t, n) - r;
|
|
29
63
|
}
|
|
30
|
-
function
|
|
64
|
+
function l(e, t) {
|
|
31
65
|
return e ? t === "12h" ? !!(e.hour && e.minutes && e.type) : !!(e.hour && e.minutes) : !1;
|
|
32
66
|
}
|
|
33
|
-
function
|
|
34
|
-
if (!
|
|
67
|
+
function u(e) {
|
|
68
|
+
if (!e || !e.includes(" - ")) return {
|
|
35
69
|
from: null,
|
|
36
70
|
to: null
|
|
37
71
|
};
|
|
38
|
-
let
|
|
39
|
-
return
|
|
72
|
+
let t = e.split(" - ").map((e) => e.trim());
|
|
73
|
+
return t.length !== 2 || t[0] === "--:--" || t[1] === "--:--" ? {
|
|
40
74
|
from: null,
|
|
41
75
|
to: null
|
|
42
76
|
} : {
|
|
43
|
-
from:
|
|
44
|
-
to:
|
|
77
|
+
from: a(t[0]),
|
|
78
|
+
to: a(t[1])
|
|
45
79
|
};
|
|
46
80
|
}
|
|
47
|
-
var
|
|
81
|
+
var d = class {
|
|
48
82
|
activePart = "from";
|
|
49
83
|
fromValue = null;
|
|
50
84
|
toValue = null;
|
|
@@ -78,10 +112,10 @@ var o = class {
|
|
|
78
112
|
this.previewValue = e;
|
|
79
113
|
}
|
|
80
114
|
isFromComplete() {
|
|
81
|
-
return
|
|
115
|
+
return l(this.fromValue, this.clockType);
|
|
82
116
|
}
|
|
83
117
|
isToComplete() {
|
|
84
|
-
return
|
|
118
|
+
return l(this.toValue, this.clockType);
|
|
85
119
|
}
|
|
86
120
|
canSwitchToEnd() {
|
|
87
121
|
return this.isFromComplete();
|
|
@@ -107,7 +141,7 @@ var o = class {
|
|
|
107
141
|
this.previewValue &&= (this.activePart === "from" ? this.fromValue = this.previewValue : this.toValue = this.previewValue, null);
|
|
108
142
|
}
|
|
109
143
|
getDuration() {
|
|
110
|
-
return
|
|
144
|
+
return c(this.fromValue, this.toValue, this.clockType);
|
|
111
145
|
}
|
|
112
146
|
validate() {
|
|
113
147
|
if (!this.fromValue || !this.toValue) return {
|
|
@@ -148,7 +182,7 @@ var o = class {
|
|
|
148
182
|
reset() {
|
|
149
183
|
this.activePart = "from", this.fromValue = null, this.toValue = null, this.previewValue = null;
|
|
150
184
|
}
|
|
151
|
-
},
|
|
185
|
+
}, f = class {
|
|
152
186
|
core;
|
|
153
187
|
state;
|
|
154
188
|
constructor(e, t) {
|
|
@@ -163,10 +197,10 @@ var o = class {
|
|
|
163
197
|
updateTimeDisplay() {
|
|
164
198
|
let e = this.core.getModalElement();
|
|
165
199
|
if (!e) return;
|
|
166
|
-
let
|
|
167
|
-
|
|
200
|
+
let t = e.querySelector(".tp-ui-range-from-time"), n = e.querySelector(".tp-ui-range-to-time"), r = this.state.getActivePart(), i = this.state.getPreviewValue(), a = this.state.getFromValue(), s = this.state.getToValue(), c = "--:--";
|
|
201
|
+
r === "from" && i ? c = o(i) : a && (c = o(a));
|
|
168
202
|
let l = "--:--";
|
|
169
|
-
|
|
203
|
+
r === "to" && i ? l = o(i) : s && (l = o(s)), t && (t.textContent = c), n && (n.textContent = l);
|
|
170
204
|
}
|
|
171
205
|
updateOkButton() {
|
|
172
206
|
let e = this.core.getOkButton();
|
|
@@ -177,8 +211,8 @@ var o = class {
|
|
|
177
211
|
updateInputValue() {
|
|
178
212
|
let e = this.core.getInput();
|
|
179
213
|
if (!e) return;
|
|
180
|
-
let
|
|
181
|
-
e.value = `${
|
|
214
|
+
let t = this.state.getFromValue(), n = this.state.getToValue();
|
|
215
|
+
e.value = `${t ? o(t) : "--:--"} - ${n ? o(n) : "--:--"}`;
|
|
182
216
|
}
|
|
183
217
|
syncClockToActivePart() {
|
|
184
218
|
let e = this.state.getSavedValue(), t = this.core.getHour(), n = this.core.getMinutes();
|
|
@@ -191,29 +225,28 @@ var o = class {
|
|
|
191
225
|
updateAll() {
|
|
192
226
|
this.updateTabs(), this.updateTimeDisplay(), this.updateOkButton();
|
|
193
227
|
}
|
|
194
|
-
}
|
|
228
|
+
};
|
|
229
|
+
function p(e, t, n, r) {
|
|
230
|
+
e.on(n, r), t.push(() => e.off(n, r));
|
|
231
|
+
}
|
|
232
|
+
var m = class {
|
|
195
233
|
core;
|
|
196
234
|
emitter;
|
|
197
235
|
state;
|
|
198
236
|
ui;
|
|
199
237
|
cleanupHandlers = [];
|
|
200
238
|
isSyncingAmPm = !1;
|
|
201
|
-
boundHandleMinuteCommit;
|
|
202
|
-
boundHandleConfirm;
|
|
203
|
-
boundHandleUpdate;
|
|
204
|
-
boundHandleAmPm;
|
|
205
|
-
boundHandleClear;
|
|
206
239
|
constructor(e, t) {
|
|
207
240
|
this.core = e, this.emitter = t;
|
|
208
241
|
let { range: n, clock: r } = e.options;
|
|
209
|
-
this.state = new
|
|
242
|
+
this.state = new d(r.type, n?.minDuration, n?.maxDuration, t), this.ui = new f(e, this.state);
|
|
210
243
|
}
|
|
211
244
|
get isEnabled() {
|
|
212
245
|
return this.core.options.range?.enabled === !0;
|
|
213
246
|
}
|
|
214
247
|
init() {
|
|
215
248
|
if (!this.isEnabled) return;
|
|
216
|
-
let { from: e, to: t } =
|
|
249
|
+
let { from: e, to: t } = u(this.core.getInput()?.value || "");
|
|
217
250
|
this.state.setFromValue(e), this.state.setToValue(t), this.state.setActivePart("from"), this.state.setPreviewValue(null), this.bindEvents(), this.ui.syncClockToActivePart(), this.emitAmPmSyncEvent(), this.ui.updateAll();
|
|
218
251
|
}
|
|
219
252
|
getActivePart() {
|
|
@@ -247,10 +280,10 @@ var o = class {
|
|
|
247
280
|
return this.isEnabled ? this.state.canConfirm() : !0;
|
|
248
281
|
}
|
|
249
282
|
getFormattedRange() {
|
|
250
|
-
let e = this.state.getFromValue(),
|
|
251
|
-
return !e || !
|
|
252
|
-
from:
|
|
253
|
-
to: t
|
|
283
|
+
let e = this.state.getFromValue(), t = this.state.getToValue();
|
|
284
|
+
return !e || !t ? null : {
|
|
285
|
+
from: o(e),
|
|
286
|
+
to: o(t)
|
|
254
287
|
};
|
|
255
288
|
}
|
|
256
289
|
bindEvents() {
|
|
@@ -258,14 +291,48 @@ var o = class {
|
|
|
258
291
|
if (!e) return;
|
|
259
292
|
let t = e.querySelector(".tp-ui-range-tab.tp-ui-range-from"), n = e.querySelector(".tp-ui-range-tab.tp-ui-range-to");
|
|
260
293
|
if (t) {
|
|
261
|
-
let e = () => this.
|
|
294
|
+
let e = () => this.activatePart("from", t);
|
|
262
295
|
t.addEventListener("click", e), this.cleanupHandlers.push(() => t.removeEventListener("click", e));
|
|
263
296
|
}
|
|
264
297
|
if (n) {
|
|
265
|
-
let e = () => this.
|
|
298
|
+
let e = () => this.activatePart("to", n);
|
|
266
299
|
n.addEventListener("click", e), this.cleanupHandlers.push(() => n.removeEventListener("click", e));
|
|
267
300
|
}
|
|
268
|
-
this.
|
|
301
|
+
this.bindTabKeyboard(t, n), p(this.emitter, this.cleanupHandlers, "update", () => this.handleUpdate()), p(this.emitter, this.cleanupHandlers, "range:minute:commit", (e) => this.handleMinuteCommit(e)), p(this.emitter, this.cleanupHandlers, "confirm", () => this.handleConfirm()), p(this.emitter, this.cleanupHandlers, "select:am", () => this.handleAmPm()), p(this.emitter, this.cleanupHandlers, "select:pm", () => this.handleAmPm()), p(this.emitter, this.cleanupHandlers, "clear", () => this.handleClear());
|
|
302
|
+
}
|
|
303
|
+
isTabDisabled(e) {
|
|
304
|
+
return !e || e.getAttribute("aria-disabled") === "true" || e.classList.contains("disabled");
|
|
305
|
+
}
|
|
306
|
+
activatePart(e, t) {
|
|
307
|
+
this.isTabDisabled(t) || this.setActivePart(e);
|
|
308
|
+
}
|
|
309
|
+
bindTabKeyboard(e, t) {
|
|
310
|
+
let n = [e, t].filter((e) => e !== null);
|
|
311
|
+
n.length !== 0 && n.forEach((e, t) => {
|
|
312
|
+
let r = t === 0 ? "from" : "to", i = (i) => {
|
|
313
|
+
switch (i.key) {
|
|
314
|
+
case "ArrowRight":
|
|
315
|
+
case "ArrowLeft": {
|
|
316
|
+
i.preventDefault();
|
|
317
|
+
let e = n[((i.key === "ArrowRight" ? t + 1 : t - 1) + n.length) % n.length];
|
|
318
|
+
this.isTabDisabled(e) || e.focus();
|
|
319
|
+
break;
|
|
320
|
+
}
|
|
321
|
+
case "Home":
|
|
322
|
+
i.preventDefault(), n[0].focus();
|
|
323
|
+
break;
|
|
324
|
+
case "End":
|
|
325
|
+
i.preventDefault(), n[n.length - 1].focus();
|
|
326
|
+
break;
|
|
327
|
+
case "Enter":
|
|
328
|
+
case " ":
|
|
329
|
+
case "Spacebar":
|
|
330
|
+
i.preventDefault(), this.activatePart(r, e);
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
e.addEventListener("keydown", i), this.cleanupHandlers.push(() => e.removeEventListener("keydown", i));
|
|
335
|
+
});
|
|
269
336
|
}
|
|
270
337
|
handleClear() {
|
|
271
338
|
this.isEnabled && (this.state.setFromValue(null), this.state.setToValue(null), this.state.setPreviewValue(null), this.state.resetActivePart());
|
|
@@ -329,14 +396,14 @@ var o = class {
|
|
|
329
396
|
}
|
|
330
397
|
}
|
|
331
398
|
}
|
|
332
|
-
handleConfirm(
|
|
399
|
+
handleConfirm() {
|
|
333
400
|
if (!this.isEnabled) return;
|
|
334
401
|
this.state.commitPreview();
|
|
335
|
-
let
|
|
402
|
+
let e = this.state.getFromValue(), t = this.state.getToValue(), n = e ? o(e) : "--:--", r = t ? o(t) : "--:--", i = this.state.getDuration();
|
|
336
403
|
this.ui.updateInputValue(), this.emitter.emit("range:confirm", {
|
|
337
|
-
from:
|
|
338
|
-
to:
|
|
339
|
-
duration:
|
|
404
|
+
from: n,
|
|
405
|
+
to: r,
|
|
406
|
+
duration: i
|
|
340
407
|
});
|
|
341
408
|
}
|
|
342
409
|
reset() {
|
|
@@ -345,9 +412,9 @@ var o = class {
|
|
|
345
412
|
destroy() {
|
|
346
413
|
this.cleanupHandlers.forEach((e) => e()), this.cleanupHandlers = [], this.reset();
|
|
347
414
|
}
|
|
348
|
-
},
|
|
415
|
+
}, h = {
|
|
349
416
|
name: "range",
|
|
350
|
-
factory: (e, t) => new
|
|
417
|
+
factory: (e, t) => new m(e, t),
|
|
351
418
|
clearHandler: (e, t) => {
|
|
352
419
|
if (!e.options.range?.enabled) return;
|
|
353
420
|
let n = e.getModalElement();
|
|
@@ -362,4 +429,4 @@ var o = class {
|
|
|
362
429
|
}
|
|
363
430
|
};
|
|
364
431
|
//#endregion
|
|
365
|
-
export {
|
|
432
|
+
export { h as RangePlugin };
|
package/dist/types.d.ts
CHANGED
|
@@ -237,9 +237,21 @@ export interface CompositionColors {
|
|
|
237
237
|
internalDividers?: string;
|
|
238
238
|
/** placeholder "[Score]" text color — sets `--chc-color-score`. Falls back to `--chc-status-info`. */
|
|
239
239
|
score?: string;
|
|
240
|
-
/** round header text
|
|
241
|
-
*
|
|
240
|
+
/** round header text color — sets `--chc-color-round-header`. Falls back to inherit.
|
|
241
|
+
* Also acts as the underline-color fallback when `roundHeaderUnderline` is unset. */
|
|
242
242
|
roundHeader?: string;
|
|
243
|
+
/** round header background color — sets `--chc-color-round-header-bg`. Falls back to transparent. */
|
|
244
|
+
roundHeaderBackground?: string;
|
|
245
|
+
/** round header underline (divider between header and participants) — sets
|
|
246
|
+
* `--chc-color-round-header-underline`. Falls back to `roundHeader`, then `--chc-text-primary`. */
|
|
247
|
+
roundHeaderUnderline?: string;
|
|
248
|
+
/** matchUp footer background color — sets `--chc-color-matchup-footer-bg`. Falls back to `matchUpBackground`. */
|
|
249
|
+
matchUpFooterBackground?: string;
|
|
250
|
+
/** matchUp footer text color — sets `--chc-color-matchup-footer-text`. Falls back to `--chc-text-muted`. */
|
|
251
|
+
matchUpFooterText?: string;
|
|
252
|
+
/** matchUp footer top divider (border between matchUp body and footer) — sets
|
|
253
|
+
* `--chc-color-matchup-footer-divider`. Falls back to transparent. */
|
|
254
|
+
matchUpFooterDivider?: string;
|
|
243
255
|
}
|
|
244
256
|
export interface Composition {
|
|
245
257
|
theme: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "courthive-components",
|
|
3
|
-
"packageManager": "pnpm@11.
|
|
4
|
-
"version": "3.
|
|
3
|
+
"packageManager": "pnpm@11.6.0",
|
|
4
|
+
"version": "3.4.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22"
|
|
7
7
|
},
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"@storybook/test-runner": "^0.24.0",
|
|
79
79
|
"@types/d3": "^7.4.3",
|
|
80
80
|
"@types/vanillajs-datepicker": "^1.3.5",
|
|
81
|
-
"@typescript-eslint/eslint-plugin": "8.60.
|
|
82
|
-
"@typescript-eslint/parser": "8.60.
|
|
81
|
+
"@typescript-eslint/eslint-plugin": "8.60.1",
|
|
82
|
+
"@typescript-eslint/parser": "8.60.1",
|
|
83
83
|
"@vitest/browser-playwright": "^4.0.16",
|
|
84
84
|
"@vitest/coverage-v8": "^4.0.16",
|
|
85
85
|
"@vitest/ui": "^4.0.16",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"lint-staged": "17.0.7",
|
|
94
94
|
"playwright": "^1.57.0",
|
|
95
95
|
"prettier": "^3.8.1",
|
|
96
|
-
"semver": "7.8.
|
|
96
|
+
"semver": "7.8.3",
|
|
97
97
|
"storybook": "^10.2.17",
|
|
98
98
|
"tabulator-tables": "6.4.0",
|
|
99
99
|
"typescript": "^6.0.2",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"focus-trap": "^8.0.0",
|
|
118
118
|
"timepicker-ui": "^4.1.2",
|
|
119
119
|
"tippy.js": "6.3.7",
|
|
120
|
-
"tods-competition-factory": "5.
|
|
120
|
+
"tods-competition-factory": "5.6.0",
|
|
121
121
|
"vanillajs-datepicker": "1.3.4"
|
|
122
122
|
}
|
|
123
123
|
}
|