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