snice 4.26.2 → 4.28.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/dist/cdn/accordion/snice-accordion.js +1 -1
- package/dist/cdn/accordion/snice-accordion.min.js +1 -1
- package/dist/cdn/activity-feed/snice-activity-feed.js +1 -1
- package/dist/cdn/activity-feed/snice-activity-feed.min.js +1 -1
- package/dist/cdn/alert/snice-alert.js +1 -1
- package/dist/cdn/alert/snice-alert.min.js +1 -1
- package/dist/cdn/app-tiles/snice-app-tiles.js +1 -1
- package/dist/cdn/app-tiles/snice-app-tiles.min.js +1 -1
- package/dist/cdn/approval-flow/snice-approval-flow.js +1 -1
- package/dist/cdn/approval-flow/snice-approval-flow.min.js +1 -1
- package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
- package/dist/cdn/audio-recorder/snice-audio-recorder.min.js +1 -1
- package/dist/cdn/availability/snice-availability.js +1 -1
- package/dist/cdn/availability/snice-availability.min.js +1 -1
- package/dist/cdn/avatar/snice-avatar.js +1 -1
- package/dist/cdn/avatar/snice-avatar.min.js +1 -1
- package/dist/cdn/avatar-group/snice-avatar-group.js +1 -1
- package/dist/cdn/avatar-group/snice-avatar-group.min.js +1 -1
- package/dist/cdn/badge/snice-badge.js +2 -2
- package/dist/cdn/badge/snice-badge.js.map +1 -1
- package/dist/cdn/badge/snice-badge.min.js +2 -2
- package/dist/cdn/badge/snice-badge.min.js.map +1 -1
- package/dist/cdn/banner/snice-banner.js +1 -1
- package/dist/cdn/banner/snice-banner.min.js +1 -1
- package/dist/cdn/book/snice-book.js +1 -1
- package/dist/cdn/book/snice-book.min.js +1 -1
- package/dist/cdn/booking/snice-booking.js +1 -1
- package/dist/cdn/booking/snice-booking.min.js +1 -1
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +1 -1
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.min.js +1 -1
- package/dist/cdn/button/snice-button.js +11 -10
- package/dist/cdn/button/snice-button.js.map +1 -1
- package/dist/cdn/button/snice-button.min.js +3 -3
- package/dist/cdn/button/snice-button.min.js.map +1 -1
- package/dist/cdn/calendar/snice-calendar.js +1 -1
- package/dist/cdn/calendar/snice-calendar.min.js +1 -1
- package/dist/cdn/camera/snice-camera.js +1 -1
- package/dist/cdn/camera/snice-camera.min.js +1 -1
- package/dist/cdn/camera-annotate/snice-camera-annotate.js +1 -1
- package/dist/cdn/camera-annotate/snice-camera-annotate.min.js +1 -1
- package/dist/cdn/candlestick/snice-candlestick.js +1 -1
- package/dist/cdn/candlestick/snice-candlestick.min.js +1 -1
- package/dist/cdn/card/snice-card.js +1 -1
- package/dist/cdn/card/snice-card.min.js +1 -1
- package/dist/cdn/carousel/snice-carousel.js +1 -1
- package/dist/cdn/carousel/snice-carousel.min.js +1 -1
- package/dist/cdn/cart/snice-cart.js +1 -1
- package/dist/cdn/cart/snice-cart.min.js +1 -1
- package/dist/cdn/chart/snice-chart.js +1 -1
- package/dist/cdn/chart/snice-chart.min.js +1 -1
- package/dist/cdn/chat/snice-chat.js +1 -1
- package/dist/cdn/chat/snice-chat.min.js +1 -1
- package/dist/cdn/checkbox/snice-checkbox.js +1 -1
- package/dist/cdn/checkbox/snice-checkbox.min.js +1 -1
- package/dist/cdn/chip/snice-chip.js +1 -1
- package/dist/cdn/chip/snice-chip.min.js +1 -1
- package/dist/cdn/code-block/snice-code-block.js +1 -1
- package/dist/cdn/code-block/snice-code-block.min.js +1 -1
- package/dist/cdn/color-display/snice-color-display.js +1 -1
- package/dist/cdn/color-display/snice-color-display.min.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.min.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.min.js +1 -1
- package/dist/cdn/comments/snice-comments.js +1 -1
- package/dist/cdn/comments/snice-comments.min.js +1 -1
- package/dist/cdn/countdown/snice-countdown.js +1 -1
- package/dist/cdn/countdown/snice-countdown.min.js +1 -1
- package/dist/cdn/cropper/snice-cropper.js +1 -1
- package/dist/cdn/cropper/snice-cropper.min.js +1 -1
- package/dist/cdn/data-card/snice-data-card.js +1 -1
- package/dist/cdn/data-card/snice-data-card.min.js +1 -1
- package/dist/cdn/date-picker/snice-date-picker.js +1 -1
- package/dist/cdn/date-picker/snice-date-picker.min.js +1 -1
- package/dist/cdn/date-range-picker/snice-date-range-picker.js +1 -1
- package/dist/cdn/date-range-picker/snice-date-range-picker.min.js +1 -1
- package/dist/cdn/date-time-picker/snice-date-time-picker.js +1 -1
- package/dist/cdn/date-time-picker/snice-date-time-picker.min.js +1 -1
- package/dist/cdn/diff/snice-diff.js +1 -1
- package/dist/cdn/diff/snice-diff.min.js +1 -1
- package/dist/cdn/divider/snice-divider.js +1 -1
- package/dist/cdn/divider/snice-divider.min.js +1 -1
- package/dist/cdn/doc/snice-doc.js +1 -1
- package/dist/cdn/doc/snice-doc.min.js +1 -1
- package/dist/cdn/draw/snice-draw.js +1 -1
- package/dist/cdn/draw/snice-draw.min.js +1 -1
- package/dist/cdn/drawer/snice-drawer.js +1 -1
- package/dist/cdn/drawer/snice-drawer.min.js +1 -1
- package/dist/cdn/empty-state/snice-empty-state.js +1 -1
- package/dist/cdn/empty-state/snice-empty-state.min.js +1 -1
- package/dist/cdn/estimate/snice-estimate.js +1 -1
- package/dist/cdn/estimate/snice-estimate.min.js +1 -1
- package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
- package/dist/cdn/file-gallery/snice-file-gallery.min.js +1 -1
- package/dist/cdn/file-upload/snice-file-upload.js +1 -1
- package/dist/cdn/file-upload/snice-file-upload.min.js +1 -1
- package/dist/cdn/flip-card/snice-flip-card.js +1 -1
- package/dist/cdn/flip-card/snice-flip-card.min.js +1 -1
- package/dist/cdn/flow/snice-flow.js +1 -1
- package/dist/cdn/flow/snice-flow.min.js +1 -1
- package/dist/cdn/form-layout/snice-form-layout.js +1 -1
- package/dist/cdn/form-layout/snice-form-layout.min.js +1 -1
- package/dist/cdn/funnel/snice-funnel.js +1 -1
- package/dist/cdn/funnel/snice-funnel.min.js +1 -1
- package/dist/cdn/gantt/snice-gantt.js +1 -1
- package/dist/cdn/gantt/snice-gantt.min.js +1 -1
- package/dist/cdn/gauge/snice-gauge.js +1 -1
- package/dist/cdn/gauge/snice-gauge.min.js +1 -1
- package/dist/cdn/heatmap/snice-heatmap.js +1 -1
- package/dist/cdn/heatmap/snice-heatmap.min.js +1 -1
- package/dist/cdn/image/snice-image.js +1 -1
- package/dist/cdn/image/snice-image.min.js +1 -1
- package/dist/cdn/input/snice-input.js +1 -1
- package/dist/cdn/input/snice-input.min.js +1 -1
- package/dist/cdn/invoice/snice-invoice.js +1 -1
- package/dist/cdn/invoice/snice-invoice.min.js +1 -1
- package/dist/cdn/kanban/snice-kanban.js +1 -1
- package/dist/cdn/kanban/snice-kanban.min.js +1 -1
- package/dist/cdn/key-value/snice-key-value.js +1 -1
- package/dist/cdn/key-value/snice-key-value.min.js +1 -1
- package/dist/cdn/kpi/snice-kpi.js +1 -1
- package/dist/cdn/kpi/snice-kpi.min.js +1 -1
- package/dist/cdn/layout/snice-layout.js +1 -1
- package/dist/cdn/layout/snice-layout.min.js +1 -1
- package/dist/cdn/leaderboard/snice-leaderboard.js +1 -1
- package/dist/cdn/leaderboard/snice-leaderboard.min.js +1 -1
- package/dist/cdn/link/snice-link.js +1 -1
- package/dist/cdn/link/snice-link.min.js +1 -1
- package/dist/cdn/link-preview/snice-link-preview.js +1 -1
- package/dist/cdn/link-preview/snice-link-preview.min.js +1 -1
- package/dist/cdn/list/snice-list.js +1 -1
- package/dist/cdn/list/snice-list.min.js +1 -1
- package/dist/cdn/location/snice-location.js +1 -1
- package/dist/cdn/location/snice-location.min.js +1 -1
- package/dist/cdn/login/snice-login.js +11 -10
- package/dist/cdn/login/snice-login.js.map +1 -1
- package/dist/cdn/login/snice-login.min.js +5 -5
- package/dist/cdn/login/snice-login.min.js.map +1 -1
- package/dist/cdn/map/snice-map.js +1 -1
- package/dist/cdn/map/snice-map.min.js +1 -1
- package/dist/cdn/markdown/snice-markdown.js +1 -1
- package/dist/cdn/markdown/snice-markdown.min.js +1 -1
- package/dist/cdn/masonry/snice-masonry.js +1 -1
- package/dist/cdn/masonry/snice-masonry.min.js +1 -1
- package/dist/cdn/menu/snice-menu.js +1 -1
- package/dist/cdn/menu/snice-menu.min.js +1 -1
- package/dist/cdn/message-strip/snice-message-strip.js +1 -1
- package/dist/cdn/message-strip/snice-message-strip.min.js +1 -1
- package/dist/cdn/metric-table/snice-metric-table.js +1 -1
- package/dist/cdn/metric-table/snice-metric-table.min.js +1 -1
- package/dist/cdn/modal/snice-modal.js +1 -1
- package/dist/cdn/modal/snice-modal.min.js +1 -1
- package/dist/cdn/music-player/snice-music-player.js +1 -1
- package/dist/cdn/music-player/snice-music-player.min.js +1 -1
- package/dist/cdn/nav/snice-nav.js +1 -1
- package/dist/cdn/nav/snice-nav.min.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.min.js +1 -1
- package/dist/cdn/notification-center/snice-notification-center.js +1 -1
- package/dist/cdn/notification-center/snice-notification-center.min.js +1 -1
- package/dist/cdn/order-tracker/snice-order-tracker.js +1 -1
- package/dist/cdn/order-tracker/snice-order-tracker.min.js +1 -1
- package/dist/cdn/org-chart/snice-org-chart.js +1 -1
- package/dist/cdn/org-chart/snice-org-chart.min.js +1 -1
- package/dist/cdn/pagination/snice-pagination.js +1 -1
- package/dist/cdn/pagination/snice-pagination.min.js +1 -1
- package/dist/cdn/paint/snice-paint.js +1 -1
- package/dist/cdn/paint/snice-paint.min.js +1 -1
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +1 -1
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.min.js +1 -1
- package/dist/cdn/permission-matrix/snice-permission-matrix.js +1 -1
- package/dist/cdn/permission-matrix/snice-permission-matrix.min.js +1 -1
- package/dist/cdn/podcast-player/snice-podcast-player.js +1 -1
- package/dist/cdn/podcast-player/snice-podcast-player.min.js +1 -1
- package/dist/cdn/pricing-table/snice-pricing-table.js +1 -1
- package/dist/cdn/pricing-table/snice-pricing-table.min.js +1 -1
- package/dist/cdn/product-card/snice-product-card.js +1 -1
- package/dist/cdn/product-card/snice-product-card.min.js +1 -1
- package/dist/cdn/progress/snice-progress.js +1 -1
- package/dist/cdn/progress/snice-progress.min.js +1 -1
- package/dist/cdn/progress-ring/snice-progress-ring.js +1 -1
- package/dist/cdn/progress-ring/snice-progress-ring.min.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.min.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.min.js +1 -1
- package/dist/cdn/radio/snice-radio.js +1 -1
- package/dist/cdn/radio/snice-radio.min.js +1 -1
- package/dist/cdn/range-slider/snice-range-slider.js +1 -1
- package/dist/cdn/range-slider/snice-range-slider.min.js +1 -1
- package/dist/cdn/rating/snice-rating.js +1 -1
- package/dist/cdn/rating/snice-rating.min.js +1 -1
- package/dist/cdn/receipt/snice-receipt.js +1 -1
- package/dist/cdn/receipt/snice-receipt.min.js +1 -1
- package/dist/cdn/recipe/snice-recipe.js +1 -1
- package/dist/cdn/recipe/snice-recipe.min.js +1 -1
- package/dist/cdn/runtime/README.md +2 -2
- package/dist/cdn/runtime/snice-runtime.esm.js +83 -61
- package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js +7 -7
- package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.js +83 -61
- package/dist/cdn/runtime/snice-runtime.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js +7 -7
- package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
- package/dist/cdn/sankey/snice-sankey.js +1 -1
- package/dist/cdn/sankey/snice-sankey.min.js +1 -1
- package/dist/cdn/segmented-control/snice-segmented-control.js +1 -1
- package/dist/cdn/segmented-control/snice-segmented-control.min.js +1 -1
- package/dist/cdn/select/snice-select.js +1 -1
- package/dist/cdn/select/snice-select.min.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.min.js +1 -1
- package/dist/cdn/slider/snice-slider.js +1 -1
- package/dist/cdn/slider/snice-slider.min.js +1 -1
- package/dist/cdn/sortable/snice-sortable.js +1 -1
- package/dist/cdn/sortable/snice-sortable.min.js +1 -1
- package/dist/cdn/sparkline/snice-sparkline.js +1 -1
- package/dist/cdn/sparkline/snice-sparkline.min.js +1 -1
- package/dist/cdn/spinner/snice-spinner.js +1 -1
- package/dist/cdn/spinner/snice-spinner.min.js +1 -1
- package/dist/cdn/split-button/snice-split-button.js +1 -1
- package/dist/cdn/split-button/snice-split-button.min.js +1 -1
- package/dist/cdn/split-pane/snice-split-pane.js +1 -1
- package/dist/cdn/split-pane/snice-split-pane.min.js +1 -1
- package/dist/cdn/spotlight/snice-spotlight.js +1 -1
- package/dist/cdn/spotlight/snice-spotlight.min.js +1 -1
- package/dist/cdn/spreadsheet/snice-spreadsheet.js +1 -1
- package/dist/cdn/spreadsheet/snice-spreadsheet.min.js +1 -1
- package/dist/cdn/stat-group/snice-stat-group.js +1 -1
- package/dist/cdn/stat-group/snice-stat-group.min.js +1 -1
- package/dist/cdn/step-input/snice-step-input.js +1 -1
- package/dist/cdn/step-input/snice-step-input.min.js +1 -1
- package/dist/cdn/stepper/snice-stepper.js +1 -1
- package/dist/cdn/stepper/snice-stepper.min.js +1 -1
- package/dist/cdn/switch/snice-switch.js +1 -1
- package/dist/cdn/switch/snice-switch.min.js +1 -1
- package/dist/cdn/table/snice-table.js +11 -10
- package/dist/cdn/table/snice-table.js.map +1 -1
- package/dist/cdn/table/snice-table.min.js +73 -73
- package/dist/cdn/table/snice-table.min.js.map +1 -1
- package/dist/cdn/tabs/snice-tabs.js +1 -1
- package/dist/cdn/tabs/snice-tabs.min.js +1 -1
- package/dist/cdn/tag/snice-tag.js +1 -1
- package/dist/cdn/tag/snice-tag.min.js +1 -1
- package/dist/cdn/tag-input/snice-tag-input.js +1 -1
- package/dist/cdn/tag-input/snice-tag-input.min.js +1 -1
- package/dist/cdn/terminal/snice-terminal.js +1 -1
- package/dist/cdn/terminal/snice-terminal.min.js +1 -1
- package/dist/cdn/testimonial/snice-testimonial.js +1 -1
- package/dist/cdn/testimonial/snice-testimonial.min.js +1 -1
- package/dist/cdn/textarea/snice-textarea.js +1 -1
- package/dist/cdn/textarea/snice-textarea.min.js +1 -1
- package/dist/cdn/time-picker/snice-time-picker.js +1 -1
- package/dist/cdn/time-picker/snice-time-picker.min.js +1 -1
- package/dist/cdn/time-range-picker/snice-time-range-picker.js +1 -1
- package/dist/cdn/time-range-picker/snice-time-range-picker.min.js +1 -1
- package/dist/cdn/timeline/snice-timeline.js +1 -1
- package/dist/cdn/timeline/snice-timeline.min.js +1 -1
- package/dist/cdn/timer/snice-timer.js +1 -1
- package/dist/cdn/timer/snice-timer.min.js +1 -1
- package/dist/cdn/toast/snice-toast.js +1 -1
- package/dist/cdn/toast/snice-toast.min.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.min.js +1 -1
- package/dist/cdn/tree/snice-tree.js +1 -1
- package/dist/cdn/tree/snice-tree.min.js +1 -1
- package/dist/cdn/treemap/snice-treemap.js +1 -1
- package/dist/cdn/treemap/snice-treemap.min.js +1 -1
- package/dist/cdn/user-card/snice-user-card.js +1 -1
- package/dist/cdn/user-card/snice-user-card.min.js +1 -1
- package/dist/cdn/video-player/snice-video-player.js +1 -1
- package/dist/cdn/video-player/snice-video-player.min.js +1 -1
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +1 -1
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.min.js +1 -1
- package/dist/cdn/waterfall/snice-waterfall.js +1 -1
- package/dist/cdn/waterfall/snice-waterfall.min.js +1 -1
- package/dist/cdn/weather/snice-weather.js +1 -1
- package/dist/cdn/weather/snice-weather.min.js +1 -1
- package/dist/cdn/work-order/snice-work-order.js +1 -1
- package/dist/cdn/work-order/snice-work-order.min.js +1 -1
- package/dist/components/badge/snice-badge.js +1 -1
- package/dist/components/badge/snice-badge.js.map +1 -1
- package/dist/components/button/snice-button.d.ts +2 -2
- package/dist/components/button/snice-button.js +11 -10
- package/dist/components/button/snice-button.js.map +1 -1
- package/dist/index.cjs +80 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +80 -58
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +80 -58
- package/dist/index.iife.js.map +1 -1
- package/dist/parts.d.ts +9 -7
- package/dist/symbols.cjs +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/package.json +20 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* snice v4.
|
|
2
|
+
* snice v4.28.0
|
|
3
3
|
* A decorator-driven web component library with differential rendering, routing, controllers, and 130+ ready-made UI components. Use as much or as little as you want. Zero dependencies, works anywhere.
|
|
4
4
|
* (c) 2024
|
|
5
5
|
* Released under the MIT License.
|
|
@@ -8,7 +8,7 @@ var Snice = (function (exports) {
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
10
|
/*!
|
|
11
|
-
* snice v4.
|
|
11
|
+
* snice v4.27.0
|
|
12
12
|
* A decorator-driven web component library with differential rendering, routing, controllers, and 130+ ready-made UI components. Use as much or as little as you want. Zero dependencies, works anywhere.
|
|
13
13
|
* (c) 2024
|
|
14
14
|
* Released under the MIT License.
|
|
@@ -2068,9 +2068,20 @@ var Snice = (function (exports) {
|
|
|
2068
2068
|
constructor(ifElement) {
|
|
2069
2069
|
super();
|
|
2070
2070
|
this.value = NOT_SET;
|
|
2071
|
-
this.
|
|
2072
|
-
|
|
2073
|
-
|
|
2071
|
+
this.childFragment = null;
|
|
2072
|
+
const parent = ifElement.parentNode;
|
|
2073
|
+
// Create comment boundary markers
|
|
2074
|
+
this.startNode = document.createComment('if');
|
|
2075
|
+
this.endNode = document.createComment('/if');
|
|
2076
|
+
// Insert markers where <if> is
|
|
2077
|
+
parent.insertBefore(this.startNode, ifElement);
|
|
2078
|
+
parent.insertBefore(this.endNode, ifElement.nextSibling);
|
|
2079
|
+
// Move <if>'s children between the markers
|
|
2080
|
+
while (ifElement.firstChild) {
|
|
2081
|
+
parent.insertBefore(ifElement.firstChild, this.endNode);
|
|
2082
|
+
}
|
|
2083
|
+
// Remove the <if> element from DOM
|
|
2084
|
+
parent.removeChild(ifElement);
|
|
2074
2085
|
}
|
|
2075
2086
|
commit(value) {
|
|
2076
2087
|
const condition = Boolean(value);
|
|
@@ -2079,26 +2090,32 @@ var Snice = (function (exports) {
|
|
|
2079
2090
|
this.value = value;
|
|
2080
2091
|
if (condition) {
|
|
2081
2092
|
// Show: restore children from fragment
|
|
2082
|
-
if (this.
|
|
2083
|
-
this.
|
|
2093
|
+
if (this.childFragment && this.childFragment.hasChildNodes()) {
|
|
2094
|
+
this.startNode.parentNode.insertBefore(this.childFragment, this.endNode);
|
|
2084
2095
|
}
|
|
2085
2096
|
}
|
|
2086
2097
|
else {
|
|
2087
2098
|
// Hide: move children to fragment
|
|
2088
|
-
if (!this.
|
|
2089
|
-
this.
|
|
2099
|
+
if (!this.childFragment) {
|
|
2100
|
+
this.childFragment = document.createDocumentFragment();
|
|
2090
2101
|
}
|
|
2091
|
-
|
|
2092
|
-
|
|
2102
|
+
let node = this.startNode.nextSibling;
|
|
2103
|
+
while (node && node !== this.endNode) {
|
|
2104
|
+
const next = node.nextSibling;
|
|
2105
|
+
this.childFragment.appendChild(node);
|
|
2106
|
+
node = next;
|
|
2093
2107
|
}
|
|
2094
2108
|
}
|
|
2095
2109
|
}
|
|
2096
2110
|
clear() {
|
|
2097
|
-
if (!this.
|
|
2098
|
-
this.
|
|
2111
|
+
if (!this.childFragment) {
|
|
2112
|
+
this.childFragment = document.createDocumentFragment();
|
|
2099
2113
|
}
|
|
2100
|
-
|
|
2101
|
-
|
|
2114
|
+
let node = this.startNode.nextSibling;
|
|
2115
|
+
while (node && node !== this.endNode) {
|
|
2116
|
+
const next = node.nextSibling;
|
|
2117
|
+
this.childFragment.appendChild(node);
|
|
2118
|
+
node = next;
|
|
2102
2119
|
}
|
|
2103
2120
|
}
|
|
2104
2121
|
}
|
|
@@ -2110,62 +2127,70 @@ var Snice = (function (exports) {
|
|
|
2110
2127
|
constructor(caseElement) {
|
|
2111
2128
|
super();
|
|
2112
2129
|
this.value = NOT_SET;
|
|
2113
|
-
this.
|
|
2114
|
-
this.
|
|
2115
|
-
this.
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
this.
|
|
2119
|
-
|
|
2120
|
-
|
|
2130
|
+
this.branches = new Map();
|
|
2131
|
+
this.defaultBranch = null;
|
|
2132
|
+
this.currentKey = null;
|
|
2133
|
+
const parent = caseElement.parentNode;
|
|
2134
|
+
// Create comment boundary markers
|
|
2135
|
+
this.startNode = document.createComment('case');
|
|
2136
|
+
this.endNode = document.createComment('/case');
|
|
2137
|
+
// Insert markers where <case> is
|
|
2138
|
+
parent.insertBefore(this.startNode, caseElement);
|
|
2139
|
+
parent.insertBefore(this.endNode, caseElement.nextSibling);
|
|
2140
|
+
// Extract branches from <when> and <default> children
|
|
2141
|
+
for (const child of Array.from(caseElement.children)) {
|
|
2121
2142
|
const childTag = child.tagName.toLowerCase();
|
|
2122
2143
|
if (childTag === 'when') {
|
|
2123
|
-
child.style.display = 'contents';
|
|
2124
2144
|
const whenValue = child.getAttribute('value') || '';
|
|
2125
|
-
this.childrenMap.set(whenValue, child);
|
|
2126
2145
|
const fragment = document.createDocumentFragment();
|
|
2127
|
-
|
|
2128
|
-
|
|
2146
|
+
while (child.firstChild) {
|
|
2147
|
+
fragment.appendChild(child.firstChild);
|
|
2148
|
+
}
|
|
2149
|
+
this.branches.set(whenValue, fragment);
|
|
2129
2150
|
}
|
|
2130
2151
|
else if (childTag === 'default') {
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
this.fragments.set(child, fragment);
|
|
2152
|
+
this.defaultBranch = document.createDocumentFragment();
|
|
2153
|
+
while (child.firstChild) {
|
|
2154
|
+
this.defaultBranch.appendChild(child.firstChild);
|
|
2155
|
+
}
|
|
2136
2156
|
}
|
|
2137
2157
|
}
|
|
2158
|
+
// Remove the <case> element from DOM
|
|
2159
|
+
parent.removeChild(caseElement);
|
|
2138
2160
|
}
|
|
2139
2161
|
commit(value) {
|
|
2140
2162
|
if (this.value === value)
|
|
2141
2163
|
return;
|
|
2142
2164
|
this.value = value;
|
|
2143
2165
|
const valueStr = String(value);
|
|
2144
|
-
//
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
this.
|
|
2166
|
+
// Move current content back to its fragment
|
|
2167
|
+
this._collectCurrent();
|
|
2168
|
+
// Insert matching branch
|
|
2169
|
+
const hasBranch = this.branches.has(valueStr);
|
|
2170
|
+
const matchingFragment = hasBranch ? this.branches.get(valueStr) : this.defaultBranch;
|
|
2171
|
+
this.currentKey = hasBranch ? valueStr : (this.defaultBranch ? '__default__' : null);
|
|
2172
|
+
if (matchingFragment && matchingFragment.hasChildNodes()) {
|
|
2173
|
+
this.startNode.parentNode.insertBefore(matchingFragment, this.endNode);
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
_collectCurrent() {
|
|
2177
|
+
if (this.currentKey === null)
|
|
2178
|
+
return;
|
|
2179
|
+
const fragment = this.currentKey === '__default__'
|
|
2180
|
+
? this.defaultBranch
|
|
2181
|
+
: this.branches.get(this.currentKey);
|
|
2182
|
+
if (!fragment)
|
|
2183
|
+
return;
|
|
2184
|
+
let node = this.startNode.nextSibling;
|
|
2185
|
+
while (node && node !== this.endNode) {
|
|
2186
|
+
const next = node.nextSibling;
|
|
2187
|
+
fragment.appendChild(node);
|
|
2188
|
+
node = next;
|
|
2159
2189
|
}
|
|
2160
2190
|
}
|
|
2161
2191
|
clear() {
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
if (fragment && !fragment.hasChildNodes()) {
|
|
2165
|
-
fragment.appendChild(this.currentChild);
|
|
2166
|
-
}
|
|
2167
|
-
this.currentChild = null;
|
|
2168
|
-
}
|
|
2192
|
+
this._collectCurrent();
|
|
2193
|
+
this.currentKey = null;
|
|
2169
2194
|
}
|
|
2170
2195
|
}
|
|
2171
2196
|
|
|
@@ -3090,19 +3115,16 @@ var Snice = (function (exports) {
|
|
|
3090
3115
|
if (!element.shadowRoot) {
|
|
3091
3116
|
element.attachShadow({ mode: 'open' });
|
|
3092
3117
|
}
|
|
3093
|
-
// Create base styles for meta elements (if, case)
|
|
3094
|
-
const baseStyleSheet = new CSSStyleSheet();
|
|
3095
|
-
baseStyleSheet.replaceSync('if, case { display: contents; }');
|
|
3096
3118
|
if (!element.shadowRoot)
|
|
3097
3119
|
return;
|
|
3098
3120
|
// Prefer constructable stylesheets
|
|
3099
3121
|
if (result.styleSheet && 'adoptedStyleSheets' in element.shadowRoot) {
|
|
3100
|
-
element.shadowRoot.adoptedStyleSheets = [
|
|
3122
|
+
element.shadowRoot.adoptedStyleSheets = [result.styleSheet];
|
|
3101
3123
|
return;
|
|
3102
3124
|
}
|
|
3103
3125
|
// Fallback to <style> tag
|
|
3104
3126
|
const style = document.createElement('style');
|
|
3105
|
-
style.textContent =
|
|
3127
|
+
style.textContent = result.cssText;
|
|
3106
3128
|
element.shadowRoot.appendChild(style);
|
|
3107
3129
|
}
|
|
3108
3130
|
catch (error) {
|
|
@@ -5422,7 +5444,7 @@ var Snice = (function (exports) {
|
|
|
5422
5444
|
}
|
|
5423
5445
|
|
|
5424
5446
|
/*!
|
|
5425
|
-
* snice v4.
|
|
5447
|
+
* snice v4.27.0
|
|
5426
5448
|
* A decorator-driven web component library with differential rendering, routing, controllers, and 130+ ready-made UI components. Use as much or as little as you want. Zero dependencies, works anywhere.
|
|
5427
5449
|
* (c) 2024
|
|
5428
5450
|
* Released under the MIT License.
|
|
@@ -5439,7 +5461,7 @@ var Snice = (function (exports) {
|
|
|
5439
5461
|
}
|
|
5440
5462
|
|
|
5441
5463
|
/*!
|
|
5442
|
-
* snice v4.
|
|
5464
|
+
* snice v4.27.0
|
|
5443
5465
|
* A decorator-driven web component library with differential rendering, routing, controllers, and 130+ ready-made UI components. Use as much or as little as you want. Zero dependencies, works anywhere.
|
|
5444
5466
|
* (c) 2024
|
|
5445
5467
|
* Released under the MIT License.
|