@v1nt1248/3nclient-lib 0.3.50 → 0.4.0
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/README.md +2 -0
- package/dist/chunks/{ui3n-notification-o0tuhTpO.js → ui3n-notification-CTYQV3nR.js} +38 -37
- package/dist/src/components/ui3n-chip/ui3n-chip.d.ts +0 -5
- package/dist/src/components/ui3n-icon/ui3n-icon.d.ts +0 -1
- package/dist/src/components/ui3n-progress/ui3n-progress-circular.d.ts +0 -2
- package/dist/src/components/ui3n-progress/ui3n-progress-linear.d.ts +0 -2
- package/dist/src/components/ui3n-scrollbar-horizontal/ui3n-scrollbar-horizontal.d.ts +0 -7
- package/dist/src/components/ui3n-scrollbar-vertical/ui3n-scrollbar-vertical.d.ts +0 -7
- package/dist/src/components/ui3n-slider/ui3n-slider.d.ts +0 -5
- package/dist/src/components/ui3n-tabs/ui3n-tabs.d.ts +0 -4
- package/dist/src/components/ui3n-tooltip/ui3n-tooltip.d.ts +0 -3
- package/dist/style.css +1 -1
- package/dist/ui3n-components.js +1698 -1749
- package/dist/ui3n-plugins.js +3 -2
- package/dist/variables.css +1 -0
- package/package.json +11 -4
- package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +28 -25
- package/src/components/ui3n-badge/ui3n-badge-simple.vue +18 -17
- package/src/components/ui3n-badge/ui3n-badge.vue +3 -2
- package/src/components/ui3n-breadcrumbs/ui3n-breadcrumb.vue +11 -10
- package/src/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue +4 -1
- package/src/components/ui3n-button/ui3n-button.vue +244 -158
- package/src/components/ui3n-checkbox/ui3n-checkbox.vue +22 -21
- package/src/components/ui3n-chip/ui3n-chip.vue +56 -40
- package/src/components/ui3n-dialog/ui3n-dialog-provider.vue +2 -0
- package/src/components/ui3n-dialog/ui3n-dialog.vue +19 -18
- package/src/components/ui3n-drop-files/ui3n-drop-files.vue +8 -7
- package/src/components/ui3n-editable/ui3n-content-editable.vue +11 -10
- package/src/components/ui3n-editable/ui3n-editable.vue +26 -25
- package/src/components/ui3n-emoji/ui3n-emoji.vue +7 -6
- package/src/components/ui3n-icon/ui3n-icon.vue +26 -16
- package/src/components/ui3n-input/ui3n-input.vue +36 -32
- package/src/components/ui3n-input-file/ui3n-input-file.vue +8 -5
- package/src/components/ui3n-list/ui3n-list.vue +8 -7
- package/src/components/ui3n-menu/ui3n-menu.vue +6 -5
- package/src/components/ui3n-mobile-menu/ui3n-mobile-menu.vue +4 -3
- package/src/components/ui3n-mobile-menu-item/ui3n-mobile-menu-item.vue +7 -6
- package/src/components/ui3n-notification/ui3n-notification-container.vue +2 -0
- package/src/components/ui3n-notification/ui3n-notification.vue +28 -26
- package/src/components/ui3n-progress/ui3n-progress-circular.vue +32 -19
- package/src/components/ui3n-progress/ui3n-progress-linear.vue +31 -18
- package/src/components/ui3n-radio-group/ui3n-radio-group.vue +4 -1
- package/src/components/ui3n-radio-group/ui3n-radio.vue +6 -5
- package/src/components/ui3n-scrollbar/ui3n-scrollbar.vue +94 -83
- package/src/components/ui3n-scrollbar-horizontal/ui3n-scrollbar-horizontal.vue +51 -39
- package/src/components/ui3n-scrollbar-vertical/ui3n-scrollbar-vertical.vue +51 -39
- package/src/components/ui3n-selector/ui3n-selector.vue +33 -28
- package/src/components/ui3n-slider/ui3n-slider.vue +53 -34
- package/src/components/ui3n-step-line-bar/ui3n-step-line-bar.vue +10 -6
- package/src/components/ui3n-switch/ui3n-switch.vue +23 -22
- package/src/components/ui3n-table/ui3n-table.vue +50 -48
- package/src/components/ui3n-tabs/ui3n-tabs.vue +38 -20
- package/src/components/ui3n-text/ui3n-text.vue +15 -14
- package/src/components/ui3n-tooltip/ui3n-tooltip-old.vue +14 -11
- package/src/components/ui3n-tooltip/ui3n-tooltip.vue +38 -27
|
@@ -6,19 +6,13 @@
|
|
|
6
6
|
Ui3nScrollbarVerticalSlots,
|
|
7
7
|
Ui3nScrollbarVerticalExpose,
|
|
8
8
|
} from './types';
|
|
9
|
+
import { toCssLength } from '../../utils/ui/to-css-length';
|
|
9
10
|
|
|
10
11
|
const MIN_HEIGHT = 32;
|
|
11
12
|
|
|
12
13
|
const props = withDefaults(defineProps<Ui3nScrollbarVerticalProps>(), {
|
|
13
14
|
thumbMinHeight: MIN_HEIGHT,
|
|
14
15
|
thumbHeight: 'auto',
|
|
15
|
-
thumbRadius: 4,
|
|
16
|
-
thumbColor: 'var(--color-bg-control-accent-default)',
|
|
17
|
-
thumbHoverColor: 'var(--color-bg-control-accent-hover)',
|
|
18
|
-
thumbActiveColor: 'var(--color-bg-control-accent-focused)',
|
|
19
|
-
trackWidth: 6,
|
|
20
|
-
trackRadius: 4,
|
|
21
|
-
trackColor: 'transparent',
|
|
22
16
|
autoUpdate: true,
|
|
23
17
|
});
|
|
24
18
|
const emits = defineEmits<Ui3nScrollbarVerticalEmits>();
|
|
@@ -80,23 +74,40 @@
|
|
|
80
74
|
return (scrollTop.value / maxScrollTop) * maxThumbTop;
|
|
81
75
|
});
|
|
82
76
|
|
|
83
|
-
const thumbRadiusCss = computed(() => {
|
|
84
|
-
const num = Number(props.thumbRadius);
|
|
85
|
-
return isNaN(num) ? String(props.thumbRadius) : `${num}px`;
|
|
86
|
-
});
|
|
87
|
-
const thumbColorCss = computed(() => props.thumbColor);
|
|
88
|
-
const thumbHoverColorCss = computed(() => props.thumbHoverColor);
|
|
89
|
-
const thumbActiveColorCss = computed(() => props.thumbActiveColor);
|
|
90
|
-
const trackWidthCss = computed(() => {
|
|
91
|
-
const num = Number(props.trackWidth);
|
|
92
|
-
return isNaN(num) ? String(props.trackWidth) : `${num}px`;
|
|
93
|
-
});
|
|
94
|
-
const trackColorCss = computed(() => props.trackColor);
|
|
95
|
-
const trackRadiusCss = computed(() => {
|
|
96
|
-
const num = Number(props.trackRadius);
|
|
97
|
-
return isNaN(num) ? String(props.trackRadius) : `${num}px`;
|
|
98
|
-
});
|
|
99
77
|
|
|
78
|
+
const scrollbarStyle = computed(() => {
|
|
79
|
+
const styles: Record<string, string> = {};
|
|
80
|
+
|
|
81
|
+
if (props.thumbRadius !== undefined) {
|
|
82
|
+
styles['--ui3n-scrollbar-thumb-radius'] = toCssLength(props.thumbRadius);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (props.thumbColor) {
|
|
86
|
+
styles['--ui3n-scrollbar-thumb-color'] = props.thumbColor;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (props.thumbHoverColor) {
|
|
90
|
+
styles['--ui3n-scrollbar-thumb-hover-color'] = props.thumbHoverColor;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (props.thumbActiveColor) {
|
|
94
|
+
styles['--ui3n-scrollbar-thumb-active-color'] = props.thumbActiveColor;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (props.trackWidth !== undefined) {
|
|
98
|
+
styles['--ui3n-scrollbar-track-width'] = toCssLength(props.trackWidth);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (props.trackRadius !== undefined) {
|
|
102
|
+
styles['--ui3n-scrollbar-track-radius'] = toCssLength(props.trackRadius);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (props.trackColor) {
|
|
106
|
+
styles['--ui3n-scrollbar-track-color'] = props.trackColor;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return styles;
|
|
110
|
+
});
|
|
100
111
|
function updateMetrics() {
|
|
101
112
|
if (!containerRef.value) {
|
|
102
113
|
return;
|
|
@@ -233,16 +244,9 @@
|
|
|
233
244
|
|
|
234
245
|
<template>
|
|
235
246
|
<div
|
|
247
|
+
data-ui3n="scrollbar-vertical"
|
|
236
248
|
:class="$style.ui3nScrollbarVertical"
|
|
237
|
-
:style="
|
|
238
|
-
'--ui3n-scrollbar-thumb-radius': thumbRadiusCss,
|
|
239
|
-
'--ui3n-scrollbar-thumb-color': thumbColorCss,
|
|
240
|
-
'--ui3n-scrollbar-thumb-hover-color': thumbHoverColorCss,
|
|
241
|
-
'--ui3n-scrollbar-thumb-active-color': thumbActiveColorCss,
|
|
242
|
-
'--ui3n-scrollbar-track-width': trackWidthCss,
|
|
243
|
-
'--ui3n-scrollbar-track-radius': trackRadiusCss,
|
|
244
|
-
'--ui3n-scrollbar-track-color': trackColorCss,
|
|
245
|
-
}"
|
|
249
|
+
:style="scrollbarStyle"
|
|
246
250
|
@mouseenter="isHovered = true"
|
|
247
251
|
@mouseleave="isHovered = false"
|
|
248
252
|
>
|
|
@@ -274,6 +278,14 @@
|
|
|
274
278
|
|
|
275
279
|
<style lang="scss" module>
|
|
276
280
|
.ui3nScrollbarVertical {
|
|
281
|
+
--_scrollbar-thumb-radius: var(--ui3n-scrollbar-thumb-radius, 4px);
|
|
282
|
+
--_scrollbar-thumb-color: var(--ui3n-scrollbar-thumb-color, var(--color-bg-control-accent-default));
|
|
283
|
+
--_scrollbar-thumb-hover-color: var(--ui3n-scrollbar-thumb-hover-color, var(--color-bg-control-accent-hover));
|
|
284
|
+
--_scrollbar-thumb-active-color: var(--ui3n-scrollbar-thumb-active-color, var(--color-bg-control-accent-focused));
|
|
285
|
+
--_scrollbar-track-width: var(--ui3n-scrollbar-track-width, 6px);
|
|
286
|
+
--_scrollbar-track-radius: var(--ui3n-scrollbar-track-radius, 4px);
|
|
287
|
+
--_scrollbar-track-color: var(--ui3n-scrollbar-track-color, transparent);
|
|
288
|
+
|
|
277
289
|
position: relative;
|
|
278
290
|
width: 100%;
|
|
279
291
|
height: 100%;
|
|
@@ -301,9 +313,9 @@
|
|
|
301
313
|
top: 0;
|
|
302
314
|
right: 2px;
|
|
303
315
|
bottom: 0;
|
|
304
|
-
width: var(--
|
|
305
|
-
background: var(--
|
|
306
|
-
border-radius: var(--
|
|
316
|
+
width: var(--_scrollbar-track-width);
|
|
317
|
+
background: var(--_scrollbar-track-color);
|
|
318
|
+
border-radius: var(--_scrollbar-track-radius);
|
|
307
319
|
z-index: 10;
|
|
308
320
|
visibility: hidden;
|
|
309
321
|
opacity: 0;
|
|
@@ -323,19 +335,19 @@
|
|
|
323
335
|
position: absolute;
|
|
324
336
|
left: 0;
|
|
325
337
|
width: 100%;
|
|
326
|
-
border-radius: var(--
|
|
327
|
-
background-color: var(--
|
|
338
|
+
border-radius: var(--_scrollbar-thumb-radius);
|
|
339
|
+
background-color: var(--_scrollbar-thumb-color);
|
|
328
340
|
cursor: pointer;
|
|
329
341
|
transition: background-color 0.15s ease;
|
|
330
342
|
touch-action: none;
|
|
331
343
|
|
|
332
344
|
&:hover {
|
|
333
|
-
background-color: var(--
|
|
345
|
+
background-color: var(--_scrollbar-thumb-hover-color);
|
|
334
346
|
}
|
|
335
347
|
|
|
336
348
|
&:active,
|
|
337
349
|
&.active {
|
|
338
|
-
background-color: var(--
|
|
350
|
+
background-color: var(--_scrollbar-thumb-active-color);
|
|
339
351
|
}
|
|
340
352
|
}
|
|
341
353
|
</style>
|
|
@@ -241,6 +241,7 @@
|
|
|
241
241
|
<template>
|
|
242
242
|
<div
|
|
243
243
|
:id="id"
|
|
244
|
+
data-ui3n="selector"
|
|
244
245
|
:class="$style.ui3nSelector"
|
|
245
246
|
>
|
|
246
247
|
<input
|
|
@@ -374,16 +375,20 @@
|
|
|
374
375
|
@use '@/assets/styles/mixins' as mixins;
|
|
375
376
|
|
|
376
377
|
.ui3nSelector {
|
|
377
|
-
--ui3n-selector-activator-height
|
|
378
|
-
--ui3n-selector-border-radius
|
|
379
|
-
--ui3n-selector-font-size
|
|
380
|
-
--ui3n-selector-trigger-padding
|
|
381
|
-
--ui3n-selector-trigger-font-size
|
|
382
|
-
--ui3n-selector-item-min-height
|
|
383
|
-
--ui3n-selector-item-padding
|
|
384
|
-
--ui3n-selector-item-font-size
|
|
385
|
-
--ui3n-selector-item-border-radius
|
|
386
|
-
--ui3n-selector-body-padding
|
|
378
|
+
--_selector-activator-height: var(--ui3n-selector-activator-height, 32px);
|
|
379
|
+
--_selector-border-radius: var(--ui3n-selector-border-radius, calc(var(--_selector-activator-height) / 2.5));
|
|
380
|
+
--_selector-font-size: var(--ui3n-selector-font-size, 12px);
|
|
381
|
+
--_selector-trigger-padding: var(--ui3n-selector-trigger-padding, 0 24px 0 8px);
|
|
382
|
+
--_selector-trigger-font-size: var(--ui3n-selector-trigger-font-size, 13px);
|
|
383
|
+
--_selector-item-min-height: var(--ui3n-selector-item-min-height, 32px);
|
|
384
|
+
--_selector-item-padding: var(--ui3n-selector-item-padding, 4px);
|
|
385
|
+
--_selector-item-font-size: var(--ui3n-selector-item-font-size, 13px);
|
|
386
|
+
--_selector-item-border-radius: var(--ui3n-selector-item-border-radius, 4px);
|
|
387
|
+
--_selector-body-padding: var(--ui3n-selector-body-padding, 4px);
|
|
388
|
+
--_selector-body-border-color: var(
|
|
389
|
+
--ui3n-selector-body-border-color,
|
|
390
|
+
var(--color-border-block-primary-default)
|
|
391
|
+
);
|
|
387
392
|
|
|
388
393
|
position: relative;
|
|
389
394
|
width: 100%;
|
|
@@ -392,7 +397,7 @@
|
|
|
392
397
|
.label {
|
|
393
398
|
display: block;
|
|
394
399
|
width: 100%;
|
|
395
|
-
font-size: var(--
|
|
400
|
+
font-size: var(--_selector-font-size);
|
|
396
401
|
font-weight: 500;
|
|
397
402
|
line-height: 1.33;
|
|
398
403
|
color: var(--color-text-control-primary-default);
|
|
@@ -400,25 +405,25 @@
|
|
|
400
405
|
}
|
|
401
406
|
|
|
402
407
|
.menu {
|
|
403
|
-
border-radius: var(--
|
|
408
|
+
border-radius: var(--_selector-border-radius);
|
|
404
409
|
|
|
405
410
|
& > div {
|
|
406
411
|
max-width: 100% !important;
|
|
407
|
-
border-radius: var(--
|
|
412
|
+
border-radius: var(--_selector-border-radius);
|
|
408
413
|
}
|
|
409
414
|
}
|
|
410
415
|
|
|
411
416
|
.trigger {
|
|
412
417
|
display: flex;
|
|
413
418
|
width: 100%;
|
|
414
|
-
height: var(--
|
|
415
|
-
padding: var(--
|
|
419
|
+
height: var(--_selector-activator-height);
|
|
420
|
+
padding: var(--_selector-trigger-padding);
|
|
416
421
|
justify-content: flex-start;
|
|
417
422
|
align-items: center;
|
|
418
423
|
background-color: var(--color-bg-control-secondary-default);
|
|
419
|
-
border-radius: var(--
|
|
424
|
+
border-radius: var(--_selector-border-radius);
|
|
420
425
|
color: var(--color-text-control-primary-default);
|
|
421
|
-
font-size: var(--
|
|
426
|
+
font-size: var(--_selector-trigger-font-size);
|
|
422
427
|
font-weight: 400;
|
|
423
428
|
line-height: 1.23;
|
|
424
429
|
transition: all 0.2s ease-in-out;
|
|
@@ -463,35 +468,35 @@
|
|
|
463
468
|
position: relative;
|
|
464
469
|
width: 100%;
|
|
465
470
|
background-color: var(--color-bg-block-primary-default);
|
|
466
|
-
padding: var(--
|
|
471
|
+
padding: var(--_selector-body-padding);
|
|
467
472
|
box-shadow: 0 4px 12px var(--shadow-close);
|
|
468
|
-
border: 1px solid var(--
|
|
469
|
-
border-radius: 8px;
|
|
473
|
+
border: 1px solid var(--_selector-body-border-color);
|
|
474
|
+
border-radius: var(--ui3n-selector-body-border-radius, 8px);
|
|
470
475
|
|
|
471
476
|
.noData {
|
|
472
477
|
display: flex;
|
|
473
|
-
min-height: var(--
|
|
478
|
+
min-height: var(--_selector-item-min-height);
|
|
474
479
|
justify-content: flex-start;
|
|
475
480
|
align-items: center;
|
|
476
|
-
padding: var(--
|
|
477
|
-
font-size: var(--
|
|
481
|
+
padding: var(--_selector-item-padding) calc(var(--_selector-item-padding) * 2);
|
|
482
|
+
font-size: var(--_selector-item-font-size);
|
|
478
483
|
line-height: 1.33;
|
|
479
484
|
font-weight: 500;
|
|
480
485
|
color: var(--color-text-control-primary-default);
|
|
481
|
-
border-radius: var(--
|
|
486
|
+
border-radius: var(--_selector-item-border-radius);
|
|
482
487
|
}
|
|
483
488
|
|
|
484
489
|
.item {
|
|
485
490
|
display: flex;
|
|
486
|
-
min-height: var(--
|
|
491
|
+
min-height: var(--_selector-item-min-height);
|
|
487
492
|
justify-content: flex-start;
|
|
488
493
|
align-items: center;
|
|
489
|
-
padding: var(--
|
|
490
|
-
font-size: var(--
|
|
494
|
+
padding: var(--_selector-item-padding) calc(var(--_selector-item-padding) * 2);
|
|
495
|
+
font-size: var(--_selector-item-font-size);
|
|
491
496
|
line-height: 1.33;
|
|
492
497
|
font-weight: 500;
|
|
493
498
|
color: var(--color-text-control-primary-default);
|
|
494
|
-
border-radius: var(--
|
|
499
|
+
border-radius: var(--_selector-item-border-radius);
|
|
495
500
|
user-select: none;
|
|
496
501
|
cursor: pointer;
|
|
497
502
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import cloneDeep from 'lodash/cloneDeep';
|
|
4
4
|
import Ui3nTooltip from '../ui3n-tooltip/ui3n-tooltip.vue';
|
|
5
5
|
import { round } from '../../utils';
|
|
6
|
+
import { toCssLength } from '../../utils/ui/to-css-length';
|
|
6
7
|
import type { Nullable } from '../../types';
|
|
7
8
|
import type { UI3nSliderProps, UI3nSliderEmits, UI3nSliderExpose } from './types';
|
|
8
9
|
|
|
@@ -13,11 +14,6 @@
|
|
|
13
14
|
labelVisible: 'normal',
|
|
14
15
|
labelColor: 'var(--color-bg-block-tritery-default)',
|
|
15
16
|
labelTextColor: 'var(--color-text-block-darkery-default)',
|
|
16
|
-
activeColor: 'var(--color-bg-control-accent-default)',
|
|
17
|
-
trackColor: 'var(--color-bg-control-secondary-default)',
|
|
18
|
-
trackHeight: 8,
|
|
19
|
-
thumbSize: 16,
|
|
20
|
-
thumbColor: 'var(--color-bg-control-accent-default)',
|
|
21
17
|
});
|
|
22
18
|
const emits = defineEmits<UI3nSliderEmits>();
|
|
23
19
|
|
|
@@ -35,7 +31,6 @@
|
|
|
35
31
|
const innerValue = ref<number | [number, number]>(0);
|
|
36
32
|
const selectedPointer = ref<Nullable<1 | 2>>(null);
|
|
37
33
|
|
|
38
|
-
const thumbSizeCss = computed(() => `${props.thumbSize}px`);
|
|
39
34
|
const diff = computed(() => Number(props.max) - Number(props.min));
|
|
40
35
|
const innerStep = computed(() => (props.step ? Number(props.step) : diff.value / 100));
|
|
41
36
|
|
|
@@ -100,20 +95,34 @@
|
|
|
100
95
|
return props.transformValueMethod ? props.transformValueMethod(val) : `${val}`;
|
|
101
96
|
});
|
|
102
97
|
|
|
98
|
+
/* sizes and colours default in CSS; a prop, when given, wins as an inline variable */
|
|
103
99
|
const sliderStyle = computed(() => {
|
|
104
|
-
const
|
|
105
|
-
return {
|
|
106
|
-
'--ui3n-slider-height': `${height}px`,
|
|
107
|
-
'--ui3n-slider-label-color': props.labelColor,
|
|
108
|
-
'--ui3n-slider-label-text-color': props.labelTextColor,
|
|
109
|
-
'--ui3n-slider-active-color': props.activeColor,
|
|
110
|
-
'--ui3n-slider-track-color': props.trackColor,
|
|
111
|
-
'--ui3n-slider-track-height': `${props.trackHeight}px`,
|
|
112
|
-
'--ui3n-slider-thumb-size': `${props.thumbSize}px`,
|
|
113
|
-
'--ui3n-slider-thumb-color': props.thumbColor,
|
|
100
|
+
const styles: Record<string, string> = {
|
|
114
101
|
'--ui3n-slider-pointer1-position': pointer1PositionCss.value,
|
|
115
102
|
'--ui3n-slider-pointer2-position': pointer2PositionCss.value,
|
|
116
103
|
};
|
|
104
|
+
|
|
105
|
+
if (props.activeColor) {
|
|
106
|
+
styles['--ui3n-slider-active-color'] = props.activeColor;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (props.trackColor) {
|
|
110
|
+
styles['--ui3n-slider-track-color'] = props.trackColor;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (props.thumbColor) {
|
|
114
|
+
styles['--ui3n-slider-thumb-color'] = props.thumbColor;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (props.trackHeight !== undefined) {
|
|
118
|
+
styles['--ui3n-slider-track-height'] = toCssLength(props.trackHeight);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (props.thumbSize !== undefined) {
|
|
122
|
+
styles['--ui3n-slider-thumb-size'] = toCssLength(props.thumbSize);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return styles;
|
|
117
126
|
});
|
|
118
127
|
|
|
119
128
|
function onMouseenter(pointer: 1 | 2) {
|
|
@@ -262,6 +271,7 @@
|
|
|
262
271
|
<div
|
|
263
272
|
ref="sliderEl"
|
|
264
273
|
:id="id"
|
|
274
|
+
data-ui3n="slider"
|
|
265
275
|
:style="sliderStyle"
|
|
266
276
|
:class="[$style.ui3nSlider, disabled && $style.disabled]"
|
|
267
277
|
@click.stop.prevent="onTimelineClick"
|
|
@@ -346,9 +356,18 @@
|
|
|
346
356
|
|
|
347
357
|
<style lang="scss" module>
|
|
348
358
|
.ui3nSlider {
|
|
359
|
+
--_slider-track-height: var(--ui3n-slider-track-height, 8px);
|
|
360
|
+
--_slider-thumb-size: var(--ui3n-slider-thumb-size, 16px);
|
|
361
|
+
--_slider-thumb-color: var(--ui3n-slider-thumb-color, var(--color-bg-control-accent-default));
|
|
362
|
+
--_slider-track-color: var(--ui3n-slider-track-color, var(--color-bg-control-secondary-default));
|
|
363
|
+
--_slider-active-color: var(--ui3n-slider-active-color, var(--color-bg-control-accent-default));
|
|
364
|
+
|
|
365
|
+
/* the slider is as tall as the taller of the track and the thumb */
|
|
366
|
+
--_slider-height: var(--ui3n-slider-height, max(var(--_slider-track-height), var(--_slider-thumb-size)));
|
|
367
|
+
|
|
349
368
|
position: relative;
|
|
350
369
|
width: 100%;
|
|
351
|
-
height: var(--
|
|
370
|
+
height: var(--_slider-height);
|
|
352
371
|
display: flex;
|
|
353
372
|
justify-content: center;
|
|
354
373
|
align-items: center;
|
|
@@ -362,25 +381,25 @@
|
|
|
362
381
|
.track {
|
|
363
382
|
position: relative;
|
|
364
383
|
width: 100%;
|
|
365
|
-
height: var(--
|
|
366
|
-
background-color: var(--
|
|
367
|
-
border-radius: var(--
|
|
384
|
+
height: var(--_slider-track-height);
|
|
385
|
+
background-color: var(--_slider-track-color);
|
|
386
|
+
border-radius: var(--_slider-track-height);
|
|
368
387
|
cursor: pointer;
|
|
369
388
|
}
|
|
370
389
|
|
|
371
390
|
.active {
|
|
372
391
|
position: absolute;
|
|
373
|
-
height: var(--
|
|
374
|
-
background-color: var(--
|
|
375
|
-
border-radius: var(--
|
|
392
|
+
height: var(--_slider-track-height);
|
|
393
|
+
background-color: var(--_slider-active-color);
|
|
394
|
+
border-radius: var(--_slider-track-height);
|
|
376
395
|
}
|
|
377
396
|
|
|
378
397
|
.pointerWrapper {
|
|
379
398
|
position: absolute;
|
|
380
|
-
//top: calc(var(--
|
|
381
|
-
top: calc(var(--
|
|
382
|
-
width: var(--
|
|
383
|
-
height: var(--
|
|
399
|
+
//top: calc(var(--_slider-track-height) / 2 * -1);
|
|
400
|
+
top: calc(var(--_slider-track-height) * -1);
|
|
401
|
+
width: var(--_slider-thumb-size);
|
|
402
|
+
height: var(--_slider-thumb-size);
|
|
384
403
|
border-radius: 50%;
|
|
385
404
|
background-color: transparent;
|
|
386
405
|
cursor: pointer;
|
|
@@ -394,34 +413,34 @@
|
|
|
394
413
|
width: 100%;
|
|
395
414
|
height: 100%;
|
|
396
415
|
border-radius: 50%;
|
|
397
|
-
background-color: var(--
|
|
416
|
+
background-color: var(--_slider-thumb-color);
|
|
398
417
|
touch-action: none;
|
|
399
418
|
z-index: 5;
|
|
400
419
|
|
|
401
420
|
&:hover {
|
|
402
|
-
background-color: oklch(from var(--
|
|
421
|
+
background-color: oklch(from var(--_slider-thumb-color) calc(l + 0.1) c h);
|
|
403
422
|
}
|
|
404
423
|
|
|
405
424
|
&.selected::before {
|
|
406
425
|
position: absolute;
|
|
407
426
|
content: '';
|
|
408
|
-
width: calc(var(--
|
|
409
|
-
height: calc(var(--
|
|
427
|
+
width: calc(var(--_slider-thumb-size) * 2);
|
|
428
|
+
height: calc(var(--_slider-thumb-size) * 2);
|
|
410
429
|
left: 50%;
|
|
411
430
|
top: 50%;
|
|
412
431
|
transform: translate(-50%, -50%);
|
|
413
432
|
border-radius: 50%;
|
|
414
433
|
opacity: 0.2;
|
|
415
434
|
transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
|
|
416
|
-
background-color: var(--
|
|
435
|
+
background-color: var(--_slider-thumb-color);
|
|
417
436
|
}
|
|
418
437
|
}
|
|
419
438
|
|
|
420
439
|
.pointer1 {
|
|
421
|
-
left: var(--ui3n-slider-pointer1-position);
|
|
440
|
+
left: var(--ui3n-slider-pointer1-position, 0);
|
|
422
441
|
}
|
|
423
442
|
|
|
424
443
|
.pointer2 {
|
|
425
|
-
left: var(--ui3n-slider-pointer2-position);
|
|
444
|
+
left: var(--ui3n-slider-pointer2-position, 0);
|
|
426
445
|
}
|
|
427
446
|
</style>
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
<template>
|
|
14
14
|
<div
|
|
15
15
|
:id="id"
|
|
16
|
+
data-ui3n="step-line-bar"
|
|
16
17
|
:class="$style.ui3nStepLineBar"
|
|
17
18
|
>
|
|
18
19
|
<div :class="$style.label">
|
|
@@ -31,6 +32,9 @@
|
|
|
31
32
|
|
|
32
33
|
<style lang="scss" module>
|
|
33
34
|
.ui3nStepLineBar {
|
|
35
|
+
/* the step height doubles as its border radius */
|
|
36
|
+
--_step-line-bar-step-height: var(--ui3n-step-line-bar-step-height, 4px);
|
|
37
|
+
|
|
34
38
|
position: relative;
|
|
35
39
|
width: 100%;
|
|
36
40
|
}
|
|
@@ -39,11 +43,11 @@
|
|
|
39
43
|
position: relative;
|
|
40
44
|
width: 100%;
|
|
41
45
|
text-align: center;
|
|
42
|
-
font-size: var(--font-
|
|
46
|
+
font-size: var(--ui3n-step-line-bar-label-font-size, 14px);
|
|
43
47
|
font-weight: 500;
|
|
44
|
-
line-height: var(--
|
|
48
|
+
line-height: var(--ui3n-step-line-bar-label-line-height, 20px);
|
|
45
49
|
color: var(--color-text-block-accent-default);
|
|
46
|
-
margin-bottom: var(--
|
|
50
|
+
margin-bottom: var(--ui3n-step-line-bar-label-offset, 16px);
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
.body {
|
|
@@ -51,14 +55,14 @@
|
|
|
51
55
|
width: 100%;
|
|
52
56
|
justify-content: space-between;
|
|
53
57
|
align-items: center;
|
|
54
|
-
gap: var(--
|
|
58
|
+
gap: var(--ui3n-step-line-bar-gap, 8px);
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
.step {
|
|
58
62
|
position: relative;
|
|
59
63
|
flex: 1;
|
|
60
|
-
height: var(--
|
|
61
|
-
border-radius: var(--
|
|
64
|
+
height: var(--_step-line-bar-step-height);
|
|
65
|
+
border-radius: var(--_step-line-bar-step-height);
|
|
62
66
|
background-color: var(--color-bg-control-secondary-default);
|
|
63
67
|
}
|
|
64
68
|
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
<template>
|
|
62
62
|
<div
|
|
63
63
|
:id="id"
|
|
64
|
+
data-ui3n="switch"
|
|
64
65
|
:style="switchStyle"
|
|
65
66
|
:tabindex="disabled ? -1 : 0"
|
|
66
67
|
:class="[
|
|
@@ -95,12 +96,12 @@
|
|
|
95
96
|
|
|
96
97
|
<style lang="scss" module>
|
|
97
98
|
.ui3nSwitch {
|
|
98
|
-
--ui3n-switch-size
|
|
99
|
-
--ui3n-switch-color
|
|
100
|
-
--ui3n-switch-off-color
|
|
101
|
-
--ui3n-switch-font-size
|
|
102
|
-
--ui3n-switch-font-color
|
|
103
|
-
--ui3n-switch-font-weight
|
|
99
|
+
--_switch-size: var(--ui3n-switch-size, 16px);
|
|
100
|
+
--_switch-color: var(--ui3n-switch-color, var(--color-icon-control-accent-default));
|
|
101
|
+
--_switch-off-color: var(--ui3n-switch-off-color, var(--color-bg-table-cell-pressed));
|
|
102
|
+
--_switch-font-size: var(--ui3n-switch-font-size, 12px);
|
|
103
|
+
--_switch-font-color: var(--ui3n-switch-font-color, var(--color-text-control-primary-default));
|
|
104
|
+
--_switch-font-weight: var(--ui3n-switch-font-weight, 500);
|
|
104
105
|
|
|
105
106
|
position: relative;
|
|
106
107
|
display: inline-flex;
|
|
@@ -118,20 +119,20 @@
|
|
|
118
119
|
|
|
119
120
|
.body {
|
|
120
121
|
position: relative;
|
|
121
|
-
background-color: var(--
|
|
122
|
-
height: var(--
|
|
123
|
-
width: calc(var(--
|
|
124
|
-
border-radius: var(--
|
|
122
|
+
background-color: var(--_switch-off-color);
|
|
123
|
+
height: var(--_switch-size);
|
|
124
|
+
width: calc(var(--_switch-size) * 2);
|
|
125
|
+
border-radius: var(--_switch-size);
|
|
125
126
|
transition: background-color 0.2s ease;
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
.checked {
|
|
129
130
|
.body {
|
|
130
|
-
background-color: var(--
|
|
131
|
+
background-color: var(--_switch-color);
|
|
131
132
|
}
|
|
132
133
|
|
|
133
134
|
.dot {
|
|
134
|
-
border-color: var(--
|
|
135
|
+
border-color: var(--_switch-color);
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
138
|
|
|
@@ -140,30 +141,30 @@
|
|
|
140
141
|
}
|
|
141
142
|
|
|
142
143
|
.dot {
|
|
143
|
-
--ui3n-switch-dot-size
|
|
144
|
-
--ui3n-switch-dot-margin
|
|
144
|
+
--_switch-dot-size: var(--ui3n-switch-dot-size, calc(var(--_switch-size) / 4 * 3));
|
|
145
|
+
--_switch-dot-margin: var(--ui3n-switch-dot-margin, calc(var(--_switch-size) / 8));
|
|
145
146
|
|
|
146
147
|
position: absolute;
|
|
147
|
-
width: var(--
|
|
148
|
-
height: var(--
|
|
148
|
+
width: var(--_switch-dot-size);
|
|
149
|
+
height: var(--_switch-dot-size);
|
|
149
150
|
border-radius: 50%;
|
|
150
151
|
background-color: var(--color-bg-control-primary-default);
|
|
151
|
-
top: var(--
|
|
152
|
+
top: var(--_switch-dot-margin);
|
|
152
153
|
transition: left 200ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
.left {
|
|
156
|
-
left: var(--
|
|
157
|
+
left: var(--_switch-dot-margin);
|
|
157
158
|
}
|
|
158
159
|
|
|
159
160
|
.right {
|
|
160
|
-
left: calc(100% - var(--
|
|
161
|
+
left: calc(100% - var(--_switch-dot-size) - var(--_switch-dot-margin));
|
|
161
162
|
}
|
|
162
163
|
|
|
163
164
|
.label {
|
|
164
|
-
font-size: var(--
|
|
165
|
-
font-weight: var(--
|
|
166
|
-
color: var(--
|
|
165
|
+
font-size: var(--_switch-font-size);
|
|
166
|
+
font-weight: var(--_switch-font-weight);
|
|
167
|
+
color: var(--_switch-font-color);
|
|
167
168
|
user-select: none;
|
|
168
169
|
}
|
|
169
170
|
|