dlzn-ui 1.56.0 → 1.58.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.
- package/assets/css/element-plus-reset.css +79 -0
- package/assets/css/index.css +5 -0
- package/assets/css/other.css +16 -0
- package/assets/css/tailwindcss-entry.css +20 -0
- package/assets/css/tdesign-chat-reset.css +33 -0
- package/assets/css/tdesign-reset.css +355 -0
- package/components/card/src/card.mjs +0 -2
- package/components/card/src/card.vue_vue_type_script_setup_true_lang.mjs +0 -2
- package/components/card/src/card2.mjs +0 -2
- package/constants/index.d.ts +1 -0
- package/constants/index.mjs +2 -0
- package/constants/others.d.ts +3 -0
- package/constants/others.mjs +4 -0
- package/ejs/slide-puzzle.ejs +135 -0
- package/index.html +57 -0
- package/package.json +23 -2
- package/types/env.d.ts +6 -0
- package/types/globle.d.ts +10 -0
- package/types/shims.d.ts +8 -0
- package/utils/boolean.d.ts +10 -0
- package/utils/boolean.mjs +14 -0
- package/utils/index.d.ts +5 -0
- package/utils/index.mjs +6 -0
- package/utils/number.d.ts +12 -0
- package/utils/number.mjs +33 -0
- package/utils/string.d.ts +14 -0
- package/utils/string.mjs +17 -0
- package/utils/tool.d.ts +4 -0
- package/utils/tool.mjs +21 -0
- package/utils/tree.d.ts +26 -0
- package/utils/tree.mjs +36 -0
- package/component.d.ts +0 -2
- package/component.mjs +0 -2
- package/components/card/src/card.mjs.map +0 -1
- package/components/card/src/card.vue_vue_type_script_setup_true_lang.mjs.map +0 -1
- package/components/card/src/card2.mjs.map +0 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* stylelint-disable selector-class-pattern */
|
|
2
|
+
body {
|
|
3
|
+
.el-popper__arrow {
|
|
4
|
+
display: none;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.el-input__icon {
|
|
8
|
+
&.clear-icon {
|
|
9
|
+
font-size: 16px;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.el-date-editor {
|
|
14
|
+
&.is-focus .el-input__wrapper {
|
|
15
|
+
/* 非range focus */
|
|
16
|
+
box-shadow: 0 0 0 2px var(--el-input-focus-border-color) inset;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.t-is-success {
|
|
20
|
+
.el-input__wrapper {
|
|
21
|
+
--el-input-border-color: var(--td-success-color);
|
|
22
|
+
--el-input-hover-border-color: var(--td-success-color);
|
|
23
|
+
--el-input-focus-border-color: var(--td-success-color);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.t-is-warning {
|
|
28
|
+
.el-input__wrapper {
|
|
29
|
+
--el-input-border-color: var(--td-warning-color);
|
|
30
|
+
--el-input-hover-border-color: var(--td-warning-color);
|
|
31
|
+
--el-input-focus-border-color: var(--td-warning-color);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&.t-is-error {
|
|
36
|
+
.el-input__wrapper {
|
|
37
|
+
--el-input-border-color: var(--td-error-color);
|
|
38
|
+
--el-input-hover-border-color: var(--td-error-color);
|
|
39
|
+
--el-input-focus-border-color: var(--td-error-color);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.el-range-editor {
|
|
45
|
+
&.is-active {
|
|
46
|
+
/* range focus */
|
|
47
|
+
box-shadow: 0 0 0 2px var(--el-input-focus-border-color) inset !important;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.el-input__wrapper {
|
|
52
|
+
&.is-focus {
|
|
53
|
+
/* 时间输入框 focus */
|
|
54
|
+
box-shadow: 0 0 0 2px var(--el-input-focus-border-color) inset;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.t-form__controls {
|
|
59
|
+
&.t-is-error {
|
|
60
|
+
.el-input__wrapper {
|
|
61
|
+
/* TDatePicker */
|
|
62
|
+
--el-input-border-color: var(--td-error-color);
|
|
63
|
+
|
|
64
|
+
/* TDatePicker */
|
|
65
|
+
--el-input-hover-border-color: var(--td-error-color);
|
|
66
|
+
|
|
67
|
+
/* TDatePicker */
|
|
68
|
+
--el-input-focus-border-color: var(--td-error-color);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.el-date-editor {
|
|
73
|
+
--el-date-editor-width: 100%;
|
|
74
|
+
--el-date-editor-monthrange-width: 100%;
|
|
75
|
+
--el-date-editor-daterange-width: 100%;
|
|
76
|
+
--el-date-editor-datetimerange-width: 100%;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
@theme {
|
|
4
|
+
--font-sans: blinkmacsystemfont, -apple-system, 'Segoe UI', roboto, helvetica, arial, sans-serif;
|
|
5
|
+
|
|
6
|
+
/* stylelint-disable-next-line custom-property-pattern */
|
|
7
|
+
--color-*: initial;
|
|
8
|
+
|
|
9
|
+
/* 自定义变量 */
|
|
10
|
+
|
|
11
|
+
/* --color-primary: var(--td-brand-color-active); */
|
|
12
|
+
|
|
13
|
+
/* 同tdesign 保持一致 */
|
|
14
|
+
--breakpoint-xs: 20rem;
|
|
15
|
+
--breakpoint-sm: 48rem;
|
|
16
|
+
--breakpoint-md: 62rem;
|
|
17
|
+
--breakpoint-lg: 75rem;
|
|
18
|
+
--breakpoint-xl: 87.5rem;
|
|
19
|
+
--breakpoint-2xl: 117.5rem;
|
|
20
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* stylelint-disable custom-property-pattern */
|
|
2
|
+
.chatbot_wrapper {
|
|
3
|
+
--td-chat-item-gap: 12px;
|
|
4
|
+
--td-chat-item-left-avatar-margin: 0 8px 0 4px;
|
|
5
|
+
--td-chat-item-right-avatar-margin: 0 4px 0 8px;
|
|
6
|
+
--td-chat-item-content-padding: 6px 0 0;
|
|
7
|
+
--td-chat-font-size: var(--td-font-size-body-medium);
|
|
8
|
+
--td-chat-item-text-padding: var(--td-comp-paddingTB-s) var(--td-comp-paddingLR-s);
|
|
9
|
+
|
|
10
|
+
::part(t-chat__input__content) {
|
|
11
|
+
border-radius: var(--td-radius-default);
|
|
12
|
+
|
|
13
|
+
&:focus-within {
|
|
14
|
+
box-shadow: 0 0 0 1px var(--td-brand-color) inset;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
::part(t-chat__text--user) {
|
|
19
|
+
background-color: var(--td-bg-color-container-active);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
::part(t-chat__input) {
|
|
23
|
+
padding: 0 12px 12px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
::part(t-chat__list) {
|
|
27
|
+
padding: 0 12px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
::part(t-chat__item__inner) {
|
|
31
|
+
margin-top: 12px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
/* stylelint-disable custom-property-pattern */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--td-radius-default: 4px;
|
|
5
|
+
--td-radius-large: 8px;
|
|
6
|
+
--td-font-family: var(--font-sans);
|
|
7
|
+
--td-font-family-medium: var(--font-sans);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:root,
|
|
11
|
+
:root[theme-mode='light'] {
|
|
12
|
+
--td-font-gray-1: rgb(0 0 0 / 70%);
|
|
13
|
+
--td-brand-color-1: #f2f3ff;
|
|
14
|
+
--td-brand-color-2: #cadffc;
|
|
15
|
+
--td-brand-color-3: #a1cbfa;
|
|
16
|
+
--td-brand-color-4: #79b7f7;
|
|
17
|
+
--td-brand-color-5: #51a2f4;
|
|
18
|
+
--td-brand-color-6: #288ef2;
|
|
19
|
+
--td-brand-color-7: #007aef;
|
|
20
|
+
--td-brand-color-8: #005fbb;
|
|
21
|
+
--td-brand-color-9: #004586;
|
|
22
|
+
--td-brand-color-10: #002a52;
|
|
23
|
+
--td-gray-color-1: #fafafa;
|
|
24
|
+
--td-bg-color-page: rgb(244 245 250);
|
|
25
|
+
--td-shadow-1:
|
|
26
|
+
0 2px 2px -1px rgb(58 53 65 / 8%), 0 1px 5px 1px rgb(58 53 65 / 12%),
|
|
27
|
+
0 1px 8px 1px rgb(58 53 65 / 4%);
|
|
28
|
+
--td-shadow-2:
|
|
29
|
+
0 4px 5px -2px rgb(58 53 65 / 8%), 0 2px 10px 1px rgb(58 53 65 / 12%),
|
|
30
|
+
0 2px 16px 1px rgb(58 53 65 / 4%);
|
|
31
|
+
--td-shadow-3:
|
|
32
|
+
0 5px 7px -3px rgb(58 53 65 / 8%), 0 3px 13px 1px rgb(58 53 65 / 12%),
|
|
33
|
+
0 3px 21px 1px rgb(58 53 65 / 4%);
|
|
34
|
+
--td-mask-active: rgb(58 53 65 / 32%);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
body {
|
|
38
|
+
> .t-loading__overlay {
|
|
39
|
+
background-color: rgb(255 255 255 / 10%);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.t-list-item {
|
|
43
|
+
&:last-child {
|
|
44
|
+
&::after {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.t-radio__input,
|
|
51
|
+
.t-checkbox__input {
|
|
52
|
+
width: 20px;
|
|
53
|
+
height: 20px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.t-radio {
|
|
57
|
+
&.t-is-checked {
|
|
58
|
+
.t-radio__input {
|
|
59
|
+
border-width: 2px;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.t-checkbox {
|
|
65
|
+
&.t-is-checked {
|
|
66
|
+
.t-checkbox__input {
|
|
67
|
+
transition: none;
|
|
68
|
+
|
|
69
|
+
&::after {
|
|
70
|
+
top: 8px;
|
|
71
|
+
left: 3px;
|
|
72
|
+
width: 8px;
|
|
73
|
+
height: 14px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.t-is-indeterminate {
|
|
79
|
+
.t-checkbox__input {
|
|
80
|
+
transition: none;
|
|
81
|
+
|
|
82
|
+
&::after {
|
|
83
|
+
top: 7px;
|
|
84
|
+
left: -4px;
|
|
85
|
+
width: 26px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* 里层的状态干不过外层的状态 */
|
|
92
|
+
.t-input:not(.t-range-input .t-input), /* input select inputNumber tagInput treeSelect */
|
|
93
|
+
.t-range-input, /* rangeInput */
|
|
94
|
+
.t-textarea__inner /* textarea */ {
|
|
95
|
+
&.t-is-focused,
|
|
96
|
+
&.t-input--focused {
|
|
97
|
+
box-shadow: 0 0 0 1px var(--td-brand-color) inset;
|
|
98
|
+
|
|
99
|
+
&.t-is-success {
|
|
100
|
+
box-shadow: 0 0 0 1px var(--td-success-color) inset;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&.t-is-warning {
|
|
104
|
+
box-shadow: 0 0 0 1px var(--td-warning-color) inset;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&.t-is-error {
|
|
108
|
+
box-shadow: 0 0 0 1px var(--td-error-color) inset;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.t-is-error {
|
|
114
|
+
.t-form__controls-content {
|
|
115
|
+
.t-input:not(.t-range-input .t-input),
|
|
116
|
+
.t-range-input,
|
|
117
|
+
.t-textarea__inner {
|
|
118
|
+
&.t-is-focused,
|
|
119
|
+
&.t-input--focused {
|
|
120
|
+
box-shadow: 0 0 0 1px var(--td-error-color) inset;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.t-tabs {
|
|
127
|
+
overflow: visible;
|
|
128
|
+
|
|
129
|
+
.t-tabs__nav-item {
|
|
130
|
+
/* stylelint-disable-next-line selector-class-pattern */
|
|
131
|
+
.remove-btn {
|
|
132
|
+
position: relative;
|
|
133
|
+
right: 4px;
|
|
134
|
+
padding: 2px;
|
|
135
|
+
margin-left: 0;
|
|
136
|
+
font-size: 22px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&:not(.t-is-disabled) {
|
|
140
|
+
/* stylelint-disable-next-line selector-class-pattern */
|
|
141
|
+
.remove-btn {
|
|
142
|
+
&:hover {
|
|
143
|
+
background-color: var(--td-bg-color-container-hover);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&:not(.t-is-active) {
|
|
148
|
+
&:hover {
|
|
149
|
+
.t-tabs__nav-item-wrapper {
|
|
150
|
+
background-color: inherit;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.t-tabs__nav-item-wrapper {
|
|
155
|
+
&:hover {
|
|
156
|
+
background-color: var(--td-bg-color-container-hover);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.t-tabs__operations--left,
|
|
164
|
+
.t-tabs__operations--right {
|
|
165
|
+
bottom: 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.t-tabs__content {
|
|
169
|
+
overflow: visible;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.t-dialog__ctx {
|
|
174
|
+
.t-dialog__mask {
|
|
175
|
+
background-color: rgb(58 53 65 / 32%);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.t-dialog {
|
|
179
|
+
min-width: 320px;
|
|
180
|
+
max-width: calc(100% - 20px);
|
|
181
|
+
border-radius: var(--td-radius-default);
|
|
182
|
+
box-shadow:
|
|
183
|
+
rgb(58 53 65 / 8%) 0 11px 15px -7px,
|
|
184
|
+
rgb(58 53 65 / 12%) 0 24px 38px 3px,
|
|
185
|
+
rgb(58 53 65 / 4%) 0 9px 46px 8px;
|
|
186
|
+
|
|
187
|
+
&.t-dialog--default {
|
|
188
|
+
padding: var(--td-size-7);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
[class^='t-dialog__body'] {
|
|
192
|
+
&:is(:last-child),
|
|
193
|
+
&:has(> .t-form:is(:last-child)) {
|
|
194
|
+
padding-bottom: 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&:has(> .t-typography:is(:first-child)),
|
|
198
|
+
&:has(> div:is(:first-child) > .t-typography:is(:first-child)),
|
|
199
|
+
&:has(> div:is(:first-child) > div:is(:first-child) > .t-typography:is(:first-child)) {
|
|
200
|
+
padding-top: 0;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&:has(.no_dialog_pt) {
|
|
204
|
+
padding-top: 0;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.t-dialog__footer {
|
|
209
|
+
@apply pt-0;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.t-dialog--draggable {
|
|
214
|
+
.t-dialog__header-content {
|
|
215
|
+
cursor: move;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.t-link {
|
|
221
|
+
display: inline;
|
|
222
|
+
|
|
223
|
+
.t-link__prefix-icon {
|
|
224
|
+
display: inline;
|
|
225
|
+
margin-right: 0;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.t-link__suffix-icon {
|
|
229
|
+
display: inline;
|
|
230
|
+
margin-left: 0;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.t-tree__icon {
|
|
235
|
+
&:has(> .t-button) {
|
|
236
|
+
display: flex;
|
|
237
|
+
justify-content: center;
|
|
238
|
+
width: 32px;
|
|
239
|
+
|
|
240
|
+
.t-button {
|
|
241
|
+
left: 2px;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
&:empty {
|
|
246
|
+
display: none;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.t-tree__item {
|
|
251
|
+
padding: 0 0 0 calc(32px * var(--level));
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.t-tree__line {
|
|
255
|
+
--space: 32px;
|
|
256
|
+
|
|
257
|
+
&::before {
|
|
258
|
+
width: 20px;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
left: calc(32px * var(--level) - 14px);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.t-input-adornment__append,
|
|
265
|
+
.t-input-adornment__prepend {
|
|
266
|
+
@apply flex items-center;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.t-list__load {
|
|
270
|
+
font-size: var(--td-font-size-body-small);
|
|
271
|
+
line-height: var(--td-line-height-body-small);
|
|
272
|
+
color: var(--td-text-color-placeholder);
|
|
273
|
+
background: transparent;
|
|
274
|
+
|
|
275
|
+
&:not(:empty) {
|
|
276
|
+
padding: var(--td-comp-paddingTB-s) var(--td-comp-paddingLR-l);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
&.t-list__load--load-more {
|
|
280
|
+
cursor: pointer;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.t-list__header,
|
|
285
|
+
.t-list__footer {
|
|
286
|
+
padding: 0;
|
|
287
|
+
background: transparent;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.t-input-adornment {
|
|
291
|
+
.t-input-adornment__prepend,
|
|
292
|
+
.t-input-adornment__append {
|
|
293
|
+
&:has(> .t-button) {
|
|
294
|
+
flex-shrink: 0;
|
|
295
|
+
overflow: hidden;
|
|
296
|
+
border: 1px solid var(--td-border-level-2-color);
|
|
297
|
+
|
|
298
|
+
.t-button {
|
|
299
|
+
margin: -1px;
|
|
300
|
+
border-radius: 0;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
&:has(> .t-button.t-button--theme-primary) {
|
|
305
|
+
border: none;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.t-drawer {
|
|
311
|
+
.t-drawer__body {
|
|
312
|
+
&:has(.no_drawer_body_padding) {
|
|
313
|
+
padding: 0;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.t-drawer__content-wrapper {
|
|
318
|
+
&:has(.no_drawer_content_shadow) {
|
|
319
|
+
box-shadow: none;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.t-popup {
|
|
325
|
+
&.t-is-head-menu {
|
|
326
|
+
.t-menu__item {
|
|
327
|
+
--td-comp-paddingLR-l: var(--td-size-4);
|
|
328
|
+
|
|
329
|
+
.t-menu__content {
|
|
330
|
+
width: 100%;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.t-popup__content {
|
|
337
|
+
border: 1px solid var(--td-border-level-2-color);
|
|
338
|
+
box-shadow: var(--td-shadow-2);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.t-empty {
|
|
342
|
+
@apply flex flex-col justify-center;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
@media (width <= 540px) {
|
|
347
|
+
.t-dialog {
|
|
348
|
+
.t-form__item {
|
|
349
|
+
/* stylelint-disable-next-line selector-class-pattern */
|
|
350
|
+
&[class*='col-span-'] {
|
|
351
|
+
@apply col-span-full;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './others';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const passwordReg: RegExp;
|
|
2
|
+
export declare const passwordRegMessage = "\u5BC6\u78018\u4F4D\u53CA\u4EE5\u4E0A\uFF0C\u542B\u5927\u5199\u5B57\u6BCD\u3001\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u7279\u6B8A\u5B57\u7B26\u4E2D\u81F3\u5C11\u4E09\u7C7B";
|
|
3
|
+
export declare const validNumberStringReg: RegExp;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region ../../packages/constants/others.ts
|
|
2
|
+
var e = /^(?=[!-~]{8,}$)(?:(?=.*[A-Z])(?=.*[a-z])(?=.*\d)|(?=.*[A-Z])(?=.*[a-z])(?=.*[^A-Za-z0-9])|(?=.*[A-Z])(?=.*\d)(?=.*[^A-Za-z0-9])|(?=.*[a-z])(?=.*\d)(?=.*[^A-Za-z0-9])).+$/, t = "密码8位及以上,含大写字母、小写字母、数字、特殊字符中至少三类", n = /^-?(?:0|[1-9]\d*)(?:\.\d+)?$/;
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as passwordReg, t as passwordRegMessage, n as validNumberStringReg };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
@keyframes landing_slide {
|
|
3
|
+
0% {
|
|
4
|
+
transform: translate(0, 0);
|
|
5
|
+
}
|
|
6
|
+
2% {
|
|
7
|
+
transform: translate(33px, 0);
|
|
8
|
+
}
|
|
9
|
+
12.5% {
|
|
10
|
+
transform: translate(33px, 0);
|
|
11
|
+
}
|
|
12
|
+
15.5% {
|
|
13
|
+
transform: translate(66px, 0);
|
|
14
|
+
}
|
|
15
|
+
25% {
|
|
16
|
+
transform: translate(66px, 0);
|
|
17
|
+
}
|
|
18
|
+
27% {
|
|
19
|
+
transform: translate(66px, 33px);
|
|
20
|
+
}
|
|
21
|
+
37.5% {
|
|
22
|
+
transform: translate(66px, 33px);
|
|
23
|
+
}
|
|
24
|
+
39.5% {
|
|
25
|
+
transform: translate(33px, 33px);
|
|
26
|
+
}
|
|
27
|
+
50% {
|
|
28
|
+
transform: translate(33px, 33px);
|
|
29
|
+
}
|
|
30
|
+
52% {
|
|
31
|
+
transform: translate(33px, 66px);
|
|
32
|
+
}
|
|
33
|
+
62.5% {
|
|
34
|
+
transform: translate(33px, 66px);
|
|
35
|
+
}
|
|
36
|
+
64.5% {
|
|
37
|
+
transform: translate(0, 66px);
|
|
38
|
+
}
|
|
39
|
+
75% {
|
|
40
|
+
transform: translate(0, 66px);
|
|
41
|
+
}
|
|
42
|
+
77% {
|
|
43
|
+
transform: translate(0, 33px);
|
|
44
|
+
}
|
|
45
|
+
87.5% {
|
|
46
|
+
transform: translate(0, 33px);
|
|
47
|
+
}
|
|
48
|
+
89.5% {
|
|
49
|
+
transform: translate(0, 0);
|
|
50
|
+
}
|
|
51
|
+
100% {
|
|
52
|
+
transform: translate(0, 0);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
@keyframes landing_gradient1 {
|
|
56
|
+
from {
|
|
57
|
+
stop-color: #4383b8;
|
|
58
|
+
}
|
|
59
|
+
50% {
|
|
60
|
+
stop-color: #8013b9;
|
|
61
|
+
}
|
|
62
|
+
to {
|
|
63
|
+
stop-color: #4383b8;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
@keyframes landing_gradient2 {
|
|
67
|
+
from {
|
|
68
|
+
stop-color: #002a52;
|
|
69
|
+
}
|
|
70
|
+
50% {
|
|
71
|
+
stop-color: #b22358;
|
|
72
|
+
}
|
|
73
|
+
to {
|
|
74
|
+
stop-color: #f2f3ff;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
#landing svg #gradient > stop[offset='0%'] {
|
|
78
|
+
animation: landing_gradient1 15s ease 0s infinite;
|
|
79
|
+
}
|
|
80
|
+
#landing svg #gradient > stop[offset='100%'] {
|
|
81
|
+
animation: landing_gradient2 15s ease 0s infinite;
|
|
82
|
+
}
|
|
83
|
+
#landing svg .rect {
|
|
84
|
+
animation: landing_slide 15s ease infinite;
|
|
85
|
+
}
|
|
86
|
+
#landing svg #rect1 {
|
|
87
|
+
animation-delay: 0s;
|
|
88
|
+
}
|
|
89
|
+
#landing svg #rect2 {
|
|
90
|
+
animation-delay: -2.1428571428571s;
|
|
91
|
+
}
|
|
92
|
+
#landing svg #rect3 {
|
|
93
|
+
animation-delay: -4.2857142857143s;
|
|
94
|
+
}
|
|
95
|
+
#landing svg #rect4 {
|
|
96
|
+
animation-delay: -6.4285714285714s;
|
|
97
|
+
}
|
|
98
|
+
#landing svg #rect5 {
|
|
99
|
+
animation-delay: -8.5714285714286s;
|
|
100
|
+
}
|
|
101
|
+
#landing svg #rect6 {
|
|
102
|
+
animation-delay: -10.714285714286s;
|
|
103
|
+
}
|
|
104
|
+
#landing svg #rect7 {
|
|
105
|
+
animation-delay: -12.857142857143s;
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
108
|
+
<svg class="landing_ele" viewBox="0 0 100 80">
|
|
109
|
+
<defs>
|
|
110
|
+
<linearGradient id="gradient" x1="100%" y1="0%" x2="0%" y2="100%">
|
|
111
|
+
<stop offset="0%" stop-color="#f2f3ff" />
|
|
112
|
+
<stop offset="100%" stop-color="#002a52" />
|
|
113
|
+
</linearGradient>
|
|
114
|
+
|
|
115
|
+
<clipPath id="rects">
|
|
116
|
+
<rect class="rect" id="rect1" x="0" y="0" width="30" height="30" rx="2" ry="2" />
|
|
117
|
+
<rect class="rect" id="rect2" x="0" y="0" width="30" height="30" rx="2" ry="2" />
|
|
118
|
+
<rect class="rect" id="rect3" x="0" y="0" width="30" height="30" rx="2" ry="2" />
|
|
119
|
+
<rect class="rect" id="rect4" x="0" y="0" width="30" height="30" rx="2" ry="2" />
|
|
120
|
+
<rect class="rect" id="rect5" x="0" y="0" width="30" height="30" rx="2" ry="2" />
|
|
121
|
+
<rect class="rect" id="rect6" x="0" y="0" width="30" height="30" rx="2" ry="2" />
|
|
122
|
+
<rect class="rect" id="rect7" x="0" y="0" width="30" height="30" rx="2" ry="2" />
|
|
123
|
+
</clipPath>
|
|
124
|
+
</defs>
|
|
125
|
+
<rect
|
|
126
|
+
id="container"
|
|
127
|
+
transform="translate(50) scale(0.707, 0.707) rotate(45)"
|
|
128
|
+
x="0"
|
|
129
|
+
y="0"
|
|
130
|
+
width="100"
|
|
131
|
+
height="100"
|
|
132
|
+
fill="url(#gradient)"
|
|
133
|
+
clip-path="url(#rects)"
|
|
134
|
+
></rect>
|
|
135
|
+
</svg>
|
package/index.html
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" href="/favicon.ico" />
|
|
6
|
+
<meta
|
|
7
|
+
name="viewport"
|
|
8
|
+
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"
|
|
9
|
+
/>
|
|
10
|
+
<title><%- title %></title>
|
|
11
|
+
<style>
|
|
12
|
+
html,
|
|
13
|
+
body,
|
|
14
|
+
#app {
|
|
15
|
+
height: 100%;
|
|
16
|
+
margin: 0;
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<div id="app" class="relative"></div>
|
|
22
|
+
<div id="landing">
|
|
23
|
+
<style>
|
|
24
|
+
:root {
|
|
25
|
+
--landing-ele-size: clamp(60px, 8vw, 240px);
|
|
26
|
+
}
|
|
27
|
+
body {
|
|
28
|
+
margin: 0;
|
|
29
|
+
}
|
|
30
|
+
#landing {
|
|
31
|
+
position: fixed;
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 100%;
|
|
34
|
+
background: #fff;
|
|
35
|
+
z-index: calc(Infinity);
|
|
36
|
+
display: flex;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
align-items: center;
|
|
39
|
+
top: 0;
|
|
40
|
+
left: 0;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
transition: opacity 1s ease-in-out;
|
|
43
|
+
font-size: clamp(12px, 0.9vw, 24px);
|
|
44
|
+
}
|
|
45
|
+
#landing .landing_ele {
|
|
46
|
+
width: var(--landing-ele-size);
|
|
47
|
+
margin-bottom: 2vw;
|
|
48
|
+
position: relative;
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
51
|
+
<% if (appId === '1') { %> <%- include('slide-puzzle.ejs') %> <% } %>
|
|
52
|
+
<div style="font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif">
|
|
53
|
+
正在加载系统资源,请耐心等待
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</body>
|
|
57
|
+
</html>
|
package/package.json
CHANGED
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./index.d.ts",
|
|
11
11
|
"import": "./index.mjs"
|
|
12
|
+
},
|
|
13
|
+
"./utils": {
|
|
14
|
+
"types": "./utils/index.d.ts",
|
|
15
|
+
"import": "./utils/index.mjs"
|
|
16
|
+
},
|
|
17
|
+
"./constants": {
|
|
18
|
+
"types": "./constants/index.d.ts",
|
|
19
|
+
"import": "./constants/index.mjs"
|
|
12
20
|
}
|
|
13
21
|
},
|
|
14
22
|
"publishConfig": {
|
|
@@ -19,13 +27,26 @@
|
|
|
19
27
|
"pnpm": "^11.17.0"
|
|
20
28
|
},
|
|
21
29
|
"peerDependencies": {
|
|
30
|
+
"@tsconfig/node-lts": "^24.0.0",
|
|
31
|
+
"@types/node": "^26.1.2",
|
|
32
|
+
"@vue/tsconfig": "^0.9.1",
|
|
22
33
|
"tdesign-vue-next": "^1.20.5",
|
|
23
|
-
"
|
|
34
|
+
"typescript": "^6.0.3",
|
|
35
|
+
"vue": "^3.5.41",
|
|
36
|
+
"vue-tsc": "^3.3.10"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@types/file-saver": "^2.0.7",
|
|
40
|
+
"crypto-js": "^4.2.0",
|
|
41
|
+
"file-saver": "^2.0.5"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/crypto-js": "^4.2.2"
|
|
24
45
|
},
|
|
25
46
|
"browserslist": [
|
|
26
47
|
"last 2 version",
|
|
27
48
|
"> 1%",
|
|
28
49
|
"not dead"
|
|
29
50
|
],
|
|
30
|
-
"version": "1.
|
|
51
|
+
"version": "1.58.0"
|
|
31
52
|
}
|
package/types/env.d.ts
ADDED
package/types/shims.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: 判断是否为空值,一般用于表单填写时的判断
|
|
3
|
+
* @example 0 和 false 是合法值
|
|
4
|
+
* @example 空格不是合法值
|
|
5
|
+
*/
|
|
6
|
+
export declare function isFalsy(val: any): val is '' | null | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* @description: 判断是否为有效的数字字符串
|
|
9
|
+
*/
|
|
10
|
+
export declare function isValidNumberString(val: any): val is string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { validNumberStringReg as e } from "../constants/others.mjs";
|
|
2
|
+
//#region ../../packages/utils/boolean.ts
|
|
3
|
+
function t(e) {
|
|
4
|
+
return [
|
|
5
|
+
"",
|
|
6
|
+
null,
|
|
7
|
+
void 0
|
|
8
|
+
].includes(e) || typeof e == "string" && e.trim() === "";
|
|
9
|
+
}
|
|
10
|
+
function n(t) {
|
|
11
|
+
return typeof t == "string" && e.test(t);
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { t as isFalsy, n as isValidNumberString };
|
package/utils/index.d.ts
ADDED
package/utils/index.mjs
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { isFalsy as e, isValidNumberString as t } from "./boolean.mjs";
|
|
2
|
+
import { formatNumber as n, formatSecondsToChinese as r } from "./number.mjs";
|
|
3
|
+
import { getFilenameFromUrl as i, queryStringToObject as a, stringDisplay as o } from "./string.mjs";
|
|
4
|
+
import { aesDecrypt as s, aesEncrypt as c, saveAs as l } from "./tool.mjs";
|
|
5
|
+
import { flatArrToTree as u, treeToFlatArr as d } from "./tree.mjs";
|
|
6
|
+
export { s as aesDecrypt, c as aesEncrypt, u as flatArrToTree, n as formatNumber, r as formatSecondsToChinese, i as getFilenameFromUrl, e as isFalsy, t as isValidNumberString, a as queryStringToObject, l as saveAs, o as stringDisplay, d as treeToFlatArr };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type FormatNumberConfig = ConstructorParameters<typeof Intl.NumberFormat>[1] & {
|
|
2
|
+
roundingMode?: 'ceil' | 'expand' | 'floor' | 'halfCeil' | 'halfEven' | 'halfExpand' | 'halfFloor' | 'halfTrunc' | 'trunc';
|
|
3
|
+
trailingZeroDisplay?: 'auto' | 'stripIfInteger';
|
|
4
|
+
};
|
|
5
|
+
export declare function formatNumber(n: any, config?: FormatNumberConfig): string;
|
|
6
|
+
/**
|
|
7
|
+
* @description: 将秒数转换为中文
|
|
8
|
+
* @param {number} seconds
|
|
9
|
+
* @return {string}
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatSecondsToChinese(seconds: number): string;
|
|
12
|
+
export {};
|
package/utils/number.mjs
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { isValidNumberString as e } from "./boolean.mjs";
|
|
2
|
+
//#region ../../packages/utils/number.ts
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
if (typeof t != "number" && typeof t != "string" || typeof t == "string" && e(t) === !1 || typeof t == "number" && Number.isFinite(t) === !1) return "";
|
|
5
|
+
let r = Number(t), i = {
|
|
6
|
+
currency: "CNY",
|
|
7
|
+
currencyDisplay: "symbol",
|
|
8
|
+
localeMatcher: "lookup",
|
|
9
|
+
maximumFractionDigits: 2,
|
|
10
|
+
minimumFractionDigits: 0,
|
|
11
|
+
notation: "standard",
|
|
12
|
+
numberingSystem: "latn",
|
|
13
|
+
style: "decimal",
|
|
14
|
+
trailingZeroDisplay: "stripIfInteger",
|
|
15
|
+
useGrouping: !0,
|
|
16
|
+
...n ?? {}
|
|
17
|
+
};
|
|
18
|
+
try {
|
|
19
|
+
return new Intl.NumberFormat("zh-CN", i).format(r);
|
|
20
|
+
} catch (e) {
|
|
21
|
+
return console.error(e?.message ?? "格式化数字失败"), String(r);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function n(e) {
|
|
25
|
+
let t = "", n = Math.floor(e / 3600);
|
|
26
|
+
n > 0 && (t += `${n}时`);
|
|
27
|
+
let r = Math.floor(e % 3600 / 60);
|
|
28
|
+
r > 0 && (t += `${r}分`);
|
|
29
|
+
let i = e % 60;
|
|
30
|
+
return i > 0 && (t += `${i}秒`), t;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { t as formatNumber, n as formatSecondsToChinese };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: 从 url 中获取文件名
|
|
3
|
+
* @param {string} url
|
|
4
|
+
* @param {boolean} withExt 是否包含扩展名
|
|
5
|
+
* @return {string}
|
|
6
|
+
*/
|
|
7
|
+
export declare function getFilenameFromUrl(url: string, withExt?: boolean): string;
|
|
8
|
+
export declare function queryStringToObject(queryString: string): Record<string, any>;
|
|
9
|
+
/**
|
|
10
|
+
* @description: 将值转换为字符串,如果值为 null 或 undefined,则返回空字符串
|
|
11
|
+
* @example String(123n) -> '123' BigInt
|
|
12
|
+
* @return {string}
|
|
13
|
+
*/
|
|
14
|
+
export declare function stringDisplay(val: any): string;
|
package/utils/string.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region ../../packages/utils/string.ts
|
|
2
|
+
function e(e, t = !1) {
|
|
3
|
+
let n = e.split("/").pop().split("?")[0];
|
|
4
|
+
if (t) return n;
|
|
5
|
+
{
|
|
6
|
+
let e = n.split(".");
|
|
7
|
+
return e.pop(), e.join(".");
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function t(e) {
|
|
11
|
+
return Object.fromEntries(new URLSearchParams(e));
|
|
12
|
+
}
|
|
13
|
+
function n(e) {
|
|
14
|
+
return [null, void 0].includes(e) ? "" : String(e);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { e as getFilenameFromUrl, t as queryStringToObject, n as stringDisplay };
|
package/utils/tool.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { default as FileSaver } from 'file-saver';
|
|
2
|
+
export declare function aesDecrypt(word: string, keyWord: string): Promise<string>;
|
|
3
|
+
export declare function aesEncrypt(word: string, keyWord: string): Promise<string>;
|
|
4
|
+
export declare function saveAs(arg1: Parameters<typeof FileSaver.saveAs>[0], arg2?: Parameters<typeof FileSaver.saveAs>[1], arg3?: FileSaver.FileSaverOptions): Promise<void>;
|
package/utils/tool.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region ../../packages/utils/tool.ts
|
|
2
|
+
async function e(e, t) {
|
|
3
|
+
let { default: n } = await import("crypto-js"), r = n.enc.Utf8.parse(t);
|
|
4
|
+
return n.AES.decrypt(e, r, {
|
|
5
|
+
mode: n.mode.ECB,
|
|
6
|
+
padding: n.pad.Pkcs7
|
|
7
|
+
}).toString(n.enc.Utf8);
|
|
8
|
+
}
|
|
9
|
+
async function t(e, t) {
|
|
10
|
+
let { default: n } = await import("crypto-js"), r = n.enc.Utf8.parse(t), i = n.enc.Utf8.parse(e);
|
|
11
|
+
return n.AES.encrypt(i, r, {
|
|
12
|
+
mode: n.mode.ECB,
|
|
13
|
+
padding: n.pad.Pkcs7
|
|
14
|
+
}).toString();
|
|
15
|
+
}
|
|
16
|
+
async function n(e, t, n) {
|
|
17
|
+
let { default: r } = await import("file-saver");
|
|
18
|
+
r(e, t, n);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { e as aesDecrypt, t as aesEncrypt, n as saveAs };
|
package/utils/tree.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface TreeNode {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
children?: TreeNode[];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* 将扁平数组转换为树形结构
|
|
7
|
+
* @param data 扁平数据数组
|
|
8
|
+
* @param options 配置选项
|
|
9
|
+
* @param options.childrenKey 子节点键名
|
|
10
|
+
* @param options.idKey 节点ID键名
|
|
11
|
+
* @param options.parentKey 节点父ID键名
|
|
12
|
+
* @param options.rootParentId 根节点ID键名
|
|
13
|
+
* @returns 树形结构数组
|
|
14
|
+
*/
|
|
15
|
+
export declare function flatArrToTree(data: Record<string, any>[], options?: {
|
|
16
|
+
childrenKey?: string;
|
|
17
|
+
idKey?: string;
|
|
18
|
+
parentKey?: string;
|
|
19
|
+
rootParentId?: null | string;
|
|
20
|
+
}): TreeNode[];
|
|
21
|
+
export declare function treeToFlatArr(tree: TreeNode[], options?: {
|
|
22
|
+
idKey?: string;
|
|
23
|
+
includeLevel?: boolean;
|
|
24
|
+
includeParent?: boolean;
|
|
25
|
+
}): Record<string, any>[];
|
|
26
|
+
export {};
|
package/utils/tree.mjs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region ../../packages/utils/tree.ts
|
|
2
|
+
function e(e, t = {}) {
|
|
3
|
+
let { childrenKey: n = "children", idKey: r = "id", parentKey: i = "parentId", rootParentId: a = null } = t;
|
|
4
|
+
if (!Array.isArray(e)) throw TypeError("flatArrToTree: 输入参数 data 必须是数组");
|
|
5
|
+
if (e.length === 0) return [];
|
|
6
|
+
let o = [], s = /* @__PURE__ */ new Map();
|
|
7
|
+
for (let t of e) {
|
|
8
|
+
let e = t[r];
|
|
9
|
+
if (e == null) {
|
|
10
|
+
console.warn(`flatArrToTree: 数据项缺少 ${r} 属性`, t);
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
let n = {
|
|
14
|
+
...t,
|
|
15
|
+
children: []
|
|
16
|
+
};
|
|
17
|
+
s.has(e) && console.warn(`flatArrToTree: 检测到重复的 ${r}: ${e}`), s.set(e, n);
|
|
18
|
+
}
|
|
19
|
+
for (let [e, t] of s) {
|
|
20
|
+
let e = t[i];
|
|
21
|
+
e == null || e === a || !s.has(e) ? o.push(t) : s.get(e)[n].push(t);
|
|
22
|
+
}
|
|
23
|
+
return o;
|
|
24
|
+
}
|
|
25
|
+
function t(e, t) {
|
|
26
|
+
let { idKey: n = "id", includeLevel: r = !1, includeParent: i = !1 } = t ?? {}, a = [];
|
|
27
|
+
function o(e, t = 0, s = null) {
|
|
28
|
+
Array.isArray(e) && e.forEach((e) => {
|
|
29
|
+
let { children: c, ...l } = e;
|
|
30
|
+
r && (l.level = t), i && (l.parentId = s), a.push(l), Array.isArray(c) && o(c, t + 1, e[n]);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return o(e), a;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { e as flatArrToTree, t as treeToFlatArr };
|
package/component.d.ts
DELETED
package/component.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"card.mjs","names":[],"sources":["../../../../../packages/components/card/src/card.ts"],"sourcesContent":["import type { CardProps as _CardProps } from 'tdesign-vue-next'\n\nexport const cardPropsInit = {\n bodyFullHeight: false,\n headerBordered: true,\n shadow: true,\n titleEllipsis: false,\n} as const\nexport type CardProps = Omit<_CardProps, 'content'> & {\n bodyFullHeight?: boolean\n titleEllipsis?: boolean\n}\n"],"mappings":";AAEA,IAAa,IAAgB;CAC3B,gBAAgB;CAChB,gBAAgB;CAChB,QAAQ;CACR,eAAe;AACjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"card.vue_vue_type_script_setup_true_lang.mjs","names":["$attrs","$slots"],"sources":["../../../../../packages/components/card/src/card.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CardProps } from './card'\nimport { Card as TCard } from 'tdesign-vue-next'\nimport { computed, getCurrentInstance, h, mergeProps } from 'vue'\nimport { cardPropsInit } from './card'\n\ndefineOptions({\n inheritAttrs: false,\n // eslint-disable-next-line vue/order-in-components -- perfectionist/sort-objects 按字母序\n name: 'TCard',\n})\n\nconst props = withDefaults(defineProps<CardProps>(), cardPropsInit)\nconst otherProps = computed(() => {\n const obj: Partial<CardProps> = {\n ...props,\n }\n\n delete obj.bodyFullHeight\n delete obj.titleEllipsis\n Object.keys(obj).forEach((key) => {\n if (obj[key as keyof typeof obj] === undefined) {\n delete obj[key as keyof typeof obj]\n }\n })\n return obj\n})\nconst compo = TCard\nconst vm = getCurrentInstance()!\n\nfunction compoRef(instance: any) {\n const exposed = instance ?? {}\n\n vm.exposed = exposed\n}\n</script>\n\n<template>\n <component\n :is=\"\n h(\n compo,\n mergeProps(\n $attrs,\n {\n ...otherProps,\n ref: compoRef,\n bodyClassName: [bodyFullHeight ? 'flex-1' : '', otherProps.bodyClassName]\n .filter(Boolean)\n .join(' '),\n },\n {\n class: {\n 'flex flex-col': bodyFullHeight,\n title_ellipsis: titleEllipsis,\n },\n },\n ),\n $slots,\n )\n \"\n >\n </component>\n</template>\n\n<style scoped>\n.title_ellipsis {\n :deep() {\n .t-card__header-wrapper {\n @apply inline overflow-hidden;\n }\n\n .t-card__title {\n @apply overflow-hidden text-ellipsis whitespace-nowrap;\n }\n }\n}\n\n:deep() {\n .t-card__title {\n line-height: 32px;\n }\n\n .t-card__header {\n align-items: flex-start;\n }\n\n .t-card__title--bordered {\n &:is(:last-child) {\n border-bottom: none;\n }\n }\n\n .t-card__body {\n &:has(> .t-form:is(:last-child)) {\n padding-bottom: 0;\n }\n }\n\n .t-card__actions {\n display: flex;\n align-items: center;\n min-height: 32px;\n color: inherit;\n }\n\n .t-loading__parent {\n /* stylelint-disable-next-line selector-class-pattern */\n &:has(.t-card__body.flex-1) {\n display: flex;\n flex: 1;\n flex-direction: column;\n overflow-y: auto;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYA,IAAM,IAAQ,GACR,IAAa,QAAe;GAChC,IAAM,IAA0B,EAC9B,GAAG,EACL;GASA,OAPA,OAAO,EAAI,gBACX,OAAO,EAAI,eACX,OAAO,KAAK,CAAG,CAAC,CAAC,SAAS,MAAQ;IAChC,AAAI,EAAI,OAA6B,KAAA,KACnC,OAAO,EAAI;GAEf,CAAC,GACM;EACT,CAAC,GACK,IAAQ,GACR,IAAK,EAAmB;EAE9B,SAAS,EAAS,GAAe;GAG/B,EAAG,UAFa,KAAY,CAAC;EAG/B;oBAIE,EAAA,GAAA,EAwBY,EAvBE,EAAW,EAAA,CAAA,GAAe,EAAsBA,EAAAA,QAAAA;GAAmC,GAAA,EAAA;GAA6B,KAAA;GAAsC,eAAA,CAAA,EAAA,iBAAc,WAAA,IAAkB,EAAA,MAAW,aAAa,CAAA,CAAiB,OAAO,OAAO,CAAA,CAAiB,KAAI,GAAA;;GAAoF,iBAAA,EAAA;GAA8C,gBAAA,EAAA;EAA8DC,EAAAA,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,CAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"card2.mjs","names":[],"sources":["../../../../../packages/components/card/src/card.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CardProps } from './card'\nimport { Card as TCard } from 'tdesign-vue-next'\nimport { computed, getCurrentInstance, h, mergeProps } from 'vue'\nimport { cardPropsInit } from './card'\n\ndefineOptions({\n inheritAttrs: false,\n // eslint-disable-next-line vue/order-in-components -- perfectionist/sort-objects 按字母序\n name: 'TCard',\n})\n\nconst props = withDefaults(defineProps<CardProps>(), cardPropsInit)\nconst otherProps = computed(() => {\n const obj: Partial<CardProps> = {\n ...props,\n }\n\n delete obj.bodyFullHeight\n delete obj.titleEllipsis\n Object.keys(obj).forEach((key) => {\n if (obj[key as keyof typeof obj] === undefined) {\n delete obj[key as keyof typeof obj]\n }\n })\n return obj\n})\nconst compo = TCard\nconst vm = getCurrentInstance()!\n\nfunction compoRef(instance: any) {\n const exposed = instance ?? {}\n\n vm.exposed = exposed\n}\n</script>\n\n<template>\n <component\n :is=\"\n h(\n compo,\n mergeProps(\n $attrs,\n {\n ...otherProps,\n ref: compoRef,\n bodyClassName: [bodyFullHeight ? 'flex-1' : '', otherProps.bodyClassName]\n .filter(Boolean)\n .join(' '),\n },\n {\n class: {\n 'flex flex-col': bodyFullHeight,\n title_ellipsis: titleEllipsis,\n },\n },\n ),\n $slots,\n )\n \"\n >\n </component>\n</template>\n\n<style scoped>\n.title_ellipsis {\n :deep() {\n .t-card__header-wrapper {\n @apply inline overflow-hidden;\n }\n\n .t-card__title {\n @apply overflow-hidden text-ellipsis whitespace-nowrap;\n }\n }\n}\n\n:deep() {\n .t-card__title {\n line-height: 32px;\n }\n\n .t-card__header {\n align-items: flex-start;\n }\n\n .t-card__title--bordered {\n &:is(:last-child) {\n border-bottom: none;\n }\n }\n\n .t-card__body {\n &:has(> .t-form:is(:last-child)) {\n padding-bottom: 0;\n }\n }\n\n .t-card__actions {\n display: flex;\n align-items: center;\n min-height: 32px;\n color: inherit;\n }\n\n .t-loading__parent {\n /* stylelint-disable-next-line selector-class-pattern */\n &:has(.t-card__body.flex-1) {\n display: flex;\n flex: 1;\n flex-direction: column;\n overflow-y: auto;\n }\n }\n}\n</style>\n"],"mappings":""}
|