@3mo/date-time-fields 0.18.1 → 0.19.0

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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.19.0 (2026-11-16)
2
+ - **🚀⚠️ Breaking Feature**: Add `weekNumbers` to show the calendar week beside each row of days in the picker ([6637e3d](https://github.com/3mo-esolutions/web-components/commit/6637e3d8725c57b6190fc9ec517e16473afe9788))
3
+
4
+ ## 0.18.2 (2026-10-15)
5
+ - **🐛 Fix**: Derive letter placeholders for Cyrillic and Greek scripts as well ([b151df6](https://github.com/3mo-esolutions/web-components/commit/b151df6ac781331a1af5d8dd33a111ad0083b24b))
6
+
1
7
  ## 0.18.1 (2026-10-09)
2
8
  - **⚡️ Performance Improvement**: Build a field's segmenter once per configuration ([b102c75](https://github.com/3mo-esolutions/web-components/commit/b102c756a8746113babab3d7b7a827d1e42cb10d))
3
9
 
package/README.md CHANGED
@@ -102,6 +102,7 @@ The segments follow the [segmented input](https://3mo-esolutions.github.io/web-c
102
102
  | `min` | `min` | `DateTime \| undefined` | | The minimum selectable date (inclusive). Dates before this are disabled. |
103
103
  | `max` | `max` | `DateTime \| undefined` | | The maximum selectable date (inclusive). Dates after this are disabled. |
104
104
  | `dateDisabled` | `dateDisabled` | `((date: DateTime) => boolean) \| undefined` | | A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean. |
105
+ | `weekNumbers` | `weekNumbers` | `boolean` | `false` | Whether the date picker shows the calendar week beside each row of days |
105
106
  | `value` | `value` | `Date \| undefined` | | The field's value |
106
107
  | `label` | `label` | `string` | `""` | The field's label |
107
108
  | `readonly` | `readonly` | `boolean` | `false` | Whether the field is readonly |
@@ -149,6 +150,7 @@ The segments follow the [segmented input](https://3mo-esolutions.github.io/web-c
149
150
  | `min` | `min` | `DateTime \| undefined` | | The minimum selectable date (inclusive). Dates before this are disabled. |
150
151
  | `max` | `max` | `DateTime \| undefined` | | The maximum selectable date (inclusive). Dates after this are disabled. |
151
152
  | `dateDisabled` | `dateDisabled` | `((date: DateTime) => boolean) \| undefined` | | A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean. |
153
+ | `weekNumbers` | `weekNumbers` | `boolean` | `false` | Whether the date picker shows the calendar week beside each row of days |
152
154
  | `value` | `value` | `DateTimeRange \| undefined` | | The selected date range. |
153
155
  | `label` | `label` | `string` | `""` | The field's label |
154
156
  | `readonly` | `readonly` | `boolean` | `false` | Whether the field is readonly |
@@ -197,6 +199,7 @@ The segments follow the [segmented input](https://3mo-esolutions.github.io/web-c
197
199
  | `min` | `min` | `DateTime \| undefined` | | The minimum selectable date (inclusive). Dates before this are disabled. |
198
200
  | `max` | `max` | `DateTime \| undefined` | | The maximum selectable date (inclusive). Dates after this are disabled. |
199
201
  | `dateDisabled` | `dateDisabled` | `((date: DateTime) => boolean) \| undefined` | | A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean. |
202
+ | `weekNumbers` | `weekNumbers` | `boolean` | `false` | Whether the date picker shows the calendar week beside each row of days |
200
203
  | `value` | `value` | `Date \| undefined` | | The field's value |
201
204
  | `label` | `label` | `string` | `""` | The field's label |
202
205
  | `readonly` | `readonly` | `boolean` | `false` | Whether the field is readonly |
@@ -244,6 +247,7 @@ The segments follow the [segmented input](https://3mo-esolutions.github.io/web-c
244
247
  | `min` | `min` | `DateTime \| undefined` | | The minimum selectable date (inclusive). Dates before this are disabled. |
245
248
  | `max` | `max` | `DateTime \| undefined` | | The maximum selectable date (inclusive). Dates after this are disabled. |
246
249
  | `dateDisabled` | `dateDisabled` | `((date: DateTime) => boolean) \| undefined` | | A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean. |
250
+ | `weekNumbers` | `weekNumbers` | `boolean` | `false` | Whether the date picker shows the calendar week beside each row of days |
247
251
  | `value` | `value` | `DateTimeRange \| undefined` | | The selected date range. |
248
252
  | `label` | `label` | `string` | `""` | The field's label |
249
253
  | `readonly` | `readonly` | `boolean` | `false` | Whether the field is readonly |
@@ -335,6 +339,7 @@ The segments follow the [segmented input](https://3mo-esolutions.github.io/web-c
335
339
  | `min` | `min` | `DateTime \| undefined` | | The minimum selectable date (inclusive). Dates before this are disabled. |
336
340
  | `max` | `max` | `DateTime \| undefined` | | The maximum selectable date (inclusive). Dates after this are disabled. |
337
341
  | `dateDisabled` | `dateDisabled` | `((date: DateTime) => boolean) \| undefined` | | A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean. |
342
+ | `weekNumbers` | `weekNumbers` | `boolean` | `false` | Whether the date picker shows the calendar week beside each row of days |
338
343
  | `value` | `value` | `DateTimeRange \| undefined` | | The selected date range. |
339
344
  | `label` | `label` | `string` | `""` | The field's label |
340
345
  | `readonly` | `readonly` | `boolean` | `false` | Whether the field is readonly |
@@ -371,14 +376,14 @@ The segments follow the [segmented input](https://3mo-esolutions.github.io/web-c
371
376
 
372
377
  #### Properties
373
378
 
374
- | Name | Attribute | Type | Default |
375
- | --- | --- | --- | --- |
376
- | `value` | `value` | `DateTimeRange \| undefined` | |
377
- | `precision` | `precision` | `FieldDateTimePrecision` | |
378
- | `includeWeek` | `includeWeek` | `boolean` | `false` |
379
- | `min` | `min` | `DateTime \| undefined` | |
380
- | `max` | `max` | `DateTime \| undefined` | |
381
- | `dateDisabled` | `dateDisabled` | `((date: DateTime) => boolean) \| undefined` | |
379
+ | Name | Attribute | Type | Default | Description |
380
+ | --- | --- | --- | --- | --- |
381
+ | `value` | `value` | `DateTimeRange \| undefined` | | |
382
+ | `precision` | `precision` | `FieldDateTimePrecision` | | |
383
+ | `weekNumbers` | `weekNumbers` | `boolean` | `false` | Whether each row of days shows its calendar week. Always shown at week precision. |
384
+ | `min` | `min` | `DateTime \| undefined` | | |
385
+ | `max` | `max` | `DateTime \| undefined` | | |
386
+ | `dateDisabled` | `dateDisabled` | `((date: DateTime) => boolean) \| undefined` | | |
382
387
 
383
388
  #### Events
384
389
 
@@ -56,6 +56,12 @@
56
56
  "description": "A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean.",
57
57
  "type": "((date: DateTime) => boolean) | undefined"
58
58
  },
59
+ {
60
+ "name": "weekNumbers",
61
+ "description": "Whether the date picker shows the calendar week beside each row of days",
62
+ "type": "boolean",
63
+ "default": "false"
64
+ },
59
65
  {
60
66
  "name": "value",
61
67
  "description": "The selected date range.",
@@ -151,6 +157,13 @@
151
157
  "description": "A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean.",
152
158
  "type": "((date: DateTime) => boolean) | undefined"
153
159
  },
160
+ {
161
+ "name": "weekNumbers",
162
+ "attribute": "weekNumbers",
163
+ "description": "Whether the date picker shows the calendar week beside each row of days",
164
+ "type": "boolean",
165
+ "default": "false"
166
+ },
154
167
  {
155
168
  "name": "value",
156
169
  "attribute": "value",
@@ -296,6 +309,12 @@
296
309
  "description": "A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean.",
297
310
  "type": "((date: DateTime) => boolean) | undefined"
298
311
  },
312
+ {
313
+ "name": "weekNumbers",
314
+ "description": "Whether the date picker shows the calendar week beside each row of days",
315
+ "type": "boolean",
316
+ "default": "false"
317
+ },
299
318
  {
300
319
  "name": "value",
301
320
  "description": "The selected date range.",
@@ -391,6 +410,13 @@
391
410
  "description": "A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean.",
392
411
  "type": "((date: DateTime) => boolean) | undefined"
393
412
  },
413
+ {
414
+ "name": "weekNumbers",
415
+ "attribute": "weekNumbers",
416
+ "description": "Whether the date picker shows the calendar week beside each row of days",
417
+ "type": "boolean",
418
+ "default": "false"
419
+ },
394
420
  {
395
421
  "name": "value",
396
422
  "attribute": "value",
@@ -535,6 +561,12 @@
535
561
  "description": "A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean.",
536
562
  "type": "((date: DateTime) => boolean) | undefined"
537
563
  },
564
+ {
565
+ "name": "weekNumbers",
566
+ "description": "Whether the date picker shows the calendar week beside each row of days",
567
+ "type": "boolean",
568
+ "default": "false"
569
+ },
538
570
  {
539
571
  "name": "value",
540
572
  "description": "The selected date range.",
@@ -630,6 +662,13 @@
630
662
  "description": "A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean.",
631
663
  "type": "((date: DateTime) => boolean) | undefined"
632
664
  },
665
+ {
666
+ "name": "weekNumbers",
667
+ "attribute": "weekNumbers",
668
+ "description": "Whether the date picker shows the calendar week beside each row of days",
669
+ "type": "boolean",
670
+ "default": "false"
671
+ },
633
672
  {
634
673
  "name": "value",
635
674
  "attribute": "value",
@@ -774,6 +813,12 @@
774
813
  "description": "A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean.",
775
814
  "type": "((date: DateTime) => boolean) | undefined"
776
815
  },
816
+ {
817
+ "name": "weekNumbers",
818
+ "description": "Whether the date picker shows the calendar week beside each row of days",
819
+ "type": "boolean",
820
+ "default": "false"
821
+ },
777
822
  {
778
823
  "name": "value",
779
824
  "description": "The field's value",
@@ -869,6 +914,13 @@
869
914
  "description": "A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean.",
870
915
  "type": "((date: DateTime) => boolean) | undefined"
871
916
  },
917
+ {
918
+ "name": "weekNumbers",
919
+ "attribute": "weekNumbers",
920
+ "description": "Whether the date picker shows the calendar week beside each row of days",
921
+ "type": "boolean",
922
+ "default": "false"
923
+ },
872
924
  {
873
925
  "name": "value",
874
926
  "attribute": "value",
@@ -1010,6 +1062,12 @@
1010
1062
  "description": "A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean.",
1011
1063
  "type": "((date: DateTime) => boolean) | undefined"
1012
1064
  },
1065
+ {
1066
+ "name": "weekNumbers",
1067
+ "description": "Whether the date picker shows the calendar week beside each row of days",
1068
+ "type": "boolean",
1069
+ "default": "false"
1070
+ },
1013
1071
  {
1014
1072
  "name": "value",
1015
1073
  "description": "The field's value",
@@ -1105,6 +1163,13 @@
1105
1163
  "description": "A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean.",
1106
1164
  "type": "((date: DateTime) => boolean) | undefined"
1107
1165
  },
1166
+ {
1167
+ "name": "weekNumbers",
1168
+ "attribute": "weekNumbers",
1169
+ "description": "Whether the date picker shows the calendar week beside each row of days",
1170
+ "type": "boolean",
1171
+ "default": "false"
1172
+ },
1108
1173
  {
1109
1174
  "name": "value",
1110
1175
  "attribute": "value",
@@ -1204,7 +1269,8 @@
1204
1269
  "type": "FieldDateTimePrecision"
1205
1270
  },
1206
1271
  {
1207
- "name": "includeWeek",
1272
+ "name": "weekNumbers",
1273
+ "description": "Whether each row of days shows its calendar week. Always shown at week precision.",
1208
1274
  "type": "boolean",
1209
1275
  "default": "false"
1210
1276
  },
@@ -1233,8 +1299,9 @@
1233
1299
  "type": "FieldDateTimePrecision"
1234
1300
  },
1235
1301
  {
1236
- "name": "includeWeek",
1237
- "attribute": "includeWeek",
1302
+ "name": "weekNumbers",
1303
+ "attribute": "weekNumbers",
1304
+ "description": "Whether each row of days shows its calendar week. Always shown at week precision.",
1238
1305
  "type": "boolean",
1239
1306
  "default": "false"
1240
1307
  },
@@ -15,6 +15,7 @@ import type { Calendar } from '../selection/index.js';
15
15
  * @attr min - The minimum selectable date (inclusive). Dates before this are disabled.
16
16
  * @attr max - The maximum selectable date (inclusive). Dates after this are disabled.
17
17
  * @attr dateDisabled - A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean.
18
+ * @attr weekNumbers - Whether the date picker shows the calendar week beside each row of days
18
19
  *
19
20
  * @csspart segments - The group of segments making up one date-time value
20
21
  * @csspart segment - An editable unit of the value
@@ -30,6 +31,7 @@ export declare abstract class FieldDateTimeBase<T> extends FieldComponent<T> {
30
31
  min?: DateTime;
31
32
  max?: DateTime;
32
33
  dateDisabled?: (date: DateTime) => boolean;
34
+ weekNumbers: boolean;
33
35
  protected readonly calendar?: Calendar;
34
36
  /** The field's behaviour, for a date field of another design. */
35
37
  abstract readonly controller: FieldDateTimeControllerBase<NonNullable<T>>;
@@ -1 +1 @@
1
- {"version":3,"file":"FieldDateTimeBase.d.ts","s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AAC,QAAQ,KAAK,gBAAgB,IAAI,kBAAkB,CAAA;IAE7D,SAAS,CAAC,mBAAmB,CAAC,UAAU,EAAE,0BAA0B,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK;IAQ7F,OAAO,KAAK,uBAAuB,GAYlC;IAED,SAAS,KAAK,0BAA0B,uBAOvC;IAED,SAAS,KAAK,eAAe,uBAkB5B;IAED,SAAS,KAAK,wBAAwB,uBAOrC;IAED,SAAS,KAAK,eAAe,IAAI,kBAAkB,CAMlD;IAED,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC;IAYzD,SAAS,KAAK,YAAY,uBAEzB;IAED,SAAS,KAAK,gBAAgB,uBAY7B;IAED,OAAO,KAAK,YAAY,GAcvB;IAED,OAAO,CAAC,mBAAmB;CAmB3B"}
@@ -15,6 +15,7 @@ import { hourCycleConverter, segmentsStyles } from '../segments/index.js';
15
15
  * @attr min - The minimum selectable date (inclusive). Dates before this are disabled.
16
16
  * @attr max - The maximum selectable date (inclusive). Dates after this are disabled.
17
17
  * @attr dateDisabled - A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean.
18
+ * @attr weekNumbers - Whether the date picker shows the calendar week beside each row of days
18
19
  *
19
20
  * @csspart segments - The group of segments making up one date-time value
20
21
  * @csspart segment - An editable unit of the value
@@ -28,6 +29,7 @@ export class FieldDateTimeBase extends FieldComponent {
28
29
  this.dense = false;
29
30
  this.shortcutReferenceDate = new DateTime();
30
31
  this.precision = FieldDateTimePrecision.Minute;
32
+ this.weekNumbers = false;
31
33
  this.handleLanguageChange = () => {
32
34
  this.controller.navigationDate = new DateTime(this.controller.navigationDate);
33
35
  };
@@ -232,6 +234,7 @@ export class FieldDateTimeBase extends FieldComponent {
232
234
  .min=${this.min}
233
235
  .max=${this.max}
234
236
  .dateDisabled=${this.dateDisabled}
237
+ ?weekNumbers=${this.weekNumbers}
235
238
  @dateClick=${(e) => this.controller.pick(e.detail, this.precision)}
236
239
  ></mo-calendar>
237
240
  `;
@@ -298,6 +301,9 @@ __decorate([
298
301
  __decorate([
299
302
  property({ type: Object, hasChanged })
300
303
  ], FieldDateTimeBase.prototype, "dateDisabled", void 0);
304
+ __decorate([
305
+ property({ type: Boolean })
306
+ ], FieldDateTimeBase.prototype, "weekNumbers", void 0);
301
307
  __decorate([
302
308
  query('mo-calendar')
303
309
  ], FieldDateTimeBase.prototype, "calendar", void 0);
@@ -146,7 +146,7 @@ export class DateTimeSegmenter {
146
146
  return type === 'dayPeriod' && this.direction === 'rtl' ? `\u200F${timePlaceholder}` : timePlaceholder;
147
147
  }
148
148
  const word = this.labelOf(type);
149
- return /^\p{Script=Latin}/u.test(word) ? word[0].toLocaleLowerCase(this.language).repeat(width) : word;
149
+ return /^[\p{Script=Latin}\p{Script=Cyrillic}\p{Script=Greek}]/u.test(word) ? word[0].toLocaleLowerCase(this.language).repeat(width) : word;
150
150
  }
151
151
  limits(date, type) {
152
152
  date = this.adopt(date);
@@ -7,7 +7,8 @@ export declare class Calendar extends Component {
7
7
  readonly dateClick: EventDispatcher<DateTime>;
8
8
  value?: DateTimeRange;
9
9
  precision: FieldDateTimePrecision;
10
- includeWeek: boolean;
10
+ /** Whether each row of days shows its calendar week. Always shown at week precision. */
11
+ weekNumbers: boolean;
11
12
  min?: DateTime;
12
13
  max?: DateTime;
13
14
  dateDisabled?: (date: DateTime) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../selection/Calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmE,MAAM,WAAW,CAAA;AAGtG,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAErE;;GAEG;AACH,qBACa,QAAS,SAAQ,SAAS;IAC7B,QAAQ,CAAC,SAAS,EAAG,eAAe,CAAC,QAAQ,CAAC,CAAA;IAE3B,KAAK,CAAC,EAAE,aAAa,CAAA;IACqC,SAAS,EA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AAK;IAIb,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,SAAS;CAKjB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,aAAa,EAAE,QAAQ,CAAA;KACvB;CACD"}
@@ -10,7 +10,8 @@ import { FieldDateTimePrecision } from '../FieldDateTimePrecision.js';
10
10
  let Calendar = Calendar_1 = class Calendar extends Component {
11
11
  constructor() {
12
12
  super(...arguments);
13
- this.includeWeek = false;
13
+ /** Whether each row of days shows its calendar week. Always shown at week precision. */
14
+ this.weekNumbers = false;
14
15
  this.datesController = new CalendarDatesController(this);
15
16
  this.view = FieldDateTimePrecision.Day;
16
17
  this.handleItemClick = (date, precision) => {
@@ -224,7 +225,7 @@ let Calendar = Calendar_1 = class Calendar extends Component {
224
225
  `;
225
226
  }
226
227
  get includeWeekNumber() {
227
- return this.includeWeek || FieldDateTimePrecision.Week === this.precision;
228
+ return this.weekNumbers || FieldDateTimePrecision.Week === this.precision;
228
229
  }
229
230
  get columns() {
230
231
  return [
@@ -331,15 +332,15 @@ let Calendar = Calendar_1 = class Calendar extends Component {
331
332
  @click=${this.precision === FieldDateTimePrecision.Day ? html.nothing : this.handleItemClick(date, FieldDateTimePrecision.Week)}
332
333
  ${this.datesController.observerIntersectionNavigation(date, FieldDateTimePrecision.Week)}
333
334
  >
335
+ ${!this.includeWeekNumber ? html.nothing : html `
336
+ <div class='week-number' style='grid-column: week-number'>${(week.find(day => day.dayOfWeek === 1) ?? date).weekOfYear?.format()}</div>
337
+ `}
334
338
  ${week.map(day => this.getDayTemplate(day))}
335
339
  </mo-grid>
336
340
  `;
337
341
  }
338
342
  getDayTemplate(day) {
339
343
  return html `
340
- ${this.includeWeekNumber === false || day.dayOfWeek !== 1 ? html.nothing : html `
341
- <div class='week-number' style='grid-column: week-number'>${day.weekOfYear?.format()}</div>
342
- `}
343
344
  <div tabindex='0' role='button' class='day'
344
345
  style='grid-column: ${this.getColumnName(day)}'
345
346
  data-view=${this.view.key}
@@ -398,7 +399,7 @@ __decorate([
398
399
  ], Calendar.prototype, "precision", void 0);
399
400
  __decorate([
400
401
  property({ type: Boolean, reflect: true })
401
- ], Calendar.prototype, "includeWeek", void 0);
402
+ ], Calendar.prototype, "weekNumbers", void 0);
402
403
  __decorate([
403
404
  property({ type: Object })
404
405
  ], Calendar.prototype, "min", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3mo/date-time-fields",
3
- "version": "0.18.1",
3
+ "version": "0.19.0",
4
4
  "description": "Web components for date, date-time, time and range fields with locale-aware segmented entry and a calendar picker.",
5
5
  "repository": {
6
6
  "type": "git",