yxuse 3.0.40 → 3.0.42

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/lib/_commonjsHelpers.cjs.js +2 -0
  2. package/lib/_commonjsHelpers.cjs.js.map +1 -0
  3. package/lib/_commonjsHelpers.es.js +34 -0
  4. package/lib/_commonjsHelpers.es.js.map +1 -0
  5. package/lib/api.cjs.js +2 -1
  6. package/lib/api.cjs.js.map +1 -0
  7. package/lib/api.es.js +3 -3
  8. package/lib/api.es.js.map +1 -0
  9. package/lib/app.cjs.js +2 -1
  10. package/lib/app.cjs.js.map +1 -0
  11. package/lib/app.es.js +2 -1
  12. package/lib/app.es.js.map +1 -0
  13. package/lib/components.cjs.js +2 -1
  14. package/lib/components.cjs.js.map +1 -0
  15. package/lib/components.es.js +7 -13
  16. package/lib/components.es.js.map +1 -0
  17. package/lib/dayjs.min.cjs.js +2 -0
  18. package/lib/dayjs.min.cjs.js.map +1 -0
  19. package/lib/dayjs.min.es.js +283 -0
  20. package/lib/dayjs.min.es.js.gz +0 -0
  21. package/lib/dayjs.min.es.js.map +1 -0
  22. package/lib/directives.cjs.js +2 -1
  23. package/lib/directives.cjs.js.map +1 -0
  24. package/lib/directives.es.js +2 -3
  25. package/lib/directives.es.js.map +1 -0
  26. package/lib/hooks.cjs.js +2 -1
  27. package/lib/hooks.cjs.js.map +1 -0
  28. package/lib/hooks.es.js +2 -2
  29. package/lib/hooks.es.js.map +1 -0
  30. package/lib/index.cjs.js +2 -1
  31. package/lib/index.cjs.js.map +1 -0
  32. package/lib/index.cjs10.js +2 -1
  33. package/lib/index.cjs10.js.map +1 -0
  34. package/lib/index.cjs11.js +2 -1
  35. package/lib/index.cjs11.js.map +1 -0
  36. package/lib/index.cjs12.js +8 -1
  37. package/lib/index.cjs12.js.gz +0 -0
  38. package/lib/index.cjs12.js.map +1 -0
  39. package/lib/index.cjs13.js +2 -1
  40. package/lib/index.cjs13.js.map +1 -0
  41. package/lib/index.cjs14.js +2 -0
  42. package/lib/index.cjs14.js.map +1 -0
  43. package/lib/index.cjs2.js +2 -1
  44. package/lib/index.cjs2.js.map +1 -0
  45. package/lib/index.cjs3.js +2 -1
  46. package/lib/index.cjs3.js.map +1 -0
  47. package/lib/index.cjs4.js +2 -1
  48. package/lib/index.cjs4.js.map +1 -0
  49. package/lib/index.cjs5.js +6 -10
  50. package/lib/index.cjs5.js.gz +0 -0
  51. package/lib/index.cjs5.js.map +1 -0
  52. package/lib/index.cjs6.js +5 -1
  53. package/lib/index.cjs6.js.gz +0 -0
  54. package/lib/index.cjs6.js.map +1 -0
  55. package/lib/index.cjs7.js +17 -1
  56. package/lib/index.cjs7.js.gz +0 -0
  57. package/lib/index.cjs7.js.map +1 -0
  58. package/lib/index.cjs8.js +2 -1
  59. package/lib/index.cjs8.js.map +1 -0
  60. package/lib/index.cjs9.js +2 -1
  61. package/lib/index.cjs9.js.map +1 -0
  62. package/lib/index.es.js +8 -22
  63. package/lib/index.es.js.map +1 -0
  64. package/lib/index.es10.js +11 -312
  65. package/lib/index.es10.js.map +1 -0
  66. package/lib/index.es11.js +16 -2387
  67. package/lib/index.es11.js.map +1 -0
  68. package/lib/index.es12.js +5024 -159
  69. package/lib/index.es12.js.gz +0 -0
  70. package/lib/index.es12.js.map +1 -0
  71. package/lib/index.es13.js +231 -20
  72. package/lib/index.es13.js.map +1 -0
  73. package/lib/index.es14.js +23 -0
  74. package/lib/index.es14.js.map +1 -0
  75. package/lib/index.es2.js +6 -2
  76. package/lib/index.es2.js.map +1 -0
  77. package/lib/index.es3.js +3 -2
  78. package/lib/index.es3.js.map +1 -0
  79. package/lib/index.es4.js +3 -2
  80. package/lib/index.es4.js.map +1 -0
  81. package/lib/index.es5.js +16588 -4368
  82. package/lib/index.es5.js.gz +0 -0
  83. package/lib/index.es5.js.map +1 -0
  84. package/lib/index.es6.js +20633 -625
  85. package/lib/index.es6.js.gz +0 -0
  86. package/lib/index.es6.js.map +1 -0
  87. package/lib/index.es7.js +5386 -17
  88. package/lib/index.es7.js.gz +0 -0
  89. package/lib/index.es7.js.map +1 -0
  90. package/lib/index.es8.js +25 -4
  91. package/lib/index.es8.js.map +1 -0
  92. package/lib/index.es9.js +5 -9
  93. package/lib/index.es9.js.map +1 -0
  94. package/lib/style.css +1 -1
  95. package/lib/style.css.gz +0 -0
  96. package/lib/theme.cjs.js +2 -1
  97. package/lib/theme.cjs.js.map +1 -0
  98. package/lib/theme.es.js +9 -9
  99. package/lib/theme.es.js.map +1 -0
  100. package/lib/translate.cjs.js +2 -1
  101. package/lib/translate.cjs.js.map +1 -0
  102. package/lib/translate.es.js +12 -9
  103. package/lib/translate.es.js.map +1 -0
  104. package/lib/utils.cjs.js +2 -1
  105. package/lib/utils.cjs.js.map +1 -0
  106. package/lib/utils.es.js +9 -6
  107. package/lib/utils.es.js.map +1 -0
  108. package/lib/yxIcon.cjs.js +2 -1
  109. package/lib/yxIcon.cjs.js.map +1 -0
  110. package/lib/yxIcon.es.js +3 -2
  111. package/lib/yxIcon.es.js.map +1 -0
  112. package/lib/yxi18n.cjs.js +2 -0
  113. package/lib/yxi18n.cjs.js.map +1 -0
  114. package/lib/yxi18n.es.js +6 -0
  115. package/lib/yxi18n.es.js.map +1 -0
  116. package/package.json +11 -4
  117. package/types/api/auth/index.d.ts +2 -0
  118. package/types/components/Common/DynamicComponent/index.vue.d.ts +5 -4
  119. package/types/components/Toolbar/index.d.ts +1 -0
  120. package/types/components/Toolbar/src/index.vue.d.ts +1 -1
  121. package/types/components/Update/index.d.ts +1 -1
  122. package/types/components/Update/index.vue.d.ts +1 -1
  123. package/types/components/YxDialog/index.d.ts +3 -3
  124. package/types/components/YxDialog/index.vue.d.ts +4 -3
  125. package/types/components/YxDrawer/index.d.ts +3 -0
  126. package/types/components/YxDrawer/index.vue.d.ts +14 -0
  127. package/types/components/YxDrawer/type.d.ts +18 -0
  128. package/types/components/YxForm/index.d.ts +3 -3
  129. package/types/components/YxForm/index.vue.d.ts +43 -0
  130. package/types/components/YxForm/type.d.ts +66 -0
  131. package/types/components/YxIcon/index.d.ts +3 -3
  132. package/types/components/YxSearchForm/index.d.ts +3 -3
  133. package/types/components/YxSearchForm/index.vue.d.ts +8 -7
  134. package/types/components/YxTable/index.d.ts +3 -3
  135. package/types/components/YxTable/index.vue.d.ts +12 -8
  136. package/types/components/YxTable/type.d.ts +13 -3
  137. package/types/components/YxUpload/index.d.ts +3 -3
  138. package/types/components/YxUpload/index.vue.d.ts +7 -4
  139. package/types/components/YxUpload/type.d.ts +7 -1
  140. package/types/components/index.d.ts +9 -9
  141. package/types/components/type.d.ts +5 -5
  142. package/types/directives/index.d.ts +2 -1
  143. package/types/directives/modules/auth.d.ts +2 -1
  144. package/types/hooks/index.d.ts +1 -1
  145. package/types/hooks/useTime/index.d.ts +1 -1
  146. package/types/index.d.ts +12 -12
  147. package/types/theme/config.d.ts +2 -0
  148. package/types/theme/index.d.ts +2 -1
  149. package/types/translate/index.d.ts +3 -1
  150. package/types/utils/common/index.d.ts +19 -0
  151. package/types/utils/common/util.d.ts +2 -1
  152. package/types/utils/excel/index.d.ts +35 -0
  153. package/types/utils/http/config.d.ts +1 -0
  154. package/types/utils/http/index.d.ts +2 -1
  155. package/types/utils/index.d.ts +3 -3
  156. package/types/yxIcon/index.d.ts +2 -1
  157. package/types/yxi18n/index.d.ts +2 -4
  158. package/lib/index.cjs11.js.gz +0 -0
  159. package/lib/index.es10.js.gz +0 -0
  160. package/lib/index.es11.js.gz +0 -0
  161. package/lib/style.cjs.js +0 -1
  162. package/lib/style.es.js +0 -1
package/lib/index.cjs8.js CHANGED
@@ -1 +1,2 @@
1
- "use strict";const e=require("./index.cjs10.js"),o=Object.freeze(Object.defineProperty({__proto__:null,useTime:e.useTime},Symbol.toStringTag,{value:"Module"}));exports.yxHooks=o;
1
+ "use strict";const e=require("./index.cjs12.js"),t={mounted(e,t){r(e,t)}},r=(t,r)=>{const o=r.value;return e.getUserIsHaveBtnPower(o)?"":t.remove()},o={auth:t},s={install:function(e){Object.keys(o).forEach((t=>{e.directive(t,o[t])}))}},i=Object.freeze(Object.defineProperty({__proto__:null,default:s},Symbol.toStringTag,{value:"Module"}));exports.directives=i,exports.directives$1=s;
2
+ //# sourceMappingURL=index.cjs8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs8.js","sources":["../packages/directives/modules/auth.ts","../packages/directives/index.ts"],"sourcesContent":["/*\n * @Author: WangXin\n * @Date: 2023-09-15 10:33:59\n * @LastEditors: WangXin\n * @LastEditTime: 2023-09-15 10:37:28\n * @FilePath: \\yxUse\\packages\\directives\\modules\\auth.ts\n * @Description:\n *\n * Copyright (c) 2023 by YuXing, All Rights Reserved.\n */\nimport type { Directive, DirectiveBinding } from \"vue\";\nimport { getUserIsHaveBtnPower } from \"@packages/api/auth\";\nconst auth: Directive = {\n\tmounted(el, binding) {\n\t\tcontrolShowByUserPower(el, binding);\n\t}\n};\nconst controlShowByUserPower = (el: HTMLElement, binding: DirectiveBinding) => {\n\tconst value = binding.value as never;\n\treturn !getUserIsHaveBtnPower(value) ? el.remove() : \"\";\n};\nexport default auth;\n","/*\n * @Author: WangXin\n * @Date: 2023-09-15 10:33:40\n * @LastEditors: WangXin\n * @LastEditTime: 2023-09-15 10:35:52\n * @FilePath: \\yxUse\\packages\\directives\\index.ts\n * @Description:\n *\n * Copyright (c) 2023 by YuXing, All Rights Reserved.\n */\nimport type { App } from \"vue\";\nimport auth from \"./modules/auth\";\nconst directivesList: any = {\n\tauth\n};\nconst directives = {\n\tinstall: function (app: App<Element>) {\n\t\tObject.keys(directivesList).forEach(key => {\n\t\t\t// 注册所有自定义指令\n\t\t\tapp.directive(key, directivesList[key]);\n\t\t});\n\t}\n};\n\nexport default directives;\n"],"names":["auth","mounted","el","binding","controlShowByUserPower","value","getUserIsHaveBtnPower","remove","directivesList","directives","install","app","Object","keys","forEach","key","directive"],"mappings":"iDAYMA,EAAkB,CACvB,OAAAC,CAAQC,EAAIC,GACXC,EAAuBF,EAAIC,EAAO,GAG9BC,EAAyB,CAACF,EAAiBC,KAChD,MAAME,EAAQF,EAAQE,MACtB,OAAQC,EAAsBA,sBAAAD,GAAuB,GAAdH,EAAGK,QAAW,ECPhDC,EAAsB,CAC3BR,QAEKS,EAAa,CAClBC,QAAS,SAAUC,GAClBC,OAAOC,KAAKL,GAAgBM,SAAeC,IAE1CJ,EAAIK,UAAUD,EAAKP,EAAeO,GAAI,GACtC"}
package/lib/index.cjs9.js CHANGED
@@ -1 +1,2 @@
1
- "use strict";const e=(e="isWebApp")=>{const t=new URLSearchParams(window.location.href.split("?")[1]),r=Object.fromEntries(t.entries());return!(!r[e]||!+r[e])},t=Object.freeze(Object.defineProperty({__proto__:null,isWebApp:e},Symbol.toStringTag,{value:"Module"}));exports.app=t,exports.isWebApp=e;
1
+ "use strict";const e=require("./index.cjs11.js"),o=Object.freeze(Object.defineProperty({__proto__:null,useTime:e.useTime},Symbol.toStringTag,{value:"Module"}));exports.yxHooks=o;
2
+ //# sourceMappingURL=index.cjs9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs9.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/lib/index.es.js CHANGED
@@ -1,30 +1,15 @@
1
1
  import { u as utils2 } from "./index.es2.js";
2
2
  import { y as yxIcon2 } from "./index.es3.js";
3
3
  import { a as api2 } from "./index.es4.js";
4
- import { g as getWordByYxI18nThesaurus, t as theme2, B as BC, a as translate2 } from "./index.es5.js";
4
+ import { t as translate2, B as BC, a as theme2 } from "./index.es5.js";
5
5
  import { b } from "./index.es5.js";
6
6
  import { c as components2 } from "./index.es6.js";
7
- import { d as directives } from "./index.es7.js";
8
- import { y as yxHooks } from "./index.es8.js";
9
- import { a as app } from "./index.es9.js";
10
- import { i } from "./index.es9.js";
11
- import { u } from "./index.es10.js";
12
- import "./index.es11.js";
13
- import "element-plus";
14
- import "./index.es12.js";
15
- import "./index.es13.js";
16
- import "vue";
17
- const index$1 = {
18
- install: (app2) => {
19
- app2.config.globalProperties.$yx18n = (key) => {
20
- return getWordByYxI18nThesaurus(key);
21
- };
22
- }
23
- };
24
- const yxi18n2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
25
- __proto__: null,
26
- default: index$1
27
- }, Symbol.toStringTag, { value: "Module" }));
7
+ import { y as yxi18n2 } from "./index.es7.js";
8
+ import { d as directives } from "./index.es8.js";
9
+ import { y as yxHooks } from "./index.es9.js";
10
+ import { a as app } from "./index.es10.js";
11
+ import { i } from "./index.es10.js";
12
+ import { u } from "./index.es11.js";
28
13
  const index = {
29
14
  utils: utils2,
30
15
  api: api2,
@@ -51,3 +36,4 @@ export {
51
36
  yxIcon2 as yxIcon,
52
37
  yxi18n2 as yxi18n
53
38
  };
39
+ //# sourceMappingURL=index.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","sources":["../packages/index.ts"],"sourcesContent":["/*\n * @Author: WangXin\n * @Date: 2023-08-16 15:38:34\n * @LastEditors: WangXin\n * @LastEditTime: 2024-09-24 15:10:30\n * @FilePath: /yxuse/packages/index.ts\n * @Description:\n *\n * Copyright (c) 2023 by YuXing, All Rights Reserved.\n */\nexport * as utils from \"./utils\";\n// export * as icons from \"./icons\";\nexport * as yxIcon from \"./yxIcon\";\nexport * as api from \"./api\";\nexport * as theme from \"./theme\";\nexport * as components from \"./components\";\nexport * as translate from \"./translate\";\nexport * as yxi18n from \"./yxi18n\";\nexport * from \"./directives\";\nexport * from \"./hooks\";\nexport * from \"./app\";\nexport * from \"./bc\";\n//导出类型\nexport * from \"./components/type\";\nimport * as utils from \"./utils\";\n// import * as icons from \"./icons\";\nimport * as api from \"./api\";\nimport * as theme from \"./theme\";\nimport * as components from \"./components\";\nimport * as directives from \"./directives\";\nimport * as translate from \"./translate\";\nimport * as yxi18n from \"./yxi18n\";\nimport * as yxHooks from \"./hooks\";\nimport * as yxIcon from \"./yxIcon\";\nimport * as app from \"./app\";\nimport * as BC from \"./bc\";\nexport default {\n\tutils,\n\tapi,\n\tapp,\n\ttheme,\n\tcomponents,\n\tdirectives,\n\tBC,\n\ttranslate,\n\tyxi18n,\n\tyxHooks,\n\tyxIcon\n};\n"],"names":["utils","api","theme","components","translate","yxi18n","yxIcon"],"mappings":";;;;;;;;;;;;AAoCA,MAAe,QAAA;AAAA,EACd,OAAAA;AAAAA,EACA,KAAAC;AAAAA,EACA;AAAA,EACA,OAAAC;AAAAA,EACA,YAAAC;AAAAA,EACA;AAAA,EACA;AAAA,EACA,WAAAC;AAAAA,EACA,QAAAC;AAAAA,EACA;AAAA,EACA,QAAAC;AACD;"}
package/lib/index.es10.js CHANGED
@@ -1,315 +1,14 @@
1
- import { ref } from "vue";
2
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
3
- function getDefaultExportFromCjs(x) {
4
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
5
- }
6
- var dayjs_min = { exports: {} };
7
- (function(module, exports) {
8
- !function(t, e) {
9
- module.exports = e();
10
- }(commonjsGlobal, function() {
11
- var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
12
- var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
13
- return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
14
- } }, m = function(t2, e2, n2) {
15
- var r2 = String(t2);
16
- return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
17
- }, v = { s: m, z: function(t2) {
18
- var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
19
- return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
20
- }, m: function t2(e2, n2) {
21
- if (e2.date() < n2.date())
22
- return -t2(n2, e2);
23
- var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
24
- return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
25
- }, a: function(t2) {
26
- return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
27
- }, p: function(t2) {
28
- return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
29
- }, u: function(t2) {
30
- return void 0 === t2;
31
- } }, g = "en", D = {};
32
- D[g] = M;
33
- var p = "$isDayjsObject", S = function(t2) {
34
- return t2 instanceof _ || !(!t2 || !t2[p]);
35
- }, w = function t2(e2, n2, r2) {
36
- var i2;
37
- if (!e2)
38
- return g;
39
- if ("string" == typeof e2) {
40
- var s2 = e2.toLowerCase();
41
- D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
42
- var u2 = e2.split("-");
43
- if (!i2 && u2.length > 1)
44
- return t2(u2[0]);
45
- } else {
46
- var a2 = e2.name;
47
- D[a2] = e2, i2 = a2;
48
- }
49
- return !r2 && i2 && (g = i2), i2 || !r2 && g;
50
- }, O = function(t2, e2) {
51
- if (S(t2))
52
- return t2.clone();
53
- var n2 = "object" == typeof e2 ? e2 : {};
54
- return n2.date = t2, n2.args = arguments, new _(n2);
55
- }, b = v;
56
- b.l = w, b.i = S, b.w = function(t2, e2) {
57
- return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
58
- };
59
- var _ = function() {
60
- function M2(t2) {
61
- this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
62
- }
63
- var m2 = M2.prototype;
64
- return m2.parse = function(t2) {
65
- this.$d = function(t3) {
66
- var e2 = t3.date, n2 = t3.utc;
67
- if (null === e2)
68
- return /* @__PURE__ */ new Date(NaN);
69
- if (b.u(e2))
70
- return /* @__PURE__ */ new Date();
71
- if (e2 instanceof Date)
72
- return new Date(e2);
73
- if ("string" == typeof e2 && !/Z$/i.test(e2)) {
74
- var r2 = e2.match($);
75
- if (r2) {
76
- var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
77
- return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
78
- }
79
- }
80
- return new Date(e2);
81
- }(t2), this.init();
82
- }, m2.init = function() {
83
- var t2 = this.$d;
84
- this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
85
- }, m2.$utils = function() {
86
- return b;
87
- }, m2.isValid = function() {
88
- return !(this.$d.toString() === l);
89
- }, m2.isSame = function(t2, e2) {
90
- var n2 = O(t2);
91
- return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
92
- }, m2.isAfter = function(t2, e2) {
93
- return O(t2) < this.startOf(e2);
94
- }, m2.isBefore = function(t2, e2) {
95
- return this.endOf(e2) < O(t2);
96
- }, m2.$g = function(t2, e2, n2) {
97
- return b.u(t2) ? this[e2] : this.set(n2, t2);
98
- }, m2.unix = function() {
99
- return Math.floor(this.valueOf() / 1e3);
100
- }, m2.valueOf = function() {
101
- return this.$d.getTime();
102
- }, m2.startOf = function(t2, e2) {
103
- var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
104
- var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
105
- return r2 ? i2 : i2.endOf(a);
106
- }, $2 = function(t3, e3) {
107
- return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
108
- }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
109
- switch (f2) {
110
- case h:
111
- return r2 ? l2(1, 0) : l2(31, 11);
112
- case c:
113
- return r2 ? l2(1, M3) : l2(0, M3 + 1);
114
- case o:
115
- var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
116
- return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
117
- case a:
118
- case d:
119
- return $2(v2 + "Hours", 0);
120
- case u:
121
- return $2(v2 + "Minutes", 1);
122
- case s:
123
- return $2(v2 + "Seconds", 2);
124
- case i:
125
- return $2(v2 + "Milliseconds", 3);
126
- default:
127
- return this.clone();
128
- }
129
- }, m2.endOf = function(t2) {
130
- return this.startOf(t2, false);
131
- }, m2.$set = function(t2, e2) {
132
- var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
133
- if (o2 === c || o2 === h) {
134
- var y2 = this.clone().set(d, 1);
135
- y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
136
- } else
137
- l2 && this.$d[l2]($2);
138
- return this.init(), this;
139
- }, m2.set = function(t2, e2) {
140
- return this.clone().$set(t2, e2);
141
- }, m2.get = function(t2) {
142
- return this[b.p(t2)]();
143
- }, m2.add = function(r2, f2) {
144
- var d2, l2 = this;
145
- r2 = Number(r2);
146
- var $2 = b.p(f2), y2 = function(t2) {
147
- var e2 = O(l2);
148
- return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
149
- };
150
- if ($2 === c)
151
- return this.set(c, this.$M + r2);
152
- if ($2 === h)
153
- return this.set(h, this.$y + r2);
154
- if ($2 === a)
155
- return y2(1);
156
- if ($2 === o)
157
- return y2(7);
158
- var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
159
- return b.w(m3, this);
160
- }, m2.subtract = function(t2, e2) {
161
- return this.add(-1 * t2, e2);
162
- }, m2.format = function(t2) {
163
- var e2 = this, n2 = this.$locale();
164
- if (!this.isValid())
165
- return n2.invalidDate || l;
166
- var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
167
- return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
168
- }, d2 = function(t3) {
169
- return b.s(s2 % 12 || 12, t3, "0");
170
- }, $2 = f2 || function(t3, e3, n3) {
171
- var r3 = t3 < 12 ? "AM" : "PM";
172
- return n3 ? r3.toLowerCase() : r3;
173
- };
174
- return r2.replace(y, function(t3, r3) {
175
- return r3 || function(t4) {
176
- switch (t4) {
177
- case "YY":
178
- return String(e2.$y).slice(-2);
179
- case "YYYY":
180
- return b.s(e2.$y, 4, "0");
181
- case "M":
182
- return a2 + 1;
183
- case "MM":
184
- return b.s(a2 + 1, 2, "0");
185
- case "MMM":
186
- return h2(n2.monthsShort, a2, c2, 3);
187
- case "MMMM":
188
- return h2(c2, a2);
189
- case "D":
190
- return e2.$D;
191
- case "DD":
192
- return b.s(e2.$D, 2, "0");
193
- case "d":
194
- return String(e2.$W);
195
- case "dd":
196
- return h2(n2.weekdaysMin, e2.$W, o2, 2);
197
- case "ddd":
198
- return h2(n2.weekdaysShort, e2.$W, o2, 3);
199
- case "dddd":
200
- return o2[e2.$W];
201
- case "H":
202
- return String(s2);
203
- case "HH":
204
- return b.s(s2, 2, "0");
205
- case "h":
206
- return d2(1);
207
- case "hh":
208
- return d2(2);
209
- case "a":
210
- return $2(s2, u2, true);
211
- case "A":
212
- return $2(s2, u2, false);
213
- case "m":
214
- return String(u2);
215
- case "mm":
216
- return b.s(u2, 2, "0");
217
- case "s":
218
- return String(e2.$s);
219
- case "ss":
220
- return b.s(e2.$s, 2, "0");
221
- case "SSS":
222
- return b.s(e2.$ms, 3, "0");
223
- case "Z":
224
- return i2;
225
- }
226
- return null;
227
- }(t3) || i2.replace(":", "");
228
- });
229
- }, m2.utcOffset = function() {
230
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
231
- }, m2.diff = function(r2, d2, l2) {
232
- var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
233
- return b.m(y2, m3);
234
- };
235
- switch (M3) {
236
- case h:
237
- $2 = D2() / 12;
238
- break;
239
- case c:
240
- $2 = D2();
241
- break;
242
- case f:
243
- $2 = D2() / 3;
244
- break;
245
- case o:
246
- $2 = (g2 - v2) / 6048e5;
247
- break;
248
- case a:
249
- $2 = (g2 - v2) / 864e5;
250
- break;
251
- case u:
252
- $2 = g2 / n;
253
- break;
254
- case s:
255
- $2 = g2 / e;
256
- break;
257
- case i:
258
- $2 = g2 / t;
259
- break;
260
- default:
261
- $2 = g2;
262
- }
263
- return l2 ? $2 : b.a($2);
264
- }, m2.daysInMonth = function() {
265
- return this.endOf(c).$D;
266
- }, m2.$locale = function() {
267
- return D[this.$L];
268
- }, m2.locale = function(t2, e2) {
269
- if (!t2)
270
- return this.$L;
271
- var n2 = this.clone(), r2 = w(t2, e2, true);
272
- return r2 && (n2.$L = r2), n2;
273
- }, m2.clone = function() {
274
- return b.w(this.$d, this);
275
- }, m2.toDate = function() {
276
- return new Date(this.valueOf());
277
- }, m2.toJSON = function() {
278
- return this.isValid() ? this.toISOString() : null;
279
- }, m2.toISOString = function() {
280
- return this.$d.toISOString();
281
- }, m2.toString = function() {
282
- return this.$d.toUTCString();
283
- }, M2;
284
- }(), k = _.prototype;
285
- return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
286
- k[t2[1]] = function(e2) {
287
- return this.$g(e2, t2[0], t2[1]);
288
- };
289
- }), O.extend = function(t2, e2) {
290
- return t2.$i || (t2(e2, _, O), t2.$i = true), O;
291
- }, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
292
- return O(1e3 * t2);
293
- }, O.en = D[g], O.Ls = D, O.p = {}, O;
294
- });
295
- })(dayjs_min);
296
- var dayjs_minExports = dayjs_min.exports;
297
- const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
298
- const time = ref("");
299
- let _timer;
300
- const useTime = () => {
301
- const timedExecution = () => {
302
- _timer = setTimeout(() => {
303
- time.value = dayjs().format("YYYY-MM-DD HH:mm:ss");
304
- _timer && clearTimeout(_timer);
305
- timedExecution();
306
- }, 1e3);
307
- };
308
- timedExecution();
309
- return { time };
1
+ const isWebApp = (key = "isWebApp") => {
2
+ const url = new URLSearchParams(window.location.href.split("?")[1]);
3
+ const params = Object.fromEntries(url.entries());
4
+ return params[key] && +params[key] ? true : false;
310
5
  };
6
+ const app = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7
+ __proto__: null,
8
+ isWebApp
9
+ }, Symbol.toStringTag, { value: "Module" }));
311
10
  export {
312
- commonjsGlobal as c,
313
- getDefaultExportFromCjs as g,
314
- useTime as u
11
+ app as a,
12
+ isWebApp as i
315
13
  };
14
+ //# sourceMappingURL=index.es10.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es10.js","sources":["../packages/app/index.ts"],"sourcesContent":["/*\n * @Author: WangXin\n * @Date: 2024-09-02 14:03:25\n * @LastEditors: WangXin\n * @LastEditTime: 2024-09-02 15:40:00\n * @FilePath: /yxuse/packages/app/index.ts\n * @Description:\n *\n * Copyright (c) ${2024} by YuXing, All Rights Reserved.\n */\n// export const installWebApp = async (systemKey?: string, lang?: string, callback?: Function) => {\n// \twindow.__YUXING_APP_ENVIRONMENT__ = true;\n// \tconsole.log(\"当前的主题是\", getCurThemeCssVar(), getCurTheme());\n// \tinstallCssVarInSystemTheme();\n// \tconst langStr = await getLang();\n// \tawait initTranslate({ to: lang ? langStr : lang || \"zh\", systemKey });\n// \t//注册BC\n// \tBC.onmessage = event => {\n// \t\tconst data = JSON.parse(event.data);\n// \t\tif (data.type === \"theme\") {\n// \t\t\tconsole.log(\"监听到其他系统切换主题收到的信息\", data.data);\n// \t\t\tconst { themeCssVar, themeId, themeUrl } = data.data;\n// \t\t\t// setCssVar(themeUrl);\n// \t\t\tsaveCssVar({ themeCssVar, themeId });\n// \t\t\tinstallCssVarInSystemTheme(themeCssVar);\n// \t\t}\n// \t\tif (data.type === \"lang\") {\n// \t\t\tconsole.log(\"监听到其他系统切换语言\");\n// \t\t\tlocation.reload();\n// \t\t}\n// \t};\n// \tcallback && callback();\n// };\n\nexport const isWebApp = (key = \"isWebApp\") => {\n\tconst url = new URLSearchParams(window.location.href.split(\"?\")[1]);\n\tconst params = Object.fromEntries(url.entries());\n\treturn params[key] && +params[key] ? true : false;\n};\n"],"names":[],"mappings":"AAkCa,MAAA,WAAW,CAAC,MAAM,eAAe;AACvC,QAAA,MAAM,IAAI,gBAAgB,OAAO,SAAS,KAAK,MAAM,GAAG,EAAE,CAAC,CAAC;AAClE,QAAM,SAAS,OAAO,YAAY,IAAI,SAAS;AAC/C,SAAO,OAAO,GAAG,KAAK,CAAC,OAAO,GAAG,IAAI,OAAO;AAC7C;;;;;"}