@vunk/form 0.0.0-alpha.3 → 0.0.0-alpha.5

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.
@@ -1,6 +1,6 @@
1
1
  import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
2
2
  import { selectProps, selectEmits } from '@vunk/form/shared/element-plus/instances/select';
3
- import { defineComponent, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, createVNode, mergeProps, toHandlers, createElementBlock, Fragment, renderList } from 'vue';
3
+ import { defineComponent, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, createVNode, mergeProps, toHandlers, createSlots, createElementBlock, Fragment, renderList, renderSlot, resolveDynamicComponent } from 'vue';
4
4
  import { createSelectBindProps, createSelectOnEmits } from '@vunk/form/shared/element-plus/ctx';
5
5
  import { ElSelect, ElOption } from 'element-plus';
6
6
  import { isPlainObject } from 'vunk/shared/utils-object';
@@ -11,6 +11,10 @@ const props = {
11
11
  options: {
12
12
  type: Array,
13
13
  default: () => []
14
+ },
15
+ selectSlots: {
16
+ type: Object,
17
+ default: void 0
14
18
  }
15
19
  };
16
20
  const emits = {
@@ -46,18 +50,28 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
46
50
  const _component_VkfFormItem = resolveComponent("VkfFormItem");
47
51
  return openBlock(), createBlock(_component_VkfFormItem, normalizeProps(guardReactiveProps(_ctx.formItemBindProps)), {
48
52
  default: withCtx(() => [
49
- createVNode(_component_ElSelect, mergeProps(_ctx.selectBindProps, toHandlers(_ctx.selectOnEmits)), {
53
+ createVNode(_component_ElSelect, mergeProps(_ctx.selectBindProps, toHandlers(_ctx.selectOnEmits)), createSlots({
50
54
  default: withCtx(() => [
51
55
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item) => {
52
56
  return openBlock(), createBlock(_component_ElOption, mergeProps({
53
57
  key: _ctx.getKey(item)
54
58
  }, item), null, 16);
55
- }), 128))
59
+ }), 128)),
60
+ renderSlot(_ctx.$slots, "default")
56
61
  ]),
57
- _: 1
58
- }, 16)
62
+ _: 2
63
+ }, [
64
+ renderList(_ctx.selectSlots, (item, key) => {
65
+ return {
66
+ name: key,
67
+ fn: withCtx((e) => [
68
+ (openBlock(), createBlock(resolveDynamicComponent(item?.(e))))
69
+ ])
70
+ };
71
+ })
72
+ ]), 1040)
59
73
  ]),
60
- _: 1
74
+ _: 3
61
75
  }, 16);
62
76
  }
63
77
 
@@ -1,5 +1,6 @@
1
1
  import { VueComponentPropsType } from 'vunk/shared/types';
2
2
  import { PropType } from 'vue';
3
+ import { SelectSlots } from './types';
3
4
  export declare const props: {
4
5
  options: {
5
6
  type: PropType<VueComponentPropsType<import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
@@ -64,6 +65,10 @@ export declare const props: {
64
65
  }>>>[]>;
65
66
  default: () => never[];
66
67
  };
68
+ selectSlots: {
69
+ type: PropType<SelectSlots>;
70
+ default: undefined;
71
+ };
67
72
  name: StringConstructor;
68
73
  id: StringConstructor;
69
74
  modelValue: {
@@ -62,6 +62,10 @@ declare const _default: import("vue").DefineComponent<{
62
62
  }>>>[]>;
63
63
  default: () => never[];
64
64
  };
65
+ selectSlots: {
66
+ type: import("vue").PropType<import("./types").SelectSlots>;
67
+ default: undefined;
68
+ };
65
69
  name: StringConstructor;
66
70
  id: StringConstructor;
67
71
  modelValue: {
@@ -365,6 +369,10 @@ declare const _default: import("vue").DefineComponent<{
365
369
  }>>>[]>;
366
370
  default: () => never[];
367
371
  };
372
+ selectSlots: {
373
+ type: import("vue").PropType<import("./types").SelectSlots>;
374
+ default: undefined;
375
+ };
368
376
  name: StringConstructor;
369
377
  id: StringConstructor;
370
378
  modelValue: {
@@ -576,5 +584,6 @@ declare const _default: import("vue").DefineComponent<{
576
584
  disabled: boolean;
577
585
  created: boolean;
578
586
  }>>>[];
587
+ selectSlots: import("./types").SelectSlots;
579
588
  }>;
580
589
  export default _default;
@@ -1,3 +1,5 @@
1
- import { ReturnVoid } from 'vunk/shared/types';
2
- export declare type LoadEvent = {};
3
- export declare type OnLoad = (e: LoadEvent) => ReturnVoid;
1
+ import { Func } from '@vunk/form/shared/types';
2
+ export declare type SelectSlots = {
3
+ prefix?: Func;
4
+ empty?: Func;
5
+ };
package/index.css CHANGED
@@ -1,44 +1,47 @@
1
+
2
+ .vkf-confirm-input .el-input-group__append {
3
+ cursor: initial;
4
+ }
5
+
6
+ .vkf-confirm-input .vkf-confirm-input-icon {
7
+ color: var(--el-color-primary);
8
+ cursor: pointer;
9
+ }
1
10
 
2
- .vkf-confirm-input .el-input-group__append {
3
- cursor: initial;
4
- }
5
-
6
- .vkf-confirm-input .vkf-confirm-input-icon {
7
- color: var(--el-color-primary);
8
- cursor: pointer;
9
- }
10
-
11
-
12
- .vkf-ground {
13
- display: flex;
14
- }
15
-
16
- .vkf-ground-widget-x {
17
- width: 15em;
18
- height: 100%;
19
- }
20
-
21
- .vkf-ground-main-x {
22
- flex: 3;
23
- }
24
- .vkf-ground-main-x .vkf-ground-main-card{
25
- height: 100%;
26
- }
27
- .vkf-ground-main-card > .vk-card-title{
28
- display: flex;
29
- justify-content: end;
30
- margin-bottom: var(--gap-xxs);
31
- }
32
- .vkf-ground-main-card > .vk-card-body{
33
- height: 100%;
34
- border: 2px var(--el-border-color) dashed;
35
- overflow: auto;
36
- }
37
-
38
- .vkf-ground-config-x {
39
- padding: 0 1em;
40
- flex: 1;
41
- }
11
+
12
+ .vkf-ground {
13
+ display: flex;
14
+ }
15
+
16
+ .vkf-ground-widget-x {
17
+ width: 15em;
18
+ height: 100%;
19
+ }
20
+
21
+ .vkf-ground-main-x {
22
+ flex: 3;
23
+ }
24
+
25
+ .vkf-ground-main-x .vkf-ground-main-card {
26
+ height: 100%;
27
+ }
28
+
29
+ .vkf-ground-main-card>.vk-card-title {
30
+ display: flex;
31
+ justify-content: end;
32
+ margin-bottom: var(--gap-xxs);
33
+ }
34
+
35
+ .vkf-ground-main-card>.vk-card-body {
36
+ height: 100%;
37
+ border: 2px var(--el-border-color) dashed;
38
+ overflow: auto;
39
+ }
40
+
41
+ .vkf-ground-config-x {
42
+ padding: 0 1em;
43
+ flex: 1;
44
+ }
42
45
 
43
46
  .vkf-ground-main {
44
47
  min-height: 100%;
package/index.d.ts CHANGED
@@ -24,11 +24,11 @@ export * from '@vunk/form/components/confirm-input'
24
24
  export * from '@vunk/form/components/form'
25
25
 
26
26
  export * from '@vunk/form/components/rules-config'
27
-
28
- export * from '@vunk/form/components/switch'
29
-
30
- export * from '@vunk/form/components/form-item'
31
-
32
- export * from '@vunk/form/components/select'
33
-
34
- export * from '@vunk/form/components/select-config'
27
+
28
+ export * from '@vunk/form/components/switch'
29
+
30
+ export * from '@vunk/form/components/form-item'
31
+
32
+ export * from '@vunk/form/components/select'
33
+
34
+ export * from '@vunk/form/components/select-config'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "0.0.0-alpha.3",
3
+ "version": "0.0.0-alpha.5",
4
4
  "description": "",
5
5
  "module": "index.esm.js",
6
6
  "scripts": {
@@ -5,3 +5,7 @@ export declare type SetDataEvent<K = any> = {
5
5
  v: any;
6
6
  insert?: boolean;
7
7
  };
8
+ export declare type UnsetDataEvent<K = any> = {
9
+ k: K;
10
+ n?: number;
11
+ };