snail.vue 1.0.43 → 1.0.44
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/snail.vue.d.ts +19 -10
- package/dist/snail.vue.js +22 -13
- package/dist/snail.vue.umd.js +22 -13
- package/dist/styles/snail.vue.vue.css +6 -6
- package/package.json +1 -1
package/dist/snail.vue.d.ts
CHANGED
|
@@ -1107,13 +1107,6 @@ type SortOptions<T> = DisabledOptions & {
|
|
|
1107
1107
|
* - 传入类样式选择器;如 .table-row
|
|
1108
1108
|
*/
|
|
1109
1109
|
draggable: string;
|
|
1110
|
-
/**
|
|
1111
|
-
* 哪个元素启动拖拽
|
|
1112
|
-
* - 传入类样式选择器;如 .sort-handle
|
|
1113
|
-
* - 不传入则默认 draggable
|
|
1114
|
-
* - 若自定义,则传入 draggable 下的dom元素作为启动拖拽的句柄
|
|
1115
|
-
*/
|
|
1116
|
-
handle?: string;
|
|
1117
1110
|
/**
|
|
1118
1111
|
* 拖动的元素上增加的类样式
|
|
1119
1112
|
* - 执行拖拽时随着鼠标移动元素,脱离文档流了
|
|
@@ -1127,6 +1120,19 @@ type SortOptions<T> = DisabledOptions & {
|
|
|
1127
1120
|
* - 默认:snail-sort-ghost
|
|
1128
1121
|
*/
|
|
1129
1122
|
ghostClass?: string;
|
|
1123
|
+
/**
|
|
1124
|
+
* 哪个元素启动拖拽
|
|
1125
|
+
* - 传入类样式选择器;如 .sort-handle
|
|
1126
|
+
* - 不传入则默认 draggable
|
|
1127
|
+
* - 若自定义,则传入 draggable 下的dom元素作为启动拖拽的句柄
|
|
1128
|
+
*/
|
|
1129
|
+
handle?: string;
|
|
1130
|
+
/**
|
|
1131
|
+
* 过滤器,不需要进行拖动的元素
|
|
1132
|
+
* - 传入类样式选择器;如 .sort-handle
|
|
1133
|
+
* - 实现特定子元素不触发拖动排序功能
|
|
1134
|
+
*/
|
|
1135
|
+
filter?: string;
|
|
1130
1136
|
/**
|
|
1131
1137
|
* 排序组
|
|
1132
1138
|
* - 组相同时,可跨组拖拽排序
|
|
@@ -1876,9 +1882,10 @@ declare const components: {
|
|
|
1876
1882
|
new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<DisabledOptions & {
|
|
1877
1883
|
changer: any;
|
|
1878
1884
|
draggable: string;
|
|
1879
|
-
handle?: string;
|
|
1880
1885
|
dragClass?: string;
|
|
1881
1886
|
ghostClass?: string;
|
|
1887
|
+
handle?: string;
|
|
1888
|
+
filter?: string;
|
|
1882
1889
|
group?: string;
|
|
1883
1890
|
animation?: number;
|
|
1884
1891
|
}> & Readonly<{
|
|
@@ -1895,9 +1902,10 @@ declare const components: {
|
|
|
1895
1902
|
}, Readonly<DisabledOptions & {
|
|
1896
1903
|
changer: any;
|
|
1897
1904
|
draggable: string;
|
|
1898
|
-
handle?: string;
|
|
1899
1905
|
dragClass?: string;
|
|
1900
1906
|
ghostClass?: string;
|
|
1907
|
+
handle?: string;
|
|
1908
|
+
filter?: string;
|
|
1901
1909
|
group?: string;
|
|
1902
1910
|
animation?: number;
|
|
1903
1911
|
}> & Readonly<{
|
|
@@ -1909,9 +1917,10 @@ declare const components: {
|
|
|
1909
1917
|
} & vue.ComponentOptionsBase<Readonly<DisabledOptions & {
|
|
1910
1918
|
changer: any;
|
|
1911
1919
|
draggable: string;
|
|
1912
|
-
handle?: string;
|
|
1913
1920
|
dragClass?: string;
|
|
1914
1921
|
ghostClass?: string;
|
|
1922
|
+
handle?: string;
|
|
1923
|
+
filter?: string;
|
|
1915
1924
|
group?: string;
|
|
1916
1925
|
animation?: number;
|
|
1917
1926
|
}> & Readonly<{
|
package/dist/snail.vue.js
CHANGED
|
@@ -1938,9 +1938,10 @@ var _sfc_main$7 = defineComponent({
|
|
|
1938
1938
|
},
|
|
1939
1939
|
changer: {},
|
|
1940
1940
|
draggable: {},
|
|
1941
|
-
handle: {},
|
|
1942
1941
|
dragClass: {},
|
|
1943
1942
|
ghostClass: {},
|
|
1943
|
+
handle: {},
|
|
1944
|
+
filter: {},
|
|
1944
1945
|
group: {},
|
|
1945
1946
|
animation: {}
|
|
1946
1947
|
},
|
|
@@ -1954,25 +1955,30 @@ var _sfc_main$7 = defineComponent({
|
|
|
1954
1955
|
const {
|
|
1955
1956
|
watcher
|
|
1956
1957
|
} = useReactive();
|
|
1958
|
+
const {
|
|
1959
|
+
onTimeout
|
|
1960
|
+
} = useTimer();
|
|
1961
|
+
var MODULE_Sortable = void 0;
|
|
1957
1962
|
var sortPanel = void 0;
|
|
1958
1963
|
var sortInstance = void 0;
|
|
1959
|
-
|
|
1964
|
+
function buildSortable() {
|
|
1960
1965
|
{
|
|
1961
1966
|
sortInstance && sortInstance.destroy();
|
|
1962
1967
|
sortInstance = void 0;
|
|
1968
|
+
sortPanel.classList.remove("sortable");
|
|
1963
1969
|
}
|
|
1964
|
-
if (props.disabled != true) {
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
sortInstance = new Sortable(sortPanel, {
|
|
1970
|
+
if (props.disabled != true && MODULE_Sortable != void 0) {
|
|
1971
|
+
sortPanel.classList.add("sortable");
|
|
1972
|
+
sortInstance = new MODULE_Sortable(sortPanel, {
|
|
1968
1973
|
group: props.group || newId(),
|
|
1969
1974
|
draggable: props.draggable,
|
|
1970
|
-
handle: props.handle || props.draggable,
|
|
1971
1975
|
dragClass: props.dragClass || "snail-sort-drag",
|
|
1972
1976
|
ghostClass: props.ghostClass || "snail-sort-ghost",
|
|
1977
|
+
handle: props.handle || props.draggable,
|
|
1978
|
+
filter: props.filter,
|
|
1979
|
+
preventOnFilter: false,
|
|
1973
1980
|
animation: props.animation > 0 ? props.animation : 150,
|
|
1974
1981
|
forceFallback: true,
|
|
1975
|
-
preventOnFilter: false,
|
|
1976
1982
|
fallbackTolerance: 2,
|
|
1977
1983
|
onUpdate(evt) {
|
|
1978
1984
|
emits("update", evt.oldIndex, evt.newIndex);
|
|
@@ -1980,13 +1986,16 @@ var _sfc_main$7 = defineComponent({
|
|
|
1980
1986
|
});
|
|
1981
1987
|
}
|
|
1982
1988
|
}
|
|
1983
|
-
onMounted(() => {
|
|
1989
|
+
onMounted(async () => {
|
|
1984
1990
|
const instance = getCurrentInstance();
|
|
1985
1991
|
sortPanel = instance.vnode.el.parentElement;
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1992
|
+
MODULE_Sortable = await script.load("sortablejs");
|
|
1993
|
+
var timerScope = void 0;
|
|
1994
|
+
buildSortable();
|
|
1995
|
+
watcher(() => props.disabled, buildSortable);
|
|
1996
|
+
watcher(() => props.changer, () => {
|
|
1997
|
+
timerScope && timerScope.destroy();
|
|
1998
|
+
timerScope = onTimeout(() => buildSortable(), 100);
|
|
1990
1999
|
});
|
|
1991
2000
|
});
|
|
1992
2001
|
onBeforeUnmount(() => sortInstance && sortInstance.destroy());
|
package/dist/snail.vue.umd.js
CHANGED
|
@@ -1940,9 +1940,10 @@
|
|
|
1940
1940
|
},
|
|
1941
1941
|
changer: {},
|
|
1942
1942
|
draggable: {},
|
|
1943
|
-
handle: {},
|
|
1944
1943
|
dragClass: {},
|
|
1945
1944
|
ghostClass: {},
|
|
1945
|
+
handle: {},
|
|
1946
|
+
filter: {},
|
|
1946
1947
|
group: {},
|
|
1947
1948
|
animation: {}
|
|
1948
1949
|
},
|
|
@@ -1956,25 +1957,30 @@
|
|
|
1956
1957
|
const {
|
|
1957
1958
|
watcher
|
|
1958
1959
|
} = useReactive();
|
|
1960
|
+
const {
|
|
1961
|
+
onTimeout
|
|
1962
|
+
} = snail_core.useTimer();
|
|
1963
|
+
var MODULE_Sortable = void 0;
|
|
1959
1964
|
var sortPanel = void 0;
|
|
1960
1965
|
var sortInstance = void 0;
|
|
1961
|
-
|
|
1966
|
+
function buildSortable() {
|
|
1962
1967
|
{
|
|
1963
1968
|
sortInstance && sortInstance.destroy();
|
|
1964
1969
|
sortInstance = void 0;
|
|
1970
|
+
sortPanel.classList.remove("sortable");
|
|
1965
1971
|
}
|
|
1966
|
-
if (props.disabled != true) {
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
sortInstance = new Sortable(sortPanel, {
|
|
1972
|
+
if (props.disabled != true && MODULE_Sortable != void 0) {
|
|
1973
|
+
sortPanel.classList.add("sortable");
|
|
1974
|
+
sortInstance = new MODULE_Sortable(sortPanel, {
|
|
1970
1975
|
group: props.group || snail_core.newId(),
|
|
1971
1976
|
draggable: props.draggable,
|
|
1972
|
-
handle: props.handle || props.draggable,
|
|
1973
1977
|
dragClass: props.dragClass || "snail-sort-drag",
|
|
1974
1978
|
ghostClass: props.ghostClass || "snail-sort-ghost",
|
|
1979
|
+
handle: props.handle || props.draggable,
|
|
1980
|
+
filter: props.filter,
|
|
1981
|
+
preventOnFilter: false,
|
|
1975
1982
|
animation: props.animation > 0 ? props.animation : 150,
|
|
1976
1983
|
forceFallback: true,
|
|
1977
|
-
preventOnFilter: false,
|
|
1978
1984
|
fallbackTolerance: 2,
|
|
1979
1985
|
onUpdate(evt) {
|
|
1980
1986
|
emits("update", evt.oldIndex, evt.newIndex);
|
|
@@ -1982,13 +1988,16 @@
|
|
|
1982
1988
|
});
|
|
1983
1989
|
}
|
|
1984
1990
|
}
|
|
1985
|
-
vue.onMounted(() => {
|
|
1991
|
+
vue.onMounted(async () => {
|
|
1986
1992
|
const instance = vue.getCurrentInstance();
|
|
1987
1993
|
sortPanel = instance.vnode.el.parentElement;
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1994
|
+
MODULE_Sortable = await snail_core.script.load("sortablejs");
|
|
1995
|
+
var timerScope = void 0;
|
|
1996
|
+
buildSortable();
|
|
1997
|
+
watcher(() => props.disabled, buildSortable);
|
|
1998
|
+
watcher(() => props.changer, () => {
|
|
1999
|
+
timerScope && timerScope.destroy();
|
|
2000
|
+
timerScope = onTimeout(() => buildSortable(), 100);
|
|
1992
2001
|
});
|
|
1993
2002
|
});
|
|
1994
2003
|
vue.onBeforeUnmount(() => sortInstance && sortInstance.destroy());
|
|
@@ -16,32 +16,32 @@
|
|
|
16
16
|
.snail-switch{border-radius:10px 10px 10px 10px;cursor:pointer;height:20px!important;overflow:hidden;position:relative;width:36px!important}.snail-switch>div{height:100%;width:100%}.snail-switch>div.on{background-color:#5ca3ff}.snail-switch>div.off{background-color:#c4c8cc;position:absolute;transition:left .2s ease}.snail-switch>div.status{background:#fff;border-radius:10px 10px 10px 10px;height:16px;position:absolute;top:2px;transition:left .2s ease;width:16px}.snail-switch.on>div.off{left:100%;top:0}.snail-switch.on>div.status{left:calc(100% - 18px)}.snail-switch.off>div.off{left:0;top:0}.snail-switch.off>div.status{left:2px}.snail-switch.readonly{cursor:not-allowed}
|
|
17
17
|
/* src:container\fold.vue index:0 */
|
|
18
18
|
.snail-fold{flex-shrink:0}.snail-fold>div.fold-header{align-items:center;display:flex;height:32px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-fold>div.fold-header:before{background-color:#2c97fb;content:"";height:18px;left:0;position:absolute;top:7px;width:4px}.snail-fold>div.fold-header>.subtitle,.snail-fold>div.fold-header>.title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.snail-fold>div.fold-header>.title{color:#2e3033;font-weight:bold;padding-left:20px}.snail-fold>div.fold-header>.subtitle{color:#8a9099;font-size:13px}.snail-fold>div.fold-header>div.status{align-items:right;display:flex;flex:1;justify-content:right}.snail-fold>div.fold-header>div.status>svg.snail-icon{transition:transform .2s ease}.snail-fold>div.fold-body{padding-left:20px}.snail-fold.expand>div.fold-header>div.status>svg.snail-icon{transform:rotate(-90deg)}.snail-fold.fold>div.fold-header>div.status>svg.snail-icon{transform:rotate(90deg)}
|
|
19
|
-
/* src:container\scroll.vue index:0 */
|
|
20
|
-
.snail-scroll{overflow:hidden}.snail-scroll.scroll-x{overflow-x:auto}.snail-scroll.scroll-y{overflow-y:auto}
|
|
21
19
|
/* src:container\dynamic.vue index:0 */
|
|
22
20
|
.snail-dynamic-error{color:red}.snail-dynamic-error>span{color:gray}
|
|
21
|
+
/* src:container\scroll.vue index:0 */
|
|
22
|
+
.snail-scroll{overflow:hidden}.snail-scroll.scroll-x{overflow-x:auto}.snail-scroll.scroll-y{overflow-y:auto}
|
|
23
23
|
/* src:container\sort.vue index:0 */
|
|
24
24
|
.snail-sort-drag{background:#fff;border:1px solid #4c9aff;border-radius:4px;cursor:move}.snail-sort-ghost{border:1px dashed #4c9aff;border-radius:4px}
|
|
25
25
|
/* src:container\table.vue index:0 */
|
|
26
26
|
.snail-table{display:flex;flex-direction:column}.snail-table>div.table-footer,.snail-table>div.table-header{align-items:center;display:flex;flex-shrink:0;width:100%}.snail-table>div.table-header{background-color:#fff;position:sticky!important;top:0;z-index:1}.snail-table>div.table-body{flex:1;width:100%}.snail-table.start-border>div.table-body>.table-row>.table-col:nth-child(n+2),.snail-table.start-border>div.table-footer>.table-col:nth-child(n+2),.snail-table.start-border>div.table-header>.table-col:nth-child(n+2){border-left:none!important}.snail-table.start-border>div.table-body>.table-row>.table-col,.snail-table.start-border>div.table-footer>.table-col{border-top:none!important}
|
|
27
27
|
/* src:container\components\table-row.vue index:0 */
|
|
28
28
|
.table-row{align-items:center;display:flex}
|
|
29
|
-
/* src:form\input.vue index:0 */
|
|
30
|
-
.snail-input{display:inline-flex;min-height:34px}.snail-input>.input-title{flex-shrink:0;padding-top:6px}.snail-input>.input-title>span.text{color:#2e3033}.snail-input>.input-title>span.required{color:#f74b4b;margin-left:2px}.snail-input>.input-body{align-self:start;display:flex;flex:1;height:32px}.snail-input>.input-body>input{flex:1}.snail-input>.input-body>span{background-color:red;flex-shrink:0}
|
|
31
29
|
/* src:container\tree.vue index:0 */
|
|
32
30
|
.snail-tree{background-color:#fff;display:flex;flex-direction:column}.snail-tree .snail-search{flex-shrink:0;margin:12px}.snail-tree .snail-scroll{flex:1}
|
|
33
31
|
/* src:container\components\table-col.vue index:0 */
|
|
34
32
|
.table-col{align-items:center;display:flex;height:100%;white-space:nowrap}.table-col.left{justify-content:left}.table-col.center{justify-content:center}.table-col.right{justify-content:right}
|
|
33
|
+
/* src:form\input.vue index:0 */
|
|
34
|
+
.snail-input{display:inline-flex;min-height:34px}.snail-input>.input-title{flex-shrink:0;padding-top:6px}.snail-input>.input-title>span.text{color:#2e3033}.snail-input>.input-title>span.required{color:#f74b4b;margin-left:2px}.snail-input>.input-body{align-self:start;display:flex;flex:1;height:32px}.snail-input>.input-body>input{flex:1}.snail-input>.input-body>span{background-color:red;flex-shrink:0}
|
|
35
35
|
/* src:prompt\drag-verify.vue index:0 */
|
|
36
36
|
.snail-drag-verify{background:#f8f9fa;border:1px solid #dddfed;border-radius:8px;height:40px;overflow:hidden;position:relative;width:100%}.snail-drag-verify>div{height:100%;width:100%}.snail-drag-verify>.drag-progress{background-color:#0c6;transition:width .5s ease-in-out}.snail-drag-verify>.drag-handle,.snail-drag-verify>.verify-message{left:0;position:absolute;top:0;transition:left .5s ease-in-out}.snail-drag-verify>.verify-message{background-image:-webkit-linear-gradient(left,#666,#666 45%,#fff 50%,#666 55%,#666);-webkit-text-fill-color:transparent;align-items:center;animation:snail-drag-verify 2s linear infinite;-webkit-background-clip:text;background-clip:text;background-size:200% 100%;color:#7e848c;display:flex;font-size:12px;font-weight:400;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-drag-verify>.drag-handle{align-items:center;background-color:#fff;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURQAAAGBQUGBaWmJZWWJYWGNYWGNZWWJYWGJZWWBYWGNYWGNZWWRYWIqwlb0AAAANdFJOUwAQMMDQoFBgcCCw4ECQ8pPMAAAAP0lEQVQI12NgwATTGBgawAwRBYZwMIPRiYErAcxSFmA0AjN4HBikBcCsUgYmQxQGE0wKphhIQrSzwAyEW4EOACHhB32zIad6AAAAAElFTkSuQmCC);background-position:50%;background-repeat:no-repeat;border-right:1px solid #dddfed;cursor:move;display:flex;justify-content:center;width:40px}.snail-drag-verify.dragging>.drag-handle,.snail-drag-verify.dragging>.drag-progress{transition:none!important}.snail-drag-verify.success>.verify-message{-webkit-text-fill-color:#fff;color:#fff}.snail-drag-verify.success>.drag-handle>svg{background:#76c61d;border-radius:50%;padding:4px}@keyframes snail-drag-verify{0%{background-position:0 0}to{background-position:-200% 0}}
|
|
37
37
|
/* src:prompt\empty.vue index:0 */
|
|
38
38
|
.snail-empty{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;min-height:150px;width:100%}.snail-empty>img{height:60px;width:60px}.snail-empty>div.message{color:#babdc2;font-weight:400;padding:0 10px 10px}
|
|
39
39
|
/* src:prompt\loading.vue index:0 */
|
|
40
40
|
.snail-loading{height:100%;left:0;position:absolute;top:0;width:100%;z-index:10000}.snail-loading.show-mask{background-color:rgba(0,0,0,.15)}.snail-loading:after,.snail-loading:before{animation:snail-loading-stretch 1s ease-in-out infinite;border-radius:50%;content:"";display:block;display:inline-block;height:10px;left:50%;margin-left:-18px;margin-top:-6px;position:absolute;top:50%;width:10px}.snail-loading:before{background-color:#279bf1}.snail-loading:after{animation-delay:-.5s;background:#64d214;margin-left:0;margin-right:-18px}@keyframes snail-loading-stretch{0%,to{transform:scale(1)}50%{transform:scale(2)}}.snail-loading-enter-active,.snail-loading-leave-active{transition:opacity .5s ease-in-out}.snail-loading-enter-from,.snail-loading-leave-to{opacity:0}
|
|
41
|
-
/* src:popup\components\dialog-container.vue index:0 */
|
|
42
|
-
.snail-dialog{align-items:center;display:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%}.snail-dialog:before{background-color:rgba(24,27,33,.45);content:"";height:100%;opacity:1;position:absolute;transition:opacity .4s ease-in-out;width:100%}.snail-dialog>.dialog-body{background-color:#fff;border-radius:4px;box-shadow:0 0 15px rgba(0,0,0,.3);position:relative}.snail-dialog.unactive:before{opacity:0}.snail-dialog.unactive>.dialog-body{box-shadow:0 0 4px rgba(0,0,0,.3)}
|
|
43
41
|
/* src:popup\components\confirm-container.vue index:0 */
|
|
44
42
|
.snail-confirm{background-color:#fff;border-radius:4px;color:#2e2f33;display:flex;flex-direction:column;max-height:350px;max-width:548px;min-width:348px}.snail-confirm>div.confirm-body{flex:1;margin:20px 40px;overflow:auto;word-wrap:break-word}
|
|
43
|
+
/* src:popup\components\dialog-container.vue index:0 */
|
|
44
|
+
.snail-dialog{align-items:center;display:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%}.snail-dialog:before{background-color:rgba(24,27,33,.45);content:"";height:100%;opacity:1;position:absolute;transition:opacity .4s ease-in-out;width:100%}.snail-dialog>.dialog-body{background-color:#fff;border-radius:4px;box-shadow:0 0 15px rgba(0,0,0,.3);position:relative}.snail-dialog.unactive:before{opacity:0}.snail-dialog.unactive>.dialog-body{box-shadow:0 0 4px rgba(0,0,0,.3)}
|
|
45
45
|
/* src:popup\components\follow-container.vue index:0 */
|
|
46
46
|
.snail-follow{background-color:#fff;display:inline-block;max-height:100%;max-width:100%;position:fixed;transition-duration:.5s;transition-property:left,top;transition-timing-function:ease}.snail-follow.initial{top:100%;transition:none}
|
|
47
47
|
/* src:popup\components\popup-container.vue index:0 */
|