This commit is contained in:
2025-09-19 14:25:20 +08:00
parent 269893a435
commit fbf3f77229
24949 changed files with 2839404 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
import TimeSelect from './src/time-select.vue';
import type { SFCWithInstall } from 'element-plus/es/utils';
export declare const ElTimeSelect: SFCWithInstall<typeof TimeSelect>;
export default ElTimeSelect;
export * from './src/time-select';

View File

@@ -0,0 +1,14 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var timeSelect$1 = require('./src/time-select2.js');
var timeSelect = require('./src/time-select.js');
var install = require('../../utils/vue/install.js');
const ElTimeSelect = install.withInstall(timeSelect$1["default"]);
exports.timeSelectProps = timeSelect.timeSelectProps;
exports.ElTimeSelect = ElTimeSelect;
exports["default"] = ElTimeSelect;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../../../../packages/components/time-select/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\nimport TimeSelect from './src/time-select.vue'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElTimeSelect: SFCWithInstall<typeof TimeSelect> =\n withInstall(TimeSelect)\nexport default ElTimeSelect\n\nexport * from './src/time-select'\n"],"names":["withInstall","TimeSelect"],"mappings":";;;;;;;;AAEY,MAAC,YAAY,GAAGA,mBAAW,CAACC,uBAAU;;;;;;"}

View File

@@ -0,0 +1,47 @@
import type { PopperEffect } from 'element-plus/es/components/popper';
import type TimeSelect from './time-select.vue';
import type { Component, ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
export declare const timeSelectProps: {
readonly emptyValues: ArrayConstructor;
readonly valueOnClear: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | ((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null))[], unknown, unknown, undefined, boolean>;
readonly format: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "HH:mm", boolean>;
readonly modelValue: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string) | (() => string | null) | ((new (...args: any[]) => string) | (() => string | null))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly disabled: BooleanConstructor;
readonly editable: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
readonly effect: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string) | (() => PopperEffect) | ((new (...args: any[]) => string) | (() => PopperEffect))[], unknown, unknown, "light", boolean>;
readonly clearable: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly placeholder: StringConstructor;
readonly start: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "09:00", boolean>;
readonly end: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "18:00", boolean>;
readonly step: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "00:30", boolean>;
readonly minTime: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string) | (() => string | null) | ((new (...args: any[]) => string) | (() => string | null))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly maxTime: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string) | (() => string | null) | ((new (...args: any[]) => string) | (() => string | null))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly includeEndTime: BooleanConstructor;
readonly name: StringConstructor;
readonly prefixIcon: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component))[], unknown, unknown, () => any, boolean>;
readonly clearIcon: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component))[], unknown, unknown, () => any, boolean>;
};
export type TimeSelectProps = ExtractPropTypes<typeof timeSelectProps>;
export type TimeSelectPropsPublic = __ExtractPublicPropTypes<typeof timeSelectProps>;
export type TimeSelectInstance = InstanceType<typeof TimeSelect> & unknown;

View File

@@ -0,0 +1,65 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var iconsVue = require('@element-plus/icons-vue');
var runtime = require('../../../utils/vue/props/runtime.js');
var index = require('../../../hooks/use-size/index.js');
var index$1 = require('../../../hooks/use-empty-values/index.js');
const timeSelectProps = runtime.buildProps({
format: {
type: String,
default: "HH:mm"
},
modelValue: {
type: runtime.definePropType(String)
},
disabled: Boolean,
editable: {
type: Boolean,
default: true
},
effect: {
type: runtime.definePropType(String),
default: "light"
},
clearable: {
type: Boolean,
default: true
},
size: index.useSizeProp,
placeholder: String,
start: {
type: String,
default: "09:00"
},
end: {
type: String,
default: "18:00"
},
step: {
type: String,
default: "00:30"
},
minTime: {
type: runtime.definePropType(String)
},
maxTime: {
type: runtime.definePropType(String)
},
includeEndTime: Boolean,
name: String,
prefixIcon: {
type: runtime.definePropType([String, Object]),
default: () => iconsVue.Clock
},
clearIcon: {
type: runtime.definePropType([String, Object]),
default: () => iconsVue.CircleClose
},
...index$1.useEmptyValuesProps
});
exports.timeSelectProps = timeSelectProps;
//# sourceMappingURL=time-select.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"time-select.js","sources":["../../../../../../packages/components/time-select/src/time-select.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport { CircleClose, Clock } from '@element-plus/icons-vue'\nimport { useEmptyValuesProps, useSizeProp } from '@element-plus/hooks'\n\nimport type { PopperEffect } from '@element-plus/components/popper'\nimport type TimeSelect from './time-select.vue'\nimport type { Component, ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\n\nexport const timeSelectProps = buildProps({\n /**\n * @description set format of time\n */\n format: {\n type: String,\n default: 'HH:mm',\n },\n /**\n * @description binding value\n */\n modelValue: {\n type: definePropType<string | null>(String),\n },\n /**\n * @description whether TimeSelect is disabled\n */\n disabled: Boolean,\n /**\n * @description whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n /**\n * @description Tooltip theme, built-in theme: `dark` / `light`\n */\n effect: {\n type: definePropType<PopperEffect>(String),\n default: 'light',\n },\n /**\n * @description whether to show clear button\n */\n clearable: {\n type: Boolean,\n default: true,\n },\n /**\n * @description size of Input\n */\n size: useSizeProp,\n /**\n * @description placeholder in non-range mode\n */\n placeholder: String,\n /**\n * @description start time\n */\n start: {\n type: String,\n default: '09:00',\n },\n /**\n * @description end time\n */\n end: {\n type: String,\n default: '18:00',\n },\n /**\n * @description time step\n */\n step: {\n type: String,\n default: '00:30',\n },\n /**\n * @description minimum time, any time before this time will be disabled\n */\n minTime: {\n type: definePropType<string | null>(String),\n },\n /**\n * @description maximum time, any time after this time will be disabled\n */\n maxTime: {\n type: definePropType<string | null>(String),\n },\n /**\n * @description whether `end` is included in options\n */\n includeEndTime: Boolean,\n /**\n * @description same as `name` in native input\n */\n name: String,\n /**\n * @description custom prefix icon component\n */\n prefixIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => Clock,\n },\n /**\n * @description custom clear icon component\n */\n clearIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => CircleClose,\n },\n ...useEmptyValuesProps,\n} as const)\n\nexport type TimeSelectProps = ExtractPropTypes<typeof timeSelectProps>\nexport type TimeSelectPropsPublic = __ExtractPublicPropTypes<\n typeof timeSelectProps\n>\n\nexport type TimeSelectInstance = InstanceType<typeof TimeSelect> & unknown\n"],"names":["buildProps","definePropType","useSizeProp","Clock","CircleClose","useEmptyValuesProps"],"mappings":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AAC1C,IAAI,OAAO,EAAE,MAAME,cAAK;AACxB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEF,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,MAAMG,oBAAW;AAC9B,GAAG;AACH,EAAE,GAAGC,2BAAmB;AACxB,CAAC;;;;"}

View File

@@ -0,0 +1,116 @@
declare const _default: import("vue").DefineComponent<{
readonly emptyValues: ArrayConstructor;
readonly valueOnClear: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | ((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null))[], unknown, unknown, undefined, boolean>;
readonly format: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "HH:mm", boolean>;
readonly modelValue: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string) | (() => string | null) | ((new (...args: any[]) => string) | (() => string | null))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly disabled: BooleanConstructor;
readonly editable: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
readonly effect: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string) | (() => import("element-plus").PopperEffect) | ((new (...args: any[]) => string) | (() => import("element-plus").PopperEffect))[], unknown, unknown, "light", boolean>;
readonly clearable: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly placeholder: StringConstructor;
readonly start: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "09:00", boolean>;
readonly end: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "18:00", boolean>;
readonly step: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "00:30", boolean>;
readonly minTime: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string) | (() => string | null) | ((new (...args: any[]) => string) | (() => string | null))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly maxTime: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string) | (() => string | null) | ((new (...args: any[]) => string) | (() => string | null))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly includeEndTime: BooleanConstructor;
readonly name: StringConstructor;
readonly prefixIcon: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown, () => any, boolean>;
readonly clearIcon: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown, () => any, boolean>;
}, {
/**
* @description blur the Input component
*/
blur: () => void;
/**
* @description focus the Input component
*/
focus: () => void;
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
focus: (...args: any[]) => void;
clear: (...args: any[]) => void;
"update:modelValue": (...args: any[]) => void;
change: (...args: any[]) => void;
blur: (...args: any[]) => void;
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly emptyValues: ArrayConstructor;
readonly valueOnClear: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | ((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null))[], unknown, unknown, undefined, boolean>;
readonly format: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "HH:mm", boolean>;
readonly modelValue: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string) | (() => string | null) | ((new (...args: any[]) => string) | (() => string | null))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly disabled: BooleanConstructor;
readonly editable: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
readonly effect: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string) | (() => import("element-plus").PopperEffect) | ((new (...args: any[]) => string) | (() => import("element-plus").PopperEffect))[], unknown, unknown, "light", boolean>;
readonly clearable: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly placeholder: StringConstructor;
readonly start: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "09:00", boolean>;
readonly end: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "18:00", boolean>;
readonly step: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "00:30", boolean>;
readonly minTime: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string) | (() => string | null) | ((new (...args: any[]) => string) | (() => string | null))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly maxTime: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string) | (() => string | null) | ((new (...args: any[]) => string) | (() => string | null))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly includeEndTime: BooleanConstructor;
readonly name: StringConstructor;
readonly prefixIcon: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown, () => any, boolean>;
readonly clearIcon: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown, () => any, boolean>;
}>> & {
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
onChange?: ((...args: any[]) => any) | undefined;
onFocus?: ((...args: any[]) => any) | undefined;
onBlur?: ((...args: any[]) => any) | undefined;
onClear?: ((...args: any[]) => any) | undefined;
}, {
readonly disabled: boolean;
readonly end: string;
readonly start: string;
readonly effect: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string) | (() => import("element-plus").PopperEffect) | ((new (...args: any[]) => string) | (() => import("element-plus").PopperEffect))[], unknown, unknown>;
readonly valueOnClear: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | ((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null))[], unknown, unknown>;
readonly format: string;
readonly clearIcon: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>;
readonly prefixIcon: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>;
readonly clearable: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
readonly editable: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
readonly step: string;
readonly includeEndTime: boolean;
}>;
export default _default;

View File

@@ -0,0 +1,145 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var dayjs = require('dayjs');
var customParseFormat = require('dayjs/plugin/customParseFormat.js');
var index$2 = require('../../select/index.js');
var index$3 = require('../../icon/index.js');
var timeSelect = require('./time-select.js');
var utils = require('./utils.js');
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
var event = require('../../../constants/event.js');
var index = require('../../../hooks/use-namespace/index.js');
var useFormCommonProps = require('../../form/src/hooks/use-form-common-props.js');
var index$1 = require('../../../hooks/use-locale/index.js');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
var customParseFormat__default = /*#__PURE__*/_interopDefaultLegacy(customParseFormat);
const __default__ = vue.defineComponent({
name: "ElTimeSelect"
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: timeSelect.timeSelectProps,
emits: [event.CHANGE_EVENT, "blur", "focus", "clear", event.UPDATE_MODEL_EVENT],
setup(__props, { expose }) {
const props = __props;
dayjs__default["default"].extend(customParseFormat__default["default"]);
const { Option: ElOption } = index$2.ElSelect;
const nsInput = index.useNamespace("input");
const select = vue.ref();
const _disabled = useFormCommonProps.useFormDisabled();
const { lang } = index$1.useLocale();
const value = vue.computed(() => props.modelValue);
const start = vue.computed(() => {
const time = utils.parseTime(props.start);
return time ? utils.formatTime(time) : null;
});
const end = vue.computed(() => {
const time = utils.parseTime(props.end);
return time ? utils.formatTime(time) : null;
});
const step = vue.computed(() => {
const time = utils.parseTime(props.step);
return time ? utils.formatTime(time) : null;
});
const minTime = vue.computed(() => {
const time = utils.parseTime(props.minTime || "");
return time ? utils.formatTime(time) : null;
});
const maxTime = vue.computed(() => {
const time = utils.parseTime(props.maxTime || "");
return time ? utils.formatTime(time) : null;
});
const items = vue.computed(() => {
var _a;
const result = [];
const push = (formattedValue, rawValue) => {
result.push({
value: formattedValue,
disabled: utils.compareTime(rawValue, minTime.value || "-1:-1") <= 0 || utils.compareTime(rawValue, maxTime.value || "100:100") >= 0
});
};
if (props.start && props.end && props.step) {
let current = start.value;
let currentTime;
while (current && end.value && utils.compareTime(current, end.value) <= 0) {
currentTime = dayjs__default["default"](current, "HH:mm").locale(lang.value).format(props.format);
push(currentTime, current);
current = utils.nextTime(current, step.value);
}
if (props.includeEndTime && end.value && ((_a = result[result.length - 1]) == null ? void 0 : _a.value) !== end.value) {
const formattedValue = dayjs__default["default"](end.value, "HH:mm").locale(lang.value).format(props.format);
push(formattedValue, end.value);
}
}
return result;
});
const blur = () => {
var _a, _b;
(_b = (_a = select.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
};
const focus = () => {
var _a, _b;
(_b = (_a = select.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
};
expose({
blur,
focus
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.unref(index$2.ElSelect), {
ref_key: "select",
ref: select,
"model-value": vue.unref(value),
disabled: vue.unref(_disabled),
clearable: _ctx.clearable,
"clear-icon": _ctx.clearIcon,
size: _ctx.size,
effect: _ctx.effect,
placeholder: _ctx.placeholder,
"default-first-option": "",
filterable: _ctx.editable,
"empty-values": _ctx.emptyValues,
"value-on-clear": _ctx.valueOnClear,
"onUpdate:modelValue": (event$1) => _ctx.$emit(vue.unref(event.UPDATE_MODEL_EVENT), event$1),
onChange: (event$1) => _ctx.$emit(vue.unref(event.CHANGE_EVENT), event$1),
onBlur: (event) => _ctx.$emit("blur", event),
onFocus: (event) => _ctx.$emit("focus", event),
onClear: () => _ctx.$emit("clear")
}, {
prefix: vue.withCtx(() => [
_ctx.prefixIcon ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.ElIcon), {
key: 0,
class: vue.normalizeClass(vue.unref(nsInput).e("prefix-icon"))
}, {
default: vue.withCtx(() => [
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.prefixIcon)))
]),
_: 1
}, 8, ["class"])) : vue.createCommentVNode("v-if", true)
]),
default: vue.withCtx(() => [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(items), (item) => {
return vue.openBlock(), vue.createBlock(vue.unref(ElOption), {
key: item.value,
label: item.value,
value: item.value,
disabled: item.disabled
}, null, 8, ["label", "value", "disabled"]);
}), 128))
]),
_: 1
}, 8, ["model-value", "disabled", "clearable", "clear-icon", "size", "effect", "placeholder", "filterable", "empty-values", "value-on-clear", "onUpdate:modelValue", "onChange", "onBlur", "onFocus", "onClear"]);
};
}
});
var TimeSelect = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "time-select.vue"]]);
exports["default"] = TimeSelect;
//# sourceMappingURL=time-select2.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
interface Time {
hours: number;
minutes: number;
}
export declare const parseTime: (time: string) => null | Time;
export declare const compareTime: (time1: string, time2: string) => number;
export declare const padTime: (time: number | string) => string;
export declare const formatTime: (time: Time) => string;
export declare const nextTime: (time: string, step: string) => string;
export {};

View File

@@ -0,0 +1,66 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const parseTime = (time) => {
const values = (time || "").split(":");
if (values.length >= 2) {
let hours = Number.parseInt(values[0], 10);
const minutes = Number.parseInt(values[1], 10);
const timeUpper = time.toUpperCase();
if (timeUpper.includes("AM") && hours === 12) {
hours = 0;
} else if (timeUpper.includes("PM") && hours !== 12) {
hours += 12;
}
return {
hours,
minutes
};
}
return null;
};
const compareTime = (time1, time2) => {
const value1 = parseTime(time1);
if (!value1)
return -1;
const value2 = parseTime(time2);
if (!value2)
return -1;
const minutes1 = value1.minutes + value1.hours * 60;
const minutes2 = value2.minutes + value2.hours * 60;
if (minutes1 === minutes2) {
return 0;
}
return minutes1 > minutes2 ? 1 : -1;
};
const padTime = (time) => {
return `${time}`.padStart(2, "0");
};
const formatTime = (time) => {
return `${padTime(time.hours)}:${padTime(time.minutes)}`;
};
const nextTime = (time, step) => {
const timeValue = parseTime(time);
if (!timeValue)
return "";
const stepValue = parseTime(step);
if (!stepValue)
return "";
const next = {
hours: timeValue.hours,
minutes: timeValue.minutes
};
next.minutes += stepValue.minutes;
next.hours += stepValue.hours;
next.hours += Math.floor(next.minutes / 60);
next.minutes = next.minutes % 60;
return formatTime(next);
};
exports.compareTime = compareTime;
exports.formatTime = formatTime;
exports.nextTime = nextTime;
exports.padTime = padTime;
exports.parseTime = parseTime;
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"utils.js","sources":["../../../../../../packages/components/time-select/src/utils.ts"],"sourcesContent":["interface Time {\n hours: number\n minutes: number\n}\n\nexport const parseTime = (time: string): null | Time => {\n const values = (time || '').split(':')\n if (values.length >= 2) {\n let hours = Number.parseInt(values[0], 10)\n const minutes = Number.parseInt(values[1], 10)\n const timeUpper = time.toUpperCase()\n if (timeUpper.includes('AM') && hours === 12) {\n hours = 0\n } else if (timeUpper.includes('PM') && hours !== 12) {\n hours += 12\n }\n return {\n hours,\n minutes,\n }\n }\n\n return null\n}\n\nexport const compareTime = (time1: string, time2: string): number => {\n const value1 = parseTime(time1)\n if (!value1) return -1\n const value2 = parseTime(time2)\n if (!value2) return -1\n const minutes1 = value1.minutes + value1.hours * 60\n const minutes2 = value2.minutes + value2.hours * 60\n if (minutes1 === minutes2) {\n return 0\n }\n return minutes1 > minutes2 ? 1 : -1\n}\n\nexport const padTime = (time: number | string) => {\n return `${time}`.padStart(2, '0')\n}\nexport const formatTime = (time: Time): string => {\n return `${padTime(time.hours)}:${padTime(time.minutes)}`\n}\n\nexport const nextTime = (time: string, step: string): string => {\n const timeValue = parseTime(time)\n if (!timeValue) return ''\n\n const stepValue = parseTime(step)\n if (!stepValue) return ''\n\n const next = {\n hours: timeValue.hours,\n minutes: timeValue.minutes,\n }\n next.minutes += stepValue.minutes\n next.hours += stepValue.hours\n next.hours += Math.floor(next.minutes / 60)\n next.minutes = next.minutes % 60\n return formatTime(next)\n}\n"],"names":[],"mappings":";;;;AAAY,MAAC,SAAS,GAAG,CAAC,IAAI,KAAK;AACnC,EAAE,MAAM,MAAM,GAAG,CAAC,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;AACzC,EAAE,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE;AAC1B,IAAI,IAAI,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC/C,IAAI,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACnD,IAAI,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AACzC,IAAI,IAAI,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,EAAE,EAAE;AAClD,MAAM,KAAK,GAAG,CAAC,CAAC;AAChB,KAAK,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,EAAE,EAAE;AACzD,MAAM,KAAK,IAAI,EAAE,CAAC;AAClB,KAAK;AACL,IAAI,OAAO;AACX,MAAM,KAAK;AACX,MAAM,OAAO;AACb,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,IAAI,CAAC;AACd,EAAE;AACU,MAAC,WAAW,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK;AAC7C,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;AAClC,EAAE,IAAI,CAAC,MAAM;AACb,IAAI,OAAO,CAAC,CAAC,CAAC;AACd,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;AAClC,EAAE,IA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;AACpC,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS,CAAC,KAAK,CAAC;AAChC,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;AAC9C,EAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;AACnC,EAAE,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC1B;;;;;;;;"}

View File

@@ -0,0 +1,7 @@
import 'element-plus/es/components/base/style/css';
import 'element-plus/theme-chalk/el-time-select.css';
import 'element-plus/es/components/scrollbar/style/css';
import 'element-plus/es/components/popper/style/css';
import 'element-plus/es/components/input/style/css';
import 'element-plus/es/components/select/style/css';
import 'element-plus/es/components/option/style/css';

View File

@@ -0,0 +1,11 @@
'use strict';
require('../../base/style/css.js');
require('element-plus/theme-chalk/el-time-select.css');
require('../../scrollbar/style/css.js');
require('../../popper/style/css.js');
require('../../input/style/css.js');
require('../../select/style/css.js');
require('../../option/style/css.js');
//# sourceMappingURL=css.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}

View File

@@ -0,0 +1,7 @@
import 'element-plus/es/components/base/style';
import 'element-plus/theme-chalk/src/time-select.scss';
import 'element-plus/es/components/scrollbar/style';
import 'element-plus/es/components/popper/style';
import 'element-plus/es/components/input/style';
import 'element-plus/es/components/select/style';
import 'element-plus/es/components/option/style';

View File

@@ -0,0 +1,11 @@
'use strict';
require('../../base/style/index.js');
require('element-plus/theme-chalk/src/time-select.scss');
require('../../scrollbar/style/index.js');
require('../../popper/style/index.js');
require('../../input/style/index.js');
require('../../select/style/index.js');
require('../../option/style/index.js');
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}