@revolist/ui 4.0.1-rc → 4.0.3-rc
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/LICENSE +21 -0
- package/README.md +345 -262
- package/_chunks/calendar-xpZ0v3xf.js +258 -0
- package/_chunks/chart-frame-Cmc7xU1i.js +130 -0
- package/_chunks/choice-chips-CHQTUdLs.js +110 -0
- package/_chunks/clock-BOhPNlW3.js +4 -0
- package/_chunks/{color-palette-BmZ7kH9R.js → color-palette-D8vyPfld.js} +41 -41
- package/_chunks/color-picker-CudqPYZo.js +138 -0
- package/_chunks/component-C_T2VN5u.js +863 -0
- package/_chunks/{component-metadata-BENbgTjU.js → component-metadata-BMOOmqx5.js} +0 -4
- package/_chunks/control-AHKXD5Eu.js +93 -0
- package/_chunks/{control-tooltip-BCNzQCXE.js → control-tooltip-uscKfAnV.js} +29 -29
- package/_chunks/{controller-CmLo-Ajc.js → controller-hRBm_Lfz.js} +15 -15
- package/_chunks/{controls-NEL5tDaz.js → controls-DsNi8V8I.js} +229 -214
- package/_chunks/{date-control-CYCkb1aQ.js → date-control-DrVFX13g.js} +21 -21
- package/_chunks/date-time-qIhp5vaX.js +768 -0
- package/_chunks/{delete-button-DnpmDNEJ.js → delete-button-CW9vjLnk.js} +7 -7
- package/_chunks/dialog.parts-CKGkC5zP.js +134 -0
- package/_chunks/duration-CL68Em0o.js +272 -0
- package/_chunks/editor-commit-Bq3wSgvr.js +12 -0
- package/_chunks/{editor-popup-B7fu_A_T.js → editor-popup-WDdtVDNA.js} +8 -8
- package/_chunks/field-context-D57PnBbH.js +5 -0
- package/_chunks/framework-mount--RTLIqE-.js +54 -0
- package/_chunks/history-controls-B3u3INEK.js +27 -0
- package/_chunks/hooks.module-CG3gN83z.js +157 -0
- package/_chunks/jsxRuntime.module-F6UFnpT-.js +30 -0
- package/_chunks/mount-DQ1cpppK.js +257 -0
- package/_chunks/native-control-C_yok8_-.js +605 -0
- package/_chunks/native.view-ByyZ1CT5.js +32 -0
- package/_chunks/{number-input-NnH57J4j.js → number-input-BKwA5FnM.js} +89 -89
- package/_chunks/picker-h1P5RUgp.js +122 -0
- package/_chunks/popup-CT2uD3go.js +367 -0
- package/_chunks/preact.module-BBM36DnO.js +290 -0
- package/_chunks/{rating-choice-CWAsNQNS.js → rating-choice-DZgmaic0.js} +10 -10
- package/_chunks/render-m5eMMwFR.js +83 -0
- package/_chunks/reorder-list-CSlqAGHw.js +59 -0
- package/_chunks/request-trail-DSlFix6i.js +618 -0
- package/_chunks/rich-text-CH7gIqOS.js +636 -0
- package/_chunks/rotate-right-Iha5ScJ1.js +4 -0
- package/_form.scss +1 -1
- package/_vendor/preact/LICENSE +21 -0
- package/_vendor/preact/compat/src/index.d.ts +353 -0
- package/_vendor/preact/compat/src/suspense-list.d.ts +16 -0
- package/_vendor/preact/compat/src/suspense.d.ts +19 -0
- package/_vendor/preact/hooks/src/index.d.ts +145 -0
- package/_vendor/preact/src/dom.d.ts +2548 -0
- package/_vendor/preact/src/index.d.ts +373 -0
- package/_vendor/preact/src/jsx.d.ts +2958 -0
- package/activity-message.d.ts +1 -1
- package/activity-message.js +16 -16
- package/ai/_chat.scss +195 -0
- package/ai/_style.scss +105 -34
- package/ai/chat.d.ts +63 -0
- package/ai/components.d.ts +20 -4
- package/ai/index.d.ts +2 -0
- package/ai/index.js +3 -3
- package/ai/mount.d.ts +30 -1
- package/ai/prompt-history.d.ts +13 -0
- package/ai/request-trail.d.ts +1 -1
- package/ai/transcript.d.ts +25 -0
- package/ai/translation-context.d.ts +1 -1
- package/ai/translations.d.ts +1 -1
- package/alert.d.ts +2 -2
- package/angular/angular.js +0 -3
- package/assignee/field.d.ts +2 -2
- package/assignee/index.js +86 -87
- package/assignee/layout.d.ts +2 -2
- package/assignee/picker.d.ts +1 -1
- package/avatar/index.js +25 -25
- package/avatar/index.view.d.ts +1 -1
- package/brush-range/component.d.ts +1 -1
- package/brush-range/component.js +30 -30
- package/buttons/delete-button.d.ts +2 -1
- package/buttons/delete-button.js +1 -1
- package/buttons/remove-button.d.ts +1 -1
- package/buttons/remove-button.js +3 -3
- package/buttons/svg-button.d.ts +2 -1
- package/buttons/svg-button.js +35 -35
- package/calendar/_calendar.scss +7 -2
- package/calendar/calendar.d.ts +1 -1
- package/calendar/calendar.js +1 -1
- package/calendar/caption.d.ts +1 -1
- package/calendar/day.d.ts +1 -1
- package/calendar/day.js +4 -4
- package/calendar/header.d.ts +1 -1
- package/calendar/header.js +35 -35
- package/calendar/index.js +2 -2
- package/calendar/month-grid.d.ts +1 -1
- package/calendar/month-grid.js +37 -37
- package/calendar/picker.d.ts +1 -1
- package/calendar/types.d.ts +1 -1
- package/calendar/year-grid.d.ts +1 -1
- package/calendar/year-grid.js +12 -12
- package/checkbox/index.d.ts +2 -2
- package/checkbox/index.js +9 -9
- package/choice-chips/index.d.ts +1 -1
- package/choice-chips/index.js +1 -1
- package/color-palette/color-palette.d.ts +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-picker.d.ts +1 -1
- package/color-palette/color-picker.js +2 -2
- package/component-catalog.d.ts +34 -23
- package/control-attributes.js +7 -7
- package/control-presentation.js +18 -18
- package/controls.d.ts +12 -10
- package/controls.js +3 -3
- package/core/editor-commit.d.ts +1 -1
- package/core/editor-popup.d.ts +1 -1
- package/core/editor-popup.js +1 -1
- package/date-time/date-control.d.ts +1 -1
- package/date-time/field.d.ts +2 -2
- package/date-time/index.js +1 -1
- package/date-time/picker.d.ts +1 -1
- package/date-time/style.scss +4 -4
- package/date-time/time-control.d.ts +1 -1
- package/date-time/time-selection.d.ts +1 -1
- package/date-time/types.d.ts +1 -1
- package/dialog/dialog-action-footer.view.d.ts +1 -1
- package/dialog/dialog.dom.js +52 -52
- package/dialog/dialog.parts.d.ts +18 -18
- package/dialog/dialog.parts.js +1 -1
- package/dialog/dialog.preact.d.ts +1 -1
- package/dialog/dialog.preact.js +6 -6
- package/distribution-chart/area-chart.d.ts +1 -1
- package/distribution-chart/area-chart.js +25 -25
- package/distribution-chart/bar-chart.d.ts +6 -3
- package/distribution-chart/bar-chart.js +10 -6
- package/distribution-chart/chart-frame.d.ts +3 -2
- package/distribution-chart/index.d.ts +1 -1
- package/distribution-chart/index.js +6 -6
- package/distribution-chart/line-chart.d.ts +1 -1
- package/distribution-chart/line-chart.js +9 -9
- package/distribution-chart/types.d.ts +1 -1
- package/dropdown/content.d.ts +3 -2
- package/dropdown/content.js +1 -141
- package/dropdown/control.d.ts +14 -0
- package/dropdown/control.js +1 -0
- package/dropdown/control.view.d.ts +6 -0
- package/dropdown/dropdown.service.d.ts +1 -1
- package/dropdown/dropdown.service.js +9 -9
- package/dropdown/dropdown.types.d.ts +4 -0
- package/dropdown/editor-dropdown.style.scss +37 -9
- package/dropdown/index.d.ts +1 -1
- package/dropdown/index.js +3 -4
- package/dropdown/lookup-field.d.ts +1 -1
- package/dropdown/lookup-field.js +41 -41
- package/dropdown/popup.d.ts +1 -1
- package/dropdown/popup.js +1 -140
- package/duration/controls.d.ts +1 -1
- package/duration/index.d.ts +2 -2
- package/duration/index.js +1 -1
- package/duration/style.scss +1 -1
- package/editor-actions.d.ts +1 -1
- package/editor-actions.js +21 -20
- package/editor-layout/index.d.ts +1 -1
- package/editor-layout/index.js +27 -27
- package/field-configurator.d.ts +1 -1
- package/field-configurator.js +93 -93
- package/field-reorder.hook.js +32 -32
- package/fieldset.d.ts +3 -0
- package/filter/filters/slider/preact.js +3 -3
- package/filter/filters/slider/single.d.ts +1 -1
- package/filter/filters/slider/single.js +23 -23
- package/filter-badge.d.ts +1 -1
- package/filter-badge.js +23 -22
- package/filter-controls.d.ts +1 -1
- package/filter-controls.js +30 -30
- package/form-controls/field-context.d.ts +5 -0
- package/form-controls/index.js +16 -21
- package/form-controls/index.view.d.ts +2 -4
- package/form-controls/presentation.d.ts +1 -1
- package/form-controls/presentation.js +59 -51
- package/formatting/comparison-preview.d.ts +1 -1
- package/formatting/control-tooltip.d.ts +1 -1
- package/formatting/icon-controls.d.ts +1 -1
- package/formatting/index.js +105 -100
- package/formatting/inspector-section.d.ts +1 -1
- package/formatting/typography-controls.d.ts +1 -1
- package/framework-mount.d.ts +1 -1
- package/framework.js +215 -207
- package/history-controls.d.ts +14 -0
- package/history-controls.js +1 -0
- package/icons/icon.d.ts +1 -1
- package/icons/icon.js +1 -1
- package/legend.d.ts +1 -1
- package/legend.js +12 -12
- package/masked-input/index.d.ts +1 -1
- package/masked-input/index.js +109 -109
- package/native-control.d.ts +14 -12
- package/native-control.js +3 -26
- package/native-styles.css +1 -1
- package/native.js +40 -39
- package/number-input/index.d.ts +1 -1
- package/number-input/index.js +1 -1
- package/package.json +18 -14
- package/pagination.d.ts +3 -0
- package/pagination.js +43 -33
- package/pdf-viewer/component.d.ts +1 -1
- package/pdf-viewer/controller.js +1 -1
- package/pdf-viewer/header.d.ts +1 -1
- package/pdf-viewer/index.js +13 -13
- package/pdf-viewer/search-bar.d.ts +1 -1
- package/pdf-viewer/status.d.ts +1 -1
- package/pdf-viewer/style.scss +3 -4
- package/pdf-viewer/toolbar.d.ts +1 -1
- package/pickers.d.ts +1 -1
- package/preact-mount.d.ts +1 -1
- package/preact-mount.js +1 -1
- package/preact.d.ts +2 -0
- package/preact.js +62 -62
- package/rating-choice.d.ts +1 -1
- package/rating-choice.js +1 -1
- package/react-adapter.d.ts +1 -1
- package/react-control.d.ts +0 -1
- package/react-control.js +2 -2
- package/react.d.ts +13 -3
- package/react.js +71 -88
- package/reorder-list.d.ts +1 -1
- package/reorder-list.js +1 -1
- package/resource-picker/resource-picker-avatar.d.ts +1 -1
- package/resource-picker/resource-picker-avatar.js +14 -14
- package/resource-picker/resource-picker-option.d.ts +1 -1
- package/resource-picker/resource-picker-option.js +28 -28
- package/resource-picker/resource-picker-popup.d.ts +1 -1
- package/resource-picker/resource-picker-popup.js +3 -3
- package/resource-picker/resource-picker.d.ts +1 -1
- package/resource-picker/resource-picker.js +88 -88
- package/resource-picker/resource-picker.scss +6 -3
- package/rich-text/engine.d.ts +16 -19
- package/rich-text/index.d.ts +7 -7
- package/rich-text/index.js +1 -1
- package/rich-text/model.d.ts +4 -3
- package/rich-text/render-model.d.ts +4 -5
- package/rich-text/style.scss +3 -12
- package/rich-text/toolbar.d.ts +7 -7
- package/rich-text/translations.d.ts +3 -15
- package/search-input/index.js +12 -12
- package/segmented-switch/index.d.ts +1 -1
- package/segmented-switch/index.js +1 -1
- package/select.d.ts +20 -0
- package/select.js +1 -0
- package/status-feedback/exit-snapshot.js +4 -4
- package/status-feedback/index.js +2 -2
- package/status-feedback/popover.js +10 -10
- package/status-feedback/render.d.ts +2 -2
- package/status-feedback/render.js +3 -44
- package/status-feedback/status-feedback.scss +7 -0
- package/status-feedback/types.d.ts +4 -0
- package/status-feedback/use-auto-dismiss.d.ts +3 -0
- package/styles/_compositions.scss +3 -1
- package/styles/_control.scss +12 -4
- package/styles/_primitives.scss +9 -8
- package/styles.css +1 -1
- package/surfaces.js +49 -49
- package/svelte/UiComponent.server.js +1 -48
- package/svelte/UiComponent.svelte +0 -21
- package/svelte.js +33 -68
- package/switch/index.js +15 -15
- package/time-grid.d.ts +1 -1
- package/time-grid.js +58 -58
- package/timeline-track/component.d.ts +5 -1
- package/timeline-track/index.js +91 -74
- package/timeline-track/model.d.ts +9 -0
- package/timeline-track/model.js +10 -1
- package/ui.css +1 -1
- package/vue-adapter.d.ts +1 -1
- package/vue.d.ts +138 -119
- package/vue.js +150 -174
- package/_chunks/calendar-BsDxCYhI.js +0 -248
- package/_chunks/chart-frame-BvxbmEU9.js +0 -126
- package/_chunks/choice-chips-0HfOnK_4.js +0 -110
- package/_chunks/color-picker-BRv-__AM.js +0 -138
- package/_chunks/component-D4PH5UZT.js +0 -859
- package/_chunks/date-time-DjucJmbc.js +0 -769
- package/_chunks/dialog.parts-Dt3KinUz.js +0 -134
- package/_chunks/dropdown-CkGQBm1Q.js +0 -357
- package/_chunks/duration-BCaktcvz.js +0 -270
- package/_chunks/editor-commit-D6Rf5rGz.js +0 -12
- package/_chunks/framework-mount-BKIOsvY-.js +0 -54
- package/_chunks/mount-0-8opf1j.js +0 -90
- package/_chunks/native.view-8q_nwQ7x.js +0 -32
- package/_chunks/picker-oazJ7sO_.js +0 -121
- package/_chunks/reorder-list-BV3kZXso.js +0 -59
- package/_chunks/request-trail-D0oVzdRd.js +0 -347
- package/_chunks/rich-text-2Rla349o.js +0 -477
- package/react-native-select.d.ts +0 -6
- package/rich-text/syntax.d.ts +0 -2
- package/vue-native-select.d.ts +0 -9
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import { ButtonControl as e, Select as t } from "../native-control.js";
|
|
2
|
-
import { createControlId as n } from "../core/control-id.js";
|
|
3
|
-
import { DEFAULT_CALENDAR_TRANSLATIONS as r } from "../calendar/translations.js";
|
|
4
|
-
import { a as i, n as a } from "./iso-B0YHBK7m.js";
|
|
5
|
-
import { a as o, c as s, d as c, f as l, l as u, n as d, p as f, r as p, s as m, t as h, u as g } from "./model-mPO2tG2f.js";
|
|
6
|
-
import { CalendarHeader as _, CalendarWeekdays as ee } from "../calendar/header.js";
|
|
7
|
-
import { CalendarMonthGrid as te } from "../calendar/month-grid.js";
|
|
8
|
-
import { CalendarYearGrid as ne } from "../calendar/year-grid.js";
|
|
9
|
-
import { useMemo as v, useRef as y, useState as b } from "preact/hooks";
|
|
10
|
-
import { jsx as x, jsxs as S } from "preact/jsx-runtime";
|
|
11
|
-
//#region src/calendar/caption.tsx
|
|
12
|
-
function re({ month: e, system: n, locale: r, layout: i, start: a, end: o, disabled: s, labels: d, onChange: f }) {
|
|
13
|
-
let p = u(e, n), h = c(e, n), _ = v(() => {
|
|
14
|
-
let t = u(e, n)[0], r = a ? u(a, n)[0] : m(t, -600, n), i = o ? u(o, n)[0] : m(t, 120, n), s = [];
|
|
15
|
-
for (let e = r; e <= i; e = m(e, 12, n)) s.push(e);
|
|
16
|
-
return s.includes(t) || s.push(t), s.sort();
|
|
17
|
-
}, [
|
|
18
|
-
e,
|
|
19
|
-
n,
|
|
20
|
-
a,
|
|
21
|
-
o
|
|
22
|
-
]);
|
|
23
|
-
return /* @__PURE__ */ S("div", {
|
|
24
|
-
class: "revo-calendar__caption",
|
|
25
|
-
children: [i === "dropdown-years" ? /* @__PURE__ */ x("span", { children: g(e, r, { month: "long" }, n) }) : /* @__PURE__ */ x(t, {
|
|
26
|
-
"aria-label": d.chooseMonth,
|
|
27
|
-
disabled: s,
|
|
28
|
-
value: String(h.month),
|
|
29
|
-
onChange: (e) => f(p[Number(e.currentTarget.value) - 1]),
|
|
30
|
-
children: p.map((e, t) => /* @__PURE__ */ x("option", {
|
|
31
|
-
value: String(t + 1),
|
|
32
|
-
disabled: !!(a && e < l(a, n) || o && e > l(o, n)),
|
|
33
|
-
children: g(e, r, { month: "short" }, n)
|
|
34
|
-
}, e))
|
|
35
|
-
}), i === "dropdown-months" ? /* @__PURE__ */ x("span", { children: g(e, r, { year: "numeric" }, n) }) : /* @__PURE__ */ x(t, {
|
|
36
|
-
"aria-label": d.chooseYear,
|
|
37
|
-
disabled: s,
|
|
38
|
-
value: p[0],
|
|
39
|
-
onChange: (e) => {
|
|
40
|
-
let t = e.currentTarget.value, r = m(t, h.month - 1, n);
|
|
41
|
-
a && r < l(a, n) && (r = l(a, n)), o && r > l(o, n) && (r = l(o, n)), f(r);
|
|
42
|
-
},
|
|
43
|
-
children: _.map((e) => /* @__PURE__ */ x("option", {
|
|
44
|
-
value: e,
|
|
45
|
-
children: g(e, r, { year: "numeric" }, n)
|
|
46
|
-
}, e))
|
|
47
|
-
})]
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region src/calendar/calendar.tsx
|
|
52
|
-
var ie = "2026-08-02";
|
|
53
|
-
function C({ locale: t = "en-US", weekStartsOn: c = 1, showOutsideDays: u = !1, allowOutsideMonthSelection: C = !1, fixedWeeks: ae = !0, showTodayButton: oe = !1, showHeader: se = !0, showNavigation: w = !0, showPreviousButton: ce = w, showNextButton: le = w, showMonthLabel: ue = !0, showWeekdays: de = !0, enableYearView: T = !0, translations: fe = {}, ...E }) {
|
|
54
|
-
let [D] = b(() => n("rv-calendar-feedback")), O = E.calendarSystem ?? "gregory", k = Math.max(1, Math.min(12, Math.trunc(E.numberOfMonths || 1))), A = v(() => {
|
|
55
|
-
let e = E.views ? [...new Set(E.views.filter((e) => e === "month" || e === "year"))] : T ? ["month", "year"] : ["month"];
|
|
56
|
-
return e.length ? e : ["month"];
|
|
57
|
-
}, [E.views, T]), [j, pe] = b(E.defaultView && A.includes(E.defaultView) ? E.defaultView : A[0]), M = A.includes(j) ? j : A[0], N = l(E.month, O), P = v(() => Array.from({ length: k }, (e, t) => m(N, t, O)), [
|
|
58
|
-
N,
|
|
59
|
-
k,
|
|
60
|
-
O
|
|
61
|
-
]), me = E.reverseMonths ? [...P].reverse() : P, he = v(() => Array.from({ length: 7 }, (e, t) => f(ie, (c + t) % 7)), [c]), F = E.referenceDate ?? (E.referenceInstant ? a(E.referenceInstant, E.timeZone ?? "UTC") : void 0), I = y(/* @__PURE__ */ new Map()), L = y(!1), R = {
|
|
62
|
-
...r,
|
|
63
|
-
...fe
|
|
64
|
-
}, z = (e) => p(e, {
|
|
65
|
-
minDate: E.minDate,
|
|
66
|
-
maxDate: E.maxDate,
|
|
67
|
-
isMonthDisabled: E.isMonthDisabled,
|
|
68
|
-
calendarSystem: O
|
|
69
|
-
}), B = [E.startMonth, E.minDate].filter((e) => !!e).map((e) => l(e, O)).sort().at(-1), V = [E.endMonth, E.maxDate].filter((e) => !!e).map((e) => l(e, O)).sort().at(0), H = (e) => !!(E.disableNavigation || z(e) || B && e < B || V && e > V), U = (e, t = k) => {
|
|
70
|
-
let n = V ? m(V, 1 - t, O) : void 0;
|
|
71
|
-
return n && B && n < B && (n = B), n && e > n && (e = n), B && e < B && (e = B), e;
|
|
72
|
-
}, W = /* @__PURE__ */ new Map(), G = (e) => {
|
|
73
|
-
let t = W.get(e);
|
|
74
|
-
if (t !== void 0) return t;
|
|
75
|
-
let n = z(l(e, O)) || d(e, {
|
|
76
|
-
minDate: E.minDate,
|
|
77
|
-
maxDate: E.maxDate,
|
|
78
|
-
isDisabled: E.isDateDisabled
|
|
79
|
-
});
|
|
80
|
-
return W.set(e, n), n;
|
|
81
|
-
}, ge = P.includes(l(E.focusedDate, O)) && !G(E.focusedDate) ? E.focusedDate : P.flatMap((e) => h(e, c, !1, O)).find((e) => P.includes(l(e, O)) && !G(e)) ?? E.focusedDate, K = (e) => {
|
|
82
|
-
e !== M && A.includes(e) && (pe(e), E.onViewChange?.(e));
|
|
83
|
-
}, q = (e, t = E.onSelect) => {
|
|
84
|
-
if (G(e)) return E.onInvalidSelection?.(R.invalidSelection, e), !1;
|
|
85
|
-
let n = E.validateSelection?.(e, {
|
|
86
|
-
month: N,
|
|
87
|
-
view: M,
|
|
88
|
-
selection: E.selection,
|
|
89
|
-
preview: E.preview,
|
|
90
|
-
referenceDate: F
|
|
91
|
-
});
|
|
92
|
-
return n === !1 || typeof n == "string" ? (E.onInvalidSelection?.(typeof n == "string" ? n : R.invalidSelection, e), !1) : (t(e), !0);
|
|
93
|
-
}, _e = (e, t) => {
|
|
94
|
-
t ? I.current.set(e, t) : I.current.delete(e), t && L.current && e === E.focusedDate && (L.current = !1, queueMicrotask(() => t.focus()));
|
|
95
|
-
}, ve = (e, t) => {
|
|
96
|
-
let n = E.dir ?? (e.currentTarget.ownerDocument.defaultView?.getComputedStyle(e.currentTarget).direction === "rtl" ? "rtl" : "ltr"), r = o({
|
|
97
|
-
date: t,
|
|
98
|
-
key: e.key,
|
|
99
|
-
shiftKey: e.shiftKey,
|
|
100
|
-
weekStartsOn: c,
|
|
101
|
-
minDate: E.minDate,
|
|
102
|
-
maxDate: E.maxDate,
|
|
103
|
-
isDisabled: G,
|
|
104
|
-
dir: n,
|
|
105
|
-
calendarSystem: O
|
|
106
|
-
});
|
|
107
|
-
if (!r) return;
|
|
108
|
-
e.preventDefault();
|
|
109
|
-
let i = l(r, O);
|
|
110
|
-
(P.includes(i) || !H(i)) && (L.current = !0, P.includes(i) || E.onMonthChange(U(i)), E.onFocusedDateChange(r), queueMicrotask(() => {
|
|
111
|
-
let e = I.current.get(r);
|
|
112
|
-
e && (L.current = !1, e.focus());
|
|
113
|
-
}));
|
|
114
|
-
}, J = (e) => E.formatMonth?.(e, t) ?? g(e, t, {
|
|
115
|
-
month: "long",
|
|
116
|
-
year: "numeric"
|
|
117
|
-
}, O), Y = M === "year", ye = Y ? 12 : E.pagedNavigation ? k : 1, X = U(m(N, -ye, O), Y ? 1 : k), Z = U(m(N, ye, O), Y ? 1 : k), Q = (e, t = Y ? 1 : k) => {
|
|
118
|
-
let n = U(e, t);
|
|
119
|
-
H(n) || E.onMonthChange(n);
|
|
120
|
-
}, $ = (e) => {
|
|
121
|
-
q(e, E.onPresetSelect ?? E.onSelect) && (E.onMonthChange(U(l(e, O))), E.onFocusedDateChange(e), K("month"));
|
|
122
|
-
};
|
|
123
|
-
return /* @__PURE__ */ S("div", {
|
|
124
|
-
class: `revo-calendar${E.showWeekNumber ? " revo-calendar--week-numbers" : ""}${E.className ? ` ${E.className}` : ""}`,
|
|
125
|
-
dir: E.dir,
|
|
126
|
-
style: E.cellSize ? { "--revo-calendar-cell-size": `${Math.max(24, E.cellSize)}px` } : void 0,
|
|
127
|
-
children: [
|
|
128
|
-
/* @__PURE__ */ x("div", {
|
|
129
|
-
class: "revo-calendar__months",
|
|
130
|
-
children: (Y ? [N] : me).map((e, n) => /* @__PURE__ */ S("section", {
|
|
131
|
-
class: "revo-calendar__month-panel",
|
|
132
|
-
children: [se && /* @__PURE__ */ x(_, {
|
|
133
|
-
label: Y ? g(e, t, { year: "numeric" }, O) : J(e),
|
|
134
|
-
previousLabel: Y ? R.previousYear : R.previousMonth,
|
|
135
|
-
nextLabel: Y ? R.nextYear : R.nextMonth,
|
|
136
|
-
caption: !Y && E.captionLayout && E.captionLayout !== "label" ? /* @__PURE__ */ x(re, {
|
|
137
|
-
month: e,
|
|
138
|
-
system: O,
|
|
139
|
-
locale: t,
|
|
140
|
-
layout: E.captionLayout,
|
|
141
|
-
start: B,
|
|
142
|
-
end: V,
|
|
143
|
-
disabled: E.disableNavigation,
|
|
144
|
-
labels: R,
|
|
145
|
-
onChange: (t) => Q(m(t, -P.indexOf(e), O))
|
|
146
|
-
}) : void 0,
|
|
147
|
-
labelAction: !E.disableNavigation && !Y && A.includes("year") ? {
|
|
148
|
-
ariaLabel: `${R.chooseMonth}: ${J(e)}`,
|
|
149
|
-
onClick: () => K("year")
|
|
150
|
-
} : void 0,
|
|
151
|
-
showLabel: ue,
|
|
152
|
-
showPrevious: ce && n === 0,
|
|
153
|
-
showNext: le && n === (Y ? 0 : k - 1),
|
|
154
|
-
previousDisabled: X >= N || H(X),
|
|
155
|
-
nextDisabled: Z <= N || H(Z),
|
|
156
|
-
onPrevious: () => Q(X),
|
|
157
|
-
onNext: () => Q(Z)
|
|
158
|
-
}), Y ? /* @__PURE__ */ x(ne, {
|
|
159
|
-
month: N,
|
|
160
|
-
system: O,
|
|
161
|
-
referenceDate: F,
|
|
162
|
-
minDate: E.minDate,
|
|
163
|
-
maxDate: E.maxDate,
|
|
164
|
-
isMonthDisabled: E.isMonthDisabled,
|
|
165
|
-
locale: t,
|
|
166
|
-
ariaLabel: `${R.chooseMonth} ${g(N, t, { year: "numeric" }, O)}`,
|
|
167
|
-
onEscape: () => K("month"),
|
|
168
|
-
onSelect: (e) => {
|
|
169
|
-
Q(e, k), K("month");
|
|
170
|
-
}
|
|
171
|
-
}) : /* @__PURE__ */ S("div", {
|
|
172
|
-
class: "revo-calendar__calendar",
|
|
173
|
-
role: "grid",
|
|
174
|
-
"aria-label": `${J(e)} ${R.calendar}`,
|
|
175
|
-
children: [de && /* @__PURE__ */ x(ee, {
|
|
176
|
-
dates: he,
|
|
177
|
-
locale: t,
|
|
178
|
-
format: E.formatWeekday ?? ((e, t) => g(e, t, { weekday: /^(fa|ar)(-|$)/.test(t) ? "narrow" : "short" }, O)),
|
|
179
|
-
weekNumberLabel: E.showWeekNumber ? R.weekNumber : void 0
|
|
180
|
-
}), /* @__PURE__ */ x(te, {
|
|
181
|
-
dates: h(e, c, ae, O),
|
|
182
|
-
month: e,
|
|
183
|
-
system: O,
|
|
184
|
-
visibleMonths: P,
|
|
185
|
-
focusedDate: ge,
|
|
186
|
-
referenceDate: F,
|
|
187
|
-
selection: E.selection,
|
|
188
|
-
selectedDates: E.selectedDates,
|
|
189
|
-
preview: E.preview,
|
|
190
|
-
previewInvalid: E.previewInvalid,
|
|
191
|
-
previewDescriptionId: E.previewDescription ? D : void 0,
|
|
192
|
-
showOutsideDays: u,
|
|
193
|
-
allowOutsideMonthSelection: C,
|
|
194
|
-
dayClassName: E.dayClassName,
|
|
195
|
-
renderDay: E.renderDay ?? ((e) => g(e, t, { day: "numeric" }, O)),
|
|
196
|
-
isDisabled: G,
|
|
197
|
-
formatDayLabel: (e) => E.formatDayLabel?.(e, t) ?? g(e, t, {
|
|
198
|
-
weekday: "long",
|
|
199
|
-
month: "long",
|
|
200
|
-
day: "numeric",
|
|
201
|
-
year: "numeric"
|
|
202
|
-
}, O),
|
|
203
|
-
weekNumber: E.showWeekNumber ? (e) => {
|
|
204
|
-
let n = s(E.weekNumbering === "local" ? e : f(e, (4 - i(e) + 7) % 7), E.weekNumbering === "local" ? c : 1, E.weekNumbering === "local" ? 1 : 4, E.weekNumbering === "local" ? O : "gregory");
|
|
205
|
-
return E.formatWeekNumber?.(n) ?? new Intl.NumberFormat(t).format(n);
|
|
206
|
-
} : void 0,
|
|
207
|
-
weekNumberLabel: R.weekNumber,
|
|
208
|
-
setDayRef: _e,
|
|
209
|
-
onFocus: E.onFocusedDateChange,
|
|
210
|
-
onPreview: (e) => E.onPreviewDateChange?.(e),
|
|
211
|
-
onKeyDown: ve,
|
|
212
|
-
onSelect: q
|
|
213
|
-
})]
|
|
214
|
-
})]
|
|
215
|
-
}, e))
|
|
216
|
-
}),
|
|
217
|
-
E.presets?.length ? /* @__PURE__ */ x("div", {
|
|
218
|
-
class: "revo-calendar__presets",
|
|
219
|
-
children: E.presets.map((t) => /* @__PURE__ */ x(e, {
|
|
220
|
-
disabled: G(t.date),
|
|
221
|
-
onClick: () => $(t.date),
|
|
222
|
-
children: t.label
|
|
223
|
-
}, t.label))
|
|
224
|
-
}) : null,
|
|
225
|
-
oe && F && /* @__PURE__ */ x("button", {
|
|
226
|
-
type: "button",
|
|
227
|
-
class: "revo-calendar__today",
|
|
228
|
-
disabled: G(F),
|
|
229
|
-
onClick: () => $(F),
|
|
230
|
-
children: R.today
|
|
231
|
-
}),
|
|
232
|
-
E.previewDescription !== void 0 && /* @__PURE__ */ x("p", {
|
|
233
|
-
id: D,
|
|
234
|
-
class: "revo-calendar__feedback",
|
|
235
|
-
role: "status",
|
|
236
|
-
"aria-live": "polite",
|
|
237
|
-
"aria-atomic": "true",
|
|
238
|
-
children: E.previewDescription
|
|
239
|
-
}),
|
|
240
|
-
E.footer && /* @__PURE__ */ x("div", {
|
|
241
|
-
class: "revo-calendar__footer",
|
|
242
|
-
children: E.footer
|
|
243
|
-
})
|
|
244
|
-
]
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
//#endregion
|
|
248
|
-
export { C as t };
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { useRef as e, useState as t } from "preact/hooks";
|
|
2
|
-
import { Fragment as n, jsx as r, jsxs as i } from "preact/jsx-runtime";
|
|
3
|
-
//#region src/distribution-chart/geometry.ts
|
|
4
|
-
function a(e) {
|
|
5
|
-
let t = e.map(({ value: e }) => Number.isFinite(e) ? Math.max(0, e) : 0), n = Math.max(1, ...t);
|
|
6
|
-
return {
|
|
7
|
-
values: t,
|
|
8
|
-
max: n,
|
|
9
|
-
points: t.map((t, r) => ({
|
|
10
|
-
x: e.length <= 1 ? 50 : r / (e.length - 1) * 100,
|
|
11
|
-
y: 96 - t / n * 88
|
|
12
|
-
}))
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function o(e, t) {
|
|
16
|
-
return t === "step" ? `H ${e.x} V ${e.y}` : `L ${e.x} ${e.y}`;
|
|
17
|
-
}
|
|
18
|
-
function s(e, t, n = "linear") {
|
|
19
|
-
return `M ${e.x} ${e.y} ${o(t, n)}`;
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/distribution-chart/chart-frame.tsx
|
|
23
|
-
function c({ title: e, details: t = [] }) {
|
|
24
|
-
return [e, ...t].filter(Boolean).join(". ");
|
|
25
|
-
}
|
|
26
|
-
function l({ title: e, details: t = [] }) {
|
|
27
|
-
return /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("strong", { children: e }), t.map((e) => /* @__PURE__ */ r("span", { children: e }, e))] });
|
|
28
|
-
}
|
|
29
|
-
function u({ data: n, ariaLabel: o, variant: s, height: u = 72, className: d = "", showGrid: f = !1, showLabels: p = !1, showValues: m = !1, legend: h, formatValue: g = String, tooltip: _ = !0, tooltipIndicator: v = "none", renderTooltip: y, positions: b, renderDatum: x, children: S }) {
|
|
30
|
-
let { values: C, max: w } = a(n), [T, E] = t(0), D = e([]), O = Math.min(T, Math.max(0, n.length - 1)), k = (e) => {
|
|
31
|
-
if (!n.length) return;
|
|
32
|
-
let t = Math.max(0, Math.min(e, n.length - 1));
|
|
33
|
-
E(t), D.current[t]?.focus();
|
|
34
|
-
};
|
|
35
|
-
return /* @__PURE__ */ i("div", {
|
|
36
|
-
class: `rv-distribution-chart rv-distribution-chart--${s} ${d}`.trim(),
|
|
37
|
-
role: "group",
|
|
38
|
-
"aria-label": o,
|
|
39
|
-
"data-empty": n.length ? void 0 : "true",
|
|
40
|
-
children: [
|
|
41
|
-
/* @__PURE__ */ i("div", {
|
|
42
|
-
class: "rv-distribution-chart__region",
|
|
43
|
-
style: { height: `${Math.max(40, Math.min(240, u))}px` },
|
|
44
|
-
children: [
|
|
45
|
-
f && /* @__PURE__ */ r("div", {
|
|
46
|
-
class: "rv-distribution-chart__grid",
|
|
47
|
-
"aria-hidden": "true",
|
|
48
|
-
children: [
|
|
49
|
-
0,
|
|
50
|
-
1,
|
|
51
|
-
2,
|
|
52
|
-
3,
|
|
53
|
-
4
|
|
54
|
-
].map((e) => /* @__PURE__ */ r("span", {}, e))
|
|
55
|
-
}),
|
|
56
|
-
S,
|
|
57
|
-
/* @__PURE__ */ r("div", {
|
|
58
|
-
class: "rv-distribution-chart__data",
|
|
59
|
-
role: "list",
|
|
60
|
-
children: n.map((e, t) => {
|
|
61
|
-
let a = b?.[t], o = !a;
|
|
62
|
-
return /* @__PURE__ */ i("span", {
|
|
63
|
-
ref: (e) => {
|
|
64
|
-
D.current[t] = e;
|
|
65
|
-
},
|
|
66
|
-
class: `rv-distribution-chart__datum${e.selected ? " is-selected" : ""}${o ? " is-bar" : " is-point"}`,
|
|
67
|
-
role: "listitem",
|
|
68
|
-
tabIndex: t === O ? 0 : -1,
|
|
69
|
-
"aria-label": c(e.tooltip),
|
|
70
|
-
style: o ? void 0 : {
|
|
71
|
-
left: `${a.x}%`,
|
|
72
|
-
top: `${a.y}%`
|
|
73
|
-
},
|
|
74
|
-
onFocus: () => E(t),
|
|
75
|
-
onKeyDown: (e) => {
|
|
76
|
-
e.key === "ArrowRight" || e.key === "ArrowDown" ? (e.preventDefault(), k(t + 1)) : e.key === "ArrowLeft" || e.key === "ArrowUp" ? (e.preventDefault(), k(t - 1)) : e.key === "Home" ? (e.preventDefault(), k(0)) : e.key === "End" && (e.preventDefault(), k(n.length - 1));
|
|
77
|
-
},
|
|
78
|
-
children: [
|
|
79
|
-
x(e, t),
|
|
80
|
-
m && /* @__PURE__ */ r("span", {
|
|
81
|
-
class: "rv-distribution-chart__value",
|
|
82
|
-
style: o ? {
|
|
83
|
-
top: `${100 - Math.max(3, C[t] / w * 100)}%`,
|
|
84
|
-
transform: "translate(-50%, -100%)"
|
|
85
|
-
} : void 0,
|
|
86
|
-
"aria-hidden": "true",
|
|
87
|
-
children: g(e.value)
|
|
88
|
-
}),
|
|
89
|
-
_ && /* @__PURE__ */ i("span", {
|
|
90
|
-
class: `rv-distribution-chart__tooltip rv-distribution-chart__tooltip--${v}`,
|
|
91
|
-
role: "tooltip",
|
|
92
|
-
children: [v !== "none" && /* @__PURE__ */ r("i", { "aria-hidden": "true" }), y ? y(e, t) : l(e.tooltip)]
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
}, e.key);
|
|
96
|
-
})
|
|
97
|
-
})
|
|
98
|
-
]
|
|
99
|
-
}),
|
|
100
|
-
p && /* @__PURE__ */ r("div", {
|
|
101
|
-
class: `rv-distribution-chart__labels${s === "bar" ? " is-bar" : ""}`,
|
|
102
|
-
"aria-hidden": "true",
|
|
103
|
-
children: n.map((e) => /* @__PURE__ */ r("span", {
|
|
104
|
-
title: e.tooltip.title,
|
|
105
|
-
children: e.tooltip.title
|
|
106
|
-
}, e.key))
|
|
107
|
-
}),
|
|
108
|
-
h && /* @__PURE__ */ i("div", {
|
|
109
|
-
class: "rv-distribution-chart__legend",
|
|
110
|
-
children: [/* @__PURE__ */ r("i", { "aria-hidden": "true" }), h]
|
|
111
|
-
})
|
|
112
|
-
]
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
function d({ children: e }) {
|
|
116
|
-
return /* @__PURE__ */ r("svg", {
|
|
117
|
-
class: "rv-distribution-chart__plot",
|
|
118
|
-
viewBox: "0 0 100 100",
|
|
119
|
-
preserveAspectRatio: "none",
|
|
120
|
-
"aria-hidden": "true",
|
|
121
|
-
focusable: "false",
|
|
122
|
-
children: e
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
//#endregion
|
|
126
|
-
export { s as i, d as n, a as r, u as t };
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { SvgIcon as e } from "../icons/icon.js";
|
|
2
|
-
import { ButtonControl as t } from "../native-control.js";
|
|
3
|
-
import { TooltipController as n } from "../surfaces.js";
|
|
4
|
-
import { RemoveButton as r } from "../buttons/remove-button.js";
|
|
5
|
-
import { useLayoutEffect as i, useRef as a } from "preact/hooks";
|
|
6
|
-
import { jsx as o, jsxs as s } from "preact/jsx-runtime";
|
|
7
|
-
//#region ../../node_modules/.pnpm/@fortawesome+fontawesome-free@7.3.1/node_modules/@fortawesome/fontawesome-free/svgs/solid/circle-info.svg?raw
|
|
8
|
-
var c = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM224 160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-8 64l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"/></svg>";
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/choice-chips/index.tsx
|
|
11
|
-
function l({ value: e, options: t, onChange: n, ariaLabel: r, appearance: i = "soft", size: a = "medium", className: s = "", itemClassName: c = "", disabled: l = !1, testId: u }) {
|
|
12
|
-
let f = Array.isArray(e) ? e : e === void 0 ? [] : [e];
|
|
13
|
-
return /* @__PURE__ */ o("div", {
|
|
14
|
-
class: `rv-choice-chips rv-choice-chips--${i} rv-choice-chips--${a} ${s}`.trim(),
|
|
15
|
-
role: "group",
|
|
16
|
-
"aria-label": r,
|
|
17
|
-
"data-testid": u,
|
|
18
|
-
children: t.map((e) => {
|
|
19
|
-
let t = f.includes(e.value), r = l || !!e.disabled;
|
|
20
|
-
return /* @__PURE__ */ o(d, {
|
|
21
|
-
className: `${c} ${e.className ?? ""}`.trim(),
|
|
22
|
-
style: e.style,
|
|
23
|
-
color: e.color,
|
|
24
|
-
selected: t,
|
|
25
|
-
"aria-label": e.ariaLabel,
|
|
26
|
-
title: e.title,
|
|
27
|
-
disabled: r,
|
|
28
|
-
"data-value": String(e.value),
|
|
29
|
-
"data-testid": e.testId,
|
|
30
|
-
onSelect: () => {
|
|
31
|
-
r || n(e.value, e);
|
|
32
|
-
},
|
|
33
|
-
info: e.info,
|
|
34
|
-
onRemove: e.onRemove,
|
|
35
|
-
removeLabel: e.removeLabel,
|
|
36
|
-
children: e.label
|
|
37
|
-
}, String(e.value));
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function u({ "data-tooltip": r, title: s, ref: l, ...u }) {
|
|
42
|
-
let d = a(null), f = r ?? (typeof s == "object" ? s.value : s);
|
|
43
|
-
return i(() => {
|
|
44
|
-
if (!d.current || !f) return;
|
|
45
|
-
let e = new n();
|
|
46
|
-
return e.bind(d.current, f, { trigger: "click" }), () => e.destroy();
|
|
47
|
-
}, [f]), /* @__PURE__ */ o(t, {
|
|
48
|
-
...u,
|
|
49
|
-
type: "button",
|
|
50
|
-
ref: (e) => {
|
|
51
|
-
d.current = e, typeof l == "function" ? l(e) : l && (l.current = e);
|
|
52
|
-
},
|
|
53
|
-
class: `rv-choice-chip-info ${u.className ?? u.class ?? ""}`.trim(),
|
|
54
|
-
children: /* @__PURE__ */ o(e, {
|
|
55
|
-
svg: c,
|
|
56
|
-
size: 12
|
|
57
|
-
})
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
function d({ children: e, color: t, selected: n, onSelect: i, info: a, onRemove: c, removeLabel: l, removeClassName: u = "", className: d = "", disabled: f, ...p }) {
|
|
61
|
-
let m = t ? typeof p.style == "string" ? `${p.style};--rv-choice-chip-color:${t}` : {
|
|
62
|
-
...p.style,
|
|
63
|
-
"--rv-choice-chip-color": t
|
|
64
|
-
} : p.style;
|
|
65
|
-
return !a && !c && i ? /* @__PURE__ */ o("button", {
|
|
66
|
-
...p,
|
|
67
|
-
style: m,
|
|
68
|
-
"data-color": t ? "true" : void 0,
|
|
69
|
-
type: "button",
|
|
70
|
-
class: `rv-choice-chip ${d}`.trim(),
|
|
71
|
-
"aria-pressed": n,
|
|
72
|
-
disabled: f,
|
|
73
|
-
onClick: i,
|
|
74
|
-
children: e
|
|
75
|
-
}) : /* @__PURE__ */ s("span", {
|
|
76
|
-
class: `rv-choice-chip rv-choice-chip--composite ${d}`.trim(),
|
|
77
|
-
role: p.role,
|
|
78
|
-
style: m,
|
|
79
|
-
"data-color": t ? "true" : void 0,
|
|
80
|
-
"data-selected": n ? "true" : void 0,
|
|
81
|
-
"aria-disabled": f || void 0,
|
|
82
|
-
children: [
|
|
83
|
-
i ? /* @__PURE__ */ o("button", {
|
|
84
|
-
...p,
|
|
85
|
-
type: "button",
|
|
86
|
-
class: "rv-choice-chip-label",
|
|
87
|
-
"aria-pressed": n,
|
|
88
|
-
disabled: f,
|
|
89
|
-
onClick: i,
|
|
90
|
-
children: e
|
|
91
|
-
}) : /* @__PURE__ */ o("span", {
|
|
92
|
-
class: "rv-choice-chip-label",
|
|
93
|
-
children: e
|
|
94
|
-
}),
|
|
95
|
-
a,
|
|
96
|
-
c && /* @__PURE__ */ o(r, {
|
|
97
|
-
compact: !0,
|
|
98
|
-
className: u,
|
|
99
|
-
disabled: typeof f == "object" ? f.value : f,
|
|
100
|
-
locale: {
|
|
101
|
-
title: l ?? "Remove",
|
|
102
|
-
ariaLabel: l ?? "Remove"
|
|
103
|
-
},
|
|
104
|
-
onClick: c
|
|
105
|
-
})
|
|
106
|
-
]
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
//#endregion
|
|
110
|
-
export { u as n, l as r, d as t };
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { ButtonControl as e, Input as t } from "../native-control.js";
|
|
2
|
-
import { createControlId as n } from "../core/control-id.js";
|
|
3
|
-
import { t as r } from "./chevron-down-GbplLa6s.js";
|
|
4
|
-
import { n as i, t as a } from "./color-palette-BmZ7kH9R.js";
|
|
5
|
-
import { COLOR_PICKER_DEFAULT_COLOR as o } from "../color-palette/color-picker.constants.js";
|
|
6
|
-
import { useEffect as s, useRef as c, useState as l } from "preact/hooks";
|
|
7
|
-
import { jsx as u, jsxs as d } from "preact/jsx-runtime";
|
|
8
|
-
//#region ../../node_modules/.pnpm/@fortawesome+fontawesome-free@7.3.1/node_modules/@fortawesome/fontawesome-free/svgs/solid/ban.svg?raw
|
|
9
|
-
var f = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M367.2 412.5L99.5 144.8c-22.4 31.4-35.5 69.8-35.5 111.2 0 106 86 192 192 192 41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3c22.4-31.4 35.5-69.8 35.5-111.2 0-106-86-192-192-192-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0z\"/></svg>", p = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M512 256c0 .9 0 1.8 0 2.7-.4 36.5-33.6 61.3-70.1 61.3L344 320c-26.5 0-48 21.5-48 48 0 3.4 .4 6.7 1 9.9 2.1 10.2 6.5 20 10.8 29.9 6.1 13.8 12.1 27.5 12.1 42 0 31.8-21.6 60.7-53.4 62-3.5 .1-7 .2-10.6 .2-141.4 0-256-114.6-256-256S114.6 0 256 0 512 114.6 512 256zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"/></svg>";
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/color-palette/color-picker.tsx
|
|
12
|
-
function m({ icon: e, className: t = "rv-format-icon rv-format-color-picker__icon" }) {
|
|
13
|
-
return /* @__PURE__ */ u("span", {
|
|
14
|
-
class: t,
|
|
15
|
-
"aria-hidden": "true",
|
|
16
|
-
dangerouslySetInnerHTML: { __html: e }
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
function h({ label: h, value: g, defaultLabel: _, customLabel: v, customHexLabel: y, invalidColor: b, colorLabels: x, optional: S = !0, allowHexInput: C = !0, disabled: w = !1, onChange: T }) {
|
|
20
|
-
let [E] = l(n), D = `rv-format-color-popover-${E}`, O = `rv-format-color-custom-${E}`, k = `rv-format-color-error-${E}`, A = `--rv-format-color-anchor-${E}`, j = c(null), [M, N] = l(!1), [P, F] = l(!1), [I, L] = l(g ?? o), [R, z] = l(!1);
|
|
21
|
-
s(() => {
|
|
22
|
-
L(g ?? o), z(!1);
|
|
23
|
-
}, [g]);
|
|
24
|
-
let B = (e) => {
|
|
25
|
-
let t = i(e);
|
|
26
|
-
t ? (z(!1), L(t), w || T(t)) : z(!0);
|
|
27
|
-
}, V = () => j.current?.hidePopover?.();
|
|
28
|
-
return s(() => {
|
|
29
|
-
w && (V(), N(!1));
|
|
30
|
-
}, [w]), /* @__PURE__ */ d("div", {
|
|
31
|
-
class: "rv-format-color-picker",
|
|
32
|
-
onKeyDownCapture: (e) => {
|
|
33
|
-
e.key === "Escape" && j.current?.matches(":popover-open") && (e.preventDefault(), e.stopPropagation(), V());
|
|
34
|
-
},
|
|
35
|
-
children: [/* @__PURE__ */ d(e, {
|
|
36
|
-
unstyled: !0,
|
|
37
|
-
type: "button",
|
|
38
|
-
class: "rv-format-color-picker__trigger",
|
|
39
|
-
"aria-label": `${h}: ${g?.toUpperCase() ?? _}`,
|
|
40
|
-
"aria-haspopup": "dialog",
|
|
41
|
-
"aria-expanded": M,
|
|
42
|
-
"aria-controls": D,
|
|
43
|
-
title: h,
|
|
44
|
-
disabled: w,
|
|
45
|
-
popovertarget: D,
|
|
46
|
-
style: `anchor-name: ${A}`,
|
|
47
|
-
children: [
|
|
48
|
-
/* @__PURE__ */ u("span", {
|
|
49
|
-
class: `rv-format-color-picker__trigger-swatch${g ? "" : " rv-format-color-picker__trigger-swatch--empty"}`,
|
|
50
|
-
style: g ? { backgroundColor: g } : void 0,
|
|
51
|
-
children: g ? null : /* @__PURE__ */ u(m, {
|
|
52
|
-
icon: f,
|
|
53
|
-
className: "rv-format-color-picker__empty-icon"
|
|
54
|
-
})
|
|
55
|
-
}),
|
|
56
|
-
/* @__PURE__ */ u("span", {
|
|
57
|
-
class: "rv-format-color-picker__trigger-value",
|
|
58
|
-
children: g?.toUpperCase() ?? _
|
|
59
|
-
}),
|
|
60
|
-
/* @__PURE__ */ u(m, { icon: r })
|
|
61
|
-
]
|
|
62
|
-
}), /* @__PURE__ */ d("div", {
|
|
63
|
-
id: D,
|
|
64
|
-
ref: j,
|
|
65
|
-
class: "rv-format-color-picker__popover",
|
|
66
|
-
role: "dialog",
|
|
67
|
-
"aria-label": h,
|
|
68
|
-
popover: "auto",
|
|
69
|
-
style: `position-anchor: ${A}`,
|
|
70
|
-
onToggle: (e) => N(e.currentTarget.matches(":popover-open")),
|
|
71
|
-
children: [
|
|
72
|
-
/* @__PURE__ */ u(a, {
|
|
73
|
-
value: i(g) ?? g ?? null,
|
|
74
|
-
ariaLabel: h,
|
|
75
|
-
defaultLabel: _,
|
|
76
|
-
colorAriaLabel: (e) => x[e.value] ?? e.label,
|
|
77
|
-
includeDefault: S,
|
|
78
|
-
disabled: w,
|
|
79
|
-
onChange: (e) => {
|
|
80
|
-
w || (T(e ?? void 0), V());
|
|
81
|
-
}
|
|
82
|
-
}),
|
|
83
|
-
/* @__PURE__ */ d("div", {
|
|
84
|
-
id: O,
|
|
85
|
-
class: "rv-format-color-picker__custom-controls",
|
|
86
|
-
"data-selection-only": !C || void 0,
|
|
87
|
-
hidden: !P,
|
|
88
|
-
children: [
|
|
89
|
-
/* @__PURE__ */ u(t, {
|
|
90
|
-
type: "color",
|
|
91
|
-
disabled: w,
|
|
92
|
-
class: "rv-format-color-picker__native",
|
|
93
|
-
"aria-label": v,
|
|
94
|
-
title: v,
|
|
95
|
-
value: i(I) ?? o,
|
|
96
|
-
onInput: (e) => B(e.currentTarget.value)
|
|
97
|
-
}),
|
|
98
|
-
C ? /* @__PURE__ */ u(t, {
|
|
99
|
-
type: "text",
|
|
100
|
-
disabled: w,
|
|
101
|
-
class: "rv-control rv-format-color-picker__hex",
|
|
102
|
-
inputMode: "text",
|
|
103
|
-
maxLength: 7,
|
|
104
|
-
"aria-label": y,
|
|
105
|
-
"aria-invalid": R,
|
|
106
|
-
"aria-describedby": R ? k : void 0,
|
|
107
|
-
title: y,
|
|
108
|
-
value: I.toUpperCase(),
|
|
109
|
-
onInput: (e) => {
|
|
110
|
-
L(e.currentTarget.value), R && z(!1);
|
|
111
|
-
},
|
|
112
|
-
onChange: (e) => B(e.currentTarget.value)
|
|
113
|
-
}) : null,
|
|
114
|
-
C && R ? /* @__PURE__ */ u("span", {
|
|
115
|
-
id: k,
|
|
116
|
-
class: "rv-format-color-picker__error",
|
|
117
|
-
role: "alert",
|
|
118
|
-
children: b
|
|
119
|
-
}) : null
|
|
120
|
-
]
|
|
121
|
-
}),
|
|
122
|
-
/* @__PURE__ */ d(e, {
|
|
123
|
-
unstyled: !0,
|
|
124
|
-
type: "button",
|
|
125
|
-
class: "rv-format-color-picker__custom-action",
|
|
126
|
-
disabled: w,
|
|
127
|
-
"aria-expanded": P,
|
|
128
|
-
"aria-controls": O,
|
|
129
|
-
title: v,
|
|
130
|
-
onClick: () => F((e) => !e),
|
|
131
|
-
children: [/* @__PURE__ */ u(m, { icon: p }), v]
|
|
132
|
-
})
|
|
133
|
-
]
|
|
134
|
-
})]
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
//#endregion
|
|
138
|
-
export { h as t };
|