@ahrowe/ui 0.1.27 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +310 -226
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/package/common/sticky/index.d.ts +1 -0
- package/dist/types/package/common/sticky/sticky.d.ts +2 -0
- package/dist/types/package/common/sticky/sticky.types.d.ts +18 -0
- package/dist/types/package/index.d.ts +2 -0
- package/docs/CLAUDE.md +1 -0
- package/docs/Sticky.md +43 -0
- package/docs/VirtualList.md +2 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4147,6 +4147,90 @@ function Dr({ steps: t = [], currentStep: n = 0, alignment: r = "horizontal", on
|
|
|
4147
4147
|
});
|
|
4148
4148
|
}
|
|
4149
4149
|
var Or = {
|
|
4150
|
+
sticky: "sticky_L6zO2",
|
|
4151
|
+
"sticky-content": "sticky-content_ZaXTD",
|
|
4152
|
+
stickyContent: "sticky-content_ZaXTD",
|
|
4153
|
+
"sticky-content-stuck": "sticky-content-stuck_w-gRW",
|
|
4154
|
+
stickyContentStuck: "sticky-content-stuck_w-gRW",
|
|
4155
|
+
"sticky-placeholder": "sticky-placeholder_aJ3Sb",
|
|
4156
|
+
stickyPlaceholder: "sticky-placeholder_aJ3Sb"
|
|
4157
|
+
};
|
|
4158
|
+
//#endregion
|
|
4159
|
+
//#region package/common/sticky/sticky.tsx
|
|
4160
|
+
function kr({ children: e, offsetTop: t = 0, zIndex: n = 20, disabled: r = !1, onStuckChange: o, className: s, style: l, classNames: u, styles: m, ...h }) {
|
|
4161
|
+
let g = d(null), _ = d(null), [v, y] = f(!1), [b, x] = f({
|
|
4162
|
+
width: 0,
|
|
4163
|
+
left: 0,
|
|
4164
|
+
height: 0
|
|
4165
|
+
}), S = d(o);
|
|
4166
|
+
a(() => {
|
|
4167
|
+
S.current = o;
|
|
4168
|
+
}, [o]);
|
|
4169
|
+
let C = i(() => {
|
|
4170
|
+
let e = g.current, n = _.current;
|
|
4171
|
+
if (!e || !n) return;
|
|
4172
|
+
let i = e.getBoundingClientRect();
|
|
4173
|
+
x({
|
|
4174
|
+
width: e.clientWidth,
|
|
4175
|
+
left: i.left,
|
|
4176
|
+
height: n.offsetHeight
|
|
4177
|
+
}), y(!r && i.top <= t);
|
|
4178
|
+
}, [r, t]);
|
|
4179
|
+
c(() => {
|
|
4180
|
+
C();
|
|
4181
|
+
}, [C, e]), a(() => {
|
|
4182
|
+
let e = 0, t = () => {
|
|
4183
|
+
cancelAnimationFrame(e), e = requestAnimationFrame(C);
|
|
4184
|
+
};
|
|
4185
|
+
window.addEventListener("scroll", t, {
|
|
4186
|
+
passive: !0,
|
|
4187
|
+
capture: !0
|
|
4188
|
+
}), window.addEventListener("resize", t);
|
|
4189
|
+
let n = new ResizeObserver(t);
|
|
4190
|
+
return g.current && n.observe(g.current), _.current && n.observe(_.current), () => {
|
|
4191
|
+
cancelAnimationFrame(e), window.removeEventListener("scroll", t, { capture: !0 }), window.removeEventListener("resize", t), n.disconnect();
|
|
4192
|
+
};
|
|
4193
|
+
}, [C]);
|
|
4194
|
+
let w = d(!0);
|
|
4195
|
+
a(() => {
|
|
4196
|
+
if (w.current) {
|
|
4197
|
+
w.current = !1;
|
|
4198
|
+
return;
|
|
4199
|
+
}
|
|
4200
|
+
S.current?.(v);
|
|
4201
|
+
}, [v]);
|
|
4202
|
+
let T = v ? {
|
|
4203
|
+
position: "fixed",
|
|
4204
|
+
top: t,
|
|
4205
|
+
left: b.left,
|
|
4206
|
+
width: b.width,
|
|
4207
|
+
zIndex: n,
|
|
4208
|
+
...m?.content
|
|
4209
|
+
} : m?.content;
|
|
4210
|
+
return /* @__PURE__ */ G("div", {
|
|
4211
|
+
ref: g,
|
|
4212
|
+
className: p(Or.sticky, s, u?.root),
|
|
4213
|
+
style: {
|
|
4214
|
+
...m?.root,
|
|
4215
|
+
...l
|
|
4216
|
+
},
|
|
4217
|
+
...h,
|
|
4218
|
+
children: [v && /* @__PURE__ */ W("div", {
|
|
4219
|
+
"aria-hidden": !0,
|
|
4220
|
+
className: p(Or.stickyPlaceholder, u?.placeholder),
|
|
4221
|
+
style: {
|
|
4222
|
+
height: b.height,
|
|
4223
|
+
...m?.placeholder
|
|
4224
|
+
}
|
|
4225
|
+
}), /* @__PURE__ */ W("div", {
|
|
4226
|
+
ref: _,
|
|
4227
|
+
className: p(Or.stickyContent, v && Or.stickyContentStuck, u?.content),
|
|
4228
|
+
style: T,
|
|
4229
|
+
children: e
|
|
4230
|
+
})]
|
|
4231
|
+
});
|
|
4232
|
+
}
|
|
4233
|
+
var Ar = {
|
|
4150
4234
|
tabHeader: "tabHeader_C-b9d",
|
|
4151
4235
|
"tabHeader-tab": "tabHeader-tab_Wbyt-",
|
|
4152
4236
|
tabHeaderTab: "tabHeader-tab_Wbyt-",
|
|
@@ -4165,11 +4249,11 @@ var Or = {
|
|
|
4165
4249
|
};
|
|
4166
4250
|
//#endregion
|
|
4167
4251
|
//#region package/common/tabHeader/tabHeader.tsx
|
|
4168
|
-
function
|
|
4252
|
+
function jr({ tabs: e = [], currentTab: t, onChange: n, className: r, style: i, classNames: a, styles: o, ...s }) {
|
|
4169
4253
|
return /* @__PURE__ */ W("div", {
|
|
4170
4254
|
...s,
|
|
4171
4255
|
role: "tablist",
|
|
4172
|
-
className: p(
|
|
4256
|
+
className: p(Ar.tabHeader, a?.root, r),
|
|
4173
4257
|
style: {
|
|
4174
4258
|
...o?.root,
|
|
4175
4259
|
...i
|
|
@@ -4181,24 +4265,24 @@ function kr({ tabs: e = [], currentTab: t, onChange: n, className: r, style: i,
|
|
|
4181
4265
|
"aria-selected": r,
|
|
4182
4266
|
"aria-disabled": e.disabled || void 0,
|
|
4183
4267
|
tabIndex: e.disabled ? -1 : 0,
|
|
4184
|
-
className: p(
|
|
4268
|
+
className: p(Ar.tabHeaderTab, { [Ar.tabHeaderTabActive]: r }, { [Ar.tabHeaderTabDisabled]: e.disabled }, a?.tab),
|
|
4185
4269
|
style: o?.tab,
|
|
4186
4270
|
onClick: () => {
|
|
4187
4271
|
e.disabled || r || n(e.id);
|
|
4188
4272
|
},
|
|
4189
4273
|
children: [/* @__PURE__ */ W(m, {
|
|
4190
4274
|
icon: e.icon,
|
|
4191
|
-
className: p(
|
|
4275
|
+
className: p(Ar.tabHeaderIcon, a?.icon),
|
|
4192
4276
|
style: o?.icon
|
|
4193
4277
|
}), i && /* @__PURE__ */ G("div", {
|
|
4194
|
-
className: p(
|
|
4278
|
+
className: p(Ar.tabHeaderLabels, a?.labels),
|
|
4195
4279
|
style: o?.labels,
|
|
4196
4280
|
children: [e.title && /* @__PURE__ */ W("span", {
|
|
4197
|
-
className: p(
|
|
4281
|
+
className: p(Ar.tabHeaderTitle, a?.title),
|
|
4198
4282
|
style: o?.title,
|
|
4199
4283
|
children: e.title
|
|
4200
4284
|
}), e.subtitle && /* @__PURE__ */ W("span", {
|
|
4201
|
-
className: p(
|
|
4285
|
+
className: p(Ar.tabHeaderSubtitle, a?.subtitle),
|
|
4202
4286
|
style: o?.subtitle,
|
|
4203
4287
|
children: e.subtitle
|
|
4204
4288
|
})]
|
|
@@ -4209,7 +4293,7 @@ function kr({ tabs: e = [], currentTab: t, onChange: n, className: r, style: i,
|
|
|
4209
4293
|
}
|
|
4210
4294
|
//#endregion
|
|
4211
4295
|
//#region package/services/tenorService.ts
|
|
4212
|
-
var
|
|
4296
|
+
var Mr = "https://tenor.googleapis.com/v2", Nr = class {
|
|
4213
4297
|
constructor(e) {
|
|
4214
4298
|
this.key = e;
|
|
4215
4299
|
}
|
|
@@ -4218,14 +4302,14 @@ var Ar = "https://tenor.googleapis.com/v2", jr = class {
|
|
|
4218
4302
|
q: e,
|
|
4219
4303
|
key: this.key
|
|
4220
4304
|
});
|
|
4221
|
-
return t.limit != null && n.set("limit", String(t.limit)), t.contentfilter != null && n.set("contentfilter", t.contentfilter), t.pos != null && n.set("pos", t.pos), (await fetch(`${
|
|
4305
|
+
return t.limit != null && n.set("limit", String(t.limit)), t.contentfilter != null && n.set("contentfilter", t.contentfilter), t.pos != null && n.set("pos", t.pos), (await fetch(`${Mr}/search?${n}`)).json();
|
|
4222
4306
|
}
|
|
4223
4307
|
async searchSuggestions(e) {
|
|
4224
4308
|
let t = new URLSearchParams({
|
|
4225
4309
|
q: e,
|
|
4226
4310
|
key: this.key
|
|
4227
4311
|
});
|
|
4228
|
-
return (await fetch(`${
|
|
4312
|
+
return (await fetch(`${Mr}/search_suggestions?${t}`)).json();
|
|
4229
4313
|
}
|
|
4230
4314
|
registerShare(e, t) {
|
|
4231
4315
|
let n = new URLSearchParams({
|
|
@@ -4233,9 +4317,9 @@ var Ar = "https://tenor.googleapis.com/v2", jr = class {
|
|
|
4233
4317
|
q: e,
|
|
4234
4318
|
key: this.key
|
|
4235
4319
|
});
|
|
4236
|
-
fetch(`${
|
|
4320
|
+
fetch(`${Mr}/registershare?${n}`).catch(() => null);
|
|
4237
4321
|
}
|
|
4238
|
-
},
|
|
4322
|
+
}, Pr = {
|
|
4239
4323
|
gifPreview: "gifPreview_-ECUZ",
|
|
4240
4324
|
"gifPreview-image": "gifPreview-image_Aq7-a",
|
|
4241
4325
|
gifPreviewImage: "gifPreview-image_Aq7-a",
|
|
@@ -4245,25 +4329,25 @@ var Ar = "https://tenor.googleapis.com/v2", jr = class {
|
|
|
4245
4329
|
};
|
|
4246
4330
|
//#endregion
|
|
4247
4331
|
//#region package/common/tenorPicker/components/gifPreview/gifPreview.tsx
|
|
4248
|
-
function
|
|
4332
|
+
function Fr({ className: e, previewItems: t = [], onSelect: n, onLoadAdditional: r }) {
|
|
4249
4333
|
function i(e) {
|
|
4250
4334
|
let t = e.currentTarget, n = t.scrollHeight - t.clientHeight * 1.5;
|
|
4251
4335
|
t.scrollTop >= n && r?.();
|
|
4252
4336
|
}
|
|
4253
4337
|
return /* @__PURE__ */ W(U, { children: t.length > 0 && /* @__PURE__ */ W("div", {
|
|
4254
|
-
className: p(
|
|
4338
|
+
className: p(Pr.gifPreview, e),
|
|
4255
4339
|
onScroll: i,
|
|
4256
4340
|
children: t.map((e, t) => /* @__PURE__ */ W(Re, {
|
|
4257
|
-
className:
|
|
4341
|
+
className: Pr.gifPreviewImageContainer,
|
|
4258
4342
|
onClick: () => n?.(e),
|
|
4259
4343
|
children: /* @__PURE__ */ W("div", {
|
|
4260
|
-
className:
|
|
4344
|
+
className: Pr.gifPreviewImage,
|
|
4261
4345
|
style: { backgroundImage: `url(${e.media_formats.tinygif.url})` }
|
|
4262
4346
|
})
|
|
4263
4347
|
}, `${e.id}_${t}`))
|
|
4264
4348
|
}) });
|
|
4265
4349
|
}
|
|
4266
|
-
var
|
|
4350
|
+
var Ir = {
|
|
4267
4351
|
gifView: "gifView_Fa2zj",
|
|
4268
4352
|
"gifView-loading": "gifView-loading_LfNJr",
|
|
4269
4353
|
gifViewLoading: "gifView-loading_LfNJr",
|
|
@@ -4271,20 +4355,20 @@ var Pr = {
|
|
|
4271
4355
|
};
|
|
4272
4356
|
//#endregion
|
|
4273
4357
|
//#region package/common/tenorPicker/components/gifView/gifView.tsx
|
|
4274
|
-
function
|
|
4358
|
+
function Lr({ className: e, src: t = "" }) {
|
|
4275
4359
|
let [n, r] = f(!0);
|
|
4276
4360
|
return a(() => {
|
|
4277
4361
|
r(!0);
|
|
4278
4362
|
}, [t]), /* @__PURE__ */ G("div", {
|
|
4279
|
-
className: p(
|
|
4363
|
+
className: p(Ir.gifView, e),
|
|
4280
4364
|
children: [/* @__PURE__ */ W("img", {
|
|
4281
|
-
className:
|
|
4365
|
+
className: Ir.tenorPickerSelected,
|
|
4282
4366
|
src: t,
|
|
4283
4367
|
onLoad: () => r(!1)
|
|
4284
|
-
}), n && /* @__PURE__ */ W("div", { className:
|
|
4368
|
+
}), n && /* @__PURE__ */ W("div", { className: Ir.gifViewLoading })]
|
|
4285
4369
|
});
|
|
4286
4370
|
}
|
|
4287
|
-
var
|
|
4371
|
+
var Rr = {
|
|
4288
4372
|
"tenorPicker-selected": "tenorPicker-selected_IfR2z",
|
|
4289
4373
|
tenorPickerSelected: "tenorPicker-selected_IfR2z",
|
|
4290
4374
|
"tenorPicker-modal-content": "tenorPicker-modal-content_Vkolf",
|
|
@@ -4296,8 +4380,8 @@ var Ir = {
|
|
|
4296
4380
|
};
|
|
4297
4381
|
//#endregion
|
|
4298
4382
|
//#region package/common/tenorPicker/tenorPicker.tsx
|
|
4299
|
-
function
|
|
4300
|
-
let a = l(() => new
|
|
4383
|
+
function zr({ className: e, token: t = "", isModal: n = !1, onSelect: r = () => void 0, selected: i = null }) {
|
|
4384
|
+
let a = l(() => new Nr(t), [t]), [o, s] = f(""), [c, u] = f([]), [d, m] = f([]), [h, g] = f(null), [_, v] = f(!1);
|
|
4301
4385
|
async function y(e) {
|
|
4302
4386
|
if (s(e), !e.trim()) {
|
|
4303
4387
|
u([]), m([]), g(null);
|
|
@@ -4323,16 +4407,16 @@ function Lr({ className: e, token: t = "", isModal: n = !1, onSelect: r = () =>
|
|
|
4323
4407
|
function S() {
|
|
4324
4408
|
return /* @__PURE__ */ W(nt, {
|
|
4325
4409
|
inline: !0,
|
|
4326
|
-
className:
|
|
4410
|
+
className: Rr.tenorPickerSuggestionsContainer,
|
|
4327
4411
|
children: d.map((e) => /* @__PURE__ */ W(tt, {
|
|
4328
|
-
className:
|
|
4412
|
+
className: Rr.tenorPickerSuggestionsItem,
|
|
4329
4413
|
text: e,
|
|
4330
4414
|
onClick: () => y(e)
|
|
4331
4415
|
}, e))
|
|
4332
4416
|
});
|
|
4333
4417
|
}
|
|
4334
4418
|
function C() {
|
|
4335
|
-
return /* @__PURE__ */ W(
|
|
4419
|
+
return /* @__PURE__ */ W(Fr, {
|
|
4336
4420
|
previewItems: c,
|
|
4337
4421
|
onSelect: x,
|
|
4338
4422
|
onLoadAdditional: b
|
|
@@ -4347,7 +4431,7 @@ function Lr({ className: e, token: t = "", isModal: n = !1, onSelect: r = () =>
|
|
|
4347
4431
|
});
|
|
4348
4432
|
}
|
|
4349
4433
|
return n ? /* @__PURE__ */ G("div", {
|
|
4350
|
-
className: p(
|
|
4434
|
+
className: p(Rr.tenorPicker, e),
|
|
4351
4435
|
children: [
|
|
4352
4436
|
/* @__PURE__ */ G("div", {
|
|
4353
4437
|
className: Ce.actionButtons,
|
|
@@ -4360,15 +4444,15 @@ function Lr({ className: e, token: t = "", isModal: n = !1, onSelect: r = () =>
|
|
|
4360
4444
|
children: "Remove gif"
|
|
4361
4445
|
})]
|
|
4362
4446
|
}),
|
|
4363
|
-
i && /* @__PURE__ */ W(
|
|
4364
|
-
className:
|
|
4447
|
+
i && /* @__PURE__ */ W(Lr, {
|
|
4448
|
+
className: Rr.tenorPickerSelected,
|
|
4365
4449
|
src: i
|
|
4366
4450
|
}),
|
|
4367
4451
|
/* @__PURE__ */ W(Ct, {
|
|
4368
4452
|
isOpen: _,
|
|
4369
4453
|
onClose: () => v(!1),
|
|
4370
4454
|
children: /* @__PURE__ */ G("div", {
|
|
4371
|
-
className:
|
|
4455
|
+
className: Rr.tenorPickerModalContent,
|
|
4372
4456
|
children: [
|
|
4373
4457
|
w(),
|
|
4374
4458
|
S(),
|
|
@@ -4378,7 +4462,7 @@ function Lr({ className: e, token: t = "", isModal: n = !1, onSelect: r = () =>
|
|
|
4378
4462
|
})
|
|
4379
4463
|
]
|
|
4380
4464
|
}) : /* @__PURE__ */ G("div", {
|
|
4381
|
-
className: p(
|
|
4465
|
+
className: p(Rr.tenorPicker, e),
|
|
4382
4466
|
children: [
|
|
4383
4467
|
/* @__PURE__ */ W(ot, {
|
|
4384
4468
|
align: it.Left,
|
|
@@ -4392,8 +4476,8 @@ function Lr({ className: e, token: t = "", isModal: n = !1, onSelect: r = () =>
|
|
|
4392
4476
|
onClick: () => x(null),
|
|
4393
4477
|
children: "Remove gif"
|
|
4394
4478
|
}),
|
|
4395
|
-
i && /* @__PURE__ */ W(
|
|
4396
|
-
className:
|
|
4479
|
+
i && /* @__PURE__ */ W(Lr, {
|
|
4480
|
+
className: Rr.tenorPickerSelected,
|
|
4397
4481
|
src: i
|
|
4398
4482
|
})
|
|
4399
4483
|
]
|
|
@@ -4401,7 +4485,7 @@ function Lr({ className: e, token: t = "", isModal: n = !1, onSelect: r = () =>
|
|
|
4401
4485
|
}
|
|
4402
4486
|
//#endregion
|
|
4403
4487
|
//#region package/common/textarea/textarea.tsx
|
|
4404
|
-
function
|
|
4488
|
+
function Br(e) {
|
|
4405
4489
|
return /* @__PURE__ */ W(ut, {
|
|
4406
4490
|
...e,
|
|
4407
4491
|
multiline: !0
|
|
@@ -4409,7 +4493,7 @@ function Rr(e) {
|
|
|
4409
4493
|
}
|
|
4410
4494
|
//#endregion
|
|
4411
4495
|
//#region package/common/themeProvider/defaultTheme.ts
|
|
4412
|
-
var
|
|
4496
|
+
var Vr = {
|
|
4413
4497
|
id: "default",
|
|
4414
4498
|
variables: {
|
|
4415
4499
|
"--grey": "#8A8A8A",
|
|
@@ -4469,14 +4553,14 @@ var zr = {
|
|
|
4469
4553
|
"--spacing-m": "8px",
|
|
4470
4554
|
"--spacing-l": "16px"
|
|
4471
4555
|
}
|
|
4472
|
-
},
|
|
4556
|
+
}, Hr = { colorFade: "colorFade_eLv2g" }, Ur = class extends t {
|
|
4473
4557
|
constructor(...t) {
|
|
4474
4558
|
super(...t), this.state = {
|
|
4475
4559
|
resolvedVariables: {},
|
|
4476
4560
|
colorFadeActive: !1,
|
|
4477
4561
|
currentThemeColor: null
|
|
4478
4562
|
}, this.colorFadeTimeout = null, this.wrapperRef = e.createRef(), this.themeColorMeta = null, this.createdThemeColorMeta = !1, this.applyTheme = (e) => {
|
|
4479
|
-
let t = this.props.themes ?? [
|
|
4563
|
+
let t = this.props.themes ?? [Vr], n = t.find((e) => !e.baseThemeId) ?? t[0], r = n ? n.variables : {}, i = t.find((t) => t.id === e), a = i ? this.resolveChain(i.id) : [], o = Object.assign({}, r, ...a);
|
|
4480
4564
|
this.setState({
|
|
4481
4565
|
resolvedVariables: o,
|
|
4482
4566
|
colorFadeActive: !0
|
|
@@ -4510,7 +4594,7 @@ var zr = {
|
|
|
4510
4594
|
}
|
|
4511
4595
|
}
|
|
4512
4596
|
resolveChain(e) {
|
|
4513
|
-
let t = (this.props.themes ?? [
|
|
4597
|
+
let t = (this.props.themes ?? [Vr]).find((t) => t.id === e);
|
|
4514
4598
|
return t ? [...t.baseThemeId ? this.resolveChain(t.baseThemeId) : [], t.variables] : [];
|
|
4515
4599
|
}
|
|
4516
4600
|
render() {
|
|
@@ -4518,7 +4602,7 @@ var zr = {
|
|
|
4518
4602
|
return /* @__PURE__ */ W("div", {
|
|
4519
4603
|
ref: this.wrapperRef,
|
|
4520
4604
|
id: "themeProvider",
|
|
4521
|
-
className: n ?
|
|
4605
|
+
className: n ? Hr.colorFade : void 0,
|
|
4522
4606
|
style: t,
|
|
4523
4607
|
children: e
|
|
4524
4608
|
});
|
|
@@ -4526,7 +4610,7 @@ var zr = {
|
|
|
4526
4610
|
};
|
|
4527
4611
|
//#endregion
|
|
4528
4612
|
//#region package/common/themeProvider/useTheme.ts
|
|
4529
|
-
function
|
|
4613
|
+
function Wr(e = "default") {
|
|
4530
4614
|
let [t, n] = f(localStorage.getItem("theme") || e);
|
|
4531
4615
|
return {
|
|
4532
4616
|
currentThemeId: t,
|
|
@@ -4537,8 +4621,8 @@ function Hr(e = "default") {
|
|
|
4537
4621
|
}
|
|
4538
4622
|
//#endregion
|
|
4539
4623
|
//#region package/common/timeInput/timeFunctions.ts
|
|
4540
|
-
var
|
|
4541
|
-
function
|
|
4624
|
+
var Gr = (e) => (Math.trunc(e) % 24 + 24) % 24, Kr = (e) => (Math.trunc(e) % 60 + 60) % 60;
|
|
4625
|
+
function qr(e) {
|
|
4542
4626
|
if (!e) return null;
|
|
4543
4627
|
let t = e.match(/^(\d{1,2}):(\d{1,2})$/);
|
|
4544
4628
|
if (!t) return null;
|
|
@@ -4548,31 +4632,31 @@ function Gr(e) {
|
|
|
4548
4632
|
minutes: r
|
|
4549
4633
|
};
|
|
4550
4634
|
}
|
|
4551
|
-
function
|
|
4552
|
-
return e ? `${String(
|
|
4635
|
+
function Jr(e) {
|
|
4636
|
+
return e ? `${String(Gr(e.hours)).padStart(2, "0")}:${String(Kr(e.minutes)).padStart(2, "0")}` : "";
|
|
4553
4637
|
}
|
|
4554
|
-
function
|
|
4555
|
-
return
|
|
4638
|
+
function Yr(e, t) {
|
|
4639
|
+
return Kr(!t || t <= 1 ? e : Math.round(Kr(e) / t) * t);
|
|
4556
4640
|
}
|
|
4557
|
-
var
|
|
4558
|
-
function
|
|
4559
|
-
let r =
|
|
4560
|
-
return i && (r = Math.max(r,
|
|
4641
|
+
var Xr = (e) => e.hours * 60 + e.minutes;
|
|
4642
|
+
function Zr(e, t, n) {
|
|
4643
|
+
let r = Xr(e), i = qr(t), a = qr(n);
|
|
4644
|
+
return i && (r = Math.max(r, Xr(i))), a && (r = Math.min(r, Xr(a))), {
|
|
4561
4645
|
hours: Math.floor(r / 60),
|
|
4562
4646
|
minutes: r % 60
|
|
4563
4647
|
};
|
|
4564
4648
|
}
|
|
4565
|
-
function
|
|
4649
|
+
function Qr(e, t, n, r, i) {
|
|
4566
4650
|
let a = r * i * Math.PI / 180;
|
|
4567
4651
|
return {
|
|
4568
4652
|
x: e + n * Math.sin(a),
|
|
4569
4653
|
y: t - n * Math.cos(a)
|
|
4570
4654
|
};
|
|
4571
4655
|
}
|
|
4572
|
-
function
|
|
4656
|
+
function $r(e, t) {
|
|
4573
4657
|
return (Math.atan2(e, -t) * 180 / Math.PI + 360) % 360;
|
|
4574
4658
|
}
|
|
4575
|
-
var
|
|
4659
|
+
var ei = (e, t) => Math.sqrt(e * e + t * t), ti = {
|
|
4576
4660
|
clockFace: "clockFace_LbXIa",
|
|
4577
4661
|
clockHand: "clockHand_E9nTw",
|
|
4578
4662
|
"clockHand-line": "clockHand-line_iOipC",
|
|
@@ -4586,8 +4670,8 @@ var Qr = (e, t) => Math.sqrt(e * e + t * t), $r = {
|
|
|
4586
4670
|
clockNumberInner: "clockNumber-inner_x2XR1",
|
|
4587
4671
|
"clockNumber-selected": "clockNumber-selected_rPVlV",
|
|
4588
4672
|
clockNumberSelected: "clockNumber-selected_rPVlV"
|
|
4589
|
-
},
|
|
4590
|
-
function
|
|
4673
|
+
}, ni = 50, ri = 40, ii = 25.5, ai = 65.5 / 2, oi = 30, si = 6, ci = (e) => (e + 11) % 12 + 1;
|
|
4674
|
+
function li(e, t) {
|
|
4591
4675
|
if (e === "minutes") return Array.from({ length: 12 }, (e, t) => {
|
|
4592
4676
|
let n = t * 5;
|
|
4593
4677
|
return {
|
|
@@ -4625,49 +4709,49 @@ function si(e, t) {
|
|
|
4625
4709
|
});
|
|
4626
4710
|
return [...n, ...r];
|
|
4627
4711
|
}
|
|
4628
|
-
function
|
|
4629
|
-
let c = d(null), l = d(!1), u =
|
|
4712
|
+
function ui({ time: e, mode: t, use24Hour: n, minuteStep: r, onChange: i, onCommit: a, classNames: o, styles: s }) {
|
|
4713
|
+
let c = d(null), l = d(!1), u = li(t, n), f = e.hours >= 12, m = ci(e.hours), h = t === "minutes" ? {
|
|
4630
4714
|
slot: e.minutes,
|
|
4631
|
-
radius:
|
|
4715
|
+
radius: ri
|
|
4632
4716
|
} : n ? e.hours === 0 ? {
|
|
4633
4717
|
slot: 0,
|
|
4634
|
-
radius:
|
|
4718
|
+
radius: ii
|
|
4635
4719
|
} : e.hours <= 12 ? {
|
|
4636
4720
|
slot: e.hours % 12,
|
|
4637
|
-
radius:
|
|
4721
|
+
radius: ri
|
|
4638
4722
|
} : {
|
|
4639
4723
|
slot: (e.hours - 12) % 12,
|
|
4640
|
-
radius:
|
|
4724
|
+
radius: ii
|
|
4641
4725
|
} : {
|
|
4642
4726
|
slot: m % 12,
|
|
4643
|
-
radius:
|
|
4644
|
-
}, g =
|
|
4727
|
+
radius: ri
|
|
4728
|
+
}, g = Qr(ni, ni, h.radius, h.slot, t === "minutes" ? si : oi), _ = (i) => t === "minutes" ? Yr(e.minutes, r) === i.value || e.minutes === i.value : n ? e.hours === i.value : m === i.value, v = (i, a) => {
|
|
4645
4729
|
let o = c.current?.getBoundingClientRect();
|
|
4646
4730
|
if (!o) return e;
|
|
4647
|
-
let s = i - (o.left + o.width / 2), l = a - (o.top + o.height / 2), u =
|
|
4731
|
+
let s = i - (o.left + o.width / 2), l = a - (o.top + o.height / 2), u = $r(s, l);
|
|
4648
4732
|
if (t === "minutes") {
|
|
4649
|
-
let t =
|
|
4733
|
+
let t = Yr(Math.round(u / si), r);
|
|
4650
4734
|
return {
|
|
4651
4735
|
hours: e.hours,
|
|
4652
4736
|
minutes: t
|
|
4653
4737
|
};
|
|
4654
4738
|
}
|
|
4655
|
-
let d = Math.round(u /
|
|
4739
|
+
let d = Math.round(u / oi) % 12;
|
|
4656
4740
|
if (!n) {
|
|
4657
4741
|
let t = d === 0 ? 12 : d;
|
|
4658
4742
|
return {
|
|
4659
|
-
hours:
|
|
4743
|
+
hours: Gr(f ? t % 12 + 12 : t % 12),
|
|
4660
4744
|
minutes: e.minutes
|
|
4661
4745
|
};
|
|
4662
4746
|
}
|
|
4663
4747
|
return {
|
|
4664
|
-
hours:
|
|
4748
|
+
hours: Gr(ei(s, l) / (o.width / 2) * ni < ai ? d === 0 ? 0 : d + 12 : d === 0 ? 12 : d),
|
|
4665
4749
|
minutes: e.minutes
|
|
4666
4750
|
};
|
|
4667
4751
|
};
|
|
4668
4752
|
return /* @__PURE__ */ G("div", {
|
|
4669
4753
|
ref: c,
|
|
4670
|
-
className: p(
|
|
4754
|
+
className: p(ti.clockFace, o?.clockFace),
|
|
4671
4755
|
style: s?.clockFace,
|
|
4672
4756
|
onPointerDown: (e) => {
|
|
4673
4757
|
l.current = !0, e.currentTarget.setPointerCapture?.(e.pointerId), i(v(e.clientX, e.clientY));
|
|
@@ -4682,35 +4766,35 @@ function ci({ time: e, mode: t, use24Hour: n, minuteStep: r, onChange: i, onComm
|
|
|
4682
4766
|
"aria-label": t === "minutes" ? "Minutes" : "Hours",
|
|
4683
4767
|
"aria-valuetext": t === "minutes" ? `${e.minutes} minutes` : `${e.hours} hours`,
|
|
4684
4768
|
children: [/* @__PURE__ */ G("svg", {
|
|
4685
|
-
className:
|
|
4769
|
+
className: ti.clockHand,
|
|
4686
4770
|
viewBox: "0 0 100 100",
|
|
4687
4771
|
"aria-hidden": !0,
|
|
4688
4772
|
children: [
|
|
4689
4773
|
/* @__PURE__ */ W("circle", {
|
|
4690
|
-
cx:
|
|
4691
|
-
cy:
|
|
4774
|
+
cx: ni,
|
|
4775
|
+
cy: ni,
|
|
4692
4776
|
r: 1.8,
|
|
4693
|
-
className:
|
|
4777
|
+
className: ti.clockHandCenter
|
|
4694
4778
|
}),
|
|
4695
4779
|
/* @__PURE__ */ W("line", {
|
|
4696
|
-
x1:
|
|
4697
|
-
y1:
|
|
4780
|
+
x1: ni,
|
|
4781
|
+
y1: ni,
|
|
4698
4782
|
x2: g.x,
|
|
4699
4783
|
y2: g.y,
|
|
4700
|
-
className:
|
|
4784
|
+
className: ti.clockHandLine
|
|
4701
4785
|
}),
|
|
4702
4786
|
/* @__PURE__ */ W("circle", {
|
|
4703
4787
|
cx: g.x,
|
|
4704
4788
|
cy: g.y,
|
|
4705
4789
|
r: 7,
|
|
4706
|
-
className: p(
|
|
4790
|
+
className: p(ti.clockHandKnob, o?.clockHand),
|
|
4707
4791
|
style: s?.clockHand
|
|
4708
4792
|
})
|
|
4709
4793
|
]
|
|
4710
4794
|
}), u.map((e) => {
|
|
4711
|
-
let t =
|
|
4795
|
+
let t = Qr(ni, ni, e.ring === "inner" ? ii : ri, e.slot, oi), n = _(e);
|
|
4712
4796
|
return /* @__PURE__ */ W("div", {
|
|
4713
|
-
className: p(
|
|
4797
|
+
className: p(ti.clockNumber, e.ring === "inner" && ti.clockNumberInner, n && ti.clockNumberSelected, o?.clockNumber),
|
|
4714
4798
|
style: {
|
|
4715
4799
|
left: `${t.x}%`,
|
|
4716
4800
|
top: `${t.y}%`,
|
|
@@ -4721,7 +4805,7 @@ function ci({ time: e, mode: t, use24Hour: n, minuteStep: r, onChange: i, onComm
|
|
|
4721
4805
|
})]
|
|
4722
4806
|
});
|
|
4723
4807
|
}
|
|
4724
|
-
var
|
|
4808
|
+
var di = {
|
|
4725
4809
|
timeInput: "timeInput_EbsZN",
|
|
4726
4810
|
"timeInput-clock": "timeInput-clock_D1-dk",
|
|
4727
4811
|
timeInputClock: "timeInput-clock_D1-dk",
|
|
@@ -4742,7 +4826,7 @@ var li = {
|
|
|
4742
4826
|
};
|
|
4743
4827
|
//#endregion
|
|
4744
4828
|
//#region package/common/timeInput/timeInput.tsx
|
|
4745
|
-
function
|
|
4829
|
+
function fi({ value: e, selected: t, onChange: n = () => null, onSelect: r = () => null, formValidator: i = null, isInline: o = !1, isModal: s = !1, noInput: c = !1, noHeader: l = !1, showClearButton: u = !1, showNowButton: h = !1, minuteStep: g = 1, use24Hour: _ = !0, minTime: v = null, maxTime: y = null, label: b = "", isValid: x = !0, errorMessage: S = "", isRequired: C = !1, disabled: T = !1, className: E = "", style: D, classNames: O, styles: k, ...A }) {
|
|
4746
4830
|
let j = () => i ? i.value || "" : e ?? t ?? "", [M, N] = f(j), [P, F] = f(!1), [I, L] = f("hours"), [R, z] = f(!1), [B, V] = f(!1), [, ee] = f(0), te = j(), [H, ne] = f(te), U = d(i);
|
|
4747
4831
|
!i && H !== te && (ne(te), N(te)), a(() => {
|
|
4748
4832
|
if (U.current = i, !i) return;
|
|
@@ -4752,28 +4836,28 @@ function ui({ value: e, selected: t, onChange: n = () => null, onSelect: r = ()
|
|
|
4752
4836
|
return i.registerOnUpdateListener(e), () => i.removeOnUpdateListener(e);
|
|
4753
4837
|
}, [i]);
|
|
4754
4838
|
let re = () => i ? i.touched && i.hasError() : !x || !!S, ie = () => !!(C || i?.validators.find((e) => e.validatorId === "required")), K = (e) => {
|
|
4755
|
-
let t = e ?
|
|
4839
|
+
let t = e ? Jr(e) : null;
|
|
4756
4840
|
i && i.set(t), n?.(t);
|
|
4757
4841
|
}, oe = (e) => {
|
|
4758
|
-
N(e ?
|
|
4759
|
-
}, se =
|
|
4842
|
+
N(e ? Jr(e) : ""), K(e);
|
|
4843
|
+
}, se = qr(M), q = se ?? {
|
|
4760
4844
|
hours: 12,
|
|
4761
4845
|
minutes: 0
|
|
4762
4846
|
}, ce = (e) => {
|
|
4763
|
-
oe(
|
|
4847
|
+
oe(Zr({
|
|
4764
4848
|
hours: e.hours,
|
|
4765
|
-
minutes:
|
|
4849
|
+
minutes: Yr(e.minutes, g)
|
|
4766
4850
|
}, v, y));
|
|
4767
4851
|
}, le = (e) => {
|
|
4768
|
-
let t =
|
|
4852
|
+
let t = Zr({
|
|
4769
4853
|
hours: e.hours,
|
|
4770
|
-
minutes:
|
|
4854
|
+
minutes: Yr(e.minutes, g)
|
|
4771
4855
|
}, v, y);
|
|
4772
4856
|
if (oe(t), I === "hours") {
|
|
4773
4857
|
L("minutes");
|
|
4774
4858
|
return;
|
|
4775
4859
|
}
|
|
4776
|
-
r?.(
|
|
4860
|
+
r?.(Jr(t)), o || F(!1);
|
|
4777
4861
|
}, ue = () => {
|
|
4778
4862
|
T || (L("hours"), F(!0));
|
|
4779
4863
|
}, de = ({ previousState: e, nextState: t }) => {
|
|
@@ -4787,55 +4871,55 @@ function ui({ value: e, selected: t, onChange: n = () => null, onSelect: r = ()
|
|
|
4787
4871
|
};
|
|
4788
4872
|
}, fe = (e) => {
|
|
4789
4873
|
N(e);
|
|
4790
|
-
let t =
|
|
4874
|
+
let t = qr(e);
|
|
4791
4875
|
t && K(t);
|
|
4792
4876
|
}, pe = () => {
|
|
4793
|
-
U.current && (U.current.touched = !0), z(!1), K(
|
|
4877
|
+
U.current && (U.current.touched = !0), z(!1), K(qr(M));
|
|
4794
4878
|
}, me = (e) => {
|
|
4795
4879
|
e !== q.hours >= 12 && oe({
|
|
4796
|
-
hours:
|
|
4880
|
+
hours: Gr(q.hours + (e ? 12 : -12)),
|
|
4797
4881
|
minutes: q.minutes
|
|
4798
4882
|
});
|
|
4799
4883
|
}, he = re(), ge = se ? String(_ ? se.hours : (se.hours + 11) % 12 + 1).padStart(2, "0") : "--", _e = se ? String(se.minutes).padStart(2, "0") : "--", ve = l ? null : /* @__PURE__ */ G("div", {
|
|
4800
|
-
className: p(
|
|
4884
|
+
className: p(di.timeInputClockHeader, O?.clockHeader),
|
|
4801
4885
|
style: k?.clockHeader,
|
|
4802
4886
|
children: [
|
|
4803
4887
|
/* @__PURE__ */ W("button", {
|
|
4804
4888
|
type: "button",
|
|
4805
|
-
className: p(
|
|
4889
|
+
className: p(di.timeInputHeaderSegment, I === "hours" && di.timeInputHeaderSegmentActive, O?.headerSegment),
|
|
4806
4890
|
style: k?.headerSegment,
|
|
4807
4891
|
onClick: () => L("hours"),
|
|
4808
4892
|
children: ge
|
|
4809
4893
|
}),
|
|
4810
4894
|
/* @__PURE__ */ W("span", {
|
|
4811
|
-
className:
|
|
4895
|
+
className: di.timeInputHeaderColon,
|
|
4812
4896
|
children: ":"
|
|
4813
4897
|
}),
|
|
4814
4898
|
/* @__PURE__ */ W("button", {
|
|
4815
4899
|
type: "button",
|
|
4816
|
-
className: p(
|
|
4900
|
+
className: p(di.timeInputHeaderSegment, I === "minutes" && di.timeInputHeaderSegmentActive, O?.headerSegment),
|
|
4817
4901
|
style: k?.headerSegment,
|
|
4818
4902
|
onClick: () => L("minutes"),
|
|
4819
4903
|
children: _e
|
|
4820
4904
|
}),
|
|
4821
4905
|
!_ && /* @__PURE__ */ G("div", {
|
|
4822
|
-
className: p(
|
|
4906
|
+
className: p(di.timeInputMeridiem, O?.meridiem),
|
|
4823
4907
|
style: k?.meridiem,
|
|
4824
4908
|
children: [/* @__PURE__ */ W("button", {
|
|
4825
4909
|
type: "button",
|
|
4826
|
-
className: p(q.hours < 12 &&
|
|
4910
|
+
className: p(q.hours < 12 && di.timeInputMeridiemActive),
|
|
4827
4911
|
onClick: () => me(!1),
|
|
4828
4912
|
children: "AM"
|
|
4829
4913
|
}), /* @__PURE__ */ W("button", {
|
|
4830
4914
|
type: "button",
|
|
4831
|
-
className: p(q.hours >= 12 &&
|
|
4915
|
+
className: p(q.hours >= 12 && di.timeInputMeridiemActive),
|
|
4832
4916
|
onClick: () => me(!0),
|
|
4833
4917
|
children: "PM"
|
|
4834
4918
|
})]
|
|
4835
4919
|
})
|
|
4836
4920
|
]
|
|
4837
4921
|
}), ye = u || h ? /* @__PURE__ */ G("div", {
|
|
4838
|
-
className: p(
|
|
4922
|
+
className: p(di.timeInputFooter, O?.footer),
|
|
4839
4923
|
style: k?.footer,
|
|
4840
4924
|
children: [h && /* @__PURE__ */ W(Pe, {
|
|
4841
4925
|
styleType: De.Default,
|
|
@@ -4855,11 +4939,11 @@ function ui({ value: e, selected: t, onChange: n = () => null, onSelect: r = ()
|
|
|
4855
4939
|
children: "Clear"
|
|
4856
4940
|
})]
|
|
4857
4941
|
}) : null, be = /* @__PURE__ */ G("div", {
|
|
4858
|
-
className: p(
|
|
4942
|
+
className: p(di.timeInputClock, O?.clock),
|
|
4859
4943
|
style: k?.clock,
|
|
4860
4944
|
children: [
|
|
4861
4945
|
ve,
|
|
4862
|
-
/* @__PURE__ */ W(
|
|
4946
|
+
/* @__PURE__ */ W(ui, {
|
|
4863
4947
|
time: q,
|
|
4864
4948
|
mode: I,
|
|
4865
4949
|
use24Hour: _,
|
|
@@ -4904,7 +4988,7 @@ function ui({ value: e, selected: t, onChange: n = () => null, onSelect: r = ()
|
|
|
4904
4988
|
children: xe
|
|
4905
4989
|
});
|
|
4906
4990
|
return /* @__PURE__ */ G("div", {
|
|
4907
|
-
className: p(
|
|
4991
|
+
className: p(di.timeInput, O?.root, E),
|
|
4908
4992
|
style: {
|
|
4909
4993
|
...k?.root,
|
|
4910
4994
|
...D
|
|
@@ -4921,7 +5005,7 @@ function ui({ value: e, selected: t, onChange: n = () => null, onSelect: r = ()
|
|
|
4921
5005
|
]
|
|
4922
5006
|
});
|
|
4923
5007
|
}
|
|
4924
|
-
var
|
|
5008
|
+
var pi = {
|
|
4925
5009
|
container: "container_krdsW",
|
|
4926
5010
|
"container-top-left": "container-top-left_zfDTO",
|
|
4927
5011
|
containerTopLeft: "container-top-left_zfDTO",
|
|
@@ -4958,14 +5042,14 @@ var di = {
|
|
|
4958
5042
|
toastCloseButton: "toastCloseButton_n-YST",
|
|
4959
5043
|
toastProgressBar: "toastProgressBar_6vBs6",
|
|
4960
5044
|
toastShrink: "toastShrink_h89HS"
|
|
4961
|
-
},
|
|
5045
|
+
}, mi = {
|
|
4962
5046
|
info: S,
|
|
4963
5047
|
success: x,
|
|
4964
5048
|
error: C,
|
|
4965
5049
|
warn: ee,
|
|
4966
5050
|
default: h
|
|
4967
5051
|
};
|
|
4968
|
-
function
|
|
5052
|
+
function hi({ item: e, isBottom: t, onDismiss: n }) {
|
|
4969
5053
|
let { id: r, content: i, options: o, dismissing: s } = e, { duration: c, showRemainingTime: l, showCloseButton: u, type: d, classNames: f, styles: h } = o;
|
|
4970
5054
|
return a(() => {
|
|
4971
5055
|
if (c === 0) return;
|
|
@@ -4976,28 +5060,28 @@ function pi({ item: e, isBottom: t, onDismiss: n }) {
|
|
|
4976
5060
|
c,
|
|
4977
5061
|
n
|
|
4978
5062
|
]), /* @__PURE__ */ G("div", {
|
|
4979
|
-
className: p(
|
|
5063
|
+
className: p(pi.toast, t ? pi.toastBottom : null, pi[`toast-${d}`], s && pi.toastDismissing, f?.root),
|
|
4980
5064
|
style: h?.root,
|
|
4981
5065
|
children: [
|
|
4982
5066
|
/* @__PURE__ */ W(m, {
|
|
4983
|
-
icon:
|
|
4984
|
-
className: p(
|
|
5067
|
+
icon: mi[d],
|
|
5068
|
+
className: p(pi.toastIcon, f?.icon),
|
|
4985
5069
|
style: h?.icon
|
|
4986
5070
|
}),
|
|
4987
5071
|
/* @__PURE__ */ W("div", {
|
|
4988
|
-
className: p(
|
|
5072
|
+
className: p(pi.toastContent, f?.content),
|
|
4989
5073
|
style: h?.content,
|
|
4990
5074
|
children: i
|
|
4991
5075
|
}),
|
|
4992
5076
|
u && /* @__PURE__ */ W(Be, {
|
|
4993
5077
|
icon: H,
|
|
4994
5078
|
onClick: () => n(r),
|
|
4995
|
-
className: p(
|
|
5079
|
+
className: p(pi.toastCloseButton, f?.closeButton),
|
|
4996
5080
|
style: h?.closeButton,
|
|
4997
5081
|
"aria-label": "Close"
|
|
4998
5082
|
}),
|
|
4999
5083
|
l && c > 0 && /* @__PURE__ */ W("div", {
|
|
5000
|
-
className: p(
|
|
5084
|
+
className: p(pi.toastProgressBar, f?.progressBar),
|
|
5001
5085
|
style: {
|
|
5002
5086
|
"--toast-duration": `${c}ms`,
|
|
5003
5087
|
...h?.progressBar
|
|
@@ -5008,40 +5092,40 @@ function pi({ item: e, isBottom: t, onDismiss: n }) {
|
|
|
5008
5092
|
}
|
|
5009
5093
|
//#endregion
|
|
5010
5094
|
//#region package/common/toast/toastService.ts
|
|
5011
|
-
var
|
|
5012
|
-
function
|
|
5013
|
-
|
|
5095
|
+
var gi = null;
|
|
5096
|
+
function _i(e) {
|
|
5097
|
+
gi = e;
|
|
5014
5098
|
}
|
|
5015
|
-
function
|
|
5016
|
-
|
|
5099
|
+
function vi() {
|
|
5100
|
+
gi = null;
|
|
5017
5101
|
}
|
|
5018
|
-
function
|
|
5019
|
-
if (!
|
|
5102
|
+
function yi(e, t) {
|
|
5103
|
+
if (!gi) {
|
|
5020
5104
|
console.error("[Toast] No ToastProvider found. Wrap your app with <ToastProvider>.");
|
|
5021
5105
|
return;
|
|
5022
5106
|
}
|
|
5023
|
-
|
|
5107
|
+
gi(e, t);
|
|
5024
5108
|
}
|
|
5025
5109
|
//#endregion
|
|
5026
5110
|
//#region package/common/toast/toastProvider.tsx
|
|
5027
|
-
var
|
|
5111
|
+
var bi = {
|
|
5028
5112
|
position: "top-right",
|
|
5029
5113
|
duration: 4e3,
|
|
5030
5114
|
showRemainingTime: !0,
|
|
5031
5115
|
showCloseButton: !0,
|
|
5032
5116
|
allowStacking: !0
|
|
5033
|
-
},
|
|
5034
|
-
function
|
|
5035
|
-
return
|
|
5117
|
+
}, xi = 220;
|
|
5118
|
+
function Si(e) {
|
|
5119
|
+
return pi[`container-${e}`];
|
|
5036
5120
|
}
|
|
5037
|
-
function
|
|
5121
|
+
function Ci({ children: e, position: t = bi.position, duration: n = bi.duration, showRemainingTime: r = bi.showRemainingTime, showCloseButton: o = bi.showCloseButton, allowStacking: s = bi.allowStacking }) {
|
|
5038
5122
|
let [c, l] = f([]), u = d(0), m = i((e) => {
|
|
5039
5123
|
l((t) => t.map((t) => t.id === e ? {
|
|
5040
5124
|
...t,
|
|
5041
5125
|
dismissing: !0
|
|
5042
5126
|
} : t)), setTimeout(() => {
|
|
5043
5127
|
l((t) => t.filter((t) => t.id !== e));
|
|
5044
|
-
},
|
|
5128
|
+
}, xi);
|
|
5045
5129
|
}, []), h = i((e, i) => {
|
|
5046
5130
|
let a = {
|
|
5047
5131
|
position: i?.position ?? t,
|
|
@@ -5061,7 +5145,7 @@ function xi({ children: e, position: t = vi.position, duration: n = vi.duration,
|
|
|
5061
5145
|
};
|
|
5062
5146
|
l((e) => !s && e.length > 0 ? (setTimeout(() => {
|
|
5063
5147
|
l([c]);
|
|
5064
|
-
},
|
|
5148
|
+
}, xi), e.map((e) => ({
|
|
5065
5149
|
...e,
|
|
5066
5150
|
dismissing: !0
|
|
5067
5151
|
}))) : [...e, c]);
|
|
@@ -5072,14 +5156,14 @@ function xi({ children: e, position: t = vi.position, duration: n = vi.duration,
|
|
|
5072
5156
|
o,
|
|
5073
5157
|
s
|
|
5074
5158
|
]);
|
|
5075
|
-
a(() => (
|
|
5159
|
+
a(() => (_i(h), () => vi()), [h]);
|
|
5076
5160
|
let g = c.reduce((e, t) => {
|
|
5077
5161
|
let n = t.options.position;
|
|
5078
5162
|
return e[n] || (e[n] = []), e[n].push(t), e;
|
|
5079
5163
|
}, {});
|
|
5080
5164
|
return /* @__PURE__ */ G(U, { children: [e, /* @__PURE__ */ W(Ve, { children: Object.entries(g).map(([e, t]) => /* @__PURE__ */ W("div", {
|
|
5081
|
-
className: p(
|
|
5082
|
-
children: t.map((t) => /* @__PURE__ */ W(
|
|
5165
|
+
className: p(pi.container, Si(e)),
|
|
5166
|
+
children: t.map((t) => /* @__PURE__ */ W(hi, {
|
|
5083
5167
|
item: t,
|
|
5084
5168
|
isBottom: e.startsWith("bottom"),
|
|
5085
5169
|
onDismiss: m
|
|
@@ -5141,7 +5225,7 @@ var $ = {
|
|
|
5141
5225
|
};
|
|
5142
5226
|
//#endregion
|
|
5143
5227
|
//#region package/common/virtualList/virtualRow.tsx
|
|
5144
|
-
function
|
|
5228
|
+
function wi({ index: e, top: t, padding: n, columnTemplate: r, isSelected: i, showDivider: a, hover: o, onClick: s, observer: l, ariaRowIndex: u, ariaPosInSet: f, ariaSetSize: m, rowRole: h, reorderable: g, draggable: _, isDragging: v, reserveToggleGutter: y, onMouseDown: b, onDragStart: x, onDragOver: S, onDragEnd: C, onDrop: w, onTouchStart: T, dropPosition: E, dropIndentPx: D, dropIndicatorClassName: O, dropIndicatorStyle: k, rowClassName: A, rowStyle: j, children: M }) {
|
|
5145
5229
|
let N = d(null);
|
|
5146
5230
|
return c(() => {
|
|
5147
5231
|
let e = N.current;
|
|
@@ -5191,7 +5275,7 @@ function Si({ index: e, top: t, padding: n, columnTemplate: r, isSelected: i, sh
|
|
|
5191
5275
|
}
|
|
5192
5276
|
//#endregion
|
|
5193
5277
|
//#region package/common/virtualList/virtualList.utils.ts
|
|
5194
|
-
function
|
|
5278
|
+
function Ti(e, t, n, r = 0) {
|
|
5195
5279
|
let i = e.length, a = Array(i + 1);
|
|
5196
5280
|
a[0] = 0;
|
|
5197
5281
|
for (let o = 0; o < i; o++) {
|
|
@@ -5203,7 +5287,7 @@ function Ci(e, t, n, r = 0) {
|
|
|
5203
5287
|
totalHeight: a[i]
|
|
5204
5288
|
};
|
|
5205
5289
|
}
|
|
5206
|
-
function
|
|
5290
|
+
function Ei(e, t, n) {
|
|
5207
5291
|
if (n <= 0) return 0;
|
|
5208
5292
|
let r = 0, i = n - 1;
|
|
5209
5293
|
for (; r < i;) {
|
|
@@ -5212,34 +5296,34 @@ function wi(e, t, n) {
|
|
|
5212
5296
|
}
|
|
5213
5297
|
return r;
|
|
5214
5298
|
}
|
|
5215
|
-
function
|
|
5299
|
+
function Di(e, t, n, r, i) {
|
|
5216
5300
|
if (i === 0) return {
|
|
5217
5301
|
startIndex: 0,
|
|
5218
5302
|
endIndex: -1
|
|
5219
5303
|
};
|
|
5220
|
-
let a =
|
|
5304
|
+
let a = Ei(e, t, i), o = a;
|
|
5221
5305
|
for (; o < i && e[o] < t + n;) o++;
|
|
5222
5306
|
return {
|
|
5223
5307
|
startIndex: Math.max(0, a - r),
|
|
5224
5308
|
endIndex: Math.min(i - 1, o + r - 1)
|
|
5225
5309
|
};
|
|
5226
5310
|
}
|
|
5227
|
-
function
|
|
5311
|
+
function Oi(e, t, n, r, i) {
|
|
5228
5312
|
if (e === -1 || e === t) return null;
|
|
5229
5313
|
let a = r + i / 2;
|
|
5230
5314
|
return (t > e ? n >= a : n <= a) ? t : null;
|
|
5231
5315
|
}
|
|
5232
|
-
function
|
|
5316
|
+
function ki(e, t, n, r) {
|
|
5233
5317
|
if (n <= 0) return "before";
|
|
5234
5318
|
let i = (e - t) / n;
|
|
5235
5319
|
return r ? i < 1 / 3 ? "before" : i > 2 / 3 ? "after" : "inside" : i < .5 ? "before" : "after";
|
|
5236
5320
|
}
|
|
5237
|
-
function
|
|
5321
|
+
function Ai(e, t) {
|
|
5238
5322
|
let n = t[e], r = e + 1;
|
|
5239
5323
|
for (; r < t.length && t[r] > n;) r++;
|
|
5240
5324
|
return r - 1;
|
|
5241
5325
|
}
|
|
5242
|
-
function
|
|
5326
|
+
function ji(e, t) {
|
|
5243
5327
|
return e.length === 0 ? "1fr" : e.map((e) => {
|
|
5244
5328
|
switch (e.width.type) {
|
|
5245
5329
|
case "fixed": return `${e.width.px}px`;
|
|
@@ -5251,11 +5335,11 @@ function ki(e, t) {
|
|
|
5251
5335
|
}
|
|
5252
5336
|
}).join(" ");
|
|
5253
5337
|
}
|
|
5254
|
-
var
|
|
5255
|
-
function
|
|
5338
|
+
var Mi = "ahroweui:virtuallist:columns:";
|
|
5339
|
+
function Ni(e) {
|
|
5256
5340
|
if (!e || typeof window > "u") return null;
|
|
5257
5341
|
try {
|
|
5258
|
-
let t = window.localStorage.getItem(
|
|
5342
|
+
let t = window.localStorage.getItem(Mi + e);
|
|
5259
5343
|
if (!t) return null;
|
|
5260
5344
|
let n = JSON.parse(t);
|
|
5261
5345
|
if (n && Array.isArray(n.visible) && Array.isArray(n.known)) return {
|
|
@@ -5265,12 +5349,12 @@ function ji(e) {
|
|
|
5265
5349
|
} catch {}
|
|
5266
5350
|
return null;
|
|
5267
5351
|
}
|
|
5268
|
-
function
|
|
5352
|
+
function Pi(e, t) {
|
|
5269
5353
|
return t && t.known.includes(e.key) ? t.visible.includes(e.key) : !e.defaultHidden;
|
|
5270
5354
|
}
|
|
5271
5355
|
//#endregion
|
|
5272
5356
|
//#region package/common/virtualList/useVirtualWindow.ts
|
|
5273
|
-
function
|
|
5357
|
+
function Fi(e, t) {
|
|
5274
5358
|
if (typeof e == "number") return e;
|
|
5275
5359
|
let n = e.trim();
|
|
5276
5360
|
if (n === "") return 0;
|
|
@@ -5284,8 +5368,8 @@ function Ni(e, t) {
|
|
|
5284
5368
|
let o = a.getBoundingClientRect().height;
|
|
5285
5369
|
return t.removeChild(a), Number.isFinite(o) ? o : 0;
|
|
5286
5370
|
}
|
|
5287
|
-
function
|
|
5288
|
-
let [m, h] = f(0), [g, _] = f(0), [v, y] = f(0), [b, x] = f(() =>
|
|
5371
|
+
function Ii({ items: e, keys: t, getItemKey: n, estimatedRowHeight: r, rowGap: o, overscan: s, onLoadMore: u, loadMoreThreshold: p }) {
|
|
5372
|
+
let [m, h] = f(0), [g, _] = f(0), [v, y] = f(0), [b, x] = f(() => Fi(o, null)), [S, C] = f(/* @__PURE__ */ new Map()), [w, T] = f(!1), E = d(!1), D = d(null), O = d(null), k = d([]), A = d(null), j = d(0), M = d([]), [N] = f(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((e) => {
|
|
5289
5373
|
C((t) => {
|
|
5290
5374
|
let n = null;
|
|
5291
5375
|
for (let r of e) {
|
|
@@ -5321,14 +5405,14 @@ function Pi({ items: e, keys: t, getItemKey: n, estimatedRowHeight: r, rowGap: o
|
|
|
5321
5405
|
}, []), c(() => {
|
|
5322
5406
|
M.current = t;
|
|
5323
5407
|
}), c(() => {
|
|
5324
|
-
let e =
|
|
5408
|
+
let e = Fi(o, D.current);
|
|
5325
5409
|
x((t) => t === e ? t : e);
|
|
5326
5410
|
}, [
|
|
5327
5411
|
o,
|
|
5328
5412
|
v,
|
|
5329
5413
|
g
|
|
5330
5414
|
]);
|
|
5331
|
-
let { offsets: F, totalHeight: I } = l(() =>
|
|
5415
|
+
let { offsets: F, totalHeight: I } = l(() => Ti(t, S, r, b), [
|
|
5332
5416
|
t,
|
|
5333
5417
|
S,
|
|
5334
5418
|
r,
|
|
@@ -5339,7 +5423,7 @@ function Pi({ items: e, keys: t, getItemKey: n, estimatedRowHeight: r, rowGap: o
|
|
|
5339
5423
|
if (k.current = F, !t || n.length === 0) return;
|
|
5340
5424
|
let r = t.scrollTop;
|
|
5341
5425
|
if (r <= 0) return;
|
|
5342
|
-
let i =
|
|
5426
|
+
let i = Ei(n, r, n.length - 1);
|
|
5343
5427
|
if (i >= e.length) return;
|
|
5344
5428
|
let a = r - n[i], o = F[i] + a;
|
|
5345
5429
|
Math.abs(o - r) > .5 && (t.scrollTop = o, j.current = o, h(o));
|
|
@@ -5375,7 +5459,7 @@ function Pi({ items: e, keys: t, getItemKey: n, estimatedRowHeight: r, rowGap: o
|
|
|
5375
5459
|
e,
|
|
5376
5460
|
F,
|
|
5377
5461
|
n
|
|
5378
|
-
]), { startIndex: R, endIndex: z } = l(() =>
|
|
5462
|
+
]), { startIndex: R, endIndex: z } = l(() => Di(F, m, g, s, e.length), [
|
|
5379
5463
|
F,
|
|
5380
5464
|
m,
|
|
5381
5465
|
g,
|
|
@@ -5400,7 +5484,7 @@ function Pi({ items: e, keys: t, getItemKey: n, estimatedRowHeight: r, rowGap: o
|
|
|
5400
5484
|
}
|
|
5401
5485
|
//#endregion
|
|
5402
5486
|
//#region package/common/virtualList/useSelection.ts
|
|
5403
|
-
function
|
|
5487
|
+
function Li({ items: e, getKey: t, multiSelect: n, selectedKeys: r, onSelectionChange: i }) {
|
|
5404
5488
|
let a = r !== void 0, [o, s] = f(/* @__PURE__ */ new Set()), c = a ? r : o;
|
|
5405
5489
|
function u(e) {
|
|
5406
5490
|
a || s(e), i?.(e);
|
|
@@ -5439,10 +5523,10 @@ function Fi({ items: e, getKey: t, multiSelect: n, selectedKeys: r, onSelectionC
|
|
|
5439
5523
|
}
|
|
5440
5524
|
//#endregion
|
|
5441
5525
|
//#region package/common/virtualList/useColumns.ts
|
|
5442
|
-
function
|
|
5526
|
+
function Ri({ columns: e, items: t, multiSelect: n, visibleColumnKeys: r, onVisibleColumnsChange: o, persistColumnsKey: s, showColumnToggle: l, rootRef: u, startIndex: p, endIndex: m, containerHeight: h, containerWidth: g }) {
|
|
5443
5527
|
let _ = r !== void 0, [v, y] = f(!1), b = d(null), [x, S] = f({}), [C, w] = f(() => {
|
|
5444
|
-
let t =
|
|
5445
|
-
return new Set((e ?? []).filter((e) =>
|
|
5528
|
+
let t = Ni(s);
|
|
5529
|
+
return new Set((e ?? []).filter((e) => Pi(e, t)).map((e) => e.key));
|
|
5446
5530
|
}), T = d(new Set((e ?? []).map((e) => e.key)));
|
|
5447
5531
|
a(() => {
|
|
5448
5532
|
if (_) return;
|
|
@@ -5455,10 +5539,10 @@ function Ii({ columns: e, items: t, multiSelect: n, visibleColumnKeys: r, onVisi
|
|
|
5455
5539
|
}
|
|
5456
5540
|
if (i) return;
|
|
5457
5541
|
T.current = n;
|
|
5458
|
-
let a =
|
|
5542
|
+
let a = Ni(s);
|
|
5459
5543
|
w((e) => {
|
|
5460
5544
|
let n = /* @__PURE__ */ new Set();
|
|
5461
|
-
for (let i of t) r.has(i.key) ? e.has(i.key) && n.add(i.key) :
|
|
5545
|
+
for (let i of t) r.has(i.key) ? e.has(i.key) && n.add(i.key) : Pi(i, a) && n.add(i.key);
|
|
5462
5546
|
return n;
|
|
5463
5547
|
});
|
|
5464
5548
|
}, [
|
|
@@ -5469,7 +5553,7 @@ function Ii({ columns: e, items: t, multiSelect: n, visibleColumnKeys: r, onVisi
|
|
|
5469
5553
|
if (_ || !s || typeof window > "u") return;
|
|
5470
5554
|
let t = e ?? [];
|
|
5471
5555
|
if (!(t.length === 0 || C.size === 0)) try {
|
|
5472
|
-
window.localStorage.setItem(
|
|
5556
|
+
window.localStorage.setItem(Mi + s, JSON.stringify({
|
|
5473
5557
|
visible: [...C],
|
|
5474
5558
|
known: t.map((e) => e.key)
|
|
5475
5559
|
}));
|
|
@@ -5488,7 +5572,7 @@ function Ii({ columns: e, items: t, multiSelect: n, visibleColumnKeys: r, onVisi
|
|
|
5488
5572
|
}
|
|
5489
5573
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
5490
5574
|
}, [v]);
|
|
5491
|
-
let D = !!e?.length, O = D ? e.filter((e) => E.has(e.key)) : [], k = D ? e.filter((e) => !e.defaultHidden && !E.has(e.key)).length : 0, A = D ? `${n && D ? "40px " : ""}${
|
|
5575
|
+
let D = !!e?.length, O = D ? e.filter((e) => E.has(e.key)) : [], k = D ? e.filter((e) => !e.defaultHidden && !E.has(e.key)).length : 0, A = D ? `${n && D ? "40px " : ""}${ji(O, x)}` : void 0, j = l !== !1 && D, M = O.filter((e) => e.width.type === "fit"), N = M.length > 0, P = M.map((e) => e.key).join("|"), [F, I] = f({
|
|
5492
5576
|
key: P,
|
|
5493
5577
|
items: t
|
|
5494
5578
|
});
|
|
@@ -5588,7 +5672,7 @@ function Ii({ columns: e, items: t, multiSelect: n, visibleColumnKeys: r, onVisi
|
|
|
5588
5672
|
}
|
|
5589
5673
|
//#endregion
|
|
5590
5674
|
//#region package/common/virtualList/useRowDrag.ts
|
|
5591
|
-
function
|
|
5675
|
+
function zi({ reorderable: e, treeReorder: t, onReorder: n, onTreeDrop: r, longPressDelay: o, dragHandle: s, treeIndentPx: l, keys: u, depths: p, isGroupAt: m, rootRef: h, keysRef: g }) {
|
|
5592
5676
|
let _ = d(null), [v, y] = f(null), [b, x] = f(null), S = d(null), C = d(n), w = d(r), T = d(t), E = d(p), D = d(m), O = d(!0), k = d(null), A = d(!1), j = d(null), M = d(0), N = d(0), P = d(null), F = d(!1), I = d(null), L = d(0), R = d(0), z = d(0), [B] = f(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)").matches : !1);
|
|
5593
5677
|
c(() => {
|
|
5594
5678
|
C.current = n, w.current = r, T.current = t, E.current = p, S.current = b, D.current = m;
|
|
@@ -5607,8 +5691,8 @@ function Li({ reorderable: e, treeReorder: t, onReorder: n, onTreeDrop: r, longP
|
|
|
5607
5691
|
let r = _.current;
|
|
5608
5692
|
if (r == null) return null;
|
|
5609
5693
|
let i = u.indexOf(r);
|
|
5610
|
-
if (i !== -1 && e >= i && e <=
|
|
5611
|
-
let a =
|
|
5694
|
+
if (i !== -1 && e >= i && e <= Ai(i, p)) return null;
|
|
5695
|
+
let a = ki(t, n.top, n.height, m(e));
|
|
5612
5696
|
return {
|
|
5613
5697
|
key: u[e],
|
|
5614
5698
|
position: a
|
|
@@ -5633,7 +5717,7 @@ function Li({ reorderable: e, treeReorder: t, onReorder: n, onTreeDrop: r, longP
|
|
|
5633
5717
|
t.preventDefault();
|
|
5634
5718
|
let r = _.current;
|
|
5635
5719
|
if (r == null) return;
|
|
5636
|
-
let i = u.indexOf(r), a = t.currentTarget.getBoundingClientRect(), o =
|
|
5720
|
+
let i = u.indexOf(r), a = t.currentTarget.getBoundingClientRect(), o = Oi(i, e, t.clientY, a.top, a.height);
|
|
5637
5721
|
o != null && n?.(i, o);
|
|
5638
5722
|
}
|
|
5639
5723
|
function re() {
|
|
@@ -5649,18 +5733,18 @@ function Li({ reorderable: e, treeReorder: t, onReorder: n, onTreeDrop: r, longP
|
|
|
5649
5733
|
let s = g.current.indexOf(t), c = a.getBoundingClientRect();
|
|
5650
5734
|
if (T.current) {
|
|
5651
5735
|
let e = g.current, t = E.current;
|
|
5652
|
-
if (s !== -1 && o >= s && o <=
|
|
5736
|
+
if (s !== -1 && o >= s && o <= Ai(s, t)) {
|
|
5653
5737
|
x(null);
|
|
5654
5738
|
return;
|
|
5655
5739
|
}
|
|
5656
|
-
let n =
|
|
5740
|
+
let n = ki(r, c.top, c.height, D.current(o)), i = {
|
|
5657
5741
|
key: e[o],
|
|
5658
5742
|
position: n
|
|
5659
5743
|
};
|
|
5660
5744
|
x((e) => e?.key === i.key && e?.position === i.position ? e : i);
|
|
5661
5745
|
return;
|
|
5662
5746
|
}
|
|
5663
|
-
let l =
|
|
5747
|
+
let l = Oi(s, o, r, c.top, c.height);
|
|
5664
5748
|
l != null && C.current?.(s, l);
|
|
5665
5749
|
}, [h, g]), ae = i(() => {
|
|
5666
5750
|
let e = I.current;
|
|
@@ -5716,7 +5800,7 @@ function Li({ reorderable: e, treeReorder: t, onReorder: n, onTreeDrop: r, longP
|
|
|
5716
5800
|
margin: "0",
|
|
5717
5801
|
opacity: "1",
|
|
5718
5802
|
pointerEvents: "none",
|
|
5719
|
-
zIndex: "
|
|
5803
|
+
zIndex: "3",
|
|
5720
5804
|
background: "var(--background)",
|
|
5721
5805
|
boxShadow: "var(--card-shadow)",
|
|
5722
5806
|
borderRadius: "var(--default-border-radius)"
|
|
@@ -5752,8 +5836,8 @@ function Li({ reorderable: e, treeReorder: t, onReorder: n, onTreeDrop: r, longP
|
|
|
5752
5836
|
}
|
|
5753
5837
|
//#endregion
|
|
5754
5838
|
//#region package/common/virtualList/virtualList.tsx
|
|
5755
|
-
function
|
|
5756
|
-
let H = i((e, t) => f ? f(e, t) : t, [f]), ne = l(() => e.map((e, t) => H(e, t)), [e, H]), re = l(() => A ? e.map((e, t) => A(e, t)) : [], [e, A]), ie = i((t) => M ? M(e[t], t) : !1, [M, e]), ae =
|
|
5839
|
+
function Bi({ items: e, renderRow: t, columns: n, height: r = "100%", estimatedRowHeight: a = 40, overscan: o = 3, rowGap: c = 0, rowPadding: u, selectedKey: d, getItemKey: f, onRowClick: h, visibleColumnKeys: g, onVisibleColumnsChange: _, persistColumnsKey: v, showColumnToggle: y, onLoadMore: b, loadMoreThreshold: x = 100, isLoading: S = !1, multiSelect: C = !1, selectedKeys: w, onSelectionChange: T, reorderable: E = !1, onReorder: D, longPressDelay: O = 400, treeReorder: k = !1, getItemDepth: A, isGroup: M, onTreeDrop: N, treeIndentPx: P = 24, dragHandle: F = !1, showDivider: I = !0, rowHover: L = !0, className: R, style: z, classNames: B, styles: V, ...ee }, te) {
|
|
5840
|
+
let H = i((e, t) => f ? f(e, t) : t, [f]), ne = l(() => e.map((e, t) => H(e, t)), [e, H]), re = l(() => A ? e.map((e, t) => A(e, t)) : [], [e, A]), ie = i((t) => M ? M(e[t], t) : !1, [M, e]), ae = Ii({
|
|
5757
5841
|
items: e,
|
|
5758
5842
|
keys: ne,
|
|
5759
5843
|
getItemKey: f,
|
|
@@ -5762,13 +5846,13 @@ function Ri({ items: e, renderRow: t, columns: n, height: r = "100%", estimatedR
|
|
|
5762
5846
|
overscan: o,
|
|
5763
5847
|
onLoadMore: b,
|
|
5764
5848
|
loadMoreThreshold: x
|
|
5765
|
-
}), { rootRef: K, headerRef: oe, rowObserver: se, keysRef: q, offsets: ce, totalHeight: le, startIndex: ue, endIndex: de } = ae, fe =
|
|
5849
|
+
}), { rootRef: K, headerRef: oe, rowObserver: se, keysRef: q, offsets: ce, totalHeight: le, startIndex: ue, endIndex: de } = ae, fe = Li({
|
|
5766
5850
|
items: e,
|
|
5767
5851
|
getKey: H,
|
|
5768
5852
|
multiSelect: C,
|
|
5769
5853
|
selectedKeys: w,
|
|
5770
5854
|
onSelectionChange: T
|
|
5771
|
-
}), { effectiveSelectedKeys: pe } = fe, { hasColumns: me, visibleColumns: he, columnTemplate: ge, shouldShowToggle: _e, effectiveVisible: ve, manuallyHiddenCount: ye, toggleOpen: be, setToggleOpen: xe, toggleRef: Se, handleToggleColumn: Ce, recalculateColumns: J } =
|
|
5855
|
+
}), { effectiveSelectedKeys: pe } = fe, { hasColumns: me, visibleColumns: he, columnTemplate: ge, shouldShowToggle: _e, effectiveVisible: ve, manuallyHiddenCount: ye, toggleOpen: be, setToggleOpen: xe, toggleRef: Se, handleToggleColumn: Ce, recalculateColumns: J } = Ri({
|
|
5772
5856
|
columns: n,
|
|
5773
5857
|
items: e,
|
|
5774
5858
|
multiSelect: C,
|
|
@@ -5786,7 +5870,7 @@ function Ri({ items: e, renderRow: t, columns: n, height: r = "100%", estimatedR
|
|
|
5786
5870
|
...ae.scrollApi,
|
|
5787
5871
|
recalculateColumns: J
|
|
5788
5872
|
}), [ae.scrollApi, J]);
|
|
5789
|
-
let we =
|
|
5873
|
+
let we = zi({
|
|
5790
5874
|
reorderable: E,
|
|
5791
5875
|
treeReorder: k,
|
|
5792
5876
|
onReorder: D,
|
|
@@ -5801,7 +5885,7 @@ function Ri({ items: e, renderRow: t, columns: n, height: r = "100%", estimatedR
|
|
|
5801
5885
|
keysRef: q
|
|
5802
5886
|
}), Te = typeof u == "number" ? `${u}px` : u, De = (n) => {
|
|
5803
5887
|
let r = e[n], i = H(r, n), a = d != null && i === d || pe.has(i), o = we.getRowDragProps(n, i);
|
|
5804
|
-
return /* @__PURE__ */ W(
|
|
5888
|
+
return /* @__PURE__ */ W(wi, {
|
|
5805
5889
|
index: n,
|
|
5806
5890
|
top: ce[n],
|
|
5807
5891
|
padding: Te,
|
|
@@ -5942,7 +6026,7 @@ function Ri({ items: e, renderRow: t, columns: n, height: r = "100%", estimatedR
|
|
|
5942
6026
|
]
|
|
5943
6027
|
});
|
|
5944
6028
|
}
|
|
5945
|
-
var
|
|
6029
|
+
var Vi = e.forwardRef(Bi), Hi = {
|
|
5946
6030
|
wizard: "wizard_uRBAN",
|
|
5947
6031
|
"wizard-content": "wizard-content_lcl4C",
|
|
5948
6032
|
wizardContent: "wizard-content_lcl4C",
|
|
@@ -5953,7 +6037,7 @@ var zi = e.forwardRef(Ri), Bi = {
|
|
|
5953
6037
|
};
|
|
5954
6038
|
//#endregion
|
|
5955
6039
|
//#region package/common/wizard/wizard.tsx
|
|
5956
|
-
function
|
|
6040
|
+
function Ui({ currentStep: e = 0, stepCount: t = 0, renderStep: n = () => null, className: r, style: i, classNames: o, styles: s, ...c }) {
|
|
5957
6041
|
let [l, u] = f(void 0), [m, h] = f(!1), [g, _] = f(e), v = d([]), y = d(null);
|
|
5958
6042
|
e !== g && (_(e), h(!0)), a(() => {
|
|
5959
6043
|
if (!m) return;
|
|
@@ -5973,10 +6057,10 @@ function Vi({ currentStep: e = 0, stepCount: t = 0, renderStep: n = () => null,
|
|
|
5973
6057
|
};
|
|
5974
6058
|
return /* @__PURE__ */ W("div", {
|
|
5975
6059
|
...c,
|
|
5976
|
-
className: p(
|
|
6060
|
+
className: p(Hi.wizard, o?.root, r),
|
|
5977
6061
|
style: b,
|
|
5978
6062
|
children: /* @__PURE__ */ W("div", {
|
|
5979
|
-
className: p(
|
|
6063
|
+
className: p(Hi.wizardContentContainer, o?.container),
|
|
5980
6064
|
style: {
|
|
5981
6065
|
width: `${t * 100}%`,
|
|
5982
6066
|
marginLeft: `-${e * 100}%`,
|
|
@@ -5986,14 +6070,14 @@ function Vi({ currentStep: e = 0, stepCount: t = 0, renderStep: n = () => null,
|
|
|
5986
6070
|
ref: (e) => {
|
|
5987
6071
|
v.current[i] = e;
|
|
5988
6072
|
},
|
|
5989
|
-
className: p(
|
|
6073
|
+
className: p(Hi.wizardContent, o?.step),
|
|
5990
6074
|
style: {
|
|
5991
6075
|
width: `${100 / t}%`,
|
|
5992
6076
|
marginLeft: `${100 / t * i}%`,
|
|
5993
6077
|
...s?.step
|
|
5994
6078
|
},
|
|
5995
6079
|
children: /* @__PURE__ */ W("div", {
|
|
5996
|
-
className: p({ [
|
|
6080
|
+
className: p({ [Hi.wizardContentOutOfFrame]: e !== i && !m }, o?.stepContent),
|
|
5997
6081
|
style: s?.stepContent,
|
|
5998
6082
|
inert: e === i ? void 0 : !0,
|
|
5999
6083
|
children: n(i)
|
|
@@ -6004,20 +6088,20 @@ function Vi({ currentStep: e = 0, stepCount: t = 0, renderStep: n = () => null,
|
|
|
6004
6088
|
}
|
|
6005
6089
|
//#endregion
|
|
6006
6090
|
//#region package/services/formValidation/formValidatorGroup.ts
|
|
6007
|
-
function
|
|
6091
|
+
function Wi(e) {
|
|
6008
6092
|
let t = e;
|
|
6009
6093
|
return t?.errors && Array.isArray(t.errors) ? t.errors.flatMap((e) => Object.entries(e).map(([e, t]) => ({
|
|
6010
6094
|
id: e,
|
|
6011
6095
|
message: t
|
|
6012
6096
|
}))) : [];
|
|
6013
6097
|
}
|
|
6014
|
-
var
|
|
6098
|
+
var Gi = class {
|
|
6015
6099
|
#e;
|
|
6016
6100
|
#t;
|
|
6017
6101
|
#n;
|
|
6018
6102
|
#r;
|
|
6019
6103
|
#i;
|
|
6020
|
-
constructor(e, t = null, { initialValues: n, onSubmit: r = () => void 0, onValidate: i = () => void 0, errorParser: a =
|
|
6104
|
+
constructor(e, t = null, { initialValues: n, onSubmit: r = () => void 0, onValidate: i = () => void 0, errorParser: a = Wi, onSubmitError: o = () => void 0 } = {}) {
|
|
6021
6105
|
this.#t = !1, this.#i = [], this.getFormError = () => {
|
|
6022
6106
|
let e = Object.keys(this.group);
|
|
6023
6107
|
for (let t = 0; t < e.length; t += 1) {
|
|
@@ -6107,7 +6191,7 @@ var Ui = class {
|
|
|
6107
6191
|
};
|
|
6108
6192
|
//#endregion
|
|
6109
6193
|
//#region package/services/formValidation/FormValidatorGroupForm.tsx
|
|
6110
|
-
function
|
|
6194
|
+
function Ki(e) {
|
|
6111
6195
|
return function({ children: t, ...n }) {
|
|
6112
6196
|
return /* @__PURE__ */ W("form", {
|
|
6113
6197
|
onSubmit: e.submit,
|
|
@@ -6119,16 +6203,16 @@ function Wi(e) {
|
|
|
6119
6203
|
}
|
|
6120
6204
|
//#endregion
|
|
6121
6205
|
//#region package/services/formValidation/FormValidatorGroupWithForm.tsx
|
|
6122
|
-
var
|
|
6123
|
-
|
|
6124
|
-
},
|
|
6206
|
+
var qi = (e) => {
|
|
6207
|
+
yi(e[0].message, { type: "error" });
|
|
6208
|
+
}, Ji = class extends Gi {
|
|
6125
6209
|
constructor(e, t = null, n) {
|
|
6126
6210
|
super(e, t, {
|
|
6127
6211
|
...n,
|
|
6128
|
-
onSubmitError: n?.onSubmitError ??
|
|
6129
|
-
}), this.Form =
|
|
6212
|
+
onSubmitError: n?.onSubmitError ?? qi
|
|
6213
|
+
}), this.Form = Ki(this);
|
|
6130
6214
|
}
|
|
6131
|
-
},
|
|
6215
|
+
}, Yi = class {
|
|
6132
6216
|
#e;
|
|
6133
6217
|
#t;
|
|
6134
6218
|
#n;
|
|
@@ -6182,44 +6266,44 @@ var Gi = (e) => {
|
|
|
6182
6266
|
return this.#r;
|
|
6183
6267
|
}
|
|
6184
6268
|
};
|
|
6185
|
-
|
|
6269
|
+
Yi.prototype.toString = function() {
|
|
6186
6270
|
return `${this.value}`;
|
|
6187
6271
|
};
|
|
6188
6272
|
//#endregion
|
|
6189
6273
|
//#region package/services/regexp.ts
|
|
6190
|
-
function
|
|
6274
|
+
function Xi(e) {
|
|
6191
6275
|
return /^[0-9]+$/.test(e);
|
|
6192
6276
|
}
|
|
6193
|
-
function
|
|
6277
|
+
function Zi(e) {
|
|
6194
6278
|
return /^[0-9]{2}.[0-9]{2}.[0-9]{4}$/.test(e);
|
|
6195
6279
|
}
|
|
6196
|
-
function
|
|
6280
|
+
function Qi(e) {
|
|
6197
6281
|
return /^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z$/.test(e);
|
|
6198
6282
|
}
|
|
6199
|
-
function
|
|
6283
|
+
function $i(e) {
|
|
6200
6284
|
return /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-ZöäüÜÖÄß\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e);
|
|
6201
6285
|
}
|
|
6202
|
-
function
|
|
6286
|
+
function ea(e) {
|
|
6203
6287
|
return /^[A-Z]{6}[A-Z\d]{2}([A-Z\d]{3})?$/.test(e);
|
|
6204
6288
|
}
|
|
6205
|
-
function
|
|
6289
|
+
function ta(e) {
|
|
6206
6290
|
return /[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}(\/[-a-zA-Z0-9@:%_+.~#?&//=]*)?$/.test(e);
|
|
6207
6291
|
}
|
|
6208
|
-
function
|
|
6292
|
+
function na(e) {
|
|
6209
6293
|
return /^[\w!@#$%^&*?±§~`'"/\\[\]{}\-,.();:><+=|öäüÖÄÜß €μ]{8,}$/.test(e);
|
|
6210
6294
|
}
|
|
6211
|
-
function
|
|
6295
|
+
function ra(e) {
|
|
6212
6296
|
return /^(?=.*[a-zöäüA-ZÖÄÜß])/.test(e);
|
|
6213
6297
|
}
|
|
6214
|
-
function
|
|
6298
|
+
function ia(e) {
|
|
6215
6299
|
return /^(?=.*\d)/.test(e);
|
|
6216
6300
|
}
|
|
6217
|
-
function
|
|
6218
|
-
return
|
|
6301
|
+
function aa(e) {
|
|
6302
|
+
return na(e) && ra(e) && ia(e);
|
|
6219
6303
|
}
|
|
6220
6304
|
//#endregion
|
|
6221
6305
|
//#region package/services/formValidation/validators.ts
|
|
6222
|
-
var
|
|
6306
|
+
var oa = { t: (e, t) => ({
|
|
6223
6307
|
"formValidators.minLength": `Must be at least ${t?.min} characters long`,
|
|
6224
6308
|
"formValidators.maxLength": `Must be at most ${t?.max} characters long`,
|
|
6225
6309
|
"formValidators.email": "Must be a valid email address",
|
|
@@ -6234,23 +6318,23 @@ var ia = { t: (e, t) => ({
|
|
|
6234
6318
|
"garages.errors.bic": "Must be a valid BIC",
|
|
6235
6319
|
"formValidators.minLetters": `Must contain at least ${t?.smart_count} letters`,
|
|
6236
6320
|
"formValidators.minDigits": `Must contain at least ${t?.smart_count} digits`
|
|
6237
|
-
})[e] || e },
|
|
6321
|
+
})[e] || e }, sa = class e {
|
|
6238
6322
|
static {
|
|
6239
6323
|
this.minLength = (e, t) => (n) => !n || n.length < e ? {
|
|
6240
6324
|
id: "minLength",
|
|
6241
|
-
message: t ||
|
|
6325
|
+
message: t || oa.t("formValidators.minLength", { min: e })
|
|
6242
6326
|
} : null;
|
|
6243
6327
|
}
|
|
6244
6328
|
static {
|
|
6245
6329
|
this.maxLength = (e, t) => (n) => n && n.length > e ? {
|
|
6246
6330
|
id: "maxLength",
|
|
6247
|
-
message: t ||
|
|
6331
|
+
message: t || oa.t("formValidators.maxLength", { max: e })
|
|
6248
6332
|
} : null;
|
|
6249
6333
|
}
|
|
6250
6334
|
static {
|
|
6251
|
-
this.email = (e) => (t) => t &&
|
|
6335
|
+
this.email = (e) => (t) => t && !$i(t) ? {
|
|
6252
6336
|
id: "email",
|
|
6253
|
-
message: e ||
|
|
6337
|
+
message: e || oa.t("formValidators.email")
|
|
6254
6338
|
} : null;
|
|
6255
6339
|
}
|
|
6256
6340
|
static {
|
|
@@ -6258,7 +6342,7 @@ var ia = { t: (e, t) => ({
|
|
|
6258
6342
|
function t(t, n) {
|
|
6259
6343
|
return !t && t !== 0 ? {
|
|
6260
6344
|
id: "required",
|
|
6261
|
-
message: e ||
|
|
6345
|
+
message: e || oa.t("formValidators.required", { label: n || oa.t("formValidators.value") })
|
|
6262
6346
|
} : null;
|
|
6263
6347
|
}
|
|
6264
6348
|
return t.validatorId = "required", t;
|
|
@@ -6267,13 +6351,13 @@ var ia = { t: (e, t) => ({
|
|
|
6267
6351
|
static {
|
|
6268
6352
|
this.mustBeNumber = (e) => (t) => t && Number.isNaN(+t) ? {
|
|
6269
6353
|
id: "mustBeNumber",
|
|
6270
|
-
message: e ||
|
|
6354
|
+
message: e || oa.t("formValidators.mustBeNumber")
|
|
6271
6355
|
} : null;
|
|
6272
6356
|
}
|
|
6273
6357
|
static {
|
|
6274
6358
|
this.oneOf = (e, t) => (n) => n && !e.includes(n) ? {
|
|
6275
6359
|
id: "oneOf",
|
|
6276
|
-
message: t ||
|
|
6360
|
+
message: t || oa.t("formValidators.oneOf", { allowedValues: e })
|
|
6277
6361
|
} : null;
|
|
6278
6362
|
}
|
|
6279
6363
|
static {
|
|
@@ -6291,48 +6375,48 @@ var ia = { t: (e, t) => ({
|
|
|
6291
6375
|
this.multiEmail = (e) => (t) => {
|
|
6292
6376
|
if (t) {
|
|
6293
6377
|
let n = t.replace(/ /g, "").replace(/,/g, ";").split(";");
|
|
6294
|
-
for (let t = 0; t < n.length; t += 1) if (
|
|
6378
|
+
for (let t = 0; t < n.length; t += 1) if (!$i(n[t])) return {
|
|
6295
6379
|
id: "multiEmail",
|
|
6296
|
-
message: e ||
|
|
6380
|
+
message: e || oa.t("formValidators.multiEmail")
|
|
6297
6381
|
};
|
|
6298
6382
|
}
|
|
6299
6383
|
return null;
|
|
6300
6384
|
};
|
|
6301
6385
|
}
|
|
6302
6386
|
static {
|
|
6303
|
-
this.date = (e) => (t) => t && !
|
|
6387
|
+
this.date = (e) => (t) => t && !Zi(t) && !Qi(t) ? {
|
|
6304
6388
|
id: "date",
|
|
6305
|
-
message: e ||
|
|
6389
|
+
message: e || oa.t("formValidators.date")
|
|
6306
6390
|
} : null;
|
|
6307
6391
|
}
|
|
6308
6392
|
static {
|
|
6309
6393
|
this.dateObject = (e) => (t) => t && !t.isValid ? {
|
|
6310
6394
|
id: "date",
|
|
6311
|
-
message: e ||
|
|
6395
|
+
message: e || oa.t("formValidators.date")
|
|
6312
6396
|
} : null;
|
|
6313
6397
|
}
|
|
6314
6398
|
static {
|
|
6315
|
-
this.website = (e) => (t) => t &&
|
|
6399
|
+
this.website = (e) => (t) => t && !ta(t) ? {
|
|
6316
6400
|
id: "website",
|
|
6317
|
-
message: e ||
|
|
6401
|
+
message: e || oa.t("garages.errors.website")
|
|
6318
6402
|
} : null;
|
|
6319
6403
|
}
|
|
6320
6404
|
static {
|
|
6321
|
-
this.bic = (e) => (t) => t && !
|
|
6405
|
+
this.bic = (e) => (t) => t && !ea(t) ? {
|
|
6322
6406
|
id: "bic",
|
|
6323
|
-
message: e ||
|
|
6407
|
+
message: e || oa.t("garages.errors.bic")
|
|
6324
6408
|
} : null;
|
|
6325
6409
|
}
|
|
6326
6410
|
static {
|
|
6327
6411
|
this.minLetters = (e, t) => (n) => n && n.replace(/[^a-zöäüA-ZÖÄÜß]/g, "").length < e ? {
|
|
6328
6412
|
id: "minLetters",
|
|
6329
|
-
message: t ||
|
|
6413
|
+
message: t || oa.t("formValidators.minLetters", { smart_count: e })
|
|
6330
6414
|
} : null;
|
|
6331
6415
|
}
|
|
6332
6416
|
static {
|
|
6333
6417
|
this.minDigits = (e, t) => (n) => n && n.replace(/[\D]/g, "").length < e ? {
|
|
6334
6418
|
id: "minDigits",
|
|
6335
|
-
message: t ||
|
|
6419
|
+
message: t || oa.t("formValidators.minDigits", { smart_count: e })
|
|
6336
6420
|
} : null;
|
|
6337
6421
|
}
|
|
6338
6422
|
static {
|
|
@@ -6344,7 +6428,7 @@ var ia = { t: (e, t) => ({
|
|
|
6344
6428
|
} : r : null;
|
|
6345
6429
|
};
|
|
6346
6430
|
}
|
|
6347
|
-
},
|
|
6431
|
+
}, ca = class extends n {
|
|
6348
6432
|
static {
|
|
6349
6433
|
this.defaultProps = {
|
|
6350
6434
|
formValidator: null,
|
|
@@ -6424,7 +6508,7 @@ var ia = { t: (e, t) => ({
|
|
|
6424
6508
|
};
|
|
6425
6509
|
//#endregion
|
|
6426
6510
|
//#region package/services/formValidation/useFormValidator.ts
|
|
6427
|
-
function
|
|
6511
|
+
function la(e) {
|
|
6428
6512
|
let [, t] = u((e) => e + 1, 0);
|
|
6429
6513
|
return a(() => {
|
|
6430
6514
|
if (e) return e.registerOnUpdateListener(t), () => e.removeOnUpdateListener(t);
|
|
@@ -6432,9 +6516,9 @@ function sa(e) {
|
|
|
6432
6516
|
}
|
|
6433
6517
|
//#endregion
|
|
6434
6518
|
//#region package/services/formValidation/useFormValidatorGroup.ts
|
|
6435
|
-
function
|
|
6519
|
+
function ua(e, { initialValues: t, onSubmit: n, onValidate: r, errorParser: i, onSubmitError: o } = {}) {
|
|
6436
6520
|
let [, s] = u((e) => e + 1, 0), c = d(null);
|
|
6437
|
-
c.current ||= new
|
|
6521
|
+
c.current ||= new Ji(e, null, {
|
|
6438
6522
|
initialValues: t,
|
|
6439
6523
|
errorParser: i,
|
|
6440
6524
|
onSubmitError: o
|
|
@@ -6443,6 +6527,6 @@ function ca(e, { initialValues: t, onSubmit: n, onValidate: r, errorParser: i, o
|
|
|
6443
6527
|
return f.current = n, p.current = r, a(() => (n !== void 0 && (l.onSubmitCallback = (...e) => f.current?.(...e)), r !== void 0 && (l.onValidateCallback = (...e) => p.current?.(...e)), l.registerOnUpdateListener(s), () => l.removeOnUpdateListener(s)), []), l;
|
|
6444
6528
|
}
|
|
6445
6529
|
//#endregion
|
|
6446
|
-
export { Se as Accordion, _e as AccordionStyleType, Fe as ActionButtons, Be as ActionIcon, it as Align, Ve as BodyEnd, Pe as Button, Oe as ButtonSize, De as ButtonStyleType, ke as ButtonType, Ge as Card, Ye as CardActions, Je as CardContent, Ke as CardHeader, qe as CardMedia, He as CardStyleType, Ze as Checkbox, tt as Chip, nt as ChipContainer, Qe as ChipStyleType, xt as ColorPicker, wt as ConfirmModal, Qt as DatePicker, en as Drawer, cn as DropZone, tn as DropZoneReturnType, Z as DropZoneStatus, Xt as Dropdown, un as EmptyState, hn as Fab, ot as FloatingMenu,
|
|
6530
|
+
export { Se as Accordion, _e as AccordionStyleType, Fe as ActionButtons, Be as ActionIcon, it as Align, Ve as BodyEnd, Pe as Button, Oe as ButtonSize, De as ButtonStyleType, ke as ButtonType, Ge as Card, Ye as CardActions, Je as CardContent, Ke as CardHeader, qe as CardMedia, He as CardStyleType, Ze as Checkbox, tt as Chip, nt as ChipContainer, Qe as ChipStyleType, xt as ColorPicker, wt as ConfirmModal, Qt as DatePicker, en as Drawer, cn as DropZone, tn as DropZoneReturnType, Z as DropZoneStatus, Xt as Dropdown, un as EmptyState, hn as Fab, ot as FloatingMenu, Yi as FormValidator, Ji as FormValidatorGroup, Mn as IconLoading, yn as IconPicker, xn as IdleManager, Yt as InfiniteBlock, ut as Input, Tn as InputDropdown, lt as InputType, Re as InteractableDiv, kn as KanbanBoard, On as KanbanColumn, Ct as Modal, Fn as NumberInput, Ln as OptionPicker, Vn as Overscroll, Wn as ProgressBar, je as Ripple, _r as RoomDrawer, yr as RoomViewer, Sr as ScrollbarProvider, wr as SearchInput, Ee as SpinnerLoading, Dr as Stepper, kr as Sticky, jr as TabHeader, zr as TenorPicker, Br as Textarea, Ur as ThemeProvider, fi as TimeInput, Ci as ToastProvider, ct as Tooltip, ca as ValidatableComponent, sa as Validators, Vi as VirtualList, Ui as Wizard, Vr as defaultTheme, Mt as getLocale, na as hasEightPasswordChars, ia as hasOnePasswordDigit, ra as hasOnePasswordLetter, ea as isBic, Zi as isDate, $i as isEmail, Qi as isISODate, Xi as isNumber, aa as isPassword, ta as isURL, kt as mapLocale, jt as setLocale, yi as showToast, la as useFormValidator, ua as useFormValidatorGroup, Wr as useTheme };
|
|
6447
6531
|
|
|
6448
6532
|
//# sourceMappingURL=index.mjs.map
|