@lavalogic/scoria 0.0.17 → 0.0.19

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,12 +2,17 @@
2
2
 
3
3
  <script lang="ts" module>
4
4
  import { InputVariant } from '../Types/Internal/InputVariant.js';
5
- import type { InputDate } from '../Types/Internal/Misc.js';
5
+ import type { InputDate, InputDateWithTime } from '../Types/Internal/Misc.js';
6
6
  import { Size } from '../Types/Internal/Size.js';
7
7
  import Icon, { type PartialIconProps } from './Icon.svelte';
8
8
 
9
- export interface DateInputProps {
10
- value?: InputDate | null;
9
+ type DTType = 'date' | 'datetime-local' | undefined;
10
+
11
+ export interface DateInputProps<
12
+ DT = DTType,
13
+ ValueType = DT extends 'datetime-local' ? InputDateWithTime : InputDate
14
+ > {
15
+ value?: ValueType | null;
11
16
  label?: string;
12
17
  placeholder?: string;
13
18
  required?: boolean;
@@ -15,7 +20,7 @@
15
20
  min?: string;
16
21
  max?: string;
17
22
  optional?: boolean;
18
- type?: 'date' | 'datetime-local';
23
+ type?: DT;
19
24
  disabled?: boolean;
20
25
  leftIcon?: PartialIconProps;
21
26
  rightIcon?: PartialIconProps;
@@ -1,8 +1,9 @@
1
1
  import { InputVariant } from '../Types/Internal/InputVariant.js';
2
- import type { InputDate } from '../Types/Internal/Misc.js';
2
+ import type { InputDate, InputDateWithTime } from '../Types/Internal/Misc.js';
3
3
  import { type PartialIconProps } from './Icon.svelte';
4
- export interface DateInputProps {
5
- value?: InputDate | null;
4
+ type DTType = 'date' | 'datetime-local' | undefined;
5
+ export interface DateInputProps<DT = DTType, ValueType = DT extends 'datetime-local' ? InputDateWithTime : InputDate> {
6
+ value?: ValueType | null;
6
7
  label?: string;
7
8
  placeholder?: string;
8
9
  required?: boolean;
@@ -10,7 +11,7 @@ export interface DateInputProps {
10
11
  min?: string;
11
12
  max?: string;
12
13
  optional?: boolean;
13
- type?: 'date' | 'datetime-local';
14
+ type?: DT;
14
15
  disabled?: boolean;
15
16
  leftIcon?: PartialIconProps;
16
17
  rightIcon?: PartialIconProps;
@@ -19,6 +20,6 @@ export interface DateInputProps {
19
20
  onblur?: (e: FocusEvent) => void;
20
21
  onfocus?: (e: FocusEvent) => void;
21
22
  }
22
- declare const DateInput: import("svelte").Component<DateInputProps, {}, "value">;
23
+ declare const DateInput: import("svelte").Component<DateInputProps<DTType, InputDate | InputDateWithTime>, {}, "value">;
23
24
  type DateInput = ReturnType<typeof DateInput>;
24
25
  export default DateInput;
@@ -13,16 +13,10 @@
13
13
  import { Size } from '../../../../../Types/Internal/Size.js';
14
14
  import { Validity } from '../../../../../Types/Internal/Validity.js';
15
15
 
16
- export interface IconCellProps<T extends object> {
16
+ export interface ValidityCellProps<T extends object> {
17
17
  cell: TableCell<T>;
18
18
  }
19
19
 
20
- export interface IconCellModalProps<T extends object> {
21
- cell: TableCell<T>;
22
- onclose: () => void;
23
- onsubmit?: (e: SubmitEvent) => void;
24
- }
25
-
26
20
  const iconSets: Record<Validity, IconProps> = {
27
21
  [Validity.Invalid]: {
28
22
  name: 'circle-cross',
@@ -49,7 +43,7 @@
49
43
  <script lang="ts" generics="T extends object">
50
44
  import { getContext, tick, untrack } from 'svelte';
51
45
 
52
- const { cell }: IconCellProps<T> = $props();
46
+ const { cell }: ValidityCellProps<T> = $props();
53
47
 
54
48
  const tableContext = getContext<TableContext<T>>(TableContext.identifier);
55
49
  const { toast } = getContext<ToastContext>(ToastContext.identifier);
@@ -1,14 +1,9 @@
1
1
  import type { TableCell } from '../../../Types/Columns/TableCell.js';
2
- export interface IconCellProps<T extends object> {
2
+ export interface ValidityCellProps<T extends object> {
3
3
  cell: TableCell<T>;
4
4
  }
5
- export interface IconCellModalProps<T extends object> {
6
- cell: TableCell<T>;
7
- onclose: () => void;
8
- onsubmit?: (e: SubmitEvent) => void;
9
- }
10
5
  declare function $$render<T extends object>(): {
11
- props: IconCellProps<T>;
6
+ props: ValidityCellProps<T>;
12
7
  exports: {};
13
8
  bindings: "";
14
9
  slots: {};
@@ -5,4 +5,5 @@ export interface FilterOnlyDefProps<T extends object> extends ColumnDefProps<T>
5
5
  }
6
6
  export declare class FilterOnlyDef<T extends object> extends ColumnDef<T, StringFilterValueType> {
7
7
  readonly columnType: ColumnType;
8
+ constructor(props: FilterOnlyDefProps<T>);
8
9
  }
@@ -2,4 +2,7 @@ import { ColumnType } from '../../ColumnType.js';
2
2
  import { ColumnDef } from '../ColumnDef.svelte.js';
3
3
  export class FilterOnlyDef extends ColumnDef {
4
4
  columnType = ColumnType.FilterOnly;
5
+ constructor(props) {
6
+ super(props);
7
+ }
5
8
  }
@@ -1,4 +1,4 @@
1
1
  import type { GridNumberItem } from './GridNumberItem.js';
2
2
  import type { GridSelectItem } from './GridSelectItem.js';
3
3
  import type { GridTextItem } from './GridTextItem.js';
4
- export type GridItem<V, VP> = GridTextItem | GridNumberItem | (V extends object ? (VP extends string & keyof V ? GridSelectItem<V, VP> : never) : never);
4
+ export type GridItem<V = unknown, VP = unknown> = GridTextItem | GridNumberItem | (V extends object ? (VP extends string & keyof V ? GridSelectItem<V, VP> : never) : never);
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export { type QueryDefProps, QueryDef } from './Components/Table/Types/Columns/D
9
9
  export { type SelectDefProps, SelectDef } from './Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.js';
10
10
  export { type TextInputDefProps, TextInputDef } from './Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.js';
11
11
  export { type ActionsDefProps, ActionsDef } from './Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.js';
12
- export { type AbstractDisplayDefProps, AbstractDisplayDef } from './Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js';
12
+ export { type DisplayDefModalProps, type AbstractDisplayDefProps, AbstractDisplayDef } from './Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js';
13
13
  export { type BubbleDefProps, BubbleDef } from './Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.js';
14
14
  export { type DisplayDefProps, DisplayDef } from './Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.js';
15
15
  export { type ProgressBarDefProps, ProgressBarDef } from './Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.js';
@@ -77,7 +77,7 @@ export { type KeyValuePair, type SummaryCardProps, default as SummaryCard } from
77
77
  export { default as TextAreaModal } from './Components/Touch/TextAreaModal.svelte';
78
78
  export { default as TextModal } from './Components/Touch/TextModal.svelte';
79
79
  export { default as TouchCard } from './Components/Touch/TouchCard.svelte';
80
- export { default as TouchModal } from './Components/Touch/TouchModal.svelte';
80
+ export { default as TouchModal, type DefaultTimer } from './Components/Touch/TouchModal.svelte';
81
81
  export { default as UtilityButton } from './Components/Touch/UtilityButton.svelte';
82
82
  export { default as Action } from './Components/Action.svelte';
83
83
  export { default as AlertModal } from './Components/AlertModal.svelte';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lavalogic/scoria",
3
3
  "description": "Svelte components used for the FloWMS Web Frontend",
4
- "version": "0.0.17",
4
+ "version": "0.0.19",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },