@origostudio/origo-design 0.0.49 → 0.0.51
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/CHANGELOG.md +6 -4
- package/dist/packages/angular-renderer/CHANGELOG.md +22 -0
- package/dist/packages/angular-renderer/package.json +3 -3
- package/dist/packages/angular-renderer/src/components/primitives/autocomplete/autocomplete.component.d.ts +99 -0
- package/dist/packages/angular-renderer/src/components/primitives/autocomplete/autocomplete.component.js +306 -0
- package/dist/packages/angular-renderer/src/components/primitives/autocomplete/autocomplete.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/combobox/combobox.component.d.ts +69 -0
- package/dist/packages/angular-renderer/src/components/primitives/combobox/combobox.component.js +276 -0
- package/dist/packages/angular-renderer/src/components/primitives/combobox/combobox.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/date-picker/date-picker.component.d.ts +57 -0
- package/dist/packages/angular-renderer/src/components/primitives/date-picker/date-picker.component.js +257 -0
- package/dist/packages/angular-renderer/src/components/primitives/date-picker/date-picker.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/date-range-picker/date-range-picker.component.d.ts +67 -0
- package/dist/packages/angular-renderer/src/components/primitives/date-range-picker/date-range-picker.component.js +299 -0
- package/dist/packages/angular-renderer/src/components/primitives/date-range-picker/date-range-picker.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/multi-select/multi-select.component.d.ts +110 -0
- package/dist/packages/angular-renderer/src/components/primitives/multi-select/multi-select.component.js +323 -0
- package/dist/packages/angular-renderer/src/components/primitives/multi-select/multi-select.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/select/select.component.d.ts +80 -19
- package/dist/packages/angular-renderer/src/components/primitives/select/select.component.js +201 -24
- package/dist/packages/angular-renderer/src/components/primitives/select/select.component.js.map +1 -1
- package/dist/packages/angular-renderer/src/components/primitives/select/selection-utils.d.ts +9 -0
- package/dist/packages/angular-renderer/src/components/primitives/select/selection-utils.js +69 -0
- package/dist/packages/angular-renderer/src/components/primitives/select/selection-utils.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/time-picker/time-picker.component.d.ts +48 -0
- package/dist/packages/angular-renderer/src/components/primitives/time-picker/time-picker.component.js +214 -0
- package/dist/packages/angular-renderer/src/components/primitives/time-picker/time-picker.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/index.d.ts +6 -0
- package/dist/packages/angular-renderer/src/index.js +6 -0
- package/dist/packages/angular-renderer/src/index.js.map +1 -1
- package/dist/packages/angular-renderer/src/lib/primitives.provider.js +12 -0
- package/dist/packages/angular-renderer/src/lib/primitives.provider.js.map +1 -1
- package/dist/packages/cli/CHANGELOG.md +8 -0
- package/dist/packages/cli/package.json +2 -2
- package/dist/packages/cli/package.json.bak +2 -2
- package/dist/packages/core/CHANGELOG.md +8 -0
- package/dist/packages/core/package.json +1 -1
- package/dist/packages/core/package.json.bak +1 -1
- package/dist/packages/design-tokens/CHANGELOG.md +8 -0
- package/dist/packages/design-tokens/package.json +1 -1
- package/dist/packages/playground/browser/{chunk-B_swdRuc.js → chunk-2fyh0Go5.js} +1 -1
- package/dist/packages/playground/browser/{chunk-C8l8Pst_.js → chunk-6qDdu3iP.js} +1 -1
- package/dist/packages/playground/browser/{chunk-G1sQXMvG.js → chunk-BQHgLM1h.js} +1 -1
- package/dist/packages/playground/browser/{chunk-Cb2ALrKC.js → chunk-BQrkBjEv.js} +1 -1
- package/dist/packages/playground/browser/{chunk-BbeNQQ9Z.js → chunk-BSIGVQT8.js} +1 -1
- package/dist/packages/playground/browser/{chunk-BlCRDoSd.js → chunk-CD79k8Eb.js} +1 -1
- package/dist/packages/playground/browser/{chunk-CCE_vAje.js → chunk-D6mKAQPx.js} +1 -1
- package/dist/packages/playground/browser/{chunk-DoYDPF2-.js → chunk-DBZa4hap.js} +1 -1
- package/dist/packages/playground/browser/{chunk-CpaI4VGh.js → chunk-DGb2Oa6d.js} +1 -1
- package/dist/packages/playground/browser/{chunk-B8mwHWgW.js → chunk-DPEeny3K.js} +1 -1
- package/dist/packages/playground/browser/{chunk-DgLZ-dIi.js → chunk-DeS5TtZS.js} +1 -1
- package/dist/packages/playground/browser/{chunk-r4-UbXQJ.js → chunk-DnW3HJ2k.js} +1 -1
- package/dist/packages/playground/browser/{chunk-lFsGUZ3A.js → chunk-V8VJI0nO.js} +1 -1
- package/dist/packages/playground/browser/{chunk-XTbjIUbx.js → chunk-mGxxpk2V.js} +1 -1
- package/dist/packages/playground/browser/{chunk-DkxgAarv.js → chunk-vt9o3pSK.js} +1 -1
- package/dist/packages/playground/browser/index.html +1 -1
- package/dist/packages/playground/browser/main-6RRVB3JV.js +740 -0
- package/package.json +1 -1
- package/packages/angular-renderer/CHANGELOG.md +22 -0
- package/packages/angular-renderer/package.json +3 -3
- package/packages/angular-renderer/src/components/primitives/autocomplete/autocomplete.component.html +83 -0
- package/packages/angular-renderer/src/components/primitives/autocomplete/autocomplete.component.scss +161 -0
- package/packages/angular-renderer/src/components/primitives/autocomplete/autocomplete.component.ts +338 -0
- package/packages/angular-renderer/src/components/primitives/combobox/combobox.component.html +90 -0
- package/packages/angular-renderer/src/components/primitives/combobox/combobox.component.scss +189 -0
- package/packages/angular-renderer/src/components/primitives/combobox/combobox.component.ts +281 -0
- package/packages/angular-renderer/src/components/primitives/date-picker/date-picker.component.html +73 -0
- package/packages/angular-renderer/src/components/primitives/date-picker/date-picker.component.scss +77 -0
- package/packages/angular-renderer/src/components/primitives/date-picker/date-picker.component.ts +294 -0
- package/packages/angular-renderer/src/components/primitives/date-range-picker/date-range-picker.component.html +83 -0
- package/packages/angular-renderer/src/components/primitives/date-range-picker/date-range-picker.component.scss +92 -0
- package/packages/angular-renderer/src/components/primitives/date-range-picker/date-range-picker.component.ts +357 -0
- package/packages/angular-renderer/src/components/primitives/icon-button/icon-button.component.html +1 -1
- package/packages/angular-renderer/src/components/primitives/multi-select/multi-select.component.html +150 -0
- package/packages/angular-renderer/src/components/primitives/multi-select/multi-select.component.scss +240 -0
- package/packages/angular-renderer/src/components/primitives/multi-select/multi-select.component.ts +362 -0
- package/packages/angular-renderer/src/components/primitives/select/select.component.html +92 -14
- package/packages/angular-renderer/src/components/primitives/select/select.component.scss +188 -13
- package/packages/angular-renderer/src/components/primitives/select/select.component.ts +242 -34
- package/packages/angular-renderer/src/components/primitives/select/selection-utils.ts +92 -0
- package/packages/angular-renderer/src/components/primitives/time-picker/time-picker.component.html +65 -0
- package/packages/angular-renderer/src/components/primitives/time-picker/time-picker.component.scss +65 -0
- package/packages/angular-renderer/src/components/primitives/time-picker/time-picker.component.ts +229 -0
- package/packages/angular-renderer/src/index.ts +6 -0
- package/packages/angular-renderer/src/lib/primitives.provider.ts +12 -0
- package/packages/cli/CHANGELOG.md +8 -0
- package/packages/cli/package.json +2 -2
- package/packages/core/CHANGELOG.md +8 -0
- package/packages/core/package.json +1 -1
- package/packages/design-tokens/CHANGELOG.md +8 -0
- package/packages/design-tokens/package.json +1 -1
- package/packages/devtools/CHANGELOG.md +14 -0
- package/packages/devtools/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/packages/devtools/package.json +3 -3
- package/packages/playground/CHANGELOG.md +8 -0
- package/packages/playground/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/packages/playground/package.json +3 -3
- package/dist/packages/playground/browser/main-D2PNGI4C.js +0 -734
package/packages/angular-renderer/src/components/primitives/time-picker/time-picker.component.html
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<div class="origo-time-picker-wrapper">
|
|
2
|
+
<input
|
|
3
|
+
type="text"
|
|
4
|
+
class="origo-time-picker__input"
|
|
5
|
+
readonly
|
|
6
|
+
inputmode="none"
|
|
7
|
+
[value]="displayValue()"
|
|
8
|
+
(click)="toggleOverlay()"
|
|
9
|
+
(keydown)="onInputKeyDown($event)"
|
|
10
|
+
[attr.aria-label]="computedAriaLabel()"
|
|
11
|
+
aria-haspopup="listbox"
|
|
12
|
+
[attr.aria-expanded]="isOpen()"
|
|
13
|
+
/>
|
|
14
|
+
|
|
15
|
+
@if (isOpen()) {
|
|
16
|
+
<div class="origo-time-picker__overlay" role="listbox" aria-label="Time Selector">
|
|
17
|
+
<div class="origo-time-picker__columns">
|
|
18
|
+
<div class="origo-time-picker__column">
|
|
19
|
+
@for (hour of hours(); track hour) {
|
|
20
|
+
<div
|
|
21
|
+
role="option"
|
|
22
|
+
class="origo-time-picker__option"
|
|
23
|
+
[class.origo-time-picker__option--selected]="isSelectedHour(hour)"
|
|
24
|
+
[attr.aria-selected]="isSelectedHour(hour)"
|
|
25
|
+
(click)="selectHour(hour)"
|
|
26
|
+
>
|
|
27
|
+
{{ pad(hour) }}
|
|
28
|
+
</div>
|
|
29
|
+
}
|
|
30
|
+
</div>
|
|
31
|
+
<div class="origo-time-picker__column">
|
|
32
|
+
@for (minute of minutes(); track minute) {
|
|
33
|
+
<div
|
|
34
|
+
role="option"
|
|
35
|
+
class="origo-time-picker__option"
|
|
36
|
+
[class.origo-time-picker__option--selected]="isSelectedMinute(minute)"
|
|
37
|
+
[attr.aria-selected]="isSelectedMinute(minute)"
|
|
38
|
+
(click)="selectMinute(minute)"
|
|
39
|
+
>
|
|
40
|
+
{{ pad(minute) }}
|
|
41
|
+
</div>
|
|
42
|
+
}
|
|
43
|
+
</div>
|
|
44
|
+
@if (is12h()) {
|
|
45
|
+
<div class="origo-time-picker__column">
|
|
46
|
+
@for (period of periods(); track period) {
|
|
47
|
+
<div
|
|
48
|
+
role="option"
|
|
49
|
+
class="origo-time-picker__option"
|
|
50
|
+
[class.origo-time-picker__option--selected]="isSelectedPeriod(period)"
|
|
51
|
+
[attr.aria-selected]="isSelectedPeriod(period)"
|
|
52
|
+
(click)="selectPeriod(period)"
|
|
53
|
+
>
|
|
54
|
+
{{ period }}
|
|
55
|
+
</div>
|
|
56
|
+
}
|
|
57
|
+
</div>
|
|
58
|
+
}
|
|
59
|
+
</div>
|
|
60
|
+
<div class="origo-time-picker__actions">
|
|
61
|
+
<button type="button" (click)="confirmTime()">OK</button>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
}
|
|
65
|
+
</div>
|
package/packages/angular-renderer/src/components/primitives/time-picker/time-picker.component.scss
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
position: relative;
|
|
4
|
+
font-family: var(--origo-typography-body-font-family);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.origo-time-picker__input {
|
|
8
|
+
width: 100%;
|
|
9
|
+
padding: var(--origo-spacing-sm) var(--origo-spacing-md);
|
|
10
|
+
border: 1px solid var(--origo-color-neutral-300);
|
|
11
|
+
border-radius: var(--origo-border-radius-md);
|
|
12
|
+
background-color: var(--origo-color-surface-default);
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.origo-time-picker__overlay {
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: calc(100% + var(--origo-spacing-xs));
|
|
19
|
+
left: 0;
|
|
20
|
+
z-index: 1000;
|
|
21
|
+
background: var(--origo-color-surface-default);
|
|
22
|
+
border: 1px solid var(--origo-color-neutral-200);
|
|
23
|
+
border-radius: var(--origo-border-radius-md);
|
|
24
|
+
box-shadow: var(--origo-shadow-md);
|
|
25
|
+
padding: var(--origo-spacing-sm);
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.origo-time-picker__columns {
|
|
31
|
+
display: flex;
|
|
32
|
+
gap: var(--origo-spacing-sm);
|
|
33
|
+
height: 200px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.origo-time-picker__column {
|
|
37
|
+
overflow-y: auto;
|
|
38
|
+
flex: 1;
|
|
39
|
+
border-right: 1px solid var(--origo-color-neutral-200);
|
|
40
|
+
}
|
|
41
|
+
.origo-time-picker__column:last-child {
|
|
42
|
+
border-right: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.origo-time-picker__option {
|
|
46
|
+
padding: var(--origo-spacing-sm);
|
|
47
|
+
text-align: center;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.origo-time-picker__option:hover {
|
|
52
|
+
background-color: var(--origo-color-neutral-100);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.origo-time-picker__option--selected {
|
|
56
|
+
background-color: var(--origo-color-primary-main);
|
|
57
|
+
color: var(--origo-color-surface-default);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.origo-time-picker__actions {
|
|
61
|
+
margin-top: var(--origo-spacing-sm);
|
|
62
|
+
text-align: right;
|
|
63
|
+
border-top: 1px solid var(--origo-color-neutral-200);
|
|
64
|
+
padding-top: var(--origo-spacing-sm);
|
|
65
|
+
}
|
package/packages/angular-renderer/src/components/primitives/time-picker/time-picker.component.ts
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
ViewEncapsulation,
|
|
5
|
+
input,
|
|
6
|
+
model,
|
|
7
|
+
signal,
|
|
8
|
+
computed,
|
|
9
|
+
inject,
|
|
10
|
+
effect,
|
|
11
|
+
untracked,
|
|
12
|
+
HostListener,
|
|
13
|
+
ElementRef,
|
|
14
|
+
} from '@angular/core';
|
|
15
|
+
import { InteractionContract } from '@origostudio/core';
|
|
16
|
+
import { OrigoAdapter } from '../../../adapters/web/adapter';
|
|
17
|
+
import { WebExperienceAdapterService } from '../../../adapters/web/experience-adapter.service';
|
|
18
|
+
|
|
19
|
+
export interface TimePickerProps {
|
|
20
|
+
format?: '12h' | '24h';
|
|
21
|
+
value?: string; // ISO 8601 UTC
|
|
22
|
+
'aria-label'?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@Component({
|
|
26
|
+
selector: 'origo-time-picker',
|
|
27
|
+
standalone: true,
|
|
28
|
+
templateUrl: './time-picker.component.html',
|
|
29
|
+
styleUrls: ['./time-picker.component.scss'],
|
|
30
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
31
|
+
encapsulation: ViewEncapsulation.ShadowDom,
|
|
32
|
+
})
|
|
33
|
+
export class TimePickerComponent implements OrigoAdapter<TimePickerProps> {
|
|
34
|
+
static readonly contractSchema = {
|
|
35
|
+
format: 'string',
|
|
36
|
+
value: 'string',
|
|
37
|
+
'aria-label': 'string',
|
|
38
|
+
permissions: 'array',
|
|
39
|
+
rules: 'array',
|
|
40
|
+
metadata: 'object',
|
|
41
|
+
};
|
|
42
|
+
static readonly strictContract = false;
|
|
43
|
+
|
|
44
|
+
contract = input.required<InteractionContract<TimePickerProps>>();
|
|
45
|
+
value = model<string | null>(null);
|
|
46
|
+
|
|
47
|
+
isOpen = signal<boolean>(false);
|
|
48
|
+
selectedHour = signal<number>(0);
|
|
49
|
+
selectedMinute = signal<number>(0);
|
|
50
|
+
selectedPeriod = signal<'AM' | 'PM'>('AM');
|
|
51
|
+
|
|
52
|
+
private experienceAdapter = inject(WebExperienceAdapterService);
|
|
53
|
+
private elementRef = inject(ElementRef);
|
|
54
|
+
|
|
55
|
+
is12h = computed(() => this.contract().props?.format === '12h');
|
|
56
|
+
computedAriaLabel = computed(() => this.contract().props?.['aria-label'] || 'Time Picker');
|
|
57
|
+
|
|
58
|
+
hours = computed(() => {
|
|
59
|
+
return this.is12h()
|
|
60
|
+
? Array.from({ length: 12 }, (_, i) => (i === 0 ? 12 : i))
|
|
61
|
+
: Array.from({ length: 24 }, (_, i) => i);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
minutes = computed(() => Array.from({ length: 60 }, (_, i) => i));
|
|
65
|
+
periods = computed(() => ['AM', 'PM'] as const);
|
|
66
|
+
|
|
67
|
+
displayValue = computed(() => {
|
|
68
|
+
const val = this.value();
|
|
69
|
+
if (!val) return '';
|
|
70
|
+
const d = this.parseSafeUTC(val);
|
|
71
|
+
if (!d) return '';
|
|
72
|
+
|
|
73
|
+
let h = d.getUTCHours();
|
|
74
|
+
const m = d.getUTCMinutes();
|
|
75
|
+
|
|
76
|
+
if (this.is12h()) {
|
|
77
|
+
const period = h >= 12 ? 'PM' : 'AM';
|
|
78
|
+
h = h % 12;
|
|
79
|
+
if (h === 0) h = 12;
|
|
80
|
+
return `${this.pad(h)}:${this.pad(m)} ${period}`;
|
|
81
|
+
}
|
|
82
|
+
return `${this.pad(h)}:${this.pad(m)}`;
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
private parseSafeUTC(timeStr: string): Date | null {
|
|
86
|
+
if (!timeStr) return null;
|
|
87
|
+
|
|
88
|
+
// Check for HH:MM format
|
|
89
|
+
const timeMatch = timeStr.trim().match(/^(\d{2}):(\d{2})/);
|
|
90
|
+
if (timeMatch && timeStr.trim().length <= 8) {
|
|
91
|
+
const d = new Date(
|
|
92
|
+
Date.UTC(1970, 0, 1, parseInt(timeMatch[1], 10), parseInt(timeMatch[2], 10), 0, 0)
|
|
93
|
+
);
|
|
94
|
+
return d;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const d = new Date(timeStr);
|
|
98
|
+
if (isNaN(d.getTime())) return null;
|
|
99
|
+
return d;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
constructor() {
|
|
103
|
+
effect(() => {
|
|
104
|
+
const val = this.contract().props?.value;
|
|
105
|
+
untracked(() => {
|
|
106
|
+
if (val === undefined || val === null) {
|
|
107
|
+
this.value.set(null);
|
|
108
|
+
this.syncInternalStateFromValue(null);
|
|
109
|
+
} else {
|
|
110
|
+
this.value.set(String(val));
|
|
111
|
+
this.syncInternalStateFromValue(String(val));
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@HostListener('document:mousedown', ['$event'])
|
|
118
|
+
onClickOutside(event: MouseEvent) {
|
|
119
|
+
if (this.isOpen() && !this.elementRef.nativeElement.contains(event.target)) {
|
|
120
|
+
this.isOpen.set(false);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@HostListener('document:keydown.escape')
|
|
125
|
+
onEscape() {
|
|
126
|
+
if (this.isOpen()) {
|
|
127
|
+
this.isOpen.set(false);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
private syncInternalStateFromValue(val: string | null) {
|
|
132
|
+
if (!val) {
|
|
133
|
+
this.selectedHour.set(this.is12h() ? 12 : 0);
|
|
134
|
+
this.selectedMinute.set(0);
|
|
135
|
+
this.selectedPeriod.set('AM');
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const d = this.parseSafeUTC(val);
|
|
140
|
+
if (d) {
|
|
141
|
+
let h = d.getUTCHours();
|
|
142
|
+
this.selectedMinute.set(d.getUTCMinutes());
|
|
143
|
+
if (this.is12h()) {
|
|
144
|
+
this.selectedPeriod.set(h >= 12 ? 'PM' : 'AM');
|
|
145
|
+
h = h % 12;
|
|
146
|
+
if (h === 0) h = 12;
|
|
147
|
+
}
|
|
148
|
+
this.selectedHour.set(h);
|
|
149
|
+
} else {
|
|
150
|
+
this.selectedHour.set(this.is12h() ? 12 : 0);
|
|
151
|
+
this.selectedMinute.set(0);
|
|
152
|
+
this.selectedPeriod.set('AM');
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
toggleOverlay() {
|
|
157
|
+
this.isOpen.update(v => !v);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
pad(n: number): string {
|
|
161
|
+
return String(n).padStart(2, '0');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
isSelectedHour(h: number) {
|
|
165
|
+
return this.selectedHour() === h;
|
|
166
|
+
}
|
|
167
|
+
isSelectedMinute(m: number) {
|
|
168
|
+
return this.selectedMinute() === m;
|
|
169
|
+
}
|
|
170
|
+
isSelectedPeriod(p: string) {
|
|
171
|
+
return this.selectedPeriod() === p;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
selectHour(h: number) {
|
|
175
|
+
this.selectedHour.set(h);
|
|
176
|
+
}
|
|
177
|
+
selectMinute(m: number) {
|
|
178
|
+
this.selectedMinute.set(m);
|
|
179
|
+
}
|
|
180
|
+
selectPeriod(p: 'AM' | 'PM') {
|
|
181
|
+
this.selectedPeriod.set(p);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
selectTime(h: number, m: number, p?: 'AM' | 'PM') {
|
|
185
|
+
this.selectedHour.set(h);
|
|
186
|
+
this.selectedMinute.set(m);
|
|
187
|
+
if (p) this.selectedPeriod.set(p);
|
|
188
|
+
this.confirmTime();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
confirmTime() {
|
|
192
|
+
let h = this.selectedHour();
|
|
193
|
+
const m = this.selectedMinute();
|
|
194
|
+
|
|
195
|
+
if (this.is12h()) {
|
|
196
|
+
const p = this.selectedPeriod();
|
|
197
|
+
if (p === 'PM' && h !== 12) h += 12;
|
|
198
|
+
else if (p === 'AM' && h === 12) h = 0;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
let year = 1970;
|
|
202
|
+
let month = 0;
|
|
203
|
+
let day = 1;
|
|
204
|
+
|
|
205
|
+
const currentVal = this.value();
|
|
206
|
+
if (currentVal) {
|
|
207
|
+
const parsed = this.parseSafeUTC(currentVal);
|
|
208
|
+
if (parsed) {
|
|
209
|
+
year = parsed.getUTCFullYear();
|
|
210
|
+
month = parsed.getUTCMonth();
|
|
211
|
+
day = parsed.getUTCDate();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const selectedDate = new Date(Date.UTC(year, month, day, h, m, 0, 0));
|
|
216
|
+
const isoString = selectedDate.toISOString();
|
|
217
|
+
|
|
218
|
+
this.value.set(isoString);
|
|
219
|
+
this.experienceAdapter.updateState(this.contract().id, 'value', isoString);
|
|
220
|
+
this.isOpen.set(false);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
onInputKeyDown(event: KeyboardEvent) {
|
|
224
|
+
if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {
|
|
225
|
+
event.preventDefault();
|
|
226
|
+
this.isOpen.set(true);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
@@ -10,6 +10,9 @@ export * from './components/primitives/button-group/button-group.component';
|
|
|
10
10
|
export * from './components/primitives/floating-action-button/floating-action-button.component';
|
|
11
11
|
export * from './devtools';
|
|
12
12
|
export * from './components/primitives/select/select.component';
|
|
13
|
+
export * from './components/primitives/multi-select/multi-select.component';
|
|
14
|
+
export * from './components/primitives/autocomplete/autocomplete.component';
|
|
15
|
+
export * from './components/primitives/combobox/combobox.component';
|
|
13
16
|
export * from './components/primitives/checkbox/checkbox.component';
|
|
14
17
|
export * from './components/primitives/radio-group/radio-group.component';
|
|
15
18
|
export * from './components/primitives/textarea/textarea.component';
|
|
@@ -25,3 +28,6 @@ export * from './components/primitives/tabs/tabs.component';
|
|
|
25
28
|
export * from './components/primitives/breadcrumbs/breadcrumbs.component';
|
|
26
29
|
export * from './adapters/web/experience-adapter.service';
|
|
27
30
|
export * from './components/primitives/input-number/input-number.component';
|
|
31
|
+
export * from './components/primitives/date-picker/date-picker.component';
|
|
32
|
+
export * from './components/primitives/time-picker/time-picker.component';
|
|
33
|
+
export * from './components/primitives/date-range-picker/date-range-picker.component';
|
|
@@ -4,6 +4,9 @@ import { IconButtonComponent } from '../components/primitives/icon-button/icon-b
|
|
|
4
4
|
import { ButtonGroupComponent } from '../components/primitives/button-group/button-group.component';
|
|
5
5
|
import { FloatingActionButtonComponent } from '../components/primitives/floating-action-button/floating-action-button.component';
|
|
6
6
|
import { SelectComponent } from '../components/primitives/select/select.component';
|
|
7
|
+
import { MultiSelectComponent } from '../components/primitives/multi-select/multi-select.component';
|
|
8
|
+
import { AutocompleteComponent } from '../components/primitives/autocomplete/autocomplete.component';
|
|
9
|
+
import { ComboboxComponent } from '../components/primitives/combobox/combobox.component';
|
|
7
10
|
import { CheckboxComponent } from '../components/primitives/checkbox/checkbox.component';
|
|
8
11
|
import { RadioGroupComponent } from '../components/primitives/radio-group/radio-group.component';
|
|
9
12
|
import { TextareaComponent } from '../components/primitives/textarea/textarea.component';
|
|
@@ -22,6 +25,9 @@ import { TextInputComponent } from '../components/primitives/text-input/text-inp
|
|
|
22
25
|
import { ButtonComponent } from '../components/primitives/button/button.component';
|
|
23
26
|
import { VBoxComponent } from '../components/primitives/vbox/vbox.component';
|
|
24
27
|
import { InputNumberComponent } from '../components/primitives/input-number/input-number.component';
|
|
28
|
+
import { DatePickerComponent } from '../components/primitives/date-picker/date-picker.component';
|
|
29
|
+
import { TimePickerComponent } from '../components/primitives/time-picker/time-picker.component';
|
|
30
|
+
import { DateRangePickerComponent } from '../components/primitives/date-range-picker/date-range-picker.component';
|
|
25
31
|
|
|
26
32
|
export function provideOrigo9Primitives(): EnvironmentProviders {
|
|
27
33
|
const registryMap = new Map<string, unknown>([
|
|
@@ -29,6 +35,9 @@ export function provideOrigo9Primitives(): EnvironmentProviders {
|
|
|
29
35
|
['ButtonGroup', ButtonGroupComponent],
|
|
30
36
|
['FloatingActionButton', FloatingActionButtonComponent],
|
|
31
37
|
['Select', SelectComponent],
|
|
38
|
+
['MultiSelect', MultiSelectComponent],
|
|
39
|
+
['Autocomplete', AutocompleteComponent],
|
|
40
|
+
['Combobox', ComboboxComponent],
|
|
32
41
|
['Checkbox', CheckboxComponent],
|
|
33
42
|
['RadioGroup', RadioGroupComponent],
|
|
34
43
|
['Textarea', TextareaComponent],
|
|
@@ -48,6 +57,9 @@ export function provideOrigo9Primitives(): EnvironmentProviders {
|
|
|
48
57
|
['Button', ButtonComponent],
|
|
49
58
|
['VBox', VBoxComponent],
|
|
50
59
|
['InputNumber', InputNumberComponent],
|
|
60
|
+
['DatePicker', DatePickerComponent],
|
|
61
|
+
['TimePicker', TimePickerComponent],
|
|
62
|
+
['DateRangePicker', DateRangePickerComponent],
|
|
51
63
|
['vbox', VBoxComponent], // For backward compatibility with 'vbox' in preview-root
|
|
52
64
|
]);
|
|
53
65
|
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 0.0.51 (2026-10-08)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for cli to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 0.0.50 (2026-10-08)
|
|
6
|
+
|
|
7
|
+
This was a version bump only for cli to align it with other projects, there were no code changes.
|
|
8
|
+
|
|
1
9
|
## 0.0.49 (2026-10-08)
|
|
2
10
|
|
|
3
11
|
This was a version bump only for cli to align it with other projects, there were no code changes.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@origostudio/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.51",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"origo": "./src/main.js"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@origostudio/core": "0.0.
|
|
12
|
+
"@origostudio/core": "0.0.51",
|
|
13
13
|
"commander": "^15.0.0",
|
|
14
14
|
"tslib": "^2.3.0"
|
|
15
15
|
},
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 0.0.51 (2026-10-08)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for core to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 0.0.50 (2026-10-08)
|
|
6
|
+
|
|
7
|
+
This was a version bump only for core to align it with other projects, there were no code changes.
|
|
8
|
+
|
|
1
9
|
## 0.0.49 (2026-10-08)
|
|
2
10
|
|
|
3
11
|
This was a version bump only for core to align it with other projects, there were no code changes.
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 0.0.51 (2026-10-08)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for design-tokens to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 0.0.50 (2026-10-08)
|
|
6
|
+
|
|
7
|
+
This was a version bump only for design-tokens to align it with other projects, there were no code changes.
|
|
8
|
+
|
|
1
9
|
## 0.0.49 (2026-10-08)
|
|
2
10
|
|
|
3
11
|
This was a version bump only for design-tokens to align it with other projects, there were no code changes.
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## 0.0.51 (2026-10-08)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for devtools to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 0.0.50 (2026-10-08)
|
|
6
|
+
|
|
7
|
+
### 🚀 Features
|
|
8
|
+
|
|
9
|
+
- add core selection control primitives including select, multi-select, combobox, and autocomplete components ([3866703](https://github.com/OrigoStudio/origo-design/commit/3866703))
|
|
10
|
+
|
|
11
|
+
### ❤️ Thank You
|
|
12
|
+
|
|
13
|
+
- Hardik Patel @hardikpatelse
|
|
14
|
+
|
|
1
15
|
## 0.0.49 (2026-10-08)
|
|
2
16
|
|
|
3
17
|
This was a version bump only for devtools to align it with other projects, there were no code changes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"4.1.11","results":[[":src/devtools-panel/app.component.spec.ts",{"duration":
|
|
1
|
+
{"version":"4.1.11","results":[[":src/devtools-panel/app.component.spec.ts",{"duration":179.4777580000009,"failed":false}]]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@origostudio/devtools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.51",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@origostudio/core": "0.0.
|
|
7
|
-
"@origostudio/cli": "0.0.
|
|
6
|
+
"@origostudio/core": "0.0.51",
|
|
7
|
+
"@origostudio/cli": "0.0.51",
|
|
8
8
|
"@angular/core": "18.1.0",
|
|
9
9
|
"@angular/common": "18.1.0"
|
|
10
10
|
},
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 0.0.51 (2026-10-08)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for playground to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 0.0.50 (2026-10-08)
|
|
6
|
+
|
|
7
|
+
This was a version bump only for playground to align it with other projects, there were no code changes.
|
|
8
|
+
|
|
1
9
|
## 0.0.49 (2026-10-08)
|
|
2
10
|
|
|
3
11
|
This was a version bump only for playground to align it with other projects, there were no code changes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"4.1.11","results":[[":src/
|
|
1
|
+
{"version":"4.1.11","results":[[":src/preview/preview-root.component.spec.ts",{"duration":511.31507599999895,"failed":false}],[":src/editor/badl-editor.component.spec.ts",{"duration":560.8525979999977,"failed":false}],[":src/workers/compiler.worker.spec.ts",{"duration":6044.724211000001,"failed":false}],[":src/editor/schema-registry.spec.ts",{"duration":39.81070399999953,"failed":false}],[":src/preview/preview.service.spec.ts",{"duration":140.87093800000002,"failed":false}],[":src/app/app.component.spec.ts",{"duration":580.886137999998,"failed":false}],[":src/preview/preview-pane.component.spec.ts",{"duration":345.5656220000019,"failed":false}]]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@origostudio/playground",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.51",
|
|
4
4
|
"private": true,
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@origostudio/core": "0.0.
|
|
7
|
-
"@origostudio/cli": "0.0.
|
|
6
|
+
"@origostudio/core": "0.0.51",
|
|
7
|
+
"@origostudio/cli": "0.0.51"
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"@angular/common": "^18.0.0",
|