@kws3/ui 4.5.9 → 5.0.0-alpha.10

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.
@@ -249,7 +249,7 @@ Default value: `<span>{option.label}</span>`
249
249
  input, //the textbox to type in
250
250
  POPPER,
251
251
  active_option = "",
252
- searching = true,
252
+ searching = false,
253
253
  show_options = false,
254
254
  mouseTracker = {
255
255
  lastX: 0,
package/forms/actions.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import flatpickr from "flatpickr";
2
+ import { tick } from "svelte";
2
3
 
3
4
  function createFlatpickrAction(defaultOpts, hooks, type) {
4
5
  return function (
@@ -40,7 +41,10 @@ function createFlatpickrAction(defaultOpts, hooks, type) {
40
41
 
41
42
  let OPTS = Object.assign(defaultOpts, _opts, opts);
42
43
 
43
- let picker = flatpickr(node, OPTS);
44
+ let picker;
45
+ tick().then(() => {
46
+ picker = flatpickr(node, OPTS);
47
+ });
44
48
 
45
49
  function createFirer(name) {
46
50
  return (selectedDates, dateStr, instance) => {
@@ -123,7 +127,7 @@ function createFlatpickrAction(defaultOpts, hooks, type) {
123
127
  * disabled:boolean,
124
128
  * color: ColorOptions
125
129
  * }>} FlatpickerAction
126
- */
130
+ */
127
131
 
128
132
  /**
129
133
  * @type {FlatpickerAction}
@@ -140,7 +144,7 @@ export let datepicker = createFlatpickrAction(
140
144
 
141
145
  /**
142
146
  * @type {FlatpickerAction}
143
- */
147
+ */
144
148
  export let timepicker = createFlatpickrAction(
145
149
  {
146
150
  altInput: true,
@@ -1,27 +1,23 @@
1
+ import { mount, unmount } from "svelte";
1
2
  import { default as _Dialog } from "./Dialog.svelte";
2
3
 
3
- /**
4
- * @typedef {import('@kws3/ui/types').DialogProps} DialogProps
5
- */
4
+ /** @typedef {import("@kws3/ui/types").DialogProps} DialogProps */
6
5
 
7
6
  function createDialog(msg, props) {
8
7
  props = Object.assign(props, { _text: msg });
9
8
 
10
9
  const promise = new Promise((fulfil) => {
11
10
  //@ts-ignore
12
- const dialog = new _Dialog({
11
+ const dialog = mount(_Dialog, {
13
12
  target: document.body,
14
13
  props,
15
14
  intro: true,
16
- });
17
-
18
- //@ts-ignore
19
- dialog.$on("_done", ({ detail }) => {
20
- fulfil(detail);
21
- //Does not outro out because of
22
- //https://github.com/sveltejs/svelte/issues/4056
23
- //@ts-ignore
24
- dialog.$destroy();
15
+ events: {
16
+ _done: ({ detail }) => {
17
+ fulfil(detail);
18
+ unmount(dialog);
19
+ },
20
+ },
25
21
  });
26
22
  });
27
23
 
@@ -30,7 +26,6 @@ function createDialog(msg, props) {
30
26
 
31
27
  class Dialog {
32
28
  /**
33
- *
34
29
  * @param {string} msg
35
30
  * @param {DialogProps} [props={}]
36
31
  */
@@ -40,7 +35,6 @@ class Dialog {
40
35
  }
41
36
 
42
37
  /**
43
- *
44
38
  * @param {string} msg
45
39
  * @param {DialogProps} [props={}]
46
40
  */
@@ -49,7 +43,6 @@ class Dialog {
49
43
  }
50
44
 
51
45
  /**
52
- *
53
46
  * @param {string} msg
54
47
  * @param {DialogProps} [props={}]
55
48
  */
@@ -59,7 +52,6 @@ class Dialog {
59
52
  }
60
53
 
61
54
  /**
62
- *
63
55
  * @param {string} msg
64
56
  * @param {DialogProps} [props={}]
65
57
  */
@@ -69,7 +61,6 @@ export function alert(msg, props) {
69
61
  }
70
62
 
71
63
  /**
72
- *
73
64
  * @param {string} msg
74
65
  * @param {DialogProps} [props={}]
75
66
  */
@@ -79,7 +70,6 @@ export function prompt(msg, props) {
79
70
  }
80
71
 
81
72
  /**
82
- *
83
73
  * @param {string} msg
84
74
  * @param {DialogProps} [props={}]
85
75
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kws3/ui",
3
- "version": "4.5.9",
3
+ "version": "5.0.0-alpha.10",
4
4
  "description": "UI components for use with Svelte v3 applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,6 +11,7 @@
11
11
  "keywords": [
12
12
  "components",
13
13
  "svelte3",
14
+ "svelte4",
14
15
  "ui"
15
16
  ],
16
17
  "author": "Khaled Ahmed <me.khaled@gmail.com>",
@@ -55,7 +56,7 @@
55
56
  },
56
57
  "peerDependencies": {
57
58
  "bulma": "^1.0.0",
58
- "svelte": "^4.2.10"
59
+ "svelte": "^4.2.10 || ^5.51.2"
59
60
  },
60
61
  "dependencies": {
61
62
  "@kws3/text-mask-core": "^5.1.5",
@@ -66,6 +67,5 @@
66
67
  },
67
68
  "devDependencies": {
68
69
  "typescript": "^5.2.2"
69
- },
70
- "gitHead": "d8d7a136c4f8eedceea82b98a46e0dd363b267ca"
70
+ }
71
71
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 KWS3 Media Ltd
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.