@ts-element-ui/theme-chalk 1.0.0 → 1.3.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/src/cascader.scss CHANGED
@@ -86,4 +86,161 @@
86
86
 
87
87
  &--open .ts-cascader__trigger { border-color: var(--ts-color-primary); }
88
88
  &--open .ts-cascader__arrow { transform: rotate(180deg); }
89
+
90
+ // ===== 实际渲染结构 =====
91
+ &__wrapper {
92
+ display: inline-flex;
93
+ align-items: center;
94
+ width: 100%;
95
+ min-height: $component-size-base;
96
+ padding: 0 8px 0 12px;
97
+ border: 1px solid var(--ts-border-color);
98
+ border-radius: $border-radius-base;
99
+ background-color: var(--ts-bg-color);
100
+ cursor: pointer;
101
+ transition: $transition-base;
102
+
103
+ &:hover { border-color: var(--ts-color-primary-light-5); }
104
+ }
105
+
106
+ &--focus &__wrapper { border-color: var(--ts-color-primary); }
107
+
108
+ &__selected {
109
+ flex: 1;
110
+ overflow: hidden;
111
+ text-overflow: ellipsis;
112
+ white-space: nowrap;
113
+ color: var(--ts-text-color-regular);
114
+ font-size: $font-size-base;
115
+ }
116
+
117
+ &__clear {
118
+ margin-left: 4px;
119
+ color: var(--ts-text-color-placeholder);
120
+ cursor: pointer;
121
+
122
+ &:hover { color: var(--ts-text-color-secondary); }
123
+ }
124
+
125
+ &__arrow.is-reverse { transform: rotate(180deg); }
126
+
127
+ &__popper {
128
+ position: fixed;
129
+ z-index: 2000;
130
+ background-color: var(--ts-bg-color);
131
+ border: 1px solid var(--ts-border-color-lighter);
132
+ border-radius: $border-radius-base;
133
+ box-shadow: var(--ts-box-shadow-light);
134
+ }
135
+
136
+ &__menus {
137
+ display: flex;
138
+ align-items: stretch;
139
+ }
140
+
141
+ &__menu {
142
+ min-width: 140px;
143
+ max-height: 240px;
144
+ margin: 0;
145
+ padding: 4px 0;
146
+ overflow-y: auto;
147
+ list-style: none;
148
+ border-right: 1px solid var(--ts-border-color-lighter);
149
+
150
+ &:last-child { border-right: none; }
151
+ }
152
+
153
+ &__menu-item {
154
+ display: flex;
155
+ align-items: center;
156
+ justify-content: space-between;
157
+ gap: 8px;
158
+ padding: 8px 16px;
159
+ font-size: $font-size-base;
160
+ color: var(--ts-text-color-regular);
161
+ white-space: nowrap;
162
+ cursor: pointer;
163
+ transition: background-color 0.2s;
164
+
165
+ &:hover,
166
+ &.is-active {
167
+ color: var(--ts-color-primary);
168
+ background-color: var(--ts-fill-color-light);
169
+ }
170
+
171
+ &.is-active { font-weight: $font-weight-primary; }
172
+ &.is-disabled {
173
+ color: var(--ts-text-color-placeholder);
174
+ cursor: not-allowed;
175
+ background-color: transparent;
176
+ }
177
+ &.is-loading {
178
+ color: var(--ts-text-color-placeholder);
179
+ cursor: progress;
180
+ }
181
+ }
182
+
183
+ &__loading {
184
+ animation: ts-cascader-rotate 1s linear infinite;
185
+ }
186
+
187
+ &__search {
188
+ padding: 8px;
189
+ border-bottom: 1px solid var(--ts-border-color-lighter);
190
+ }
191
+
192
+ &__search-input {
193
+ width: 100%;
194
+ height: 28px;
195
+ padding: 0 8px;
196
+ border: 1px solid var(--ts-border-color);
197
+ border-radius: $border-radius-base;
198
+ outline: none;
199
+ color: var(--ts-text-color-regular);
200
+ font-size: $font-size-base;
201
+ transition: $transition-base;
202
+
203
+ &:focus { border-color: var(--ts-color-primary); }
204
+ }
205
+
206
+ &__search-list {
207
+ min-width: 240px;
208
+ max-height: 240px;
209
+ margin: 0;
210
+ padding: 4px 0;
211
+ overflow-y: auto;
212
+ list-style: none;
213
+ }
214
+
215
+ &__search-item {
216
+ padding: 8px 16px;
217
+ font-size: $font-size-base;
218
+ color: var(--ts-text-color-regular);
219
+ white-space: nowrap;
220
+ cursor: pointer;
221
+ transition: background-color 0.2s;
222
+
223
+ &:hover {
224
+ color: var(--ts-color-primary);
225
+ background-color: var(--ts-fill-color-light);
226
+ }
227
+
228
+ &.is-disabled {
229
+ color: var(--ts-text-color-placeholder);
230
+ cursor: not-allowed;
231
+ background-color: transparent;
232
+ }
233
+ }
234
+
235
+ &__search-empty {
236
+ padding: 16px;
237
+ font-size: $font-size-base;
238
+ color: var(--ts-text-color-placeholder);
239
+ text-align: center;
240
+ }
241
+ }
242
+
243
+ @keyframes ts-cascader-rotate {
244
+ from { transform: rotate(0deg); }
245
+ to { transform: rotate(360deg); }
89
246
  }
@@ -99,4 +99,242 @@
99
99
  margin: -6px;
100
100
  }
101
101
  }
102
+
103
+ &__trigger-inner {
104
+ display: block;
105
+ width: 100%;
106
+ height: 100%;
107
+ border-radius: $border-radius-small;
108
+ border: 1px solid var(--ts-border-color-lighter);
109
+ }
110
+
111
+ &__popper {
112
+ position: fixed;
113
+ z-index: 2000;
114
+ width: 240px;
115
+ padding: 12px;
116
+ background-color: var(--ts-bg-color);
117
+ border: 1px solid var(--ts-border-color-lighter);
118
+ border-radius: $border-radius-base;
119
+ box-shadow: var(--ts-box-shadow-light);
120
+ }
121
+
122
+ // 饱和度-明度二维选择区
123
+ &__sv {
124
+ position: relative;
125
+ height: 140px;
126
+ border-radius: $border-radius-base;
127
+ cursor: crosshair;
128
+ user-select: none;
129
+ }
130
+
131
+ &__sv-cursor {
132
+ position: absolute;
133
+ width: 12px;
134
+ height: 12px;
135
+ border: 2px solid #fff;
136
+ border-radius: 50%;
137
+ box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
138
+ transform: translate(-50%, -50%);
139
+ pointer-events: none;
140
+ }
141
+
142
+ // 色相 / 透明度滑条
143
+ &__slider {
144
+ position: relative;
145
+ height: 12px;
146
+ margin-top: 10px;
147
+ border-radius: 6px;
148
+ cursor: pointer;
149
+ user-select: none;
150
+ }
151
+
152
+ &__slider--alpha {
153
+ background-color: #fff;
154
+ background-image: repeating-conic-gradient(#d9d9d9 0% 25%, transparent 0% 50%);
155
+ background-size: 8px 8px;
156
+ }
157
+
158
+ &__slider-gradient {
159
+ position: absolute;
160
+ inset: 0;
161
+ border-radius: 6px;
162
+ }
163
+
164
+ &__slider-thumb {
165
+ position: absolute;
166
+ top: 50%;
167
+ width: 12px;
168
+ height: 12px;
169
+ border: 2px solid #fff;
170
+ border-radius: 50%;
171
+ box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
172
+ transform: translate(-50%, -50%);
173
+ pointer-events: none;
174
+ z-index: 1;
175
+ }
176
+
177
+ &__predefine {
178
+ display: grid;
179
+ grid-template-columns: repeat(10, 1fr);
180
+ gap: 4px;
181
+ margin-top: 12px;
182
+ }
183
+
184
+ &__color-cell {
185
+ width: 16px;
186
+ height: 16px;
187
+ border-radius: $border-radius-small;
188
+ border: 1px solid var(--ts-border-color-lighter);
189
+ cursor: pointer;
190
+
191
+ &.is-active {
192
+ box-shadow: 0 0 0 2px var(--ts-color-primary);
193
+ }
194
+ }
195
+
196
+ &__label {
197
+ font-size: $font-size-extra-small;
198
+ color: var(--ts-text-color-secondary);
199
+ }
200
+
201
+ &__hex-input {
202
+ display: flex;
203
+ align-items: center;
204
+ gap: 8px;
205
+ margin-top: 10px;
206
+ }
207
+
208
+ &__hex-field {
209
+ flex: 1;
210
+ height: 26px;
211
+ padding: 0 8px;
212
+ border: 1px solid var(--ts-border-color);
213
+ border-radius: $border-radius-base;
214
+ background-color: var(--ts-bg-color);
215
+ font-size: $font-size-small;
216
+ color: var(--ts-text-color-regular);
217
+ outline: none;
218
+
219
+ &:focus {
220
+ border-color: var(--ts-color-primary);
221
+ }
222
+ }
223
+
224
+ &__current {
225
+ display: flex;
226
+ align-items: center;
227
+ gap: 8px;
228
+ margin-top: 10px;
229
+ }
230
+
231
+ &__current-preview {
232
+ width: 20px;
233
+ height: 20px;
234
+ border-radius: $border-radius-small;
235
+ border: 1px solid var(--ts-border-color-lighter);
236
+ }
237
+
238
+ &__current-value {
239
+ font-size: $font-size-extra-small;
240
+ color: var(--ts-text-color-secondary);
241
+ font-family: monospace;
242
+ }
243
+ }
244
+
245
+ .ts-color-picker-panel {
246
+ width: 240px;
247
+ padding: 8px;
248
+ background-color: var(--ts-bg-color);
249
+ border-radius: $border-radius-base;
250
+
251
+ &__sv {
252
+ position: relative;
253
+ height: 140px;
254
+ border-radius: $border-radius-base;
255
+ cursor: crosshair;
256
+ user-select: none;
257
+ }
258
+
259
+ &__sv-cursor {
260
+ position: absolute;
261
+ width: 12px;
262
+ height: 12px;
263
+ border: 2px solid #fff;
264
+ border-radius: 50%;
265
+ box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
266
+ transform: translate(-50%, -50%);
267
+ pointer-events: none;
268
+ }
269
+
270
+ &__slider {
271
+ position: relative;
272
+ height: 12px;
273
+ margin-top: 10px;
274
+ border-radius: 6px;
275
+ cursor: pointer;
276
+ user-select: none;
277
+ }
278
+
279
+ &__slider--alpha {
280
+ background-color: #fff;
281
+ background-image: repeating-conic-gradient(#d9d9d9 0% 25%, transparent 0% 50%);
282
+ background-size: 8px 8px;
283
+ }
284
+
285
+ &__slider-gradient {
286
+ position: absolute;
287
+ inset: 0;
288
+ border-radius: 6px;
289
+ }
290
+
291
+ &__slider-thumb {
292
+ position: absolute;
293
+ top: 50%;
294
+ width: 12px;
295
+ height: 12px;
296
+ border: 2px solid #fff;
297
+ border-radius: 50%;
298
+ box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
299
+ transform: translate(-50%, -50%);
300
+ pointer-events: none;
301
+ z-index: 1;
302
+ }
303
+
304
+ &__native {
305
+ width: 100%;
306
+ height: 32px;
307
+ margin-top: 10px;
308
+ padding: 0;
309
+ border: 1px solid var(--ts-border-color);
310
+ border-radius: $border-radius-base;
311
+ cursor: pointer;
312
+ }
313
+
314
+ &__presets {
315
+ display: grid;
316
+ grid-template-columns: repeat(10, 1fr);
317
+ gap: 4px;
318
+ margin-top: 8px;
319
+ }
320
+
321
+ &__cell {
322
+ width: 16px;
323
+ height: 16px;
324
+ border-radius: $border-radius-small;
325
+ border: 1px solid var(--ts-border-color-lighter);
326
+ cursor: pointer;
327
+ display: inline-block;
328
+
329
+ &.is-active {
330
+ box-shadow: 0 0 0 2px var(--ts-color-primary);
331
+ }
332
+ }
333
+
334
+ &__current {
335
+ margin-top: 8px;
336
+ font-size: $font-size-extra-small;
337
+ color: var(--ts-text-color-secondary);
338
+ font-family: monospace;
339
+ }
102
340
  }
@@ -117,4 +117,211 @@
117
117
  }
118
118
 
119
119
  &--open .ts-date-picker__wrapper { border-color: var(--ts-color-primary); }
120
+
121
+ &__input {
122
+ flex: 1;
123
+ min-width: 0;
124
+ border: none;
125
+ outline: none;
126
+ background: transparent;
127
+ font-size: $font-size-base;
128
+ color: var(--ts-text-color-regular);
129
+ cursor: pointer;
130
+
131
+ &::placeholder { color: var(--ts-text-color-placeholder); }
132
+ }
133
+
134
+ &__clear {
135
+ flex: 0 0 auto;
136
+ margin-left: 6px;
137
+ color: var(--ts-text-color-placeholder);
138
+ cursor: pointer;
139
+
140
+ &:hover { color: var(--ts-text-color-regular); }
141
+ }
142
+
143
+ &__icon {
144
+ flex: 0 0 auto;
145
+ display: inline-flex;
146
+ align-items: center;
147
+ margin-left: 8px;
148
+ color: var(--ts-text-color-placeholder);
149
+ }
150
+
151
+ &__popper {
152
+ position: fixed;
153
+ z-index: 2000;
154
+ padding: 10px;
155
+ background-color: var(--ts-bg-color);
156
+ border: 1px solid var(--ts-border-color-lighter);
157
+ border-radius: $border-radius-base;
158
+ box-shadow: var(--ts-box-shadow-light);
159
+ }
160
+
161
+ &__shortcuts {
162
+ display: flex;
163
+ flex-wrap: wrap;
164
+ gap: 8px;
165
+ padding-bottom: 8px;
166
+ margin-bottom: 8px;
167
+ border-bottom: 1px solid var(--ts-border-color-lighter);
168
+ }
169
+
170
+ &__shortcut {
171
+ font-size: $font-size-small;
172
+ color: var(--ts-color-primary);
173
+ cursor: pointer;
174
+ }
175
+
176
+ &__panels {
177
+ display: flex;
178
+ gap: 10px;
179
+ }
180
+
181
+ &__footer {
182
+ display: flex;
183
+ align-items: center;
184
+ justify-content: space-between;
185
+ padding-top: 8px;
186
+ margin-top: 8px;
187
+ border-top: 1px solid var(--ts-border-color-lighter);
188
+ }
189
+
190
+ &__today,
191
+ &__footer-clear {
192
+ padding: 0;
193
+ font-size: $font-size-small;
194
+ color: var(--ts-color-primary);
195
+ background: none;
196
+ border: none;
197
+ cursor: pointer;
198
+ }
199
+
200
+ &__range {
201
+ display: flex;
202
+ align-items: center;
203
+ gap: 8px;
204
+ }
205
+
206
+ &__range-label {
207
+ display: block;
208
+ margin-bottom: 4px;
209
+ font-size: $font-size-small;
210
+ color: var(--ts-text-color-placeholder);
211
+ }
212
+
213
+ &__separator {
214
+ color: var(--ts-text-color-placeholder);
215
+ }
216
+ }
217
+
218
+ .ts-dp-panel {
219
+ width: 260px;
220
+ user-select: none;
221
+
222
+ &__header {
223
+ display: flex;
224
+ align-items: center;
225
+ justify-content: space-between;
226
+ padding: 4px 6px 8px;
227
+ border-bottom: 1px solid var(--ts-border-color-lighter);
228
+ }
229
+
230
+ &__nav {
231
+ padding: 0 4px;
232
+ font-size: 14px;
233
+ line-height: 1;
234
+ color: var(--ts-text-color-regular);
235
+ background: none;
236
+ border: none;
237
+ cursor: pointer;
238
+
239
+ &:hover { color: var(--ts-color-primary); }
240
+ }
241
+
242
+ &__title {
243
+ flex: 1;
244
+ font-size: $font-size-base;
245
+ font-weight: $font-weight-primary;
246
+ color: var(--ts-text-color-primary);
247
+ text-align: center;
248
+
249
+ &.is-clickable {
250
+ cursor: pointer;
251
+
252
+ &:hover { color: var(--ts-color-primary); }
253
+ }
254
+ }
255
+
256
+ &__weekdays {
257
+ display: grid;
258
+ grid-template-columns: repeat(7, 1fr);
259
+ padding: 6px 0;
260
+ font-size: $font-size-small;
261
+ color: var(--ts-text-color-placeholder);
262
+ text-align: center;
263
+ }
264
+
265
+ &__grid {
266
+ display: grid;
267
+ grid-template-columns: repeat(7, 1fr);
268
+ }
269
+
270
+ &__grid--month,
271
+ &__grid--year {
272
+ grid-template-columns: repeat(3, 1fr);
273
+ gap: 8px;
274
+ padding: 10px 4px;
275
+ }
276
+
277
+ &__cell {
278
+ display: flex;
279
+ align-items: center;
280
+ justify-content: center;
281
+ height: 32px;
282
+ font-size: $font-size-base;
283
+ color: var(--ts-text-color-regular);
284
+ border-radius: $border-radius-base;
285
+ cursor: pointer;
286
+
287
+ &:hover { background-color: var(--ts-color-primary-light-9); }
288
+
289
+ &.is-other-month { color: var(--ts-text-color-placeholder); }
290
+ &.is-today { color: var(--ts-color-primary); font-weight: $font-weight-primary; }
291
+ &.is-selected,
292
+ &.is-range-start,
293
+ &.is-range-end {
294
+ color: #fff;
295
+ background-color: var(--ts-color-primary);
296
+ }
297
+ &.is-in-range { background-color: var(--ts-color-primary-light-9); }
298
+ &.is-hover-range { background-color: var(--ts-color-primary-light-7); }
299
+ &.ts-dp-panel__cell--hover { background-color: var(--ts-color-primary-light-7); }
300
+ &.is-current { color: var(--ts-color-primary); font-weight: $font-weight-primary; }
301
+ &.is-disabled {
302
+ color: var(--ts-text-color-disabled);
303
+ background: transparent;
304
+ cursor: not-allowed;
305
+ }
306
+ }
307
+
308
+ &__cell--month,
309
+ &__cell--year {
310
+ height: 40px;
311
+ }
312
+
313
+ &__footer {
314
+ padding-top: 8px;
315
+ text-align: right;
316
+ border-top: 1px solid var(--ts-border-color-lighter);
317
+ }
318
+
319
+ &__today-btn {
320
+ padding: 0;
321
+ font-size: $font-size-small;
322
+ color: var(--ts-color-primary);
323
+ background: none;
324
+ border: none;
325
+ cursor: pointer;
326
+ }
120
327
  }