@mptw/skylens-ui 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +59 -0
- package/CLAUDE.md +36 -0
- package/README.md +7 -7
- package/app/app.config.ts +11 -2
- package/app/app.vue +5 -0
- package/app/assets/css/layout.css +134 -0
- package/app/assets/css/main.css +189 -0
- package/app/components/SLAlertModal.vue +24 -16
- package/app/components/SLBreadcrumbs.vue +12 -8
- package/app/components/SLButton.vue +196 -163
- package/app/components/SLCalendarButton.vue +40 -34
- package/app/components/SLCalendarPopup.vue +79 -53
- package/app/components/SLCard.vue +57 -41
- package/app/components/SLChart.vue +6 -3
- package/app/components/SLCheckbox.vue +92 -49
- package/app/components/SLCircleButton.vue +25 -16
- package/app/components/SLCollapsableBlock.vue +44 -33
- package/app/components/SLCollapsableMulitPillSelect.vue +20 -15
- package/app/components/SLConfirmModal.vue +9 -6
- package/app/components/SLContextMenu.vue +88 -48
- package/app/components/SLDateInput.vue +109 -92
- package/app/components/SLDatePicker.vue +9 -7
- package/app/components/SLDistributor.vue +1 -1
- package/app/components/SLDownloadButton.vue +39 -29
- package/app/components/SLDraggable.vue +2 -2
- package/app/components/SLDropdown.vue +33 -25
- package/app/components/SLDropdownItem.vue +9 -5
- package/app/components/SLElementWithTitle.vue +12 -7
- package/app/components/SLEyeCheckbox.vue +44 -31
- package/app/components/SLFileInput.vue +23 -16
- package/app/components/SLGenderAgeSelect.vue +52 -36
- package/app/components/SLHourRangeInput.vue +45 -32
- package/app/components/SLIOSSwitch.vue +81 -60
- package/app/components/SLIcon.vue +4 -3
- package/app/components/SLIconButton.vue +31 -29
- package/app/components/SLInfoTip.vue +51 -40
- package/app/components/SLInsightSitePage.vue +12 -7
- package/app/components/SLLegend.vue +19 -12
- package/app/components/SLLinearProgressBar.vue +7 -20
- package/app/components/SLLink.vue +12 -8
- package/app/components/SLLoading.vue +34 -31
- package/app/components/SLMapChart.vue +5 -4
- package/app/components/SLModal.vue +90 -66
- package/app/components/SLMonthCalendarButton.vue +91 -45
- package/app/components/SLMonthPicker.vue +42 -37
- package/app/components/SLMultiEmailInput.vue +163 -113
- package/app/components/SLMultiSelect.vue +37 -26
- package/app/components/SLNoData.vue +16 -11
- package/app/components/SLNotification.vue +133 -129
- package/app/components/SLPageModal.vue +14 -9
- package/app/components/SLPagination.vue +45 -33
- package/app/components/SLPillCheckbox.vue +50 -42
- package/app/components/SLPillLabel.vue +43 -28
- package/app/components/SLPopupMenuButton.vue +26 -17
- package/app/components/SLProfileButton.vue +28 -20
- package/app/components/SLProjectShareItem.vue +30 -17
- package/app/components/SLRadioButton.vue +41 -33
- package/app/components/SLRadioButtonGroup.vue +28 -23
- package/app/components/SLRadioGroup.vue +90 -78
- package/app/components/SLRangeInput.vue +53 -38
- package/app/components/SLRegionsMapChart.vue +5 -4
- package/app/components/SLRightSider.vue +50 -40
- package/app/components/SLSearchInput.vue +24 -19
- package/app/components/SLSelect.vue +114 -87
- package/app/components/SLSelectAllToggle.vue +52 -37
- package/app/components/SLSidebarNav.vue +253 -193
- package/app/components/SLSidebarNavGroupItem.vue +13 -10
- package/app/components/SLSidebarNavGroupItemSection.vue +240 -179
- package/app/components/SLSidebarNavLinkItem.vue +131 -109
- package/app/components/SLSidebarNavSectionItem.vue +21 -18
- package/app/components/SLSitePage.vue +35 -24
- package/app/components/SLSkyInsightSitePage.vue +13 -8
- package/app/components/SLSortByDropdown.vue +35 -22
- package/app/components/SLSpinIcon.vue +6 -3
- package/app/components/SLStayRangeInput.vue +47 -36
- package/app/components/SLTab.vue +7 -2
- package/app/components/SLTable.vue +330 -313
- package/app/components/SLTableTooltip.vue +44 -30
- package/app/components/SLTabs.vue +333 -280
- package/app/components/SLTextInput.vue +162 -134
- package/app/components/SLTextarea.vue +40 -29
- package/app/components/SLToast.vue +19 -11
- package/app/components/SLToggleButton.vue +18 -11
- package/app/components/SLTwoLayerMultiSelect.vue +180 -85
- package/app/components/SLTwoLayerSelect.vue +47 -37
- package/app/components/SLTwoLayerSingleSelect.vue +52 -33
- package/app/components/SLWarnModal.vue +9 -7
- package/app/interface/commons.ts +7 -0
- package/app/utils/index.ts +213 -146
- package/eslint.config.js +3 -0
- package/nuxt.config.ts +17 -14
- package/package.json +9 -8
- package/skills-lock.json +59 -0
- package/tsconfig.json +1 -6
- package/.eslintrc.cjs +0 -4
- package/app/assets/css/layout.styl +0 -98
- package/app/assets/css/tailwind.css +0 -3
- package/app/pages/index.vue +0 -15
- package/interface/commons.ts +0 -7
- package/tailwind.config.js +0 -271
- /package/{interface → app/interface}/IDateRange.ts +0 -0
- /package/{interface → app/interface}/IHourRange.ts +0 -0
- /package/{interface → app/interface}/IInputOption.ts +0 -0
- /package/{interface → app/interface}/ILegendItem.ts +0 -0
- /package/{interface → app/interface}/IOrganization.ts +0 -0
- /package/{interface → app/interface}/IPopupMenuButton.ts +0 -0
- /package/{interface → app/interface}/IStayRange.ts +0 -0
- /package/{interface → app/interface}/ITableField.ts +0 -0
- /package/{interface → app/interface}/IWeb.ts +0 -0
- /package/{interface → app/interface}/NavConfigType.ts +0 -0
- /package/{models → app/models}/DateRange.ts +0 -0
|
@@ -113,10 +113,10 @@ export default defineComponent({
|
|
|
113
113
|
},
|
|
114
114
|
query: {
|
|
115
115
|
type: String,
|
|
116
|
-
default:
|
|
117
|
-
}
|
|
116
|
+
default: "",
|
|
117
|
+
},
|
|
118
118
|
},
|
|
119
|
-
emits: ["update:modelValue", "update:selecting",
|
|
119
|
+
emits: ["update:modelValue", "update:selecting", "update:query"],
|
|
120
120
|
setup(props, { emit }) {
|
|
121
121
|
const { size, modelValue, options, placement, query } = toRefs(props);
|
|
122
122
|
|
|
@@ -131,9 +131,11 @@ export default defineComponent({
|
|
|
131
131
|
let clickSubscriber: any = null;
|
|
132
132
|
|
|
133
133
|
const queryProxy = computed({
|
|
134
|
-
get() {
|
|
134
|
+
get() {
|
|
135
|
+
return query.value || selfQuery.value;
|
|
136
|
+
},
|
|
135
137
|
set(newValue: string) {
|
|
136
|
-
emit(
|
|
138
|
+
emit("update:query", newValue);
|
|
137
139
|
selfQuery.value = newValue;
|
|
138
140
|
},
|
|
139
141
|
});
|
|
@@ -185,7 +187,7 @@ export default defineComponent({
|
|
|
185
187
|
const secondOptions = computed(() => {
|
|
186
188
|
const found = filteredOptions.value.find(
|
|
187
189
|
(option) =>
|
|
188
|
-
selectedFirstOption.value && option.key === selectedFirstOption.value
|
|
190
|
+
selectedFirstOption.value && option.key === selectedFirstOption.value,
|
|
189
191
|
);
|
|
190
192
|
return found?.subOptions || [];
|
|
191
193
|
});
|
|
@@ -341,105 +343,198 @@ export default defineComponent({
|
|
|
341
343
|
});
|
|
342
344
|
</script>
|
|
343
345
|
|
|
344
|
-
<style
|
|
345
|
-
.
|
|
346
|
-
@apply relative w-full
|
|
347
|
-
|
|
348
|
-
&.two-layer-multi-select-sm
|
|
349
|
-
.toggle-button
|
|
350
|
-
@apply text-sm
|
|
351
|
-
|
|
352
|
-
&.bordered
|
|
353
|
-
.select-menu-popup
|
|
354
|
-
@apply border-primary-600
|
|
355
|
-
|
|
356
|
-
.toggle-button
|
|
357
|
-
@apply relative flex items-center w-full s('p-1.75') s('space-x-1.75') border border-primary-600 rounded text-base text-pgray-4
|
|
358
|
-
|
|
359
|
-
&.selected
|
|
360
|
-
@apply text-pgray-2
|
|
361
|
-
|
|
362
|
-
.button-title
|
|
363
|
-
@apply flex-grow
|
|
346
|
+
<style>
|
|
347
|
+
@reference '~ui/app/assets/css/main.css';
|
|
364
348
|
|
|
365
|
-
|
|
366
|
-
|
|
349
|
+
.two-layer-multi-select {
|
|
350
|
+
@apply relative w-full;
|
|
351
|
+
}
|
|
367
352
|
|
|
368
|
-
|
|
369
|
-
|
|
353
|
+
.two-layer-multi-select.two-layer-multi-select-sm .toggle-button {
|
|
354
|
+
@apply text-sm;
|
|
355
|
+
}
|
|
370
356
|
|
|
371
|
-
|
|
372
|
-
|
|
357
|
+
.two-layer-multi-select.bordered .select-menu-popup {
|
|
358
|
+
@apply border-primary-600;
|
|
359
|
+
}
|
|
373
360
|
|
|
374
|
-
|
|
375
|
-
|
|
361
|
+
.two-layer-multi-select .toggle-button {
|
|
362
|
+
@apply relative flex items-center w-full p-1.75 space-x-1.75 border border-primary-600 rounded text-base text-pgray-4;
|
|
363
|
+
}
|
|
376
364
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
365
|
+
.two-layer-multi-select .toggle-button.selected {
|
|
366
|
+
@apply text-pgray-2;
|
|
367
|
+
}
|
|
380
368
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
@apply s('py-1.25')
|
|
369
|
+
.two-layer-multi-select .toggle-button .button-title {
|
|
370
|
+
@apply grow;
|
|
371
|
+
}
|
|
385
372
|
|
|
386
|
-
|
|
387
|
-
|
|
373
|
+
.two-layer-multi-select .toggle-button .icon {
|
|
374
|
+
@apply grow-0 shrink-0 inline-flex text-xs text-pgray-2 leading-none;
|
|
375
|
+
}
|
|
388
376
|
|
|
389
|
-
|
|
390
|
-
|
|
377
|
+
.two-layer-multi-select .select-menu-popup {
|
|
378
|
+
@apply z-10 flex flex-col h-67.75 min-w-[552px] w-full pt-2.75 px-2.75 bg-white border border-primary-100 rounded shadow-default invisible pointer-events-none;
|
|
379
|
+
}
|
|
391
380
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
381
|
+
.two-layer-multi-select .select-menu-popup[data-show] {
|
|
382
|
+
@apply visible pointer-events-auto;
|
|
383
|
+
}
|
|
395
384
|
|
|
396
|
-
|
|
397
|
-
|
|
385
|
+
.two-layer-multi-select .select-menu-popup .select-header {
|
|
386
|
+
@apply grow-0 shrink-0 mb-3;
|
|
387
|
+
}
|
|
398
388
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
&-header
|
|
407
|
-
@apply flex-grow-0 flex-shrink-0 w-full pb-2 text-primary border-b border-primary
|
|
389
|
+
.two-layer-multi-select
|
|
390
|
+
.select-menu-popup
|
|
391
|
+
.select-header
|
|
392
|
+
.search-input
|
|
393
|
+
.button-group {
|
|
394
|
+
@apply py-0.75;
|
|
395
|
+
}
|
|
408
396
|
|
|
409
|
-
|
|
410
|
-
|
|
397
|
+
.two-layer-multi-select
|
|
398
|
+
.select-menu-popup
|
|
399
|
+
.select-header
|
|
400
|
+
.text-input
|
|
401
|
+
.input-group
|
|
402
|
+
.input {
|
|
403
|
+
@apply py-1.25;
|
|
404
|
+
}
|
|
411
405
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
406
|
+
.two-layer-multi-select
|
|
407
|
+
.select-menu-popup
|
|
408
|
+
.select-header
|
|
409
|
+
.text-input
|
|
410
|
+
.input-group
|
|
411
|
+
.input
|
|
412
|
+
input {
|
|
413
|
+
@apply text-sm;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.two-layer-multi-select .select-menu-popup .select-body {
|
|
417
|
+
@apply grow flex overflow-hidden;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.two-layer-multi-select .select-menu-popup .select-body .menu {
|
|
421
|
+
@apply grow flex flex-col text-base leading-[1.3125] overflow-hidden;
|
|
422
|
+
flex: 1;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.two-layer-multi-select .select-menu-popup .select-body .menu:hover {
|
|
426
|
+
flex: 1.5;
|
|
427
|
+
}
|
|
416
428
|
|
|
417
|
-
|
|
418
|
-
|
|
429
|
+
.two-layer-multi-select
|
|
430
|
+
.select-menu-popup
|
|
431
|
+
.select-body
|
|
432
|
+
.menu-2
|
|
433
|
+
.menu-body
|
|
434
|
+
.list
|
|
435
|
+
.item
|
|
436
|
+
.checkbox {
|
|
437
|
+
@apply grow;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.two-layer-multi-select .select-menu-popup .select-body .menu-header {
|
|
441
|
+
@apply grow-0 shrink-0 w-full pb-2 text-primary border-b border-primary;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.two-layer-multi-select .select-menu-popup .select-body .menu-body {
|
|
445
|
+
@apply relative grow;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.two-layer-multi-select .select-menu-popup .select-body .menu-body .list .item {
|
|
449
|
+
@apply relative flex items-center justify-start flex-nowrap py-1.5 px-2 space-x-2.5 text-sm text-pgray-3 hover:bg-primary-100;
|
|
450
|
+
}
|
|
419
451
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
452
|
+
.two-layer-multi-select
|
|
453
|
+
.select-menu-popup
|
|
454
|
+
.select-body
|
|
455
|
+
.menu-body
|
|
456
|
+
.list
|
|
457
|
+
.item.checked {
|
|
458
|
+
@apply text-primary;
|
|
459
|
+
}
|
|
424
460
|
|
|
425
|
-
|
|
426
|
-
|
|
461
|
+
.two-layer-multi-select
|
|
462
|
+
.select-menu-popup
|
|
463
|
+
.select-body
|
|
464
|
+
.menu-body
|
|
465
|
+
.list
|
|
466
|
+
.item.checked
|
|
467
|
+
.checkbox
|
|
468
|
+
input:checked
|
|
469
|
+
+ label
|
|
470
|
+
span {
|
|
471
|
+
@apply text-primary;
|
|
472
|
+
}
|
|
427
473
|
|
|
428
|
-
|
|
429
|
-
|
|
474
|
+
.two-layer-multi-select
|
|
475
|
+
.select-menu-popup
|
|
476
|
+
.select-body
|
|
477
|
+
.menu-body
|
|
478
|
+
.list
|
|
479
|
+
.item.selected {
|
|
480
|
+
@apply bg-primary-100;
|
|
481
|
+
}
|
|
430
482
|
|
|
431
|
-
|
|
432
|
-
|
|
483
|
+
.two-layer-multi-select
|
|
484
|
+
.select-menu-popup
|
|
485
|
+
.select-body
|
|
486
|
+
.menu-body
|
|
487
|
+
.list
|
|
488
|
+
.item
|
|
489
|
+
.checkbox {
|
|
490
|
+
@apply grow-0 shrink-0 inline-flex;
|
|
491
|
+
}
|
|
433
492
|
|
|
434
|
-
|
|
435
|
-
|
|
493
|
+
.two-layer-multi-select
|
|
494
|
+
.select-menu-popup
|
|
495
|
+
.select-body
|
|
496
|
+
.menu-body
|
|
497
|
+
.list
|
|
498
|
+
.item
|
|
499
|
+
.checkbox
|
|
500
|
+
label {
|
|
501
|
+
@apply grow flex-nowrap flex items-center;
|
|
502
|
+
}
|
|
436
503
|
|
|
437
|
-
|
|
438
|
-
|
|
504
|
+
.two-layer-multi-select
|
|
505
|
+
.select-menu-popup
|
|
506
|
+
.select-body
|
|
507
|
+
.menu-body
|
|
508
|
+
.list
|
|
509
|
+
.item
|
|
510
|
+
.checkbox
|
|
511
|
+
label
|
|
512
|
+
.icon {
|
|
513
|
+
@apply grow-0 shrink-0;
|
|
514
|
+
}
|
|
439
515
|
|
|
440
|
-
|
|
441
|
-
|
|
516
|
+
.two-layer-multi-select
|
|
517
|
+
.select-menu-popup
|
|
518
|
+
.select-body
|
|
519
|
+
.menu-body
|
|
520
|
+
.list
|
|
521
|
+
.item
|
|
522
|
+
.checkbox
|
|
523
|
+
label
|
|
524
|
+
span {
|
|
525
|
+
@apply grow block truncate;
|
|
526
|
+
}
|
|
442
527
|
|
|
443
|
-
|
|
444
|
-
|
|
528
|
+
.two-layer-multi-select
|
|
529
|
+
.select-menu-popup
|
|
530
|
+
.select-body
|
|
531
|
+
.menu-body
|
|
532
|
+
.list
|
|
533
|
+
.item-name {
|
|
534
|
+
@apply grow block truncate;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.two-layer-multi-select .select-menu-popup .select-body-divider {
|
|
538
|
+
@apply grow-0 shrink-0 w-px h-auto mb-3 mr-2.75 ml-3 bg-pgray-4;
|
|
539
|
+
}
|
|
445
540
|
</style>
|
|
@@ -138,10 +138,10 @@ export default defineComponent({
|
|
|
138
138
|
|
|
139
139
|
const { firstLayer, secondLayer } = modelValue.value;
|
|
140
140
|
const firstLayerIndex = firstLayers.value.findIndex(
|
|
141
|
-
(l) => l.key === firstLayer
|
|
141
|
+
(l) => l.key === firstLayer,
|
|
142
142
|
);
|
|
143
143
|
const secondLayerKey = secondLayers.value.findIndex(
|
|
144
|
-
(l) => l.key === secondLayer
|
|
144
|
+
(l) => l.key === secondLayer,
|
|
145
145
|
);
|
|
146
146
|
const firstLayerItems = leftMenuEl.value?.querySelectorAll(".item");
|
|
147
147
|
const secondLayerItems = rightMenuEl.value?.querySelectorAll(".item");
|
|
@@ -214,52 +214,62 @@ export default defineComponent({
|
|
|
214
214
|
});
|
|
215
215
|
</script>
|
|
216
216
|
|
|
217
|
-
<style
|
|
218
|
-
.
|
|
219
|
-
@apply flex flex-col s("h-67.75") s("pt-2.75") s("px-2.75") bg-white border border-primary-100 rounded shadow
|
|
220
|
-
width 552px
|
|
217
|
+
<style>
|
|
218
|
+
@reference '~ui/app/assets/css/main.css';
|
|
221
219
|
|
|
222
|
-
|
|
223
|
-
|
|
220
|
+
.tw-layer-select {
|
|
221
|
+
@apply flex flex-col w-138 h-67.75 pt-2.75 px-2.75 bg-white border border-primary-100 rounded shadow-default;
|
|
222
|
+
}
|
|
224
223
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
.tw-layer-select .select-header {
|
|
225
|
+
@apply grow-0 shrink-0 mb-3;
|
|
226
|
+
}
|
|
228
227
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
@apply s('py-1.25')
|
|
228
|
+
.tw-layer-select .select-header .search-input .button-group {
|
|
229
|
+
@apply py-0.75;
|
|
230
|
+
}
|
|
233
231
|
|
|
234
|
-
|
|
235
|
-
|
|
232
|
+
.tw-layer-select .select-header .text-input .input-group .input {
|
|
233
|
+
@apply py-1.25;
|
|
234
|
+
}
|
|
236
235
|
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
.tw-layer-select .select-header .text-input .input-group .input input {
|
|
237
|
+
@apply text-sm;
|
|
238
|
+
}
|
|
239
239
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
.tw-layer-select .select-body {
|
|
241
|
+
@apply grow flex overflow-hidden;
|
|
242
|
+
}
|
|
243
243
|
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
.tw-layer-select .select-body .menu {
|
|
245
|
+
@apply grow flex flex-col text-base leading-[1.3125] overflow-hidden;
|
|
246
|
+
}
|
|
246
247
|
|
|
247
|
-
|
|
248
|
-
|
|
248
|
+
.tw-layer-select .select-body .menu:hover {
|
|
249
|
+
@apply grow-[1.5];
|
|
250
|
+
}
|
|
249
251
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
+
.tw-layer-select .select-body .menu-header {
|
|
253
|
+
@apply grow-0 shrink-0 w-full pb-2 text-primary border-b border-primary;
|
|
254
|
+
}
|
|
252
255
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
+
.tw-layer-select .select-body .menu-body {
|
|
257
|
+
@apply relative grow;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.tw-layer-select .select-body .menu-body .list .item {
|
|
261
|
+
@apply relative block py-1.5 px-2 hover:bg-primary-50 text-sm text-pgray-3 truncate;
|
|
262
|
+
}
|
|
256
263
|
|
|
257
|
-
|
|
258
|
-
|
|
264
|
+
.tw-layer-select .select-body .menu-body .list .item.selected {
|
|
265
|
+
@apply bg-primary-100 text-primary;
|
|
266
|
+
}
|
|
259
267
|
|
|
260
|
-
|
|
261
|
-
|
|
268
|
+
.tw-layer-select .select-body .menu-body .list .item .highlight-dot {
|
|
269
|
+
@apply absolute top-0 left-0 w-1.5 h-1.5 mt-2 ml-1 bg-red rounded-full;
|
|
270
|
+
}
|
|
262
271
|
|
|
263
|
-
|
|
264
|
-
|
|
272
|
+
.tw-layer-select .select-body-divider {
|
|
273
|
+
@apply grow-0 shrink-0 w-px h-auto mb-3 mr-2.75 ml-3 bg-pgray-4;
|
|
274
|
+
}
|
|
265
275
|
</style>
|
|
@@ -30,7 +30,7 @@ import type { PropType } from "vue";
|
|
|
30
30
|
import { fromEvent } from "rxjs";
|
|
31
31
|
import { createPopper } from "@popperjs/core";
|
|
32
32
|
import type { Placement } from "@popperjs/core";
|
|
33
|
-
import { SLTwoLayerSelect } from
|
|
33
|
+
import { SLTwoLayerSelect } from "#components";
|
|
34
34
|
|
|
35
35
|
type SLTwoLayerSelectType = InstanceType<typeof SLTwoLayerSelect>;
|
|
36
36
|
|
|
@@ -82,10 +82,10 @@ export default defineComponent({
|
|
|
82
82
|
},
|
|
83
83
|
query: {
|
|
84
84
|
type: String,
|
|
85
|
-
default:
|
|
86
|
-
}
|
|
85
|
+
default: "",
|
|
86
|
+
},
|
|
87
87
|
},
|
|
88
|
-
emits: ["update:modelValue", "update:selecting",
|
|
88
|
+
emits: ["update:modelValue", "update:selecting", "update:query"],
|
|
89
89
|
setup(props, { emit }) {
|
|
90
90
|
const { size, options, placement, query } = toRefs(props);
|
|
91
91
|
|
|
@@ -100,9 +100,11 @@ export default defineComponent({
|
|
|
100
100
|
let clickSubscriber: any = null;
|
|
101
101
|
|
|
102
102
|
const queryProxy = computed({
|
|
103
|
-
get() {
|
|
103
|
+
get() {
|
|
104
|
+
return selfQuery.value;
|
|
105
|
+
},
|
|
104
106
|
set(newValue: string) {
|
|
105
|
-
emit(
|
|
107
|
+
emit("update:query", newValue);
|
|
106
108
|
selfQuery.value = newValue;
|
|
107
109
|
},
|
|
108
110
|
});
|
|
@@ -130,12 +132,12 @@ export default defineComponent({
|
|
|
130
132
|
.filter((option) => option.subOptions.length > 0);
|
|
131
133
|
});
|
|
132
134
|
const firstOptions = computed(() => {
|
|
133
|
-
return filteredOptions.value
|
|
135
|
+
return filteredOptions.value;
|
|
134
136
|
});
|
|
135
137
|
const secondOptions = computed(() => {
|
|
136
138
|
const found = filteredOptions.value.find(
|
|
137
139
|
(option) =>
|
|
138
|
-
selectedFirstOption.value && option.key === selectedFirstOption.value
|
|
140
|
+
selectedFirstOption.value && option.key === selectedFirstOption.value,
|
|
139
141
|
);
|
|
140
142
|
return found?.subOptions || [];
|
|
141
143
|
});
|
|
@@ -148,10 +150,12 @@ export default defineComponent({
|
|
|
148
150
|
selectedFirstOption.value = key;
|
|
149
151
|
}
|
|
150
152
|
|
|
151
|
-
function onInputedSecondOption(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
function onInputedSecondOption(
|
|
154
|
+
newValue: {
|
|
155
|
+
firstLayer: string;
|
|
156
|
+
secondLayer: string;
|
|
157
|
+
} | null,
|
|
158
|
+
) {
|
|
155
159
|
emit("update:modelValue", newValue);
|
|
156
160
|
}
|
|
157
161
|
|
|
@@ -208,7 +212,10 @@ export default defineComponent({
|
|
|
208
212
|
body.classList.remove("popup");
|
|
209
213
|
}
|
|
210
214
|
|
|
211
|
-
if (
|
|
215
|
+
if (
|
|
216
|
+
!popupComp.value?.$el ||
|
|
217
|
+
popupComp.value?.$el.getAttribute("data-show") === null
|
|
218
|
+
)
|
|
212
219
|
return;
|
|
213
220
|
|
|
214
221
|
isSelecting.value = false;
|
|
@@ -226,7 +233,10 @@ export default defineComponent({
|
|
|
226
233
|
}
|
|
227
234
|
|
|
228
235
|
function onClickedToggle() {
|
|
229
|
-
if (
|
|
236
|
+
if (
|
|
237
|
+
!popupComp.value?.$el ||
|
|
238
|
+
popupComp.value?.$el.getAttribute("data-show") !== null
|
|
239
|
+
) {
|
|
230
240
|
hide();
|
|
231
241
|
return;
|
|
232
242
|
}
|
|
@@ -235,7 +245,7 @@ export default defineComponent({
|
|
|
235
245
|
}
|
|
236
246
|
|
|
237
247
|
function onSearch(search: string) {
|
|
238
|
-
console.log("search", search ===
|
|
248
|
+
console.log("search", search === "");
|
|
239
249
|
queryProxy.value = search;
|
|
240
250
|
}
|
|
241
251
|
|
|
@@ -286,29 +296,38 @@ export default defineComponent({
|
|
|
286
296
|
});
|
|
287
297
|
</script>
|
|
288
298
|
|
|
289
|
-
<style
|
|
290
|
-
.
|
|
291
|
-
|
|
299
|
+
<style>
|
|
300
|
+
@reference '~ui/app/assets/css/main.css';
|
|
301
|
+
|
|
302
|
+
.two-layer-single-select {
|
|
303
|
+
@apply relative w-full;
|
|
304
|
+
}
|
|
292
305
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
306
|
+
.two-layer-single-select.two-layer-single-select-sm .toggle-button {
|
|
307
|
+
@apply text-sm;
|
|
308
|
+
}
|
|
296
309
|
|
|
297
|
-
|
|
298
|
-
|
|
310
|
+
.two-layer-single-select .toggle-button {
|
|
311
|
+
@apply relative flex items-center w-full p-1.75 space-x-1.75 border border-primary-600 rounded text-base text-pgray-4;
|
|
312
|
+
}
|
|
299
313
|
|
|
300
|
-
|
|
301
|
-
|
|
314
|
+
.two-layer-single-select .toggle-button.selected {
|
|
315
|
+
@apply text-pgray-2;
|
|
316
|
+
}
|
|
302
317
|
|
|
303
|
-
|
|
304
|
-
|
|
318
|
+
.two-layer-single-select .toggle-button .button-title {
|
|
319
|
+
@apply grow;
|
|
320
|
+
}
|
|
305
321
|
|
|
306
|
-
|
|
307
|
-
|
|
322
|
+
.two-layer-single-select .toggle-button .icon {
|
|
323
|
+
@apply grow-0 shrink-0 inline-flex text-xs text-pgray-2 leading-none;
|
|
324
|
+
}
|
|
308
325
|
|
|
309
|
-
|
|
310
|
-
|
|
326
|
+
.two-layer-single-select .tw-layer-select {
|
|
327
|
+
@apply z-10 invisible pointer-events-none;
|
|
328
|
+
}
|
|
311
329
|
|
|
312
|
-
|
|
313
|
-
|
|
330
|
+
.two-layer-single-select .tw-layer-select[data-show] {
|
|
331
|
+
@apply visible pointer-events-auto;
|
|
332
|
+
}
|
|
314
333
|
</style>
|
|
@@ -64,12 +64,14 @@ export default defineComponent({
|
|
|
64
64
|
});
|
|
65
65
|
</script>
|
|
66
66
|
|
|
67
|
-
<style
|
|
68
|
-
.
|
|
69
|
-
.modal-body
|
|
70
|
-
&-content
|
|
71
|
-
@apply flex flex-col items-center space-y-6 text-base text-pgray-2
|
|
67
|
+
<style>
|
|
68
|
+
@reference '~ui/app/assets/css/main.css';
|
|
72
69
|
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
.warn-modal .modal-body-content {
|
|
71
|
+
@apply flex flex-col items-center space-y-6 text-base text-pgray-2;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.warn-modal .modal-body-content .icon {
|
|
75
|
+
@apply text-16xl;
|
|
76
|
+
}
|
|
75
77
|
</style>
|