sakura-ui-plus 1.0.4 → 1.0.5

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/es/index.js CHANGED
@@ -2156,7 +2156,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2156
2156
  const message = useMessage();
2157
2157
  const onDrop = (e) => {
2158
2158
  var _a;
2159
- const { showMessage } = props;
2159
+ const { showMessage, disabled } = props;
2160
+ if (disabled) {
2161
+ return;
2162
+ }
2160
2163
  isDragging.value = false;
2161
2164
  const files = (_a = e.dataTransfer) == null ? void 0 : _a.files;
2162
2165
  const fileResult = getFileResult(files);
@@ -2211,7 +2214,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2211
2214
  key: 1,
2212
2215
  class: normalizeClass([
2213
2216
  unref(ns).b(),
2214
- unref(ns).m(__props.type)
2217
+ unref(ns).m(__props.type),
2218
+ unref(ns).is("disabled", __props.disabled)
2215
2219
  ])
2216
2220
  }, [
2217
2221
  createVNode(unref(ElButton), {
package/dist/lib/index.js CHANGED
@@ -2158,7 +2158,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
2158
2158
  const message = useMessage();
2159
2159
  const onDrop = (e) => {
2160
2160
  var _a;
2161
- const { showMessage } = props;
2161
+ const { showMessage, disabled } = props;
2162
+ if (disabled) {
2163
+ return;
2164
+ }
2162
2165
  isDragging.value = false;
2163
2166
  const files = (_a = e.dataTransfer) == null ? void 0 : _a.files;
2164
2167
  const fileResult = getFileResult(files);
@@ -2213,7 +2216,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
2213
2216
  key: 1,
2214
2217
  class: vue.normalizeClass([
2215
2218
  vue.unref(ns).b(),
2216
- vue.unref(ns).m(__props.type)
2219
+ vue.unref(ns).m(__props.type),
2220
+ vue.unref(ns).is("disabled", __props.disabled)
2217
2221
  ])
2218
2222
  }, [
2219
2223
  vue.createVNode(vue.unref(elementPlus.ElButton), {
package/dist/style.css CHANGED
@@ -3869,6 +3869,7 @@
3869
3869
  border: var(--sakura-file-item-border);
3870
3870
  border-radius: var(--sakura-file-item-border-radius);
3871
3871
  cursor: pointer;
3872
+ position: relative;
3872
3873
  }
3873
3874
  .sakura-file-item + .sakura-file-item {
3874
3875
  margin-top: 20px;
@@ -4827,7 +4828,7 @@
4827
4828
  .sakura-upload.is-active {
4828
4829
  border-color: var(--sakura-color-primary);
4829
4830
  }
4830
- .sakura-upload:hover {
4831
+ .sakura-upload:not(.sakura-upload.is-disabled):hover {
4831
4832
  border-color: var(--sakura-color-primary);
4832
4833
  }
4833
4834
  .sakura-upload {
@@ -4923,4 +4924,34 @@
4923
4924
  cursor: pointer;
4924
4925
  width: 200%;
4925
4926
  height: 200%;
4927
+ }
4928
+ .sakura-upload.is-disabled {
4929
+ cursor: not-allowed;
4930
+ }
4931
+ .sakura-upload.is-disabled:after {
4932
+ content: "";
4933
+ width: 100%;
4934
+ height: 100%;
4935
+ position: absolute;
4936
+ left: 0;
4937
+ top: 0;
4938
+ z-index: 9;
4939
+ cursor: not-allowed;
4940
+ }
4941
+ .sakura-upload.is-disabled {
4942
+ /**
4943
+ @at-root使用之后会将另起一行不在进行嵌套
4944
+ .demo {
4945
+ @at-root .a{
4946
+ color: red;
4947
+ }
4948
+ }
4949
+ .demo{}
4950
+ .a{
4951
+ color: red;
4952
+ }
4953
+ */
4954
+ }
4955
+ .sakura-upload.is-disabled .sakura-upload__file {
4956
+ display: none;
4926
4957
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sakura-ui-plus",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "开发常用组件",
5
5
  "type": "module",
6
6
  "sideEffects": [