origam 2.9.0 → 2.11.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/dist/src/assets/css/main.css +1 -1
- package/dist/src/assets/css/tokens/dark.css +6 -4
- package/dist/src/assets/css/tokens/light.css +3 -2
- package/dist/src/assets/scss/tokens/_dark.scss +3 -2
- package/dist/src/assets/scss/tokens/_light.scss +3 -2
- package/dist/src/components/App/OrigamApp.vue +7 -6
- package/dist/src/components/Avatar/OrigamAvatar.vue +1 -1
- package/dist/src/components/Btn/OrigamBtnGroup.vue +26 -10
- package/dist/src/components/Checkbox/OrigamCheckboxBtn.vue +20 -1
- package/dist/src/components/ColorPicker/OrigamColorPickerPreview.vue +1 -1
- package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +33 -0
- package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +29 -0
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanel.vue +1 -1
- package/dist/src/components/Field/OrigamField.vue +32 -3
- package/dist/src/components/Label/OrigamLabel.vue +1 -1
- package/dist/src/components/Messages/OrigamMessages.vue +1 -1
- package/dist/src/components/Radio/OrigamRadioBtn.vue +20 -1
- package/dist/src/components/SelectionControl/OrigamSelectionControl.vue +48 -4
- package/dist/src/components/SliderField/OrigamSliderField.vue +23 -12
- package/dist/src/components/Tabs/OrigamTab.vue +1 -1
- package/dist/src/components/Tabs/OrigamTabs.vue +1 -1
- package/dist/src/interfaces/SelectionControl/selection-control.interface.d.ts +13 -2
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -880,8 +880,8 @@
|
|
|
880
880
|
--origam-field__input---padding-block-xl: 14px;
|
|
881
881
|
--origam-field__input---padding-top: var(--origam-field__input---padding-block-md);
|
|
882
882
|
--origam-field__input---padding-bottom: var(--origam-field__input---padding-block-md);
|
|
883
|
-
--origam-field__input---padding-start:
|
|
884
|
-
--origam-field__input---padding-end:
|
|
883
|
+
--origam-field__input---padding-start: 0;
|
|
884
|
+
--origam-field__input---padding-end: 0;
|
|
885
885
|
--origam-field__input---opacity: 0.7;
|
|
886
886
|
--origam-field__label---font-size: 0.75em;
|
|
887
887
|
--origam-field__label---transition-duration: var(--origam-motion__duration---normal);
|
|
@@ -2255,6 +2255,7 @@
|
|
|
2255
2255
|
--origam-slider-field---padding-block: var(--origam-space---2);
|
|
2256
2256
|
--origam-slider-field---transition-duration: var(--origam-motion__duration---fast);
|
|
2257
2257
|
--origam-slider-field---transition-timing-function: var(--origam-motion__easing---standard);
|
|
2258
|
+
--origam-slider-field---border-radius: var(--origam-radius---full);
|
|
2258
2259
|
--origam-slider-field__track---height: 4px;
|
|
2259
2260
|
--origam-slider-field__track---background-color: var(--origam-color__surface---disabled);
|
|
2260
2261
|
--origam-slider-field__track---border-radius: var(--origam-radius---full);
|
|
@@ -3651,8 +3652,8 @@
|
|
|
3651
3652
|
--origam-field__input---padding-block-xl: 14px;
|
|
3652
3653
|
--origam-field__input---padding-top: var(--origam-field__input---padding-block-md);
|
|
3653
3654
|
--origam-field__input---padding-bottom: var(--origam-field__input---padding-block-md);
|
|
3654
|
-
--origam-field__input---padding-start:
|
|
3655
|
-
--origam-field__input---padding-end:
|
|
3655
|
+
--origam-field__input---padding-start: 0;
|
|
3656
|
+
--origam-field__input---padding-end: 0;
|
|
3656
3657
|
--origam-field__input---opacity: 0.7;
|
|
3657
3658
|
--origam-field__label---font-size: 0.75em;
|
|
3658
3659
|
--origam-field__label---transition-duration: var(--origam-motion__duration---normal);
|
|
@@ -5026,6 +5027,7 @@
|
|
|
5026
5027
|
--origam-slider-field---padding-block: var(--origam-space---2);
|
|
5027
5028
|
--origam-slider-field---transition-duration: var(--origam-motion__duration---fast);
|
|
5028
5029
|
--origam-slider-field---transition-timing-function: var(--origam-motion__easing---standard);
|
|
5030
|
+
--origam-slider-field---border-radius: var(--origam-radius---full);
|
|
5029
5031
|
--origam-slider-field__track---height: 4px;
|
|
5030
5032
|
--origam-slider-field__track---background-color: var(--origam-color__surface---disabled);
|
|
5031
5033
|
--origam-slider-field__track---border-radius: var(--origam-radius---full);
|
|
@@ -881,8 +881,8 @@
|
|
|
881
881
|
--origam-field__input---padding-block-xl: 14px;
|
|
882
882
|
--origam-field__input---padding-top: var(--origam-field__input---padding-block-md);
|
|
883
883
|
--origam-field__input---padding-bottom: var(--origam-field__input---padding-block-md);
|
|
884
|
-
--origam-field__input---padding-start:
|
|
885
|
-
--origam-field__input---padding-end:
|
|
884
|
+
--origam-field__input---padding-start: 0;
|
|
885
|
+
--origam-field__input---padding-end: 0;
|
|
886
886
|
--origam-field__input---opacity: 0.7;
|
|
887
887
|
--origam-field__label---font-size: 0.75em;
|
|
888
888
|
--origam-field__label---transition-duration: var(--origam-motion__duration---normal);
|
|
@@ -2256,6 +2256,7 @@
|
|
|
2256
2256
|
--origam-slider-field---padding-block: var(--origam-space---2);
|
|
2257
2257
|
--origam-slider-field---transition-duration: var(--origam-motion__duration---fast);
|
|
2258
2258
|
--origam-slider-field---transition-timing-function: var(--origam-motion__easing---standard);
|
|
2259
|
+
--origam-slider-field---border-radius: var(--origam-radius---full);
|
|
2259
2260
|
--origam-slider-field__track---height: 4px;
|
|
2260
2261
|
--origam-slider-field__track---background-color: var(--origam-color__surface---disabled);
|
|
2261
2262
|
--origam-slider-field__track---border-radius: var(--origam-radius---full);
|
|
@@ -880,8 +880,8 @@
|
|
|
880
880
|
--origam-field__input---padding-block-xl: 14px;
|
|
881
881
|
--origam-field__input---padding-top: var(--origam-field__input---padding-block-md);
|
|
882
882
|
--origam-field__input---padding-bottom: var(--origam-field__input---padding-block-md);
|
|
883
|
-
--origam-field__input---padding-start:
|
|
884
|
-
--origam-field__input---padding-end:
|
|
883
|
+
--origam-field__input---padding-start: 0;
|
|
884
|
+
--origam-field__input---padding-end: 0;
|
|
885
885
|
--origam-field__input---opacity: 0.7;
|
|
886
886
|
--origam-field__label---font-size: 0.75em;
|
|
887
887
|
--origam-field__label---transition-duration: var(--origam-motion__duration---normal);
|
|
@@ -2255,6 +2255,7 @@
|
|
|
2255
2255
|
--origam-slider-field---padding-block: var(--origam-space---2);
|
|
2256
2256
|
--origam-slider-field---transition-duration: var(--origam-motion__duration---fast);
|
|
2257
2257
|
--origam-slider-field---transition-timing-function: var(--origam-motion__easing---standard);
|
|
2258
|
+
--origam-slider-field---border-radius: var(--origam-radius---full);
|
|
2258
2259
|
--origam-slider-field__track---height: 4px;
|
|
2259
2260
|
--origam-slider-field__track---background-color: var(--origam-color__surface---disabled);
|
|
2260
2261
|
--origam-slider-field__track---border-radius: var(--origam-radius---full);
|
|
@@ -881,8 +881,8 @@
|
|
|
881
881
|
--origam-field__input---padding-block-xl: 14px;
|
|
882
882
|
--origam-field__input---padding-top: var(--origam-field__input---padding-block-md);
|
|
883
883
|
--origam-field__input---padding-bottom: var(--origam-field__input---padding-block-md);
|
|
884
|
-
--origam-field__input---padding-start:
|
|
885
|
-
--origam-field__input---padding-end:
|
|
884
|
+
--origam-field__input---padding-start: 0;
|
|
885
|
+
--origam-field__input---padding-end: 0;
|
|
886
886
|
--origam-field__input---opacity: 0.7;
|
|
887
887
|
--origam-field__label---font-size: 0.75em;
|
|
888
888
|
--origam-field__label---transition-duration: var(--origam-motion__duration---normal);
|
|
@@ -2256,6 +2256,7 @@
|
|
|
2256
2256
|
--origam-slider-field---padding-block: var(--origam-space---2);
|
|
2257
2257
|
--origam-slider-field---transition-duration: var(--origam-motion__duration---fast);
|
|
2258
2258
|
--origam-slider-field---transition-timing-function: var(--origam-motion__easing---standard);
|
|
2259
|
+
--origam-slider-field---border-radius: var(--origam-radius---full);
|
|
2259
2260
|
--origam-slider-field__track---height: 4px;
|
|
2260
2261
|
--origam-slider-field__track---background-color: var(--origam-color__surface---disabled);
|
|
2261
2262
|
--origam-slider-field__track---border-radius: var(--origam-radius---full);
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
ref="origamAppRef"
|
|
5
5
|
:class="appClasses"
|
|
6
6
|
:style="appStyles"
|
|
7
|
-
:color="color"
|
|
8
|
-
:bg-color="bgColor"
|
|
9
|
-
:full-height="fullHeight"
|
|
10
|
-
:overlaps="overlaps"
|
|
7
|
+
:color="props.color"
|
|
8
|
+
:bg-color="props.bgColor"
|
|
9
|
+
:full-height="props.fullHeight"
|
|
10
|
+
:overlaps="props.overlaps"
|
|
11
11
|
>
|
|
12
12
|
<template #default>
|
|
13
13
|
<slot name="default"/>
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
|
|
18
18
|
<script lang="ts" setup>
|
|
19
19
|
import { OrigamLayout } from "../../components";
|
|
20
|
-
import { useProps, useRtl, useStyle } from "../../composables";
|
|
20
|
+
import { useDefaults, useProps, useRtl, useStyle } from "../../composables";
|
|
21
21
|
import { computed, ref, StyleValue } from "vue";
|
|
22
|
-
const
|
|
22
|
+
const _props = defineProps({
|
|
23
23
|
fullHeight: { type: Boolean, required: false, default: true },
|
|
24
24
|
overlaps: { type: Array, required: false },
|
|
25
25
|
id: { type: String, required: false },
|
|
@@ -28,6 +28,7 @@ const props = defineProps({
|
|
|
28
28
|
color: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
29
29
|
bgColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true }
|
|
30
30
|
});
|
|
31
|
+
const props = useDefaults(_props);
|
|
31
32
|
const { filterProps } = useProps(props);
|
|
32
33
|
const { rtlClasses } = useRtl();
|
|
33
34
|
const origamAppRef = ref();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
|
-
:is="tag"
|
|
3
|
+
:is="props.tag"
|
|
4
4
|
:id="id"
|
|
5
5
|
role="group"
|
|
6
6
|
:class="btnGroupClasses"
|
|
@@ -30,6 +30,7 @@ import { OrigamBtn, OrigamDefaultsProvider } from "../../components";
|
|
|
30
30
|
import {
|
|
31
31
|
useDefaults,
|
|
32
32
|
useDensity,
|
|
33
|
+
usePassedProps,
|
|
33
34
|
useProps,
|
|
34
35
|
useSize,
|
|
35
36
|
useStateEffect,
|
|
@@ -37,6 +38,7 @@ import {
|
|
|
37
38
|
useVariant
|
|
38
39
|
} from "../../composables";
|
|
39
40
|
import { DENSITY } from "../../enums";
|
|
41
|
+
import { omitUndefined } from "../../utils";
|
|
40
42
|
import { computed, StyleValue, useSlots } from "vue";
|
|
41
43
|
const _props = defineProps({
|
|
42
44
|
divided: { type: Boolean, required: false },
|
|
@@ -89,19 +91,33 @@ const _props = defineProps({
|
|
|
89
91
|
});
|
|
90
92
|
const props = useDefaults(_props);
|
|
91
93
|
const { filterProps } = useProps(props);
|
|
94
|
+
const wasPropPassed = usePassedProps(props);
|
|
92
95
|
const slotDefaults = computed(() => ({
|
|
93
|
-
"origam-btn": {
|
|
96
|
+
"origam-btn": omitUndefined({
|
|
97
|
+
// `variant` is the ONE deliberate exception, kept unconditional:
|
|
98
|
+
// `--variant-text` (the group's own root default, and every
|
|
99
|
+
// child's own component default) has NO active-state background
|
|
100
|
+
// rule at all — only `outlined`/`tonal` paint a filled surface
|
|
101
|
+
// on the selected segment (see OrigamBtn.vue's
|
|
102
|
+
// `&--variant-outlined { &--active { background-color: ... } }`).
|
|
103
|
+
// The group's OWN resolved `variant` (whether explicitly passed,
|
|
104
|
+
// or resolved from a theme's `'origam-btn-group'` defaults) must
|
|
105
|
+
// always reach the children — else a themed
|
|
106
|
+
// `<origam-btn-toggle variant="outlined">` gets the right root
|
|
107
|
+
// chrome but every child silently stays on 'text', so the active
|
|
108
|
+
// segment never fills — no visible selection at all.
|
|
94
109
|
variant: props.variant,
|
|
95
|
-
density: props.density,
|
|
96
|
-
color: props.color,
|
|
97
|
-
bgColor: props.bgColor,
|
|
98
|
-
size: props.size,
|
|
110
|
+
density: wasPropPassed("density") ? props.density : void 0,
|
|
111
|
+
color: wasPropPassed("color") ? props.color : void 0,
|
|
112
|
+
bgColor: wasPropPassed("bgColor") ? props.bgColor : void 0,
|
|
113
|
+
size: wasPropPassed("size") ? props.size : void 0,
|
|
99
114
|
// New API: `hover` / `active` accept boolean | IHoverState |
|
|
100
115
|
// IActiveState; pass-through propagates the parent's intent
|
|
101
|
-
// override to each child OrigamBtn
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
116
|
+
// override to each child OrigamBtn — only when the consumer
|
|
117
|
+
// actually set it.
|
|
118
|
+
hover: wasPropPassed("hover") ? props.hover : void 0,
|
|
119
|
+
active: wasPropPassed("active") ? props.active : void 0
|
|
120
|
+
})
|
|
105
121
|
}));
|
|
106
122
|
const items = computed(() => props.items ?? []);
|
|
107
123
|
const slots = useSlots();
|
|
@@ -77,7 +77,26 @@ const props = defineProps({
|
|
|
77
77
|
bgColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
78
78
|
active: { type: [Boolean, Object], required: false },
|
|
79
79
|
activeClass: { type: String, required: false },
|
|
80
|
-
hover: { type: [Boolean, Object], required: false }
|
|
80
|
+
hover: { type: [Boolean, Object], required: false },
|
|
81
|
+
border: { type: [Boolean, Number, String, Array], required: false, skipCheck: true },
|
|
82
|
+
borderTop: { type: [Boolean, Number, String], required: false },
|
|
83
|
+
borderLeft: { type: [Boolean, Number, String], required: false },
|
|
84
|
+
borderBottom: { type: [Boolean, Number, String], required: false },
|
|
85
|
+
borderRight: { type: [Boolean, Number, String], required: false },
|
|
86
|
+
borderBlock: { type: [Boolean, Number, String], required: false },
|
|
87
|
+
borderInline: { type: [Boolean, Number, String], required: false },
|
|
88
|
+
borderColor: { type: String, required: false },
|
|
89
|
+
borderStyle: { type: String, required: false },
|
|
90
|
+
borderTopColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
91
|
+
borderRightColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
92
|
+
borderBottomColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
93
|
+
borderLeftColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
94
|
+
rounded: { type: [Boolean, Number, String, null], required: false, skipCheck: true },
|
|
95
|
+
roundedTopRight: { type: [Boolean, Number, String], required: false },
|
|
96
|
+
roundedTopLeft: { type: [Boolean, Number, String], required: false },
|
|
97
|
+
roundedBottomLeft: { type: [Boolean, Number, String], required: false },
|
|
98
|
+
roundedBottomRight: { type: [Boolean, Number, String], required: false },
|
|
99
|
+
elevation: { type: [Number, String], required: false }
|
|
81
100
|
});
|
|
82
101
|
const emits = defineEmits(["update:indeterminate", "update:modelValue", "update:focused", "click:label"]);
|
|
83
102
|
defineSlots();
|
|
@@ -404,6 +404,22 @@ defineExpose(forwardRefs({
|
|
|
404
404
|
padding-bottom: 0;
|
|
405
405
|
padding-inline-start: 0;
|
|
406
406
|
overflow: hidden;
|
|
407
|
+
border-start-start-radius: var(--origam-field---border-radius, 8px);
|
|
408
|
+
border-end-start-radius: var(--origam-field---border-radius, 8px);
|
|
409
|
+
|
|
410
|
+
// The swatch must sit FLUSH against the field's inline-start edge.
|
|
411
|
+
// `OrigamField` applies `--origam-field---padding-start` to the whole
|
|
412
|
+
// grid (prepend-inner included), so any consumer that raises it pushes
|
|
413
|
+
// the swatch inward and opens a gap between the colour and the left
|
|
414
|
+
// border. The Theme Builder does exactly this — it forces
|
|
415
|
+
// `--origam-field---padding-start: 14px` on prepended control fields to
|
|
416
|
+
// widen the outline's start leg so the left corner rounds — which left
|
|
417
|
+
// a ~14px gap in front of the swatch. Cancel the padding for the
|
|
418
|
+
// prepend cell only (negative margin = -padding-start) so the swatch
|
|
419
|
+
// bleeds back to the edge while the outline keeps its rounded corner.
|
|
420
|
+
// No-op when padding-start resolves to 0 (the component's own default),
|
|
421
|
+
// so there is zero regression for plain consumers.
|
|
422
|
+
margin-inline-start: calc(-1 * var(--origam-field---padding-start, 0px));
|
|
407
423
|
|
|
408
424
|
> .origam-sheet {
|
|
409
425
|
width: var(--origam-color-picker-field__swatch---width, 24px);
|
|
@@ -418,6 +434,10 @@ defineExpose(forwardRefs({
|
|
|
418
434
|
font-family: var(--origam-font__family---mono);
|
|
419
435
|
font-size: 0.875em;
|
|
420
436
|
letter-spacing: 0.03em;
|
|
437
|
+
overflow: hidden;
|
|
438
|
+
text-overflow: ellipsis;
|
|
439
|
+
white-space: nowrap;
|
|
440
|
+
min-width: 0;
|
|
421
441
|
}
|
|
422
442
|
|
|
423
443
|
// `.origam-field__input` is `display: flex; flex-wrap: wrap` by
|
|
@@ -432,8 +452,21 @@ defineExpose(forwardRefs({
|
|
|
432
452
|
// `colorSelection` span is the real display value) — forcing
|
|
433
453
|
// `nowrap` lets the invisible native input shrink instead of
|
|
434
454
|
// pushing a wrap, with zero visual loss.
|
|
455
|
+
// Same single-line fix as OrigamSelect: the underlying native
|
|
456
|
+
// `<input>` is taken OUT of flow (`position: absolute`, `flex: 0 0`)
|
|
457
|
+
// so it can't sit beside the formatted hex `colorSelection` span and
|
|
458
|
+
// push the field onto a second line. The span is the real display
|
|
459
|
+
// value; the input only carries focus / the editable value. `nowrap`
|
|
460
|
+
// alone was insufficient — the in-flow input still forced a wrap in a
|
|
461
|
+
// narrow container.
|
|
435
462
|
:deep(.origam-field__input) {
|
|
436
463
|
flex-wrap: nowrap;
|
|
464
|
+
|
|
465
|
+
> input {
|
|
466
|
+
position: absolute;
|
|
467
|
+
flex: 0 0;
|
|
468
|
+
min-width: 0;
|
|
469
|
+
}
|
|
437
470
|
}
|
|
438
471
|
}
|
|
439
472
|
</style>
|
|
@@ -509,3 +509,32 @@ defineExpose(forwardRefs({
|
|
|
509
509
|
isLoaded
|
|
510
510
|
}, origamTextFieldRef));
|
|
511
511
|
</script>
|
|
512
|
+
|
|
513
|
+
<style lang="scss" scoped>
|
|
514
|
+
.origam-date-picker-field {
|
|
515
|
+
:deep(.origam-date-picker-field__selection-text) {
|
|
516
|
+
overflow: hidden;
|
|
517
|
+
text-overflow: ellipsis;
|
|
518
|
+
white-space: nowrap;
|
|
519
|
+
min-width: 0;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// Same single-line fix as OrigamSelect / OrigamColorPickerField: the
|
|
523
|
+
// underlying native `<input>` is taken OUT of flow so it can't sit
|
|
524
|
+
// beside the formatted `selectionText`/`rangeSelection` span and push
|
|
525
|
+
// the field onto a second line. The span is the real display value;
|
|
526
|
+
// the input only carries focus / the editable value. `nowrap` alone
|
|
527
|
+
// is insufficient — the in-flow input still forces a wrap in a
|
|
528
|
+
// narrow container (confirmed: 61px vs 36px at 150px width on the
|
|
529
|
+
// range variant).
|
|
530
|
+
:deep(.origam-field__input) {
|
|
531
|
+
flex-wrap: nowrap;
|
|
532
|
+
|
|
533
|
+
> input {
|
|
534
|
+
position: absolute;
|
|
535
|
+
flex: 0 0;
|
|
536
|
+
min-width: 0;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
</style>
|
|
@@ -519,7 +519,14 @@ defineExpose({
|
|
|
519
519
|
flex: 1 0;
|
|
520
520
|
grid-area: control;
|
|
521
521
|
position: relative;
|
|
522
|
-
|
|
522
|
+
// Corner-clearing: when the corner radius is larger than the inline
|
|
523
|
+
// padding, the text / floating label collide with the rounded outline.
|
|
524
|
+
// Floor the inline padding at the effective radius (capped at the control
|
|
525
|
+
// height for pills). Prepended fields opt out below — their prepend icon
|
|
526
|
+
// already fills the corner.
|
|
527
|
+
padding-inline:
|
|
528
|
+
max(var(--origam-field---padding-start), min(var(--origam-field---border-radius, 8px), var(--origam-input__control---height, 36px)))
|
|
529
|
+
var(--origam-field---padding-end);
|
|
523
530
|
backdrop-filter: var(--origam-field---backdrop-filter, none);
|
|
524
531
|
-webkit-backdrop-filter: var(--origam-field---backdrop-filter, none);
|
|
525
532
|
|
|
@@ -704,7 +711,7 @@ defineExpose({
|
|
|
704
711
|
|
|
705
712
|
#{$this}__outline {
|
|
706
713
|
&--start {
|
|
707
|
-
flex: 0 0 var(--origam-field---padding-start);
|
|
714
|
+
flex: 0 0 max(var(--origam-field---padding-start), min(var(--origam-field---border-radius, 8px), var(--origam-input__control---height, 36px)));
|
|
708
715
|
}
|
|
709
716
|
|
|
710
717
|
&--end {
|
|
@@ -775,6 +782,16 @@ defineExpose({
|
|
|
775
782
|
|
|
776
783
|
&--prepended {
|
|
777
784
|
--origam-field---padding-start: 6px;
|
|
785
|
+
|
|
786
|
+
// A prepend-inner (icon / swatch) already fills the left corner, so
|
|
787
|
+
// opt out of the corner-clearing floor: keep the inline padding and
|
|
788
|
+
// the start outline leg at the raw padding-start (widening them would
|
|
789
|
+
// draw the outline over the prepend content).
|
|
790
|
+
padding-inline: var(--origam-field---padding-start) var(--origam-field---padding-end);
|
|
791
|
+
|
|
792
|
+
#{$this}__outline--start {
|
|
793
|
+
flex-basis: var(--origam-field---padding-start);
|
|
794
|
+
}
|
|
778
795
|
}
|
|
779
796
|
|
|
780
797
|
&--appended {
|
|
@@ -974,7 +991,19 @@ defineExpose({
|
|
|
974
991
|
&#{$this}__label--floating {
|
|
975
992
|
transform: translateY(-50%);
|
|
976
993
|
transform-origin: center;
|
|
977
|
-
|
|
994
|
+
// Align the floating label's inline-start with the input
|
|
995
|
+
// text (and the resting label), both of which sit at
|
|
996
|
+
// `--origam-field__input---padding-start`. The old hard
|
|
997
|
+
// `margin: 0 4px` pinned the floating label to the notch
|
|
998
|
+
// corner instead, leaving it inset by (input-padding − 4)
|
|
999
|
+
// px LESS than the value — a visible label/value
|
|
1000
|
+
// misalignment that grows with the corner radius (most
|
|
1001
|
+
// obvious on large-radius themes, e.g. cartoon `rounded-lg`,
|
|
1002
|
+
// where it read as "the input is more indented than the
|
|
1003
|
+
// label"). Keep the 4px on the inline-end for notch
|
|
1004
|
+
// breathing room.
|
|
1005
|
+
margin-block: 0;
|
|
1006
|
+
margin-inline: var(--origam-field__input---padding-start, 0) 4px;
|
|
978
1007
|
}
|
|
979
1008
|
}
|
|
980
1009
|
|
|
@@ -73,7 +73,26 @@ const props = defineProps({
|
|
|
73
73
|
bgColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
74
74
|
active: { type: [Boolean, Object], required: false },
|
|
75
75
|
activeClass: { type: String, required: false },
|
|
76
|
-
hover: { type: [Boolean, Object], required: false }
|
|
76
|
+
hover: { type: [Boolean, Object], required: false },
|
|
77
|
+
border: { type: [Boolean, Number, String, Array], required: false, skipCheck: true },
|
|
78
|
+
borderTop: { type: [Boolean, Number, String], required: false },
|
|
79
|
+
borderLeft: { type: [Boolean, Number, String], required: false },
|
|
80
|
+
borderBottom: { type: [Boolean, Number, String], required: false },
|
|
81
|
+
borderRight: { type: [Boolean, Number, String], required: false },
|
|
82
|
+
borderBlock: { type: [Boolean, Number, String], required: false },
|
|
83
|
+
borderInline: { type: [Boolean, Number, String], required: false },
|
|
84
|
+
borderColor: { type: String, required: false },
|
|
85
|
+
borderStyle: { type: String, required: false },
|
|
86
|
+
borderTopColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
87
|
+
borderRightColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
88
|
+
borderBottomColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
89
|
+
borderLeftColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
90
|
+
rounded: { type: [Boolean, Number, String, null], required: false, skipCheck: true },
|
|
91
|
+
roundedTopRight: { type: [Boolean, Number, String], required: false },
|
|
92
|
+
roundedTopLeft: { type: [Boolean, Number, String], required: false },
|
|
93
|
+
roundedBottomLeft: { type: [Boolean, Number, String], required: false },
|
|
94
|
+
roundedBottomRight: { type: [Boolean, Number, String], required: false },
|
|
95
|
+
elevation: { type: [Number, String], required: false }
|
|
77
96
|
});
|
|
78
97
|
const emits = defineEmits(["update:modelValue", "update:focused", "click:label"]);
|
|
79
98
|
const { filterProps } = useProps(props);
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
<div
|
|
17
17
|
v-ripple="rippleProp"
|
|
18
|
-
class="
|
|
18
|
+
:class="selectionControlInputClasses"
|
|
19
|
+
:style="selectionControlInputStyles"
|
|
19
20
|
>
|
|
20
21
|
<slot
|
|
21
22
|
name="input"
|
|
@@ -69,10 +70,13 @@ import { computed, inject, nextTick, ref, shallowRef, StyleValue, useAttrs } fro
|
|
|
69
70
|
import { ORIGAM_SELECTION_CONTROL_GROUP_KEY } from "../../consts";
|
|
70
71
|
import { OrigamIcon, OrigamLabel } from "../../components";
|
|
71
72
|
import {
|
|
73
|
+
useBorder,
|
|
72
74
|
useDefaults,
|
|
73
75
|
useDensity,
|
|
76
|
+
useElevation,
|
|
74
77
|
useHover,
|
|
75
78
|
useProps,
|
|
79
|
+
useRounded,
|
|
76
80
|
useStateEffect,
|
|
77
81
|
useStyle,
|
|
78
82
|
useTextColor,
|
|
@@ -108,7 +112,26 @@ const _props = defineProps({
|
|
|
108
112
|
bgColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
109
113
|
active: { type: [Boolean, Object], required: false },
|
|
110
114
|
activeClass: { type: String, required: false },
|
|
111
|
-
hover: { type: [Boolean, Object], required: false }
|
|
115
|
+
hover: { type: [Boolean, Object], required: false },
|
|
116
|
+
border: { type: [Boolean, Number, String, Array], required: false, skipCheck: true },
|
|
117
|
+
borderTop: { type: [Boolean, Number, String], required: false },
|
|
118
|
+
borderLeft: { type: [Boolean, Number, String], required: false },
|
|
119
|
+
borderBottom: { type: [Boolean, Number, String], required: false },
|
|
120
|
+
borderRight: { type: [Boolean, Number, String], required: false },
|
|
121
|
+
borderBlock: { type: [Boolean, Number, String], required: false },
|
|
122
|
+
borderInline: { type: [Boolean, Number, String], required: false },
|
|
123
|
+
borderColor: { type: String, required: false },
|
|
124
|
+
borderStyle: { type: String, required: false },
|
|
125
|
+
borderTopColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
126
|
+
borderRightColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
127
|
+
borderBottomColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
128
|
+
borderLeftColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
129
|
+
rounded: { type: [Boolean, Number, String, null], required: false, skipCheck: true },
|
|
130
|
+
roundedTopRight: { type: [Boolean, Number, String], required: false },
|
|
131
|
+
roundedTopLeft: { type: [Boolean, Number, String], required: false },
|
|
132
|
+
roundedBottomLeft: { type: [Boolean, Number, String], required: false },
|
|
133
|
+
roundedBottomRight: { type: [Boolean, Number, String], required: false },
|
|
134
|
+
elevation: { type: [Number, String], required: false }
|
|
112
135
|
});
|
|
113
136
|
const props = useDefaults(_props);
|
|
114
137
|
const emits = defineEmits(["click:label", "update:modelValue"]);
|
|
@@ -202,6 +225,9 @@ const bgColor = computed(() => {
|
|
|
202
225
|
return model.value ? props.activeBgColor || props.bgColor : props.bgColor;
|
|
203
226
|
});
|
|
204
227
|
const { textColorClasses: wrapperColorClasses, textColorStyles: wrapperColorStyles } = useTextColor(color);
|
|
228
|
+
const { borderClasses, borderStyles } = useBorder(props);
|
|
229
|
+
const { roundedClasses, roundedStyles } = useRounded(props);
|
|
230
|
+
const { elevationClasses, elevationStyles } = useElevation(props);
|
|
205
231
|
const rippleProp = computed(() => {
|
|
206
232
|
if (props.ripple) {
|
|
207
233
|
return [!props.disabled && !props.readonly, null, ["center", "circle"]];
|
|
@@ -219,6 +245,21 @@ const selectionControlWrapperClasses = computed(() => {
|
|
|
219
245
|
wrapperColorClasses.value
|
|
220
246
|
];
|
|
221
247
|
});
|
|
248
|
+
const selectionControlInputClasses = computed(() => {
|
|
249
|
+
return [
|
|
250
|
+
"origam-selection-control__input",
|
|
251
|
+
borderClasses.value,
|
|
252
|
+
roundedClasses.value,
|
|
253
|
+
elevationClasses.value
|
|
254
|
+
];
|
|
255
|
+
});
|
|
256
|
+
const selectionControlInputStyles = computed(() => {
|
|
257
|
+
return [
|
|
258
|
+
borderStyles.value,
|
|
259
|
+
roundedStyles.value,
|
|
260
|
+
elevationStyles.value
|
|
261
|
+
];
|
|
262
|
+
});
|
|
222
263
|
const selectionControlClasses = computed(() => {
|
|
223
264
|
return [
|
|
224
265
|
"origam-selection-control",
|
|
@@ -254,7 +295,6 @@ defineExpose(forwardRefs({
|
|
|
254
295
|
contain: layout;
|
|
255
296
|
display: flex;
|
|
256
297
|
flex: 1 0;
|
|
257
|
-
grid-area: control;
|
|
258
298
|
position: relative;
|
|
259
299
|
user-select: none;
|
|
260
300
|
|
|
@@ -307,7 +347,11 @@ defineExpose(forwardRefs({
|
|
|
307
347
|
left: 0;
|
|
308
348
|
width: 100%;
|
|
309
349
|
height: 100%;
|
|
310
|
-
|
|
350
|
+
// Le halo suit la forme du contrôle. Codé en dur à 100%, il restait
|
|
351
|
+
// circulaire même sous `rounded="md"` : la seule surface que la prop
|
|
352
|
+
// pouvait peindre au repos ignorait la prop. `inherit` reprend le
|
|
353
|
+
// border-radius résolu par `useRounded` sur `__input`.
|
|
354
|
+
border-radius: inherit;
|
|
311
355
|
background-color: currentColor;
|
|
312
356
|
opacity: 0;
|
|
313
357
|
pointer-events: none;
|