@mixd-id/web-scaffold 0.1.230406342 → 0.1.230406344
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/package.json +1 -1
- package/src/components/PresetSelectorFilterItem.vue +15 -2
- package/src/widgets/Dashboard/BarChartSetting.vue +9 -9
- package/src/widgets/Dashboard/MetricSetting.vue +2 -2
- package/src/widgets/Dashboard/VirtualTableSetting.vue +3 -3
- package/src/widgets/Dashboard.vue +45 -34
- package/src/widgets/WebPageBuilder4/TreeViewItem.vue +0 -3
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
<div v-if="type === 'date'" class="flex-1 flex flex-row gap-2">
|
|
6
6
|
<div class="flex-1 flex flex-row gap-2">
|
|
7
7
|
<Dropdown v-model="value.operator"
|
|
8
|
+
:readonly="readonly"
|
|
8
9
|
:class="![ 'yesterday', 'today', 'thisWeek', 'thisMonth', 'lastMonth', 'thisYear' ].includes(value.operator) ? 'w-[100px]' : 'w-full'"
|
|
9
10
|
@change="apply">
|
|
10
11
|
<option value="=">=</option>
|
|
@@ -24,10 +25,12 @@
|
|
|
24
25
|
class="flex-1 flex flex-row gap-2">
|
|
25
26
|
<Datepicker class="flex-1"
|
|
26
27
|
mode="popup"
|
|
28
|
+
:readonly="readonly"
|
|
27
29
|
v-model="value.value"
|
|
28
30
|
@change="apply" />
|
|
29
31
|
<Datepicker v-if="value.operator === 'between'"
|
|
30
32
|
class="flex-1"
|
|
33
|
+
:readonly="readonly"
|
|
31
34
|
mode="popup"
|
|
32
35
|
v-model="value.value2"
|
|
33
36
|
@change="apply" />
|
|
@@ -38,6 +41,7 @@
|
|
|
38
41
|
<div v-else-if="type === 'number'" class="flex flex-row gap-2">
|
|
39
42
|
<Dropdown v-model="value.operator"
|
|
40
43
|
class="w-[100px]"
|
|
44
|
+
:readonly="readonly"
|
|
41
45
|
@change="apply">
|
|
42
46
|
<option value="=">=</option>
|
|
43
47
|
<option value=">">></option>
|
|
@@ -49,13 +53,16 @@
|
|
|
49
53
|
</Dropdown>
|
|
50
54
|
<Textbox v-model="value.value"
|
|
51
55
|
class="flex-1"
|
|
56
|
+
:readonly="readonly"
|
|
52
57
|
@keyup.enter="apply"
|
|
53
58
|
@blur="apply" />
|
|
54
59
|
</div>
|
|
55
60
|
|
|
56
61
|
<div v-else-if="type === 'boolean'" class="flex flex-row gap-2">
|
|
57
|
-
<Radio :name="value.key"
|
|
58
|
-
|
|
62
|
+
<Radio :name="value.key"
|
|
63
|
+
:readonly="readonly" :value="true" v-model="value.value" @change="apply">True</Radio>
|
|
64
|
+
<Radio :name="value.key"
|
|
65
|
+
:readonly="readonly" :value="false" v-model="value.value" @change="apply">False</Radio>
|
|
59
66
|
</div>
|
|
60
67
|
|
|
61
68
|
<div v-else-if="type === 'enum' && Array.isArray(cTypeParams) && cTypeParams.length > 0"
|
|
@@ -64,6 +71,7 @@
|
|
|
64
71
|
<Checkbox v-for="param in cTypeParams"
|
|
65
72
|
v-model="cValue.value"
|
|
66
73
|
class="flex-1"
|
|
74
|
+
:readonly="readonly"
|
|
67
75
|
:value="param.value"
|
|
68
76
|
@change="apply">
|
|
69
77
|
{{ param.text }}
|
|
@@ -74,11 +82,13 @@
|
|
|
74
82
|
<div v-else-if="type === 'component'">
|
|
75
83
|
<component :is="column.component"
|
|
76
84
|
:value="value"
|
|
85
|
+
:readonly="readonly"
|
|
77
86
|
@change="apply" />
|
|
78
87
|
</div>
|
|
79
88
|
|
|
80
89
|
<div v-else class="flex flex-row gap-2">
|
|
81
90
|
<Dropdown v-model="value.operator" class="w-[100px]"
|
|
91
|
+
:readonly="readonly"
|
|
82
92
|
@change="apply">
|
|
83
93
|
<option value="eq">Equal</option>
|
|
84
94
|
<option value="not">Not Equal</option>
|
|
@@ -91,6 +101,7 @@
|
|
|
91
101
|
<option value="regex">Regex</option>
|
|
92
102
|
</Dropdown>
|
|
93
103
|
<Textbox v-model="value.value"
|
|
104
|
+
:readonly="readonly"
|
|
94
105
|
class="flex-1"
|
|
95
106
|
@keyup.enter="apply"
|
|
96
107
|
@blur="apply" />
|
|
@@ -120,6 +131,8 @@ export default{
|
|
|
120
131
|
|
|
121
132
|
value: Object,
|
|
122
133
|
|
|
134
|
+
readonly: [ Boolean, Number ],
|
|
135
|
+
|
|
123
136
|
enumCache: Object,
|
|
124
137
|
|
|
125
138
|
},
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
<div class="flex-1">
|
|
31
31
|
<label class="text-primary cursor-pointer"
|
|
32
32
|
ref="xAxis"
|
|
33
|
-
@click="$refs.context1.open($refs.xAxis)">
|
|
33
|
+
@click="!readonly ? $refs.context1.open($refs.xAxis) : null">
|
|
34
34
|
{{ value.props.xAxeMultiple ? 'X Axes' : 'X Axis' }}
|
|
35
|
-
<svg class="fill-primary inline relative top-[-1px]" width="12" height="12" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"/></svg>
|
|
35
|
+
<svg v-if="!readonly" class="fill-primary inline relative top-[-1px]" width="12" height="12" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"/></svg>
|
|
36
36
|
</label>
|
|
37
37
|
<ContextMenu ref="context1">
|
|
38
38
|
<div class="flex flex-col min-w-[100px]">
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
@reorder="(from, to) => { cXAxes.splice(to, 0, cXAxes.splice(from, 1)[0]); }">
|
|
58
58
|
<template v-slot="{ item, index }">
|
|
59
59
|
<div class="flex flex-row items-center gap-2">
|
|
60
|
-
<div data-reorder v-if="cXAxes.length > 1">
|
|
60
|
+
<div data-reorder v-if="cXAxes.length > 1 && !readonly">
|
|
61
61
|
<svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M496 288H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-128H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16z"/></svg>
|
|
62
62
|
</div>
|
|
63
63
|
<div class="flex-1">
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
<div class="flex-1">
|
|
82
82
|
<label class="text-primary cursor-pointer"
|
|
83
83
|
ref="yAxis"
|
|
84
|
-
@click="$refs.context2.open($refs.yAxis)">
|
|
84
|
+
@click="!readonly ? $refs.context2.open($refs.yAxis) : null">
|
|
85
85
|
{{ value.props.yAxeMultiple ? 'Y Axes' : 'Y Axis' }}
|
|
86
|
-
<svg class="fill-primary inline relative top-[-1px]" width="12" height="12" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"/></svg>
|
|
86
|
+
<svg v-if="!readonly" class="fill-primary inline relative top-[-1px]" width="12" height="12" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"/></svg>
|
|
87
87
|
</label>
|
|
88
88
|
<ContextMenu ref="context2">
|
|
89
89
|
<div class="flex flex-col min-w-[100px]">
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
<svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M496 288H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-128H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16z"/></svg>
|
|
113
113
|
</div>
|
|
114
114
|
<div class="flex-1">
|
|
115
|
-
<Dropdown v-model="item.key">
|
|
115
|
+
<Dropdown v-model="item.key" :readonly="readonly">
|
|
116
116
|
<option v-for="column in selectedDatasourceColumns"
|
|
117
117
|
:value="column.key">
|
|
118
118
|
{{ selectedDatasource.pivot?.enabled ? column.key : column.label }}
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
</ListItem>
|
|
128
128
|
</div>
|
|
129
129
|
|
|
130
|
-
<div class="flex justify-center">
|
|
130
|
+
<div class="flex justify-center" v-if="!readonly">
|
|
131
131
|
<button type="button" class="text-primary p-3 flex flex-row items-center gap-2"
|
|
132
132
|
@click="swap">
|
|
133
133
|
<svg width="14" height="14" class="fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M449.9 39.96l-48.5 48.53C362.5 53.19 311.4 32 256 32C161.5 32 78.59 92.34 49.58 182.2c-5.438 16.81 3.797 34.88 20.61 40.28c16.97 5.5 34.86-3.812 40.3-20.59C130.9 138.5 189.4 96 256 96c37.96 0 73 14.18 100.2 37.8L311.1 178C295.1 194.8 306.8 223.4 330.4 224h146.9C487.7 223.7 496 215.3 496 204.9V59.04C496 34.99 466.9 22.95 449.9 39.96zM441.8 289.6c-16.94-5.438-34.88 3.812-40.3 20.59C381.1 373.5 322.6 416 256 416c-37.96 0-73-14.18-100.2-37.8L200 334C216.9 317.2 205.2 288.6 181.6 288H34.66C24.32 288.3 16 296.7 16 307.1v145.9c0 24.04 29.07 36.08 46.07 19.07l48.5-48.53C149.5 458.8 200.6 480 255.1 480c94.45 0 177.4-60.34 206.4-150.2C467.9 313 458.6 294.1 441.8 289.6z"/></svg>
|
|
@@ -137,12 +137,12 @@
|
|
|
137
137
|
|
|
138
138
|
<div v-if="value.props.yAxeMultiple" class="flex flex-row items-center gap-2">
|
|
139
139
|
<label class="flex-1">Use Percentage</label>
|
|
140
|
-
<Switch v-model="value.props.usePercentage" />
|
|
140
|
+
<Switch v-model="value.props.usePercentage" :readonly="readonly" />
|
|
141
141
|
</div>
|
|
142
142
|
|
|
143
143
|
<div v-if="value.props.yAxeMultiple" class="flex flex-row items-center gap-2">
|
|
144
144
|
<label class="flex-1">Stacked</label>
|
|
145
|
-
<Switch v-model="value.props.stacked" />
|
|
145
|
+
<Switch v-model="value.props.stacked" :readonly="readonly" />
|
|
146
146
|
</div>
|
|
147
147
|
|
|
148
148
|
</div>
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
|
|
59
59
|
<div class="flex flex-col gap-2">
|
|
60
60
|
<div>
|
|
61
|
-
<Checkbox v-model="value.props.column2Enabled">
|
|
61
|
+
<Checkbox v-model="value.props.column2Enabled" :disabled="readonly">
|
|
62
62
|
Compare to
|
|
63
63
|
</Checkbox>
|
|
64
64
|
</div>
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
</div>
|
|
88
88
|
</div>
|
|
89
89
|
|
|
90
|
-
<div v-if="value.props.column2Enabled" class="flex justify-center p-3">
|
|
90
|
+
<div v-if="value.props.column2Enabled && !readonly" class="flex justify-center p-3">
|
|
91
91
|
<button type="button" class="text-primary" @click="swap">
|
|
92
92
|
<svg width="14" height="14" class="fill-primary inline" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M449.9 39.96l-48.5 48.53C362.5 53.19 311.4 32 256 32C161.5 32 78.59 92.34 49.58 182.2c-5.438 16.81 3.797 34.88 20.61 40.28c16.97 5.5 34.86-3.812 40.3-20.59C130.9 138.5 189.4 96 256 96c37.96 0 73 14.18 100.2 37.8L311.1 178C295.1 194.8 306.8 223.4 330.4 224h146.9C487.7 223.7 496 215.3 496 204.9V59.04C496 34.99 466.9 22.95 449.9 39.96zM441.8 289.6c-16.94-5.438-34.88 3.812-40.3 20.59C381.1 373.5 322.6 416 256 416c-37.96 0-73-14.18-100.2-37.8L200 334C216.9 317.2 205.2 288.6 181.6 288H34.66C24.32 288.3 16 296.7 16 307.1v145.9c0 24.04 29.07 36.08 46.07 19.07l48.5-48.53C149.5 458.8 200.6 480 255.1 480c94.45 0 177.4-60.34 206.4-150.2C467.9 313 458.6 294.1 441.8 289.6z"/></svg>
|
|
93
93
|
Swap
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
<template #item="{ item }">
|
|
49
49
|
<div class="flex-1 flex flex-row gap-2 items-center p-1 px-3">
|
|
50
50
|
<div>
|
|
51
|
-
<Checkbox v-model="item.visible" default="true" />
|
|
51
|
+
<Checkbox v-model="item.visible" default="true" :disabled="readonly" />
|
|
52
52
|
</div>
|
|
53
|
-
<Textbox v-model="item.label2" :placeholder="item.label"
|
|
54
|
-
class="border-none bg-transparent" :class="$style.columnTextbox"
|
|
53
|
+
<Textbox v-model="item.label2" :placeholder="item.label" :readonly="readonly"
|
|
54
|
+
class="flex-1 border-none bg-transparent" :class="$style.columnTextbox"
|
|
55
55
|
item-class="p-1 px-0" />
|
|
56
56
|
</div>
|
|
57
57
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div v-if="cConfig" :class="$style.comp">
|
|
2
|
+
<div v-if="cConfig && cConfig?.presets" :class="$style.comp">
|
|
3
3
|
|
|
4
4
|
<div class="relative flex flex-col border-r-[1px] border-text-50 panel-400 overflow-hidden"
|
|
5
5
|
:style="sidebarStyle">
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
<div v-for="(filter, idx) in selectedDatasource.filters" class="p-5 py-8">
|
|
79
79
|
|
|
80
80
|
<div class="flex flex-row items-start">
|
|
81
|
-
<Checkbox v-model="filter.enabled" :default="true" @change="onDatasourceFilterChanged"/>
|
|
81
|
+
<Checkbox v-model="filter.enabled" :disabled="selectedPreset.readonly" :default="true" @change="onDatasourceFilterChanged"/>
|
|
82
82
|
<div class="flex-1 flex flex-col gap-3">
|
|
83
83
|
<div class="flex-1 flex flex-row gap-2">
|
|
84
84
|
<strong class="flex-1 cursor-pointer" @click="filter._collapsed = !filter._collapsed">
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
<option value="and">And</option>
|
|
95
95
|
<option value="or">Or</option>
|
|
96
96
|
</select>
|
|
97
|
-
<button v-if="typeOf(selectedDatasourceColumn(filter.key).type) !== 'enum' && filter._collapsed !== true" type="button" @click="filter.value.push({})">
|
|
97
|
+
<button v-if="!selectedPreset.readonly && typeOf(selectedDatasourceColumn(filter.key).type) !== 'enum' && filter._collapsed !== true" type="button" @click="filter.value.push({})">
|
|
98
98
|
<svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M432 256C432 269.3 421.3 280 408 280h-160v160c0 13.25-10.75 24.01-24 24.01S200 453.3 200 440v-160h-160c-13.25 0-24-10.74-24-23.99C16 242.8 26.75 232 40 232h160v-160c0-13.25 10.75-23.99 24-23.99S248 58.75 248 72v160h160C421.3 232 432 242.8 432 256z"/></svg>
|
|
99
99
|
</button>
|
|
100
|
-
<button type="button" class="p-1" @click="selectedDatasource.filters.splice(idx, 1);onDatasourceFilterChanged()">
|
|
100
|
+
<button v-if="!selectedPreset.readonly" type="button" class="p-1" @click="selectedDatasource.filters.splice(idx, 1);onDatasourceFilterChanged()">
|
|
101
101
|
<svg width="14" height="14" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"/></svg>
|
|
102
102
|
</button>
|
|
103
103
|
</div>
|
|
@@ -111,9 +111,10 @@
|
|
|
111
111
|
:typeParams="typeParamsOf(selectedDatasourceColumn(filter.key))"
|
|
112
112
|
:value="filterVal"
|
|
113
113
|
:enumCache="enumCache"
|
|
114
|
+
:readonly="selectedPreset.readonly"
|
|
114
115
|
@change="onDatasourceFilterChanged" />
|
|
115
116
|
|
|
116
|
-
<button v-if="filter.value.length > 1"
|
|
117
|
+
<button v-if="filter.value.length > 1 && !selectedPreset.readonly"
|
|
117
118
|
type="button"
|
|
118
119
|
class="p-1"
|
|
119
120
|
@click="filter.value.splice(filterIdx, 1);onDatasourceFilterChanged()">
|
|
@@ -126,6 +127,7 @@
|
|
|
126
127
|
:type="typeOf(selectedDatasourceColumn(filter.key).type)"
|
|
127
128
|
:value="filter"
|
|
128
129
|
:enumCache="enumCache"
|
|
130
|
+
:readonly="selectedPreset.readonly"
|
|
129
131
|
@change="onDatasourceFilterChanged" />
|
|
130
132
|
</div>
|
|
131
133
|
</div>
|
|
@@ -133,7 +135,7 @@
|
|
|
133
135
|
|
|
134
136
|
</div>
|
|
135
137
|
|
|
136
|
-
<div class="py-8 flex justify-center">
|
|
138
|
+
<div class="py-8 flex justify-center" v-if="!selectedPreset.readonly">
|
|
137
139
|
<button type="button"
|
|
138
140
|
class="text-primary flex flex-row items-center justify-center p-3"
|
|
139
141
|
@click="$refs.columnSelector.open(addFilter, selectedDatasourceFilterColumns)">
|
|
@@ -151,11 +153,12 @@
|
|
|
151
153
|
container-class="flex flex-col rounded-lg border-[1px] border-text-50 bg-base-300 divide-y divide-text-50">
|
|
152
154
|
<template v-slot="{ item, index }">
|
|
153
155
|
<div class="flex flex-row items-center gap-3 p-1">
|
|
154
|
-
<div data-reorder>
|
|
156
|
+
<div data-reorder v-if="!selectedPreset.readonly">
|
|
155
157
|
<svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M496 288H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-128H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16z"/></svg>
|
|
156
158
|
</div>
|
|
157
159
|
<div class="flex-1 flex flex-row gap-3">
|
|
158
160
|
<Dropdown class="flex-1"
|
|
161
|
+
:readonly="selectedPreset.readonly"
|
|
159
162
|
v-model="item.key"
|
|
160
163
|
@change="">
|
|
161
164
|
<option v-for="column in selectedDatasourceSortColumns"
|
|
@@ -164,28 +167,27 @@
|
|
|
164
167
|
</option>
|
|
165
168
|
</Dropdown>
|
|
166
169
|
<div class="flex flex-row">
|
|
167
|
-
<Radio v-model="item.type" value="asc" @change="" custom="true">
|
|
170
|
+
<Radio v-model="item.type" value="asc" @change="" custom="true" :disabled="selectedPreset.readonly">
|
|
168
171
|
<button type="button" class="p-1" :class="item.type === 'asc' ? 'bg-primary' : ''">
|
|
169
172
|
<svg width="14" height="14" :class="item.type === 'asc' ? 'fill-white' : 'fill-text'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M439.1 432H377.1l81.87-105.3c5.625-7.25 6.656-17.06 2.625-25.28C457.5 293.2 449.1 288 439.1 288h-111.1c-13.25 0-23.1 10.75-23.1 24s10.75 24 23.1 24h62.94L309.1 441.3c-5.623 7.25-6.654 17.06-2.625 25.28C310.5 474.8 318.8 480 327.1 480h111.1c13.25 0 23.1-10.75 23.1-24S453.2 432 439.1 432zM477.5 189.3l-71.1-144c-8.123-16.31-34.81-16.31-42.94 0l-71.1 144c-5.938 11.84-1.125 26.25 10.75 32.19c11.9 5.938 26.25 1.156 32.19-10.75L338.8 200h90.34l5.359 10.72C438.7 219.2 447.2 224 456 224c3.594 0 7.25-.8125 10.69-2.531C478.6 215.5 483.4 201.1 477.5 189.3zM362.8 152l21.17-42.34L405.2 152H362.8zM206.4 335.1L152 394.9V56.02c0-13.27-10.75-24.02-24-24.02S104 42.76 104 56.02v338.9l-54.37-58.95c-4.719-5.125-11.16-7.719-17.62-7.719c-5.812 0-11.66 2.094-16.28 6.375c-9.75 8.977-10.34 24.18-1.344 33.94l95.1 104.1c9.062 9.82 26.19 9.82 35.25 0l95.1-104.1c9-9.758 8.406-24.96-1.344-33.94C230.5 325.5 215.3 326.2 206.4 335.1z"/></svg>
|
|
170
173
|
</button>
|
|
171
174
|
</Radio>
|
|
172
|
-
<Radio v-model="item.type" value="desc" @change="" custom="true">
|
|
175
|
+
<Radio v-model="item.type" value="desc" @change="" custom="true" :disabled="selectedPreset.readonly">
|
|
173
176
|
<button type="button" class="p-1" :class="item.type === 'desc' ? 'bg-primary' : ''">
|
|
174
177
|
<svg width="14" height="14" :class="item.type === 'desc' ? 'fill-white' : 'fill-text'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M327.1 80h62.94L309.1 185.2c-5.623 7.25-6.654 17.06-2.625 25.28c4.031 8.25 12.41 13.47 21.56 13.47h111.1c13.25 0 23.1-10.75 23.1-24s-10.75-24-23.1-24H377.1l81.87-105.2c5.625-7.25 6.656-17.06 2.625-25.28C457.5 37.22 449.1 32 439.1 32h-111.1c-13.25 0-23.1 10.75-23.1 24S314.7 80 327.1 80zM477.5 445.3l-71.1-144c-8.123-16.3-34.81-16.3-42.94 0l-71.1 144c-5.938 11.84-1.125 26.25 10.75 32.19c11.9 5.938 26.25 1.156 32.19-10.75l5.359-10.72h90.34l5.359 10.72c4.219 8.438 12.69 13.28 21.5 13.28c3.594 0 7.25-.8125 10.69-2.531C478.6 471.5 483.4 457.1 477.5 445.3zM362.8 407.1l21.17-42.34l21.17 42.34H362.8zM206.4 335.1L152 394.9V56.02c0-13.27-10.75-24.02-24-24.02S104 42.76 104 56.02v338.9l-54.37-58.95c-4.719-5.125-11.16-7.719-17.62-7.719c-5.812 0-11.66 2.094-16.28 6.375c-9.75 8.977-10.34 24.18-1.344 33.94l95.1 104.1c9.062 9.82 26.19 9.82 35.25 0l95.1-104.1c9-9.758 8.406-24.96-1.344-33.94C230.5 325.5 215.3 326.2 206.4 335.1z"/></svg>
|
|
175
178
|
</button>
|
|
176
179
|
</Radio>
|
|
177
180
|
</div>
|
|
178
181
|
</div>
|
|
179
|
-
<
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
</button>
|
|
183
|
-
</div>
|
|
182
|
+
<button v-if="!selectedPreset.readonly" type="button" @click="selectedDatasource.sorts.splice(index, 1); ">
|
|
183
|
+
<svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"/></svg>
|
|
184
|
+
</button>
|
|
184
185
|
</div>
|
|
185
186
|
</template>
|
|
186
187
|
</ListItem>
|
|
187
188
|
|
|
188
189
|
<button type="button"
|
|
190
|
+
v-if="!selectedPreset.readonly"
|
|
189
191
|
class="text-primary flex flex-row items-center justify-center p-3"
|
|
190
192
|
@click="addSort({ type:'asc' })">
|
|
191
193
|
<svg width="16" height="16" class="fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M432 256C432 269.3 421.3 280 408 280h-160v160c0 13.25-10.75 24.01-24 24.01S200 453.3 200 440v-160h-160c-13.25 0-24-10.74-24-23.99C16 242.8 26.75 232 40 232h160v-160c0-13.25 10.75-23.99 24-23.99S248 58.75 248 72v160h160C421.3 232 432 242.8 432 256z"/></svg>
|
|
@@ -197,7 +199,7 @@
|
|
|
197
199
|
<div v-else-if="selectedDatasource.tabIndex === 4" class="p-5 flex-1 flex flex-col gap-5">
|
|
198
200
|
<div>
|
|
199
201
|
<Checkbox v-model="selectedDatasourcePivot.enabled"
|
|
200
|
-
@change="">
|
|
202
|
+
@change="" :disabled="selectedPreset.readonly">
|
|
201
203
|
Pivot Enabled
|
|
202
204
|
</Checkbox>
|
|
203
205
|
</div>
|
|
@@ -207,7 +209,7 @@
|
|
|
207
209
|
<div>
|
|
208
210
|
<div class="flex flex-row items-center gap-2">
|
|
209
211
|
<label>Groups</label>
|
|
210
|
-
<button type="button" @click="$refs.columnSelector.open(obj => addPivot('rows', obj), selectedDatasourcePivotColumns)">
|
|
212
|
+
<button v-if="!selectedPreset.readonly" type="button" @click="$refs.columnSelector.open(obj => addPivot('rows', obj), selectedDatasourcePivotColumns)">
|
|
211
213
|
<svg width="16" height="16" class="fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M432 256C432 269.3 421.3 280 408 280h-160v160c0 13.25-10.75 24.01-24 24.01S200 453.3 200 440v-160h-160c-13.25 0-24-10.74-24-23.99C16 242.8 26.75 232 40 232h160v-160c0-13.25 10.75-23.99 24-23.99S248 58.75 248 72v160h160C421.3 232 432 242.8 432 256z"/></svg>
|
|
212
214
|
</button>
|
|
213
215
|
</div>
|
|
@@ -217,12 +219,12 @@
|
|
|
217
219
|
container-class="divide-y divide-text-50">
|
|
218
220
|
<template v-slot="{ item, index }">
|
|
219
221
|
<div class="flex flex-row items-center gap-3 p-2 bg-base-500 hover:bg-primary-100 first:rounded-t-md last:rounded-b-md">
|
|
220
|
-
<div data-reorder v-if="(selectedDatasourcePivot.rows ?? []).length > 1">
|
|
222
|
+
<div data-reorder v-if="(selectedDatasourcePivot.rows ?? []).length > 1 && !selectedPreset.readonly">
|
|
221
223
|
<svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M496 288H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-128H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16z"/></svg>
|
|
222
224
|
</div>
|
|
223
225
|
<div class="flex-1 flex flex-row gap-3">
|
|
224
226
|
<strong class="flex-1 cursor-pointer text-ellipsis overflow-hidden whitespace-nowrap"
|
|
225
|
-
@click="$refs.columnSelector.open(obj => { Object.assign(item, obj); }, selectedDatasourcePivotColumns);">
|
|
227
|
+
@click="!selectedPreset.readonly ? $refs.columnSelector.open(obj => { Object.assign(item, obj); }, selectedDatasourcePivotColumns) : null;">
|
|
226
228
|
{{ item.label ? item.label : item.key }}
|
|
227
229
|
</strong>
|
|
228
230
|
<select v-if="item.type === 'date'"
|
|
@@ -235,7 +237,7 @@
|
|
|
235
237
|
<option value="year">Year</option>
|
|
236
238
|
</select>
|
|
237
239
|
</div>
|
|
238
|
-
<button type="button" @click="selectedDatasourcePivot.rows.splice(index, 1); loadPivotData()">
|
|
240
|
+
<button v-if="!selectedPreset.readonly" type="button" @click="selectedDatasourcePivot.rows.splice(index, 1); loadPivotData()">
|
|
239
241
|
<svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"/></svg>
|
|
240
242
|
</button>
|
|
241
243
|
</div>
|
|
@@ -246,7 +248,7 @@
|
|
|
246
248
|
<div>
|
|
247
249
|
<div class="flex flex-row items-center gap-2">
|
|
248
250
|
<label>Aggregrates</label>
|
|
249
|
-
<button type="button" @click="$refs.columnSelector.open(obj => addPivot('values', obj), selectedDatasourcePivotColumns)">
|
|
251
|
+
<button v-if="!selectedPreset.readonly" type="button" @click="$refs.columnSelector.open(obj => addPivot('values', obj), selectedDatasourcePivotColumns)">
|
|
250
252
|
<svg width="16" height="16" class="fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M432 256C432 269.3 421.3 280 408 280h-160v160c0 13.25-10.75 24.01-24 24.01S200 453.3 200 440v-160h-160c-13.25 0-24-10.74-24-23.99C16 242.8 26.75 232 40 232h160v-160c0-13.25 10.75-23.99 24-23.99S248 58.75 248 72v160h160C421.3 232 432 242.8 432 256z"/></svg>
|
|
251
253
|
</button>
|
|
252
254
|
</div>
|
|
@@ -256,15 +258,16 @@
|
|
|
256
258
|
container-class="divide-y divide-text-50">
|
|
257
259
|
<template v-slot="{ item, index }">
|
|
258
260
|
<div class="flex flex-row items-center gap-3 p-2 bg-base-500 hover:bg-primary-100 first:rounded-t-md last:rounded-b-md">
|
|
259
|
-
<div data-reorder v-if="(selectedDatasourcePivot.values ?? []).length > 1">
|
|
261
|
+
<div data-reorder v-if="(selectedDatasourcePivot.values ?? []).length > 1 && !selectedPreset.readonly">
|
|
260
262
|
<svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M496 288H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-128H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16z"/></svg>
|
|
261
263
|
</div>
|
|
262
264
|
<div class="flex-1 flex flex-row gap-3">
|
|
263
265
|
<strong class="flex-1 cursor-pointer text-ellipsis overflow-hidden whitespace-nowrap"
|
|
264
|
-
@click="$refs.columnSelector.open(obj => { Object.assign(item, obj); }, selectedDatasourcePivotColumns);">
|
|
266
|
+
@click="!selectedPreset.readonly ? $refs.columnSelector.open(obj => { Object.assign(item, obj); }, selectedDatasourcePivotColumns) : null;">
|
|
265
267
|
{{ item.label ? item.label : item.key }}
|
|
266
268
|
</strong>
|
|
267
269
|
<select v-model="item.aggregrate"
|
|
270
|
+
:disabled="selectedPreset.readonly"
|
|
268
271
|
class="px-1 appearance-none bg-base-300 w-[80px] rounded-md border-[1px] border-text-50 outline-none"
|
|
269
272
|
@change="loadPivotData">
|
|
270
273
|
<option value="">Default</option>
|
|
@@ -276,7 +279,7 @@
|
|
|
276
279
|
<option v-if="[ 'number' ].includes(item.type)" value="max">Max</option>
|
|
277
280
|
</select>
|
|
278
281
|
</div>
|
|
279
|
-
<button type="button" @click="selectedDatasourcePivot.values.splice(index, 1); loadPivotData()">
|
|
282
|
+
<button v-if="!selectedPreset.readonly" type="button" @click="selectedDatasourcePivot.values.splice(index, 1); loadPivotData()">
|
|
280
283
|
<svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"/></svg>
|
|
281
284
|
</button>
|
|
282
285
|
</div>
|
|
@@ -287,7 +290,7 @@
|
|
|
287
290
|
<div>
|
|
288
291
|
<div class="flex flex-row items-center gap-2">
|
|
289
292
|
<label class="flex-1">Columns</label>
|
|
290
|
-
<button v-if="selectedDatasourcePivot.manualColumns"
|
|
293
|
+
<button v-if="selectedDatasourcePivot.manualColumns && !selectedPreset.readonly"
|
|
291
294
|
type="button"
|
|
292
295
|
class="text-primary"
|
|
293
296
|
@click="delete selectedDatasourcePivot.manualColumns; ">Reset</button>
|
|
@@ -298,17 +301,17 @@
|
|
|
298
301
|
container-class="divide-y divide-text-50">
|
|
299
302
|
<template v-slot="{ item, index }">
|
|
300
303
|
<div class="flex flex-row gap-2 items-center px-2 bg-base-500">
|
|
301
|
-
<div data-reorder>
|
|
304
|
+
<div data-reorder v-if="!selectedPreset.readonly">
|
|
302
305
|
<svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M496 288H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-128H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16z"/></svg>
|
|
303
306
|
</div>
|
|
304
|
-
<Textbox class="flex-1 border-none" :class="$style.columnTextbox" v-model="item.label2" :placeholder="item.label"
|
|
307
|
+
<Textbox class="flex-1 border-none" :readonly="selectedPreset.readonly" :class="$style.columnTextbox" v-model="item.label2" :placeholder="item.label"
|
|
305
308
|
item-class="p-1"/>
|
|
306
|
-
<button type="button" v-if="[ 'number' ].includes(item.type)" @click="">
|
|
309
|
+
<button type="button" v-if="[ 'number' ].includes(item.type) && !selectedPreset.readonly" @click="">
|
|
307
310
|
<svg width="13" height="13" :class="(item.appearances ?? []).length > 0 ? 'fill-primary' : 'fill-text-300 hover:fill-primary'"
|
|
308
311
|
@click="$refs.presetBarPivotColumnEdit.open(item, next => { Object.assign(item, next); })"
|
|
309
312
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M176 0h-128C21.49 0 0 21.49 0 48v128C0 202.5 21.49 224 48 224h128C202.5 224 224 202.5 224 176v-128C224 21.49 202.5 0 176 0zM176 288h-128C21.49 288 0 309.5 0 336v128C0 490.5 21.49 512 48 512h128C202.5 512 224 490.5 224 464v-128C224 309.5 202.5 288 176 288zM464 0h-128C309.5 0 288 21.49 288 48v128C288 202.5 309.5 224 336 224h128C490.5 224 512 202.5 512 176v-128C512 21.49 490.5 0 464 0zM488 376h-64v-64C424 298.8 413.3 288 400 288s-24 10.75-24 24v64h-64c-13.25 0-24 10.75-24 24s10.75 24 24 24h64v64c0 13.25 10.75 24 24 24s24-10.75 24-24v-64h64c13.25 0 24-10.75 24-24S501.3 376 488 376z"/></svg>
|
|
310
313
|
</button>
|
|
311
|
-
<button type="button" @click="selectedDatasourcePivot.columns.splice(index, 1); selectedDatasourcePivot.manualColumns = true; ">
|
|
314
|
+
<button v-if="!selectedPreset.readonly" type="button" @click="selectedDatasourcePivot.columns.splice(index, 1); selectedDatasourcePivot.manualColumns = true; ">
|
|
312
315
|
<svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"/></svg>
|
|
313
316
|
</button>
|
|
314
317
|
</div>
|
|
@@ -320,7 +323,7 @@
|
|
|
320
323
|
|
|
321
324
|
<div class="flex flex-row items-center gap-3">
|
|
322
325
|
<label>Total</label>
|
|
323
|
-
<Switch v-model="selectedDatasourcePivot.useTotal" @change=""/>
|
|
326
|
+
<Switch v-model="selectedDatasourcePivot.useTotal" :readonly="selectedPreset.readonly" @change=""/>
|
|
324
327
|
</div>
|
|
325
328
|
|
|
326
329
|
</div>
|
|
@@ -383,7 +386,7 @@
|
|
|
383
386
|
Edit
|
|
384
387
|
</button>
|
|
385
388
|
|
|
386
|
-
<button class="w-full p-3 text-left flex flex-row items-center" :class="appStyle.menuItem"
|
|
389
|
+
<button v-if="!selectedPreset.readonly" class="w-full p-3 text-left flex flex-row items-center" :class="appStyle.menuItem"
|
|
387
390
|
@click="duplicateDatasource(context.index)">
|
|
388
391
|
<div class="w-[30px]">
|
|
389
392
|
<svg width="16" height="16" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M502.6 70.63l-61.25-61.25C435.4 3.371 427.2 0 418.7 0H255.1c-35.35 0-64 28.66-64 64l.0195 256C192 355.4 220.7 384 256 384h192c35.2 0 64-28.8 64-64V93.25C512 84.77 508.6 76.63 502.6 70.63zM464 320c0 8.836-7.164 16-16 16H255.1c-8.838 0-16-7.164-16-16L239.1 64.13c0-8.836 7.164-16 16-16h128L384 96c0 17.67 14.33 32 32 32h47.1V320zM272 448c0 8.836-7.164 16-16 16H63.1c-8.838 0-16-7.164-16-16L47.98 192.1c0-8.836 7.164-16 16-16H160V128H63.99c-35.35 0-64 28.65-64 64l.0098 256C.002 483.3 28.66 512 64 512h192c35.2 0 64-28.8 64-64v-32h-47.1L272 448z"/></svg>
|
|
@@ -391,7 +394,7 @@
|
|
|
391
394
|
Duplicate
|
|
392
395
|
</button>
|
|
393
396
|
|
|
394
|
-
<button class="w-full p-3 text-left flex flex-row items-center" :class="appStyle.menuItem"
|
|
397
|
+
<button v-if="!selectedPreset.readonly" class="w-full p-3 text-left flex flex-row items-center" :class="appStyle.menuItem"
|
|
395
398
|
@click="removeDatasource(context.index)">
|
|
396
399
|
<div class="w-[30px]">
|
|
397
400
|
<svg width="16" height="16" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"/></svg>
|
|
@@ -643,7 +646,11 @@
|
|
|
643
646
|
@mousedown="(e) => $util.dragResize(e, resize1)"></div>
|
|
644
647
|
</div>
|
|
645
648
|
|
|
646
|
-
<div v-if="
|
|
649
|
+
<div v-if="readyState === 0" class="flex-1 flex items-center justify-center">
|
|
650
|
+
<svg class="animate-spin aspect-square w-[64px] h-[64px]" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>
|
|
651
|
+
</div>
|
|
652
|
+
|
|
653
|
+
<div v-else-if="viewedPreset" class="flex-1 px-8 py-5 overflow-y-auto flex flex-col gap-6">
|
|
647
654
|
|
|
648
655
|
<div class="flex flex-row gap-2 md:gap-2 items-center" ref="title">
|
|
649
656
|
<button type="button"
|
|
@@ -715,6 +722,7 @@
|
|
|
715
722
|
<DatasourcePreview ref="datasourcePreview" :src="previewSrc" />
|
|
716
723
|
|
|
717
724
|
</div>
|
|
725
|
+
<div v-else>{{ $t('Loading...') }}</div>
|
|
718
726
|
</template>
|
|
719
727
|
|
|
720
728
|
<script>
|
|
@@ -936,6 +944,8 @@ export default{
|
|
|
936
944
|
|
|
937
945
|
previewData: null,
|
|
938
946
|
|
|
947
|
+
readyState: 0,
|
|
948
|
+
|
|
939
949
|
selectedViewUid: null,
|
|
940
950
|
|
|
941
951
|
viewTypes: [
|
|
@@ -1207,6 +1217,7 @@ export default{
|
|
|
1207
1217
|
this.socket.send(this.src, { views })
|
|
1208
1218
|
.then(_ => {
|
|
1209
1219
|
Object.assign(this.values, _)
|
|
1220
|
+
this.readyState = 1
|
|
1210
1221
|
})
|
|
1211
1222
|
},
|
|
1212
1223
|
|
|
@@ -1335,7 +1346,7 @@ export default{
|
|
|
1335
1346
|
watch: {
|
|
1336
1347
|
|
|
1337
1348
|
'cConfig.presets'(){
|
|
1338
|
-
this.cConfig.selectedUid = 'edit' in this.$route.query ? this.$route.query.edit :
|
|
1349
|
+
this.cConfig.selectedUid = 'edit' in this.$route.query ? this.$route.query.edit : false
|
|
1339
1350
|
this.cConfig.viewedUid = 'uid' in this.$route.query ? this.$route.query.uid : this.cConfig.viewedUid
|
|
1340
1351
|
},
|
|
1341
1352
|
|
|
@@ -1347,7 +1358,7 @@ export default{
|
|
|
1347
1358
|
immediate: true,
|
|
1348
1359
|
handler(to){
|
|
1349
1360
|
if(this.cConfig){
|
|
1350
|
-
this.cConfig.selectedUid = 'edit' in to ? to.edit :
|
|
1361
|
+
this.cConfig.selectedUid = 'edit' in to ? to.edit : false
|
|
1351
1362
|
this.cConfig.viewedUid = 'uid' in to ? to.uid : this.cConfig.viewedUid
|
|
1352
1363
|
}
|
|
1353
1364
|
}
|
|
@@ -88,7 +88,6 @@ export default{
|
|
|
88
88
|
|
|
89
89
|
hoverMouseOver(e){
|
|
90
90
|
if(!dragged) return
|
|
91
|
-
console.log(this.item.uid, dragged.item.uid)
|
|
92
91
|
if(this.item.uid === dragged.item.uid) return
|
|
93
92
|
|
|
94
93
|
// Drag to own child is not allowed
|
|
@@ -210,8 +209,6 @@ export default{
|
|
|
210
209
|
|
|
211
210
|
if(dragged && dragged.parent && dragged.targetParent){
|
|
212
211
|
|
|
213
|
-
console.log(dragged, dragged.parent, dragged.targetParent)
|
|
214
|
-
|
|
215
212
|
const targetIdx = dragged.targetParent.indexOf(dragged.target)
|
|
216
213
|
const moveDirection = e.clientY < dragged.startY ? -1 : 1
|
|
217
214
|
const sameParent = dragged.parent === dragged.targetParent
|