@ithinkdt/ui 4.0.0-21 → 4.0.0-23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ithinkdt/ui",
3
- "version": "4.0.0-21",
3
+ "version": "4.0.0-23",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "iThinkDT UI",
@@ -87,8 +87,8 @@
87
87
  "unocss": ">=66.5.4",
88
88
  "vite": "npm:rolldown-vite@^7.1.17",
89
89
  "vue": "^3.5.22",
90
- "vue-router": "^4.6.0",
91
- "@ithinkdt/page": "^4.0.0-13"
90
+ "vue-router": "^4.6.2",
91
+ "@ithinkdt/page": "^4.0.0-16"
92
92
  },
93
93
  "scripts": {
94
94
  "release": "pnpm publish --no-git-checks"
@@ -13,6 +13,7 @@ const DataCustomItem = /* @__PURE__ */ defineComponent({
13
13
  label: [String, Function],
14
14
  disabled: Boolean,
15
15
  hidden: Boolean,
16
+ showFixed: Boolean,
16
17
  fixed: [Boolean, String],
17
18
  },
18
19
  emits: ['update-hidden', 'update-fixed'],
@@ -31,24 +32,30 @@ const DataCustomItem = /* @__PURE__ */ defineComponent({
31
32
  onUpdateChecked={v => emit('update-hidden', !v)}
32
33
  />
33
34
  <NEllipsis style="flex: 1 1 auto">{toValue(props.label)}</NEllipsis>
34
- <NButton
35
- text
36
- type={props.fixed === 'left' ? 'primary' : undefined}
37
- onClick={() => emit('update-fixed', props.fixed === 'left' ? false : 'left')}
38
- >
39
- <NIcon>
40
- <ILeft />
41
- </NIcon>
42
- </NButton>
43
- <NButton
44
- text
45
- type={props.fixed === 'right' ? 'primary' : undefined}
46
- onClick={() => emit('update-fixed', props.fixed === 'right' ? false : 'right')}
47
- >
48
- <NIcon>
49
- <IRight />
50
- </NIcon>
51
- </NButton>
35
+ {
36
+ props.showFixed
37
+ ? [
38
+ <NButton
39
+ text
40
+ type={props.fixed === 'left' ? 'primary' : undefined}
41
+ onClick={() => emit('update-fixed', props.fixed === 'left' ? false : 'left')}
42
+ >
43
+ <NIcon>
44
+ <ILeft />
45
+ </NIcon>
46
+ </NButton>,
47
+ <NButton
48
+ text
49
+ type={props.fixed === 'right' ? 'primary' : undefined}
50
+ onClick={() => emit('update-fixed', props.fixed === 'right' ? false : 'right')}
51
+ >
52
+ <NIcon>
53
+ <IRight />
54
+ </NIcon>
55
+ </NButton>,
56
+ ]
57
+ : undefined
58
+ }
52
59
  </NFlex>
53
60
  )
54
61
  }
@@ -80,7 +87,7 @@ export const DataCustom = /* @__PURE__ */ defineComponent({
80
87
  },
81
88
  showFixed: {
82
89
  type: Boolean,
83
- default: false,
90
+ default: true,
84
91
  },
85
92
  disabledField: {
86
93
  type: String,
@@ -91,6 +98,13 @@ export const DataCustom = /* @__PURE__ */ defineComponent({
91
98
  default: 'visiblity',
92
99
  },
93
100
  tooltip: [String, Object],
101
+ size: {
102
+ type: Number,
103
+ default: 20,
104
+ },
105
+ type: {
106
+ type: String,
107
+ },
94
108
  },
95
109
  emits: {
96
110
  custom: () => true,
@@ -100,7 +114,7 @@ export const DataCustom = /* @__PURE__ */ defineComponent({
100
114
 
101
115
  function emitCols(col, field, value) {
102
116
  emit('custom', {
103
- key: col.key,
117
+ key: col[props.keyField],
104
118
  [field]: value,
105
119
  })
106
120
  }
@@ -134,8 +148,8 @@ export const DataCustom = /* @__PURE__ */ defineComponent({
134
148
  {{
135
149
  trigger: () =>
136
150
  withDirectives(
137
- <NButton text>
138
- <NIcon size="20">
151
+ <NButton text type={props.type}>
152
+ <NIcon size={props.size}>
139
153
  <ICustom />
140
154
  </NIcon>
141
155
  </NButton>,
@@ -158,6 +172,7 @@ export const DataCustom = /* @__PURE__ */ defineComponent({
158
172
  label={item[props.labelField]}
159
173
  hidden={item[props.hiddenField]}
160
174
  fixed={item[props.fixedField]}
175
+ showFixed={props.showFixed}
161
176
  onUpdateHidden={v => emitCols(item, 'hidden', v)}
162
177
  onUpdateFixed={v => emitCols(item, 'fixed', v)}
163
178
  />
@@ -5,6 +5,7 @@ import { pickProps } from '@ithinkdt/common/object'
5
5
 
6
6
  import { useI18n } from '../use-i18n.js'
7
7
 
8
+ import { DataCustom } from './DataCustom.jsx'
8
9
  import { DataForm } from './DataForm.jsx'
9
10
  import { IDown, IUp } from './assets.jsx'
10
11
 
@@ -87,6 +88,11 @@ export const DataFilter = /* @__PURE__ */ defineComponent({
87
88
  <NButton attrType="reset" disabled={props.disabled || props.loading}>
88
89
  {resetText || t('common.page.form.resetText') }
89
90
  </NButton>
91
+ {
92
+ customizable
93
+ ? <DataCustom keyField="name" showFixed={false} data={formProps.items} onCustom={e => emit('custom', e)} size={18} type="primary" />
94
+ : undefined
95
+ }
90
96
  {
91
97
  collapsible && action.suffix
92
98
  ? (
@@ -232,6 +232,8 @@ export type DataCustomProps<Data extends {}> = {
232
232
  disabledField?: keyof Data | undefined
233
233
  visiblityField?: keyof Data | undefined
234
234
  labelTitle?: VNodeChild | undefined
235
+ size?: number | undefined
236
+ type?: 'primary' | 'default' | undefined
235
237
  onCustom?: MaybeArray<
236
238
  ((reset: true) => void)
237
239
  | ((sort: string[]) => void)
package/src/page.jsx CHANGED
@@ -555,7 +555,7 @@ export function createModalHelper() {
555
555
  const footer0 = footer
556
556
  ? () => footer
557
557
  : footer === null
558
- ? () => null
558
+ ? null
559
559
  : () => (
560
560
  <NFlex justify="end" gap="16">
561
561
  {cancelText === null ? undefined : <NButton onClick={onCancel} disabled={cancelDisabled} loading={cancelLoading} style="min-width: 60px">{cancelText}</NButton>}
@@ -598,6 +598,7 @@ export function createModalHelper() {
598
598
  )
599
599
  }
600
600
 
601
+ const { bodyContentClass, bodyContentStyle, ...options2 } = options
601
602
  return (
602
603
  <NDrawer
603
604
  show={visible}
@@ -613,9 +614,14 @@ export function createModalHelper() {
613
614
  onAfterEnter={onAfterOpen}
614
615
  onAfterLeave={onAfterClose}
615
616
  style={style}
616
- {...options}
617
+ {...options2}
617
618
  >
618
- <NDrawerContent closable={closable} nativeScrollbar={nativeScrollbar ?? false}>
619
+ <NDrawerContent
620
+ closable={closable}
621
+ nativeScrollbar={nativeScrollbar ?? false}
622
+ bodyContentClass={bodyContentClass}
623
+ bodyContentStyle={bodyContentStyle}
624
+ >
619
625
  {{
620
626
  default: () => content,
621
627
  header: () => title,