@kashi-ui/elements 2.22.0 → 2.23.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/README.md +6 -1
- package/dist/base.js +4 -0
- package/dist/buttons.d.ts +82 -0
- package/dist/buttons.js +487 -0
- package/dist/cards.d.ts +30 -0
- package/dist/cards.js +183 -0
- package/dist/cdn/{appointment-wMGBoHw9.js → appointment-DOXBUwIU.js} +1 -1
- package/dist/cdn/{base-Dg1Mb8Jk.js → base-D4tCOysh.js} +1 -1
- package/dist/cdn/{basic-B5ZxgagA.js → basic-DuY4RslZ.js} +1 -1
- package/dist/cdn/buttons-zhSdiaXr.js +1 -0
- package/dist/cdn/calendar-BulPeVAJ.js +16 -0
- package/dist/cdn/card-BKiwJF34.js +1 -0
- package/dist/cdn/cards-DKarXHsC.js +1 -0
- package/dist/cdn/charts-ETYOAJyB.js +1 -0
- package/dist/cdn/chat-D5ZIMnNp.js +4 -0
- package/dist/cdn/choice-DBvC2Puo.js +1 -0
- package/dist/cdn/{combobox-CBT7yp94.js → combobox-BGuPAAt3.js} +1 -1
- package/dist/cdn/{commerce-CsyixnVK.js → commerce-SzWdpWJG.js} +1 -1
- package/dist/cdn/content-BgfBfy8j.js +1 -0
- package/dist/cdn/controls--OMZkJYe.js +1 -0
- package/dist/cdn/display-BfYWAjNu.js +1 -0
- package/dist/cdn/{fields-Cx84-qz1.js → fields-B-jTUQiI.js} +1 -1
- package/dist/cdn/forms-DgRiYmdV.js +1 -0
- package/dist/cdn/{holidays-DO82gXhM.js → holidays-Cu6IfbTL.js} +1 -1
- package/dist/cdn/hours-CeiVqPKD.js +1 -0
- package/dist/cdn/inputs-BkJ70Xkc.js +1 -0
- package/dist/cdn/kashi-elements.js +1 -1
- package/dist/cdn/legal-id-Mt8FX0fV.js +1 -0
- package/dist/cdn/{map-DlpA916P.js → map-TfSt3CjL.js} +2 -2
- package/dist/cdn/media-BRBINvzU.js +1 -0
- package/dist/cdn/{menu-CqTvk8Ok.js → menu-DTNVFXrb.js} +1 -1
- package/dist/cdn/money-CjGI2VIQ.js +1 -0
- package/dist/cdn/{nav-BHv7H1Fy.js → nav-CT5RVOzy.js} +1 -1
- package/dist/cdn/{overlay-BIEEJ4Sh.js → overlay-DC5-I6hM.js} +1 -1
- package/dist/cdn/parts-5fVaWtRe.js +1 -0
- package/dist/cdn/pickers-BwDRsDRo.js +1 -0
- package/dist/cdn/relative-OC1fV3Xh.js +1 -0
- package/dist/cdn/rich-text-CS6xEim6.js +1 -0
- package/dist/cdn/sheets-eVMx4d-5.js +1 -0
- package/dist/cdn/{table-B5XwDDS9.js → table-tgB4iwcM.js} +1 -1
- package/dist/cdn/{text-Bml-pVjo.js → text-C6fzEBBh.js} +1 -1
- package/dist/cdn/{time-DrXgFeQy.js → time-CkqqUKJv.js} +1 -1
- package/dist/cdn/{time-BQsTSvql.js → time-CwOYrtK-.js} +1 -1
- package/dist/cdn/validate-Dr2f6i6s.js +1 -0
- package/dist/cdn/work-DoNAKgVU.js +1 -0
- package/dist/cdn.js +11 -0
- package/dist/chat.d.ts +127 -0
- package/dist/chat.js +734 -0
- package/dist/choice.d.ts +98 -0
- package/dist/choice.js +597 -0
- package/dist/content.d.ts +164 -0
- package/dist/content.js +726 -0
- package/dist/hours.d.ts +29 -0
- package/dist/hours.js +179 -0
- package/dist/index.d.ts +64 -2
- package/dist/index.js +22 -1
- package/dist/manifest.json +843 -1
- package/dist/media.d.ts +51 -0
- package/dist/media.js +363 -0
- package/dist/parts.d.ts +31 -0
- package/dist/parts.js +114 -0
- package/dist/qr.d.ts +7 -0
- package/dist/qr.js +271 -0
- package/dist/rich-text.d.ts +40 -0
- package/dist/rich-text.js +375 -0
- package/dist/sheets.d.ts +128 -0
- package/dist/sheets.js +661 -0
- package/dist/validate.d.ts +40 -0
- package/dist/validate.js +224 -0
- package/dist/work.d.ts +117 -0
- package/dist/work.js +895 -0
- package/package.json +4 -4
- package/dist/cdn/calendar-Cjp5Rqer.js +0 -16
- package/dist/cdn/charts-DvQ4OwdS.js +0 -1
- package/dist/cdn/controls-B-s4IF_4.js +0 -1
- package/dist/cdn/display-MorJMDEF.js +0 -1
- package/dist/cdn/forms-CQeP9iiW.js +0 -1
- package/dist/cdn/inputs-Bqcs9Xy7.js +0 -1
- package/dist/cdn/pickers-BT9VPT4o.js +0 -1
package/dist/hours.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type WeekHours } from "@kashi-ui/persian";
|
|
2
|
+
import { HTMLBase } from "./base.js";
|
|
3
|
+
import "./forms.js";
|
|
4
|
+
/**
|
|
5
|
+
* ساعت کاری هفتگی: هر روز باز یا تعطیل با یک یا چند بازهٔ ساعت (kashi-time-input). value (JSON هفت روز از شنبه) یا پیشفرض
|
|
6
|
+
* شنبه تا چهارشنبه ۹ تا ۱۷ و پنجشنبه ۹ تا ۱۳. step، max-ranges، summary="false"، now، name (JSON در فرم) و disabled.
|
|
7
|
+
* kashi-change با detail { value, valid }.
|
|
8
|
+
*/
|
|
9
|
+
export declare class KashiBusinessHours extends HTMLBase {
|
|
10
|
+
static observedAttributes: string[];
|
|
11
|
+
private week;
|
|
12
|
+
private root;
|
|
13
|
+
private key;
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
attributeChangedCallback(n: string, old: string | null, next: string | null): void;
|
|
16
|
+
get value(): WeekHours;
|
|
17
|
+
set value(v: WeekHours);
|
|
18
|
+
/** همهٔ بازهها درستاند */
|
|
19
|
+
get valid(): boolean;
|
|
20
|
+
private parse;
|
|
21
|
+
private commit;
|
|
22
|
+
private dayOf;
|
|
23
|
+
private onToggle;
|
|
24
|
+
private onTime;
|
|
25
|
+
private onClick;
|
|
26
|
+
private render;
|
|
27
|
+
/** خطای هر روز، وضعیت «الان باز است»، خلاصه و فیلد فرم */
|
|
28
|
+
private paintState;
|
|
29
|
+
}
|
package/dist/hours.js
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// ساعت کاری هفتگی؛ جدا از cards.ts چون فیلد ساعت (forms.js) را با خودش میآورد.
|
|
2
|
+
import { defaultWeekHours, invalidRanges, isOpenAt, summarizeHours } from "@kashi-ui/persian";
|
|
3
|
+
import { afterParse, bool, calendarNames, define, digitsOf, emit, esc, HTMLBase, lang, msg, num, syncHidden, uid } from "./base.js";
|
|
4
|
+
import { icon, toDate } from "./parts.js";
|
|
5
|
+
import "./forms.js";
|
|
6
|
+
// ---------- ساعت کاری ----------
|
|
7
|
+
const X = icon('<path d="M6 6l8 8M14 6l-8 8"/>');
|
|
8
|
+
const PLUS = icon('<path d="M10 5v10M5 10h10"/>');
|
|
9
|
+
const clone = (w) => w.map((d) => ({ open: d.open, ranges: d.ranges.map((r) => ({ ...r })) }));
|
|
10
|
+
/**
|
|
11
|
+
* ساعت کاری هفتگی: هر روز باز یا تعطیل با یک یا چند بازهٔ ساعت (kashi-time-input). value (JSON هفت روز از شنبه) یا پیشفرض
|
|
12
|
+
* شنبه تا چهارشنبه ۹ تا ۱۷ و پنجشنبه ۹ تا ۱۳. step، max-ranges، summary="false"، now، name (JSON در فرم) و disabled.
|
|
13
|
+
* kashi-change با detail { value, valid }.
|
|
14
|
+
*/
|
|
15
|
+
export class KashiBusinessHours extends HTMLBase {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.week = null;
|
|
19
|
+
this.root = null;
|
|
20
|
+
this.key = uid("kashi-hours");
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
afterParse(() => {
|
|
24
|
+
if (!this.isConnected)
|
|
25
|
+
return;
|
|
26
|
+
if (!this.root) {
|
|
27
|
+
this.week ?? (this.week = this.parse(this.getAttribute("value")));
|
|
28
|
+
this.root = document.createElement("fieldset");
|
|
29
|
+
this.root.className = "k-hours";
|
|
30
|
+
this.replaceChildren(this.root);
|
|
31
|
+
this.root.addEventListener("change", (e) => this.onToggle(e));
|
|
32
|
+
this.root.addEventListener("kashi-change", (e) => this.onTime(e));
|
|
33
|
+
this.root.addEventListener("click", (e) => this.onClick(e));
|
|
34
|
+
}
|
|
35
|
+
this.render();
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
attributeChangedCallback(n, old, next) {
|
|
39
|
+
if (old === next)
|
|
40
|
+
return;
|
|
41
|
+
if (n === "value")
|
|
42
|
+
this.week = this.parse(next);
|
|
43
|
+
if (this.root)
|
|
44
|
+
this.render();
|
|
45
|
+
}
|
|
46
|
+
get value() {
|
|
47
|
+
return clone(this.week ?? this.parse(this.getAttribute("value")));
|
|
48
|
+
}
|
|
49
|
+
set value(v) {
|
|
50
|
+
this.week = Array.isArray(v) && v.length === 7 ? clone(v) : defaultWeekHours();
|
|
51
|
+
if (this.root)
|
|
52
|
+
this.render();
|
|
53
|
+
}
|
|
54
|
+
/** همهٔ بازهها درستاند */
|
|
55
|
+
get valid() {
|
|
56
|
+
return this.value.every((d) => invalidRanges(d).length === 0);
|
|
57
|
+
}
|
|
58
|
+
parse(v) {
|
|
59
|
+
if (!v)
|
|
60
|
+
return defaultWeekHours();
|
|
61
|
+
try {
|
|
62
|
+
const w = JSON.parse(v);
|
|
63
|
+
return Array.isArray(w) && w.length === 7 ? w : defaultWeekHours();
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return defaultWeekHours();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
commit(next, focus) {
|
|
70
|
+
this.week = next;
|
|
71
|
+
this.render(focus);
|
|
72
|
+
emit(this, "kashi-change", { value: this.value, valid: this.valid });
|
|
73
|
+
}
|
|
74
|
+
dayOf(el) {
|
|
75
|
+
return Number(el.closest("[data-day]")?.dataset.day);
|
|
76
|
+
}
|
|
77
|
+
onToggle(e) {
|
|
78
|
+
const input = e.target;
|
|
79
|
+
if (!input.matches(".k-switch"))
|
|
80
|
+
return;
|
|
81
|
+
e.stopPropagation();
|
|
82
|
+
const i = this.dayOf(input);
|
|
83
|
+
const w = this.value;
|
|
84
|
+
w[i] = { open: input.checked, ranges: input.checked && !w[i].ranges.length ? [{ from: "09:00", to: "17:00" }] : w[i].ranges };
|
|
85
|
+
this.commit(w, `[data-day="${i}"] .k-switch`);
|
|
86
|
+
}
|
|
87
|
+
onTime(e) {
|
|
88
|
+
const t = e.target;
|
|
89
|
+
if (t === this || !t.matches("kashi-time-input"))
|
|
90
|
+
return;
|
|
91
|
+
e.stopPropagation();
|
|
92
|
+
if (!e.detail?.value)
|
|
93
|
+
return;
|
|
94
|
+
const i = this.dayOf(t), j = Number(t.dataset.range);
|
|
95
|
+
const w = this.value;
|
|
96
|
+
w[i].ranges[j] = { ...w[i].ranges[j], [t.dataset.part]: e.detail.value };
|
|
97
|
+
// فیلد ساعت در حال تایپ دوباره ساخته نمیشود؛ فقط خطا، خلاصه و مقدار فرم
|
|
98
|
+
this.week = w;
|
|
99
|
+
this.paintState();
|
|
100
|
+
emit(this, "kashi-change", { value: this.value, valid: this.valid });
|
|
101
|
+
}
|
|
102
|
+
onClick(e) {
|
|
103
|
+
const b = e.target.closest("button[data-act]");
|
|
104
|
+
if (!b)
|
|
105
|
+
return;
|
|
106
|
+
const w = this.value;
|
|
107
|
+
const i = this.dayOf(b);
|
|
108
|
+
if (b.dataset.act === "remove") {
|
|
109
|
+
w[i].ranges.splice(Number(b.dataset.range), 1);
|
|
110
|
+
this.commit(w, `[data-day="${i}"] [data-act=add], [data-day="${i}"] .k-switch`);
|
|
111
|
+
}
|
|
112
|
+
else if (b.dataset.act === "add") {
|
|
113
|
+
const last = w[i].ranges[w[i].ranges.length - 1]?.to ?? "09:00";
|
|
114
|
+
const h = Math.min(23, Number(last.slice(0, 2)) + 1);
|
|
115
|
+
w[i].ranges.push({ from: `${String(h).padStart(2, "0")}:00`, to: `${String(Math.min(23, h + 3)).padStart(2, "0")}:00` });
|
|
116
|
+
this.commit(w, `[data-day="${i}"] kashi-time-input[data-range="${w[i].ranges.length - 1}"][data-part=from]`);
|
|
117
|
+
}
|
|
118
|
+
else if (b.dataset.act === "copy") {
|
|
119
|
+
const first = w.find((d) => d.open && d.ranges.length);
|
|
120
|
+
if (first)
|
|
121
|
+
this.commit(w.map((d) => (d.open ? { open: true, ranges: first.ranges.map((r) => ({ ...r })) } : d)), ".k-hours__copy");
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
render(focus) {
|
|
125
|
+
const M = msg(), B = M.businessHours;
|
|
126
|
+
const { weekdays } = calendarNames();
|
|
127
|
+
const root = this.root;
|
|
128
|
+
const week = this.week;
|
|
129
|
+
const step = this.getAttribute("step") ?? "30";
|
|
130
|
+
const maxRanges = Number(this.getAttribute("max-ranges")) || 3;
|
|
131
|
+
const digits = digitsOf(this);
|
|
132
|
+
root.disabled = bool(this, "disabled");
|
|
133
|
+
root.setAttribute("aria-labelledby", `${this.key}-legend`);
|
|
134
|
+
root.innerHTML = `<legend id="${this.key}-legend" class="k-hours__legend">${esc(this.getAttribute("label") ?? B.label)}</legend><div class="k-hours__days">${week.map((day, i) => {
|
|
135
|
+
const errId = `${this.key}-e${i}`;
|
|
136
|
+
const ranges = day.ranges.map((r, j) => {
|
|
137
|
+
const group = B.rangeOf(weekdays[i], num(this, j + 1));
|
|
138
|
+
const field = (part) => `<kashi-time-input data-part="${part}" data-range="${j}" value="${esc(r[part])}" step="${esc(step)}" digits="${digits}" aria-label="${esc(`${group}${M.common.list}${part === "from" ? B.from : B.to}`)}"></kashi-time-input>`;
|
|
139
|
+
return `<div class="k-hours__range" role="group" aria-label="${esc(group)}">${field("from")}<span class="k-hours__sep" aria-hidden="true">${esc(B.to)}</span>${field("to")}${day.ranges.length > 1 ? `<button type="button" class="k-hours__icon" data-act="remove" data-range="${j}" aria-label="${esc(`${B.removeRange}${M.common.list}${group}`)}">${X}</button>` : ""}</div>`;
|
|
140
|
+
}).join("");
|
|
141
|
+
return `<div class="k-hours__day" data-day="${i}"${day.open ? " data-open" : ""}><label class="k-hours__toggle"><input type="checkbox" role="switch" class="k-switch k-switch--sm"${day.open ? " checked" : ""}><span class="k-hours__name">${esc(weekdays[i])}</span></label><div class="k-hours__body"><div class="k-hours__inner">${day.open ? `${ranges}${day.ranges.length < maxRanges ? `<button type="button" class="k-hours__add" data-act="add">${PLUS}${esc(B.addRange)}</button>` : ""}<p class="k-hint k-hint--error k-hours__error" id="${errId}" hidden>${esc(B.invalid)}</p>` : `<span class="k-hours__closed">${esc(B.closed)}</span>`}</div></div></div>`;
|
|
142
|
+
}).join("")}</div>${this.getAttribute("summary") !== "false" ? `<div class="k-hours__foot"><span class="k-hours__status"><span class="k-hours__dot" aria-hidden="true"></span><span></span></span><p class="k-hours__summary"></p><button type="button" class="k-btn k-btn--tertiary k-btn--sm k-hours__copy" data-act="copy">${esc(B.copyAll)}</button></div>` : ""}`;
|
|
143
|
+
this.paintState();
|
|
144
|
+
if (focus)
|
|
145
|
+
root.querySelector(focus)?.focus();
|
|
146
|
+
}
|
|
147
|
+
/** خطای هر روز، وضعیت «الان باز است»، خلاصه و فیلد فرم */
|
|
148
|
+
paintState() {
|
|
149
|
+
const B = msg().businessHours;
|
|
150
|
+
const root = this.root;
|
|
151
|
+
const week = this.week;
|
|
152
|
+
week.forEach((day, i) => {
|
|
153
|
+
const bad = invalidRanges(day);
|
|
154
|
+
const row = root.querySelector(`[data-day="${i}"]`);
|
|
155
|
+
row.toggleAttribute("data-invalid", bad.length > 0);
|
|
156
|
+
const err = row.querySelector(".k-hours__error");
|
|
157
|
+
if (err)
|
|
158
|
+
err.hidden = !bad.length;
|
|
159
|
+
row.querySelectorAll(".k-hours__range").forEach((r, j) => r.toggleAttribute("data-invalid", bad.includes(j)));
|
|
160
|
+
row.querySelectorAll("kashi-time-input").forEach((t) => {
|
|
161
|
+
const input = t.querySelector("input");
|
|
162
|
+
if (input && bad.length)
|
|
163
|
+
input.setAttribute("aria-describedby", `${this.key}-e${i}`);
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
const foot = root.querySelector(".k-hours__foot");
|
|
167
|
+
if (foot) {
|
|
168
|
+
const open = isOpenAt(week, toDate(this.getAttribute("now")) ?? new Date());
|
|
169
|
+
const status = foot.querySelector(".k-hours__status");
|
|
170
|
+
status.toggleAttribute("data-open", open);
|
|
171
|
+
status.lastElementChild.textContent = open ? B.openNow : B.closedNow;
|
|
172
|
+
foot.querySelector(".k-hours__summary").textContent = summarizeHours(week, { locale: lang() });
|
|
173
|
+
foot.querySelector(".k-hours__copy").hidden = !week.some((d) => d.open && d.ranges.length);
|
|
174
|
+
}
|
|
175
|
+
syncHidden(this, this.getAttribute("name"), this.valid ? JSON.stringify(week) : "");
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
KashiBusinessHours.observedAttributes = ["value", "label", "step", "max-ranges", "summary", "now", "name", "digits", "disabled"];
|
|
179
|
+
define("kashi-business-hours", KashiBusinessHours, "block");
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,18 @@ import { KashiCountdown, KashiDate, KashiMoney, KashiRelativeTime } from "./disp
|
|
|
17
17
|
import { KashiCopyButton, KashiDialog, KashiTabs, KashiTooltip } from "./overlay.js";
|
|
18
18
|
import { KashiToaster, toast } from "./toast.js";
|
|
19
19
|
import { KashiPriceRange, KashiSearchSuggest, KashiSwatchGroup } from "./commerce.js";
|
|
20
|
-
|
|
20
|
+
import { KashiBadge, KashiAvatar, KashiAvatarGroup, KashiDivider, KashiSkeleton, KashiCard, KashiEmptyState, KashiStatCard, KashiAlert, KashiMeter, KashiProgress, KashiTimeline, KashiStepper } from "./content.js";
|
|
21
|
+
import { KashiButton, KashiButtonGroup, KashiSegmentedControl, KashiBreadcrumb, KashiAccordion } from "./buttons.js";
|
|
22
|
+
import { KashiCheckbox, KashiSwitch, KashiRadioGroup, KashiSelect } from "./choice.js";
|
|
23
|
+
import { KashiDrawer, KashiBottomSheet, KashiNavbar, KashiNotificationList, KashiNotificationCenter } from "./sheets.js";
|
|
24
|
+
import { KashiChat, KashiChatMessage, KashiTypingIndicator, KashiChatComposer, KashiStreamingText, KashiCodeBlock } from "./chat.js";
|
|
25
|
+
import { KashiSortable, KashiKanban, KashiScheduler } from "./work.js";
|
|
26
|
+
import { KashiGallery, KashiQrCode } from "./media.js";
|
|
27
|
+
import { KashiRichText } from "./rich-text.js";
|
|
28
|
+
import { KashiForm } from "./validate.js";
|
|
29
|
+
import { KashiBankCard, KashiReceipt, KashiDateTile } from "./cards.js";
|
|
30
|
+
import { KashiBusinessHours } from "./hours.js";
|
|
31
|
+
export { KashiCardNumber, KashiIban, KashiLandline, KashiLegalId, KashiMobile, KashiNationalId, KashiPostalCode, KashiPrice, KashiSayad, KashiEconomicCode, KashiTaxId, KashiOtp, KashiProvinceSelect, KashiCombobox, KashiCitySelect, KashiIranMap, KashiAddressForm, KashiCalendar, KashiDatePicker, KashiTimePicker, KashiTimeClock, KashiCountdown, KashiDate, KashiMoney, KashiRelativeTime, KashiCopyButton, KashiDialog, KashiTabs, KashiTooltip, KashiToaster, toast, KashiDropdownMenu, KashiPopover, KashiTagInput, KashiNumberInput, KashiRating, KashiPagination, KashiDataTable, KashiMultiSelect, KashiSlider, KashiChipGroup, KashiPasswordStrength, KashiPersianTextarea, KashiKeyboardFix, KashiTimeInput, KashiPlateInput, KashiInlineEdit, KashiDateRangePicker, KashiMonthPicker, KashiFileUpload, KashiColorPicker, KashiBarChart, KashiLineChart, KashiPieChart, KashiBarList, KashiProportionBar, KashiSparkline, KashiActivityHeatmap, KashiCommandPalette, KashiContextMenu, KashiCarousel, KashiTreeView, KashiTour, KashiSplitter, KashiSideNav, KashiInput, KashiTextarea, KashiBanner, KashiAppointmentPicker, KashiPriceRange, KashiSwatchGroup, KashiSearchSuggest, KashiBadge, KashiAvatar, KashiAvatarGroup, KashiDivider, KashiSkeleton, KashiCard, KashiEmptyState, KashiStatCard, KashiAlert, KashiMeter, KashiProgress, KashiTimeline, KashiStepper, KashiButton, KashiButtonGroup, KashiSegmentedControl, KashiBreadcrumb, KashiAccordion, KashiCheckbox, KashiSwitch, KashiRadioGroup, KashiSelect, KashiDrawer, KashiBottomSheet, KashiNavbar, KashiNotificationList, KashiNotificationCenter, KashiChat, KashiChatMessage, KashiTypingIndicator, KashiChatComposer, KashiStreamingText, KashiCodeBlock, KashiSortable, KashiKanban, KashiScheduler, KashiGallery, KashiQrCode, KashiRichText, KashiForm, KashiBankCard, KashiReceipt, KashiDateTile, KashiBusinessHours, };
|
|
21
32
|
export { KashiDigitsInput } from "./inputs.js";
|
|
22
33
|
/** زبان متنهای داخلی همهٔ عنصرها: setLocale("en") */
|
|
23
34
|
export { setLocale } from "./base.js";
|
|
@@ -27,8 +38,15 @@ export type { ToastOptions, ToastTone } from "./toast.js";
|
|
|
27
38
|
export type { ComboboxOption } from "./combobox.js";
|
|
28
39
|
export type { TableColumn } from "./table.js";
|
|
29
40
|
export type { CommandItem, TourStep, TreeNode } from "./nav.js";
|
|
41
|
+
export type { TimelineItem, Step } from "./content.js";
|
|
42
|
+
export type { SelectOption } from "./choice.js";
|
|
43
|
+
export type { NotificationItem } from "./sheets.js";
|
|
44
|
+
export type { SchedulerEvent } from "./work.js";
|
|
45
|
+
export type { GalleryImage } from "./media.js";
|
|
46
|
+
export type { RichTextTool } from "./rich-text.js";
|
|
47
|
+
export type { FormRule } from "./validate.js";
|
|
30
48
|
/** نام همهٔ عنصرها؛ مثلاً برای isCustomElement در Vue */
|
|
31
|
-
export declare const KASHI_ELEMENTS: readonly ["kashi-national-id", "kashi-legal-id", "kashi-mobile", "kashi-landline", "kashi-card-number", "kashi-iban", "kashi-postal-code", "kashi-price", "kashi-otp", "kashi-combobox", "kashi-province-select", "kashi-city-select", "kashi-iran-map", "kashi-address-form", "kashi-calendar", "kashi-date-picker", "kashi-money", "kashi-date", "kashi-relative-time", "kashi-countdown", "kashi-dialog", "kashi-tabs", "kashi-tooltip", "kashi-copy-button", "kashi-toaster", "kashi-dropdown-menu", "kashi-popover", "kashi-tag-input", "kashi-number-input", "kashi-rating", "kashi-pagination", "kashi-data-table", "kashi-multi-select", "kashi-slider", "kashi-chip-group", "kashi-password-strength", "kashi-persian-textarea", "kashi-keyboard-fix", "kashi-time-input", "kashi-time-picker", "kashi-time-clock", "kashi-plate-input", "kashi-inline-edit", "kashi-date-range-picker", "kashi-month-picker", "kashi-file-upload", "kashi-color-picker", "kashi-bar-chart", "kashi-line-chart", "kashi-pie-chart", "kashi-bar-list", "kashi-proportion-bar", "kashi-sparkline", "kashi-activity-heatmap", "kashi-command-palette", "kashi-context-menu", "kashi-carousel", "kashi-tree-view", "kashi-tour", "kashi-splitter", "kashi-side-nav", "kashi-input", "kashi-textarea", "kashi-banner", "kashi-appointment-picker", "kashi-price-range", "kashi-swatch-group", "kashi-search-suggest", "kashi-sayad", "kashi-economic-code", "kashi-tax-id"];
|
|
49
|
+
export declare const KASHI_ELEMENTS: readonly ["kashi-national-id", "kashi-legal-id", "kashi-mobile", "kashi-landline", "kashi-card-number", "kashi-iban", "kashi-postal-code", "kashi-price", "kashi-otp", "kashi-combobox", "kashi-province-select", "kashi-city-select", "kashi-iran-map", "kashi-address-form", "kashi-calendar", "kashi-date-picker", "kashi-money", "kashi-date", "kashi-relative-time", "kashi-countdown", "kashi-dialog", "kashi-tabs", "kashi-tooltip", "kashi-copy-button", "kashi-toaster", "kashi-dropdown-menu", "kashi-popover", "kashi-tag-input", "kashi-number-input", "kashi-rating", "kashi-pagination", "kashi-data-table", "kashi-multi-select", "kashi-slider", "kashi-chip-group", "kashi-password-strength", "kashi-persian-textarea", "kashi-keyboard-fix", "kashi-time-input", "kashi-time-picker", "kashi-time-clock", "kashi-plate-input", "kashi-inline-edit", "kashi-date-range-picker", "kashi-month-picker", "kashi-file-upload", "kashi-color-picker", "kashi-bar-chart", "kashi-line-chart", "kashi-pie-chart", "kashi-bar-list", "kashi-proportion-bar", "kashi-sparkline", "kashi-activity-heatmap", "kashi-command-palette", "kashi-context-menu", "kashi-carousel", "kashi-tree-view", "kashi-tour", "kashi-splitter", "kashi-side-nav", "kashi-input", "kashi-textarea", "kashi-banner", "kashi-appointment-picker", "kashi-price-range", "kashi-swatch-group", "kashi-search-suggest", "kashi-sayad", "kashi-economic-code", "kashi-tax-id", "kashi-badge", "kashi-avatar", "kashi-avatar-group", "kashi-divider", "kashi-skeleton", "kashi-card", "kashi-empty-state", "kashi-stat-card", "kashi-alert", "kashi-meter", "kashi-progress", "kashi-timeline", "kashi-stepper", "kashi-button", "kashi-button-group", "kashi-segmented-control", "kashi-breadcrumb", "kashi-accordion", "kashi-checkbox", "kashi-switch", "kashi-radio-group", "kashi-select", "kashi-drawer", "kashi-bottom-sheet", "kashi-navbar", "kashi-notification-list", "kashi-notification-center", "kashi-chat", "kashi-chat-message", "kashi-typing-indicator", "kashi-chat-composer", "kashi-streaming-text", "kashi-code-block", "kashi-sortable", "kashi-kanban", "kashi-scheduler", "kashi-gallery", "kashi-qr-code", "kashi-rich-text", "kashi-form", "kashi-bank-card", "kashi-receipt", "kashi-date-tile", "kashi-business-hours"];
|
|
32
50
|
declare global {
|
|
33
51
|
interface HTMLElementTagNameMap {
|
|
34
52
|
"kashi-national-id": KashiNationalId;
|
|
@@ -102,5 +120,49 @@ declare global {
|
|
|
102
120
|
"kashi-price-range": KashiPriceRange;
|
|
103
121
|
"kashi-swatch-group": KashiSwatchGroup;
|
|
104
122
|
"kashi-search-suggest": KashiSearchSuggest;
|
|
123
|
+
"kashi-badge": KashiBadge;
|
|
124
|
+
"kashi-avatar": KashiAvatar;
|
|
125
|
+
"kashi-avatar-group": KashiAvatarGroup;
|
|
126
|
+
"kashi-divider": KashiDivider;
|
|
127
|
+
"kashi-skeleton": KashiSkeleton;
|
|
128
|
+
"kashi-card": KashiCard;
|
|
129
|
+
"kashi-empty-state": KashiEmptyState;
|
|
130
|
+
"kashi-stat-card": KashiStatCard;
|
|
131
|
+
"kashi-alert": KashiAlert;
|
|
132
|
+
"kashi-meter": KashiMeter;
|
|
133
|
+
"kashi-progress": KashiProgress;
|
|
134
|
+
"kashi-timeline": KashiTimeline;
|
|
135
|
+
"kashi-stepper": KashiStepper;
|
|
136
|
+
"kashi-button": KashiButton;
|
|
137
|
+
"kashi-button-group": KashiButtonGroup;
|
|
138
|
+
"kashi-segmented-control": KashiSegmentedControl;
|
|
139
|
+
"kashi-breadcrumb": KashiBreadcrumb;
|
|
140
|
+
"kashi-accordion": KashiAccordion;
|
|
141
|
+
"kashi-checkbox": KashiCheckbox;
|
|
142
|
+
"kashi-switch": KashiSwitch;
|
|
143
|
+
"kashi-radio-group": KashiRadioGroup;
|
|
144
|
+
"kashi-select": KashiSelect;
|
|
145
|
+
"kashi-drawer": KashiDrawer;
|
|
146
|
+
"kashi-bottom-sheet": KashiBottomSheet;
|
|
147
|
+
"kashi-navbar": KashiNavbar;
|
|
148
|
+
"kashi-notification-list": KashiNotificationList;
|
|
149
|
+
"kashi-notification-center": KashiNotificationCenter;
|
|
150
|
+
"kashi-chat": KashiChat;
|
|
151
|
+
"kashi-chat-message": KashiChatMessage;
|
|
152
|
+
"kashi-typing-indicator": KashiTypingIndicator;
|
|
153
|
+
"kashi-chat-composer": KashiChatComposer;
|
|
154
|
+
"kashi-streaming-text": KashiStreamingText;
|
|
155
|
+
"kashi-code-block": KashiCodeBlock;
|
|
156
|
+
"kashi-sortable": KashiSortable;
|
|
157
|
+
"kashi-kanban": KashiKanban;
|
|
158
|
+
"kashi-scheduler": KashiScheduler;
|
|
159
|
+
"kashi-gallery": KashiGallery;
|
|
160
|
+
"kashi-qr-code": KashiQrCode;
|
|
161
|
+
"kashi-rich-text": KashiRichText;
|
|
162
|
+
"kashi-form": KashiForm;
|
|
163
|
+
"kashi-bank-card": KashiBankCard;
|
|
164
|
+
"kashi-receipt": KashiReceipt;
|
|
165
|
+
"kashi-date-tile": KashiDateTile;
|
|
166
|
+
"kashi-business-hours": KashiBusinessHours;
|
|
105
167
|
}
|
|
106
168
|
}
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,18 @@ import { KashiCountdown, KashiDate, KashiMoney, KashiRelativeTime } from "./disp
|
|
|
19
19
|
import { KashiCopyButton, KashiDialog, KashiTabs, KashiTooltip } from "./overlay.js";
|
|
20
20
|
import { KashiToaster, toast } from "./toast.js";
|
|
21
21
|
import { KashiPriceRange, KashiSearchSuggest, KashiSwatchGroup } from "./commerce.js";
|
|
22
|
-
|
|
22
|
+
import { KashiBadge, KashiAvatar, KashiAvatarGroup, KashiDivider, KashiSkeleton, KashiCard, KashiEmptyState, KashiStatCard, KashiAlert, KashiMeter, KashiProgress, KashiTimeline, KashiStepper } from "./content.js";
|
|
23
|
+
import { KashiButton, KashiButtonGroup, KashiSegmentedControl, KashiBreadcrumb, KashiAccordion } from "./buttons.js";
|
|
24
|
+
import { KashiCheckbox, KashiSwitch, KashiRadioGroup, KashiSelect } from "./choice.js";
|
|
25
|
+
import { KashiDrawer, KashiBottomSheet, KashiNavbar, KashiNotificationList, KashiNotificationCenter } from "./sheets.js";
|
|
26
|
+
import { KashiChat, KashiChatMessage, KashiTypingIndicator, KashiChatComposer, KashiStreamingText, KashiCodeBlock } from "./chat.js";
|
|
27
|
+
import { KashiSortable, KashiKanban, KashiScheduler } from "./work.js";
|
|
28
|
+
import { KashiGallery, KashiQrCode } from "./media.js";
|
|
29
|
+
import { KashiRichText } from "./rich-text.js";
|
|
30
|
+
import { KashiForm } from "./validate.js";
|
|
31
|
+
import { KashiBankCard, KashiReceipt, KashiDateTile } from "./cards.js";
|
|
32
|
+
import { KashiBusinessHours } from "./hours.js";
|
|
33
|
+
export { KashiCardNumber, KashiIban, KashiLandline, KashiLegalId, KashiMobile, KashiNationalId, KashiPostalCode, KashiPrice, KashiSayad, KashiEconomicCode, KashiTaxId, KashiOtp, KashiProvinceSelect, KashiCombobox, KashiCitySelect, KashiIranMap, KashiAddressForm, KashiCalendar, KashiDatePicker, KashiTimePicker, KashiTimeClock, KashiCountdown, KashiDate, KashiMoney, KashiRelativeTime, KashiCopyButton, KashiDialog, KashiTabs, KashiTooltip, KashiToaster, toast, KashiDropdownMenu, KashiPopover, KashiTagInput, KashiNumberInput, KashiRating, KashiPagination, KashiDataTable, KashiMultiSelect, KashiSlider, KashiChipGroup, KashiPasswordStrength, KashiPersianTextarea, KashiKeyboardFix, KashiTimeInput, KashiPlateInput, KashiInlineEdit, KashiDateRangePicker, KashiMonthPicker, KashiFileUpload, KashiColorPicker, KashiBarChart, KashiLineChart, KashiPieChart, KashiBarList, KashiProportionBar, KashiSparkline, KashiActivityHeatmap, KashiCommandPalette, KashiContextMenu, KashiCarousel, KashiTreeView, KashiTour, KashiSplitter, KashiSideNav, KashiInput, KashiTextarea, KashiBanner, KashiAppointmentPicker, KashiPriceRange, KashiSwatchGroup, KashiSearchSuggest, KashiBadge, KashiAvatar, KashiAvatarGroup, KashiDivider, KashiSkeleton, KashiCard, KashiEmptyState, KashiStatCard, KashiAlert, KashiMeter, KashiProgress, KashiTimeline, KashiStepper, KashiButton, KashiButtonGroup, KashiSegmentedControl, KashiBreadcrumb, KashiAccordion, KashiCheckbox, KashiSwitch, KashiRadioGroup, KashiSelect, KashiDrawer, KashiBottomSheet, KashiNavbar, KashiNotificationList, KashiNotificationCenter, KashiChat, KashiChatMessage, KashiTypingIndicator, KashiChatComposer, KashiStreamingText, KashiCodeBlock, KashiSortable, KashiKanban, KashiScheduler, KashiGallery, KashiQrCode, KashiRichText, KashiForm, KashiBankCard, KashiReceipt, KashiDateTile, KashiBusinessHours, };
|
|
23
34
|
export { KashiDigitsInput } from "./inputs.js";
|
|
24
35
|
/** زبان متنهای داخلی همهٔ عنصرها: setLocale("en") */
|
|
25
36
|
export { setLocale } from "./base.js";
|
|
@@ -39,4 +50,14 @@ export const KASHI_ELEMENTS = [
|
|
|
39
50
|
"kashi-input", "kashi-textarea", "kashi-banner", "kashi-appointment-picker",
|
|
40
51
|
"kashi-price-range", "kashi-swatch-group", "kashi-search-suggest",
|
|
41
52
|
"kashi-sayad", "kashi-economic-code", "kashi-tax-id",
|
|
53
|
+
"kashi-badge", "kashi-avatar", "kashi-avatar-group", "kashi-divider", "kashi-skeleton", "kashi-card", "kashi-empty-state", "kashi-stat-card", "kashi-alert", "kashi-meter", "kashi-progress", "kashi-timeline", "kashi-stepper",
|
|
54
|
+
"kashi-button", "kashi-button-group", "kashi-segmented-control", "kashi-breadcrumb", "kashi-accordion",
|
|
55
|
+
"kashi-checkbox", "kashi-switch", "kashi-radio-group", "kashi-select",
|
|
56
|
+
"kashi-drawer", "kashi-bottom-sheet", "kashi-navbar", "kashi-notification-list", "kashi-notification-center",
|
|
57
|
+
"kashi-chat", "kashi-chat-message", "kashi-typing-indicator", "kashi-chat-composer", "kashi-streaming-text", "kashi-code-block",
|
|
58
|
+
"kashi-sortable", "kashi-kanban", "kashi-scheduler",
|
|
59
|
+
"kashi-gallery", "kashi-qr-code",
|
|
60
|
+
"kashi-rich-text",
|
|
61
|
+
"kashi-form",
|
|
62
|
+
"kashi-bank-card", "kashi-receipt", "kashi-date-tile", "kashi-business-hours",
|
|
42
63
|
];
|