@dataloop-ai/components 0.18.124 → 0.18.126
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/compound/DlInput/DlInput.vue +3 -4
- package/src/components/compound/DlSelect/DlSelect.vue +4 -6
- package/src/components/compound/DlTable/hooks/tablePagination.ts +3 -2
- package/src/components/compound/DlTable/types.ts +3 -7
- package/src/demos/DlCodeEditor/DlCodeEditorDemo.vue +138 -168
- package/src/demos/DlInputDemo.vue +37 -0
- package/src/demos/DlSelectDemo.vue +75 -0
- package/src/demos/DlTableDemo.vue +5 -3
package/package.json
CHANGED
|
@@ -731,11 +731,10 @@ export default defineComponent({
|
|
|
731
731
|
display: flex;
|
|
732
732
|
align-items: center;
|
|
733
733
|
|
|
734
|
+
&--small,
|
|
734
735
|
&--s {
|
|
735
|
-
margin:
|
|
736
|
-
|
|
737
|
-
&--small {
|
|
738
|
-
margin: 4px auto auto;
|
|
736
|
+
margin-bottom: 0;
|
|
737
|
+
margin-right: 4px;
|
|
739
738
|
}
|
|
740
739
|
}
|
|
741
740
|
|
|
@@ -917,10 +917,7 @@ export default defineComponent({
|
|
|
917
917
|
<style scoped lang="scss">
|
|
918
918
|
.root-container {
|
|
919
919
|
width: var(--dl-select-width);
|
|
920
|
-
&--s
|
|
921
|
-
display: flex;
|
|
922
|
-
align-items: center;
|
|
923
|
-
}
|
|
920
|
+
&--s,
|
|
924
921
|
&--small {
|
|
925
922
|
display: flex;
|
|
926
923
|
align-items: center;
|
|
@@ -935,9 +932,10 @@ export default defineComponent({
|
|
|
935
932
|
align-items: center;
|
|
936
933
|
color: var(--dl-color-lighter);
|
|
937
934
|
|
|
935
|
+
&--s,
|
|
938
936
|
&--small {
|
|
939
|
-
margin-
|
|
940
|
-
margin-
|
|
937
|
+
margin-bottom: 0;
|
|
938
|
+
margin-right: 4px;
|
|
941
939
|
}
|
|
942
940
|
}
|
|
943
941
|
|
|
@@ -16,7 +16,7 @@ export type TablePagination = {
|
|
|
16
16
|
page?: number
|
|
17
17
|
rowsPerPage?: number
|
|
18
18
|
rowsNumber?: number
|
|
19
|
-
|
|
19
|
+
maxDisplayRange?: number
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
function samePagination(oldPag: TablePagination, newPag: TablePagination) {
|
|
@@ -69,7 +69,8 @@ export function useTablePaginationState(
|
|
|
69
69
|
? rowsPerPageOptions.value[0]
|
|
70
70
|
: 5,
|
|
71
71
|
min: 1,
|
|
72
|
-
|
|
72
|
+
// todo: calculate based on width of element
|
|
73
|
+
maxDisplayRange: 7,
|
|
73
74
|
boundaryNumbers: true,
|
|
74
75
|
boundaryLinks: true,
|
|
75
76
|
directionLinks: true,
|
|
@@ -50,13 +50,9 @@ export type DlTableSortMethod = (
|
|
|
50
50
|
descending: boolean
|
|
51
51
|
) => DlTableRow[]
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
rowsNumber?: number
|
|
57
|
-
sortBy?: string | null
|
|
58
|
-
descending?: boolean
|
|
59
|
-
}
|
|
53
|
+
import { TablePagination } from './hooks/tablePagination'
|
|
54
|
+
|
|
55
|
+
export type DlTablePagination = TablePagination
|
|
60
56
|
|
|
61
57
|
export type DlTableRequestProp = {
|
|
62
58
|
pagination: DlTablePagination
|
|
@@ -37,174 +37,144 @@ export default defineComponent({
|
|
|
37
37
|
const lines = ref(false)
|
|
38
38
|
|
|
39
39
|
const codeEditorValue = ref(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
' targets=[flashBladeRep])\n' +
|
|
179
|
-
' else:\n' +
|
|
180
|
-
' # create a snapshot without suffix and replicate to target array\n' +
|
|
181
|
-
' res = fb.file_system_snapshots.create_file_system_snapshots(sources=[fs],\n' +
|
|
182
|
-
' send=True,\n' +
|
|
183
|
-
' targets=[flashBladeRep])\n' +
|
|
184
|
-
' else:\n' +
|
|
185
|
-
' if suffix:\n' +
|
|
186
|
-
' # create a snapshot with suffix for the file system\n' +
|
|
187
|
-
' res = fb.file_system_snapshots.create_file_system_snapshots(sources=[fs],\n' +
|
|
188
|
-
' suffix=SnapshotSuffix(suffix))\n' +
|
|
189
|
-
' else:\n' +
|
|
190
|
-
' # create a snapshot without suffix for the file system\n' +
|
|
191
|
-
' res = fb.file_system_snapshots.create_file_system_snapshots(sources=[fs])\n' +
|
|
192
|
-
' \n' +
|
|
193
|
-
' if VERBOSE_FLAG:\n' +
|
|
194
|
-
' print(res)\n' +
|
|
195
|
-
' \n' +
|
|
196
|
-
" print('Snapshot created for', fs, 'suffix', res.items[0].suffix) \n" +
|
|
197
|
-
'\n' +
|
|
198
|
-
' except rest.ApiException as e:\n' +
|
|
199
|
-
' print("Exception when creating file system snapshots: %s\\n" % e) \n' +
|
|
200
|
-
'\n' +
|
|
201
|
-
' fb.logout()\n' +
|
|
202
|
-
' print(BANNER)\n' +
|
|
203
|
-
" print(strftime('%d/%m/%Y %H:%M:%S %Z', gmtime()))\n" +
|
|
204
|
-
' print(BANNER)\n' +
|
|
205
|
-
' sys.exit(exit_code)\n' +
|
|
206
|
-
'\n' +
|
|
207
|
-
'main()'
|
|
40
|
+
`import getopt, sys, urllib, time
|
|
41
|
+
|
|
42
|
+
def main():
|
|
43
|
+
|
|
44
|
+
status = 0
|
|
45
|
+
|
|
46
|
+
# input arguments
|
|
47
|
+
|
|
48
|
+
try:
|
|
49
|
+
opts, args = getopt.getopt(sys.argv[1:],"h:iq",
|
|
50
|
+
["help","invid=","quarter="])
|
|
51
|
+
except getopt.GetoptError:
|
|
52
|
+
usage()
|
|
53
|
+
tree = False
|
|
54
|
+
for o, a in opts:
|
|
55
|
+
if o in ("-h", "--help"):
|
|
56
|
+
usage()
|
|
57
|
+
if o in ("-i", "--invid"):
|
|
58
|
+
invid = str(a)
|
|
59
|
+
if o in ("-q", "--quarter"):
|
|
60
|
+
quarter = int(a)
|
|
61
|
+
|
|
62
|
+
kepid, invid, kepmag, mode, start, stop, release = GetMetaData(invid,quarter)
|
|
63
|
+
|
|
64
|
+
# convert Gregorian date to Julian date
|
|
65
|
+
|
|
66
|
+
def Greg2JD(year, month, day):
|
|
67
|
+
|
|
68
|
+
if (month < 3):
|
|
69
|
+
y = float(year) - 1.0
|
|
70
|
+
m = float(month) + 12.0
|
|
71
|
+
else:
|
|
72
|
+
y = float(year)
|
|
73
|
+
m = float(month)
|
|
74
|
+
a = 0; b = 0
|
|
75
|
+
if (y + m / 12 + float(day) / 365 > 1582.87166):
|
|
76
|
+
a = int(y / 100)
|
|
77
|
+
b = 2 - a + int(float(a / 4))
|
|
78
|
+
c = 0
|
|
79
|
+
if (y < 0.0):
|
|
80
|
+
c = int(365.25 * y - 0.75)
|
|
81
|
+
else:
|
|
82
|
+
c = int(365.25 * y)
|
|
83
|
+
d = int(30.6001 * (m + 1))
|
|
84
|
+
jd = float(b + c + d + day + 1720994.5);
|
|
85
|
+
|
|
86
|
+
return jd
|
|
87
|
+
|
|
88
|
+
# start and stop Julian dates for Kepler quarters
|
|
89
|
+
|
|
90
|
+
def QuarterDates(quarter):
|
|
91
|
+
|
|
92
|
+
Qstart = [2454953.5,2454964.5,2454998.5]
|
|
93
|
+
Qstop = [2454962.5,2454997.5,2455100.5]
|
|
94
|
+
if (quarter < len(Qstart)):
|
|
95
|
+
return Qstart[quarter] - 10, Qstop[quarter] + 10
|
|
96
|
+
else:
|
|
97
|
+
message = 'No spacecraft roll dates recorded for quarter ' + str(quarter) + '.\n'
|
|
98
|
+
message += 'Find an updated script at http://keplergo.arc.nasa.gov'
|
|
99
|
+
sys.exit(message)
|
|
100
|
+
|
|
101
|
+
def GetMetaData(invid,quarter):
|
|
102
|
+
|
|
103
|
+
# get start and stop dates for quarter
|
|
104
|
+
|
|
105
|
+
Qstart, Qstop = QuarterDates(quarter)
|
|
106
|
+
|
|
107
|
+
# URL for MAST data access
|
|
108
|
+
|
|
109
|
+
url = 'http://archive.stsci.edu/kepler/data_search/search.php?'
|
|
110
|
+
url += 'action=Search'
|
|
111
|
+
url += '&max_records=100000'
|
|
112
|
+
url += '&verb=3'
|
|
113
|
+
url += '&ktc_investigation_id=' + invid
|
|
114
|
+
url += '&ktc_target_type[]=LC'
|
|
115
|
+
url += '&ktc_target_type[]=SC'
|
|
116
|
+
url += '&outputformat=CSV'
|
|
117
|
+
|
|
118
|
+
# retrieve results from MAST
|
|
119
|
+
|
|
120
|
+
lines = urllib.urlopen(url)
|
|
121
|
+
|
|
122
|
+
# extract metadata from CSV
|
|
123
|
+
|
|
124
|
+
print '\n%4s %9s %7s %5s %2s %10s %10s %10s' % \
|
|
125
|
+
('#', 'KepID', 'InvID', 'KpMag', 'Md', 'Start', 'Stop', 'Release')
|
|
126
|
+
kepid = []; invid = []; mode = []
|
|
127
|
+
ra = []; dec = []; kepmag = []
|
|
128
|
+
start = []; stop = []; release = []
|
|
129
|
+
for line in lines:
|
|
130
|
+
line = line.strip().split(',')
|
|
131
|
+
if (len(line[0]) > 0 and
|
|
132
|
+
'Kepler' not in line[0] and
|
|
133
|
+
'integer' not in line[0] and
|
|
134
|
+
'no rows found' not in line[0]):
|
|
135
|
+
GregStart = line[7][:10].split('-')
|
|
136
|
+
GregStop = line[8][:10].split('-')
|
|
137
|
+
JDstart = Greg2JD(int(GregStart[0]),int(GregStart[1]),int(GregStart[2]))
|
|
138
|
+
JDstop = Greg2JD(int(GregStop[0]),int(GregStop[1]),int(GregStop[2]))
|
|
139
|
+
if (JDstart > Qstart and JDstop < Qstop):
|
|
140
|
+
kepid.append(line[0])
|
|
141
|
+
invid.append(line[1])
|
|
142
|
+
kepmag.append(float(line[22]))
|
|
143
|
+
mode.append(line[6])
|
|
144
|
+
ra.append(line[4])
|
|
145
|
+
dec.append(line[5])
|
|
146
|
+
start.append(line[7])
|
|
147
|
+
stop.append(line[8])
|
|
148
|
+
release.append(line[9])
|
|
149
|
+
print '%4d %9s %7s %5.2f %2s %10s %10s %10s' % \
|
|
150
|
+
(len(kepid), kepid[-1], invid[-1], kepmag[-1], mode[-1],
|
|
151
|
+
start[-1][:10], stop[-1][:10], release[-1][:10])
|
|
152
|
+
if (len(kepid) == 0):
|
|
153
|
+
print '\nNo data available as of ' + time.asctime(time.localtime())
|
|
154
|
+
else:
|
|
155
|
+
print '\n' + time.asctime(time.localtime())
|
|
156
|
+
|
|
157
|
+
return kepid, invid, kepmag, mode, start, stop, release
|
|
158
|
+
|
|
159
|
+
def usage():
|
|
160
|
+
|
|
161
|
+
print ' -------------------------------------------------------------------------'
|
|
162
|
+
print ' Martin Still (martin.d.still@nasa.gov) NASA Ames Nov 11, 2009'
|
|
163
|
+
print ' '
|
|
164
|
+
print ' Find all quarter data associated with an investigation ID within the MAST'
|
|
165
|
+
print ' archive.'
|
|
166
|
+
print ' '
|
|
167
|
+
print ' Typical usage:'
|
|
168
|
+
print ' KepInvestigationAtMAST.py --invid=GO10003 --quarter=1'
|
|
169
|
+
print ' '
|
|
170
|
+
print ' --invid Investigation ID number of GO program'
|
|
171
|
+
print ' --quarter Kepler quarter (integer number)'
|
|
172
|
+
print ' -------------------------------------------------------------------------'
|
|
173
|
+
sys.exit(' ')
|
|
174
|
+
|
|
175
|
+
#-------------------------------
|
|
176
|
+
if __name__ == "__main__":
|
|
177
|
+
main()`
|
|
208
178
|
)
|
|
209
179
|
const language = ref('python')
|
|
210
180
|
|
|
@@ -143,6 +143,43 @@
|
|
|
143
143
|
</template>
|
|
144
144
|
</dl-input>
|
|
145
145
|
</div>
|
|
146
|
+
|
|
147
|
+
<p>input with tooltip and no title</p>
|
|
148
|
+
<div>
|
|
149
|
+
<dl-input
|
|
150
|
+
class="input-parts"
|
|
151
|
+
placeholder="Select option"
|
|
152
|
+
tooltip="test me tooltip"
|
|
153
|
+
>
|
|
154
|
+
<template #action>
|
|
155
|
+
<dl-button
|
|
156
|
+
dense
|
|
157
|
+
flat
|
|
158
|
+
icon="icon-dl-add"
|
|
159
|
+
size="m"
|
|
160
|
+
/>
|
|
161
|
+
</template>
|
|
162
|
+
</dl-input>
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
<p>input with tooltip and no title size small</p>
|
|
166
|
+
<div>
|
|
167
|
+
<dl-input
|
|
168
|
+
class="input-parts"
|
|
169
|
+
placeholder="Select option"
|
|
170
|
+
tooltip="test me tooltip"
|
|
171
|
+
size="small"
|
|
172
|
+
>
|
|
173
|
+
<template #action>
|
|
174
|
+
<dl-button
|
|
175
|
+
dense
|
|
176
|
+
flat
|
|
177
|
+
icon="icon-dl-add"
|
|
178
|
+
size="m"
|
|
179
|
+
/>
|
|
180
|
+
</template>
|
|
181
|
+
</dl-input>
|
|
182
|
+
</div>
|
|
146
183
|
</div>
|
|
147
184
|
</template>
|
|
148
185
|
<script lang="ts">
|
|
@@ -426,6 +426,81 @@
|
|
|
426
426
|
</div>
|
|
427
427
|
</template>
|
|
428
428
|
</dl-select>
|
|
429
|
+
|
|
430
|
+
Select with tooltip no title
|
|
431
|
+
<dl-select
|
|
432
|
+
v-model="selectedOption"
|
|
433
|
+
:options="[
|
|
434
|
+
{
|
|
435
|
+
subLabel: 'not so high',
|
|
436
|
+
label: 'High',
|
|
437
|
+
value: 'high',
|
|
438
|
+
bgColor: 'dl-color-negative'
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
subLabel: 'not so medium',
|
|
442
|
+
label: 'Medium',
|
|
443
|
+
value: 'medium',
|
|
444
|
+
bgColor: 'dl-color-warning',
|
|
445
|
+
textColor: 'dl-color-darker'
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
subLabel: 'not so low',
|
|
449
|
+
label: 'Low',
|
|
450
|
+
value: 'low',
|
|
451
|
+
bgColor: 'dl-color-positive',
|
|
452
|
+
textColor: 'dl-color-darker'
|
|
453
|
+
}
|
|
454
|
+
]"
|
|
455
|
+
clearable
|
|
456
|
+
style="margin-bottom: 150px"
|
|
457
|
+
tooltip="test tooltip"
|
|
458
|
+
>
|
|
459
|
+
<template #option="scope">
|
|
460
|
+
<div style="padding: 5px 0px">
|
|
461
|
+
<div>{{ scope.opt.label }}</div>
|
|
462
|
+
<div>{{ scope.opt.subLabel }}</div>
|
|
463
|
+
</div>
|
|
464
|
+
</template>
|
|
465
|
+
</dl-select>
|
|
466
|
+
|
|
467
|
+
Select with tooltip no title size small
|
|
468
|
+
<dl-select
|
|
469
|
+
v-model="selectedOption"
|
|
470
|
+
:options="[
|
|
471
|
+
{
|
|
472
|
+
subLabel: 'not so high',
|
|
473
|
+
label: 'High',
|
|
474
|
+
value: 'high',
|
|
475
|
+
bgColor: 'dl-color-negative'
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
subLabel: 'not so medium',
|
|
479
|
+
label: 'Medium',
|
|
480
|
+
value: 'medium',
|
|
481
|
+
bgColor: 'dl-color-warning',
|
|
482
|
+
textColor: 'dl-color-darker'
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
subLabel: 'not so low',
|
|
486
|
+
label: 'Low',
|
|
487
|
+
value: 'low',
|
|
488
|
+
bgColor: 'dl-color-positive',
|
|
489
|
+
textColor: 'dl-color-darker'
|
|
490
|
+
}
|
|
491
|
+
]"
|
|
492
|
+
clearable
|
|
493
|
+
style="margin-bottom: 150px"
|
|
494
|
+
size="small"
|
|
495
|
+
tooltip="test tooltip"
|
|
496
|
+
>
|
|
497
|
+
<template #option="scope">
|
|
498
|
+
<div style="padding: 5px 0px">
|
|
499
|
+
<div>{{ scope.opt.label }}</div>
|
|
500
|
+
<div>{{ scope.opt.subLabel }}</div>
|
|
501
|
+
</div>
|
|
502
|
+
</template>
|
|
503
|
+
</dl-select>
|
|
429
504
|
</div>
|
|
430
505
|
</template>
|
|
431
506
|
|
|
@@ -446,6 +446,7 @@ import {
|
|
|
446
446
|
} from '../components'
|
|
447
447
|
import { defineComponent, ref, computed, nextTick } from 'vue-demi'
|
|
448
448
|
import { times, cloneDeep, isNumber } from 'lodash'
|
|
449
|
+
import { DlTablePagination } from '../types'
|
|
449
450
|
|
|
450
451
|
const columns = [
|
|
451
452
|
{
|
|
@@ -591,7 +592,7 @@ const rows = [
|
|
|
591
592
|
calcium: '12%',
|
|
592
593
|
iron: '6%'
|
|
593
594
|
},
|
|
594
|
-
...times(
|
|
595
|
+
...times(1000, (index) => ({
|
|
595
596
|
name: 'KitKat' + index,
|
|
596
597
|
calories: 518,
|
|
597
598
|
fat: 26.0,
|
|
@@ -681,11 +682,12 @@ export default defineComponent({
|
|
|
681
682
|
}
|
|
682
683
|
}
|
|
683
684
|
|
|
684
|
-
const pagination = ref({
|
|
685
|
+
const pagination = ref<DlTablePagination>({
|
|
685
686
|
sortBy: 'desc',
|
|
686
687
|
descending: false,
|
|
687
688
|
page: 2,
|
|
688
|
-
rowsPerPage: 3
|
|
689
|
+
rowsPerPage: 3,
|
|
690
|
+
maxDisplayRange: 9
|
|
689
691
|
// rowsNumber: xx if getting data from a server
|
|
690
692
|
})
|
|
691
693
|
|