@lavalogic/scoria 0.40.18 → 0.40.20
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.
- package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte +16 -3
- package/dist/Components/AppointmentCalendar/AppointmentCalendarProps.d.ts +2 -0
- package/dist/Components/DateInput.svelte +6 -4
- package/dist/Components/DateInputProps.d.ts +2 -1
- package/dist/Components/Icons.d.ts +12 -0
- package/dist/Components/Icons.js +16 -0
- package/dist/Components/TimeInputProps.d.ts +51 -0
- package/dist/Components/TimeInputProps.js +1 -0
- package/dist/Types/Internal/Misc.d.ts +2 -0
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -771,6 +771,9 @@ $effect(() => {
|
|
|
771
771
|
{#if apt.sublabel}
|
|
772
772
|
<span class="apt-sublabel">{apt.sublabel}</span>
|
|
773
773
|
{/if}
|
|
774
|
+
{#if apt.reference}
|
|
775
|
+
<span class="apt-reference">Ref: {apt.reference}</span>
|
|
776
|
+
{/if}
|
|
774
777
|
</div>
|
|
775
778
|
{/each}
|
|
776
779
|
</div>
|
|
@@ -1044,11 +1047,15 @@ $effect(() => {
|
|
|
1044
1047
|
color: #259fc7;
|
|
1045
1048
|
}
|
|
1046
1049
|
.appointment-block.outbound {
|
|
1047
|
-
border-color: #
|
|
1048
|
-
background-color: #
|
|
1050
|
+
border-color: #66bb6a;
|
|
1051
|
+
background-color: #eaf7ec;
|
|
1049
1052
|
}
|
|
1050
1053
|
.appointment-block.outbound .apt-type {
|
|
1051
|
-
color: #
|
|
1054
|
+
color: #2e7d32;
|
|
1055
|
+
}
|
|
1056
|
+
.appointment-block.outbound:hover {
|
|
1057
|
+
background-color: #dcefdd;
|
|
1058
|
+
border-color: #43a047;
|
|
1052
1059
|
}
|
|
1053
1060
|
|
|
1054
1061
|
.apt-type {
|
|
@@ -1067,6 +1074,12 @@ $effect(() => {
|
|
|
1067
1074
|
font-size: 0.75rem;
|
|
1068
1075
|
}
|
|
1069
1076
|
|
|
1077
|
+
.apt-reference {
|
|
1078
|
+
color: #647d8e;
|
|
1079
|
+
font-size: 0.75rem;
|
|
1080
|
+
font-weight: 600;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1070
1083
|
.week-day-tabs {
|
|
1071
1084
|
display: flex;
|
|
1072
1085
|
flex-flow: row nowrap;
|
|
@@ -29,6 +29,8 @@ export interface CalendarAppointment {
|
|
|
29
29
|
readonly typeCode: string;
|
|
30
30
|
readonly label: string;
|
|
31
31
|
readonly sublabel?: string;
|
|
32
|
+
/** Optional booking reference shown on the appointment card. */
|
|
33
|
+
readonly reference?: string;
|
|
32
34
|
}
|
|
33
35
|
export interface CalendarDoor {
|
|
34
36
|
readonly id: number;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script
|
|
4
4
|
lang="ts"
|
|
5
5
|
module
|
|
6
|
-
>import { cssLength
|
|
6
|
+
>import { cssLength } from "../Helpers/Helpers.svelte.js";
|
|
7
7
|
import { InputVariant } from "../Types/Internal/InputVariant.js";
|
|
8
8
|
import { Size } from "../Types/Internal/Size.js";
|
|
9
9
|
import Icon from "./Icon.svelte";
|
|
@@ -28,11 +28,13 @@ function submitAncestorForm(e) {
|
|
|
28
28
|
// DateInput rendered inside e.g. the Order Details collapsible card.
|
|
29
29
|
const isInvalid = $derived(required && !value?.trim() || invalid);
|
|
30
30
|
function onkeydown(e) {
|
|
31
|
+
// Only Enter is intercepted (to submit an ancestor form). All other
|
|
32
|
+
// keys — crucially the digit keys used to type a date/time — must pass
|
|
33
|
+
// through; `passthrough` was blurring the input on every alphanumeric
|
|
34
|
+
// keypress, which made the field impossible to type into.
|
|
31
35
|
if (e.key === "Enter") {
|
|
32
36
|
submitAncestorForm(e);
|
|
33
|
-
return;
|
|
34
37
|
}
|
|
35
|
-
passthrough(e);
|
|
36
38
|
}
|
|
37
39
|
function ondblclick() {
|
|
38
40
|
openPicker(inputRef);
|
|
@@ -82,7 +84,7 @@ function handleChange(e) {
|
|
|
82
84
|
/>
|
|
83
85
|
{/if}
|
|
84
86
|
<input
|
|
85
|
-
step={type === 'datetime-local' ? 1 : 'any'}
|
|
87
|
+
step={type === 'datetime-local' ? 1 : type === 'time' ? 60 : 'any'}
|
|
86
88
|
class:invalid={isInvalid}
|
|
87
89
|
class:left-pad={leftIcon != undefined}
|
|
88
90
|
class:right-pad={rightIcon != undefined}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { DateOnlyInputProps } from './DateOnlyInputProps.js';
|
|
2
2
|
import type { DateTimeInputProps } from './DateTimeInputProps.js';
|
|
3
|
-
|
|
3
|
+
import type { TimeInputProps } from './TimeInputProps.js';
|
|
4
|
+
export type DateInputProps = DateOnlyInputProps | DateTimeInputProps | TimeInputProps;
|
|
@@ -867,4 +867,16 @@ export declare const icons: {
|
|
|
867
867
|
readonly box: 24;
|
|
868
868
|
readonly svg: "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M17.4338 3C17.7851 3 18.1106 3.1843 18.2913 3.4855L20.8575 7.76249C20.9507 7.9179 21 8.09574 21 8.27698V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V8.27698C3 8.09574 3.04926 7.9179 3.14251 7.76249L5.7087 3.4855C5.88942 3.1843 6.21493 3 6.56619 3H17.4338ZM14.5 5H17.2L19 8H15.5L14.5 5ZM12.5 5H11.5L10.5 8V13H13.5V8L12.5 5ZM9.5 5H6.8L5 8H8.5L9.5 5ZM8.5 10H5V19H19V10H15.5V14C15.5 14.5523 15.0523 15 14.5 15H9.5C8.94772 15 8.5 14.5523 8.5 14V10Z\"/>";
|
|
869
869
|
};
|
|
870
|
+
readonly doors: {
|
|
871
|
+
readonly box: 24;
|
|
872
|
+
readonly svg: "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12 4C19 4 22 8 22 8V9H20V20H4V9H2V8C2 8 5 4 12 4ZM12 6C8 6 6 8 6 8V18H8V13H11V18H13V13H16V18H18V8C18 8 16 6 12 6Z\"/>";
|
|
873
|
+
};
|
|
874
|
+
readonly 'door-groups': {
|
|
875
|
+
readonly box: 24;
|
|
876
|
+
readonly svg: "<path d=\"M13 21H11V13H5V21H3V11H13V21Z\"/>\n\t\t\t\t\t\t<path d=\"M17 17H15V9H9V10H7V7H17V17Z\"/>\n\t\t\t\t\t\t<path d=\"M21 13H19V5H13V6H11V3H21V13Z\"/>";
|
|
877
|
+
};
|
|
878
|
+
readonly 'door-schedule': {
|
|
879
|
+
readonly box: 24;
|
|
880
|
+
readonly svg: "<path d=\"M20 22H18V6H6V22H4V3H20V22Z\"/>\n\t\t\t\t\t\t<path d=\"M10.1465 10.8535C10.4615 10.5386 10.9999 10.7616 11 11.207V16.793C10.9999 17.2384 10.4615 17.4614 10.1465 17.1465L7.35352 14.3535C7.1583 14.1583 7.1583 13.8417 7.35352 13.6465L10.1465 10.8535Z\"/>\n\t\t\t\t\t\t<path d=\"M13 11.207C13.0001 10.7616 13.5385 10.5386 13.8535 10.8535L16.6465 13.6465C16.8417 13.8417 16.8417 14.1583 16.6465 14.3535L13.8535 17.1465C13.5385 17.4614 13.0001 17.2384 13 16.793V11.207Z\"/>";
|
|
881
|
+
};
|
|
870
882
|
};
|
package/dist/Components/Icons.js
CHANGED
|
@@ -1238,6 +1238,22 @@ export const icons = {
|
|
|
1238
1238
|
box: 24,
|
|
1239
1239
|
svg: `<path fill-rule="evenodd" clip-rule="evenodd" d="M17.4338 3C17.7851 3 18.1106 3.1843 18.2913 3.4855L20.8575 7.76249C20.9507 7.9179 21 8.09574 21 8.27698V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V8.27698C3 8.09574 3.04926 7.9179 3.14251 7.76249L5.7087 3.4855C5.88942 3.1843 6.21493 3 6.56619 3H17.4338ZM14.5 5H17.2L19 8H15.5L14.5 5ZM12.5 5H11.5L10.5 8V13H13.5V8L12.5 5ZM9.5 5H6.8L5 8H8.5L9.5 5ZM8.5 10H5V19H19V10H15.5V14C15.5 14.5523 15.0523 15 14.5 15H9.5C8.94772 15 8.5 14.5523 8.5 14V10Z"/>`,
|
|
1240
1240
|
},
|
|
1241
|
+
doors: {
|
|
1242
|
+
box: 24,
|
|
1243
|
+
svg: `<path fill-rule="evenodd" clip-rule="evenodd" d="M12 4C19 4 22 8 22 8V9H20V20H4V9H2V8C2 8 5 4 12 4ZM12 6C8 6 6 8 6 8V18H8V13H11V18H13V13H16V18H18V8C18 8 16 6 12 6Z"/>`,
|
|
1244
|
+
},
|
|
1245
|
+
'door-groups': {
|
|
1246
|
+
box: 24,
|
|
1247
|
+
svg: `<path d="M13 21H11V13H5V21H3V11H13V21Z"/>
|
|
1248
|
+
<path d="M17 17H15V9H9V10H7V7H17V17Z"/>
|
|
1249
|
+
<path d="M21 13H19V5H13V6H11V3H21V13Z"/>`,
|
|
1250
|
+
},
|
|
1251
|
+
'door-schedule': {
|
|
1252
|
+
box: 24,
|
|
1253
|
+
svg: `<path d="M20 22H18V6H6V22H4V3H20V22Z"/>
|
|
1254
|
+
<path d="M10.1465 10.8535C10.4615 10.5386 10.9999 10.7616 11 11.207V16.793C10.9999 17.2384 10.4615 17.4614 10.1465 17.1465L7.35352 14.3535C7.1583 14.1583 7.1583 13.8417 7.35352 13.6465L10.1465 10.8535Z"/>
|
|
1255
|
+
<path d="M13 11.207C13.0001 10.7616 13.5385 10.5386 13.8535 10.8535L16.6465 13.6465C16.8417 13.8417 16.8417 14.1583 16.6465 14.3535L13.8535 17.1465C13.5385 17.4614 13.0001 17.2384 13 16.793V11.207Z"/>`,
|
|
1256
|
+
},
|
|
1241
1257
|
};
|
|
1242
1258
|
Object.freeze(icons);
|
|
1243
1259
|
Object.keys(icons).forEach((key) => {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { InputVariant } from '../Types/Internal/InputVariant.js';
|
|
2
|
+
import type { InputTime } from '../Types/Internal/Misc.js';
|
|
3
|
+
import type { PartialIconProps } from './PartialIconProps.js';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the `time` variant of {@link DateInput}.
|
|
6
|
+
*
|
|
7
|
+
* Renders a native `<input type="time">` with the same overlapping-label
|
|
8
|
+
* border chrome as the date/datetime variants. `value` is branded with
|
|
9
|
+
* {@link InputTime} (`HH:MM`); the empty string is a known sentinel that
|
|
10
|
+
* the consumer is expected to handle when binding.
|
|
11
|
+
*/
|
|
12
|
+
export interface TimeInputProps {
|
|
13
|
+
/** Discriminator. Must be the literal `'time'`. */
|
|
14
|
+
type: 'time';
|
|
15
|
+
/**
|
|
16
|
+
* Bindable time value (`HH:MM`). `''` or `null` represent "no time
|
|
17
|
+
* selected" — both are accepted because consumers commonly back the
|
|
18
|
+
* binding with a nullable field; the component treats them alike.
|
|
19
|
+
*/
|
|
20
|
+
value?: InputTime | '' | null;
|
|
21
|
+
/** Label rendered above the input. */
|
|
22
|
+
label?: string;
|
|
23
|
+
/** Native `placeholder` attribute. */
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
/** Native `required` attribute. */
|
|
26
|
+
required?: boolean;
|
|
27
|
+
/** Render the "- optional" suffix next to `label`. */
|
|
28
|
+
optional?: boolean;
|
|
29
|
+
/** Render variant. See {@link InputVariant}. */
|
|
30
|
+
variant?: InputVariant;
|
|
31
|
+
/** Native `min` constraint. */
|
|
32
|
+
min?: InputTime;
|
|
33
|
+
/** Native `max` constraint. */
|
|
34
|
+
max?: InputTime;
|
|
35
|
+
/** Native `disabled` attribute. */
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
/** Icon rendered on the left of the input. */
|
|
38
|
+
leftIcon?: PartialIconProps;
|
|
39
|
+
/** Icon rendered on the right of the input. */
|
|
40
|
+
rightIcon?: PartialIconProps;
|
|
41
|
+
/** Bindable reference to the underlying `<input>` element. */
|
|
42
|
+
inputRef?: HTMLInputElement;
|
|
43
|
+
/** Force the invalid visual state. */
|
|
44
|
+
invalid?: boolean;
|
|
45
|
+
/** Blur handler. */
|
|
46
|
+
onblur?: (e: FocusEvent) => void;
|
|
47
|
+
/** Focus handler. */
|
|
48
|
+
onfocus?: (e: FocusEvent) => void;
|
|
49
|
+
/** Change handler. May return `void` or `Promise<void>`. */
|
|
50
|
+
onchange?: (value: InputTime | null) => void | Promise<void>;
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -69,6 +69,8 @@ export type ScoriaStorageKey = BrandedString<'ScoriaStorageKey'>;
|
|
|
69
69
|
export type InputDate = BrandedString<'InputDate'>;
|
|
70
70
|
/** ISO date-time string of the form `YYYY-MM-DDTHH:MM:SS`. */
|
|
71
71
|
export type InputDateWithTime = BrandedString<'InputDateWithTime'>;
|
|
72
|
+
/** ISO time-only string of the form `HH:MM`. */
|
|
73
|
+
export type InputTime = BrandedString<'InputTime'>;
|
|
72
74
|
/** Date string formatted for the FloWMS SQL backend. */
|
|
73
75
|
export type SQLDate = BrandedString<'SQLDate'>;
|
|
74
76
|
/** Integer centimetre count. Used by dimension inputs. */
|
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export type { DateOnlyInputProps } from './Components/DateOnlyInputProps.js';
|
|
|
41
41
|
export { default as DatePicker } from './Components/DatePicker.svelte';
|
|
42
42
|
export { type DatePickerProps } from './Components/DatePickerProps.js';
|
|
43
43
|
export type { DateTimeInputProps } from './Components/DateTimeInputProps.js';
|
|
44
|
+
export type { TimeInputProps } from './Components/TimeInputProps.js';
|
|
44
45
|
export { default as DesktopModal } from './Components/DesktopModal.svelte';
|
|
45
46
|
export type { DesktopModalProps } from './Components/DesktopModalProps.js';
|
|
46
47
|
export { default as Dial } from './Components/Dial.svelte';
|
|
@@ -210,7 +211,7 @@ export { type GridStringItem } from './Types/Internal/GridStringItem.js';
|
|
|
210
211
|
export { type GridTextItem } from './Types/Internal/GridTextItem.js';
|
|
211
212
|
export { type IdentifiableToastMessage } from './Types/Internal/IdentifiableToastMessage.js';
|
|
212
213
|
export { InputVariant } from './Types/Internal/InputVariant.js';
|
|
213
|
-
export { type BrandedInteger, type BrandedNumber, type BrandedString, type Centimetres, type CssLength, type InputDate, type InputDateWithTime, type NonNullableKey, type Pixels, type ScoriaStorageKey, type SQLDate, type Unsubscriber, type Uuid, type ValueProp, } from './Types/Internal/Misc.js';
|
|
214
|
+
export { type BrandedInteger, type BrandedNumber, type BrandedString, type Centimetres, type CssLength, type InputDate, type InputDateWithTime, type InputTime, type NonNullableKey, type Pixels, type ScoriaStorageKey, type SQLDate, type Unsubscriber, type Uuid, type ValueProp, } from './Types/Internal/Misc.js';
|
|
214
215
|
export { type RefWrapper } from './Types/Internal/RefWrapper.js';
|
|
215
216
|
export { type SelectOption } from './Types/Internal/SelectOption.js';
|
|
216
217
|
export { Shape } from './Types/Internal/Shape.js';
|