@onsvisual/svelte-components 1.1.30 → 1.1.32

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.
@@ -2,6 +2,11 @@
2
2
  import { onMount, createEventDispatcher } from "svelte";
3
3
  import pym from "pym.js";
4
4
 
5
+ /**
6
+ * (Optional) ID for embed
7
+ * @type {string|null}
8
+ */
9
+ export let id = null;
5
10
  /**
6
11
  * Binding for pymChild element (can be used to send messages to parent of iframe)
7
12
  * @type {object}
@@ -16,7 +21,7 @@
16
21
  const dispatch = createEventDispatcher();
17
22
 
18
23
  onMount(() => {
19
- pymChild = new pym.Child();
24
+ pymChild = id ? new pym.Child({ id }) : new pym.Child();
20
25
 
21
26
  if (polling) {
22
27
  setInterval(() => {
@@ -2,6 +2,7 @@
2
2
  /** @typedef {typeof __propDef.events} EmbedEvents */
3
3
  /** @typedef {typeof __propDef.slots} EmbedSlots */
4
4
  export default class Embed extends SvelteComponentTyped<{
5
+ id?: string | null | undefined;
5
6
  polling?: number | false | undefined;
6
7
  pymChild?: object | undefined;
7
8
  }, {
@@ -18,6 +19,7 @@ export type EmbedSlots = typeof __propDef.slots;
18
19
  import { SvelteComponentTyped } from "svelte";
19
20
  declare const __propDef: {
20
21
  props: {
22
+ id?: string | null | undefined;
21
23
  polling?: number | false | undefined;
22
24
  pymChild?: object | undefined;
23
25
  };
@@ -68,6 +68,11 @@
68
68
  * @type {boolean}
69
69
  */
70
70
  export let numeric = false;
71
+ /**
72
+ * Set to `true` to make the input read-only
73
+ * @type {boolean}
74
+ */
75
+ export let readonly = false;
71
76
  /**
72
77
  * Set to `true` to give the input a disabled state
73
78
  * @type {boolean}
@@ -121,6 +126,7 @@
121
126
  aria-labelledby="{id} {id}-unit"
122
127
  aria-describedby={description ? `${id}-description-hint` : null}
123
128
  {disabled}
129
+ {readonly}
124
130
  on:change={(e) => dispatch("change", { value, e })}
125
131
  on:input={(e) => dispatch("input", { value, e })}
126
132
  on:blur={(e) => dispatch("blur", { value, e })}
@@ -149,6 +155,7 @@
149
155
  class:ons-input--error={error}
150
156
  aria-describedby={description ? `${id}-description-hint` : null}
151
157
  {disabled}
158
+ {readonly}
152
159
  on:change={(e) => dispatch("change", { value, e })}
153
160
  on:input={(e) => dispatch("input", { value, e })}
154
161
  on:blur={(e) => dispatch("blur", { value, e })}
@@ -18,6 +18,7 @@ export default class Input extends SvelteComponentTyped<{
18
18
  prefix?: string | null | undefined;
19
19
  suffix?: string | null | undefined;
20
20
  unitLabel?: string | undefined;
21
+ readonly?: boolean | undefined;
21
22
  }, {
22
23
  change: CustomEvent<any>;
23
24
  input: CustomEvent<any>;
@@ -48,6 +49,7 @@ declare const __propDef: {
48
49
  prefix?: string | null | undefined;
49
50
  suffix?: string | null | undefined;
50
51
  unitLabel?: string | undefined;
52
+ readonly?: boolean | undefined;
51
53
  };
52
54
  events: {
53
55
  change: CustomEvent<any>;
@@ -48,6 +48,16 @@
48
48
  * @type {number}
49
49
  */
50
50
  export let width = 30;
51
+ /**
52
+ * Set to `true` to make the input read-only
53
+ * @type {boolean}
54
+ */
55
+ export let readonly = false;
56
+ /**
57
+ * Set to `true` to give the input a disabled state
58
+ * @type {boolean}
59
+ */
60
+ export let disabled = false;
51
61
  /**
52
62
  * Optional: Set an additional CSS class for the component
53
63
  * @type {string|null}
@@ -82,6 +92,8 @@
82
92
  maxlength={charLimit}
83
93
  data-char-limit-ref="{id}-lim"
84
94
  aria-describedby="textarea-char-limit-lim"
95
+ {disabled}
96
+ {readonly}
85
97
  ></textarea>
86
98
  {#if Number.isInteger(remaining)}
87
99
  <span
@@ -7,10 +7,12 @@ export default class Textarea extends SvelteComponentTyped<{
7
7
  width?: number | undefined;
8
8
  label?: string | null | undefined;
9
9
  name?: string | null | undefined;
10
+ disabled?: boolean | undefined;
10
11
  hideLabel?: boolean | undefined;
11
12
  description?: string | null | undefined;
12
13
  value?: string | null | undefined;
13
14
  charLimit?: number | null | undefined;
15
+ readonly?: boolean | undefined;
14
16
  rows?: number | undefined;
15
17
  }, {
16
18
  [evt: string]: CustomEvent<any>;
@@ -27,10 +29,12 @@ declare const __propDef: {
27
29
  width?: number | undefined;
28
30
  label?: string | null | undefined;
29
31
  name?: string | null | undefined;
32
+ disabled?: boolean | undefined;
30
33
  hideLabel?: boolean | undefined;
31
34
  description?: string | null | undefined;
32
35
  value?: string | null | undefined;
33
36
  charLimit?: number | null | undefined;
37
+ readonly?: boolean | undefined;
34
38
  rows?: number | undefined;
35
39
  };
36
40
  events: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onsvisual/svelte-components",
3
- "version": "1.1.30",
3
+ "version": "1.1.32",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "npm run build:package && npm run build:docs",