@acorex/components 20.7.37 → 20.7.39
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/calendar/index.d.ts +11 -4
- package/data-pager/index.d.ts +6 -25
- package/datetime-box/index.d.ts +2 -3
- package/datetime-input/index.d.ts +2 -2
- package/datetime-picker/index.d.ts +3 -3
- package/fesm2022/acorex-components-calendar.mjs +34 -17
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-data-pager.mjs +44 -53
- package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +6 -18
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-input.mjs +9 -17
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +27 -30
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler.mjs +130 -57
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-tree-view.mjs +272 -13
- package/fesm2022/acorex-components-tree-view.mjs.map +1 -1
- package/package.json +18 -18
- package/scheduler/index.d.ts +20 -2
- package/tree-view/index.d.ts +43 -2
|
@@ -5,7 +5,7 @@ import { AXLocaleService } from '@acorex/core/locale';
|
|
|
5
5
|
import { AXPlatform } from '@acorex/core/platform';
|
|
6
6
|
import { getWordBoundsAtPosition } from '@acorex/core/utils';
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { inject, signal, input, linkedSignal, viewChild, output, effect, untracked, forwardRef, HostBinding, HostListener, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
8
|
+
import { inject, signal, input, computed, linkedSignal, viewChild, output, effect, untracked, forwardRef, HostBinding, HostListener, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
9
9
|
import * as i1 from '@angular/forms';
|
|
10
10
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
11
11
|
import { map } from 'rxjs';
|
|
@@ -107,7 +107,7 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
|
|
|
107
107
|
* @description The calendar type to use for the datetime input.
|
|
108
108
|
*/
|
|
109
109
|
this.calendar = input(null, ...(ngDevMode ? [{ debugName: "calendar" }] : []));
|
|
110
|
-
this._calendarSystem =
|
|
110
|
+
this._calendarSystem = computed(() => this.calendar() ?? this.localeService.activeProfile().calendar.system, ...(ngDevMode ? [{ debugName: "_calendarSystem" }] : []));
|
|
111
111
|
this._activePart = signal(null, ...(ngDevMode ? [{ debugName: "_activePart" }] : []));
|
|
112
112
|
// TODO: fix this
|
|
113
113
|
// #effect = effect(() => {
|
|
@@ -127,22 +127,14 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
|
|
|
127
127
|
*/
|
|
128
128
|
this.onClick = output();
|
|
129
129
|
this.picker = input('datetime', ...(ngDevMode ? [{ debugName: "picker" }] : []));
|
|
130
|
-
this.
|
|
130
|
+
this._resolvedFormat = computed(() => this.format() ?? this.localeService.activeProfile().formats[this.picker()]?.short ?? '', ...(ngDevMode ? [{ debugName: "_resolvedFormat" }] : []));
|
|
131
131
|
/**
|
|
132
132
|
* @deprecated use locale & mode instead
|
|
133
133
|
*/
|
|
134
134
|
this.format = input(...(ngDevMode ? [undefined, { debugName: "format" }] : []));
|
|
135
135
|
this.#effect = effect(() => {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (!this.format()) {
|
|
139
|
-
this._format.set(this.format() ?? profile.formats[this.picker()]?.short ?? '');
|
|
140
|
-
}
|
|
141
|
-
//
|
|
142
|
-
if (!this.calendar()) {
|
|
143
|
-
this._calendarSystem.set(profile.calendar.system);
|
|
144
|
-
}
|
|
145
|
-
//
|
|
136
|
+
this._resolvedFormat();
|
|
137
|
+
this._calendarSystem();
|
|
146
138
|
this._detectParts();
|
|
147
139
|
untracked(() => {
|
|
148
140
|
this._updateText();
|
|
@@ -158,7 +150,7 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
|
|
|
158
150
|
Object.values(this._editingParts).forEach((e) => {
|
|
159
151
|
e.enabled = false;
|
|
160
152
|
});
|
|
161
|
-
const formatParts = this.
|
|
153
|
+
const formatParts = this._resolvedFormat().split(/[^a-zA-Z]+/);
|
|
162
154
|
formatParts.forEach((f) => {
|
|
163
155
|
const found = Object.values(this._editingParts).find((c) => c.placeholders.some((d) => d == f));
|
|
164
156
|
if (found) {
|
|
@@ -178,7 +170,7 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
|
|
|
178
170
|
*/
|
|
179
171
|
_getOrderedParts() {
|
|
180
172
|
// TODO: better spliter format
|
|
181
|
-
const formatParts = this.
|
|
173
|
+
const formatParts = this._resolvedFormat().split(/[^a-zA-Z]+/);
|
|
182
174
|
const result = [];
|
|
183
175
|
formatParts.forEach((f) => {
|
|
184
176
|
const found = Object.values(this._editingParts).find((c) => c.placeholders.some((d) => d == f));
|
|
@@ -197,7 +189,7 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
|
|
|
197
189
|
* @ignore
|
|
198
190
|
*/
|
|
199
191
|
_updateText() {
|
|
200
|
-
let text = this.
|
|
192
|
+
let text = this._resolvedFormat();
|
|
201
193
|
//
|
|
202
194
|
Object.values(this._editingParts).forEach((part) => {
|
|
203
195
|
if (this._activePart() == part.key) {
|
|
@@ -210,7 +202,7 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
|
|
|
210
202
|
}
|
|
211
203
|
}
|
|
212
204
|
});
|
|
213
|
-
this._editingText.set(text == this.
|
|
205
|
+
this._editingText.set(text == this._resolvedFormat() ? '' : text);
|
|
214
206
|
if (this._activePart()) {
|
|
215
207
|
this._highlightActivePart();
|
|
216
208
|
}
|