Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentiny/vue-time-spinner

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentiny/vue-time-spinner - npm Package Compare versions

Comparing version 3.13.0 to 3.14.0

lib/mobile-first.js

2

index.d.ts

@@ -12,3 +12,3 @@ /**

*/
import TimeSpinner from './src/pc.vue';
import TimeSpinner from './src/index';
export default TimeSpinner;

@@ -1,70 +0,37 @@

import { renderless, api } from "@opentiny/vue-renderless/time-spinner/vue";
import { defineComponent, $prefix, directive, setup as _setup } from "@opentiny/vue-common";
import Scrollbar from "@opentiny/vue-scrollbar";
import bind from "@opentiny/vue-renderless/common/deps/repeat-click";
import { iconChevronDown, iconChevronUp } from "@opentiny/vue-icon";
import { resolveComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, Fragment, createVNode, withCtx, renderList, createElementVNode, toDisplayString, withDirectives, vShow, createCommentVNode } from "vue";
function _createForOfIteratorHelperLoose_tiny(o, allowArrayLike) {
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
if (it)
return (it = it.call(o)).next.bind(it);
if (Array.isArray(o) || (it = _unsupportedIterableToArray_tiny(o)) || allowArrayLike && o && typeof o.length === "number") {
if (it)
o = it;
var i = 0;
return function() {
if (i >= o.length)
return { done: true };
return { done: false, value: o[i++] };
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function _unsupportedIterableToArray_tiny(o, minLen) {
if (!o)
return;
if (typeof o === "string")
return _arrayLikeToArray_tiny(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor)
n = o.constructor.name;
if (n === "Map" || n === "Set")
return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
return _arrayLikeToArray_tiny(o, minLen);
}
function _arrayLikeToArray_tiny(arr, len) {
if (len == null || len > arr.length)
len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++)
arr2[i] = arr[i];
return arr2;
}
var _export_sfc = function _export_sfc2(sfc, props) {
var target = sfc.__vccOpts || sfc;
for (var _iterator = _createForOfIteratorHelperLoose_tiny(props), _step; !(_step = _iterator()).done; ) {
var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
target[key] = val;
import { defineComponent, $prefix, $props, $setup } from "@opentiny/vue-common";
import PcTemplate from "./pc.js";
import MobileFirstTemplate from "./mobile-first.js";
import "@opentiny/vue-theme/time-spinner/index.css";
var template = function template2(mode) {
var _process$env;
var tinyMode = typeof process === "object" ? (_process$env = process.env) == null ? void 0 : _process$env.TINY_MODE : null;
if ("pc" === (tinyMode || mode)) {
return PcTemplate;
}
return target;
if ("mobile-first" === (tinyMode || mode)) {
return MobileFirstTemplate;
}
return PcTemplate;
};
import "@opentiny/vue-theme/time-spinner/index.css";
var $constants = {
ANIMATIONNAME: "tiny-transition-timepicker"
};
var _sfc_main = defineComponent({
var TimeSpinner = defineComponent({
name: $prefix + "TimeSpinner",
emits: ["change", "select-range"],
components: {
TinyScrollbar: Scrollbar,
IconChevronDown: iconChevronDown(),
IconChevronUp: iconChevronUp()
},
directives: directive({
repeatClick: {
bind
}
}),
props: {
componentName: "TimeSpinner",
props: _extends({}, $props, {
_constants: {

@@ -111,351 +78,16 @@ type: Object,

var value = _ref2.value, range = _ref2.range;
return value || value == 0 ? Math.floor(value) === value && value > 0 && value <= range : true;
return value || value === 0 ? Math.floor(value) === value && value > 0 && value <= range : true;
});
}
}
},
}),
setup: function setup(props, context) {
return _setup({
return $setup({
props,
context,
renderless,
api,
mono: true
template
});
}
});
var _hoisted_1 = ["onClick"];
var _hoisted_2 = ["onClick"];
var _hoisted_3 = ["onClick"];
var _hoisted_4 = {
class: "tiny-time-spinner__arrow tiny-icon-arrow-up"
};
var _hoisted_5 = {
class: "tiny-time-spinner__arrow tiny-icon-arrow-down"
};
var _hoisted_6 = {
class: "tiny-time-spinner__arrow tiny-icon-arrow-up"
};
var _hoisted_7 = {
class: "tiny-time-spinner__arrow tiny-icon-arrow-down"
};
var _hoisted_8 = {
class: "tiny-time-spinner__arrow tiny-icon-arrow-up"
};
var _hoisted_9 = {
class: "tiny-time-spinner__arrow tiny-icon-arrow-down"
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
var _component_tiny_scrollbar = resolveComponent("tiny-scrollbar");
var _component_icon_chevron_up = resolveComponent("icon-chevron-up");
var _component_icon_chevron_down = resolveComponent("icon-chevron-down");
var _directive_repeat_click = resolveDirective("repeat-click");
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(["tiny-time-spinner", {
"has-seconds": _ctx.showSeconds
}])
},
[!_ctx.arrowControl ? (openBlock(), createElementBlock(
Fragment,
{
key: 0
},
[createVNode(_component_tiny_scrollbar, {
onMouseenter: _cache[0] || (_cache[0] = function($event) {
return _ctx.emitSelectRange("hours");
}),
onMousemove: _cache[1] || (_cache[1] = function($event) {
return _ctx.adjustCurrentSpinner("hours");
}),
class: normalizeClass([[_ctx.state.animationName], "tiny-time-spinner__wrapper"]),
"wrap-style": "max-height: inherit;",
"view-class": "tiny-time-spinner__list",
noresize: "",
tag: "ul",
ref: "hours"
}, {
default: withCtx(function() {
return [(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.state.hoursList, function(_ref3) {
var disabled = _ref3.disabled, hour = _ref3.hour;
return openBlock(), createElementBlock("li", {
onClick: function onClick($event) {
return _ctx.handleClick("hours", {
value: hour,
disabled
});
},
class: normalizeClass(["tiny-time-spinner__item", {
active: hour === _ctx.state.hours,
disabled
}]),
key: hour
}, [createElementVNode(
"span",
null,
toDisplayString(("0" + (_ctx.amPmMode ? hour % 12 || 12 : hour)).slice(-2)) + toDisplayString(_ctx.amPm(hour)),
1
/* TEXT */
)], 10, _hoisted_1);
}),
128
/* KEYED_FRAGMENT */
))];
}),
_: 1
/* STABLE */
}, 8, ["class"]), createVNode(_component_tiny_scrollbar, {
onMouseenter: _cache[2] || (_cache[2] = function($event) {
return _ctx.emitSelectRange("minutes");
}),
onMousemove: _cache[3] || (_cache[3] = function($event) {
return _ctx.adjustCurrentSpinner("minutes");
}),
class: normalizeClass([[_ctx.state.animationName + "-up"], "tiny-time-spinner__wrapper"]),
"wrap-style": "max-height: inherit;",
"view-class": "tiny-time-spinner__list",
noresize: "",
tag: "ul",
ref: "minutes"
}, {
default: withCtx(function() {
return [(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.state.minutesList, function(_ref4) {
var disabled = _ref4.disabled, minute = _ref4.minute;
return openBlock(), createElementBlock("li", {
onClick: function onClick($event) {
return _ctx.handleClick("minutes", {
value: minute,
disabled: false
});
},
key: minute,
class: normalizeClass(["tiny-time-spinner__item", {
active: minute === _ctx.state.minutes,
disabled: !disabled
}])
}, [createElementVNode(
"span",
null,
toDisplayString(("0" + minute).slice(-2)),
1
/* TEXT */
)], 10, _hoisted_2);
}),
128
/* KEYED_FRAGMENT */
))];
}),
_: 1
/* STABLE */
}, 8, ["class"]), withDirectives(createVNode(_component_tiny_scrollbar, {
onMouseenter: _cache[4] || (_cache[4] = function($event) {
return _ctx.emitSelectRange("seconds");
}),
onMousemove: _cache[5] || (_cache[5] = function($event) {
return _ctx.adjustCurrentSpinner("seconds");
}),
class: normalizeClass([[_ctx.state.animationName], "tiny-time-spinner__wrapper"]),
"wrap-style": "max-height: inherit;",
"view-class": "tiny-time-spinner__list",
noresize: "",
tag: "ul",
ref: "seconds"
}, {
default: withCtx(function() {
return [(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.state.secondsList, function(_ref5) {
var second = _ref5.second;
return openBlock(), createElementBlock("li", {
onClick: function onClick($event) {
return _ctx.handleClick("seconds", {
value: second,
disabled: false
});
},
class: normalizeClass(["tiny-time-spinner__item", {
active: second === _ctx.state.seconds
}]),
key: second
}, [createElementVNode(
"span",
null,
toDisplayString(("0" + second).slice(-2)),
1
/* TEXT */
)], 10, _hoisted_3);
}),
128
/* KEYED_FRAGMENT */
))];
}),
_: 1
/* STABLE */
}, 8, ["class"]), [[vShow, _ctx.showSeconds]])],
64
/* STABLE_FRAGMENT */
)) : createCommentVNode("v-if", true), _ctx.arrowControl ? (openBlock(), createElementBlock(
Fragment,
{
key: 1
},
[createElementVNode(
"div",
{
onMouseenter: _cache[6] || (_cache[6] = function($event) {
return _ctx.emitSelectRange("hours");
}),
class: "tiny-time-spinner__wrapper is-arrow"
},
[withDirectives((openBlock(), createElementBlock("i", _hoisted_4, [createVNode(_component_icon_chevron_up)])), [[_directive_repeat_click, _ctx.decrease]]), withDirectives((openBlock(), createElementBlock("i", _hoisted_5, [createVNode(_component_icon_chevron_down)])), [[_directive_repeat_click, _ctx.increase]]), createElementVNode(
"ul",
{
class: normalizeClass(["tiny-time-spinner__list", [_ctx.state.animationName]]),
ref: "hours"
},
[(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.state.arrowHourList, function(hour, key) {
return openBlock(), createElementBlock(
"li",
{
class: normalizeClass(["tiny-time-spinner__item", {
active: hour === _ctx.state.hours,
disabled: _ctx.state.hoursList.find(function(item) {
return item.hour === hour;
}) && _ctx.state.hoursList.find(function(item) {
return item.hour === hour;
}).disabled
}]),
key
},
[createElementVNode(
"span",
null,
toDisplayString(hour === void 0 ? "" : ("0" + (_ctx.amPmMode ? hour % 12 || 12 : hour)).slice(-2) + _ctx.amPm(hour)),
1
/* TEXT */
)],
2
/* CLASS */
);
}),
128
/* KEYED_FRAGMENT */
))],
2
/* CLASS */
)],
32
/* NEED_HYDRATION */
), createElementVNode(
"div",
{
onMouseenter: _cache[7] || (_cache[7] = function($event) {
return _ctx.emitSelectRange("minutes");
}),
class: "tiny-time-spinner__wrapper is-arrow"
},
[withDirectives((openBlock(), createElementBlock("i", _hoisted_6, [createVNode(_component_icon_chevron_up)])), [[_directive_repeat_click, _ctx.decrease]]), withDirectives((openBlock(), createElementBlock("i", _hoisted_7, [createVNode(_component_icon_chevron_down)])), [[_directive_repeat_click, _ctx.increase]]), createElementVNode(
"ul",
{
class: normalizeClass(["tiny-time-spinner__list", [_ctx.state.animationName + "-up"]]),
ref: "minutes"
},
[(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.state.arrowMinuteList, function(minute, key) {
return openBlock(), createElementBlock(
"li",
{
class: normalizeClass(["tiny-time-spinner__item", {
active: minute === _ctx.state.minutes
}]),
key
},
[createElementVNode(
"span",
null,
toDisplayString(minute === void 0 ? "" : ("0" + minute).slice(-2)),
1
/* TEXT */
)],
2
/* CLASS */
);
}),
128
/* KEYED_FRAGMENT */
))],
2
/* CLASS */
)],
32
/* NEED_HYDRATION */
), _ctx.showSeconds ? (openBlock(), createElementBlock(
"div",
{
key: 0,
onMouseenter: _cache[8] || (_cache[8] = function($event) {
return _ctx.emitSelectRange("seconds");
}),
class: "tiny-time-spinner__wrapper is-arrow"
},
[withDirectives((openBlock(), createElementBlock("i", _hoisted_8, [createVNode(_component_icon_chevron_up)])), [[_directive_repeat_click, _ctx.decrease]]), withDirectives((openBlock(), createElementBlock("i", _hoisted_9, [createVNode(_component_icon_chevron_down)])), [[_directive_repeat_click, _ctx.increase]]), createElementVNode(
"ul",
{
class: normalizeClass(["tiny-time-spinner__list", [_ctx.state.animationName]]),
ref: "seconds"
},
[(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.state.arrowSecondList, function(second, key) {
return openBlock(), createElementBlock(
"li",
{
class: normalizeClass(["tiny-time-spinner__item", {
active: second === _ctx.state.seconds
}]),
key
},
[createElementVNode(
"span",
null,
toDisplayString(second === void 0 ? "" : ("0" + second).slice(-2)),
1
/* TEXT */
)],
2
/* CLASS */
);
}),
128
/* KEYED_FRAGMENT */
))],
2
/* CLASS */
)],
32
/* NEED_HYDRATION */
)) : createCommentVNode("v-if", true)],
64
/* STABLE_FRAGMENT */
)) : createCommentVNode("v-if", true)],
2
/* CLASS */
);
}
var TimeSpinner = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
var version = "3.13.0";
var version = "3.14.0";
TimeSpinner.install = function(Vue) {

@@ -462,0 +94,0 @@ Vue.component(TimeSpinner.name, TimeSpinner);

{
"name": "@opentiny/vue-time-spinner",
"version": "3.13.0",
"version": "3.14.0",
"description": "",

@@ -10,5 +10,7 @@ "main": "./lib/index.js",

"dependencies": {
"@opentiny/vue-renderless": "~3.13.0",
"@opentiny/vue-common": "~3.13.0",
"@opentiny/vue-scrollbar": "~3.13.0"
"@opentiny/vue-renderless": "~3.14.0",
"@opentiny/vue-common": "~3.14.0",
"@opentiny/vue-scrollbar": "~3.14.0",
"@opentiny/vue-theme": "~3.14.0",
"@opentiny/vue-icon": "~3.14.0"
},

@@ -15,0 +17,0 @@ "license": "MIT",

@@ -1,33 +0,16 @@

declare const _default: import("@vue/runtime-core").DefineComponent<{
_constants: {
type: ObjectConstructor;
default: () => {
ANIMATIONNAME: string;
};
};
date: {};
defaultValue: {};
showSeconds: {
type: BooleanConstructor;
default: boolean;
};
arrowControl: BooleanConstructor;
amPmMode: {
type: StringConstructor;
default: string;
};
step: {
type: ObjectConstructor;
default(): {
hour: number;
minute: number;
second: number;
};
validator: ({ hour, minute, second }: {
hour: any;
minute: any;
second: any;
}) => boolean;
};
}, {
declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
date?: any;
tiny_mode?: any;
tiny_mode_root?: any;
tiny_template?: any;
tiny_renderless?: any;
_constants?: any;
tiny_theme?: any;
tiny_chart_theme?: any;
defaultValue?: any;
arrowControl?: any;
step?: any;
showSeconds?: any;
amPmMode?: any;
}>, {
t: (this: any, path: any, options?: any) => any;

@@ -40,43 +23,34 @@ vm: any;

gcls: (key: any) => any;
}, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("change" | "select-range")[], "change" | "select-range", import("@vue/runtime-core").VNodeProps & import("@vue/runtime-core").AllowedComponentProps & import("@vue/runtime-core").ComponentCustomProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
_constants: {
type: ObjectConstructor;
default: () => {
ANIMATIONNAME: string;
};
};
date: {};
defaultValue: {};
showSeconds: {
type: BooleanConstructor;
default: boolean;
};
arrowControl: BooleanConstructor;
amPmMode: {
type: StringConstructor;
default: string;
};
step: {
type: ObjectConstructor;
default(): {
hour: number;
minute: number;
second: number;
};
validator: ({ hour, minute, second }: {
hour: any;
minute: any;
second: any;
}) => boolean;
};
}>> & {
}, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("change" | "select-range")[], "change" | "select-range", import("@vue/runtime-core").VNodeProps & import("@vue/runtime-core").AllowedComponentProps & import("@vue/runtime-core").ComponentCustomProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<Readonly<{
date?: any;
tiny_mode?: any;
tiny_mode_root?: any;
tiny_template?: any;
tiny_renderless?: any;
_constants?: any;
tiny_theme?: any;
tiny_chart_theme?: any;
defaultValue?: any;
arrowControl?: any;
step?: any;
showSeconds?: any;
amPmMode?: any;
}>>> & {
onChange?: ((...args: any[]) => any) | undefined;
"onSelect-range"?: ((...args: any[]) => any) | undefined;
}, {
_constants: Record<string, any>;
arrowControl: boolean;
step: Record<string, any>;
showSeconds: boolean;
amPmMode: string;
readonly date?: any;
readonly tiny_mode?: any;
readonly tiny_mode_root?: any;
readonly tiny_template?: any;
readonly tiny_renderless?: any;
readonly _constants?: any;
readonly tiny_theme?: any;
readonly tiny_chart_theme?: any;
readonly defaultValue?: any;
readonly arrowControl?: any;
readonly step?: any;
readonly showSeconds?: any;
readonly amPmMode?: any;
}, {}>;
export default _default;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc