@ticatec/uniface-element 0.1.61 → 0.1.66

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 (48) hide show
  1. package/dist/checkbox/CheckBox.svelte +11 -0
  2. package/dist/checkbox/CheckBox.svelte.d.ts +5 -1
  3. package/dist/common/utils.js +1 -7
  4. package/dist/common-editor/CommonEditor.svelte +2 -1
  5. package/dist/common-editor/CommonEditor.svelte.d.ts +1 -0
  6. package/dist/common-editor/NumberInput.svelte +60 -19
  7. package/dist/common-editor/NumberInput.svelte.d.ts +3 -4
  8. package/dist/data-table/UniDataTable.js +7 -5
  9. package/dist/date-picker/DatePicker.svelte +7 -1
  10. package/dist/date-picker/DatePicker.svelte.d.ts +4 -1
  11. package/dist/date-picker/DateTimePicker.svelte +9 -3
  12. package/dist/date-picker/DateTimePicker.svelte.d.ts +4 -1
  13. package/dist/inline-cell-editor/EditorManager.d.ts +8 -0
  14. package/dist/inline-cell-editor/EditorManager.js +29 -0
  15. package/dist/inline-cell-editor/InlineCellEditor.svelte +9 -0
  16. package/dist/inline-cell-editor/InlineCellEditor.svelte.d.ts +31 -0
  17. package/dist/inline-cell-editor/InlineCheckbox.svelte +32 -0
  18. package/dist/inline-cell-editor/InlineCheckbox.svelte.d.ts +24 -0
  19. package/dist/inline-cell-editor/InlineDatePicker.svelte +32 -0
  20. package/dist/inline-cell-editor/InlineDatePicker.svelte.d.ts +24 -0
  21. package/dist/inline-cell-editor/InlineDateTimePicker.svelte +31 -0
  22. package/dist/inline-cell-editor/InlineDateTimePicker.svelte.d.ts +24 -0
  23. package/dist/inline-cell-editor/InlineNumberEditor.svelte +30 -0
  24. package/dist/inline-cell-editor/InlineNumberEditor.svelte.d.ts +24 -0
  25. package/dist/inline-cell-editor/InlineOptionsMultiSelect.svelte +32 -0
  26. package/dist/inline-cell-editor/InlineOptionsMultiSelect.svelte.d.ts +24 -0
  27. package/dist/inline-cell-editor/InlineOptionsSelect.svelte +30 -0
  28. package/dist/inline-cell-editor/InlineOptionsSelect.svelte.d.ts +24 -0
  29. package/dist/inline-cell-editor/InlineTextEditor.svelte +30 -0
  30. package/dist/inline-cell-editor/InlineTextEditor.svelte.d.ts +24 -0
  31. package/dist/inline-cell-editor/InvalidEditor.svelte +13 -0
  32. package/dist/inline-cell-editor/InvalidEditor.svelte.d.ts +23 -0
  33. package/dist/inline-cell-editor/acceptProps.d.ts +6 -0
  34. package/dist/inline-cell-editor/acceptProps.js +20 -0
  35. package/dist/inline-cell-editor/getNestObject.d.ts +9 -0
  36. package/dist/inline-cell-editor/getNestObject.js +28 -0
  37. package/dist/inline-cell-editor/index.d.ts +6 -0
  38. package/dist/inline-cell-editor/index.js +6 -0
  39. package/dist/number-editor/NumberEditor.svelte +13 -2
  40. package/dist/number-editor/NumberEditor.svelte.d.ts +2 -0
  41. package/dist/options-multi-select/OptionsMultiSelect.svelte +6 -0
  42. package/dist/options-multi-select/OptionsMultiSelect.svelte.d.ts +4 -1
  43. package/dist/options-select/OptionsSelect.svelte +6 -0
  44. package/dist/options-select/OptionsSelect.svelte.d.ts +4 -1
  45. package/dist/text-editor/TextEditor.svelte +7 -4
  46. package/dist/text-editor/TextEditor.svelte.d.ts +2 -1
  47. package/dist/ticatec-uniface-web.css +5 -3
  48. package/package.json +5 -1
@@ -12,12 +12,20 @@
12
12
  export let compact: boolean = false;
13
13
  export let onClick: ((event: MouseEvent) => void) | null = null;
14
14
  export let onChange: OnChangeHandler<boolean> = null as unknown as OnChangeHandler<boolean>;
15
+ export let autoFocus: boolean = false;
16
+
17
+ export const setFocus = () => {
18
+ setTimeout(()=> {
19
+ checkbox && checkbox.focus();
20
+ }, 50);
21
+ }
15
22
 
16
23
  let oldValue = value;
17
24
 
18
25
  let checkbox: any;
19
26
  let checked: boolean;
20
27
 
28
+
21
29
  const handleClickEvent = (e: MouseEvent) => {
22
30
  if (readonly || disabled) {
23
31
  e.stopPropagation();
@@ -45,6 +53,9 @@
45
53
  oldValue = value;
46
54
  }
47
55
 
56
+ $: if (checkbox && autoFocus) {
57
+ checkbox.focus();
58
+ }
48
59
 
49
60
  </script>
50
61
  <div class="uniface-checkbox" class:disabled class:compact {style}>
@@ -22,8 +22,12 @@ declare const CheckBox: $$__sveltets_2_IsomorphicComponent<{
22
22
  compact?: boolean;
23
23
  onClick?: ((event: MouseEvent) => void) | null;
24
24
  onChange?: OnChangeHandler<boolean>;
25
+ autoFocus?: boolean;
26
+ setFocus?: () => void;
25
27
  }, {
26
28
  [evt: string]: CustomEvent<any>;
27
- }, {}, {}, string>;
29
+ }, {}, {
30
+ setFocus: () => void;
31
+ }, string>;
28
32
  type CheckBox = InstanceType<typeof CheckBox>;
29
33
  export default CheckBox;
@@ -70,13 +70,7 @@ const formatNumber = (n, precision) => {
70
70
  }
71
71
  else {
72
72
  if (precision != null) {
73
- if (precision > 0) {
74
- let base = Math.pow(10, precision);
75
- return (Math.floor(n * base) / base).toFixed(precision);
76
- }
77
- else {
78
- return Math.floor(n).toString();
79
- }
73
+ return n.toFixed(precision);
80
74
  }
81
75
  else {
82
76
  return n.toString();
@@ -14,6 +14,7 @@
14
14
  export let value: any = null;
15
15
  export let suffix: string = '';
16
16
  export let prefix: string = '';
17
+ export let input$class: string = null as unknown as string;
17
18
  export let displayMode: DisplayMode = DisplayMode.Edit;
18
19
  export let showActionIcon: boolean = false;
19
20
  export let clean: () => void;
@@ -53,7 +54,7 @@
53
54
  </div>
54
55
  {/if}
55
56
  {#if disabled || readonly}
56
- <input type="text" style="flex: 1 1 auto" {value} {disabled} {readonly} {placeholder}>
57
+ <input class={input$class} type="text" style="flex: 1 1 auto" {value} {disabled} {readonly} {placeholder}>
57
58
  {:else}
58
59
  <div style="position: relative; flex: 1 1 auto">
59
60
  <slot/>
@@ -28,6 +28,7 @@ declare const CommonEditor: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_Pr
28
28
  value?: any;
29
29
  suffix?: string;
30
30
  prefix?: string;
31
+ input$class?: string;
31
32
  displayMode?: DisplayMode;
32
33
  showActionIcon?: boolean;
33
34
  clean: () => void;
@@ -14,8 +14,8 @@
14
14
  export let max: number | null = null;
15
15
  export let min: number | null = null;
16
16
  export let onChange: OnChangeHandler<number | null> = null as unknown as OnChangeHandler<number | null>;
17
-
18
- export const setFocus = () => {
17
+ export let textValue: string;
18
+ export const focus = () => {
19
19
  editor.focus();
20
20
  }
21
21
 
@@ -26,6 +26,7 @@
26
26
  let editor: any;
27
27
 
28
28
  const handleBlurEvent = (e: FocusEvent) => {
29
+ isFocused = false;
29
30
  if (!readonly) {
30
31
  value = parseFloat(textValue);
31
32
  if (isNaN(value)) {
@@ -58,21 +59,10 @@
58
59
  }
59
60
  }
60
61
 
61
- const handleKeyDown = async (event: KeyboardEvent) => {
62
- let accept = (ctrlKeys.indexOf(event.key) > -1 && !composing) || checkNewInputText(event.key);
63
- // if (!accept) {
64
- // accept = checkNewInputText(event.key)
65
- // }
66
- if (!accept) {
67
- event.stopPropagation();
68
- event.preventDefault();
69
- } else {
70
- await tick();
71
- }
72
- }
73
62
 
74
63
  let composing: boolean = false;
75
64
  let currentText: string;
65
+ let isFocused = false;
76
66
 
77
67
  const handlePaste = (event: ClipboardEvent) => {
78
68
  const pasteData = event.clipboardData?.getData('text') || '';
@@ -81,6 +71,46 @@
81
71
  }
82
72
  }
83
73
 
74
+ const handleKeyDown = (event: KeyboardEvent) => {
75
+ // 检查是否是全角字符或中文等(非 ASCII)
76
+ if (/[^\x00-\x7F]/.test(event.key)) {
77
+ event.preventDefault();
78
+ event.stopPropagation();
79
+ return;
80
+ }
81
+
82
+ // 保留 ctrl 等特殊键
83
+ const allowKeys = ['Backspace', 'Delete', 'Tab', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];
84
+ if (allowKeys.includes(event.key)) return;
85
+
86
+ // 如果是数字或小数点、负号等,可允许(你可根据 precision 精度自定义更严格规则)
87
+ if (/[\d\.\-]/.test(event.key)) return;
88
+
89
+ // 拦截其他非法字符
90
+ event.preventDefault();
91
+ event.stopPropagation();
92
+ };
93
+ const handleInput = () => {
94
+ if (composing) return; // 正在输入拼音等,忽略
95
+
96
+ // 校验是否为合法数字字符串
97
+ const raw = editor.value;
98
+ if (/[^\x00-\x7F]/.test(raw)) {
99
+ // 包含中文、日文、韩文、全角字符、表情等
100
+ editor.value = textValue; // 恢复输入前状态
101
+ return;
102
+ }
103
+ if (regex.test(raw)) {
104
+ const parsed = parseFloat(raw);
105
+ if (!isNaN(parsed) && utils.isValidNumber(parsed, precision, allowNegative, max, min)) {
106
+ value = parsed;
107
+ }
108
+ }
109
+
110
+ // 不合法时可以不更新 value,只更新 textValue(允许用户继续输)
111
+ textValue = raw;
112
+ }
113
+
84
114
 
85
115
  const handleCompositionStart = (event: CompositionEvent) => {
86
116
  currentText = editor.value;
@@ -89,16 +119,27 @@
89
119
 
90
120
  const handleCompositionEnd = (event: CompositionEvent) => {
91
121
  composing = false;
92
- editor.value = currentText;
122
+ if (/[^\x00-\x7F]/.test(editor.value)) {
123
+ editor.value = currentText; // 恢复输入前内容
124
+ textValue = currentText;
125
+ } else {
126
+ handleInput(); // 正常输入
127
+ }
93
128
  };
94
129
 
95
130
 
96
- let textValue: string = utils.formatNumber(value, precision);
131
+ $: if (!isFocused) {
132
+ textValue = value == null ? '' : utils.formatNumber(value, precision);
133
+ }
97
134
 
98
- $: textValue = value == null ? '' : utils.formatNumber(value, precision);
99
135
  $: regex = new RegExp(utils.getNumberRegex(precision, allowNegative));
100
136
 
101
137
  </script>
102
- <input bind:this={editor} type="text" {readonly} {style} {disabled} placeholder={readonly || disabled ? '' : placeholder} bind:value={textValue}
103
- on:keydown={handleKeyDown} on:focus on:blur={handleBlurEvent} on:compositionstart={handleCompositionStart}
138
+ <input class="number-editor" bind:this={editor} type="text" {readonly} {style} {disabled} placeholder={readonly || disabled ? '' : placeholder}
139
+ bind:value={textValue}
140
+ on:focus={() => isFocused = true}
141
+ on:blur={handleBlurEvent}
142
+ on:compositionstart={handleCompositionStart}
143
+ on:input={handleInput}
144
+ on:keydown={handleKeyDown}
104
145
  on:compositionend={handleCompositionEnd} on:paste={handlePaste}/>
@@ -23,13 +23,12 @@ declare const NumberInput: $$__sveltets_2_IsomorphicComponent<{
23
23
  max?: number | null;
24
24
  min?: number | null;
25
25
  onChange?: OnChangeHandler<number | null>;
26
- setFocus?: () => void;
26
+ textValue: string;
27
+ focus?: () => void;
27
28
  }, {
28
- focus: FocusEvent;
29
- } & {
30
29
  [evt: string]: CustomEvent<any>;
31
30
  }, {}, {
32
- setFocus: () => void;
31
+ focus: () => void;
33
32
  }, string>;
34
33
  type NumberInput = InstanceType<typeof NumberInput>;
35
34
  export default NumberInput;
@@ -28,11 +28,13 @@ export default class UniDataTable {
28
28
  this._frozenColumns = [];
29
29
  this._columns = [];
30
30
  (columns ?? []).forEach(col => {
31
- if (col.frozen) {
32
- this._frozenColumns.push(col);
33
- }
34
- else {
35
- this._columns.push(col);
31
+ if (col.visible != false) {
32
+ if (col.frozen) {
33
+ this._frozenColumns.push(col);
34
+ }
35
+ else {
36
+ this._columns.push(col);
37
+ }
36
38
  }
37
39
  });
38
40
  }
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
 
3
- import {onMount} from "svelte";
3
+ import {onMount, tick} from "svelte";
4
4
  import {DisplayMode} from "../common/DisplayMode";
5
5
  import Popover from "../common/Popover.svelte";
6
6
  import dayjs from "dayjs";
@@ -21,6 +21,12 @@
21
21
  export let min: UniDate = null;
22
22
  export let max: UniDate = null;
23
23
  export let onChange: OnChangeHandler<Date> = null as unknown as OnChangeHandler<Date>;
24
+ export const setFocus = () => {
25
+ setTimeout(()=> {
26
+ editor && editor.focus();
27
+ }, 50);
28
+ }
29
+
24
30
 
25
31
  let textValue: string;
26
32
  let editor: any;
@@ -27,11 +27,14 @@ declare const DatePicker: $$__sveltets_2_IsomorphicComponent<{
27
27
  min?: UniDate;
28
28
  max?: UniDate;
29
29
  onChange?: OnChangeHandler<Date>;
30
+ setFocus?: () => void;
30
31
  }, {
31
32
  blur: FocusEvent;
32
33
  focus: FocusEvent;
33
34
  } & {
34
35
  [evt: string]: CustomEvent<any>;
35
- }, {}, {}, string>;
36
+ }, {}, {
37
+ setFocus: () => void;
38
+ }, string>;
36
39
  type DatePicker = InstanceType<typeof DatePicker>;
37
40
  export default DatePicker;
@@ -1,10 +1,10 @@
1
1
  <script lang="ts">
2
2
 
3
- import {onMount} from "svelte";
3
+ import {onMount, tick} from "svelte";
4
4
  import dayjs from "dayjs";
5
5
  import {DisplayMode} from "../common/DisplayMode";
6
6
  import dateUtils, {type UniDate} from "../base-calendar/dateUtils";
7
- import Calendar, {DateContext} from "../base-calendar";
7
+ import Calendar from "../base-calendar";
8
8
  import TimePanel from "./TimePanel.svelte";
9
9
  import {TextButton} from "../button";
10
10
  import type {OnChangeHandler} from "../common/OnChangeHandler";
@@ -24,11 +24,17 @@
24
24
  export let variant: '' | 'plain' | 'outlined' | 'filled' = '';
25
25
  export let mandatory: boolean = false;
26
26
  export let onChange: OnChangeHandler<Date> = null as unknown as OnChangeHandler<Date>;
27
+ export const setFocus = () => {
28
+ setTimeout(()=> {
29
+ editor && editor.focus();
30
+ }, 50);
31
+ }
32
+
27
33
 
28
34
  let confirmText = i18nContext.getText('uniface.calendar.confirmText');
29
35
  let textValue: string;
30
36
  let editor: any;
31
- let oldValue: Date = dateUtils.toDayjs(value)?.toDate();
37
+
32
38
  let currentValue: dayjs.Dayjs;
33
39
 
34
40
  const dateFmts = {
@@ -28,11 +28,14 @@ declare const DateTimePicker: $$__sveltets_2_IsomorphicComponent<{
28
28
  variant?: "" | "plain" | "outlined" | "filled";
29
29
  mandatory?: boolean;
30
30
  onChange?: OnChangeHandler<Date>;
31
+ setFocus?: () => void;
31
32
  }, {
32
33
  blur: FocusEvent;
33
34
  focus: FocusEvent;
34
35
  } & {
35
36
  [evt: string]: CustomEvent<any>;
36
- }, {}, {}, string>;
37
+ }, {}, {
38
+ setFocus: () => void;
39
+ }, string>;
37
40
  type DateTimePicker = InstanceType<typeof DateTimePicker>;
38
41
  export default DateTimePicker;
@@ -0,0 +1,8 @@
1
+ declare class EditorManager {
2
+ private map;
3
+ constructor();
4
+ getRender(type: string): any;
5
+ register(type: string, render: any): void;
6
+ }
7
+ declare const editorManager: EditorManager;
8
+ export default editorManager;
@@ -0,0 +1,29 @@
1
+ import InlineTextEditor from "./InlineTextEditor.svelte";
2
+ import InlineOptionsSelect from "./InlineOptionsSelect.svelte";
3
+ import InvalidEditor from "./InvalidEditor.svelte";
4
+ import InlineDatePicker from "./InlineDatePicker.svelte";
5
+ import InlineNumberEditor from "./InlineNumberEditor.svelte";
6
+ import InlineDateTimePicker from "./InlineDateTimePicker.svelte";
7
+ import InlineOptionsMultiSelect from "./InlineOptionsMultiSelect.svelte";
8
+ import InlineCheckbox from "./InlineCheckbox.svelte";
9
+ class EditorManager {
10
+ map;
11
+ constructor() {
12
+ this.map = new Map();
13
+ }
14
+ getRender(type) {
15
+ return this.map.get(type) ?? InvalidEditor;
16
+ }
17
+ register(type, render) {
18
+ this.map.set(type, render);
19
+ }
20
+ }
21
+ const editorManager = new EditorManager();
22
+ editorManager.register('text', InlineTextEditor);
23
+ editorManager.register('number', InlineNumberEditor);
24
+ editorManager.register('date', InlineDatePicker);
25
+ editorManager.register('boolean', InlineCheckbox);
26
+ editorManager.register('date-time', InlineDateTimePicker);
27
+ editorManager.register('options-selector', InlineOptionsSelect);
28
+ editorManager.register('multi-select', InlineOptionsMultiSelect);
29
+ export default editorManager;
@@ -0,0 +1,9 @@
1
+ <script lang="ts">
2
+
3
+ export let style: string = ""
4
+
5
+ </script>
6
+
7
+ <div class="editor-cell" {style} on:focus>
8
+ <slot/>
9
+ </div>
@@ -0,0 +1,31 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
15
+ default: any;
16
+ } ? Props extends Record<string, never> ? any : {
17
+ children?: any;
18
+ } : {});
19
+ declare const InlineCellEditor: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
20
+ style?: string;
21
+ }, {
22
+ default: {};
23
+ }>, {
24
+ focus: FocusEvent;
25
+ } & {
26
+ [evt: string]: CustomEvent<any>;
27
+ }, {
28
+ default: {};
29
+ }, {}, string>;
30
+ type InlineCellEditor = InstanceType<typeof InlineCellEditor>;
31
+ export default InlineCellEditor;
@@ -0,0 +1,32 @@
1
+ <script lang="ts">
2
+
3
+
4
+ import InlineCellEditor from "./InlineCellEditor.svelte";
5
+ import {acceptProps} from "./acceptProps";
6
+ import Checkbox from "../checkbox";
7
+ import {getNestObject} from "./getNestObject";
8
+
9
+ export let data: any;
10
+ export let readonly: boolean = false;
11
+ export let field: any;
12
+ export let props: any;
13
+ export let active: boolean;
14
+
15
+ const accepts = ['indeterminate', 'compact']
16
+
17
+ let filteredProps: any = acceptProps(props, accepts);
18
+
19
+ let {parent, keyField} = getNestObject(data, field)
20
+
21
+
22
+ let checkbox: any;
23
+
24
+ $: if (active) {
25
+ checkbox.setFocus();
26
+ }
27
+
28
+ </script>
29
+ <InlineCellEditor style="text-align: center" on:focus={() => checkbox.focus() }>
30
+ <Checkbox bind:this={checkbox} style="position: relative; top: 50%; transform: translateY(-50%)"
31
+ bind:checked={parent[keyField]} readonly={readonly || !active} {...filteredProps}/>
32
+ </InlineCellEditor>
@@ -0,0 +1,24 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const InlineCheckbox: $$__sveltets_2_IsomorphicComponent<{
15
+ data: any;
16
+ readonly?: boolean;
17
+ field: any;
18
+ props: any;
19
+ active: boolean;
20
+ }, {
21
+ [evt: string]: CustomEvent<any>;
22
+ }, {}, {}, string>;
23
+ type InlineCheckbox = InstanceType<typeof InlineCheckbox>;
24
+ export default InlineCheckbox;
@@ -0,0 +1,32 @@
1
+ <script lang="ts">
2
+
3
+
4
+ import InlineCellEditor from "./InlineCellEditor.svelte";
5
+ import {acceptProps} from "./acceptProps";
6
+ import DatePicker from "../date-picker";
7
+ import {getNestObject} from "./getNestObject";
8
+
9
+ export let data: any;
10
+ export let readonly: boolean = false;
11
+ export let field: any;
12
+ export let props: any;
13
+ export let active: boolean;
14
+
15
+ const accepts = ['placeholder', 'max', 'min', 'mandatory', 'compact'];
16
+
17
+ let attrs: any = acceptProps(props, accepts);
18
+
19
+ let {parent, keyField} = getNestObject(data, field)
20
+
21
+ let editor: any;
22
+
23
+ $: if (active) {
24
+ editor.setFocus();
25
+ }
26
+
27
+
28
+
29
+ </script>
30
+ <InlineCellEditor>
31
+ <DatePicker bind:this={editor} bind:value={parent[keyField]} readonly={readonly || !active} variant="plain" {...attrs} />
32
+ </InlineCellEditor>
@@ -0,0 +1,24 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const InlineDatePicker: $$__sveltets_2_IsomorphicComponent<{
15
+ data: any;
16
+ readonly?: boolean;
17
+ field: any;
18
+ props: any;
19
+ active: boolean;
20
+ }, {
21
+ [evt: string]: CustomEvent<any>;
22
+ }, {}, {}, string>;
23
+ type InlineDatePicker = InstanceType<typeof InlineDatePicker>;
24
+ export default InlineDatePicker;
@@ -0,0 +1,31 @@
1
+ <script lang="ts">
2
+
3
+
4
+ import InlineCellEditor from "./InlineCellEditor.svelte";
5
+ import {DateTimePicker} from "../date-picker";
6
+ import {acceptProps} from "./acceptProps";
7
+ import {getNestObject} from "./getNestObject";
8
+
9
+ export let data: any;
10
+ export let readonly: boolean = false;
11
+ export let field: any;
12
+ export let props: any;
13
+ export let active: boolean;
14
+
15
+ const accepts = ['placeholder', 'max', 'min', 'precision', 'mandatory', 'compact'];
16
+
17
+ let attrs: any = acceptProps(props, accepts);
18
+
19
+ let {parent, keyField} = getNestObject(data, field)
20
+
21
+ let editor: any;
22
+
23
+ $: if (active) {
24
+ editor.setFocus();
25
+ }
26
+
27
+
28
+ </script>
29
+ <InlineCellEditor>
30
+ <DateTimePicker bind:this={editor} bind:value={parent[keyField]} readonly={readonly || !active} variant="plain" {...attrs} />
31
+ </InlineCellEditor>
@@ -0,0 +1,24 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const InlineDateTimePicker: $$__sveltets_2_IsomorphicComponent<{
15
+ data: any;
16
+ readonly?: boolean;
17
+ field: any;
18
+ props: any;
19
+ active: boolean;
20
+ }, {
21
+ [evt: string]: CustomEvent<any>;
22
+ }, {}, {}, string>;
23
+ type InlineDateTimePicker = InstanceType<typeof InlineDateTimePicker>;
24
+ export default InlineDateTimePicker;
@@ -0,0 +1,30 @@
1
+ <script lang="ts">
2
+
3
+
4
+ import InlineCellEditor from "./InlineCellEditor.svelte";
5
+ import {acceptProps} from "./acceptProps";
6
+ import NumberEditor from "../number-editor";
7
+ import {getNestObject} from "./getNestObject";
8
+
9
+ export let data: any;
10
+ export let readonly: boolean = false;
11
+ export let field: any;
12
+ export let props: any;
13
+ export let active: boolean;
14
+
15
+ const accepts = ['placeholder', 'precision', 'suffix', 'prefix', 'allowNegative', 'max', 'min', 'removable', 'compact'];
16
+
17
+ let attrs: any = acceptProps(props, accepts);
18
+
19
+ let {parent, keyField} = getNestObject(data, field)
20
+
21
+ let editor: any;
22
+
23
+ $: if (active) {
24
+ editor.setFocus();
25
+ }
26
+
27
+ </script>
28
+ <InlineCellEditor>
29
+ <NumberEditor bind:this={editor} bind:value={parent[keyField]} readonly={readonly || !active} variant="plain" {...attrs}/>
30
+ </InlineCellEditor>
@@ -0,0 +1,24 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const InlineNumberEditor: $$__sveltets_2_IsomorphicComponent<{
15
+ data: any;
16
+ readonly?: boolean;
17
+ field: any;
18
+ props: any;
19
+ active: boolean;
20
+ }, {
21
+ [evt: string]: CustomEvent<any>;
22
+ }, {}, {}, string>;
23
+ type InlineNumberEditor = InstanceType<typeof InlineNumberEditor>;
24
+ export default InlineNumberEditor;
@@ -0,0 +1,32 @@
1
+ <script lang="ts">
2
+
3
+ import InlineCellEditor from "./InlineCellEditor.svelte";
4
+ import {acceptProps} from "./acceptProps";
5
+ import OptionsMultiSelect from "../options-multi-select";
6
+ import {getNestObject} from "./getNestObject";
7
+
8
+ export let data: any;
9
+ export let readonly: boolean = false;
10
+ export let field: any;
11
+ export let props: any;
12
+ export let active: boolean;
13
+
14
+ const accepts = ['menu$height', 'delimiter', 'keyField', 'textField', 'placeholder', 'disableOptions', 'hideOptions', 'compact', 'tagColor', 'tagVariant']
15
+
16
+ let attrs: any = acceptProps(props, accepts);
17
+
18
+ let options: Array<any> = props?.options ?? [];
19
+
20
+ let {parent, keyField} = getNestObject(data, field)
21
+
22
+ let editor: any;
23
+
24
+ $: if (active) {
25
+ editor.setFocus();
26
+ }
27
+
28
+ </script>
29
+ <InlineCellEditor>
30
+ <OptionsMultiSelect bind:this={editor} variant="plain" bind:value={parent[keyField]} readonly={readonly || !active} {options}
31
+ {...attrs}/>
32
+ </InlineCellEditor>
@@ -0,0 +1,24 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const InlineOptionsMultiSelect: $$__sveltets_2_IsomorphicComponent<{
15
+ data: any;
16
+ readonly?: boolean;
17
+ field: any;
18
+ props: any;
19
+ active: boolean;
20
+ }, {
21
+ [evt: string]: CustomEvent<any>;
22
+ }, {}, {}, string>;
23
+ type InlineOptionsMultiSelect = InstanceType<typeof InlineOptionsMultiSelect>;
24
+ export default InlineOptionsMultiSelect;
@@ -0,0 +1,30 @@
1
+ <script lang="ts">
2
+
3
+ import InlineCellEditor from "./InlineCellEditor.svelte";
4
+ import {acceptProps} from "./acceptProps";
5
+ import OptionsSelect from "../options-select";
6
+ import {getNestObject} from "./getNestObject";
7
+
8
+ export let data: any;
9
+ export let readonly: boolean = false;
10
+ export let field: any;
11
+ export let props: any;
12
+ export let active: boolean;
13
+
14
+ const accepts = ['mandatory', 'keyField', 'textField', 'menu$height', 'placeholder', 'disableOptions', 'hideOptions', 'itemRender', 'compact']
15
+
16
+ let attrs: any = acceptProps(props, accepts);
17
+
18
+ let options: Array<any> = props.options ?? [];
19
+
20
+ let {parent, keyField} = getNestObject(data, field)
21
+
22
+ let editor: any;
23
+
24
+ $: if (active) {
25
+ editor.setFocus();
26
+ }
27
+ </script>
28
+ <InlineCellEditor>
29
+ <OptionsSelect bind:this={editor} variant="plain" bind:value={parent[keyField]} readonly={readonly || !active} {options} {...attrs}/>
30
+ </InlineCellEditor>
@@ -0,0 +1,24 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const InlineOptionsSelect: $$__sveltets_2_IsomorphicComponent<{
15
+ data: any;
16
+ readonly?: boolean;
17
+ field: any;
18
+ props: any;
19
+ active: boolean;
20
+ }, {
21
+ [evt: string]: CustomEvent<any>;
22
+ }, {}, {}, string>;
23
+ type InlineOptionsSelect = InstanceType<typeof InlineOptionsSelect>;
24
+ export default InlineOptionsSelect;
@@ -0,0 +1,30 @@
1
+ <script lang="ts">
2
+
3
+
4
+ import InlineCellEditor from "./InlineCellEditor.svelte";
5
+ import TextEditor from "../text-editor";
6
+ import {acceptProps} from "./acceptProps";
7
+ import {getNestObject} from "./getNestObject";
8
+
9
+ export let data: any;
10
+ export let readonly: boolean = false;
11
+ export let field: any;
12
+ export let props: any;
13
+ export let active: boolean;
14
+
15
+ const accepts = ['suffix', 'prefix', 'removable', 'compact']
16
+
17
+ let attrs: any = acceptProps(props, accepts);
18
+
19
+ let {parent, keyField} = getNestObject(data, field)
20
+
21
+ let editor: any;
22
+
23
+ $: if (active) {
24
+ editor.setFocus();
25
+ }
26
+
27
+ </script>
28
+ <InlineCellEditor>
29
+ <TextEditor bind:this={editor} bind:value={parent[keyField]} readonly={readonly || !active} variant="plain" {...attrs}/>
30
+ </InlineCellEditor>
@@ -0,0 +1,24 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const InlineTextEditor: $$__sveltets_2_IsomorphicComponent<{
15
+ data: any;
16
+ readonly?: boolean;
17
+ field: any;
18
+ props: any;
19
+ active: boolean;
20
+ }, {
21
+ [evt: string]: CustomEvent<any>;
22
+ }, {}, {}, string>;
23
+ type InlineTextEditor = InstanceType<typeof InlineTextEditor>;
24
+ export default InlineTextEditor;
@@ -0,0 +1,13 @@
1
+ <script lang="ts">
2
+
3
+
4
+ export let readonly: boolean = false;
5
+ export let field: any;
6
+ export let props: any;
7
+ export let active: boolean;
8
+
9
+
10
+ </script>
11
+ <div>
12
+ <span>Invalid type on {field}</span>
13
+ </div>
@@ -0,0 +1,23 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const InvalidEditor: $$__sveltets_2_IsomorphicComponent<{
15
+ readonly?: boolean;
16
+ field: any;
17
+ props: any;
18
+ active: boolean;
19
+ }, {
20
+ [evt: string]: CustomEvent<any>;
21
+ }, {}, {}, string>;
22
+ type InvalidEditor = InstanceType<typeof InvalidEditor>;
23
+ export default InvalidEditor;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 拷贝属性,接收所有input$开头和预定义的属性
3
+ * @param obj
4
+ * @param acceptKeys
5
+ */
6
+ export declare const acceptProps: (obj: any, acceptKeys: Array<string>) => any;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * 拷贝属性,接收所有input$开头和预定义的属性
3
+ * @param obj
4
+ * @param acceptKeys
5
+ */
6
+ export const acceptProps = (obj, acceptKeys) => {
7
+ if (obj == null) {
8
+ return {};
9
+ }
10
+ let result = {};
11
+ for (let attr in obj) {
12
+ if (attr.startsWith('input$')) {
13
+ result[attr] = obj[attr];
14
+ }
15
+ else if (acceptKeys.indexOf(attr) > -1) {
16
+ result[attr] = obj[attr];
17
+ }
18
+ }
19
+ return result;
20
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 返回嵌套对象和属性
3
+ * @param data
4
+ * @param key
5
+ */
6
+ export declare function getNestObject(data: any, key: string): {
7
+ parent: any;
8
+ keyField: string;
9
+ };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 返回嵌套对象和属性
3
+ * @param data
4
+ * @param key
5
+ */
6
+ export function getNestObject(data, key) {
7
+ // 如果 key 为空或无效,返回默认值
8
+ if (!key || typeof key !== 'string') {
9
+ throw new Error('invalid key');
10
+ }
11
+ // 分割 key 为数组
12
+ const keys = key.split('.'); // ["aaa", "bbb", "ccc"]
13
+ const field = keys[keys.length - 1]; // 最后一个属性: "ccc"
14
+ const parentPath = keys.slice(0, -1); // 倒数第二层路径: ["aaa", "bbb"]
15
+ // 如果没有父路径(例如 key="ccc"),返回 data 和 field
16
+ if (parentPath.length === 0) {
17
+ return { parent: data, keyField: field };
18
+ }
19
+ // 遍历父路径,补全 null/undefined
20
+ let current = data;
21
+ for (const k of parentPath) {
22
+ if (current[k] == null) { // 包括 null 和 undefined
23
+ current[k] = {};
24
+ }
25
+ current = current[k];
26
+ }
27
+ return { parent: current, keyField: field };
28
+ }
@@ -0,0 +1,6 @@
1
+ import editorManager from "./EditorManager";
2
+ import { acceptProps } from "./acceptProps";
3
+ import InlineCellEditor from "./InlineCellEditor.svelte";
4
+ import { getNestObject } from "./getNestObject";
5
+ export default InlineCellEditor;
6
+ export { editorManager, acceptProps, getNestObject };
@@ -0,0 +1,6 @@
1
+ import editorManager from "./EditorManager";
2
+ import { acceptProps } from "./acceptProps";
3
+ import InlineCellEditor from "./InlineCellEditor.svelte";
4
+ import { getNestObject } from "./getNestObject";
5
+ export default InlineCellEditor;
6
+ export { editorManager, acceptProps, getNestObject };
@@ -4,6 +4,8 @@
4
4
  import CommonEditor from "../common-editor/CommonEditor.svelte";
5
5
  import type {OnChangeHandler} from "../common/OnChangeHandler";
6
6
  import NumberInput from "../common-editor/NumberInput.svelte";
7
+ import {tick} from "svelte";
8
+ import utils from "../common/utils";
7
9
 
8
10
 
9
11
 
@@ -24,6 +26,11 @@
24
26
  export let min: number | null = null;
25
27
  export let removable: boolean = true;
26
28
  export let onChange: OnChangeHandler<number | null> = null as unknown as OnChangeHandler<number | null>;
29
+ export const setFocus = () => {
30
+ setTimeout(()=> {
31
+ editor && editor.focus();
32
+ }, 50);
33
+ }
27
34
 
28
35
  let className: string = '';
29
36
  let editor: NumberInput;
@@ -33,9 +40,12 @@
33
40
  editor.setFocus();
34
41
  }
35
42
 
43
+ let textValue: string = utils.formatNumber(value, precision);
44
+
36
45
 
37
46
  </script>
38
- <CommonEditor {displayMode} {style} {value} {suffix} {prefix} {readonly} {variant} {compact} class={className}
47
+ <CommonEditor {displayMode} {style} value={textValue} {suffix} {prefix} {readonly} {variant} {compact} class={className}
48
+ input$class="number-editor"
39
49
  hasLeadingIcon={$$slots['leading-icon']!=null} hasTrailingIcon={$$slots['trailing-icon']!=null}
40
50
  showActionIcon={removable && !readonly && !disabled && value != null} {clean}>
41
51
  <svelte:fragment slot="leading-icon">
@@ -45,7 +55,8 @@
45
55
  </div>
46
56
  {/if}
47
57
  </svelte:fragment>
48
- <NumberInput bind:this={editor} style="flex: 1 1 auto" {disabled} {placeholder} bind:value {precision} {allowNegative} {max} {min} {readonly} {onChange}/>
58
+ <NumberInput bind:this={editor} bind:textValue style="flex: 1 1 auto" {disabled} {placeholder} bind:value {precision} {allowNegative} {max} {min}
59
+ {readonly} {onChange}/>
49
60
  <svelte:fragment slot="trailing-icon">
50
61
  {#if $$slots['trailing-icon']}
51
62
  <div class="editor-embed-icon">
@@ -31,6 +31,7 @@ declare const NumberEditor: $$__sveltets_2_IsomorphicComponent<{
31
31
  min?: number | null;
32
32
  removable?: boolean;
33
33
  onChange?: OnChangeHandler<number | null>;
34
+ setFocus?: () => void;
34
35
  }, {
35
36
  [evt: string]: CustomEvent<any>;
36
37
  }, {
@@ -38,6 +39,7 @@ declare const NumberEditor: $$__sveltets_2_IsomorphicComponent<{
38
39
  'trailing-icon': {};
39
40
  }, {
40
41
  class: string;
42
+ setFocus: () => void;
41
43
  }, string>;
42
44
  type NumberEditor = InstanceType<typeof NumberEditor>;
43
45
  export default NumberEditor;
@@ -6,6 +6,7 @@
6
6
  import utils from "../common/utils";
7
7
  import type {OnChangeHandler} from "../common/OnChangeHandler";
8
8
  import Tag from "../tag";
9
+ import {tick} from "svelte";
9
10
 
10
11
  export let style: string = "";
11
12
  export let variant: '' | 'plain' | 'outlined' | 'filled' = '';
@@ -27,6 +28,11 @@
27
28
  export let tagColor: string = '';
28
29
  export let tagVariant: 'borderless' | 'border' | 'round' = 'border';
29
30
 
31
+ export const setFocus = () => {
32
+ setTimeout(()=> {
33
+ editor && editor.focus();
34
+ }, 50);
35
+ }
30
36
 
31
37
  let selectedList: Array<string> = [];
32
38
 
@@ -33,8 +33,11 @@ declare const OptionsMultiSelect: $$__sveltets_2_IsomorphicComponent<{
33
33
  onChange?: OnChangeHandler<Array<string>>;
34
34
  tagColor?: string;
35
35
  tagVariant?: "borderless" | "border" | "round";
36
+ setFocus?: () => void;
36
37
  }, {
37
38
  [evt: string]: CustomEvent<any>;
38
- }, {}, {}, string>;
39
+ }, {}, {
40
+ setFocus: () => void;
41
+ }, string>;
39
42
  type OptionsMultiSelect = InstanceType<typeof OptionsMultiSelect>;
40
43
  export default OptionsMultiSelect;
@@ -3,6 +3,7 @@
3
3
  import {DisplayMode} from "../common/DisplayMode";
4
4
  import type {OnChangeHandler} from "../common/OnChangeHandler";
5
5
  import CommonPicker from "../common/CommonPicker.svelte";
6
+ import {tick} from "svelte";
6
7
 
7
8
  export let variant: '' | 'plain' | 'outlined' | 'filled' = '';
8
9
  export let disabled: boolean = false;
@@ -23,6 +24,11 @@
23
24
  export let emptyText: string = null as unknown as string;
24
25
  export let onChange: OnChangeHandler<any> = null as unknown as OnChangeHandler<any>;
25
26
 
27
+ export const setFocus = () => {
28
+ setTimeout(()=> {
29
+ editor && editor.focus();
30
+ }, 50);
31
+ }
26
32
 
27
33
  let textValue: string;
28
34
  let editor: any;
@@ -32,11 +32,14 @@ declare const OptionsSelect: $$__sveltets_2_IsomorphicComponent<{
32
32
  itemRender?: any;
33
33
  emptyText?: string;
34
34
  onChange?: OnChangeHandler<any>;
35
+ setFocus?: () => void;
35
36
  }, {
36
37
  blur: FocusEvent;
37
38
  focus: FocusEvent;
38
39
  } & {
39
40
  [evt: string]: CustomEvent<any>;
40
- }, {}, {}, string>;
41
+ }, {}, {
42
+ setFocus: () => void;
43
+ }, string>;
41
44
  type OptionsSelect = InstanceType<typeof OptionsSelect>;
42
45
  export default OptionsSelect;
@@ -3,6 +3,7 @@
3
3
  import {DisplayMode} from "../common/DisplayMode";
4
4
  import prefixFilter from "../utils/prefixFilter";
5
5
  import CommonEditor from "../common-editor/CommonEditor.svelte";
6
+ import {tick} from "svelte";
6
7
 
7
8
  const excludeAttrs = ['type', 'readonly', 'disabled', 'required', "form", "wrap"]
8
9
 
@@ -19,7 +20,12 @@
19
20
  export let displayMode: DisplayMode = DisplayMode.Edit;
20
21
  export let onChange: ((value: string) => void) | undefined = undefined;
21
22
 
22
- export let autoFocus: boolean = false;
23
+ export const setFocus = () => {
24
+ setTimeout(()=> {
25
+ editor && editor.focus();
26
+ }, 50);
27
+ }
28
+
23
29
 
24
30
  let className: string = '';
25
31
  let input$: any;
@@ -41,9 +47,6 @@
41
47
  oldValue = value;
42
48
  }
43
49
 
44
- $: if (editor && autoFocus) {
45
- editor.focus();
46
- }
47
50
 
48
51
  </script>
49
52
  <CommonEditor {displayMode} {style} {value} {suffix} {prefix} {readonly} {disabled} {variant} {compact}
@@ -26,7 +26,7 @@ declare const TextEditor: $$__sveltets_2_IsomorphicComponent<{
26
26
  removable?: boolean | undefined;
27
27
  displayMode?: DisplayMode | undefined;
28
28
  onChange?: ((value: string) => void) | undefined | undefined;
29
- autoFocus?: boolean | undefined;
29
+ setFocus?: (() => void) | undefined;
30
30
  }, {
31
31
  blur: FocusEvent;
32
32
  focus: FocusEvent;
@@ -44,6 +44,7 @@ declare const TextEditor: $$__sveltets_2_IsomorphicComponent<{
44
44
  'trailing-icon': {};
45
45
  }, {
46
46
  class: string;
47
+ setFocus: () => void;
47
48
  }, string>;
48
49
  type TextEditor = InstanceType<typeof TextEditor>;
49
50
  export default TextEditor;
@@ -598,6 +598,10 @@
598
598
  padding: 0;
599
599
  color: var(--uniface-editor-text-color, #374151);
600
600
  }
601
+ .uniface-common-editor input.number-editor {
602
+ text-align: right; /* 默认右对齐 */
603
+ padding-right: 16px;
604
+ }
601
605
  .uniface-common-editor input:focus {
602
606
  outline: none;
603
607
  }
@@ -665,9 +669,7 @@
665
669
  }
666
670
  .uniface-common-editor.plain {
667
671
  border: none;
668
- }
669
- .uniface-common-editor.plain:focus-within {
670
- border-bottom-color: transparent;
672
+ padding: 0 4px;
671
673
  }
672
674
  .uniface-common-editor .editor-prefix, .uniface-common-editor .editor-suffix {
673
675
  color: #6B7280;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticatec/uniface-element",
3
- "version": "0.1.61",
3
+ "version": "0.1.66",
4
4
  "description": "uniface web elements",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -192,6 +192,10 @@
192
192
  "types": "./dist/icon/index.d.ts",
193
193
  "import": "./dist/icon/index.js"
194
194
  },
195
+ "./InlineCellEditor": {
196
+ "types": "./dist/inline-cell-editor/index.d.ts",
197
+ "import": "./dist/inline-cell-editor/index.js"
198
+ },
195
199
  "./ImageFiles": {
196
200
  "types": "./dist/image-files/index.d.ts",
197
201
  "import": "./dist/image-files/index.js"