@qy_better_lib/pc 0.2.20 → 0.2.22

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.
Files changed (162) hide show
  1. package/dist/@qy_better_lib/pc.min.js +1 -1
  2. package/lib/contextMenu/src/index.vue.js +104 -0
  3. package/lib/contextMenu/src/index.vue2.js +4 -0
  4. package/lib/describeView/src/index.vue.js +81 -0
  5. package/lib/describeView/src/index.vue2.js +4 -0
  6. package/lib/simpleVirtualList/src/index.vue.js +84 -0
  7. package/lib/simpleVirtualList/src/index.vue2.js +4 -0
  8. package/lib/tableExtend/src/colVisible.vue.js +103 -0
  9. package/lib/tableExtend/src/colVisible.vue2.js +4 -0
  10. package/lib/tableExtend/src/index.vue.js +220 -0
  11. package/lib/tableExtend/src/index.vue2.js +4 -0
  12. package/lib/tableExtend/src/valueCol.vue.js +26 -0
  13. package/lib/tableExtend/src/valueCol.vue2.js +4 -0
  14. package/lib/textButton/src/index.vue.js +56 -0
  15. package/lib/textButton/src/index.vue2.js +4 -0
  16. package/lib/utils/index.d.ts +1 -1
  17. package/lib/utils/index.js +80 -0
  18. package/package.json +1 -1
  19. package/lib/node_modules/@ctrl/tinycolor/dist/module/conversion.js +0 -115
  20. package/lib/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js +0 -153
  21. package/lib/node_modules/@ctrl/tinycolor/dist/module/format-input.js +0 -68
  22. package/lib/node_modules/@ctrl/tinycolor/dist/module/index.js +0 -183
  23. package/lib/node_modules/@ctrl/tinycolor/dist/module/util.js +0 -32
  24. package/lib/node_modules/@element-plus/icons-vue/dist/index.js +0 -167
  25. package/lib/node_modules/@vue/shared/dist/shared.esm-bundler.js +0 -22
  26. package/lib/node_modules/@vueuse/core/index.js +0 -112
  27. package/lib/node_modules/@vueuse/shared/index.js +0 -68
  28. package/lib/node_modules/element-plus/es/_virtual/plugin-vue_export-helper.js +0 -9
  29. package/lib/node_modules/element-plus/es/components/badge/index.js +0 -7
  30. package/lib/node_modules/element-plus/es/components/button/index.js +0 -11
  31. package/lib/node_modules/element-plus/es/components/icon/index.js +0 -7
  32. package/lib/node_modules/element-plus/es/components/input/index.js +0 -7
  33. package/lib/node_modules/element-plus/es/components/message/index.js +0 -7
  34. package/lib/node_modules/element-plus/es/components/message-box/index.js +0 -10
  35. package/lib/node_modules/element-plus/es/components/notification/index.js +0 -7
  36. package/lib/node_modules/element-plus/es/components/overlay/index.js +0 -9
  37. package/lib/node_modules/element-plus/es/constants/aria.js +0 -9
  38. package/lib/node_modules/element-plus/es/constants/event.js +0 -6
  39. package/lib/node_modules/element-plus/es/constants/size.js +0 -4
  40. package/lib/node_modules/element-plus/es/directives/trap-focus/index.js +0 -32
  41. package/lib/node_modules/element-plus/es/hooks/use-aria/index.js +0 -14
  42. package/lib/node_modules/element-plus/es/hooks/use-attrs/index.js +0 -12
  43. package/lib/node_modules/element-plus/es/hooks/use-composition/index.js +0 -29
  44. package/lib/node_modules/element-plus/es/hooks/use-cursor/index.js +0 -39
  45. package/lib/node_modules/element-plus/es/hooks/use-deprecated/index.js +0 -10
  46. package/lib/node_modules/element-plus/es/hooks/use-draggable/index.js +0 -45
  47. package/lib/node_modules/element-plus/es/hooks/use-empty-values/index.js +0 -20
  48. package/lib/node_modules/element-plus/es/hooks/use-escape-keydown/index.js +0 -16
  49. package/lib/node_modules/element-plus/es/hooks/use-focus-controller/index.js +0 -34
  50. package/lib/node_modules/element-plus/es/hooks/use-id/index.js +0 -15
  51. package/lib/node_modules/element-plus/es/hooks/use-locale/index.js +0 -24
  52. package/lib/node_modules/element-plus/es/hooks/use-lockscreen/index.js +0 -30
  53. package/lib/node_modules/element-plus/es/hooks/use-namespace/index.js +0 -44
  54. package/lib/node_modules/element-plus/es/hooks/use-prop/index.js +0 -11
  55. package/lib/node_modules/element-plus/es/hooks/use-same-target/index.js +0 -16
  56. package/lib/node_modules/element-plus/es/hooks/use-size/index.js +0 -16
  57. package/lib/node_modules/element-plus/es/hooks/use-z-index/index.js +0 -22
  58. package/lib/node_modules/element-plus/es/locale/lang/en.js +0 -182
  59. package/lib/node_modules/element-plus/es/utils/browser.js +0 -6
  60. package/lib/node_modules/element-plus/es/utils/dom/aria.js +0 -29
  61. package/lib/node_modules/element-plus/es/utils/dom/scroll.js +0 -20
  62. package/lib/node_modules/element-plus/es/utils/dom/style.js +0 -45
  63. package/lib/node_modules/element-plus/es/utils/error.js +0 -14
  64. package/lib/node_modules/element-plus/es/utils/i18n.js +0 -4
  65. package/lib/node_modules/element-plus/es/utils/objects.js +0 -4
  66. package/lib/node_modules/element-plus/es/utils/types.js +0 -13
  67. package/lib/node_modules/element-plus/es/utils/typescript.js +0 -4
  68. package/lib/node_modules/element-plus/es/utils/vue/icon.js +0 -29
  69. package/lib/node_modules/element-plus/es/utils/vue/install.js +0 -17
  70. package/lib/node_modules/element-plus/es/utils/vue/props/runtime.js +0 -31
  71. package/lib/node_modules/element-plus/es/utils/vue/validator.js +0 -5
  72. package/lib/node_modules/element-plus/es/utils/vue/vnode.js +0 -5
  73. package/lib/node_modules/lodash-es/_Hash.js +0 -20
  74. package/lib/node_modules/lodash-es/_ListCache.js +0 -20
  75. package/lib/node_modules/lodash-es/_Map.js +0 -6
  76. package/lib/node_modules/lodash-es/_MapCache.js +0 -20
  77. package/lib/node_modules/lodash-es/_Symbol.js +0 -5
  78. package/lib/node_modules/lodash-es/_apply.js +0 -16
  79. package/lib/node_modules/lodash-es/_arrayMap.js +0 -8
  80. package/lib/node_modules/lodash-es/_arrayPush.js +0 -8
  81. package/lib/node_modules/lodash-es/_assignValue.js +0 -10
  82. package/lib/node_modules/lodash-es/_assocIndexOf.js +0 -10
  83. package/lib/node_modules/lodash-es/_baseAssignValue.js +0 -12
  84. package/lib/node_modules/lodash-es/_baseFlatten.js +0 -13
  85. package/lib/node_modules/lodash-es/_baseGet.js +0 -11
  86. package/lib/node_modules/lodash-es/_baseGetTag.js +0 -10
  87. package/lib/node_modules/lodash-es/_baseHasIn.js +0 -6
  88. package/lib/node_modules/lodash-es/_baseIsArguments.js +0 -9
  89. package/lib/node_modules/lodash-es/_baseIsNative.js +0 -16
  90. package/lib/node_modules/lodash-es/_basePick.js +0 -10
  91. package/lib/node_modules/lodash-es/_basePickBy.js +0 -13
  92. package/lib/node_modules/lodash-es/_baseSet.js +0 -24
  93. package/lib/node_modules/lodash-es/_baseSetToString.js +0 -14
  94. package/lib/node_modules/lodash-es/_baseToString.js +0 -18
  95. package/lib/node_modules/lodash-es/_castPath.js +0 -10
  96. package/lib/node_modules/lodash-es/_coreJsData.js +0 -5
  97. package/lib/node_modules/lodash-es/_defineProperty.js +0 -11
  98. package/lib/node_modules/lodash-es/_flatRest.js +0 -9
  99. package/lib/node_modules/lodash-es/_freeGlobal.js +0 -4
  100. package/lib/node_modules/lodash-es/_getMapData.js +0 -8
  101. package/lib/node_modules/lodash-es/_getNative.js +0 -9
  102. package/lib/node_modules/lodash-es/_getRawTag.js +0 -15
  103. package/lib/node_modules/lodash-es/_getValue.js +0 -6
  104. package/lib/node_modules/lodash-es/_hasPath.js +0 -19
  105. package/lib/node_modules/lodash-es/_hashClear.js +0 -7
  106. package/lib/node_modules/lodash-es/_hashDelete.js +0 -7
  107. package/lib/node_modules/lodash-es/_hashGet.js +0 -13
  108. package/lib/node_modules/lodash-es/_hashHas.js +0 -9
  109. package/lib/node_modules/lodash-es/_hashSet.js +0 -9
  110. package/lib/node_modules/lodash-es/_isFlattenable.js +0 -10
  111. package/lib/node_modules/lodash-es/_isIndex.js +0 -8
  112. package/lib/node_modules/lodash-es/_isKey.js +0 -12
  113. package/lib/node_modules/lodash-es/_isKeyable.js +0 -7
  114. package/lib/node_modules/lodash-es/_isMasked.js +0 -11
  115. package/lib/node_modules/lodash-es/_listCacheClear.js +0 -6
  116. package/lib/node_modules/lodash-es/_listCacheDelete.js +0 -12
  117. package/lib/node_modules/lodash-es/_listCacheGet.js +0 -8
  118. package/lib/node_modules/lodash-es/_listCacheHas.js +0 -7
  119. package/lib/node_modules/lodash-es/_listCacheSet.js +0 -8
  120. package/lib/node_modules/lodash-es/_mapCacheClear.js +0 -13
  121. package/lib/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  122. package/lib/node_modules/lodash-es/_mapCacheGet.js +0 -7
  123. package/lib/node_modules/lodash-es/_mapCacheHas.js +0 -7
  124. package/lib/node_modules/lodash-es/_mapCacheSet.js +0 -8
  125. package/lib/node_modules/lodash-es/_memoizeCapped.js +0 -11
  126. package/lib/node_modules/lodash-es/_nativeCreate.js +0 -5
  127. package/lib/node_modules/lodash-es/_objectToString.js +0 -7
  128. package/lib/node_modules/lodash-es/_overRest.js +0 -15
  129. package/lib/node_modules/lodash-es/_root.js +0 -5
  130. package/lib/node_modules/lodash-es/_setToString.js +0 -6
  131. package/lib/node_modules/lodash-es/_shortOut.js +0 -16
  132. package/lib/node_modules/lodash-es/_stringToPath.js +0 -10
  133. package/lib/node_modules/lodash-es/_toKey.js +0 -10
  134. package/lib/node_modules/lodash-es/_toSource.js +0 -17
  135. package/lib/node_modules/lodash-es/constant.js +0 -8
  136. package/lib/node_modules/lodash-es/eq.js +0 -6
  137. package/lib/node_modules/lodash-es/flatten.js +0 -8
  138. package/lib/node_modules/lodash-es/fromPairs.js +0 -10
  139. package/lib/node_modules/lodash-es/get.js +0 -8
  140. package/lib/node_modules/lodash-es/hasIn.js +0 -8
  141. package/lib/node_modules/lodash-es/identity.js +0 -6
  142. package/lib/node_modules/lodash-es/isArguments.js +0 -10
  143. package/lib/node_modules/lodash-es/isArray.js +0 -4
  144. package/lib/node_modules/lodash-es/isFunction.js +0 -12
  145. package/lib/node_modules/lodash-es/isLength.js +0 -7
  146. package/lib/node_modules/lodash-es/isNil.js +0 -6
  147. package/lib/node_modules/lodash-es/isObject.js +0 -7
  148. package/lib/node_modules/lodash-es/isObjectLike.js +0 -6
  149. package/lib/node_modules/lodash-es/isSymbol.js +0 -9
  150. package/lib/node_modules/lodash-es/memoize.js +0 -18
  151. package/lib/node_modules/lodash-es/pick.js +0 -8
  152. package/lib/node_modules/lodash-es/toString.js +0 -7
  153. package/lib/src/utils/index.js +0 -82
  154. /package/lib/{src/contextMenu → contextMenu}/index.js +0 -0
  155. /package/lib/{src/describeView → describeView}/index.js +0 -0
  156. /package/lib/{src/index.js → index.js} +0 -0
  157. /package/lib/{src/simpleVirtualList → simpleVirtualList}/index.js +0 -0
  158. /package/lib/{src/tableExtend → tableExtend}/index.js +0 -0
  159. /package/lib/{src/tableExtend → tableExtend}/props.js +0 -0
  160. /package/lib/{src/tableExtend → tableExtend}/type.js +0 -0
  161. /package/lib/{src/tableExtend → tableExtend}/useTable.js +0 -0
  162. /package/lib/{src/textButton → textButton}/index.js +0 -0
@@ -0,0 +1,220 @@
1
+ import { defineComponent as J, provide as K, toRef as Q, ref as _, watch as w, onMounted as W, nextTick as X, resolveComponent as h, resolveDirective as Y, createElementBlock as c, openBlock as o, createCommentVNode as a, renderSlot as n, unref as l, createElementVNode as m, createBlock as r, withDirectives as Z, mergeProps as C, withCtx as f, Fragment as $, renderList as ee, createTextVNode as te, toDisplayString as oe, createVNode as R } from "vue";
2
+ import { useI18n as le } from "vue-i18n";
3
+ import ne from "../useTable.js";
4
+ import ae from "../props.js";
5
+ import re from "./valueCol.vue.js";
6
+ import se from "./colVisible.vue.js";
7
+ const ie = {
8
+ key: 0,
9
+ class: "tool-panel"
10
+ }, de = { class: "left-panel" }, ue = { class: "right-panel" }, pe = { class: "default-tool" }, ce = ["innerHTML"], fe = {
11
+ key: 0,
12
+ class: "required-ident"
13
+ }, ge = {
14
+ key: 1,
15
+ class: "table-bottom"
16
+ }, me = { class: "left" }, we = /* @__PURE__ */ J({
17
+ __name: "index",
18
+ props: { ...ae() },
19
+ emits: [
20
+ "tableSort",
21
+ "handleSelectionChange",
22
+ "currentChange",
23
+ "pageSizeChange",
24
+ "rowClick",
25
+ "rowDblClick"
26
+ ],
27
+ setup(T, { expose: D, emit: P }) {
28
+ const s = T, u = P, { t: I } = le(), {
29
+ selectionOptions: y,
30
+ tableAttribute: L,
31
+ pagination: i,
32
+ hasPagination: v,
33
+ columnConfig: S,
34
+ colSettingList: x,
35
+ showToolPanel: N,
36
+ showBottomPanel: B,
37
+ auto_size: z
38
+ } = ne(I);
39
+ K("table-extend", {
40
+ tableProps: s,
41
+ tableColums: Q(s, "tableColums"),
42
+ columnConfig: S
43
+ });
44
+ const E = _(), p = _(null), k = _(!1);
45
+ w(
46
+ () => s.tableColums,
47
+ () => {
48
+ S.showColumn = s.tableColums;
49
+ }
50
+ ), w(
51
+ () => i.pageIndex,
52
+ (e) => {
53
+ if (e && e > 0) {
54
+ if (k.value) {
55
+ k.value = !1;
56
+ return;
57
+ }
58
+ u("currentChange", e), p.value?.setScrollTop(0);
59
+ }
60
+ }
61
+ ), w(
62
+ () => i.pageSize,
63
+ (e) => {
64
+ e && e > 0 && (k.value = !0, i.pageIndex = 1, u("pageSizeChange", e), p.value?.setScrollTop(0));
65
+ }
66
+ ), W(() => {
67
+ X(() => {
68
+ s.tableColums && s.tableColums.length > 0 && (S.showColumn = s.tableColums);
69
+ }).then(() => {
70
+ });
71
+ }), D({
72
+ clearSelection: U,
73
+ toggleRowSelection: j,
74
+ table: p
75
+ });
76
+ function V(e) {
77
+ u("tableSort", {
78
+ sortName: e.prop,
79
+ sortType: e.order === "descending" ? "desc" : e.order === "ascending" ? "asc" : ""
80
+ });
81
+ }
82
+ function H(e) {
83
+ y.rows = e, y.count = e && e.length, u("handleSelectionChange", e);
84
+ }
85
+ function M(e) {
86
+ u("rowClick", e);
87
+ }
88
+ function q(e) {
89
+ u("rowDblClick", e);
90
+ }
91
+ function U() {
92
+ p.value?.clearSelection();
93
+ }
94
+ function j(e) {
95
+ p.value?.toggleRowSelection(e);
96
+ }
97
+ return (e, b) => {
98
+ const g = h("el-table-column"), A = h("el-empty"), F = h("el-table"), O = h("el-pagination"), G = Y("loading");
99
+ return o(), c("div", {
100
+ class: "table-extend",
101
+ ref_key: "tableExtendRef",
102
+ ref: E
103
+ }, [
104
+ l(N) ? (o(), c("div", ie, [
105
+ m("div", de, [
106
+ n(e.$slots, "tool-left")
107
+ ]),
108
+ m("div", ue, [
109
+ n(e.$slots, "tool-right"),
110
+ m("div", pe, [
111
+ e.isSetColumn ? (o(), r(se, { key: 0 })) : a("", !0)
112
+ ])
113
+ ])
114
+ ])) : a("", !0),
115
+ n(e.$slots, "default", {}, () => [
116
+ Z((o(), r(F, C({
117
+ ref_key: "tableRef",
118
+ ref: p
119
+ }, l(L), {
120
+ data: e.tableData,
121
+ onSortChange: V,
122
+ onSelectionChange: H,
123
+ onRowClick: M,
124
+ onRowDblclick: q
125
+ }), {
126
+ empty: f(() => [
127
+ n(e.$slots, "empty", {}, () => [
128
+ R(A, { "image-size": 60 })
129
+ ])
130
+ ]),
131
+ default: f(() => [
132
+ e.selectionCol ? (o(), r(g, {
133
+ key: 0,
134
+ type: "selection",
135
+ width: e.autoSize ? l(z)(50) : 50,
136
+ fixed: "left"
137
+ }, null, 8, ["width"])) : a("", !0),
138
+ e.indexCol ? (o(), r(g, {
139
+ key: 1,
140
+ type: "index",
141
+ label: "序号",
142
+ width: e.autoSize ? l(z)(60) : 60,
143
+ fixed: "left"
144
+ }, null, 8, ["width"])) : a("", !0),
145
+ e.expand ? (o(), r(g, {
146
+ key: 2,
147
+ type: "expand"
148
+ }, {
149
+ default: f(({ row: t, $index: d }) => [
150
+ n(e.$slots, "expand", {
151
+ index: d,
152
+ data: t
153
+ })
154
+ ]),
155
+ _: 3
156
+ })) : a("", !0),
157
+ (o(!0), c($, null, ee(l(x), (t) => (o(), c($, {
158
+ key: t.prop
159
+ }, [
160
+ t.isHtml ? (o(), r(g, C({
161
+ key: 0,
162
+ ref_for: !0
163
+ }, t), {
164
+ default: f((d) => [
165
+ m("div", {
166
+ innerHTML: t.prop && d.row[t.prop]
167
+ }, null, 8, ce)
168
+ ]),
169
+ _: 2
170
+ }, 1040)) : (o(), r(g, C({
171
+ key: 1,
172
+ ref_for: !0
173
+ }, t), {
174
+ default: f((d) => [
175
+ n(e.$slots, `col_${t.prop}`, {
176
+ index: d.$index,
177
+ data: d.row
178
+ }, () => [
179
+ R(re, C({ ref_for: !0 }, { row: d.row, colCfg: t }), null, 16)
180
+ ])
181
+ ]),
182
+ header: f(() => [
183
+ n(e.$slots, `header_${t.prop}`, { data: t }, () => [
184
+ t.required ? (o(), c("span", fe, "*")) : a("", !0),
185
+ te(" " + oe(t.label), 1)
186
+ ])
187
+ ]),
188
+ _: 2
189
+ }, 1040))
190
+ ], 64))), 128)),
191
+ n(e.$slots, "operatColumn")
192
+ ]),
193
+ _: 3
194
+ }, 16, ["data"])), [
195
+ [G, e.tableLoading]
196
+ ])
197
+ ]),
198
+ l(B) || l(v) ? (o(), c("div", ge, [
199
+ m("div", me, [
200
+ n(e.$slots, "bottom-left")
201
+ ]),
202
+ l(v) ? (o(), r(O, {
203
+ key: 0,
204
+ "current-page": l(i).pageIndex,
205
+ "onUpdate:currentPage": b[0] || (b[0] = (t) => l(i).pageIndex = t),
206
+ "page-size": l(i).pageSize,
207
+ "onUpdate:pageSize": b[1] || (b[1] = (t) => l(i).pageSize = t),
208
+ "page-sizes": e.sizeList,
209
+ layout: "total,prev,pager,next,sizes,jumper",
210
+ total: e.total,
211
+ background: ""
212
+ }, null, 8, ["current-page", "page-size", "page-sizes", "total"])) : a("", !0)
213
+ ])) : a("", !0)
214
+ ], 512);
215
+ };
216
+ }
217
+ });
218
+ export {
219
+ we as default
220
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,26 @@
1
+ import { defineComponent as l, computed as p, createElementBlock as r, openBlock as a, toDisplayString as u } from "vue";
2
+ const f = /* @__PURE__ */ l({
3
+ __name: "valueCol",
4
+ props: {
5
+ row: {
6
+ type: Object,
7
+ default: () => {
8
+ }
9
+ },
10
+ colCfg: {
11
+ type: Object,
12
+ default: () => {
13
+ }
14
+ }
15
+ },
16
+ setup(n) {
17
+ const c = n, e = p(() => {
18
+ const { row: o, colCfg: t } = c;
19
+ return o[t.prop];
20
+ });
21
+ return (o, t) => (a(), r("span", null, u(e.value != null ? e.value : "--"), 1));
22
+ }
23
+ });
24
+ export {
25
+ f as default
26
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./valueCol.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,56 @@
1
+ import { defineComponent as s, resolveComponent as d, createElementBlock as m, openBlock as o, normalizeClass as u, createBlock as i, createCommentVNode as p, createElementVNode as f, withCtx as b, resolveDynamicComponent as k, withModifiers as x, renderSlot as C } from "vue";
2
+ const B = /* @__PURE__ */ s({
3
+ name: "TextButton",
4
+ __name: "index",
5
+ props: {
6
+ type: {
7
+ type: String,
8
+ default: "primary",
9
+ validator: (e) => [
10
+ "default",
11
+ "primary",
12
+ "success",
13
+ "warning",
14
+ "info",
15
+ "danger"
16
+ ].includes(e)
17
+ },
18
+ icon: String,
19
+ disabled: Boolean
20
+ },
21
+ emits: ["click"],
22
+ setup(e, { emit: c }) {
23
+ const t = e, r = c;
24
+ function l(n) {
25
+ t.disabled || r("click", n);
26
+ }
27
+ return (n, y) => {
28
+ const a = d("el-icon");
29
+ return o(), m("div", {
30
+ class: u(["text-button", [
31
+ `text-button-${e.type}`,
32
+ e.disabled && "is-disabled"
33
+ ]])
34
+ }, [
35
+ t.icon ? (o(), i(a, {
36
+ key: 0,
37
+ class: "text-button-icon"
38
+ }, {
39
+ default: b(() => [
40
+ (o(), i(k(t.icon)))
41
+ ]),
42
+ _: 1
43
+ })) : p("", !0),
44
+ f("div", {
45
+ class: "text-button-inner",
46
+ onClick: x(l, ["prevent"])
47
+ }, [
48
+ C(n.$slots, "default")
49
+ ])
50
+ ], 2);
51
+ };
52
+ }
53
+ });
54
+ export {
55
+ B as default
56
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -14,7 +14,7 @@ export declare function confirmBox(str: string, callback: () => any | void, opti
14
14
  * @param options MessageBox配置项,参考element-plus文档
15
15
  * @returns
16
16
  */
17
- export declare function confirmBoxAsync(str: string, callback: () => any | void, options?: any, cancelCallback?: () => any | void): Promise<any>;
17
+ export declare function confirmBoxAsync(str: string, callback: () => any | void, options?: any, cancelCallback?: (action: "confirm" | "cancel" | "close") => any | void): Promise<any>;
18
18
  /**
19
19
  * 消息提示
20
20
  * @export
@@ -0,0 +1,80 @@
1
+ import { ElMessage as a, ElMessageBox as u, ElNotification as m } from "element-plus";
2
+ function x(o, n, e = !0, t = "") {
3
+ switch (n) {
4
+ case "toast":
5
+ g(
6
+ e ? "success" : "error",
7
+ o || (e ? "执行成功" : "执行失败")
8
+ );
9
+ break;
10
+ case "dialog":
11
+ h(o || (e ? "执行成功" : "执行失败"), () => {
12
+ }, {
13
+ title: t || "提示",
14
+ type: e ? "success" : "error",
15
+ "show-cancel-button": !1
16
+ });
17
+ break;
18
+ case "notif":
19
+ l(e ? "success" : "error", t || "消息提示", o);
20
+ break;
21
+ }
22
+ }
23
+ function y(o, n, e) {
24
+ const t = {
25
+ beforeClose: (r, s, i) => {
26
+ r === "confirm" ? setTimeout(() => {
27
+ i();
28
+ }, 0) : i();
29
+ },
30
+ ...e
31
+ };
32
+ u.confirm(`此操作将${o}, 是否继续?`, "提示", t).then(async () => {
33
+ n && n();
34
+ }).catch(() => {
35
+ });
36
+ }
37
+ function h(o, n, e, t) {
38
+ return new Promise((r, s) => {
39
+ const i = {
40
+ beforeClose: (c, p, f) => {
41
+ c === "confirm" ? setTimeout(() => {
42
+ f();
43
+ }, 0) : f();
44
+ },
45
+ ...e
46
+ };
47
+ u.confirm(`${o}`, "Tip", i).then(() => {
48
+ r(n && n());
49
+ }).catch((c) => {
50
+ r(t ? t(c) : !1);
51
+ });
52
+ });
53
+ }
54
+ function g(o, n = "", e = !1, t = 3e3) {
55
+ a({
56
+ showClose: !0,
57
+ message: n,
58
+ type: o,
59
+ duration: t,
60
+ dangerouslyUseHTMLString: e
61
+ });
62
+ }
63
+ function l(o, n = "", e = "", t = !0, r = "bottom-right", s = 3e3) {
64
+ m({
65
+ title: n,
66
+ message: e,
67
+ type: o,
68
+ dangerouslyUseHTMLString: t,
69
+ duration: s,
70
+ showClose: !0,
71
+ position: r
72
+ });
73
+ }
74
+ export {
75
+ y as confirmBox,
76
+ h as confirmBoxAsync,
77
+ g as messageAlert,
78
+ x as messageBox,
79
+ l as notification
80
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qy_better_lib/pc",
3
3
  "private": false,
4
- "version": "0.2.20",
4
+ "version": "0.2.22",
5
5
  "description": "qy better lib pc compontens",
6
6
  "author": "luhuiming",
7
7
  "license": "ISC",
@@ -1,115 +0,0 @@
1
- import { bound01 as u, pad2 as f } from "./util.js";
2
- function T(t, a, r) {
3
- return {
4
- r: u(t, 255) * 255,
5
- g: u(a, 255) * 255,
6
- b: u(r, 255) * 255
7
- };
8
- }
9
- function g(t, a, r) {
10
- t = u(t, 255), a = u(a, 255), r = u(r, 255);
11
- var i = Math.max(t, a, r), e = Math.min(t, a, r), n = 0, c = 0, o = (i + e) / 2;
12
- if (i === e)
13
- c = 0, n = 0;
14
- else {
15
- var h = i - e;
16
- switch (c = o > 0.5 ? h / (2 - i - e) : h / (i + e), i) {
17
- case t:
18
- n = (a - r) / h + (a < r ? 6 : 0);
19
- break;
20
- case a:
21
- n = (r - t) / h + 2;
22
- break;
23
- case r:
24
- n = (t - a) / h + 4;
25
- break;
26
- }
27
- n /= 6;
28
- }
29
- return { h: n, s: c, l: o };
30
- }
31
- function s(t, a, r) {
32
- return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (a - t) * (6 * r) : r < 1 / 2 ? a : r < 2 / 3 ? t + (a - t) * (2 / 3 - r) * 6 : t;
33
- }
34
- function d(t, a, r) {
35
- var i, e, n;
36
- if (t = u(t, 360), a = u(a, 100), r = u(r, 100), a === 0)
37
- e = r, n = r, i = r;
38
- else {
39
- var c = r < 0.5 ? r * (1 + a) : r + a - r * a, o = 2 * r - c;
40
- i = s(o, c, t + 1 / 3), e = s(o, c, t), n = s(o, c, t - 1 / 3);
41
- }
42
- return { r: i * 255, g: e * 255, b: n * 255 };
43
- }
44
- function H(t, a, r) {
45
- t = u(t, 255), a = u(a, 255), r = u(r, 255);
46
- var i = Math.max(t, a, r), e = Math.min(t, a, r), n = 0, c = i, o = i - e, h = i === 0 ? 0 : o / i;
47
- if (i === e)
48
- n = 0;
49
- else {
50
- switch (i) {
51
- case t:
52
- n = (a - r) / o + (a < r ? 6 : 0);
53
- break;
54
- case a:
55
- n = (r - t) / o + 2;
56
- break;
57
- case r:
58
- n = (t - a) / o + 4;
59
- break;
60
- }
61
- n /= 6;
62
- }
63
- return { h: n, s: h, v: c };
64
- }
65
- function S(t, a, r) {
66
- t = u(t, 360) * 6, a = u(a, 100), r = u(r, 100);
67
- var i = Math.floor(t), e = t - i, n = r * (1 - a), c = r * (1 - e * a), o = r * (1 - (1 - e) * a), h = i % 6, v = [r, c, n, n, o, r][h], m = [o, r, r, c, n, n][h], x = [n, n, o, r, r, c][h];
68
- return { r: v * 255, g: m * 255, b: x * 255 };
69
- }
70
- function W(t, a, r, i) {
71
- var e = [
72
- f(Math.round(t).toString(16)),
73
- f(Math.round(a).toString(16)),
74
- f(Math.round(r).toString(16))
75
- ];
76
- return i && e[0].startsWith(e[0].charAt(1)) && e[1].startsWith(e[1].charAt(1)) && e[2].startsWith(e[2].charAt(1)) ? e[0].charAt(0) + e[1].charAt(0) + e[2].charAt(0) : e.join("");
77
- }
78
- function k(t, a, r, i, e) {
79
- var n = [
80
- f(Math.round(t).toString(16)),
81
- f(Math.round(a).toString(16)),
82
- f(Math.round(r).toString(16)),
83
- f(A(i))
84
- ];
85
- return e && n[0].startsWith(n[0].charAt(1)) && n[1].startsWith(n[1].charAt(1)) && n[2].startsWith(n[2].charAt(1)) && n[3].startsWith(n[3].charAt(1)) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) + n[3].charAt(0) : n.join("");
86
- }
87
- function A(t) {
88
- return Math.round(parseFloat(t) * 255).toString(16);
89
- }
90
- function j(t) {
91
- return M(t) / 255;
92
- }
93
- function M(t) {
94
- return parseInt(t, 16);
95
- }
96
- function I(t) {
97
- return {
98
- r: t >> 16,
99
- g: (t & 65280) >> 8,
100
- b: t & 255
101
- };
102
- }
103
- export {
104
- A as convertDecimalToHex,
105
- j as convertHexToDecimal,
106
- d as hslToRgb,
107
- S as hsvToRgb,
108
- I as numberInputToObject,
109
- M as parseIntFromHex,
110
- W as rgbToHex,
111
- g as rgbToHsl,
112
- H as rgbToHsv,
113
- T as rgbToRgb,
114
- k as rgbaToHex
115
- };
@@ -1,153 +0,0 @@
1
- var e = {
2
- aliceblue: "#f0f8ff",
3
- antiquewhite: "#faebd7",
4
- aqua: "#00ffff",
5
- aquamarine: "#7fffd4",
6
- azure: "#f0ffff",
7
- beige: "#f5f5dc",
8
- bisque: "#ffe4c4",
9
- black: "#000000",
10
- blanchedalmond: "#ffebcd",
11
- blue: "#0000ff",
12
- blueviolet: "#8a2be2",
13
- brown: "#a52a2a",
14
- burlywood: "#deb887",
15
- cadetblue: "#5f9ea0",
16
- chartreuse: "#7fff00",
17
- chocolate: "#d2691e",
18
- coral: "#ff7f50",
19
- cornflowerblue: "#6495ed",
20
- cornsilk: "#fff8dc",
21
- crimson: "#dc143c",
22
- cyan: "#00ffff",
23
- darkblue: "#00008b",
24
- darkcyan: "#008b8b",
25
- darkgoldenrod: "#b8860b",
26
- darkgray: "#a9a9a9",
27
- darkgreen: "#006400",
28
- darkgrey: "#a9a9a9",
29
- darkkhaki: "#bdb76b",
30
- darkmagenta: "#8b008b",
31
- darkolivegreen: "#556b2f",
32
- darkorange: "#ff8c00",
33
- darkorchid: "#9932cc",
34
- darkred: "#8b0000",
35
- darksalmon: "#e9967a",
36
- darkseagreen: "#8fbc8f",
37
- darkslateblue: "#483d8b",
38
- darkslategray: "#2f4f4f",
39
- darkslategrey: "#2f4f4f",
40
- darkturquoise: "#00ced1",
41
- darkviolet: "#9400d3",
42
- deeppink: "#ff1493",
43
- deepskyblue: "#00bfff",
44
- dimgray: "#696969",
45
- dimgrey: "#696969",
46
- dodgerblue: "#1e90ff",
47
- firebrick: "#b22222",
48
- floralwhite: "#fffaf0",
49
- forestgreen: "#228b22",
50
- fuchsia: "#ff00ff",
51
- gainsboro: "#dcdcdc",
52
- ghostwhite: "#f8f8ff",
53
- goldenrod: "#daa520",
54
- gold: "#ffd700",
55
- gray: "#808080",
56
- green: "#008000",
57
- greenyellow: "#adff2f",
58
- grey: "#808080",
59
- honeydew: "#f0fff0",
60
- hotpink: "#ff69b4",
61
- indianred: "#cd5c5c",
62
- indigo: "#4b0082",
63
- ivory: "#fffff0",
64
- khaki: "#f0e68c",
65
- lavenderblush: "#fff0f5",
66
- lavender: "#e6e6fa",
67
- lawngreen: "#7cfc00",
68
- lemonchiffon: "#fffacd",
69
- lightblue: "#add8e6",
70
- lightcoral: "#f08080",
71
- lightcyan: "#e0ffff",
72
- lightgoldenrodyellow: "#fafad2",
73
- lightgray: "#d3d3d3",
74
- lightgreen: "#90ee90",
75
- lightgrey: "#d3d3d3",
76
- lightpink: "#ffb6c1",
77
- lightsalmon: "#ffa07a",
78
- lightseagreen: "#20b2aa",
79
- lightskyblue: "#87cefa",
80
- lightslategray: "#778899",
81
- lightslategrey: "#778899",
82
- lightsteelblue: "#b0c4de",
83
- lightyellow: "#ffffe0",
84
- lime: "#00ff00",
85
- limegreen: "#32cd32",
86
- linen: "#faf0e6",
87
- magenta: "#ff00ff",
88
- maroon: "#800000",
89
- mediumaquamarine: "#66cdaa",
90
- mediumblue: "#0000cd",
91
- mediumorchid: "#ba55d3",
92
- mediumpurple: "#9370db",
93
- mediumseagreen: "#3cb371",
94
- mediumslateblue: "#7b68ee",
95
- mediumspringgreen: "#00fa9a",
96
- mediumturquoise: "#48d1cc",
97
- mediumvioletred: "#c71585",
98
- midnightblue: "#191970",
99
- mintcream: "#f5fffa",
100
- mistyrose: "#ffe4e1",
101
- moccasin: "#ffe4b5",
102
- navajowhite: "#ffdead",
103
- navy: "#000080",
104
- oldlace: "#fdf5e6",
105
- olive: "#808000",
106
- olivedrab: "#6b8e23",
107
- orange: "#ffa500",
108
- orangered: "#ff4500",
109
- orchid: "#da70d6",
110
- palegoldenrod: "#eee8aa",
111
- palegreen: "#98fb98",
112
- paleturquoise: "#afeeee",
113
- palevioletred: "#db7093",
114
- papayawhip: "#ffefd5",
115
- peachpuff: "#ffdab9",
116
- peru: "#cd853f",
117
- pink: "#ffc0cb",
118
- plum: "#dda0dd",
119
- powderblue: "#b0e0e6",
120
- purple: "#800080",
121
- rebeccapurple: "#663399",
122
- red: "#ff0000",
123
- rosybrown: "#bc8f8f",
124
- royalblue: "#4169e1",
125
- saddlebrown: "#8b4513",
126
- salmon: "#fa8072",
127
- sandybrown: "#f4a460",
128
- seagreen: "#2e8b57",
129
- seashell: "#fff5ee",
130
- sienna: "#a0522d",
131
- silver: "#c0c0c0",
132
- skyblue: "#87ceeb",
133
- slateblue: "#6a5acd",
134
- slategray: "#708090",
135
- slategrey: "#708090",
136
- snow: "#fffafa",
137
- springgreen: "#00ff7f",
138
- steelblue: "#4682b4",
139
- tan: "#d2b48c",
140
- teal: "#008080",
141
- thistle: "#d8bfd8",
142
- tomato: "#ff6347",
143
- turquoise: "#40e0d0",
144
- violet: "#ee82ee",
145
- wheat: "#f5deb3",
146
- white: "#ffffff",
147
- whitesmoke: "#f5f5f5",
148
- yellow: "#ffff00",
149
- yellowgreen: "#9acd32"
150
- };
151
- export {
152
- e as names
153
- };