@sky.ui/core 0.0.1
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/LICENSE.md +139 -0
- package/README.md +113 -0
- package/auto-import-loader.js +60 -0
- package/auto-import.js +93 -0
- package/dist/custom-elements.json +27051 -0
- package/dist/helper/controllers/animation-controller.d.ts +120 -0
- package/dist/helper/controllers/animation-controller.js +2 -0
- package/dist/helper/controllers/animation-controller.js.map +1 -0
- package/dist/helper/controllers/index.d.ts +2 -0
- package/dist/helper/controllers/popover-controller.d.ts +162 -0
- package/dist/helper/controllers/popover-controller.js +2 -0
- package/dist/helper/controllers/popover-controller.js.map +1 -0
- package/dist/helper/form-control-base.d.ts +1 -0
- package/dist/helper/iconify-offline.d.ts +73 -0
- package/dist/helper/iconify-offline.js +2 -0
- package/dist/helper/iconify-offline.js.map +1 -0
- package/dist/helper/index.d.ts +5 -0
- package/dist/helper/internals/form-control-base.d.ts +81 -0
- package/dist/helper/internals/form-control-base.js +2 -0
- package/dist/helper/internals/form-control-base.js.map +1 -0
- package/dist/helper/internals/index.d.ts +1 -0
- package/dist/helper/utils/color-resolver.d.ts +139 -0
- package/dist/helper/utils/color-resolver.js +2 -0
- package/dist/helper/utils/color-resolver.js.map +1 -0
- package/dist/helper/utils/index.d.ts +2 -0
- package/dist/helper/utils/size-resolver.d.ts +6 -0
- package/dist/helper/utils/size-resolver.js +2 -0
- package/dist/helper/utils/size-resolver.js.map +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/sky-accordion/index.d.ts +1 -0
- package/dist/sky-accordion/index.js +1 -0
- package/dist/sky-accordion/sky-accordion.d.ts +201 -0
- package/dist/sky-accordion/sky-accordion.js +85 -0
- package/dist/sky-accordion/sky-accordion.js.map +1 -0
- package/dist/sky-accordion-item/index.d.ts +1 -0
- package/dist/sky-accordion-item/index.js +1 -0
- package/dist/sky-accordion-item/sky-accordion-item.d.ts +161 -0
- package/dist/sky-accordion-item/sky-accordion-item.js +191 -0
- package/dist/sky-accordion-item/sky-accordion-item.js.map +1 -0
- package/dist/sky-alert/index.d.ts +1 -0
- package/dist/sky-alert/index.js +1 -0
- package/dist/sky-alert/sky-alert.d.ts +136 -0
- package/dist/sky-alert/sky-alert.js +292 -0
- package/dist/sky-alert/sky-alert.js.map +1 -0
- package/dist/sky-appbar/index.d.ts +1 -0
- package/dist/sky-appbar/index.js +1 -0
- package/dist/sky-appbar/sky-appbar.d.ts +84 -0
- package/dist/sky-appbar/sky-appbar.js +173 -0
- package/dist/sky-appbar/sky-appbar.js.map +1 -0
- package/dist/sky-avatar/index.d.ts +1 -0
- package/dist/sky-avatar/index.js +1 -0
- package/dist/sky-avatar/sky-avatar.d.ts +104 -0
- package/dist/sky-avatar/sky-avatar.js +152 -0
- package/dist/sky-avatar/sky-avatar.js.map +1 -0
- package/dist/sky-badge/index.d.ts +1 -0
- package/dist/sky-badge/index.js +1 -0
- package/dist/sky-badge/sky-badge.d.ts +154 -0
- package/dist/sky-badge/sky-badge.js +148 -0
- package/dist/sky-badge/sky-badge.js.map +1 -0
- package/dist/sky-breadcrumb/index.d.ts +1 -0
- package/dist/sky-breadcrumb/index.js +1 -0
- package/dist/sky-breadcrumb/sky-breadcrumb.d.ts +111 -0
- package/dist/sky-breadcrumb/sky-breadcrumb.js +230 -0
- package/dist/sky-breadcrumb/sky-breadcrumb.js.map +1 -0
- package/dist/sky-button/index.d.ts +1 -0
- package/dist/sky-button/index.js +1 -0
- package/dist/sky-button/sky-button.d.ts +118 -0
- package/dist/sky-button/sky-button.js +172 -0
- package/dist/sky-button/sky-button.js.map +1 -0
- package/dist/sky-button-group/index.d.ts +1 -0
- package/dist/sky-button-group/index.js +1 -0
- package/dist/sky-button-group/sky-button-group.d.ts +93 -0
- package/dist/sky-button-group/sky-button-group.js +281 -0
- package/dist/sky-button-group/sky-button-group.js.map +1 -0
- package/dist/sky-card/index.d.ts +1 -0
- package/dist/sky-card/index.js +1 -0
- package/dist/sky-card/sky-card.d.ts +143 -0
- package/dist/sky-card/sky-card.js +186 -0
- package/dist/sky-card/sky-card.js.map +1 -0
- package/dist/sky-carousel/index.d.ts +1 -0
- package/dist/sky-carousel/index.js +1 -0
- package/dist/sky-carousel/sky-carousel.d.ts +265 -0
- package/dist/sky-carousel/sky-carousel.js +211 -0
- package/dist/sky-carousel/sky-carousel.js.map +1 -0
- package/dist/sky-checkbox/index.d.ts +1 -0
- package/dist/sky-checkbox/index.js +1 -0
- package/dist/sky-checkbox/sky-checkbox.d.ts +165 -0
- package/dist/sky-checkbox/sky-checkbox.js +276 -0
- package/dist/sky-checkbox/sky-checkbox.js.map +1 -0
- package/dist/sky-chip/index.d.ts +1 -0
- package/dist/sky-chip/index.js +1 -0
- package/dist/sky-chip/sky-chip.d.ts +95 -0
- package/dist/sky-chip/sky-chip.js +210 -0
- package/dist/sky-chip/sky-chip.js.map +1 -0
- package/dist/sky-col/index.d.ts +1 -0
- package/dist/sky-col/index.js +1 -0
- package/dist/sky-col/sky-col.d.ts +84 -0
- package/dist/sky-col/sky-col.js +46 -0
- package/dist/sky-col/sky-col.js.map +1 -0
- package/dist/sky-combobox/index.d.ts +1 -0
- package/dist/sky-combobox/index.js +1 -0
- package/dist/sky-combobox/sky-combobox.d.ts +313 -0
- package/dist/sky-combobox/sky-combobox.js +1146 -0
- package/dist/sky-combobox/sky-combobox.js.map +1 -0
- package/dist/sky-counter/index.d.ts +1 -0
- package/dist/sky-counter/index.js +1 -0
- package/dist/sky-counter/sky-counter.d.ts +130 -0
- package/dist/sky-counter/sky-counter.js +101 -0
- package/dist/sky-counter/sky-counter.js.map +1 -0
- package/dist/sky-dialog/index.d.ts +1 -0
- package/dist/sky-dialog/index.js +1 -0
- package/dist/sky-dialog/sky-dialog.d.ts +237 -0
- package/dist/sky-dialog/sky-dialog.js +265 -0
- package/dist/sky-dialog/sky-dialog.js.map +1 -0
- package/dist/sky-divider/index.d.ts +1 -0
- package/dist/sky-divider/index.js +1 -0
- package/dist/sky-divider/sky-divider.d.ts +120 -0
- package/dist/sky-divider/sky-divider.js +42 -0
- package/dist/sky-divider/sky-divider.js.map +1 -0
- package/dist/sky-drawer/index.d.ts +1 -0
- package/dist/sky-drawer/index.js +1 -0
- package/dist/sky-drawer/sky-drawer.d.ts +161 -0
- package/dist/sky-drawer/sky-drawer.js +177 -0
- package/dist/sky-drawer/sky-drawer.js.map +1 -0
- package/dist/sky-dropdown/index.d.ts +1 -0
- package/dist/sky-dropdown/index.js +1 -0
- package/dist/sky-dropdown/sky-dropdown.d.ts +252 -0
- package/dist/sky-dropdown/sky-dropdown.js +58 -0
- package/dist/sky-dropdown/sky-dropdown.js.map +1 -0
- package/dist/sky-dropdown-item/index.d.ts +1 -0
- package/dist/sky-dropdown-item/index.js +1 -0
- package/dist/sky-dropdown-item/sky-dropdown-item.d.ts +207 -0
- package/dist/sky-dropdown-item/sky-dropdown-item.js +341 -0
- package/dist/sky-dropdown-item/sky-dropdown-item.js.map +1 -0
- package/dist/sky-flexbar/index.d.ts +1 -0
- package/dist/sky-flexbar/index.js +1 -0
- package/dist/sky-flexbar/sky-flexbar.d.ts +189 -0
- package/dist/sky-flexbar/sky-flexbar.js +148 -0
- package/dist/sky-flexbar/sky-flexbar.js.map +1 -0
- package/dist/sky-flexbox/index.d.ts +1 -0
- package/dist/sky-flexbox/index.js +1 -0
- package/dist/sky-flexbox/sky-flexbox.d.ts +156 -0
- package/dist/sky-flexbox/sky-flexbox.js +40 -0
- package/dist/sky-flexbox/sky-flexbox.js.map +1 -0
- package/dist/sky-flexcol/index.d.ts +1 -0
- package/dist/sky-flexcol/index.js +1 -0
- package/dist/sky-flexcol/sky-flexcol.d.ts +154 -0
- package/dist/sky-flexcol/sky-flexcol.js +14 -0
- package/dist/sky-flexcol/sky-flexcol.js.map +1 -0
- package/dist/sky-flexitem/index.d.ts +1 -0
- package/dist/sky-flexitem/index.js +1 -0
- package/dist/sky-flexitem/sky-flexitem.d.ts +114 -0
- package/dist/sky-flexitem/sky-flexitem.js +45 -0
- package/dist/sky-flexitem/sky-flexitem.js.map +1 -0
- package/dist/sky-form/index.d.ts +1 -0
- package/dist/sky-form/index.js +1 -0
- package/dist/sky-form/sky-form.d.ts +286 -0
- package/dist/sky-form/sky-form.js +66 -0
- package/dist/sky-form/sky-form.js.map +1 -0
- package/dist/sky-grid/index.d.ts +1 -0
- package/dist/sky-grid/index.js +1 -0
- package/dist/sky-grid/sky-grid.d.ts +78 -0
- package/dist/sky-grid/sky-grid.js +40 -0
- package/dist/sky-grid/sky-grid.js.map +1 -0
- package/dist/sky-icon/index.d.ts +1 -0
- package/dist/sky-icon/index.js +1 -0
- package/dist/sky-icon/ion-local.json.js +2 -0
- package/dist/sky-icon/ion-local.json.js.map +1 -0
- package/dist/sky-icon/sky-icon.d.ts +123 -0
- package/dist/sky-icon/sky-icon.js +40 -0
- package/dist/sky-icon/sky-icon.js.map +1 -0
- package/dist/sky-image/index.d.ts +1 -0
- package/dist/sky-image/index.js +1 -0
- package/dist/sky-image/sky-image.d.ts +102 -0
- package/dist/sky-image/sky-image.js +29 -0
- package/dist/sky-image/sky-image.js.map +1 -0
- package/dist/sky-input/index.d.ts +1 -0
- package/dist/sky-input/index.js +1 -0
- package/dist/sky-input/sky-input.d.ts +345 -0
- package/dist/sky-input/sky-input.js +820 -0
- package/dist/sky-input/sky-input.js.map +1 -0
- package/dist/sky-list/index.d.ts +1 -0
- package/dist/sky-list/index.js +1 -0
- package/dist/sky-list/sky-list.d.ts +85 -0
- package/dist/sky-list/sky-list.js +41 -0
- package/dist/sky-list/sky-list.js.map +1 -0
- package/dist/sky-listitem/index.d.ts +1 -0
- package/dist/sky-listitem/index.js +1 -0
- package/dist/sky-listitem/sky-listitem.d.ts +76 -0
- package/dist/sky-listitem/sky-listitem.js +104 -0
- package/dist/sky-listitem/sky-listitem.js.map +1 -0
- package/dist/sky-navbar/index.d.ts +1 -0
- package/dist/sky-navbar/index.js +1 -0
- package/dist/sky-navbar/sky-navbar.d.ts +207 -0
- package/dist/sky-navbar/sky-navbar.js +521 -0
- package/dist/sky-navbar/sky-navbar.js.map +1 -0
- package/dist/sky-navpanel/index.d.ts +1 -0
- package/dist/sky-navpanel/index.js +1 -0
- package/dist/sky-navpanel/sky-navpanel.d.ts +186 -0
- package/dist/sky-navpanel/sky-navpanel.js +404 -0
- package/dist/sky-navpanel/sky-navpanel.js.map +1 -0
- package/dist/sky-notification/index.d.ts +1 -0
- package/dist/sky-notification/index.js +1 -0
- package/dist/sky-notification/sky-notification.d.ts +152 -0
- package/dist/sky-notification/sky-notification.js +456 -0
- package/dist/sky-notification/sky-notification.js.map +1 -0
- package/dist/sky-otp/index.d.ts +1 -0
- package/dist/sky-otp/index.js +1 -0
- package/dist/sky-otp/sky-otp.d.ts +101 -0
- package/dist/sky-otp/sky-otp.js +96 -0
- package/dist/sky-otp/sky-otp.js.map +1 -0
- package/dist/sky-overlay/index.d.ts +1 -0
- package/dist/sky-overlay/index.js +1 -0
- package/dist/sky-overlay/sky-overlay.d.ts +71 -0
- package/dist/sky-overlay/sky-overlay.js +26 -0
- package/dist/sky-overlay/sky-overlay.js.map +1 -0
- package/dist/sky-pagination/index.d.ts +1 -0
- package/dist/sky-pagination/index.js +1 -0
- package/dist/sky-pagination/sky-pagination.d.ts +167 -0
- package/dist/sky-pagination/sky-pagination.js +453 -0
- package/dist/sky-pagination/sky-pagination.js.map +1 -0
- package/dist/sky-progress/index.d.ts +1 -0
- package/dist/sky-progress/index.js +1 -0
- package/dist/sky-progress/sky-progress.d.ts +70 -0
- package/dist/sky-progress/sky-progress.js +87 -0
- package/dist/sky-progress/sky-progress.js.map +1 -0
- package/dist/sky-radio/index.d.ts +1 -0
- package/dist/sky-radio/index.js +1 -0
- package/dist/sky-radio/sky-radio.d.ts +118 -0
- package/dist/sky-radio/sky-radio.js +109 -0
- package/dist/sky-radio/sky-radio.js.map +1 -0
- package/dist/sky-radio-group/index.d.ts +1 -0
- package/dist/sky-radio-group/index.js +1 -0
- package/dist/sky-radio-group/sky-radio-group.d.ts +186 -0
- package/dist/sky-radio-group/sky-radio-group.js +239 -0
- package/dist/sky-radio-group/sky-radio-group.js.map +1 -0
- package/dist/sky-range/index.d.ts +1 -0
- package/dist/sky-range/index.js +1 -0
- package/dist/sky-range/sky-range.d.ts +110 -0
- package/dist/sky-range/sky-range.js +196 -0
- package/dist/sky-range/sky-range.js.map +1 -0
- package/dist/sky-row/index.d.ts +1 -0
- package/dist/sky-row/index.js +1 -0
- package/dist/sky-row/sky-row.d.ts +57 -0
- package/dist/sky-row/sky-row.js +6 -0
- package/dist/sky-row/sky-row.js.map +1 -0
- package/dist/sky-serial/index.d.ts +1 -0
- package/dist/sky-serial/index.js +1 -0
- package/dist/sky-serial/sky-serial.d.ts +127 -0
- package/dist/sky-serial/sky-serial.js +133 -0
- package/dist/sky-serial/sky-serial.js.map +1 -0
- package/dist/sky-sheet/index.d.ts +1 -0
- package/dist/sky-sheet/index.js +1 -0
- package/dist/sky-sheet/sky-sheet.d.ts +70 -0
- package/dist/sky-sheet/sky-sheet.js +47 -0
- package/dist/sky-sheet/sky-sheet.js.map +1 -0
- package/dist/sky-skeleton/index.d.ts +1 -0
- package/dist/sky-skeleton/index.js +1 -0
- package/dist/sky-skeleton/sky-skeleton.d.ts +80 -0
- package/dist/sky-skeleton/sky-skeleton.js +233 -0
- package/dist/sky-skeleton/sky-skeleton.js.map +1 -0
- package/dist/sky-slider/index.d.ts +1 -0
- package/dist/sky-slider/index.js +1 -0
- package/dist/sky-slider/sky-slider.d.ts +96 -0
- package/dist/sky-slider/sky-slider.js +139 -0
- package/dist/sky-slider/sky-slider.js.map +1 -0
- package/dist/sky-speeddial/index.d.ts +1 -0
- package/dist/sky-speeddial/index.js +1 -0
- package/dist/sky-speeddial/sky-speeddial.d.ts +86 -0
- package/dist/sky-speeddial/sky-speeddial.js +154 -0
- package/dist/sky-speeddial/sky-speeddial.js.map +1 -0
- package/dist/sky-spinner/index.d.ts +1 -0
- package/dist/sky-spinner/index.js +1 -0
- package/dist/sky-spinner/sky-spinner.d.ts +87 -0
- package/dist/sky-spinner/sky-spinner.js +334 -0
- package/dist/sky-spinner/sky-spinner.js.map +1 -0
- package/dist/sky-steps/index.d.ts +1 -0
- package/dist/sky-steps/index.js +1 -0
- package/dist/sky-steps/sky-steps.d.ts +170 -0
- package/dist/sky-steps/sky-steps.js +455 -0
- package/dist/sky-steps/sky-steps.js.map +1 -0
- package/dist/sky-switch/index.d.ts +1 -0
- package/dist/sky-switch/index.js +1 -0
- package/dist/sky-switch/sky-switch.d.ts +116 -0
- package/dist/sky-switch/sky-switch.js +191 -0
- package/dist/sky-switch/sky-switch.js.map +1 -0
- package/dist/sky-tab/index.d.ts +1 -0
- package/dist/sky-tab/index.js +1 -0
- package/dist/sky-tab/sky-tab.d.ts +188 -0
- package/dist/sky-tab/sky-tab.js +390 -0
- package/dist/sky-tab/sky-tab.js.map +1 -0
- package/dist/sky-tab-button/index.d.ts +1 -0
- package/dist/sky-tab-button/index.js +1 -0
- package/dist/sky-tab-button/sky-tab-button.d.ts +114 -0
- package/dist/sky-tab-button/sky-tab-button.js +167 -0
- package/dist/sky-tab-button/sky-tab-button.js.map +1 -0
- package/dist/sky-theme-provider/index.d.ts +1 -0
- package/dist/sky-theme-provider/index.js +1 -0
- package/dist/sky-theme-provider/sky-theme-provider.d.ts +169 -0
- package/dist/sky-theme-provider/sky-theme-provider.js +12 -0
- package/dist/sky-theme-provider/sky-theme-provider.js.map +1 -0
- package/dist/sky-theme-switcher/index.d.ts +1 -0
- package/dist/sky-theme-switcher/index.js +1 -0
- package/dist/sky-theme-switcher/sky-theme-switcher.d.ts +92 -0
- package/dist/sky-theme-switcher/sky-theme-switcher.js +43 -0
- package/dist/sky-theme-switcher/sky-theme-switcher.js.map +1 -0
- package/dist/sky-tooltip/index.d.ts +1 -0
- package/dist/sky-tooltip/index.js +1 -0
- package/dist/sky-tooltip/sky-tooltip.d.ts +156 -0
- package/dist/sky-tooltip/sky-tooltip.js +242 -0
- package/dist/sky-tooltip/sky-tooltip.js.map +1 -0
- package/package.json +475 -0
- package/plugins/rollup-plugin.d.ts +19 -0
- package/plugins/rollup-plugin.js +129 -0
- package/plugins/vite-plugin.d.ts +22 -0
- package/plugins/vite-plugin.js +116 -0
- package/plugins/webpack-plugin.d.ts +12 -0
- package/plugins/webpack-plugin.js +46 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export type SkyFlexcolAlignSelf = "auto" | "flex-start" | "center" | "flex-end" | "stretch" | "baseline";
|
|
3
|
+
/**
|
|
4
|
+
* @element sky-flexcol
|
|
5
|
+
*
|
|
6
|
+
* @summary Flex column item for `sky-flexbox` layouts with responsive span controls.
|
|
7
|
+
*
|
|
8
|
+
* @status stable
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
*
|
|
11
|
+
* @documentation https://library.sky-ui.com/components/flexbox
|
|
12
|
+
*
|
|
13
|
+
* @slot - Default slot for column content.
|
|
14
|
+
*
|
|
15
|
+
* @property {number} span - Base number of columns to span.
|
|
16
|
+
* @property {number | undefined} spanLg - Span at large breakpoints.
|
|
17
|
+
* @property {number | undefined} spanMd - Span at medium breakpoints.
|
|
18
|
+
* @property {number | undefined} spanSm - Span at small breakpoints.
|
|
19
|
+
* @property {number | undefined} spanXs - Span at extra-small breakpoints.
|
|
20
|
+
* @property {number} grow - Flex grow factor.
|
|
21
|
+
* @property {number} shrink - Flex shrink factor.
|
|
22
|
+
* @property {string | null} basis - Flex basis override.
|
|
23
|
+
* @property {number | undefined} order - Flex order override.
|
|
24
|
+
* @property {SkyFlexcolAlignSelf | undefined} alignSelf - Cross-axis alignment override.
|
|
25
|
+
* @method refreshStyles Re-applies CSS custom properties from current values.
|
|
26
|
+
* @method getSpan Returns current base span value.
|
|
27
|
+
* @method setSpan Updates base span value and refreshes styles.
|
|
28
|
+
*
|
|
29
|
+
* @csspart col - The flex item wrapper.
|
|
30
|
+
*
|
|
31
|
+
* @Behavior
|
|
32
|
+
* - Designed to work within `<sky-flexbox>` containers
|
|
33
|
+
* - Supports responsive column spans with breakpoint attributes
|
|
34
|
+
* - Exposes all standard flex item properties
|
|
35
|
+
* - Automatically syncs properties to CSS custom properties
|
|
36
|
+
*
|
|
37
|
+
* - `span`: Base span across columns (1 to container's column count)
|
|
38
|
+
* - `span-lg`: Span at large screens (≤1200px)
|
|
39
|
+
* - `span-md`: Span at medium screens (≤992px)
|
|
40
|
+
* - `span-sm`: Span at small screens (≤768px)
|
|
41
|
+
* - `span-xs`: Span at extra-small screens (≤576px)
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```html
|
|
45
|
+
* <sky-flexbox col="12" gap="16px">
|
|
46
|
+
* <sky-flexcol span="8">
|
|
47
|
+
* <div class="card">Main Content</div>
|
|
48
|
+
* </sky-flexcol>
|
|
49
|
+
* <sky-flexcol span="4">
|
|
50
|
+
* <div class="card">Sidebar</div>
|
|
51
|
+
* </sky-flexcol>
|
|
52
|
+
* </sky-flexbox>
|
|
53
|
+
* ```
|
|
54
|
+
* ```vue
|
|
55
|
+
* <template>
|
|
56
|
+
* <sky-flexbox col="12" gap="16px">
|
|
57
|
+
* <sky-flexcol span="8" span-md="12">Main Content</sky-flexcol>
|
|
58
|
+
* <sky-flexcol span="4" span-md="12">Sidebar</sky-flexcol>
|
|
59
|
+
* </sky-flexbox>
|
|
60
|
+
* </template>
|
|
61
|
+
* ```
|
|
62
|
+
* ```jsx
|
|
63
|
+
* export default function Demo() {
|
|
64
|
+
* return (
|
|
65
|
+
* <sky-flexbox col="12" gap="16px">
|
|
66
|
+
* <sky-flexcol span="8" span-md="12">Main Content</sky-flexcol>
|
|
67
|
+
* <sky-flexcol span="4" span-md="12">Sidebar</sky-flexcol>
|
|
68
|
+
* </sky-flexbox>
|
|
69
|
+
* );
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare class SkyFlexcol extends LitElement {
|
|
74
|
+
/**
|
|
75
|
+
* Number of columns to span.
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
span: number;
|
|
79
|
+
/**
|
|
80
|
+
* Columns spanned at large screens (≤1200px).
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
83
|
+
spanLg?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Columns spanned at medium screens (≤992px).
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
spanMd?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Columns spanned at small screens (≤768px).
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
spanSm?: number;
|
|
94
|
+
/**
|
|
95
|
+
* Columns spanned at extra-small screens (≤576px).
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
spanXs?: number;
|
|
99
|
+
/**
|
|
100
|
+
* Flex grow factor.
|
|
101
|
+
* @public
|
|
102
|
+
*/
|
|
103
|
+
grow: number;
|
|
104
|
+
/**
|
|
105
|
+
* Flex shrink factor.
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
108
|
+
shrink: number;
|
|
109
|
+
/**
|
|
110
|
+
* Flex basis (e.g., `"200px"` or `"auto"`).
|
|
111
|
+
* @public
|
|
112
|
+
*/
|
|
113
|
+
basis: string | null;
|
|
114
|
+
/**
|
|
115
|
+
* Flex order relative to siblings.
|
|
116
|
+
* @public
|
|
117
|
+
*/
|
|
118
|
+
order?: number;
|
|
119
|
+
/**
|
|
120
|
+
* Self alignment override.
|
|
121
|
+
* @public
|
|
122
|
+
*/
|
|
123
|
+
alignSelf?: SkyFlexcolAlignSelf;
|
|
124
|
+
static styles: import("lit").CSSResult;
|
|
125
|
+
/** @protected */
|
|
126
|
+
firstUpdated(): void;
|
|
127
|
+
/** @protected */
|
|
128
|
+
updated(changed: Map<string | number | symbol, unknown>): void;
|
|
129
|
+
/**
|
|
130
|
+
* Syncs component properties to CSS custom properties.
|
|
131
|
+
* @private
|
|
132
|
+
*/
|
|
133
|
+
private syncVars;
|
|
134
|
+
/**
|
|
135
|
+
* Forces resynchronization of CSS custom properties.
|
|
136
|
+
* Useful when properties are changed programmatically.
|
|
137
|
+
* @public
|
|
138
|
+
*/
|
|
139
|
+
refreshStyles(): void;
|
|
140
|
+
/**
|
|
141
|
+
* Gets the current span value.
|
|
142
|
+
* @returns Current span value
|
|
143
|
+
* @public
|
|
144
|
+
*/
|
|
145
|
+
getSpan(): number;
|
|
146
|
+
/**
|
|
147
|
+
* Sets the span value and updates styles.
|
|
148
|
+
* @param value - New span value
|
|
149
|
+
* @public
|
|
150
|
+
*/
|
|
151
|
+
setSpan(value: number): void;
|
|
152
|
+
/** @protected */
|
|
153
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
154
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{__decorate as s,__metadata as t}from"tslib";import{LitElement as e,css as r,html as i}from"lit";import{property as o,customElement as p}from"lit/decorators.js";let n=class extends e{constructor(){super(...arguments),this.span=1,this.grow=0,this.shrink=0,this.basis=null}static{this.styles=r`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
/* These are read by the container’s ::slotted(*) rules */
|
|
6
|
+
flex-grow: var(--col-grow, 0);
|
|
7
|
+
flex-shrink: var(--col-shrink, 0);
|
|
8
|
+
order: var(--col-order, 0);
|
|
9
|
+
align-self: var(--col-align-self, auto);
|
|
10
|
+
/* If you set basis, it will override the basis calc coming from container's ::slotted(*) */
|
|
11
|
+
flex-basis: var(--col-basis, auto);
|
|
12
|
+
}
|
|
13
|
+
`}firstUpdated(){this.syncVars()}updated(s){(s.has("span")||s.has("spanLg")||s.has("spanMd")||s.has("spanSm")||s.has("spanXs")||s.has("grow")||s.has("shrink")||s.has("basis")||s.has("order")||s.has("alignSelf"))&&this.syncVars()}syncVars(){this.style.setProperty("--span",String(this.span)),this.spanLg&&this.style.setProperty("--span-lg",String(this.spanLg)),this.spanMd&&this.style.setProperty("--span-md",String(this.spanMd)),this.spanSm&&this.style.setProperty("--span-sm",String(this.spanSm)),this.spanXs&&this.style.setProperty("--span-xs",String(this.spanXs)),this.style.setProperty("--col-grow",String(this.grow)),this.style.setProperty("--col-shrink",String(this.shrink)),null!=this.order?this.style.setProperty("--col-order",String(this.order)):this.style.removeProperty("--col-order"),this.alignSelf?this.style.setProperty("--col-align-self",this.alignSelf):this.style.removeProperty("--col-align-self"),this.basis?this.style.setProperty("--col-basis",this.basis):this.style.removeProperty("--col-basis")}refreshStyles(){this.syncVars()}getSpan(){return this.span}setSpan(s){this.span=s,this.syncVars()}render(){return i` <slot part="col"></slot> `}};s([o({type:Number}),t("design:type",Object)],n.prototype,"span",void 0),s([o({type:Number}),t("design:type",Number)],n.prototype,"spanLg",void 0),s([o({type:Number}),t("design:type",Number)],n.prototype,"spanMd",void 0),s([o({type:Number}),t("design:type",Number)],n.prototype,"spanSm",void 0),s([o({type:Number}),t("design:type",Number)],n.prototype,"spanXs",void 0),s([o({type:Number}),t("design:type",Object)],n.prototype,"grow",void 0),s([o({type:Number}),t("design:type",Object)],n.prototype,"shrink",void 0),s([o({type:String}),t("design:type",Object)],n.prototype,"basis",void 0),s([o({type:Number}),t("design:type",Number)],n.prototype,"order",void 0),s([o({type:String}),t("design:type",String)],n.prototype,"alignSelf",void 0),n=s([p("sky-flexcol")],n);export{n as SkyFlexcol};
|
|
14
|
+
//# sourceMappingURL=sky-flexcol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sky-flexcol.js","sources":["../../src/sky-flexcol/sky-flexcol.ts"],"sourcesContent":[null],"names":["SkyFlexcol","LitElement","constructor","this","span","grow","shrink","basis","styles","css","firstUpdated","syncVars","updated","changed","has","style","setProperty","String","spanLg","spanMd","spanSm","spanXs","order","removeProperty","alignSelf","refreshStyles","getSpan","setSpan","value","render","html","__decorate","property","type","Number","prototype","customElement"],"mappings":"uKAkFO,IAAMA,EAAN,cAAyBC,EAAzB,WAAAC,uBAMLC,KAAAC,KAAO,EAmCPD,KAAAE,KAAO,EAOPF,KAAAG,OAAS,EAOTH,KAAAI,MAAuB,IAwHzB,QAxGgBJ,KAAAK,OAASC,CAAG;;;;;;;;;;;;GAYxB,CAGO,YAAAC,GACPP,KAAKQ,UACP,CAGS,OAAAC,CAAQC,IAEbA,EAAQC,IAAI,SACZD,EAAQC,IAAI,WACZD,EAAQC,IAAI,WACZD,EAAQC,IAAI,WACZD,EAAQC,IAAI,WACZD,EAAQC,IAAI,SACZD,EAAQC,IAAI,WACZD,EAAQC,IAAI,UACZD,EAAQC,IAAI,UACZD,EAAQC,IAAI,eAEZX,KAAKQ,UAET,CAMQ,QAAAA,GAENR,KAAKY,MAAMC,YAAY,SAAUC,OAAOd,KAAKC,OACzCD,KAAKe,QAAQf,KAAKY,MAAMC,YAAY,YAAaC,OAAOd,KAAKe,SAC7Df,KAAKgB,QAAQhB,KAAKY,MAAMC,YAAY,YAAaC,OAAOd,KAAKgB,SAC7DhB,KAAKiB,QAAQjB,KAAKY,MAAMC,YAAY,YAAaC,OAAOd,KAAKiB,SAC7DjB,KAAKkB,QAAQlB,KAAKY,MAAMC,YAAY,YAAaC,OAAOd,KAAKkB,SAGjElB,KAAKY,MAAMC,YAAY,aAAcC,OAAOd,KAAKE,OACjDF,KAAKY,MAAMC,YAAY,eAAgBC,OAAOd,KAAKG,SAEjC,MAAdH,KAAKmB,MACPnB,KAAKY,MAAMC,YAAY,cAAeC,OAAOd,KAAKmB,QAElDnB,KAAKY,MAAMQ,eAAe,eAGxBpB,KAAKqB,UACPrB,KAAKY,MAAMC,YAAY,mBAAoBb,KAAKqB,WAEhDrB,KAAKY,MAAMQ,eAAe,oBAGxBpB,KAAKI,MACPJ,KAAKY,MAAMC,YAAY,cAAeb,KAAKI,OAE3CJ,KAAKY,MAAMQ,eAAe,cAE9B,CAOO,aAAAE,GACLtB,KAAKQ,UACP,CAOO,OAAAe,GACL,OAAOvB,KAAKC,IACd,CAOO,OAAAuB,CAAQC,GACbzB,KAAKC,KAAOwB,EACZzB,KAAKQ,UACP,CAGS,MAAAkB,GACP,OAAOC,CAAI,4BACb,GAxKAC,EAAA,CADCC,EAAS,CAAEC,KAAMC,kCACTlC,EAAAmC,UAAA,eAOTJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,kCACFlC,EAAAmC,UAAA,iBAOhBJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,kCACFlC,EAAAmC,UAAA,iBAOhBJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,kCACFlC,EAAAmC,UAAA,iBAOhBJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,kCACFlC,EAAAmC,UAAA,iBAOhBJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,kCACTlC,EAAAmC,UAAA,eAOTJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,kCACPlC,EAAAmC,UAAA,iBAOXJ,EAAA,CADCC,EAAS,CAAEC,KAAMhB,kCACUjB,EAAAmC,UAAA,gBAO5BJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,kCACHlC,EAAAmC,UAAA,gBAOfJ,EAAA,CADCC,EAAS,CAAEC,KAAMhB,kCACcjB,EAAAmC,UAAA,oBArErBnC,EAAU+B,EAAA,CADtBK,EAAc,gBACFpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./sky-flexitem";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sky-flexitem.js';
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export type SkyFlexitemDirection = "horizontal" | "vertical";
|
|
3
|
+
export type SkyFlexitemSizeDetail = {
|
|
4
|
+
element: SkyFlexitem;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
flexDirection: SkyFlexitemDirection;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @element sky-flexitem
|
|
11
|
+
*
|
|
12
|
+
* @summary Flex item for `sky-flexbar` that adapts orientation and reports size changes.
|
|
13
|
+
*
|
|
14
|
+
* @status stable
|
|
15
|
+
* @since 1.0.0
|
|
16
|
+
*
|
|
17
|
+
* @documentation https://library.sky-ui.com/components/flexbar
|
|
18
|
+
*
|
|
19
|
+
* @slot title - The title/content slot for the flex item.
|
|
20
|
+
* @slot content - The main content slot for the flex item.
|
|
21
|
+
* @slot hamburger - Special slot for hamburger menu context.
|
|
22
|
+
*
|
|
23
|
+
* @property {SkyFlexitemDirection} flexDirection - Layout direction used by the internal item container.
|
|
24
|
+
* @fires {CustomEvent<SkyFlexitemSizeDetail>} flexitem-size - Fired when the component size changes.
|
|
25
|
+
* @method getSize Returns the current element bounding rect.
|
|
26
|
+
* @method isInHamburger Returns whether the item is in hamburger-menu context.
|
|
27
|
+
*
|
|
28
|
+
* @csspart item - The main container element.
|
|
29
|
+
* @csspart in-hamburger - Applied when item is in hamburger menu context.
|
|
30
|
+
* @csspart in-bar - Applied when item is in navigation bar context.
|
|
31
|
+
*
|
|
32
|
+
* @Behavior
|
|
33
|
+
* - Dynamically adjusts layout direction based on parent flex direction
|
|
34
|
+
* - Supports both horizontal and vertical orientations
|
|
35
|
+
* - Automatically reports size changes via ResizeObserver
|
|
36
|
+
* - Responds to flex-direction-changed events from parent components
|
|
37
|
+
* - Provides different styling based on slot assignment (hamburger vs bar)
|
|
38
|
+
*
|
|
39
|
+
* - `title`: Typically used for labels, icons, or short text
|
|
40
|
+
* - `content`: Main content area for longer text or complex content
|
|
41
|
+
* - `hamburger`: Special slot for items within a hamburger menu context
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```html
|
|
45
|
+
* <sky-flexitem flexdirection="horizontal">
|
|
46
|
+
* <span slot="title">Item 1</span>
|
|
47
|
+
* <div slot="content">Content for item 1</div>
|
|
48
|
+
* </sky-flexitem>
|
|
49
|
+
* ```
|
|
50
|
+
* ```vue
|
|
51
|
+
* <template>
|
|
52
|
+
* <sky-flexitem flexdirection="horizontal">
|
|
53
|
+
* <span slot="title">Item 1</span>
|
|
54
|
+
* <span slot="content">Content for item 1</span>
|
|
55
|
+
* </sky-flexitem>
|
|
56
|
+
* </template>
|
|
57
|
+
* ```
|
|
58
|
+
* ```jsx
|
|
59
|
+
* export default function Demo() {
|
|
60
|
+
* return (
|
|
61
|
+
* <sky-flexitem flexdirection="horizontal">
|
|
62
|
+
* <span slot="title">Item 1</span>
|
|
63
|
+
* <span slot="content">Content for item 1</span>
|
|
64
|
+
* </sky-flexitem>
|
|
65
|
+
* );
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare class SkyFlexitem extends LitElement {
|
|
70
|
+
/**
|
|
71
|
+
* Layout direction of the flex item.
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
flexDirection: SkyFlexitemDirection;
|
|
75
|
+
/**
|
|
76
|
+
* Internal state tracking if item is in hamburger menu.
|
|
77
|
+
* @private
|
|
78
|
+
*/
|
|
79
|
+
private _inHamburger;
|
|
80
|
+
/** @private */
|
|
81
|
+
private _resizeObserver?;
|
|
82
|
+
static styles: import("lit").CSSResult;
|
|
83
|
+
static get observedAttributes(): string[];
|
|
84
|
+
/** @protected */
|
|
85
|
+
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
|
|
86
|
+
/**
|
|
87
|
+
* Handles flex direction changes from parent components.
|
|
88
|
+
* @param {Event} e - The flex-direction-changed event
|
|
89
|
+
* @private
|
|
90
|
+
*/
|
|
91
|
+
private _onFlexDir;
|
|
92
|
+
/**
|
|
93
|
+
* Measures and reports the current size of the flex item.
|
|
94
|
+
* @private
|
|
95
|
+
*/
|
|
96
|
+
private _measureAndReportSize;
|
|
97
|
+
/** @protected */
|
|
98
|
+
connectedCallback(): void;
|
|
99
|
+
/** @protected */
|
|
100
|
+
disconnectedCallback(): void;
|
|
101
|
+
/**
|
|
102
|
+
* Gets the current size of the flex item.
|
|
103
|
+
* @returns {DOMRect} The bounding rectangle of the element
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
getSize(): DOMRect;
|
|
107
|
+
/**
|
|
108
|
+
* Checks if the item is currently in hamburger menu context.
|
|
109
|
+
* @returns {boolean} True if in hamburger menu
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
isInHamburger(): boolean;
|
|
113
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
114
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import{__decorate as e,__metadata as t}from"tslib";import{LitElement as i,css as r,html as s}from"lit";import{property as n,state as o,customElement as l}from"lit/decorators.js";let a=class extends i{constructor(){super(...arguments),this.flexDirection="vertical",this._inHamburger=!1,this._onFlexDir=e=>{const t=e;t.detail&&(this.flexDirection=t.detail.flexDirection)}}static{this.styles=r`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.flex-item-container {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: 8px;
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host([flexdirection="vertical"]) .flex-item-container {
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
align-items: flex-start;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.content {
|
|
21
|
+
display: block;
|
|
22
|
+
flex: 1;
|
|
23
|
+
min-width: 0; /* Prevent overflow */
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* RTL support */
|
|
27
|
+
:host([dir="rtl"]) .flex-item-container {
|
|
28
|
+
flex-direction: row-reverse;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host([dir="rtl"][flexdirection="vertical"]) .flex-item-container {
|
|
32
|
+
align-items: flex-end;
|
|
33
|
+
}
|
|
34
|
+
`}static get observedAttributes(){return[...super.observedAttributes,"slot"]}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),"slot"===e&&t!==i&&(this._inHamburger="hamburger"===i,this.requestUpdate())}_measureAndReportSize(){const e=this.offsetWidth,t=this.offsetHeight;this.dispatchEvent(new CustomEvent("flexitem-size",{bubbles:!0,composed:!0,detail:{element:this,width:e,height:t,flexDirection:this.flexDirection}}))}connectedCallback(){super.connectedCallback(),this.classList.add("menu-parent"),this._inHamburger="hamburger"===this.slot,this._resizeObserver=new ResizeObserver(()=>this._measureAndReportSize()),this._resizeObserver.observe(this),this.addEventListener("flex-direction-changed",this._onFlexDir),this.updateComplete.then(()=>this._measureAndReportSize())}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this.removeEventListener("flex-direction-changed",this._onFlexDir)}getSize(){return this.getBoundingClientRect()}isInHamburger(){return this._inHamburger}render(){const e=this._inHamburger?"item in-hamburger":"item in-bar";return s`
|
|
35
|
+
<div
|
|
36
|
+
part=${e}
|
|
37
|
+
class="flex-item-container"
|
|
38
|
+
role="${this._inHamburger?"menuitem":"listitem"}"
|
|
39
|
+
aria-orientation="${this.flexDirection}"
|
|
40
|
+
>
|
|
41
|
+
<slot name="title"></slot>
|
|
42
|
+
<slot name="content" class="content"></slot>
|
|
43
|
+
</div>
|
|
44
|
+
`}};e([n({type:String,reflect:!0}),t("design:type",String)],a.prototype,"flexDirection",void 0),e([o(),t("design:type",Object)],a.prototype,"_inHamburger",void 0),a=e([l("sky-flexitem")],a);export{a as SkyFlexitem};
|
|
45
|
+
//# sourceMappingURL=sky-flexitem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sky-flexitem.js","sources":["../../src/sky-flexitem/sky-flexitem.ts"],"sourcesContent":[null],"names":["SkyFlexitem","LitElement","constructor","this","flexDirection","_inHamburger","_onFlexDir","e","ce","detail","styles","css","observedAttributes","super","attributeChangedCallback","name","oldVal","newVal","requestUpdate","_measureAndReportSize","width","offsetWidth","height","offsetHeight","dispatchEvent","CustomEvent","bubbles","composed","element","connectedCallback","classList","add","slot","_resizeObserver","ResizeObserver","observe","addEventListener","updateComplete","then","disconnectedCallback","disconnect","removeEventListener","getSize","getBoundingClientRect","isInHamburger","render","partTokens","html","__decorate","property","type","String","reflect","prototype","state","customElement"],"mappings":"kLAwEO,IAAMA,EAAN,cAA0BC,EAA1B,WAAAC,uBAMLC,KAAAC,cAAsC,WAO9BD,KAAAE,cAAe,EA2DfF,KAAAG,WAAcC,IACpB,MAAMC,EAAKD,EACNC,EAAGC,SACRN,KAAKC,cAAgBI,EAAGC,OAAOL,eAgFnC,QAzIkBD,KAAAO,OAASC,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiC1B,CAGF,6BAAoBC,GAClB,MAAO,IAAIC,MAAMD,mBAAoB,OACvC,CAGS,wBAAAE,CAAyBC,EAAcC,EAAuBC,GACrEJ,MAAMC,yBAAyBC,EAAMC,EAAQC,GAChC,SAATF,GAAmBC,IAAWC,IAChCd,KAAKE,aAA0B,cAAXY,EACpBd,KAAKe,gBAET,CAiBQ,qBAAAC,GACN,MAAMC,EAAQjB,KAAKkB,YACbC,EAASnB,KAAKoB,aACpBpB,KAAKqB,cACH,IAAIC,YAAmC,gBAAiB,CACtDC,SAAS,EACTC,UAAU,EACVlB,OAAQ,CACNmB,QAASzB,KACTiB,QACAE,SACAlB,cAAeD,KAAKC,iBAI5B,CAGS,iBAAAyB,GACPhB,MAAMgB,oBAEN1B,KAAK2B,UAAUC,IAAI,eAGnB5B,KAAKE,aAA6B,cAAdF,KAAK6B,KAEzB7B,KAAK8B,gBAAkB,IAAIC,eAAe,IAAM/B,KAAKgB,yBACrDhB,KAAK8B,gBAAgBE,QAAQhC,MAE7BA,KAAKiC,iBAAiB,yBAA0BjC,KAAKG,YAErDH,KAAKkC,eAAeC,KAAK,IAAMnC,KAAKgB,wBACtC,CAGS,oBAAAoB,GACP1B,MAAM0B,uBACNpC,KAAK8B,iBAAiBO,aACtBrC,KAAKsC,oBAAoB,yBAA0BtC,KAAKG,WAC1D,CAOO,OAAAoC,GACL,OAAOvC,KAAKwC,uBACd,CAOO,aAAAC,GACL,OAAOzC,KAAKE,YACd,CAES,MAAAwC,GACP,MAAMC,EAAa3C,KAAKE,aAAe,oBAAsB,cAC7D,OAAO0C,CAAI;;eAEAD;;gBAEC3C,KAAKE,aAAe,WAAa;4BACrBF,KAAKC;;;;;KAM/B,GApJA4C,EAAA,CADCC,EAAS,CAAEC,KAAMC,OAAQC,SAAS,6BACcpD,EAAAqD,UAAA,wBAOzCL,EAAA,CADPM,6BAC4BtD,EAAAqD,UAAA,uBAblBrD,EAAWgD,EAAA,CADvBO,EAAc,iBACFvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./sky-form";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sky-form.js';
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export type SkyFormMode = "client" | "server";
|
|
3
|
+
export type SkyFormMethod = "get" | "post";
|
|
4
|
+
export type SkyFormEnctype = "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain";
|
|
5
|
+
export type SkyFormAutocomplete = "on" | "off";
|
|
6
|
+
export type SkyFormValues = Record<string, FormDataEntryValue | FormDataEntryValue[]>;
|
|
7
|
+
export type SkyFormChangeDetail = {
|
|
8
|
+
values: SkyFormValues;
|
|
9
|
+
formData: FormData;
|
|
10
|
+
success: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type SkyFormValidationErrorsDetail = {
|
|
13
|
+
errors: string[];
|
|
14
|
+
};
|
|
15
|
+
export type SkyFormSubmitDetail = {
|
|
16
|
+
values: SkyFormValues;
|
|
17
|
+
formData: FormData;
|
|
18
|
+
success: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type SkyFormFormDataFallbackDetail = {
|
|
21
|
+
formData: FormData;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @element sky-form
|
|
25
|
+
*
|
|
26
|
+
* @summary Form wrapper with unified validation, error aggregation, and client/server submit flows.
|
|
27
|
+
*
|
|
28
|
+
* @status stable
|
|
29
|
+
* @since 1.0.0
|
|
30
|
+
*
|
|
31
|
+
* @documentation https://library.sky-ui.com/components/form
|
|
32
|
+
*
|
|
33
|
+
* @slot - Form elements: inputs, buttons, and other form controls.
|
|
34
|
+
*
|
|
35
|
+
* @property {boolean} liveValidation - Validates and emits `form-change` on value changes.
|
|
36
|
+
* @property {boolean} showErrors - Shows validation errors in child controls when available.
|
|
37
|
+
* @property {boolean} errorBox - Shows consolidated validation messages above the form.
|
|
38
|
+
* @property {string} errorBoxMessage - Header message shown in the consolidated error box.
|
|
39
|
+
* @property {SkyFormMode} mode - Submission mode (`client` or `server`).
|
|
40
|
+
* @property {SkyFormMethod | undefined} method - Native form method in server mode.
|
|
41
|
+
* @property {string | undefined} action - Native form action in server mode.
|
|
42
|
+
* @property {string | undefined} target - Native form target in server mode.
|
|
43
|
+
* @property {SkyFormEnctype | undefined} enctype - Native form encoding type.
|
|
44
|
+
* @property {SkyFormAutocomplete | undefined} autocomplete - Native form autocomplete behavior.
|
|
45
|
+
* @property {boolean} noValidate - Disables native HTML constraint UI.
|
|
46
|
+
* @property {boolean} enterSubmit - Submits on Enter for non-textarea controls.
|
|
47
|
+
* @property {boolean} resetOnSubmit - Resets form after successful submit.
|
|
48
|
+
* @property {string | null} csrfToken - Optional CSRF token value for app-level submit handling.
|
|
49
|
+
*
|
|
50
|
+
* @fires {CustomEvent<SkyFormChangeDetail>} form-change - Fired when form values change in live validation mode.
|
|
51
|
+
* @fires {CustomEvent<SkyFormValidationErrorsDetail>} validation-errors - Fired when aggregated validation errors change.
|
|
52
|
+
* @fires {CustomEvent<SkyFormFormDataFallbackDetail> | FormDataEvent} formdata - Fired before client-mode submit with form data.
|
|
53
|
+
* @fires {CustomEvent<SkyFormSubmitDetail>} form-submit - Fired after successful client-mode submit handling.
|
|
54
|
+
*
|
|
55
|
+
* @method checkValidity Returns native form validity without UI reporting.
|
|
56
|
+
* @method reportValidity Returns native form validity and reports native UI messages.
|
|
57
|
+
* @method requestSubmit Requests submission using optional submitter.
|
|
58
|
+
* @method reset Resets native form and values.
|
|
59
|
+
* @method resetForm Alias for `reset`.
|
|
60
|
+
* @method submit Submits form using mode-specific client/server flow.
|
|
61
|
+
*
|
|
62
|
+
* @csspart error-box - Container for the consolidated error messages.
|
|
63
|
+
* @csspart error-list - List element containing validation errors.
|
|
64
|
+
*
|
|
65
|
+
* @Behavior
|
|
66
|
+
* - Provides seamless integration of custom form controls with native HTML form behavior
|
|
67
|
+
* - Supports both client-side AJAX submissions and traditional server-side submissions
|
|
68
|
+
* - Automatic validation aggregation from both native and custom form controls
|
|
69
|
+
* - Light DOM rendering for proper browser form association
|
|
70
|
+
*
|
|
71
|
+
* The component automatically associates form controls (including custom elements) with the native form
|
|
72
|
+
* using the `form` attribute, ensuring proper browser validation and FormData collection.
|
|
73
|
+
*
|
|
74
|
+
* - **Live Validation**: Validates on every input change (when liveValidation=true)
|
|
75
|
+
* - **Submit Validation**: Validates only on form submission
|
|
76
|
+
* - **Mixed Validation**: Combines both native HTML5 validation and custom component validation
|
|
77
|
+
*
|
|
78
|
+
* - **Client Mode**: Prevents page refresh, emits formdata/form-submit events for JavaScript handling
|
|
79
|
+
* - **Server Mode**: Allows traditional form submission with page navigation/refresh
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```html
|
|
83
|
+
* <sky-form id="login-form" live-validation error-box>
|
|
84
|
+
* <sky-input name="email" type="email" required label="Email"></sky-input>
|
|
85
|
+
* <sky-input name="password" type="password" required label="Password"></sky-input>
|
|
86
|
+
* <sky-button type="submit">Sign In</sky-button>
|
|
87
|
+
* </sky-form>
|
|
88
|
+
* ```
|
|
89
|
+
* ```vue
|
|
90
|
+
* <template>
|
|
91
|
+
* <sky-form id="login-form" live-validation error-box @form-submit="onSubmit">
|
|
92
|
+
* <sky-input name="email" type="email" required label="Email"></sky-input>
|
|
93
|
+
* <sky-input name="password" type="password" required label="Password"></sky-input>
|
|
94
|
+
* <sky-button type="submit">Sign In</sky-button>
|
|
95
|
+
* </sky-form>
|
|
96
|
+
* </template>
|
|
97
|
+
* ```
|
|
98
|
+
* ```jsx
|
|
99
|
+
* export default function Demo() {
|
|
100
|
+
* return (
|
|
101
|
+
* <sky-form id="login-form" live-validation error-box>
|
|
102
|
+
* <sky-input name="email" type="email" required label="Email"></sky-input>
|
|
103
|
+
* <sky-input name="password" type="password" required label="Password"></sky-input>
|
|
104
|
+
* <sky-button type="submit">Sign In</sky-button>
|
|
105
|
+
* </sky-form>
|
|
106
|
+
* );
|
|
107
|
+
* }
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export declare class SkyForm extends LitElement {
|
|
111
|
+
/**
|
|
112
|
+
* When true, validates form on every value change.
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
liveValidation: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Controls whether validation errors are displayed.
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
showErrors: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* When true, displays a consolidated error box with all validation errors.
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
errorBox: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Custom message displayed in the error box header.
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
errorBoxMessage: string;
|
|
131
|
+
/**
|
|
132
|
+
* Submission mode: 'client' prevents page refresh, 'server' allows native form submission.
|
|
133
|
+
* @public
|
|
134
|
+
*/
|
|
135
|
+
mode: SkyFormMode;
|
|
136
|
+
/**
|
|
137
|
+
* HTTP method for form submission (when mode='server').
|
|
138
|
+
* @public
|
|
139
|
+
*/
|
|
140
|
+
method?: SkyFormMethod;
|
|
141
|
+
/**
|
|
142
|
+
* URL for form submission (when mode='server').
|
|
143
|
+
* @public
|
|
144
|
+
*/
|
|
145
|
+
action?: string;
|
|
146
|
+
/**
|
|
147
|
+
* Target window/frame for form submission.
|
|
148
|
+
* @public
|
|
149
|
+
*/
|
|
150
|
+
target?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Form encoding type.
|
|
153
|
+
* @public
|
|
154
|
+
*/
|
|
155
|
+
enctype?: SkyFormEnctype;
|
|
156
|
+
/**
|
|
157
|
+
* HTML autocomplete attribute.
|
|
158
|
+
* @public
|
|
159
|
+
*/
|
|
160
|
+
autocomplete?: SkyFormAutocomplete;
|
|
161
|
+
/**
|
|
162
|
+
* When true, disables native HTML5 validation.
|
|
163
|
+
* @public
|
|
164
|
+
*/
|
|
165
|
+
noValidate: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* When true, pressing Enter in any input submits the form (except textarea).
|
|
168
|
+
* @public
|
|
169
|
+
*/
|
|
170
|
+
enterSubmit: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* When true, resets the form after successful submission.
|
|
173
|
+
* @public
|
|
174
|
+
*/
|
|
175
|
+
resetOnSubmit: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* CSRF token for form submission protection.
|
|
178
|
+
* @public
|
|
179
|
+
*/
|
|
180
|
+
csrfToken: string | null;
|
|
181
|
+
/**
|
|
182
|
+
* Array of current validation error messages.
|
|
183
|
+
* @private
|
|
184
|
+
*/
|
|
185
|
+
private validationErrors;
|
|
186
|
+
/**
|
|
187
|
+
* Indicates whether the last form submission was successful.
|
|
188
|
+
* @private
|
|
189
|
+
*/
|
|
190
|
+
private submitSuccess;
|
|
191
|
+
/**
|
|
192
|
+
* Indicates whether validation is currently active (errors shown).
|
|
193
|
+
* @private
|
|
194
|
+
*/
|
|
195
|
+
private validationActive;
|
|
196
|
+
/** Reference to the native form element. */
|
|
197
|
+
private _formEl;
|
|
198
|
+
private _mo?;
|
|
199
|
+
private _syncQueued;
|
|
200
|
+
private _handlingSubmit;
|
|
201
|
+
private _handlingInvalid;
|
|
202
|
+
/** MUST be light DOM for button[form="..."] + native id lookup */
|
|
203
|
+
protected createRenderRoot(): this;
|
|
204
|
+
/**
|
|
205
|
+
* Returns the native HTML form element.
|
|
206
|
+
* @public
|
|
207
|
+
*/
|
|
208
|
+
get formElement(): HTMLFormElement;
|
|
209
|
+
connectedCallback(): void;
|
|
210
|
+
disconnectedCallback(): void;
|
|
211
|
+
private _queueSync;
|
|
212
|
+
private _onEnterKey;
|
|
213
|
+
/**
|
|
214
|
+
* Make `document.getElementById(hostId)` return the native form.
|
|
215
|
+
* Copies host id => native form id and removes id from host to avoid duplicate ids.
|
|
216
|
+
*/
|
|
217
|
+
private _moveHostIdToNativeForm;
|
|
218
|
+
/**
|
|
219
|
+
* Slotted controls remain in the light DOM under `<sky-form>`, not under the inner `<form>`.
|
|
220
|
+
* `_assignFormOwnerToChildren` needs a stable `id` on that `<form>` to set `form="…"` on
|
|
221
|
+
* associated controls. When the host has no `id`, generate one so association still works.
|
|
222
|
+
*/
|
|
223
|
+
private _ensureNativeFormHasId;
|
|
224
|
+
private _handleValueChanged;
|
|
225
|
+
/**
|
|
226
|
+
* Whether the form passes constraint validation, without calling `form.checkValidity()`.
|
|
227
|
+
* `HTMLFormElement.checkValidity()` dispatches `invalid` on each invalid control; during
|
|
228
|
+
* liveValidation that runs on every keystroke and our capture listener would focus the first
|
|
229
|
+
* invalid field, stealing focus from the control the user is editing.
|
|
230
|
+
*/
|
|
231
|
+
private _formValidQuiet;
|
|
232
|
+
private _emitFormChange;
|
|
233
|
+
/**
|
|
234
|
+
* Assigns form ownership to elements not inside the native <form> element.
|
|
235
|
+
* Ensures browser association for native submit + validation + FormData.
|
|
236
|
+
*/
|
|
237
|
+
private _assignFormOwnerToChildren;
|
|
238
|
+
private _getSkyInputs;
|
|
239
|
+
private _emitValidationErrors;
|
|
240
|
+
private _onFormDataCapture;
|
|
241
|
+
private _onInvalidCapture;
|
|
242
|
+
private _refreshAggregates;
|
|
243
|
+
private _focusFirstInvalid;
|
|
244
|
+
private _focusElement;
|
|
245
|
+
private _syncNow;
|
|
246
|
+
private _onHostSubmitCapture;
|
|
247
|
+
private _formDataToJSON;
|
|
248
|
+
/** Activates validation mode and refreshes error aggregates. */
|
|
249
|
+
private _activateValidation;
|
|
250
|
+
/**
|
|
251
|
+
* Checks form validity without displaying validation messages.
|
|
252
|
+
* @returns {boolean} True if the form is valid, false otherwise.
|
|
253
|
+
* @public
|
|
254
|
+
*/
|
|
255
|
+
checkValidity(): boolean;
|
|
256
|
+
/**
|
|
257
|
+
* Checks form validity and displays validation messages.
|
|
258
|
+
* @returns {boolean} True if the form is valid, false otherwise.
|
|
259
|
+
* @public
|
|
260
|
+
*/
|
|
261
|
+
reportValidity(): boolean;
|
|
262
|
+
/**
|
|
263
|
+
* Requests form submission (compatible with native requestSubmit).
|
|
264
|
+
* @param {HTMLElement} submitter - Optional submitter element.
|
|
265
|
+
* @public
|
|
266
|
+
*/
|
|
267
|
+
requestSubmit(submitter?: HTMLElement): void;
|
|
268
|
+
/**
|
|
269
|
+
* Resets the form to its initial state.
|
|
270
|
+
* @public
|
|
271
|
+
*/
|
|
272
|
+
reset(): void;
|
|
273
|
+
/**
|
|
274
|
+
* Resets the form to its initial state (alias for reset()).
|
|
275
|
+
* @public
|
|
276
|
+
*/
|
|
277
|
+
resetForm(): void;
|
|
278
|
+
/**
|
|
279
|
+
* Manually submits the form, respecting the current mode setting.
|
|
280
|
+
* In client mode, triggers the client-side submission flow.
|
|
281
|
+
* In server mode, performs native form submission.
|
|
282
|
+
* @public
|
|
283
|
+
*/
|
|
284
|
+
submit(): void;
|
|
285
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
286
|
+
}
|