@selectwin/kit 0.1.258 → 0.1.259
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/README.md +31 -0
- package/dist/SelectActionBar.d.ts +29 -0
- package/dist/SelectActionBar.js +101 -0
- package/dist/SelectBadge.d.ts +9 -0
- package/dist/SelectBadge.js +26 -12
- package/dist/SelectBulkBar.d.ts +21 -0
- package/dist/SelectBulkBar.js +40 -0
- package/dist/SelectChannelPreview.d.ts +21 -1
- package/dist/SelectChannelPreview.js +100 -73
- package/dist/SelectColorField.d.ts +1 -5
- package/dist/SelectColorField.js +83 -101
- package/dist/SelectCombobox.d.ts +5 -0
- package/dist/SelectCombobox.js +52 -49
- package/dist/SelectDataTable.d.ts +17 -1
- package/dist/SelectDataTable.js +100 -90
- package/dist/SelectDeadlineBadge.d.ts +32 -0
- package/dist/SelectDeadlineBadge.js +73 -0
- package/dist/SelectFilterBar.js +5 -5
- package/dist/SelectListCard.d.ts +27 -1
- package/dist/SelectListCard.js +47 -22
- package/dist/SelectLocale.d.ts +62 -0
- package/dist/SelectLocale.js +173 -0
- package/dist/SelectMail.d.ts +9 -1
- package/dist/SelectMail.js +234 -207
- package/dist/SelectSection.d.ts +4 -4
- package/dist/SelectSection.js +77 -8
- package/dist/SelectTable.d.ts +13 -1
- package/dist/SelectTable.js +88 -79
- package/dist/SelectTabs.d.ts +10 -0
- package/dist/SelectTabs.js +68 -30
- package/dist/SelectWeekHours.d.ts +64 -0
- package/dist/SelectWeekHours.js +338 -0
- package/dist/index.d.ts +12 -2
- package/dist/index.js +188 -183
- package/dist/internal/color.d.ts +15 -0
- package/dist/internal/color.js +40 -0
- package/dist/internal/safeHref.d.ts +7 -0
- package/dist/internal/safeHref.js +12 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SelectLocaleCode } from './SelectLocale';
|
|
3
|
+
export type SelectWeekday = 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
|
|
4
|
+
/** Uma faixa do dia, em `HH:MM` (o fim pode ser `24:00`, o fim do dia). */
|
|
5
|
+
export interface SelectTimeRange {
|
|
6
|
+
from: string;
|
|
7
|
+
to: string;
|
|
8
|
+
}
|
|
9
|
+
/** O horário da semana: as faixas de cada dia; o dia ausente (ou vazio) é fechado. */
|
|
10
|
+
export type SelectWeekHoursValue = Partial<Record<SelectWeekday, readonly SelectTimeRange[]>>;
|
|
11
|
+
/** Uma data a mais (o municipal, o ponto facultativo): `YYYY-MM-DD` e o nome. */
|
|
12
|
+
export interface SelectHoliday {
|
|
13
|
+
date: string;
|
|
14
|
+
name: string;
|
|
15
|
+
}
|
|
16
|
+
/** O problema de um dia: a faixa sem as duas horas, a que termina antes de começar, as que se cruzam, as faixas demais. */
|
|
17
|
+
export type SelectWeekHoursProblem = 'empty' | 'order' | 'overlap' | 'many';
|
|
18
|
+
export declare const SELECT_WEEKDAYS: readonly SelectWeekday[];
|
|
19
|
+
/** `HH:MM` em minutos do dia; `null` quando não é uma hora. PURA. */
|
|
20
|
+
export declare function selectTimeMinutes(hhmm: string): number | null;
|
|
21
|
+
/** Os dias na ordem da tela: a semana começa na segunda (o padrão) ou no domingo. PURA. */
|
|
22
|
+
export declare function selectWeekOrder(weekStart?: 'mon' | 'sun'): SelectWeekday[];
|
|
23
|
+
/**
|
|
24
|
+
* Os problemas de cada dia (só os dias com problema aparecem), as mesmas regras do horário da API: as duas horas em
|
|
25
|
+
* `HH:MM`, o fim depois do começo, nada cruzando e até `max` faixas (padrão 6). PURA.
|
|
26
|
+
*/
|
|
27
|
+
export declare function selectWeekHoursProblems(value: SelectWeekHoursValue, max?: number): Partial<Record<SelectWeekday, SelectWeekHoursProblem>>;
|
|
28
|
+
/** O horário de `from` copiado para os outros dias (`to`); os outros ficam como estavam. PURA. */
|
|
29
|
+
export declare function selectCopyDay(value: SelectWeekHoursValue, from: SelectWeekday, to: readonly SelectWeekday[]): SelectWeekHoursValue;
|
|
30
|
+
/** A faixa nova depois das de um dia: uma hora depois da última, por quatro horas (até o fim do dia); `null` sem lugar. PURA. */
|
|
31
|
+
export declare function selectNextRange(ranges: readonly SelectTimeRange[], fallback: SelectTimeRange): SelectTimeRange | null;
|
|
32
|
+
/**
|
|
33
|
+
* A semana como texto, agrupando os dias seguidos com o mesmo horário: `[{ days: 'Segunda a sexta', hours: '08:00 às
|
|
34
|
+
* 12:00, 13:00 às 18:00' }, { days: 'Sábado e domingo', hours: 'Fechado' }]`. PURA (a língua do kit).
|
|
35
|
+
*/
|
|
36
|
+
export declare function selectWeekHoursLines(value: SelectWeekHoursValue, locale?: SelectLocaleCode, weekStart?: 'mon' | 'sun'): Array<{
|
|
37
|
+
days: string;
|
|
38
|
+
hours: string;
|
|
39
|
+
}>;
|
|
40
|
+
export interface SelectWeekHoursProps {
|
|
41
|
+
/** As faixas de cada dia; o dia ausente (ou vazio) é fechado. */
|
|
42
|
+
value: SelectWeekHoursValue;
|
|
43
|
+
/** O horário novo, a cada mudança (inclusive com problema: quem grava confere com `selectWeekHoursProblems`). */
|
|
44
|
+
onChange: (next: SelectWeekHoursValue) => void;
|
|
45
|
+
/** As datas a mais (o municipal, o ponto facultativo). Com `onHolidaysChange`, a seção dos feriados aparece. */
|
|
46
|
+
holidays?: readonly SelectHoliday[];
|
|
47
|
+
onHolidaysChange?: (next: SelectHoliday[]) => void;
|
|
48
|
+
/** No topo da seção dos feriados: o que vale sempre (os nacionais, a UF, o município) — o app desenha. */
|
|
49
|
+
holidaysNote?: ReactNode;
|
|
50
|
+
/** A semana começa na segunda (o padrão) ou no domingo. */
|
|
51
|
+
weekStart?: 'mon' | 'sun';
|
|
52
|
+
/** A faixa do dia que abre sem faixa guardada (padrão das 08:00 às 18:00). */
|
|
53
|
+
defaultRange?: SelectTimeRange;
|
|
54
|
+
/** O teto de faixas por dia (padrão 6, o da API do CRM). */
|
|
55
|
+
maxRanges?: number;
|
|
56
|
+
/** Só para ler: a semana como texto (os dias seguidos com o mesmo horário juntos), sem os campos. */
|
|
57
|
+
readOnly?: boolean;
|
|
58
|
+
/** Tudo apagado (enquanto grava). */
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
/** O nome do editor (padrão "Horário da semana"): a legenda do grupo, para o leitor de tela. */
|
|
61
|
+
label?: string;
|
|
62
|
+
className?: string;
|
|
63
|
+
}
|
|
64
|
+
export declare function SelectWeekHours({ value, onChange, holidays, onHolidaysChange, holidaysNote, weekStart, defaultRange, maxRanges, readOnly, disabled, label, className, }: SelectWeekHoursProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { SelectButton as e } from "./SelectButton.js";
|
|
2
|
+
import { CloseIcon as t, PlusIcon as n } from "./icons.js";
|
|
3
|
+
import { selectIntlLocale as r, selectKitMessages as i, useSelectLocale as a, useSelectMessages as o } from "./SelectLocale.js";
|
|
4
|
+
import { SelectField as s } from "./SelectField.js";
|
|
5
|
+
import { SelectSwitch as c } from "./SelectSwitch.js";
|
|
6
|
+
import { SelectBadge as l } from "./SelectBadge.js";
|
|
7
|
+
import { SelectIconButton as u } from "./SelectIconButton.js";
|
|
8
|
+
import { SelectDateField as d } from "./SelectDateField.js";
|
|
9
|
+
import { SelectRowActions as f } from "./SelectRowActions.js";
|
|
10
|
+
import { useId as p, useRef as m, useState as h } from "react";
|
|
11
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
12
|
+
//#region src/SelectWeekHours.tsx
|
|
13
|
+
var y = [
|
|
14
|
+
"mon",
|
|
15
|
+
"tue",
|
|
16
|
+
"wed",
|
|
17
|
+
"thu",
|
|
18
|
+
"fri",
|
|
19
|
+
"sat",
|
|
20
|
+
"sun"
|
|
21
|
+
], b = [
|
|
22
|
+
"mon",
|
|
23
|
+
"tue",
|
|
24
|
+
"wed",
|
|
25
|
+
"thu",
|
|
26
|
+
"fri"
|
|
27
|
+
], x = /^([01]\d|2[0-3]):([0-5]\d)$|^24:00$/;
|
|
28
|
+
function S(e) {
|
|
29
|
+
return x.test(e) ? Number(e.slice(0, 2)) * 60 + Number(e.slice(3, 5)) : null;
|
|
30
|
+
}
|
|
31
|
+
var C = (e) => `${String(Math.floor(e / 60)).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`;
|
|
32
|
+
function w(e = "mon") {
|
|
33
|
+
return e === "sun" ? ["sun", ...y.slice(0, 6)] : [...y];
|
|
34
|
+
}
|
|
35
|
+
function T(e, t = 6) {
|
|
36
|
+
let n = {};
|
|
37
|
+
for (let r of y) {
|
|
38
|
+
let i = e[r] ?? [];
|
|
39
|
+
if (i.length > t) {
|
|
40
|
+
n[r] = "many";
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
let a = i.map((e) => [S(e.from), S(e.to)]);
|
|
44
|
+
if (a.some(([e, t]) => e === null || t === null)) {
|
|
45
|
+
n[r] = "empty";
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (a.some(([e, t]) => t <= e)) {
|
|
49
|
+
n[r] = "order";
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
let o = [...a].sort((e, t) => e[0] - t[0]);
|
|
53
|
+
o.some(([e], t) => t > 0 && e < o[t - 1][1]) && (n[r] = "overlap");
|
|
54
|
+
}
|
|
55
|
+
return n;
|
|
56
|
+
}
|
|
57
|
+
function E(e, t, n) {
|
|
58
|
+
let r = e[t] ?? [], i = { ...e };
|
|
59
|
+
for (let e of n) e !== t && (r.length ? i[e] = r.map((e) => ({ ...e })) : delete i[e]);
|
|
60
|
+
return i;
|
|
61
|
+
}
|
|
62
|
+
function D(e, t) {
|
|
63
|
+
if (!e.length) return { ...t };
|
|
64
|
+
let n = e.map((e) => S(e.to)).filter((e) => e !== null), r = n.length ? Math.max(...n) : 0, i = Math.min(r + 60, 1380);
|
|
65
|
+
return i <= r ? null : {
|
|
66
|
+
from: C(i),
|
|
67
|
+
to: C(Math.min(i + 240, 1439))
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function O(e, t) {
|
|
71
|
+
let n = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
|
|
72
|
+
return n ? new Intl.DateTimeFormat(r(t), {
|
|
73
|
+
day: "2-digit",
|
|
74
|
+
month: "2-digit",
|
|
75
|
+
year: "numeric",
|
|
76
|
+
timeZone: "UTC"
|
|
77
|
+
}).format(new Date(Date.UTC(Number(n[1]), Number(n[2]) - 1, Number(n[3])))) : e;
|
|
78
|
+
}
|
|
79
|
+
function k(e, t = "pt-BR", n = "mon") {
|
|
80
|
+
let r = i[t].weekHours, a = (t) => (e[t] ?? []).map((e) => `${e.from}-${e.to}`).join(","), o = w(n), s = [];
|
|
81
|
+
for (let e of o) {
|
|
82
|
+
let t = s[s.length - 1];
|
|
83
|
+
t && a(t[0]) === a(e) ? t.push(e) : s.push([e]);
|
|
84
|
+
}
|
|
85
|
+
return s.map((t) => {
|
|
86
|
+
let n = t[0], i = t[t.length - 1], a = t.length === 1 ? r.days[n] : t.length === 2 ? r.pair(r.span[n], r.span[i]) : r.through(r.span[n], r.span[i]), o = e[n] ?? [];
|
|
87
|
+
return {
|
|
88
|
+
days: a,
|
|
89
|
+
hours: o.length ? o.map((e) => r.range(e.from, e.to)).join(", ") : r.closed
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function A({ value: r, onChange: i, holidays: s = [], onHolidaysChange: l, holidaysNote: d, weekStart: x = "mon", defaultRange: S = {
|
|
94
|
+
from: "08:00",
|
|
95
|
+
to: "18:00"
|
|
96
|
+
}, maxRanges: C = 6, readOnly: A = !1, disabled: M = !1, label: N, className: P }) {
|
|
97
|
+
let F = a(), I = o().weekHours, L = p(), R = m({}), [z, B] = h(""), V = w(x), H = T(r, C), U = `select-weekhours${A ? " select-weekhours--readonly" : ""}${P ? " " + P : ""}`;
|
|
98
|
+
if (A) {
|
|
99
|
+
let e = k(r, F, x);
|
|
100
|
+
return /* @__PURE__ */ v("div", {
|
|
101
|
+
className: U,
|
|
102
|
+
role: "group",
|
|
103
|
+
"aria-label": N ?? I.label,
|
|
104
|
+
children: [/* @__PURE__ */ _("dl", {
|
|
105
|
+
className: "select-weekhours__summary",
|
|
106
|
+
children: e.map((e) => /* @__PURE__ */ v("div", {
|
|
107
|
+
className: "select-weekhours__line",
|
|
108
|
+
children: [/* @__PURE__ */ _("dt", { children: e.days }), /* @__PURE__ */ _("dd", {
|
|
109
|
+
className: e.hours === I.closed ? "is-closed" : void 0,
|
|
110
|
+
children: e.hours
|
|
111
|
+
})]
|
|
112
|
+
}, e.days))
|
|
113
|
+
}), d || s.length ? /* @__PURE__ */ v("div", {
|
|
114
|
+
className: "select-weekhours__holidays",
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ _("span", {
|
|
117
|
+
className: "select-weekhours__subtitle",
|
|
118
|
+
children: I.holidays
|
|
119
|
+
}),
|
|
120
|
+
d ? /* @__PURE__ */ _("div", {
|
|
121
|
+
className: "select-weekhours__note",
|
|
122
|
+
children: d
|
|
123
|
+
}) : null,
|
|
124
|
+
s.length ? /* @__PURE__ */ _("ul", {
|
|
125
|
+
className: "select-weekhours__dates",
|
|
126
|
+
children: [...s].sort((e, t) => e.date.localeCompare(t.date)).map((e) => /* @__PURE__ */ _("li", { children: I.holiday(O(e.date, F), e.name) }, e.date))
|
|
127
|
+
}) : null
|
|
128
|
+
]
|
|
129
|
+
}) : null]
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
let W = (e, t) => {
|
|
133
|
+
let n = { ...r };
|
|
134
|
+
t.length ? n[e] = t : delete n[e], i(n);
|
|
135
|
+
}, G = (e, t) => {
|
|
136
|
+
let n = r[e] ?? [];
|
|
137
|
+
if (t) {
|
|
138
|
+
let t = R.current[e];
|
|
139
|
+
W(e, t && t.length ? t : [{ ...S }]);
|
|
140
|
+
} else R.current[e] = n, W(e, []);
|
|
141
|
+
}, K = (e, t, n) => {
|
|
142
|
+
i(E(r, e, t)), B(I.copied(I.days[e], n));
|
|
143
|
+
};
|
|
144
|
+
return /* @__PURE__ */ v("fieldset", {
|
|
145
|
+
className: U,
|
|
146
|
+
disabled: M,
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ _("legend", {
|
|
149
|
+
className: "select-visually-hidden",
|
|
150
|
+
children: N ?? I.label
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ _("div", {
|
|
153
|
+
className: "select-weekhours__days",
|
|
154
|
+
children: V.map((i) => {
|
|
155
|
+
let a = r[i] ?? [], o = a.length > 0, s = H[i], l = `${L}-${i}-error`, d = I.days[i], p = D(a, S);
|
|
156
|
+
return /* @__PURE__ */ v("div", {
|
|
157
|
+
className: `select-weekhours__day${o ? "" : " is-closed"}`,
|
|
158
|
+
role: "group",
|
|
159
|
+
"aria-labelledby": `${L}-${i}`,
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ v("div", {
|
|
162
|
+
className: "select-weekhours__dayhead",
|
|
163
|
+
children: [/* @__PURE__ */ _(c, {
|
|
164
|
+
checked: o,
|
|
165
|
+
onChange: (e) => G(i, e),
|
|
166
|
+
label: I.openOn(i),
|
|
167
|
+
disabled: M
|
|
168
|
+
}), /* @__PURE__ */ _("span", {
|
|
169
|
+
className: "select-weekhours__dayname",
|
|
170
|
+
id: `${L}-${i}`,
|
|
171
|
+
children: d
|
|
172
|
+
})]
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ _("div", {
|
|
175
|
+
className: "select-weekhours__ranges",
|
|
176
|
+
children: o ? /* @__PURE__ */ v(g, { children: [
|
|
177
|
+
a.map((e, n) => /* @__PURE__ */ v("div", {
|
|
178
|
+
className: "select-weekhours__range",
|
|
179
|
+
role: "group",
|
|
180
|
+
"aria-label": I.rangeLabel(d, n + 1),
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ _("input", {
|
|
183
|
+
type: "time",
|
|
184
|
+
className: `select-input select-weekhours__time${s ? " select-input--error" : ""}`,
|
|
185
|
+
"aria-label": I.from,
|
|
186
|
+
value: e.from,
|
|
187
|
+
"aria-invalid": s ? !0 : void 0,
|
|
188
|
+
"aria-describedby": s ? l : void 0,
|
|
189
|
+
onChange: (e) => W(i, a.map((t, r) => r === n ? {
|
|
190
|
+
...t,
|
|
191
|
+
from: e.target.value
|
|
192
|
+
} : t))
|
|
193
|
+
}),
|
|
194
|
+
/* @__PURE__ */ _("span", {
|
|
195
|
+
className: "select-weekhours__to",
|
|
196
|
+
"aria-hidden": "true",
|
|
197
|
+
children: I.until
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ _("input", {
|
|
200
|
+
type: "time",
|
|
201
|
+
className: `select-input select-weekhours__time${s ? " select-input--error" : ""}`,
|
|
202
|
+
"aria-label": I.to,
|
|
203
|
+
value: e.to === "24:00" ? "23:59" : e.to,
|
|
204
|
+
"aria-invalid": s ? !0 : void 0,
|
|
205
|
+
"aria-describedby": s ? l : void 0,
|
|
206
|
+
onChange: (e) => W(i, a.map((t, r) => r === n ? {
|
|
207
|
+
...t,
|
|
208
|
+
to: e.target.value
|
|
209
|
+
} : t))
|
|
210
|
+
}),
|
|
211
|
+
/* @__PURE__ */ _(u, {
|
|
212
|
+
icon: /* @__PURE__ */ _(t, {}),
|
|
213
|
+
size: "sm",
|
|
214
|
+
label: I.removeRange(e.from, e.to),
|
|
215
|
+
disabled: M,
|
|
216
|
+
onClick: () => W(i, a.filter((e, t) => t !== n))
|
|
217
|
+
})
|
|
218
|
+
]
|
|
219
|
+
}, n)),
|
|
220
|
+
s ? /* @__PURE__ */ _("p", {
|
|
221
|
+
id: l,
|
|
222
|
+
className: "select-weekhours__error",
|
|
223
|
+
children: I.problems[s]
|
|
224
|
+
}) : null,
|
|
225
|
+
a.length < C && p ? /* @__PURE__ */ _(e, {
|
|
226
|
+
variant: "ghost",
|
|
227
|
+
size: "sm",
|
|
228
|
+
inline: !0,
|
|
229
|
+
icon: /* @__PURE__ */ _(n, {}),
|
|
230
|
+
disabled: M,
|
|
231
|
+
onClick: () => W(i, [...a, p]),
|
|
232
|
+
children: I.addRange
|
|
233
|
+
}) : null
|
|
234
|
+
] }) : /* @__PURE__ */ _("span", {
|
|
235
|
+
className: "select-weekhours__closed",
|
|
236
|
+
children: I.closed
|
|
237
|
+
})
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ _("div", {
|
|
240
|
+
className: "select-weekhours__menu",
|
|
241
|
+
children: /* @__PURE__ */ _(f, {
|
|
242
|
+
label: I.copyMenu(d),
|
|
243
|
+
actions: [{
|
|
244
|
+
content: I.copyWorkdays,
|
|
245
|
+
onAction: () => K(i, b, I.workdays)
|
|
246
|
+
}, {
|
|
247
|
+
content: I.copyAll,
|
|
248
|
+
onAction: () => K(i, y, I.everyDay)
|
|
249
|
+
}]
|
|
250
|
+
})
|
|
251
|
+
})
|
|
252
|
+
]
|
|
253
|
+
}, i);
|
|
254
|
+
})
|
|
255
|
+
}),
|
|
256
|
+
l ? /* @__PURE__ */ _(j, {
|
|
257
|
+
holidays: s,
|
|
258
|
+
onChange: l,
|
|
259
|
+
note: d
|
|
260
|
+
}) : null,
|
|
261
|
+
/* @__PURE__ */ _("span", {
|
|
262
|
+
className: "select-visually-hidden",
|
|
263
|
+
role: "status",
|
|
264
|
+
"aria-live": "polite",
|
|
265
|
+
children: z
|
|
266
|
+
})
|
|
267
|
+
]
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
function j({ holidays: t, onChange: n, note: r }) {
|
|
271
|
+
let i = a(), c = o().weekHours, u = p(), [f, m] = h(""), [g, y] = h(""), b = [...t].sort((e, t) => e.date.localeCompare(t.date)), x = /^\d{4}-\d{2}-\d{2}$/.test(f) && g.trim() !== "", S = () => {
|
|
272
|
+
x && (n([...t.filter((e) => e.date !== f), {
|
|
273
|
+
date: f,
|
|
274
|
+
name: g.trim()
|
|
275
|
+
}].sort((e, t) => e.date.localeCompare(t.date))), m(""), y(""));
|
|
276
|
+
};
|
|
277
|
+
return /* @__PURE__ */ v("div", {
|
|
278
|
+
className: "select-weekhours__holidays",
|
|
279
|
+
role: "group",
|
|
280
|
+
"aria-labelledby": `${u}-title`,
|
|
281
|
+
children: [
|
|
282
|
+
/* @__PURE__ */ _("span", {
|
|
283
|
+
className: "select-weekhours__subtitle",
|
|
284
|
+
id: `${u}-title`,
|
|
285
|
+
children: c.holidays
|
|
286
|
+
}),
|
|
287
|
+
r ? /* @__PURE__ */ _("div", {
|
|
288
|
+
className: "select-weekhours__note",
|
|
289
|
+
children: r
|
|
290
|
+
}) : null,
|
|
291
|
+
b.length ? /* @__PURE__ */ _("ul", {
|
|
292
|
+
className: "select-weekhours__dates",
|
|
293
|
+
children: b.map((e) => {
|
|
294
|
+
let r = c.holiday(O(e.date, i), e.name);
|
|
295
|
+
return /* @__PURE__ */ _("li", { children: /* @__PURE__ */ _(l, {
|
|
296
|
+
onRemove: () => n(t.filter((t) => t.date !== e.date)),
|
|
297
|
+
removeLabel: c.removeHoliday(r),
|
|
298
|
+
children: r
|
|
299
|
+
}) }, e.date);
|
|
300
|
+
})
|
|
301
|
+
}) : /* @__PURE__ */ _("p", {
|
|
302
|
+
className: "select-weekhours__none",
|
|
303
|
+
children: c.noHolidays
|
|
304
|
+
}),
|
|
305
|
+
/* @__PURE__ */ v("div", {
|
|
306
|
+
className: "select-weekhours__adddate",
|
|
307
|
+
children: [
|
|
308
|
+
/* @__PURE__ */ _(d, {
|
|
309
|
+
label: c.date,
|
|
310
|
+
value: f,
|
|
311
|
+
onChange: m,
|
|
312
|
+
clearable: !1
|
|
313
|
+
}),
|
|
314
|
+
/* @__PURE__ */ _(s, {
|
|
315
|
+
label: c.name,
|
|
316
|
+
value: g,
|
|
317
|
+
onChange: (e) => y(e),
|
|
318
|
+
maxLength: 80,
|
|
319
|
+
onKeyDown: (e) => {
|
|
320
|
+
e.key === "Enter" && (e.preventDefault(), S());
|
|
321
|
+
}
|
|
322
|
+
}),
|
|
323
|
+
/* @__PURE__ */ _(e, {
|
|
324
|
+
variant: "secondary",
|
|
325
|
+
inline: !0,
|
|
326
|
+
disabled: !x,
|
|
327
|
+
onClick: S,
|
|
328
|
+
children: c.addHoliday
|
|
329
|
+
})
|
|
330
|
+
]
|
|
331
|
+
})
|
|
332
|
+
]
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
//#endregion
|
|
336
|
+
export { y as SELECT_WEEKDAYS, A as SelectWeekHours, E as selectCopyDay, D as selectNextRange, S as selectTimeMinutes, k as selectWeekHoursLines, T as selectWeekHoursProblems, w as selectWeekOrder };
|
|
337
|
+
|
|
338
|
+
//# sourceMappingURL=SelectWeekHours.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -64,6 +64,16 @@ export type { SelectFieldsetProps } from './SelectFieldset';
|
|
|
64
64
|
export type { SelectNavCount } from './internal/navCount';
|
|
65
65
|
export { useSelectSortable, selectSortableOrder } from './SelectSortable';
|
|
66
66
|
export type { SelectSortable, SelectSortableOptions, SelectSortableHandleProps, SelectSortableItemBinding } from './SelectSortable';
|
|
67
|
+
export type { SelectListRowColumn } from './SelectListCard';
|
|
68
|
+
export type { SelectDeviceFrameBrand } from './SelectChannelPreview';
|
|
69
|
+
export { SelectWeekHours, SELECT_WEEKDAYS, selectWeekHoursProblems, selectWeekHoursLines, selectCopyDay, selectNextRange, selectTimeMinutes, selectWeekOrder, } from './SelectWeekHours';
|
|
70
|
+
export type { SelectWeekHoursProps, SelectWeekHoursValue, SelectWeekHoursProblem, SelectWeekday, SelectTimeRange, SelectHoliday, } from './SelectWeekHours';
|
|
71
|
+
export { SelectActionBar, selectActionBarFit } from './SelectActionBar';
|
|
72
|
+
export type { SelectActionBarProps, SelectActionBarItem } from './SelectActionBar';
|
|
73
|
+
export { SelectDeadlineBadge, selectDeadlineText, selectDurationText } from './SelectDeadlineBadge';
|
|
74
|
+
export type { SelectDeadlineBadgeProps, SelectDeadlineState } from './SelectDeadlineBadge';
|
|
75
|
+
export { SelectBulkBar } from './SelectBulkBar';
|
|
76
|
+
export type { SelectBulkBarProps } from './SelectBulkBar';
|
|
67
77
|
export { SelectPage, SelectPageBackProvider, SelectPageHeader } from './SelectPage';
|
|
68
78
|
export { SelectFormLayout } from './SelectFormLayout';
|
|
69
79
|
export { SelectSkeleton } from './SelectSkeleton';
|
|
@@ -160,7 +170,7 @@ export { SelectRowActions } from './SelectRowActions';
|
|
|
160
170
|
export { SelectConfirmModal } from './SelectConfirmModal';
|
|
161
171
|
export { SelectFormModal } from './SelectFormModal';
|
|
162
172
|
export { detectSelectTheme } from './detectSelectTheme';
|
|
163
|
-
export { SelectDataTable, SELECT_COL_DATETIME, SELECT_COL_ID, useSelectPageSize } from './SelectDataTable';
|
|
173
|
+
export { SelectDataTable, SELECT_COL_DATETIME, SELECT_COL_TIMEAGO, SELECT_COL_ID, useSelectPageSize } from './SelectDataTable';
|
|
164
174
|
export { SelectCardGrid } from './SelectCardGrid';
|
|
165
175
|
export { SelectRecordCard, SelectLayoutThumb, SelectFactList } from './SelectRecordCard';
|
|
166
176
|
export { SelectBreadcrumb } from './SelectBreadcrumb';
|
|
@@ -330,7 +340,7 @@ export type { SelectRadioOption } from './SelectRadioGroup';
|
|
|
330
340
|
export type { SegmentedOption } from './SelectSegmented';
|
|
331
341
|
export type { SelectTab } from './SelectTabs';
|
|
332
342
|
export type { SideNavItem, SideNavSection } from './SelectSideNav';
|
|
333
|
-
export type { SelectColumn } from './SelectTable';
|
|
343
|
+
export type { SelectColumn, SelectTableRowTone } from './SelectTable';
|
|
334
344
|
export type { ComboboxOption } from './SelectCombobox';
|
|
335
345
|
export type { SelectTheme } from './SelectThemeSwitcher';
|
|
336
346
|
export type { SelectToastApi, SelectToastAction, SelectToastVariant } from './SelectToast';
|