@gez/date-time-kit 2.0.0-alpha.0 → 2.0.0-alpha.2
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/calendar/index.d.ts +1 -1
- package/dist/components/calendar/index.mjs +1 -1
- package/dist/components/date-time-selector/index.d.ts +61 -0
- package/dist/components/date-time-selector/index.mjs +212 -0
- package/dist/components/date-time-selector/styleStr.d.ts +1 -0
- package/dist/components/date-time-selector/styleStr.mjs +6 -0
- package/dist/components/hhmmss-ms-list-grp/index.d.ts +3 -3
- package/dist/components/hhmmss-ms-list-grp/index.mjs +35 -33
- package/dist/components/period-selector/index.css +2 -1
- package/dist/components/period-selector/index.d.ts +9 -0
- package/dist/components/period-selector/index.mjs +31 -12
- package/dist/components/quick-selector/index.d.ts +14 -2
- package/dist/components/quick-selector/index.mjs +89 -57
- package/dist/components/{period-selector/date-nav.d.ts → yyyymm-nav/index.d.ts} +4 -6
- package/dist/components/{period-selector/date-nav.mjs → yyyymm-nav/index.mjs} +9 -10
- package/dist/components/yyyymmdd-list-grp/index.mjs +6 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +2 -0
- package/package.json +2 -2
- package/src/components/calendar/index.ts +2 -2
- package/src/components/date-time-selector/index.ts +291 -0
- package/src/components/date-time-selector/styleStr.ts +125 -0
- package/src/components/hhmmss-ms-list-grp/index.ts +44 -54
- package/src/components/period-selector/index.scss +3 -2
- package/src/components/period-selector/index.ts +45 -16
- package/src/components/quick-selector/index.ts +102 -57
- package/src/components/{period-selector/date-nav.ts → yyyymm-nav/index.ts} +12 -15
- package/src/components/yyyymmdd-list-grp/index.ts +38 -17
- package/src/index.ts +1 -0
- /package/dist/components/{period-selector/date-nav.css → yyyymm-nav/index.css} +0 -0
- /package/src/components/{period-selector/date-nav.scss → yyyymm-nav/index.scss} +0 -0
|
@@ -12,7 +12,7 @@ export interface Attrs extends BaseAttrs {
|
|
|
12
12
|
/**
|
|
13
13
|
* The start time of the calendar display range.
|
|
14
14
|
* @type {`string | number`} A value that can be passed to the Date constructor.
|
|
15
|
-
* @default '
|
|
15
|
+
* @default 'showing-time'
|
|
16
16
|
*/
|
|
17
17
|
'time-start'?: string | number;
|
|
18
18
|
/**
|
|
@@ -191,7 +191,7 @@ export class Ele extends UiBase {
|
|
|
191
191
|
return this._getAttr("week-start-at", "sun");
|
|
192
192
|
}
|
|
193
193
|
set weekStartAt(val) {
|
|
194
|
-
if (weekKey.includes(val)) return;
|
|
194
|
+
if (!weekKey.includes(val)) return;
|
|
195
195
|
this.setAttribute("week-start-at", val);
|
|
196
196
|
}
|
|
197
197
|
get showOtherMonth() {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type BaseAttrs, type Emit2EventMap, UiBase } from '../web-component-base';
|
|
2
|
+
import { type Weeks } from '../calendar';
|
|
3
|
+
export interface Attrs extends BaseAttrs {
|
|
4
|
+
/**
|
|
5
|
+
* Set which day of the week is the first day.
|
|
6
|
+
* @type `'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'`
|
|
7
|
+
* @default 'sun'
|
|
8
|
+
*/
|
|
9
|
+
'week-start-at'?: Weeks;
|
|
10
|
+
/**
|
|
11
|
+
* The time of the calendar.
|
|
12
|
+
* @type {`string | number`} A value that can be passed to the Date constructor.
|
|
13
|
+
* @default Date.now()
|
|
14
|
+
*/
|
|
15
|
+
'current-time'?: string | number;
|
|
16
|
+
/**
|
|
17
|
+
* The showing time, used to determine the month to show on calendar.
|
|
18
|
+
* @type {`string | number`} A value that can be passed to the Date constructor.
|
|
19
|
+
* @default 'current-time'
|
|
20
|
+
*/
|
|
21
|
+
'showing-time'?: string | number;
|
|
22
|
+
/**
|
|
23
|
+
* 选择器的粒度,表示最小可选的时间单位。默认为 millisecond。
|
|
24
|
+
* 例如设置为 'minute',则表示只能选择到分钟,秒和毫秒将被忽略。
|
|
25
|
+
*/
|
|
26
|
+
'min-granularity'?: 'day' | 'hour' | 'minute' | 'second' | 'millisecond';
|
|
27
|
+
}
|
|
28
|
+
export interface Emits {
|
|
29
|
+
'select-time': Date;
|
|
30
|
+
'open-change': boolean;
|
|
31
|
+
}
|
|
32
|
+
export type EventMap = Emit2EventMap<Emits>;
|
|
33
|
+
export declare class Ele extends UiBase<Attrs, Emits> {
|
|
34
|
+
static readonly tagName: "dt-date-time-selector";
|
|
35
|
+
static get observedAttributes(): string[];
|
|
36
|
+
get currentTime(): number | string | Date;
|
|
37
|
+
set currentTime(val: number | string | Date);
|
|
38
|
+
get showingTime(): number | string | Date;
|
|
39
|
+
set showingTime(val: number | string | Date);
|
|
40
|
+
get weekStartAt(): Weeks;
|
|
41
|
+
set weekStartAt(val: Weeks);
|
|
42
|
+
get minGranularity(): "day" | "hour" | "minute" | "second" | "millisecond";
|
|
43
|
+
set minGranularity(val: 'day' | 'hour' | 'minute' | 'second' | 'millisecond');
|
|
44
|
+
protected _style: string;
|
|
45
|
+
protected _template: string;
|
|
46
|
+
private get _navEle();
|
|
47
|
+
private get _calendar();
|
|
48
|
+
private get _timeSelector();
|
|
49
|
+
private get _timePopover();
|
|
50
|
+
constructor();
|
|
51
|
+
connectedCallback(): void;
|
|
52
|
+
disconnectedCallback(): void;
|
|
53
|
+
protected _onAttrChanged(name: string, oldValue: string, newValue: string): void;
|
|
54
|
+
private _render;
|
|
55
|
+
private _onCalendarSelect;
|
|
56
|
+
private _onNavChange;
|
|
57
|
+
private _onTimePopoverOpenChange;
|
|
58
|
+
private _onNavOpenToggle;
|
|
59
|
+
private _onTimeSelectorDoneClick;
|
|
60
|
+
timeFormatter: (time: Date, minGranularity: "day" | "hour" | "minute" | "second" | "millisecond") => string;
|
|
61
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
var __freeze = Object.freeze;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
|
|
6
|
+
var _a;
|
|
7
|
+
import { closestByEvent, debounce, html } from "../../utils.mjs";
|
|
8
|
+
import {
|
|
9
|
+
UiBase
|
|
10
|
+
} from "../web-component-base/index.mjs";
|
|
11
|
+
import {
|
|
12
|
+
Ele as YyyyMmNavEle
|
|
13
|
+
} from "../yyyymm-nav/index.mjs";
|
|
14
|
+
import { styleStr } from "./styleStr.mjs";
|
|
15
|
+
YyyyMmNavEle.define();
|
|
16
|
+
import {
|
|
17
|
+
Ele as CalendarBaseEle,
|
|
18
|
+
weekKey
|
|
19
|
+
} from "../calendar/index.mjs";
|
|
20
|
+
CalendarBaseEle.define();
|
|
21
|
+
import { Ele as HhMmSsMsListGrpEle } from "../hhmmss-ms-list-grp/index.mjs";
|
|
22
|
+
HhMmSsMsListGrpEle.define();
|
|
23
|
+
import { Ele as PopoverEle } from "../popover/index.mjs";
|
|
24
|
+
PopoverEle.define();
|
|
25
|
+
const granularityList = [
|
|
26
|
+
"day",
|
|
27
|
+
"hour",
|
|
28
|
+
"minute",
|
|
29
|
+
"second",
|
|
30
|
+
"millisecond"
|
|
31
|
+
];
|
|
32
|
+
export class Ele extends UiBase {
|
|
33
|
+
constructor() {
|
|
34
|
+
super();
|
|
35
|
+
__publicField(this, "_style", styleStr);
|
|
36
|
+
__publicField(this, "_template", html(_a || (_a = __template(['\n<dt-popover>\n <slot slot="trigger" name="trigger"><button>select date and time</button></slot>\n <div slot="pop" class="wrapper menu">\n <dt-yyyymm-nav\n show-ctrl-btn-month-add\n show-ctrl-btn-month-sub\n ></dt-yyyymm-nav>\n <dt-calendar-base></dt-calendar-base>\n <dt-popover id="time-popover">\n <div slot="trigger" class="time-echo-wrapper">\n <i class="time-icon"></i>\n <span class="time-echo">hh:mm:ss.sss</span>\n </div>\n <div slot="pop" class="time-selector">\n <h3 class="title">Select Time</h3>\n <dt-hhmmss-ms-list-grp></dt-hhmmss-ms-list-grp>\n <button id="time-selector-done-btn">Done</button>\n </div>\n </dt-popover>\n </div>\n</dt-popover>\n']))));
|
|
37
|
+
__publicField(this, "_render", debounce(() => {
|
|
38
|
+
if (!this.isConnected) return;
|
|
39
|
+
const currentTime = this.currentTime;
|
|
40
|
+
this._calendar.weekStartAt = this.weekStartAt;
|
|
41
|
+
const tz = (/* @__PURE__ */ new Date()).getTimezoneOffset() * 60 * 1e3;
|
|
42
|
+
this._navEle.millisecond = this._calendar.timeStart = this._calendar.timeEnd = +currentTime;
|
|
43
|
+
this._calendar.showingTime = this.showingTime;
|
|
44
|
+
const selectorWrapper = this.shadowRoot.querySelector(".time-selector");
|
|
45
|
+
if (this.minGranularity === "day") {
|
|
46
|
+
this._timeSelector.millisecond = 0;
|
|
47
|
+
selectorWrapper.style.display = "none";
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
selectorWrapper.style.display = "";
|
|
51
|
+
this._timeSelector.minGranularity = this.minGranularity;
|
|
52
|
+
this._timeSelector.millisecond = (+currentTime - tz) % (24 * 60 * 60 * 1e3);
|
|
53
|
+
this.shadowRoot.querySelector(".wrapper .time-echo").textContent = this.timeFormatter(currentTime, this.minGranularity);
|
|
54
|
+
}, 0));
|
|
55
|
+
__publicField(this, "_onCalendarSelect", (e) => {
|
|
56
|
+
e.stopPropagation();
|
|
57
|
+
this.currentTime = +e.detail + this._timeSelector.millisecond;
|
|
58
|
+
});
|
|
59
|
+
__publicField(this, "_onNavChange", (e) => {
|
|
60
|
+
e.stopPropagation();
|
|
61
|
+
const wrapper = closestByEvent(e, ".wrapper");
|
|
62
|
+
if (!wrapper) return;
|
|
63
|
+
const { newTime } = e.detail;
|
|
64
|
+
this._calendar.showingTime = +newTime;
|
|
65
|
+
});
|
|
66
|
+
__publicField(this, "_onTimePopoverOpenChange", (e) => {
|
|
67
|
+
var _a2;
|
|
68
|
+
if (!(e.target instanceof PopoverEle)) return;
|
|
69
|
+
e.stopPropagation();
|
|
70
|
+
if (!e.detail) return this._render();
|
|
71
|
+
(_a2 = e.target.querySelector("dt-hhmmss-ms-list-grp")) == null ? void 0 : _a2.scrollToCurrentItem();
|
|
72
|
+
});
|
|
73
|
+
__publicField(this, "_onNavOpenToggle", (e) => {
|
|
74
|
+
var _a2;
|
|
75
|
+
if (!(e.target instanceof YyyyMmNavEle)) return;
|
|
76
|
+
e.stopPropagation();
|
|
77
|
+
(_a2 = e.target.nextElementSibling) == null ? void 0 : _a2.classList.toggle("hide", e.detail);
|
|
78
|
+
});
|
|
79
|
+
__publicField(this, "_onTimeSelectorDoneClick", (e) => {
|
|
80
|
+
const btn = closestByEvent(e, "#time-selector-done-btn");
|
|
81
|
+
if (!btn) return;
|
|
82
|
+
const calcTime = (time, ms) => {
|
|
83
|
+
time.setHours(0, 0, 0, 0);
|
|
84
|
+
time.setMilliseconds(ms);
|
|
85
|
+
return time;
|
|
86
|
+
};
|
|
87
|
+
this.currentTime = calcTime(
|
|
88
|
+
this.currentTime,
|
|
89
|
+
this._timeSelector.millisecond
|
|
90
|
+
);
|
|
91
|
+
this._timePopover.open = false;
|
|
92
|
+
});
|
|
93
|
+
__publicField(this, "timeFormatter", (time, minGranularity) => {
|
|
94
|
+
const t = new Date(+time - (/* @__PURE__ */ new Date()).getTimezoneOffset() * 60 * 1e3).toISOString().slice(11, 23);
|
|
95
|
+
if (minGranularity === "day") return "";
|
|
96
|
+
if (minGranularity === "hour") return t.slice(0, 2);
|
|
97
|
+
if (minGranularity === "minute") return t.slice(0, 5);
|
|
98
|
+
if (minGranularity === "second") return t.slice(0, 8);
|
|
99
|
+
return t;
|
|
100
|
+
});
|
|
101
|
+
this._applyTemplate();
|
|
102
|
+
}
|
|
103
|
+
static get observedAttributes() {
|
|
104
|
+
return [
|
|
105
|
+
...super.observedAttributes,
|
|
106
|
+
"week-start-at",
|
|
107
|
+
"current-time",
|
|
108
|
+
"showing-time",
|
|
109
|
+
"min-granularity"
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
get currentTime() {
|
|
113
|
+
const v = this._getAttr("current-time", "" + Date.now());
|
|
114
|
+
return new Date(Number.isNaN(+v) ? v : +v);
|
|
115
|
+
}
|
|
116
|
+
set currentTime(val) {
|
|
117
|
+
const v = new Date(val);
|
|
118
|
+
if (Number.isNaN(+v)) return;
|
|
119
|
+
this.setAttribute("current-time", +v + "");
|
|
120
|
+
}
|
|
121
|
+
get showingTime() {
|
|
122
|
+
const v = this._getAttr("showing-time", "" + this.currentTime);
|
|
123
|
+
return new Date(Number.isNaN(+v) ? v : +v);
|
|
124
|
+
}
|
|
125
|
+
set showingTime(val) {
|
|
126
|
+
const v = new Date(val);
|
|
127
|
+
if (Number.isNaN(+v)) return;
|
|
128
|
+
this.setAttribute("showing-time", +v + "");
|
|
129
|
+
}
|
|
130
|
+
get weekStartAt() {
|
|
131
|
+
return this._getAttr("week-start-at", "sun");
|
|
132
|
+
}
|
|
133
|
+
set weekStartAt(val) {
|
|
134
|
+
if (!weekKey.includes(val)) return;
|
|
135
|
+
this.setAttribute("week-start-at", val);
|
|
136
|
+
}
|
|
137
|
+
get minGranularity() {
|
|
138
|
+
return this._getAttr("min-granularity", "millisecond");
|
|
139
|
+
}
|
|
140
|
+
set minGranularity(val) {
|
|
141
|
+
if (!granularityList.includes(val)) return;
|
|
142
|
+
this.setAttribute("min-granularity", val);
|
|
143
|
+
}
|
|
144
|
+
get _navEle() {
|
|
145
|
+
var _a2;
|
|
146
|
+
return (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("dt-yyyymm-nav");
|
|
147
|
+
}
|
|
148
|
+
get _calendar() {
|
|
149
|
+
var _a2;
|
|
150
|
+
return (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(
|
|
151
|
+
"dt-calendar-base"
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
get _timeSelector() {
|
|
155
|
+
var _a2;
|
|
156
|
+
return (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(
|
|
157
|
+
"dt-hhmmss-ms-list-grp"
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
get _timePopover() {
|
|
161
|
+
var _a2;
|
|
162
|
+
return (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("#time-popover");
|
|
163
|
+
}
|
|
164
|
+
connectedCallback() {
|
|
165
|
+
var _a2;
|
|
166
|
+
if (!super.connectedCallback()) return;
|
|
167
|
+
this._calendar.formatter = (i) => String(i).padStart(2, "0");
|
|
168
|
+
this._render();
|
|
169
|
+
this._calendar.addEventListener("select-time", this._onCalendarSelect);
|
|
170
|
+
this._navEle.addEventListener("change", this._onNavChange);
|
|
171
|
+
this._timePopover.addEventListener(
|
|
172
|
+
"open-change",
|
|
173
|
+
this._onTimePopoverOpenChange
|
|
174
|
+
);
|
|
175
|
+
this._navEle.addEventListener(
|
|
176
|
+
"popover-open-change",
|
|
177
|
+
this._onNavOpenToggle
|
|
178
|
+
);
|
|
179
|
+
(_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelectorAll("#time-selector-done-btn").forEach((btn) => {
|
|
180
|
+
btn.addEventListener("click", this._onTimeSelectorDoneClick);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
disconnectedCallback() {
|
|
184
|
+
var _a2;
|
|
185
|
+
if (!super.disconnectedCallback()) return;
|
|
186
|
+
this._calendar.removeEventListener(
|
|
187
|
+
"select-time",
|
|
188
|
+
this._onCalendarSelect
|
|
189
|
+
);
|
|
190
|
+
this._navEle.removeEventListener("change", this._onNavChange);
|
|
191
|
+
this._timePopover.removeEventListener(
|
|
192
|
+
"open-change",
|
|
193
|
+
this._onTimePopoverOpenChange
|
|
194
|
+
);
|
|
195
|
+
this._navEle.removeEventListener(
|
|
196
|
+
"popover-open-change",
|
|
197
|
+
this._onNavOpenToggle
|
|
198
|
+
);
|
|
199
|
+
(_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelectorAll("#time-selector-done-btn").forEach((btn) => {
|
|
200
|
+
btn.removeEventListener("click", this._onTimeSelectorDoneClick);
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
_onAttrChanged(name, oldValue, newValue) {
|
|
204
|
+
super._onAttrChanged(name, oldValue, newValue);
|
|
205
|
+
this._render();
|
|
206
|
+
if (name === "current-time") {
|
|
207
|
+
this.dispatchEvent("select-time", this.currentTime);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
__publicField(Ele, "tagName", "dt-date-time-selector");
|
|
212
|
+
Ele.define();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styleStr: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var __freeze = Object.freeze;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
|
|
4
|
+
var _a;
|
|
5
|
+
import { css } from "../../utils.mjs";
|
|
6
|
+
export const styleStr = css(_a || (_a = __template(["\n.wrapper {\n display: flex;\n flex-direction: column;\n gap: 15px;\n}\ndt-popover {\n position: relative;\n}\n\n[open] > .time-echo-wrapper {\n border-color: #18181B;\n}\n\n.time-echo-wrapper {\n width: 100%;\n padding: 4px;\n display: flex;\n gap: 5px;\n border-radius: 4px;\n min-height: 30px;\n border: 1px solid #0001;\n box-sizing: border-box;\n align-items: center;\n cursor: pointer;\n}\n\n.time-selector {\n position: absolute;\n width: 100%;\n height: 461px;\n box-sizing: border-box;\n background-color: #fff;\n\n display: flex;\n flex-direction: column;\n gap: 15px;\n padding: 15px;\n border-radius: 6px;\n border: 1px solid #eee;\n box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);\n\n .title {\n font-size: 16px;\n margin: 0;\n line-height: 1;\n }\n}\n\ndt-hhmmss-ms-list-grp::part(list-container) {\n gap: 2px;\n}\ndt-hhmmss-ms-list-grp::part(list) {\n scroll-behavior: smooth;\n}\ndt-hhmmss-ms-list-grp::part(item) {\n font-size: 14px;\n line-height: 17px;\n}\n\n#time-selector-done-btn {\n border: none;\n min-height: 30px;\n border-radius: 6px;\n padding: 5px 10px;\n font-size: 14px;\n background-color: #18181B;\n color: #fff;\n}\n\n.time-icon {\n display: inline-block;\n width: 20px;\n height: 20px;\n background: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='15' fill='currentColor'%3E%3Cpath d='M7.4335 4.241a.4376.4376 0 0 0-.871.0594v3.783l.0044.0622a.4375.4375 0 0 0 .1921.3029L8.9242 9.877l.0566.0317a.4376.4376 0 0 0 .5495-.1559l.0317-.0566a.4376.4376 0 0 0-.1559-.5495L7.4375 7.8471V4.3004l-.004-.0593ZM7 1.6667c-3.2217 0-5.8333 2.6116-5.8333 5.8333 0 3.2217 2.6116 5.8333 5.8333 5.8333 3.2217 0 5.8333-2.6116 5.8333-5.8333 0-3.2217-2.6116-5.8333-5.8333-5.8333Zm0 .814c2.7721 0 5.0194 2.2472 5.0194 5.0193 0 2.7721-2.2473 5.0194-5.0194 5.0194S1.9806 10.2721 1.9806 7.5 4.228 2.4806 7 2.4806Z'/%3E%3C/svg%3E\") 50%/20px 20px no-repeat;\n}\n\n.time-echo {\n font-size: 14px;\n color: #999;\n line-height: 1;\n}\n\n.menu {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 5px;\n font-size: 14px;\n gap: 10px;\n border-radius: 6px;\n border: 1px solid #eee;\n box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);\n background-color: #fff;\n width: 285px;\n\n & > * {\n width: 100%;\n box-sizing: border-box;\n }\n}\n\ndt-calendar-base {\n // 254 = item height 6 * 30 + week 14 + gap 10 * 6\n height: 254px;\n\n &::part(week) {\n font-size: 12px;\n line-height: 14px;\n }\n\n &::part(item) {\n font-size: 14px;\n }\n}\ndt-yyyymm-nav::part(list-grp) {\n height: 254px;\n margin-top: 10px;\n}\ndt-calendar-base.hide {\n display: none;\n}\n"])));
|
|
@@ -29,9 +29,9 @@ export declare class Ele extends UiBase<Attrs, Emits> {
|
|
|
29
29
|
protected _style: string;
|
|
30
30
|
protected _template: string;
|
|
31
31
|
constructor();
|
|
32
|
-
private get
|
|
33
|
-
private get
|
|
34
|
-
private get
|
|
32
|
+
private get _listEleHour();
|
|
33
|
+
private get _listEleMinute();
|
|
34
|
+
private get _listEleSecond();
|
|
35
35
|
private get _msInputEle();
|
|
36
36
|
get millisecond(): number;
|
|
37
37
|
set millisecond(v: number);
|
|
@@ -15,14 +15,14 @@ export class Ele extends UiBase {
|
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
__publicField(this, "_style", styleStr);
|
|
18
|
-
__publicField(this, "_template", html(_b || (_b = __template(['\n <div class="cols" part="cols">\n <div class="col" part="col hour">\n <span>Hour</span>\n <dt-num-list\n exportparts="container:list-container, item, item-current"\n part="list hour"\n class="hour"\n min-num="0"\n max-num="23"\n ></dt-num-list>\n </div>\n <div class="col" part="col minute">\n <span>Minute</span>\n <dt-num-list\n exportparts="container:list-container, item, item-current"\n part="list minute"\n class="minute"\n min-num="0"\n max-num="59"\n ></dt-num-list>\n </div>\n <div class="col" part="col second">\n <span>Second</span>\n <dt-num-list\n exportparts="container:list-container, item, item-current"\n part="list second"\n class="second"\n min-num="0"\n max-num="59"\n ></dt-num-list>\n </div>\n </div>\n <label class="ms-input" part="ms-wrapper">\n <span part="ms-label">Millisecond</span>\n <input part="ms-input" id="ms" type="number" class="millisecond" min="0" max="999" step="1" placeholder="000" />\n </label>\n ']))));
|
|
18
|
+
__publicField(this, "_template", html(_b || (_b = __template(['\n <div class="cols" part="cols">\n <div class="col hour" part="col hour">\n <span>Hour</span>\n <dt-num-list\n exportparts="container:list-container, item, item-current"\n part="list hour"\n class="hour"\n min-num="0"\n max-num="23"\n ></dt-num-list>\n </div>\n <div class="col minute" part="col minute">\n <span>Minute</span>\n <dt-num-list\n exportparts="container:list-container, item, item-current"\n part="list minute"\n class="minute"\n min-num="0"\n max-num="59"\n ></dt-num-list>\n </div>\n <div class="col second" part="col second">\n <span>Second</span>\n <dt-num-list\n exportparts="container:list-container, item, item-current"\n part="list second"\n class="second"\n min-num="0"\n max-num="59"\n ></dt-num-list>\n </div>\n </div>\n <label class="ms-input" part="ms-wrapper">\n <span part="ms-label">Millisecond</span>\n <input part="ms-input" id="ms" type="number" class="millisecond" min="0" max="999" step="1" placeholder="000" />\n </label>\n ']))));
|
|
19
19
|
__publicField(this, "_renderCols", debounce(() => {
|
|
20
20
|
if (!this.isConnected) return;
|
|
21
21
|
const {
|
|
22
22
|
colOrder,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
_listEleHour: hEle,
|
|
24
|
+
_listEleMinute: mEle,
|
|
25
|
+
_listEleSecond: sEle
|
|
26
26
|
} = this;
|
|
27
27
|
const orderedCols = [];
|
|
28
28
|
for (const c of colOrder) {
|
|
@@ -39,13 +39,13 @@ export class Ele extends UiBase {
|
|
|
39
39
|
__publicField(this, "_updateGranularity", debounce(() => {
|
|
40
40
|
var _a2, _b2;
|
|
41
41
|
if (!this.isConnected) return;
|
|
42
|
-
const {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
const { maxGranularity, minGranularity } = this;
|
|
43
|
+
const hEle = this.shadowRoot.querySelector(".col.hour");
|
|
44
|
+
const mEle = this.shadowRoot.querySelector(".col.minute");
|
|
45
|
+
const sEle = this.shadowRoot.querySelector(".col.second");
|
|
46
|
+
const msEle = this.shadowRoot.querySelector(
|
|
47
|
+
'[part="ms-wrapper"]'
|
|
48
|
+
);
|
|
49
49
|
const colsContainer = this.shadowRoot.querySelector(".cols");
|
|
50
50
|
const granularityMap = {
|
|
51
51
|
hour: 3,
|
|
@@ -62,16 +62,14 @@ export class Ele extends UiBase {
|
|
|
62
62
|
colsContainer.style.display = [hEle, mEle, sEle].filter(
|
|
63
63
|
(ele) => ele.style.display !== "none"
|
|
64
64
|
).length ? "" : "none";
|
|
65
|
-
|
|
66
|
-
'[part="ms-wrapper"]'
|
|
67
|
-
).style.display = maxG >= 0 && minG <= 0 ? "" : "none";
|
|
65
|
+
msEle.style.display = maxG >= 0 && minG <= 0 ? "" : "none";
|
|
68
66
|
}, 0));
|
|
69
67
|
__publicField(this, "_updateColsValue", debounce(() => {
|
|
70
68
|
if (!this.isConnected) return;
|
|
71
69
|
const {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
_listEleHour: hEle,
|
|
71
|
+
_listEleMinute: mEle,
|
|
72
|
+
_listEleSecond: sEle,
|
|
75
73
|
millisecond
|
|
76
74
|
} = this;
|
|
77
75
|
const hour = Math.floor(millisecond / (60 * 60 * 1e3));
|
|
@@ -132,17 +130,21 @@ export class Ele extends UiBase {
|
|
|
132
130
|
"col-order"
|
|
133
131
|
];
|
|
134
132
|
}
|
|
135
|
-
get
|
|
133
|
+
get _listEleHour() {
|
|
136
134
|
var _a2;
|
|
137
|
-
return (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(".
|
|
135
|
+
return (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("dt-num-list.hour");
|
|
138
136
|
}
|
|
139
|
-
get
|
|
137
|
+
get _listEleMinute() {
|
|
140
138
|
var _a2;
|
|
141
|
-
return (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(
|
|
139
|
+
return (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(
|
|
140
|
+
"dt-num-list.minute"
|
|
141
|
+
);
|
|
142
142
|
}
|
|
143
|
-
get
|
|
143
|
+
get _listEleSecond() {
|
|
144
144
|
var _a2;
|
|
145
|
-
return (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(
|
|
145
|
+
return (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(
|
|
146
|
+
"dt-num-list.second"
|
|
147
|
+
);
|
|
146
148
|
}
|
|
147
149
|
get _msInputEle() {
|
|
148
150
|
var _a2;
|
|
@@ -185,23 +187,23 @@ export class Ele extends UiBase {
|
|
|
185
187
|
}
|
|
186
188
|
connectedCallback() {
|
|
187
189
|
if (!super.connectedCallback()) return;
|
|
188
|
-
this.
|
|
190
|
+
this._listEleHour.formatter = this._listEleMinute.formatter = this._listEleSecond.formatter = (num) => ("0" + num).slice(-2);
|
|
189
191
|
this._renderCols();
|
|
190
192
|
this._updateGranularity();
|
|
191
193
|
this._updateColsValue();
|
|
192
|
-
this.
|
|
193
|
-
this.
|
|
194
|
-
this.
|
|
194
|
+
this._listEleHour.addEventListener("select-num", this._onColsSelect);
|
|
195
|
+
this._listEleMinute.addEventListener("select-num", this._onColsSelect);
|
|
196
|
+
this._listEleSecond.addEventListener("select-num", this._onColsSelect);
|
|
195
197
|
this._msInputEle.addEventListener("input", this._onMsInput);
|
|
196
198
|
}
|
|
197
199
|
disconnectedCallback() {
|
|
198
200
|
if (!super.disconnectedCallback()) return;
|
|
199
|
-
this.
|
|
200
|
-
this.
|
|
201
|
+
this._listEleHour.removeEventListener("select-num", this._onColsSelect);
|
|
202
|
+
this._listEleMinute.removeEventListener(
|
|
201
203
|
"select-num",
|
|
202
204
|
this._onColsSelect
|
|
203
205
|
);
|
|
204
|
-
this.
|
|
206
|
+
this._listEleSecond.removeEventListener(
|
|
205
207
|
"select-num",
|
|
206
208
|
this._onColsSelect
|
|
207
209
|
);
|
|
@@ -215,9 +217,9 @@ export class Ele extends UiBase {
|
|
|
215
217
|
else if (name === "millisecond") this._updateColsValue();
|
|
216
218
|
}
|
|
217
219
|
_getMsFromEle() {
|
|
218
|
-
const hour = this.
|
|
219
|
-
const minute = this.
|
|
220
|
-
const second = this.
|
|
220
|
+
const hour = this._listEleHour.currentNum;
|
|
221
|
+
const minute = this._listEleMinute.currentNum;
|
|
222
|
+
const second = this._listEleSecond.currentNum;
|
|
221
223
|
const ms = Math.min(Math.max(0, +this._msInputEle.value || 0), 999);
|
|
222
224
|
return ((hour * 60 + minute) * 60 + second) * 1e3 + ms;
|
|
223
225
|
}
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
background-color: #eee;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
dt-
|
|
47
|
+
dt-yyyymm-nav::part(list-grp) {
|
|
48
48
|
height: 254px;
|
|
49
49
|
margin-top: 15px;
|
|
50
50
|
}
|
|
@@ -84,6 +84,7 @@ dt-popover {
|
|
|
84
84
|
border: 1px solid rgba(0, 0, 0, 0.0666666667);
|
|
85
85
|
box-sizing: border-box;
|
|
86
86
|
align-items: center;
|
|
87
|
+
cursor: pointer;
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
.time-selector {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type BaseAttrs, UiBase } from '../web-component-base';
|
|
2
|
+
import { type Weeks } from '../calendar';
|
|
2
3
|
export interface Attrs extends BaseAttrs {
|
|
3
4
|
/**
|
|
4
5
|
* The start time of the calendar display range.
|
|
@@ -17,6 +18,12 @@ export interface Attrs extends BaseAttrs {
|
|
|
17
18
|
* 例如设置为 'minute',则表示只能选择到分钟,秒和毫秒将被忽略。
|
|
18
19
|
*/
|
|
19
20
|
'min-granularity'?: 'day' | 'hour' | 'minute' | 'second' | 'millisecond';
|
|
21
|
+
/**
|
|
22
|
+
* Set which day of the week is the first day.
|
|
23
|
+
* @type `'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'`
|
|
24
|
+
* @default 'sun'
|
|
25
|
+
*/
|
|
26
|
+
'week-start-at'?: Weeks;
|
|
20
27
|
}
|
|
21
28
|
export interface Emits {
|
|
22
29
|
change: {
|
|
@@ -38,6 +45,8 @@ export declare class Ele extends UiBase<Attrs, Emits> {
|
|
|
38
45
|
set timeStart(val: number | string | Date);
|
|
39
46
|
get timeEnd(): number | string | Date;
|
|
40
47
|
set timeEnd(val: number | string | Date);
|
|
48
|
+
get weekStartAt(): Weeks;
|
|
49
|
+
set weekStartAt(val: Weeks);
|
|
41
50
|
protected _style: string;
|
|
42
51
|
protected _template: string;
|
|
43
52
|
constructor();
|
|
@@ -6,11 +6,14 @@ var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __f
|
|
|
6
6
|
var _a, _b, _c;
|
|
7
7
|
import { closestByEvent, css, debounce, html } from "../../utils.mjs";
|
|
8
8
|
import { UiBase } from "../web-component-base/index.mjs";
|
|
9
|
-
const styleStr = css(_a || (_a = __template(["\n:host {\n display: flex;\n flex-direction: column;\n gap: 15px;\n}\n\n.date-echo {\n display: flex;\n gap: 5px;\n align-items: center;\n}\n\n.start-date-echo-wrapper,\n.end-date-echo-wrapper {\n width: 100%;\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 2px;\n border-radius: 6px;\n border: 1px solid rgba(0, 0, 0, 0.1490196078);\n padding: 4px;\n}\n.start-date-echo-wrapper.active,\n.end-date-echo-wrapper.active {\n border-color: #333;\n}\n\n.date-echo .label {\n font-size: 14px;\n line-height: 1;\n}\n\n.start-date-echo, .end-date-echo {\n font-size: 16px;\n line-height: 1;\n font-weight: bold;\n}\n\n.dividing-line {\n display: block;\n height: 1px;\n width: 20px;\n background-color: #eee;\n}\n\ndt-
|
|
10
|
-
import { Ele as DateNavEle } from "./date-nav.mjs";
|
|
11
|
-
DateNavEle.define();
|
|
9
|
+
const styleStr = css(_a || (_a = __template(["\n:host {\n display: flex;\n flex-direction: column;\n gap: 15px;\n}\n\n.date-echo {\n display: flex;\n gap: 5px;\n align-items: center;\n}\n\n.start-date-echo-wrapper,\n.end-date-echo-wrapper {\n width: 100%;\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 2px;\n border-radius: 6px;\n border: 1px solid rgba(0, 0, 0, 0.1490196078);\n padding: 4px;\n}\n.start-date-echo-wrapper.active,\n.end-date-echo-wrapper.active {\n border-color: #333;\n}\n\n.date-echo .label {\n font-size: 14px;\n line-height: 1;\n}\n\n.start-date-echo, .end-date-echo {\n font-size: 16px;\n line-height: 1;\n font-weight: bold;\n}\n\n.dividing-line {\n display: block;\n height: 1px;\n width: 20px;\n background-color: #eee;\n}\n\ndt-yyyymm-nav::part(list-grp) {\n height: 254px;\n margin-top: 15px;\n}\n\ndt-calendar-base.hide {\n display: none;\n}\n\n.calendars {\n display: flex;\n gap: 20px;\n}\n\n.wrapper {\n flex: 1;\n height: 100%;\n display: flex;\n flex-direction: column;\n gap: 15px;\n}\n\ndt-popover {\n position: relative;\n}\n\n[open] .time-echo-wrapper {\n border-color: #18181B;\n}\n\n.time-echo-wrapper {\n width: 100%;\n padding: 4px;\n display: flex;\n gap: 5px;\n border-radius: 4px;\n min-height: 30px;\n border: 1px solid rgba(0, 0, 0, 0.0666666667);\n box-sizing: border-box;\n align-items: center;\n cursor: pointer;\n}\n\n.time-selector {\n position: absolute;\n width: 100%;\n height: 461px;\n box-sizing: border-box;\n background-color: #fff;\n display: flex;\n flex-direction: column;\n gap: 15px;\n padding: 15px;\n border-radius: 6px;\n border: 1px solid #eee;\n box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);\n}\n.time-selector .title {\n font-size: 16px;\n margin: 0;\n line-height: 1;\n}\n\ndt-hhmmss-ms-list-grp::part(list-container) {\n gap: 2px;\n}\ndt-hhmmss-ms-list-grp::part(list) {\n scroll-behavior: smooth;\n}\ndt-hhmmss-ms-list-grp::part(item) {\n font-size: 14px;\n line-height: 17px;\n}\n\n#time-selector-done-btn {\n border: none;\n min-height: 30px;\n border-radius: 6px;\n padding: 5px 10px;\n font-size: 14px;\n background-color: #18181B;\n color: #fff;\n}\n\n.time-icon {\n display: inline-block;\n width: 20px;\n height: 20px;\n background: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='15' fill='currentColor'%3E%3Cpath d='M7.4335 4.241a.4376.4376 0 0 0-.871.0594v3.783l.0044.0622a.4375.4375 0 0 0 .1921.3029L8.9242 9.877l.0566.0317a.4376.4376 0 0 0 .5495-.1559l.0317-.0566a.4376.4376 0 0 0-.1559-.5495L7.4375 7.8471V4.3004l-.004-.0593ZM7 1.6667c-3.2217 0-5.8333 2.6116-5.8333 5.8333 0 3.2217 2.6116 5.8333 5.8333 5.8333 3.2217 0 5.8333-2.6116 5.8333-5.8333 0-3.2217-2.6116-5.8333-5.8333-5.8333Zm0 .814c2.7721 0 5.0194 2.2472 5.0194 5.0193 0 2.7721-2.2473 5.0194-5.0194 5.0194S1.9806 10.2721 1.9806 7.5 4.228 2.4806 7 2.4806Z'/%3E%3C/svg%3E\") 50%/20px 20px no-repeat;\n}\n\n.time-echo {\n font-size: 14px;\n color: #999;\n line-height: 1;\n}\n\ndt-calendar-base {\n height: 254px;\n}\ndt-calendar-base::part(week) {\n font-size: 12px;\n line-height: 14px;\n}\ndt-calendar-base::part(item) {\n font-size: 14px;\n}\n"])));
|
|
12
10
|
import {
|
|
13
|
-
Ele as
|
|
11
|
+
Ele as YyyyMmNavEle
|
|
12
|
+
} from "../yyyymm-nav/index.mjs";
|
|
13
|
+
YyyyMmNavEle.define();
|
|
14
|
+
import {
|
|
15
|
+
Ele as CalendarBaseEle,
|
|
16
|
+
weekKey
|
|
14
17
|
} from "../calendar/index.mjs";
|
|
15
18
|
CalendarBaseEle.define();
|
|
16
19
|
import { Ele as HhMmSsMsListGrpEle } from "../hhmmss-ms-list-grp/index.mjs";
|
|
@@ -30,7 +33,7 @@ export class Ele extends UiBase {
|
|
|
30
33
|
super();
|
|
31
34
|
__publicField(this, "_style", styleStr);
|
|
32
35
|
__publicField(this, "_template", html(_c || (_c = __template(['\n<div class="date-echo">\n <div class="start-date-echo-wrapper active">\n <span class="label">Start Date</span>\n <span class="start-date-echo">dd/mm/yyyy</span>\n </div>\n <i class="dividing-line"></i>\n <div class="end-date-echo-wrapper">\n <span class="label">End Date</span>\n <span class="end-date-echo">dd/mm/yyyy</span>\n </div>\n</div><div class="calendars">', "</div>"])), ["start", "end"].map(
|
|
33
|
-
(s) => html(_b || (_b = __template(['\n<div class="wrapper ', '">\n <dt-
|
|
36
|
+
(s) => html(_b || (_b = __template(['\n<div class="wrapper ', '">\n <dt-yyyymm-nav\n show-ctrl-btn-month-add\n show-ctrl-btn-month-sub\n ></dt-yyyymm-nav>\n <dt-calendar-base data-type="', '"></dt-calendar-base>\n <dt-popover>\n <div slot="trigger" class="time-echo-wrapper">\n <i class="time-icon"></i>\n <span class="time-echo">hh:mm:ss.sss</span>\n </div>\n <div slot="pop" class="time-selector">\n <h3 class="title">', '</h3>\n <dt-hhmmss-ms-list-grp></dt-hhmmss-ms-list-grp>\n <button id="time-selector-done-btn" data-type="', '">Done</button>\n </div>\n </dt-popover>\n</div>'])), s, s, s === "start" ? "Start Time" : "End Time", s)
|
|
34
37
|
).join("")));
|
|
35
38
|
// 存放的是结束时间点
|
|
36
39
|
__publicField(this, "_selectedDate", null);
|
|
@@ -39,6 +42,7 @@ export class Ele extends UiBase {
|
|
|
39
42
|
let timeStart = this.timeStart;
|
|
40
43
|
let timeEnd = this.timeEnd;
|
|
41
44
|
if (timeStart > timeEnd) [timeStart, timeEnd] = [timeEnd, timeStart];
|
|
45
|
+
this._startCalendar.weekStartAt = this._endCalendar.weekStartAt = this.weekStartAt;
|
|
42
46
|
const tz = (/* @__PURE__ */ new Date()).getTimezoneOffset() * 60 * 1e3;
|
|
43
47
|
this._startNavEle.millisecond = this._startCalendar.showingTime = this._startCalendar.timeStart = this._endCalendar.timeStart = +timeStart;
|
|
44
48
|
this._startTimeSelector.millisecond = (+timeStart - tz) % (24 * 60 * 60 * 1e3);
|
|
@@ -63,6 +67,7 @@ export class Ele extends UiBase {
|
|
|
63
67
|
this._updateNavCtrlBtn();
|
|
64
68
|
}, 0));
|
|
65
69
|
__publicField(this, "_onCalendarSelect", (e) => {
|
|
70
|
+
e.stopPropagation();
|
|
66
71
|
if (this._selectedDate) {
|
|
67
72
|
this._selectedDate = null;
|
|
68
73
|
this.timeEnd = +e.detail + this._endTimeSelector.millisecond;
|
|
@@ -72,27 +77,31 @@ export class Ele extends UiBase {
|
|
|
72
77
|
}
|
|
73
78
|
});
|
|
74
79
|
__publicField(this, "_onCalendarItemHover", (e) => {
|
|
80
|
+
e.stopPropagation();
|
|
75
81
|
if (!this._selectedDate) return;
|
|
76
82
|
this.timeEnd = +e.detail + this._endTimeSelector.millisecond;
|
|
77
83
|
});
|
|
78
84
|
__publicField(this, "_onNavChange", (e) => {
|
|
85
|
+
e.stopPropagation();
|
|
79
86
|
const wrapper = closestByEvent(e, ".wrapper");
|
|
80
87
|
if (!wrapper) return;
|
|
81
|
-
const {
|
|
88
|
+
const { newTime } = e.detail;
|
|
82
89
|
if (wrapper.classList.contains("start")) {
|
|
83
|
-
this._startCalendar.showingTime = +
|
|
90
|
+
this._startCalendar.showingTime = +newTime;
|
|
84
91
|
} else {
|
|
85
|
-
this._endCalendar.showingTime = +
|
|
92
|
+
this._endCalendar.showingTime = +newTime;
|
|
86
93
|
}
|
|
87
94
|
this._updateNavCtrlBtn();
|
|
88
95
|
});
|
|
89
96
|
__publicField(this, "_onNavOpenToggle", (e) => {
|
|
90
97
|
var _a2;
|
|
91
|
-
if (!(e.target instanceof
|
|
98
|
+
if (!(e.target instanceof YyyyMmNavEle)) return;
|
|
99
|
+
e.stopPropagation();
|
|
92
100
|
(_a2 = e.target.nextElementSibling) == null ? void 0 : _a2.classList.toggle("hide", e.detail);
|
|
93
101
|
});
|
|
94
102
|
__publicField(this, "_onTimePopoverOpenChange", (e) => {
|
|
95
103
|
if (!(e.target instanceof PopoverEle)) return;
|
|
104
|
+
e.stopPropagation();
|
|
96
105
|
if (!e.detail) return this._render();
|
|
97
106
|
e.target.querySelectorAll("dt-hhmmss-ms-list-grp").forEach((ele) => {
|
|
98
107
|
ele.scrollToCurrentItem();
|
|
@@ -130,7 +139,8 @@ export class Ele extends UiBase {
|
|
|
130
139
|
...super.observedAttributes,
|
|
131
140
|
"time-start",
|
|
132
141
|
"time-end",
|
|
133
|
-
"min-granularity"
|
|
142
|
+
"min-granularity",
|
|
143
|
+
"week-start-at"
|
|
134
144
|
];
|
|
135
145
|
}
|
|
136
146
|
get timeStart() {
|
|
@@ -151,15 +161,24 @@ export class Ele extends UiBase {
|
|
|
151
161
|
if (Number.isNaN(+v)) return;
|
|
152
162
|
this.setAttribute("time-end", +v + "");
|
|
153
163
|
}
|
|
164
|
+
get weekStartAt() {
|
|
165
|
+
return this._getAttr("week-start-at", "sun");
|
|
166
|
+
}
|
|
167
|
+
set weekStartAt(val) {
|
|
168
|
+
if (!weekKey.includes(val)) return;
|
|
169
|
+
this.setAttribute("week-start-at", val);
|
|
170
|
+
}
|
|
154
171
|
get _startNavEle() {
|
|
155
172
|
var _a2;
|
|
156
173
|
return (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(
|
|
157
|
-
".start dt-
|
|
174
|
+
".start dt-yyyymm-nav"
|
|
158
175
|
);
|
|
159
176
|
}
|
|
160
177
|
get _endNavEle() {
|
|
161
178
|
var _a2;
|
|
162
|
-
return (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(
|
|
179
|
+
return (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(
|
|
180
|
+
".end dt-yyyymm-nav"
|
|
181
|
+
);
|
|
163
182
|
}
|
|
164
183
|
get _startCalendar() {
|
|
165
184
|
var _a2;
|