@daikin-oss/design-system-web-components 0.3.2 → 0.4.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 +63 -0
- package/dist/cjs/components/accordion/daikin-accordion.cjs +31 -6
- package/dist/cjs/components/accordion/daikin-accordion.d.ts +15 -9
- package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +105 -59
- package/dist/cjs/components/accordion-item/daikin-accordion-item.d.ts +28 -13
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.cjs +3 -6
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.d.ts +4 -0
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.cjs +38 -30
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +12 -2
- package/dist/cjs/components/button/daikin-button.cjs +89 -128
- package/dist/cjs/components/button/daikin-button.d.ts +30 -27
- package/dist/cjs/components/checkbox/daikin-checkbox.cjs +99 -119
- package/dist/cjs/components/checkbox/daikin-checkbox.d.ts +27 -38
- package/dist/cjs/components/icon/daikin-icon.d.ts +4 -0
- package/dist/cjs/components/icon/icons.json.cjs +20 -0
- package/dist/cjs/components/icon/icons.json.d.ts +20 -0
- package/dist/cjs/components/index.cjs +18 -8
- package/dist/cjs/components/index.d.ts +4 -2
- package/dist/cjs/components/input-group/daikin-input-group.cjs +1 -1
- package/dist/cjs/components/input-group/daikin-input-group.d.ts +6 -0
- package/dist/cjs/components/list/daikin-list.cjs +24 -0
- package/dist/cjs/components/list/daikin-list.d.ts +28 -0
- package/dist/cjs/components/list/index.cjs +7 -0
- package/dist/cjs/components/list/index.d.ts +1 -0
- package/dist/cjs/components/list-item/daikin-list-item.cjs +125 -0
- package/dist/cjs/components/list-item/daikin-list-item.d.ts +64 -0
- package/dist/cjs/components/list-item/index.cjs +7 -0
- package/dist/cjs/components/list-item/index.d.ts +1 -0
- package/dist/cjs/components/notification/daikin-notification.cjs +14 -15
- package/dist/cjs/components/notification/daikin-notification.d.ts +13 -11
- package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +53 -29
- package/dist/cjs/components/progress-bar/daikin-progress-bar.d.ts +32 -10
- package/dist/cjs/components/radio/daikin-radio.cjs +73 -92
- package/dist/cjs/components/radio/daikin-radio.d.ts +23 -39
- package/dist/cjs/components/tab/daikin-tab.cjs +41 -46
- package/dist/cjs/components/tab/daikin-tab.d.ts +12 -12
- package/dist/cjs/components/{panel-switcher/daikin-panel-switcher.cjs → tab-panels/daikin-tab-panels.cjs} +8 -8
- package/dist/{cjs-dev/components/panel-switcher/daikin-panel-switcher.d.ts → cjs/components/tab-panels/daikin-tab-panels.d.ts} +17 -11
- package/dist/cjs/components/tab-panels/index.cjs +7 -0
- package/dist/cjs/components/tab-panels/index.d.ts +1 -0
- package/dist/cjs/components/{tab-group/daikin-tab-group.cjs → tabs/daikin-tabs.cjs} +29 -35
- package/dist/cjs/components/{tab-group/daikin-tab-group.d.ts → tabs/daikin-tabs.d.ts} +27 -21
- package/dist/cjs/components/tabs/index.cjs +7 -0
- package/dist/cjs/components/tabs/index.d.ts +1 -0
- package/dist/cjs/components/text-input/daikin-text-input.cjs +4 -3
- package/dist/cjs/components/text-input/daikin-text-input.d.ts +5 -0
- package/dist/cjs/components/textarea/daikin-textarea.cjs +3 -3
- package/dist/cjs/components/textarea/daikin-textarea.d.ts +5 -0
- package/dist/cjs/components/toggle/daikin-toggle.cjs +44 -68
- package/dist/cjs/components/toggle/daikin-toggle.d.ts +15 -26
- package/dist/cjs/components/tooltip/daikin-tooltip.d.ts +4 -0
- package/dist/cjs/index.cjs +18 -8
- package/dist/cjs/tailwind.css.cjs +1 -1
- package/dist/cjs-dev/components/accordion/daikin-accordion.cjs +31 -6
- package/dist/cjs-dev/components/accordion/daikin-accordion.d.ts +15 -9
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +105 -59
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.d.ts +28 -13
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.cjs +3 -6
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.d.ts +4 -0
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.cjs +38 -30
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +12 -2
- package/dist/cjs-dev/components/button/daikin-button.cjs +89 -128
- package/dist/cjs-dev/components/button/daikin-button.d.ts +30 -27
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +99 -119
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.ts +27 -38
- package/dist/cjs-dev/components/icon/daikin-icon.d.ts +4 -0
- package/dist/cjs-dev/components/icon/icons.json.cjs +20 -0
- package/dist/cjs-dev/components/icon/icons.json.d.ts +20 -0
- package/dist/cjs-dev/components/index.cjs +18 -8
- package/dist/cjs-dev/components/index.d.ts +4 -2
- package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +1 -1
- package/dist/cjs-dev/components/input-group/daikin-input-group.d.ts +6 -0
- package/dist/cjs-dev/components/list/daikin-list.cjs +24 -0
- package/dist/cjs-dev/components/list/daikin-list.d.ts +28 -0
- package/dist/cjs-dev/components/list/index.cjs +7 -0
- package/dist/cjs-dev/components/list/index.d.ts +1 -0
- package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +125 -0
- package/dist/cjs-dev/components/list-item/daikin-list-item.d.ts +64 -0
- package/dist/cjs-dev/components/list-item/index.cjs +7 -0
- package/dist/cjs-dev/components/list-item/index.d.ts +1 -0
- package/dist/cjs-dev/components/notification/daikin-notification.cjs +14 -15
- package/dist/cjs-dev/components/notification/daikin-notification.d.ts +13 -11
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +53 -29
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.d.ts +32 -10
- package/dist/cjs-dev/components/radio/daikin-radio.cjs +73 -92
- package/dist/cjs-dev/components/radio/daikin-radio.d.ts +23 -39
- package/dist/cjs-dev/components/tab/daikin-tab.cjs +41 -46
- package/dist/cjs-dev/components/tab/daikin-tab.d.ts +12 -12
- package/dist/cjs-dev/components/{panel-switcher/daikin-panel-switcher.cjs → tab-panels/daikin-tab-panels.cjs} +9 -9
- package/dist/{cjs/components/panel-switcher/daikin-panel-switcher.d.ts → cjs-dev/components/tab-panels/daikin-tab-panels.d.ts} +17 -11
- package/dist/cjs-dev/components/tab-panels/index.cjs +7 -0
- package/dist/cjs-dev/components/tab-panels/index.d.ts +1 -0
- package/dist/cjs-dev/components/{tab-group/daikin-tab-group.cjs → tabs/daikin-tabs.cjs} +31 -37
- package/dist/{es-dev/components/tab-group/daikin-tab-group.d.ts → cjs-dev/components/tabs/daikin-tabs.d.ts} +27 -21
- package/dist/cjs-dev/components/tabs/index.cjs +7 -0
- package/dist/cjs-dev/components/tabs/index.d.ts +1 -0
- package/dist/cjs-dev/components/text-input/daikin-text-input.cjs +4 -3
- package/dist/cjs-dev/components/text-input/daikin-text-input.d.ts +5 -0
- package/dist/cjs-dev/components/textarea/daikin-textarea.cjs +3 -3
- package/dist/cjs-dev/components/textarea/daikin-textarea.d.ts +5 -0
- package/dist/cjs-dev/components/toggle/daikin-toggle.cjs +44 -68
- package/dist/cjs-dev/components/toggle/daikin-toggle.d.ts +15 -26
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.ts +4 -0
- package/dist/cjs-dev/index.cjs +18 -8
- package/dist/cjs-dev/tailwind.css.cjs +1 -1
- package/dist/es/components/accordion/daikin-accordion.d.ts +15 -9
- package/dist/es/components/accordion/daikin-accordion.js +32 -7
- package/dist/es/components/accordion-item/daikin-accordion-item.d.ts +28 -13
- package/dist/es/components/accordion-item/daikin-accordion-item.js +106 -60
- package/dist/es/components/breadcrumb/daikin-breadcrumb.d.ts +4 -0
- package/dist/es/components/breadcrumb/daikin-breadcrumb.js +3 -6
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +12 -2
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.js +38 -30
- package/dist/es/components/button/daikin-button.d.ts +30 -27
- package/dist/es/components/button/daikin-button.js +90 -129
- package/dist/es/components/checkbox/daikin-checkbox.d.ts +27 -38
- package/dist/es/components/checkbox/daikin-checkbox.js +101 -121
- package/dist/es/components/icon/daikin-icon.d.ts +4 -0
- package/dist/es/components/icon/icons.json.d.ts +20 -0
- package/dist/es/components/icon/icons.json.js +20 -0
- package/dist/es/components/index.d.ts +4 -2
- package/dist/es/components/index.js +8 -4
- package/dist/es/components/input-group/daikin-input-group.d.ts +6 -0
- package/dist/es/components/input-group/daikin-input-group.js +1 -1
- package/dist/es/components/list/daikin-list.d.ts +28 -0
- package/dist/es/components/list/daikin-list.js +25 -0
- package/dist/es/components/list/index.d.ts +1 -0
- package/dist/es/components/list/index.js +4 -0
- package/dist/es/components/list-item/daikin-list-item.d.ts +64 -0
- package/dist/es/components/list-item/daikin-list-item.js +126 -0
- package/dist/es/components/list-item/index.d.ts +1 -0
- package/dist/es/components/list-item/index.js +4 -0
- package/dist/es/components/notification/daikin-notification.d.ts +13 -11
- package/dist/es/components/notification/daikin-notification.js +15 -16
- package/dist/es/components/progress-bar/daikin-progress-bar.d.ts +32 -10
- package/dist/es/components/progress-bar/daikin-progress-bar.js +53 -29
- package/dist/es/components/radio/daikin-radio.d.ts +23 -39
- package/dist/es/components/radio/daikin-radio.js +74 -93
- package/dist/es/components/tab/daikin-tab.d.ts +12 -12
- package/dist/es/components/tab/daikin-tab.js +42 -47
- package/dist/es/components/{panel-switcher/daikin-panel-switcher.d.ts → tab-panels/daikin-tab-panels.d.ts} +17 -11
- package/dist/es/components/{panel-switcher/daikin-panel-switcher.js → tab-panels/daikin-tab-panels.js} +9 -9
- package/dist/es/components/tab-panels/index.d.ts +1 -0
- package/dist/es/components/tab-panels/index.js +4 -0
- package/dist/es/components/{tab-group/daikin-tab-group.d.ts → tabs/daikin-tabs.d.ts} +27 -21
- package/dist/es/components/{tab-group/daikin-tab-group.js → tabs/daikin-tabs.js} +30 -36
- package/dist/es/components/tabs/index.d.ts +1 -0
- package/dist/es/components/tabs/index.js +4 -0
- package/dist/es/components/text-input/daikin-text-input.d.ts +5 -0
- package/dist/es/components/text-input/daikin-text-input.js +4 -3
- package/dist/es/components/textarea/daikin-textarea.d.ts +5 -0
- package/dist/es/components/textarea/daikin-textarea.js +3 -3
- package/dist/es/components/toggle/daikin-toggle.d.ts +15 -26
- package/dist/es/components/toggle/daikin-toggle.js +45 -69
- package/dist/es/components/tooltip/daikin-tooltip.d.ts +4 -0
- package/dist/es/index.js +8 -4
- package/dist/es/tailwind.css.js +1 -1
- package/dist/es-dev/components/accordion/daikin-accordion.d.ts +15 -9
- package/dist/es-dev/components/accordion/daikin-accordion.js +32 -7
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.d.ts +28 -13
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +106 -60
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.d.ts +4 -0
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.js +3 -6
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +12 -2
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.js +38 -30
- package/dist/es-dev/components/button/daikin-button.d.ts +30 -27
- package/dist/es-dev/components/button/daikin-button.js +90 -129
- package/dist/es-dev/components/checkbox/daikin-checkbox.d.ts +27 -38
- package/dist/es-dev/components/checkbox/daikin-checkbox.js +101 -121
- package/dist/es-dev/components/icon/daikin-icon.d.ts +4 -0
- package/dist/es-dev/components/icon/icons.json.d.ts +20 -0
- package/dist/es-dev/components/icon/icons.json.js +20 -0
- package/dist/es-dev/components/index.d.ts +4 -2
- package/dist/es-dev/components/index.js +8 -4
- package/dist/es-dev/components/input-group/daikin-input-group.d.ts +6 -0
- package/dist/es-dev/components/input-group/daikin-input-group.js +1 -1
- package/dist/es-dev/components/list/daikin-list.d.ts +28 -0
- package/dist/es-dev/components/list/daikin-list.js +25 -0
- package/dist/es-dev/components/list/index.d.ts +1 -0
- package/dist/es-dev/components/list/index.js +4 -0
- package/dist/es-dev/components/list-item/daikin-list-item.d.ts +64 -0
- package/dist/es-dev/components/list-item/daikin-list-item.js +126 -0
- package/dist/es-dev/components/list-item/index.d.ts +1 -0
- package/dist/es-dev/components/list-item/index.js +4 -0
- package/dist/es-dev/components/notification/daikin-notification.d.ts +13 -11
- package/dist/es-dev/components/notification/daikin-notification.js +15 -16
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.d.ts +32 -10
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +53 -29
- package/dist/es-dev/components/radio/daikin-radio.d.ts +23 -39
- package/dist/es-dev/components/radio/daikin-radio.js +74 -93
- package/dist/es-dev/components/tab/daikin-tab.d.ts +12 -12
- package/dist/es-dev/components/tab/daikin-tab.js +42 -47
- package/dist/es-dev/components/{panel-switcher/daikin-panel-switcher.d.ts → tab-panels/daikin-tab-panels.d.ts} +17 -11
- package/dist/es-dev/components/{panel-switcher/daikin-panel-switcher.js → tab-panels/daikin-tab-panels.js} +10 -10
- package/dist/es-dev/components/tab-panels/index.d.ts +1 -0
- package/dist/es-dev/components/tab-panels/index.js +4 -0
- package/dist/{cjs-dev/components/tab-group/daikin-tab-group.d.ts → es-dev/components/tabs/daikin-tabs.d.ts} +27 -21
- package/dist/es-dev/components/{tab-group/daikin-tab-group.js → tabs/daikin-tabs.js} +32 -38
- package/dist/es-dev/components/tabs/index.d.ts +1 -0
- package/dist/es-dev/components/tabs/index.js +4 -0
- package/dist/es-dev/components/text-input/daikin-text-input.d.ts +5 -0
- package/dist/es-dev/components/text-input/daikin-text-input.js +4 -3
- package/dist/es-dev/components/textarea/daikin-textarea.d.ts +5 -0
- package/dist/es-dev/components/textarea/daikin-textarea.js +3 -3
- package/dist/es-dev/components/toggle/daikin-toggle.d.ts +15 -26
- package/dist/es-dev/components/toggle/daikin-toggle.js +45 -69
- package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +4 -0
- package/dist/es-dev/index.js +8 -4
- package/dist/es-dev/tailwind.css.js +1 -1
- package/icons/checkbox-indeterminate.svg +2 -2
- package/icons/chevron-down.svg +3 -0
- package/icons/chevron-left.svg +3 -0
- package/icons/chevron-right.svg +3 -0
- package/icons/chevron-up.svg +3 -0
- package/icons/status-error.svg +3 -0
- package/package.json +2 -1
- package/dist/cjs/components/panel-switcher/index.cjs +0 -7
- package/dist/cjs/components/panel-switcher/index.d.ts +0 -1
- package/dist/cjs/components/tab-group/index.cjs +0 -7
- package/dist/cjs/components/tab-group/index.d.ts +0 -1
- package/dist/cjs-dev/components/panel-switcher/index.cjs +0 -7
- package/dist/cjs-dev/components/panel-switcher/index.d.ts +0 -1
- package/dist/cjs-dev/components/tab-group/index.cjs +0 -7
- package/dist/cjs-dev/components/tab-group/index.d.ts +0 -1
- package/dist/es/components/panel-switcher/index.d.ts +0 -1
- package/dist/es/components/panel-switcher/index.js +0 -4
- package/dist/es/components/tab-group/index.d.ts +0 -1
- package/dist/es/components/tab-group/index.js +0 -4
- package/dist/es-dev/components/panel-switcher/index.d.ts +0 -1
- package/dist/es-dev/components/panel-switcher/index.js +0 -4
- package/dist/es-dev/components/tab-group/index.d.ts +0 -1
- package/dist/es-dev/components/tab-group/index.js +0 -4
- package/icons/accordion-chevron-up.svg +0 -3
- package/icons/radio-checked.svg +0 -4
- package/icons/radio-unchecked.svg +0 -4
- package/icons/status-negative.svg +0 -11
- /package/dist/cjs/components/{tab-group → tabs}/scroller.cjs +0 -0
- /package/dist/cjs/components/{tab-group → tabs}/scroller.d.ts +0 -0
- /package/dist/cjs-dev/components/{tab-group → tabs}/scroller.cjs +0 -0
- /package/dist/cjs-dev/components/{tab-group → tabs}/scroller.d.ts +0 -0
- /package/dist/es/components/{tab-group → tabs}/scroller.d.ts +0 -0
- /package/dist/es/components/{tab-group → tabs}/scroller.js +0 -0
- /package/dist/es-dev/components/{tab-group → tabs}/scroller.d.ts +0 -0
- /package/dist/es-dev/components/{tab-group → tabs}/scroller.js +0 -0
|
@@ -12,7 +12,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
12
12
|
if (kind && result) __defProp(target, key, result);
|
|
13
13
|
return result;
|
|
14
14
|
};
|
|
15
|
-
let
|
|
15
|
+
let DaikinTabs = class extends LitElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
18
|
this.value = "";
|
|
@@ -20,22 +20,21 @@ let DaikinTabGroup = class extends LitElement {
|
|
|
20
20
|
/**
|
|
21
21
|
* Emits `beforechange` event if necessary and returns whether we should proceed.
|
|
22
22
|
*
|
|
23
|
-
* 1. Check if `
|
|
23
|
+
* 1. Check if `newTab.value` is different from `value`.
|
|
24
24
|
* 2. Emit "beforechange" event.
|
|
25
|
-
* 3. Check
|
|
25
|
+
* 3. Check and return whether the event is canceled.
|
|
26
26
|
*
|
|
27
|
-
* @param
|
|
27
|
+
* @param newTab The newly active tab element.
|
|
28
28
|
* @returns `true` if we should proceed (event is emitted and not canceled). `false` otherwise.
|
|
29
29
|
*/
|
|
30
|
-
_emitBeforeChange(
|
|
31
|
-
if (this.value ===
|
|
30
|
+
_emitBeforeChange(newTab) {
|
|
31
|
+
if (this.value === newTab.value) {
|
|
32
32
|
return false;
|
|
33
33
|
}
|
|
34
34
|
if (!this.dispatchEvent(
|
|
35
35
|
new CustomEvent("beforechange", {
|
|
36
|
-
detail: {
|
|
36
|
+
detail: { newTab },
|
|
37
37
|
bubbles: true,
|
|
38
|
-
composed: true,
|
|
39
38
|
cancelable: true
|
|
40
39
|
})
|
|
41
40
|
)) {
|
|
@@ -46,18 +45,16 @@ let DaikinTabGroup = class extends LitElement {
|
|
|
46
45
|
/**
|
|
47
46
|
* Updates `this.value` and emit "change" event.
|
|
48
47
|
*
|
|
49
|
-
* @param
|
|
48
|
+
* @param newTab The newly active tab element.
|
|
50
49
|
*/
|
|
51
|
-
_updateValue(
|
|
50
|
+
_updateValue(newTab) {
|
|
51
|
+
this.value = newTab.value;
|
|
52
52
|
this.dispatchEvent(
|
|
53
|
-
new
|
|
54
|
-
detail: { oldValue: this.value, newValue },
|
|
53
|
+
new Event("change", {
|
|
55
54
|
bubbles: true,
|
|
56
|
-
composed: true,
|
|
57
55
|
cancelable: false
|
|
58
56
|
})
|
|
59
57
|
);
|
|
60
|
-
this.value = newValue;
|
|
61
58
|
}
|
|
62
59
|
/**
|
|
63
60
|
* Updates `daikin-tab` component(s)' properties in the slot.
|
|
@@ -80,13 +77,13 @@ let DaikinTabGroup = class extends LitElement {
|
|
|
80
77
|
selectedTab = tabs.find((tab) => !tab.disabled);
|
|
81
78
|
if (selectedTab) {
|
|
82
79
|
selectedTab.active = true;
|
|
83
|
-
this._updateValue(selectedTab
|
|
80
|
+
this._updateValue(selectedTab);
|
|
84
81
|
}
|
|
85
82
|
}
|
|
86
83
|
if (!selectedTab) {
|
|
87
84
|
{
|
|
88
85
|
console.warn(
|
|
89
|
-
`[daikin-
|
|
86
|
+
`[daikin-tabs] No tabs that can be activated! This may cause unexpected behavior.`
|
|
90
87
|
);
|
|
91
88
|
}
|
|
92
89
|
return;
|
|
@@ -94,14 +91,14 @@ let DaikinTabGroup = class extends LitElement {
|
|
|
94
91
|
scrollIntoViewOnlyParent(selectedTab);
|
|
95
92
|
}
|
|
96
93
|
/**
|
|
97
|
-
* Updates `daikin-
|
|
94
|
+
* Updates `daikin-tab-panels` component(s)' properties in the slot.
|
|
98
95
|
*
|
|
99
96
|
* Invoke when:
|
|
100
97
|
* - `this.value` is changed.
|
|
101
98
|
* - the default slot's content is changed.
|
|
102
99
|
* - the panel slot's content is changed.
|
|
103
100
|
*/
|
|
104
|
-
|
|
101
|
+
_updateTabPanels() {
|
|
105
102
|
const panelSwitchers = this._panelSwitchers;
|
|
106
103
|
const tabs = this._tabs;
|
|
107
104
|
const panels = Array.from(new Set(tabs.map((tab) => tab.value)));
|
|
@@ -124,13 +121,13 @@ let DaikinTabGroup = class extends LitElement {
|
|
|
124
121
|
if (this.value === tab.value) {
|
|
125
122
|
return;
|
|
126
123
|
}
|
|
127
|
-
if (!this._emitBeforeChange(tab
|
|
124
|
+
if (!this._emitBeforeChange(tab)) {
|
|
128
125
|
return;
|
|
129
126
|
}
|
|
130
127
|
for (const element of tabs) {
|
|
131
128
|
element.active = element === tab;
|
|
132
129
|
}
|
|
133
|
-
this._updateValue(tab
|
|
130
|
+
this._updateValue(tab);
|
|
134
131
|
}
|
|
135
132
|
/**
|
|
136
133
|
* Handles keyboard interactions in the tab list.
|
|
@@ -147,7 +144,7 @@ let DaikinTabGroup = class extends LitElement {
|
|
|
147
144
|
if (!tabs.some((tab) => !tab.disabled)) {
|
|
148
145
|
{
|
|
149
146
|
console.warn(
|
|
150
|
-
`[daikin-
|
|
147
|
+
`[daikin-tabs] No tabs that can be activated! This may cause unexpected behavior.`
|
|
151
148
|
);
|
|
152
149
|
}
|
|
153
150
|
return;
|
|
@@ -173,10 +170,10 @@ let DaikinTabGroup = class extends LitElement {
|
|
|
173
170
|
}
|
|
174
171
|
_handleSlotChange() {
|
|
175
172
|
this._updateTabs();
|
|
176
|
-
this.
|
|
173
|
+
this._updateTabPanels();
|
|
177
174
|
}
|
|
178
|
-
|
|
179
|
-
this.
|
|
175
|
+
_handleTabPanelsSlotChange() {
|
|
176
|
+
this._updateTabPanels();
|
|
180
177
|
}
|
|
181
178
|
render() {
|
|
182
179
|
return html`
|
|
@@ -188,10 +185,7 @@ let DaikinTabGroup = class extends LitElement {
|
|
|
188
185
|
>
|
|
189
186
|
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
190
187
|
</div>
|
|
191
|
-
<slot
|
|
192
|
-
name="panels"
|
|
193
|
-
@slotchange=${this._handlePanelSwitcherSlotChange}
|
|
194
|
-
></slot>
|
|
188
|
+
<slot name="panels" @slotchange=${this._handleTabPanelsSlotChange}></slot>
|
|
195
189
|
`;
|
|
196
190
|
}
|
|
197
191
|
updated(changedProperties) {
|
|
@@ -199,24 +193,24 @@ let DaikinTabGroup = class extends LitElement {
|
|
|
199
193
|
return;
|
|
200
194
|
}
|
|
201
195
|
this._updateTabs();
|
|
202
|
-
this.
|
|
196
|
+
this._updateTabPanels();
|
|
203
197
|
}
|
|
204
198
|
};
|
|
205
|
-
|
|
199
|
+
DaikinTabs.styles = css`
|
|
206
200
|
${unsafeCSS(tailwindStyles)}
|
|
207
201
|
`;
|
|
208
202
|
__decorateClass([
|
|
209
203
|
property({ type: String, reflect: true })
|
|
210
|
-
],
|
|
204
|
+
], DaikinTabs.prototype, "value", 2);
|
|
211
205
|
__decorateClass([
|
|
212
206
|
queryAssignedElements({ selector: "daikin-tab" })
|
|
213
|
-
],
|
|
207
|
+
], DaikinTabs.prototype, "_tabs", 2);
|
|
214
208
|
__decorateClass([
|
|
215
|
-
queryAssignedElements({ slot: "panels", selector: "daikin-
|
|
216
|
-
],
|
|
217
|
-
|
|
218
|
-
customElement("daikin-
|
|
219
|
-
],
|
|
209
|
+
queryAssignedElements({ slot: "panels", selector: "daikin-tab-panels" })
|
|
210
|
+
], DaikinTabs.prototype, "_panelSwitchers", 2);
|
|
211
|
+
DaikinTabs = __decorateClass([
|
|
212
|
+
customElement("daikin-tabs")
|
|
213
|
+
], DaikinTabs);
|
|
220
214
|
export {
|
|
221
|
-
|
|
215
|
+
DaikinTabs
|
|
222
216
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './daikin-tabs';
|
|
@@ -9,9 +9,14 @@ import { LitElement, PropertyValues } from 'lit';
|
|
|
9
9
|
* - `daikin-input-group` > `daikin-text-input`
|
|
10
10
|
*
|
|
11
11
|
* @fires change - A cloned event of a [change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) emitted from the inner `<input>` element.
|
|
12
|
+
* @fires input - A retargeted event of a [input event](https://developer.mozilla.org/en-US/docs/Web/API/Element/input_event).
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
*
|
|
16
|
+
* ```js
|
|
17
|
+
* import "@daikin-oss/design-system-web-components/components/text-input/index.js";
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
15
20
|
* ```html
|
|
16
21
|
* <!-- See `daikin-input-group` component for complete example. -->
|
|
17
22
|
* <daikin-text-input name="name"></daikin-text-input>
|
|
@@ -16,8 +16,8 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
16
16
|
};
|
|
17
17
|
const cvaInput = cva(
|
|
18
18
|
[
|
|
19
|
-
"w-
|
|
20
|
-
"h-
|
|
19
|
+
"w-full",
|
|
20
|
+
"h-full",
|
|
21
21
|
"text-daikinNeutral-900",
|
|
22
22
|
"border",
|
|
23
23
|
"border-solid",
|
|
@@ -99,7 +99,8 @@ DaikinTextInput.styles = css`
|
|
|
99
99
|
--text-input-outline-color-hover: #54c3f1;
|
|
100
100
|
|
|
101
101
|
display: block;
|
|
102
|
-
width:
|
|
102
|
+
width: 340px;
|
|
103
|
+
height: 48px;
|
|
103
104
|
}
|
|
104
105
|
`;
|
|
105
106
|
DaikinTextInput.formAssociated = true;
|
|
@@ -9,9 +9,14 @@ import { LitElement, PropertyValues } from 'lit';
|
|
|
9
9
|
* - `daikin-input-group` > `daikin-textarea`
|
|
10
10
|
*
|
|
11
11
|
* @fires change - A cloned event of a [change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) emitted from the inner `<textarea>` element.
|
|
12
|
+
* @fires input - A retargeted event of a [input event](https://developer.mozilla.org/en-US/docs/Web/API/Element/input_event).
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
*
|
|
16
|
+
* ```js
|
|
17
|
+
* import "@daikin-oss/design-system-web-components/components/textarea/index.js";
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
15
20
|
* ```html
|
|
16
21
|
* <!-- See `daikin-input-group` component for complete example. -->
|
|
17
22
|
* <daikin-textarea name="name"></daikin-textarea>
|
|
@@ -16,8 +16,8 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
16
16
|
};
|
|
17
17
|
const cvaTextarea = cva(
|
|
18
18
|
[
|
|
19
|
-
"w-
|
|
20
|
-
"h-
|
|
19
|
+
"w-full",
|
|
20
|
+
"h-full",
|
|
21
21
|
"text-daikinNeutral-900",
|
|
22
22
|
"border",
|
|
23
23
|
"border-solid",
|
|
@@ -125,7 +125,7 @@ DaikinTextarea.styles = css`
|
|
|
125
125
|
--text-input-background-color: #ffffff;
|
|
126
126
|
|
|
127
127
|
display: block;
|
|
128
|
-
width:
|
|
128
|
+
width: 340px;
|
|
129
129
|
height: 120px;
|
|
130
130
|
position: relative;
|
|
131
131
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
-
import { MergeVariantProps } from '../../type-utils';
|
|
3
|
-
declare const cvaToggle: (props?: ({
|
|
4
|
-
size?: "default" | "small" | null | undefined;
|
|
5
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
-
type ToggleVariantProps = MergeVariantProps<typeof cvaToggle>;
|
|
7
2
|
/**
|
|
8
3
|
* The toggle switch component is a UI element that allows users to switch between two states, typically "on" and "off".
|
|
9
4
|
* It functions similarly to a `daikin-checkbox` component but provides a more visually intuitive way to represent binary options.
|
|
@@ -14,41 +9,36 @@ type ToggleVariantProps = MergeVariantProps<typeof cvaToggle>;
|
|
|
14
9
|
*
|
|
15
10
|
* @example
|
|
16
11
|
*
|
|
12
|
+
* ```js
|
|
13
|
+
* import "@daikin-oss/design-system-web-components/components/toggle/index.js";
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
17
16
|
* ```html
|
|
18
17
|
* <daikin-toggle name="name" value="value"></daikin-toggle>
|
|
19
18
|
* ```
|
|
20
19
|
*/
|
|
21
20
|
export declare class DaikinToggle extends LitElement {
|
|
22
21
|
static readonly styles: import('lit').CSSResult;
|
|
23
|
-
static readonly formAssociated = true;
|
|
24
|
-
private _internals;
|
|
25
|
-
private _updateFormValue;
|
|
26
|
-
private _input;
|
|
27
|
-
private _handleChange;
|
|
28
22
|
/**
|
|
29
|
-
*
|
|
23
|
+
* Form name of the toggle switch.
|
|
30
24
|
*/
|
|
31
|
-
|
|
25
|
+
name: string;
|
|
32
26
|
/**
|
|
33
|
-
*
|
|
27
|
+
* Form value of the toggle switch.
|
|
34
28
|
*/
|
|
35
|
-
|
|
29
|
+
value: string;
|
|
36
30
|
/**
|
|
37
|
-
*
|
|
31
|
+
* Whether the toggle switch is turned on.
|
|
38
32
|
*/
|
|
39
33
|
checked: boolean;
|
|
40
34
|
/**
|
|
41
|
-
*
|
|
42
|
-
*/
|
|
43
|
-
name: string;
|
|
44
|
-
/**
|
|
45
|
-
* The value.
|
|
46
|
-
*/
|
|
47
|
-
value: string;
|
|
48
|
-
/**
|
|
49
|
-
* Specify whether the Toggle is in a error state
|
|
35
|
+
* Whether the toggle switch is disabled.
|
|
50
36
|
*/
|
|
51
|
-
|
|
37
|
+
disabled: boolean;
|
|
38
|
+
static readonly formAssociated = true;
|
|
39
|
+
private _internals;
|
|
40
|
+
private _updateFormValue;
|
|
41
|
+
private _handleChange;
|
|
52
42
|
render(): import('lit-html').TemplateResult<1>;
|
|
53
43
|
updated(changedProperties: PropertyValues<this>): void;
|
|
54
44
|
}
|
|
@@ -57,4 +47,3 @@ declare global {
|
|
|
57
47
|
"daikin-toggle": DaikinToggle;
|
|
58
48
|
}
|
|
59
49
|
}
|
|
60
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
2
|
import { css, unsafeCSS, LitElement, html } from "lit";
|
|
3
|
-
import {
|
|
3
|
+
import { property, customElement } from "lit/decorators.js";
|
|
4
4
|
import tailwindStyles from "../../tailwind.css.js";
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -12,79 +12,64 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
12
12
|
if (kind && result) __defProp(target, key, result);
|
|
13
13
|
return result;
|
|
14
14
|
};
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"before:h-5",
|
|
50
|
-
"before:w-5",
|
|
51
|
-
"before:top-[-3px]",
|
|
52
|
-
"before:bg-daikinNeutral-600",
|
|
53
|
-
"before:checked:bg-daikinBlue-500",
|
|
54
|
-
"before:checked:translate-x-3"
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
);
|
|
15
|
+
const TOGGLE_CLASS_NAME = cva([
|
|
16
|
+
"w-12",
|
|
17
|
+
"h-6",
|
|
18
|
+
"relative",
|
|
19
|
+
"bg-daikinNeutral-600",
|
|
20
|
+
"rounded-full",
|
|
21
|
+
"cursor-pointer",
|
|
22
|
+
"transition-colors",
|
|
23
|
+
"duration-300",
|
|
24
|
+
"appearance-none",
|
|
25
|
+
"enabled:hover:bg-daikinNeutral-400",
|
|
26
|
+
"enabled:active:bg-daikinNeutral-700",
|
|
27
|
+
"focus-visible:outline",
|
|
28
|
+
"focus-visible:outline-1",
|
|
29
|
+
"focus-visible:outline-offset-1",
|
|
30
|
+
"focus-visible:outline-daikinBlue-700",
|
|
31
|
+
"enabled:checked:bg-daikinBlue-500",
|
|
32
|
+
"enabled:checked:hover:bg-daikinBlue-300",
|
|
33
|
+
"enabled:checked:active:bg-daikinBlue-600",
|
|
34
|
+
"disabled:bg-daikinNeutral-200",
|
|
35
|
+
"disabled:cursor-default",
|
|
36
|
+
"before:size-4",
|
|
37
|
+
"before:m-auto",
|
|
38
|
+
"before:rounded-full",
|
|
39
|
+
"before:absolute",
|
|
40
|
+
"before:top-0",
|
|
41
|
+
"before:bottom-0",
|
|
42
|
+
"before:left-1",
|
|
43
|
+
"before:transition",
|
|
44
|
+
"before:duration-300",
|
|
45
|
+
"before:checked:translate-x-6",
|
|
46
|
+
"enabled:before:bg-white",
|
|
47
|
+
"disabled:before:bg-daikinNeutral-100"
|
|
48
|
+
])();
|
|
60
49
|
let DaikinToggle = class extends LitElement {
|
|
61
50
|
constructor() {
|
|
62
51
|
super(...arguments);
|
|
63
|
-
this._internals = this.attachInternals();
|
|
64
|
-
this.size = "default";
|
|
65
|
-
this.disabled = false;
|
|
66
|
-
this.checked = false;
|
|
67
52
|
this.name = "";
|
|
68
53
|
this.value = "";
|
|
69
|
-
this.
|
|
54
|
+
this.checked = false;
|
|
55
|
+
this.disabled = false;
|
|
56
|
+
this._internals = this.attachInternals();
|
|
70
57
|
}
|
|
71
58
|
_updateFormValue() {
|
|
72
59
|
this._internals.setFormValue(this.checked ? this.value : null);
|
|
73
60
|
}
|
|
74
61
|
_handleChange(event) {
|
|
75
|
-
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
62
|
+
this.checked = event.target.checked;
|
|
78
63
|
this._updateFormValue();
|
|
79
64
|
this.dispatchEvent(new Event("change", event));
|
|
80
65
|
}
|
|
81
66
|
render() {
|
|
82
|
-
const toggleClassName = cvaToggle({ size: this.size });
|
|
83
67
|
return html`<input
|
|
84
|
-
class=${
|
|
68
|
+
class=${TOGGLE_CLASS_NAME}
|
|
85
69
|
type="checkbox"
|
|
86
70
|
name=${this.name}
|
|
87
71
|
value=${this.value}
|
|
72
|
+
role="switch"
|
|
88
73
|
.checked=${this.checked}
|
|
89
74
|
?disabled=${this.disabled}
|
|
90
75
|
@change=${this._handleChange}
|
|
@@ -104,18 +89,6 @@ DaikinToggle.styles = css`
|
|
|
104
89
|
}
|
|
105
90
|
`;
|
|
106
91
|
DaikinToggle.formAssociated = true;
|
|
107
|
-
__decorateClass([
|
|
108
|
-
query("input")
|
|
109
|
-
], DaikinToggle.prototype, "_input", 2);
|
|
110
|
-
__decorateClass([
|
|
111
|
-
property({ type: String })
|
|
112
|
-
], DaikinToggle.prototype, "size", 2);
|
|
113
|
-
__decorateClass([
|
|
114
|
-
property({ type: Boolean, reflect: true })
|
|
115
|
-
], DaikinToggle.prototype, "disabled", 2);
|
|
116
|
-
__decorateClass([
|
|
117
|
-
property({ type: Boolean, reflect: true })
|
|
118
|
-
], DaikinToggle.prototype, "checked", 2);
|
|
119
92
|
__decorateClass([
|
|
120
93
|
property({ type: String, reflect: true })
|
|
121
94
|
], DaikinToggle.prototype, "name", 2);
|
|
@@ -124,7 +97,10 @@ __decorateClass([
|
|
|
124
97
|
], DaikinToggle.prototype, "value", 2);
|
|
125
98
|
__decorateClass([
|
|
126
99
|
property({ type: Boolean, reflect: true })
|
|
127
|
-
], DaikinToggle.prototype, "
|
|
100
|
+
], DaikinToggle.prototype, "checked", 2);
|
|
101
|
+
__decorateClass([
|
|
102
|
+
property({ type: Boolean, reflect: true })
|
|
103
|
+
], DaikinToggle.prototype, "disabled", 2);
|
|
128
104
|
DaikinToggle = __decorateClass([
|
|
129
105
|
customElement("daikin-toggle")
|
|
130
106
|
], DaikinToggle);
|
|
@@ -12,6 +12,10 @@ import { LitElement, PropertyValues } from 'lit';
|
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
*
|
|
15
|
+
* ```js
|
|
16
|
+
* import "@daikin-oss/design-system-web-components/components/tooltip/index.js";
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
15
19
|
* ```html
|
|
16
20
|
* </daikin-tooltip>
|
|
17
21
|
* <span slot="tooltip">This is a message</span>
|
package/dist/es-dev/index.js
CHANGED
|
@@ -7,12 +7,14 @@ import { DaikinButton } from "./components/button/daikin-button.js";
|
|
|
7
7
|
import { DaikinCheckbox } from "./components/checkbox/daikin-checkbox.js";
|
|
8
8
|
import { DaikinIcon, iconList } from "./components/icon/daikin-icon.js";
|
|
9
9
|
import { DaikinInputGroup } from "./components/input-group/daikin-input-group.js";
|
|
10
|
+
import { DaikinList } from "./components/list/daikin-list.js";
|
|
11
|
+
import { DaikinListItem } from "./components/list-item/daikin-list-item.js";
|
|
10
12
|
import { DaikinNotification } from "./components/notification/daikin-notification.js";
|
|
11
|
-
import { DaikinPanelSwitcher } from "./components/panel-switcher/daikin-panel-switcher.js";
|
|
12
13
|
import { DaikinProgressBar } from "./components/progress-bar/daikin-progress-bar.js";
|
|
13
14
|
import { DaikinRadio } from "./components/radio/daikin-radio.js";
|
|
14
15
|
import { DaikinTab } from "./components/tab/daikin-tab.js";
|
|
15
|
-
import {
|
|
16
|
+
import { DaikinTabPanels } from "./components/tab-panels/daikin-tab-panels.js";
|
|
17
|
+
import { DaikinTabs } from "./components/tabs/daikin-tabs.js";
|
|
16
18
|
import { DaikinTextInput } from "./components/text-input/daikin-text-input.js";
|
|
17
19
|
import { DaikinTextarea } from "./components/textarea/daikin-textarea.js";
|
|
18
20
|
import { DaikinToggle } from "./components/toggle/daikin-toggle.js";
|
|
@@ -26,12 +28,14 @@ export {
|
|
|
26
28
|
DaikinCheckbox,
|
|
27
29
|
DaikinIcon,
|
|
28
30
|
DaikinInputGroup,
|
|
31
|
+
DaikinList,
|
|
32
|
+
DaikinListItem,
|
|
29
33
|
DaikinNotification,
|
|
30
|
-
DaikinPanelSwitcher,
|
|
31
34
|
DaikinProgressBar,
|
|
32
35
|
DaikinRadio,
|
|
33
36
|
DaikinTab,
|
|
34
|
-
|
|
37
|
+
DaikinTabPanels,
|
|
38
|
+
DaikinTabs,
|
|
35
39
|
DaikinTextInput,
|
|
36
40
|
DaikinTextarea,
|
|
37
41
|
DaikinToggle,
|