jsbox-cview 1.3.2 → 1.3.4

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.
@@ -7,18 +7,22 @@
7
7
  import { Text } from "../single-views";
8
8
  import { DialogSheet } from "./dialog-sheet";
9
9
 
10
- export function textDialog({ title, text = "", placeholder = "" }: {
10
+ export function textDialog({ title, text = "", placeholder = "", editable = true }: {
11
11
  title: string;
12
12
  text?: string;
13
13
  placeholder?: string;
14
+ editable?: boolean;
14
15
  }) {
15
16
  const textView = new Text({
16
17
  props: {
17
18
  text,
18
- placeholder
19
+ placeholder,
20
+ editable
19
21
  },
20
22
  events: {
21
- ready: sender => sender.focus()
23
+ ready: sender => {
24
+ if (sender.editable) sender.focus()
25
+ }
22
26
  }
23
27
  });
24
28
 
@@ -8,14 +8,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.textDialog = void 0;
9
9
  const single_views_1 = require("../single-views");
10
10
  const dialog_sheet_1 = require("./dialog-sheet");
11
- function textDialog({ title, text = "", placeholder = "" }) {
11
+ function textDialog({ title, text = "", placeholder = "", editable = true }) {
12
12
  const textView = new single_views_1.Text({
13
13
  props: {
14
14
  text,
15
- placeholder
15
+ placeholder,
16
+ editable
16
17
  },
17
18
  events: {
18
- ready: sender => sender.focus()
19
+ ready: sender => {
20
+ if (sender.editable)
21
+ sender.focus();
22
+ }
19
23
  }
20
24
  });
21
25
  const sheet = new dialog_sheet_1.DialogSheet({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsbox-cview",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "为 JSBox 设计的微型框架",
5
5
  "repository": {
6
6
  "type": "git",