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

@opentiny/vue-pager

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-pager - npm Package Compare versions

Comparing version 2.10.0 to 2.11.0-alpha.0

2

lib/index.js

@@ -123,3 +123,3 @@ function _extends() {

});
var version = "2.10.0";
var version = "2.11.0-alpha.0";
Pager.install = function(Vue) {

@@ -126,0 +126,0 @@ Vue.component(Pager.name, Pager);

@@ -230,3 +230,3 @@ function _extends() {

},
"class": ["group min-w-[1.75rem] h-7 text-xs py-0 px-1 text-color-text-primary bg-white border border-solid border-color-border rounded-sm outline-0 ml-2", "align-bottom cursor-pointer hover:border-color-icon-primary disabled:bg-color-bg-4 disabled:border-color-border disabled:cursor-default disabled:opacity-50"],
"class": ["group min-w-[1.75rem] h-7 text-xs py-0 px-1 text-color-text-primary bg-color-bg-1 border border-solid border-color-border rounded-sm outline-0 ml-2", "align-bottom cursor-pointer hover:border-color-icon-primary disabled:bg-color-bg-4 disabled:border-color-border disabled:cursor-default disabled:opacity-50"],
"on": {

@@ -251,3 +251,3 @@ "click": this.$parent.prev

},
"class": ["group min-w-[1.75rem] h-7 text-xs py-0 px-1 text-color-text-primary bg-white border border-solid border-color-border rounded-sm outline-0 ml-2", "align-bottom cursor-pointer hover:border-color-icon-primary disabled:bg-color-bg-4 disabled:border-color-border disabled:cursor-default disabled:opacity-50"],
"class": ["group min-w-[1.75rem] h-7 text-xs py-0 px-1 text-color-text-primary bg-color-bg-1 border border-solid border-color-border rounded-sm outline-0 ml-2", "align-bottom cursor-pointer hover:border-color-icon-primary disabled:bg-color-bg-4 disabled:border-color-border disabled:cursor-default disabled:opacity-50"],
"on": {

@@ -284,3 +284,3 @@ "click": this.$parent.next

if (Array.isArray(newVal)) {
this.$parent.internalPageSize = newVal.includes(this.$parent.pageSize) ? this.$parent.pageSize : this.pageSizes[0];
this.$parent.internalPageSize = newVal.indexOf(this.$parent.pageSize) > -1 ? this.$parent.pageSize : this.pageSizes[0];
}

@@ -297,6 +297,9 @@ }

return h2("div", {
"attrs": {
"data-tag": "tiny-pager-reference"
},
"slot": "reference",
"class": "my-0 mr-0 ml-4"
}, [h2("div", {
"class": ["min-w-[6.125rem] max-w-[12.5rem] h-7 cursor-pointer leading-7 border border-solid border-color-border text-left text-color-text-primary", "rounded-sm bg-white text-xs pl-3 pr-1 py-0 align-middle relative top-px whitespace-nowrap transition-[border] duration-300 box-border select-none", "hover:border-color-border-hover", _this.showSizes ? "border-color-brand-hover hover:border-color-brand-hover" : ""]
"class": ["min-w-[6.125rem] max-w-[12.5rem] h-7 cursor-pointer leading-7 border border-solid border-color-border text-left text-color-text-primary", "rounded-sm bg-color-bg-1 text-xs pl-3 pr-1 py-0 align-middle relative top-px whitespace-nowrap transition-[border] duration-300 box-border select-none", "hover:border-color-border-hover", _this.showSizes ? "border-color-brand-hover hover:border-color-brand-hover" : ""]
}, [h2("span", {

@@ -312,2 +315,5 @@ "class": "mr-[0.375rem]"

return h2("div", {
"attrs": {
"data-tag": "tiny-pager-size"
},
"class": "max-h-[18.75rem] overflow-y-auto overflow-x-hidden mx-[-1rem] my-[-0.75rem]"

@@ -331,2 +337,5 @@ }, [_this.pageSizes.map(function(item) {

return h2("div", {
"attrs": {
"data-tag": "tiny-pager-popover"
},
"class": ["inline-block align-middle text-xs h-7", "text-xs text-color-text-primary relative -top-px"]

@@ -510,2 +519,5 @@ }, [h2(Popover, {

return typeof this.$parent.internalTotal === "number" ? h2("div", {
"attrs": {
"data-tag": "tiny-pager"
},
"class": ["inline-block align-middle text-xs h-7", this.$parent.mode === "simple" ? "" : "text-color-text-primary text-xs float-left"]

@@ -512,0 +524,0 @@ }, [" ", h2("div", {

@@ -23,2 +23,3 @@ function _extends() {

import { emitEvent } from "@opentiny/vue-renderless/common/event";
import "@opentiny/vue-theme/pager/index.css";
function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {

@@ -81,52 +82,62 @@ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;

props: _extends({}, $props, {
pageSize: {
type: Number,
default: 10
accurateJumper: {
type: Boolean,
default: function _default() {
return true;
}
},
total: Number,
pageCount: Number,
pagerCount: {
type: Number,
validator: function validator(value) {
return (value | 0) === value && value > 2 && value < 22 && value % 2 === 1;
},
default: 7
appendToBody: {
type: Boolean,
default: function _default2() {
return true;
}
},
currentPage: {
type: Number,
default: 1
default: function _default3() {
return 1;
}
},
disabled: {
type: Boolean,
default: function _default4() {
return false;
}
},
hideOnSinglePage: Boolean,
isBeforePageChange: Boolean,
layout: String,
mode: String,
nextText: String,
pageCount: Number,
pageSize: {
type: Number,
default: function _default5() {
return 10;
}
},
pageSizes: {
type: Array,
default: function _default() {
default: function _default6() {
return [10, 20, 30, 40, 50, 100];
}
},
prevText: String,
nextText: String,
hideOnSinglePage: Boolean,
mode: String,
appendToBody: {
type: Boolean,
default: true
pagerCount: {
type: Number,
validator: function validator(value) {
return (value | 0) === value && value > 2 && value < 22 && value % 2 === 1;
},
default: function _default7() {
return 7;
}
},
isBeforePageChange: Boolean,
popperClass: String,
popperAppendToBody: {
type: Boolean,
default: true
default: function _default8() {
return true;
}
},
disabled: {
type: Boolean,
default: false
},
size: {
type: String,
default: ""
},
align: String,
showTotalLoading: {
type: Boolean,
default: function _default2() {
default: function _default9() {
return false;

@@ -137,12 +148,14 @@ }

type: [Boolean, String],
default: function _default3() {
default: function _default10() {
return false;
}
},
accurateJumper: {
type: Boolean,
default: function _default4() {
return true;
}
}
popperClass: String,
prevText: String,
total: Number,
size: {
type: String,
default: ""
},
align: String
}),

@@ -181,2 +194,3 @@ data: function data() {

"isBeforePageChange": this.isBeforePageChange,
"disabled": this.disabled,
"max": this.internalPageCount

@@ -221,5 +235,4 @@ },

});
var templateChildren = [];
components.forEach(function(compo) {
templateChildren.push(TEMPLATE_MAP[compo]);
var templateChildren = components.map(function(compo) {
return TEMPLATE_MAP[compo];
});

@@ -323,14 +336,8 @@ return h2("div", {

}, [h2("div", {
"class": "tiny-pager__input"
}, [h2("input", {
"attrs": {
"disabled": _this.$parent.disabled,
"type": "text",
"readonly": "readonly"
},
"domProps": {
"value": _this.$parent.internalPageSize
}
}), h2("div", {
"class": "tiny-pager__input-btn"
"class": "tiny-pager__page-size",
"ref": "pageSize"
}, [h2("span", {
"class": "sizes"
}, [_this.$parent.internalPageSize]), h2("div", {
"class": "tiny-pager__page-size-btn"
}, [h2(TriangleDown, {

@@ -340,3 +347,3 @@ "class": ["tiny-svg-size", _this.showSizes ? "tiny-svg-size__reverse-180" : ""]

},
default: function _default5() {
default: function _default11() {
return h2("div", {

@@ -363,3 +370,3 @@ "class": "tiny-pager tiny-pager__selector-body"

return h2("div", {
"class": ["tiny-pager__group", "tiny-pager__sizes"]
"class": "tiny-pager__group tiny-pager__sizes"
}, [h2(Popover, {

@@ -410,3 +417,3 @@ props: {

};
this.$parent.beforePagerChangeHandler(params);
this.$parent.beforeSizeChangeHandler(params);
} else {

@@ -494,3 +501,3 @@ callback();

handleClick: function handleClick() {
if (!this.$parent.canJumperGo())
if (!this.$parent.canJumperGo() || this.disabled)
return;

@@ -540,3 +547,3 @@ this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(this.value);

}), h("button", {
class: ["tiny-btn"],
class: ["tiny-btn", this.disabled ? "is-disabled" : ""],
attrs: {

@@ -574,17 +581,23 @@ type: "button"

var h2 = arguments[0];
return typeof this.$parent.internalTotal === "number" ? this.$parent.showTotalLoading ? h2("div", {
"class": "tiny-pager__group tiny-pager__pull-left tiny-pager__loading"
}, [h2("div", {
"class": "tiny-pager__total"
}, [h2("div", {
"class": "tiny-pager__total-loading"
}), h2("span", {
"class": "tiny-pager__loading-text"
}, [t("ui.page.loadingTotals")])])]) : h2("div", {
"class": ["tiny-pager__group", this.$parent.disabled ? "is-disabled" : ""]
}, [" ", h2("div", {
"class": ["tiny-pager__total", this.$parent.size ? "tiny-pager--" + this.$parent.size : ""]
}, [h2("span", [t("ui.page.total"), ":"]), h2("span", {
"class": "tiny-pager__total-allpage"
}, [this.$parent.customTotal ? this.$parent.totalText : this.$parent.internalTotal])])]) : "";
var tempalte = "";
if (typeof this.$parent.internalTotal === "number") {
var loadingTotalTemplate = h2("div", {
"class": "tiny-pager__group tiny-pager__pull-left tiny-pager__loading"
}, [h2("div", {
"class": "tiny-pager__total"
}, [h2("div", {
"class": "tiny-pager__total-loading"
}), h2("span", {
"class": "tiny-pager__loading-text"
}, [t("ui.page.loadingTotals")])])]);
var totalTemplate = h2("div", {
"class": ["tiny-pager__group", this.$parent.disabled ? "is-disabled" : ""]
}, [" ", h2("div", {
"class": ["tiny-pager__total", this.$parent.size ? "tiny-pager--" + this.$parent.size : ""]
}, [h2("span", [t("ui.page.total"), ":"]), h2("span", {
"class": "tiny-pager__total-allpage"
}, [this.$parent.customTotal ? this.$parent.totalText : this.$parent.internalTotal])])]);
tempalte = this.$parent.showTotalLoading ? loadingTotalTemplate : totalTemplate;
}
return tempalte;
}

@@ -776,4 +789,4 @@ },

internalPageCount: function internalPageCount() {
if (typeof this.internalTotal === "number") {
return Math.max(1, Math.ceil(this.internalTotal / this.internalPageSize));
if (typeof this.total === "number") {
return Math.max(1, Math.ceil(this.total / this.internalPageSize));
} else if (typeof this.pageCount === "number") {

@@ -794,3 +807,3 @@ return Math.max(1, this.pageCount);

} else {
layout = "total, prev, pager, next, jumper";
layout = "prev, pager, next, jumper, total";
}

@@ -802,15 +815,19 @@ return layout;

currentPage: {
immediate: true,
handler: function handler2(val) {
this.internalCurrentPage = this.getValidCurrentPage(val);
}
handler: function handler2(curPage) {
this.internalCurrentPage = this.getValidCurrentPage(curPage);
},
immediate: true
},
pageSize: {
immediate: true,
handler: function handler3(val) {
this.internalPageSize = isNaN(val) ? 10 : val;
internalPageCount: function internalPageCount2(pageCount) {
var oldCurPage = this.internalCurrentPage;
if (pageCount > 0 && oldCurPage === 0) {
this.internalCurrentPage = 1;
} else if (oldCurPage > pageCount) {
this.internalCurrentPage = pageCount || 1;
this.userChangePageSize && this.emitChange();
}
this.userChangePageSize = false;
},
internalCurrentPage: {
handler: function handler4(newVal) {
handler: function handler3(newVal) {
this.$emit("update:currentPage", newVal);

@@ -821,14 +838,10 @@ this.$emit("current-change", newVal);

},
internalPageCount: function internalPageCount2(newVal) {
var oldPage = this.internalCurrentPage;
if (newVal > 0 && oldPage === 0) {
this.internalCurrentPage = 1;
} else if (oldPage > newVal) {
this.internalCurrentPage = newVal === 0 ? 1 : newVal;
this.userChangePageSize && this.emitChange();
}
this.userChangePageSize = false;
pageSize: {
handler: function handler4(pageSize) {
this.internalPageSize = isNaN(pageSize) ? 10 : pageSize;
},
immediate: true
},
total: function total(val) {
this.internalTotal = val;
total: function total(_total) {
this.internalTotal = _total;
}

@@ -835,0 +848,0 @@ }

{
"name": "@opentiny/vue-pager",
"version": "2.10.0",
"version": "2.11.0-alpha.0",
"description": "",

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

"dependencies": {
"@opentiny/vue-renderless": "~3.10.0",
"@opentiny/vue-icon": "~2.10.0",
"@opentiny/vue-popover": "~2.10.0",
"@opentiny/vue-locale": "~2.10.0",
"@opentiny/vue-pager-item": "~2.10.0"
"@opentiny/vue-renderless": "~3.11.0",
"@opentiny/vue-icon": "~2.11.0",
"@opentiny/vue-popover": "~2.11.0",
"@opentiny/vue-locale": "~2.11.0",
"@opentiny/vue-pager-item": "~2.11.0"
},

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

@@ -1,166 +0,2 @@

declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api/dist/vue-composition-api.js").ShallowUnwrapRef<() => import("vue").VNode> & import("@vue/composition-api/dist/vue-composition-api.js").Data, {}, {}, {
accurateJumper: {
type: BooleanConstructor;
default: () => true;
};
appendToBody: {
type: BooleanConstructor;
default: () => true;
};
currentPage: {
type: NumberConstructor;
default: () => 1;
};
disabled: {
type: BooleanConstructor;
default: () => false;
};
hideOnSinglePage: BooleanConstructor;
isBeforePageChange: BooleanConstructor;
layout: StringConstructor;
mode: StringConstructor;
nextText: StringConstructor;
pageCount: NumberConstructor;
pageSize: {
type: NumberConstructor;
default: () => 10;
};
pageSizes: {
type: ArrayConstructor;
default: () => number[];
};
pagerCount: {
type: NumberConstructor;
validator: (value: unknown) => boolean;
default: () => 7;
};
popperAppendToBody: {
type: BooleanConstructor;
default: () => true;
};
showTotalLoading: {
type: BooleanConstructor;
default: () => false;
};
customTotal: {
type: (StringConstructor | BooleanConstructor)[];
default: () => false;
};
popperClass: StringConstructor;
prevText: StringConstructor;
total: NumberConstructor;
size: {
type: StringConstructor;
default: string;
};
align: {
type: StringConstructor;
validator: (value: unknown) => boolean;
};
tiny_mode: StringConstructor;
tiny_mode_root: BooleanConstructor;
tiny_template: (ObjectConstructor | FunctionConstructor)[];
tiny_renderless: FunctionConstructor;
tiny_theme: StringConstructor;
tiny_chart_theme: ObjectConstructor;
}, {
disabled: boolean;
tiny_mode_root: boolean;
size: string;
popperAppendToBody: boolean;
appendToBody: boolean;
hideOnSinglePage: boolean;
isBeforePageChange: boolean;
accurateJumper: boolean;
currentPage: number;
pageSize: number;
pageSizes: unknown[];
pagerCount: number;
showTotalLoading: boolean;
customTotal: string | boolean;
} & {
tiny_mode?: string | undefined;
tiny_template?: unknown;
tiny_renderless?: Function | undefined;
tiny_theme?: string | undefined;
tiny_chart_theme?: Record<string, any> | undefined;
popperClass?: string | undefined;
mode?: string | undefined;
align?: string | undefined;
total?: number | undefined;
layout?: string | undefined;
nextText?: string | undefined;
pageCount?: number | undefined;
prevText?: string | undefined;
}> & import("vue").VueConstructor<import("vue").default> & (new (...args: any[]) => import("@vue/composition-api/dist/vue-composition-api.js").ComponentRenderProxy<{
disabled: boolean;
tiny_mode_root: boolean;
size: string;
popperAppendToBody: boolean;
appendToBody: boolean;
hideOnSinglePage: boolean;
isBeforePageChange: boolean;
accurateJumper: boolean;
currentPage: number;
pageSize: number;
pageSizes: unknown[];
pagerCount: number;
showTotalLoading: boolean;
customTotal: string | boolean;
} & {
tiny_mode?: string | undefined;
tiny_template?: unknown;
tiny_renderless?: Function | undefined;
tiny_theme?: string | undefined;
tiny_chart_theme?: Record<string, any> | undefined;
popperClass?: string | undefined;
mode?: string | undefined;
align?: string | undefined;
total?: number | undefined;
layout?: string | undefined;
nextText?: string | undefined;
pageCount?: number | undefined;
prevText?: string | undefined;
}, import("@vue/composition-api/dist/vue-composition-api.js").ShallowUnwrapRef<() => import("vue").VNode>, import("@vue/composition-api/dist/vue-composition-api.js").Data, {}, {}, {
disabled: boolean;
tiny_mode_root: boolean;
size: string;
popperAppendToBody: boolean;
appendToBody: boolean;
hideOnSinglePage: boolean;
isBeforePageChange: boolean;
accurateJumper: boolean;
currentPage: number;
pageSize: number;
pageSizes: unknown[];
pagerCount: number;
showTotalLoading: boolean;
customTotal: string | boolean;
} & {
tiny_mode?: string | undefined;
tiny_template?: unknown;
tiny_renderless?: Function | undefined;
tiny_theme?: string | undefined;
tiny_chart_theme?: Record<string, any> | undefined;
popperClass?: string | undefined;
mode?: string | undefined;
align?: string | undefined;
total?: number | undefined;
layout?: string | undefined;
nextText?: string | undefined;
pageCount?: number | undefined;
prevText?: string | undefined;
}, {
disabled: boolean;
size: string;
popperAppendToBody: boolean;
appendToBody: boolean;
accurateJumper: boolean;
currentPage: number;
pageSize: number;
pageSizes: unknown[];
pagerCount: number;
showTotalLoading: boolean;
customTotal: string | boolean;
}, true>);
declare const _default: any;
export default _default;

@@ -1,8 +0,2 @@

declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api/dist/vue-composition-api.js").ShallowUnwrapRef<unknown> & import("@vue/composition-api/dist/vue-composition-api.js").Data, {}, {}, unknown, {
[x: string]: any;
}> & import("vue").VueConstructor<import("vue").default> & (new (...args: any[]) => import("@vue/composition-api/dist/vue-composition-api.js").ComponentRenderProxy<{
[x: string]: any;
}, import("@vue/composition-api/dist/vue-composition-api.js").ShallowUnwrapRef<unknown>, import("@vue/composition-api/dist/vue-composition-api.js").Data, {}, {}, {
[x: string]: any;
}, {}, true>);
declare const _default: any;
export default _default;

@@ -1,8 +0,2 @@

declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api/dist/vue-composition-api.js").ShallowUnwrapRef<unknown> & import("@vue/composition-api/dist/vue-composition-api.js").Data, {}, {}, unknown, {
[x: string]: any;
}> & import("vue").VueConstructor<import("vue").default> & (new (...args: any[]) => import("@vue/composition-api/dist/vue-composition-api.js").ComponentRenderProxy<{
[x: string]: any;
}, import("@vue/composition-api/dist/vue-composition-api.js").ShallowUnwrapRef<unknown>, import("@vue/composition-api/dist/vue-composition-api.js").Data, {}, {}, {
[x: string]: any;
}, {}, true>);
declare const _default: 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