duck-vue-components 0.0.0

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 (123) hide show
  1. package/README.md +29 -0
  2. package/dist/MyButton-C1krVCi6.cjs +36 -0
  3. package/dist/MyButton-C7riFwH6.js +28 -0
  4. package/dist/_plugin-vue_export-helper-DQXgr64F.cjs +13 -0
  5. package/dist/_plugin-vue_export-helper-DbXABBKy.js +8 -0
  6. package/dist/affix-CYU-9qMr.cjs +71 -0
  7. package/dist/affix-D9EM8_Um.js +66 -0
  8. package/dist/button-CGv1WHzT.cjs +132 -0
  9. package/dist/button-tOWSPPxz.js +126 -0
  10. package/dist/chunk-CZWwpsFl.cjs +43 -0
  11. package/dist/chunk-pbuEa-1d.js +13 -0
  12. package/dist/config.cjs +1 -0
  13. package/dist/config.js +1 -0
  14. package/dist/constants/json.cjs +4 -0
  15. package/dist/constants/json.d.cts +2 -0
  16. package/dist/constants/json.d.ts +2 -0
  17. package/dist/constants/json.js +2 -0
  18. package/dist/constants.cjs +14 -0
  19. package/dist/constants.d.cts +3 -0
  20. package/dist/constants.d.ts +3 -0
  21. package/dist/constants.js +3 -0
  22. package/dist/controls/MyButton.cjs +3 -0
  23. package/dist/controls/MyButton.d.cts +2 -0
  24. package/dist/controls/MyButton.d.ts +2 -0
  25. package/dist/controls/MyButton.js +2 -0
  26. package/dist/controls/affix.cjs +8 -0
  27. package/dist/controls/affix.d.cts +2 -0
  28. package/dist/controls/affix.d.ts +2 -0
  29. package/dist/controls/affix.js +2 -0
  30. package/dist/controls/button.cjs +8 -0
  31. package/dist/controls/button.js +2 -0
  32. package/dist/controls.cjs +18 -0
  33. package/dist/controls.d.cts +10 -0
  34. package/dist/controls.d.ts +10 -0
  35. package/dist/controls.js +5 -0
  36. package/dist/dom-CllENWMY.js +346 -0
  37. package/dist/dom-DS4YqkjW.cjs +580 -0
  38. package/dist/index-1ELDRrC5.d.ts +1397 -0
  39. package/dist/index-5JdIJn1m.d.cts +74 -0
  40. package/dist/index-6KzLtJFy.d.cts +157 -0
  41. package/dist/index-BGkTN1DD.d.cts +15 -0
  42. package/dist/index-BHq-BMCP.d.ts +74 -0
  43. package/dist/index-BI-hrf4t.d.ts +332 -0
  44. package/dist/index-BtOBjeH7.d.ts +10 -0
  45. package/dist/index-C-uY4885.d.cts +23 -0
  46. package/dist/index-C5SJLWEN.d.ts +23 -0
  47. package/dist/index-CSvc8L11.d.cts +51 -0
  48. package/dist/index-CeemHBNT.d.ts +51 -0
  49. package/dist/index-CfkAYIKD.d.cts +80 -0
  50. package/dist/index-CiJC-ieW.d.ts +157 -0
  51. package/dist/index-DamAmum6.d.ts +15 -0
  52. package/dist/index-DhOoJCHW.d.cts +1397 -0
  53. package/dist/index-PhthUD7x.d.cts +10 -0
  54. package/dist/index-oDsyZ3t2.d.cts +332 -0
  55. package/dist/index-x9xs2cbA.d.ts +80 -0
  56. package/dist/json-BkkaM20u.cjs +31034 -0
  57. package/dist/json-D-_zTSK6.js +31023 -0
  58. package/dist/locale-DhlAaV1Q.js +597 -0
  59. package/dist/locale-WzzxOobw.cjs +658 -0
  60. package/dist/locale.cjs +12 -0
  61. package/dist/locale.js +2 -0
  62. package/dist/objects-CLXPNOUW.js +134 -0
  63. package/dist/objects-o7u5s_lI.cjs +272 -0
  64. package/dist/packages/config.cjs +10 -0
  65. package/dist/packages/config.d.cts +2 -0
  66. package/dist/packages/config.d.ts +2 -0
  67. package/dist/packages/config.js +5 -0
  68. package/dist/packages/constants/json.cjs +4 -0
  69. package/dist/packages/constants/json.js +2 -0
  70. package/dist/packages/constants.cjs +78 -0
  71. package/dist/packages/constants.js +67 -0
  72. package/dist/packages/controls/MyButton.cjs +3 -0
  73. package/dist/packages/controls/MyButton.js +2 -0
  74. package/dist/packages/controls/affix.cjs +8 -0
  75. package/dist/packages/controls/affix.js +2 -0
  76. package/dist/packages/controls/button.cjs +8 -0
  77. package/dist/packages/controls/button.d.cts +2 -0
  78. package/dist/packages/controls/button.d.ts +2 -0
  79. package/dist/packages/controls/button.js +2 -0
  80. package/dist/packages/controls.cjs +31 -0
  81. package/dist/packages/controls.js +12 -0
  82. package/dist/packages/locale.cjs +12 -0
  83. package/dist/packages/locale.d.cts +39 -0
  84. package/dist/packages/locale.d.ts +39 -0
  85. package/dist/packages/locale.js +2 -0
  86. package/dist/packages/stores.cjs +337 -0
  87. package/dist/packages/stores.js +320 -0
  88. package/dist/packages/utils/dom.cjs +32 -0
  89. package/dist/packages/utils/dom.d.cts +2 -0
  90. package/dist/packages/utils/dom.d.ts +2 -0
  91. package/dist/packages/utils/dom.js +2 -0
  92. package/dist/packages/utils/vue/props.cjs +63 -0
  93. package/dist/packages/utils/vue/props.d.cts +2 -0
  94. package/dist/packages/utils/vue/props.d.ts +2 -0
  95. package/dist/packages/utils/vue/props.js +56 -0
  96. package/dist/packages/utils/vue.cjs +32 -0
  97. package/dist/packages/utils/vue.d.cts +3 -0
  98. package/dist/packages/utils/vue.d.ts +3 -0
  99. package/dist/packages/utils/vue.js +24 -0
  100. package/dist/packages/utils.cjs +190 -0
  101. package/dist/packages/utils.js +6 -0
  102. package/dist/packages.cjs +15 -0
  103. package/dist/packages.d.cts +3 -0
  104. package/dist/packages.d.ts +3 -0
  105. package/dist/packages.js +3 -0
  106. package/dist/stores.cjs +17 -0
  107. package/dist/stores.d.cts +805 -0
  108. package/dist/stores.d.ts +805 -0
  109. package/dist/stores.js +4 -0
  110. package/dist/style.css +15 -0
  111. package/dist/utils/dom.cjs +32 -0
  112. package/dist/utils/dom.js +2 -0
  113. package/dist/utils/vue/props.cjs +7 -0
  114. package/dist/utils/vue/props.js +2 -0
  115. package/dist/utils/vue.cjs +11 -0
  116. package/dist/utils/vue.js +3 -0
  117. package/dist/utils-DlBKdS0t.js +696 -0
  118. package/dist/utils-egS_3P4w.cjs +850 -0
  119. package/dist/utils.cjs +190 -0
  120. package/dist/utils.d.cts +5 -0
  121. package/dist/utils.d.ts +5 -0
  122. package/dist/utils.js +6 -0
  123. package/package.json +184 -0
@@ -0,0 +1,12 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_locale = require("../locale-WzzxOobw.cjs");
3
+ exports.i18n = require_locale.i18n;
4
+ exports.initLangOptions = require_locale.initLangOptions;
5
+ exports.initi18n = require_locale.initi18n;
6
+ exports.locale = require_locale.locale;
7
+ exports.localeOptions = require_locale.localeOptions;
8
+ exports.mergeLocaleMessage = require_locale.mergeLocaleMessage;
9
+ exports.mergeLocaleMessages = require_locale.mergeLocaleMessages;
10
+ exports.messages = require_locale.messages;
11
+ exports.setLanguage = require_locale.setLanguage;
12
+ exports.t = require_locale.t;
@@ -0,0 +1,39 @@
1
+ import * as _$vue from "vue";
2
+ import { I18n } from "vue-i18n";
3
+
4
+ //#region src/packages/locale/index.d.ts
5
+ /** 语言包结构 */
6
+ interface langInfoI {
7
+ /** 必须要有页面标题 */
8
+ [key: string]: string | langInfoI;
9
+ }
10
+ /** 系统语言包集 */
11
+ interface langsI {
12
+ /** 中文语言包必填 */
13
+ cn: langInfoI;
14
+ /** 其他语言包可选 */
15
+ en: langInfoI;
16
+ tw: langInfoI;
17
+ [key: string]: langInfoI;
18
+ }
19
+ interface initLangOptionsI {
20
+ ClientLang: string;
21
+ fallbackLocale: string;
22
+ appLangs: string[];
23
+ }
24
+ declare const initLangOptions: initLangOptionsI;
25
+ declare const messages: Record<string, any>;
26
+ declare const localeOptions: Array<{
27
+ label: string;
28
+ value: string;
29
+ image: any;
30
+ }>;
31
+ declare const i18n: I18n<Record<string, any>, {}, {}, string, false>;
32
+ declare function setLanguage(lang: string): void;
33
+ declare const initi18n: () => void;
34
+ declare function mergeLocaleMessages(moduleName: string, langs: any): void;
35
+ declare function mergeLocaleMessage(moduleName: string | undefined, langs: langsI, targetI18n?: I18n): void;
36
+ declare const locale: _$vue.WritableComputedRef<string, string>;
37
+ declare const t: (key: string, values?: any) => string;
38
+ //#endregion
39
+ export { i18n, initLangOptions, initLangOptionsI, initi18n, langInfoI, langsI, locale, localeOptions, mergeLocaleMessage, mergeLocaleMessages, messages, setLanguage, t };
@@ -0,0 +1,39 @@
1
+ import * as _$vue from "vue";
2
+ import { I18n } from "vue-i18n";
3
+
4
+ //#region src/packages/locale/index.d.ts
5
+ /** 语言包结构 */
6
+ interface langInfoI {
7
+ /** 必须要有页面标题 */
8
+ [key: string]: string | langInfoI;
9
+ }
10
+ /** 系统语言包集 */
11
+ interface langsI {
12
+ /** 中文语言包必填 */
13
+ cn: langInfoI;
14
+ /** 其他语言包可选 */
15
+ en: langInfoI;
16
+ tw: langInfoI;
17
+ [key: string]: langInfoI;
18
+ }
19
+ interface initLangOptionsI {
20
+ ClientLang: string;
21
+ fallbackLocale: string;
22
+ appLangs: string[];
23
+ }
24
+ declare const initLangOptions: initLangOptionsI;
25
+ declare const messages: Record<string, any>;
26
+ declare const localeOptions: Array<{
27
+ label: string;
28
+ value: string;
29
+ image: any;
30
+ }>;
31
+ declare const i18n: I18n<Record<string, any>, {}, {}, string, false>;
32
+ declare function setLanguage(lang: string): void;
33
+ declare const initi18n: () => void;
34
+ declare function mergeLocaleMessages(moduleName: string, langs: any): void;
35
+ declare function mergeLocaleMessage(moduleName: string | undefined, langs: langsI, targetI18n?: I18n): void;
36
+ declare const locale: _$vue.WritableComputedRef<string, string>;
37
+ declare const t: (key: string, values?: any) => string;
38
+ //#endregion
39
+ export { i18n, initLangOptions, initLangOptionsI, initi18n, langInfoI, langsI, locale, localeOptions, mergeLocaleMessage, mergeLocaleMessages, messages, setLanguage, t };
@@ -0,0 +1,2 @@
1
+ import { a as localeOptions, c as messages, i as locale, l as setLanguage, n as initLangOptions, o as mergeLocaleMessage, r as initi18n, s as mergeLocaleMessages, t as i18n, u as t } from "../locale-DhlAaV1Q.js";
2
+ export { i18n, initLangOptions, initi18n, locale, localeOptions, mergeLocaleMessage, mergeLocaleMessages, messages, setLanguage, t };
@@ -0,0 +1,337 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_chunk = require("../chunk-CZWwpsFl.cjs");
3
+ const require_utils = require("../utils-egS_3P4w.cjs");
4
+ let vue = require("vue");
5
+ let _vueuse_core = require("@vueuse/core");
6
+ let element_plus = require("element-plus");
7
+ let pinia = require("pinia");
8
+ let pinia_plugin_persistedstate = require("pinia-plugin-persistedstate");
9
+ pinia_plugin_persistedstate = require_chunk.__toESM(pinia_plugin_persistedstate);
10
+ let element_plus_es_locale_lang_zh_cn = require("element-plus/es/locale/lang/zh-cn");
11
+ element_plus_es_locale_lang_zh_cn = require_chunk.__toESM(element_plus_es_locale_lang_zh_cn);
12
+ let element_plus_es_locale_lang_zh_tw = require("element-plus/es/locale/lang/zh-tw");
13
+ element_plus_es_locale_lang_zh_tw = require_chunk.__toESM(element_plus_es_locale_lang_zh_tw);
14
+ let element_plus_es_locale_lang_en = require("element-plus/es/locale/lang/en");
15
+ element_plus_es_locale_lang_en = require_chunk.__toESM(element_plus_es_locale_lang_en);
16
+ //#region src/packages/stores/columnsSetting.ts
17
+ const useColumnsSettingStore = (0, pinia.defineStore)("columnsSetting", () => {
18
+ let columns = (0, vue.reactive)({});
19
+ let tableOrderColumns = (0, vue.reactive)({});
20
+ let fieldsOrder = (0, vue.reactive)({});
21
+ function setFieldsOrder(moduleName, fieldsOrderArr) {
22
+ fieldsOrder[moduleName] = fieldsOrderArr;
23
+ }
24
+ function setOrderColumns(moduleName, orderColumns) {
25
+ tableOrderColumns[moduleName] = orderColumns;
26
+ }
27
+ function clearColumns(moduleName) {
28
+ columns[moduleName] = [];
29
+ }
30
+ function getColumns() {
31
+ return columns;
32
+ }
33
+ function isChecked(moduleName, fieldName) {
34
+ if (columns[moduleName] == void 0) return true;
35
+ if (columns[moduleName].includes(fieldName)) return false;
36
+ else return true;
37
+ }
38
+ function setItem(moduleName, fieldName, checked) {
39
+ if (checked) {
40
+ if (columns[moduleName] == void 0) columns[moduleName] = [];
41
+ if (columns[moduleName].findIndex((model) => model == fieldName) == -1) columns[moduleName].push(fieldName);
42
+ } else {
43
+ if (columns[moduleName] == void 0) return false;
44
+ const findIndex = columns[moduleName].findIndex((model) => model == fieldName);
45
+ columns[moduleName].splice(findIndex, 1);
46
+ }
47
+ return true;
48
+ }
49
+ async function getFromRemote() {
50
+ const conf = { field: "" };
51
+ conf.field = "showcolumns";
52
+ return require_utils.http.post("?p=index&a=index&apiName=System/getLocalsetting", conf).then((res) => {
53
+ if (res.status == 0) {
54
+ if (res.data) for (const index in res.data) {
55
+ const element = res.data[index];
56
+ columns[index].splice(0, columns[index].length);
57
+ columns[index].push(...element);
58
+ }
59
+ else columns = {};
60
+ element_plus.ElMessage.success(res.errorMsg);
61
+ return true;
62
+ } else {
63
+ element_plus.ElMessage.error(res.errorMsg);
64
+ return false;
65
+ }
66
+ });
67
+ }
68
+ function saveToRemote() {
69
+ const conf = {
70
+ conf: { ...columns },
71
+ field: "showcolumns"
72
+ };
73
+ require_utils.http.post("?p=index&a=index&apiName=System/saveLocalsetting", conf).then((res) => {
74
+ if (res.status == 0) {
75
+ element_plus.ElMessage.success(res.errorMsg);
76
+ return true;
77
+ } else {
78
+ element_plus.ElMessage.error(res.errorMsg);
79
+ return false;
80
+ }
81
+ });
82
+ }
83
+ return {
84
+ columns,
85
+ isChecked,
86
+ setItem,
87
+ getFromRemote,
88
+ saveToRemote,
89
+ clearColumns,
90
+ getColumns,
91
+ tableOrderColumns,
92
+ setOrderColumns,
93
+ fieldsOrder,
94
+ setFieldsOrder
95
+ };
96
+ }, { persist: {
97
+ key: "columnsSetting",
98
+ storage: localStorage,
99
+ pick: ["columns", "fieldsOrder"],
100
+ serializer: {
101
+ serialize: (state) => require_utils.rwEncode(state),
102
+ deserialize: (data) => require_utils.rwDecode(data)
103
+ }
104
+ } });
105
+ //#endregion
106
+ //#region src/packages/stores/localSetting.ts
107
+ const useLocalSettingStore = (0, pinia.defineStore)("localSetting", {
108
+ state: () => ({
109
+ system: {
110
+ dark: false,
111
+ locale: "cn",
112
+ langLable: "icon",
113
+ emptyValues: "",
114
+ valueOnClear: "",
115
+ size: "default",
116
+ message: {
117
+ max: 1,
118
+ grouping: false,
119
+ duration: 3e3,
120
+ showClose: true,
121
+ offset: 0,
122
+ plain: false
123
+ },
124
+ button: {
125
+ type: "default",
126
+ autoInsertSpace: false,
127
+ plain: true,
128
+ round: false
129
+ },
130
+ checkBox: "default",
131
+ link: {
132
+ type: "default",
133
+ underline: false
134
+ },
135
+ maxOpenPage: 10
136
+ },
137
+ layout: {
138
+ layout: "tlr",
139
+ fullScreen: false,
140
+ backTop: true
141
+ },
142
+ smallComponents: {
143
+ dark: true,
144
+ lang: false,
145
+ fullScreen: true,
146
+ size: true,
147
+ tabs: true
148
+ },
149
+ page: {
150
+ process: true,
151
+ transition: "el-fade-in",
152
+ waterType: "text",
153
+ dialogType: "center"
154
+ },
155
+ pageTable: {
156
+ showTitle: true,
157
+ margin: 5,
158
+ search: {
159
+ oneLineControl: 4,
160
+ mergeStringControl: true,
161
+ stringControlLocation: "front",
162
+ labelPosition: "left",
163
+ buttonStyle: "button"
164
+ },
165
+ table: {
166
+ deleteConfirmStyle: "bubble",
167
+ showHeader: true,
168
+ showHeadBgColor: false,
169
+ verticalLine: false,
170
+ horizontalLine: true,
171
+ stripe: true,
172
+ highlightCurrentRow: true,
173
+ height: "follow",
174
+ buttonStyle: "text",
175
+ showIndex: true,
176
+ fit: true,
177
+ fixed: "right",
178
+ showMenu: true,
179
+ maxButtons: 3,
180
+ multiLangShowType: "all"
181
+ },
182
+ buttons: {
183
+ groupType: false,
184
+ location: "top",
185
+ buttonStyle: "button"
186
+ },
187
+ pagination: {
188
+ location: "bottom",
189
+ footerFollow: "bottom",
190
+ showBgColor: true
191
+ }
192
+ },
193
+ pageForm: {
194
+ showTitle: true,
195
+ margin: 50,
196
+ form: {
197
+ gutter: 5,
198
+ labelPosition: "right",
199
+ formItemwidth: 200,
200
+ oneLineControl: 2
201
+ },
202
+ buttons: {
203
+ groupType: false,
204
+ location: "center",
205
+ verticalLocation: "bottom",
206
+ buttonStyle: "button"
207
+ },
208
+ autoSaveLocal: true
209
+ },
210
+ pageFormDialog: {
211
+ showTitle: false,
212
+ margin: 20,
213
+ form: {
214
+ gutter: 5,
215
+ formItemwidth: 125,
216
+ labelPosition: "right",
217
+ oneLineControl: 2
218
+ },
219
+ buttons: {
220
+ location: "end",
221
+ verticalLocation: "bottom",
222
+ buttonStyle: "button"
223
+ }
224
+ },
225
+ isCollapse: false
226
+ }),
227
+ getters: {
228
+ getButtonStyle: (state) => (area) => {
229
+ switch (area) {
230
+ case "form": return state.pageForm.buttons.buttonStyle;
231
+ case "table":
232
+ case "operate": return state.pageTable.buttons.buttonStyle;
233
+ case "search": return state.pageTable.search.buttonStyle;
234
+ case "tableLine": return state.pageTable.table.buttonStyle;
235
+ default: return "button";
236
+ }
237
+ },
238
+ getPaginationLocation: (state) => (location) => {
239
+ if (state.pageTable.pagination.location != "bottom" && location == "top" || state.pageTable.pagination.location != "top" && location == "bottom") return true;
240
+ else return false;
241
+ },
242
+ elementPlusLocale: (state) => () => {
243
+ switch (state.system.locale) {
244
+ case "en": return element_plus_es_locale_lang_en.default;
245
+ case "tw": return element_plus_es_locale_lang_zh_tw.default;
246
+ default: return element_plus_es_locale_lang_zh_cn.default;
247
+ }
248
+ }
249
+ },
250
+ actions: {
251
+ showTitle(pageModel) {
252
+ switch (pageModel) {
253
+ case "form": return this.pageForm.showTitle;
254
+ default: return this.pageTable.showTitle;
255
+ }
256
+ },
257
+ setValue(key, value) {
258
+ const keys = key.split(".");
259
+ let current = this;
260
+ for (let i = 0; i < keys.length - 1; i++) {
261
+ if (!current[keys[i]]) current[keys[i]] = {};
262
+ current = current[keys[i]];
263
+ }
264
+ current[keys[keys.length - 1]] = value;
265
+ },
266
+ isDark() {
267
+ const storeDark = (0, _vueuse_core.useDark)();
268
+ if (storeDark.value != this.system.dark) {
269
+ storeDark.value = this.system.dark;
270
+ (0, _vueuse_core.useToggle)(storeDark);
271
+ }
272
+ return storeDark;
273
+ },
274
+ reset() {
275
+ this.$reset();
276
+ },
277
+ async getFromRemote(url) {
278
+ return await require_utils.http.post(url, {}).then((res) => {
279
+ if (res.status == 0) {
280
+ this.$patch({ ...res.data });
281
+ element_plus.ElMessage.success(res.errorMsg);
282
+ return true;
283
+ } else {
284
+ element_plus.ElMessage.error(res.errorMsg);
285
+ return false;
286
+ }
287
+ });
288
+ },
289
+ saveToRemote(url) {
290
+ const conf = { conf: { ...this.$state } };
291
+ require_utils.http.post(url, conf).then((res) => {
292
+ if (res.status == 0) {
293
+ element_plus.ElMessage.success(res.errorMsg);
294
+ return true;
295
+ } else {
296
+ element_plus.ElMessage.error(res.errorMsg);
297
+ return false;
298
+ }
299
+ });
300
+ },
301
+ toggleCollapse() {
302
+ this.isCollapse = !this.isCollapse;
303
+ }
304
+ },
305
+ persist: {
306
+ key: "localSetting",
307
+ serializer: {
308
+ serialize: (state) => require_utils.rwEncode(state),
309
+ deserialize: (data) => require_utils.rwDecode(data)
310
+ },
311
+ storage: localStorage
312
+ }
313
+ });
314
+ //#endregion
315
+ //#region src/packages/stores/error.ts
316
+ const useErrorStore = (0, pinia.defineStore)("error", { state: () => ({
317
+ err: "",
318
+ instance: null,
319
+ info: ""
320
+ }) });
321
+ //#endregion
322
+ //#region src/packages/stores/index.ts
323
+ const store = (0, pinia.createPinia)().use(pinia_plugin_persistedstate.default);
324
+ //#endregion
325
+ exports.store = store;
326
+ exports.useAppConfigStore = require_utils.useAppConfigStore;
327
+ exports.useColumnsSettingStore = useColumnsSettingStore;
328
+ exports.useErrorStore = useErrorStore;
329
+ exports.useLocalSettingStore = useLocalSettingStore;
330
+ Object.keys(pinia).forEach(function(k) {
331
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
332
+ enumerable: true,
333
+ get: function() {
334
+ return pinia[k];
335
+ }
336
+ });
337
+ });