@deot/vc-components 1.0.50 → 1.0.52
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/index.cjs +108 -16
- package/dist/index.d.ts +80 -28
- package/dist/index.iife.js +4261 -38
- package/dist/index.js +107 -15
- package/dist/index.style.css +1 -1
- package/dist/index.umd.cjs +4261 -38
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -2361,23 +2361,23 @@ const InputNumber = /* @__PURE__ */ defineComponent({
|
|
|
2361
2361
|
...listeners
|
|
2362
2362
|
}), {
|
|
2363
2363
|
prepend: slots.prepend && (() => slots.prepend?.()),
|
|
2364
|
-
append:
|
|
2364
|
+
append: slots.append ? () => slots.append?.() : props.step ? () => {
|
|
2365
2365
|
return createVNode("div", {
|
|
2366
2366
|
"class": "vc-input-number__icon"
|
|
2367
2367
|
}, [createVNode("div", {
|
|
2368
2368
|
"class": "vc-input-number__up",
|
|
2369
|
-
"disabled": plusDisabled.value ? 'disabled' :
|
|
2369
|
+
"disabled": plusDisabled.value ? 'disabled' : void 0,
|
|
2370
2370
|
"onClick": e => handleStepper(e, 1)
|
|
2371
2371
|
}, [createVNode(Icon, {
|
|
2372
2372
|
"type": "up"
|
|
2373
2373
|
}, null)]), createVNode("div", {
|
|
2374
2374
|
"class": "vc-input-number__down",
|
|
2375
|
-
"disabled": minusDisabled.value ? 'disabled' :
|
|
2375
|
+
"disabled": minusDisabled.value ? 'disabled' : void 0,
|
|
2376
2376
|
"onClick": e => handleStepper(e, -1)
|
|
2377
2377
|
}, [createVNode(Icon, {
|
|
2378
2378
|
"type": "down"
|
|
2379
2379
|
}, null)])]);
|
|
2380
|
-
} :
|
|
2380
|
+
} : void 0
|
|
2381
2381
|
});
|
|
2382
2382
|
};
|
|
2383
2383
|
}
|
|
@@ -12092,27 +12092,109 @@ const props$H = {
|
|
|
12092
12092
|
tag: {
|
|
12093
12093
|
type: String,
|
|
12094
12094
|
default: "div"
|
|
12095
|
+
},
|
|
12096
|
+
// useCORS
|
|
12097
|
+
crossOrigin: {
|
|
12098
|
+
type: String,
|
|
12099
|
+
// ''. 'anonymous', 'use-credentials'
|
|
12100
|
+
default: "anonymous",
|
|
12101
|
+
validator: (v) => /^(|anonymous|use-credentials)$/.test(v)
|
|
12102
|
+
},
|
|
12103
|
+
transformSource: Function,
|
|
12104
|
+
// 传递给snap-dom的配置项
|
|
12105
|
+
options: {
|
|
12106
|
+
type: Object,
|
|
12107
|
+
default: () => ({})
|
|
12095
12108
|
}
|
|
12096
12109
|
};
|
|
12097
12110
|
|
|
12098
12111
|
/** @jsxImportSource vue */
|
|
12099
12112
|
|
|
12100
|
-
const COMPONENT_NAME$Z = 'vc-
|
|
12101
|
-
const
|
|
12113
|
+
const COMPONENT_NAME$Z = 'vc-snapshot';
|
|
12114
|
+
const Snapshot = /* @__PURE__ */ defineComponent({
|
|
12102
12115
|
name: COMPONENT_NAME$Z,
|
|
12103
12116
|
props: props$H,
|
|
12117
|
+
emits: ['ready'],
|
|
12104
12118
|
setup(props, {
|
|
12105
|
-
|
|
12119
|
+
emit,
|
|
12120
|
+
slots,
|
|
12121
|
+
expose
|
|
12106
12122
|
}) {
|
|
12123
|
+
const current = ref();
|
|
12124
|
+
const instance = ref();
|
|
12125
|
+
|
|
12126
|
+
// 网络的图片如果没有加上crossOrigin,且没有放在第一个就会出现问题(Safari)
|
|
12127
|
+
const refresh = async () => {
|
|
12128
|
+
if (!props.crossOrigin) return;
|
|
12129
|
+
const transformSource = props.transformSource || VcInstance.options.Snapshot?.transformSource || (v => v);
|
|
12130
|
+
return Promise.all(Array.from(current.value.querySelectorAll('img')).map(node => {
|
|
12131
|
+
return new Promise(resolve => {
|
|
12132
|
+
(async () => {
|
|
12133
|
+
let url;
|
|
12134
|
+
try {
|
|
12135
|
+
url = await transformSource(node.src);
|
|
12136
|
+
} catch (e) {
|
|
12137
|
+
console.error(e);
|
|
12138
|
+
}
|
|
12139
|
+
const image = new Image();
|
|
12140
|
+
image.crossOrigin = props.crossOrigin;
|
|
12141
|
+
image.src = `${url}?=${new Date().getTime()}`; // 强制不缓存
|
|
12142
|
+
image.onload = () => {
|
|
12143
|
+
node.src = image.src;
|
|
12144
|
+
resolve(1);
|
|
12145
|
+
};
|
|
12146
|
+
image.onerror = () => resolve(0);
|
|
12147
|
+
})();
|
|
12148
|
+
});
|
|
12149
|
+
}));
|
|
12150
|
+
};
|
|
12151
|
+
const toDataURL = async () => {
|
|
12152
|
+
await refresh();
|
|
12153
|
+
return instance.value.toRaw();
|
|
12154
|
+
};
|
|
12155
|
+
const download = async options => {
|
|
12156
|
+
await refresh();
|
|
12157
|
+
const _download = VcInstance.options.Snapshot?.download || (() => false);
|
|
12158
|
+
const allow = _download(options);
|
|
12159
|
+
if (allow && allow.then) {
|
|
12160
|
+
allow.catch(() => {
|
|
12161
|
+
instance.value.download(options);
|
|
12162
|
+
});
|
|
12163
|
+
return;
|
|
12164
|
+
}
|
|
12165
|
+
allow || instance.value.download(options);
|
|
12166
|
+
};
|
|
12167
|
+
expose({
|
|
12168
|
+
instance,
|
|
12169
|
+
refresh,
|
|
12170
|
+
toDataURL,
|
|
12171
|
+
download
|
|
12172
|
+
});
|
|
12173
|
+
onMounted(async () => {
|
|
12174
|
+
try {
|
|
12175
|
+
let snapDOM = window.snapdom || (await import('@zumer/snapdom'));
|
|
12176
|
+
snapDOM = snapDOM.snapdom || snapDOM;
|
|
12177
|
+
instance.value = await snapDOM(current.value, props.options);
|
|
12178
|
+
emit('ready', {
|
|
12179
|
+
instance: instance.value,
|
|
12180
|
+
dependencies: {
|
|
12181
|
+
snapDOM
|
|
12182
|
+
}
|
|
12183
|
+
});
|
|
12184
|
+
} catch (e) {
|
|
12185
|
+
throw new VcError('snapshot', e);
|
|
12186
|
+
}
|
|
12187
|
+
});
|
|
12107
12188
|
return () => {
|
|
12108
12189
|
return createVNode("div", {
|
|
12109
|
-
"
|
|
12190
|
+
"ref": current,
|
|
12191
|
+
"class": "vc-snapshot"
|
|
12110
12192
|
}, [slots?.default?.()]);
|
|
12111
12193
|
};
|
|
12112
12194
|
}
|
|
12113
12195
|
});
|
|
12114
12196
|
|
|
12115
|
-
const
|
|
12197
|
+
const MSnapshot = Snapshot;
|
|
12116
12198
|
|
|
12117
12199
|
const MIcon = Icon;
|
|
12118
12200
|
|
|
@@ -15411,6 +15493,7 @@ const Radio = /* @__PURE__ */ defineComponent({
|
|
|
15411
15493
|
checked,
|
|
15412
15494
|
classes,
|
|
15413
15495
|
computedLabel,
|
|
15496
|
+
isDisabled,
|
|
15414
15497
|
handleChange,
|
|
15415
15498
|
handleFocus,
|
|
15416
15499
|
handleBlur
|
|
@@ -15430,7 +15513,7 @@ const Radio = /* @__PURE__ */ defineComponent({
|
|
|
15430
15513
|
}, null)]), createVNode("input", {
|
|
15431
15514
|
"checked": checked.value,
|
|
15432
15515
|
"name": radioName.value,
|
|
15433
|
-
"disabled":
|
|
15516
|
+
"disabled": isDisabled.value,
|
|
15434
15517
|
"type": "radio",
|
|
15435
15518
|
"onChange": handleChange,
|
|
15436
15519
|
"onFocus": handleFocus,
|
|
@@ -15445,7 +15528,11 @@ const Radio = /* @__PURE__ */ defineComponent({
|
|
|
15445
15528
|
const COMPONENT_NAME$x = 'vc-radio-button';
|
|
15446
15529
|
const RadioButton = /* @__PURE__ */ defineComponent({
|
|
15447
15530
|
name: COMPONENT_NAME$x,
|
|
15448
|
-
props:
|
|
15531
|
+
props: {
|
|
15532
|
+
...props$m,
|
|
15533
|
+
labelStyle: [String, Object],
|
|
15534
|
+
labelClass: [String, Object]
|
|
15535
|
+
},
|
|
15449
15536
|
emits: ['update:modelValue', 'change'],
|
|
15450
15537
|
setup(props, {
|
|
15451
15538
|
slots
|
|
@@ -15456,6 +15543,7 @@ const RadioButton = /* @__PURE__ */ defineComponent({
|
|
|
15456
15543
|
checked,
|
|
15457
15544
|
classes,
|
|
15458
15545
|
computedLabel,
|
|
15546
|
+
isDisabled,
|
|
15459
15547
|
handleChange,
|
|
15460
15548
|
handleFocus,
|
|
15461
15549
|
handleBlur
|
|
@@ -15467,12 +15555,15 @@ const RadioButton = /* @__PURE__ */ defineComponent({
|
|
|
15467
15555
|
}, [createVNode("input", {
|
|
15468
15556
|
"checked": checked.value,
|
|
15469
15557
|
"name": radioName.value,
|
|
15470
|
-
"disabled":
|
|
15558
|
+
"disabled": isDisabled.value,
|
|
15471
15559
|
"type": "radio",
|
|
15472
15560
|
"onChange": handleChange,
|
|
15473
15561
|
"onFocus": handleFocus,
|
|
15474
15562
|
"onBlur": handleBlur
|
|
15475
|
-
}, null),
|
|
15563
|
+
}, null), createVNode("span", {
|
|
15564
|
+
"class": [props.labelClass, 'vc-radio-button__label'],
|
|
15565
|
+
"style": props.labelStyle
|
|
15566
|
+
}, [slots.default ? slots.default() : computedLabel.value || ''])]);
|
|
15476
15567
|
};
|
|
15477
15568
|
}
|
|
15478
15569
|
});
|
|
@@ -15586,6 +15677,7 @@ const MRadio = /* @__PURE__ */ defineComponent({
|
|
|
15586
15677
|
checked,
|
|
15587
15678
|
classes,
|
|
15588
15679
|
computedLabel,
|
|
15680
|
+
isDisabled,
|
|
15589
15681
|
handleChange,
|
|
15590
15682
|
handleFocus,
|
|
15591
15683
|
handleBlur
|
|
@@ -15605,7 +15697,7 @@ const MRadio = /* @__PURE__ */ defineComponent({
|
|
|
15605
15697
|
}, null)]), createVNode("input", {
|
|
15606
15698
|
"checked": checked.value,
|
|
15607
15699
|
"name": radioName.value,
|
|
15608
|
-
"disabled":
|
|
15700
|
+
"disabled": isDisabled.value,
|
|
15609
15701
|
"type": "radio",
|
|
15610
15702
|
"onChange": handleChange,
|
|
15611
15703
|
"onFocus": handleFocus,
|
|
@@ -23897,4 +23989,4 @@ const UploadPicker = /* @__PURE__ */ defineComponent({
|
|
|
23897
23989
|
|
|
23898
23990
|
const MUploadPicker = UploadPicker;
|
|
23899
23991
|
|
|
23900
|
-
export { ActionSheet, Affix, Alert, Artboard, Button, ButtonGroup, Calendar, Card, Carousel, Cascader, Chart, Checkbox, CheckboxGroup, Clipboard, Collapse, CollapseItem, ColorPicker, Countdown, Customer, DatePicker, Debounce, Divider, Drawer, DrawerView, Dropdown, DropdownItem, DropdownMenu, Editor, EditorView, Expand$1 as Expand, Form, FormItem, Fragment,
|
|
23992
|
+
export { ActionSheet, Affix, Alert, Artboard, Button, ButtonGroup, Calendar, Card, Carousel, Cascader, Chart, Checkbox, CheckboxGroup, Clipboard, Collapse, CollapseItem, ColorPicker, Countdown, Customer, DatePicker, Debounce, Divider, Drawer, DrawerView, Dropdown, DropdownItem, DropdownMenu, Editor, EditorView, Expand$1 as Expand, Form, FormItem, Fragment, Icon, IconManager, Image$1 as Image, ImageCrop, ImagePreview, ImageProcessing, Input, InputNumber, InputSearch, MList as List, MListItem as ListItem, MActionSheet, MAffix, MAlert, MArtboard, MButton, MButtonGroup, MCalendar, MCard, MCarousel, MCascader, MChart, MCheckbox, MCheckboxGroup, MClipboard, MCollapse, MCollapseItem, MColorPicker, MCountdown, MCustomer, MDatePicker, Debounce as MDebounce, MDivider, MDrawer, MDrawerView, MDropdown, MDropdownItem, MDropdownMenu, MEditor, MEditorView, MExpand, MForm, MFormItem, MFragment, MIcon, MImage, MImageCrop, MImagePreview, MImageProcessing, MInput, MInputNumber, MInputSearch, MList, MListItem, MMarquee, MMessage, modal as MModal, MModalView, MNotice, MOption, MPagination, MPicker, MPopconfirm, MPopover, MPopup, MPortal, MPrint, MProgress, MRadio, MRadioButton, MRadioGroup, MRate, MRecycleList, MResizer, MScroller, MSelect, MSlider, MSnapshot, MSortList, MSpin, MSteps, MSwitch, MTable, MTableColumn, MTabs, MTabsPane, MTag, MText, MTextarea, MTimePicker, MTimeline, MToast, MToastView, MTouch, MTransition, MTransitionCollapse, MTransitionFade, MTransitionScale, MTransitionSlide, MTransitionZoom, MTree, MTreeSelect, MUpload, MUploadPicker, Marquee, Message, MessageView, Modal, ModalView, Notice, NoticeView, Option$1 as Option, Pagination, Picker, Popconfirm, Popover, Popup, Portal, PortalView, Print, Progress, Radio, RadioButton, RadioGroup, Rate, RecycleList, Resizer, Scroller, ScrollerWheel, Select, Slider, Snapshot, SortList, Spin, Steps, Switch, Table, TableColumn, Tabs, TabsPane, Tag, Text, Textarea, Theme, ThemeImage, ThemeText, ThemeView, TimePicker, Timeline, Toast, ToastView, Touch, Transition, TransitionCollapse, TransitionFade, TransitionScale, TransitionSlide, TransitionZoom, Tree, TreeSelect, Upload, UploadPicker, VcError, VcInstance };
|