@acorex/components 20.1.38 → 20.1.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.
@@ -1,10 +1,16 @@
1
+ import * as i1 from '@acorex/components/label';
2
+ import { AXLabelModule } from '@acorex/components/label';
3
+ import * as i2 from '@acorex/core/translation';
4
+ import { AXTranslationModule } from '@acorex/core/translation';
5
+ import * as i9 from '@angular/common';
6
+ import { DatePipe, AsyncPipe, CommonModule } from '@angular/common';
7
+ import * as i0 from '@angular/core';
8
+ import { Injectable, input, inject, signal, computed, effect, Component, model, output, untracked } from '@angular/core';
1
9
  import * as i8 from '@acorex/components/button';
2
10
  import { AXButtonModule } from '@acorex/components/button';
3
- import * as i2 from '@acorex/components/datetime-box';
11
+ import * as i2$1 from '@acorex/components/datetime-box';
4
12
  import { AXDateTimeBoxModule } from '@acorex/components/datetime-box';
5
13
  import { AXFormModule } from '@acorex/components/form';
6
- import * as i6 from '@acorex/components/label';
7
- import { AXLabelModule } from '@acorex/components/label';
8
14
  import * as i4 from '@acorex/components/number-box';
9
15
  import { AXNumberBoxModule } from '@acorex/components/number-box';
10
16
  import * as i7 from '@acorex/components/search-box';
@@ -13,15 +19,143 @@ import * as i5 from '@acorex/components/select-box';
13
19
  import { AXSelectBoxModule } from '@acorex/components/select-box';
14
20
  import * as i3 from '@acorex/components/selection-list';
15
21
  import { AXSelectionListModule } from '@acorex/components/selection-list';
16
- import * as i10 from '@acorex/core/translation';
17
- import { AXTranslationModule } from '@acorex/core/translation';
18
- import * as i9 from '@angular/common';
19
- import { CommonModule } from '@angular/common';
20
- import * as i0 from '@angular/core';
21
- import { Injectable, model, output, signal, computed, inject, effect, untracked, Component } from '@angular/core';
22
- import * as i1 from '@angular/forms';
22
+ import * as i1$1 from '@angular/forms';
23
23
  import { FormsModule } from '@angular/forms';
24
24
 
25
+ class AXRruleService {
26
+ async rruleFromOptions(options) {
27
+ // eslint-disable-next-line @nx/enforce-module-boundaries
28
+ const { RRule } = await import('rrule');
29
+ return new RRule(options);
30
+ }
31
+ async rruleFromString(ruleString) {
32
+ // eslint-disable-next-line @nx/enforce-module-boundaries
33
+ const { RRule } = await import('rrule');
34
+ return RRule.fromString(ruleString);
35
+ }
36
+ async rruleFromText(ruleText) {
37
+ // eslint-disable-next-line @nx/enforce-module-boundaries
38
+ const { RRule } = await import('rrule');
39
+ return RRule.fromText(ruleText);
40
+ }
41
+ rruleToOptions(rule) {
42
+ return rule.options;
43
+ }
44
+ rruleToString(rule) {
45
+ return rule.toString();
46
+ }
47
+ rruleToText(rule) {
48
+ return rule.toText();
49
+ }
50
+ rruleGetAll(rule, limit = 500) {
51
+ return rule.all((d, l) => l < limit);
52
+ }
53
+ rruleGetBetween(rule, after, before, inclusive = false) {
54
+ return rule.between(after, before, inclusive);
55
+ }
56
+ rruleGetBefore(rule, date, inclusive = false) {
57
+ return rule.before(date, inclusive);
58
+ }
59
+ rruleGetAfter(rule, date, inclusive = false) {
60
+ return rule.after(date, inclusive);
61
+ }
62
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXRruleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
63
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXRruleService, providedIn: 'root' }); }
64
+ }
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXRruleService, decorators: [{
66
+ type: Injectable,
67
+ args: [{
68
+ providedIn: 'root',
69
+ }]
70
+ }] });
71
+
72
+ class AXRrulePreviewComponent {
73
+ constructor() {
74
+ this.value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
75
+ this.repeat = input(100, ...(ngDevMode ? [{ debugName: "repeat" }] : []));
76
+ this.format = input('yyyy-MM-dd HH:mm:ss', ...(ngDevMode ? [{ debugName: "format" }] : []));
77
+ this.rruleService = inject(AXRruleService);
78
+ this.rrule = signal(null, ...(ngDevMode ? [{ debugName: "rrule" }] : []));
79
+ this.timeZone = signal(null, ...(ngDevMode ? [{ debugName: "timeZone" }] : []));
80
+ this.text = computed(() => (this.rrule() ? this.rruleService.rruleToText(this.rrule()) : ''), ...(ngDevMode ? [{ debugName: "text" }] : []));
81
+ this.string = computed(() => (this.rrule() ? this.rruleService.rruleToString(this.rrule()) : ''), ...(ngDevMode ? [{ debugName: "string" }] : []));
82
+ this.dates = computed(() => (this.rrule() ? this.rruleService.rruleGetAll(this.rrule(), this.repeat()) : []), ...(ngDevMode ? [{ debugName: "dates" }] : []));
83
+ this.options = computed(() => (this.rrule() ? this.rruleService.rruleToOptions(this.rrule()) : {}), ...(ngDevMode ? [{ debugName: "options" }] : []));
84
+ this.eff = effect(async () => {
85
+ if (this.value()) {
86
+ this.rrule.set(await this.rruleService.rruleFromString(this.value()));
87
+ }
88
+ }, ...(ngDevMode ? [{ debugName: "eff" }] : []));
89
+ }
90
+ ngOnInit() {
91
+ this.timeZone.set(Intl.DateTimeFormat().resolvedOptions().timeZone);
92
+ }
93
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXRrulePreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
94
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: AXRrulePreviewComponent, isStandalone: true, selector: "ax-rrule-preview", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, repeat: { classPropertyName: "repeat", publicName: "repeat", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
95
+ <div class="ax-flex ax-flex-col ax-gap-4 ax-rounded-md ax-border ax-p-4">
96
+ <div>
97
+ <ax-label>{{ 'rrule.text' | translate: { scope: 'common' } | async }}</ax-label>
98
+ <code class="ax-mt-2 ax-block ax-rounded ax-bg-surface ax-p-2">
99
+ {{ text() }}
100
+ </code>
101
+ </div>
102
+ <div>
103
+ <ax-label>{{ 'rrule.string' | translate: { scope: 'common' } | async }}</ax-label>
104
+ <code class="ax-mt-2 ax-block ax-rounded ax-bg-surface ax-p-2">
105
+ {{ string() }}
106
+ </code>
107
+ </div>
108
+ <div>
109
+ <ax-label>{{
110
+ 'rrule.occurrences' | translate: { scope: 'common', params: { repeat: repeat() } } | async
111
+ }}</ax-label>
112
+ <div class="ax-mt-2 ax-max-h-64 ax-overflow-y-auto">
113
+ @for (date of dates(); track $index) {
114
+ <code class="ax-block ax-bg-surface ax-p-1 even:ax-bg-lighter">
115
+ {{ date | date: format() : timeZone() }}
116
+ </code>
117
+ }
118
+ </div>
119
+ </div>
120
+ </div>
121
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i1.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }] }); }
122
+ }
123
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXRrulePreviewComponent, decorators: [{
124
+ type: Component,
125
+ args: [{
126
+ selector: 'ax-rrule-preview',
127
+ template: `
128
+ <div class="ax-flex ax-flex-col ax-gap-4 ax-rounded-md ax-border ax-p-4">
129
+ <div>
130
+ <ax-label>{{ 'rrule.text' | translate: { scope: 'common' } | async }}</ax-label>
131
+ <code class="ax-mt-2 ax-block ax-rounded ax-bg-surface ax-p-2">
132
+ {{ text() }}
133
+ </code>
134
+ </div>
135
+ <div>
136
+ <ax-label>{{ 'rrule.string' | translate: { scope: 'common' } | async }}</ax-label>
137
+ <code class="ax-mt-2 ax-block ax-rounded ax-bg-surface ax-p-2">
138
+ {{ string() }}
139
+ </code>
140
+ </div>
141
+ <div>
142
+ <ax-label>{{
143
+ 'rrule.occurrences' | translate: { scope: 'common', params: { repeat: repeat() } } | async
144
+ }}</ax-label>
145
+ <div class="ax-mt-2 ax-max-h-64 ax-overflow-y-auto">
146
+ @for (date of dates(); track $index) {
147
+ <code class="ax-block ax-bg-surface ax-p-1 even:ax-bg-lighter">
148
+ {{ date | date: format() : timeZone() }}
149
+ </code>
150
+ }
151
+ </div>
152
+ </div>
153
+ </div>
154
+ `,
155
+ imports: [AXLabelModule, DatePipe, AXTranslationModule, AsyncPipe],
156
+ }]
157
+ }] });
158
+
25
159
  const freqs = [
26
160
  { text: 'Yearly', value: 0 },
27
161
  { text: 'Monthly', value: 1 },
@@ -70,53 +204,6 @@ const setpos = [
70
204
  ...Array.from({ length: 366 }, (_, i) => i + 1),
71
205
  ];
72
206
 
73
- class AXRruleService {
74
- async rruleFromOptions(options) {
75
- // eslint-disable-next-line @nx/enforce-module-boundaries
76
- const { RRule } = await import('rrule');
77
- return new RRule(options);
78
- }
79
- async rruleFromString(ruleString) {
80
- // eslint-disable-next-line @nx/enforce-module-boundaries
81
- const { RRule } = await import('rrule');
82
- return RRule.fromString(ruleString);
83
- }
84
- async rruleFromText(ruleText) {
85
- // eslint-disable-next-line @nx/enforce-module-boundaries
86
- const { RRule } = await import('rrule');
87
- return RRule.fromText(ruleText);
88
- }
89
- rruleToOptions(rule) {
90
- return rule.options;
91
- }
92
- rruleToString(rule) {
93
- return rule.toString();
94
- }
95
- rruleToText(rule) {
96
- return rule.toText();
97
- }
98
- rruleGetAll(rule, limit = 500) {
99
- return rule.all((d, l) => l < limit);
100
- }
101
- rruleGetBetween(rule, after, before, inclusive = false) {
102
- return rule.between(after, before, inclusive);
103
- }
104
- rruleGetBefore(rule, date, inclusive = false) {
105
- return rule.before(date, inclusive);
106
- }
107
- rruleGetAfter(rule, date, inclusive = false) {
108
- return rule.after(date, inclusive);
109
- }
110
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXRruleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
111
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXRruleService, providedIn: 'root' }); }
112
- }
113
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXRruleService, decorators: [{
114
- type: Injectable,
115
- args: [{
116
- providedIn: 'root',
117
- }]
118
- }] });
119
-
120
207
  const defaultOptions = {
121
208
  freq: 2,
122
209
  dtstart: null,
@@ -166,45 +253,83 @@ class AXRruleComponent {
166
253
  // public all = computed(() => this.rruleService.rruleGetAll(this.rrule()));
167
254
  this.rruleService = inject(AXRruleService);
168
255
  this._isUpdating = false;
169
- this.#valueEffect = effect(async () => {
170
- const value = this.value();
171
- console.log('valueEffect', value);
172
- if (value) {
173
- if (this._isUpdating) {
174
- this._isUpdating = false;
175
- return;
256
+ this._applyToken = 0;
257
+ this.#valueEffect = effect(() => {
258
+ const incoming = this.value();
259
+ if (this._isUpdating) {
260
+ this._isUpdating = false;
261
+ return;
262
+ }
263
+ this._scheduleApplyIncoming(incoming);
264
+ }, ...(ngDevMode ? [{ debugName: "#valueEffect" }] : []));
265
+ }
266
+ #valueEffect;
267
+ _scheduleApplyIncoming(incoming) {
268
+ const token = ++this._applyToken;
269
+ // Defer to microtask to avoid doing async work directly inside effect
270
+ Promise.resolve().then(() => this._applyIncomingAsync(incoming, token));
271
+ }
272
+ async _applyIncomingAsync(incoming, token) {
273
+ try {
274
+ let rrule;
275
+ let newOptions;
276
+ if (incoming) {
277
+ if (typeof incoming === 'string') {
278
+ rrule = await this.rruleService.rruleFromString(incoming);
279
+ newOptions = this._clearOptions({ ...rrule.options }, incoming);
280
+ }
281
+ else {
282
+ rrule = await this.rruleService.rruleFromOptions(incoming);
283
+ newOptions = { ...rrule.options };
176
284
  }
177
- untracked(async () => {
178
- if (typeof value === 'string') {
179
- const rrule = await this.rruleService.rruleFromString(value);
180
- this.rrule.set(rrule);
181
- const newOptions = this._clearOptions({ ...rrule.options }, value);
182
- this.options.set(newOptions);
183
- }
184
- else {
185
- const rrule = await this.rruleService.rruleFromOptions(value);
186
- this.rrule.set(rrule);
187
- this.options.set({ ...rrule.options });
188
- }
189
- });
190
285
  }
191
286
  else {
192
- const rrule = await this.rruleService.rruleFromString(defaultRrule);
287
+ rrule = await this.rruleService.rruleFromString(defaultRrule);
288
+ newOptions = this._clearOptions({ ...rrule.options }, defaultRrule);
289
+ }
290
+ // Only apply the latest scheduled update
291
+ if (token !== this._applyToken)
292
+ return;
293
+ untracked(() => {
193
294
  this.rrule.set(rrule);
194
- const newOptions = this._clearOptions({ ...rrule.options }, defaultRrule);
195
295
  this.options.set(newOptions);
296
+ this._emitAll();
297
+ });
298
+ }
299
+ catch {
300
+ // Swallow errors to avoid breaking the reactive graph; consider surfacing via output events if needed
301
+ }
302
+ }
303
+ _emitAll() {
304
+ this.rruleChange.emit(this.rrule());
305
+ this.optionsChange.emit(this.options());
306
+ this.stringChange.emit(this.string());
307
+ this.textChange.emit(this.text());
308
+ }
309
+ _areOptionValuesEqual(a, b) {
310
+ if (a === b)
311
+ return true;
312
+ if (a == null || b == null)
313
+ return a === b;
314
+ // Compare Date
315
+ if (a instanceof Date && b instanceof Date)
316
+ return a.getTime() === b.getTime();
317
+ // Compare arrays of primitives
318
+ if (Array.isArray(a) && Array.isArray(b)) {
319
+ if (a.length !== b.length)
320
+ return false;
321
+ for (let i = 0; i < a.length; i++) {
322
+ if (a[i] !== b[i])
323
+ return false;
196
324
  }
197
- this.rruleChange.emit(this.rrule());
198
- this.optionsChange.emit(this.options());
199
- this.stringChange.emit(this.string());
200
- this.textChange.emit(this.text());
201
- }, ...(ngDevMode ? [{ debugName: "#valueEffect" }] : []));
325
+ return true;
326
+ }
327
+ return false;
202
328
  }
203
- #valueEffect;
204
329
  _clearOptions(options, rule) {
205
330
  const upperCaseRule = rule.toUpperCase();
206
331
  if (!upperCaseRule.includes('DTSTART')) {
207
- options.dtstart = new Date();
332
+ options.dtstart = this.options().dtstart ?? new Date();
208
333
  }
209
334
  if (!upperCaseRule.includes('BYHOUR')) {
210
335
  options.byhour = [];
@@ -225,15 +350,16 @@ class AXRruleComponent {
225
350
  options.byweekday = [];
226
351
  }
227
352
  if (!upperCaseRule.includes('TZID')) {
228
- const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
229
- options.tzid = userTimeZone;
353
+ const currentTz = this.options().tzid;
354
+ const userTimeZone = Intl?.DateTimeFormat?.().resolvedOptions?.().timeZone;
355
+ options.tzid = currentTz ?? userTimeZone ?? null;
230
356
  }
231
357
  return options;
232
358
  }
233
359
  async updateOption(key, value) {
234
- if (this.options()[key] === value)
360
+ const current = this.options()[key];
361
+ if (this._areOptionValuesEqual(current, value))
235
362
  return;
236
- console.log('updateOption', key, value);
237
363
  this.options.update((opts) => ({ ...opts, [key]: value }));
238
364
  const newRrule = await this.rruleService.rruleFromOptions(this.options());
239
365
  this.rrule.set(newRrule);
@@ -244,10 +370,7 @@ class AXRruleComponent {
244
370
  else {
245
371
  this.value.set(this.options());
246
372
  }
247
- this.rruleChange.emit(newRrule);
248
- this.optionsChange.emit(this.options());
249
- this.stringChange.emit(this.string());
250
- this.textChange.emit(this.text());
373
+ this._emitAll();
251
374
  }
252
375
  async resetOptions() {
253
376
  this.options.set({ ...defaultOptions });
@@ -260,13 +383,10 @@ class AXRruleComponent {
260
383
  else {
261
384
  this.value.set(this.options());
262
385
  }
263
- this.rruleChange.emit(newRrule);
264
- this.optionsChange.emit(this.options());
265
- this.stringChange.emit(this.string());
266
- this.textChange.emit(this.text());
386
+ this._emitAll();
267
387
  }
268
388
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXRruleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
269
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.4", type: AXRruleComponent, isStandalone: true, selector: "ax-rrule", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", rruleChange: "rruleChange", optionsChange: "optionsChange", stringChange: "stringChange", textChange: "textChange" }, ngImport: i0, template: "<div class=\"ax-rrule-container ax-grid ax-grid-cols-1 ax-gap-4 md:ax-grid-cols-2 lg:ax-grid-cols-3\">\n <!-- General -->\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-rounded-md ax-border ax-p-4\">\n <div class=\"ax-text-lg ax-font-semibold\">{{ 'rrule.general' | translate: { scope: 'common' } | async }}</div>\n\n <div>\n <ax-label>{{ 'rrule.freq' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-selection-list\n valueField=\"value\"\n textField=\"text\"\n name=\"freq\"\n [items]=\"freqs\"\n [ngModel]=\"options().freq\"\n (ngModelChange)=\"updateOption('freq', $event)\"\n ></ax-selection-list>\n </div>\n\n <div>\n <ax-label>{{ 'rrule.dtstart' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-datetime-box\n name=\"dtstart\"\n [ngModel]=\"options().dtstart\"\n (ngModelChange)=\"updateOption('dtstart', $event)\"\n ></ax-datetime-box>\n </div>\n\n <div>\n <ax-label>{{ 'rrule.until' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-datetime-box\n name=\"until\"\n [ngModel]=\"options().until\"\n (ngModelChange)=\"updateOption('until', $event)\"\n ></ax-datetime-box>\n </div>\n\n <div>\n <ax-label>{{ 'rrule.count' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-number-box\n name=\"count\"\n [ngModel]=\"options().count\"\n (ngModelChange)=\"updateOption('count', $event)\"\n [minValue]=\"1\"\n ></ax-number-box>\n </div>\n\n <div>\n <ax-label>{{ 'rrule.interval' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-number-box\n name=\"interval\"\n [ngModel]=\"options().interval\"\n (ngModelChange)=\"updateOption('interval', $event)\"\n [minValue]=\"1\"\n ></ax-number-box>\n </div>\n\n <div>\n <ax-label>{{ 'rrule.tzid' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"tzid\"\n [dataSource]=\"timezones\"\n [ngModel]=\"options().tzid\"\n (ngModelChange)=\"updateOption('tzid', $event)\"\n >\n <ax-search-box></ax-search-box>\n </ax-select-box>\n </div>\n </div>\n\n <!-- By Weekday -->\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-rounded-md ax-border ax-p-4\">\n <div class=\"ax-text-lg ax-font-semibold\">{{ 'rrule.by-weekday' | translate: { scope: 'common' } | async }}</div>\n <div>\n <ax-label>{{ 'rrule.wkst' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-selection-list\n valueField=\"value\"\n textField=\"text\"\n name=\"wkst\"\n [items]=\"weekdays\"\n [ngModel]=\"options().wkst\"\n (ngModelChange)=\"updateOption('wkst', $event)\"\n ></ax-selection-list>\n </div>\n <div>\n <ax-label>{{ 'rrule.by-weekday-rule' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-selection-list\n valueField=\"value\"\n textField=\"text\"\n name=\"byweekday\"\n [items]=\"weekdays\"\n multiple=\"true\"\n [ngModel]=\"options().byweekday\"\n (ngModelChange)=\"updateOption('byweekday', $event)\"\n ></ax-selection-list>\n </div>\n </div>\n\n <!-- By Month -->\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-rounded-md ax-border ax-p-4\">\n <div class=\"ax-text-lg ax-font-semibold\">{{ 'rrule.by-month' | translate: { scope: 'common' } | async }}</div>\n <div>\n <ax-label>{{ 'rrule.by-month-rule' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-selection-list\n valueField=\"value\"\n textField=\"text\"\n name=\"bymonth\"\n [items]=\"months\"\n multiple=\"true\"\n [ngModel]=\"options().bymonth\"\n (ngModelChange)=\"updateOption('bymonth', $event)\"\n ></ax-selection-list>\n </div>\n <div>\n <ax-label>{{ 'rrule.by-month-day' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"bymonthday\"\n [dataSource]=\"monthdays\"\n multiple=\"true\"\n [ngModel]=\"options().bymonthday\"\n (ngModelChange)=\"updateOption('bymonthday', $event)\"\n >\n </ax-select-box>\n </div>\n <!-- <div>\n <ax-label>By Negative Month Day (BYNMONTHDAY)</ax-label>\n <ax-select-box\n name=\"bynmonthday\"\n [dataSource]=\"nmonthdays\"\n multiple=\"true\"\n [ngModel]=\"options().bynmonthday\"\n (ngModelChange)=\"updateOption('bynmonthday', $event)\"\n >\n </ax-select-box>\n </div> -->\n </div>\n\n <!-- By Year -->\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-rounded-md ax-border ax-p-4\">\n <div class=\"ax-text-lg ax-font-semibold\">{{ 'rrule.by-year' | translate: { scope: 'common' } | async }}</div>\n <div>\n <ax-label>{{ 'rrule.by-year-day' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"byyearday\"\n [dataSource]=\"yeardays\"\n multiple=\"true\"\n [ngModel]=\"options().byyearday\"\n (ngModelChange)=\"updateOption('byyearday', $event)\"\n >\n </ax-select-box>\n </div>\n <div>\n <ax-label>{{ 'rrule.by-week-no' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"byweekno\"\n [dataSource]=\"weeknos\"\n multiple=\"true\"\n [ngModel]=\"options().byweekno\"\n (ngModelChange)=\"updateOption('byweekno', $event)\"\n >\n </ax-select-box>\n </div>\n </div>\n\n <!-- By Time -->\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-rounded-md ax-border ax-p-4\">\n <div class=\"ax-text-lg ax-font-semibold\">{{ 'rrule.by-time' | translate: { scope: 'common' } | async }}</div>\n <div>\n <ax-label>{{ 'rrule.by-hour' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"byhour\"\n [dataSource]=\"hours\"\n multiple=\"true\"\n [ngModel]=\"options().byhour\"\n (ngModelChange)=\"updateOption('byhour', $event)\"\n >\n </ax-select-box>\n </div>\n <div>\n <ax-label>{{ 'rrule.by-minute' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"byminute\"\n [dataSource]=\"minutes\"\n multiple=\"true\"\n [ngModel]=\"options().byminute\"\n (ngModelChange)=\"updateOption('byminute', $event)\"\n >\n </ax-select-box>\n </div>\n <div>\n <ax-label>{{ 'rrule.by-second' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"bysecond\"\n [dataSource]=\"seconds\"\n multiple=\"true\"\n [ngModel]=\"options().bysecond\"\n (ngModelChange)=\"updateOption('bysecond', $event)\"\n >\n </ax-select-box>\n </div>\n </div>\n\n <!-- Advanced -->\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-rounded-md ax-border ax-p-4\">\n <div class=\"ax-text-lg ax-font-semibold\">{{ 'rrule.advanced' | translate: { scope: 'common' } | async }}</div>\n <div>\n <ax-label>{{ 'rrule.by-set-pos' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"bysetpos\"\n [dataSource]=\"setpos\"\n multiple=\"true\"\n [ngModel]=\"options().bysetpos\"\n (ngModelChange)=\"updateOption('bysetpos', $event)\"\n [disabled]=\"true\"\n >\n </ax-select-box>\n </div>\n </div>\n</div>\n\n<div class=\"ax-flex ax-justify-end ax-py-4\">\n <ax-button [text]=\"'rrule.reset' | translate: { scope: 'common' } | async\" (click)=\"resetOptions()\"></ax-button>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXDateTimeBoxModule }, { kind: "component", type: i2.AXDateTimeBoxComponent, selector: "ax-datetime-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "depth", "id", "type", "look", "holidayDates", "allowTyping", "picker", "calendar", "weekend", "weekdays", "format"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "onOpened", "onClosed", "readonlyChange", "disabledChange", "formatChange"] }, { kind: "ngmodule", type: AXSelectionListModule }, { kind: "component", type: i3.AXSelectionListComponent, selector: "ax-selection-list", inputs: ["id", "name", "disabled", "readonly", "tabIndex", "size", "value", "valueField", "textField", "disabledField", "readonlyField", "multiple", "direction", "customTemplate", "showControl", "items", "look"], outputs: ["onValueChanged", "onBlur", "onFocus"] }, { kind: "ngmodule", type: AXNumberBoxModule }, { kind: "component", type: i4.AXNumberBoxComponent, selector: "ax-number-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "type", "changeOnScroll", "allDigits", "thousandsSeparator", "padDecimalZeros", "step", "decimals", "decimalStep", "showSpinButtons", "minValue", "maxValue", "class"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i5.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed", "onItemSelected", "onItemClick"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i6.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i7.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i8.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i9.AsyncPipe, name: "async" }, { kind: "pipe", type: i10.AXTranslatorPipe, name: "translate" }] }); }
389
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.4", type: AXRruleComponent, isStandalone: true, selector: "ax-rrule", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", rruleChange: "rruleChange", optionsChange: "optionsChange", stringChange: "stringChange", textChange: "textChange" }, ngImport: i0, template: "<div class=\"ax-rrule-container ax-grid ax-grid-cols-1 ax-gap-4 md:ax-grid-cols-2 lg:ax-grid-cols-3\">\n <!-- General -->\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-rounded-md ax-border ax-p-4\">\n <div class=\"ax-text-lg ax-font-semibold\">{{ 'rrule.general' | translate: { scope: 'common' } | async }}</div>\n\n <div>\n <ax-label>{{ 'rrule.freq' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-selection-list\n valueField=\"value\"\n textField=\"text\"\n name=\"freq\"\n [items]=\"freqs\"\n [ngModel]=\"options().freq\"\n (ngModelChange)=\"updateOption('freq', $event)\"\n ></ax-selection-list>\n </div>\n\n <div>\n <ax-label>{{ 'rrule.dtstart' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-datetime-box\n name=\"dtstart\"\n [ngModel]=\"options().dtstart\"\n (ngModelChange)=\"updateOption('dtstart', $event)\"\n ></ax-datetime-box>\n </div>\n\n <div>\n <ax-label>{{ 'rrule.until' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-datetime-box\n name=\"until\"\n [ngModel]=\"options().until\"\n (ngModelChange)=\"updateOption('until', $event)\"\n ></ax-datetime-box>\n </div>\n\n <div>\n <ax-label>{{ 'rrule.count' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-number-box\n name=\"count\"\n [ngModel]=\"options().count\"\n (ngModelChange)=\"updateOption('count', $event)\"\n [minValue]=\"1\"\n ></ax-number-box>\n </div>\n\n <div>\n <ax-label>{{ 'rrule.interval' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-number-box\n name=\"interval\"\n [ngModel]=\"options().interval\"\n (ngModelChange)=\"updateOption('interval', $event)\"\n [minValue]=\"1\"\n ></ax-number-box>\n </div>\n\n <div>\n <ax-label>{{ 'rrule.tzid' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"tzid\"\n [dataSource]=\"timezones\"\n [ngModel]=\"options().tzid\"\n (ngModelChange)=\"updateOption('tzid', $event)\"\n >\n <ax-search-box></ax-search-box>\n </ax-select-box>\n </div>\n </div>\n\n <!-- By Weekday -->\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-rounded-md ax-border ax-p-4\">\n <div class=\"ax-text-lg ax-font-semibold\">{{ 'rrule.by-weekday' | translate: { scope: 'common' } | async }}</div>\n <div>\n <ax-label>{{ 'rrule.wkst' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-selection-list\n valueField=\"value\"\n textField=\"text\"\n name=\"wkst\"\n [items]=\"weekdays\"\n [ngModel]=\"options().wkst\"\n (ngModelChange)=\"updateOption('wkst', $event)\"\n ></ax-selection-list>\n </div>\n <div>\n <ax-label>{{ 'rrule.by-weekday-rule' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-selection-list\n valueField=\"value\"\n textField=\"text\"\n name=\"byweekday\"\n [items]=\"weekdays\"\n multiple=\"true\"\n [ngModel]=\"options().byweekday\"\n (ngModelChange)=\"updateOption('byweekday', $event)\"\n ></ax-selection-list>\n </div>\n </div>\n\n <!-- By Month -->\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-rounded-md ax-border ax-p-4\">\n <div class=\"ax-text-lg ax-font-semibold\">{{ 'rrule.by-month' | translate: { scope: 'common' } | async }}</div>\n <div>\n <ax-label>{{ 'rrule.by-month-rule' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-selection-list\n valueField=\"value\"\n textField=\"text\"\n name=\"bymonth\"\n [items]=\"months\"\n multiple=\"true\"\n [ngModel]=\"options().bymonth\"\n (ngModelChange)=\"updateOption('bymonth', $event)\"\n ></ax-selection-list>\n </div>\n <div>\n <ax-label>{{ 'rrule.by-month-day' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"bymonthday\"\n [dataSource]=\"monthdays\"\n multiple=\"true\"\n [ngModel]=\"options().bymonthday\"\n (ngModelChange)=\"updateOption('bymonthday', $event)\"\n >\n </ax-select-box>\n </div>\n <!-- <div>\n <ax-label>By Negative Month Day (BYNMONTHDAY)</ax-label>\n <ax-select-box\n name=\"bynmonthday\"\n [dataSource]=\"nmonthdays\"\n multiple=\"true\"\n [ngModel]=\"options().bynmonthday\"\n (ngModelChange)=\"updateOption('bynmonthday', $event)\"\n >\n </ax-select-box>\n </div> -->\n </div>\n\n <!-- By Year -->\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-rounded-md ax-border ax-p-4\">\n <div class=\"ax-text-lg ax-font-semibold\">{{ 'rrule.by-year' | translate: { scope: 'common' } | async }}</div>\n <div>\n <ax-label>{{ 'rrule.by-year-day' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"byyearday\"\n [dataSource]=\"yeardays\"\n multiple=\"true\"\n [ngModel]=\"options().byyearday\"\n (ngModelChange)=\"updateOption('byyearday', $event)\"\n >\n </ax-select-box>\n </div>\n <div>\n <ax-label>{{ 'rrule.by-week-no' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"byweekno\"\n [dataSource]=\"weeknos\"\n multiple=\"true\"\n [ngModel]=\"options().byweekno\"\n (ngModelChange)=\"updateOption('byweekno', $event)\"\n >\n </ax-select-box>\n </div>\n </div>\n\n <!-- By Time -->\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-rounded-md ax-border ax-p-4\">\n <div class=\"ax-text-lg ax-font-semibold\">{{ 'rrule.by-time' | translate: { scope: 'common' } | async }}</div>\n <div>\n <ax-label>{{ 'rrule.by-hour' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"byhour\"\n [dataSource]=\"hours\"\n multiple=\"true\"\n [ngModel]=\"options().byhour\"\n (ngModelChange)=\"updateOption('byhour', $event)\"\n >\n </ax-select-box>\n </div>\n <div>\n <ax-label>{{ 'rrule.by-minute' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"byminute\"\n [dataSource]=\"minutes\"\n multiple=\"true\"\n [ngModel]=\"options().byminute\"\n (ngModelChange)=\"updateOption('byminute', $event)\"\n >\n </ax-select-box>\n </div>\n <div>\n <ax-label>{{ 'rrule.by-second' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"bysecond\"\n [dataSource]=\"seconds\"\n multiple=\"true\"\n [ngModel]=\"options().bysecond\"\n (ngModelChange)=\"updateOption('bysecond', $event)\"\n >\n </ax-select-box>\n </div>\n </div>\n\n <!-- Advanced -->\n <div class=\"ax-flex ax-flex-col ax-gap-4 ax-rounded-md ax-border ax-p-4\">\n <div class=\"ax-text-lg ax-font-semibold\">{{ 'rrule.advanced' | translate: { scope: 'common' } | async }}</div>\n <div>\n <ax-label>{{ 'rrule.by-set-pos' | translate: { scope: 'common' } | async }}</ax-label>\n <ax-select-box\n name=\"bysetpos\"\n [dataSource]=\"setpos\"\n multiple=\"true\"\n [ngModel]=\"options().bysetpos\"\n (ngModelChange)=\"updateOption('bysetpos', $event)\"\n [disabled]=\"true\"\n >\n </ax-select-box>\n </div>\n </div>\n</div>\n\n<div class=\"ax-flex ax-justify-end ax-py-4\">\n <ax-button [text]=\"'rrule.reset' | translate: { scope: 'common' } | async\" (click)=\"resetOptions()\"></ax-button>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXDateTimeBoxModule }, { kind: "component", type: i2$1.AXDateTimeBoxComponent, selector: "ax-datetime-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "depth", "id", "type", "look", "holidayDates", "allowTyping", "picker", "calendar", "weekend", "weekdays", "format"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "onOpened", "onClosed", "readonlyChange", "disabledChange", "formatChange"] }, { kind: "ngmodule", type: AXSelectionListModule }, { kind: "component", type: i3.AXSelectionListComponent, selector: "ax-selection-list", inputs: ["id", "name", "disabled", "readonly", "tabIndex", "size", "value", "valueField", "textField", "disabledField", "readonlyField", "multiple", "direction", "customTemplate", "showControl", "items", "look"], outputs: ["onValueChanged", "onBlur", "onFocus"] }, { kind: "ngmodule", type: AXNumberBoxModule }, { kind: "component", type: i4.AXNumberBoxComponent, selector: "ax-number-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "type", "changeOnScroll", "allDigits", "thousandsSeparator", "padDecimalZeros", "step", "decimals", "decimalStep", "showSpinButtons", "minValue", "maxValue", "class"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i5.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed", "onItemSelected", "onItemClick"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i1.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i7.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i8.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i9.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }] }); }
270
390
  }
271
391
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: AXRruleComponent, decorators: [{
272
392
  type: Component,
@@ -289,5 +409,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
289
409
  * Generated bundle index. Do not edit.
290
410
  */
291
411
 
292
- export { AXRruleComponent, AXRruleService, defaultOptions, defaultRrule };
412
+ export { AXRruleComponent, AXRrulePreviewComponent, AXRruleService, defaultOptions, defaultRrule };
293
413
  //# sourceMappingURL=acorex-components-rrule.mjs.map