@getflip/swirl-components 0.100.0 → 0.100.2

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.
Files changed (27) hide show
  1. package/components.json +1 -1
  2. package/dist/cjs/swirl-accordion-item.cjs.entry.js +1 -1
  3. package/dist/cjs/swirl-accordion.cjs.entry.js +1 -1
  4. package/dist/cjs/swirl-app-layout_6.cjs.entry.js +3 -1
  5. package/dist/cjs/wc-datepicker.cjs.entry.js +19 -3
  6. package/dist/collection/assets/pdfjs/pdf.worker.min.js +22 -0
  7. package/dist/collection/components/swirl-accordion/swirl-accordion.css +1 -0
  8. package/dist/collection/components/swirl-accordion-item/swirl-accordion-item.css +0 -4
  9. package/dist/collection/components/swirl-resource-list/swirl-resource-list.js +3 -1
  10. package/dist/components/assets/pdfjs/pdf.worker.min.js +22 -0
  11. package/dist/components/swirl-accordion-item.js +1 -1
  12. package/dist/components/swirl-accordion.js +1 -1
  13. package/dist/components/swirl-resource-list2.js +3 -1
  14. package/dist/components/wc-datepicker2.js +19 -3
  15. package/dist/esm/swirl-accordion-item.entry.js +1 -1
  16. package/dist/esm/swirl-accordion.entry.js +1 -1
  17. package/dist/esm/swirl-app-layout_6.entry.js +3 -1
  18. package/dist/esm/wc-datepicker.entry.js +19 -3
  19. package/dist/swirl-components/p-2615a987.entry.js +1 -0
  20. package/dist/swirl-components/p-3e2d4f9b.entry.js +1 -0
  21. package/dist/swirl-components/{p-1a815fd4.entry.js → p-c0f4b4ad.entry.js} +1 -1
  22. package/dist/swirl-components/{p-f4144d4c.entry.js → p-e88e10b6.entry.js} +1 -1
  23. package/dist/swirl-components/swirl-components.esm.js +1 -1
  24. package/dist/types/components/swirl-resource-list/swirl-resource-list.d.ts +1 -0
  25. package/package.json +1 -1
  26. package/dist/swirl-components/p-11d08dde.entry.js +0 -1
  27. package/dist/swirl-components/p-6e72e129.entry.js +0 -1
package/components.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-10-09T11:04:28",
2
+ "timestamp": "2023-10-10T13:16:21",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "3.3.1",
@@ -6,7 +6,7 @@ const index = require('./index-506fe4ea.js');
6
6
  const index$1 = require('./index-2ddd0598.js');
7
7
  const v4 = require('./v4-8e8d6fbc.js');
8
8
 
9
- const swirlAccordionItemCss = ":host{display:block}:host *{box-sizing:border-box}:host(:last-child) .accordion-item{border-bottom:0.0625rem solid var(--s-border-default)}.accordion-item{display:grid;align-content:start;border-top:0.0625rem solid var(--s-border-default);transition:grid-template-rows 0.15s;grid-template-rows:auto 0fr;will-change:grid-template-rows}@media (prefers-reduced-motion){.accordion-item{transition:none}}.accordion-item--expanded{grid-template-rows:auto 1fr}.accordion-item--expanded .accordion-item__content{padding-top:var(--s-space-16);padding-bottom:var(--s-space-16);animation:accordion-overflow 0.01s;animation-delay:0.15s;animation-fill-mode:forwards}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.accordion-item--expanded .accordion-item__content{padding-top:var(--s-space-8)}}.accordion-item__heading{margin:0;padding:0;font-size:var(--s-font-size-base);font-weight:var(--s-font-weight-semibold)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.accordion-item__heading{font-size:var(--s-font-size-sm)}}.accordion-item__toggle{display:flex;width:100%;padding:0;padding-top:var(--s-space-16);padding-bottom:var(--s-space-16);align-items:center;border:none;color:var(--s-text-default);background-color:var(--s-surface-default);font:inherit;line-height:var(--s-line-height-lg);text-align:start;cursor:pointer;gap:var(--s-space-16)}.accordion-item__toggle:hover{background-color:var(--s-surface-hovered)}.accordion-item__toggle:active{background-color:var(--s-surface-pressed)}.accordion-item__toggle:disabled{color:var(--s-text-disabled);background-color:var(--s-surface-default);cursor:default}.accordion-item__toggle:disabled .text{color:var(--s-text-disabled)}.accordion-item__toggle:focus:not(:focus-visible){outline:none}.accordion-item__toggle:focus-visible{outline-color:var(--s-focus-default)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.accordion-item__toggle{line-height:var(--s-line-height-sm)}}.accordion-item__toggle-text{flex-grow:1}.accordion-item__icon{display:inline-flex;padding-right:var(--s-space-8);flex-shrink:0}.accordion-item__content{overflow:hidden;padding-top:0;padding-bottom:0;transition:padding-top 0.15s, padding-bottom 0.15s;animation:accordion-display 0.01s;animation-delay:0.15s;animation-fill-mode:forwards}@media (prefers-reduced-motion){.accordion-item__content{transition:none}}@keyframes accordion-overflow{from{overflow:hidden}to{overflow:visible}}@keyframes accordion-display{from{display:block}to{display:none}}";
9
+ const swirlAccordionItemCss = ":host{display:block}:host *{box-sizing:border-box}.accordion-item{display:grid;align-content:start;border-top:0.0625rem solid var(--s-border-default);transition:grid-template-rows 0.15s;grid-template-rows:auto 0fr;will-change:grid-template-rows}@media (prefers-reduced-motion){.accordion-item{transition:none}}.accordion-item--expanded{grid-template-rows:auto 1fr}.accordion-item--expanded .accordion-item__content{padding-top:var(--s-space-16);padding-bottom:var(--s-space-16);animation:accordion-overflow 0.01s;animation-delay:0.15s;animation-fill-mode:forwards}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.accordion-item--expanded .accordion-item__content{padding-top:var(--s-space-8)}}.accordion-item__heading{margin:0;padding:0;font-size:var(--s-font-size-base);font-weight:var(--s-font-weight-semibold)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.accordion-item__heading{font-size:var(--s-font-size-sm)}}.accordion-item__toggle{display:flex;width:100%;padding:0;padding-top:var(--s-space-16);padding-bottom:var(--s-space-16);align-items:center;border:none;color:var(--s-text-default);background-color:var(--s-surface-default);font:inherit;line-height:var(--s-line-height-lg);text-align:start;cursor:pointer;gap:var(--s-space-16)}.accordion-item__toggle:hover{background-color:var(--s-surface-hovered)}.accordion-item__toggle:active{background-color:var(--s-surface-pressed)}.accordion-item__toggle:disabled{color:var(--s-text-disabled);background-color:var(--s-surface-default);cursor:default}.accordion-item__toggle:disabled .text{color:var(--s-text-disabled)}.accordion-item__toggle:focus:not(:focus-visible){outline:none}.accordion-item__toggle:focus-visible{outline-color:var(--s-focus-default)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.accordion-item__toggle{line-height:var(--s-line-height-sm)}}.accordion-item__toggle-text{flex-grow:1}.accordion-item__icon{display:inline-flex;padding-right:var(--s-space-8);flex-shrink:0}.accordion-item__content{overflow:hidden;padding-top:0;padding-bottom:0;transition:padding-top 0.15s, padding-bottom 0.15s;animation:accordion-display 0.01s;animation-delay:0.15s;animation-fill-mode:forwards}@media (prefers-reduced-motion){.accordion-item__content{transition:none}}@keyframes accordion-overflow{from{overflow:hidden}to{overflow:visible}}@keyframes accordion-display{from{display:block}to{display:none}}";
10
10
 
11
11
  const SwirlAccordionItem = class {
12
12
  constructor(hostRef) {
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-506fe4ea.js');
6
6
 
7
- const swirlAccordionCss = ":host{display:block}:host *{box-sizing:border-box}";
7
+ const swirlAccordionCss = ":host{display:block;border-bottom:0.0625rem solid var(--s-border-default)}:host *{box-sizing:border-box}";
8
8
 
9
9
  const SwirlAccordion = class {
10
10
  constructor(hostRef) {
@@ -317,6 +317,9 @@ const SwirlResourceList = class {
317
317
  this.setItemAllowDragState();
318
318
  this.setupDragDrop();
319
319
  }
320
+ componentDidRender() {
321
+ this.setupDragDrop();
322
+ }
320
323
  disconnectedCallback() {
321
324
  this.sortable?.destroy();
322
325
  this.observer?.disconnect();
@@ -325,7 +328,6 @@ const SwirlResourceList = class {
325
328
  this.observer = new MutationObserver(() => {
326
329
  this.collectItems();
327
330
  this.setItemAllowDragState();
328
- this.setupDragDrop();
329
331
  });
330
332
  this.observer.observe(this.el, {
331
333
  childList: true,
@@ -45,7 +45,7 @@ function getDaysOfMonth(date, padded, firstDayOfWeek) {
45
45
  return [...leftPaddingDays, ...days, ...rightPaddingDays];
46
46
  }
47
47
  function getFirstOfMonth(date) {
48
- const firstOfMonth = removeTimezoneOffset(new Date(`${getYear(date)}-${String(getMonth(date)).padStart(2, '0')}-01`));
48
+ const firstOfMonth = removeTimezoneOffset(new Date(`${String(getYear(date)).padStart(4, '0')}-${String(getMonth(date)).padStart(2, '0')}-01`));
49
49
  return firstOfMonth;
50
50
  }
51
51
  function getISODateString(date) {
@@ -216,7 +216,20 @@ const WCDatepicker = class {
216
216
  this.updateCurrentDate(date);
217
217
  };
218
218
  this.onYearSelect = (event) => {
219
- const year = +event.target.value;
219
+ let year = +event.target.value;
220
+ const input = event.target;
221
+ if (isNaN(year)) {
222
+ year = new Date().getFullYear();
223
+ input.value = String(year);
224
+ }
225
+ else if (year < 0) {
226
+ year = 0;
227
+ input.value = String(year);
228
+ }
229
+ else if (year > 9999) {
230
+ year = 9999;
231
+ input.value = String(year);
232
+ }
220
233
  const date = new Date(this.currentDate);
221
234
  date.setFullYear(year);
222
235
  this.updateCurrentDate(date);
@@ -355,6 +368,9 @@ const WCDatepicker = class {
355
368
  updateCurrentDate(date, moveFocus) {
356
369
  const month = date.getMonth();
357
370
  const year = date.getFullYear();
371
+ if (year > 9999 || year < 0) {
372
+ return;
373
+ }
358
374
  const monthChanged = month !== this.currentDate.getMonth() ||
359
375
  year !== this.currentDate.getFullYear();
360
376
  if (monthChanged) {
@@ -403,7 +419,7 @@ const WCDatepicker = class {
403
419
  return (index.h(index.Host, null, index.h("div", { "aria-disabled": String(this.disabled), "aria-label": this.labels.picker, class: {
404
420
  [this.getClassName()]: true,
405
421
  [`${this.getClassName()}--disabled`]: this.disabled
406
- }, role: "group" }, index.h("div", { class: this.getClassName('header') }, index.h("span", { "aria-atomic": "true", "aria-live": "polite", class: "visually-hidden" }, this.getTitle()), this.showYearStepper && (index.h("button", { "aria-label": this.labels.previousYearButton, class: this.getClassName('previous-year-button'), disabled: this.disabled, innerHTML: this.previousYearButtonContent || undefined, onClick: this.previousYear, type: "button" }, index.h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, index.h("polyline", { points: "11 17 6 12 11 7" }), index.h("polyline", { points: "18 17 13 12 18 7" })))), this.showMonthStepper && (index.h("button", { "aria-label": this.labels.previousMonthButton, class: this.getClassName('previous-month-button'), disabled: this.disabled, innerHTML: this.previousMonthButtonContent || undefined, onClick: this.previousMonth, type: "button" }, index.h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, index.h("polyline", { points: "15 18 9 12 15 6" })))), index.h("span", { class: this.getClassName('current-month') }, index.h("select", { "aria-label": this.labels.monthSelect, class: this.getClassName('month-select'), disabled: this.disabled, name: "month", onChange: this.onMonthSelect }, getMonths(this.locale).map((month, index$1) => (index.h("option", { key: month, selected: this.currentDate.getMonth() === index$1, value: index$1 + 1 }, month)))), index.h("input", { "aria-label": this.labels.yearSelect, class: this.getClassName('year-select'), disabled: this.disabled, max: 9999, min: 1, name: "year", onChange: this.onYearSelect, type: "number", value: this.currentDate.getFullYear() })), this.showMonthStepper && (index.h("button", { "aria-label": this.labels.nextMonthButton, class: this.getClassName('next-month-button'), disabled: this.disabled, innerHTML: this.nextMonthButtonContent || undefined, onClick: this.nextMonth, type: "button" }, index.h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, index.h("polyline", { points: "9 18 15 12 9 6" })))), this.showYearStepper && (index.h("button", { "aria-label": this.labels.nextYearButton, class: this.getClassName('next-year-button'), disabled: this.disabled, innerHTML: this.nextYearButtonContent || undefined, onClick: this.nextYear, type: "button" }, index.h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, index.h("polyline", { points: "13 17 18 12 13 7" }), index.h("polyline", { points: "6 17 11 12 6 7" }))))), index.h("div", { class: this.getClassName('body') }, index.h("table", { class: this.getClassName('calendar'), onKeyDown: this.onKeyDown, role: "grid" }, index.h("thead", { class: this.getClassName('calendar-header') }, index.h("tr", { class: this.getClassName('weekday-row') }, this.weekdays.map((weekday) => (index.h("th", { abbr: weekday[1], class: this.getClassName('weekday'), key: weekday[0], scope: "col" }, index.h("span", null, weekday[0])))))), index.h("tbody", null, this.getCalendarRows().map((calendarRow) => {
422
+ }, role: "group" }, index.h("div", { class: this.getClassName('header') }, index.h("span", { "aria-atomic": "true", "aria-live": "polite", class: "visually-hidden" }, this.getTitle()), this.showYearStepper && (index.h("button", { "aria-label": this.labels.previousYearButton, class: this.getClassName('previous-year-button'), disabled: this.disabled, innerHTML: this.previousYearButtonContent || undefined, onClick: this.previousYear, type: "button" }, index.h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, index.h("polyline", { points: "11 17 6 12 11 7" }), index.h("polyline", { points: "18 17 13 12 18 7" })))), this.showMonthStepper && (index.h("button", { "aria-label": this.labels.previousMonthButton, class: this.getClassName('previous-month-button'), disabled: this.disabled, innerHTML: this.previousMonthButtonContent || undefined, onClick: this.previousMonth, type: "button" }, index.h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, index.h("polyline", { points: "15 18 9 12 15 6" })))), index.h("span", { class: this.getClassName('current-month') }, index.h("select", { "aria-label": this.labels.monthSelect, class: this.getClassName('month-select'), disabled: this.disabled, name: "month", onChange: this.onMonthSelect }, getMonths(this.locale).map((month, index$1) => (index.h("option", { key: month, selected: this.currentDate.getMonth() === index$1, value: index$1 + 1 }, month)))), index.h("input", { "aria-label": this.labels.yearSelect, class: this.getClassName('year-select'), disabled: this.disabled, max: 9999, maxLength: 4, min: 1, name: "year", onChange: this.onYearSelect, type: "number", value: this.currentDate.getFullYear() })), this.showMonthStepper && (index.h("button", { "aria-label": this.labels.nextMonthButton, class: this.getClassName('next-month-button'), disabled: this.disabled, innerHTML: this.nextMonthButtonContent || undefined, onClick: this.nextMonth, type: "button" }, index.h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, index.h("polyline", { points: "9 18 15 12 9 6" })))), this.showYearStepper && (index.h("button", { "aria-label": this.labels.nextYearButton, class: this.getClassName('next-year-button'), disabled: this.disabled, innerHTML: this.nextYearButtonContent || undefined, onClick: this.nextYear, type: "button" }, index.h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, index.h("polyline", { points: "13 17 18 12 13 7" }), index.h("polyline", { points: "6 17 11 12 6 7" }))))), index.h("div", { class: this.getClassName('body') }, index.h("table", { class: this.getClassName('calendar'), onKeyDown: this.onKeyDown, role: "grid" }, index.h("thead", { class: this.getClassName('calendar-header') }, index.h("tr", { class: this.getClassName('weekday-row') }, this.weekdays.map((weekday) => (index.h("th", { abbr: weekday[1], class: this.getClassName('weekday'), key: weekday[0], scope: "col" }, index.h("span", null, weekday[0])))))), index.h("tbody", null, this.getCalendarRows().map((calendarRow) => {
407
423
  const rowKey = `row-${calendarRow[0].getMonth()}-${calendarRow[0].getDate()}`;
408
424
  return (index.h("tr", { class: this.getClassName('calendar-row'), key: rowKey }, calendarRow.map((day) => {
409
425
  var _a, _b, _c, _d, _e;