@bagelink/vue 1.4.111 → 1.4.118
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/bin/generateFormSchema.ts +14 -14
- package/dist/components/Card.vue.d.ts.map +1 -1
- package/dist/components/ImportData.vue.d.ts.map +1 -1
- package/dist/components/analytics/PieChart.vue.d.ts.map +1 -1
- package/dist/components/calendar/Index.vue.d.ts.map +1 -1
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/calendar/views/MonthView.vue.d.ts.map +1 -1
- package/dist/components/calendar/views/WeekView.vue.d.ts.map +1 -1
- package/dist/components/dataTable/DataTable.vue.d.ts.map +1 -1
- package/dist/components/form/BagelForm.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePicker.vue.d.ts +1 -0
- package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/composables/useEditor.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/utils/media.d.ts.map +1 -1
- package/dist/components/layout/AppContent.vue.d.ts.map +1 -1
- package/dist/composables/useSchemaField.d.ts +2 -2
- package/dist/composables/useSchemaField.d.ts.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +5 -5
- package/dist/plugins/modalTypes.d.ts +2 -1
- package/dist/plugins/modalTypes.d.ts.map +1 -1
- package/dist/plugins/useModal.d.ts +1 -1
- package/dist/plugins/useModal.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/BagelForm.d.ts +40 -19
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/dist/types/NavLink.d.ts +1 -1
- package/dist/types/NavLink.d.ts.map +1 -1
- package/dist/utils/BagelFormUtils.d.ts +20 -5
- package/dist/utils/BagelFormUtils.d.ts.map +1 -1
- package/dist/utils/elementUtils.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Card.vue +1 -2
- package/src/components/DataPreview.vue +1 -1
- package/src/components/ImportData.vue +94 -88
- package/src/components/analytics/PieChart.vue +21 -34
- package/src/components/calendar/Index.vue +15 -35
- package/src/components/calendar/views/MonthView.vue +84 -88
- package/src/components/calendar/views/WeekView.vue +143 -89
- package/src/components/dataTable/DataTable.vue +2 -3
- package/src/components/form/BagelForm.vue +3 -6
- package/src/components/form/inputs/DateInput.vue +2 -2
- package/src/components/form/inputs/DatePicker.vue +40 -47
- package/src/components/form/inputs/RichText/utils/media.ts +8 -9
- package/src/components/layout/AppContent.vue +21 -1
- package/src/composables/useSchemaField.ts +7 -7
- package/src/plugins/modalTypes.ts +10 -2
- package/src/plugins/useModal.ts +23 -7
- package/src/styles/layout.css +6 -0
- package/src/types/BagelForm.ts +97 -22
- package/src/types/NavLink.ts +1 -1
- package/src/utils/BagelFormUtils.ts +63 -34
- package/src/utils/elementUtils.ts +1 -4
- package/src/utils/index.ts +7 -5
- /package/src/components/{dialog → calendar}/index.ts +0 -0
|
@@ -126,7 +126,7 @@ const relatedDefaultValues = reactive<Record<string, Record<string, any>>>({})
|
|
|
126
126
|
const relatedTransformations = reactive<Record<string, Record<string, Transformation[]>>>({})
|
|
127
127
|
|
|
128
128
|
const formData = ref<any>({})
|
|
129
|
-
const { renderField } = useSchemaField<any
|
|
129
|
+
const { renderField } = useSchemaField<any>({
|
|
130
130
|
mode: 'form',
|
|
131
131
|
getFormData: () => formData.value,
|
|
132
132
|
onUpdateModelValue: (field: Field<any>, value: any) => {
|
|
@@ -1305,13 +1305,10 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1305
1305
|
<Card class="upload-data-container h-100p grid overflow-hidden list-wrap ">
|
|
1306
1306
|
<h2 class="line-height-1 m-0 pb-2 txt-center" v-text="props.title || 'Upload and Map Data'" />
|
|
1307
1307
|
<div v-if="!file" class="h-100p flex column justify-content-center">
|
|
1308
|
-
<DragOver
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
@addFiles="handleFilesUploaded"
|
|
1313
|
-
>
|
|
1314
|
-
<Card class="flex flex-column items-center justify-center outline-dashed outline-3 bg-input hover h-100p justify-content-center txt-center">
|
|
1308
|
+
<DragOver accept=".csv,.xls,.xlsx" class="max-h300px w-500px" browse @addFiles="handleFilesUploaded">
|
|
1309
|
+
<Card
|
|
1310
|
+
class="flex flex-column items-center justify-center outline-dashed outline-3 bg-input hover h-100p justify-content-center txt-center"
|
|
1311
|
+
>
|
|
1315
1312
|
<Icon name="upload" size="5" />
|
|
1316
1313
|
<p>Drag and drop an Excel or CSV file here</p>
|
|
1317
1314
|
<u>or click to select a file</u>
|
|
@@ -1332,7 +1329,10 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1332
1329
|
<Icon icon="draft" size="1.5" weight="300" />
|
|
1333
1330
|
<p v-text="file.name" />
|
|
1334
1331
|
</Btn>
|
|
1335
|
-
<SelectInput
|
|
1332
|
+
<SelectInput
|
|
1333
|
+
v-if="sheetNames.length > 1" v-model="selectedSheet" :options="sheetNames"
|
|
1334
|
+
label="Select Sheet"
|
|
1335
|
+
/>
|
|
1336
1336
|
<CheckInput
|
|
1337
1337
|
v-model="hasHeaders" label="Mark this if file has a header row" class="m-0"
|
|
1338
1338
|
style="--bgl-accent-color: var(--bgl-black); --bgl-primary: var(--bgl-black);"
|
|
@@ -1340,7 +1340,8 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1340
1340
|
</div>
|
|
1341
1341
|
<div v-if="file && !isLoading && fileHeaders.length > 0">
|
|
1342
1342
|
<p class="label pb-1 border-bottom mb-1">
|
|
1343
|
-
Match each required field to a column from your file, set default values, or configure
|
|
1343
|
+
Match each required field to a column from your file, set default values, or configure
|
|
1344
|
+
transformations
|
|
1344
1345
|
</p>
|
|
1345
1346
|
|
|
1346
1347
|
<div class="mapping-table">
|
|
@@ -1352,7 +1353,11 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1352
1353
|
<p>Actions</p>
|
|
1353
1354
|
</div>
|
|
1354
1355
|
|
|
1355
|
-
<div
|
|
1356
|
+
<div
|
|
1357
|
+
v-for="field in schemaFields" :key="field.id"
|
|
1358
|
+
class="grid grid-wrap-5 gap-1 m_gap-025 m_pb-1-5"
|
|
1359
|
+
:class="{ 'array-field-row': field.isArrayField || field.$el === 'array' }"
|
|
1360
|
+
>
|
|
1356
1361
|
<div>
|
|
1357
1362
|
<div class="field-label">
|
|
1358
1363
|
<p class="grid-span-2 input-size line-height-1 inline-block">
|
|
@@ -1373,12 +1378,8 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1373
1378
|
</div>
|
|
1374
1379
|
<div class="fileColSelect">
|
|
1375
1380
|
<SelectInput
|
|
1376
|
-
v-model="fieldMapping[field.id]"
|
|
1377
|
-
|
|
1378
|
-
:options="fileHeaders"
|
|
1379
|
-
searchable
|
|
1380
|
-
:required="isFieldRequired(field)"
|
|
1381
|
-
:disabled="field.disabled"
|
|
1381
|
+
v-model="fieldMapping[field.id]" icon="table_chart" :options="fileHeaders"
|
|
1382
|
+
searchable :required="isFieldRequired(field)" :disabled="field.disabled"
|
|
1382
1383
|
@change="handleSelectChange($event, field.id)"
|
|
1383
1384
|
/>
|
|
1384
1385
|
</div>
|
|
@@ -1386,28 +1387,25 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1386
1387
|
<!-- Default Value Input -->
|
|
1387
1388
|
<div class="default-value-container hideLabel">
|
|
1388
1389
|
{{ initDefaultValue(field.id) }}
|
|
1389
|
-
<component
|
|
1390
|
-
:is="renderField(getFieldWithDefaults(field))"
|
|
1391
|
-
/>
|
|
1390
|
+
<component :is="renderField(getFieldWithDefaults(field))" />
|
|
1392
1391
|
</div>
|
|
1393
1392
|
</div>
|
|
1394
1393
|
<div>
|
|
1395
1394
|
<SelectInput
|
|
1396
|
-
v-model="fieldDataTypes[field.id]"
|
|
1397
|
-
:options="dataTypeOptions"
|
|
1395
|
+
v-model="fieldDataTypes[field.id]" :options="dataTypeOptions"
|
|
1398
1396
|
:disabled="!fieldMapping[field.id] && !defaultValues[field.id]"
|
|
1399
1397
|
/>
|
|
1400
1398
|
</div>
|
|
1401
1399
|
<div>
|
|
1402
1400
|
<div class="flex gap-05 my-05">
|
|
1403
1401
|
<Btn
|
|
1404
|
-
v-tooltip="'Transform'"
|
|
1405
|
-
thin
|
|
1406
|
-
:disabled="field.disabled"
|
|
1407
|
-
icon="transform"
|
|
1402
|
+
v-tooltip="'Transform'" thin :disabled="field.disabled" icon="transform"
|
|
1408
1403
|
@click="openTransformDialog(field)"
|
|
1409
1404
|
/>
|
|
1410
|
-
<Btn
|
|
1405
|
+
<Btn
|
|
1406
|
+
v-if="field.$el === 'array'" v-tooltip="'Related File'" thin icon="attach_file"
|
|
1407
|
+
:disabled="field.disabled" @click="openRelatedDialog(field)"
|
|
1408
|
+
/>
|
|
1411
1409
|
</div>
|
|
1412
1410
|
</div>
|
|
1413
1411
|
</div>
|
|
@@ -1429,7 +1427,10 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1429
1427
|
<div v-if="selectedTransformField">
|
|
1430
1428
|
<div class="flex space-between gap-1 mb-1 border-bottom pb-05 m_flex-wrap">
|
|
1431
1429
|
<p>Create transformations for <strong>{{ selectedTransformField.label }}</strong></p>
|
|
1432
|
-
<Btn
|
|
1430
|
+
<Btn
|
|
1431
|
+
icon="auto_awesome" thin value="Autodetect"
|
|
1432
|
+
@click="autoPopulateTransformations(selectedTransformField.id)"
|
|
1433
|
+
/>
|
|
1433
1434
|
</div>
|
|
1434
1435
|
|
|
1435
1436
|
<div>
|
|
@@ -1443,7 +1444,10 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1443
1444
|
<p>Action</p>
|
|
1444
1445
|
</div>
|
|
1445
1446
|
<div>
|
|
1446
|
-
<div
|
|
1447
|
+
<div
|
|
1448
|
+
v-for="(transform, index) in transformations[selectedTransformField.id] || []" :key="index"
|
|
1449
|
+
class="grid grid-wrap-7 gap-1 align-items-center m_gap-025 m_pb-1-5"
|
|
1450
|
+
>
|
|
1447
1451
|
<p class="grid-span-2 input-size line-height-1">
|
|
1448
1452
|
{{ transform.sourceValue }}
|
|
1449
1453
|
</p>
|
|
@@ -1451,11 +1455,7 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1451
1455
|
{{ transform.targetValue }}
|
|
1452
1456
|
</p>
|
|
1453
1457
|
<Btn
|
|
1454
|
-
v-tooltip="'Remove'"
|
|
1455
|
-
class="mb-05"
|
|
1456
|
-
thin
|
|
1457
|
-
icon="delete"
|
|
1458
|
-
color="red"
|
|
1458
|
+
v-tooltip="'Remove'" class="mb-05" thin icon="delete" color="red"
|
|
1459
1459
|
@click="removeTransformation(selectedTransformField.id, index)"
|
|
1460
1460
|
/>
|
|
1461
1461
|
</div>
|
|
@@ -1463,29 +1463,27 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1463
1463
|
<div class="grid-span-2">
|
|
1464
1464
|
<SelectInput
|
|
1465
1465
|
v-if="fieldMapping[selectedTransformField.id]"
|
|
1466
|
-
v-model="selectedSourceValue"
|
|
1467
|
-
searchable
|
|
1468
|
-
:options="sourceValueOptions"
|
|
1466
|
+
v-model="selectedSourceValue" searchable :options="sourceValueOptions"
|
|
1469
1467
|
placeholder="Select source value"
|
|
1470
1468
|
/>
|
|
1471
|
-
<TextInput
|
|
1469
|
+
<TextInput
|
|
1470
|
+
v-else v-model="selectedSourceValue" type="text"
|
|
1471
|
+
placeholder="Source value"
|
|
1472
|
+
/>
|
|
1472
1473
|
</div>
|
|
1473
1474
|
<div class="grid-span-4">
|
|
1474
1475
|
<SelectInput
|
|
1475
1476
|
v-if="selectedTransformField.options && selectedTransformField.options.length > 0"
|
|
1476
|
-
v-model="selectedTargetValue"
|
|
1477
|
-
searchable
|
|
1478
|
-
:options="selectedTransformField.options"
|
|
1477
|
+
v-model="selectedTargetValue" searchable :options="selectedTransformField.options"
|
|
1479
1478
|
placeholder="Select target value"
|
|
1480
1479
|
/>
|
|
1481
|
-
<TextInput
|
|
1480
|
+
<TextInput
|
|
1481
|
+
v-else v-model="selectedTargetValue" type="text"
|
|
1482
|
+
placeholder="Target value"
|
|
1483
|
+
/>
|
|
1482
1484
|
</div>
|
|
1483
1485
|
<Btn
|
|
1484
|
-
v-tooltip="'Add'"
|
|
1485
|
-
class="mb-05"
|
|
1486
|
-
thin
|
|
1487
|
-
icon="add"
|
|
1488
|
-
color="primary"
|
|
1486
|
+
v-tooltip="'Add'" class="mb-05" thin icon="add" color="primary"
|
|
1489
1487
|
@click="addTransformation(selectedTransformField.id)"
|
|
1490
1488
|
/>
|
|
1491
1489
|
</div>
|
|
@@ -1505,11 +1503,12 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1505
1503
|
|
|
1506
1504
|
<div v-if="!relatedFiles[selectedRelationField.id]" class="mb-05">
|
|
1507
1505
|
<DragOver
|
|
1508
|
-
accept=".csv,.xls,.xlsx"
|
|
1509
|
-
browse
|
|
1506
|
+
accept=".csv,.xls,.xlsx" browse
|
|
1510
1507
|
@addFiles="(files) => processRelatedFile(selectedRelationField!.id, files)"
|
|
1511
1508
|
>
|
|
1512
|
-
<Card
|
|
1509
|
+
<Card
|
|
1510
|
+
class="flex flex-column items-center justify-center outline-dashed outline-3 hover bg-input"
|
|
1511
|
+
>
|
|
1513
1512
|
<Icon name="upload" size="5" />
|
|
1514
1513
|
<p>Drag and drop an Excel or CSV file here</p>
|
|
1515
1514
|
<p>or click to select a file</p>
|
|
@@ -1532,8 +1531,15 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1532
1531
|
<h4>Configure Relationship</h4>
|
|
1533
1532
|
|
|
1534
1533
|
<div class="flex gap-1">
|
|
1535
|
-
<SelectInput
|
|
1536
|
-
|
|
1534
|
+
<SelectInput
|
|
1535
|
+
v-model="parentKeyField[selectedRelationField.id]" :options="fileHeaders"
|
|
1536
|
+
label="Source Key Field (from this file)"
|
|
1537
|
+
/>
|
|
1538
|
+
<SelectInput
|
|
1539
|
+
v-model="relatedKeyField[selectedRelationField.id]"
|
|
1540
|
+
:options="Object.keys(relatedFileData[selectedRelationField.id][0] || {})"
|
|
1541
|
+
label="Related Key Field (from related file)"
|
|
1542
|
+
/>
|
|
1537
1543
|
</div>
|
|
1538
1544
|
|
|
1539
1545
|
<h4>Map Related Fields</h4>
|
|
@@ -1549,7 +1555,10 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1549
1555
|
</tr>
|
|
1550
1556
|
</thead>
|
|
1551
1557
|
<tbody>
|
|
1552
|
-
<tr
|
|
1558
|
+
<tr
|
|
1559
|
+
v-for="schemaItem in (selectedRelationField.attrs?.schema || [])"
|
|
1560
|
+
:key="schemaItem.id"
|
|
1561
|
+
>
|
|
1553
1562
|
<td>{{ schemaItem.label }}</td>
|
|
1554
1563
|
<td>
|
|
1555
1564
|
<SelectInput
|
|
@@ -1577,8 +1586,7 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1577
1586
|
<td>
|
|
1578
1587
|
<div class="action-buttons-cell">
|
|
1579
1588
|
<Btn
|
|
1580
|
-
thin
|
|
1581
|
-
icon="transform"
|
|
1589
|
+
thin icon="transform"
|
|
1582
1590
|
@click="openRelatedTransformDialog(selectedRelationField.id, schemaItem)"
|
|
1583
1591
|
>
|
|
1584
1592
|
Transform
|
|
@@ -1599,9 +1607,7 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1599
1607
|
<Modal v-model:visible="showPreviewModal" title="Data Preview & Edit" width="90vw">
|
|
1600
1608
|
<div>
|
|
1601
1609
|
<Spreadsheet
|
|
1602
|
-
v-model="previewData"
|
|
1603
|
-
class="popupPreviewSpreadsheet"
|
|
1604
|
-
:column-config="spreadsheetColumns"
|
|
1610
|
+
v-model="previewData" class="popupPreviewSpreadsheet" :column-config="spreadsheetColumns"
|
|
1605
1611
|
allow-add-row
|
|
1606
1612
|
/>
|
|
1607
1613
|
</div>
|
|
@@ -1618,16 +1624,15 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1618
1624
|
|
|
1619
1625
|
<Modal v-model:visible="showRelatedTransformDialog" title="Configure Related Transformations" width="800">
|
|
1620
1626
|
<div v-if="selectedRelatedTransformField">
|
|
1621
|
-
<p>
|
|
1627
|
+
<p>
|
|
1628
|
+
Create transformations for <strong>{{ selectedRelatedTransformField.field.label }}</strong> in {{
|
|
1629
|
+
selectedRelationField?.label }}
|
|
1630
|
+
</p>
|
|
1622
1631
|
|
|
1623
1632
|
<div>
|
|
1624
1633
|
<div>
|
|
1625
1634
|
<Btn
|
|
1626
|
-
thin
|
|
1627
|
-
icon="auto_awesome"
|
|
1628
|
-
value="Autolink"
|
|
1629
|
-
color="primary"
|
|
1630
|
-
@click="autoPopulateRelatedTransformations(
|
|
1635
|
+
thin icon="auto_awesome" value="Autolink" color="primary" @click="autoPopulateRelatedTransformations(
|
|
1631
1636
|
selectedRelatedTransformField.parentId,
|
|
1632
1637
|
selectedRelatedTransformField.field.id,
|
|
1633
1638
|
)"
|
|
@@ -1653,11 +1658,7 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1653
1658
|
<td>{{ transform.targetValue }}</td>
|
|
1654
1659
|
<td>
|
|
1655
1660
|
<Btn
|
|
1656
|
-
v-tooltip="'Remove'"
|
|
1657
|
-
thin
|
|
1658
|
-
icon="delete"
|
|
1659
|
-
color="red"
|
|
1660
|
-
@click="removeRelatedTransformation(
|
|
1661
|
+
v-tooltip="'Remove'" thin icon="delete" color="red" @click="removeRelatedTransformation(
|
|
1661
1662
|
selectedRelatedTransformField.parentId,
|
|
1662
1663
|
selectedRelatedTransformField.field.id,
|
|
1663
1664
|
index,
|
|
@@ -1669,30 +1670,29 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1669
1670
|
<td>
|
|
1670
1671
|
<SelectInput
|
|
1671
1672
|
v-if="relatedFileMappings[selectedRelatedTransformField.parentId]?.[selectedRelatedTransformField.field.id]"
|
|
1672
|
-
v-model="selectedRelatedSourceValue"
|
|
1673
|
-
|
|
1674
|
-
:options="relatedSourceValueOptions"
|
|
1675
|
-
placeholder="Select source value"
|
|
1673
|
+
v-model="selectedRelatedSourceValue" searchable
|
|
1674
|
+
:options="relatedSourceValueOptions" placeholder="Select source value"
|
|
1676
1675
|
/>
|
|
1677
|
-
<input
|
|
1676
|
+
<input
|
|
1677
|
+
v-else v-model="selectedRelatedSourceValue" type="text"
|
|
1678
|
+
placeholder="Source value"
|
|
1679
|
+
>
|
|
1678
1680
|
</td>
|
|
1679
1681
|
<td>
|
|
1680
1682
|
<SelectInput
|
|
1681
1683
|
v-if="selectedRelatedTransformField.field.options && selectedRelatedTransformField.field.options.length > 0"
|
|
1682
|
-
v-model="selectedRelatedTargetValue"
|
|
1683
|
-
searchable
|
|
1684
|
+
v-model="selectedRelatedTargetValue" searchable
|
|
1684
1685
|
:options="selectedRelatedTransformField.field.options"
|
|
1685
1686
|
placeholder="Select target value"
|
|
1686
1687
|
/>
|
|
1687
|
-
<input
|
|
1688
|
+
<input
|
|
1689
|
+
v-else v-model="selectedRelatedTargetValue" type="text"
|
|
1690
|
+
placeholder="Target value"
|
|
1691
|
+
>
|
|
1688
1692
|
</td>
|
|
1689
1693
|
<td>
|
|
1690
1694
|
<Btn
|
|
1691
|
-
v-tooltip="'Add'"
|
|
1692
|
-
thin
|
|
1693
|
-
icon="add"
|
|
1694
|
-
color="primary"
|
|
1695
|
-
@click="addRelatedTransformation(
|
|
1695
|
+
v-tooltip="'Add'" thin icon="add" color="primary" @click="addRelatedTransformation(
|
|
1696
1696
|
selectedRelatedTransformField.parentId,
|
|
1697
1697
|
selectedRelatedTransformField.field.id,
|
|
1698
1698
|
)"
|
|
@@ -1712,24 +1712,30 @@ function getRelatedFieldWithDefaults(parentId: string, field: any) {
|
|
|
1712
1712
|
</template>
|
|
1713
1713
|
|
|
1714
1714
|
<style>
|
|
1715
|
-
.fileColSelect{
|
|
1715
|
+
.fileColSelect {
|
|
1716
1716
|
--input-bg: var(--bgl-green-light);
|
|
1717
1717
|
}
|
|
1718
|
-
|
|
1718
|
+
|
|
1719
|
+
.fileColSelect .bgl_icon-font {
|
|
1719
1720
|
color: var(--bgl-green);
|
|
1720
1721
|
line-height: 0;
|
|
1721
1722
|
}
|
|
1722
|
-
|
|
1723
|
+
|
|
1724
|
+
.hideLabel label,
|
|
1725
|
+
.hideLabel .label {
|
|
1723
1726
|
font-size: 0 !important;
|
|
1724
1727
|
}
|
|
1725
|
-
|
|
1728
|
+
|
|
1729
|
+
.mapping-table .selectinput-btn:disabled {
|
|
1726
1730
|
background: var(--input-bg) !important;
|
|
1727
1731
|
cursor: not-allowed !important;
|
|
1728
1732
|
}
|
|
1729
|
-
|
|
1733
|
+
|
|
1734
|
+
.field-label {
|
|
1730
1735
|
--pill-height: 20px;
|
|
1731
1736
|
}
|
|
1732
|
-
|
|
1737
|
+
|
|
1738
|
+
.popupPreviewSpreadsheet .spreadsheet {
|
|
1733
1739
|
width: 100%;
|
|
1734
1740
|
overflow: auto;
|
|
1735
1741
|
height: calc(100vh - 300px);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
2
|
import { Icon } from '@bagelink/vue'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
4
|
|
|
5
5
|
interface PieData {
|
|
6
6
|
label: string
|
|
@@ -32,27 +32,26 @@ const colors = computed(() => {
|
|
|
32
32
|
const baseColor = props.color
|
|
33
33
|
const opacities = [1, 0.8, 0.6, 0.4, 0.85, 0.7, 0.5, 0.3, 0.9, 0.75]
|
|
34
34
|
|
|
35
|
-
return opacities.map(opacity => {
|
|
35
|
+
return opacities.map((opacity) => {
|
|
36
36
|
// Convert hex to rgba with opacity
|
|
37
37
|
const hex = baseColor.replace('#', '')
|
|
38
|
-
const r = parseInt(hex.substr(0, 2), 16)
|
|
39
|
-
const g = parseInt(hex.substr(2, 2), 16)
|
|
40
|
-
const b = parseInt(hex.substr(4, 2), 16)
|
|
38
|
+
const r = Number.parseInt(hex.substr(0, 2), 16)
|
|
39
|
+
const g = Number.parseInt(hex.substr(2, 2), 16)
|
|
40
|
+
const b = Number.parseInt(hex.substr(4, 2), 16)
|
|
41
41
|
|
|
42
42
|
return `rgba(${r}, ${g}, ${b}, ${opacity})`
|
|
43
43
|
})
|
|
44
44
|
})
|
|
45
45
|
|
|
46
|
-
// RTL detection
|
|
47
|
-
const isRtl = computed(() => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
})
|
|
46
|
+
// // RTL detection
|
|
47
|
+
// const isRtl = computed(() => {
|
|
48
|
+
// if (typeof document !== 'undefined') {
|
|
49
|
+
// return document.documentElement.dir === 'rtl' || document.body.dir === 'rtl'
|
|
50
|
+
// }
|
|
51
|
+
// return false
|
|
52
|
+
// })
|
|
53
53
|
|
|
54
|
-
const totalValue = computed(() =>
|
|
55
|
-
props.data.reduce((sum, item) => sum + item.value, 0)
|
|
54
|
+
const totalValue = computed(() => props.data.reduce((sum, item) => sum + item.value, 0)
|
|
56
55
|
)
|
|
57
56
|
|
|
58
57
|
const pieSegments = computed(() => {
|
|
@@ -131,36 +130,24 @@ function formatPercentage(percentage: number): string {
|
|
|
131
130
|
</div>
|
|
132
131
|
</div>
|
|
133
132
|
<div class="chart-container flex space-between gap-1 flex-wrap" :class="{ 'with-legend': showLegend }">
|
|
134
|
-
<svg
|
|
135
|
-
:width="size"
|
|
136
|
-
:height="size"
|
|
137
|
-
class="chart-svg mx-auto flex-shrink-0"
|
|
138
|
-
>
|
|
133
|
+
<svg :width="size" :height="size" class="chart-svg mx-auto flex-shrink-0">
|
|
139
134
|
<g :transform="`translate(${size / 2}, ${size / 2})`">
|
|
140
135
|
<path
|
|
141
|
-
v-for="(segment, index) in pieSegments"
|
|
142
|
-
:
|
|
143
|
-
:d="segment.pathData"
|
|
144
|
-
:fill="segment.color"
|
|
145
|
-
class="pie-segment"
|
|
146
|
-
stroke="white"
|
|
147
|
-
stroke-width="2"
|
|
136
|
+
v-for="(segment, index) in pieSegments" :key="index" :d="segment.pathData"
|
|
137
|
+
:fill="segment.color" class="pie-segment" stroke="white" stroke-width="2"
|
|
148
138
|
>
|
|
149
|
-
<title>{{ segment.label }}: {{ formatValue(segment.value) }} ({{
|
|
139
|
+
<title>{{ segment.label }}: {{ formatValue(segment.value) }} ({{
|
|
140
|
+
formatPercentage(segment.percentage) }})</title>
|
|
150
141
|
</path>
|
|
151
142
|
</g>
|
|
152
143
|
</svg>
|
|
153
144
|
|
|
154
145
|
<div v-if="showLegend" class="legend mx-auto display-flex column gap-05 min-w-100px">
|
|
155
146
|
<div
|
|
156
|
-
v-for="(segment, index) in pieSegments"
|
|
157
|
-
:key="index"
|
|
147
|
+
v-for="(segment, index) in pieSegments" :key="index"
|
|
158
148
|
class="gap-1 flex align-items-center txt14 justify-content-start"
|
|
159
149
|
>
|
|
160
|
-
<div
|
|
161
|
-
class="legend-color flex-shrink-0 radius-05"
|
|
162
|
-
:style="{ backgroundColor: segment.color }"
|
|
163
|
-
/>
|
|
150
|
+
<div class="legend-color flex-shrink-0 radius-05" :style="{ backgroundColor: segment.color }" />
|
|
164
151
|
<span v-if="segment.label" class="flex-shrink-1 flex-grow-1">{{ segment.label }}</span>
|
|
165
152
|
<span class="bold">{{ formatValue(segment.value) }}</span>
|
|
166
153
|
<span class="opacity-6 txt12">({{ formatPercentage(segment.percentage) }})</span>
|
|
@@ -174,6 +161,7 @@ function formatPercentage(percentage: number): string {
|
|
|
174
161
|
[dir="rtl"] .chart-container.with-legend {
|
|
175
162
|
flex-direction: row-reverse;
|
|
176
163
|
}
|
|
164
|
+
|
|
177
165
|
.pie-segment {
|
|
178
166
|
cursor: pointer;
|
|
179
167
|
transition: opacity 0.2s ease;
|
|
@@ -192,5 +180,4 @@ function formatPercentage(percentage: number): string {
|
|
|
192
180
|
width: 12px;
|
|
193
181
|
height: 12px;
|
|
194
182
|
}
|
|
195
|
-
|
|
196
183
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { Component } from 'vue'
|
|
3
3
|
import type { CalendarEvent, CalendarProps, CalendarView, CalendarViewState } from './CalendarTypes'
|
|
4
|
-
import { timeDelta, Btn, ListItem, Dropdown,
|
|
4
|
+
import { timeDelta, Btn, ListItem, Dropdown, formatDate } from '@bagelink/vue'
|
|
5
5
|
import { ref, computed, onMounted } from 'vue'
|
|
6
6
|
import CalendarPopover from './CalendarPopover.vue'
|
|
7
7
|
import AgendaView from './views/AgendaView.vue'
|
|
@@ -124,44 +124,28 @@ onMounted(() => { emit('ready', state.value) })
|
|
|
124
124
|
<div class="calendar">
|
|
125
125
|
<div class="flex m_block m_pb-1">
|
|
126
126
|
<h3 class="txt-light my-0">
|
|
127
|
-
<b>{{
|
|
128
|
-
{{
|
|
127
|
+
<b>{{ formatDate(currentDate, 'MMMM') }}</b>
|
|
128
|
+
{{ formatDate(currentDate, 'YYYY') }}
|
|
129
129
|
</h3>
|
|
130
130
|
<div class="ms-auto flex gap-025">
|
|
131
131
|
<Dropdown thin :value="currentView" iconEnd="keyboard_arrow_down" color="gray">
|
|
132
|
-
<ListItem
|
|
133
|
-
v-for="(_, key) in views"
|
|
134
|
-
:key="key"
|
|
135
|
-
:title="key"
|
|
136
|
-
@click="handleViewChange(key)"
|
|
137
|
-
/>
|
|
132
|
+
<ListItem v-for="(_, key) in views" :key="key" thin :title="key" @click="handleViewChange(key)" />
|
|
138
133
|
</Dropdown>
|
|
139
134
|
<Btn icon="calendar" thin color="gray" value="Today" @click="handleDateChange(new Date())" />
|
|
140
135
|
<Btn
|
|
141
|
-
icon="chevron_left"
|
|
142
|
-
color="gray"
|
|
143
|
-
thin
|
|
136
|
+
icon="chevron_left" color="gray" thin
|
|
144
137
|
@click="handleDateChange(timeDelta(currentDate, { [currentView]: -1 }))"
|
|
145
138
|
/>
|
|
146
139
|
<Btn
|
|
147
|
-
icon="chevron_right"
|
|
148
|
-
color="gray"
|
|
149
|
-
thin
|
|
140
|
+
icon="chevron_right" color="gray" thin
|
|
150
141
|
@click="handleDateChange(timeDelta(currentDate, { [currentView]: 1 }))"
|
|
151
142
|
/>
|
|
152
143
|
</div>
|
|
153
144
|
</div>
|
|
154
145
|
<component
|
|
155
|
-
:is="views[currentView]"
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
:week-start="weekStart"
|
|
159
|
-
@event-click="handleEventClick"
|
|
160
|
-
@event-create="handleEventCreate"
|
|
161
|
-
@event-update="handleEventUpdate"
|
|
162
|
-
@event-delete="handleEventDelete"
|
|
163
|
-
@date-change="handleDateChange"
|
|
164
|
-
@open-popover="openPopover"
|
|
146
|
+
:is="views[currentView]" :events="events" :start-date="currentDate" :week-start="weekStart"
|
|
147
|
+
@event-click="handleEventClick" @event-create="handleEventCreate" @event-update="handleEventUpdate"
|
|
148
|
+
@event-delete="handleEventDelete" @date-change="handleDateChange" @open-popover="openPopover"
|
|
165
149
|
>
|
|
166
150
|
<template #eventContent="{ event }">
|
|
167
151
|
<slot name="eventContent" :event="event" />
|
|
@@ -170,12 +154,8 @@ onMounted(() => { emit('ready', state.value) })
|
|
|
170
154
|
|
|
171
155
|
<!-- Global Popover -->
|
|
172
156
|
<CalendarPopover
|
|
173
|
-
:event="activeEvent"
|
|
174
|
-
:
|
|
175
|
-
:show="showPopover"
|
|
176
|
-
:has-event-content-slot="!!$slots.eventContent"
|
|
177
|
-
@close="closePopover"
|
|
178
|
-
@event-click="handleEventClick"
|
|
157
|
+
:event="activeEvent" :position="popoverPosition" :show="showPopover"
|
|
158
|
+
:has-event-content-slot="!!$slots.eventContent" @close="closePopover" @event-click="handleEventClick"
|
|
179
159
|
>
|
|
180
160
|
<template #eventContent="{ event }">
|
|
181
161
|
<slot name="eventContent" :event="event" />
|
|
@@ -186,9 +166,9 @@ onMounted(() => { emit('ready', state.value) })
|
|
|
186
166
|
|
|
187
167
|
<style scoped>
|
|
188
168
|
.calendar {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
height: 100%;
|
|
172
|
+
width: 100%;
|
|
193
173
|
}
|
|
194
174
|
</style>
|