tandd-ui 0.2.0 → 0.2.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/CHANGELOG.md +10 -0
- package/dist/components/select/DTSelect.vue.d.ts +5 -0
- package/dist/components/tree-select/DTTreeSelect.vue.d.ts +4 -1
- package/dist/index.d.ts +1 -1
- package/dist/tandd-ui.css +131 -0
- package/dist/tandd-ui.js +4148 -4146
- package/package.json +1 -1
- package/src/components/select/DTSelect.scss +150 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.1 (2026-11-11)
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **DTSelect and DTTreeSelect `variant`:** `soft` (default), `outlined`, `filled`, `underlined`, `plain`, matching DTInput. Set it app-wide with the same option as the text fields: `createTanDDUI({ global: { defaults: { DTInput: { variant: "outlined" } } } })` changes inputs and selects together; a `variant` prop on one select still wins. Outlined, underlined, and plain float the label onto the field exactly where DTInput puts it.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **DTSelect and DTTreeSelect default look:** the trigger now uses the `soft` fill, like DTInput's default, instead of the plain surface. Set `variant="outlined"` (or the app-wide default) for a white field with a border.
|
|
12
|
+
|
|
3
13
|
## 0.2.0 (2026-11-11): component rebuild (0.x, breaking)
|
|
4
14
|
|
|
5
15
|
First release on npm (`npm install tandd-ui`), under the MIT license.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'vue';
|
|
2
2
|
export type DTSelectItem = string | number | Record<string, unknown>;
|
|
3
3
|
export type DTSelectSize = "sm" | "md" | "lg";
|
|
4
|
+
/** The field look, as DTInput: soft (default), outlined, filled, underlined, plain. */
|
|
5
|
+
export type DTSelectVariant = "soft" | "outlined" | "filled" | "underlined" | "plain";
|
|
4
6
|
/** Panel options (`menu-props`). */
|
|
5
7
|
export interface DTSelectMenuProps {
|
|
6
8
|
/** Largest panel height: a px number or a CSS length. Default 360 px (or the viewport, whichever is smaller). */
|
|
@@ -34,6 +36,8 @@ type __VLS_Props = {
|
|
|
34
36
|
clearable?: boolean;
|
|
35
37
|
/** Trigger height 32, 40, or 48 px, matching DTInput. Default: `global.defaults.DTInput.size`, else md. */
|
|
36
38
|
size?: DTSelectSize;
|
|
39
|
+
/** Field look, matching DTInput. Default: `global.defaults.DTInput.variant`, else soft. */
|
|
40
|
+
variant?: DTSelectVariant;
|
|
37
41
|
/** Shows the value but cannot be opened, cleared, or changed. Stays focusable. */
|
|
38
42
|
readonly?: boolean;
|
|
39
43
|
/** Attributes for the listbox element (class, style, aria-*, data-*). The listbox role, id, and selection state stay DTSelect's. */
|
|
@@ -106,6 +110,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
106
110
|
"onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
|
|
107
111
|
}>, {
|
|
108
112
|
error: boolean | string;
|
|
113
|
+
variant: DTSelectVariant;
|
|
109
114
|
size: DTSelectSize;
|
|
110
115
|
label: string;
|
|
111
116
|
clearLabel: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DTTreeviewItem } from '../treeview/DTTreeview.vue';
|
|
2
|
-
import { DTSelectSize } from '../select/DTSelect.vue';
|
|
2
|
+
import { DTSelectSize, DTSelectVariant } from '../select/DTSelect.vue';
|
|
3
3
|
export type DTTreeSelectItem = DTTreeviewItem;
|
|
4
4
|
type __VLS_Props = {
|
|
5
5
|
/** The chosen value, or an array of values with `multiple`. */
|
|
@@ -30,6 +30,8 @@ type __VLS_Props = {
|
|
|
30
30
|
readonly?: boolean;
|
|
31
31
|
/** Trigger height, as DTSelect. Default: `global.defaults.DTInput.size`, else md. */
|
|
32
32
|
size?: DTSelectSize;
|
|
33
|
+
/** Field look, as DTSelect. Default: `global.defaults.DTInput.variant`, else soft. */
|
|
34
|
+
variant?: DTSelectVariant;
|
|
33
35
|
id?: string;
|
|
34
36
|
/** Opens every branch when the panel first opens. */
|
|
35
37
|
openAll?: boolean;
|
|
@@ -55,6 +57,7 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
|
|
|
55
57
|
"onUpdate:menu"?: ((open: boolean) => any) | undefined;
|
|
56
58
|
}>, {
|
|
57
59
|
error: boolean | string;
|
|
60
|
+
variant: DTSelectVariant;
|
|
58
61
|
size: DTSelectSize;
|
|
59
62
|
label: string;
|
|
60
63
|
clearLabel: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export type { DTMenuItemType } from './components/menu/DTMenuItem.vue';
|
|
|
63
63
|
export { default as DTMenuLabel } from './components/menu/DTMenuLabel.vue';
|
|
64
64
|
export { default as DTMenuSeparator } from './components/menu/DTMenuSeparator.vue';
|
|
65
65
|
export { default as DTSelect } from './components/select/DTSelect.vue';
|
|
66
|
-
export type { DTSelectAttrs, DTSelectItem, DTSelectMenuProps } from './components/select/DTSelect.vue';
|
|
66
|
+
export type { DTSelectAttrs, DTSelectItem, DTSelectMenuProps, DTSelectSize, DTSelectVariant } from './components/select/DTSelect.vue';
|
|
67
67
|
export { default as DTModal } from './components/modal/DTModal.vue';
|
|
68
68
|
export type { DTModalFullscreen, DTModalSize } from './components/modal/DTModal.vue';
|
|
69
69
|
export { default as DTToastRegion } from './components/toast/DTToastRegion.vue';
|
package/dist/tandd-ui.css
CHANGED
|
@@ -4988,6 +4988,81 @@ select {
|
|
|
4988
4988
|
white-space: nowrap;
|
|
4989
4989
|
}
|
|
4990
4990
|
|
|
4991
|
+
.dt-select--soft .dt-select__trigger {
|
|
4992
|
+
background: var(--dt-color-surface-muted);
|
|
4993
|
+
}
|
|
4994
|
+
|
|
4995
|
+
.dt-select--soft .dt-select__trigger:focus-visible,
|
|
4996
|
+
.dt-select--soft.is-open .dt-select__trigger {
|
|
4997
|
+
background: var(--dt-color-surface);
|
|
4998
|
+
}
|
|
4999
|
+
|
|
5000
|
+
.dt-select--outlined .dt-select__trigger {
|
|
5001
|
+
border-radius: var(--dt-radius-md);
|
|
5002
|
+
background: var(--dt-color-surface);
|
|
5003
|
+
}
|
|
5004
|
+
|
|
5005
|
+
.dt-select--outlined .dt-select__trigger:focus-visible,
|
|
5006
|
+
.dt-select--outlined.is-open .dt-select__trigger {
|
|
5007
|
+
box-shadow: inset 0 0 0 1px var(--dt-color-primary);
|
|
5008
|
+
}
|
|
5009
|
+
|
|
5010
|
+
.dt-select--filled .dt-select__trigger {
|
|
5011
|
+
border-width: 0 0 2px;
|
|
5012
|
+
border-radius: var(--dt-radius-sm) var(--dt-radius-sm) 0 0;
|
|
5013
|
+
background: var(--dt-color-surface-muted);
|
|
5014
|
+
}
|
|
5015
|
+
|
|
5016
|
+
.dt-select--underlined .dt-select__trigger,
|
|
5017
|
+
.dt-select--plain .dt-select__trigger {
|
|
5018
|
+
padding-inline: 0;
|
|
5019
|
+
border-radius: 0;
|
|
5020
|
+
background: transparent;
|
|
5021
|
+
}
|
|
5022
|
+
|
|
5023
|
+
.dt-select--underlined .dt-select__trigger {
|
|
5024
|
+
border-width: 0 0 1px;
|
|
5025
|
+
}
|
|
5026
|
+
|
|
5027
|
+
.dt-select--underlined .dt-select__trigger:focus-visible,
|
|
5028
|
+
.dt-select--underlined.is-open .dt-select__trigger {
|
|
5029
|
+
box-shadow: inset 0 -1px 0 var(--dt-color-primary);
|
|
5030
|
+
}
|
|
5031
|
+
|
|
5032
|
+
.dt-select--plain .dt-select__trigger {
|
|
5033
|
+
border-width: 0;
|
|
5034
|
+
}
|
|
5035
|
+
|
|
5036
|
+
.dt-select--plain .dt-select__trigger:focus-visible,
|
|
5037
|
+
.dt-select--plain.is-open .dt-select__trigger {
|
|
5038
|
+
box-shadow: inset 0 -2px 0 var(--dt-color-primary);
|
|
5039
|
+
}
|
|
5040
|
+
|
|
5041
|
+
.dt-select--plain.is-invalid .dt-select__trigger {
|
|
5042
|
+
box-shadow: inset 0 -2px 0 var(--dt-color-danger);
|
|
5043
|
+
}
|
|
5044
|
+
|
|
5045
|
+
.dt-select .dt-select__trigger:disabled {
|
|
5046
|
+
background: var(--dt-color-surface-muted);
|
|
5047
|
+
}
|
|
5048
|
+
|
|
5049
|
+
.dt-select:is(.dt-select--underlined, .dt-select--plain) .dt-select__trigger:hover:not(:disabled) {
|
|
5050
|
+
background: transparent;
|
|
5051
|
+
}
|
|
5052
|
+
|
|
5053
|
+
.dt-select:is(.dt-select--underlined, .dt-select--plain) .dt-select__chips {
|
|
5054
|
+
padding-inline-start: 0;
|
|
5055
|
+
}
|
|
5056
|
+
|
|
5057
|
+
.dt-select:is(.dt-select--underlined, .dt-select--plain) .dt-select__clear {
|
|
5058
|
+
inset-inline-end: 22px;
|
|
5059
|
+
}
|
|
5060
|
+
|
|
5061
|
+
.dt-select:is(.dt-select--underlined, .dt-select--plain) .dt-select__trigger:disabled,
|
|
5062
|
+
.dt-select.is-readonly:is(.dt-select--underlined, .dt-select--plain) .dt-select__trigger {
|
|
5063
|
+
background: transparent;
|
|
5064
|
+
}
|
|
5065
|
+
|
|
4991
5066
|
.dt-select--sm .dt-select__trigger {
|
|
4992
5067
|
height: 32px;
|
|
4993
5068
|
padding: 0 10px;
|
|
@@ -5023,6 +5098,62 @@ select {
|
|
|
5023
5098
|
height: 100%;
|
|
5024
5099
|
}
|
|
5025
5100
|
|
|
5101
|
+
.dt-select--floating {
|
|
5102
|
+
position: relative;
|
|
5103
|
+
gap: 0;
|
|
5104
|
+
}
|
|
5105
|
+
|
|
5106
|
+
.dt-select--floating .dt-select__label {
|
|
5107
|
+
position: absolute;
|
|
5108
|
+
z-index: 2;
|
|
5109
|
+
left: 0;
|
|
5110
|
+
max-width: calc(100% - 24px);
|
|
5111
|
+
overflow: hidden;
|
|
5112
|
+
font-size: 11px;
|
|
5113
|
+
line-height: 1.2;
|
|
5114
|
+
white-space: nowrap;
|
|
5115
|
+
text-overflow: ellipsis;
|
|
5116
|
+
pointer-events: none;
|
|
5117
|
+
transform: translateY(-50%);
|
|
5118
|
+
}
|
|
5119
|
+
|
|
5120
|
+
.dt-select--floating.dt-select--outlined {
|
|
5121
|
+
padding-top: 7px;
|
|
5122
|
+
}
|
|
5123
|
+
|
|
5124
|
+
.dt-select--floating.dt-select--outlined .dt-select__label {
|
|
5125
|
+
top: 7px;
|
|
5126
|
+
left: 9px;
|
|
5127
|
+
padding: 0 4px;
|
|
5128
|
+
background: var(--dt-color-surface);
|
|
5129
|
+
}
|
|
5130
|
+
|
|
5131
|
+
.dt-select--floating:is(.dt-select--underlined, .dt-select--plain) {
|
|
5132
|
+
padding-top: 10px;
|
|
5133
|
+
}
|
|
5134
|
+
|
|
5135
|
+
.dt-select--floating:is(.dt-select--underlined, .dt-select--plain) .dt-select__label {
|
|
5136
|
+
top: 8px;
|
|
5137
|
+
font-size: 12px;
|
|
5138
|
+
}
|
|
5139
|
+
|
|
5140
|
+
.dt-select--floating:has(.dt-select__trigger:focus-visible) .dt-select__label,
|
|
5141
|
+
.dt-select--floating.is-open .dt-select__label {
|
|
5142
|
+
color: var(--dt-color-primary);
|
|
5143
|
+
}
|
|
5144
|
+
|
|
5145
|
+
.dt-select--floating.is-invalid .dt-select__label {
|
|
5146
|
+
color: var(--dt-color-danger);
|
|
5147
|
+
}
|
|
5148
|
+
|
|
5149
|
+
.dt-select--floating.is-disabled .dt-select__label {
|
|
5150
|
+
color: var(--dt-color-text-disabled);
|
|
5151
|
+
}
|
|
5152
|
+
|
|
5153
|
+
.dt-select:is(.dt-select--underlined, .dt-select--plain) .dt-select__trigger {
|
|
5154
|
+
padding-inline: 0;
|
|
5155
|
+
}
|
|
5156
|
+
|
|
5026
5157
|
.dt-select.is-readonly .dt-select__trigger {
|
|
5027
5158
|
background: var(--dt-color-surface-muted);
|
|
5028
5159
|
cursor: default;
|