@daikin-oss/design-system-web-components 0.6.0 → 0.7.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 +58 -0
- package/README.md +40 -23
- package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +8 -8
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.cjs +19 -80
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.d.cts +11 -23
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.cjs +25 -77
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.d.cts +14 -23
- package/dist/cjs/components/button/daikin-button.cjs +16 -15
- package/dist/cjs/components/button/daikin-button.d.cts +2 -2
- package/dist/cjs/components/card/daikin-card.cjs +63 -0
- package/dist/cjs/components/card/daikin-card.d.cts +42 -0
- package/dist/cjs/components/card/index.cjs +7 -0
- package/dist/cjs/components/card/index.d.cts +1 -0
- package/dist/cjs/components/card-footer/daikin-card-footer.cjs +33 -0
- package/dist/cjs/components/card-footer/daikin-card-footer.d.cts +29 -0
- package/dist/cjs/components/card-footer/index.cjs +7 -0
- package/dist/cjs/components/card-footer/index.d.cts +1 -0
- package/dist/cjs/components/card-header/daikin-card-header.cjs +59 -0
- package/dist/cjs/components/card-header/daikin-card-header.d.cts +31 -0
- package/dist/cjs/components/card-header/index.cjs +7 -0
- package/dist/cjs/components/card-header/index.d.cts +1 -0
- package/dist/cjs/components/checkbox/daikin-checkbox.cjs +29 -29
- package/dist/cjs/components/dropdown/daikin-dropdown.cjs +14 -14
- package/dist/cjs/components/dropdown-item/daikin-dropdown-item.cjs +9 -9
- package/dist/cjs/components/icon/daikin-icon.cjs +8 -8
- package/dist/cjs/components/icon/daikin-icon.d.cts +3 -3
- package/dist/cjs/components/icon-button/daikin-icon-button.cjs +21 -20
- package/dist/cjs/components/index.cjs +31 -0
- package/dist/cjs/components/index.d.cts +6 -0
- package/dist/cjs/components/input-group/daikin-input-group.cjs +61 -45
- package/dist/cjs/components/input-group/daikin-input-group.d.cts +10 -1
- package/dist/cjs/components/link/daikin-link.cjs +32 -50
- package/dist/cjs/components/list-item/daikin-list-item.cjs +8 -8
- package/dist/cjs/components/notification/daikin-notification.cjs +18 -19
- package/dist/cjs/components/pagination/daikin-pagination.cjs +22 -24
- package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +22 -12
- package/dist/cjs/components/progress-indicator/daikin-progress-indicator.cjs +1 -6
- package/dist/cjs/components/progress-indicator-item/daikin-progress-indicator-item.cjs +12 -12
- package/dist/cjs/components/radio/daikin-radio.cjs +12 -10
- package/dist/cjs/components/select/daikin-select.cjs +11 -11
- package/dist/cjs/components/tab/daikin-tab.cjs +13 -13
- package/dist/cjs/components/table/daikin-table.cjs +6 -6
- package/dist/cjs/components/table-cell/daikin-table-cell.cjs +2 -2
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.cjs +4 -5
- package/dist/cjs/components/tabs/daikin-tabs.cjs +1 -1
- package/dist/cjs/components/text-area/daikin-text-area.cjs +16 -14
- package/dist/cjs/components/text-field/daikin-text-field.cjs +14 -13
- package/dist/cjs/components/toggle/daikin-toggle.cjs +10 -10
- package/dist/cjs/components/tooltip/daikin-tooltip.cjs +3 -3
- package/dist/cjs/components/tooltip/daikin-tooltip.d.cts +1 -1
- package/dist/cjs/components/tree/common.cjs +90 -0
- package/dist/cjs/components/tree/common.d.cts +32 -0
- package/dist/cjs/components/tree/daikin-tree.cjs +109 -0
- package/dist/cjs/components/tree/daikin-tree.d.cts +74 -0
- package/dist/cjs/components/tree/index.cjs +7 -0
- package/dist/cjs/components/tree/index.d.cts +1 -0
- package/dist/cjs/components/tree-item/daikin-tree-item.cjs +197 -0
- package/dist/cjs/components/tree-item/daikin-tree-item.d.cts +95 -0
- package/dist/cjs/components/tree-item/index.cjs +8 -0
- package/dist/cjs/components/tree-item/index.d.cts +1 -0
- package/dist/cjs/components/tree-section/daikin-tree-section.cjs +245 -0
- package/dist/cjs/components/tree-section/daikin-tree-section.d.cts +119 -0
- package/dist/cjs/components/tree-section/index.cjs +7 -0
- package/dist/cjs/components/tree-section/index.d.cts +1 -0
- package/dist/cjs/index.cjs +31 -2
- package/dist/cjs/index.d.cts +0 -1
- package/dist/cjs/tailwind.css.cjs +1 -1
- package/dist/cjs/utils/is-simple-key.cjs +6 -0
- package/dist/cjs/utils/is-simple-key.d.cts +7 -0
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +8 -8
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.cjs +19 -80
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.d.cts +11 -23
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.cjs +25 -77
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.cts +14 -23
- package/dist/cjs-dev/components/button/daikin-button.cjs +16 -15
- package/dist/cjs-dev/components/button/daikin-button.d.cts +2 -2
- package/dist/cjs-dev/components/card/daikin-card.cjs +63 -0
- package/dist/cjs-dev/components/card/daikin-card.d.cts +42 -0
- package/dist/cjs-dev/components/card/index.cjs +7 -0
- package/dist/cjs-dev/components/card/index.d.cts +1 -0
- package/dist/cjs-dev/components/card-footer/daikin-card-footer.cjs +33 -0
- package/dist/cjs-dev/components/card-footer/daikin-card-footer.d.cts +29 -0
- package/dist/cjs-dev/components/card-footer/index.cjs +7 -0
- package/dist/cjs-dev/components/card-footer/index.d.cts +1 -0
- package/dist/cjs-dev/components/card-header/daikin-card-header.cjs +59 -0
- package/dist/cjs-dev/components/card-header/daikin-card-header.d.cts +31 -0
- package/dist/cjs-dev/components/card-header/index.cjs +7 -0
- package/dist/cjs-dev/components/card-header/index.d.cts +1 -0
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +29 -29
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.cjs +14 -14
- package/dist/cjs-dev/components/dropdown-item/daikin-dropdown-item.cjs +9 -9
- package/dist/cjs-dev/components/icon/daikin-icon.cjs +8 -8
- package/dist/cjs-dev/components/icon/daikin-icon.d.cts +3 -3
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.cjs +21 -20
- package/dist/cjs-dev/components/index.cjs +31 -0
- package/dist/cjs-dev/components/index.d.cts +6 -0
- package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +61 -45
- package/dist/cjs-dev/components/input-group/daikin-input-group.d.cts +10 -1
- package/dist/cjs-dev/components/link/daikin-link.cjs +32 -50
- package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +8 -8
- package/dist/cjs-dev/components/notification/daikin-notification.cjs +18 -19
- package/dist/cjs-dev/components/pagination/daikin-pagination.cjs +22 -24
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +22 -12
- package/dist/cjs-dev/components/progress-indicator/daikin-progress-indicator.cjs +1 -6
- package/dist/cjs-dev/components/progress-indicator-item/daikin-progress-indicator-item.cjs +12 -12
- package/dist/cjs-dev/components/radio/daikin-radio.cjs +12 -10
- package/dist/cjs-dev/components/select/daikin-select.cjs +11 -11
- package/dist/cjs-dev/components/tab/daikin-tab.cjs +13 -13
- package/dist/cjs-dev/components/table/daikin-table.cjs +6 -6
- package/dist/cjs-dev/components/table-cell/daikin-table-cell.cjs +2 -2
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.cjs +4 -5
- package/dist/cjs-dev/components/tabs/daikin-tabs.cjs +1 -1
- package/dist/cjs-dev/components/text-area/daikin-text-area.cjs +16 -14
- package/dist/cjs-dev/components/text-field/daikin-text-field.cjs +14 -13
- package/dist/cjs-dev/components/toggle/daikin-toggle.cjs +10 -10
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +3 -3
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.cts +1 -1
- package/dist/cjs-dev/components/tree/common.cjs +90 -0
- package/dist/cjs-dev/components/tree/common.d.cts +32 -0
- package/dist/cjs-dev/components/tree/daikin-tree.cjs +109 -0
- package/dist/cjs-dev/components/tree/daikin-tree.d.cts +74 -0
- package/dist/cjs-dev/components/tree/index.cjs +7 -0
- package/dist/cjs-dev/components/tree/index.d.cts +1 -0
- package/dist/cjs-dev/components/tree-item/daikin-tree-item.cjs +197 -0
- package/dist/cjs-dev/components/tree-item/daikin-tree-item.d.cts +95 -0
- package/dist/cjs-dev/components/tree-item/index.cjs +8 -0
- package/dist/cjs-dev/components/tree-item/index.d.cts +1 -0
- package/dist/cjs-dev/components/tree-section/daikin-tree-section.cjs +245 -0
- package/dist/cjs-dev/components/tree-section/daikin-tree-section.d.cts +119 -0
- package/dist/cjs-dev/components/tree-section/index.cjs +7 -0
- package/dist/cjs-dev/components/tree-section/index.d.cts +1 -0
- package/dist/cjs-dev/index.cjs +31 -2
- package/dist/cjs-dev/index.d.cts +0 -1
- package/dist/cjs-dev/tailwind.css.cjs +1 -1
- package/dist/cjs-dev/utils/is-simple-key.cjs +6 -0
- package/dist/cjs-dev/utils/is-simple-key.d.cts +7 -0
- package/dist/es/components/accordion-item/daikin-accordion-item.js +8 -8
- package/dist/es/components/breadcrumb/daikin-breadcrumb.d.ts +11 -23
- package/dist/es/components/breadcrumb/daikin-breadcrumb.js +20 -81
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +14 -23
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.js +26 -78
- package/dist/es/components/button/daikin-button.d.ts +2 -2
- package/dist/es/components/button/daikin-button.js +16 -15
- package/dist/es/components/card/daikin-card.d.ts +42 -0
- package/dist/es/components/card/daikin-card.js +64 -0
- package/dist/es/components/card/index.d.ts +1 -0
- package/dist/es/components/card/index.js +4 -0
- package/dist/es/components/card-footer/daikin-card-footer.d.ts +29 -0
- package/dist/es/components/card-footer/daikin-card-footer.js +34 -0
- package/dist/es/components/card-footer/index.d.ts +1 -0
- package/dist/es/components/card-footer/index.js +4 -0
- package/dist/es/components/card-header/daikin-card-header.d.ts +31 -0
- package/dist/es/components/card-header/daikin-card-header.js +60 -0
- package/dist/es/components/card-header/index.d.ts +1 -0
- package/dist/es/components/card-header/index.js +4 -0
- package/dist/es/components/checkbox/daikin-checkbox.js +29 -29
- package/dist/es/components/dropdown/daikin-dropdown.js +14 -14
- package/dist/es/components/dropdown-item/daikin-dropdown-item.js +9 -9
- package/dist/es/components/icon/daikin-icon.d.ts +3 -3
- package/dist/es/components/icon/daikin-icon.js +8 -8
- package/dist/es/components/icon-button/daikin-icon-button.js +21 -20
- package/dist/es/components/index.d.ts +6 -0
- package/dist/es/components/index.js +13 -0
- package/dist/es/components/input-group/daikin-input-group.d.ts +10 -1
- package/dist/es/components/input-group/daikin-input-group.js +61 -45
- package/dist/es/components/link/daikin-link.js +32 -50
- package/dist/es/components/list-item/daikin-list-item.js +8 -8
- package/dist/es/components/notification/daikin-notification.js +18 -19
- package/dist/es/components/pagination/daikin-pagination.js +22 -24
- package/dist/es/components/progress-bar/daikin-progress-bar.js +22 -12
- package/dist/es/components/progress-indicator/daikin-progress-indicator.js +1 -6
- package/dist/es/components/progress-indicator-item/daikin-progress-indicator-item.js +12 -12
- package/dist/es/components/radio/daikin-radio.js +12 -10
- package/dist/es/components/select/daikin-select.js +11 -11
- package/dist/es/components/tab/daikin-tab.js +13 -13
- package/dist/es/components/table/daikin-table.js +6 -6
- package/dist/es/components/table-cell/daikin-table-cell.js +2 -2
- package/dist/es/components/table-header-cell/daikin-table-header-cell.js +4 -5
- package/dist/es/components/tabs/daikin-tabs.js +1 -1
- package/dist/es/components/text-area/daikin-text-area.js +16 -14
- package/dist/es/components/text-field/daikin-text-field.js +14 -13
- package/dist/es/components/toggle/daikin-toggle.js +10 -10
- package/dist/es/components/tooltip/daikin-tooltip.d.ts +1 -1
- package/dist/es/components/tooltip/daikin-tooltip.js +3 -3
- package/dist/es/components/tree/common.d.ts +32 -0
- package/dist/es/components/tree/common.js +90 -0
- package/dist/es/components/tree/daikin-tree.d.ts +74 -0
- package/dist/es/components/tree/daikin-tree.js +110 -0
- package/dist/es/components/tree/index.d.ts +1 -0
- package/dist/es/components/tree/index.js +4 -0
- package/dist/es/components/tree-item/daikin-tree-item.d.ts +95 -0
- package/dist/es/components/tree-item/daikin-tree-item.js +198 -0
- package/dist/es/components/tree-item/index.d.ts +1 -0
- package/dist/es/components/tree-item/index.js +5 -0
- package/dist/es/components/tree-section/daikin-tree-section.d.ts +119 -0
- package/dist/es/components/tree-section/daikin-tree-section.js +246 -0
- package/dist/es/components/tree-section/index.d.ts +1 -0
- package/dist/es/components/tree-section/index.js +4 -0
- package/dist/es/index.d.ts +0 -1
- package/dist/es/index.js +13 -2
- package/dist/es/tailwind.css.js +1 -1
- package/dist/es/utils/is-simple-key.d.ts +7 -0
- package/dist/es/utils/is-simple-key.js +6 -0
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +8 -8
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.d.ts +11 -23
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.js +20 -81
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +14 -23
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.js +26 -78
- package/dist/es-dev/components/button/daikin-button.d.ts +2 -2
- package/dist/es-dev/components/button/daikin-button.js +16 -15
- package/dist/es-dev/components/card/daikin-card.d.ts +42 -0
- package/dist/es-dev/components/card/daikin-card.js +64 -0
- package/dist/es-dev/components/card/index.d.ts +1 -0
- package/dist/es-dev/components/card/index.js +4 -0
- package/dist/es-dev/components/card-footer/daikin-card-footer.d.ts +29 -0
- package/dist/es-dev/components/card-footer/daikin-card-footer.js +34 -0
- package/dist/es-dev/components/card-footer/index.d.ts +1 -0
- package/dist/es-dev/components/card-footer/index.js +4 -0
- package/dist/es-dev/components/card-header/daikin-card-header.d.ts +31 -0
- package/dist/es-dev/components/card-header/daikin-card-header.js +60 -0
- package/dist/es-dev/components/card-header/index.d.ts +1 -0
- package/dist/es-dev/components/card-header/index.js +4 -0
- package/dist/es-dev/components/checkbox/daikin-checkbox.js +29 -29
- package/dist/es-dev/components/dropdown/daikin-dropdown.js +14 -14
- package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.js +9 -9
- package/dist/es-dev/components/icon/daikin-icon.d.ts +3 -3
- package/dist/es-dev/components/icon/daikin-icon.js +8 -8
- package/dist/es-dev/components/icon-button/daikin-icon-button.js +21 -20
- package/dist/es-dev/components/index.d.ts +6 -0
- package/dist/es-dev/components/index.js +13 -0
- package/dist/es-dev/components/input-group/daikin-input-group.d.ts +10 -1
- package/dist/es-dev/components/input-group/daikin-input-group.js +61 -45
- package/dist/es-dev/components/link/daikin-link.js +32 -50
- package/dist/es-dev/components/list-item/daikin-list-item.js +8 -8
- package/dist/es-dev/components/notification/daikin-notification.js +18 -19
- package/dist/es-dev/components/pagination/daikin-pagination.js +22 -24
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +22 -12
- package/dist/es-dev/components/progress-indicator/daikin-progress-indicator.js +1 -6
- package/dist/es-dev/components/progress-indicator-item/daikin-progress-indicator-item.js +12 -12
- package/dist/es-dev/components/radio/daikin-radio.js +12 -10
- package/dist/es-dev/components/select/daikin-select.js +11 -11
- package/dist/es-dev/components/tab/daikin-tab.js +13 -13
- package/dist/es-dev/components/table/daikin-table.js +6 -6
- package/dist/es-dev/components/table-cell/daikin-table-cell.js +2 -2
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.js +4 -5
- package/dist/es-dev/components/tabs/daikin-tabs.js +1 -1
- package/dist/es-dev/components/text-area/daikin-text-area.js +16 -14
- package/dist/es-dev/components/text-field/daikin-text-field.js +14 -13
- package/dist/es-dev/components/toggle/daikin-toggle.js +10 -10
- package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +1 -1
- package/dist/es-dev/components/tooltip/daikin-tooltip.js +3 -3
- package/dist/es-dev/components/tree/common.d.ts +32 -0
- package/dist/es-dev/components/tree/common.js +90 -0
- package/dist/es-dev/components/tree/daikin-tree.d.ts +74 -0
- package/dist/es-dev/components/tree/daikin-tree.js +110 -0
- package/dist/es-dev/components/tree/index.d.ts +1 -0
- package/dist/es-dev/components/tree/index.js +4 -0
- package/dist/es-dev/components/tree-item/daikin-tree-item.d.ts +95 -0
- package/dist/es-dev/components/tree-item/daikin-tree-item.js +198 -0
- package/dist/es-dev/components/tree-item/index.d.ts +1 -0
- package/dist/es-dev/components/tree-item/index.js +5 -0
- package/dist/es-dev/components/tree-section/daikin-tree-section.d.ts +119 -0
- package/dist/es-dev/components/tree-section/daikin-tree-section.js +246 -0
- package/dist/es-dev/components/tree-section/index.d.ts +1 -0
- package/dist/es-dev/components/tree-section/index.js +4 -0
- package/dist/es-dev/index.d.ts +0 -1
- package/dist/es-dev/index.js +13 -2
- package/dist/es-dev/tailwind.css.js +1 -1
- package/dist/es-dev/utils/is-simple-key.d.ts +7 -0
- package/dist/es-dev/utils/is-simple-key.js +6 -0
- package/icons/sort.svg +1 -1
- package/icons/status-error.svg +1 -1
- package/package.json +8 -3
- package/dist/cjs/colors.cjs +0 -80
- package/dist/cjs/colors.d.cts +0 -69
- package/dist/cjs-dev/colors.cjs +0 -80
- package/dist/cjs-dev/colors.d.cts +0 -69
- package/dist/es/colors.d.ts +0 -69
- package/dist/es/colors.js +0 -80
- package/dist/es-dev/colors.d.ts +0 -69
- package/dist/es-dev/colors.js +0 -80
|
@@ -21,7 +21,7 @@ const cvaHeaderCell = cva(
|
|
|
21
21
|
"min-h-12",
|
|
22
22
|
"px-4",
|
|
23
23
|
"py-3",
|
|
24
|
-
"text-
|
|
24
|
+
"text-ddt-color-common-text-primary",
|
|
25
25
|
"font-bold"
|
|
26
26
|
],
|
|
27
27
|
{
|
|
@@ -34,15 +34,14 @@ const cvaHeaderCell = cva(
|
|
|
34
34
|
sortable: {
|
|
35
35
|
false: [],
|
|
36
36
|
true: [
|
|
37
|
-
"hover:bg-
|
|
38
|
-
"active:bg-
|
|
37
|
+
"hover:bg-ddt-color-common-surface-hover",
|
|
38
|
+
"active:bg-ddt-color-common-surface-press",
|
|
39
39
|
"focus-visible:outline",
|
|
40
40
|
"focus-visible:outline-2",
|
|
41
41
|
"focus-visible:-outline-offset-2",
|
|
42
|
-
"focus-visible:outline-
|
|
42
|
+
"focus-visible:outline-ddt-color-common-border-focus",
|
|
43
43
|
"after:flex-none",
|
|
44
44
|
"after:size-6",
|
|
45
|
-
"after:text-system-element-text-primary",
|
|
46
45
|
"after:i-daikin-sort"
|
|
47
46
|
]
|
|
48
47
|
}
|
|
@@ -178,7 +178,7 @@ let DaikinTabs = class extends LitElement {
|
|
|
178
178
|
render() {
|
|
179
179
|
return html`
|
|
180
180
|
<div
|
|
181
|
-
class="flex flex-nowrap w-full p-[3px] overflow-auto relative before:absolute before:h-[1px] before:inset-[3px] before:top-auto before:bg-
|
|
181
|
+
class="flex flex-nowrap w-full p-[3px] overflow-auto relative before:absolute before:h-[1px] before:inset-[3px] before:top-auto before:bg-ddt-color-divider"
|
|
182
182
|
role="tablist"
|
|
183
183
|
@click=${this._handleTabClick}
|
|
184
184
|
@keydown=${this._handleKeyDown}
|
|
@@ -17,15 +17,16 @@ const cvaTextArea = cva(
|
|
|
17
17
|
[
|
|
18
18
|
"w-full",
|
|
19
19
|
"h-full",
|
|
20
|
+
"bg-ddt-color-common-background-default",
|
|
20
21
|
"px-4",
|
|
21
22
|
"py-3",
|
|
22
23
|
"rounded",
|
|
23
24
|
"font-daikinSerif",
|
|
24
25
|
"outline",
|
|
25
26
|
"outline-[--color-border]",
|
|
26
|
-
"outline-
|
|
27
|
-
"-outline-offset-
|
|
28
|
-
"placeholder:text-
|
|
27
|
+
"outline-1",
|
|
28
|
+
"-outline-offset-1",
|
|
29
|
+
"placeholder:text-ddt-color-common-text-secondary",
|
|
29
30
|
// Define `--color-border` as a CSS variable that references `--color-state-focus` and `--color-base` in that order.
|
|
30
31
|
// `--color-base` indicates the color of the border when the element is normal, hovered, or disabled.
|
|
31
32
|
"define-[--color-state-active,--color-state-focus,--color-base]/color-border",
|
|
@@ -33,23 +34,24 @@ const cvaTextArea = cva(
|
|
|
33
34
|
"border-[--color-border]",
|
|
34
35
|
// Update `--color-base` depending on the state.
|
|
35
36
|
// The default `--color-base` and `--color-state-focus` values are defined in `variants.error` because they differ depending on whether or not the input has an error state.
|
|
36
|
-
"enabled:text-
|
|
37
|
-
"enabled:hover:bg-
|
|
38
|
-
"enabled:active:bg-
|
|
37
|
+
"enabled:text-ddt-color-common-text-primary",
|
|
38
|
+
"enabled:hover:bg-ddt-color-common-surface-hover",
|
|
39
|
+
"enabled:active:bg-ddt-color-common-surface-press",
|
|
39
40
|
"focus-visible:outline-2",
|
|
40
|
-
"
|
|
41
|
-
"disabled:
|
|
42
|
-
"disabled:
|
|
43
|
-
"disabled:
|
|
41
|
+
"focus-visible:-outline-offset-2",
|
|
42
|
+
"disabled:var-color-ddt-color-common-disabled/color-base",
|
|
43
|
+
"disabled:text-ddt-color-common-disabled",
|
|
44
|
+
"disabled:bg-color-common-background-default",
|
|
45
|
+
"disabled:placeholder:text-ddt-color-common-disabled"
|
|
44
46
|
],
|
|
45
47
|
{
|
|
46
48
|
variants: {
|
|
47
49
|
error: {
|
|
48
50
|
false: [
|
|
49
|
-
"enabled:var-color-
|
|
50
|
-
"focus-visible:var-color-
|
|
51
|
+
"enabled:var-color-ddt-color-common-neutral-default/color-base",
|
|
52
|
+
"focus-visible:var-color-ddt-color-common-border-focus/color-state-focus"
|
|
51
53
|
],
|
|
52
|
-
true: ["enabled:var-color-
|
|
54
|
+
true: ["enabled:var-color-ddt-color-common-danger-default/color-base"]
|
|
53
55
|
},
|
|
54
56
|
resize: {
|
|
55
57
|
false: ["resize-none"],
|
|
@@ -110,7 +112,7 @@ let DaikinTextArea = class extends LitElement {
|
|
|
110
112
|
this._updateValue(this.value);
|
|
111
113
|
}
|
|
112
114
|
reflectInputGroup(inputGroup) {
|
|
113
|
-
const isError = !inputGroup.disabled && !!inputGroup.error;
|
|
115
|
+
const isError = !inputGroup.disabled && (!!inputGroup.error || !!inputGroup.textareaLimitExceeded);
|
|
114
116
|
this.disabled = !!inputGroup.disabled;
|
|
115
117
|
this.required = !!inputGroup.required;
|
|
116
118
|
this.error = isError;
|
|
@@ -19,6 +19,7 @@ const cvaInput = cva(
|
|
|
19
19
|
"items-center",
|
|
20
20
|
"w-full",
|
|
21
21
|
"h-full",
|
|
22
|
+
"bg-ddt-color-common-background-default",
|
|
22
23
|
"relative",
|
|
23
24
|
"px-2",
|
|
24
25
|
"rounded",
|
|
@@ -28,7 +29,7 @@ const cvaInput = cva(
|
|
|
28
29
|
"outline-[--color-border]",
|
|
29
30
|
"outline-0",
|
|
30
31
|
"-outline-offset-2",
|
|
31
|
-
"placeholder:text-
|
|
32
|
+
"placeholder:text-ddt-color-common-text-secondary",
|
|
32
33
|
// Define `--color-border` as a CSS variable that references `--color-state-focus` and `--color-base` in that order.
|
|
33
34
|
// `--color-base` indicates the color of the border when the element is normal, hovered, or disabled.
|
|
34
35
|
"define-[--color-state-focus,--color-base]/color-border",
|
|
@@ -36,23 +37,23 @@ const cvaInput = cva(
|
|
|
36
37
|
"border-[--color-border]",
|
|
37
38
|
// Update `--color-base` depending on the state.
|
|
38
39
|
// The default `--color-base` and `--color-state-focus` values are defined in `variants.error` because they differ depending on whether or not the input has an error state.
|
|
39
|
-
"enabled:text-
|
|
40
|
-
"enabled:hover:bg-
|
|
41
|
-
"enabled:active:bg-
|
|
40
|
+
"enabled:text-ddt-color-common-text-primary",
|
|
41
|
+
"enabled:hover:bg-ddt-color-common-surface-hover",
|
|
42
|
+
"enabled:active:bg-ddt-color-common-surface-press",
|
|
42
43
|
"focus-visible:outline-2",
|
|
43
|
-
"disabled:var-color-
|
|
44
|
-
"disabled:text-
|
|
45
|
-
"disabled:bg-
|
|
46
|
-
"disabled:placeholder:text-
|
|
44
|
+
"disabled:var-color-ddt-color-common-disabled/color-base",
|
|
45
|
+
"disabled:text-ddt-color-common-disabled",
|
|
46
|
+
"disabled:bg-ddt-color-common-background-default",
|
|
47
|
+
"disabled:placeholder:text-ddt-color-common-disabled"
|
|
47
48
|
],
|
|
48
49
|
{
|
|
49
50
|
variants: {
|
|
50
51
|
error: {
|
|
51
52
|
false: [
|
|
52
|
-
"enabled:var-color-
|
|
53
|
-
"focus-visible:var-color-
|
|
53
|
+
"enabled:var-color-ddt-color-common-neutral-default/color-base",
|
|
54
|
+
"focus-visible:var-color-ddt-color-common-border-focus/color-state-focus"
|
|
54
55
|
],
|
|
55
|
-
true: ["enabled:var-color-
|
|
56
|
+
true: ["enabled:var-color-ddt-color-common-danger-default/color-base"]
|
|
56
57
|
},
|
|
57
58
|
leftIcon: {
|
|
58
59
|
false: ["pl-4"],
|
|
@@ -74,8 +75,8 @@ const cvaIcon = cva(
|
|
|
74
75
|
right: "right-3"
|
|
75
76
|
},
|
|
76
77
|
disabled: {
|
|
77
|
-
false: ["text-
|
|
78
|
-
true: ["text-
|
|
78
|
+
false: ["text-ddt-color-common-text-primary"],
|
|
79
|
+
true: ["text-ddt-color-common-disabled"]
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
}
|
|
@@ -16,22 +16,22 @@ const TOGGLE_CLASS_NAME = cva([
|
|
|
16
16
|
"w-12",
|
|
17
17
|
"h-6",
|
|
18
18
|
"relative",
|
|
19
|
-
"bg-
|
|
19
|
+
"bg-ddt-color-common-neutral-default",
|
|
20
20
|
"rounded-full",
|
|
21
21
|
"cursor-pointer",
|
|
22
22
|
"transition-colors",
|
|
23
23
|
"duration-300",
|
|
24
24
|
"appearance-none",
|
|
25
|
-
"enabled:hover:bg-
|
|
26
|
-
"enabled:active:bg-
|
|
25
|
+
"enabled:hover:bg-ddt-color-common-neutral-hover",
|
|
26
|
+
"enabled:active:bg-ddt-color-common-neutral-press",
|
|
27
27
|
"focus-visible:outline",
|
|
28
28
|
"focus-visible:outline-2",
|
|
29
29
|
"focus-visible:outline-offset-2",
|
|
30
|
-
"focus-visible:outline-
|
|
31
|
-
"enabled:checked:bg-
|
|
32
|
-
"enabled:checked:hover:bg-
|
|
33
|
-
"enabled:checked:active:bg-
|
|
34
|
-
"disabled:bg-
|
|
30
|
+
"focus-visible:outline-ddt-color-common-border-focus",
|
|
31
|
+
"enabled:checked:bg-ddt-color-common-brand-default",
|
|
32
|
+
"enabled:checked:hover:bg-ddt-color-common-brand-hover",
|
|
33
|
+
"enabled:checked:active:bg-ddt-color-common-brand-press",
|
|
34
|
+
"disabled:bg-ddt-color-common-disabled",
|
|
35
35
|
"disabled:cursor-default",
|
|
36
36
|
"before:size-4",
|
|
37
37
|
"before:m-auto",
|
|
@@ -43,8 +43,8 @@ const TOGGLE_CLASS_NAME = cva([
|
|
|
43
43
|
"before:transition",
|
|
44
44
|
"before:duration-300",
|
|
45
45
|
"before:checked:translate-x-6",
|
|
46
|
-
"enabled:before:bg-
|
|
47
|
-
"disabled:before:bg-
|
|
46
|
+
"enabled:before:bg-ddt-color-common-background-default",
|
|
47
|
+
"disabled:before:bg-ddt-color-common-surface-hover"
|
|
48
48
|
])();
|
|
49
49
|
let DaikinToggle = class extends LitElement {
|
|
50
50
|
constructor() {
|
|
@@ -8,7 +8,7 @@ import { LitElement, PropertyValues } from 'lit';
|
|
|
8
8
|
* @slot - A slot for the element to which the tooltip is attached (the trigger element).
|
|
9
9
|
* @slot description - A slot for the tooltip description content.
|
|
10
10
|
*
|
|
11
|
-
* @cssprop [--
|
|
11
|
+
* @cssprop [--ddc-tooltip-spacing=20px] - Spacing between the tooltip and the trigger
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
*
|
|
@@ -63,7 +63,7 @@ let DaikinTooltip = class extends LitElement {
|
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
window.CSS.registerProperty({
|
|
66
|
-
name: "--
|
|
66
|
+
name: "--ddc-tooltip-spacing",
|
|
67
67
|
syntax: "<length>",
|
|
68
68
|
inherits: true,
|
|
69
69
|
initialValue: "0px"
|
|
@@ -99,7 +99,7 @@ let DaikinTooltip = class extends LitElement {
|
|
|
99
99
|
render() {
|
|
100
100
|
var _a;
|
|
101
101
|
const spacing = parseInt(
|
|
102
|
-
((_a = this._hostStyles) == null ? void 0 : _a.getPropertyValue("--
|
|
102
|
+
((_a = this._hostStyles) == null ? void 0 : _a.getPropertyValue("--ddc-tooltip-spacing")) || DEFAULT_TOOLTIP_SPACING,
|
|
103
103
|
10
|
|
104
104
|
);
|
|
105
105
|
return html`<div class="relative inline-block">
|
|
@@ -158,7 +158,7 @@ DaikinTooltip.styles = css`
|
|
|
158
158
|
:host {
|
|
159
159
|
display: inline-block;
|
|
160
160
|
|
|
161
|
-
--
|
|
161
|
+
--ddc-tooltip-spacing: ${unsafeCSS(DEFAULT_TOOLTIP_SPACING)};
|
|
162
162
|
}
|
|
163
163
|
`;
|
|
164
164
|
__decorateClass([
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DaikinTreeItem } from "../tree-item/index.js";
|
|
2
|
+
import { DaikinTreeSection } from "../tree-section/index.js";
|
|
3
|
+
export type Direction = "up" | "down" | "left" | "right";
|
|
4
|
+
export type DirectionDispatched = Exclude<Direction, "right">;
|
|
5
|
+
export type TreeMoveFocusEventDetail = {
|
|
6
|
+
direction: DirectionDispatched;
|
|
7
|
+
};
|
|
8
|
+
export type TreeMoveFocusEvent = CustomEvent<TreeMoveFocusEventDetail>;
|
|
9
|
+
/**
|
|
10
|
+
* Get direction from key name.
|
|
11
|
+
* @param key `event.key` where `event` is `KeyboardEvent`
|
|
12
|
+
* @returns direction
|
|
13
|
+
*/
|
|
14
|
+
export declare function getDirectionFromKey(key: string): Direction | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* `tree-move-focus` event handler for `daikin-tree-section`.
|
|
17
|
+
*
|
|
18
|
+
* @param section `daikin-tree-section`
|
|
19
|
+
* @param event `TreeMoveFocusEvent`
|
|
20
|
+
* @param children Children in the slot.
|
|
21
|
+
*/
|
|
22
|
+
export declare function handleTreeMoveFocusSection(section: DaikinTreeSection, event: TreeMoveFocusEvent, children: readonly (DaikinTreeSection | DaikinTreeItem)[]): void;
|
|
23
|
+
/**
|
|
24
|
+
* `tree-move-focus` event handler for `daikin-tree`.
|
|
25
|
+
*
|
|
26
|
+
* @param event `TreeMoveFocusEvent`
|
|
27
|
+
* @param children Children in the slot.
|
|
28
|
+
*/
|
|
29
|
+
export declare function handleTreeMoveFocusRoot(event: TreeMoveFocusEvent, children: readonly (DaikinTreeSection | DaikinTreeItem)[]): void;
|
|
30
|
+
export declare function emitTreeMoveFocus(target: HTMLElement, direction: DirectionDispatched): void;
|
|
31
|
+
export declare function emitTreeSelect(target: HTMLElement): void;
|
|
32
|
+
export declare function emitTreeUnselect(target: HTMLElement): void;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
function getDirectionFromKey(key) {
|
|
2
|
+
return {
|
|
3
|
+
ArrowUp: "up",
|
|
4
|
+
ArrowDown: "down",
|
|
5
|
+
ArrowLeft: "left",
|
|
6
|
+
ArrowRight: "right"
|
|
7
|
+
}[key];
|
|
8
|
+
}
|
|
9
|
+
function handleTreeMoveFocusCommon(event, children) {
|
|
10
|
+
const moveOffset = {
|
|
11
|
+
up: -1,
|
|
12
|
+
down: 1,
|
|
13
|
+
left: 0
|
|
14
|
+
}[event.detail.direction];
|
|
15
|
+
if (!moveOffset) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const target = event.target;
|
|
19
|
+
const enabledChildren = children.filter(({ disabled }) => !disabled);
|
|
20
|
+
const focusedItemIndex = enabledChildren.findIndex((item) => item === target);
|
|
21
|
+
if (focusedItemIndex < 0) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
event.stopPropagation();
|
|
25
|
+
const child = enabledChildren[focusedItemIndex + moveOffset];
|
|
26
|
+
if (!child) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
if (moveOffset > 0) {
|
|
30
|
+
child.focus();
|
|
31
|
+
} else {
|
|
32
|
+
child.focusLastItem();
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
function handleTreeMoveFocusSection(section, event, children) {
|
|
37
|
+
const { direction } = event.detail;
|
|
38
|
+
if (direction === "left") {
|
|
39
|
+
event.stopPropagation();
|
|
40
|
+
section.focus();
|
|
41
|
+
} else {
|
|
42
|
+
const result = handleTreeMoveFocusCommon(event, children);
|
|
43
|
+
if (result === false) {
|
|
44
|
+
if (direction === "up") {
|
|
45
|
+
section.focus();
|
|
46
|
+
} else {
|
|
47
|
+
emitTreeMoveFocus(section, "down");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function handleTreeMoveFocusRoot(event, children) {
|
|
53
|
+
event.stopPropagation();
|
|
54
|
+
handleTreeMoveFocusCommon(event, children);
|
|
55
|
+
}
|
|
56
|
+
function emitTreeMoveFocus(target, direction) {
|
|
57
|
+
target.dispatchEvent(
|
|
58
|
+
new CustomEvent("tree-move-focus", {
|
|
59
|
+
detail: {
|
|
60
|
+
direction
|
|
61
|
+
},
|
|
62
|
+
composed: true,
|
|
63
|
+
bubbles: true
|
|
64
|
+
})
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
function emitTreeSelect(target) {
|
|
68
|
+
target.dispatchEvent(
|
|
69
|
+
new Event("tree-select", {
|
|
70
|
+
composed: true,
|
|
71
|
+
bubbles: true
|
|
72
|
+
})
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function emitTreeUnselect(target) {
|
|
76
|
+
target.dispatchEvent(
|
|
77
|
+
new Event("tree-unselect", {
|
|
78
|
+
composed: true,
|
|
79
|
+
bubbles: true
|
|
80
|
+
})
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
emitTreeMoveFocus,
|
|
85
|
+
emitTreeSelect,
|
|
86
|
+
emitTreeUnselect,
|
|
87
|
+
getDirectionFromKey,
|
|
88
|
+
handleTreeMoveFocusRoot,
|
|
89
|
+
handleTreeMoveFocusSection
|
|
90
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* The tree component is a component that creates a hierarchical list. You can create a hierarchical structure by placing tree section components and tree item components under the parent tree component.
|
|
4
|
+
*
|
|
5
|
+
* Hierarchy:
|
|
6
|
+
* - `daikin-tree` > `daikin-tree-section` > `daikin-tree-item`
|
|
7
|
+
* - `daikin-tree` > `daikin-tree-section` > `daikin-tree-section` ...
|
|
8
|
+
* - `daikin-tree` > `daikin-tree-item`
|
|
9
|
+
*
|
|
10
|
+
* @slot - A slot for tree sections and tree items. Place `daikin-tree-section` or `daikin-tree-item` elements here.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
*
|
|
14
|
+
* ```js
|
|
15
|
+
* import "@daikin-oss/design-system-web-components/components/tree/index.js";
|
|
16
|
+
* import "@daikin-oss/design-system-web-components/components/tree-item/index.js";
|
|
17
|
+
* import "@daikin-oss/design-system-web-components/components/tree-section/index.js";
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* ```html
|
|
21
|
+
* <daikin-tree>
|
|
22
|
+
* <daikin-tree-section>
|
|
23
|
+
* <span slot="label">Tree section 1</span>
|
|
24
|
+
* <daikin-tree-item>Tree item 1-1</daikin-tree-item>
|
|
25
|
+
* <daikin-tree-item>Tree item 1-2</daikin-tree-item>
|
|
26
|
+
* <daikin-tree-item>Tree item 1-3</daikin-tree-item>
|
|
27
|
+
* </daikin-tree-section>
|
|
28
|
+
* </daikin-tree>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare class DaikinTree extends LitElement {
|
|
32
|
+
static readonly styles: import('lit').CSSResult;
|
|
33
|
+
/**
|
|
34
|
+
* Whether or not to enable tree selection.
|
|
35
|
+
* When enabled, tree sections and items can be selected by click, and the `selected` property of the `daikin-tree` and its descendants will be automatically controlled.
|
|
36
|
+
* Even if this is disabled, you can still set the `selected` property of sections and items yourself.
|
|
37
|
+
*/
|
|
38
|
+
selectable: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The value of the currently selected tree section or tree item.
|
|
41
|
+
* Only used if `selectable` is `true`.
|
|
42
|
+
*/
|
|
43
|
+
selected: string | null;
|
|
44
|
+
private readonly _children;
|
|
45
|
+
private readonly _sections;
|
|
46
|
+
private _updateChildrenLevel;
|
|
47
|
+
private _updateSections;
|
|
48
|
+
private _handleSlotChange;
|
|
49
|
+
private _handleTreeMoveFocus;
|
|
50
|
+
private _handleTreeSelect;
|
|
51
|
+
private _handleTreeUnselect;
|
|
52
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
53
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
54
|
+
/**
|
|
55
|
+
* Calls `selectItem` for the tree sections and tree items of the child elements in the slot.
|
|
56
|
+
*
|
|
57
|
+
* @param value Tree item value.
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
60
|
+
selectItem(value: string | null): void;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the `value` of the currently selected section or item.
|
|
63
|
+
* If nothing is selected, returns `null`.
|
|
64
|
+
*
|
|
65
|
+
* @returns The `value` of the selected section or item (if any). `null` if there is none.
|
|
66
|
+
* @private
|
|
67
|
+
*/
|
|
68
|
+
getSelectedItem(): string | null;
|
|
69
|
+
}
|
|
70
|
+
declare global {
|
|
71
|
+
interface HTMLElementTagNameMap {
|
|
72
|
+
"daikin-tree": DaikinTree;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { css, unsafeCSS, LitElement, html } from "lit";
|
|
2
|
+
import { property, queryAssignedElements, customElement } from "lit/decorators.js";
|
|
3
|
+
import tailwindStyles from "../../tailwind.css.js";
|
|
4
|
+
import { handleTreeMoveFocusRoot } from "./common.js";
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12
|
+
if (kind && result) __defProp(target, key, result);
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
let DaikinTree = class extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.selectable = false;
|
|
19
|
+
this.selected = null;
|
|
20
|
+
}
|
|
21
|
+
_updateChildrenLevel() {
|
|
22
|
+
this._children.forEach((child) => child.level = 0);
|
|
23
|
+
}
|
|
24
|
+
_updateSections() {
|
|
25
|
+
this._sections.forEach((section) => {
|
|
26
|
+
section.selectable = this.selectable;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
_handleSlotChange() {
|
|
30
|
+
this._updateChildrenLevel();
|
|
31
|
+
this._updateSections();
|
|
32
|
+
}
|
|
33
|
+
_handleTreeMoveFocus(event) {
|
|
34
|
+
handleTreeMoveFocusRoot(event, this._children);
|
|
35
|
+
}
|
|
36
|
+
_handleTreeSelect(event) {
|
|
37
|
+
event.stopPropagation();
|
|
38
|
+
if (!this.selectable) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const target = event.target;
|
|
42
|
+
this.selected = target.value;
|
|
43
|
+
}
|
|
44
|
+
_handleTreeUnselect(event) {
|
|
45
|
+
event.stopPropagation();
|
|
46
|
+
this.selected = this.getSelectedItem();
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
return html`<div role="tree">
|
|
50
|
+
<slot
|
|
51
|
+
@slotchange=${this._handleSlotChange}
|
|
52
|
+
@tree-move-focus=${this._handleTreeMoveFocus}
|
|
53
|
+
@tree-select=${this._handleTreeSelect}
|
|
54
|
+
@tree-unselect=${this._handleTreeUnselect}
|
|
55
|
+
></slot>
|
|
56
|
+
</div>`;
|
|
57
|
+
}
|
|
58
|
+
updated(changedProperties) {
|
|
59
|
+
if (changedProperties.has("selectable")) {
|
|
60
|
+
this._updateSections();
|
|
61
|
+
}
|
|
62
|
+
if (changedProperties.has("selected") && this.selectable) {
|
|
63
|
+
this.selectItem(this.selected);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Calls `selectItem` for the tree sections and tree items of the child elements in the slot.
|
|
68
|
+
*
|
|
69
|
+
* @param value Tree item value.
|
|
70
|
+
* @private
|
|
71
|
+
*/
|
|
72
|
+
selectItem(value) {
|
|
73
|
+
this._children.forEach((child) => child.selectItem(value));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Returns the `value` of the currently selected section or item.
|
|
77
|
+
* If nothing is selected, returns `null`.
|
|
78
|
+
*
|
|
79
|
+
* @returns The `value` of the selected section or item (if any). `null` if there is none.
|
|
80
|
+
* @private
|
|
81
|
+
*/
|
|
82
|
+
getSelectedItem() {
|
|
83
|
+
return this._children.map((child) => child.getSelectedItem()).find((item) => !!item) ?? null;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
DaikinTree.styles = css`
|
|
87
|
+
${unsafeCSS(tailwindStyles)}
|
|
88
|
+
|
|
89
|
+
:host {
|
|
90
|
+
display: block;
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
93
|
+
__decorateClass([
|
|
94
|
+
property({ type: Boolean, reflect: true })
|
|
95
|
+
], DaikinTree.prototype, "selectable", 2);
|
|
96
|
+
__decorateClass([
|
|
97
|
+
property({ type: String, reflect: true })
|
|
98
|
+
], DaikinTree.prototype, "selected", 2);
|
|
99
|
+
__decorateClass([
|
|
100
|
+
queryAssignedElements({ selector: "daikin-tree-section,daikin-tree-item" })
|
|
101
|
+
], DaikinTree.prototype, "_children", 2);
|
|
102
|
+
__decorateClass([
|
|
103
|
+
queryAssignedElements({ selector: "daikin-tree-section" })
|
|
104
|
+
], DaikinTree.prototype, "_sections", 2);
|
|
105
|
+
DaikinTree = __decorateClass([
|
|
106
|
+
customElement("daikin-tree")
|
|
107
|
+
], DaikinTree);
|
|
108
|
+
export {
|
|
109
|
+
DaikinTree
|
|
110
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./daikin-tree.js";
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
export declare const cvaTreeChildren: (props?: ({
|
|
3
|
+
disabled?: boolean | null | undefined;
|
|
4
|
+
selected?: boolean | null | undefined;
|
|
5
|
+
icon?: boolean | null | undefined;
|
|
6
|
+
open?: boolean | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
/**
|
|
9
|
+
* The tree item component that can be used within `daikin-tree` and `daikin-tree-section` component.
|
|
10
|
+
*
|
|
11
|
+
* This can be placed either under the tree section or directly under the tree. Elements cannot be placed any deeper than tree item.
|
|
12
|
+
*
|
|
13
|
+
* Hierarchy:
|
|
14
|
+
* - `daikin-tree` > `daikin-tree-section` > `daikin-tree-item`
|
|
15
|
+
* - `daikin-tree` > `daikin-tree-item`
|
|
16
|
+
*
|
|
17
|
+
* @fires click - A retargeted event of a [click event](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event) emitted from the inner `<a>` or `<button>` element. Suppressed if `disabled` is true,
|
|
18
|
+
* @fires tree-move-focus - _Internal use._ A custom event used to move the focus within a tree.
|
|
19
|
+
*
|
|
20
|
+
* @slot - A slot for the tree item content.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
*
|
|
24
|
+
* ```js
|
|
25
|
+
* import "@daikin-oss/design-system-web-components/components/tree-item/index.js";
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* ```html
|
|
29
|
+
* <daikin-tree-item>Tree item</daikin-tree-item>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class DaikinTreeItem extends LitElement {
|
|
33
|
+
static readonly styles: import('lit').CSSResult;
|
|
34
|
+
/**
|
|
35
|
+
* Value of the tree item.
|
|
36
|
+
*/
|
|
37
|
+
value: string;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the tree item is disabled.
|
|
40
|
+
*/
|
|
41
|
+
disabled: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the tree item is selected.
|
|
44
|
+
* Ignored if disabled.
|
|
45
|
+
* Controlled by `daikin-tree` if its `selectable` is true.
|
|
46
|
+
* If the tree's `selected` is false, you can manually set this property to control the display of the selected state.
|
|
47
|
+
*/
|
|
48
|
+
selected: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* _Internal use._
|
|
51
|
+
* The current nesting depth when the root's children are 0.
|
|
52
|
+
* Automatically set by the parent.
|
|
53
|
+
*
|
|
54
|
+
* @private
|
|
55
|
+
*/
|
|
56
|
+
level: number;
|
|
57
|
+
private readonly _focusableRef;
|
|
58
|
+
private _handleKeyDown;
|
|
59
|
+
constructor();
|
|
60
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
61
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
62
|
+
/**
|
|
63
|
+
* Focuses on the inner button.
|
|
64
|
+
*
|
|
65
|
+
* @param options focus options
|
|
66
|
+
*/
|
|
67
|
+
focus(options?: FocusOptions): void;
|
|
68
|
+
/**
|
|
69
|
+
* Focuses on the inner button.
|
|
70
|
+
* This is provided to ensure consistency of the interface.
|
|
71
|
+
*
|
|
72
|
+
* @param options focus options
|
|
73
|
+
* @private
|
|
74
|
+
*/
|
|
75
|
+
focusLastItem(options?: FocusOptions): void;
|
|
76
|
+
/**
|
|
77
|
+
* Updates the selection state (`this.selected`) to true if the argument `value` matches `this.value`. Otherwise, sets it to false.
|
|
78
|
+
*
|
|
79
|
+
* @param value Tree item value.
|
|
80
|
+
* @private
|
|
81
|
+
*/
|
|
82
|
+
selectItem(value: string | null): void;
|
|
83
|
+
/**
|
|
84
|
+
* Returns `this.value` if selected, or `null` if not selected.
|
|
85
|
+
*
|
|
86
|
+
* @returns `this.value` if selected. `null` if not selected.
|
|
87
|
+
* @private
|
|
88
|
+
*/
|
|
89
|
+
getSelectedItem(): string | null;
|
|
90
|
+
}
|
|
91
|
+
declare global {
|
|
92
|
+
interface HTMLElementTagNameMap {
|
|
93
|
+
"daikin-tree-item": DaikinTreeItem;
|
|
94
|
+
}
|
|
95
|
+
}
|