bkui-vue 0.0.1-beta.17 → 0.0.1-beta.18
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/dist/bkui-vue.cjs.js +330 -28
- package/dist/bkui-vue.esm.js +329 -29
- package/dist/bkui-vue.umd.js +330 -28
- package/dist/style.css +182 -1
- package/lib/alert/alert.variable.css +1 -0
- package/lib/backtop/backtop.variable.css +1 -0
- package/lib/badge/badge.variable.css +1 -0
- package/lib/breadcrumb/breadcrumb.variable.css +1 -0
- package/lib/button/button.variable.css +1 -0
- package/lib/card/card.variable.css +1 -0
- package/lib/checkbox/checkbox.variable.css +1 -0
- package/lib/components.d.ts +1 -0
- package/lib/date-picker/date-picker.variable.css +1 -0
- package/lib/divider/divider.variable.css +1 -0
- package/lib/dropdown/dropdown.variable.css +1 -0
- package/lib/exception/exception.variable.css +1 -0
- package/lib/fixed-navbar/fixed-navbar.variable.css +1 -0
- package/lib/form/form.d.ts +1 -1
- package/lib/form/index.d.ts +285 -3
- package/lib/form/index.js +1 -1
- package/lib/icon/angle-double-down-line.d.ts +4 -0
- package/lib/icon/angle-double-down-line.js +15 -0
- package/lib/icon/angle-double-left-line.d.ts +4 -0
- package/lib/icon/angle-double-left-line.js +15 -0
- package/lib/icon/angle-double-right-line.d.ts +4 -0
- package/lib/icon/angle-double-right-line.js +15 -0
- package/lib/icon/angle-double-up-line.d.ts +4 -0
- package/lib/icon/angle-double-up-line.js +15 -0
- package/lib/icon/ellipsis.d.ts +4 -0
- package/lib/icon/ellipsis.js +15 -0
- package/lib/icon/index.d.ts +7 -0
- package/lib/icon/index.js +1 -1
- package/lib/icon/left-shape.d.ts +4 -0
- package/lib/icon/left-shape.js +15 -0
- package/lib/icon/up-shape.d.ts +4 -0
- package/lib/icon/up-shape.js +15 -0
- package/lib/input/input.variable.css +1 -0
- package/lib/link/link.variable.css +1 -0
- package/lib/loading/loading.variable.css +1 -0
- package/lib/menu/menu.variable.css +1 -0
- package/lib/menu/submenu.variable.css +1 -0
- package/lib/message/message.variable.css +1 -0
- package/lib/navigation/navigation.variable.css +1 -0
- package/lib/notify/notify.variable.css +1 -0
- package/lib/pagination/index.d.ts +395 -0
- package/lib/pagination/index.js +1 -0
- package/lib/pagination/pagination.css +179 -0
- package/lib/pagination/pagination.d.ts +220 -0
- package/lib/pagination/pagination.less +201 -0
- package/lib/pagination/pagination.variable.css +272 -0
- package/lib/pagination/type.d.ts +6 -0
- package/lib/pagination/use-limit.d.ts +8 -0
- package/lib/pagination/use-list.d.ts +8 -0
- package/lib/pagination/use-small-list.d.ts +5 -0
- package/lib/pagination/use-total.d.ts +5 -0
- package/lib/popover/popover.css +1 -0
- package/lib/popover/popover.less +2 -0
- package/lib/popover/popover.variable.css +2 -0
- package/lib/process/process.variable.css +1 -0
- package/lib/progress/progress.variable.css +1 -0
- package/lib/radio/radio.variable.css +1 -0
- package/lib/select/select.css +2 -1
- package/lib/select/select.less +2 -1
- package/lib/select/select.variable.css +3 -1
- package/lib/shared/index.js +1 -1
- package/lib/sideslider/sideslider.variable.css +1 -0
- package/lib/slider/slider.variable.css +1 -0
- package/lib/steps/steps.variable.css +1 -0
- package/lib/styles/index.d.ts +1 -0
- package/lib/styles/index.js +1 -1
- package/lib/styles/themes/themes.less +1 -0
- package/lib/switcher/switcher.variable.css +1 -0
- package/lib/tab/tab.variable.css +1 -0
- package/lib/table/table.variable.css +1 -0
- package/lib/tag/tag.variable.css +1 -0
- package/lib/timeline/timeline.variable.css +1 -0
- package/lib/use-form.d.ts +3 -0
- package/package.json +1 -1
package/dist/style.css
CHANGED
@@ -1634,6 +1634,7 @@ optgroup {
|
|
1634
1634
|
}
|
1635
1635
|
.bk-popover-content .arrow {
|
1636
1636
|
position: absolute;
|
1637
|
+
z-index: -1;
|
1637
1638
|
width: 8px;
|
1638
1639
|
height: 8px;
|
1639
1640
|
background: inherit;
|
@@ -1956,6 +1957,7 @@ optgroup {
|
|
1956
1957
|
cursor: pointer;
|
1957
1958
|
}
|
1958
1959
|
.bk-select .bk-select-trigger .bk-select-input {
|
1960
|
+
width: 100%;
|
1959
1961
|
height: 32px;
|
1960
1962
|
padding: 0 28px 0 10px;
|
1961
1963
|
font-size: 12px;
|
@@ -2077,7 +2079,7 @@ optgroup {
|
|
2077
2079
|
.bk-select .bk-select-option {
|
2078
2080
|
position: relative;
|
2079
2081
|
height: 32px;
|
2080
|
-
padding: 0
|
2082
|
+
padding: 0 12px;
|
2081
2083
|
line-height: 32px;
|
2082
2084
|
color: #63656e;
|
2083
2085
|
text-align: left;
|
@@ -4322,6 +4324,185 @@ span.bk-date-picker-cells-cell-disabled.bk-date-picker-cells-cell-selected em {
|
|
4322
4324
|
background-color: #dcdee5;
|
4323
4325
|
border-radius: 6px;
|
4324
4326
|
}
|
4327
|
+
.bk-pagination {
|
4328
|
+
display: flex;
|
4329
|
+
align-items: center;
|
4330
|
+
font-size: 12px;
|
4331
|
+
letter-spacing: normal;
|
4332
|
+
color: #63656e;
|
4333
|
+
user-select: none;
|
4334
|
+
}
|
4335
|
+
.bk-pagination.is-disabled {
|
4336
|
+
cursor: not-allowed;
|
4337
|
+
}
|
4338
|
+
.bk-pagination.is-align-left {
|
4339
|
+
justify-content: flex-start;
|
4340
|
+
}
|
4341
|
+
.bk-pagination.is-align-center {
|
4342
|
+
justify-content: center;
|
4343
|
+
}
|
4344
|
+
.bk-pagination.is-align-right {
|
4345
|
+
justify-content: flex-end;
|
4346
|
+
}
|
4347
|
+
.bk-pagination > * {
|
4348
|
+
margin: 0 6px;
|
4349
|
+
}
|
4350
|
+
.bk-pagination > .is-first {
|
4351
|
+
margin-left: 0;
|
4352
|
+
}
|
4353
|
+
.bk-pagination > .is-last {
|
4354
|
+
margin-right: 0;
|
4355
|
+
}
|
4356
|
+
.bk-pagination-total {
|
4357
|
+
display: flex;
|
4358
|
+
user-select: none;
|
4359
|
+
}
|
4360
|
+
.bk-pagination-total-num {
|
4361
|
+
padding: 0 2px;
|
4362
|
+
color: #3f4046;
|
4363
|
+
}
|
4364
|
+
.bk-pagination-list {
|
4365
|
+
display: flex;
|
4366
|
+
}
|
4367
|
+
.bk-pagination-list-pre,
|
4368
|
+
.bk-pagination-list-next,
|
4369
|
+
.bk-pagination-list-item {
|
4370
|
+
display: flex;
|
4371
|
+
align-items: center;
|
4372
|
+
justify-content: center;
|
4373
|
+
height: 32px;
|
4374
|
+
min-width: 32px;
|
4375
|
+
padding: 0 4px;
|
4376
|
+
margin-right: 2px;
|
4377
|
+
margin-left: 2px;
|
4378
|
+
color: #63656e;
|
4379
|
+
cursor: pointer;
|
4380
|
+
background: #fff;
|
4381
|
+
border: 1px solid #c4c6cc;
|
4382
|
+
border-radius: 2px;
|
4383
|
+
user-select: none;
|
4384
|
+
}
|
4385
|
+
.bk-pagination-list-pre:hover,
|
4386
|
+
.bk-pagination-list-next:hover,
|
4387
|
+
.bk-pagination-list-item:hover,
|
4388
|
+
.bk-pagination-list-pre.is-active,
|
4389
|
+
.bk-pagination-list-next.is-active,
|
4390
|
+
.bk-pagination-list-item.is-active {
|
4391
|
+
color: #3a84ff;
|
4392
|
+
border-color: #3a84ff;
|
4393
|
+
}
|
4394
|
+
.bk-pagination-list-pre.is-disabled,
|
4395
|
+
.bk-pagination-list-next.is-disabled,
|
4396
|
+
.bk-pagination-list-item.is-disabled {
|
4397
|
+
color: #c4c6cc;
|
4398
|
+
cursor: not-allowed;
|
4399
|
+
background-color: #fafbfd;
|
4400
|
+
border-color: #dcdee5;
|
4401
|
+
}
|
4402
|
+
.bk-pagination-list-pre-batch,
|
4403
|
+
.bk-pagination-list-next-batch {
|
4404
|
+
display: flex;
|
4405
|
+
align-items: center;
|
4406
|
+
justify-content: center;
|
4407
|
+
height: 32px;
|
4408
|
+
cursor: pointer;
|
4409
|
+
user-select: none;
|
4410
|
+
}
|
4411
|
+
.bk-pagination-list-pre-batch:hover,
|
4412
|
+
.bk-pagination-list-next-batch:hover {
|
4413
|
+
color: #3a84ff;
|
4414
|
+
}
|
4415
|
+
.bk-pagination-list-pre,
|
4416
|
+
.bk-pagination-list-next {
|
4417
|
+
font-size: 14px;
|
4418
|
+
}
|
4419
|
+
.bk-pagination-list-item {
|
4420
|
+
margin-right: 4px;
|
4421
|
+
margin-left: 4px;
|
4422
|
+
}
|
4423
|
+
.bk-pagination-limit {
|
4424
|
+
display: flex;
|
4425
|
+
align-items: center;
|
4426
|
+
user-select: none;
|
4427
|
+
}
|
4428
|
+
.bk-pagination-limit-select {
|
4429
|
+
width: 60px;
|
4430
|
+
margin: 0 4px;
|
4431
|
+
}
|
4432
|
+
.bk-pagination-small-list {
|
4433
|
+
display: flex;
|
4434
|
+
}
|
4435
|
+
.bk-pagination-small-list .bk-pagination-picker {
|
4436
|
+
display: flex;
|
4437
|
+
height: 24px;
|
4438
|
+
cursor: pointer;
|
4439
|
+
background-color: #f0f1f5;
|
4440
|
+
border: 1px solid #f0f1f5;
|
4441
|
+
border-radius: 2px;
|
4442
|
+
align-items: center;
|
4443
|
+
}
|
4444
|
+
.bk-pagination-small-list .bk-pagination-picker:hover {
|
4445
|
+
background-color: #e1ecff;
|
4446
|
+
border-color: #e1ecff;
|
4447
|
+
}
|
4448
|
+
.bk-pagination-small-list .bk-pagination-picker.is-focused {
|
4449
|
+
background-color: #fff;
|
4450
|
+
border-color: #3a84ff;
|
4451
|
+
box-shadow: 0px 0px 4px rgba(58, 132, 255, 0.4);
|
4452
|
+
}
|
4453
|
+
.bk-pagination-editor {
|
4454
|
+
height: 16px;
|
4455
|
+
min-width: 14px;
|
4456
|
+
padding-right: 4px;
|
4457
|
+
padding-left: 8px;
|
4458
|
+
line-height: 16px;
|
4459
|
+
text-align: center;
|
4460
|
+
background-color: transparent;
|
4461
|
+
border: 0;
|
4462
|
+
border-radius: 2px;
|
4463
|
+
outline: none;
|
4464
|
+
transition: all 0.15s;
|
4465
|
+
}
|
4466
|
+
.bk-pagination-small-list-total {
|
4467
|
+
padding-right: 8px;
|
4468
|
+
padding-left: 4px;
|
4469
|
+
}
|
4470
|
+
.bk-pagination-btn-pre,
|
4471
|
+
.bk-pagination-btn-next {
|
4472
|
+
display: flex;
|
4473
|
+
justify-content: center;
|
4474
|
+
align-items: center;
|
4475
|
+
width: 24px;
|
4476
|
+
cursor: pointer;
|
4477
|
+
}
|
4478
|
+
.bk-pagination-btn-pre:hover,
|
4479
|
+
.bk-pagination-btn-next:hover {
|
4480
|
+
color: #3a84ff;
|
4481
|
+
}
|
4482
|
+
.bk-pagination-btn-pre.is-disabled,
|
4483
|
+
.bk-pagination-btn-next.is-disabled {
|
4484
|
+
color: #dcdee5;
|
4485
|
+
cursor: not-allowed;
|
4486
|
+
}
|
4487
|
+
.bk-pagination-picker-list {
|
4488
|
+
max-height: 216px;
|
4489
|
+
padding: 7px 0;
|
4490
|
+
margin: -7px -14px;
|
4491
|
+
overflow: auto;
|
4492
|
+
}
|
4493
|
+
.bk-pagination-picker-list .item {
|
4494
|
+
height: 32px;
|
4495
|
+
padding: 0 10px;
|
4496
|
+
font-size: 12px;
|
4497
|
+
line-height: 32px;
|
4498
|
+
color: #63656e;
|
4499
|
+
cursor: pointer;
|
4500
|
+
}
|
4501
|
+
.bk-pagination-picker-list .item:hover,
|
4502
|
+
.bk-pagination-picker-list .item.is-actived {
|
4503
|
+
color: #3a84ff;
|
4504
|
+
background: #f4f6fa;
|
4505
|
+
}
|
4325
4506
|
* {
|
4326
4507
|
box-sizing: border-box;
|
4327
4508
|
}
|
package/lib/components.d.ts
CHANGED
@@ -33,3 +33,4 @@ export { default as Navigation } from './navigation';
|
|
33
33
|
export { default as DatePicker } from './date-picker';
|
34
34
|
export { default as Tree } from './tree';
|
35
35
|
export { default as VirtualRender } from './virtual-render';
|
36
|
+
export { default as Form, BkFormItem as FormItem } from './form';
|
package/lib/form/form.d.ts
CHANGED
package/lib/form/index.d.ts
CHANGED
@@ -1,4 +1,286 @@
|
|
1
|
-
import
|
1
|
+
import { formProps } from './form';
|
2
2
|
import FormItem from './form-item';
|
3
|
-
|
4
|
-
|
3
|
+
declare const BkForm: {
|
4
|
+
new (...args: any[]): {
|
5
|
+
$: import("vue").ComponentInternalInstance;
|
6
|
+
$data: {};
|
7
|
+
$props: Partial<{
|
8
|
+
formType: string;
|
9
|
+
labelWidth: number;
|
10
|
+
labelPosition: string;
|
11
|
+
model: {
|
12
|
+
[key: string]: any;
|
13
|
+
};
|
14
|
+
rules: unknown[];
|
15
|
+
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
16
|
+
formType: import("vue-types").VueTypeValidableDef<string> & {
|
17
|
+
default: string;
|
18
|
+
};
|
19
|
+
labelWidth: import("vue-types").VueTypeValidableDef<number> & {
|
20
|
+
default: number;
|
21
|
+
};
|
22
|
+
labelPosition: import("vue-types").VueTypeValidableDef<string> & {
|
23
|
+
default: string;
|
24
|
+
} & {
|
25
|
+
default: string;
|
26
|
+
};
|
27
|
+
model: import("vue-types").VueTypeValidableDef<{
|
28
|
+
[key: string]: any;
|
29
|
+
}> & {
|
30
|
+
default: () => {
|
31
|
+
[key: string]: any;
|
32
|
+
};
|
33
|
+
};
|
34
|
+
rules: import("vue-types").VueTypeValidableDef<unknown[]> & {
|
35
|
+
default: () => unknown[];
|
36
|
+
};
|
37
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "formType" | "labelWidth" | "labelPosition" | "model" | "rules">;
|
38
|
+
$attrs: {
|
39
|
+
[x: string]: unknown;
|
40
|
+
};
|
41
|
+
$refs: {
|
42
|
+
[x: string]: unknown;
|
43
|
+
};
|
44
|
+
$slots: Readonly<{
|
45
|
+
[name: string]: import("vue").Slot;
|
46
|
+
}>;
|
47
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
48
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
49
|
+
$emit: (event: string, ...args: any[]) => void;
|
50
|
+
$el: any;
|
51
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
52
|
+
formType: import("vue-types").VueTypeValidableDef<string> & {
|
53
|
+
default: string;
|
54
|
+
};
|
55
|
+
labelWidth: import("vue-types").VueTypeValidableDef<number> & {
|
56
|
+
default: number;
|
57
|
+
};
|
58
|
+
labelPosition: import("vue-types").VueTypeValidableDef<string> & {
|
59
|
+
default: string;
|
60
|
+
} & {
|
61
|
+
default: string;
|
62
|
+
};
|
63
|
+
model: import("vue-types").VueTypeValidableDef<{
|
64
|
+
[key: string]: any;
|
65
|
+
}> & {
|
66
|
+
default: () => {
|
67
|
+
[key: string]: any;
|
68
|
+
};
|
69
|
+
};
|
70
|
+
rules: import("vue-types").VueTypeValidableDef<unknown[]> & {
|
71
|
+
default: () => unknown[];
|
72
|
+
};
|
73
|
+
}>>, {
|
74
|
+
validate: (fields: string | string[]) => Promise<{
|
75
|
+
[key: string]: any;
|
76
|
+
}>;
|
77
|
+
clearValidate: (fields: string | string[]) => void;
|
78
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
79
|
+
formType: string;
|
80
|
+
labelWidth: number;
|
81
|
+
labelPosition: string;
|
82
|
+
model: {
|
83
|
+
[key: string]: any;
|
84
|
+
};
|
85
|
+
rules: unknown[];
|
86
|
+
}> & {
|
87
|
+
beforeCreate?: (() => void) | (() => void)[];
|
88
|
+
created?: (() => void) | (() => void)[];
|
89
|
+
beforeMount?: (() => void) | (() => void)[];
|
90
|
+
mounted?: (() => void) | (() => void)[];
|
91
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
92
|
+
updated?: (() => void) | (() => void)[];
|
93
|
+
activated?: (() => void) | (() => void)[];
|
94
|
+
deactivated?: (() => void) | (() => void)[];
|
95
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
96
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
97
|
+
destroyed?: (() => void) | (() => void)[];
|
98
|
+
unmounted?: (() => void) | (() => void)[];
|
99
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
100
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
101
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>, info: string) => boolean | void)[];
|
102
|
+
};
|
103
|
+
$forceUpdate: () => void;
|
104
|
+
$nextTick: typeof import("vue").nextTick;
|
105
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean>): import("vue").WatchStopHandle;
|
106
|
+
} & Readonly<import("vue").ExtractPropTypes<{
|
107
|
+
formType: import("vue-types").VueTypeValidableDef<string> & {
|
108
|
+
default: string;
|
109
|
+
};
|
110
|
+
labelWidth: import("vue-types").VueTypeValidableDef<number> & {
|
111
|
+
default: number;
|
112
|
+
};
|
113
|
+
labelPosition: import("vue-types").VueTypeValidableDef<string> & {
|
114
|
+
default: string;
|
115
|
+
} & {
|
116
|
+
default: string;
|
117
|
+
};
|
118
|
+
model: import("vue-types").VueTypeValidableDef<{
|
119
|
+
[key: string]: any;
|
120
|
+
}> & {
|
121
|
+
default: () => {
|
122
|
+
[key: string]: any;
|
123
|
+
};
|
124
|
+
};
|
125
|
+
rules: import("vue-types").VueTypeValidableDef<unknown[]> & {
|
126
|
+
default: () => unknown[];
|
127
|
+
};
|
128
|
+
}>> & import("vue").ShallowUnwrapRef<{
|
129
|
+
validate: (fields: string | string[]) => Promise<{
|
130
|
+
[key: string]: any;
|
131
|
+
}>;
|
132
|
+
clearValidate: (fields: string | string[]) => void;
|
133
|
+
}> & {} & {} & import("vue").ComponentCustomProperties;
|
134
|
+
__isFragment?: never;
|
135
|
+
__isTeleport?: never;
|
136
|
+
__isSuspense?: never;
|
137
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
138
|
+
formType: import("vue-types").VueTypeValidableDef<string> & {
|
139
|
+
default: string;
|
140
|
+
};
|
141
|
+
labelWidth: import("vue-types").VueTypeValidableDef<number> & {
|
142
|
+
default: number;
|
143
|
+
};
|
144
|
+
labelPosition: import("vue-types").VueTypeValidableDef<string> & {
|
145
|
+
default: string;
|
146
|
+
} & {
|
147
|
+
default: string;
|
148
|
+
};
|
149
|
+
model: import("vue-types").VueTypeValidableDef<{
|
150
|
+
[key: string]: any;
|
151
|
+
}> & {
|
152
|
+
default: () => {
|
153
|
+
[key: string]: any;
|
154
|
+
};
|
155
|
+
};
|
156
|
+
rules: import("vue-types").VueTypeValidableDef<unknown[]> & {
|
157
|
+
default: () => unknown[];
|
158
|
+
};
|
159
|
+
}>>, {
|
160
|
+
validate: (fields: string | string[]) => Promise<{
|
161
|
+
[key: string]: any;
|
162
|
+
}>;
|
163
|
+
clearValidate: (fields: string | string[]) => void;
|
164
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
165
|
+
formType: string;
|
166
|
+
labelWidth: number;
|
167
|
+
labelPosition: string;
|
168
|
+
model: {
|
169
|
+
[key: string]: any;
|
170
|
+
};
|
171
|
+
rules: unknown[];
|
172
|
+
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin & Readonly<{
|
173
|
+
FormItem: import("vue").DefineComponent<{
|
174
|
+
label: import("vue-types").VueTypeValidableDef<string> & {
|
175
|
+
default: string;
|
176
|
+
};
|
177
|
+
labelWidth: import("vue-types").VueTypeValidableDef<number> & {
|
178
|
+
default: number;
|
179
|
+
};
|
180
|
+
labelPosition: import("vue-types").VueTypeValidableDef<string> & {
|
181
|
+
default: string;
|
182
|
+
};
|
183
|
+
property: import("vue-types").VueTypeValidableDef<string> & {
|
184
|
+
default: string;
|
185
|
+
} & {
|
186
|
+
default: string;
|
187
|
+
};
|
188
|
+
required: import("vue-types").VueTypeValidableDef<boolean> & {
|
189
|
+
default: boolean;
|
190
|
+
} & {
|
191
|
+
default: boolean;
|
192
|
+
};
|
193
|
+
email: import("vue-types").VueTypeValidableDef<boolean> & {
|
194
|
+
default: boolean;
|
195
|
+
} & {
|
196
|
+
default: boolean;
|
197
|
+
};
|
198
|
+
max: import("vue-types").VueTypeValidableDef<number> & {
|
199
|
+
default: number;
|
200
|
+
};
|
201
|
+
min: import("vue-types").VueTypeValidableDef<number> & {
|
202
|
+
default: number;
|
203
|
+
};
|
204
|
+
maxlength: import("vue-types").VueTypeValidableDef<number> & {
|
205
|
+
default: number;
|
206
|
+
};
|
207
|
+
rules: import("vue-types").VueTypeValidableDef<unknown[]> & {
|
208
|
+
default: () => unknown[];
|
209
|
+
};
|
210
|
+
autoCheck: import("vue-types").VueTypeValidableDef<boolean> & {
|
211
|
+
default: boolean;
|
212
|
+
} & {
|
213
|
+
default: boolean;
|
214
|
+
};
|
215
|
+
description: import("vue-types").VueTypeValidableDef<string> & {
|
216
|
+
default: string;
|
217
|
+
};
|
218
|
+
}, {
|
219
|
+
labelStyles: import("vue").ComputedRef<object>;
|
220
|
+
validate: () => any;
|
221
|
+
clearValidate: () => void;
|
222
|
+
isError: import("vue").Ref<boolean>;
|
223
|
+
errorMessage: import("vue").Ref<string>;
|
224
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
225
|
+
label: import("vue-types").VueTypeValidableDef<string> & {
|
226
|
+
default: string;
|
227
|
+
};
|
228
|
+
labelWidth: import("vue-types").VueTypeValidableDef<number> & {
|
229
|
+
default: number;
|
230
|
+
};
|
231
|
+
labelPosition: import("vue-types").VueTypeValidableDef<string> & {
|
232
|
+
default: string;
|
233
|
+
};
|
234
|
+
property: import("vue-types").VueTypeValidableDef<string> & {
|
235
|
+
default: string;
|
236
|
+
} & {
|
237
|
+
default: string;
|
238
|
+
};
|
239
|
+
required: import("vue-types").VueTypeValidableDef<boolean> & {
|
240
|
+
default: boolean;
|
241
|
+
} & {
|
242
|
+
default: boolean;
|
243
|
+
};
|
244
|
+
email: import("vue-types").VueTypeValidableDef<boolean> & {
|
245
|
+
default: boolean;
|
246
|
+
} & {
|
247
|
+
default: boolean;
|
248
|
+
};
|
249
|
+
max: import("vue-types").VueTypeValidableDef<number> & {
|
250
|
+
default: number;
|
251
|
+
};
|
252
|
+
min: import("vue-types").VueTypeValidableDef<number> & {
|
253
|
+
default: number;
|
254
|
+
};
|
255
|
+
maxlength: import("vue-types").VueTypeValidableDef<number> & {
|
256
|
+
default: number;
|
257
|
+
};
|
258
|
+
rules: import("vue-types").VueTypeValidableDef<unknown[]> & {
|
259
|
+
default: () => unknown[];
|
260
|
+
};
|
261
|
+
autoCheck: import("vue-types").VueTypeValidableDef<boolean> & {
|
262
|
+
default: boolean;
|
263
|
+
} & {
|
264
|
+
default: boolean;
|
265
|
+
};
|
266
|
+
description: import("vue-types").VueTypeValidableDef<string> & {
|
267
|
+
default: string;
|
268
|
+
};
|
269
|
+
}>>, {
|
270
|
+
label: string;
|
271
|
+
property: string;
|
272
|
+
email: boolean;
|
273
|
+
labelWidth: number;
|
274
|
+
labelPosition: string;
|
275
|
+
rules: unknown[];
|
276
|
+
required: boolean;
|
277
|
+
max: number;
|
278
|
+
min: number;
|
279
|
+
maxlength: number;
|
280
|
+
autoCheck: boolean;
|
281
|
+
description: string;
|
282
|
+
}>;
|
283
|
+
}>;
|
284
|
+
export default BkForm;
|
285
|
+
export { BkForm, FormItem as BkFormItem, };
|
286
|
+
export type { formProps, };
|
package/lib/form/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("
|
1
|
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("../shared"),require("vue")):"function"==typeof define&&define.amd?define(["exports","../shared","vue"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue)}(this,(function(e,r,t){"use strict";function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n={exports:{}};!function(e){e.exports=function(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e},e.exports.__esModule=!0,e.exports.default=e.exports}(n);var s=o(n.exports),i=Symbol("form"),a={formType:r.PropTypes.string,labelWidth:r.PropTypes.number,labelPosition:r.PropTypes.string.def("right"),model:r.PropTypes.object,rules:r.PropTypes.array},u=t.defineComponent({name:"BKForm",props:a,setup:function(e){var r=[];t.provide(i,{props:e,register:function(e){r.push(e)},unregister:function(e){r=r.reduce((function(r,t){return t!==e&&r.push(t),r}),[])}});return{validate:function(t){var o={};t?o=("string"==typeof t?[t]:t).reduce((function(e,r){return Object.assign(Object.assign({},e),s({},r,!0))}),{}):o=r.reduce((function(e,r){return r.property?Object.assign(Object.assign({},e),s({},r.property,!0)):e}),{});return Promise.all(r.reduce((function(e,r){return o[r.property]&&e.push(r.validate()),e}),[])).then((function(){return Promise.resolve(e.model)}))},clearValidate:function(e){var t={};e?t=("string"==typeof e?[e]:e).reduce((function(e,r){return Object.assign(Object.assign({},e),s({},r,!0))}),{}):t=r.reduce((function(e,r){return Object.assign(Object.assign({},e),s({},r.property,!0))}),{});r.forEach((function(e){return t[e.property]&&e.clearValidate()}))}}},render:function(){var e,o,n=r.classes(s({"bk-form":!0},"bk-form--".concat(this.formType),!0));return t.createVNode("form",{class:n},[null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e)])}}),l={exports:{}},p={exports:{}},c={exports:{}};!function(e){e.exports=function(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o},e.exports.__esModule=!0,e.exports.default=e.exports}(c),function(e){var r=c.exports;e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(p);var f={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(f);var d={exports:{}};!function(e){var r=c.exports;e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(d);var m={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(m),function(e){var r=p.exports,t=f.exports,o=d.exports,n=m.exports;e.exports=function(e){return r(e)||t(e)||o(e)||n()},e.exports.__esModule=!0,e.exports.default=e.exports}(l);var g=o(l.exports),b={required:function(e){return console.log("required"),""!==e},min:function(e,r){return console.log("min"),e>=r},max:function(e,r){return console.log("max"),r>=e},email:function(e){return console.log("email"),/^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/.test(e)},maxlength:function(e,r){return console.log("maxlength"),e.length<=r}},x={label:r.PropTypes.string,labelWidth:r.PropTypes.number,labelPosition:r.PropTypes.string,property:r.PropTypes.string.def(""),required:r.PropTypes.bool.def(!1),email:r.PropTypes.bool.def(!1),max:r.PropTypes.number,min:r.PropTypes.number,maxlength:r.PropTypes.number,rules:r.PropTypes.array,autoCheck:r.PropTypes.bool.def(!1),description:r.PropTypes.string},y=t.defineComponent({name:"BKFormItem",props:x,setup:function(e){var r=t.getCurrentInstance(),o=t.reactive({isError:!1,errorMessage:""}),n=t.inject(i),s=Boolean(n),a=t.computed((function(){var r={width:"",textAlign:""},t=e.labelWidth||s&&n.props.labelWidth;return t&&(r.width="".concat(t,"px")),(e.labelPosition||s&&n.props.labelPosition)&&(r["text-align"]="labelPosition"),r}));return t.onMounted((function(){s&&n.register(r.proxy)})),t.onBeforeUnmount((function(){s&&n.unregister(r.proxy)})),Object.assign(Object.assign({},t.toRefs(o)),{labelStyles:a,validate:function(){if(!e.property||s&&!n.props.model)return Promise.resolve();var r,t,i,a,u,l=[];s&&n.props.rules&&(r=n.props.rules,t=e.property,Object.prototype.hasOwnProperty.call(r,t))&&(l=n.props.rules[e.property]),e.rules&&(l=e.rules),i=l,a=function(e){var r=[];return e.required&&r.push({validator:b.required,message:"".concat(e.label,"不能为空"),trigger:"blur"}),e.email&&r.push({validator:b.email,message:"".concat(e.label,"格式不正确"),trigger:"blur"}),Number(e.max)>-1&&r.push({validator:function(r){return b.max(r,e.max)},message:"".concat(e.label,"最大值").concat(e.max),trigger:"blur"}),Number(e.min)>-1&&r.push({validator:function(r){return b.min(r,e.min)},message:"".concat(e.label,"最小值").concat(e.min),trigger:"blur"}),Number(e.maxlength)>-1&&r.push({validator:function(r){return b.maxlength(r,e.maxlength)},message:"".concat(e.label,"最大长度").concat(e.maxlength),trigger:"blur"}),r}(e),u=i.map((function(e){return{validator:e.required?b.required:e.email?b.email:Number(e.max)>-1?function(r){return b.max(r,e.max)}:Number(e.min)>-1||Number(e.maxlength)>-1?function(r){return b.min(r,e.max)}:function(){return!0},message:e.message,trigger:e.trigger}})),l=[].concat(g(a),g(u));var p,c=n.props.model[e.property],f=(p=-1,function(){if((p+=1)>=l.length)return Promise.resolve();var e=l[p];return Promise.resolve().then((function(){var r=e.validator(c);return"boolean"!=typeof r&&"function"==typeof r.then?r.then((function(){return f}),(function(){return o.isError=!0,o.errorMessage=e.message,Promise.reject(e.message)})):r?f():(o.isError=!0,o.errorMessage=e.message,Promise.reject(e.message))}))});return f()},clearValidate:function(){o.isError=!1,o.errorMessage=""}})},render:function(){var e=r.classes({"is-error":this.isError,"is-required":this.required},"bk-form-item");return t.createVNode("div",{class:e},[t.createVNode("div",{class:"bk-form-label",style:this.labelStyles},[this.label]),t.createVNode("div",{class:"bk-form-content"},[this.$slots.default(),this.isError&&t.createVNode("div",{class:"bk-form-error"},[this.errorMessage])])])}}),h=r.withInstallProps(u,{FormItem:y});e.BkForm=h,e.BkFormItem=y,e.default=h,Object.defineProperty(e,"__esModule",{value:!0})}));
|
@@ -0,0 +1,15 @@
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Vue)}(this,(function(e,t){"use strict";
|
2
|
+
/*! *****************************************************************************
|
3
|
+
Copyright (c) Microsoft Corporation.
|
4
|
+
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
6
|
+
purpose with or without fee is hereby granted.
|
7
|
+
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
15
|
+
***************************************************************************** */function n(e,a,i){return t.h(e.name,Object.assign(Object.assign({key:a},e.attributes),{style:"".concat(e.attributes.style," ").concat(i)}),(e.elements||[]).map((function(t,i){return n(t,"".concat(a,"-").concat(e.name,"-").concat(i))})))}var a=function(e,a){var i=Object.assign(Object.assign({},a.attrs),e),r=i.data,o=i.name,l=i.width,s=i.height,c=i.fill,u=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(n[a[i]]=e[a[i]])}return n}(i,["data","name","width","height","fill"]),f="width: ".concat(l,"; height: ").concat(s,"; fill: ").concat(c);return t.createVNode("span",u,[n(r,o,f)])};a.inheritAttrs=!1,a.displayName="bkIcon";var i=JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M512 744.64L789.6 462.72 880 554.56 512 928 144 554.56 234.4 462.72 512 744.64z"}},{"type":"element","name":"path","attributes":{"d":"M144 187.68L234.4 96 512 377.76 789.6 96 880 187.68 512 561.28 144 187.68z"}}]}'),r=function(e,n){var r=Object.assign(Object.assign({},e),n.attrs);return t.createVNode(a,t.mergeProps(r,{data:i,name:"angleDoubleDownLine"}),null)};r.displayName="angleDoubleDownLine",r.inheritAttrs=!1,e.default=r,Object.defineProperty(e,"__esModule",{value:!0})}));
|