@warp-ds/elements 2.2.0-next.29 → 2.2.0-next.30
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/dist/custom-elements.json +973 -5050
- package/dist/index.d.ts +87 -995
- package/dist/packages/link/index.js +93 -2640
- package/dist/packages/modal/index.js +5 -2717
- package/dist/packages/select/select.react.stories.d.ts +1 -1
- package/dist/packages/textfield/textfield.react.stories.d.ts +1 -1
- package/dist/packages/toast/index.js +3 -2483
- package/dist/packages/utils/index.js +37 -2
- package/dist/vscode.html-custom-data.json +13 -456
- package/dist/web-types.json +166 -1203
- package/package.json +1 -1
- package/dist/packages/combobox/combobox.react.stories.d.ts +0 -28
- package/dist/packages/combobox/combobox.react.stories.js +0 -90
- package/dist/packages/combobox/combobox.stories.d.ts +0 -18
- package/dist/packages/combobox/combobox.stories.js +0 -117
- package/dist/packages/combobox/index.d.ts +0 -95
- package/dist/packages/combobox/index.js +0 -2492
- package/dist/packages/combobox/index.js.map +0 -7
- package/dist/packages/combobox/locales/da/messages.d.mts +0 -1
- package/dist/packages/combobox/locales/da/messages.mjs +0 -1
- package/dist/packages/combobox/locales/en/messages.d.mts +0 -1
- package/dist/packages/combobox/locales/en/messages.mjs +0 -1
- package/dist/packages/combobox/locales/fi/messages.d.mts +0 -1
- package/dist/packages/combobox/locales/fi/messages.mjs +0 -1
- package/dist/packages/combobox/locales/nb/messages.d.mts +0 -1
- package/dist/packages/combobox/locales/nb/messages.mjs +0 -1
- package/dist/packages/combobox/locales/sv/messages.d.mts +0 -1
- package/dist/packages/combobox/locales/sv/messages.mjs +0 -1
- package/dist/packages/combobox/react.d.ts +0 -7
- package/dist/packages/combobox/react.js +0 -17
- package/dist/packages/combobox/styles.d.ts +0 -1
- package/dist/packages/combobox/styles.js +0 -2
- package/dist/packages/datepicker/DatePicker.test.d.ts +0 -2
- package/dist/packages/datepicker/DatePicker.test.js +0 -69
- package/dist/packages/datepicker/datepicker.d.ts +0 -102
- package/dist/packages/datepicker/datepicker.js +0 -2785
- package/dist/packages/datepicker/datepicker.js.map +0 -7
- package/dist/packages/datepicker/datepicker.react.stories.d.ts +0 -18
- package/dist/packages/datepicker/datepicker.react.stories.js +0 -26
- package/dist/packages/datepicker/datepicker.stories.d.ts +0 -12
- package/dist/packages/datepicker/datepicker.stories.js +0 -51
- package/dist/packages/datepicker/datepicker.test.d.ts +0 -2
- package/dist/packages/datepicker/datepicker.test.js +0 -62
- package/dist/packages/datepicker/index.d.ts +0 -1
- package/dist/packages/datepicker/index.js +0 -2785
- package/dist/packages/datepicker/index.js.map +0 -7
- package/dist/packages/datepicker/locales/da/messages.d.mts +0 -1
- package/dist/packages/datepicker/locales/da/messages.mjs +0 -1
- package/dist/packages/datepicker/locales/en/messages.d.mts +0 -1
- package/dist/packages/datepicker/locales/en/messages.mjs +0 -1
- package/dist/packages/datepicker/locales/fi/messages.d.mts +0 -1
- package/dist/packages/datepicker/locales/fi/messages.mjs +0 -1
- package/dist/packages/datepicker/locales/nb/messages.d.mts +0 -1
- package/dist/packages/datepicker/locales/nb/messages.mjs +0 -1
- package/dist/packages/datepicker/locales/sv/messages.d.mts +0 -1
- package/dist/packages/datepicker/locales/sv/messages.mjs +0 -1
- package/dist/packages/datepicker/react.d.ts +0 -5
- package/dist/packages/datepicker/react.js +0 -15
- package/dist/packages/datepicker/styles/w-datepicker-calendar.styles.d.ts +0 -1
- package/dist/packages/datepicker/styles/w-datepicker-calendar.styles.js +0 -15
- package/dist/packages/datepicker/styles/w-datepicker-day.styles.d.ts +0 -1
- package/dist/packages/datepicker/styles/w-datepicker-day.styles.js +0 -64
- package/dist/packages/datepicker/styles/w-datepicker-month.styles.d.ts +0 -1
- package/dist/packages/datepicker/styles/w-datepicker-month.styles.js +0 -72
- package/dist/packages/datepicker/styles/w-datepicker.styles.d.ts +0 -1
- package/dist/packages/datepicker/styles/w-datepicker.styles.js +0 -101
- package/dist/packages/datepicker/utils.d.ts +0 -13
- package/dist/packages/datepicker/utils.js +0 -28
- package/dist/packages/dead-toggle/dead-toggle.react.stories.d.ts +0 -15
- package/dist/packages/dead-toggle/dead-toggle.react.stories.js +0 -34
- package/dist/packages/dead-toggle/dead-toggle.stories.d.ts +0 -14
- package/dist/packages/dead-toggle/dead-toggle.stories.js +0 -45
- package/dist/packages/dead-toggle/dead-toggle.test.d.ts +0 -1
- package/dist/packages/dead-toggle/dead-toggle.test.js +0 -9
- package/dist/packages/dead-toggle/index.d.ts +0 -17
- package/dist/packages/dead-toggle/index.js +0 -2548
- package/dist/packages/dead-toggle/index.js.map +0 -7
- package/dist/packages/dead-toggle/react.d.ts +0 -2
- package/dist/packages/dead-toggle/react.js +0 -11
- package/dist/packages/link/index.js.map +0 -7
- package/dist/packages/link/link.react.stories.d.ts +0 -21
- package/dist/packages/link/link.react.stories.js +0 -96
- package/dist/packages/link/link.stories.d.ts +0 -20
- package/dist/packages/link/link.stories.js +0 -110
- package/dist/packages/link/link.test.d.ts +0 -1
- package/dist/packages/link/link.test.js +0 -9
- package/dist/packages/link/react.d.ts +0 -2
- package/dist/packages/link/react.js +0 -11
- package/dist/packages/modal/index.js.map +0 -7
- package/dist/packages/pageindicator/index.d.ts +0 -10
- package/dist/packages/pageindicator/index.js +0 -32
- package/dist/packages/pageindicator/index.js.map +0 -7
- package/dist/packages/pageindicator/pageindicator.react.stories.d.ts +0 -19
- package/dist/packages/pageindicator/pageindicator.react.stories.js +0 -20
- package/dist/packages/pageindicator/pageindicator.stories.d.ts +0 -32
- package/dist/packages/pageindicator/pageindicator.stories.js +0 -71
- package/dist/packages/pageindicator/react.d.ts +0 -2
- package/dist/packages/pageindicator/react.js +0 -11
- package/dist/packages/pageindicator/style.d.ts +0 -1
- package/dist/packages/pageindicator/style.js +0 -26
- package/dist/packages/pagination/index.d.ts +0 -32
- package/dist/packages/pagination/index.js +0 -2500
- package/dist/packages/pagination/index.js.map +0 -7
- package/dist/packages/pagination/locales/da/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/da/messages.mjs +0 -1
- package/dist/packages/pagination/locales/en/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/en/messages.mjs +0 -1
- package/dist/packages/pagination/locales/fi/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/fi/messages.mjs +0 -1
- package/dist/packages/pagination/locales/nb/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/nb/messages.mjs +0 -1
- package/dist/packages/pagination/locales/sv/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/sv/messages.mjs +0 -1
- package/dist/packages/pagination/pagination.react.stories.d.ts +0 -21
- package/dist/packages/pagination/pagination.react.stories.js +0 -45
- package/dist/packages/pagination/pagination.stories.d.ts +0 -14
- package/dist/packages/pagination/pagination.stories.js +0 -56
- package/dist/packages/pagination/pagination.test.d.ts +0 -1
- package/dist/packages/pagination/pagination.test.js +0 -76
- package/dist/packages/pagination/react.d.ts +0 -5
- package/dist/packages/pagination/react.js +0 -15
- package/dist/packages/pagination/styles.d.ts +0 -1
- package/dist/packages/pagination/styles.js +0 -2
- package/dist/packages/rip-and-tear-checkbox/checkbox.d.ts +0 -66
- package/dist/packages/rip-and-tear-checkbox/checkbox.js +0 -2592
- package/dist/packages/rip-and-tear-checkbox/checkbox.js.map +0 -7
- package/dist/packages/rip-and-tear-checkbox/checkbox.stories.d.ts +0 -8
- package/dist/packages/rip-and-tear-checkbox/checkbox.stories.js +0 -11
- package/dist/packages/rip-and-tear-checkbox/index.d.ts +0 -1
- package/dist/packages/rip-and-tear-checkbox/index.js +0 -2592
- package/dist/packages/rip-and-tear-checkbox/index.js.map +0 -7
- package/dist/packages/rip-and-tear-checkbox/react.d.ts +0 -5
- package/dist/packages/rip-and-tear-checkbox/react.js +0 -15
- package/dist/packages/rip-and-tear-checkbox/rip-and-tear-checkbox.react.stories.d.ts +0 -12
- package/dist/packages/rip-and-tear-checkbox/rip-and-tear-checkbox.react.stories.js +0 -10
- package/dist/packages/rip-and-tear-checkbox/styles.d.ts +0 -0
- package/dist/packages/rip-and-tear-checkbox/styles.js +0 -0
- package/dist/packages/rip-and-tear-radio/base-element.d.ts +0 -46
- package/dist/packages/rip-and-tear-radio/base-element.js +0 -100
- package/dist/packages/rip-and-tear-radio/custom-error-validator.d.ts +0 -6
- package/dist/packages/rip-and-tear-radio/custom-error-validator.js +0 -22
- package/dist/packages/rip-and-tear-radio/form-associated-element.d.ts +0 -103
- package/dist/packages/rip-and-tear-radio/form-associated-element.js +0 -282
- package/dist/packages/rip-and-tear-radio/host-styles.d.ts +0 -1
- package/dist/packages/rip-and-tear-radio/host-styles.js +0 -12
- package/dist/packages/rip-and-tear-radio/index.d.ts +0 -1
- package/dist/packages/rip-and-tear-radio/index.js +0 -2649
- package/dist/packages/rip-and-tear-radio/index.js.map +0 -7
- package/dist/packages/rip-and-tear-radio/invalid.d.ts +0 -8
- package/dist/packages/rip-and-tear-radio/invalid.js +0 -5
- package/dist/packages/rip-and-tear-radio/math.d.ts +0 -1
- package/dist/packages/rip-and-tear-radio/math.js +0 -4
- package/dist/packages/rip-and-tear-radio/radio-group-styles.d.ts +0 -1
- package/dist/packages/rip-and-tear-radio/radio-group-styles.js +0 -59
- package/dist/packages/rip-and-tear-radio/radio-group-styles.js.map +0 -7
- package/dist/packages/rip-and-tear-radio/radio-group.d.ts +0 -72
- package/dist/packages/rip-and-tear-radio/radio-group.js +0 -2649
- package/dist/packages/rip-and-tear-radio/radio-group.js.map +0 -7
- package/dist/packages/rip-and-tear-radio/radio-styles.d.ts +0 -0
- package/dist/packages/rip-and-tear-radio/radio-styles.js +0 -1
- package/dist/packages/rip-and-tear-radio/radio-styles.js.map +0 -7
- package/dist/packages/rip-and-tear-radio/radio.d.ts +0 -38
- package/dist/packages/rip-and-tear-radio/radio.js +0 -2563
- package/dist/packages/rip-and-tear-radio/radio.js.map +0 -7
- package/dist/packages/rip-and-tear-radio/radio.stories.d.ts +0 -8
- package/dist/packages/rip-and-tear-radio/radio.stories.js +0 -2654
- package/dist/packages/rip-and-tear-radio/radio.stories.js.map +0 -7
- package/dist/packages/rip-and-tear-radio/react.d.ts +0 -9
- package/dist/packages/rip-and-tear-radio/react.js +0 -22
- package/dist/packages/rip-and-tear-radio/required-validator.d.ts +0 -11
- package/dist/packages/rip-and-tear-radio/required-validator.js +0 -34
- package/dist/packages/rip-and-tear-radio/rip-and-tear-radio.react.stories.d.ts +0 -9
- package/dist/packages/rip-and-tear-radio/rip-and-tear-radio.react.stories.js +0 -10
- package/dist/packages/rip-and-tear-radio/slot.d.ts +0 -20
- package/dist/packages/rip-and-tear-radio/slot.js +0 -71
- package/dist/packages/rip-and-tear-radio/watch.d.ts +0 -26
- package/dist/packages/rip-and-tear-radio/watch.js +0 -39
- package/dist/packages/slider/Slider.d.ts +0 -2
- package/dist/packages/slider/Slider.js +0 -8
- package/dist/packages/slider/SliderThumb.d.ts +0 -2
- package/dist/packages/slider/SliderThumb.js +0 -8
- package/dist/packages/slider/index.d.ts +0 -2
- package/dist/packages/slider/index.js +0 -2851
- package/dist/packages/slider/index.js.map +0 -7
- package/dist/packages/slider/oddbird-css-anchor-positioning.d.ts +0 -2
- package/dist/packages/slider/oddbird-css-anchor-positioning.js +0 -3
- package/dist/packages/slider/react.d.ts +0 -8
- package/dist/packages/slider/react.js +0 -20
- package/dist/packages/slider/slider-thumb.d.ts +0 -57
- package/dist/packages/slider/slider-thumb.js +0 -2705
- package/dist/packages/slider/slider-thumb.js.map +0 -7
- package/dist/packages/slider/slider.d.ts +0 -46
- package/dist/packages/slider/slider.js +0 -2587
- package/dist/packages/slider/slider.js.map +0 -7
- package/dist/packages/slider/slider.react.stories.d.ts +0 -18
- package/dist/packages/slider/slider.react.stories.js +0 -118
- package/dist/packages/slider/slider.stories.d.ts +0 -18
- package/dist/packages/slider/slider.stories.js +0 -197
- package/dist/packages/slider/slider.test.d.ts +0 -4
- package/dist/packages/slider/slider.test.js +0 -83
- package/dist/packages/slider/styles/w-slider-thumb.styles.d.ts +0 -1
- package/dist/packages/slider/styles/w-slider-thumb.styles.js +0 -167
- package/dist/packages/slider/styles/w-slider.styles.d.ts +0 -1
- package/dist/packages/slider/styles/w-slider.styles.js +0 -134
- package/dist/packages/slider/styles.d.ts +0 -1
- package/dist/packages/slider/styles.js +0 -2
- package/dist/packages/steps/index.d.ts +0 -36
- package/dist/packages/steps/index.js +0 -2465
- package/dist/packages/steps/index.js.map +0 -7
- package/dist/packages/steps/locales/da/messages.d.mts +0 -1
- package/dist/packages/steps/locales/da/messages.mjs +0 -1
- package/dist/packages/steps/locales/en/messages.d.mts +0 -1
- package/dist/packages/steps/locales/en/messages.mjs +0 -1
- package/dist/packages/steps/locales/fi/messages.d.mts +0 -1
- package/dist/packages/steps/locales/fi/messages.mjs +0 -1
- package/dist/packages/steps/locales/nb/messages.d.mts +0 -1
- package/dist/packages/steps/locales/nb/messages.mjs +0 -1
- package/dist/packages/steps/locales/sv/messages.d.mts +0 -1
- package/dist/packages/steps/locales/sv/messages.mjs +0 -1
- package/dist/packages/steps/react.d.ts +0 -3
- package/dist/packages/steps/react.js +0 -16
- package/dist/packages/steps/steps.react.stories.d.ts +0 -15
- package/dist/packages/steps/steps.react.stories.js +0 -112
- package/dist/packages/steps/steps.stories.d.ts +0 -12
- package/dist/packages/steps/steps.stories.js +0 -172
- package/dist/packages/steps/styles.d.ts +0 -1
- package/dist/packages/steps/styles.js +0 -2
- package/dist/packages/switch/index.d.ts +0 -15
- package/dist/packages/switch/index.js +0 -2455
- package/dist/packages/switch/index.js.map +0 -7
- package/dist/packages/switch/react.d.ts +0 -5
- package/dist/packages/switch/react.js +0 -15
- package/dist/packages/switch/styles.d.ts +0 -1
- package/dist/packages/switch/styles.js +0 -2
- package/dist/packages/switch/switch.react.stories.d.ts +0 -15
- package/dist/packages/switch/switch.react.stories.js +0 -29
- package/dist/packages/switch/switch.stories.d.ts +0 -9
- package/dist/packages/switch/switch.stories.js +0 -34
- package/dist/packages/tabs/index.d.ts +0 -4
- package/dist/packages/tabs/index.js +0 -2470
- package/dist/packages/tabs/index.js.map +0 -7
- package/dist/packages/tabs/react.d.ts +0 -12
- package/dist/packages/tabs/react.js +0 -31
- package/dist/packages/tabs/styles.d.ts +0 -1
- package/dist/packages/tabs/styles.js +0 -2
- package/dist/packages/tabs/tab-panel.d.ts +0 -20
- package/dist/packages/tabs/tab-panel.js +0 -2441
- package/dist/packages/tabs/tab-panel.js.map +0 -7
- package/dist/packages/tabs/tab.d.ts +0 -18
- package/dist/packages/tabs/tab.js +0 -2463
- package/dist/packages/tabs/tab.js.map +0 -7
- package/dist/packages/tabs/tabs.d.ts +0 -40
- package/dist/packages/tabs/tabs.js +0 -2448
- package/dist/packages/tabs/tabs.js.map +0 -7
- package/dist/packages/tabs/tabs.react.stories.d.ts +0 -15
- package/dist/packages/tabs/tabs.react.stories.js +0 -51
- package/dist/packages/tabs/tabs.stories.d.ts +0 -8
- package/dist/packages/tabs/tabs.stories.js +0 -2545
- package/dist/packages/tabs/tabs.stories.js.map +0 -7
- package/dist/packages/toast/index.js.map +0 -7
- package/dist/packages/toggle-styles.d.ts +0 -1
- package/dist/packages/toggle-styles.js +0 -109
- package/dist/packages/utils/index.js.map +0 -7
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StoryObj } from '@storybook/react';
|
|
3
|
-
import { DatePicker } from './react';
|
|
4
|
-
declare const _default: {
|
|
5
|
-
title: string;
|
|
6
|
-
render(args: Omit<React.HTMLAttributes<import("./datepicker").WarpDatepicker>, "label" | "onchange" | "onChange" | "render" | "renderOptions" | "connectedCallback" | "disconnectedCallback" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "form" | "input" | "name" | "value" | "updated" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "resetFormControl" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "month" | "calendar" | "wrapper" | "headerFormat" | "weekdayFormat" | "isDayDisabled" | "dayFormat" | "isCalendarOpen" | "navigationDate" | "locale" | "selectedDate" | "weeks" | "toggleButton" | "previousMonthButton" | "todayCell" | "selectedCell"> & {
|
|
7
|
-
onChange?: (e: Event) => void;
|
|
8
|
-
onchange?: (e: Event) => void;
|
|
9
|
-
} & Partial<Omit<import("./datepicker").WarpDatepicker, keyof HTMLElement>> & React.RefAttributes<import("./datepicker").WarpDatepicker>): React.JSX.Element;
|
|
10
|
-
component: import("@lit/react").ReactWebComponent<import("./datepicker").WarpDatepicker, {
|
|
11
|
-
onChange: string;
|
|
12
|
-
onchange: string;
|
|
13
|
-
}>;
|
|
14
|
-
};
|
|
15
|
-
export default _default;
|
|
16
|
-
export type Story = StoryObj<typeof DatePicker>;
|
|
17
|
-
export declare const Default: Story;
|
|
18
|
-
export declare const DisableCalendarDates: Story;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DatePicker } from './react';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Forms/Datepicker',
|
|
5
|
-
render(args) {
|
|
6
|
-
return (React.createElement("div", { style: { minHeight: '400px' } },
|
|
7
|
-
React.createElement(DatePicker, { ...args })));
|
|
8
|
-
},
|
|
9
|
-
component: DatePicker,
|
|
10
|
-
};
|
|
11
|
-
export const Default = {
|
|
12
|
-
args: {
|
|
13
|
-
label: 'Dato',
|
|
14
|
-
lang: 'nb',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
export const DisableCalendarDates = {
|
|
18
|
-
args: {
|
|
19
|
-
label: 'Dato',
|
|
20
|
-
lang: 'nb',
|
|
21
|
-
},
|
|
22
|
-
render(args) {
|
|
23
|
-
return (React.createElement("div", { style: { minHeight: '400px' } },
|
|
24
|
-
React.createElement(DatePicker, { ...args, isDayDisabled: (day) => day.getDay() === 0 })));
|
|
25
|
-
},
|
|
26
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
-
import '../button/index.js';
|
|
3
|
-
import type { WarpDatepicker } from './index.js';
|
|
4
|
-
import './index.js';
|
|
5
|
-
declare const args: Partial<WarpDatepicker> & {
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
};
|
|
8
|
-
declare const meta: Meta<typeof args>;
|
|
9
|
-
export default meta;
|
|
10
|
-
type Story = StoryObj<typeof args>;
|
|
11
|
-
export declare const Default: Story;
|
|
12
|
-
export declare const DisableCalendarDates: Story;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { spread } from '@open-wc/lit-helpers';
|
|
2
|
-
import { getStorybookHelpers } from '@wc-toolkit/storybook-helpers';
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
import { prespread } from '../../.storybook/utilities.js';
|
|
5
|
-
import '../button/index.js';
|
|
6
|
-
import './index.js';
|
|
7
|
-
const { events, args, argTypes } = getStorybookHelpers('w-datepicker');
|
|
8
|
-
const meta = {
|
|
9
|
-
title: 'Forms/Datepicker',
|
|
10
|
-
render(args) {
|
|
11
|
-
return html `
|
|
12
|
-
<!-- Workaround for Storybook's overflow hidden -->
|
|
13
|
-
<div style="min-height: 400px">
|
|
14
|
-
<w-datepicker ${spread(prespread(args))}></w-datepicker>
|
|
15
|
-
</div>
|
|
16
|
-
`;
|
|
17
|
-
},
|
|
18
|
-
args,
|
|
19
|
-
argTypes,
|
|
20
|
-
parameters: {
|
|
21
|
-
actions: {
|
|
22
|
-
handles: events,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
export default meta;
|
|
27
|
-
export const Default = {
|
|
28
|
-
args: {
|
|
29
|
-
label: 'Dato',
|
|
30
|
-
lang: 'nb',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
export const DisableCalendarDates = {
|
|
34
|
-
args: {
|
|
35
|
-
label: 'Dato',
|
|
36
|
-
lang: 'nb',
|
|
37
|
-
},
|
|
38
|
-
render(args) {
|
|
39
|
-
return html `
|
|
40
|
-
<!-- Workaround for Storybook's overflow hidden -->
|
|
41
|
-
<div style="min-height: 400px">
|
|
42
|
-
<w-datepicker ${spread(prespread(args))}></w-datepicker>
|
|
43
|
-
</div>
|
|
44
|
-
<script type="module">
|
|
45
|
-
const datePicker = document.querySelector('w-datepicker');
|
|
46
|
-
// No working on Sundays!
|
|
47
|
-
datePicker.isDayDisabled = (day) => day.getDay() === 0;
|
|
48
|
-
</script>
|
|
49
|
-
`;
|
|
50
|
-
},
|
|
51
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { server, userEvent } from '@vitest/browser/context';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import { expect, test } from 'vitest';
|
|
4
|
-
import { render } from 'vitest-browser-lit';
|
|
5
|
-
import '../button/index.js';
|
|
6
|
-
import './index.js';
|
|
7
|
-
test('can pick a date using a pointer', async () => {
|
|
8
|
-
const component = html `
|
|
9
|
-
<form data-testid="flight">
|
|
10
|
-
<w-datepicker label="From date" name="from"></w-datepicker>
|
|
11
|
-
</form>
|
|
12
|
-
`;
|
|
13
|
-
const page = render(component);
|
|
14
|
-
await expect.element(page.getByLabelText('From date')).not.toHaveValue();
|
|
15
|
-
await expect.element(page.getByTestId('calendar').query()).not.toBeVisible();
|
|
16
|
-
await page.getByRole('button').click({ force: true });
|
|
17
|
-
await expect.element(page.getByTestId('calendar')).toBeVisible();
|
|
18
|
-
await page.getByRole('gridcell').nth(15).click();
|
|
19
|
-
await expect
|
|
20
|
-
.element(page.getByTestId('calendar').query(), { message: 'expected calendar to close after clicking a date' })
|
|
21
|
-
.not.toBeVisible();
|
|
22
|
-
await expect.element(page.getByLabelText('From date')).toHaveValue();
|
|
23
|
-
const formData = new FormData(page.getByTestId('flight').element());
|
|
24
|
-
expect(formData.get('from')).toBeTruthy();
|
|
25
|
-
});
|
|
26
|
-
test.skipIf(server.browser === 'firefox')('can pick a date using a keyboard', async () => {
|
|
27
|
-
const component = html `
|
|
28
|
-
<form data-testid="flight">
|
|
29
|
-
<w-datepicker label="From date" name="from"></w-datepicker>
|
|
30
|
-
</form>
|
|
31
|
-
`;
|
|
32
|
-
const page = render(component);
|
|
33
|
-
await expect.element(page.getByLabelText('From date')).not.toHaveValue();
|
|
34
|
-
await expect.element(page.getByTestId('calendar').query()).not.toBeVisible();
|
|
35
|
-
const toggle = page.getByRole('button').element();
|
|
36
|
-
toggle.focus();
|
|
37
|
-
await userEvent.keyboard('[Enter]');
|
|
38
|
-
await expect.element(page.getByTestId('calendar')).toBeVisible();
|
|
39
|
-
page.getByRole('gridcell').nth(15).element().focus();
|
|
40
|
-
await userEvent.keyboard('[Enter]');
|
|
41
|
-
await expect
|
|
42
|
-
.element(page.getByTestId('calendar').query(), { message: 'expected calendar to close after clicking a date' })
|
|
43
|
-
.not.toBeVisible();
|
|
44
|
-
await expect.element(page.getByLabelText('From date')).toHaveValue();
|
|
45
|
-
const formData = new FormData(page.getByTestId('flight').element());
|
|
46
|
-
expect(formData.get('from')).toBeTruthy();
|
|
47
|
-
});
|
|
48
|
-
test('can pick a date by typing in the input field', async () => {
|
|
49
|
-
const component = html `
|
|
50
|
-
<form data-testid="flight">
|
|
51
|
-
<w-datepicker label="From date" name="from" lang="nb"></w-datepicker>
|
|
52
|
-
</form>
|
|
53
|
-
`;
|
|
54
|
-
const page = render(component);
|
|
55
|
-
await expect.element(page.getByLabelText('From date')).not.toHaveValue();
|
|
56
|
-
const toggle = page.getByLabelText('From date').element();
|
|
57
|
-
toggle.focus();
|
|
58
|
-
await page.getByLabelText('From date').fill('2025-01-01');
|
|
59
|
-
await expect.element(page.getByLabelText('From date')).toHaveValue();
|
|
60
|
-
const formData = new FormData(page.getByTestId('flight').element());
|
|
61
|
-
expect(formData.get('from')).toBeTruthy();
|
|
62
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './datepicker.js';
|