@rockshin/tao-ui 0.0.12 → 0.0.14
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/components/button/button.css +18 -18
- package/dist/components/button/button.js +1 -0
- package/dist/components/checkbox/checkbox.css +11 -8
- package/dist/components/checkbox/checkbox.js +34 -23
- package/dist/components/radio/radio.css +11 -8
- package/dist/components/radio/radio.js +34 -23
- package/dist/components/select/mobile-select.css +29 -0
- package/dist/components/select/mobile-select.d.ts +8 -4
- package/dist/components/select/mobile-select.js +41 -36
- package/dist/components/select/select.css +85 -12
- package/dist/components/select/select.d.ts +38 -8
- package/dist/components/select/select.js +437 -129
- package/dist/index.d.ts +1 -1
- package/dist/theme/theme.css +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
button[data-tao-
|
|
1
|
+
button[data-tao-button] {
|
|
2
2
|
justify-content: center;
|
|
3
3
|
align-items: center;
|
|
4
4
|
gap: var(--tao-padding-xs);
|
|
@@ -17,91 +17,91 @@ button[data-tao-variant] {
|
|
|
17
17
|
display: inline-flex;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
button[data-tao-size="small"] {
|
|
20
|
+
button[data-tao-button][data-tao-size="small"] {
|
|
21
21
|
height: var(--tao-control-height-sm);
|
|
22
22
|
padding-inline: var(--tao-padding-xs);
|
|
23
23
|
font-size: var(--tao-font-size-sm);
|
|
24
24
|
border-radius: var(--tao-radius-sm);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
button[data-tao-size="medium"] {
|
|
27
|
+
button[data-tao-button][data-tao-size="medium"] {
|
|
28
28
|
height: var(--tao-control-height);
|
|
29
29
|
padding-inline: var(--tao-padding);
|
|
30
30
|
font-size: var(--tao-font-size-base);
|
|
31
31
|
border-radius: var(--tao-radius-md);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
button[data-tao-size="large"] {
|
|
34
|
+
button[data-tao-button][data-tao-size="large"] {
|
|
35
35
|
height: var(--tao-control-height-lg);
|
|
36
36
|
padding-inline: var(--tao-padding);
|
|
37
37
|
font-size: var(--tao-font-size-base);
|
|
38
38
|
border-radius: var(--tao-radius-md);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
button[data-tao-variant="primary"] {
|
|
41
|
+
button[data-tao-button][data-tao-variant="primary"] {
|
|
42
42
|
background: var(--tao-primary);
|
|
43
43
|
color: var(--tao-primary-fg);
|
|
44
44
|
box-shadow: var(--tao-box-shadow-xs);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
button[data-tao-variant="primary"]:hover:not(:disabled) {
|
|
47
|
+
button[data-tao-button][data-tao-variant="primary"]:hover:not(:disabled) {
|
|
48
48
|
background: var(--tao-primary-hover);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
button[data-tao-variant="primary"]:active:not(:disabled) {
|
|
51
|
+
button[data-tao-button][data-tao-variant="primary"]:active:not(:disabled) {
|
|
52
52
|
background: var(--tao-primary-active);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
button[data-tao-variant="secondary"] {
|
|
55
|
+
button[data-tao-button][data-tao-variant="secondary"] {
|
|
56
56
|
color: var(--tao-color-text);
|
|
57
57
|
border-color: var(--tao-color-border);
|
|
58
58
|
box-shadow: var(--tao-box-shadow-xs);
|
|
59
59
|
background: none;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
button[data-tao-variant="secondary"]:hover:not(:disabled) {
|
|
62
|
+
button[data-tao-button][data-tao-variant="secondary"]:hover:not(:disabled) {
|
|
63
63
|
background: var(--tao-color-fill-tertiary);
|
|
64
64
|
border-color: var(--tao-color-border);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
button[data-tao-variant="secondary"]:active:not(:disabled) {
|
|
67
|
+
button[data-tao-button][data-tao-variant="secondary"]:active:not(:disabled) {
|
|
68
68
|
background: var(--tao-color-fill-secondary);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
button[data-tao-variant="ghost"] {
|
|
71
|
+
button[data-tao-button][data-tao-variant="ghost"] {
|
|
72
72
|
color: var(--tao-color-text-secondary);
|
|
73
73
|
background: none;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
button[data-tao-variant="ghost"]:hover:not(:disabled) {
|
|
76
|
+
button[data-tao-button][data-tao-variant="ghost"]:hover:not(:disabled) {
|
|
77
77
|
background: var(--tao-color-fill-tertiary);
|
|
78
78
|
color: var(--tao-color-text);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
button[data-tao-variant="ghost"]:active:not(:disabled) {
|
|
81
|
+
button[data-tao-button][data-tao-variant="ghost"]:active:not(:disabled) {
|
|
82
82
|
background: var(--tao-color-fill-secondary);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
button[data-tao-variant="destructive"] {
|
|
85
|
+
button[data-tao-button][data-tao-variant="destructive"] {
|
|
86
86
|
background: var(--tao-error);
|
|
87
87
|
color: var(--tao-error-fg);
|
|
88
88
|
box-shadow: var(--tao-box-shadow-xs);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
button[data-tao-variant="destructive"]:hover:not(:disabled) {
|
|
91
|
+
button[data-tao-button][data-tao-variant="destructive"]:hover:not(:disabled) {
|
|
92
92
|
background: var(--tao-error-hover);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
button[data-tao-variant="destructive"]:active:not(:disabled) {
|
|
95
|
+
button[data-tao-button][data-tao-variant="destructive"]:active:not(:disabled) {
|
|
96
96
|
background: var(--tao-error-active);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
button[data-tao-
|
|
99
|
+
button[data-tao-button]:disabled {
|
|
100
100
|
opacity: var(--tao-opacity-loading);
|
|
101
101
|
cursor: not-allowed;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
button[data-tao-
|
|
104
|
+
button[data-tao-button]:focus-visible {
|
|
105
105
|
box-shadow: 0 0 0 var(--tao-ring-width) var(--tao-control-outline);
|
|
106
106
|
outline: none;
|
|
107
107
|
}
|
|
@@ -16,16 +16,19 @@
|
|
|
16
16
|
opacity: var(--tao-opacity-loading);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
[data-tao-checkbox-control] {
|
|
20
|
+
flex: none;
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
position: relative;
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
[data-tao-checkbox-input] {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
height: 1px;
|
|
25
|
-
margin: -1px;
|
|
26
|
-
padding: 0;
|
|
26
|
+
z-index: 1;
|
|
27
|
+
opacity: 0;
|
|
28
|
+
cursor: inherit;
|
|
29
|
+
margin: 0;
|
|
27
30
|
position: absolute;
|
|
28
|
-
|
|
31
|
+
inset: 0;
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
[data-tao-checkbox] {
|
|
@@ -6,7 +6,7 @@ import { cx } from "../../utils/semantic.js";
|
|
|
6
6
|
import "./checkbox.css";
|
|
7
7
|
const CheckboxGroupContext = /*#__PURE__*/ createContext(null);
|
|
8
8
|
function Checkbox(t0) {
|
|
9
|
-
const $ = c(
|
|
9
|
+
const $ = c(45);
|
|
10
10
|
const { checked, indeterminate, disabled, onChange, value, children, classNames, styles } = t0;
|
|
11
11
|
const ctx = useTaoConfig();
|
|
12
12
|
const groupCtx = useContext(CheckboxGroupContext);
|
|
@@ -122,40 +122,51 @@ function Checkbox(t0) {
|
|
|
122
122
|
$[31] = t18;
|
|
123
123
|
} else t18 = $[31];
|
|
124
124
|
let t19;
|
|
125
|
-
if ($[32] !==
|
|
126
|
-
t19 =
|
|
125
|
+
if ($[32] !== t10 || $[33] !== t18) {
|
|
126
|
+
t19 = /*#__PURE__*/ jsxs("span", {
|
|
127
|
+
"data-tao-checkbox-control": "",
|
|
128
|
+
children: [
|
|
129
|
+
t10,
|
|
130
|
+
t18
|
|
131
|
+
]
|
|
132
|
+
});
|
|
133
|
+
$[32] = t10;
|
|
134
|
+
$[33] = t18;
|
|
135
|
+
$[34] = t19;
|
|
136
|
+
} else t19 = $[34];
|
|
137
|
+
let t20;
|
|
138
|
+
if ($[35] !== children || $[36] !== classNames?.label || $[37] !== styles?.label) {
|
|
139
|
+
t20 = null != children && /*#__PURE__*/ jsx("span", {
|
|
127
140
|
"data-tao-checkbox-label": "",
|
|
128
141
|
className: cx(classNames?.label),
|
|
129
142
|
style: styles?.label,
|
|
130
143
|
children: children
|
|
131
144
|
});
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
} else
|
|
137
|
-
let
|
|
138
|
-
if ($[
|
|
139
|
-
|
|
145
|
+
$[35] = children;
|
|
146
|
+
$[36] = classNames?.label;
|
|
147
|
+
$[37] = styles?.label;
|
|
148
|
+
$[38] = t20;
|
|
149
|
+
} else t20 = $[38];
|
|
150
|
+
let t21;
|
|
151
|
+
if ($[39] !== t19 || $[40] !== t20 || $[41] !== t5 || $[42] !== t7 || $[43] !== t8) {
|
|
152
|
+
t21 = /*#__PURE__*/ jsxs("label", {
|
|
140
153
|
"data-tao-checkbox-wrapper": "",
|
|
141
154
|
"data-tao-disabled": t5,
|
|
142
155
|
className: t7,
|
|
143
156
|
style: t8,
|
|
144
157
|
children: [
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
t19
|
|
158
|
+
t19,
|
|
159
|
+
t20
|
|
148
160
|
]
|
|
149
161
|
});
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return t20;
|
|
162
|
+
$[39] = t19;
|
|
163
|
+
$[40] = t20;
|
|
164
|
+
$[41] = t5;
|
|
165
|
+
$[42] = t7;
|
|
166
|
+
$[43] = t8;
|
|
167
|
+
$[44] = t21;
|
|
168
|
+
} else t21 = $[44];
|
|
169
|
+
return t21;
|
|
159
170
|
}
|
|
160
171
|
function CheckboxGroup(t0) {
|
|
161
172
|
const $ = c(26);
|
|
@@ -16,16 +16,19 @@
|
|
|
16
16
|
opacity: var(--tao-opacity-loading);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
[data-tao-radio-control] {
|
|
20
|
+
flex: none;
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
position: relative;
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
[data-tao-radio-input] {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
height: 1px;
|
|
25
|
-
margin: -1px;
|
|
26
|
-
padding: 0;
|
|
26
|
+
z-index: 1;
|
|
27
|
+
opacity: 0;
|
|
28
|
+
cursor: inherit;
|
|
29
|
+
margin: 0;
|
|
27
30
|
position: absolute;
|
|
28
|
-
|
|
31
|
+
inset: 0;
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
[data-tao-radio] {
|
|
@@ -6,7 +6,7 @@ import { cx } from "../../utils/semantic.js";
|
|
|
6
6
|
import "./radio.css";
|
|
7
7
|
const RadioGroupContext = /*#__PURE__*/ createContext(null);
|
|
8
8
|
function Radio(t0) {
|
|
9
|
-
const $ = c(
|
|
9
|
+
const $ = c(31);
|
|
10
10
|
const { value, checked, disabled, onChange, children, name, classNames, styles } = t0;
|
|
11
11
|
const ctx = useTaoConfig();
|
|
12
12
|
const groupCtx = useContext(RadioGroupContext);
|
|
@@ -75,40 +75,51 @@ function Radio(t0) {
|
|
|
75
75
|
$[17] = t11;
|
|
76
76
|
} else t11 = $[17];
|
|
77
77
|
let t12;
|
|
78
|
-
if ($[18] !==
|
|
79
|
-
t12 =
|
|
78
|
+
if ($[18] !== t11 || $[19] !== t6) {
|
|
79
|
+
t12 = /*#__PURE__*/ jsxs("span", {
|
|
80
|
+
"data-tao-radio-control": "",
|
|
81
|
+
children: [
|
|
82
|
+
t6,
|
|
83
|
+
t11
|
|
84
|
+
]
|
|
85
|
+
});
|
|
86
|
+
$[18] = t11;
|
|
87
|
+
$[19] = t6;
|
|
88
|
+
$[20] = t12;
|
|
89
|
+
} else t12 = $[20];
|
|
90
|
+
let t13;
|
|
91
|
+
if ($[21] !== children || $[22] !== classNames?.label || $[23] !== styles?.label) {
|
|
92
|
+
t13 = null != children && /*#__PURE__*/ jsx("span", {
|
|
80
93
|
"data-tao-radio-label": "",
|
|
81
94
|
className: cx(classNames?.label),
|
|
82
95
|
style: styles?.label,
|
|
83
96
|
children: children
|
|
84
97
|
});
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
} else
|
|
90
|
-
let
|
|
91
|
-
if ($[
|
|
92
|
-
|
|
98
|
+
$[21] = children;
|
|
99
|
+
$[22] = classNames?.label;
|
|
100
|
+
$[23] = styles?.label;
|
|
101
|
+
$[24] = t13;
|
|
102
|
+
} else t13 = $[24];
|
|
103
|
+
let t14;
|
|
104
|
+
if ($[25] !== t12 || $[26] !== t13 || $[27] !== t2 || $[28] !== t4 || $[29] !== t5) {
|
|
105
|
+
t14 = /*#__PURE__*/ jsxs("label", {
|
|
93
106
|
"data-tao-radio-wrapper": "",
|
|
94
107
|
"data-tao-disabled": t2,
|
|
95
108
|
className: t4,
|
|
96
109
|
style: t5,
|
|
97
110
|
children: [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
t12
|
|
111
|
+
t12,
|
|
112
|
+
t13
|
|
101
113
|
]
|
|
102
114
|
});
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return t13;
|
|
115
|
+
$[25] = t12;
|
|
116
|
+
$[26] = t13;
|
|
117
|
+
$[27] = t2;
|
|
118
|
+
$[28] = t4;
|
|
119
|
+
$[29] = t5;
|
|
120
|
+
$[30] = t14;
|
|
121
|
+
} else t14 = $[30];
|
|
122
|
+
return t14;
|
|
112
123
|
}
|
|
113
124
|
function RadioGroup(t0) {
|
|
114
125
|
const $ = c(26);
|
|
@@ -131,3 +131,32 @@
|
|
|
131
131
|
color: var(--tao-color-text-tertiary);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
[data-tao-sheet-footer] {
|
|
135
|
+
padding: var(--tao-padding-sm) var(--tao-padding);
|
|
136
|
+
border-block-start: var(--tao-line-width) solid
|
|
137
|
+
var(--tao-color-border-secondary);
|
|
138
|
+
background: var(--tao-color-bg-elevated);
|
|
139
|
+
flex-shrink: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
[data-tao-sheet-done] {
|
|
143
|
+
border-radius: var(--tao-radius-md);
|
|
144
|
+
background: var(--tao-primary);
|
|
145
|
+
color: #fff;
|
|
146
|
+
width: 100%;
|
|
147
|
+
height: 44px;
|
|
148
|
+
font-family: var(--tao-font-family);
|
|
149
|
+
font-size: var(--tao-font-size-base);
|
|
150
|
+
font-weight: var(--tao-font-weight-medium);
|
|
151
|
+
cursor: pointer;
|
|
152
|
+
-webkit-tap-highlight-color: transparent;
|
|
153
|
+
border: none;
|
|
154
|
+
justify-content: center;
|
|
155
|
+
align-items: center;
|
|
156
|
+
display: flex;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
[data-tao-sheet-done]:active {
|
|
160
|
+
opacity: .85;
|
|
161
|
+
}
|
|
162
|
+
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type SelectOption } from './select';
|
|
3
3
|
import './mobile-select.css';
|
|
4
4
|
interface MobileSelectContentProps {
|
|
5
5
|
options: SelectOption[];
|
|
6
|
-
value?: string;
|
|
6
|
+
value?: string | string[];
|
|
7
7
|
onChange?: (value: string) => void;
|
|
8
|
+
/** Multi-mode commit callback: fires when "Done" is pressed with the full array. */
|
|
9
|
+
onMultiChange?: (values: string[]) => void;
|
|
8
10
|
placeholder?: string;
|
|
9
11
|
showSearch?: boolean;
|
|
10
12
|
filterOption?: (input: string, option: SelectOption) => boolean;
|
|
@@ -13,10 +15,12 @@ interface MobileSelectContentProps {
|
|
|
13
15
|
index: number;
|
|
14
16
|
}) => ReactNode;
|
|
15
17
|
onClose: () => void;
|
|
18
|
+
/** Enable multi-select checkboxes + Done button flow. */
|
|
19
|
+
multiple?: boolean;
|
|
16
20
|
}
|
|
17
|
-
|
|
21
|
+
declare function MobileSelectContentInner({ options, value, onChange, onMultiChange, showSearch, filterOption, notFoundContent, optionRender, onClose, multiple, }: MobileSelectContentProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export { MobileSelectContentInner as MobileSelectContent };
|
|
18
23
|
export interface MobileSelectDrawerProps extends MobileSelectContentProps {
|
|
19
24
|
open: boolean;
|
|
20
25
|
}
|
|
21
26
|
export declare function MobileSelectDrawer({ open, onClose, placeholder, ...rest }: MobileSelectDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export {};
|
|
@@ -2,6 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { useCallback, useMemo, useState } from "react";
|
|
4
4
|
import { Drawer } from "../drawer/drawer.js";
|
|
5
|
+
import { SearchIcon } from "./select.js";
|
|
5
6
|
import "./mobile-select.css";
|
|
6
7
|
const defaultFilter = (input, option)=>{
|
|
7
8
|
const label = 'string' == typeof option.label ? option.label : String(option.label);
|
|
@@ -21,8 +22,18 @@ function filterTree(options, fn, input) {
|
|
|
21
22
|
function countLeaves(options) {
|
|
22
23
|
return options.reduce((n, o)=>n + (o.options ? countLeaves(o.options) : 1), 0);
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
+
function MobileSelectContentInner({ options, value, onChange, onMultiChange, showSearch, filterOption, notFoundContent = 'No results', optionRender, onClose, multiple }) {
|
|
25
26
|
const [search, setSearch] = useState('');
|
|
27
|
+
const valueArray = useMemo(()=>{
|
|
28
|
+
if (multiple) return value ?? [];
|
|
29
|
+
return value ? [
|
|
30
|
+
value
|
|
31
|
+
] : [];
|
|
32
|
+
}, [
|
|
33
|
+
multiple,
|
|
34
|
+
value
|
|
35
|
+
]);
|
|
36
|
+
const [draft, setDraft] = useState(valueArray);
|
|
26
37
|
const filteredOptions = useMemo(()=>{
|
|
27
38
|
if (!showSearch || !search) return options;
|
|
28
39
|
const fn = filterOption ?? defaultFilter;
|
|
@@ -34,16 +45,31 @@ function MobileSelectContent({ options, value, onChange, showSearch, filterOptio
|
|
|
34
45
|
filterOption
|
|
35
46
|
]);
|
|
36
47
|
const handleSelect = useCallback((optValue)=>{
|
|
37
|
-
|
|
38
|
-
|
|
48
|
+
if (multiple) setDraft((prev)=>prev.includes(optValue) ? prev.filter((v)=>v !== optValue) : [
|
|
49
|
+
...prev,
|
|
50
|
+
optValue
|
|
51
|
+
]);
|
|
52
|
+
else {
|
|
53
|
+
onChange?.(optValue);
|
|
54
|
+
onClose();
|
|
55
|
+
}
|
|
39
56
|
}, [
|
|
57
|
+
multiple,
|
|
40
58
|
onChange,
|
|
41
59
|
onClose
|
|
42
60
|
]);
|
|
61
|
+
const handleDone = useCallback(()=>{
|
|
62
|
+
onMultiChange?.(draft);
|
|
63
|
+
onClose();
|
|
64
|
+
}, [
|
|
65
|
+
draft,
|
|
66
|
+
onMultiChange,
|
|
67
|
+
onClose
|
|
68
|
+
]);
|
|
43
69
|
let optIndex = 0;
|
|
44
70
|
const renderItem = (opt)=>{
|
|
45
71
|
const index = optIndex++;
|
|
46
|
-
const isSelected = opt.value === value;
|
|
72
|
+
const isSelected = multiple ? draft.includes(opt.value) : opt.value === value;
|
|
47
73
|
return /*#__PURE__*/ jsxs("button", {
|
|
48
74
|
type: "button",
|
|
49
75
|
"data-tao-sheet-item": "",
|
|
@@ -115,6 +141,15 @@ function MobileSelectContent({ options, value, onChange, showSearch, filterOptio
|
|
|
115
141
|
"data-tao-sheet-empty": "",
|
|
116
142
|
children: notFoundContent
|
|
117
143
|
})
|
|
144
|
+
}),
|
|
145
|
+
multiple && /*#__PURE__*/ jsx("div", {
|
|
146
|
+
"data-tao-sheet-footer": "",
|
|
147
|
+
children: /*#__PURE__*/ jsx("button", {
|
|
148
|
+
type: "button",
|
|
149
|
+
"data-tao-sheet-done": "",
|
|
150
|
+
onClick: handleDone,
|
|
151
|
+
children: "Done"
|
|
152
|
+
})
|
|
118
153
|
})
|
|
119
154
|
]
|
|
120
155
|
});
|
|
@@ -141,7 +176,7 @@ function MobileSelectDrawer(t0) {
|
|
|
141
176
|
const t1 = placeholder ?? "Select";
|
|
142
177
|
let t2;
|
|
143
178
|
if ($[5] !== onClose || $[6] !== placeholder || $[7] !== rest) {
|
|
144
|
-
t2 = /*#__PURE__*/ jsx(
|
|
179
|
+
t2 = /*#__PURE__*/ jsx(MobileSelectContentInner, {
|
|
145
180
|
onClose: onClose,
|
|
146
181
|
placeholder: placeholder,
|
|
147
182
|
...rest
|
|
@@ -169,36 +204,6 @@ function MobileSelectDrawer(t0) {
|
|
|
169
204
|
} else t3 = $[13];
|
|
170
205
|
return t3;
|
|
171
206
|
}
|
|
172
|
-
function SearchIcon() {
|
|
173
|
-
const $ = c(1);
|
|
174
|
-
let t0;
|
|
175
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
176
|
-
t0 = /*#__PURE__*/ jsxs("svg", {
|
|
177
|
-
"aria-hidden": "true",
|
|
178
|
-
focusable: "false",
|
|
179
|
-
width: "14",
|
|
180
|
-
height: "14",
|
|
181
|
-
viewBox: "0 0 24 24",
|
|
182
|
-
fill: "none",
|
|
183
|
-
stroke: "currentColor",
|
|
184
|
-
strokeWidth: "2",
|
|
185
|
-
strokeLinecap: "round",
|
|
186
|
-
strokeLinejoin: "round",
|
|
187
|
-
children: [
|
|
188
|
-
/*#__PURE__*/ jsx("circle", {
|
|
189
|
-
cx: "11",
|
|
190
|
-
cy: "11",
|
|
191
|
-
r: "8"
|
|
192
|
-
}),
|
|
193
|
-
/*#__PURE__*/ jsx("path", {
|
|
194
|
-
d: "m21 21-4.3-4.3"
|
|
195
|
-
})
|
|
196
|
-
]
|
|
197
|
-
});
|
|
198
|
-
$[0] = t0;
|
|
199
|
-
} else t0 = $[0];
|
|
200
|
-
return t0;
|
|
201
|
-
}
|
|
202
207
|
function CheckIcon() {
|
|
203
208
|
const $ = c(1);
|
|
204
209
|
let t0;
|
|
@@ -222,4 +227,4 @@ function CheckIcon() {
|
|
|
222
227
|
} else t0 = $[0];
|
|
223
228
|
return t0;
|
|
224
229
|
}
|
|
225
|
-
export { MobileSelectContent, MobileSelectDrawer };
|
|
230
|
+
export { MobileSelectContentInner as MobileSelectContent, MobileSelectDrawer };
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
--tao-select-height: var(--tao-control-height);
|
|
3
3
|
--tao-select-font-size: var(--tao-font-size-base);
|
|
4
4
|
--tao-select-line-height: var(--tao-line-height);
|
|
5
|
-
--tao-select-padding-inline: var(--tao-padding-sm);
|
|
6
5
|
--tao-select-padding-block: calc((
|
|
7
6
|
var(--tao-select-height) -
|
|
8
7
|
var(--tao-select-font-size) *
|
|
@@ -10,34 +9,29 @@
|
|
|
10
9
|
) /
|
|
11
10
|
2 -
|
|
12
11
|
var(--tao-line-width));
|
|
13
|
-
|
|
12
|
+
--tao-select-padding-inline: calc(var(--tao-padding-sm) -
|
|
13
|
+
var(--tao-line-width));
|
|
14
|
+
align-items: center;
|
|
14
15
|
gap: var(--tao-padding-xs);
|
|
15
16
|
width: 100%;
|
|
16
17
|
font-family: var(--tao-font-family);
|
|
17
18
|
font-size: var(--tao-select-font-size);
|
|
18
19
|
line-height: var(--tao-select-line-height);
|
|
19
20
|
height: var(--tao-select-height);
|
|
20
|
-
padding-block:
|
|
21
|
+
padding-block: var(--tao-select-padding-block);
|
|
21
22
|
padding-inline: var(--tao-select-padding-inline);
|
|
22
23
|
cursor: pointer;
|
|
23
24
|
outline: none;
|
|
24
25
|
display: flex;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
button[data-tao-select] {
|
|
28
|
-
appearance: none;
|
|
29
|
-
text-align: start;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
28
|
[data-tao-select-value] {
|
|
33
29
|
text-overflow: ellipsis;
|
|
34
30
|
white-space: nowrap;
|
|
35
31
|
min-width: 0;
|
|
36
32
|
color: var(--tao-color-text);
|
|
37
|
-
line-height:
|
|
33
|
+
line-height: inherit;
|
|
38
34
|
flex: 1;
|
|
39
|
-
align-self: center;
|
|
40
|
-
display: block;
|
|
41
35
|
overflow: hidden;
|
|
42
36
|
}
|
|
43
37
|
|
|
@@ -46,11 +40,16 @@ button[data-tao-select] {
|
|
|
46
40
|
line-height: var(--tao-select-line-height);
|
|
47
41
|
}
|
|
48
42
|
|
|
43
|
+
[data-tao-select][data-tao-multiple] [data-tao-select-placeholder] {
|
|
44
|
+
padding-inline-start: var(--tao-select-padding-inline);
|
|
45
|
+
}
|
|
46
|
+
|
|
49
47
|
[data-tao-select][data-tao-size="small"] {
|
|
50
48
|
--tao-select-height: var(--tao-control-height-sm);
|
|
51
49
|
--tao-select-font-size: var(--tao-font-size-sm);
|
|
52
50
|
--tao-select-line-height: var(--tao-line-height-sm);
|
|
53
|
-
--tao-select-padding-inline: var(--tao-padding-xs)
|
|
51
|
+
--tao-select-padding-inline: calc(var(--tao-padding-xs) -
|
|
52
|
+
var(--tao-line-width));
|
|
54
53
|
border-radius: var(--tao-radius-sm);
|
|
55
54
|
}
|
|
56
55
|
|
|
@@ -326,3 +325,77 @@ button[data-tao-select] {
|
|
|
326
325
|
color: var(--tao-color-text-tertiary);
|
|
327
326
|
}
|
|
328
327
|
|
|
328
|
+
[data-tao-select][data-tao-multiple] {
|
|
329
|
+
height: auto;
|
|
330
|
+
min-height: var(--tao-select-height);
|
|
331
|
+
flex-wrap: wrap;
|
|
332
|
+
padding-block: 4px;
|
|
333
|
+
padding-inline-start: 4px;
|
|
334
|
+
padding-inline-end: var(--tao-select-padding-inline);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
[data-tao-select-values] {
|
|
338
|
+
flex-wrap: wrap;
|
|
339
|
+
flex: 1;
|
|
340
|
+
align-items: center;
|
|
341
|
+
gap: 4px;
|
|
342
|
+
min-width: 0;
|
|
343
|
+
padding-block: 1px;
|
|
344
|
+
display: flex;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
[data-tao-select-tag] {
|
|
348
|
+
max-width: 160px;
|
|
349
|
+
font-size: var(--tao-font-size-sm);
|
|
350
|
+
height: 24px;
|
|
351
|
+
color: var(--tao-color-text);
|
|
352
|
+
background: var(--tao-color-fill-quaternary);
|
|
353
|
+
border-radius: var(--tao-radius-sm);
|
|
354
|
+
border: var(--tao-line-width) solid var(--tao-color-border-secondary);
|
|
355
|
+
align-items: center;
|
|
356
|
+
gap: 0;
|
|
357
|
+
padding-block: 0;
|
|
358
|
+
padding-inline: 6px;
|
|
359
|
+
line-height: 1.53846;
|
|
360
|
+
display: inline-flex;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
[data-tao-select-tag][data-tao-disabled] {
|
|
364
|
+
opacity: .5;
|
|
365
|
+
cursor: not-allowed;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
[data-tao-select-tag-label] {
|
|
369
|
+
text-overflow: ellipsis;
|
|
370
|
+
white-space: nowrap;
|
|
371
|
+
overflow: hidden;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
[data-tao-select-tag-close] {
|
|
375
|
+
cursor: pointer;
|
|
376
|
+
width: 16px;
|
|
377
|
+
height: 16px;
|
|
378
|
+
color: var(--tao-color-text-quaternary);
|
|
379
|
+
border-radius: var(--tao-radius-xs);
|
|
380
|
+
transition: color var(--tao-motion-duration-fast) var(--tao-motion-ease-out),
|
|
381
|
+
background-color var(--tao-motion-duration-fast) var(--tao-motion-ease-out);
|
|
382
|
+
flex-shrink: 0;
|
|
383
|
+
justify-content: center;
|
|
384
|
+
align-items: center;
|
|
385
|
+
margin-inline: 2px -2px;
|
|
386
|
+
display: inline-flex;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
[data-tao-select-tag-close]:hover {
|
|
390
|
+
color: var(--tao-color-text-secondary);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
[data-tao-select-tag-rest] {
|
|
394
|
+
cursor: default;
|
|
395
|
+
color: var(--tao-color-text-tertiary);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
[data-tao-select-item][data-tao-selected] {
|
|
399
|
+
font-weight: var(--tao-font-weight-medium);
|
|
400
|
+
}
|
|
401
|
+
|