vuetify 3.6.0 → 3.6.1
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/_component-variables-labs.sass +0 -2
- package/dist/_component-variables.sass +2 -0
- package/dist/json/importMap-labs.json +10 -30
- package/dist/json/importMap.json +114 -94
- package/dist/json/web-types.json +1 -1
- package/dist/vuetify-labs.css +2555 -2555
- package/dist/vuetify-labs.d.ts +4811 -4811
- package/dist/vuetify-labs.esm.js +10050 -10052
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +10050 -10052
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +679 -502
- package/dist/vuetify.d.ts +2872 -574
- package/dist/vuetify.esm.js +1711 -887
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +1711 -887
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +611 -557
- package/dist/vuetify.min.js.map +1 -1
- package/lib/{labs → components}/VConfirmEdit/VConfirmEdit.mjs +1 -1
- package/lib/components/VConfirmEdit/VConfirmEdit.mjs.map +1 -0
- package/lib/components/VConfirmEdit/__test__/VConfirmEdit.spec.cy.mjs.map +1 -0
- package/lib/components/VConfirmEdit/index.mjs.map +1 -0
- package/lib/{labs → components}/VEmptyState/VEmptyState.mjs +4 -4
- package/lib/components/VEmptyState/VEmptyState.mjs.map +1 -0
- package/lib/components/VEmptyState/index.mjs.map +1 -0
- package/lib/{labs → components}/VFab/VFab.mjs +1 -1
- package/lib/components/VFab/VFab.mjs.map +1 -0
- package/lib/components/VFab/index.mjs.map +1 -0
- package/lib/components/VSparkline/VBarline.mjs.map +1 -0
- package/lib/components/VSparkline/VSparkline.mjs +44 -320
- package/lib/components/VSparkline/VSparkline.mjs.map +1 -1
- package/lib/components/VSparkline/VTrendline.mjs.map +1 -0
- package/lib/components/VSparkline/index.mjs +1 -3
- package/lib/components/VSparkline/index.mjs.map +1 -1
- package/lib/components/VSparkline/util/line.mjs.map +1 -0
- package/lib/components/VSparkline/util/path.mjs.map +1 -0
- package/lib/components/VSpeedDial/VSpeedDial.mjs +68 -85
- package/lib/components/VSpeedDial/VSpeedDial.mjs.map +1 -1
- package/lib/components/VSpeedDial/VSpeedDial.sass +20 -72
- package/lib/components/VSpeedDial/index.mjs +1 -3
- package/lib/components/VSpeedDial/index.mjs.map +1 -1
- package/lib/components/index.d.mts +2840 -547
- package/lib/components/index.mjs +6 -2
- package/lib/components/index.mjs.map +1 -1
- package/lib/composables/directiveComponent.mjs +1 -3
- package/lib/composables/directiveComponent.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.mts +40 -40
- package/lib/labs/VDateInput/VDateInput.mjs +2 -2
- package/lib/labs/VDateInput/VDateInput.mjs.map +1 -1
- package/lib/labs/VDateInput/index.d.mts +14 -14
- package/lib/labs/components.d.mts +1628 -3945
- package/lib/labs/components.mjs +0 -5
- package/lib/labs/components.mjs.map +1 -1
- package/package.json +2 -2
- package/lib/components/VSparkline/helpers/core.mjs +0 -49
- package/lib/components/VSparkline/helpers/core.mjs.map +0 -1
- package/lib/components/VSparkline/helpers/math.mjs +0 -34
- package/lib/components/VSparkline/helpers/math.mjs.map +0 -1
- package/lib/components/VSparkline/helpers/path.mjs +0 -27
- package/lib/components/VSparkline/helpers/path.mjs.map +0 -1
- package/lib/components/VSpeedDial/_variables.scss +0 -5
- package/lib/labs/VConfirmEdit/VConfirmEdit.mjs.map +0 -1
- package/lib/labs/VConfirmEdit/__test__/VConfirmEdit.spec.cy.mjs.map +0 -1
- package/lib/labs/VConfirmEdit/index.mjs.map +0 -1
- package/lib/labs/VEmptyState/VEmptyState.mjs.map +0 -1
- package/lib/labs/VEmptyState/index.mjs.map +0 -1
- package/lib/labs/VFab/VFab.mjs.map +0 -1
- package/lib/labs/VFab/index.mjs.map +0 -1
- package/lib/labs/VSparkline/VBarline.mjs.map +0 -1
- package/lib/labs/VSparkline/VSparkline.mjs +0 -49
- package/lib/labs/VSparkline/VSparkline.mjs.map +0 -1
- package/lib/labs/VSparkline/VTrendline.mjs.map +0 -1
- package/lib/labs/VSparkline/index.mjs +0 -2
- package/lib/labs/VSparkline/index.mjs.map +0 -1
- package/lib/labs/VSparkline/util/line.mjs.map +0 -1
- package/lib/labs/VSparkline/util/path.mjs.map +0 -1
- package/lib/labs/VSpeedDial/VSpeedDial.mjs +0 -76
- package/lib/labs/VSpeedDial/VSpeedDial.mjs.map +0 -1
- package/lib/labs/VSpeedDial/VSpeedDial.sass +0 -27
- package/lib/labs/VSpeedDial/index.mjs +0 -2
- package/lib/labs/VSpeedDial/index.mjs.map +0 -1
- /package/lib/{labs → components}/VConfirmEdit/__test__/VConfirmEdit.spec.cy.mjs +0 -0
- /package/lib/{labs → components}/VConfirmEdit/index.d.mts +0 -0
- /package/lib/{labs → components}/VConfirmEdit/index.mjs +0 -0
- /package/lib/{labs → components}/VEmptyState/VEmptyState.css +0 -0
- /package/lib/{labs → components}/VEmptyState/VEmptyState.sass +0 -0
- /package/lib/{labs → components}/VEmptyState/_variables.scss +0 -0
- /package/lib/{labs → components}/VEmptyState/index.d.mts +0 -0
- /package/lib/{labs → components}/VEmptyState/index.mjs +0 -0
- /package/lib/{labs → components}/VFab/VFab.css +0 -0
- /package/lib/{labs → components}/VFab/VFab.sass +0 -0
- /package/lib/{labs → components}/VFab/_mixins.scss +0 -0
- /package/lib/{labs → components}/VFab/_variables.scss +0 -0
- /package/lib/{labs → components}/VFab/index.d.mts +0 -0
- /package/lib/{labs → components}/VFab/index.mjs +0 -0
- /package/lib/{labs → components}/VSparkline/VBarline.mjs +0 -0
- /package/lib/{labs → components}/VSparkline/VTrendline.mjs +0 -0
- /package/lib/{labs → components}/VSparkline/index.d.mts +0 -0
- /package/lib/{labs → components}/VSparkline/util/line.mjs +0 -0
- /package/lib/{labs → components}/VSparkline/util/path.mjs +0 -0
- /package/lib/{labs → components}/VSpeedDial/VSpeedDial.css +0 -0
- /package/lib/{labs → components}/VSpeedDial/index.d.mts +0 -0
package/dist/vuetify.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vuetify v3.6.
|
|
2
|
+
* Vuetify v3.6.1
|
|
3
3
|
* Forged by John Leider
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -17272,764 +17272,255 @@ const VCombobox = genericComponent()({
|
|
|
17272
17272
|
}
|
|
17273
17273
|
});
|
|
17274
17274
|
|
|
17275
|
-
//
|
|
17275
|
+
// Utilities
|
|
17276
17276
|
|
|
17277
17277
|
// Types
|
|
17278
17278
|
|
|
17279
|
-
const
|
|
17280
|
-
|
|
17281
|
-
|
|
17282
|
-
|
|
17283
|
-
|
|
17284
|
-
|
|
17279
|
+
const firstDay = {
|
|
17280
|
+
'001': 1,
|
|
17281
|
+
AD: 1,
|
|
17282
|
+
AE: 6,
|
|
17283
|
+
AF: 6,
|
|
17284
|
+
AG: 0,
|
|
17285
|
+
AI: 1,
|
|
17286
|
+
AL: 1,
|
|
17287
|
+
AM: 1,
|
|
17288
|
+
AN: 1,
|
|
17289
|
+
AR: 1,
|
|
17290
|
+
AS: 0,
|
|
17291
|
+
AT: 1,
|
|
17292
|
+
AU: 1,
|
|
17293
|
+
AX: 1,
|
|
17294
|
+
AZ: 1,
|
|
17295
|
+
BA: 1,
|
|
17296
|
+
BD: 0,
|
|
17297
|
+
BE: 1,
|
|
17298
|
+
BG: 1,
|
|
17299
|
+
BH: 6,
|
|
17300
|
+
BM: 1,
|
|
17301
|
+
BN: 1,
|
|
17302
|
+
BR: 0,
|
|
17303
|
+
BS: 0,
|
|
17304
|
+
BT: 0,
|
|
17305
|
+
BW: 0,
|
|
17306
|
+
BY: 1,
|
|
17307
|
+
BZ: 0,
|
|
17308
|
+
CA: 0,
|
|
17309
|
+
CH: 1,
|
|
17310
|
+
CL: 1,
|
|
17311
|
+
CM: 1,
|
|
17312
|
+
CN: 1,
|
|
17313
|
+
CO: 0,
|
|
17314
|
+
CR: 1,
|
|
17315
|
+
CY: 1,
|
|
17316
|
+
CZ: 1,
|
|
17317
|
+
DE: 1,
|
|
17318
|
+
DJ: 6,
|
|
17319
|
+
DK: 1,
|
|
17320
|
+
DM: 0,
|
|
17321
|
+
DO: 0,
|
|
17322
|
+
DZ: 6,
|
|
17323
|
+
EC: 1,
|
|
17324
|
+
EE: 1,
|
|
17325
|
+
EG: 6,
|
|
17326
|
+
ES: 1,
|
|
17327
|
+
ET: 0,
|
|
17328
|
+
FI: 1,
|
|
17329
|
+
FJ: 1,
|
|
17330
|
+
FO: 1,
|
|
17331
|
+
FR: 1,
|
|
17332
|
+
GB: 1,
|
|
17333
|
+
'GB-alt-variant': 0,
|
|
17334
|
+
GE: 1,
|
|
17335
|
+
GF: 1,
|
|
17336
|
+
GP: 1,
|
|
17337
|
+
GR: 1,
|
|
17338
|
+
GT: 0,
|
|
17339
|
+
GU: 0,
|
|
17340
|
+
HK: 0,
|
|
17341
|
+
HN: 0,
|
|
17342
|
+
HR: 1,
|
|
17343
|
+
HU: 1,
|
|
17344
|
+
ID: 0,
|
|
17345
|
+
IE: 1,
|
|
17346
|
+
IL: 0,
|
|
17347
|
+
IN: 0,
|
|
17348
|
+
IQ: 6,
|
|
17349
|
+
IR: 6,
|
|
17350
|
+
IS: 1,
|
|
17351
|
+
IT: 1,
|
|
17352
|
+
JM: 0,
|
|
17353
|
+
JO: 6,
|
|
17354
|
+
JP: 0,
|
|
17355
|
+
KE: 0,
|
|
17356
|
+
KG: 1,
|
|
17357
|
+
KH: 0,
|
|
17358
|
+
KR: 0,
|
|
17359
|
+
KW: 6,
|
|
17360
|
+
KZ: 1,
|
|
17361
|
+
LA: 0,
|
|
17362
|
+
LB: 1,
|
|
17363
|
+
LI: 1,
|
|
17364
|
+
LK: 1,
|
|
17365
|
+
LT: 1,
|
|
17366
|
+
LU: 1,
|
|
17367
|
+
LV: 1,
|
|
17368
|
+
LY: 6,
|
|
17369
|
+
MC: 1,
|
|
17370
|
+
MD: 1,
|
|
17371
|
+
ME: 1,
|
|
17372
|
+
MH: 0,
|
|
17373
|
+
MK: 1,
|
|
17374
|
+
MM: 0,
|
|
17375
|
+
MN: 1,
|
|
17376
|
+
MO: 0,
|
|
17377
|
+
MQ: 1,
|
|
17378
|
+
MT: 0,
|
|
17379
|
+
MV: 5,
|
|
17380
|
+
MX: 0,
|
|
17381
|
+
MY: 1,
|
|
17382
|
+
MZ: 0,
|
|
17383
|
+
NI: 0,
|
|
17384
|
+
NL: 1,
|
|
17385
|
+
NO: 1,
|
|
17386
|
+
NP: 0,
|
|
17387
|
+
NZ: 1,
|
|
17388
|
+
OM: 6,
|
|
17389
|
+
PA: 0,
|
|
17390
|
+
PE: 0,
|
|
17391
|
+
PH: 0,
|
|
17392
|
+
PK: 0,
|
|
17393
|
+
PL: 1,
|
|
17394
|
+
PR: 0,
|
|
17395
|
+
PT: 0,
|
|
17396
|
+
PY: 0,
|
|
17397
|
+
QA: 6,
|
|
17398
|
+
RE: 1,
|
|
17399
|
+
RO: 1,
|
|
17400
|
+
RS: 1,
|
|
17401
|
+
RU: 1,
|
|
17402
|
+
SA: 0,
|
|
17403
|
+
SD: 6,
|
|
17404
|
+
SE: 1,
|
|
17405
|
+
SG: 0,
|
|
17406
|
+
SI: 1,
|
|
17407
|
+
SK: 1,
|
|
17408
|
+
SM: 1,
|
|
17409
|
+
SV: 0,
|
|
17410
|
+
SY: 6,
|
|
17411
|
+
TH: 0,
|
|
17412
|
+
TJ: 1,
|
|
17413
|
+
TM: 1,
|
|
17414
|
+
TR: 1,
|
|
17415
|
+
TT: 0,
|
|
17416
|
+
TW: 0,
|
|
17417
|
+
UA: 1,
|
|
17418
|
+
UM: 0,
|
|
17419
|
+
US: 0,
|
|
17420
|
+
UY: 1,
|
|
17421
|
+
UZ: 1,
|
|
17422
|
+
VA: 1,
|
|
17423
|
+
VE: 0,
|
|
17424
|
+
VI: 0,
|
|
17425
|
+
VN: 1,
|
|
17426
|
+
WS: 0,
|
|
17427
|
+
XK: 1,
|
|
17428
|
+
YE: 0,
|
|
17429
|
+
ZA: 0,
|
|
17430
|
+
ZW: 0
|
|
17431
|
+
};
|
|
17432
|
+
function getWeekArray(date, locale) {
|
|
17433
|
+
const weeks = [];
|
|
17434
|
+
let currentWeek = [];
|
|
17435
|
+
const firstDayOfMonth = startOfMonth(date);
|
|
17436
|
+
const lastDayOfMonth = endOfMonth(date);
|
|
17437
|
+
const firstDayWeekIndex = (firstDayOfMonth.getDay() - firstDay[locale.slice(-2).toUpperCase()] + 7) % 7;
|
|
17438
|
+
const lastDayWeekIndex = (lastDayOfMonth.getDay() - firstDay[locale.slice(-2).toUpperCase()] + 7) % 7;
|
|
17439
|
+
for (let i = 0; i < firstDayWeekIndex; i++) {
|
|
17440
|
+
const adjacentDay = new Date(firstDayOfMonth);
|
|
17441
|
+
adjacentDay.setDate(adjacentDay.getDate() - (firstDayWeekIndex - i));
|
|
17442
|
+
currentWeek.push(adjacentDay);
|
|
17285
17443
|
}
|
|
17286
|
-
|
|
17287
|
-
const
|
|
17288
|
-
|
|
17289
|
-
|
|
17290
|
-
|
|
17291
|
-
|
|
17292
|
-
|
|
17293
|
-
|
|
17294
|
-
|
|
17295
|
-
|
|
17296
|
-
const newExpanded = new Set(expanded.value);
|
|
17297
|
-
if (!value) {
|
|
17298
|
-
newExpanded.delete(item.value);
|
|
17299
|
-
} else {
|
|
17300
|
-
newExpanded.add(item.value);
|
|
17444
|
+
for (let i = 1; i <= lastDayOfMonth.getDate(); i++) {
|
|
17445
|
+
const day = new Date(date.getFullYear(), date.getMonth(), i);
|
|
17446
|
+
|
|
17447
|
+
// Add the day to the current week
|
|
17448
|
+
currentWeek.push(day);
|
|
17449
|
+
|
|
17450
|
+
// If the current week has 7 days, add it to the weeks array and start a new week
|
|
17451
|
+
if (currentWeek.length === 7) {
|
|
17452
|
+
weeks.push(currentWeek);
|
|
17453
|
+
currentWeek = [];
|
|
17301
17454
|
}
|
|
17302
|
-
expanded.value = newExpanded;
|
|
17303
17455
|
}
|
|
17304
|
-
|
|
17305
|
-
|
|
17456
|
+
for (let i = 1; i < 7 - lastDayWeekIndex; i++) {
|
|
17457
|
+
const adjacentDay = new Date(lastDayOfMonth);
|
|
17458
|
+
adjacentDay.setDate(adjacentDay.getDate() + i);
|
|
17459
|
+
currentWeek.push(adjacentDay);
|
|
17306
17460
|
}
|
|
17307
|
-
|
|
17308
|
-
|
|
17461
|
+
if (currentWeek.length > 0) {
|
|
17462
|
+
weeks.push(currentWeek);
|
|
17309
17463
|
}
|
|
17310
|
-
|
|
17311
|
-
expand,
|
|
17312
|
-
expanded,
|
|
17313
|
-
expandOnClick,
|
|
17314
|
-
isExpanded,
|
|
17315
|
-
toggleExpand
|
|
17316
|
-
};
|
|
17317
|
-
provide(VDataTableExpandedKey, data);
|
|
17318
|
-
return data;
|
|
17464
|
+
return weeks;
|
|
17319
17465
|
}
|
|
17320
|
-
function
|
|
17321
|
-
const
|
|
17322
|
-
|
|
17323
|
-
|
|
17466
|
+
function startOfWeek(date, locale) {
|
|
17467
|
+
const d = new Date(date);
|
|
17468
|
+
while (d.getDay() !== (firstDay[locale.slice(-2).toUpperCase()] ?? 0)) {
|
|
17469
|
+
d.setDate(d.getDate() - 1);
|
|
17470
|
+
}
|
|
17471
|
+
return d;
|
|
17324
17472
|
}
|
|
17325
|
-
|
|
17326
|
-
|
|
17327
|
-
|
|
17328
|
-
|
|
17329
|
-
|
|
17330
|
-
const makeDataTableGroupProps = propsFactory({
|
|
17331
|
-
groupBy: {
|
|
17332
|
-
type: Array,
|
|
17333
|
-
default: () => []
|
|
17473
|
+
function endOfWeek(date, locale) {
|
|
17474
|
+
const d = new Date(date);
|
|
17475
|
+
const lastDay = ((firstDay[locale.slice(-2).toUpperCase()] ?? 0) + 6) % 7;
|
|
17476
|
+
while (d.getDay() !== lastDay) {
|
|
17477
|
+
d.setDate(d.getDate() + 1);
|
|
17334
17478
|
}
|
|
17335
|
-
|
|
17336
|
-
const VDataTableGroupSymbol = Symbol.for('vuetify:data-table-group');
|
|
17337
|
-
function createGroupBy(props) {
|
|
17338
|
-
const groupBy = useProxiedModel(props, 'groupBy');
|
|
17339
|
-
return {
|
|
17340
|
-
groupBy
|
|
17341
|
-
};
|
|
17479
|
+
return d;
|
|
17342
17480
|
}
|
|
17343
|
-
function
|
|
17344
|
-
|
|
17345
|
-
groupBy,
|
|
17346
|
-
sortBy
|
|
17347
|
-
} = options;
|
|
17348
|
-
const opened = ref(new Set());
|
|
17349
|
-
const sortByWithGroups = computed(() => {
|
|
17350
|
-
return groupBy.value.map(val => ({
|
|
17351
|
-
...val,
|
|
17352
|
-
order: val.order ?? false
|
|
17353
|
-
})).concat(sortBy.value);
|
|
17354
|
-
});
|
|
17355
|
-
function isGroupOpen(group) {
|
|
17356
|
-
return opened.value.has(group.id);
|
|
17357
|
-
}
|
|
17358
|
-
function toggleGroup(group) {
|
|
17359
|
-
const newOpened = new Set(opened.value);
|
|
17360
|
-
if (!isGroupOpen(group)) newOpened.add(group.id);else newOpened.delete(group.id);
|
|
17361
|
-
opened.value = newOpened;
|
|
17362
|
-
}
|
|
17363
|
-
function extractRows(items) {
|
|
17364
|
-
function dive(group) {
|
|
17365
|
-
const arr = [];
|
|
17366
|
-
for (const item of group.items) {
|
|
17367
|
-
if ('type' in item && item.type === 'group') {
|
|
17368
|
-
arr.push(...dive(item));
|
|
17369
|
-
} else {
|
|
17370
|
-
arr.push(item);
|
|
17371
|
-
}
|
|
17372
|
-
}
|
|
17373
|
-
return arr;
|
|
17374
|
-
}
|
|
17375
|
-
return dive({
|
|
17376
|
-
type: 'group',
|
|
17377
|
-
items,
|
|
17378
|
-
id: 'dummy',
|
|
17379
|
-
key: 'dummy',
|
|
17380
|
-
value: 'dummy',
|
|
17381
|
-
depth: 0
|
|
17382
|
-
});
|
|
17383
|
-
}
|
|
17384
|
-
|
|
17385
|
-
// onBeforeMount(() => {
|
|
17386
|
-
// for (const key of groupedItems.value.keys()) {
|
|
17387
|
-
// opened.value.add(key)
|
|
17388
|
-
// }
|
|
17389
|
-
// })
|
|
17390
|
-
|
|
17391
|
-
const data = {
|
|
17392
|
-
sortByWithGroups,
|
|
17393
|
-
toggleGroup,
|
|
17394
|
-
opened,
|
|
17395
|
-
groupBy,
|
|
17396
|
-
extractRows,
|
|
17397
|
-
isGroupOpen
|
|
17398
|
-
};
|
|
17399
|
-
provide(VDataTableGroupSymbol, data);
|
|
17400
|
-
return data;
|
|
17401
|
-
}
|
|
17402
|
-
function useGroupBy() {
|
|
17403
|
-
const data = inject$1(VDataTableGroupSymbol);
|
|
17404
|
-
if (!data) throw new Error('Missing group!');
|
|
17405
|
-
return data;
|
|
17481
|
+
function startOfMonth(date) {
|
|
17482
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
17406
17483
|
}
|
|
17407
|
-
function
|
|
17408
|
-
|
|
17409
|
-
const groups = new Map();
|
|
17410
|
-
for (const item of items) {
|
|
17411
|
-
const value = getObjectValueByPath(item.raw, groupBy);
|
|
17412
|
-
if (!groups.has(value)) {
|
|
17413
|
-
groups.set(value, []);
|
|
17414
|
-
}
|
|
17415
|
-
groups.get(value).push(item);
|
|
17416
|
-
}
|
|
17417
|
-
return groups;
|
|
17484
|
+
function endOfMonth(date) {
|
|
17485
|
+
return new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
17418
17486
|
}
|
|
17419
|
-
function
|
|
17420
|
-
|
|
17421
|
-
|
|
17422
|
-
|
|
17423
|
-
|
|
17424
|
-
const groups = [];
|
|
17425
|
-
const rest = groupBy.slice(1);
|
|
17426
|
-
groupedItems.forEach((items, value) => {
|
|
17427
|
-
const key = groupBy[0];
|
|
17428
|
-
const id = `${prefix}_${key}_${value}`;
|
|
17429
|
-
groups.push({
|
|
17430
|
-
depth,
|
|
17431
|
-
id,
|
|
17432
|
-
key,
|
|
17433
|
-
value,
|
|
17434
|
-
items: rest.length ? groupItems(items, rest, depth + 1, id) : items,
|
|
17435
|
-
type: 'group'
|
|
17436
|
-
});
|
|
17437
|
-
});
|
|
17438
|
-
return groups;
|
|
17487
|
+
function parseLocalDate(value) {
|
|
17488
|
+
const parts = value.split('-').map(Number);
|
|
17489
|
+
|
|
17490
|
+
// new Date() uses local time zone when passing individual date component values
|
|
17491
|
+
return new Date(parts[0], parts[1] - 1, parts[2]);
|
|
17439
17492
|
}
|
|
17440
|
-
|
|
17441
|
-
|
|
17442
|
-
|
|
17443
|
-
|
|
17444
|
-
|
|
17445
|
-
|
|
17446
|
-
|
|
17447
|
-
|
|
17448
|
-
if (opened.has(item.id) || item.value == null) {
|
|
17449
|
-
flatItems.push(...flattenItems(item.items, opened));
|
|
17450
|
-
}
|
|
17493
|
+
const _YYYMMDD = /^([12]\d{3}-([1-9]|0[1-9]|1[0-2])-([1-9]|0[1-9]|[12]\d|3[01]))$/;
|
|
17494
|
+
function date(value) {
|
|
17495
|
+
if (value == null) return new Date();
|
|
17496
|
+
if (value instanceof Date) return value;
|
|
17497
|
+
if (typeof value === 'string') {
|
|
17498
|
+
let parsed;
|
|
17499
|
+
if (_YYYMMDD.test(value)) {
|
|
17500
|
+
return parseLocalDate(value);
|
|
17451
17501
|
} else {
|
|
17452
|
-
|
|
17502
|
+
parsed = Date.parse(value);
|
|
17453
17503
|
}
|
|
17504
|
+
if (!isNaN(parsed)) return new Date(parsed);
|
|
17454
17505
|
}
|
|
17455
|
-
return
|
|
17456
|
-
}
|
|
17457
|
-
function useGroupedItems(items, groupBy, opened) {
|
|
17458
|
-
const flatItems = computed(() => {
|
|
17459
|
-
if (!groupBy.value.length) return items.value;
|
|
17460
|
-
const groupedItems = groupItems(items.value, groupBy.value.map(item => item.key));
|
|
17461
|
-
return flattenItems(groupedItems, opened.value);
|
|
17462
|
-
});
|
|
17463
|
-
return {
|
|
17464
|
-
flatItems
|
|
17465
|
-
};
|
|
17506
|
+
return null;
|
|
17466
17507
|
}
|
|
17467
|
-
|
|
17468
|
-
|
|
17469
|
-
|
|
17470
|
-
|
|
17471
|
-
|
|
17472
|
-
|
|
17473
|
-
|
|
17474
|
-
|
|
17475
|
-
|
|
17476
|
-
sortBy,
|
|
17477
|
-
groupBy,
|
|
17478
|
-
search
|
|
17479
|
-
} = _ref;
|
|
17480
|
-
const vm = getCurrentInstance('VDataTable');
|
|
17481
|
-
const options = computed(() => ({
|
|
17482
|
-
page: page.value,
|
|
17483
|
-
itemsPerPage: itemsPerPage.value,
|
|
17484
|
-
sortBy: sortBy.value,
|
|
17485
|
-
groupBy: groupBy.value,
|
|
17486
|
-
search: search.value
|
|
17487
|
-
}));
|
|
17488
|
-
let oldOptions = null;
|
|
17489
|
-
watch(options, () => {
|
|
17490
|
-
if (deepEqual(oldOptions, options.value)) return;
|
|
17491
|
-
|
|
17492
|
-
// Reset page when searching
|
|
17493
|
-
if (oldOptions && oldOptions.search !== options.value.search) {
|
|
17494
|
-
page.value = 1;
|
|
17495
|
-
}
|
|
17496
|
-
vm.emit('update:options', options.value);
|
|
17497
|
-
oldOptions = options.value;
|
|
17498
|
-
}, {
|
|
17499
|
-
deep: true,
|
|
17500
|
-
immediate: true
|
|
17508
|
+
const sundayJanuarySecond2000 = new Date(2000, 0, 2);
|
|
17509
|
+
function getWeekdays(locale) {
|
|
17510
|
+
const daysFromSunday = firstDay[locale.slice(-2).toUpperCase()];
|
|
17511
|
+
return createRange(7).map(i => {
|
|
17512
|
+
const weekday = new Date(sundayJanuarySecond2000);
|
|
17513
|
+
weekday.setDate(sundayJanuarySecond2000.getDate() + daysFromSunday + i);
|
|
17514
|
+
return new Intl.DateTimeFormat(locale, {
|
|
17515
|
+
weekday: 'narrow'
|
|
17516
|
+
}).format(weekday);
|
|
17501
17517
|
});
|
|
17502
17518
|
}
|
|
17503
|
-
|
|
17504
|
-
|
|
17505
|
-
|
|
17506
|
-
|
|
17507
|
-
|
|
17508
|
-
const makeDataTablePaginateProps = propsFactory({
|
|
17509
|
-
page: {
|
|
17510
|
-
type: [Number, String],
|
|
17511
|
-
default: 1
|
|
17512
|
-
},
|
|
17513
|
-
itemsPerPage: {
|
|
17514
|
-
type: [Number, String],
|
|
17515
|
-
default: 10
|
|
17516
|
-
}
|
|
17517
|
-
}, 'DataTable-paginate');
|
|
17518
|
-
const VDataTablePaginationSymbol = Symbol.for('vuetify:data-table-pagination');
|
|
17519
|
-
function createPagination(props) {
|
|
17520
|
-
const page = useProxiedModel(props, 'page', undefined, value => +(value ?? 1));
|
|
17521
|
-
const itemsPerPage = useProxiedModel(props, 'itemsPerPage', undefined, value => +(value ?? 10));
|
|
17522
|
-
return {
|
|
17523
|
-
page,
|
|
17524
|
-
itemsPerPage
|
|
17525
|
-
};
|
|
17526
|
-
}
|
|
17527
|
-
function providePagination(options) {
|
|
17528
|
-
const {
|
|
17529
|
-
page,
|
|
17530
|
-
itemsPerPage,
|
|
17531
|
-
itemsLength
|
|
17532
|
-
} = options;
|
|
17533
|
-
const startIndex = computed(() => {
|
|
17534
|
-
if (itemsPerPage.value === -1) return 0;
|
|
17535
|
-
return itemsPerPage.value * (page.value - 1);
|
|
17536
|
-
});
|
|
17537
|
-
const stopIndex = computed(() => {
|
|
17538
|
-
if (itemsPerPage.value === -1) return itemsLength.value;
|
|
17539
|
-
return Math.min(itemsLength.value, startIndex.value + itemsPerPage.value);
|
|
17540
|
-
});
|
|
17541
|
-
const pageCount = computed(() => {
|
|
17542
|
-
if (itemsPerPage.value === -1 || itemsLength.value === 0) return 1;
|
|
17543
|
-
return Math.ceil(itemsLength.value / itemsPerPage.value);
|
|
17544
|
-
});
|
|
17545
|
-
watchEffect(() => {
|
|
17546
|
-
if (page.value > pageCount.value) {
|
|
17547
|
-
page.value = pageCount.value;
|
|
17548
|
-
}
|
|
17549
|
-
});
|
|
17550
|
-
function setItemsPerPage(value) {
|
|
17551
|
-
itemsPerPage.value = value;
|
|
17552
|
-
page.value = 1;
|
|
17553
|
-
}
|
|
17554
|
-
function nextPage() {
|
|
17555
|
-
page.value = clamp(page.value + 1, 1, pageCount.value);
|
|
17556
|
-
}
|
|
17557
|
-
function prevPage() {
|
|
17558
|
-
page.value = clamp(page.value - 1, 1, pageCount.value);
|
|
17559
|
-
}
|
|
17560
|
-
function setPage(value) {
|
|
17561
|
-
page.value = clamp(value, 1, pageCount.value);
|
|
17562
|
-
}
|
|
17563
|
-
const data = {
|
|
17564
|
-
page,
|
|
17565
|
-
itemsPerPage,
|
|
17566
|
-
startIndex,
|
|
17567
|
-
stopIndex,
|
|
17568
|
-
pageCount,
|
|
17569
|
-
itemsLength,
|
|
17570
|
-
nextPage,
|
|
17571
|
-
prevPage,
|
|
17572
|
-
setPage,
|
|
17573
|
-
setItemsPerPage
|
|
17574
|
-
};
|
|
17575
|
-
provide(VDataTablePaginationSymbol, data);
|
|
17576
|
-
return data;
|
|
17577
|
-
}
|
|
17578
|
-
function usePagination() {
|
|
17579
|
-
const data = inject$1(VDataTablePaginationSymbol);
|
|
17580
|
-
if (!data) throw new Error('Missing pagination!');
|
|
17581
|
-
return data;
|
|
17582
|
-
}
|
|
17583
|
-
function usePaginatedItems(options) {
|
|
17584
|
-
const vm = getCurrentInstance('usePaginatedItems');
|
|
17585
|
-
const {
|
|
17586
|
-
items,
|
|
17587
|
-
startIndex,
|
|
17588
|
-
stopIndex,
|
|
17589
|
-
itemsPerPage
|
|
17590
|
-
} = options;
|
|
17591
|
-
const paginatedItems = computed(() => {
|
|
17592
|
-
if (itemsPerPage.value <= 0) return items.value;
|
|
17593
|
-
return items.value.slice(startIndex.value, stopIndex.value);
|
|
17594
|
-
});
|
|
17595
|
-
watch(paginatedItems, val => {
|
|
17596
|
-
vm.emit('update:currentItems', val);
|
|
17597
|
-
});
|
|
17598
|
-
return {
|
|
17599
|
-
paginatedItems
|
|
17600
|
-
};
|
|
17601
|
-
}
|
|
17602
|
-
|
|
17603
|
-
// Composables
|
|
17604
|
-
|
|
17605
|
-
// Types
|
|
17606
|
-
|
|
17607
|
-
const singleSelectStrategy = {
|
|
17608
|
-
showSelectAll: false,
|
|
17609
|
-
allSelected: () => [],
|
|
17610
|
-
select: _ref => {
|
|
17611
|
-
let {
|
|
17612
|
-
items,
|
|
17613
|
-
value
|
|
17614
|
-
} = _ref;
|
|
17615
|
-
return new Set(value ? [toRaw(items[0]?.value)] : []);
|
|
17616
|
-
},
|
|
17617
|
-
selectAll: _ref2 => {
|
|
17618
|
-
let {
|
|
17619
|
-
selected
|
|
17620
|
-
} = _ref2;
|
|
17621
|
-
return selected;
|
|
17622
|
-
}
|
|
17623
|
-
};
|
|
17624
|
-
const pageSelectStrategy = {
|
|
17625
|
-
showSelectAll: true,
|
|
17626
|
-
allSelected: _ref3 => {
|
|
17627
|
-
let {
|
|
17628
|
-
currentPage
|
|
17629
|
-
} = _ref3;
|
|
17630
|
-
return currentPage;
|
|
17631
|
-
},
|
|
17632
|
-
select: _ref4 => {
|
|
17633
|
-
let {
|
|
17634
|
-
items,
|
|
17635
|
-
value,
|
|
17636
|
-
selected
|
|
17637
|
-
} = _ref4;
|
|
17638
|
-
for (const item of items) {
|
|
17639
|
-
if (value) selected.add(toRaw(item.value));else selected.delete(toRaw(item.value));
|
|
17640
|
-
}
|
|
17641
|
-
return selected;
|
|
17642
|
-
},
|
|
17643
|
-
selectAll: _ref5 => {
|
|
17644
|
-
let {
|
|
17645
|
-
value,
|
|
17646
|
-
currentPage,
|
|
17647
|
-
selected
|
|
17648
|
-
} = _ref5;
|
|
17649
|
-
return pageSelectStrategy.select({
|
|
17650
|
-
items: currentPage,
|
|
17651
|
-
value,
|
|
17652
|
-
selected
|
|
17653
|
-
});
|
|
17654
|
-
}
|
|
17655
|
-
};
|
|
17656
|
-
const allSelectStrategy = {
|
|
17657
|
-
showSelectAll: true,
|
|
17658
|
-
allSelected: _ref6 => {
|
|
17659
|
-
let {
|
|
17660
|
-
allItems
|
|
17661
|
-
} = _ref6;
|
|
17662
|
-
return allItems;
|
|
17663
|
-
},
|
|
17664
|
-
select: _ref7 => {
|
|
17665
|
-
let {
|
|
17666
|
-
items,
|
|
17667
|
-
value,
|
|
17668
|
-
selected
|
|
17669
|
-
} = _ref7;
|
|
17670
|
-
for (const item of items) {
|
|
17671
|
-
if (value) selected.add(toRaw(item.value));else selected.delete(toRaw(item.value));
|
|
17672
|
-
}
|
|
17673
|
-
return selected;
|
|
17674
|
-
},
|
|
17675
|
-
selectAll: _ref8 => {
|
|
17676
|
-
let {
|
|
17677
|
-
value,
|
|
17678
|
-
allItems,
|
|
17679
|
-
selected
|
|
17680
|
-
} = _ref8;
|
|
17681
|
-
return allSelectStrategy.select({
|
|
17682
|
-
items: allItems,
|
|
17683
|
-
value,
|
|
17684
|
-
selected
|
|
17685
|
-
});
|
|
17686
|
-
}
|
|
17687
|
-
};
|
|
17688
|
-
const makeDataTableSelectProps = propsFactory({
|
|
17689
|
-
showSelect: Boolean,
|
|
17690
|
-
selectStrategy: {
|
|
17691
|
-
type: [String, Object],
|
|
17692
|
-
default: 'page'
|
|
17693
|
-
},
|
|
17694
|
-
modelValue: {
|
|
17695
|
-
type: Array,
|
|
17696
|
-
default: () => []
|
|
17697
|
-
},
|
|
17698
|
-
valueComparator: {
|
|
17699
|
-
type: Function,
|
|
17700
|
-
default: deepEqual
|
|
17701
|
-
}
|
|
17702
|
-
}, 'DataTable-select');
|
|
17703
|
-
const VDataTableSelectionSymbol = Symbol.for('vuetify:data-table-selection');
|
|
17704
|
-
function provideSelection(props, _ref9) {
|
|
17705
|
-
let {
|
|
17706
|
-
allItems,
|
|
17707
|
-
currentPage
|
|
17708
|
-
} = _ref9;
|
|
17709
|
-
const selected = useProxiedModel(props, 'modelValue', props.modelValue, v => {
|
|
17710
|
-
return new Set(wrapInArray(v).map(v => {
|
|
17711
|
-
return allItems.value.find(item => props.valueComparator(v, item.value))?.value ?? v;
|
|
17712
|
-
}));
|
|
17713
|
-
}, v => {
|
|
17714
|
-
return [...v.values()];
|
|
17715
|
-
});
|
|
17716
|
-
const allSelectable = computed(() => allItems.value.filter(item => item.selectable));
|
|
17717
|
-
const currentPageSelectable = computed(() => currentPage.value.filter(item => item.selectable));
|
|
17718
|
-
const selectStrategy = computed(() => {
|
|
17719
|
-
if (typeof props.selectStrategy === 'object') return props.selectStrategy;
|
|
17720
|
-
switch (props.selectStrategy) {
|
|
17721
|
-
case 'single':
|
|
17722
|
-
return singleSelectStrategy;
|
|
17723
|
-
case 'all':
|
|
17724
|
-
return allSelectStrategy;
|
|
17725
|
-
case 'page':
|
|
17726
|
-
default:
|
|
17727
|
-
return pageSelectStrategy;
|
|
17728
|
-
}
|
|
17729
|
-
});
|
|
17730
|
-
function isSelected(items) {
|
|
17731
|
-
return wrapInArray(items).every(item => selected.value.has(toRaw(item.value)));
|
|
17732
|
-
}
|
|
17733
|
-
function isSomeSelected(items) {
|
|
17734
|
-
return wrapInArray(items).some(item => selected.value.has(toRaw(item.value)));
|
|
17735
|
-
}
|
|
17736
|
-
function select(items, value) {
|
|
17737
|
-
const newSelected = selectStrategy.value.select({
|
|
17738
|
-
items,
|
|
17739
|
-
value,
|
|
17740
|
-
selected: new Set(selected.value)
|
|
17741
|
-
});
|
|
17742
|
-
selected.value = newSelected;
|
|
17743
|
-
}
|
|
17744
|
-
function toggleSelect(item) {
|
|
17745
|
-
const newItem = toRef(item);
|
|
17746
|
-
select([newItem.value], !isSelected([newItem.value]));
|
|
17747
|
-
}
|
|
17748
|
-
function selectAll(value) {
|
|
17749
|
-
const newSelected = selectStrategy.value.selectAll({
|
|
17750
|
-
value,
|
|
17751
|
-
allItems: allSelectable.value,
|
|
17752
|
-
currentPage: currentPageSelectable.value,
|
|
17753
|
-
selected: new Set(selected.value)
|
|
17754
|
-
});
|
|
17755
|
-
selected.value = newSelected;
|
|
17756
|
-
}
|
|
17757
|
-
const someSelected = computed(() => selected.value.size > 0);
|
|
17758
|
-
const allSelected = computed(() => {
|
|
17759
|
-
const items = selectStrategy.value.allSelected({
|
|
17760
|
-
allItems: allSelectable.value,
|
|
17761
|
-
currentPage: currentPageSelectable.value
|
|
17762
|
-
});
|
|
17763
|
-
return !!items.length && isSelected(items);
|
|
17764
|
-
});
|
|
17765
|
-
const data = {
|
|
17766
|
-
toggleSelect,
|
|
17767
|
-
select,
|
|
17768
|
-
selectAll,
|
|
17769
|
-
isSelected,
|
|
17770
|
-
isSomeSelected,
|
|
17771
|
-
someSelected,
|
|
17772
|
-
allSelected,
|
|
17773
|
-
showSelectAll: selectStrategy.value.showSelectAll
|
|
17774
|
-
};
|
|
17775
|
-
provide(VDataTableSelectionSymbol, data);
|
|
17776
|
-
return data;
|
|
17777
|
-
}
|
|
17778
|
-
function useSelection() {
|
|
17779
|
-
const data = inject$1(VDataTableSelectionSymbol);
|
|
17780
|
-
if (!data) throw new Error('Missing selection!');
|
|
17781
|
-
return data;
|
|
17782
|
-
}
|
|
17783
|
-
|
|
17784
|
-
// Utilities
|
|
17785
|
-
|
|
17786
|
-
// Types
|
|
17787
|
-
|
|
17788
|
-
const firstDay = {
|
|
17789
|
-
'001': 1,
|
|
17790
|
-
AD: 1,
|
|
17791
|
-
AE: 6,
|
|
17792
|
-
AF: 6,
|
|
17793
|
-
AG: 0,
|
|
17794
|
-
AI: 1,
|
|
17795
|
-
AL: 1,
|
|
17796
|
-
AM: 1,
|
|
17797
|
-
AN: 1,
|
|
17798
|
-
AR: 1,
|
|
17799
|
-
AS: 0,
|
|
17800
|
-
AT: 1,
|
|
17801
|
-
AU: 1,
|
|
17802
|
-
AX: 1,
|
|
17803
|
-
AZ: 1,
|
|
17804
|
-
BA: 1,
|
|
17805
|
-
BD: 0,
|
|
17806
|
-
BE: 1,
|
|
17807
|
-
BG: 1,
|
|
17808
|
-
BH: 6,
|
|
17809
|
-
BM: 1,
|
|
17810
|
-
BN: 1,
|
|
17811
|
-
BR: 0,
|
|
17812
|
-
BS: 0,
|
|
17813
|
-
BT: 0,
|
|
17814
|
-
BW: 0,
|
|
17815
|
-
BY: 1,
|
|
17816
|
-
BZ: 0,
|
|
17817
|
-
CA: 0,
|
|
17818
|
-
CH: 1,
|
|
17819
|
-
CL: 1,
|
|
17820
|
-
CM: 1,
|
|
17821
|
-
CN: 1,
|
|
17822
|
-
CO: 0,
|
|
17823
|
-
CR: 1,
|
|
17824
|
-
CY: 1,
|
|
17825
|
-
CZ: 1,
|
|
17826
|
-
DE: 1,
|
|
17827
|
-
DJ: 6,
|
|
17828
|
-
DK: 1,
|
|
17829
|
-
DM: 0,
|
|
17830
|
-
DO: 0,
|
|
17831
|
-
DZ: 6,
|
|
17832
|
-
EC: 1,
|
|
17833
|
-
EE: 1,
|
|
17834
|
-
EG: 6,
|
|
17835
|
-
ES: 1,
|
|
17836
|
-
ET: 0,
|
|
17837
|
-
FI: 1,
|
|
17838
|
-
FJ: 1,
|
|
17839
|
-
FO: 1,
|
|
17840
|
-
FR: 1,
|
|
17841
|
-
GB: 1,
|
|
17842
|
-
'GB-alt-variant': 0,
|
|
17843
|
-
GE: 1,
|
|
17844
|
-
GF: 1,
|
|
17845
|
-
GP: 1,
|
|
17846
|
-
GR: 1,
|
|
17847
|
-
GT: 0,
|
|
17848
|
-
GU: 0,
|
|
17849
|
-
HK: 0,
|
|
17850
|
-
HN: 0,
|
|
17851
|
-
HR: 1,
|
|
17852
|
-
HU: 1,
|
|
17853
|
-
ID: 0,
|
|
17854
|
-
IE: 1,
|
|
17855
|
-
IL: 0,
|
|
17856
|
-
IN: 0,
|
|
17857
|
-
IQ: 6,
|
|
17858
|
-
IR: 6,
|
|
17859
|
-
IS: 1,
|
|
17860
|
-
IT: 1,
|
|
17861
|
-
JM: 0,
|
|
17862
|
-
JO: 6,
|
|
17863
|
-
JP: 0,
|
|
17864
|
-
KE: 0,
|
|
17865
|
-
KG: 1,
|
|
17866
|
-
KH: 0,
|
|
17867
|
-
KR: 0,
|
|
17868
|
-
KW: 6,
|
|
17869
|
-
KZ: 1,
|
|
17870
|
-
LA: 0,
|
|
17871
|
-
LB: 1,
|
|
17872
|
-
LI: 1,
|
|
17873
|
-
LK: 1,
|
|
17874
|
-
LT: 1,
|
|
17875
|
-
LU: 1,
|
|
17876
|
-
LV: 1,
|
|
17877
|
-
LY: 6,
|
|
17878
|
-
MC: 1,
|
|
17879
|
-
MD: 1,
|
|
17880
|
-
ME: 1,
|
|
17881
|
-
MH: 0,
|
|
17882
|
-
MK: 1,
|
|
17883
|
-
MM: 0,
|
|
17884
|
-
MN: 1,
|
|
17885
|
-
MO: 0,
|
|
17886
|
-
MQ: 1,
|
|
17887
|
-
MT: 0,
|
|
17888
|
-
MV: 5,
|
|
17889
|
-
MX: 0,
|
|
17890
|
-
MY: 1,
|
|
17891
|
-
MZ: 0,
|
|
17892
|
-
NI: 0,
|
|
17893
|
-
NL: 1,
|
|
17894
|
-
NO: 1,
|
|
17895
|
-
NP: 0,
|
|
17896
|
-
NZ: 1,
|
|
17897
|
-
OM: 6,
|
|
17898
|
-
PA: 0,
|
|
17899
|
-
PE: 0,
|
|
17900
|
-
PH: 0,
|
|
17901
|
-
PK: 0,
|
|
17902
|
-
PL: 1,
|
|
17903
|
-
PR: 0,
|
|
17904
|
-
PT: 0,
|
|
17905
|
-
PY: 0,
|
|
17906
|
-
QA: 6,
|
|
17907
|
-
RE: 1,
|
|
17908
|
-
RO: 1,
|
|
17909
|
-
RS: 1,
|
|
17910
|
-
RU: 1,
|
|
17911
|
-
SA: 0,
|
|
17912
|
-
SD: 6,
|
|
17913
|
-
SE: 1,
|
|
17914
|
-
SG: 0,
|
|
17915
|
-
SI: 1,
|
|
17916
|
-
SK: 1,
|
|
17917
|
-
SM: 1,
|
|
17918
|
-
SV: 0,
|
|
17919
|
-
SY: 6,
|
|
17920
|
-
TH: 0,
|
|
17921
|
-
TJ: 1,
|
|
17922
|
-
TM: 1,
|
|
17923
|
-
TR: 1,
|
|
17924
|
-
TT: 0,
|
|
17925
|
-
TW: 0,
|
|
17926
|
-
UA: 1,
|
|
17927
|
-
UM: 0,
|
|
17928
|
-
US: 0,
|
|
17929
|
-
UY: 1,
|
|
17930
|
-
UZ: 1,
|
|
17931
|
-
VA: 1,
|
|
17932
|
-
VE: 0,
|
|
17933
|
-
VI: 0,
|
|
17934
|
-
VN: 1,
|
|
17935
|
-
WS: 0,
|
|
17936
|
-
XK: 1,
|
|
17937
|
-
YE: 0,
|
|
17938
|
-
ZA: 0,
|
|
17939
|
-
ZW: 0
|
|
17940
|
-
};
|
|
17941
|
-
function getWeekArray(date, locale) {
|
|
17942
|
-
const weeks = [];
|
|
17943
|
-
let currentWeek = [];
|
|
17944
|
-
const firstDayOfMonth = startOfMonth(date);
|
|
17945
|
-
const lastDayOfMonth = endOfMonth(date);
|
|
17946
|
-
const firstDayWeekIndex = (firstDayOfMonth.getDay() - firstDay[locale.slice(-2).toUpperCase()] + 7) % 7;
|
|
17947
|
-
const lastDayWeekIndex = (lastDayOfMonth.getDay() - firstDay[locale.slice(-2).toUpperCase()] + 7) % 7;
|
|
17948
|
-
for (let i = 0; i < firstDayWeekIndex; i++) {
|
|
17949
|
-
const adjacentDay = new Date(firstDayOfMonth);
|
|
17950
|
-
adjacentDay.setDate(adjacentDay.getDate() - (firstDayWeekIndex - i));
|
|
17951
|
-
currentWeek.push(adjacentDay);
|
|
17952
|
-
}
|
|
17953
|
-
for (let i = 1; i <= lastDayOfMonth.getDate(); i++) {
|
|
17954
|
-
const day = new Date(date.getFullYear(), date.getMonth(), i);
|
|
17955
|
-
|
|
17956
|
-
// Add the day to the current week
|
|
17957
|
-
currentWeek.push(day);
|
|
17958
|
-
|
|
17959
|
-
// If the current week has 7 days, add it to the weeks array and start a new week
|
|
17960
|
-
if (currentWeek.length === 7) {
|
|
17961
|
-
weeks.push(currentWeek);
|
|
17962
|
-
currentWeek = [];
|
|
17963
|
-
}
|
|
17964
|
-
}
|
|
17965
|
-
for (let i = 1; i < 7 - lastDayWeekIndex; i++) {
|
|
17966
|
-
const adjacentDay = new Date(lastDayOfMonth);
|
|
17967
|
-
adjacentDay.setDate(adjacentDay.getDate() + i);
|
|
17968
|
-
currentWeek.push(adjacentDay);
|
|
17969
|
-
}
|
|
17970
|
-
if (currentWeek.length > 0) {
|
|
17971
|
-
weeks.push(currentWeek);
|
|
17972
|
-
}
|
|
17973
|
-
return weeks;
|
|
17974
|
-
}
|
|
17975
|
-
function startOfWeek(date, locale) {
|
|
17976
|
-
const d = new Date(date);
|
|
17977
|
-
while (d.getDay() !== (firstDay[locale.slice(-2).toUpperCase()] ?? 0)) {
|
|
17978
|
-
d.setDate(d.getDate() - 1);
|
|
17979
|
-
}
|
|
17980
|
-
return d;
|
|
17981
|
-
}
|
|
17982
|
-
function endOfWeek(date, locale) {
|
|
17983
|
-
const d = new Date(date);
|
|
17984
|
-
const lastDay = ((firstDay[locale.slice(-2).toUpperCase()] ?? 0) + 6) % 7;
|
|
17985
|
-
while (d.getDay() !== lastDay) {
|
|
17986
|
-
d.setDate(d.getDate() + 1);
|
|
17987
|
-
}
|
|
17988
|
-
return d;
|
|
17989
|
-
}
|
|
17990
|
-
function startOfMonth(date) {
|
|
17991
|
-
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
17992
|
-
}
|
|
17993
|
-
function endOfMonth(date) {
|
|
17994
|
-
return new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
17995
|
-
}
|
|
17996
|
-
function parseLocalDate(value) {
|
|
17997
|
-
const parts = value.split('-').map(Number);
|
|
17998
|
-
|
|
17999
|
-
// new Date() uses local time zone when passing individual date component values
|
|
18000
|
-
return new Date(parts[0], parts[1] - 1, parts[2]);
|
|
18001
|
-
}
|
|
18002
|
-
const _YYYMMDD = /^([12]\d{3}-([1-9]|0[1-9]|1[0-2])-([1-9]|0[1-9]|[12]\d|3[01]))$/;
|
|
18003
|
-
function date(value) {
|
|
18004
|
-
if (value == null) return new Date();
|
|
18005
|
-
if (value instanceof Date) return value;
|
|
18006
|
-
if (typeof value === 'string') {
|
|
18007
|
-
let parsed;
|
|
18008
|
-
if (_YYYMMDD.test(value)) {
|
|
18009
|
-
return parseLocalDate(value);
|
|
18010
|
-
} else {
|
|
18011
|
-
parsed = Date.parse(value);
|
|
18012
|
-
}
|
|
18013
|
-
if (!isNaN(parsed)) return new Date(parsed);
|
|
18014
|
-
}
|
|
18015
|
-
return null;
|
|
18016
|
-
}
|
|
18017
|
-
const sundayJanuarySecond2000 = new Date(2000, 0, 2);
|
|
18018
|
-
function getWeekdays(locale) {
|
|
18019
|
-
const daysFromSunday = firstDay[locale.slice(-2).toUpperCase()];
|
|
18020
|
-
return createRange(7).map(i => {
|
|
18021
|
-
const weekday = new Date(sundayJanuarySecond2000);
|
|
18022
|
-
weekday.setDate(sundayJanuarySecond2000.getDate() + daysFromSunday + i);
|
|
18023
|
-
return new Intl.DateTimeFormat(locale, {
|
|
18024
|
-
weekday: 'narrow'
|
|
18025
|
-
}).format(weekday);
|
|
18026
|
-
});
|
|
18027
|
-
}
|
|
18028
|
-
function format(value, formatString, locale, formats) {
|
|
18029
|
-
const newDate = date(value) ?? new Date();
|
|
18030
|
-
const customFormat = formats?.[formatString];
|
|
18031
|
-
if (typeof customFormat === 'function') {
|
|
18032
|
-
return customFormat(newDate, formatString, locale);
|
|
17519
|
+
function format(value, formatString, locale, formats) {
|
|
17520
|
+
const newDate = date(value) ?? new Date();
|
|
17521
|
+
const customFormat = formats?.[formatString];
|
|
17522
|
+
if (typeof customFormat === 'function') {
|
|
17523
|
+
return customFormat(newDate, formatString, locale);
|
|
18033
17524
|
}
|
|
18034
17525
|
let options = {};
|
|
18035
17526
|
switch (formatString) {
|
|
@@ -18434,178 +17925,759 @@ class VuetifyDateAdapter {
|
|
|
18434
17925
|
isEqual(date, comparing) {
|
|
18435
17926
|
return isEqual(date, comparing);
|
|
18436
17927
|
}
|
|
18437
|
-
isValid(date) {
|
|
18438
|
-
return isValid(date);
|
|
17928
|
+
isValid(date) {
|
|
17929
|
+
return isValid(date);
|
|
17930
|
+
}
|
|
17931
|
+
isWithinRange(date, range) {
|
|
17932
|
+
return isWithinRange(date, range);
|
|
17933
|
+
}
|
|
17934
|
+
isAfter(date, comparing) {
|
|
17935
|
+
return isAfter(date, comparing);
|
|
17936
|
+
}
|
|
17937
|
+
isAfterDay(date, comparing) {
|
|
17938
|
+
return isAfterDay(date, comparing);
|
|
17939
|
+
}
|
|
17940
|
+
isBefore(date, comparing) {
|
|
17941
|
+
return !isAfter(date, comparing) && !isEqual(date, comparing);
|
|
17942
|
+
}
|
|
17943
|
+
isSameDay(date, comparing) {
|
|
17944
|
+
return isSameDay(date, comparing);
|
|
17945
|
+
}
|
|
17946
|
+
isSameMonth(date, comparing) {
|
|
17947
|
+
return isSameMonth(date, comparing);
|
|
17948
|
+
}
|
|
17949
|
+
isSameYear(date, comparing) {
|
|
17950
|
+
return isSameYear(date, comparing);
|
|
17951
|
+
}
|
|
17952
|
+
setMinutes(date, count) {
|
|
17953
|
+
return setMinutes(date, count);
|
|
17954
|
+
}
|
|
17955
|
+
setHours(date, count) {
|
|
17956
|
+
return setHours(date, count);
|
|
17957
|
+
}
|
|
17958
|
+
setMonth(date, count) {
|
|
17959
|
+
return setMonth(date, count);
|
|
17960
|
+
}
|
|
17961
|
+
setDate(date, day) {
|
|
17962
|
+
return setDate(date, day);
|
|
17963
|
+
}
|
|
17964
|
+
setYear(date, year) {
|
|
17965
|
+
return setYear(date, year);
|
|
17966
|
+
}
|
|
17967
|
+
getDiff(date, comparing, unit) {
|
|
17968
|
+
return getDiff(date, comparing, unit);
|
|
17969
|
+
}
|
|
17970
|
+
getWeekdays() {
|
|
17971
|
+
return getWeekdays(this.locale);
|
|
17972
|
+
}
|
|
17973
|
+
getYear(date) {
|
|
17974
|
+
return getYear(date);
|
|
17975
|
+
}
|
|
17976
|
+
getMonth(date) {
|
|
17977
|
+
return getMonth(date);
|
|
17978
|
+
}
|
|
17979
|
+
getDate(date) {
|
|
17980
|
+
return getDate(date);
|
|
17981
|
+
}
|
|
17982
|
+
getNextMonth(date) {
|
|
17983
|
+
return getNextMonth(date);
|
|
17984
|
+
}
|
|
17985
|
+
getPreviousMonth(date) {
|
|
17986
|
+
return getPreviousMonth(date);
|
|
17987
|
+
}
|
|
17988
|
+
getHours(date) {
|
|
17989
|
+
return getHours(date);
|
|
17990
|
+
}
|
|
17991
|
+
getMinutes(date) {
|
|
17992
|
+
return getMinutes(date);
|
|
17993
|
+
}
|
|
17994
|
+
startOfDay(date) {
|
|
17995
|
+
return startOfDay(date);
|
|
17996
|
+
}
|
|
17997
|
+
endOfDay(date) {
|
|
17998
|
+
return endOfDay(date);
|
|
17999
|
+
}
|
|
18000
|
+
startOfYear(date) {
|
|
18001
|
+
return startOfYear(date);
|
|
18002
|
+
}
|
|
18003
|
+
endOfYear(date) {
|
|
18004
|
+
return endOfYear(date);
|
|
18005
|
+
}
|
|
18006
|
+
}
|
|
18007
|
+
|
|
18008
|
+
// Composables
|
|
18009
|
+
const DateOptionsSymbol = Symbol.for('vuetify:date-options');
|
|
18010
|
+
const DateAdapterSymbol = Symbol.for('vuetify:date-adapter');
|
|
18011
|
+
function createDate(options, locale) {
|
|
18012
|
+
const _options = mergeDeep({
|
|
18013
|
+
adapter: VuetifyDateAdapter,
|
|
18014
|
+
locale: {
|
|
18015
|
+
af: 'af-ZA',
|
|
18016
|
+
// ar: '', # not the same value for all variants
|
|
18017
|
+
bg: 'bg-BG',
|
|
18018
|
+
ca: 'ca-ES',
|
|
18019
|
+
ckb: '',
|
|
18020
|
+
cs: 'cs-CZ',
|
|
18021
|
+
de: 'de-DE',
|
|
18022
|
+
el: 'el-GR',
|
|
18023
|
+
en: 'en-US',
|
|
18024
|
+
// es: '', # not the same value for all variants
|
|
18025
|
+
et: 'et-EE',
|
|
18026
|
+
fa: 'fa-IR',
|
|
18027
|
+
fi: 'fi-FI',
|
|
18028
|
+
// fr: '', #not the same value for all variants
|
|
18029
|
+
hr: 'hr-HR',
|
|
18030
|
+
hu: 'hu-HU',
|
|
18031
|
+
he: 'he-IL',
|
|
18032
|
+
id: 'id-ID',
|
|
18033
|
+
it: 'it-IT',
|
|
18034
|
+
ja: 'ja-JP',
|
|
18035
|
+
ko: 'ko-KR',
|
|
18036
|
+
lv: 'lv-LV',
|
|
18037
|
+
lt: 'lt-LT',
|
|
18038
|
+
nl: 'nl-NL',
|
|
18039
|
+
no: 'no-NO',
|
|
18040
|
+
pl: 'pl-PL',
|
|
18041
|
+
pt: 'pt-PT',
|
|
18042
|
+
ro: 'ro-RO',
|
|
18043
|
+
ru: 'ru-RU',
|
|
18044
|
+
sk: 'sk-SK',
|
|
18045
|
+
sl: 'sl-SI',
|
|
18046
|
+
srCyrl: 'sr-SP',
|
|
18047
|
+
srLatn: 'sr-SP',
|
|
18048
|
+
sv: 'sv-SE',
|
|
18049
|
+
th: 'th-TH',
|
|
18050
|
+
tr: 'tr-TR',
|
|
18051
|
+
az: 'az-AZ',
|
|
18052
|
+
uk: 'uk-UA',
|
|
18053
|
+
vi: 'vi-VN',
|
|
18054
|
+
zhHans: 'zh-CN',
|
|
18055
|
+
zhHant: 'zh-TW'
|
|
18056
|
+
}
|
|
18057
|
+
}, options);
|
|
18058
|
+
return {
|
|
18059
|
+
options: _options,
|
|
18060
|
+
instance: createInstance(_options, locale)
|
|
18061
|
+
};
|
|
18062
|
+
}
|
|
18063
|
+
function createInstance(options, locale) {
|
|
18064
|
+
const instance = reactive(typeof options.adapter === 'function'
|
|
18065
|
+
// eslint-disable-next-line new-cap
|
|
18066
|
+
? new options.adapter({
|
|
18067
|
+
locale: options.locale[locale.current.value] ?? locale.current.value,
|
|
18068
|
+
formats: options.formats
|
|
18069
|
+
}) : options.adapter);
|
|
18070
|
+
watch(locale.current, value => {
|
|
18071
|
+
instance.locale = options.locale[value] ?? value ?? instance.locale;
|
|
18072
|
+
});
|
|
18073
|
+
return instance;
|
|
18074
|
+
}
|
|
18075
|
+
function useDate() {
|
|
18076
|
+
const options = inject$1(DateOptionsSymbol);
|
|
18077
|
+
if (!options) throw new Error('[Vuetify] Could not find injected date options');
|
|
18078
|
+
const locale = useLocale();
|
|
18079
|
+
return createInstance(options, locale);
|
|
18080
|
+
}
|
|
18081
|
+
|
|
18082
|
+
// https://stackoverflow.com/questions/274861/how-do-i-calculate-the-week-number-given-a-date/275024#275024
|
|
18083
|
+
function getWeek(adapter, value) {
|
|
18084
|
+
const date = adapter.toJsDate(value);
|
|
18085
|
+
let year = date.getFullYear();
|
|
18086
|
+
let d1w1 = new Date(year, 0, 1);
|
|
18087
|
+
if (date < d1w1) {
|
|
18088
|
+
year = year - 1;
|
|
18089
|
+
d1w1 = new Date(year, 0, 1);
|
|
18090
|
+
} else {
|
|
18091
|
+
const tv = new Date(year + 1, 0, 1);
|
|
18092
|
+
if (date >= tv) {
|
|
18093
|
+
year = year + 1;
|
|
18094
|
+
d1w1 = tv;
|
|
18095
|
+
}
|
|
18096
|
+
}
|
|
18097
|
+
const diffTime = Math.abs(date.getTime() - d1w1.getTime());
|
|
18098
|
+
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
|
18099
|
+
return Math.floor(diffDays / 7) + 1;
|
|
18100
|
+
}
|
|
18101
|
+
|
|
18102
|
+
// Types
|
|
18103
|
+
|
|
18104
|
+
const makeVConfirmEditProps = propsFactory({
|
|
18105
|
+
modelValue: null,
|
|
18106
|
+
color: String,
|
|
18107
|
+
cancelText: {
|
|
18108
|
+
type: String,
|
|
18109
|
+
default: '$vuetify.confirmEdit.cancel'
|
|
18110
|
+
},
|
|
18111
|
+
okText: {
|
|
18112
|
+
type: String,
|
|
18113
|
+
default: '$vuetify.confirmEdit.ok'
|
|
18439
18114
|
}
|
|
18440
|
-
|
|
18441
|
-
|
|
18115
|
+
}, 'VConfirmEdit');
|
|
18116
|
+
const VConfirmEdit = genericComponent()({
|
|
18117
|
+
name: 'VConfirmEdit',
|
|
18118
|
+
props: makeVConfirmEditProps(),
|
|
18119
|
+
emits: {
|
|
18120
|
+
cancel: () => true,
|
|
18121
|
+
save: value => true,
|
|
18122
|
+
'update:modelValue': value => true
|
|
18123
|
+
},
|
|
18124
|
+
setup(props, _ref) {
|
|
18125
|
+
let {
|
|
18126
|
+
emit,
|
|
18127
|
+
slots
|
|
18128
|
+
} = _ref;
|
|
18129
|
+
const model = useProxiedModel(props, 'modelValue');
|
|
18130
|
+
const internalModel = ref();
|
|
18131
|
+
watchEffect(() => {
|
|
18132
|
+
internalModel.value = structuredClone(toRaw(model.value));
|
|
18133
|
+
});
|
|
18134
|
+
const {
|
|
18135
|
+
t
|
|
18136
|
+
} = useLocale();
|
|
18137
|
+
const isPristine = computed(() => {
|
|
18138
|
+
return deepEqual(model.value, internalModel.value);
|
|
18139
|
+
});
|
|
18140
|
+
function save() {
|
|
18141
|
+
model.value = internalModel.value;
|
|
18142
|
+
emit('save', internalModel.value);
|
|
18143
|
+
}
|
|
18144
|
+
function cancel() {
|
|
18145
|
+
internalModel.value = structuredClone(toRaw(model.value));
|
|
18146
|
+
emit('cancel');
|
|
18147
|
+
}
|
|
18148
|
+
let actionsUsed = false;
|
|
18149
|
+
useRender(() => {
|
|
18150
|
+
const actions = createVNode(Fragment, null, [createVNode(VBtn, {
|
|
18151
|
+
"disabled": isPristine.value,
|
|
18152
|
+
"variant": "text",
|
|
18153
|
+
"color": props.color,
|
|
18154
|
+
"onClick": cancel,
|
|
18155
|
+
"text": t(props.cancelText)
|
|
18156
|
+
}, null), createVNode(VBtn, {
|
|
18157
|
+
"disabled": isPristine.value,
|
|
18158
|
+
"variant": "text",
|
|
18159
|
+
"color": props.color,
|
|
18160
|
+
"onClick": save,
|
|
18161
|
+
"text": t(props.okText)
|
|
18162
|
+
}, null)]);
|
|
18163
|
+
return createVNode(Fragment, null, [slots.default?.({
|
|
18164
|
+
model: internalModel,
|
|
18165
|
+
get actions() {
|
|
18166
|
+
actionsUsed = true;
|
|
18167
|
+
return actions;
|
|
18168
|
+
}
|
|
18169
|
+
}), !actionsUsed && actions]);
|
|
18170
|
+
});
|
|
18442
18171
|
}
|
|
18443
|
-
|
|
18444
|
-
|
|
18172
|
+
});
|
|
18173
|
+
|
|
18174
|
+
// Composables
|
|
18175
|
+
|
|
18176
|
+
// Types
|
|
18177
|
+
|
|
18178
|
+
const makeDataTableExpandProps = propsFactory({
|
|
18179
|
+
expandOnClick: Boolean,
|
|
18180
|
+
showExpand: Boolean,
|
|
18181
|
+
expanded: {
|
|
18182
|
+
type: Array,
|
|
18183
|
+
default: () => []
|
|
18445
18184
|
}
|
|
18446
|
-
|
|
18447
|
-
|
|
18185
|
+
}, 'DataTable-expand');
|
|
18186
|
+
const VDataTableExpandedKey = Symbol.for('vuetify:datatable:expanded');
|
|
18187
|
+
function provideExpanded(props) {
|
|
18188
|
+
const expandOnClick = toRef(props, 'expandOnClick');
|
|
18189
|
+
const expanded = useProxiedModel(props, 'expanded', props.expanded, v => {
|
|
18190
|
+
return new Set(v);
|
|
18191
|
+
}, v => {
|
|
18192
|
+
return [...v.values()];
|
|
18193
|
+
});
|
|
18194
|
+
function expand(item, value) {
|
|
18195
|
+
const newExpanded = new Set(expanded.value);
|
|
18196
|
+
if (!value) {
|
|
18197
|
+
newExpanded.delete(item.value);
|
|
18198
|
+
} else {
|
|
18199
|
+
newExpanded.add(item.value);
|
|
18200
|
+
}
|
|
18201
|
+
expanded.value = newExpanded;
|
|
18448
18202
|
}
|
|
18449
|
-
|
|
18450
|
-
return
|
|
18203
|
+
function isExpanded(item) {
|
|
18204
|
+
return expanded.value.has(item.value);
|
|
18451
18205
|
}
|
|
18452
|
-
|
|
18453
|
-
|
|
18206
|
+
function toggleExpand(item) {
|
|
18207
|
+
expand(item, !isExpanded(item));
|
|
18454
18208
|
}
|
|
18455
|
-
|
|
18456
|
-
|
|
18209
|
+
const data = {
|
|
18210
|
+
expand,
|
|
18211
|
+
expanded,
|
|
18212
|
+
expandOnClick,
|
|
18213
|
+
isExpanded,
|
|
18214
|
+
toggleExpand
|
|
18215
|
+
};
|
|
18216
|
+
provide(VDataTableExpandedKey, data);
|
|
18217
|
+
return data;
|
|
18218
|
+
}
|
|
18219
|
+
function useExpanded() {
|
|
18220
|
+
const data = inject$1(VDataTableExpandedKey);
|
|
18221
|
+
if (!data) throw new Error('foo');
|
|
18222
|
+
return data;
|
|
18223
|
+
}
|
|
18224
|
+
|
|
18225
|
+
// Composables
|
|
18226
|
+
|
|
18227
|
+
// Types
|
|
18228
|
+
|
|
18229
|
+
const makeDataTableGroupProps = propsFactory({
|
|
18230
|
+
groupBy: {
|
|
18231
|
+
type: Array,
|
|
18232
|
+
default: () => []
|
|
18457
18233
|
}
|
|
18458
|
-
|
|
18459
|
-
|
|
18234
|
+
}, 'DataTable-group');
|
|
18235
|
+
const VDataTableGroupSymbol = Symbol.for('vuetify:data-table-group');
|
|
18236
|
+
function createGroupBy(props) {
|
|
18237
|
+
const groupBy = useProxiedModel(props, 'groupBy');
|
|
18238
|
+
return {
|
|
18239
|
+
groupBy
|
|
18240
|
+
};
|
|
18241
|
+
}
|
|
18242
|
+
function provideGroupBy(options) {
|
|
18243
|
+
const {
|
|
18244
|
+
groupBy,
|
|
18245
|
+
sortBy
|
|
18246
|
+
} = options;
|
|
18247
|
+
const opened = ref(new Set());
|
|
18248
|
+
const sortByWithGroups = computed(() => {
|
|
18249
|
+
return groupBy.value.map(val => ({
|
|
18250
|
+
...val,
|
|
18251
|
+
order: val.order ?? false
|
|
18252
|
+
})).concat(sortBy.value);
|
|
18253
|
+
});
|
|
18254
|
+
function isGroupOpen(group) {
|
|
18255
|
+
return opened.value.has(group.id);
|
|
18460
18256
|
}
|
|
18461
|
-
|
|
18462
|
-
|
|
18257
|
+
function toggleGroup(group) {
|
|
18258
|
+
const newOpened = new Set(opened.value);
|
|
18259
|
+
if (!isGroupOpen(group)) newOpened.add(group.id);else newOpened.delete(group.id);
|
|
18260
|
+
opened.value = newOpened;
|
|
18463
18261
|
}
|
|
18464
|
-
|
|
18465
|
-
|
|
18262
|
+
function extractRows(items) {
|
|
18263
|
+
function dive(group) {
|
|
18264
|
+
const arr = [];
|
|
18265
|
+
for (const item of group.items) {
|
|
18266
|
+
if ('type' in item && item.type === 'group') {
|
|
18267
|
+
arr.push(...dive(item));
|
|
18268
|
+
} else {
|
|
18269
|
+
arr.push(item);
|
|
18270
|
+
}
|
|
18271
|
+
}
|
|
18272
|
+
return arr;
|
|
18273
|
+
}
|
|
18274
|
+
return dive({
|
|
18275
|
+
type: 'group',
|
|
18276
|
+
items,
|
|
18277
|
+
id: 'dummy',
|
|
18278
|
+
key: 'dummy',
|
|
18279
|
+
value: 'dummy',
|
|
18280
|
+
depth: 0
|
|
18281
|
+
});
|
|
18466
18282
|
}
|
|
18467
|
-
|
|
18468
|
-
|
|
18283
|
+
|
|
18284
|
+
// onBeforeMount(() => {
|
|
18285
|
+
// for (const key of groupedItems.value.keys()) {
|
|
18286
|
+
// opened.value.add(key)
|
|
18287
|
+
// }
|
|
18288
|
+
// })
|
|
18289
|
+
|
|
18290
|
+
const data = {
|
|
18291
|
+
sortByWithGroups,
|
|
18292
|
+
toggleGroup,
|
|
18293
|
+
opened,
|
|
18294
|
+
groupBy,
|
|
18295
|
+
extractRows,
|
|
18296
|
+
isGroupOpen
|
|
18297
|
+
};
|
|
18298
|
+
provide(VDataTableGroupSymbol, data);
|
|
18299
|
+
return data;
|
|
18300
|
+
}
|
|
18301
|
+
function useGroupBy() {
|
|
18302
|
+
const data = inject$1(VDataTableGroupSymbol);
|
|
18303
|
+
if (!data) throw new Error('Missing group!');
|
|
18304
|
+
return data;
|
|
18305
|
+
}
|
|
18306
|
+
function groupItemsByProperty(items, groupBy) {
|
|
18307
|
+
if (!items.length) return [];
|
|
18308
|
+
const groups = new Map();
|
|
18309
|
+
for (const item of items) {
|
|
18310
|
+
const value = getObjectValueByPath(item.raw, groupBy);
|
|
18311
|
+
if (!groups.has(value)) {
|
|
18312
|
+
groups.set(value, []);
|
|
18313
|
+
}
|
|
18314
|
+
groups.get(value).push(item);
|
|
18469
18315
|
}
|
|
18470
|
-
|
|
18471
|
-
|
|
18316
|
+
return groups;
|
|
18317
|
+
}
|
|
18318
|
+
function groupItems(items, groupBy) {
|
|
18319
|
+
let depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
18320
|
+
let prefix = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'root';
|
|
18321
|
+
if (!groupBy.length) return [];
|
|
18322
|
+
const groupedItems = groupItemsByProperty(items, groupBy[0]);
|
|
18323
|
+
const groups = [];
|
|
18324
|
+
const rest = groupBy.slice(1);
|
|
18325
|
+
groupedItems.forEach((items, value) => {
|
|
18326
|
+
const key = groupBy[0];
|
|
18327
|
+
const id = `${prefix}_${key}_${value}`;
|
|
18328
|
+
groups.push({
|
|
18329
|
+
depth,
|
|
18330
|
+
id,
|
|
18331
|
+
key,
|
|
18332
|
+
value,
|
|
18333
|
+
items: rest.length ? groupItems(items, rest, depth + 1, id) : items,
|
|
18334
|
+
type: 'group'
|
|
18335
|
+
});
|
|
18336
|
+
});
|
|
18337
|
+
return groups;
|
|
18338
|
+
}
|
|
18339
|
+
function flattenItems(items, opened) {
|
|
18340
|
+
const flatItems = [];
|
|
18341
|
+
for (const item of items) {
|
|
18342
|
+
// TODO: make this better
|
|
18343
|
+
if ('type' in item && item.type === 'group') {
|
|
18344
|
+
if (item.value != null) {
|
|
18345
|
+
flatItems.push(item);
|
|
18346
|
+
}
|
|
18347
|
+
if (opened.has(item.id) || item.value == null) {
|
|
18348
|
+
flatItems.push(...flattenItems(item.items, opened));
|
|
18349
|
+
}
|
|
18350
|
+
} else {
|
|
18351
|
+
flatItems.push(item);
|
|
18352
|
+
}
|
|
18472
18353
|
}
|
|
18473
|
-
|
|
18474
|
-
|
|
18354
|
+
return flatItems;
|
|
18355
|
+
}
|
|
18356
|
+
function useGroupedItems(items, groupBy, opened) {
|
|
18357
|
+
const flatItems = computed(() => {
|
|
18358
|
+
if (!groupBy.value.length) return items.value;
|
|
18359
|
+
const groupedItems = groupItems(items.value, groupBy.value.map(item => item.key));
|
|
18360
|
+
return flattenItems(groupedItems, opened.value);
|
|
18361
|
+
});
|
|
18362
|
+
return {
|
|
18363
|
+
flatItems
|
|
18364
|
+
};
|
|
18365
|
+
}
|
|
18366
|
+
|
|
18367
|
+
// Utilities
|
|
18368
|
+
|
|
18369
|
+
// Types
|
|
18370
|
+
|
|
18371
|
+
function useOptions(_ref) {
|
|
18372
|
+
let {
|
|
18373
|
+
page,
|
|
18374
|
+
itemsPerPage,
|
|
18375
|
+
sortBy,
|
|
18376
|
+
groupBy,
|
|
18377
|
+
search
|
|
18378
|
+
} = _ref;
|
|
18379
|
+
const vm = getCurrentInstance('VDataTable');
|
|
18380
|
+
const options = computed(() => ({
|
|
18381
|
+
page: page.value,
|
|
18382
|
+
itemsPerPage: itemsPerPage.value,
|
|
18383
|
+
sortBy: sortBy.value,
|
|
18384
|
+
groupBy: groupBy.value,
|
|
18385
|
+
search: search.value
|
|
18386
|
+
}));
|
|
18387
|
+
let oldOptions = null;
|
|
18388
|
+
watch(options, () => {
|
|
18389
|
+
if (deepEqual(oldOptions, options.value)) return;
|
|
18390
|
+
|
|
18391
|
+
// Reset page when searching
|
|
18392
|
+
if (oldOptions && oldOptions.search !== options.value.search) {
|
|
18393
|
+
page.value = 1;
|
|
18394
|
+
}
|
|
18395
|
+
vm.emit('update:options', options.value);
|
|
18396
|
+
oldOptions = options.value;
|
|
18397
|
+
}, {
|
|
18398
|
+
deep: true,
|
|
18399
|
+
immediate: true
|
|
18400
|
+
});
|
|
18401
|
+
}
|
|
18402
|
+
|
|
18403
|
+
// Composables
|
|
18404
|
+
|
|
18405
|
+
// Types
|
|
18406
|
+
|
|
18407
|
+
const makeDataTablePaginateProps = propsFactory({
|
|
18408
|
+
page: {
|
|
18409
|
+
type: [Number, String],
|
|
18410
|
+
default: 1
|
|
18411
|
+
},
|
|
18412
|
+
itemsPerPage: {
|
|
18413
|
+
type: [Number, String],
|
|
18414
|
+
default: 10
|
|
18475
18415
|
}
|
|
18476
|
-
|
|
18477
|
-
|
|
18416
|
+
}, 'DataTable-paginate');
|
|
18417
|
+
const VDataTablePaginationSymbol = Symbol.for('vuetify:data-table-pagination');
|
|
18418
|
+
function createPagination(props) {
|
|
18419
|
+
const page = useProxiedModel(props, 'page', undefined, value => +(value ?? 1));
|
|
18420
|
+
const itemsPerPage = useProxiedModel(props, 'itemsPerPage', undefined, value => +(value ?? 10));
|
|
18421
|
+
return {
|
|
18422
|
+
page,
|
|
18423
|
+
itemsPerPage
|
|
18424
|
+
};
|
|
18425
|
+
}
|
|
18426
|
+
function providePagination(options) {
|
|
18427
|
+
const {
|
|
18428
|
+
page,
|
|
18429
|
+
itemsPerPage,
|
|
18430
|
+
itemsLength
|
|
18431
|
+
} = options;
|
|
18432
|
+
const startIndex = computed(() => {
|
|
18433
|
+
if (itemsPerPage.value === -1) return 0;
|
|
18434
|
+
return itemsPerPage.value * (page.value - 1);
|
|
18435
|
+
});
|
|
18436
|
+
const stopIndex = computed(() => {
|
|
18437
|
+
if (itemsPerPage.value === -1) return itemsLength.value;
|
|
18438
|
+
return Math.min(itemsLength.value, startIndex.value + itemsPerPage.value);
|
|
18439
|
+
});
|
|
18440
|
+
const pageCount = computed(() => {
|
|
18441
|
+
if (itemsPerPage.value === -1 || itemsLength.value === 0) return 1;
|
|
18442
|
+
return Math.ceil(itemsLength.value / itemsPerPage.value);
|
|
18443
|
+
});
|
|
18444
|
+
watchEffect(() => {
|
|
18445
|
+
if (page.value > pageCount.value) {
|
|
18446
|
+
page.value = pageCount.value;
|
|
18447
|
+
}
|
|
18448
|
+
});
|
|
18449
|
+
function setItemsPerPage(value) {
|
|
18450
|
+
itemsPerPage.value = value;
|
|
18451
|
+
page.value = 1;
|
|
18478
18452
|
}
|
|
18479
|
-
|
|
18480
|
-
|
|
18453
|
+
function nextPage() {
|
|
18454
|
+
page.value = clamp(page.value + 1, 1, pageCount.value);
|
|
18481
18455
|
}
|
|
18482
|
-
|
|
18483
|
-
|
|
18456
|
+
function prevPage() {
|
|
18457
|
+
page.value = clamp(page.value - 1, 1, pageCount.value);
|
|
18484
18458
|
}
|
|
18485
|
-
|
|
18486
|
-
|
|
18459
|
+
function setPage(value) {
|
|
18460
|
+
page.value = clamp(value, 1, pageCount.value);
|
|
18487
18461
|
}
|
|
18488
|
-
|
|
18489
|
-
|
|
18462
|
+
const data = {
|
|
18463
|
+
page,
|
|
18464
|
+
itemsPerPage,
|
|
18465
|
+
startIndex,
|
|
18466
|
+
stopIndex,
|
|
18467
|
+
pageCount,
|
|
18468
|
+
itemsLength,
|
|
18469
|
+
nextPage,
|
|
18470
|
+
prevPage,
|
|
18471
|
+
setPage,
|
|
18472
|
+
setItemsPerPage
|
|
18473
|
+
};
|
|
18474
|
+
provide(VDataTablePaginationSymbol, data);
|
|
18475
|
+
return data;
|
|
18476
|
+
}
|
|
18477
|
+
function usePagination() {
|
|
18478
|
+
const data = inject$1(VDataTablePaginationSymbol);
|
|
18479
|
+
if (!data) throw new Error('Missing pagination!');
|
|
18480
|
+
return data;
|
|
18481
|
+
}
|
|
18482
|
+
function usePaginatedItems(options) {
|
|
18483
|
+
const vm = getCurrentInstance('usePaginatedItems');
|
|
18484
|
+
const {
|
|
18485
|
+
items,
|
|
18486
|
+
startIndex,
|
|
18487
|
+
stopIndex,
|
|
18488
|
+
itemsPerPage
|
|
18489
|
+
} = options;
|
|
18490
|
+
const paginatedItems = computed(() => {
|
|
18491
|
+
if (itemsPerPage.value <= 0) return items.value;
|
|
18492
|
+
return items.value.slice(startIndex.value, stopIndex.value);
|
|
18493
|
+
});
|
|
18494
|
+
watch(paginatedItems, val => {
|
|
18495
|
+
vm.emit('update:currentItems', val);
|
|
18496
|
+
});
|
|
18497
|
+
return {
|
|
18498
|
+
paginatedItems
|
|
18499
|
+
};
|
|
18500
|
+
}
|
|
18501
|
+
|
|
18502
|
+
// Composables
|
|
18503
|
+
|
|
18504
|
+
// Types
|
|
18505
|
+
|
|
18506
|
+
const singleSelectStrategy = {
|
|
18507
|
+
showSelectAll: false,
|
|
18508
|
+
allSelected: () => [],
|
|
18509
|
+
select: _ref => {
|
|
18510
|
+
let {
|
|
18511
|
+
items,
|
|
18512
|
+
value
|
|
18513
|
+
} = _ref;
|
|
18514
|
+
return new Set(value ? [toRaw(items[0]?.value)] : []);
|
|
18515
|
+
},
|
|
18516
|
+
selectAll: _ref2 => {
|
|
18517
|
+
let {
|
|
18518
|
+
selected
|
|
18519
|
+
} = _ref2;
|
|
18520
|
+
return selected;
|
|
18490
18521
|
}
|
|
18491
|
-
|
|
18492
|
-
|
|
18522
|
+
};
|
|
18523
|
+
const pageSelectStrategy = {
|
|
18524
|
+
showSelectAll: true,
|
|
18525
|
+
allSelected: _ref3 => {
|
|
18526
|
+
let {
|
|
18527
|
+
currentPage
|
|
18528
|
+
} = _ref3;
|
|
18529
|
+
return currentPage;
|
|
18530
|
+
},
|
|
18531
|
+
select: _ref4 => {
|
|
18532
|
+
let {
|
|
18533
|
+
items,
|
|
18534
|
+
value,
|
|
18535
|
+
selected
|
|
18536
|
+
} = _ref4;
|
|
18537
|
+
for (const item of items) {
|
|
18538
|
+
if (value) selected.add(toRaw(item.value));else selected.delete(toRaw(item.value));
|
|
18539
|
+
}
|
|
18540
|
+
return selected;
|
|
18541
|
+
},
|
|
18542
|
+
selectAll: _ref5 => {
|
|
18543
|
+
let {
|
|
18544
|
+
value,
|
|
18545
|
+
currentPage,
|
|
18546
|
+
selected
|
|
18547
|
+
} = _ref5;
|
|
18548
|
+
return pageSelectStrategy.select({
|
|
18549
|
+
items: currentPage,
|
|
18550
|
+
value,
|
|
18551
|
+
selected
|
|
18552
|
+
});
|
|
18493
18553
|
}
|
|
18494
|
-
|
|
18495
|
-
|
|
18554
|
+
};
|
|
18555
|
+
const allSelectStrategy = {
|
|
18556
|
+
showSelectAll: true,
|
|
18557
|
+
allSelected: _ref6 => {
|
|
18558
|
+
let {
|
|
18559
|
+
allItems
|
|
18560
|
+
} = _ref6;
|
|
18561
|
+
return allItems;
|
|
18562
|
+
},
|
|
18563
|
+
select: _ref7 => {
|
|
18564
|
+
let {
|
|
18565
|
+
items,
|
|
18566
|
+
value,
|
|
18567
|
+
selected
|
|
18568
|
+
} = _ref7;
|
|
18569
|
+
for (const item of items) {
|
|
18570
|
+
if (value) selected.add(toRaw(item.value));else selected.delete(toRaw(item.value));
|
|
18571
|
+
}
|
|
18572
|
+
return selected;
|
|
18573
|
+
},
|
|
18574
|
+
selectAll: _ref8 => {
|
|
18575
|
+
let {
|
|
18576
|
+
value,
|
|
18577
|
+
allItems,
|
|
18578
|
+
selected
|
|
18579
|
+
} = _ref8;
|
|
18580
|
+
return allSelectStrategy.select({
|
|
18581
|
+
items: allItems,
|
|
18582
|
+
value,
|
|
18583
|
+
selected
|
|
18584
|
+
});
|
|
18496
18585
|
}
|
|
18497
|
-
|
|
18498
|
-
|
|
18586
|
+
};
|
|
18587
|
+
const makeDataTableSelectProps = propsFactory({
|
|
18588
|
+
showSelect: Boolean,
|
|
18589
|
+
selectStrategy: {
|
|
18590
|
+
type: [String, Object],
|
|
18591
|
+
default: 'page'
|
|
18592
|
+
},
|
|
18593
|
+
modelValue: {
|
|
18594
|
+
type: Array,
|
|
18595
|
+
default: () => []
|
|
18596
|
+
},
|
|
18597
|
+
valueComparator: {
|
|
18598
|
+
type: Function,
|
|
18599
|
+
default: deepEqual
|
|
18499
18600
|
}
|
|
18500
|
-
|
|
18501
|
-
|
|
18601
|
+
}, 'DataTable-select');
|
|
18602
|
+
const VDataTableSelectionSymbol = Symbol.for('vuetify:data-table-selection');
|
|
18603
|
+
function provideSelection(props, _ref9) {
|
|
18604
|
+
let {
|
|
18605
|
+
allItems,
|
|
18606
|
+
currentPage
|
|
18607
|
+
} = _ref9;
|
|
18608
|
+
const selected = useProxiedModel(props, 'modelValue', props.modelValue, v => {
|
|
18609
|
+
return new Set(wrapInArray(v).map(v => {
|
|
18610
|
+
return allItems.value.find(item => props.valueComparator(v, item.value))?.value ?? v;
|
|
18611
|
+
}));
|
|
18612
|
+
}, v => {
|
|
18613
|
+
return [...v.values()];
|
|
18614
|
+
});
|
|
18615
|
+
const allSelectable = computed(() => allItems.value.filter(item => item.selectable));
|
|
18616
|
+
const currentPageSelectable = computed(() => currentPage.value.filter(item => item.selectable));
|
|
18617
|
+
const selectStrategy = computed(() => {
|
|
18618
|
+
if (typeof props.selectStrategy === 'object') return props.selectStrategy;
|
|
18619
|
+
switch (props.selectStrategy) {
|
|
18620
|
+
case 'single':
|
|
18621
|
+
return singleSelectStrategy;
|
|
18622
|
+
case 'all':
|
|
18623
|
+
return allSelectStrategy;
|
|
18624
|
+
case 'page':
|
|
18625
|
+
default:
|
|
18626
|
+
return pageSelectStrategy;
|
|
18627
|
+
}
|
|
18628
|
+
});
|
|
18629
|
+
function isSelected(items) {
|
|
18630
|
+
return wrapInArray(items).every(item => selected.value.has(toRaw(item.value)));
|
|
18502
18631
|
}
|
|
18503
|
-
|
|
18504
|
-
return
|
|
18632
|
+
function isSomeSelected(items) {
|
|
18633
|
+
return wrapInArray(items).some(item => selected.value.has(toRaw(item.value)));
|
|
18505
18634
|
}
|
|
18506
|
-
|
|
18507
|
-
|
|
18635
|
+
function select(items, value) {
|
|
18636
|
+
const newSelected = selectStrategy.value.select({
|
|
18637
|
+
items,
|
|
18638
|
+
value,
|
|
18639
|
+
selected: new Set(selected.value)
|
|
18640
|
+
});
|
|
18641
|
+
selected.value = newSelected;
|
|
18508
18642
|
}
|
|
18509
|
-
|
|
18510
|
-
|
|
18643
|
+
function toggleSelect(item) {
|
|
18644
|
+
const newItem = toRef(item);
|
|
18645
|
+
select([newItem.value], !isSelected([newItem.value]));
|
|
18511
18646
|
}
|
|
18512
|
-
|
|
18513
|
-
|
|
18647
|
+
function selectAll(value) {
|
|
18648
|
+
const newSelected = selectStrategy.value.selectAll({
|
|
18649
|
+
value,
|
|
18650
|
+
allItems: allSelectable.value,
|
|
18651
|
+
currentPage: currentPageSelectable.value,
|
|
18652
|
+
selected: new Set(selected.value)
|
|
18653
|
+
});
|
|
18654
|
+
selected.value = newSelected;
|
|
18514
18655
|
}
|
|
18515
|
-
|
|
18516
|
-
|
|
18517
|
-
|
|
18518
|
-
|
|
18519
|
-
|
|
18520
|
-
|
|
18521
|
-
|
|
18522
|
-
adapter: VuetifyDateAdapter,
|
|
18523
|
-
locale: {
|
|
18524
|
-
af: 'af-ZA',
|
|
18525
|
-
// ar: '', # not the same value for all variants
|
|
18526
|
-
bg: 'bg-BG',
|
|
18527
|
-
ca: 'ca-ES',
|
|
18528
|
-
ckb: '',
|
|
18529
|
-
cs: 'cs-CZ',
|
|
18530
|
-
de: 'de-DE',
|
|
18531
|
-
el: 'el-GR',
|
|
18532
|
-
en: 'en-US',
|
|
18533
|
-
// es: '', # not the same value for all variants
|
|
18534
|
-
et: 'et-EE',
|
|
18535
|
-
fa: 'fa-IR',
|
|
18536
|
-
fi: 'fi-FI',
|
|
18537
|
-
// fr: '', #not the same value for all variants
|
|
18538
|
-
hr: 'hr-HR',
|
|
18539
|
-
hu: 'hu-HU',
|
|
18540
|
-
he: 'he-IL',
|
|
18541
|
-
id: 'id-ID',
|
|
18542
|
-
it: 'it-IT',
|
|
18543
|
-
ja: 'ja-JP',
|
|
18544
|
-
ko: 'ko-KR',
|
|
18545
|
-
lv: 'lv-LV',
|
|
18546
|
-
lt: 'lt-LT',
|
|
18547
|
-
nl: 'nl-NL',
|
|
18548
|
-
no: 'no-NO',
|
|
18549
|
-
pl: 'pl-PL',
|
|
18550
|
-
pt: 'pt-PT',
|
|
18551
|
-
ro: 'ro-RO',
|
|
18552
|
-
ru: 'ru-RU',
|
|
18553
|
-
sk: 'sk-SK',
|
|
18554
|
-
sl: 'sl-SI',
|
|
18555
|
-
srCyrl: 'sr-SP',
|
|
18556
|
-
srLatn: 'sr-SP',
|
|
18557
|
-
sv: 'sv-SE',
|
|
18558
|
-
th: 'th-TH',
|
|
18559
|
-
tr: 'tr-TR',
|
|
18560
|
-
az: 'az-AZ',
|
|
18561
|
-
uk: 'uk-UA',
|
|
18562
|
-
vi: 'vi-VN',
|
|
18563
|
-
zhHans: 'zh-CN',
|
|
18564
|
-
zhHant: 'zh-TW'
|
|
18565
|
-
}
|
|
18566
|
-
}, options);
|
|
18567
|
-
return {
|
|
18568
|
-
options: _options,
|
|
18569
|
-
instance: createInstance(_options, locale)
|
|
18570
|
-
};
|
|
18571
|
-
}
|
|
18572
|
-
function createInstance(options, locale) {
|
|
18573
|
-
const instance = reactive(typeof options.adapter === 'function'
|
|
18574
|
-
// eslint-disable-next-line new-cap
|
|
18575
|
-
? new options.adapter({
|
|
18576
|
-
locale: options.locale[locale.current.value] ?? locale.current.value,
|
|
18577
|
-
formats: options.formats
|
|
18578
|
-
}) : options.adapter);
|
|
18579
|
-
watch(locale.current, value => {
|
|
18580
|
-
instance.locale = options.locale[value] ?? value ?? instance.locale;
|
|
18656
|
+
const someSelected = computed(() => selected.value.size > 0);
|
|
18657
|
+
const allSelected = computed(() => {
|
|
18658
|
+
const items = selectStrategy.value.allSelected({
|
|
18659
|
+
allItems: allSelectable.value,
|
|
18660
|
+
currentPage: currentPageSelectable.value
|
|
18661
|
+
});
|
|
18662
|
+
return !!items.length && isSelected(items);
|
|
18581
18663
|
});
|
|
18582
|
-
|
|
18583
|
-
|
|
18584
|
-
|
|
18585
|
-
|
|
18586
|
-
|
|
18587
|
-
|
|
18588
|
-
|
|
18664
|
+
const data = {
|
|
18665
|
+
toggleSelect,
|
|
18666
|
+
select,
|
|
18667
|
+
selectAll,
|
|
18668
|
+
isSelected,
|
|
18669
|
+
isSomeSelected,
|
|
18670
|
+
someSelected,
|
|
18671
|
+
allSelected,
|
|
18672
|
+
showSelectAll: selectStrategy.value.showSelectAll
|
|
18673
|
+
};
|
|
18674
|
+
provide(VDataTableSelectionSymbol, data);
|
|
18675
|
+
return data;
|
|
18589
18676
|
}
|
|
18590
|
-
|
|
18591
|
-
|
|
18592
|
-
|
|
18593
|
-
|
|
18594
|
-
let year = date.getFullYear();
|
|
18595
|
-
let d1w1 = new Date(year, 0, 1);
|
|
18596
|
-
if (date < d1w1) {
|
|
18597
|
-
year = year - 1;
|
|
18598
|
-
d1w1 = new Date(year, 0, 1);
|
|
18599
|
-
} else {
|
|
18600
|
-
const tv = new Date(year + 1, 0, 1);
|
|
18601
|
-
if (date >= tv) {
|
|
18602
|
-
year = year + 1;
|
|
18603
|
-
d1w1 = tv;
|
|
18604
|
-
}
|
|
18605
|
-
}
|
|
18606
|
-
const diffTime = Math.abs(date.getTime() - d1w1.getTime());
|
|
18607
|
-
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
|
18608
|
-
return Math.floor(diffDays / 7) + 1;
|
|
18677
|
+
function useSelection() {
|
|
18678
|
+
const data = inject$1(VDataTableSelectionSymbol);
|
|
18679
|
+
if (!data) throw new Error('Missing selection!');
|
|
18680
|
+
return data;
|
|
18609
18681
|
}
|
|
18610
18682
|
|
|
18611
18683
|
// Composables
|
|
@@ -22191,6 +22263,141 @@ const VDatePicker = genericComponent()({
|
|
|
22191
22263
|
}
|
|
22192
22264
|
});
|
|
22193
22265
|
|
|
22266
|
+
// Types
|
|
22267
|
+
|
|
22268
|
+
// Types
|
|
22269
|
+
|
|
22270
|
+
const makeVEmptyStateProps = propsFactory({
|
|
22271
|
+
actionText: String,
|
|
22272
|
+
bgColor: String,
|
|
22273
|
+
color: String,
|
|
22274
|
+
icon: IconValue,
|
|
22275
|
+
image: String,
|
|
22276
|
+
justify: {
|
|
22277
|
+
type: String,
|
|
22278
|
+
default: 'center'
|
|
22279
|
+
},
|
|
22280
|
+
headline: String,
|
|
22281
|
+
title: String,
|
|
22282
|
+
text: String,
|
|
22283
|
+
textWidth: {
|
|
22284
|
+
type: [Number, String],
|
|
22285
|
+
default: 500
|
|
22286
|
+
},
|
|
22287
|
+
href: String,
|
|
22288
|
+
to: String,
|
|
22289
|
+
...makeComponentProps(),
|
|
22290
|
+
...makeDimensionProps(),
|
|
22291
|
+
...makeSizeProps({
|
|
22292
|
+
size: undefined
|
|
22293
|
+
}),
|
|
22294
|
+
...makeThemeProps()
|
|
22295
|
+
}, 'VEmptyState');
|
|
22296
|
+
const VEmptyState = genericComponent()({
|
|
22297
|
+
name: 'VEmptyState',
|
|
22298
|
+
props: makeVEmptyStateProps(),
|
|
22299
|
+
emits: {
|
|
22300
|
+
'click:action': e => true
|
|
22301
|
+
},
|
|
22302
|
+
setup(props, _ref) {
|
|
22303
|
+
let {
|
|
22304
|
+
emit,
|
|
22305
|
+
slots
|
|
22306
|
+
} = _ref;
|
|
22307
|
+
const {
|
|
22308
|
+
themeClasses
|
|
22309
|
+
} = provideTheme(props);
|
|
22310
|
+
const {
|
|
22311
|
+
backgroundColorClasses,
|
|
22312
|
+
backgroundColorStyles
|
|
22313
|
+
} = useBackgroundColor(toRef(props, 'bgColor'));
|
|
22314
|
+
const {
|
|
22315
|
+
dimensionStyles
|
|
22316
|
+
} = useDimension(props);
|
|
22317
|
+
const {
|
|
22318
|
+
displayClasses
|
|
22319
|
+
} = useDisplay();
|
|
22320
|
+
function onClickAction(e) {
|
|
22321
|
+
emit('click:action', e);
|
|
22322
|
+
}
|
|
22323
|
+
useRender(() => {
|
|
22324
|
+
const hasActions = !!(slots.actions || props.actionText);
|
|
22325
|
+
const hasHeadline = !!(slots.headline || props.headline);
|
|
22326
|
+
const hasTitle = !!(slots.title || props.title);
|
|
22327
|
+
const hasText = !!(slots.text || props.text);
|
|
22328
|
+
const hasMedia = !!(slots.media || props.image || props.icon);
|
|
22329
|
+
const size = props.size || (props.image ? 200 : 96);
|
|
22330
|
+
return createVNode("div", {
|
|
22331
|
+
"class": ['v-empty-state', {
|
|
22332
|
+
[`v-empty-state--${props.justify}`]: true
|
|
22333
|
+
}, themeClasses.value, backgroundColorClasses.value, displayClasses.value, props.class],
|
|
22334
|
+
"style": [backgroundColorStyles.value, dimensionStyles.value, props.style]
|
|
22335
|
+
}, [hasMedia && createVNode("div", {
|
|
22336
|
+
"key": "media",
|
|
22337
|
+
"class": "v-empty-state__media"
|
|
22338
|
+
}, [!slots.media ? createVNode(Fragment, null, [props.image ? createVNode(VImg, {
|
|
22339
|
+
"key": "image",
|
|
22340
|
+
"src": props.image,
|
|
22341
|
+
"height": size
|
|
22342
|
+
}, null) : props.icon ? createVNode(VIcon, {
|
|
22343
|
+
"key": "icon",
|
|
22344
|
+
"color": props.color,
|
|
22345
|
+
"size": size,
|
|
22346
|
+
"icon": props.icon
|
|
22347
|
+
}, null) : undefined]) : createVNode(VDefaultsProvider, {
|
|
22348
|
+
"key": "media-defaults",
|
|
22349
|
+
"defaults": {
|
|
22350
|
+
VImg: {
|
|
22351
|
+
src: props.image,
|
|
22352
|
+
height: size
|
|
22353
|
+
},
|
|
22354
|
+
VIcon: {
|
|
22355
|
+
size,
|
|
22356
|
+
icon: props.icon
|
|
22357
|
+
}
|
|
22358
|
+
}
|
|
22359
|
+
}, {
|
|
22360
|
+
default: () => [slots.media()]
|
|
22361
|
+
})]), hasHeadline && createVNode("div", {
|
|
22362
|
+
"key": "headline",
|
|
22363
|
+
"class": "v-empty-state__headline"
|
|
22364
|
+
}, [slots.headline?.() ?? props.headline]), hasTitle && createVNode("div", {
|
|
22365
|
+
"key": "title",
|
|
22366
|
+
"class": "v-empty-state__title"
|
|
22367
|
+
}, [slots.title?.() ?? props.title]), hasText && createVNode("div", {
|
|
22368
|
+
"key": "text",
|
|
22369
|
+
"class": "v-empty-state__text",
|
|
22370
|
+
"style": {
|
|
22371
|
+
maxWidth: convertToUnit(props.textWidth)
|
|
22372
|
+
}
|
|
22373
|
+
}, [slots.text?.() ?? props.text]), slots.default && createVNode("div", {
|
|
22374
|
+
"key": "content",
|
|
22375
|
+
"class": "v-empty-state__content"
|
|
22376
|
+
}, [slots.default()]), hasActions && createVNode("div", {
|
|
22377
|
+
"key": "actions",
|
|
22378
|
+
"class": "v-empty-state__actions"
|
|
22379
|
+
}, [createVNode(VDefaultsProvider, {
|
|
22380
|
+
"defaults": {
|
|
22381
|
+
VBtn: {
|
|
22382
|
+
class: 'v-empty-state__action-btn',
|
|
22383
|
+
color: props.color,
|
|
22384
|
+
text: props.actionText
|
|
22385
|
+
}
|
|
22386
|
+
}
|
|
22387
|
+
}, {
|
|
22388
|
+
default: () => [slots.actions?.({
|
|
22389
|
+
props: {
|
|
22390
|
+
onClick: onClickAction
|
|
22391
|
+
}
|
|
22392
|
+
}) ?? createVNode(VBtn, {
|
|
22393
|
+
"onClick": onClickAction
|
|
22394
|
+
}, null)]
|
|
22395
|
+
})])]);
|
|
22396
|
+
});
|
|
22397
|
+
return {};
|
|
22398
|
+
}
|
|
22399
|
+
});
|
|
22400
|
+
|
|
22194
22401
|
const makeVExpansionPanelTextProps = propsFactory({
|
|
22195
22402
|
...makeComponentProps(),
|
|
22196
22403
|
...makeLazyProps()
|
|
@@ -22424,6 +22631,107 @@ const VExpansionPanels = genericComponent()({
|
|
|
22424
22631
|
}
|
|
22425
22632
|
});
|
|
22426
22633
|
|
|
22634
|
+
const makeVFabProps = propsFactory({
|
|
22635
|
+
app: Boolean,
|
|
22636
|
+
appear: Boolean,
|
|
22637
|
+
extended: Boolean,
|
|
22638
|
+
layout: Boolean,
|
|
22639
|
+
location: {
|
|
22640
|
+
type: String,
|
|
22641
|
+
default: 'bottom end'
|
|
22642
|
+
},
|
|
22643
|
+
offset: Boolean,
|
|
22644
|
+
modelValue: {
|
|
22645
|
+
type: Boolean,
|
|
22646
|
+
default: true
|
|
22647
|
+
},
|
|
22648
|
+
...omit(makeVBtnProps({
|
|
22649
|
+
active: true
|
|
22650
|
+
}), ['location']),
|
|
22651
|
+
...makeLayoutItemProps(),
|
|
22652
|
+
...makeTransitionProps({
|
|
22653
|
+
transition: 'fab-transition'
|
|
22654
|
+
})
|
|
22655
|
+
}, 'VFab');
|
|
22656
|
+
const VFab = genericComponent()({
|
|
22657
|
+
name: 'VFab',
|
|
22658
|
+
props: makeVFabProps(),
|
|
22659
|
+
emits: {
|
|
22660
|
+
'update:modelValue': value => true
|
|
22661
|
+
},
|
|
22662
|
+
setup(props, _ref) {
|
|
22663
|
+
let {
|
|
22664
|
+
slots
|
|
22665
|
+
} = _ref;
|
|
22666
|
+
const model = useProxiedModel(props, 'modelValue');
|
|
22667
|
+
const height = shallowRef(56);
|
|
22668
|
+
const layoutItemStyles = ref();
|
|
22669
|
+
const {
|
|
22670
|
+
resizeRef
|
|
22671
|
+
} = useResizeObserver(entries => {
|
|
22672
|
+
if (!entries.length) return;
|
|
22673
|
+
height.value = entries[0].target.clientHeight;
|
|
22674
|
+
});
|
|
22675
|
+
const hasPosition = computed(() => props.app || props.absolute);
|
|
22676
|
+
const position = computed(() => {
|
|
22677
|
+
if (!hasPosition.value) return false;
|
|
22678
|
+
return props.location.split(' ').shift();
|
|
22679
|
+
});
|
|
22680
|
+
const orientation = computed(() => {
|
|
22681
|
+
if (!hasPosition.value) return false;
|
|
22682
|
+
return props.location.split(' ')[1] ?? 'end';
|
|
22683
|
+
});
|
|
22684
|
+
useToggleScope(() => props.app, () => {
|
|
22685
|
+
const layout = useLayoutItem({
|
|
22686
|
+
id: props.name,
|
|
22687
|
+
order: computed(() => parseInt(props.order, 10)),
|
|
22688
|
+
position,
|
|
22689
|
+
layoutSize: computed(() => props.layout ? height.value + 24 : 0),
|
|
22690
|
+
elementSize: computed(() => height.value + 24),
|
|
22691
|
+
active: computed(() => props.app && model.value),
|
|
22692
|
+
absolute: toRef(props, 'absolute')
|
|
22693
|
+
});
|
|
22694
|
+
watchEffect(() => {
|
|
22695
|
+
layoutItemStyles.value = layout.layoutItemStyles.value;
|
|
22696
|
+
});
|
|
22697
|
+
});
|
|
22698
|
+
const vFabRef = ref();
|
|
22699
|
+
useRender(() => {
|
|
22700
|
+
const btnProps = VBtn.filterProps(props);
|
|
22701
|
+
return createVNode("div", {
|
|
22702
|
+
"ref": vFabRef,
|
|
22703
|
+
"class": ['v-fab', {
|
|
22704
|
+
'v-fab--absolute': props.absolute,
|
|
22705
|
+
'v-fab--app': !!props.app,
|
|
22706
|
+
'v-fab--extended': props.extended,
|
|
22707
|
+
'v-fab--offset': props.offset,
|
|
22708
|
+
[`v-fab--${position.value}`]: hasPosition.value,
|
|
22709
|
+
[`v-fab--${orientation.value}`]: hasPosition.value
|
|
22710
|
+
}, props.class],
|
|
22711
|
+
"style": [props.app ? {
|
|
22712
|
+
...layoutItemStyles.value
|
|
22713
|
+
} : {
|
|
22714
|
+
height: 'inherit',
|
|
22715
|
+
width: undefined
|
|
22716
|
+
}, props.style]
|
|
22717
|
+
}, [createVNode("div", {
|
|
22718
|
+
"class": "v-fab__container"
|
|
22719
|
+
}, [createVNode(MaybeTransition, {
|
|
22720
|
+
"appear": props.appear,
|
|
22721
|
+
"transition": props.transition
|
|
22722
|
+
}, {
|
|
22723
|
+
default: () => [withDirectives(createVNode(VBtn, mergeProps({
|
|
22724
|
+
"ref": resizeRef
|
|
22725
|
+
}, btnProps, {
|
|
22726
|
+
"active": undefined,
|
|
22727
|
+
"location": undefined
|
|
22728
|
+
}), slots), [[vShow, props.active]])]
|
|
22729
|
+
})])]);
|
|
22730
|
+
});
|
|
22731
|
+
return {};
|
|
22732
|
+
}
|
|
22733
|
+
});
|
|
22734
|
+
|
|
22427
22735
|
// Types
|
|
22428
22736
|
|
|
22429
22737
|
const makeVFileInputProps = propsFactory({
|
|
@@ -25084,6 +25392,519 @@ const VSnackbar = genericComponent()({
|
|
|
25084
25392
|
}
|
|
25085
25393
|
});
|
|
25086
25394
|
|
|
25395
|
+
// Utilities
|
|
25396
|
+
|
|
25397
|
+
// Types
|
|
25398
|
+
|
|
25399
|
+
const makeLineProps = propsFactory({
|
|
25400
|
+
autoDraw: Boolean,
|
|
25401
|
+
autoDrawDuration: [Number, String],
|
|
25402
|
+
autoDrawEasing: {
|
|
25403
|
+
type: String,
|
|
25404
|
+
default: 'ease'
|
|
25405
|
+
},
|
|
25406
|
+
color: String,
|
|
25407
|
+
gradient: {
|
|
25408
|
+
type: Array,
|
|
25409
|
+
default: () => []
|
|
25410
|
+
},
|
|
25411
|
+
gradientDirection: {
|
|
25412
|
+
type: String,
|
|
25413
|
+
validator: val => ['top', 'bottom', 'left', 'right'].includes(val),
|
|
25414
|
+
default: 'top'
|
|
25415
|
+
},
|
|
25416
|
+
height: {
|
|
25417
|
+
type: [String, Number],
|
|
25418
|
+
default: 75
|
|
25419
|
+
},
|
|
25420
|
+
labels: {
|
|
25421
|
+
type: Array,
|
|
25422
|
+
default: () => []
|
|
25423
|
+
},
|
|
25424
|
+
labelSize: {
|
|
25425
|
+
type: [Number, String],
|
|
25426
|
+
default: 7
|
|
25427
|
+
},
|
|
25428
|
+
lineWidth: {
|
|
25429
|
+
type: [String, Number],
|
|
25430
|
+
default: 4
|
|
25431
|
+
},
|
|
25432
|
+
id: String,
|
|
25433
|
+
itemValue: {
|
|
25434
|
+
type: String,
|
|
25435
|
+
default: 'value'
|
|
25436
|
+
},
|
|
25437
|
+
modelValue: {
|
|
25438
|
+
type: Array,
|
|
25439
|
+
default: () => []
|
|
25440
|
+
},
|
|
25441
|
+
min: [String, Number],
|
|
25442
|
+
max: [String, Number],
|
|
25443
|
+
padding: {
|
|
25444
|
+
type: [String, Number],
|
|
25445
|
+
default: 8
|
|
25446
|
+
},
|
|
25447
|
+
showLabels: Boolean,
|
|
25448
|
+
smooth: Boolean,
|
|
25449
|
+
width: {
|
|
25450
|
+
type: [Number, String],
|
|
25451
|
+
default: 300
|
|
25452
|
+
}
|
|
25453
|
+
}, 'Line');
|
|
25454
|
+
|
|
25455
|
+
// Types
|
|
25456
|
+
|
|
25457
|
+
const makeVBarlineProps = propsFactory({
|
|
25458
|
+
autoLineWidth: Boolean,
|
|
25459
|
+
...makeLineProps()
|
|
25460
|
+
}, 'VBarline');
|
|
25461
|
+
const VBarline = genericComponent()({
|
|
25462
|
+
name: 'VBarline',
|
|
25463
|
+
props: makeVBarlineProps(),
|
|
25464
|
+
setup(props, _ref) {
|
|
25465
|
+
let {
|
|
25466
|
+
slots
|
|
25467
|
+
} = _ref;
|
|
25468
|
+
const uid = getUid();
|
|
25469
|
+
const id = computed(() => props.id || `barline-${uid}`);
|
|
25470
|
+
const autoDrawDuration = computed(() => Number(props.autoDrawDuration) || 500);
|
|
25471
|
+
const hasLabels = computed(() => {
|
|
25472
|
+
return Boolean(props.showLabels || props.labels.length > 0 || !!slots?.label);
|
|
25473
|
+
});
|
|
25474
|
+
const lineWidth = computed(() => parseFloat(props.lineWidth) || 4);
|
|
25475
|
+
const totalWidth = computed(() => Math.max(props.modelValue.length * lineWidth.value, Number(props.width)));
|
|
25476
|
+
const boundary = computed(() => {
|
|
25477
|
+
return {
|
|
25478
|
+
minX: 0,
|
|
25479
|
+
maxX: totalWidth.value,
|
|
25480
|
+
minY: 0,
|
|
25481
|
+
maxY: parseInt(props.height, 10)
|
|
25482
|
+
};
|
|
25483
|
+
});
|
|
25484
|
+
const items = computed(() => props.modelValue.map(item => getPropertyFromItem(item, props.itemValue, item)));
|
|
25485
|
+
function genBars(values, boundary) {
|
|
25486
|
+
const {
|
|
25487
|
+
minX,
|
|
25488
|
+
maxX,
|
|
25489
|
+
minY,
|
|
25490
|
+
maxY
|
|
25491
|
+
} = boundary;
|
|
25492
|
+
const totalValues = values.length;
|
|
25493
|
+
let maxValue = props.max != null ? Number(props.max) : Math.max(...values);
|
|
25494
|
+
let minValue = props.min != null ? Number(props.min) : Math.min(...values);
|
|
25495
|
+
if (minValue > 0 && props.min == null) minValue = 0;
|
|
25496
|
+
if (maxValue < 0 && props.max == null) maxValue = 0;
|
|
25497
|
+
const gridX = maxX / totalValues;
|
|
25498
|
+
const gridY = (maxY - minY) / (maxValue - minValue || 1);
|
|
25499
|
+
const horizonY = maxY - Math.abs(minValue * gridY);
|
|
25500
|
+
return values.map((value, index) => {
|
|
25501
|
+
const height = Math.abs(gridY * value);
|
|
25502
|
+
return {
|
|
25503
|
+
x: minX + index * gridX,
|
|
25504
|
+
y: horizonY - height + +(value < 0) * height,
|
|
25505
|
+
height,
|
|
25506
|
+
value
|
|
25507
|
+
};
|
|
25508
|
+
});
|
|
25509
|
+
}
|
|
25510
|
+
const parsedLabels = computed(() => {
|
|
25511
|
+
const labels = [];
|
|
25512
|
+
const points = genBars(items.value, boundary.value);
|
|
25513
|
+
const len = points.length;
|
|
25514
|
+
for (let i = 0; labels.length < len; i++) {
|
|
25515
|
+
const item = points[i];
|
|
25516
|
+
let value = props.labels[i];
|
|
25517
|
+
if (!value) {
|
|
25518
|
+
value = typeof item === 'object' ? item.value : item;
|
|
25519
|
+
}
|
|
25520
|
+
labels.push({
|
|
25521
|
+
x: item.x,
|
|
25522
|
+
value: String(value)
|
|
25523
|
+
});
|
|
25524
|
+
}
|
|
25525
|
+
return labels;
|
|
25526
|
+
});
|
|
25527
|
+
const bars = computed(() => genBars(items.value, boundary.value));
|
|
25528
|
+
const offsetX = computed(() => (Math.abs(bars.value[0].x - bars.value[1].x) - lineWidth.value) / 2);
|
|
25529
|
+
useRender(() => {
|
|
25530
|
+
const gradientData = !props.gradient.slice().length ? [''] : props.gradient.slice().reverse();
|
|
25531
|
+
return createVNode("svg", {
|
|
25532
|
+
"display": "block"
|
|
25533
|
+
}, [createVNode("defs", null, [createVNode("linearGradient", {
|
|
25534
|
+
"id": id.value,
|
|
25535
|
+
"gradientUnits": "userSpaceOnUse",
|
|
25536
|
+
"x1": props.gradientDirection === 'left' ? '100%' : '0',
|
|
25537
|
+
"y1": props.gradientDirection === 'top' ? '100%' : '0',
|
|
25538
|
+
"x2": props.gradientDirection === 'right' ? '100%' : '0',
|
|
25539
|
+
"y2": props.gradientDirection === 'bottom' ? '100%' : '0'
|
|
25540
|
+
}, [gradientData.map((color, index) => createVNode("stop", {
|
|
25541
|
+
"offset": index / Math.max(gradientData.length - 1, 1),
|
|
25542
|
+
"stop-color": color || 'currentColor'
|
|
25543
|
+
}, null))])]), createVNode("clipPath", {
|
|
25544
|
+
"id": `${id.value}-clip`
|
|
25545
|
+
}, [bars.value.map(item => createVNode("rect", {
|
|
25546
|
+
"x": item.x + offsetX.value,
|
|
25547
|
+
"y": item.y,
|
|
25548
|
+
"width": lineWidth.value,
|
|
25549
|
+
"height": item.height,
|
|
25550
|
+
"rx": typeof props.smooth === 'number' ? props.smooth : props.smooth ? 2 : 0,
|
|
25551
|
+
"ry": typeof props.smooth === 'number' ? props.smooth : props.smooth ? 2 : 0
|
|
25552
|
+
}, [props.autoDraw && createVNode(Fragment, null, [createVNode("animate", {
|
|
25553
|
+
"attributeName": "y",
|
|
25554
|
+
"from": item.y + item.height,
|
|
25555
|
+
"to": item.y,
|
|
25556
|
+
"dur": `${autoDrawDuration.value}ms`,
|
|
25557
|
+
"fill": "freeze"
|
|
25558
|
+
}, null), createVNode("animate", {
|
|
25559
|
+
"attributeName": "height",
|
|
25560
|
+
"from": "0",
|
|
25561
|
+
"to": item.height,
|
|
25562
|
+
"dur": `${autoDrawDuration.value}ms`,
|
|
25563
|
+
"fill": "freeze"
|
|
25564
|
+
}, null)])]))]), hasLabels.value && createVNode("g", {
|
|
25565
|
+
"key": "labels",
|
|
25566
|
+
"style": {
|
|
25567
|
+
textAnchor: 'middle',
|
|
25568
|
+
dominantBaseline: 'mathematical',
|
|
25569
|
+
fill: 'currentColor'
|
|
25570
|
+
}
|
|
25571
|
+
}, [parsedLabels.value.map((item, i) => createVNode("text", {
|
|
25572
|
+
"x": item.x + offsetX.value + lineWidth.value / 2,
|
|
25573
|
+
"y": parseInt(props.height, 10) - 2 + (parseInt(props.labelSize, 10) || 7 * 0.75),
|
|
25574
|
+
"font-size": Number(props.labelSize) || 7
|
|
25575
|
+
}, [slots.label?.({
|
|
25576
|
+
index: i,
|
|
25577
|
+
value: item.value
|
|
25578
|
+
}) ?? item.value]))]), createVNode("g", {
|
|
25579
|
+
"clip-path": `url(#${id.value}-clip)`,
|
|
25580
|
+
"fill": `url(#${id.value})`
|
|
25581
|
+
}, [createVNode("rect", {
|
|
25582
|
+
"x": 0,
|
|
25583
|
+
"y": 0,
|
|
25584
|
+
"width": Math.max(props.modelValue.length * lineWidth.value, Number(props.width)),
|
|
25585
|
+
"height": props.height
|
|
25586
|
+
}, null)])]);
|
|
25587
|
+
});
|
|
25588
|
+
}
|
|
25589
|
+
});
|
|
25590
|
+
|
|
25591
|
+
// @ts-nocheck
|
|
25592
|
+
/* eslint-disable */
|
|
25593
|
+
|
|
25594
|
+
// import { checkCollinear, getDistance, moveTo } from './math'
|
|
25595
|
+
|
|
25596
|
+
/**
|
|
25597
|
+
* From https://github.com/unsplash/react-trend/blob/master/src/helpers/DOM.helpers.js#L18
|
|
25598
|
+
*/
|
|
25599
|
+
function genPath(points, radius) {
|
|
25600
|
+
let fill = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
25601
|
+
let height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 75;
|
|
25602
|
+
if (points.length === 0) return '';
|
|
25603
|
+
const start = points.shift();
|
|
25604
|
+
const end = points[points.length - 1];
|
|
25605
|
+
return (fill ? `M${start.x} ${height - start.x + 2} L${start.x} ${start.y}` : `M${start.x} ${start.y}`) + points.map((point, index) => {
|
|
25606
|
+
const next = points[index + 1];
|
|
25607
|
+
const prev = points[index - 1] || start;
|
|
25608
|
+
const isCollinear = next && checkCollinear(next, point, prev);
|
|
25609
|
+
if (!next || isCollinear) {
|
|
25610
|
+
return `L${point.x} ${point.y}`;
|
|
25611
|
+
}
|
|
25612
|
+
const threshold = Math.min(getDistance(prev, point), getDistance(next, point));
|
|
25613
|
+
const isTooCloseForRadius = threshold / 2 < radius;
|
|
25614
|
+
const radiusForPoint = isTooCloseForRadius ? threshold / 2 : radius;
|
|
25615
|
+
const before = moveTo(prev, point, radiusForPoint);
|
|
25616
|
+
const after = moveTo(next, point, radiusForPoint);
|
|
25617
|
+
return `L${before.x} ${before.y}S${point.x} ${point.y} ${after.x} ${after.y}`;
|
|
25618
|
+
}).join('') + (fill ? `L${end.x} ${height - start.x + 2} Z` : '');
|
|
25619
|
+
}
|
|
25620
|
+
function int(value) {
|
|
25621
|
+
return parseInt(value, 10);
|
|
25622
|
+
}
|
|
25623
|
+
|
|
25624
|
+
/**
|
|
25625
|
+
* https://en.wikipedia.org/wiki/Collinearity
|
|
25626
|
+
* x=(x1+x2)/2
|
|
25627
|
+
* y=(y1+y2)/2
|
|
25628
|
+
*/
|
|
25629
|
+
function checkCollinear(p0, p1, p2) {
|
|
25630
|
+
return int(p0.x + p2.x) === int(2 * p1.x) && int(p0.y + p2.y) === int(2 * p1.y);
|
|
25631
|
+
}
|
|
25632
|
+
function getDistance(p1, p2) {
|
|
25633
|
+
return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
|
|
25634
|
+
}
|
|
25635
|
+
function moveTo(to, from, radius) {
|
|
25636
|
+
const vector = {
|
|
25637
|
+
x: to.x - from.x,
|
|
25638
|
+
y: to.y - from.y
|
|
25639
|
+
};
|
|
25640
|
+
const length = Math.sqrt(vector.x * vector.x + vector.y * vector.y);
|
|
25641
|
+
const unitVector = {
|
|
25642
|
+
x: vector.x / length,
|
|
25643
|
+
y: vector.y / length
|
|
25644
|
+
};
|
|
25645
|
+
return {
|
|
25646
|
+
x: from.x + unitVector.x * radius,
|
|
25647
|
+
y: from.y + unitVector.y * radius
|
|
25648
|
+
};
|
|
25649
|
+
}
|
|
25650
|
+
|
|
25651
|
+
// Types
|
|
25652
|
+
|
|
25653
|
+
const makeVTrendlineProps = propsFactory({
|
|
25654
|
+
fill: Boolean,
|
|
25655
|
+
...makeLineProps()
|
|
25656
|
+
}, 'VTrendline');
|
|
25657
|
+
const VTrendline = genericComponent()({
|
|
25658
|
+
name: 'VTrendline',
|
|
25659
|
+
props: makeVTrendlineProps(),
|
|
25660
|
+
setup(props, _ref) {
|
|
25661
|
+
let {
|
|
25662
|
+
slots
|
|
25663
|
+
} = _ref;
|
|
25664
|
+
const uid = getUid();
|
|
25665
|
+
const id = computed(() => props.id || `trendline-${uid}`);
|
|
25666
|
+
const autoDrawDuration = computed(() => Number(props.autoDrawDuration) || (props.fill ? 500 : 2000));
|
|
25667
|
+
const lastLength = ref(0);
|
|
25668
|
+
const path = ref(null);
|
|
25669
|
+
function genPoints(values, boundary) {
|
|
25670
|
+
const {
|
|
25671
|
+
minX,
|
|
25672
|
+
maxX,
|
|
25673
|
+
minY,
|
|
25674
|
+
maxY
|
|
25675
|
+
} = boundary;
|
|
25676
|
+
const totalValues = values.length;
|
|
25677
|
+
const maxValue = props.max != null ? Number(props.max) : Math.max(...values);
|
|
25678
|
+
const minValue = props.min != null ? Number(props.min) : Math.min(...values);
|
|
25679
|
+
const gridX = (maxX - minX) / (totalValues - 1);
|
|
25680
|
+
const gridY = (maxY - minY) / (maxValue - minValue || 1);
|
|
25681
|
+
return values.map((value, index) => {
|
|
25682
|
+
return {
|
|
25683
|
+
x: minX + index * gridX,
|
|
25684
|
+
y: maxY - (value - minValue) * gridY,
|
|
25685
|
+
value
|
|
25686
|
+
};
|
|
25687
|
+
});
|
|
25688
|
+
}
|
|
25689
|
+
const hasLabels = computed(() => {
|
|
25690
|
+
return Boolean(props.showLabels || props.labels.length > 0 || !!slots?.label);
|
|
25691
|
+
});
|
|
25692
|
+
const lineWidth = computed(() => {
|
|
25693
|
+
return parseFloat(props.lineWidth) || 4;
|
|
25694
|
+
});
|
|
25695
|
+
const totalWidth = computed(() => Number(props.width));
|
|
25696
|
+
const boundary = computed(() => {
|
|
25697
|
+
const padding = Number(props.padding);
|
|
25698
|
+
return {
|
|
25699
|
+
minX: padding,
|
|
25700
|
+
maxX: totalWidth.value - padding,
|
|
25701
|
+
minY: padding,
|
|
25702
|
+
maxY: parseInt(props.height, 10) - padding
|
|
25703
|
+
};
|
|
25704
|
+
});
|
|
25705
|
+
const items = computed(() => props.modelValue.map(item => getPropertyFromItem(item, props.itemValue, item)));
|
|
25706
|
+
const parsedLabels = computed(() => {
|
|
25707
|
+
const labels = [];
|
|
25708
|
+
const points = genPoints(items.value, boundary.value);
|
|
25709
|
+
const len = points.length;
|
|
25710
|
+
for (let i = 0; labels.length < len; i++) {
|
|
25711
|
+
const item = points[i];
|
|
25712
|
+
let value = props.labels[i];
|
|
25713
|
+
if (!value) {
|
|
25714
|
+
value = typeof item === 'object' ? item.value : item;
|
|
25715
|
+
}
|
|
25716
|
+
labels.push({
|
|
25717
|
+
x: item.x,
|
|
25718
|
+
value: String(value)
|
|
25719
|
+
});
|
|
25720
|
+
}
|
|
25721
|
+
return labels;
|
|
25722
|
+
});
|
|
25723
|
+
watch(() => props.modelValue, async () => {
|
|
25724
|
+
await nextTick();
|
|
25725
|
+
if (!props.autoDraw || !path.value) return;
|
|
25726
|
+
const pathRef = path.value;
|
|
25727
|
+
const length = pathRef.getTotalLength();
|
|
25728
|
+
if (!props.fill) {
|
|
25729
|
+
// Initial setup to "hide" the line by using the stroke dash array
|
|
25730
|
+
pathRef.style.strokeDasharray = `${length}`;
|
|
25731
|
+
pathRef.style.strokeDashoffset = `${length}`;
|
|
25732
|
+
|
|
25733
|
+
// Force reflow to ensure the transition starts from this state
|
|
25734
|
+
pathRef.getBoundingClientRect();
|
|
25735
|
+
|
|
25736
|
+
// Animate the stroke dash offset to "draw" the line
|
|
25737
|
+
pathRef.style.transition = `stroke-dashoffset ${autoDrawDuration.value}ms ${props.autoDrawEasing}`;
|
|
25738
|
+
pathRef.style.strokeDashoffset = '0';
|
|
25739
|
+
} else {
|
|
25740
|
+
// Your existing logic for filled paths remains the same
|
|
25741
|
+
pathRef.style.transformOrigin = 'bottom center';
|
|
25742
|
+
pathRef.style.transition = 'none';
|
|
25743
|
+
pathRef.style.transform = `scaleY(0)`;
|
|
25744
|
+
pathRef.getBoundingClientRect();
|
|
25745
|
+
pathRef.style.transition = `transform ${autoDrawDuration.value}ms ${props.autoDrawEasing}`;
|
|
25746
|
+
pathRef.style.transform = `scaleY(1)`;
|
|
25747
|
+
}
|
|
25748
|
+
lastLength.value = length;
|
|
25749
|
+
}, {
|
|
25750
|
+
immediate: true
|
|
25751
|
+
});
|
|
25752
|
+
function genPath$1(fill) {
|
|
25753
|
+
return genPath(genPoints(items.value, boundary.value), props.smooth ? 8 : Number(props.smooth), fill, parseInt(props.height, 10));
|
|
25754
|
+
}
|
|
25755
|
+
useRender(() => {
|
|
25756
|
+
const gradientData = !props.gradient.slice().length ? [''] : props.gradient.slice().reverse();
|
|
25757
|
+
return createVNode("svg", {
|
|
25758
|
+
"display": "block",
|
|
25759
|
+
"stroke-width": parseFloat(props.lineWidth) ?? 4
|
|
25760
|
+
}, [createVNode("defs", null, [createVNode("linearGradient", {
|
|
25761
|
+
"id": id.value,
|
|
25762
|
+
"gradientUnits": "userSpaceOnUse",
|
|
25763
|
+
"x1": props.gradientDirection === 'left' ? '100%' : '0',
|
|
25764
|
+
"y1": props.gradientDirection === 'top' ? '100%' : '0',
|
|
25765
|
+
"x2": props.gradientDirection === 'right' ? '100%' : '0',
|
|
25766
|
+
"y2": props.gradientDirection === 'bottom' ? '100%' : '0'
|
|
25767
|
+
}, [gradientData.map((color, index) => createVNode("stop", {
|
|
25768
|
+
"offset": index / Math.max(gradientData.length - 1, 1),
|
|
25769
|
+
"stop-color": color || 'currentColor'
|
|
25770
|
+
}, null))])]), hasLabels.value && createVNode("g", {
|
|
25771
|
+
"key": "labels",
|
|
25772
|
+
"style": {
|
|
25773
|
+
textAnchor: 'middle',
|
|
25774
|
+
dominantBaseline: 'mathematical',
|
|
25775
|
+
fill: 'currentColor'
|
|
25776
|
+
}
|
|
25777
|
+
}, [parsedLabels.value.map((item, i) => createVNode("text", {
|
|
25778
|
+
"x": item.x + lineWidth.value / 2 + lineWidth.value / 2,
|
|
25779
|
+
"y": parseInt(props.height, 10) - 4 + (parseInt(props.labelSize, 10) || 7 * 0.75),
|
|
25780
|
+
"font-size": Number(props.labelSize) || 7
|
|
25781
|
+
}, [slots.label?.({
|
|
25782
|
+
index: i,
|
|
25783
|
+
value: item.value
|
|
25784
|
+
}) ?? item.value]))]), createVNode("path", {
|
|
25785
|
+
"ref": path,
|
|
25786
|
+
"d": genPath$1(props.fill),
|
|
25787
|
+
"fill": props.fill ? `url(#${id.value})` : 'none',
|
|
25788
|
+
"stroke": props.fill ? 'none' : `url(#${id.value})`
|
|
25789
|
+
}, null), props.fill && createVNode("path", {
|
|
25790
|
+
"d": genPath$1(false),
|
|
25791
|
+
"fill": "none",
|
|
25792
|
+
"stroke": props.color ?? props.gradient?.[0]
|
|
25793
|
+
}, null)]);
|
|
25794
|
+
});
|
|
25795
|
+
}
|
|
25796
|
+
});
|
|
25797
|
+
|
|
25798
|
+
// Types
|
|
25799
|
+
|
|
25800
|
+
// Types
|
|
25801
|
+
|
|
25802
|
+
const makeVSparklineProps = propsFactory({
|
|
25803
|
+
type: {
|
|
25804
|
+
type: String,
|
|
25805
|
+
default: 'trend'
|
|
25806
|
+
},
|
|
25807
|
+
...makeVBarlineProps(),
|
|
25808
|
+
...makeVTrendlineProps()
|
|
25809
|
+
}, 'VSparkline');
|
|
25810
|
+
const VSparkline = genericComponent()({
|
|
25811
|
+
name: 'VSparkline',
|
|
25812
|
+
props: makeVSparklineProps(),
|
|
25813
|
+
setup(props, _ref) {
|
|
25814
|
+
let {
|
|
25815
|
+
slots
|
|
25816
|
+
} = _ref;
|
|
25817
|
+
const {
|
|
25818
|
+
textColorClasses,
|
|
25819
|
+
textColorStyles
|
|
25820
|
+
} = useTextColor(toRef(props, 'color'));
|
|
25821
|
+
const hasLabels = computed(() => {
|
|
25822
|
+
return Boolean(props.showLabels || props.labels.length > 0 || !!slots?.label);
|
|
25823
|
+
});
|
|
25824
|
+
const totalHeight = computed(() => {
|
|
25825
|
+
let height = parseInt(props.height, 10);
|
|
25826
|
+
if (hasLabels.value) height += parseInt(props.labelSize, 10) * 1.5;
|
|
25827
|
+
return height;
|
|
25828
|
+
});
|
|
25829
|
+
useRender(() => {
|
|
25830
|
+
const Tag = props.type === 'trend' ? VTrendline : VBarline;
|
|
25831
|
+
const lineProps = props.type === 'trend' ? VTrendline.filterProps(props) : VBarline.filterProps(props);
|
|
25832
|
+
return createVNode(Tag, mergeProps({
|
|
25833
|
+
"key": props.type,
|
|
25834
|
+
"class": textColorClasses.value,
|
|
25835
|
+
"style": textColorStyles.value,
|
|
25836
|
+
"viewBox": `0 0 ${props.width} ${parseInt(totalHeight.value, 10)}`
|
|
25837
|
+
}, lineProps), slots);
|
|
25838
|
+
});
|
|
25839
|
+
}
|
|
25840
|
+
});
|
|
25841
|
+
|
|
25842
|
+
// Types
|
|
25843
|
+
|
|
25844
|
+
const makeVSpeedDialProps = propsFactory({
|
|
25845
|
+
...makeComponentProps(),
|
|
25846
|
+
...makeVMenuProps({
|
|
25847
|
+
offset: 8,
|
|
25848
|
+
minWidth: 0,
|
|
25849
|
+
openDelay: 0,
|
|
25850
|
+
closeDelay: 100,
|
|
25851
|
+
location: 'top center',
|
|
25852
|
+
transition: 'scale-transition'
|
|
25853
|
+
})
|
|
25854
|
+
}, 'VSpeedDial');
|
|
25855
|
+
const VSpeedDial = genericComponent()({
|
|
25856
|
+
name: 'VSpeedDial',
|
|
25857
|
+
props: makeVSpeedDialProps(),
|
|
25858
|
+
emits: {
|
|
25859
|
+
'update:modelValue': value => true
|
|
25860
|
+
},
|
|
25861
|
+
setup(props, _ref) {
|
|
25862
|
+
let {
|
|
25863
|
+
slots
|
|
25864
|
+
} = _ref;
|
|
25865
|
+
const model = useProxiedModel(props, 'modelValue');
|
|
25866
|
+
const menuRef = ref();
|
|
25867
|
+
const location = computed(() => {
|
|
25868
|
+
const [y, x = 'center'] = props.location.split(' ');
|
|
25869
|
+
return `${y} ${x}`;
|
|
25870
|
+
});
|
|
25871
|
+
const locationClasses = computed(() => ({
|
|
25872
|
+
[`v-speed-dial__content--${location.value.replace(' ', '-')}`]: true
|
|
25873
|
+
}));
|
|
25874
|
+
useRender(() => {
|
|
25875
|
+
const menuProps = VMenu.filterProps(props);
|
|
25876
|
+
return createVNode(VMenu, mergeProps(menuProps, {
|
|
25877
|
+
"modelValue": model.value,
|
|
25878
|
+
"onUpdate:modelValue": $event => model.value = $event,
|
|
25879
|
+
"class": props.class,
|
|
25880
|
+
"style": props.style,
|
|
25881
|
+
"contentClass": ['v-speed-dial__content', locationClasses.value],
|
|
25882
|
+
"location": location.value,
|
|
25883
|
+
"ref": menuRef,
|
|
25884
|
+
"transition": "fade-transition"
|
|
25885
|
+
}), {
|
|
25886
|
+
...slots,
|
|
25887
|
+
default: slotProps => createVNode(VDefaultsProvider, {
|
|
25888
|
+
"defaults": {
|
|
25889
|
+
VBtn: {
|
|
25890
|
+
size: 'small'
|
|
25891
|
+
}
|
|
25892
|
+
}
|
|
25893
|
+
}, {
|
|
25894
|
+
default: () => [createVNode(MaybeTransition, {
|
|
25895
|
+
"appear": true,
|
|
25896
|
+
"group": true,
|
|
25897
|
+
"transition": props.transition
|
|
25898
|
+
}, {
|
|
25899
|
+
default: () => [slots.default?.(slotProps)]
|
|
25900
|
+
})]
|
|
25901
|
+
})
|
|
25902
|
+
});
|
|
25903
|
+
});
|
|
25904
|
+
return {};
|
|
25905
|
+
}
|
|
25906
|
+
});
|
|
25907
|
+
|
|
25087
25908
|
// Types
|
|
25088
25909
|
|
|
25089
25910
|
const makeVStepperActionsProps = propsFactory({
|
|
@@ -26662,6 +27483,7 @@ var components = /*#__PURE__*/Object.freeze({
|
|
|
26662
27483
|
VColorPicker: VColorPicker,
|
|
26663
27484
|
VCombobox: VCombobox,
|
|
26664
27485
|
VComponentIcon: VComponentIcon,
|
|
27486
|
+
VConfirmEdit: VConfirmEdit,
|
|
26665
27487
|
VContainer: VContainer,
|
|
26666
27488
|
VCounter: VCounter,
|
|
26667
27489
|
VDataIterator: VDataIterator,
|
|
@@ -26684,12 +27506,14 @@ var components = /*#__PURE__*/Object.freeze({
|
|
|
26684
27506
|
VDialogTopTransition: VDialogTopTransition,
|
|
26685
27507
|
VDialogTransition: VDialogTransition,
|
|
26686
27508
|
VDivider: VDivider,
|
|
27509
|
+
VEmptyState: VEmptyState,
|
|
26687
27510
|
VExpandTransition: VExpandTransition,
|
|
26688
27511
|
VExpandXTransition: VExpandXTransition,
|
|
26689
27512
|
VExpansionPanel: VExpansionPanel,
|
|
26690
27513
|
VExpansionPanelText: VExpansionPanelText,
|
|
26691
27514
|
VExpansionPanelTitle: VExpansionPanelTitle,
|
|
26692
27515
|
VExpansionPanels: VExpansionPanels,
|
|
27516
|
+
VFab: VFab,
|
|
26693
27517
|
VFabTransition: VFabTransition,
|
|
26694
27518
|
VFadeTransition: VFadeTransition,
|
|
26695
27519
|
VField: VField,
|
|
@@ -26756,6 +27580,8 @@ var components = /*#__PURE__*/Object.freeze({
|
|
|
26756
27580
|
VSlider: VSlider,
|
|
26757
27581
|
VSnackbar: VSnackbar,
|
|
26758
27582
|
VSpacer: VSpacer,
|
|
27583
|
+
VSparkline: VSparkline,
|
|
27584
|
+
VSpeedDial: VSpeedDial,
|
|
26759
27585
|
VStepper: VStepper,
|
|
26760
27586
|
VStepperActions: VStepperActions,
|
|
26761
27587
|
VStepperHeader: VStepperHeader,
|
|
@@ -26932,9 +27758,7 @@ function mountComponent(component, props) {
|
|
|
26932
27758
|
// If vnode.ctx is the same as the instance, then we're bound to a plain element
|
|
26933
27759
|
// and need to find the nearest parent component instance to inherit provides from
|
|
26934
27760
|
const provides = (vnode.ctx === binding.instance.$ ? findComponentParent(vnode, binding.instance.$)?.provides : vnode.ctx?.provides) ?? binding.instance.$.provides;
|
|
26935
|
-
const node = h(component, mergeProps(_props, value),
|
|
26936
|
-
default: () => children
|
|
26937
|
-
});
|
|
27761
|
+
const node = h(component, mergeProps(_props, value), children);
|
|
26938
27762
|
node.appContext = Object.assign(Object.create(null), binding.instance.$.appContext, {
|
|
26939
27763
|
provides
|
|
26940
27764
|
});
|
|
@@ -27093,7 +27917,7 @@ function createVuetify$1() {
|
|
|
27093
27917
|
goTo
|
|
27094
27918
|
};
|
|
27095
27919
|
}
|
|
27096
|
-
const version$1 = "3.6.
|
|
27920
|
+
const version$1 = "3.6.1";
|
|
27097
27921
|
createVuetify$1.version = version$1;
|
|
27098
27922
|
|
|
27099
27923
|
// Vue's inject() can only be used in setup
|
|
@@ -27118,7 +27942,7 @@ const createVuetify = function () {
|
|
|
27118
27942
|
...options
|
|
27119
27943
|
});
|
|
27120
27944
|
};
|
|
27121
|
-
const version = "3.6.
|
|
27945
|
+
const version = "3.6.1";
|
|
27122
27946
|
createVuetify.version = version;
|
|
27123
27947
|
|
|
27124
27948
|
export { index as blueprints, components, createVuetify, directives, useDate, useDefaults, useDisplay, useGoTo, useLayout, useLocale, useRtl, useTheme, version };
|