sveltekit-ui 1.1.72 → 1.1.74
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.
|
@@ -66,9 +66,8 @@ export function create_text_input_manager(config) {
|
|
|
66
66
|
const id = create_unique_id(null, 20)
|
|
67
67
|
let val = $state(config?.val)
|
|
68
68
|
let type = $state(config?.type ?? "text")
|
|
69
|
-
let input_type = $state(config?.type ?? "text")
|
|
70
69
|
let error_message = $state(config?.error_message ?? null)
|
|
71
|
-
let is_text_hidden = $state(defaults?.[config?.type ?? "text"]?.is_text_hidden)
|
|
70
|
+
let is_text_hidden = $state(defaults?.[config?.type ?? "text"]?.is_text_hidden ?? false)
|
|
72
71
|
let is_image_url = $state(false)
|
|
73
72
|
let is_valid = $state(false)
|
|
74
73
|
let popover_manager = $state(null)
|
|
@@ -76,6 +75,7 @@ export function create_text_input_manager(config) {
|
|
|
76
75
|
let finish_button_manager = $state(null)
|
|
77
76
|
let rerender_input_trigger = $state(0)
|
|
78
77
|
|
|
78
|
+
let input_type = $derived(is_text_hidden ? "password" : type == "password" ? "text" : type)
|
|
79
79
|
let val_closurable = $derived(set_closurable(val, null))
|
|
80
80
|
let is_popover = $derived(set_closurable(config?.is_popover, false))
|
|
81
81
|
let popover_header = $derived(set_closurable(config?.popover_header, null))
|
|
@@ -214,34 +214,12 @@ export function create_text_input_manager(config) {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
function set_is_text_hidden(input) {
|
|
217
|
-
if (typeof window === "undefined") {
|
|
218
|
-
return
|
|
219
|
-
}
|
|
220
217
|
is_text_hidden = !!input
|
|
221
|
-
let input_el = document?.querySelector(`#input_${id}`)
|
|
222
|
-
if (input_el) {
|
|
223
|
-
if (!!input) {
|
|
224
|
-
input_el.type = "password"
|
|
225
|
-
} else {
|
|
226
|
-
input_el.type = type
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
218
|
}
|
|
230
219
|
|
|
231
220
|
function set_type(input) {
|
|
232
|
-
type = input
|
|
233
|
-
|
|
234
|
-
return
|
|
235
|
-
}
|
|
236
|
-
is_text_hidden = !!input
|
|
237
|
-
let input_el = document?.querySelector(`#input_${id}`)
|
|
238
|
-
if (input_el) {
|
|
239
|
-
if (!!input) {
|
|
240
|
-
input_el.type = "text"
|
|
241
|
-
} else {
|
|
242
|
-
input_el.type = input
|
|
243
|
-
}
|
|
244
|
-
}
|
|
221
|
+
type = input ?? "text"
|
|
222
|
+
is_text_hidden = defaults?.[type]?.is_text_hidden ?? false
|
|
245
223
|
}
|
|
246
224
|
|
|
247
225
|
async function finish() {
|
|
@@ -262,9 +240,8 @@ export function create_text_input_manager(config) {
|
|
|
262
240
|
function init(config) {
|
|
263
241
|
val = config?.val ?? null
|
|
264
242
|
type = config?.type ?? "text"
|
|
265
|
-
input_type = config?.is_text_hidden ? "password" : config?.type ?? "text"
|
|
266
243
|
error_message = config?.error_message ?? null
|
|
267
|
-
is_text_hidden = config?.is_text_hidden ?? defaults?.[type]?.is_text_hidden
|
|
244
|
+
is_text_hidden = config?.is_text_hidden ?? defaults?.[type]?.is_text_hidden ?? false
|
|
268
245
|
popover_manager = create_popover_manager({
|
|
269
246
|
type: "center",
|
|
270
247
|
header: popover_header ?? "Text Editor",
|
|
@@ -7127,7 +7127,7 @@ export const definitions = {
|
|
|
7127
7127
|
},
|
|
7128
7128
|
set_type: {
|
|
7129
7129
|
description:
|
|
7130
|
-
"Changes the input type dynamically
|
|
7130
|
+
"Changes the input type dynamically and resets text visibility to that type's default (for example, password inputs become hidden).",
|
|
7131
7131
|
},
|
|
7132
7132
|
set_is_text_hidden: {
|
|
7133
7133
|
description: "Toggles hiding or showing the text if `is_text_hidable = true` (e.g. for password fields).",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sveltekit-ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.74",
|
|
4
4
|
"description": "A SvelteKit UI component library for building modern web applications",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"context-filter-polyfill": "^0.3.23",
|
|
25
25
|
"qr-code-styling": "^1.9.2",
|
|
26
|
-
"svelte": "^5.56.
|
|
26
|
+
"svelte": "^5.56.5"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@sveltejs/kit": "^2.22.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@sveltejs/adapter-vercel": "^6.3.4",
|
|
33
|
-
"@sveltejs/kit": "^2.69.
|
|
33
|
+
"@sveltejs/kit": "^2.69.3",
|
|
34
34
|
"@sveltejs/package": "^2.5.8",
|
|
35
35
|
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
|
36
36
|
"@vercel/analytics": "^2.0.1",
|
|
37
|
-
"typescript": "^
|
|
37
|
+
"typescript": "^6.0.3",
|
|
38
38
|
"vite": "^8.1.4"
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://www.sveltekit-ui.com",
|
|
@@ -66,9 +66,8 @@ export function create_text_input_manager(config) {
|
|
|
66
66
|
const id = create_unique_id(null, 20)
|
|
67
67
|
let val = $state(config?.val)
|
|
68
68
|
let type = $state(config?.type ?? "text")
|
|
69
|
-
let input_type = $state(config?.type ?? "text")
|
|
70
69
|
let error_message = $state(config?.error_message ?? null)
|
|
71
|
-
let is_text_hidden = $state(defaults?.[config?.type ?? "text"]?.is_text_hidden)
|
|
70
|
+
let is_text_hidden = $state(defaults?.[config?.type ?? "text"]?.is_text_hidden ?? false)
|
|
72
71
|
let is_image_url = $state(false)
|
|
73
72
|
let is_valid = $state(false)
|
|
74
73
|
let popover_manager = $state(null)
|
|
@@ -76,6 +75,7 @@ export function create_text_input_manager(config) {
|
|
|
76
75
|
let finish_button_manager = $state(null)
|
|
77
76
|
let rerender_input_trigger = $state(0)
|
|
78
77
|
|
|
78
|
+
let input_type = $derived(is_text_hidden ? "password" : type == "password" ? "text" : type)
|
|
79
79
|
let val_closurable = $derived(set_closurable(val, null))
|
|
80
80
|
let is_popover = $derived(set_closurable(config?.is_popover, false))
|
|
81
81
|
let popover_header = $derived(set_closurable(config?.popover_header, null))
|
|
@@ -214,34 +214,12 @@ export function create_text_input_manager(config) {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
function set_is_text_hidden(input) {
|
|
217
|
-
if (typeof window === "undefined") {
|
|
218
|
-
return
|
|
219
|
-
}
|
|
220
217
|
is_text_hidden = !!input
|
|
221
|
-
let input_el = document?.querySelector(`#input_${id}`)
|
|
222
|
-
if (input_el) {
|
|
223
|
-
if (!!input) {
|
|
224
|
-
input_el.type = "password"
|
|
225
|
-
} else {
|
|
226
|
-
input_el.type = type
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
218
|
}
|
|
230
219
|
|
|
231
220
|
function set_type(input) {
|
|
232
|
-
type = input
|
|
233
|
-
|
|
234
|
-
return
|
|
235
|
-
}
|
|
236
|
-
is_text_hidden = !!input
|
|
237
|
-
let input_el = document?.querySelector(`#input_${id}`)
|
|
238
|
-
if (input_el) {
|
|
239
|
-
if (!!input) {
|
|
240
|
-
input_el.type = "text"
|
|
241
|
-
} else {
|
|
242
|
-
input_el.type = input
|
|
243
|
-
}
|
|
244
|
-
}
|
|
221
|
+
type = input ?? "text"
|
|
222
|
+
is_text_hidden = defaults?.[type]?.is_text_hidden ?? false
|
|
245
223
|
}
|
|
246
224
|
|
|
247
225
|
async function finish() {
|
|
@@ -262,9 +240,8 @@ export function create_text_input_manager(config) {
|
|
|
262
240
|
function init(config) {
|
|
263
241
|
val = config?.val ?? null
|
|
264
242
|
type = config?.type ?? "text"
|
|
265
|
-
input_type = config?.is_text_hidden ? "password" : config?.type ?? "text"
|
|
266
243
|
error_message = config?.error_message ?? null
|
|
267
|
-
is_text_hidden = config?.is_text_hidden ?? defaults?.[type]?.is_text_hidden
|
|
244
|
+
is_text_hidden = config?.is_text_hidden ?? defaults?.[type]?.is_text_hidden ?? false
|
|
268
245
|
popover_manager = create_popover_manager({
|
|
269
246
|
type: "center",
|
|
270
247
|
header: popover_header ?? "Text Editor",
|
|
@@ -7127,7 +7127,7 @@ export const definitions = {
|
|
|
7127
7127
|
},
|
|
7128
7128
|
set_type: {
|
|
7129
7129
|
description:
|
|
7130
|
-
"Changes the input type dynamically
|
|
7130
|
+
"Changes the input type dynamically and resets text visibility to that type's default (for example, password inputs become hidden).",
|
|
7131
7131
|
},
|
|
7132
7132
|
set_is_text_hidden: {
|
|
7133
7133
|
description: "Toggles hiding or showing the text if `is_text_hidable = true` (e.g. for password fields).",
|