svseeds 0.3.7 → 0.3.8

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,7 +7,7 @@
7
7
  unique?: boolean, // <true>
8
8
  min?: TagCountValidation,
9
9
  max?: TagCountValidation,
10
- validations?: ((values: string[]) => string)[],
10
+ validations?: TagsInputValidation[],
11
11
  status?: string, // bindable <STATE.DEFAULT>
12
12
  style?: SVSStyle,
13
13
  element?: HTMLInputElement, // bindable
@@ -19,6 +19,7 @@
19
19
  };
20
20
  export type TagsInputReqdProps = never;
21
21
  export type TagsInputBindProps = "dark" | "status" | "element";
22
+ export type TagsInputValidation = (values: string[]) => string;
22
23
  export type TagCountValidation = { value: number, message: string };
23
24
 
24
25
  const preset = "svs-tags-input";
@@ -37,7 +38,10 @@
37
38
  if (!status) status = STATE.DEFAULT;
38
39
  const cls = fnClass(preset, style);
39
40
  const confirmKeys = new Set([CONFIRM_KEY, ...confirm]);
40
- if (min) validations.push((values) => values.length < min.value ? min.message : "");
41
+ const textValidations = deps?.svsTextField?.validations ?? [];
42
+ if (max) textValidations.unshift((_) => values.length >= max.value ? max.message : "");
43
+ if (min) validations.unshift((values) => values.length < min.value ? min.message : "");
44
+
41
45
  const left = type === "left" || deps?.svsTextField?.left ? sideLeft : undefined;
42
46
  const right = type === "right" || deps?.svsTextField?.right ? sideRight : undefined;
43
47
  let value = $state("");
@@ -47,11 +51,8 @@
47
51
  ...omit(deps?.svsBadge, "onclick", "right", "style"),
48
52
  style: deps?.svsBadge?.style ?? `${preset} svs-badge`,
49
53
  };
50
- const textValidations = deps?.svsTextField?.validations ?? [];
51
- if (max) textValidations.push((_) => values.length >= max.value ? max.message : "");
52
54
  const svsTextField = {
53
55
  ...omit(deps?.svsTextField, "validations", "style", "attributes"),
54
- validations: textValidations,
55
56
  style: deps?.svsTextField?.style ?? `${preset} svs-text-field`,
56
57
  attributes: { ...deps?.svsTextField?.attributes, onkeydown },
57
58
  };
@@ -59,28 +60,42 @@
59
60
  // *** Bind Handlers *** //
60
61
  $effect.pre(() => {
61
62
  values;
62
- untrack(() => validate());
63
+ untrack(() => validateTags());
63
64
  });
64
- function validate() {
65
+ function validateText(): boolean {
66
+ if (!element) return false;
67
+ for (const v of textValidations) {
68
+ const msg = v(value);
69
+ if (msg) return showMessageTemporarily(msg);
70
+ }
71
+ return true;
72
+ }
73
+ function showMessageTemporarily(msg: string): boolean {
74
+ element?.setCustomValidity(msg);
75
+ element?.checkValidity();
76
+ element?.setCustomValidity("");
77
+ return false;
78
+ }
79
+ function validateTags() {
80
+ if (!element) return;
65
81
  for (const v of validations) {
66
82
  const msg = v(values);
67
- if (msg) return element?.setCustomValidity(msg);
83
+ if (msg) return element.setCustomValidity(msg);
68
84
  }
69
85
  }
70
86
 
71
87
  // *** Event Handlers *** //
72
- const change = new Event("change", { bubbles: true, cancelable: true });
73
88
  function onkeydown(ev: KeyboardEvent) {
74
89
  deps?.svsTextField?.attributes?.onkeydown?.(ev as any);
75
90
  if (!confirmKeys.has(ev.key) || ev.isComposing) return;
76
91
  ev.preventDefault();
77
- element?.dispatchEvent(change);
78
- if (status === STATE.INACTIVE) return;
79
- addTag();
92
+ if (trim) value = value.trim();
93
+ const valid = validateText();
94
+ if (valid) addTag();
95
+ validateTags();
80
96
  }
81
97
  function addTag() {
82
98
  if (unique && values.includes(value)) value = "";
83
- if (trim) value = value.trim();
84
99
  if (!value) return;
85
100
  values.push(value);
86
101
  value = "";
@@ -89,9 +104,10 @@
89
104
  return (ev) => {
90
105
  deps?.svsBadge?.onclick?.(ev as any);
91
106
  values.splice(index, 1);
107
+ validateTags();
92
108
  };
93
109
  }
94
- $effect(() => untrack(() => validate()))
110
+ $effect(() => untrack(() => validateTags()))
95
111
  </script>
96
112
 
97
113
  <!---------------------------------------->
@@ -6,7 +6,7 @@ export type TagsInputProps = {
6
6
  unique?: boolean;
7
7
  min?: TagCountValidation;
8
8
  max?: TagCountValidation;
9
- validations?: ((values: string[]) => string)[];
9
+ validations?: TagsInputValidation[];
10
10
  status?: string;
11
11
  style?: SVSStyle;
12
12
  element?: HTMLInputElement;
@@ -18,6 +18,7 @@ export type TagsInputDeps = {
18
18
  };
19
19
  export type TagsInputReqdProps = never;
20
20
  export type TagsInputBindProps = "dark" | "status" | "element";
21
+ export type TagsInputValidation = (values: string[]) => string;
21
22
  export type TagCountValidation = {
22
23
  value: number;
23
24
  message: string;
@@ -25,6 +26,6 @@ export type TagCountValidation = {
25
26
  import { type SVSStyle } from "./core";
26
27
  import { type TextFieldProps, type TextFieldReqdProps, type TextFieldBindProps } from "./_TextField.svelte";
27
28
  import { type BadgeProps, type BadgeReqdProps, type BadgeBindProps } from "./_Badge.svelte";
28
- declare const TagsInput: import("svelte").Component<TagsInputProps, {}, "status" | "values" | "element">;
29
+ declare const TagsInput: import("svelte").Component<TagsInputProps, {}, "status" | "element" | "values">;
29
30
  type TagsInput = ReturnType<typeof TagsInput>;
30
31
  export default TagsInput;
@@ -8,7 +8,7 @@
8
8
  values?: string[], // bindable
9
9
  multiple?: boolean, // <true>
10
10
  descFirst?: boolean, // <false>
11
- validations?: ((values: string[], validities?: ValidityState[]) => string)[],
11
+ validations?: CheckFieldValidation[],
12
12
  status?: string, // bindable <STATE.DEFAULT>
13
13
  style?: SVSStyle,
14
14
  attributes?: HTMLInputAttributes,
@@ -17,6 +17,7 @@
17
17
  };
18
18
  export type CheckFieldReqdProps = "options";
19
19
  export type CheckFieldBindProps = "values" | "status" | "elements";
20
+ export type CheckFieldValidation = (values: string[], validities?: ValidityState[]) => string;
20
21
 
21
22
  type CheckFieldTarget = { currentTarget: EventTarget & HTMLInputElement };
22
23
  const preset = "svs-check-field";
@@ -59,6 +60,7 @@
59
60
  }
60
61
  function validate(oninvalid?: boolean) {
61
62
  if (!values.length && !oninvalid) return toNonInvalid();
63
+ if (!elements[0] || !validations.length) return;
62
64
  const validities = elements.map((x) => x.validity);
63
65
  for (const v of validations) {
64
66
  const msg = v(values, validities);
@@ -85,7 +87,7 @@
85
87
  ev.preventDefault();
86
88
  phase.submit = true;
87
89
  validate(true);
88
- if (status !== STATE.INACTIVE) toInvalid(elements[0]?.validationMessage);
90
+ toInvalid(elements[0]?.validationMessage);
89
91
  }
90
92
  </script>
91
93
 
@@ -7,7 +7,7 @@ export type CheckFieldProps = {
7
7
  values?: string[];
8
8
  multiple?: boolean;
9
9
  descFirst?: boolean;
10
- validations?: ((values: string[], validities?: ValidityState[]) => string)[];
10
+ validations?: CheckFieldValidation[];
11
11
  status?: string;
12
12
  style?: SVSStyle;
13
13
  attributes?: HTMLInputAttributes;
@@ -16,6 +16,7 @@ export type CheckFieldProps = {
16
16
  };
17
17
  export type CheckFieldReqdProps = "options";
18
18
  export type CheckFieldBindProps = "values" | "status" | "elements";
19
+ export type CheckFieldValidation = (values: string[], validities?: ValidityState[]) => string;
19
20
  import { type Snippet } from "svelte";
20
21
  import { type Action } from "svelte/action";
21
22
  import { type SvelteMap } from "svelte/reactivity";
@@ -9,7 +9,7 @@
9
9
  bottom?: string,
10
10
  value?: string, // bindable
11
11
  descFirst?: boolean, // <false>
12
- validations?: ((value: string, validity?: ValidityState) => string)[],
12
+ validations?: SelectFieldValidation[],
13
13
  status?: string, // bindable <STATE.DEFAULT>
14
14
  style?: SVSStyle,
15
15
  attributes?: HTMLSelectAttributes;
@@ -18,6 +18,7 @@
18
18
  };
19
19
  export type SelectFieldReqdProps = "options";
20
20
  export type SelectFieldBindProps = "value" | "status" | "element";
21
+ export type SelectFieldValidation = (value: string, validity?: ValidityState) => string;
21
22
 
22
23
  type SelectFieldTarget = { currentTarget: EventTarget & HTMLSelectElement };
23
24
  const preset = "svs-select-field";
@@ -57,6 +58,7 @@
57
58
  }
58
59
  function validate(oninvalid?: boolean) {
59
60
  if (!value && !oninvalid) return toNonInvalid(neutral);
61
+ if (!element || !validations.length) return;
60
62
  for (const v of validations) {
61
63
  const msg = v(value, element?.validity);
62
64
  if (msg) return toInvalid(msg);
@@ -76,7 +78,7 @@
76
78
  attributes?.oninvalid?.(ev);
77
79
  ev.preventDefault();
78
80
  validate(true);
79
- if (status !== STATE.INACTIVE) toInvalid(element?.validationMessage);
81
+ toInvalid(element?.validationMessage);
80
82
  }
81
83
  </script>
82
84
 
@@ -8,7 +8,7 @@ export type SelectFieldProps = {
8
8
  bottom?: string;
9
9
  value?: string;
10
10
  descFirst?: boolean;
11
- validations?: ((value: string, validity?: ValidityState) => string)[];
11
+ validations?: SelectFieldValidation[];
12
12
  status?: string;
13
13
  style?: SVSStyle;
14
14
  attributes?: HTMLSelectAttributes;
@@ -17,6 +17,7 @@ export type SelectFieldProps = {
17
17
  };
18
18
  export type SelectFieldReqdProps = "options";
19
19
  export type SelectFieldBindProps = "value" | "status" | "element";
20
+ export type SelectFieldValidation = (value: string, validity?: ValidityState) => string;
20
21
  import { type Snippet } from "svelte";
21
22
  import { type Action } from "svelte/action";
22
23
  import { type SvelteMap } from "svelte/reactivity";
@@ -10,7 +10,7 @@
10
10
  type?: "text" | "area" | "email" | "password" | "search" | "tel" | "url" | "number", // bindable <"text">
11
11
  options?: SvelteSet<string> | Set<string>,
12
12
  descFirst?: boolean, // <false>
13
- validations?: ((value: string, validity?: ValidityState) => string)[],
13
+ validations?: TextFieldValidation[],
14
14
  status?: string, // bindable <STATE.DEFAULT>
15
15
  style?: SVSStyle,
16
16
  attributes?: HTMLInputAttributes | HTMLTextareaAttributes,
@@ -19,6 +19,7 @@
19
19
  };
20
20
  export type TextFieldReqdProps = never;
21
21
  export type TextFieldBindProps = "value" | "type" | "status" | "element";
22
+ export type TextFieldValidation = (value: string, validity?: ValidityState) => string;
22
23
 
23
24
  const preset = "svs-text-field";
24
25
 
@@ -58,6 +59,7 @@
58
59
  }
59
60
  function validate(oninvalid?: boolean) {
60
61
  if (!value && !oninvalid) return toNonInvalid(neutral);
62
+ if (!element || !validations.length) return;
61
63
  for (const v of validations) {
62
64
  const msg = v(value, element?.validity);
63
65
  if (msg) return toInvalid(msg);
@@ -84,7 +86,7 @@
84
86
  attributes?.oninvalid?.(ev as any);
85
87
  ev.preventDefault();
86
88
  validate(true);
87
- if (status !== STATE.INACTIVE) toInvalid(element?.validationMessage);
89
+ toInvalid(element?.validationMessage);
88
90
  }
89
91
  </script>
90
92
 
@@ -9,7 +9,7 @@ export type TextFieldProps = {
9
9
  type?: "text" | "area" | "email" | "password" | "search" | "tel" | "url" | "number";
10
10
  options?: SvelteSet<string> | Set<string>;
11
11
  descFirst?: boolean;
12
- validations?: ((value: string, validity?: ValidityState) => string)[];
12
+ validations?: TextFieldValidation[];
13
13
  status?: string;
14
14
  style?: SVSStyle;
15
15
  attributes?: HTMLInputAttributes | HTMLTextareaAttributes;
@@ -18,6 +18,7 @@ export type TextFieldProps = {
18
18
  };
19
19
  export type TextFieldReqdProps = never;
20
20
  export type TextFieldBindProps = "value" | "type" | "status" | "element";
21
+ export type TextFieldValidation = (value: string, validity?: ValidityState) => string;
21
22
  import { type Snippet } from "svelte";
22
23
  import { type Action } from "svelte/action";
23
24
  import { type SvelteSet } from "svelte/reactivity";
@@ -8,7 +8,7 @@
8
8
  values?: string[], // bindable
9
9
  multiple?: boolean, // <true>
10
10
  descFirst?: boolean, // <false>
11
- validations?: ((values: string[], validities?: ValidityState[]) => string)[],
11
+ validations?: TogglesFieldValidation[],
12
12
  status?: string, // bindable <STATE.DEFAULT>
13
13
  style?: SVSStyle,
14
14
  attributes?: HTMLButtonAttributes;
@@ -17,6 +17,7 @@
17
17
  };
18
18
  export type TogglesFieldReqdProps = "options";
19
19
  export type TogglesFieldBindProps = "values" | "status" | "elements";
20
+ export type TogglesFieldValidation = (values: string[], validities?: ValidityState[]) => string;
20
21
 
21
22
  type TogglesFieldTarget = { currentTarget: EventTarget & HTMLButtonElement };
22
23
  const preset = "svs-toggles-field";
@@ -59,6 +60,7 @@
59
60
  }
60
61
  function validate(oninvalid?: boolean) {
61
62
  if (!values.length && !oninvalid) return toNonInvalid();
63
+ if (!elem || !validations.length) return;
62
64
  const validities = elements.map((x) => x.validity);
63
65
  for (const v of validations) {
64
66
  const msg = v(values, validities);
@@ -88,7 +90,7 @@
88
90
  ev.preventDefault();
89
91
  phase.submit = true;
90
92
  validate(true);
91
- if (status !== STATE.INACTIVE) toInvalid(elem?.validationMessage);
93
+ toInvalid(elem?.validationMessage);
92
94
  }
93
95
  </script>
94
96
 
@@ -7,7 +7,7 @@ export type TogglesFieldProps = {
7
7
  values?: string[];
8
8
  multiple?: boolean;
9
9
  descFirst?: boolean;
10
- validations?: ((values: string[], validities?: ValidityState[]) => string)[];
10
+ validations?: TogglesFieldValidation[];
11
11
  status?: string;
12
12
  style?: SVSStyle;
13
13
  attributes?: HTMLButtonAttributes;
@@ -16,6 +16,7 @@ export type TogglesFieldProps = {
16
16
  };
17
17
  export type TogglesFieldReqdProps = "options";
18
18
  export type TogglesFieldBindProps = "values" | "status" | "elements";
19
+ export type TogglesFieldValidation = (values: string[], validities?: ValidityState[]) => string;
19
20
  import { type Snippet } from "svelte";
20
21
  import { type Action } from "svelte/action";
21
22
  import { type SvelteMap } from "svelte/reactivity";
@@ -1,7 +1,6 @@
1
1
  export { type SVSStyle, CONST, STATE, AREA, elemId, fnClass, isNeutral, omit, debounce, throttle, UniqueId, };
2
- type ClassRule = Record<string, string>;
3
- type ClassRuleSet = Partial<Record<string, ClassRule>>;
4
- type SVSStyle = ClassRuleSet | ClassRule | string;
2
+ type ClassRule = Record<string, string> | string;
3
+ type SVSStyle = Record<string, ClassRule> | string;
5
4
  declare const CONST = "const";
6
5
  declare const STATE: Readonly<{
7
6
  DEFAULT: "default";
package/_svseeds/core.js CHANGED
@@ -1 +1 @@
1
- var t=this&&this.__assign||function(){return t=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var i in r=arguments[e])Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i]);return t},t.apply(this,arguments)},r=this&&this.__classPrivateFieldSet||function(t,r,e,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof r?t!==r||!i:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,e):i?i.value=e:r.set(t,e),e},e=this&&this.__classPrivateFieldGet||function(t,r,e,n){if("a"===e&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof r?t!==r||!n:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?n:"a"===e?n.call(t):n?n.value:r.get(t)},n=this&&this.__spreadArray||function(t,r,e){if(e||2===arguments.length)for(var n,i=0,o=r.length;i<o;i++)!n&&i in r||(n||(n=Array.prototype.slice.call(r,0,i)),n[i]=r[i]);return t.concat(n||Array.prototype.slice.call(r))};export{i as CONST,o as STATE,a as AREA,u as elemId,l as fnClass,s as isNeutral,h as omit,v as debounce,d as throttle,c as UniqueId};var i="const",o=Object.freeze({DEFAULT:"default",ACTIVE:"active",INACTIVE:"inactive"}),a=Object.freeze({WHOLE:"whole",MIDDLE:"middle",MAIN:"main",TOP:"top",LEFT:"left",RIGHT:"right",BOTTOM:"bottom",LABEL:"label",AUX:"aux",EXTRA:"extra"}),c=function(){function t(t){void 0===t&&(t=4),i.add(this),c.set(this,new Set),u.set(this,4),t>2&&r(this,u,t,"f")}var i,o,a,c,u,l,f,s;return Object.defineProperty(t.prototype,"id",{get:function(){return this.get(!0)},enumerable:!1,configurable:!0}),t.prototype.get=function(t){if(t)return e(this,c,"f").size>1e4&&e(this,c,"f").clear(),e(this,i,"m",s).call(this)},o=t,c=new WeakMap,u=new WeakMap,i=new WeakSet,l=function(){return e(o,o,"f",a)[Math.trunc(Math.random()*e(o,o,"f",a).length)]},f=function(){var t=this;return String.fromCharCode.apply(String,Array(e(this,u,"f")).fill(null).map((function(){return e(t,i,"m",l).call(t)})))},s=function(){for(var t=e(this,i,"m",f).call(this);e(this,c,"f").has(t);)t=e(this,i,"m",f).call(this);return e(this,c,"f").add(t),t},a={value:n(n([],Array.from(Array(25).keys(),(function(t){return t+65})),!0),Array.from(Array(25).keys(),(function(t){return t+97})),!0)},t}(),u=new c;function l(t,r){var e,n=null!==(e=f(r))&&void 0!==e?e:f(t);return null==n?function(t,r){}:"string"==typeof n?function(t,r){return"".concat(n," ").concat(t," ").concat(r)}:function(t,r){return function(t,r,e){var n,a,c,u,l,f,s=null!==(a=null===(n=t[r])||void 0===n?void 0:n[i])&&void 0!==a?a:"",h=null!==(f=null!==(u=null===(c=t[r])||void 0===c?void 0:c[e])&&void 0!==u?u:null===(l=t[r])||void 0===l?void 0:l[o.DEFAULT])&&void 0!==f?f:"";if(!s&&!h)return;return"".concat(s).concat(s&&h?" ":"").concat(h)}(n,t,r)}}function f(t){if(null!=t){if("string"==typeof t)return t.trim()?t:void 0;var r=Object.values(t);if(r.length)return"string"!=typeof r[0]?t:Object.fromEntries(Object.entries(t).map((function(t){return[t[0],{const:t[1]}]})))}}function s(t){return t!==o.ACTIVE&&t!==o.INACTIVE}function h(r){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!r)return{};var i=t({},r);return e.forEach((function(t){return delete i[t]})),i}function v(t,r){var e;return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];e&&clearTimeout(e),e=setTimeout((function(){r.call.apply(r,n([null],i,!1))}),t)}}function d(t,r){var e,i=0,o=function(){return Date.now()-i},a=function(t){r.call.apply(r,n([null],t,!1)),i=Date.now()};return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(!i)return a(r);clearTimeout(e),e=setTimeout((function(){o()>=t&&a(r)}),t-o())}}
1
+ var t=this&&this.__assign||function(){return t=Object.assign||function(t){for(var r,n=1,e=arguments.length;n<e;n++)for(var i in r=arguments[n])Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i]);return t},t.apply(this,arguments)},r=this&&this.__classPrivateFieldSet||function(t,r,n,e,i){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof r?t!==r||!i:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?i.call(t,n):i?i.value=n:r.set(t,n),n},n=this&&this.__classPrivateFieldGet||function(t,r,n,e){if("a"===n&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof r?t!==r||!e:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?e:"a"===n?e.call(t):e?e.value:r.get(t)},e=this&&this.__spreadArray||function(t,r,n){if(n||2===arguments.length)for(var e,i=0,o=r.length;i<o;i++)!e&&i in r||(e||(e=Array.prototype.slice.call(r,0,i)),e[i]=r[i]);return t.concat(e||Array.prototype.slice.call(r))};export{i as CONST,o as STATE,a as AREA,u as elemId,l as fnClass,s as isNeutral,h as omit,v as debounce,d as throttle,c as UniqueId};var i="const",o=Object.freeze({DEFAULT:"default",ACTIVE:"active",INACTIVE:"inactive"}),a=Object.freeze({WHOLE:"whole",MIDDLE:"middle",MAIN:"main",TOP:"top",LEFT:"left",RIGHT:"right",BOTTOM:"bottom",LABEL:"label",AUX:"aux",EXTRA:"extra"}),c=function(){function t(t){void 0===t&&(t=4),i.add(this),c.set(this,new Set),u.set(this,4),t>2&&r(this,u,t,"f")}var i,o,a,c,u,l,f,s;return Object.defineProperty(t.prototype,"id",{get:function(){return this.get(!0)},enumerable:!1,configurable:!0}),t.prototype.get=function(t){if(t)return n(this,c,"f").size>1e4&&n(this,c,"f").clear(),n(this,i,"m",s).call(this)},o=t,c=new WeakMap,u=new WeakMap,i=new WeakSet,l=function(){return n(o,o,"f",a)[Math.trunc(Math.random()*n(o,o,"f",a).length)]},f=function(){var t=this;return String.fromCharCode.apply(String,Array(n(this,u,"f")).fill(null).map((function(){return n(t,i,"m",l).call(t)})))},s=function(){for(var t=n(this,i,"m",f).call(this);n(this,c,"f").has(t);)t=n(this,i,"m",f).call(this);return n(this,c,"f").add(t),t},a={value:e(e([],Array.from(Array(25).keys(),(function(t){return t+65})),!0),Array.from(Array(25).keys(),(function(t){return t+97})),!0)},t}(),u=new c;function l(t,r){var n,e=null!==(n=f(r))&&void 0!==n?n:f(t);return null==e?function(t,r){}:"string"==typeof e?function(t,r){return"".concat(e," ").concat(t," ").concat(r)}:function(t,r){return function(t,r,n){var e,a,c,u,l,f,s=null!==(a=null===(e=t[r])||void 0===e?void 0:e[i])&&void 0!==a?a:"",h=null!==(f=null!==(u=null===(c=t[r])||void 0===c?void 0:c[n])&&void 0!==u?u:null===(l=t[r])||void 0===l?void 0:l[o.DEFAULT])&&void 0!==f?f:"";if(!s&&!h)return;return"".concat(s).concat(s&&h?" ":"").concat(h)}(e,t,r)}}function f(t){if(null!=t){if("string"==typeof t)return t.trim()?t:void 0;var r=Object.entries(t);if(r.length)return Object.fromEntries(r.map((function(t){var r=t[0],n=t[1];return"string"==typeof n?[r,{const:n}]:[r,n]})))}}function s(t){return t!==o.ACTIVE&&t!==o.INACTIVE}function h(r){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];if(!r)return{};var i=t({},r);return n.forEach((function(t){return delete i[t]})),i}function v(t,r){var n;return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];n&&clearTimeout(n),n=setTimeout((function(){r.call.apply(r,e([null],i,!1))}),t)}}function d(t,r){var n,i=0,o=function(){return Date.now()-i},a=function(t){r.call.apply(r,e([null],t,!1)),i=Date.now()};return function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];if(!i)return a(r);clearTimeout(n),n=setTimeout((function(){o()>=t&&a(r)}),t-o())}}
package/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { type SVSStyle, CONST, STATE, AREA, elemId, fnClass, isNeutral, omit, debounce, throttle, UniqueId } from "./_svseeds/core";
2
2
  export { default as Badge, type BadgeProps, type BadgeReqdProps, type BadgeBindProps } from "./_svseeds/_Badge.svelte";
3
3
  export { default as Button, type ButtonProps, type ButtonReqdProps, type ButtonBindProps } from "./_svseeds/_Button.svelte";
4
- export { default as CheckField, type CheckFieldProps, type CheckFieldReqdProps, type CheckFieldBindProps } from "./_svseeds/_CheckField.svelte";
4
+ export { default as CheckField, type CheckFieldProps, type CheckFieldReqdProps, type CheckFieldBindProps, type CheckFieldValidation } from "./_svseeds/_CheckField.svelte";
5
5
  export { default as ColorPicker, type ColorPickerProps, type ColorPickerReqdProps, type ColorPickerBindProps, getHex } from "./_svseeds/_ColorPicker.svelte";
6
6
  export { default as ComboBox, type ComboBoxProps, type ComboBoxReqdProps, type ComboBoxBindProps } from "./_svseeds/_ComboBox.svelte";
7
7
  export { default as ContextMenu, type ContextMenuProps, type ContextMenuReqdProps, type ContextMenuBindProps } from "./_svseeds/_ContextMenu.svelte";
@@ -9,14 +9,14 @@ export { default as Disclosure, type DisclosureProps, type DisclosureReqdProps,
9
9
  export { default as HotkeyCapture, type HotkeyCaptureProps, type HotkeyCaptureReqdProps, type HotkeyCaptureBindProps } from "./_svseeds/_HotkeyCapture.svelte";
10
10
  export { default as Modal, type ModalProps, type ModalReqdProps, type ModalBindProps } from "./_svseeds/_Modal.svelte";
11
11
  export { default as ProgressTracker, type ProgressTrackerProps, type ProgressTrackerReqdProps, type ProgressTrackerBindProps } from "./_svseeds/_ProgressTracker.svelte";
12
- export { default as SelectField, type SelectFieldProps, type SelectFieldReqdProps, type SelectFieldBindProps } from "./_svseeds/_SelectField.svelte";
12
+ export { default as SelectField, type SelectFieldProps, type SelectFieldReqdProps, type SelectFieldBindProps, type SelectFieldValidation } from "./_svseeds/_SelectField.svelte";
13
13
  export { default as Slider, type SliderProps, type SliderReqdProps, type SliderBindProps, type Range } from "./_svseeds/_Slider.svelte";
14
14
  export { default as Sortable, type SortableProps, type SortableReqdProps, type SortableBindProps, SortableItems } from "./_svseeds/_Sortable.svelte";
15
15
  export { default as Tabs, type TabsProps, type TabsReqdProps, type TabsBindProps } from "./_svseeds/_Tabs.svelte";
16
- export { default as TextField, type TextFieldProps, type TextFieldReqdProps, type TextFieldBindProps } from "./_svseeds/_TextField.svelte";
16
+ export { default as TextField, type TextFieldProps, type TextFieldReqdProps, type TextFieldBindProps, type TextFieldValidation } from "./_svseeds/_TextField.svelte";
17
17
  export { default as Toggle, type ToggleProps, type ToggleReqdProps, type ToggleBindProps } from "./_svseeds/_Toggle.svelte";
18
- export { default as TogglesField, type TogglesFieldProps, type TogglesFieldReqdProps, type TogglesFieldBindProps } from "./_svseeds/_TogglesField.svelte";
18
+ export { default as TogglesField, type TogglesFieldProps, type TogglesFieldReqdProps, type TogglesFieldBindProps, type TogglesFieldValidation } from "./_svseeds/_TogglesField.svelte";
19
19
  export { default as Tooltip, type TooltipProps, type TooltipReqdProps, type TooltipBindProps, type Vector, type Position, type Align, tooltip, tooltipAction } from "./_svseeds/_Tooltip.svelte";
20
20
  export { default as Accordion, type AccordionProps, type AccordionDeps, type AccordionReqdProps, type AccordionBindProps } from "./_svseeds/Accordion.svelte";
21
21
  export { default as DarkToggle, type DarkToggleProps, type DarkToggleDeps, type DarkToggleReqdProps, type DarkToggleBindProps } from "./_svseeds/DarkToggle.svelte";
22
- export { default as TagsInput, type TagsInputProps, type TagsInputDeps, type TagsInputReqdProps, type TagsInputBindProps, type TagCountValidation } from "./_svseeds/TagsInput.svelte";
22
+ export { default as TagsInput, type TagsInputProps, type TagsInputDeps, type TagsInputReqdProps, type TagsInputBindProps, type TagsInputValidation, type TagCountValidation } from "./_svseeds/TagsInput.svelte";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svseeds",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "Simple components for Svelte.",
5
5
  "type": "module",
6
6
  "main": "./index.js",