@gez/date-time-kit 1.1.4 → 2.0.0-alpha.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/assets/arrow-down.svg +1 -0
- package/dist/assets/arrow-left-double.svg +1 -0
- package/dist/assets/arrow-left.svg +1 -0
- package/dist/assets/arrow-right-double.svg +1 -0
- package/dist/assets/arrow-right.svg +1 -0
- package/dist/assets/back-arrow.svg +1 -0
- package/dist/assets/time.svg +1 -0
- package/dist/components/calendar/index.css +108 -0
- package/dist/components/calendar/index.d.ts +84 -0
- package/dist/components/calendar/index.mjs +238 -0
- package/dist/components/hhmmss-ms-list-grp/index.css +60 -0
- package/dist/components/hhmmss-ms-list-grp/index.d.ts +54 -0
- package/dist/components/hhmmss-ms-list-grp/index.mjs +226 -0
- package/dist/components/i18n/index.d.ts +13 -0
- package/dist/components/i18n/index.mjs +42 -0
- package/dist/components/num-list/index.css +35 -0
- package/dist/components/num-list/index.d.ts +68 -0
- package/dist/components/num-list/index.mjs +259 -0
- package/dist/components/period-selector/date-nav.css +92 -0
- package/dist/components/period-selector/date-nav.d.ts +64 -0
- package/dist/components/period-selector/date-nav.mjs +161 -0
- package/dist/components/period-selector/index.css +152 -0
- package/dist/components/period-selector/index.d.ts +68 -0
- package/dist/components/period-selector/index.mjs +312 -0
- package/dist/components/popover/index.d.ts +34 -0
- package/dist/components/popover/index.mjs +104 -0
- package/dist/components/quick-selector/index.css +167 -0
- package/dist/components/quick-selector/index.d.ts +74 -0
- package/dist/components/quick-selector/index.mjs +347 -0
- package/dist/components/web-component-base/index.css +9 -0
- package/dist/components/web-component-base/index.d.ts +46 -0
- package/dist/components/web-component-base/index.mjs +118 -0
- package/dist/components/web-component-base/scrollbar.css +25 -0
- package/dist/components/yyyymmdd-list-grp/index.css +32 -0
- package/dist/components/yyyymmdd-list-grp/index.d.ts +52 -0
- package/dist/components/yyyymmdd-list-grp/index.mjs +181 -0
- package/dist/i18n.d.ts +36 -0
- package/dist/i18n.mjs +368 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.mjs +15 -0
- package/dist/utils.d.ts +12 -0
- package/dist/utils.mjs +21 -0
- package/package.json +37 -63
- package/src/assets/arrow-down.svg +1 -0
- package/src/assets/arrow-left-double.svg +1 -0
- package/src/assets/arrow-left.svg +1 -0
- package/src/assets/arrow-right-double.svg +1 -0
- package/src/assets/arrow-right.svg +1 -0
- package/src/assets/back-arrow.svg +1 -0
- package/src/assets/time.svg +1 -0
- package/src/components/calendar/index.scss +128 -0
- package/src/components/calendar/index.ts +453 -0
- package/src/components/hhmmss-ms-list-grp/index.scss +61 -0
- package/src/components/hhmmss-ms-list-grp/index.ts +387 -0
- package/src/components/i18n/index.ts +48 -0
- package/src/components/num-list/index.scss +38 -0
- package/src/components/num-list/index.ts +357 -0
- package/src/components/period-selector/date-nav.scss +108 -0
- package/src/components/period-selector/date-nav.ts +322 -0
- package/src/components/period-selector/index.scss +160 -0
- package/src/components/period-selector/index.ts +552 -0
- package/src/components/popover/index.ts +127 -0
- package/src/components/quick-selector/index.scss +183 -0
- package/src/components/quick-selector/index.ts +611 -0
- package/src/components/web-component-base/index.scss +11 -0
- package/src/components/web-component-base/index.ts +235 -0
- package/src/components/web-component-base/scrollbar.scss +30 -0
- package/src/components/yyyymmdd-list-grp/index.scss +33 -0
- package/src/components/yyyymmdd-list-grp/index.ts +257 -0
- package/src/i18n.ts +415 -0
- package/src/index.ts +12 -0
- package/src/utils.ts +36 -0
- package/README.md +0 -152
- package/dist/index.css +0 -1
- package/dist/index.html +0 -85
- package/dist/index.js +0 -145
- package/type.d.ts +0 -164
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { closestByEvent, css, debounce, html } from '../../utils';
|
|
2
|
+
import {
|
|
3
|
+
type BaseAttrs,
|
|
4
|
+
type Emit2EventMap,
|
|
5
|
+
UiBase
|
|
6
|
+
} from '../web-component-base';
|
|
7
|
+
// import styleStr from './index.scss?inline';
|
|
8
|
+
const styleStr = css`
|
|
9
|
+
:host {
|
|
10
|
+
--color-current-bg: var(--calendar-item-in-range-bg, #002BE726);
|
|
11
|
+
--color-current-text: var(--calendar-item-in-range-text, #002BE7);
|
|
12
|
+
--color-hover-bg: var(--calendar-item-hover-bg, #0000000D);
|
|
13
|
+
--color-hover-text: var(--calendar-item-hover-text, #000);
|
|
14
|
+
display: block;
|
|
15
|
+
overflow: hidden auto;
|
|
16
|
+
position: relative !important;
|
|
17
|
+
overflow-anchor: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.container {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: 5px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.item {
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
user-select: none;
|
|
30
|
+
width: 100%;
|
|
31
|
+
text-align: center;
|
|
32
|
+
border-radius: 2px;
|
|
33
|
+
padding: 5px 2px;
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
}
|
|
36
|
+
.item.item-current {
|
|
37
|
+
color: var(--color-current-text);
|
|
38
|
+
background-color: var(--color-current-bg);
|
|
39
|
+
}
|
|
40
|
+
.item:hover {
|
|
41
|
+
color: var(--color-hover-text);
|
|
42
|
+
background-color: var(--color-hover-bg);
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
export interface Attrs extends BaseAttrs {
|
|
47
|
+
/**
|
|
48
|
+
* The current number in the list. The component will scroll to this number when rendered.
|
|
49
|
+
* @type {number}
|
|
50
|
+
*/
|
|
51
|
+
'current-num': number;
|
|
52
|
+
/**
|
|
53
|
+
* The minimum number in the list (include). If not set, there is no minimum limit.
|
|
54
|
+
* @type {number}
|
|
55
|
+
* @default -Infinity
|
|
56
|
+
*/
|
|
57
|
+
'min-num'?: number;
|
|
58
|
+
/**
|
|
59
|
+
* The maximum number in the list (include). If not set, there is no maximum limit.
|
|
60
|
+
* @type {number}
|
|
61
|
+
* @default Infinity
|
|
62
|
+
*/
|
|
63
|
+
'max-num'?: number;
|
|
64
|
+
/**
|
|
65
|
+
* The position to scroll the current number into view.
|
|
66
|
+
* @type {`"center" | "end" | "nearest" | "start"`}
|
|
67
|
+
* @default "start"
|
|
68
|
+
*/
|
|
69
|
+
position?: ScrollLogicalPosition;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface Emits {
|
|
73
|
+
'select-num': {
|
|
74
|
+
oldNum: number;
|
|
75
|
+
newNum: number;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export type EventMap = Emit2EventMap<Emits>;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 基础的数字列表组件。允许无限滚动。点击后可以滚动定位到当前数字。
|
|
82
|
+
*
|
|
83
|
+
* 存在一个 formatter 方法,可以重写该方法以自定义数字的显示格式。
|
|
84
|
+
*/
|
|
85
|
+
export class Ele extends UiBase<Attrs, Emits> {
|
|
86
|
+
public static tagName = 'dt-num-list' as const;
|
|
87
|
+
|
|
88
|
+
static get observedAttributes(): string[] {
|
|
89
|
+
return [
|
|
90
|
+
...(super.observedAttributes as (keyof BaseAttrs)[]),
|
|
91
|
+
'current-num',
|
|
92
|
+
'min-num',
|
|
93
|
+
'max-num'
|
|
94
|
+
] satisfies (keyof Attrs)[];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
protected _style = styleStr;
|
|
98
|
+
protected _template = html`<div class="container" part="container"></div>`;
|
|
99
|
+
|
|
100
|
+
constructor() {
|
|
101
|
+
super();
|
|
102
|
+
this._applyTemplate();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
private get _containerEle() {
|
|
106
|
+
return this.shadowRoot?.querySelector('.container') as HTMLElement;
|
|
107
|
+
}
|
|
108
|
+
private get _currentItemEle() {
|
|
109
|
+
return this._containerEle.querySelector<HTMLElement>('.item-current');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
public get currentNum() {
|
|
113
|
+
return Number(this._getAttr('current-num'));
|
|
114
|
+
}
|
|
115
|
+
public set currentNum(val: number) {
|
|
116
|
+
this.setAttribute('current-num', String(val));
|
|
117
|
+
}
|
|
118
|
+
public get minNum() {
|
|
119
|
+
return Number(this._getAttr('min-num', '-Infinity'));
|
|
120
|
+
}
|
|
121
|
+
public set minNum(val: number) {
|
|
122
|
+
let min = +val;
|
|
123
|
+
if (Number.isNaN(min)) min = Number.NEGATIVE_INFINITY;
|
|
124
|
+
if (min > this.maxNum) [this.maxNum, min] = [min, this.maxNum];
|
|
125
|
+
this.setAttribute('min-num', String(val));
|
|
126
|
+
}
|
|
127
|
+
public get maxNum() {
|
|
128
|
+
return Number(this._getAttr('max-num', 'Infinity'));
|
|
129
|
+
}
|
|
130
|
+
public set maxNum(val: number) {
|
|
131
|
+
let max = +val;
|
|
132
|
+
if (Number.isNaN(max)) max = Number.POSITIVE_INFINITY;
|
|
133
|
+
if (max < this.minNum) [this.minNum, max] = [max, this.minNum];
|
|
134
|
+
this.setAttribute('max-num', String(val));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
private _createItem = (num: number, currentNum = this.currentNum) => {
|
|
138
|
+
const ele = document.createElement('div');
|
|
139
|
+
ele.setAttribute('part', (ele.className = 'item'));
|
|
140
|
+
ele.classList.toggle('item-current', num === currentNum);
|
|
141
|
+
ele.part.toggle('item-current', num === currentNum);
|
|
142
|
+
ele.dataset.number = num + '';
|
|
143
|
+
ele.textContent = this.formatter(num);
|
|
144
|
+
return ele;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
private _intersectionOb: IntersectionObserver | null = null;
|
|
148
|
+
private _destroyOb() {
|
|
149
|
+
this._intersectionOb?.disconnect();
|
|
150
|
+
this._intersectionOb = null;
|
|
151
|
+
}
|
|
152
|
+
private _initOb() {
|
|
153
|
+
this._destroyOb();
|
|
154
|
+
if (!this.shadowRoot) return;
|
|
155
|
+
this._intersectionOb = new IntersectionObserver(
|
|
156
|
+
(
|
|
157
|
+
entries: IntersectionObserverEntry[],
|
|
158
|
+
observer: IntersectionObserver
|
|
159
|
+
) => {
|
|
160
|
+
const container = this._containerEle;
|
|
161
|
+
const firstItem = container.firstElementChild as HTMLElement;
|
|
162
|
+
const lastItem = container.lastElementChild as HTMLElement;
|
|
163
|
+
for (const { target, isIntersecting } of entries) {
|
|
164
|
+
if (!isIntersecting) continue;
|
|
165
|
+
observer.unobserve(target);
|
|
166
|
+
if (target === this._currentItemEle) {
|
|
167
|
+
observer.observe(firstItem!);
|
|
168
|
+
observer.observe(lastItem!);
|
|
169
|
+
}
|
|
170
|
+
if (target === firstItem) {
|
|
171
|
+
this._loadBefore();
|
|
172
|
+
} else if (target === lastItem) {
|
|
173
|
+
this._loadAfter();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{ root: this }
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
private _loadBefore = debounce(() => {
|
|
182
|
+
const container = this._containerEle;
|
|
183
|
+
const firstItem = container.firstElementChild as HTMLElement;
|
|
184
|
+
const lastItem = container.lastElementChild as HTMLElement;
|
|
185
|
+
const firstNum = Number(firstItem.dataset.number);
|
|
186
|
+
const curNum = this.currentNum;
|
|
187
|
+
const pageSize = this._pageSize;
|
|
188
|
+
const itemHeight = this._itemHeight;
|
|
189
|
+
const items = [...Array(pageSize * 2)].map((_, i) =>
|
|
190
|
+
this._createItem(firstNum - pageSize * 2 + i, curNum)
|
|
191
|
+
);
|
|
192
|
+
this._intersectionOb?.unobserve(firstItem);
|
|
193
|
+
this._intersectionOb?.unobserve(lastItem);
|
|
194
|
+
const scrollTop = this.scrollTop;
|
|
195
|
+
container.prepend(...items);
|
|
196
|
+
for (let i = 0; i < items.length; ++i) {
|
|
197
|
+
container.removeChild(container.lastElementChild!);
|
|
198
|
+
}
|
|
199
|
+
const addedHeight = items.length * itemHeight;
|
|
200
|
+
this.scrollTo({
|
|
201
|
+
top: scrollTop + addedHeight,
|
|
202
|
+
behavior: 'instant'
|
|
203
|
+
});
|
|
204
|
+
this._intersectionOb?.observe(items[0]);
|
|
205
|
+
this._intersectionOb?.observe(container.lastElementChild!);
|
|
206
|
+
}, 0);
|
|
207
|
+
private _loadAfter = debounce(() => {
|
|
208
|
+
const container = this._containerEle;
|
|
209
|
+
const firstItem = container.firstElementChild as HTMLElement;
|
|
210
|
+
const lastItem = container.lastElementChild as HTMLElement;
|
|
211
|
+
const curNum = this.currentNum;
|
|
212
|
+
const pageSize = this._pageSize;
|
|
213
|
+
const itemHeight = this._itemHeight;
|
|
214
|
+
const lastNum = Number(lastItem.textContent);
|
|
215
|
+
const items = [...Array(pageSize * 2)].map((_, i) =>
|
|
216
|
+
this._createItem(lastNum + i + 1, curNum)
|
|
217
|
+
);
|
|
218
|
+
this._intersectionOb?.unobserve(firstItem);
|
|
219
|
+
this._intersectionOb?.unobserve(lastItem);
|
|
220
|
+
const scrollTop = this.scrollTop;
|
|
221
|
+
container.append(...items);
|
|
222
|
+
for (let i = 0; i < items.length; ++i) {
|
|
223
|
+
container.removeChild(container.firstElementChild!);
|
|
224
|
+
}
|
|
225
|
+
const addedHeight = items.length * itemHeight;
|
|
226
|
+
this.scrollTo({
|
|
227
|
+
top: scrollTop - addedHeight,
|
|
228
|
+
behavior: 'instant'
|
|
229
|
+
});
|
|
230
|
+
this._intersectionOb?.observe(container.firstElementChild!);
|
|
231
|
+
this._intersectionOb?.observe(items[items.length - 1]);
|
|
232
|
+
}, 0);
|
|
233
|
+
|
|
234
|
+
public connectedCallback() {
|
|
235
|
+
if (!super.connectedCallback()) return;
|
|
236
|
+
this._render();
|
|
237
|
+
this.addEventListener('click', this._onClick);
|
|
238
|
+
}
|
|
239
|
+
public disconnectedCallback() {
|
|
240
|
+
if (!super.disconnectedCallback()) return;
|
|
241
|
+
this.removeEventListener('click', this._onClick);
|
|
242
|
+
this._destroyOb();
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
protected _onAttrChanged(name: string, oldValue: string, newValue: string) {
|
|
246
|
+
super._onAttrChanged(name, oldValue, newValue);
|
|
247
|
+
// 选中选项后,会更新 dom class,此时触发的更新不需要重新渲染。
|
|
248
|
+
// 这里是针对无限滚动时重新渲染会导致元素滚动异常。
|
|
249
|
+
if (
|
|
250
|
+
name === 'current-num' &&
|
|
251
|
+
newValue ===
|
|
252
|
+
this._containerEle.querySelector<HTMLElement>('.item-current')
|
|
253
|
+
?.dataset.number
|
|
254
|
+
) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
this._render();
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
private get _itemHeight() {
|
|
261
|
+
const container = this._containerEle;
|
|
262
|
+
const items = Array.from(
|
|
263
|
+
container.querySelectorAll<HTMLElement>('.item')
|
|
264
|
+
);
|
|
265
|
+
const len = items.length;
|
|
266
|
+
if (len === 1) {
|
|
267
|
+
container.append(this._createItem(0, 1));
|
|
268
|
+
} else if (len === 0) {
|
|
269
|
+
container.append(this._createItem(0, 1), this._createItem(0, 1));
|
|
270
|
+
}
|
|
271
|
+
const h = (container.firstElementChild as HTMLElement).offsetHeight;
|
|
272
|
+
const itemNum = Math.max(2, len);
|
|
273
|
+
const gap = Math.max(
|
|
274
|
+
0,
|
|
275
|
+
(container.clientHeight - h * itemNum) / (itemNum - 1)
|
|
276
|
+
);
|
|
277
|
+
if (len === 0) {
|
|
278
|
+
container.removeChild(container.lastElementChild!);
|
|
279
|
+
container.removeChild(container.lastElementChild!);
|
|
280
|
+
} else if (len === 1) {
|
|
281
|
+
container.removeChild(container.lastElementChild!);
|
|
282
|
+
}
|
|
283
|
+
return h + gap;
|
|
284
|
+
}
|
|
285
|
+
private get _pageSize() {
|
|
286
|
+
const thisHeight = this.clientHeight;
|
|
287
|
+
if (thisHeight === 0) return 10;
|
|
288
|
+
return Math.min(10, Math.ceil(thisHeight / this._itemHeight));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
public scrollToCurrent = () => {
|
|
292
|
+
const ele = this._currentItemEle;
|
|
293
|
+
if (!ele) return;
|
|
294
|
+
this._intersectionOb?.observe(ele);
|
|
295
|
+
const containerRect = this._containerEle.getBoundingClientRect();
|
|
296
|
+
const eleRect = ele.getBoundingClientRect();
|
|
297
|
+
const offsetTop = eleRect.top - containerRect.top + this.scrollTop;
|
|
298
|
+
this.scrollTo({
|
|
299
|
+
top: offsetTop
|
|
300
|
+
});
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
private _render = debounce(() => {
|
|
304
|
+
if (!this.isConnected) return;
|
|
305
|
+
this._destroyOb();
|
|
306
|
+
const container = this._containerEle;
|
|
307
|
+
container.innerHTML = '';
|
|
308
|
+
if (!this.hasAttribute('current-num')) return;
|
|
309
|
+
|
|
310
|
+
const currentNum = this.currentNum;
|
|
311
|
+
const minNum = this.minNum;
|
|
312
|
+
const maxNum = this.maxNum;
|
|
313
|
+
|
|
314
|
+
if (
|
|
315
|
+
minNum === Number.NEGATIVE_INFINITY &&
|
|
316
|
+
maxNum === Number.POSITIVE_INFINITY
|
|
317
|
+
) {
|
|
318
|
+
this._initOb();
|
|
319
|
+
const pageSize = this._pageSize;
|
|
320
|
+
for (let i = -pageSize * 2; i <= pageSize * 2; ++i) {
|
|
321
|
+
container.appendChild(
|
|
322
|
+
this._createItem(currentNum + i, currentNum)
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
} else
|
|
326
|
+
for (let i = minNum; i <= maxNum; ++i) {
|
|
327
|
+
container.appendChild(this._createItem(i, currentNum));
|
|
328
|
+
}
|
|
329
|
+
setTimeout(this.scrollToCurrent, 0);
|
|
330
|
+
}, 0);
|
|
331
|
+
|
|
332
|
+
private _onClick = (e: MouseEvent) => {
|
|
333
|
+
if (!this.isConnected) return;
|
|
334
|
+
const container = this._containerEle;
|
|
335
|
+
const oldCurrent =
|
|
336
|
+
container.querySelector<HTMLElement>('.item-current');
|
|
337
|
+
const item = closestByEvent(e, '.item', this);
|
|
338
|
+
if (!item || item === oldCurrent) return;
|
|
339
|
+
oldCurrent?.classList.remove('item-current');
|
|
340
|
+
oldCurrent?.part.remove('item-current');
|
|
341
|
+
item.classList.add('item-current');
|
|
342
|
+
item.part.add('item-current');
|
|
343
|
+
this.scrollToCurrent();
|
|
344
|
+
super.dispatchEvent(
|
|
345
|
+
'select-num',
|
|
346
|
+
{
|
|
347
|
+
oldNum: +(oldCurrent?.dataset.number ?? this.currentNum),
|
|
348
|
+
newNum: +item.dataset.number!
|
|
349
|
+
},
|
|
350
|
+
true
|
|
351
|
+
);
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
public formatter = (num: number) => '' + num;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
Ele.define();
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
|
|
2
|
+
.wrapper {
|
|
3
|
+
display: block;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
|
|
10
|
+
&.show-list .btns {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.btns {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.btn {
|
|
21
|
+
width: 25px;
|
|
22
|
+
height: 25px;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
background: 50% / 16px 16px no-repeat;
|
|
25
|
+
--icon-arrow-left: url('@/assets/arrow-left.svg');
|
|
26
|
+
--icon-arrow-left-double: url('@/assets/arrow-left-double.svg');
|
|
27
|
+
--icon-arrow-right: url('@/assets/arrow-right.svg');
|
|
28
|
+
--icon-arrow-right-double: url('@/assets/arrow-right-double.svg');
|
|
29
|
+
background-image: var(--bg-img);
|
|
30
|
+
border-radius: 50%;
|
|
31
|
+
|
|
32
|
+
&:hover {
|
|
33
|
+
background-color: #eee;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:host(:not([show-ctrl-btn-year-add])) &.add.year,
|
|
37
|
+
:host(:not([show-ctrl-btn-year-sub])) &.sub.year,
|
|
38
|
+
:host(:not([show-ctrl-btn-month-add])) &.add.month,
|
|
39
|
+
:host(:not([show-ctrl-btn-month-sub])) &.sub.month {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.sub {
|
|
44
|
+
--bg-img: var(--icon-arrow-left);
|
|
45
|
+
|
|
46
|
+
:host([show-ctrl-btn-month-add]) &.add.year,
|
|
47
|
+
:host([show-ctrl-btn-month-sub]) &.sub.year {
|
|
48
|
+
--bg-img: var(--icon-arrow-left-double);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.add {
|
|
53
|
+
--bg-img: var(--icon-arrow-right);
|
|
54
|
+
|
|
55
|
+
:host([show-ctrl-btn-month-add]) &.add.year,
|
|
56
|
+
:host([show-ctrl-btn-month-sub]) &.sub.year {
|
|
57
|
+
--bg-img: var(--icon-arrow-right-double);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
dt-yyyymmdd-list-grp {
|
|
63
|
+
width: 100%;
|
|
64
|
+
|
|
65
|
+
&::part(list) {
|
|
66
|
+
scroll-behavior: smooth;
|
|
67
|
+
}
|
|
68
|
+
&::part(col label) {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
dt-popover {
|
|
74
|
+
width: 100%;
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
align-items: center;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.title-wrapper {
|
|
82
|
+
box-sizing: border-box;
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
gap: 2px;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
// 25px = icon height
|
|
88
|
+
margin: calc((45px - 25px) / 2) 0;
|
|
89
|
+
min-height: 25px;
|
|
90
|
+
padding: 0 10px;
|
|
91
|
+
border-radius: 2px;
|
|
92
|
+
user-select: none;
|
|
93
|
+
|
|
94
|
+
&:hover {
|
|
95
|
+
background-color: #eee;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.title-arrow {
|
|
100
|
+
display: inline-block;
|
|
101
|
+
width: 16px;
|
|
102
|
+
height: 16px;
|
|
103
|
+
background: url('@/assets/arrow-down.svg') no-repeat center center;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
dt-popover[open] .title-arrow {
|
|
107
|
+
transform: rotate(180deg);
|
|
108
|
+
}
|