tungsten 0.1.42 → 0.1.44

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.
@@ -3,8 +3,8 @@ import type { FilterSelectFunc, HTMLInputTypeAttribute, SelectHTMLAttributes } f
3
3
  import type { InputKeyboardEvent } from '../../../types/jsx/html.events.js';
4
4
  import { TungstenSimpleComponent } from '../../Components.jsx';
5
5
  import { DetailedHTMLProps } from '../../../types/jsx/jsx.js';
6
- export type Option<Options> = {
7
- value: Options;
6
+ export type OptionStruct<Option> = {
7
+ value: Option;
8
8
  text: string;
9
9
  };
10
10
  type BasicProps = {
@@ -16,14 +16,14 @@ type BasicProps = {
16
16
  value?: string;
17
17
  placeholder?: string;
18
18
  };
19
- export type BindableSelectProps<O extends object, K extends keyof O, Options extends string> = DetailedHTMLProps<SelectHTMLAttributes<HTMLSelectElement, O>, HTMLSelectElement> & BasicProps & {
20
- options: readonly Option<Options>[];
19
+ export type BindableSelectProps<O extends object, K extends keyof O, Option extends string> = DetailedHTMLProps<SelectHTMLAttributes<HTMLSelectElement, O>, HTMLSelectElement> & BasicProps & {
20
+ options: readonly OptionStruct<Option>[];
21
21
  } & ({} | ({
22
22
  bind: TypedBindVariable<O, K>;
23
- } & (Options extends O[K] ? {
24
- filter?: FilterSelectFunc<InputKeyboardEvent, Options, O[K]> | undefined;
23
+ } & (Option extends O[K] ? {
24
+ filter?: FilterSelectFunc<InputKeyboardEvent, Option, O[K]> | undefined;
25
25
  } : {
26
- filter: FilterSelectFunc<InputKeyboardEvent, Options, O[K]>;
26
+ filter: FilterSelectFunc<InputKeyboardEvent, Option, O[K]>;
27
27
  })));
28
28
  export declare class BindableSelect<O extends object, K extends keyof O, Options extends string> extends TungstenSimpleComponent<BindableSelectProps<O, K, Options>> {
29
29
  content: () => import("../../ContentNode.js").ContentNode;
@@ -1 +1 @@
1
- {"version":3,"file":"BindableSelect.d.ts","sourceRoot":"","sources":["../../../src/components/bindable/BindableSelect.ts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CAAA;AAEvC,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,gBAAgB,GAAG,OAAO,QAAQ,CAAA;AAkBrE,wBAAgB,GAAG,CACf,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,EAChE,KAAK,EAAE,6BAA6B,EACpC,GAAG,EAAE,OAAO,GACb,WAAW,CAwDb;AAID,eAAO,MAAM,IAAI,YAAM,CAAA"}
1
+ {"version":3,"file":"jsxRuntime.d.ts","sourceRoot":"","sources":["../src/jsxRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,KAAK,6BAA6B,EAAoD,MAAM,kBAAkB,CAAA;AACvH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAM9C,cAAc,yBAAyB,CAAA;AAEvC,eAAO,MAAM,QAAQ,OAAkB,CAAA;AAEvC,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,gBAAgB,GAAG,OAAO,QAAQ,CAAA;AAkBrE,wBAAgB,GAAG,CACf,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,EAChE,KAAK,EAAE,6BAA6B,EACpC,GAAG,EAAE,OAAO,GACb,WAAW,CAgEb;AAID,eAAO,MAAM,IAAI,YAAM,CAAA"}
@@ -25,7 +25,9 @@ export function jsx(type, props, key) {
25
25
  if (Array.isArray(props.class) || typeof props.class === 'string') {
26
26
  const classString = Array.isArray(props.class) ? classNameArrayToString(props.class) : props.class;
27
27
  if (props.className !== undefined) {
28
- if (typeof props.className !== 'string') throwError('jsxRuntime', `expected className prop to be string, instead got ${typeof props.className}`);
28
+ if (typeof props.className !== 'string') {
29
+ throwError('jsxRuntime', `expected className prop to be string, instead got ${typeof props.className}`);
30
+ }
29
31
  props.className = props.className + ' ' + classString;
30
32
  } else {
31
33
  props.className = classString;
@@ -34,6 +36,10 @@ export function jsx(type, props, key) {
34
36
  delete props.class;
35
37
  }
36
38
  }
39
+ if ('htmlFor' in props) {
40
+ props.for = props.htmlFor;
41
+ delete props.htmlFor;
42
+ }
37
43
  //const { children, ...filteredProps } = props
38
44
  if (type === Fragment) {
39
45
  const {
@@ -1 +1 @@
1
- {"version":3,"file":"processProps.d.ts","sourceRoot":"","sources":["../../src/render/processProps.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAA;AAoBjE,wBAAgB,YAAY,CAAC,KAAK,EAAE,6BAA6B,iCAwChE"}
1
+ {"version":3,"file":"processProps.d.ts","sourceRoot":"","sources":["../../src/render/processProps.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAA;AAoBjE,wBAAgB,YAAY,CAAC,KAAK,EAAE,6BAA6B,iCA2ChE"}
@@ -18,6 +18,8 @@ export function processProps(props) {
18
18
  delete props.class;
19
19
  if ('className' in props) props.class = props.className;
20
20
  delete props.className;
21
+ // if ('htmlFor' in props) props.for = props.htmlFor
22
+ // delete props.htmlFor
21
23
  // assignStyle
22
24
  // if (props.assignStyle) {
23
25
  // const assignStyle = attributes.class as AssignedStyle
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tungsten",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "bin": {
@@ -949,6 +949,7 @@ export interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
949
949
 
950
950
  export interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
951
951
  form?: string | undefined;
952
+ for?: string | undefined;
952
953
  htmlFor?: string | undefined;
953
954
  }
954
955
 
@@ -1058,6 +1059,7 @@ export interface OptionHTMLAttributes<T, BO extends object> extends HTMLAttribut
1058
1059
 
1059
1060
  export interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
1060
1061
  form?: string | undefined;
1062
+ for?: string | undefined;
1061
1063
  htmlFor?: string | undefined;
1062
1064
  name?: string | undefined;
1063
1065
  }