@antdv-vue/pro-provider 0.0.0-stage → 2.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 (92) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +136 -2
  3. package/dist/ConfigProviderContainer.d.ts +10 -0
  4. package/dist/ConfigProviderContainer.js +207 -0
  5. package/dist/ProConfigProvider.d.ts +12 -0
  6. package/dist/ProConfigProvider.js +115 -0
  7. package/dist/context.d.ts +2810 -0
  8. package/dist/context.js +37 -0
  9. package/dist/index.d.ts +8 -0
  10. package/dist/index.js +7 -0
  11. package/dist/intl.d.ts +220 -0
  12. package/dist/intl.js +188 -0
  13. package/dist/locale/ar_EG.d.ts +6 -0
  14. package/dist/locale/ar_EG.js +99 -0
  15. package/dist/locale/ca_ES.d.ts +6 -0
  16. package/dist/locale/ca_ES.js +99 -0
  17. package/dist/locale/cs_CZ.d.ts +6 -0
  18. package/dist/locale/cs_CZ.js +99 -0
  19. package/dist/locale/de_DE.d.ts +6 -0
  20. package/dist/locale/de_DE.js +99 -0
  21. package/dist/locale/en_GB.d.ts +6 -0
  22. package/dist/locale/en_GB.js +99 -0
  23. package/dist/locale/en_US.d.ts +6 -0
  24. package/dist/locale/en_US.js +99 -0
  25. package/dist/locale/es_ES.d.ts +6 -0
  26. package/dist/locale/es_ES.js +99 -0
  27. package/dist/locale/fa_IR.d.ts +6 -0
  28. package/dist/locale/fa_IR.js +99 -0
  29. package/dist/locale/fr_FR.d.ts +6 -0
  30. package/dist/locale/fr_FR.js +99 -0
  31. package/dist/locale/he_IL.d.ts +6 -0
  32. package/dist/locale/he_IL.js +99 -0
  33. package/dist/locale/hr_HR.d.ts +6 -0
  34. package/dist/locale/hr_HR.js +99 -0
  35. package/dist/locale/id_ID.d.ts +6 -0
  36. package/dist/locale/id_ID.js +99 -0
  37. package/dist/locale/it_IT.d.ts +6 -0
  38. package/dist/locale/it_IT.js +99 -0
  39. package/dist/locale/ja_JP.d.ts +6 -0
  40. package/dist/locale/ja_JP.js +99 -0
  41. package/dist/locale/ko_KR.d.ts +6 -0
  42. package/dist/locale/ko_KR.js +99 -0
  43. package/dist/locale/mn_MN.d.ts +6 -0
  44. package/dist/locale/mn_MN.js +99 -0
  45. package/dist/locale/ms_MY.d.ts +6 -0
  46. package/dist/locale/ms_MY.js +99 -0
  47. package/dist/locale/nl_NL.d.ts +6 -0
  48. package/dist/locale/nl_NL.js +99 -0
  49. package/dist/locale/pl_PL.d.ts +6 -0
  50. package/dist/locale/pl_PL.js +99 -0
  51. package/dist/locale/pt_BR.d.ts +6 -0
  52. package/dist/locale/pt_BR.js +99 -0
  53. package/dist/locale/ro_RO.d.ts +6 -0
  54. package/dist/locale/ro_RO.js +99 -0
  55. package/dist/locale/ru_RU.d.ts +6 -0
  56. package/dist/locale/ru_RU.js +99 -0
  57. package/dist/locale/sk_SK.d.ts +6 -0
  58. package/dist/locale/sk_SK.js +99 -0
  59. package/dist/locale/sr_RS.d.ts +6 -0
  60. package/dist/locale/sr_RS.js +99 -0
  61. package/dist/locale/sv_SE.d.ts +6 -0
  62. package/dist/locale/sv_SE.js +99 -0
  63. package/dist/locale/th_TH.d.ts +6 -0
  64. package/dist/locale/th_TH.js +99 -0
  65. package/dist/locale/tr_TR.d.ts +6 -0
  66. package/dist/locale/tr_TR.js +99 -0
  67. package/dist/locale/uk_UA.d.ts +6 -0
  68. package/dist/locale/uk_UA.js +99 -0
  69. package/dist/locale/uz_UZ.d.ts +6 -0
  70. package/dist/locale/uz_UZ.js +99 -0
  71. package/dist/locale/vi_VN.d.ts +6 -0
  72. package/dist/locale/vi_VN.js +99 -0
  73. package/dist/locale/zh_CN.d.ts +112 -0
  74. package/dist/locale/zh_CN.js +106 -0
  75. package/dist/locale/zh_HK.d.ts +6 -0
  76. package/dist/locale/zh_HK.js +99 -0
  77. package/dist/locale/zh_TW.d.ts +6 -0
  78. package/dist/locale/zh_TW.js +99 -0
  79. package/dist/pro-provider.esm.js +4147 -0
  80. package/dist/typing/layoutToken.d.ts +625 -0
  81. package/dist/typing/layoutToken.js +72 -0
  82. package/dist/typing.d.ts +99 -0
  83. package/dist/typing.js +1 -0
  84. package/dist/useStyle/index.d.ts +162 -0
  85. package/dist/useStyle/index.js +254 -0
  86. package/dist/useStyle/token.d.ts +35 -0
  87. package/dist/useStyle/token.js +421 -0
  88. package/dist/utils/index.d.ts +13 -0
  89. package/dist/utils/index.js +21 -0
  90. package/dist/utils/merge.d.ts +20 -0
  91. package/dist/utils/merge.js +36 -0
  92. package/package.json +65 -3
@@ -0,0 +1,421 @@
1
+ import { computed } from "vue";
2
+ import { createTheme } from "@antdv-next/cssinjs";
3
+ import { theme } from "antdv-next";
4
+ //#region src/useStyle/token.ts
5
+ const defaultToken = {
6
+ blue: "#1677ff",
7
+ purple: "#722ED1",
8
+ cyan: "#13C2C2",
9
+ green: "#52C41A",
10
+ magenta: "#EB2F96",
11
+ pink: "#eb2f96",
12
+ red: "#F5222D",
13
+ orange: "#FA8C16",
14
+ yellow: "#FADB14",
15
+ volcano: "#FA541C",
16
+ geekblue: "#2F54EB",
17
+ gold: "#FAAD14",
18
+ lime: "#A0D911",
19
+ colorPrimary: "#1677ff",
20
+ colorSuccess: "#52c41a",
21
+ colorWarning: "#faad14",
22
+ colorError: "#ff7875",
23
+ colorInfo: "#1677ff",
24
+ colorTextBase: "#000",
25
+ colorBgBase: "#fff",
26
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",
27
+ fontSize: 14,
28
+ lineWidth: 1,
29
+ lineType: "solid",
30
+ motionUnit: .1,
31
+ motionBase: 0,
32
+ motionEaseOutCirc: "cubic-bezier(0.08, 0.82, 0.17, 1)",
33
+ motionEaseInOutCirc: "cubic-bezier(0.78, 0.14, 0.15, 0.86)",
34
+ motionEaseOut: "cubic-bezier(0.215, 0.61, 0.355, 1)",
35
+ motionEaseInOut: "cubic-bezier(0.645, 0.045, 0.355, 1)",
36
+ motionEaseOutBack: "cubic-bezier(0.12, 0.4, 0.29, 1.46)",
37
+ motionEaseInQuint: "cubic-bezier(0.645, 0.045, 0.355, 1)",
38
+ motionEaseOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
39
+ borderRadius: 4,
40
+ sizeUnit: 4,
41
+ sizeStep: 4,
42
+ sizePopupArrow: 16,
43
+ controlHeight: 32,
44
+ zIndexBase: 0,
45
+ zIndexPopupBase: 1e3,
46
+ opacityImage: 1,
47
+ wireframe: false,
48
+ "blue-1": "#e6f4ff",
49
+ "blue-2": "#bae0ff",
50
+ "blue-3": "#91caff",
51
+ "blue-4": "#69b1ff",
52
+ "blue-5": "#4096ff",
53
+ "blue-6": "#1677ff",
54
+ "blue-7": "#0958d9",
55
+ "blue-8": "#003eb3",
56
+ "blue-9": "#002c8c",
57
+ "blue-10": "#001d66",
58
+ "purple-1": "#f9f0ff",
59
+ "purple-2": "#efdbff",
60
+ "purple-3": "#d3adf7",
61
+ "purple-4": "#b37feb",
62
+ "purple-5": "#9254de",
63
+ "purple-6": "#722ed1",
64
+ "purple-7": "#531dab",
65
+ "purple-8": "#391085",
66
+ "purple-9": "#22075e",
67
+ "purple-10": "#120338",
68
+ "cyan-1": "#e6fffb",
69
+ "cyan-2": "#b5f5ec",
70
+ "cyan-3": "#87e8de",
71
+ "cyan-4": "#5cdbd3",
72
+ "cyan-5": "#36cfc9",
73
+ "cyan-6": "#13c2c2",
74
+ "cyan-7": "#08979c",
75
+ "cyan-8": "#006d75",
76
+ "cyan-9": "#00474f",
77
+ "cyan-10": "#002329",
78
+ "green-1": "#f6ffed",
79
+ "green-2": "#d9f7be",
80
+ "green-3": "#b7eb8f",
81
+ "green-4": "#95de64",
82
+ "green-5": "#73d13d",
83
+ "green-6": "#52c41a",
84
+ "green-7": "#389e0d",
85
+ "green-8": "#237804",
86
+ "green-9": "#135200",
87
+ "green-10": "#092b00",
88
+ "magenta-1": "#fff0f6",
89
+ "magenta-2": "#ffd6e7",
90
+ "magenta-3": "#ffadd2",
91
+ "magenta-4": "#ff85c0",
92
+ "magenta-5": "#f759ab",
93
+ "magenta-6": "#eb2f96",
94
+ "magenta-7": "#c41d7f",
95
+ "magenta-8": "#9e1068",
96
+ "magenta-9": "#780650",
97
+ "magenta-10": "#520339",
98
+ "pink-1": "#fff0f6",
99
+ "pink-2": "#ffd6e7",
100
+ "pink-3": "#ffadd2",
101
+ "pink-4": "#ff85c0",
102
+ "pink-5": "#f759ab",
103
+ "pink-6": "#eb2f96",
104
+ "pink-7": "#c41d7f",
105
+ "pink-8": "#9e1068",
106
+ "pink-9": "#780650",
107
+ "pink-10": "#520339",
108
+ "red-1": "#fff1f0",
109
+ "red-2": "#ffccc7",
110
+ "red-3": "#ffa39e",
111
+ "red-4": "#ff7875",
112
+ "red-5": "#ff4d4f",
113
+ "red-6": "#f5222d",
114
+ "red-7": "#cf1322",
115
+ "red-8": "#a8071a",
116
+ "red-9": "#820014",
117
+ "red-10": "#5c0011",
118
+ "orange-1": "#fff7e6",
119
+ "orange-2": "#ffe7ba",
120
+ "orange-3": "#ffd591",
121
+ "orange-4": "#ffc069",
122
+ "orange-5": "#ffa940",
123
+ "orange-6": "#fa8c16",
124
+ "orange-7": "#d46b08",
125
+ "orange-8": "#ad4e00",
126
+ "orange-9": "#873800",
127
+ "orange-10": "#612500",
128
+ "yellow-1": "#feffe6",
129
+ "yellow-2": "#ffffb8",
130
+ "yellow-3": "#fffb8f",
131
+ "yellow-4": "#fff566",
132
+ "yellow-5": "#ffec3d",
133
+ "yellow-6": "#fadb14",
134
+ "yellow-7": "#d4b106",
135
+ "yellow-8": "#ad8b00",
136
+ "yellow-9": "#876800",
137
+ "yellow-10": "#614700",
138
+ "volcano-1": "#fff2e8",
139
+ "volcano-2": "#ffd8bf",
140
+ "volcano-3": "#ffbb96",
141
+ "volcano-4": "#ff9c6e",
142
+ "volcano-5": "#ff7a45",
143
+ "volcano-6": "#fa541c",
144
+ "volcano-7": "#d4380d",
145
+ "volcano-8": "#ad2102",
146
+ "volcano-9": "#871400",
147
+ "volcano-10": "#610b00",
148
+ "geekblue-1": "#f0f5ff",
149
+ "geekblue-2": "#d6e4ff",
150
+ "geekblue-3": "#adc6ff",
151
+ "geekblue-4": "#85a5ff",
152
+ "geekblue-5": "#597ef7",
153
+ "geekblue-6": "#2f54eb",
154
+ "geekblue-7": "#1d39c4",
155
+ "geekblue-8": "#10239e",
156
+ "geekblue-9": "#061178",
157
+ "geekblue-10": "#030852",
158
+ "gold-1": "#fffbe6",
159
+ "gold-2": "#fff1b8",
160
+ "gold-3": "#ffe58f",
161
+ "gold-4": "#ffd666",
162
+ "gold-5": "#ffc53d",
163
+ "gold-6": "#faad14",
164
+ "gold-7": "#d48806",
165
+ "gold-8": "#ad6800",
166
+ "gold-9": "#874d00",
167
+ "gold-10": "#613400",
168
+ "lime-1": "#fcffe6",
169
+ "lime-2": "#f4ffb8",
170
+ "lime-3": "#eaff8f",
171
+ "lime-4": "#d3f261",
172
+ "lime-5": "#bae637",
173
+ "lime-6": "#a0d911",
174
+ "lime-7": "#7cb305",
175
+ "lime-8": "#5b8c00",
176
+ "lime-9": "#3f6600",
177
+ "lime-10": "#254000",
178
+ colorText: "rgba(0, 0, 0, 0.88)",
179
+ colorTextSecondary: "rgba(0, 0, 0, 0.65)",
180
+ colorTextTertiary: "rgba(0, 0, 0, 0.45)",
181
+ colorTextQuaternary: "rgba(0, 0, 0, 0.25)",
182
+ colorFill: "rgba(0, 0, 0, 0.15)",
183
+ colorFillSecondary: "rgba(0, 0, 0, 0.06)",
184
+ colorFillTertiary: "rgba(0, 0, 0, 0.04)",
185
+ colorFillQuaternary: "rgba(0, 0, 0, 0.02)",
186
+ colorBgLayout: "hsl(220,23%,97%)",
187
+ colorBgContainer: "#ffffff",
188
+ colorBgElevated: "#ffffff",
189
+ colorBgSpotlight: "rgba(0, 0, 0, 0.85)",
190
+ colorBorder: "#d9d9d9",
191
+ colorBorderSecondary: "#f0f0f0",
192
+ colorPrimaryBg: "#e6f4ff",
193
+ colorPrimaryBgHover: "#bae0ff",
194
+ colorPrimaryBorder: "#91caff",
195
+ colorPrimaryBorderHover: "#69b1ff",
196
+ colorPrimaryHover: "#4096ff",
197
+ colorPrimaryActive: "#0958d9",
198
+ colorPrimaryTextHover: "#4096ff",
199
+ colorPrimaryText: "#1677ff",
200
+ colorPrimaryTextActive: "#0958d9",
201
+ colorSuccessBg: "#f6ffed",
202
+ colorSuccessBgHover: "#d9f7be",
203
+ colorSuccessBorder: "#b7eb8f",
204
+ colorSuccessBorderHover: "#95de64",
205
+ colorSuccessHover: "#95de64",
206
+ colorSuccessActive: "#389e0d",
207
+ colorSuccessTextHover: "#73d13d",
208
+ colorSuccessText: "#52c41a",
209
+ colorSuccessTextActive: "#389e0d",
210
+ colorErrorBg: "#fff2f0",
211
+ colorErrorBgHover: "#fff1f0",
212
+ colorErrorBorder: "#ffccc7",
213
+ colorErrorBorderHover: "#ffa39e",
214
+ colorErrorHover: "#ffa39e",
215
+ colorErrorActive: "#d9363e",
216
+ colorErrorTextHover: "#ff7875",
217
+ colorErrorText: "#ff4d4f",
218
+ colorErrorTextActive: "#d9363e",
219
+ colorWarningBg: "#fffbe6",
220
+ colorWarningBgHover: "#fff1b8",
221
+ colorWarningBorder: "#ffe58f",
222
+ colorWarningBorderHover: "#ffd666",
223
+ colorWarningHover: "#ffd666",
224
+ colorWarningActive: "#d48806",
225
+ colorWarningTextHover: "#ffc53d",
226
+ colorWarningText: "#faad14",
227
+ colorWarningTextActive: "#d48806",
228
+ colorInfoBg: "#e6f4ff",
229
+ colorInfoBgHover: "#bae0ff",
230
+ colorInfoBorder: "#91caff",
231
+ colorInfoBorderHover: "#69b1ff",
232
+ colorInfoHover: "#69b1ff",
233
+ colorInfoActive: "#0958d9",
234
+ colorInfoTextHover: "#4096ff",
235
+ colorInfoText: "#1677ff",
236
+ colorInfoTextActive: "#0958d9",
237
+ colorBgMask: "rgba(0, 0, 0, 0.45)",
238
+ colorWhite: "#fff",
239
+ sizeXXL: 48,
240
+ sizeXL: 32,
241
+ sizeLG: 24,
242
+ sizeMD: 20,
243
+ sizeMS: 16,
244
+ size: 16,
245
+ sizeSM: 12,
246
+ sizeXS: 8,
247
+ sizeXXS: 4,
248
+ controlHeightSM: 24,
249
+ controlHeightXS: 16,
250
+ controlHeightLG: 40,
251
+ motionDurationFast: "0.1s",
252
+ motionDurationMid: "0.2s",
253
+ motionDurationSlow: "0.3s",
254
+ fontSizes: [
255
+ 12,
256
+ 14,
257
+ 16,
258
+ 20,
259
+ 24,
260
+ 30,
261
+ 38,
262
+ 46,
263
+ 56,
264
+ 68
265
+ ],
266
+ lineHeights: [
267
+ 1.6666666666666667,
268
+ 1.5714285714285714,
269
+ 1.5,
270
+ 1.4,
271
+ 1.3333333333333333,
272
+ 1.2666666666666666,
273
+ 1.2105263157894737,
274
+ 1.173913043478261,
275
+ 1.1428571428571428,
276
+ 1.1176470588235294
277
+ ],
278
+ lineWidthBold: 2,
279
+ borderRadiusXS: 1,
280
+ borderRadiusSM: 4,
281
+ borderRadiusLG: 8,
282
+ borderRadiusOuter: 4,
283
+ colorLink: "#1677ff",
284
+ colorLinkHover: "#69b1ff",
285
+ colorLinkActive: "#0958d9",
286
+ colorFillContent: "rgba(0, 0, 0, 0.06)",
287
+ colorFillContentHover: "rgba(0, 0, 0, 0.15)",
288
+ colorFillAlter: "rgba(0, 0, 0, 0.02)",
289
+ colorBgContainerDisabled: "rgba(0, 0, 0, 0.04)",
290
+ colorBorderBg: "#ffffff",
291
+ colorSplit: "rgba(5, 5, 5, 0.06)",
292
+ colorTextPlaceholder: "rgba(0, 0, 0, 0.25)",
293
+ colorTextDisabled: "rgba(0, 0, 0, 0.25)",
294
+ colorTextHeading: "rgba(0, 0, 0, 0.88)",
295
+ colorTextLabel: "rgba(0, 0, 0, 0.65)",
296
+ colorTextDescription: "rgba(0, 0, 0, 0.45)",
297
+ colorTextLightSolid: "#fff",
298
+ colorHighlight: "#ff7875",
299
+ colorBgTextHover: "rgba(0, 0, 0, 0.06)",
300
+ colorBgTextActive: "rgba(0, 0, 0, 0.15)",
301
+ colorIcon: "rgba(0, 0, 0, 0.45)",
302
+ colorIconHover: "rgba(0, 0, 0, 0.88)",
303
+ colorErrorOutline: "rgba(255, 38, 5, 0.06)",
304
+ colorWarningOutline: "rgba(255, 215, 5, 0.1)",
305
+ fontSizeSM: 12,
306
+ fontSizeLG: 16,
307
+ fontSizeXL: 20,
308
+ fontSizeHeading1: 38,
309
+ fontSizeHeading2: 30,
310
+ fontSizeHeading3: 24,
311
+ fontSizeHeading4: 20,
312
+ fontSizeHeading5: 16,
313
+ fontSizeIcon: 12,
314
+ lineHeight: 1.5714285714285714,
315
+ lineHeightLG: 1.5,
316
+ lineHeightSM: 1.6666666666666667,
317
+ lineHeightHeading1: 1.2105263157894737,
318
+ lineHeightHeading2: 1.2666666666666666,
319
+ lineHeightHeading3: 1.3333333333333333,
320
+ lineHeightHeading4: 1.4,
321
+ lineHeightHeading5: 1.5,
322
+ controlOutlineWidth: 2,
323
+ controlInteractiveSize: 16,
324
+ controlItemBgHover: "rgba(0, 0, 0, 0.04)",
325
+ controlItemBgActive: "#e6f4ff",
326
+ controlItemBgActiveHover: "#bae0ff",
327
+ controlItemBgActiveDisabled: "rgba(0, 0, 0, 0.15)",
328
+ controlTmpOutline: "rgba(0, 0, 0, 0.02)",
329
+ controlOutline: "rgba(5, 145, 255, 0.1)",
330
+ fontWeightStrong: 600,
331
+ opacityLoading: .65,
332
+ linkDecoration: "none",
333
+ linkHoverDecoration: "none",
334
+ linkFocusDecoration: "none",
335
+ controlPaddingHorizontal: 12,
336
+ controlPaddingHorizontalSM: 8,
337
+ paddingXXS: 4,
338
+ paddingXS: 8,
339
+ paddingSM: 12,
340
+ padding: 16,
341
+ paddingMD: 20,
342
+ paddingLG: 24,
343
+ paddingXL: 32,
344
+ paddingContentHorizontalLG: 24,
345
+ paddingContentVerticalLG: 16,
346
+ paddingContentHorizontal: 16,
347
+ paddingContentVertical: 12,
348
+ paddingContentHorizontalSM: 16,
349
+ paddingContentVerticalSM: 8,
350
+ marginXXS: 4,
351
+ marginXS: 8,
352
+ marginSM: 12,
353
+ margin: 16,
354
+ marginMD: 20,
355
+ marginLG: 24,
356
+ marginXL: 32,
357
+ marginXXL: 48,
358
+ boxShadow: "0 1px 2px 0 rgba(0, 0, 0, 0.03),0 1px 6px -1px rgba(0, 0, 0, 0.02),0 2px 4px 0 rgba(0, 0, 0, 0.02)",
359
+ boxShadowSecondary: "0 6px 16px 0 rgba(0, 0, 0, 0.08),0 3px 6px -4px rgba(0, 0, 0, 0.12),0 9px 28px 8px rgba(0, 0, 0, 0.05)",
360
+ screenXS: 480,
361
+ screenXSMin: 480,
362
+ screenXSMax: 479,
363
+ screenSM: 576,
364
+ screenSMMin: 576,
365
+ screenSMMax: 575,
366
+ screenMD: 768,
367
+ screenMDMin: 768,
368
+ screenMDMax: 767,
369
+ screenLG: 992,
370
+ screenLGMin: 992,
371
+ screenLGMax: 991,
372
+ screenXL: 1200,
373
+ screenXLMin: 1200,
374
+ screenXLMax: 1199,
375
+ screenXXL: 1600,
376
+ screenXXLMin: 1600,
377
+ screenXXLMax: 1599,
378
+ boxShadowPopoverArrow: "3px 3px 7px rgba(0, 0, 0, 0.1)",
379
+ boxShadowCard: "0 1px 2px -2px rgba(0, 0, 0, 0.16),0 3px 6px 0 rgba(0, 0, 0, 0.12),0 5px 12px 4px rgba(0, 0, 0, 0.09)",
380
+ boxShadowDrawerRight: "-6px 0 16px 0 rgba(0, 0, 0, 0.08),-3px 0 6px -4px rgba(0, 0, 0, 0.12),-9px 0 28px 8px rgba(0, 0, 0, 0.05)",
381
+ boxShadowDrawerLeft: "6px 0 16px 0 rgba(0, 0, 0, 0.08),3px 0 6px -4px rgba(0, 0, 0, 0.12),9px 0 28px 8px rgba(0, 0, 0, 0.05)",
382
+ boxShadowDrawerUp: "0 6px 16px 0 rgba(0, 0, 0, 0.08),0 3px 6px -4px rgba(0, 0, 0, 0.12),0 9px 28px 8px rgba(0, 0, 0, 0.05)",
383
+ boxShadowDrawerDown: "0 -6px 16px 0 rgba(0, 0, 0, 0.08),0 -3px 6px -4px rgba(0, 0, 0, 0.12),0 -9px 28px 8px rgba(0, 0, 0, 0.05)",
384
+ boxShadowTabsOverflowLeft: "inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",
385
+ boxShadowTabsOverflowRight: "inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",
386
+ boxShadowTabsOverflowTop: "inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",
387
+ boxShadowTabsOverflowBottom: "inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)",
388
+ _tokenKey: "19w80ff",
389
+ _hashId: "css-dev-only-do-not-override-i2zu9q"
390
+ };
391
+ function hashCode(str, seed = 1) {
392
+ let h1 = 3735928559 ^ seed;
393
+ let h2 = 1103547991 ^ seed;
394
+ for (let i = 0, ch; i < str.length; i++) {
395
+ ch = str.charCodeAt(i);
396
+ h1 = Math.imul(h1 ^ ch, 2654435761);
397
+ h2 = Math.imul(h2 ^ ch, 1597334677);
398
+ }
399
+ h1 = Math.imul(h1 ^ h1 >>> 16, 2246822507) ^ Math.imul(h2 ^ h2 >>> 13, 3266489909);
400
+ h2 = Math.imul(h2 ^ h2 >>> 16, 2246822507) ^ Math.imul(h1 ^ h1 >>> 13, 3266489909);
401
+ return 4294967296 * (2097151 & h2) + (h1 >>> 0);
402
+ }
403
+ const emptyTheme = createTheme((token) => token);
404
+ const token = {
405
+ theme: computed(() => emptyTheme),
406
+ token: computed(() => ({
407
+ ...defaultToken,
408
+ ...theme?.defaultAlgorithm?.(theme?.defaultSeed)
409
+ })),
410
+ hashId: computed(() => `pro-${hashCode(JSON.stringify(defaultToken))}`)
411
+ };
412
+ const useToken = () => token;
413
+ var token_default = {
414
+ useToken,
415
+ token,
416
+ emptyTheme,
417
+ hashCode,
418
+ defaultToken
419
+ };
420
+ //#endregion
421
+ export { token_default as default, defaultToken, emptyTheme, hashCode, token, useToken };
@@ -0,0 +1,13 @@
1
+ //#region src/utils/index.d.ts
2
+ /**
3
+ * 用于判断当前是否需要开启哈希(Hash)模式。
4
+ *
5
+ * 下列场景返回 `false`(关闭 hash,便于快照/调试):
6
+ * - env === 'test'`(单元测试快照稳定)
7
+ * - `env === 'development'`(本地开发时样式调试更直观)
8
+ *
9
+ * 其余环境(含生产、未设置 env)一律返回 `true`。
10
+ */
11
+ declare function isNeedOpenHash(): boolean;
12
+ //#endregion
13
+ export { isNeedOpenHash };
@@ -0,0 +1,21 @@
1
+ //#region src/utils/index.ts
2
+ /**
3
+ * 用于判断当前是否需要开启哈希(Hash)模式。
4
+ *
5
+ * 下列场景返回 `false`(关闭 hash,便于快照/调试):
6
+ * - env === 'test'`(单元测试快照稳定)
7
+ * - `env === 'development'`(本地开发时样式调试更直观)
8
+ *
9
+ * 其余环境(含生产、未设置 env)一律返回 `true`。
10
+ */
11
+ function isNeedOpenHash() {
12
+ try {
13
+ const env = import.meta.env.MODE?.toLowerCase() || process.env.NODE_ENV?.toLowerCase();
14
+ if (env === "test" || env === "development") return false;
15
+ return true;
16
+ } catch (error) {
17
+ return true;
18
+ }
19
+ }
20
+ //#endregion
21
+ export { isNeedOpenHash };
@@ -0,0 +1,20 @@
1
+ //#region src/utils/merge.d.ts
2
+ /**
3
+ * 只合并一层深的对象合并工具。
4
+ *
5
+ * 与 lodash.merge 的区别:仅对**顶层同名的普通对象**做一次 `{...a, ...b}` 展开,
6
+ * 再深一层的嵌套对象会被整体覆盖而不是继续递归合并。数组一律走覆盖语义。
7
+ *
8
+ * 在 ProProvider 里用来合并 token 时足够了,因为 layout token 的深合并已经
9
+ * 在 `getLayoutDesignToken` 里提前做过。
10
+ *
11
+ * @example
12
+ * shallowMergeOneLevel({ a: { x: 1 } }, { a: { y: 2 } })
13
+ * // => { a: { x: 1, y: 2 } } ← 顶层对象合并
14
+ *
15
+ * shallowMergeOneLevel({ a: { b: { x: 1 } } }, { a: { b: { y: 2 } } })
16
+ * // => { a: { b: { y: 2 } } } ← 二层对象被覆盖,不会深合并
17
+ */
18
+ declare function shallowMergeOneLevel<T extends Record<string, any>>(...sources: any[]): T;
19
+ //#endregion
20
+ export { shallowMergeOneLevel };
@@ -0,0 +1,36 @@
1
+ //#region src/utils/merge.ts
2
+ /**
3
+ * 只合并一层深的对象合并工具。
4
+ *
5
+ * 与 lodash.merge 的区别:仅对**顶层同名的普通对象**做一次 `{...a, ...b}` 展开,
6
+ * 再深一层的嵌套对象会被整体覆盖而不是继续递归合并。数组一律走覆盖语义。
7
+ *
8
+ * 在 ProProvider 里用来合并 token 时足够了,因为 layout token 的深合并已经
9
+ * 在 `getLayoutDesignToken` 里提前做过。
10
+ *
11
+ * @example
12
+ * shallowMergeOneLevel({ a: { x: 1 } }, { a: { y: 2 } })
13
+ * // => { a: { x: 1, y: 2 } } ← 顶层对象合并
14
+ *
15
+ * shallowMergeOneLevel({ a: { b: { x: 1 } } }, { a: { b: { y: 2 } } })
16
+ * // => { a: { b: { y: 2 } } } ← 二层对象被覆盖,不会深合并
17
+ */
18
+ function shallowMergeOneLevel(...sources) {
19
+ const result = {};
20
+ for (let i = 0; i < sources.length; i += 1) {
21
+ const source = sources[i];
22
+ if (!source) continue;
23
+ for (const key in source) {
24
+ if (!Object.prototype.hasOwnProperty.call(source, key)) continue;
25
+ const prev = result[key];
26
+ const next = source[key];
27
+ result[key] = typeof prev === "object" && typeof next === "object" && prev !== null && next !== null && !Array.isArray(prev) && !Array.isArray(next) ? {
28
+ ...prev,
29
+ ...next
30
+ } : next;
31
+ }
32
+ }
33
+ return result;
34
+ }
35
+ //#endregion
36
+ export { shallowMergeOneLevel };
package/package.json CHANGED
@@ -1,6 +1,68 @@
1
1
  {
2
2
  "name": "@antdv-vue/pro-provider",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "type": "module",
4
+ "version": "2.0.0",
5
+ "description": "@antdv-vue/pro-provider",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/bunnyblueair/pro-components.git",
9
+ "directory": "packages/provider"
10
+ },
11
+ "sideEffects": [
12
+ "./dist/pro-provider.esm.js"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js",
18
+ "default": "./dist/index.js"
19
+ },
20
+ "./dist/*": {
21
+ "types": "./dist/*.d.ts",
22
+ "import": "./dist/*.js",
23
+ "default": "./dist/*.js"
24
+ },
25
+ "./dist/pro-provider.esm.js": "./dist/pro-provider.esm.js"
26
+ },
27
+ "main": "./dist/index.js",
28
+ "module": "./dist/index.js",
29
+ "types": "./dist/index.d.ts",
30
+ "files": [
31
+ "CHANGELOG.md",
32
+ "LICENSE",
33
+ "README.md",
34
+ "dist",
35
+ "package.json"
36
+ ],
37
+ "scripts": {
38
+ "build": "run-s build:esm build:full-esm",
39
+ "build:esm": "tsdown --config-loader unrun",
40
+ "build:full-esm": "vite build"
41
+ },
42
+ "browserslist": [
43
+ "last 2 versions",
44
+ "Firefox ESR",
45
+ "> 1%",
46
+ "ie >= 11"
47
+ ],
48
+ "peerDependencies": {
49
+ "antdv-next": ">=1.8.0",
50
+ "vue": ">=3.5.30"
51
+ },
52
+ "dependencies": {
53
+ "@ant-design/fast-color": "^3.0.1",
54
+ "@antdv-next/cssinjs": "^1.0.6",
55
+ "@v-c/util": "^1.0.21",
56
+ "dayjs": "^1.11.20"
57
+ },
58
+ "devDependencies": {
59
+ "csstype": "^3.2.3",
60
+ "typescript": "~5.9.3"
61
+ },
62
+ "publishConfig": {
63
+ "access": "public"
64
+ },
65
+ "authors": [
66
+ "lucasjeke <lucasjekeqd@gmail.com> (https://github.com/lucasjeke)"
67
+ ]
6
68
  }