@teranga-ds/components 0.1.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/LICENSE +21 -0
- package/README.md +97 -0
- package/dist/cjs/index-BrBjyHdB.js +2038 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/cjs/teranga-ds.cjs.js +24 -0
- package/dist/cjs/tg-activity-feed.cjs.entry.js +29 -0
- package/dist/cjs/tg-activity-stream.cjs.entry.js +30 -0
- package/dist/cjs/tg-ai-feedback.cjs.entry.js +29 -0
- package/dist/cjs/tg-ai-insight-card.cjs.entry.js +20 -0
- package/dist/cjs/tg-alert.cjs.entry.js +42 -0
- package/dist/cjs/tg-audio-player.cjs.entry.js +46 -0
- package/dist/cjs/tg-autocomplete.cjs.entry.js +54 -0
- package/dist/cjs/tg-avatar.cjs.entry.js +39 -0
- package/dist/cjs/tg-badge.cjs.entry.js +31 -0
- package/dist/cjs/tg-bottom-nav.cjs.entry.js +30 -0
- package/dist/cjs/tg-bottom-sheet.cjs.entry.js +21 -0
- package/dist/cjs/tg-breadcrumb.cjs.entry.js +53 -0
- package/dist/cjs/tg-button.cjs.entry.js +45 -0
- package/dist/cjs/tg-calendar-view.cjs.entry.js +53 -0
- package/dist/cjs/tg-card.cjs.entry.js +31 -0
- package/dist/cjs/tg-chat-message.cjs.entry.js +19 -0
- package/dist/cjs/tg-chat.cjs.entry.js +59 -0
- package/dist/cjs/tg-checkbox.cjs.entry.js +31 -0
- package/dist/cjs/tg-combobox.cjs.entry.js +68 -0
- package/dist/cjs/tg-command-palette.cjs.entry.js +66 -0
- package/dist/cjs/tg-confidence-badge.cjs.entry.js +27 -0
- package/dist/cjs/tg-confirm-dialog.cjs.entry.js +27 -0
- package/dist/cjs/tg-context-menu.cjs.entry.js +35 -0
- package/dist/cjs/tg-data-table.cjs.entry.js +90 -0
- package/dist/cjs/tg-date-picker.cjs.entry.js +56 -0
- package/dist/cjs/tg-empty-state.cjs.entry.js +19 -0
- package/dist/cjs/tg-expandable-row.cjs.entry.js +19 -0
- package/dist/cjs/tg-fab.cjs.entry.js +22 -0
- package/dist/cjs/tg-file-upload.cjs.entry.js +86 -0
- package/dist/cjs/tg-global-loader.cjs.entry.js +24 -0
- package/dist/cjs/tg-heatmap.cjs.entry.js +65 -0
- package/dist/cjs/tg-image-gallery.cjs.entry.js +32 -0
- package/dist/cjs/tg-input.cjs.entry.js +51 -0
- package/dist/cjs/tg-kanban-board.cjs.entry.js +30 -0
- package/dist/cjs/tg-kpi-card.cjs.entry.js +20 -0
- package/dist/cjs/tg-live-badge.cjs.entry.js +20 -0
- package/dist/cjs/tg-login-form.cjs.entry.js +23 -0
- package/dist/cjs/tg-mega-menu.cjs.entry.js +34 -0
- package/dist/cjs/tg-modal.cjs.entry.js +43 -0
- package/dist/cjs/tg-model-selector.cjs.entry.js +34 -0
- package/dist/cjs/tg-multi-select.cjs.entry.js +67 -0
- package/dist/cjs/tg-navbar.cjs.entry.js +43 -0
- package/dist/cjs/tg-otp-input.cjs.entry.js +60 -0
- package/dist/cjs/tg-pagination.cjs.entry.js +53 -0
- package/dist/cjs/tg-presence-indicator.cjs.entry.js +33 -0
- package/dist/cjs/tg-progress.cjs.entry.js +53 -0
- package/dist/cjs/tg-prompt-input.cjs.entry.js +34 -0
- package/dist/cjs/tg-pull-to-refresh.cjs.entry.js +37 -0
- package/dist/cjs/tg-quick-switcher.cjs.entry.js +35 -0
- package/dist/cjs/tg-radio.cjs.entry.js +29 -0
- package/dist/cjs/tg-retry-ui.cjs.entry.js +22 -0
- package/dist/cjs/tg-rich-editor.cjs.entry.js +24 -0
- package/dist/cjs/tg-role-badge.cjs.entry.js +19 -0
- package/dist/cjs/tg-select.cjs.entry.js +69 -0
- package/dist/cjs/tg-session-expired.cjs.entry.js +24 -0
- package/dist/cjs/tg-sidebar.cjs.entry.js +35 -0
- package/dist/cjs/tg-skeleton.cjs.entry.js +30 -0
- package/dist/cjs/tg-slider.cjs.entry.js +26 -0
- package/dist/cjs/tg-source-citation.cjs.entry.js +29 -0
- package/dist/cjs/tg-spinner.cjs.entry.js +27 -0
- package/dist/cjs/tg-stat-widget.cjs.entry.js +19 -0
- package/dist/cjs/tg-status-badge.cjs.entry.js +21 -0
- package/dist/cjs/tg-stepper-input.cjs.entry.js +39 -0
- package/dist/cjs/tg-stepper.cjs.entry.js +31 -0
- package/dist/cjs/tg-streaming-response.cjs.entry.js +19 -0
- package/dist/cjs/tg-switch.cjs.entry.js +31 -0
- package/dist/cjs/tg-table.cjs.entry.js +113 -0
- package/dist/cjs/tg-tabs.cjs.entry.js +47 -0
- package/dist/cjs/tg-tag.cjs.entry.js +28 -0
- package/dist/cjs/tg-textarea.cjs.entry.js +45 -0
- package/dist/cjs/tg-time-picker.cjs.entry.js +37 -0
- package/dist/cjs/tg-timeline.cjs.entry.js +30 -0
- package/dist/cjs/tg-toast.cjs.entry.js +53 -0
- package/dist/cjs/tg-token-usage.cjs.entry.js +23 -0
- package/dist/cjs/tg-tooltip.cjs.entry.js +32 -0
- package/dist/cjs/tg-tree-view.cjs.entry.js +53 -0
- package/dist/cjs/tg-undo-snackbar.cjs.entry.js +30 -0
- package/dist/cjs/tg-video-player.cjs.entry.js +19 -0
- package/dist/cjs/tg-wizard-nav.cjs.entry.js +30 -0
- package/dist/collection/collection-manifest.json +91 -0
- package/dist/collection/components/tg-activity-feed/tg-activity-feed.css +10 -0
- package/dist/collection/components/tg-activity-feed/tg-activity-feed.js +81 -0
- package/dist/collection/components/tg-activity-stream/tg-activity-stream.css +11 -0
- package/dist/collection/components/tg-activity-stream/tg-activity-stream.js +83 -0
- package/dist/collection/components/tg-ai-feedback/tg-ai-feedback.css +12 -0
- package/dist/collection/components/tg-ai-feedback/tg-ai-feedback.js +80 -0
- package/dist/collection/components/tg-ai-insight-card/tg-ai-insight-card.css +10 -0
- package/dist/collection/components/tg-ai-insight-card/tg-ai-insight-card.js +144 -0
- package/dist/collection/components/tg-alert/tg-alert.css +122 -0
- package/dist/collection/components/tg-alert/tg-alert.js +142 -0
- package/dist/collection/components/tg-audio-player/tg-audio-player.css +11 -0
- package/dist/collection/components/tg-audio-player/tg-audio-player.js +118 -0
- package/dist/collection/components/tg-autocomplete/tg-autocomplete.css +15 -0
- package/dist/collection/components/tg-autocomplete/tg-autocomplete.js +285 -0
- package/dist/collection/components/tg-avatar/tg-avatar.css +72 -0
- package/dist/collection/components/tg-avatar/tg-avatar.js +195 -0
- package/dist/collection/components/tg-badge/tg-badge.css +153 -0
- package/dist/collection/components/tg-badge/tg-badge.js +128 -0
- package/dist/collection/components/tg-bottom-nav/tg-bottom-nav.css +7 -0
- package/dist/collection/components/tg-bottom-nav/tg-bottom-nav.js +99 -0
- package/dist/collection/components/tg-bottom-sheet/tg-bottom-sheet.css +8 -0
- package/dist/collection/components/tg-bottom-sheet/tg-bottom-sheet.js +84 -0
- package/dist/collection/components/tg-breadcrumb/tg-breadcrumb.css +82 -0
- package/dist/collection/components/tg-breadcrumb/tg-breadcrumb.js +111 -0
- package/dist/collection/components/tg-button/tg-button.css +245 -0
- package/dist/collection/components/tg-button/tg-button.js +239 -0
- package/dist/collection/components/tg-calendar-view/tg-calendar-view.css +19 -0
- package/dist/collection/components/tg-calendar-view/tg-calendar-view.js +108 -0
- package/dist/collection/components/tg-card/tg-card.css +117 -0
- package/dist/collection/components/tg-card/tg-card.js +134 -0
- package/dist/collection/components/tg-chat/tg-chat.css +207 -0
- package/dist/collection/components/tg-chat/tg-chat.js +194 -0
- package/dist/collection/components/tg-chat-message/tg-chat-message.css +15 -0
- package/dist/collection/components/tg-chat-message/tg-chat-message.js +104 -0
- package/dist/collection/components/tg-checkbox/tg-checkbox.css +94 -0
- package/dist/collection/components/tg-checkbox/tg-checkbox.js +210 -0
- package/dist/collection/components/tg-combobox/tg-combobox.css +22 -0
- package/dist/collection/components/tg-combobox/tg-combobox.js +290 -0
- package/dist/collection/components/tg-command-palette/tg-command-palette.css +16 -0
- package/dist/collection/components/tg-command-palette/tg-command-palette.js +152 -0
- package/dist/collection/components/tg-confidence-badge/tg-confidence-badge.css +12 -0
- package/dist/collection/components/tg-confidence-badge/tg-confidence-badge.js +93 -0
- package/dist/collection/components/tg-confirm-dialog/tg-confirm-dialog.css +19 -0
- package/dist/collection/components/tg-confirm-dialog/tg-confirm-dialog.js +204 -0
- package/dist/collection/components/tg-context-menu/tg-context-menu.css +12 -0
- package/dist/collection/components/tg-context-menu/tg-context-menu.js +107 -0
- package/dist/collection/components/tg-data-table/tg-data-table.css +19 -0
- package/dist/collection/components/tg-data-table/tg-data-table.js +287 -0
- package/dist/collection/components/tg-date-picker/tg-date-picker.css +28 -0
- package/dist/collection/components/tg-date-picker/tg-date-picker.js +251 -0
- package/dist/collection/components/tg-empty-state/tg-empty-state.css +7 -0
- package/dist/collection/components/tg-empty-state/tg-empty-state.js +123 -0
- package/dist/collection/components/tg-expandable-row/tg-expandable-row.css +13 -0
- package/dist/collection/components/tg-expandable-row/tg-expandable-row.js +89 -0
- package/dist/collection/components/tg-fab/tg-fab.css +16 -0
- package/dist/collection/components/tg-fab/tg-fab.js +164 -0
- package/dist/collection/components/tg-file-upload/tg-file-upload.css +172 -0
- package/dist/collection/components/tg-file-upload/tg-file-upload.js +240 -0
- package/dist/collection/components/tg-global-loader/tg-global-loader.css +8 -0
- package/dist/collection/components/tg-global-loader/tg-global-loader.js +90 -0
- package/dist/collection/components/tg-heatmap/tg-heatmap.css +9 -0
- package/dist/collection/components/tg-heatmap/tg-heatmap.js +191 -0
- package/dist/collection/components/tg-image-gallery/tg-image-gallery.css +13 -0
- package/dist/collection/components/tg-image-gallery/tg-image-gallery.js +90 -0
- package/dist/collection/components/tg-input/tg-input.css +164 -0
- package/dist/collection/components/tg-input/tg-input.js +355 -0
- package/dist/collection/components/tg-kanban-board/tg-kanban-board.css +14 -0
- package/dist/collection/components/tg-kanban-board/tg-kanban-board.js +80 -0
- package/dist/collection/components/tg-kpi-card/tg-kpi-card.css +17 -0
- package/dist/collection/components/tg-kpi-card/tg-kpi-card.js +163 -0
- package/dist/collection/components/tg-live-badge/tg-live-badge.css +11 -0
- package/dist/collection/components/tg-live-badge/tg-live-badge.js +87 -0
- package/dist/collection/components/tg-login-form/tg-login-form.css +16 -0
- package/dist/collection/components/tg-login-form/tg-login-form.js +150 -0
- package/dist/collection/components/tg-mega-menu/tg-mega-menu.css +19 -0
- package/dist/collection/components/tg-mega-menu/tg-mega-menu.js +82 -0
- package/dist/collection/components/tg-modal/tg-modal.css +132 -0
- package/dist/collection/components/tg-modal/tg-modal.js +180 -0
- package/dist/collection/components/tg-model-selector/tg-model-selector.css +15 -0
- package/dist/collection/components/tg-model-selector/tg-model-selector.js +117 -0
- package/dist/collection/components/tg-multi-select/tg-multi-select.css +22 -0
- package/dist/collection/components/tg-multi-select/tg-multi-select.js +251 -0
- package/dist/collection/components/tg-navbar/tg-navbar.css +144 -0
- package/dist/collection/components/tg-navbar/tg-navbar.js +159 -0
- package/dist/collection/components/tg-otp-input/tg-otp-input.css +10 -0
- package/dist/collection/components/tg-otp-input/tg-otp-input.js +221 -0
- package/dist/collection/components/tg-pagination/tg-pagination.css +73 -0
- package/dist/collection/components/tg-pagination/tg-pagination.js +137 -0
- package/dist/collection/components/tg-presence-indicator/tg-presence-indicator.css +10 -0
- package/dist/collection/components/tg-presence-indicator/tg-presence-indicator.js +80 -0
- package/dist/collection/components/tg-progress/tg-progress.css +142 -0
- package/dist/collection/components/tg-progress/tg-progress.js +299 -0
- package/dist/collection/components/tg-prompt-input/tg-prompt-input.css +11 -0
- package/dist/collection/components/tg-prompt-input/tg-prompt-input.js +142 -0
- package/dist/collection/components/tg-pull-to-refresh/tg-pull-to-refresh.css +7 -0
- package/dist/collection/components/tg-pull-to-refresh/tg-pull-to-refresh.js +127 -0
- package/dist/collection/components/tg-quick-switcher/tg-quick-switcher.css +12 -0
- package/dist/collection/components/tg-quick-switcher/tg-quick-switcher.js +120 -0
- package/dist/collection/components/tg-radio/tg-radio.css +83 -0
- package/dist/collection/components/tg-radio/tg-radio.js +169 -0
- package/dist/collection/components/tg-retry-ui/tg-retry-ui.css +10 -0
- package/dist/collection/components/tg-retry-ui/tg-retry-ui.js +145 -0
- package/dist/collection/components/tg-rich-editor/tg-rich-editor.css +10 -0
- package/dist/collection/components/tg-rich-editor/tg-rich-editor.js +151 -0
- package/dist/collection/components/tg-role-badge/tg-role-badge.css +7 -0
- package/dist/collection/components/tg-role-badge/tg-role-badge.js +85 -0
- package/dist/collection/components/tg-select/tg-select.css +144 -0
- package/dist/collection/components/tg-select/tg-select.js +329 -0
- package/dist/collection/components/tg-session-expired/tg-session-expired.css +8 -0
- package/dist/collection/components/tg-session-expired/tg-session-expired.js +128 -0
- package/dist/collection/components/tg-sidebar/tg-sidebar.css +188 -0
- package/dist/collection/components/tg-sidebar/tg-sidebar.js +112 -0
- package/dist/collection/components/tg-skeleton/tg-skeleton.css +58 -0
- package/dist/collection/components/tg-skeleton/tg-skeleton.js +135 -0
- package/dist/collection/components/tg-slider/tg-slider.css +10 -0
- package/dist/collection/components/tg-slider/tg-slider.js +208 -0
- package/dist/collection/components/tg-source-citation/tg-source-citation.css +12 -0
- package/dist/collection/components/tg-source-citation/tg-source-citation.js +56 -0
- package/dist/collection/components/tg-spinner/tg-spinner.css +50 -0
- package/dist/collection/components/tg-spinner/tg-spinner.js +101 -0
- package/dist/collection/components/tg-stat-widget/tg-stat-widget.css +12 -0
- package/dist/collection/components/tg-stat-widget/tg-stat-widget.js +142 -0
- package/dist/collection/components/tg-status-badge/tg-status-badge.css +24 -0
- package/dist/collection/components/tg-status-badge/tg-status-badge.js +108 -0
- package/dist/collection/components/tg-stepper/tg-stepper.css +17 -0
- package/dist/collection/components/tg-stepper/tg-stepper.js +104 -0
- package/dist/collection/components/tg-stepper-input/tg-stepper-input.css +15 -0
- package/dist/collection/components/tg-stepper-input/tg-stepper-input.js +200 -0
- package/dist/collection/components/tg-streaming-response/tg-streaming-response.css +12 -0
- package/dist/collection/components/tg-streaming-response/tg-streaming-response.js +104 -0
- package/dist/collection/components/tg-switch/tg-switch.css +89 -0
- package/dist/collection/components/tg-switch/tg-switch.js +172 -0
- package/dist/collection/components/tg-table/tg-table.css +117 -0
- package/dist/collection/components/tg-table/tg-table.js +289 -0
- package/dist/collection/components/tg-tabs/tg-tabs.css +114 -0
- package/dist/collection/components/tg-tabs/tg-tabs.js +141 -0
- package/dist/collection/components/tg-tag/tg-tag.css +76 -0
- package/dist/collection/components/tg-tag/tg-tag.js +152 -0
- package/dist/collection/components/tg-textarea/tg-textarea.css +105 -0
- package/dist/collection/components/tg-textarea/tg-textarea.js +357 -0
- package/dist/collection/components/tg-time-picker/tg-time-picker.css +15 -0
- package/dist/collection/components/tg-time-picker/tg-time-picker.js +213 -0
- package/dist/collection/components/tg-timeline/tg-timeline.css +14 -0
- package/dist/collection/components/tg-timeline/tg-timeline.js +83 -0
- package/dist/collection/components/tg-toast/tg-toast.css +112 -0
- package/dist/collection/components/tg-toast/tg-toast.js +181 -0
- package/dist/collection/components/tg-token-usage/tg-token-usage.css +14 -0
- package/dist/collection/components/tg-token-usage/tg-token-usage.js +129 -0
- package/dist/collection/components/tg-tooltip/tg-tooltip.css +93 -0
- package/dist/collection/components/tg-tooltip/tg-tooltip.js +104 -0
- package/dist/collection/components/tg-tree-view/tg-tree-view.css +10 -0
- package/dist/collection/components/tg-tree-view/tg-tree-view.js +112 -0
- package/dist/collection/components/tg-undo-snackbar/tg-undo-snackbar.css +8 -0
- package/dist/collection/components/tg-undo-snackbar/tg-undo-snackbar.js +148 -0
- package/dist/collection/components/tg-video-player/tg-video-player.css +6 -0
- package/dist/collection/components/tg-video-player/tg-video-player.js +104 -0
- package/dist/collection/components/tg-wizard-nav/tg-wizard-nav.css +14 -0
- package/dist/collection/components/tg-wizard-nav/tg-wizard-nav.js +202 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/teranga-tokens.css +189 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-BWkBF3Ng.js +1 -0
- package/dist/components/p-DcG1qXzH.js +1 -0
- package/dist/components/tg-activity-feed.d.ts +11 -0
- package/dist/components/tg-activity-feed.js +1 -0
- package/dist/components/tg-activity-stream.d.ts +11 -0
- package/dist/components/tg-activity-stream.js +1 -0
- package/dist/components/tg-ai-feedback.d.ts +11 -0
- package/dist/components/tg-ai-feedback.js +1 -0
- package/dist/components/tg-ai-insight-card.d.ts +11 -0
- package/dist/components/tg-ai-insight-card.js +1 -0
- package/dist/components/tg-alert.d.ts +11 -0
- package/dist/components/tg-alert.js +1 -0
- package/dist/components/tg-audio-player.d.ts +11 -0
- package/dist/components/tg-audio-player.js +1 -0
- package/dist/components/tg-autocomplete.d.ts +11 -0
- package/dist/components/tg-autocomplete.js +1 -0
- package/dist/components/tg-avatar.d.ts +11 -0
- package/dist/components/tg-avatar.js +1 -0
- package/dist/components/tg-badge.d.ts +11 -0
- package/dist/components/tg-badge.js +1 -0
- package/dist/components/tg-bottom-nav.d.ts +11 -0
- package/dist/components/tg-bottom-nav.js +1 -0
- package/dist/components/tg-bottom-sheet.d.ts +11 -0
- package/dist/components/tg-bottom-sheet.js +1 -0
- package/dist/components/tg-breadcrumb.d.ts +11 -0
- package/dist/components/tg-breadcrumb.js +1 -0
- package/dist/components/tg-button.d.ts +11 -0
- package/dist/components/tg-button.js +1 -0
- package/dist/components/tg-calendar-view.d.ts +11 -0
- package/dist/components/tg-calendar-view.js +1 -0
- package/dist/components/tg-card.d.ts +11 -0
- package/dist/components/tg-card.js +1 -0
- package/dist/components/tg-chat-message.d.ts +11 -0
- package/dist/components/tg-chat-message.js +1 -0
- package/dist/components/tg-chat.d.ts +11 -0
- package/dist/components/tg-chat.js +1 -0
- package/dist/components/tg-checkbox.d.ts +11 -0
- package/dist/components/tg-checkbox.js +1 -0
- package/dist/components/tg-combobox.d.ts +11 -0
- package/dist/components/tg-combobox.js +1 -0
- package/dist/components/tg-command-palette.d.ts +11 -0
- package/dist/components/tg-command-palette.js +1 -0
- package/dist/components/tg-confidence-badge.d.ts +11 -0
- package/dist/components/tg-confidence-badge.js +1 -0
- package/dist/components/tg-confirm-dialog.d.ts +11 -0
- package/dist/components/tg-confirm-dialog.js +1 -0
- package/dist/components/tg-context-menu.d.ts +11 -0
- package/dist/components/tg-context-menu.js +1 -0
- package/dist/components/tg-data-table.d.ts +11 -0
- package/dist/components/tg-data-table.js +1 -0
- package/dist/components/tg-date-picker.d.ts +11 -0
- package/dist/components/tg-date-picker.js +1 -0
- package/dist/components/tg-empty-state.d.ts +11 -0
- package/dist/components/tg-empty-state.js +1 -0
- package/dist/components/tg-expandable-row.d.ts +11 -0
- package/dist/components/tg-expandable-row.js +1 -0
- package/dist/components/tg-fab.d.ts +11 -0
- package/dist/components/tg-fab.js +1 -0
- package/dist/components/tg-file-upload.d.ts +11 -0
- package/dist/components/tg-file-upload.js +1 -0
- package/dist/components/tg-global-loader.d.ts +11 -0
- package/dist/components/tg-global-loader.js +1 -0
- package/dist/components/tg-heatmap.d.ts +11 -0
- package/dist/components/tg-heatmap.js +1 -0
- package/dist/components/tg-image-gallery.d.ts +11 -0
- package/dist/components/tg-image-gallery.js +1 -0
- package/dist/components/tg-input.d.ts +11 -0
- package/dist/components/tg-input.js +1 -0
- package/dist/components/tg-kanban-board.d.ts +11 -0
- package/dist/components/tg-kanban-board.js +1 -0
- package/dist/components/tg-kpi-card.d.ts +11 -0
- package/dist/components/tg-kpi-card.js +1 -0
- package/dist/components/tg-live-badge.d.ts +11 -0
- package/dist/components/tg-live-badge.js +1 -0
- package/dist/components/tg-login-form.d.ts +11 -0
- package/dist/components/tg-login-form.js +1 -0
- package/dist/components/tg-mega-menu.d.ts +11 -0
- package/dist/components/tg-mega-menu.js +1 -0
- package/dist/components/tg-modal.d.ts +11 -0
- package/dist/components/tg-modal.js +1 -0
- package/dist/components/tg-model-selector.d.ts +11 -0
- package/dist/components/tg-model-selector.js +1 -0
- package/dist/components/tg-multi-select.d.ts +11 -0
- package/dist/components/tg-multi-select.js +1 -0
- package/dist/components/tg-navbar.d.ts +11 -0
- package/dist/components/tg-navbar.js +1 -0
- package/dist/components/tg-otp-input.d.ts +11 -0
- package/dist/components/tg-otp-input.js +1 -0
- package/dist/components/tg-pagination.d.ts +11 -0
- package/dist/components/tg-pagination.js +1 -0
- package/dist/components/tg-presence-indicator.d.ts +11 -0
- package/dist/components/tg-presence-indicator.js +1 -0
- package/dist/components/tg-progress.d.ts +11 -0
- package/dist/components/tg-progress.js +1 -0
- package/dist/components/tg-prompt-input.d.ts +11 -0
- package/dist/components/tg-prompt-input.js +1 -0
- package/dist/components/tg-pull-to-refresh.d.ts +11 -0
- package/dist/components/tg-pull-to-refresh.js +1 -0
- package/dist/components/tg-quick-switcher.d.ts +11 -0
- package/dist/components/tg-quick-switcher.js +1 -0
- package/dist/components/tg-radio.d.ts +11 -0
- package/dist/components/tg-radio.js +1 -0
- package/dist/components/tg-retry-ui.d.ts +11 -0
- package/dist/components/tg-retry-ui.js +1 -0
- package/dist/components/tg-rich-editor.d.ts +11 -0
- package/dist/components/tg-rich-editor.js +1 -0
- package/dist/components/tg-role-badge.d.ts +11 -0
- package/dist/components/tg-role-badge.js +1 -0
- package/dist/components/tg-select.d.ts +11 -0
- package/dist/components/tg-select.js +1 -0
- package/dist/components/tg-session-expired.d.ts +11 -0
- package/dist/components/tg-session-expired.js +1 -0
- package/dist/components/tg-sidebar.d.ts +11 -0
- package/dist/components/tg-sidebar.js +1 -0
- package/dist/components/tg-skeleton.d.ts +11 -0
- package/dist/components/tg-skeleton.js +1 -0
- package/dist/components/tg-slider.d.ts +11 -0
- package/dist/components/tg-slider.js +1 -0
- package/dist/components/tg-source-citation.d.ts +11 -0
- package/dist/components/tg-source-citation.js +1 -0
- package/dist/components/tg-spinner.d.ts +11 -0
- package/dist/components/tg-spinner.js +1 -0
- package/dist/components/tg-stat-widget.d.ts +11 -0
- package/dist/components/tg-stat-widget.js +1 -0
- package/dist/components/tg-status-badge.d.ts +11 -0
- package/dist/components/tg-status-badge.js +1 -0
- package/dist/components/tg-stepper-input.d.ts +11 -0
- package/dist/components/tg-stepper-input.js +1 -0
- package/dist/components/tg-stepper.d.ts +11 -0
- package/dist/components/tg-stepper.js +1 -0
- package/dist/components/tg-streaming-response.d.ts +11 -0
- package/dist/components/tg-streaming-response.js +1 -0
- package/dist/components/tg-switch.d.ts +11 -0
- package/dist/components/tg-switch.js +1 -0
- package/dist/components/tg-table.d.ts +11 -0
- package/dist/components/tg-table.js +1 -0
- package/dist/components/tg-tabs.d.ts +11 -0
- package/dist/components/tg-tabs.js +1 -0
- package/dist/components/tg-tag.d.ts +11 -0
- package/dist/components/tg-tag.js +1 -0
- package/dist/components/tg-textarea.d.ts +11 -0
- package/dist/components/tg-textarea.js +1 -0
- package/dist/components/tg-time-picker.d.ts +11 -0
- package/dist/components/tg-time-picker.js +1 -0
- package/dist/components/tg-timeline.d.ts +11 -0
- package/dist/components/tg-timeline.js +1 -0
- package/dist/components/tg-toast.d.ts +11 -0
- package/dist/components/tg-toast.js +1 -0
- package/dist/components/tg-token-usage.d.ts +11 -0
- package/dist/components/tg-token-usage.js +1 -0
- package/dist/components/tg-tooltip.d.ts +11 -0
- package/dist/components/tg-tooltip.js +1 -0
- package/dist/components/tg-tree-view.d.ts +11 -0
- package/dist/components/tg-tree-view.js +1 -0
- package/dist/components/tg-undo-snackbar.d.ts +11 -0
- package/dist/components/tg-undo-snackbar.js +1 -0
- package/dist/components/tg-video-player.d.ts +11 -0
- package/dist/components/tg-video-player.js +1 -0
- package/dist/components/tg-wizard-nav.d.ts +11 -0
- package/dist/components/tg-wizard-nav.js +1 -0
- package/dist/docs.d.ts +480 -0
- package/dist/docs.json +14240 -0
- package/dist/esm/index-CXqO9vvj.js +2010 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +10 -0
- package/dist/esm/teranga-ds.js +20 -0
- package/dist/esm/tg-activity-feed.entry.js +27 -0
- package/dist/esm/tg-activity-stream.entry.js +28 -0
- package/dist/esm/tg-ai-feedback.entry.js +27 -0
- package/dist/esm/tg-ai-insight-card.entry.js +18 -0
- package/dist/esm/tg-alert.entry.js +40 -0
- package/dist/esm/tg-audio-player.entry.js +44 -0
- package/dist/esm/tg-autocomplete.entry.js +52 -0
- package/dist/esm/tg-avatar.entry.js +37 -0
- package/dist/esm/tg-badge.entry.js +29 -0
- package/dist/esm/tg-bottom-nav.entry.js +28 -0
- package/dist/esm/tg-bottom-sheet.entry.js +19 -0
- package/dist/esm/tg-breadcrumb.entry.js +51 -0
- package/dist/esm/tg-button.entry.js +43 -0
- package/dist/esm/tg-calendar-view.entry.js +51 -0
- package/dist/esm/tg-card.entry.js +29 -0
- package/dist/esm/tg-chat-message.entry.js +17 -0
- package/dist/esm/tg-chat.entry.js +57 -0
- package/dist/esm/tg-checkbox.entry.js +29 -0
- package/dist/esm/tg-combobox.entry.js +66 -0
- package/dist/esm/tg-command-palette.entry.js +64 -0
- package/dist/esm/tg-confidence-badge.entry.js +25 -0
- package/dist/esm/tg-confirm-dialog.entry.js +25 -0
- package/dist/esm/tg-context-menu.entry.js +33 -0
- package/dist/esm/tg-data-table.entry.js +88 -0
- package/dist/esm/tg-date-picker.entry.js +54 -0
- package/dist/esm/tg-empty-state.entry.js +17 -0
- package/dist/esm/tg-expandable-row.entry.js +17 -0
- package/dist/esm/tg-fab.entry.js +20 -0
- package/dist/esm/tg-file-upload.entry.js +84 -0
- package/dist/esm/tg-global-loader.entry.js +22 -0
- package/dist/esm/tg-heatmap.entry.js +63 -0
- package/dist/esm/tg-image-gallery.entry.js +30 -0
- package/dist/esm/tg-input.entry.js +49 -0
- package/dist/esm/tg-kanban-board.entry.js +28 -0
- package/dist/esm/tg-kpi-card.entry.js +18 -0
- package/dist/esm/tg-live-badge.entry.js +18 -0
- package/dist/esm/tg-login-form.entry.js +21 -0
- package/dist/esm/tg-mega-menu.entry.js +32 -0
- package/dist/esm/tg-modal.entry.js +41 -0
- package/dist/esm/tg-model-selector.entry.js +32 -0
- package/dist/esm/tg-multi-select.entry.js +65 -0
- package/dist/esm/tg-navbar.entry.js +41 -0
- package/dist/esm/tg-otp-input.entry.js +58 -0
- package/dist/esm/tg-pagination.entry.js +51 -0
- package/dist/esm/tg-presence-indicator.entry.js +31 -0
- package/dist/esm/tg-progress.entry.js +51 -0
- package/dist/esm/tg-prompt-input.entry.js +32 -0
- package/dist/esm/tg-pull-to-refresh.entry.js +35 -0
- package/dist/esm/tg-quick-switcher.entry.js +33 -0
- package/dist/esm/tg-radio.entry.js +27 -0
- package/dist/esm/tg-retry-ui.entry.js +20 -0
- package/dist/esm/tg-rich-editor.entry.js +22 -0
- package/dist/esm/tg-role-badge.entry.js +17 -0
- package/dist/esm/tg-select.entry.js +67 -0
- package/dist/esm/tg-session-expired.entry.js +22 -0
- package/dist/esm/tg-sidebar.entry.js +33 -0
- package/dist/esm/tg-skeleton.entry.js +28 -0
- package/dist/esm/tg-slider.entry.js +24 -0
- package/dist/esm/tg-source-citation.entry.js +27 -0
- package/dist/esm/tg-spinner.entry.js +25 -0
- package/dist/esm/tg-stat-widget.entry.js +17 -0
- package/dist/esm/tg-status-badge.entry.js +19 -0
- package/dist/esm/tg-stepper-input.entry.js +37 -0
- package/dist/esm/tg-stepper.entry.js +29 -0
- package/dist/esm/tg-streaming-response.entry.js +17 -0
- package/dist/esm/tg-switch.entry.js +29 -0
- package/dist/esm/tg-table.entry.js +111 -0
- package/dist/esm/tg-tabs.entry.js +45 -0
- package/dist/esm/tg-tag.entry.js +26 -0
- package/dist/esm/tg-textarea.entry.js +43 -0
- package/dist/esm/tg-time-picker.entry.js +35 -0
- package/dist/esm/tg-timeline.entry.js +28 -0
- package/dist/esm/tg-toast.entry.js +51 -0
- package/dist/esm/tg-token-usage.entry.js +21 -0
- package/dist/esm/tg-tooltip.entry.js +30 -0
- package/dist/esm/tg-tree-view.entry.js +51 -0
- package/dist/esm/tg-undo-snackbar.entry.js +28 -0
- package/dist/esm/tg-video-player.entry.js +17 -0
- package/dist/esm/tg-wizard-nav.entry.js +28 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/teranga-ds/index.esm.js +0 -0
- package/dist/teranga-ds/p-003a47ca.entry.js +1 -0
- package/dist/teranga-ds/p-017ddeb1.entry.js +1 -0
- package/dist/teranga-ds/p-02c5a12d.entry.js +1 -0
- package/dist/teranga-ds/p-0a42664a.entry.js +1 -0
- package/dist/teranga-ds/p-0b076dde.entry.js +1 -0
- package/dist/teranga-ds/p-0c4d9863.entry.js +1 -0
- package/dist/teranga-ds/p-0e8e624c.entry.js +1 -0
- package/dist/teranga-ds/p-188921a5.entry.js +1 -0
- package/dist/teranga-ds/p-1925d476.entry.js +1 -0
- package/dist/teranga-ds/p-19a4e248.entry.js +1 -0
- package/dist/teranga-ds/p-223af07c.entry.js +1 -0
- package/dist/teranga-ds/p-229331e3.entry.js +1 -0
- package/dist/teranga-ds/p-229a048d.entry.js +1 -0
- package/dist/teranga-ds/p-2537b595.entry.js +1 -0
- package/dist/teranga-ds/p-256c5686.entry.js +1 -0
- package/dist/teranga-ds/p-25af1fe1.entry.js +1 -0
- package/dist/teranga-ds/p-293e42b5.entry.js +1 -0
- package/dist/teranga-ds/p-29ce1cb3.entry.js +1 -0
- package/dist/teranga-ds/p-2bcf5c49.entry.js +1 -0
- package/dist/teranga-ds/p-2e8eb1cd.entry.js +1 -0
- package/dist/teranga-ds/p-321ec5a3.entry.js +1 -0
- package/dist/teranga-ds/p-34c8b3db.entry.js +1 -0
- package/dist/teranga-ds/p-3722c1c8.entry.js +1 -0
- package/dist/teranga-ds/p-386e978e.entry.js +1 -0
- package/dist/teranga-ds/p-45825e6c.entry.js +1 -0
- package/dist/teranga-ds/p-45d69cd2.entry.js +1 -0
- package/dist/teranga-ds/p-4ca63079.entry.js +1 -0
- package/dist/teranga-ds/p-4cdefae6.entry.js +1 -0
- package/dist/teranga-ds/p-4d3e0645.entry.js +1 -0
- package/dist/teranga-ds/p-5179d2e1.entry.js +1 -0
- package/dist/teranga-ds/p-5888f1d1.entry.js +1 -0
- package/dist/teranga-ds/p-58fd7fc1.entry.js +1 -0
- package/dist/teranga-ds/p-5b34ae37.entry.js +1 -0
- package/dist/teranga-ds/p-5cb3cab5.entry.js +1 -0
- package/dist/teranga-ds/p-5f64253e.entry.js +1 -0
- package/dist/teranga-ds/p-61bab799.entry.js +1 -0
- package/dist/teranga-ds/p-63285c1c.entry.js +1 -0
- package/dist/teranga-ds/p-6b40af59.entry.js +1 -0
- package/dist/teranga-ds/p-6c275cd2.entry.js +1 -0
- package/dist/teranga-ds/p-700908a2.entry.js +1 -0
- package/dist/teranga-ds/p-71257d05.entry.js +1 -0
- package/dist/teranga-ds/p-727543e6.entry.js +1 -0
- package/dist/teranga-ds/p-73082aef.entry.js +1 -0
- package/dist/teranga-ds/p-7acaa999.entry.js +1 -0
- package/dist/teranga-ds/p-81041fa8.entry.js +1 -0
- package/dist/teranga-ds/p-816417c6.entry.js +1 -0
- package/dist/teranga-ds/p-82057162.entry.js +1 -0
- package/dist/teranga-ds/p-84506153.entry.js +1 -0
- package/dist/teranga-ds/p-9259b7ad.entry.js +1 -0
- package/dist/teranga-ds/p-968f33cd.entry.js +1 -0
- package/dist/teranga-ds/p-9a86750e.entry.js +1 -0
- package/dist/teranga-ds/p-9b661306.entry.js +1 -0
- package/dist/teranga-ds/p-9ddbbe0b.entry.js +1 -0
- package/dist/teranga-ds/p-9f6a460b.entry.js +1 -0
- package/dist/teranga-ds/p-CXqO9vvj.js +2 -0
- package/dist/teranga-ds/p-a02dc9c0.entry.js +1 -0
- package/dist/teranga-ds/p-a25e8482.entry.js +1 -0
- package/dist/teranga-ds/p-a7ed37b2.entry.js +1 -0
- package/dist/teranga-ds/p-b4b5570e.entry.js +1 -0
- package/dist/teranga-ds/p-b762afff.entry.js +1 -0
- package/dist/teranga-ds/p-ba67b6cb.entry.js +1 -0
- package/dist/teranga-ds/p-bd667d1b.entry.js +1 -0
- package/dist/teranga-ds/p-bd7eefaa.entry.js +1 -0
- package/dist/teranga-ds/p-cd11c0ce.entry.js +1 -0
- package/dist/teranga-ds/p-d783708a.entry.js +1 -0
- package/dist/teranga-ds/p-dab038ae.entry.js +1 -0
- package/dist/teranga-ds/p-dda9a7c3.entry.js +1 -0
- package/dist/teranga-ds/p-deb81958.entry.js +1 -0
- package/dist/teranga-ds/p-dfaff259.entry.js +1 -0
- package/dist/teranga-ds/p-e0c5a144.entry.js +1 -0
- package/dist/teranga-ds/p-e26d2a8d.entry.js +1 -0
- package/dist/teranga-ds/p-e58a4ab8.entry.js +1 -0
- package/dist/teranga-ds/p-e8736bde.entry.js +1 -0
- package/dist/teranga-ds/p-eca93015.entry.js +1 -0
- package/dist/teranga-ds/p-ed2a5ec6.entry.js +1 -0
- package/dist/teranga-ds/p-ed48b855.entry.js +1 -0
- package/dist/teranga-ds/p-ee8c0470.entry.js +1 -0
- package/dist/teranga-ds/p-efff537c.entry.js +1 -0
- package/dist/teranga-ds/p-f5d99e53.entry.js +1 -0
- package/dist/teranga-ds/p-f790b8f4.entry.js +1 -0
- package/dist/teranga-ds/teranga-ds.css +1 -0
- package/dist/teranga-ds/teranga-ds.esm.js +1 -0
- package/dist/teranga-ds/teranga-tokens.css +189 -0
- package/dist/types/components/tg-activity-feed/tg-activity-feed.d.ts +13 -0
- package/dist/types/components/tg-activity-stream/tg-activity-stream.d.ts +14 -0
- package/dist/types/components/tg-ai-feedback/tg-ai-feedback.d.ts +14 -0
- package/dist/types/components/tg-ai-insight-card/tg-ai-insight-card.d.ts +9 -0
- package/dist/types/components/tg-alert/tg-alert.d.ts +28 -0
- package/dist/types/components/tg-audio-player/tg-audio-player.d.ts +15 -0
- package/dist/types/components/tg-autocomplete/tg-autocomplete.d.ts +21 -0
- package/dist/types/components/tg-avatar/tg-avatar.d.ts +27 -0
- package/dist/types/components/tg-badge/tg-badge.d.ts +21 -0
- package/dist/types/components/tg-bottom-nav/tg-bottom-nav.d.ts +14 -0
- package/dist/types/components/tg-bottom-sheet/tg-bottom-sheet.d.ts +7 -0
- package/dist/types/components/tg-breadcrumb/tg-breadcrumb.d.ts +12 -0
- package/dist/types/components/tg-button/tg-button.d.ts +35 -0
- package/dist/types/components/tg-calendar-view/tg-calendar-view.d.ts +18 -0
- package/dist/types/components/tg-card/tg-card.d.ts +27 -0
- package/dist/types/components/tg-chat/tg-chat.d.ts +24 -0
- package/dist/types/components/tg-chat-message/tg-chat-message.d.ts +7 -0
- package/dist/types/components/tg-checkbox/tg-checkbox.d.ts +14 -0
- package/dist/types/components/tg-combobox/tg-combobox.d.ts +30 -0
- package/dist/types/components/tg-command-palette/tg-command-palette.d.ts +20 -0
- package/dist/types/components/tg-confidence-badge/tg-confidence-badge.d.ts +7 -0
- package/dist/types/components/tg-confirm-dialog/tg-confirm-dialog.d.ts +13 -0
- package/dist/types/components/tg-context-menu/tg-context-menu.d.ts +21 -0
- package/dist/types/components/tg-data-table/tg-data-table.d.ts +34 -0
- package/dist/types/components/tg-date-picker/tg-date-picker.d.ts +22 -0
- package/dist/types/components/tg-empty-state/tg-empty-state.d.ts +8 -0
- package/dist/types/components/tg-expandable-row/tg-expandable-row.d.ts +7 -0
- package/dist/types/components/tg-fab/tg-fab.d.ts +11 -0
- package/dist/types/components/tg-file-upload/tg-file-upload.d.ts +28 -0
- package/dist/types/components/tg-global-loader/tg-global-loader.d.ts +6 -0
- package/dist/types/components/tg-heatmap/tg-heatmap.d.ts +14 -0
- package/dist/types/components/tg-image-gallery/tg-image-gallery.d.ts +12 -0
- package/dist/types/components/tg-input/tg-input.d.ts +48 -0
- package/dist/types/components/tg-kanban-board/tg-kanban-board.d.ts +23 -0
- package/dist/types/components/tg-kpi-card/tg-kpi-card.d.ts +10 -0
- package/dist/types/components/tg-live-badge/tg-live-badge.d.ts +6 -0
- package/dist/types/components/tg-login-form/tg-login-form.d.ts +16 -0
- package/dist/types/components/tg-mega-menu/tg-mega-menu.d.ts +21 -0
- package/dist/types/components/tg-modal/tg-modal.d.ts +14 -0
- package/dist/types/components/tg-model-selector/tg-model-selector.d.ts +18 -0
- package/dist/types/components/tg-multi-select/tg-multi-select.d.ts +25 -0
- package/dist/types/components/tg-navbar/tg-navbar.d.ts +16 -0
- package/dist/types/components/tg-otp-input/tg-otp-input.d.ts +18 -0
- package/dist/types/components/tg-pagination/tg-pagination.d.ts +10 -0
- package/dist/types/components/tg-presence-indicator/tg-presence-indicator.d.ts +10 -0
- package/dist/types/components/tg-progress/tg-progress.d.ts +18 -0
- package/dist/types/components/tg-prompt-input/tg-prompt-input.d.ts +12 -0
- package/dist/types/components/tg-pull-to-refresh/tg-pull-to-refresh.d.ts +15 -0
- package/dist/types/components/tg-quick-switcher/tg-quick-switcher.d.ts +18 -0
- package/dist/types/components/tg-radio/tg-radio.d.ts +12 -0
- package/dist/types/components/tg-retry-ui/tg-retry-ui.d.ts +10 -0
- package/dist/types/components/tg-rich-editor/tg-rich-editor.d.ts +13 -0
- package/dist/types/components/tg-role-badge/tg-role-badge.d.ts +6 -0
- package/dist/types/components/tg-select/tg-select.d.ts +27 -0
- package/dist/types/components/tg-session-expired/tg-session-expired.d.ts +9 -0
- package/dist/types/components/tg-sidebar/tg-sidebar.d.ts +20 -0
- package/dist/types/components/tg-skeleton/tg-skeleton.d.ts +8 -0
- package/dist/types/components/tg-slider/tg-slider.d.ts +15 -0
- package/dist/types/components/tg-source-citation/tg-source-citation.d.ts +10 -0
- package/dist/types/components/tg-spinner/tg-spinner.d.ts +16 -0
- package/dist/types/components/tg-stat-widget/tg-stat-widget.d.ts +9 -0
- package/dist/types/components/tg-status-badge/tg-status-badge.d.ts +7 -0
- package/dist/types/components/tg-stepper/tg-stepper.d.ts +11 -0
- package/dist/types/components/tg-stepper-input/tg-stepper-input.d.ts +15 -0
- package/dist/types/components/tg-streaming-response/tg-streaming-response.d.ts +7 -0
- package/dist/types/components/tg-switch/tg-switch.d.ts +12 -0
- package/dist/types/components/tg-table/tg-table.d.ts +30 -0
- package/dist/types/components/tg-tabs/tg-tabs.d.ts +18 -0
- package/dist/types/components/tg-tag/tg-tag.d.ts +10 -0
- package/dist/types/components/tg-textarea/tg-textarea.d.ts +23 -0
- package/dist/types/components/tg-time-picker/tg-time-picker.d.ts +16 -0
- package/dist/types/components/tg-timeline/tg-timeline.d.ts +13 -0
- package/dist/types/components/tg-toast/tg-toast.d.ts +17 -0
- package/dist/types/components/tg-token-usage/tg-token-usage.d.ts +10 -0
- package/dist/types/components/tg-tooltip/tg-tooltip.d.ts +10 -0
- package/dist/types/components/tg-tree-view/tg-tree-view.d.ts +17 -0
- package/dist/types/components/tg-undo-snackbar/tg-undo-snackbar.d.ts +11 -0
- package/dist/types/components/tg-video-player/tg-video-player.d.ts +7 -0
- package/dist/types/components/tg-wizard-nav/tg-wizard-nav.d.ts +15 -0
- package/dist/types/components.d.ts +5028 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +74 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BrBjyHdB.js');
|
|
4
|
+
|
|
5
|
+
const tgButtonCss = () => `:host{display:inline-block}:host([full-width]){display:block;width:100%}.tg-button{display:inline-flex;align-items:center;justify-content:center;gap:var(--tg-spacing-2);font-family:var(--tg-font-family-sans);font-weight:var(--tg-font-weight-semibold);line-height:var(--tg-line-height-tight);white-space:nowrap;cursor:pointer;border:1px solid transparent;border-radius:var(--tg-radius-lg);text-decoration:none;transition:background-color var(--tg-duration-normal) var(--tg-ease-default), border-color var(--tg-duration-normal) var(--tg-ease-default), color var(--tg-duration-normal) var(--tg-ease-default), box-shadow var(--tg-duration-normal) var(--tg-ease-default), opacity var(--tg-duration-normal) var(--tg-ease-default);outline:none;position:relative;overflow:hidden}.tg-button:focus-visible{box-shadow:var(--tg-focus-ring);outline:none}.tg-button--sm{height:2rem;padding:0 var(--tg-spacing-3);font-size:var(--tg-font-size-sm)}.tg-button--md{height:2.5rem;padding:0 var(--tg-spacing-4);font-size:var(--tg-font-size-sm)}.tg-button--lg{height:3rem;padding:0 var(--tg-spacing-6);font-size:var(--tg-font-size-md)}.tg-button--primary{background-color:var(--tg-color-primary);border-color:var(--tg-color-primary);color:var(--tg-color-primary-on)}.tg-button--primary:hover:not(.tg-button--disabled):not(.tg-button--loading){background-color:var(--tg-color-primary-hover);border-color:var(--tg-color-primary-hover)}.tg-button--primary:active:not(.tg-button--disabled):not(.tg-button--loading){background-color:var(--tg-color-primary-active);border-color:var(--tg-color-primary-active)}.tg-button--secondary{background-color:var(--tg-color-secondary);border-color:var(--tg-color-secondary);color:var(--tg-color-secondary-on)}.tg-button--secondary:hover:not(.tg-button--disabled):not(.tg-button--loading){background-color:var(--tg-color-secondary-hover);border-color:var(--tg-color-secondary-hover)}.tg-button--secondary:active:not(.tg-button--disabled):not(.tg-button--loading){background-color:var(--tg-color-secondary-active);border-color:var(--tg-color-secondary-active)}.tg-button--outline{background-color:transparent;border-color:var(--tg-color-primary);color:var(--tg-color-primary)}.tg-button--outline:hover:not(.tg-button--disabled):not(.tg-button--loading){background-color:var(--tg-color-primary-subtle)}.tg-button--outline:active:not(.tg-button--disabled):not(.tg-button--loading){background-color:var(--tg-color-primary-muted)}.tg-button--ghost{background-color:transparent;border-color:transparent;color:var(--tg-color-primary)}.tg-button--ghost:hover:not(.tg-button--disabled):not(.tg-button--loading){background-color:var(--tg-color-primary-subtle)}.tg-button--ghost:active:not(.tg-button--disabled):not(.tg-button--loading){background-color:var(--tg-color-primary-muted)}.tg-button--danger{background-color:var(--tg-color-danger);border-color:var(--tg-color-danger);color:var(--tg-color-danger-on)}.tg-button--danger:hover:not(.tg-button--disabled):not(.tg-button--loading){background-color:var(--tg-color-danger-hover);border-color:var(--tg-color-danger-hover)}.tg-button--danger:active:not(.tg-button--disabled):not(.tg-button--loading){background-color:var(--tg-color-danger-active);border-color:var(--tg-color-danger-active)}.tg-button--disabled,.tg-button[disabled]{opacity:0.45;cursor:not-allowed;pointer-events:none}.tg-button--full-width{width:100%}.tg-button--loading{cursor:wait}.tg-button__spinner{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;animation:tg-spin 0.75s linear infinite}.tg-button--sm .tg-button__spinner{width:14px;height:14px}.tg-button--md .tg-button__spinner{width:16px;height:16px}.tg-button--lg .tg-button__spinner{width:20px;height:20px}.tg-button__spinner svg{width:100%;height:100%}@keyframes tg-spin{to{transform:rotate(360deg)}}.tg-button::after{content:'';position:absolute;inset:0;background:radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 60%);opacity:0;transform:scale(0);transition:opacity 0.3s, transform 0.3s;pointer-events:none}.tg-button:active:not(.tg-button--disabled):not(.tg-button--loading)::after{opacity:1;transform:scale(2.5);transition:0s}.tg-button:active:not(.tg-button--disabled):not(.tg-button--loading){transform:scale(0.97)}.tg-button--primary:hover:not(.tg-button--disabled):not(.tg-button--loading){transform:translateY(-1px);box-shadow:var(--tg-shadow-primary, 0 4px 14px -3px rgba(0, 133, 63, 0.35))}.tg-button--secondary:hover:not(.tg-button--disabled):not(.tg-button--loading){transform:translateY(-1px);box-shadow:var(--tg-shadow-secondary, 0 4px 14px -3px rgba(200, 170, 0, 0.3))}.tg-button--danger:hover:not(.tg-button--disabled):not(.tg-button--loading){transform:translateY(-1px);box-shadow:var(--tg-shadow-danger, 0 4px 14px -3px rgba(227, 27, 35, 0.3))}.tg-button{letter-spacing:0.01em}.tg-button--icon-only.tg-button--sm{width:2rem;padding:0}.tg-button--icon-only.tg-button--md{width:2.5rem;padding:0}.tg-button--icon-only.tg-button--lg{width:3rem;padding:0}.tg-button__label{display:inline-flex;align-items:center}::slotted([slot='icon-start']),::slotted([slot='icon-end']){display:inline-flex;align-items:center;flex-shrink:0;width:1em;height:1em}`;
|
|
6
|
+
|
|
7
|
+
const TgButton = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.tgClick = index.createEvent(this, "tgClick");
|
|
11
|
+
/** Visual style of the button */
|
|
12
|
+
this.variant = 'primary';
|
|
13
|
+
/** Size of the button */
|
|
14
|
+
this.size = 'md';
|
|
15
|
+
/** Disables the button */
|
|
16
|
+
this.disabled = false;
|
|
17
|
+
/** Shows a loading spinner and disables interaction */
|
|
18
|
+
this.loading = false;
|
|
19
|
+
/** Stretches the button to full container width */
|
|
20
|
+
this.fullWidth = false;
|
|
21
|
+
/** Native button type attribute */
|
|
22
|
+
this.type = 'button';
|
|
23
|
+
this.handleClick = () => {
|
|
24
|
+
if (!this.disabled && !this.loading) {
|
|
25
|
+
this.tgClick.emit();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
const Tag = this.href ? 'a' : 'button';
|
|
31
|
+
const attrs = this.href
|
|
32
|
+
? Object.assign(Object.assign({ href: this.href }, (this.target ? { target: this.target } : {})), (this.target === '_blank' ? { rel: 'noopener noreferrer' } : {})) : { type: this.type, disabled: this.disabled || this.loading };
|
|
33
|
+
return (index.h(index.Host, { key: '85193b6b5b939d7a911650820cfa57604ef66034' }, index.h(Tag, Object.assign({ key: 'be304319fd4e72d315e0942b409e2f356ad375fc', class: {
|
|
34
|
+
'tg-button': true,
|
|
35
|
+
[`tg-button--${this.variant}`]: true,
|
|
36
|
+
[`tg-button--${this.size}`]: true,
|
|
37
|
+
'tg-button--full-width': this.fullWidth,
|
|
38
|
+
'tg-button--loading': this.loading,
|
|
39
|
+
'tg-button--disabled': this.disabled,
|
|
40
|
+
} }, attrs, { "aria-disabled": this.disabled || this.loading ? 'true' : undefined, "aria-busy": this.loading ? 'true' : undefined, onClick: this.handleClick }), this.loading && (index.h("span", { key: '38808b3251dbeb279b2a02eb8b7a7afde968695c', class: "tg-button__spinner", "aria-hidden": "true" }, index.h("svg", { key: '46043cbb407c33daef90131ef03b93e039c4c9a4', viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("circle", { key: '8a44304e7145904cda62eb5129515ed25d3e99e6', cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "3", opacity: "0.25" }), index.h("path", { key: '21fb0610a8c1db5cacc3b223a8db0e10d4b786a9', d: "M12 2a10 10 0 0 1 10 10", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round" })))), index.h("slot", { key: '0e300e079a33a79379d3becae14468f783673550', name: "icon-start" }), index.h("span", { key: 'e041222fab4cbebec2619f7e17b8b87fb37995a8', class: "tg-button__label" }, index.h("slot", { key: 'ae2e3a577c8167746948cda5328597da034f630b' })), index.h("slot", { key: '360dab87f77ed5008fb99eebc52b752970241a3c', name: "icon-end" }))));
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
TgButton.style = tgButtonCss();
|
|
44
|
+
|
|
45
|
+
exports.tg_button = TgButton;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BrBjyHdB.js');
|
|
4
|
+
|
|
5
|
+
const tgCalendarViewCss = () => `:host{display:block}.tg-cal{font-family:var(--tg-font-family-sans);background:var(--tg-color-surface-raised);border:1px solid var(--tg-color-border);border-radius:var(--tg-radius-xl);padding:var(--tg-spacing-4)}.tg-cal__nav{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--tg-spacing-3)}.tg-cal__nav-btn{background:none;border:none;cursor:pointer;font-size:1.5rem;color:var(--tg-color-text-primary);padding:var(--tg-spacing-1) var(--tg-spacing-2);border-radius:var(--tg-radius-md)}.tg-cal__nav-btn:hover{background:var(--tg-color-primary-subtle)}.tg-cal__month{font-size:var(--tg-font-size-md);font-weight:var(--tg-font-weight-semibold)}.tg-cal__weekdays{display:grid;grid-template-columns:repeat(7, 1fr);margin-bottom:var(--tg-spacing-1)}.tg-cal__wd{text-align:center;font-size:var(--tg-font-size-xs);color:var(--tg-color-text-secondary);font-weight:var(--tg-font-weight-medium);padding:var(--tg-spacing-2) 0}.tg-cal__grid{display:grid;grid-template-columns:repeat(7, 1fr);gap:1px;background:var(--tg-color-border);border:1px solid var(--tg-color-border);border-radius:var(--tg-radius-lg);overflow:hidden}.tg-cal__cell{min-height:5rem;padding:var(--tg-spacing-1);background:var(--tg-color-surface-raised);cursor:pointer}.tg-cal__cell:hover{background:var(--tg-color-primary-subtle)}.tg-cal__cell--empty{cursor:default;background:var(--tg-color-surface-sunken)}.tg-cal__cell--today{background:var(--tg-color-primary-subtle)}.tg-cal__day-num{display:block;font-size:var(--tg-font-size-xs);font-weight:var(--tg-font-weight-medium);margin-bottom:var(--tg-spacing-0-5)}.tg-cal__event{font-size:0.625rem;padding:1px var(--tg-spacing-1);border-radius:var(--tg-radius-sm);margin-bottom:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tg-cal__event--default{background:var(--tg-color-primary-subtle);color:var(--tg-color-primary)}.tg-cal__event--success{background:var(--tg-color-success-subtle);color:var(--tg-color-success)}.tg-cal__event--warning{background:var(--tg-color-warning-subtle);color:var(--tg-color-warning)}.tg-cal__event--danger{background:var(--tg-color-danger-subtle);color:var(--tg-color-danger)}`;
|
|
6
|
+
|
|
7
|
+
const TgCalendarView = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.tgDateSelect = index.createEvent(this, "tgDateSelect");
|
|
11
|
+
this.events = [];
|
|
12
|
+
this.viewDate = new Date();
|
|
13
|
+
this.prevMonth = () => { const d = new Date(this.viewDate); d.setMonth(d.getMonth() - 1); this.viewDate = d; };
|
|
14
|
+
this.nextMonth = () => { const d = new Date(this.viewDate); d.setMonth(d.getMonth() + 1); this.viewDate = d; };
|
|
15
|
+
}
|
|
16
|
+
get parsed() {
|
|
17
|
+
if (typeof this.events === 'string') {
|
|
18
|
+
try {
|
|
19
|
+
return JSON.parse(this.events);
|
|
20
|
+
}
|
|
21
|
+
catch (_a) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return this.events;
|
|
26
|
+
}
|
|
27
|
+
daysInMonth(y, m) { return new Date(y, m + 1, 0).getDate(); }
|
|
28
|
+
firstDow(y, m) { return new Date(y, m, 1).getDay(); }
|
|
29
|
+
getEvents(day) {
|
|
30
|
+
const y = this.viewDate.getFullYear();
|
|
31
|
+
const m = String(this.viewDate.getMonth() + 1).padStart(2, '0');
|
|
32
|
+
const d = String(day).padStart(2, '0');
|
|
33
|
+
const dateStr = y + '-' + m + '-' + d;
|
|
34
|
+
return this.parsed.filter(e => e.date === dateStr);
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
const y = this.viewDate.getFullYear();
|
|
38
|
+
const m = this.viewDate.getMonth();
|
|
39
|
+
const days = this.daysInMonth(y, m);
|
|
40
|
+
const first = this.firstDow(y, m);
|
|
41
|
+
const months = ['Janvier', 'F\u00e9vrier', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Ao\u00fbt', 'Septembre', 'Octobre', 'Novembre', 'D\u00e9cembre'];
|
|
42
|
+
const dNames = ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'];
|
|
43
|
+
const cells = [];
|
|
44
|
+
for (let i = 0; i < first; i++)
|
|
45
|
+
cells.push(null);
|
|
46
|
+
for (let i = 1; i <= days; i++)
|
|
47
|
+
cells.push(i);
|
|
48
|
+
return (index.h(index.Host, { key: '5d19cf4407abf802127e686e26b4ce2e50aa4e48' }, index.h("div", { key: 'ed361d104dde29bec0e44e90782fb0387e7ec907', class: "tg-cal" }, index.h("div", { key: 'b386975ff0453e1562352f92cc2362376b278574', class: "tg-cal__nav" }, index.h("button", { key: '961f0a5748d053dbc4c44bd2cb92d89427ab8fc5', class: "tg-cal__nav-btn", type: "button", onClick: this.prevMonth }, "\\u2039"), index.h("span", { key: '204c44557e626d4b39dbed6a40b617147bad7eeb', class: "tg-cal__month" }, months[m], " ", y), index.h("button", { key: '74ec81ffccd6367023aca4b340099a19162d5669', class: "tg-cal__nav-btn", type: "button", onClick: this.nextMonth }, "\\u203a")), index.h("div", { key: 'c4d5c746da64d14044f46585961a16923d913401', class: "tg-cal__weekdays" }, dNames.map(d => index.h("span", { class: "tg-cal__wd" }, d))), index.h("div", { key: '3227acc2de576a8322f847457e840c00b70d1efb', class: "tg-cal__grid" }, cells.map(day => (index.h("div", { class: { 'tg-cal__cell': true, 'tg-cal__cell--empty': !day, 'tg-cal__cell--today': day !== null && new Date().getDate() === day && new Date().getMonth() === m && new Date().getFullYear() === y }, onClick: () => day && this.tgDateSelect.emit(y + '-' + String(m + 1).padStart(2, '0') + '-' + String(day).padStart(2, '0')) }, day && index.h("span", { class: "tg-cal__day-num" }, day), day && this.getEvents(day).map(ev => index.h("div", { class: 'tg-cal__event tg-cal__event--' + (ev.variant || 'default') }, ev.title)))))))));
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
TgCalendarView.style = tgCalendarViewCss();
|
|
52
|
+
|
|
53
|
+
exports.tg_calendar_view = TgCalendarView;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BrBjyHdB.js');
|
|
4
|
+
|
|
5
|
+
const tgCardCss = () => `:host{display:block}:host([full-width]){width:100%}.tg-card{background-color:var(--tg-color-surface-raised);border-radius:var(--tg-radius-xl);border:1px solid var(--tg-color-border);overflow:hidden;display:flex;flex-direction:column;font-family:var(--tg-font-family-sans)}.tg-card--flat{box-shadow:none}.tg-card--raised{box-shadow:var(--tg-shadow-sm)}.tg-card--floating{box-shadow:var(--tg-shadow-md)}.tg-card--interactive{cursor:pointer;transition:box-shadow var(--tg-duration-normal) var(--tg-ease-default), transform var(--tg-duration-normal) var(--tg-ease-default)}.tg-card--interactive:hover{box-shadow:var(--tg-shadow-lg);transform:translateY(-1px)}.tg-card--interactive:active{box-shadow:var(--tg-shadow-sm);transform:translateY(0)}::slotted([slot='media']){display:block;width:100%;object-fit:cover}.tg-card__header-slot:not(:empty){padding:var(--tg-spacing-4) var(--tg-spacing-5);border-bottom:1px solid var(--tg-color-border);font-weight:var(--tg-font-weight-semibold);font-size:var(--tg-font-size-md);color:var(--tg-color-text-primary)}.tg-card__body{flex:1;padding:var(--tg-spacing-5);color:var(--tg-color-text-secondary);font-size:var(--tg-font-size-sm);line-height:var(--tg-line-height-relaxed)}.tg-card--no-padding .tg-card__body{padding:0}.tg-card__footer-slot:not(:empty){padding:var(--tg-spacing-4) var(--tg-spacing-5);border-top:1px solid var(--tg-color-border);display:flex;align-items:center;gap:var(--tg-spacing-3)}.tg-card--accent-primary{border-top:3px solid var(--tg-color-primary)}.tg-card--accent-secondary{border-top:3px solid var(--tg-color-secondary)}.tg-card--accent-danger{border-top:3px solid var(--tg-color-danger)}.tg-card--accent-success{border-top:3px solid var(--tg-color-success)}.tg-card--accent-accent{border-top:3px solid var(--tg-color-accent, #C2703A)}.tg-card--accent-flag{border-top:3px solid transparent;border-image:linear-gradient(90deg, var(--tg-color-green-500), var(--tg-color-gold-600), var(--tg-color-red-500)) 1}.tg-card{animation:tg-card-enter var(--tg-duration-normal, 200ms) var(--tg-ease-out, ease-out)}@keyframes tg-card-enter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.tg-card--interactive:focus-within{box-shadow:var(--tg-focus-ring)}`;
|
|
6
|
+
|
|
7
|
+
const TgCard = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
/** Visual elevation / shadow level */
|
|
11
|
+
this.elevation = 'raised';
|
|
12
|
+
/** Removes internal padding for flush content */
|
|
13
|
+
this.noPadding = false;
|
|
14
|
+
/** Makes the card take full width of its container */
|
|
15
|
+
this.fullWidth = false;
|
|
16
|
+
/** Makes the card interactive (hover + cursor pointer) */
|
|
17
|
+
this.interactive = false;
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return (index.h(index.Host, { key: '8c305fbeed5f77c0f32ca5c3cefe5af1ad84e623' }, index.h("div", { key: 'dcd60171d6321db97fa864093df5d42ad82bbb8e', class: {
|
|
21
|
+
'tg-card': true,
|
|
22
|
+
[`tg-card--${this.elevation}`]: true,
|
|
23
|
+
'tg-card--no-padding': this.noPadding,
|
|
24
|
+
'tg-card--full-width': this.fullWidth,
|
|
25
|
+
'tg-card--interactive': this.interactive,
|
|
26
|
+
} }, index.h("slot", { key: '3dd0f10efc40225b531384c75a1bd317750bb2fc', name: "media" }), index.h("div", { key: '7c96f4e1c507e42edb495ce0a6963ca28e6a308d', class: "tg-card__header-slot" }, index.h("slot", { key: '6fafb906f219aa6e8f9c8699034710fecc567a9f', name: "header" })), index.h("div", { key: '48cfed9312a3a7fa41c2cc4e0e81608587807a63', class: "tg-card__body" }, index.h("slot", { key: 'cc717ecfa2aa6a5e9c8fc0aff3d61bc99921f188' })), index.h("div", { key: '0ebcde8f0af639ccda9cdbf96fdff087e7152070', class: "tg-card__footer-slot" }, index.h("slot", { key: '34d345e1cc83580d1f864f802f53a6f0df327d13', name: "footer" })))));
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
TgCard.style = tgCardCss();
|
|
30
|
+
|
|
31
|
+
exports.tg_card = TgCard;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BrBjyHdB.js');
|
|
4
|
+
|
|
5
|
+
const tgChatMessageCss = () => `:host{display:block}.tg-cm{display:flex;gap:var(--tg-spacing-2);font-family:var(--tg-font-family-sans);margin-bottom:var(--tg-spacing-3);animation:tg-cm-in 0.2s var(--tg-ease-out)}@keyframes tg-cm-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.tg-cm--user{flex-direction:row-reverse}.tg-cm__avatar{width:2rem;height:2rem;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:1rem;flex-shrink:0}.tg-cm--assistant .tg-cm__avatar{background:var(--tg-color-primary-subtle)}.tg-cm--user .tg-cm__avatar{background:var(--tg-color-surface-sunken)}.tg-cm__bubble{padding:var(--tg-spacing-3);border-radius:var(--tg-radius-xl);font-size:var(--tg-font-size-sm);line-height:var(--tg-line-height-relaxed);max-width:80%}.tg-cm--assistant .tg-cm__bubble{background:var(--tg-color-surface-raised);border:1px solid var(--tg-color-border);color:var(--tg-color-text-primary);border-bottom-left-radius:var(--tg-radius-sm)}.tg-cm--user .tg-cm__bubble{background:var(--tg-color-primary);color:var(--tg-color-primary-on);border-bottom-right-radius:var(--tg-radius-sm);margin-left:auto}.tg-cm--system .tg-cm__bubble{background:var(--tg-color-warning-subtle);color:var(--tg-color-warning);text-align:center;max-width:100%;font-size:var(--tg-font-size-xs)}.tg-cm__cursor{display:inline-block;width:2px;height:1em;background:var(--tg-color-primary);animation:tg-cm-blink 0.8s infinite;vertical-align:middle;margin-left:2px}@keyframes tg-cm-blink{0%,100%{opacity:1}50%{opacity:0}}.tg-cm__time{display:block;font-size:var(--tg-font-size-xs);color:var(--tg-color-text-disabled);margin-top:var(--tg-spacing-0-5)}.tg-cm--user .tg-cm__time{text-align:right}`;
|
|
6
|
+
|
|
7
|
+
const TgChatMessage = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.role = 'user';
|
|
11
|
+
this.streaming = false;
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (index.h(index.Host, { key: '8f33ddbaf10f4111a7747d18afd4b8ae1ed6d9b2' }, index.h("div", { key: '4f0fef482ab9e2070a4a2ee5494bbcd9cd9c5f44', class: 'tg-cm tg-cm--' + this.role }, index.h("div", { key: 'ab5528b751f5947e2a2450dbb99ef777ce43562a', class: "tg-cm__avatar" }, this.avatar || (this.role === 'user' ? '\ud83d\udc64' : '\ud83e\udd16')), index.h("div", { key: '5cc89064ada68b7adf4ed56067acbfe2474610ad', class: "tg-cm__body" }, index.h("div", { key: '58b8b2b1d1748b9538824fa43a3c229fe4225a6f', class: "tg-cm__bubble" }, index.h("slot", { key: '42eaec7d0dcea1b24bdd37e1c9063f1eca3b97a4' }), this.streaming && index.h("span", { key: '500c8e09faf030ebee17ea6a05017b2fb1072c3a', class: "tg-cm__cursor" })), this.timestamp && index.h("span", { key: '66fc731892b0c1a15462f6e7868dca87b9e73fca', class: "tg-cm__time" }, this.timestamp)))));
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
TgChatMessage.style = tgChatMessageCss();
|
|
18
|
+
|
|
19
|
+
exports.tg_chat_message = TgChatMessage;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BrBjyHdB.js');
|
|
4
|
+
|
|
5
|
+
const tgChatCss = () => `:host{display:flex;flex-direction:column;height:100%}.tg-chat{display:flex;flex-direction:column;height:100%;font-family:var(--tg-font-family, sans-serif);background:var(--tg-color-surface, #fff);border:1px solid var(--tg-color-neutral-200, #e5e7eb);border-radius:var(--tg-radius-xl, 16px);overflow:hidden}.tg-chat__header{display:flex;align-items:center;gap:var(--tg-spacing-sm, 12px);padding:var(--tg-spacing-md, 16px) var(--tg-spacing-lg, 24px);border-bottom:1px solid var(--tg-color-neutral-100, #f3f4f6);background:var(--tg-color-neutral-50, #f9fafb)}.tg-chat__avatar{width:36px;height:36px;border-radius:50%;background:var(--tg-color-primary, #00853F);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:var(--tg-font-weight-bold, 700);font-size:0.875rem;flex-shrink:0}.tg-chat__name{font-weight:var(--tg-font-weight-semibold, 600);font-size:var(--tg-font-size-sm, 0.8125rem);color:var(--tg-color-text, #111827)}.tg-chat__status{font-size:0.75rem;color:var(--tg-color-success, #059669)}.tg-chat__messages{flex:1;overflow-y:auto;padding:var(--tg-spacing-md, 16px) var(--tg-spacing-lg, 24px);display:flex;flex-direction:column;gap:var(--tg-spacing-md, 16px)}.tg-chat__bubble-row{display:flex;gap:var(--tg-spacing-xs, 8px);align-items:flex-end;animation:tg-chat-bubble-in var(--tg-duration-normal, 200ms) var(--tg-ease-out, ease-out)}.tg-chat__bubble-row--user{flex-direction:row-reverse}@keyframes tg-chat-bubble-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.tg-chat__bubble{max-width:75%;padding:var(--tg-spacing-sm, 12px) var(--tg-spacing-md, 16px);border-radius:var(--tg-radius-lg, 12px);font-size:var(--tg-font-size-sm, 0.8125rem);line-height:1.6;word-break:break-word}.tg-chat__bubble--bot{background:var(--tg-color-neutral-100, #f3f4f6);color:var(--tg-color-text, #111827);border-bottom-left-radius:var(--tg-radius-xs, 4px)}.tg-chat__bubble--user{background:var(--tg-color-primary, #00853F);color:#fff;border-bottom-right-radius:var(--tg-radius-xs, 4px)}.tg-chat__time{font-size:0.65rem;color:var(--tg-color-text-secondary, #6b7280);margin-top:var(--tg-spacing-2xs, 4px)}.tg-chat__typing{display:flex;align-items:center;gap:4px;padding:var(--tg-spacing-sm, 12px) var(--tg-spacing-md, 16px);background:var(--tg-color-neutral-100, #f3f4f6);border-radius:var(--tg-radius-lg, 12px);border-bottom-left-radius:var(--tg-radius-xs, 4px);width:fit-content}.tg-chat__typing-dot{width:6px;height:6px;border-radius:50%;background:var(--tg-color-neutral-400, #9ca3af);animation:tg-chat-typing 1.4s infinite}.tg-chat__typing-dot:nth-child(2){animation-delay:0.2s}.tg-chat__typing-dot:nth-child(3){animation-delay:0.4s}@keyframes tg-chat-typing{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-6px)}}.tg-chat__composer{display:flex;align-items:flex-end;gap:var(--tg-spacing-xs, 8px);padding:var(--tg-spacing-md, 16px) var(--tg-spacing-lg, 24px);border-top:1px solid var(--tg-color-neutral-100, #f3f4f6)}.tg-chat__input{flex:1;resize:none;border:1px solid var(--tg-color-neutral-200, #e5e7eb);border-radius:var(--tg-radius-lg, 12px);padding:var(--tg-spacing-sm, 12px) var(--tg-spacing-md, 16px);font-family:inherit;font-size:var(--tg-font-size-sm, 0.8125rem);line-height:1.5;color:var(--tg-color-text, #111827);background:var(--tg-color-surface, #fff);min-height:44px;max-height:120px;transition:border-color var(--tg-duration-fast, 150ms)}.tg-chat__input::placeholder{color:var(--tg-color-neutral-400, #9ca3af)}.tg-chat__input:focus{outline:none;border-color:var(--tg-color-primary, #00853F);box-shadow:var(--tg-focus-ring)}.tg-chat__send{appearance:none;border:none;background:var(--tg-color-primary, #00853F);color:#fff;cursor:pointer;width:44px;height:44px;border-radius:var(--tg-radius-lg, 12px);display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background var(--tg-duration-fast, 150ms), transform var(--tg-duration-fast, 150ms)}.tg-chat__send:hover{background:var(--tg-color-primary-dark, #006B32)}.tg-chat__send:active{transform:scale(0.95)}.tg-chat__send:focus-visible{outline:none;box-shadow:var(--tg-focus-ring)}.tg-chat__send:disabled{opacity:0.5;cursor:not-allowed}.tg-chat__send svg{width:20px;height:20px}`;
|
|
6
|
+
|
|
7
|
+
const TgChat = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.tgSend = index.createEvent(this, "tgSend");
|
|
11
|
+
this.chatTitle = 'Teranga AI';
|
|
12
|
+
this.botInitial = 'T';
|
|
13
|
+
this.placeholder = 'Écrivez votre message…';
|
|
14
|
+
this.messages = [];
|
|
15
|
+
this.typing = false;
|
|
16
|
+
this.inputValue = '';
|
|
17
|
+
this.handleSend = () => {
|
|
18
|
+
const text = this.inputValue.trim();
|
|
19
|
+
if (!text)
|
|
20
|
+
return;
|
|
21
|
+
this.tgSend.emit(text);
|
|
22
|
+
this.inputValue = '';
|
|
23
|
+
};
|
|
24
|
+
this.handleKeyDown = (e) => {
|
|
25
|
+
if (e.key === 'Enter' && !e.shiftKey) {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
this.handleSend();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
get parsedMessages() {
|
|
32
|
+
if (typeof this.messages === 'string') {
|
|
33
|
+
try {
|
|
34
|
+
return JSON.parse(this.messages);
|
|
35
|
+
}
|
|
36
|
+
catch (_a) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return this.messages;
|
|
41
|
+
}
|
|
42
|
+
componentDidUpdate() {
|
|
43
|
+
this.scrollToBottom();
|
|
44
|
+
}
|
|
45
|
+
scrollToBottom() {
|
|
46
|
+
if (this.messagesRef) {
|
|
47
|
+
this.messagesRef.scrollTop = this.messagesRef.scrollHeight;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
const msgs = this.parsedMessages;
|
|
52
|
+
const sendIcon = `<svg viewBox="0 0 20 20" fill="currentColor"><path d="M3.105 2.289a.75.75 0 00-.826.95l1.414 4.925A1.5 1.5 0 005.135 9.25H10.5a.75.75 0 010 1.5H5.135a1.5 1.5 0 00-1.442 1.086l-1.414 4.926a.75.75 0 00.826.95l14.095-5.638a.75.75 0 000-1.39L3.105 2.289z"/></svg>`;
|
|
53
|
+
return (index.h(index.Host, { key: '3c07f4d1c6c599cf0d35868d3ffe03994fdd5d19' }, index.h("div", { key: '822715425ecbce20177e6e7733dfc4d05d2db5ed', class: "tg-chat" }, index.h("div", { key: '0b0df62a9c73f7ff39beac69be771a339b0272f3', class: "tg-chat__header" }, index.h("div", { key: 'e1b2d914c8676ae17617b559cdeb7d8ecddf6ae4', class: "tg-chat__avatar" }, this.botInitial), index.h("div", { key: '6599d0a5c87221500339590925a91e00ec622ff3' }, index.h("div", { key: 'a814d5d5566324592a9916b147017b6e70bb5045', class: "tg-chat__name" }, this.chatTitle), index.h("div", { key: 'f6c60c941406e25a69df2d4acffc40103488d070', class: "tg-chat__status" }, this.typing ? 'En cours de saisie…' : 'En ligne'))), index.h("div", { key: '97d71ad1679aeab0083265192429fd8602f7cba8', class: "tg-chat__messages", ref: el => (this.messagesRef = el) }, msgs.map(msg => (index.h("div", { class: { 'tg-chat__bubble-row': true, [`tg-chat__bubble-row--${msg.role}`]: true }, key: msg.id }, msg.role === 'bot' && index.h("div", { class: "tg-chat__avatar", style: { width: '28px', height: '28px', fontSize: '0.7rem' } }, this.botInitial), index.h("div", null, index.h("div", { class: { 'tg-chat__bubble': true, [`tg-chat__bubble--${msg.role}`]: true } }, msg.content), msg.time && index.h("div", { class: "tg-chat__time" }, msg.time))))), this.typing && (index.h("div", { key: 'd50dc27b7714a270e748ab275926021dceb0639c', class: "tg-chat__bubble-row" }, index.h("div", { key: '452cd4e105b619acc2ba713b95b829cca12ee4d7', class: "tg-chat__avatar", style: { width: '28px', height: '28px', fontSize: '0.7rem' } }, this.botInitial), index.h("div", { key: '5f07a0fcc43e7a6ffd2b7a0e90f2c2d537a678ec', class: "tg-chat__typing" }, index.h("span", { key: 'a85767e97c3d77ad5fa793aa43e65792cc4517fc', class: "tg-chat__typing-dot" }), index.h("span", { key: '7a57588d308703763e816cac5a3cbf137753dbf6', class: "tg-chat__typing-dot" }), index.h("span", { key: '416b6cca53977055fba5d52bf76f024fe3ce53fc', class: "tg-chat__typing-dot" }))))), index.h("div", { key: '3c0c6dc9e4af5080213568e41c49635933bd9fbb', class: "tg-chat__composer" }, index.h("textarea", { key: 'c0a43e3e12b0e1ed3e6f75181939e42a1839107a', class: "tg-chat__input", placeholder: this.placeholder, rows: 1, value: this.inputValue, onInput: (e) => (this.inputValue = e.target.value), onKeyDown: this.handleKeyDown }), index.h("button", { key: 'f8d15458a911b1731798533b28fb4eff754db991', class: "tg-chat__send", onClick: this.handleSend, disabled: !this.inputValue.trim(), "aria-label": "Envoyer", innerHTML: sendIcon })))));
|
|
54
|
+
}
|
|
55
|
+
get el() { return index.getElement(this); }
|
|
56
|
+
};
|
|
57
|
+
TgChat.style = tgChatCss();
|
|
58
|
+
|
|
59
|
+
exports.tg_chat = TgChat;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BrBjyHdB.js');
|
|
4
|
+
|
|
5
|
+
const tgCheckboxCss = () => `:host{display:inline-flex}.tg-checkbox{display:inline-flex;align-items:flex-start;gap:var(--tg-spacing-2);cursor:pointer;font-family:var(--tg-font-family-sans);user-select:none}.tg-checkbox--disabled{opacity:0.5;cursor:not-allowed}.tg-checkbox__input{position:absolute;opacity:0;width:0;height:0}.tg-checkbox__box{position:relative;width:1.125rem;height:1.125rem;flex-shrink:0;margin-top:0.125rem;border:2px solid var(--tg-color-border-strong);border-radius:var(--tg-radius-sm);background:var(--tg-color-surface-raised);transition:all var(--tg-duration-fast) var(--tg-ease-default);display:flex;align-items:center;justify-content:center}.tg-checkbox__input:checked+.tg-checkbox__box{background:var(--tg-color-primary);border-color:var(--tg-color-primary)}.tg-checkbox__input:checked+.tg-checkbox__box .tg-checkbox__icon{opacity:1;transform:scale(1)}.tg-checkbox__input:focus-visible+.tg-checkbox__box{box-shadow:var(--tg-focus-ring)}.tg-checkbox__input:indeterminate+.tg-checkbox__box{background:var(--tg-color-primary);border-color:var(--tg-color-primary)}.tg-checkbox__icon{width:0.75rem;height:0.75rem;color:white;opacity:0;transform:scale(0.5);transition:all var(--tg-duration-fast) var(--tg-ease-bounce)}.tg-checkbox__content{display:flex;flex-direction:column;gap:var(--tg-spacing-0-5)}.tg-checkbox__label-text{font-size:var(--tg-font-size-sm);color:var(--tg-color-text-primary);line-height:var(--tg-line-height-snug)}.tg-checkbox__description{font-size:var(--tg-font-size-xs);color:var(--tg-color-text-secondary);line-height:var(--tg-line-height-normal)}.tg-checkbox--invalid .tg-checkbox__box{border-color:var(--tg-color-danger)}`;
|
|
6
|
+
|
|
7
|
+
const TgCheckbox = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.tgChange = index.createEvent(this, "tgChange");
|
|
11
|
+
this.checked = false;
|
|
12
|
+
this.disabled = false;
|
|
13
|
+
this.indeterminate = false;
|
|
14
|
+
this.handleChange = () => {
|
|
15
|
+
if (this.disabled)
|
|
16
|
+
return;
|
|
17
|
+
this.checked = !this.checked;
|
|
18
|
+
this.tgChange.emit(this.checked);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return (index.h(index.Host, { key: '177af6bbb10f104f97eff0b0bf6287cded07dbba' }, index.h("label", { key: 'c851c983bce7bb3a26831dcd32ce646371a8e078', class: {
|
|
23
|
+
'tg-checkbox': true,
|
|
24
|
+
'tg-checkbox--disabled': this.disabled,
|
|
25
|
+
'tg-checkbox--invalid': !!this.error,
|
|
26
|
+
} }, index.h("input", Object.assign({ key: 'e11145030298a01c20d4d2e6d42b5622f6f11141', type: "checkbox", class: "tg-checkbox__input", checked: this.checked, disabled: this.disabled, indeterminate: this.indeterminate }, (this.name ? { name: this.name } : {}), (this.value ? { value: this.value } : {}), { onChange: this.handleChange })), index.h("span", { key: '6c67f6e2aa4bdd1f9a76b914ba3ba97c1d1f2e3d', class: "tg-checkbox__box" }, index.h("svg", { key: '8c146d3de219541244f5c7487c1512dca05a357f', class: "tg-checkbox__icon", viewBox: "0 0 12 12", fill: "none" }, this.indeterminate ? (index.h("line", { x1: "2", y1: "6", x2: "10", y2: "6", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" })) : (index.h("path", { d: "M2 6l3 3 5-6", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })))), (this.label || this.description) && (index.h("span", { key: 'c27ad8bc80ce1ba645ca8e8fa41d7967b3896606', class: "tg-checkbox__content" }, this.label && index.h("span", { key: '46e3d0a598faac5495aa267c70ab2e8b77ab2767', class: "tg-checkbox__label-text" }, this.label), this.description && index.h("span", { key: '060b9bc82bbca637012140d0d5eebaa58594c2b7', class: "tg-checkbox__description" }, this.description))))));
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
TgCheckbox.style = tgCheckboxCss();
|
|
30
|
+
|
|
31
|
+
exports.tg_checkbox = TgCheckbox;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BrBjyHdB.js');
|
|
4
|
+
|
|
5
|
+
const tgComboboxCss = () => `:host{display:block}.tg-combobox{position:relative;font-family:var(--tg-font-family-sans)}.tg-combobox__label{display:block;font-size:var(--tg-font-size-sm);font-weight:var(--tg-font-weight-medium);color:var(--tg-color-text-primary);margin-bottom:var(--tg-spacing-1-5)}.tg-combobox__input-wrap{display:flex;align-items:center;border:1px solid var(--tg-color-border-strong);border-radius:var(--tg-radius-lg);background:var(--tg-color-surface-raised);transition:border-color var(--tg-duration-fast) var(--tg-ease-default), box-shadow var(--tg-duration-fast) var(--tg-ease-default)}.tg-combobox__input-wrap:focus-within{border-color:var(--tg-color-border-focus);box-shadow:var(--tg-focus-ring)}.tg-combobox__input-wrap--invalid{border-color:var(--tg-color-danger)}.tg-combobox__input-wrap--disabled{opacity:0.5;cursor:not-allowed}.tg-combobox__input{flex:1;border:none;outline:none;background:transparent;color:var(--tg-color-text-primary);font-family:inherit;padding:0 var(--tg-spacing-3);width:100%}.tg-combobox__input::placeholder{color:var(--tg-color-text-disabled)}.tg-combobox--sm .tg-combobox__input{height:2rem;font-size:var(--tg-font-size-xs)}.tg-combobox--md .tg-combobox__input{height:2.5rem;font-size:var(--tg-font-size-sm)}.tg-combobox--lg .tg-combobox__input{height:3rem;font-size:var(--tg-font-size-md)}.tg-combobox__chevron{display:flex;align-items:center;padding-right:var(--tg-spacing-2);color:var(--tg-color-text-secondary);transition:transform var(--tg-duration-fast)}.tg-combobox__chevron--open{transform:rotate(180deg)}.tg-combobox__dropdown{position:absolute;top:100%;left:0;right:0;margin-top:var(--tg-spacing-1);background:var(--tg-color-surface-raised);border:1px solid var(--tg-color-border);border-radius:var(--tg-radius-lg);box-shadow:var(--tg-shadow-lg);z-index:1000;max-height:14rem;overflow-y:auto;padding:var(--tg-spacing-1) 0;list-style:none;animation:tg-combo-enter var(--tg-duration-fast) var(--tg-ease-out)}@keyframes tg-combo-enter{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.tg-combobox__option{padding:var(--tg-spacing-2) var(--tg-spacing-3);font-size:var(--tg-font-size-sm);cursor:pointer;color:var(--tg-color-text-primary);transition:background var(--tg-duration-fast)}.tg-combobox__option:hover,.tg-combobox__option--focused{background:var(--tg-color-primary-subtle)}.tg-combobox__option--selected{color:var(--tg-color-primary);font-weight:var(--tg-font-weight-medium)}.tg-combobox__option--disabled{opacity:0.4;cursor:not-allowed}.tg-combobox__error{margin:var(--tg-spacing-1) 0 0;font-size:var(--tg-font-size-xs);color:var(--tg-color-danger)}.tg-combobox__helper{margin:var(--tg-spacing-1) 0 0;font-size:var(--tg-font-size-xs);color:var(--tg-color-text-secondary)}`;
|
|
6
|
+
|
|
7
|
+
const TgCombobox = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.tgChange = index.createEvent(this, "tgChange");
|
|
11
|
+
this.placeholder = 'Rechercher…';
|
|
12
|
+
this.options = [];
|
|
13
|
+
this.disabled = false;
|
|
14
|
+
this.invalid = false;
|
|
15
|
+
this.size = 'md';
|
|
16
|
+
this.query = '';
|
|
17
|
+
this.open = false;
|
|
18
|
+
this.focusedIndex = -1;
|
|
19
|
+
this.handleInput = (e) => { this.query = e.target.value; this.open = true; };
|
|
20
|
+
this.handleFocus = () => { this.open = true; };
|
|
21
|
+
this.handleKeyDown = (e) => {
|
|
22
|
+
const items = this.filtered;
|
|
23
|
+
if (e.key === 'ArrowDown') {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
this.focusedIndex = Math.min(this.focusedIndex + 1, items.length - 1);
|
|
26
|
+
}
|
|
27
|
+
else if (e.key === 'ArrowUp') {
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
this.focusedIndex = Math.max(this.focusedIndex - 1, 0);
|
|
30
|
+
}
|
|
31
|
+
else if (e.key === 'Enter' && this.focusedIndex >= 0 && items[this.focusedIndex]) {
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
this.select(items[this.focusedIndex]);
|
|
34
|
+
}
|
|
35
|
+
else if (e.key === 'Escape') {
|
|
36
|
+
this.open = false;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
get parsed() {
|
|
41
|
+
if (typeof this.options === 'string') {
|
|
42
|
+
try {
|
|
43
|
+
return JSON.parse(this.options);
|
|
44
|
+
}
|
|
45
|
+
catch (_a) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return this.options;
|
|
50
|
+
}
|
|
51
|
+
get filtered() {
|
|
52
|
+
const q = this.query.toLowerCase();
|
|
53
|
+
return q ? this.parsed.filter(o => o.label.toLowerCase().includes(q)) : this.parsed;
|
|
54
|
+
}
|
|
55
|
+
get selectedLabel() {
|
|
56
|
+
const f = this.parsed.find(o => o.value === this.value);
|
|
57
|
+
return f ? f.label : '';
|
|
58
|
+
}
|
|
59
|
+
handleDocClick() { this.open = false; }
|
|
60
|
+
select(opt) { this.tgChange.emit(opt.value); this.query = opt.label; this.open = false; }
|
|
61
|
+
render() {
|
|
62
|
+
const items = this.filtered;
|
|
63
|
+
return (index.h(index.Host, { key: '565f072e24300dd80eec6206a9ee2922b7504589' }, index.h("div", { key: 'd43ede25747b229bfe8c1c25ae62ca24cedadf5e', class: `tg-combobox tg-combobox--${this.size}`, onClick: (e) => e.stopPropagation() }, this.label && index.h("label", { key: '04baf228f536e3f93f8b15a5d8a8ec5055d349b7', class: "tg-combobox__label" }, this.label), index.h("div", { key: '16969267f3ef67da727c5c3b8463146398f910ca', class: { 'tg-combobox__input-wrap': true, 'tg-combobox__input-wrap--invalid': this.invalid, 'tg-combobox__input-wrap--disabled': this.disabled } }, index.h("input", { key: 'd43dbe66854e5993ecf3de07a37c2b8dca7bb4ac', class: "tg-combobox__input", type: "text", value: this.open ? this.query : this.selectedLabel, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput, onFocus: this.handleFocus, onKeyDown: this.handleKeyDown, role: "combobox", "aria-expanded": String(this.open), "aria-autocomplete": "list" }), index.h("span", { key: '1848157598a1534516a72c4df74266771e666028', class: { 'tg-combobox__chevron': true, 'tg-combobox__chevron--open': this.open } }, index.h("svg", { key: '800f1089b123c22cfe2dfdc513fe6632b51b4a5e', viewBox: "0 0 20 20", fill: "currentColor", width: "16", height: "16" }, index.h("path", { key: '8069e0b3d7f69861b4b9dd0723e6531eaff7e2fd', "fill-rule": "evenodd", d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z" })))), this.open && items.length > 0 && (index.h("ul", { key: 'c2552593271adbc015fc5b4457cf4225183b571b', class: "tg-combobox__dropdown", role: "listbox" }, items.map((opt, i) => (index.h("li", { class: { 'tg-combobox__option': true, 'tg-combobox__option--focused': i === this.focusedIndex, 'tg-combobox__option--selected': opt.value === this.value, 'tg-combobox__option--disabled': opt.disabled === true }, role: "option", "aria-selected": String(opt.value === this.value), onClick: () => !opt.disabled && this.select(opt) }, opt.label))))), this.errorText && index.h("p", { key: '6c3488a6db12f9c4c4f8f4a978526eeb728fd247', class: "tg-combobox__error" }, this.errorText), !this.errorText && this.helperText && index.h("p", { key: 'b1c7475ea8220f626c18b2ebb5d785a54f76b6ca', class: "tg-combobox__helper" }, this.helperText))));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
TgCombobox.style = tgComboboxCss();
|
|
67
|
+
|
|
68
|
+
exports.tg_combobox = TgCombobox;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BrBjyHdB.js');
|
|
4
|
+
|
|
5
|
+
const tgCommandPaletteCss = () => `:host{display:contents}.tg-cp__overlay{position:fixed;inset:0;background:rgba(0,0,0,0.4);z-index:9999;display:flex;align-items:flex-start;justify-content:center;padding-top:20vh;backdrop-filter:blur(4px);animation:tg-cp-fade var(--tg-duration-fast)}@keyframes tg-cp-fade{from{opacity:0}to{opacity:1}}.tg-cp{width:100%;max-width:32rem;background:var(--tg-color-surface-raised);border-radius:var(--tg-radius-xl);box-shadow:var(--tg-shadow-xl);overflow:hidden;font-family:var(--tg-font-family-sans);animation:tg-cp-slide var(--tg-duration-fast) var(--tg-ease-out)}@keyframes tg-cp-slide{from{opacity:0;transform:translateY(-12px) scale(0.98)}to{opacity:1;transform:translateY(0) scale(1)}}.tg-cp__input-wrap{display:flex;align-items:center;gap:var(--tg-spacing-2);padding:var(--tg-spacing-3) var(--tg-spacing-4);border-bottom:1px solid var(--tg-color-border)}.tg-cp__search-icon{color:var(--tg-color-text-secondary);flex-shrink:0}.tg-cp__input{flex:1;border:none;outline:none;background:transparent;font-size:var(--tg-font-size-md);color:var(--tg-color-text-primary);font-family:inherit}.tg-cp__input::placeholder{color:var(--tg-color-text-disabled)}.tg-cp__list{list-style:none;padding:var(--tg-spacing-1) 0;margin:0;max-height:20rem;overflow-y:auto}.tg-cp__item{display:flex;align-items:center;gap:var(--tg-spacing-2);padding:var(--tg-spacing-2) var(--tg-spacing-4);cursor:pointer;transition:background var(--tg-duration-fast)}.tg-cp__item:hover,.tg-cp__item--focused{background:var(--tg-color-primary-subtle)}.tg-cp__item-icon{font-size:1rem;color:var(--tg-color-text-secondary);flex-shrink:0}.tg-cp__item-label{flex:1;font-size:var(--tg-font-size-sm);color:var(--tg-color-text-primary)}.tg-cp__shortcut{font-family:var(--tg-font-family-mono);font-size:var(--tg-font-size-xs);color:var(--tg-color-text-secondary);background:var(--tg-color-surface-sunken);padding:2px var(--tg-spacing-1-5);border-radius:var(--tg-radius-sm);border:1px solid var(--tg-color-border)}.tg-cp__empty{padding:var(--tg-spacing-4);text-align:center;color:var(--tg-color-text-disabled);font-size:var(--tg-font-size-sm)}`;
|
|
6
|
+
|
|
7
|
+
const TgCommandPalette = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.tgSelect = index.createEvent(this, "tgSelect");
|
|
11
|
+
this.commands = [];
|
|
12
|
+
this.placeholder = 'Tapez une commande\u2026';
|
|
13
|
+
this.open = false;
|
|
14
|
+
this.query = '';
|
|
15
|
+
this.focusedIndex = 0;
|
|
16
|
+
}
|
|
17
|
+
get parsed() {
|
|
18
|
+
if (typeof this.commands === 'string') {
|
|
19
|
+
try {
|
|
20
|
+
return JSON.parse(this.commands);
|
|
21
|
+
}
|
|
22
|
+
catch (_a) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return this.commands;
|
|
27
|
+
}
|
|
28
|
+
get filtered() { const q = this.query.toLowerCase(); return q ? this.parsed.filter(c => c.label.toLowerCase().includes(q)) : this.parsed; }
|
|
29
|
+
onKeyDown(e) {
|
|
30
|
+
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
this.open = !this.open;
|
|
33
|
+
this.query = '';
|
|
34
|
+
this.focusedIndex = 0;
|
|
35
|
+
}
|
|
36
|
+
if (!this.open)
|
|
37
|
+
return;
|
|
38
|
+
if (e.key === 'Escape') {
|
|
39
|
+
this.open = false;
|
|
40
|
+
}
|
|
41
|
+
else if (e.key === 'ArrowDown') {
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
this.focusedIndex = Math.min(this.focusedIndex + 1, this.filtered.length - 1);
|
|
44
|
+
}
|
|
45
|
+
else if (e.key === 'ArrowUp') {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
this.focusedIndex = Math.max(this.focusedIndex - 1, 0);
|
|
48
|
+
}
|
|
49
|
+
else if (e.key === 'Enter') {
|
|
50
|
+
const item = this.filtered[this.focusedIndex];
|
|
51
|
+
if (item) {
|
|
52
|
+
this.tgSelect.emit(item.id);
|
|
53
|
+
this.open = false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
if (!this.open)
|
|
59
|
+
return index.h(index.Host, null);
|
|
60
|
+
const items = this.filtered;
|
|
61
|
+
return (index.h(index.Host, null, index.h("div", { class: "tg-cp__overlay", onClick: () => { this.open = false; } }, index.h("div", { class: "tg-cp", onClick: (e) => e.stopPropagation() }, index.h("div", { class: "tg-cp__input-wrap" }, index.h("svg", { class: "tg-cp__search-icon", viewBox: "0 0 20 20", fill: "currentColor", width: "18", height: "18" }, index.h("path", { "fill-rule": "evenodd", d: "M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" })), index.h("input", { class: "tg-cp__input", type: "text", placeholder: this.placeholder, value: this.query, onInput: (e) => { this.query = e.target.value; this.focusedIndex = 0; }, autofocus: true })), index.h("ul", { class: "tg-cp__list" }, items.map((cmd, i) => (index.h("li", { class: { 'tg-cp__item': true, 'tg-cp__item--focused': i === this.focusedIndex }, onClick: () => { this.tgSelect.emit(cmd.id); this.open = false; } }, cmd.icon && index.h("span", { class: "tg-cp__item-icon" }, cmd.icon), index.h("span", { class: "tg-cp__item-label" }, cmd.label), cmd.shortcut && index.h("kbd", { class: "tg-cp__shortcut" }, cmd.shortcut)))), items.length === 0 && index.h("li", { class: "tg-cp__empty" }, "Aucun r\\u00e9sultat"))))));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
TgCommandPalette.style = tgCommandPaletteCss();
|
|
65
|
+
|
|
66
|
+
exports.tg_command_palette = TgCommandPalette;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BrBjyHdB.js');
|
|
4
|
+
|
|
5
|
+
const tgConfidenceBadgeCss = () => `:host{display:inline-flex}.tg-conf{display:inline-flex;align-items:center;gap:var(--tg-spacing-2);padding:var(--tg-spacing-1) var(--tg-spacing-2-5);border-radius:var(--tg-radius-full);font-family:var(--tg-font-family-sans)}.tg-conf--high{background:var(--tg-color-success-subtle);color:var(--tg-color-success)}.tg-conf--medium{background:var(--tg-color-warning-subtle);color:var(--tg-color-warning)}.tg-conf--low{background:var(--tg-color-danger-subtle);color:var(--tg-color-danger)}.tg-conf__pct{font-size:var(--tg-font-size-xs);font-weight:var(--tg-font-weight-bold);font-family:var(--tg-font-family-mono)}.tg-conf__label{font-size:var(--tg-font-size-xs);font-weight:var(--tg-font-weight-medium)}.tg-conf__bar{width:3rem;height:4px;background:rgba(0,0,0,0.1);border-radius:var(--tg-radius-full);overflow:hidden}.tg-conf__fill{height:100%;border-radius:var(--tg-radius-full);transition:width var(--tg-duration-normal)}.tg-conf--high .tg-conf__fill{background:var(--tg-color-success)}.tg-conf--medium .tg-conf__fill{background:var(--tg-color-warning)}.tg-conf--low .tg-conf__fill{background:var(--tg-color-danger)}`;
|
|
6
|
+
|
|
7
|
+
const TgConfidenceBadge = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.score = 0;
|
|
11
|
+
this.showBar = true;
|
|
12
|
+
}
|
|
13
|
+
get level() {
|
|
14
|
+
if (this.score >= 0.8)
|
|
15
|
+
return 'high';
|
|
16
|
+
if (this.score >= 0.5)
|
|
17
|
+
return 'medium';
|
|
18
|
+
return 'low';
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
const pct = Math.round(this.score * 100);
|
|
22
|
+
return (index.h(index.Host, { key: 'aecf1b4b43cf40be94ae02979e80ddd296b489e3' }, index.h("div", { key: '5593278db1c44b8b42bdacf28648a313c045ebc8', class: 'tg-conf tg-conf--' + this.level }, index.h("span", { key: '01334ff751a99cdb839e0551ef97e121603b3fa6', class: "tg-conf__pct" }, pct, "%"), this.label && index.h("span", { key: '93b067ed5c3a8a88a62a599cc7a8e71c461f2b0a', class: "tg-conf__label" }, this.label), this.showBar && index.h("div", { key: '9c3cbf7f8afed63cd3fae1643a0fdf20e78025ea', class: "tg-conf__bar" }, index.h("div", { key: 'e582e1f3e220ba4e4ad0590b2efe886ab3451bd0', class: "tg-conf__fill", style: { width: pct + '%' } })))));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
TgConfidenceBadge.style = tgConfidenceBadgeCss();
|
|
26
|
+
|
|
27
|
+
exports.tg_confidence_badge = TgConfidenceBadge;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BrBjyHdB.js');
|
|
4
|
+
|
|
5
|
+
const tgConfirmDialogCss = () => `:host{display:contents}.tg-cd__overlay{position:fixed;inset:0;background:rgba(0,0,0,0.5);z-index:10000;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(4px);animation:tg-cd-fade 0.15s}@keyframes tg-cd-fade{from{opacity:0}to{opacity:1}}.tg-cd{background:var(--tg-color-surface-raised);border-radius:var(--tg-radius-xl);padding:var(--tg-spacing-6);max-width:24rem;width:90%;font-family:var(--tg-font-family-sans);text-align:center;animation:tg-cd-scale 0.15s var(--tg-ease-out)}@keyframes tg-cd-scale{from{opacity:0;transform:scale(0.95)}to{opacity:1;transform:scale(1)}}.tg-cd__icon{font-size:2.5rem;margin-bottom:var(--tg-spacing-3)}.tg-cd--danger .tg-cd__icon{color:var(--tg-color-danger)}.tg-cd--warning .tg-cd__icon{color:var(--tg-color-warning)}.tg-cd__title{margin:0 0 var(--tg-spacing-2);font-size:var(--tg-font-size-lg);font-weight:var(--tg-font-weight-semibold);color:var(--tg-color-text-primary)}.tg-cd__msg{margin:0 0 var(--tg-spacing-5);font-size:var(--tg-font-size-sm);color:var(--tg-color-text-secondary);line-height:var(--tg-line-height-relaxed)}.tg-cd__actions{display:flex;gap:var(--tg-spacing-2);justify-content:center}.tg-cd__btn{padding:var(--tg-spacing-2) var(--tg-spacing-5);border-radius:var(--tg-radius-lg);font-size:var(--tg-font-size-sm);font-weight:var(--tg-font-weight-medium);cursor:pointer;transition:all var(--tg-duration-fast);border:1px solid transparent}.tg-cd__btn--cancel{background:none;color:var(--tg-color-text-secondary);border-color:var(--tg-color-border)}.tg-cd__btn--cancel:hover{background:var(--tg-color-surface-sunken)}.tg-cd__btn--confirm{color:white}.tg-cd__btn--default{background:var(--tg-color-primary)}.tg-cd__btn--danger{background:var(--tg-color-danger)}.tg-cd__btn--warning{background:var(--tg-color-warning)}.tg-cd__btn--confirm:hover{filter:brightness(1.1)}`;
|
|
6
|
+
|
|
7
|
+
const TgConfirmDialog = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.tgConfirm = index.createEvent(this, "tgConfirm");
|
|
11
|
+
this.tgCancel = index.createEvent(this, "tgCancel");
|
|
12
|
+
this.open = false;
|
|
13
|
+
this.heading = 'Confirmer';
|
|
14
|
+
this.message = '';
|
|
15
|
+
this.confirmLabel = 'Confirmer';
|
|
16
|
+
this.cancelLabel = 'Annuler';
|
|
17
|
+
this.variant = 'default';
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
if (!this.open)
|
|
21
|
+
return index.h(index.Host, null);
|
|
22
|
+
return (index.h(index.Host, null, index.h("div", { class: "tg-cd__overlay", onClick: () => this.tgCancel.emit() }, index.h("div", { class: 'tg-cd tg-cd--' + this.variant, role: "alertdialog", onClick: (e) => e.stopPropagation() }, this.icon && index.h("div", { class: "tg-cd__icon" }, this.icon), index.h("h3", { class: "tg-cd__title" }, this.heading), index.h("p", { class: "tg-cd__msg" }, this.message), index.h("div", { class: "tg-cd__actions" }, index.h("button", { class: "tg-cd__btn tg-cd__btn--cancel", type: "button", onClick: () => this.tgCancel.emit() }, this.cancelLabel), index.h("button", { class: 'tg-cd__btn tg-cd__btn--confirm tg-cd__btn--' + this.variant, type: "button", onClick: () => this.tgConfirm.emit() }, this.confirmLabel))))));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
TgConfirmDialog.style = tgConfirmDialogCss();
|
|
26
|
+
|
|
27
|
+
exports.tg_confirm_dialog = TgConfirmDialog;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BrBjyHdB.js');
|
|
4
|
+
|
|
5
|
+
const tgContextMenuCss = () => `:host{display:contents}.tg-ctx{position:fixed;z-index:10000;min-width:12rem;background:var(--tg-color-surface-raised);border:1px solid var(--tg-color-border);border-radius:var(--tg-radius-lg);box-shadow:var(--tg-shadow-lg);padding:var(--tg-spacing-1) 0;font-family:var(--tg-font-family-sans);animation:tg-ctx-in var(--tg-duration-fast) var(--tg-ease-out)}@keyframes tg-ctx-in{from{opacity:0;transform:scale(0.95)}to{opacity:1;transform:scale(1)}}.tg-ctx__item{display:flex;align-items:center;gap:var(--tg-spacing-2);width:100%;padding:var(--tg-spacing-2) var(--tg-spacing-3);background:none;border:none;cursor:pointer;font-size:var(--tg-font-size-sm);color:var(--tg-color-text-primary);transition:background var(--tg-duration-fast);text-align:left}.tg-ctx__item:hover:not(:disabled){background:var(--tg-color-primary-subtle)}.tg-ctx__item--danger{color:var(--tg-color-danger)}.tg-ctx__item--danger:hover:not(:disabled){background:var(--tg-color-danger-subtle)}.tg-ctx__item--disabled{opacity:0.4;cursor:not-allowed}.tg-ctx__icon{font-size:1rem;flex-shrink:0}.tg-ctx__label{flex:1}.tg-ctx__shortcut{margin-left:auto;font-family:var(--tg-font-family-mono);font-size:var(--tg-font-size-xs);color:var(--tg-color-text-disabled)}.tg-ctx__divider{height:1px;background:var(--tg-color-border);margin:var(--tg-spacing-1) 0}`;
|
|
6
|
+
|
|
7
|
+
const TgContextMenu = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.tgAction = index.createEvent(this, "tgAction");
|
|
11
|
+
this.items = [];
|
|
12
|
+
this.visible = false;
|
|
13
|
+
this.x = 0;
|
|
14
|
+
this.y = 0;
|
|
15
|
+
}
|
|
16
|
+
get parsed() {
|
|
17
|
+
if (typeof this.items === 'string') {
|
|
18
|
+
try {
|
|
19
|
+
return JSON.parse(this.items);
|
|
20
|
+
}
|
|
21
|
+
catch (_a) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return this.items;
|
|
26
|
+
}
|
|
27
|
+
onContext(e) { e.preventDefault(); this.x = e.clientX; this.y = e.clientY; this.visible = true; }
|
|
28
|
+
onDocClick() { this.visible = false; }
|
|
29
|
+
render() {
|
|
30
|
+
return (index.h(index.Host, { key: '0e56291c2114cb180a64855f9fc8bd5e10b69b9d' }, index.h("slot", { key: '8711f7eda110514f39136bc5995e42a909e4a6b5' }), this.visible && (index.h("div", { key: '67d9386b7fc248c30a6387ae8677145f4b2d98dd', class: "tg-ctx", style: { left: this.x + 'px', top: this.y + 'px' }, onClick: (e) => e.stopPropagation() }, this.parsed.map(item => item.divider ? index.h("div", { class: "tg-ctx__divider" }) : (index.h("button", Object.assign({ class: { 'tg-ctx__item': true, 'tg-ctx__item--danger': item.danger === true, 'tg-ctx__item--disabled': item.disabled === true }, type: "button" }, (item.disabled ? { disabled: true } : {}), { onClick: () => { this.tgAction.emit(item.id); this.visible = false; } }), item.icon && index.h("span", { class: "tg-ctx__icon" }, item.icon), index.h("span", { class: "tg-ctx__label" }, item.label), item.shortcut && index.h("kbd", { class: "tg-ctx__shortcut" }, item.shortcut))))))));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
TgContextMenu.style = tgContextMenuCss();
|
|
34
|
+
|
|
35
|
+
exports.tg_context_menu = TgContextMenu;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BrBjyHdB.js');
|
|
4
|
+
|
|
5
|
+
const tgDataTableCss = () => `:host{display:block}.tg-dt{font-family:var(--tg-font-family-sans);border:1px solid var(--tg-color-border);border-radius:var(--tg-radius-xl);overflow:hidden;background:var(--tg-color-surface-raised);position:relative}.tg-dt__loader{position:absolute;top:0;left:0;right:0;height:3px;overflow:hidden;z-index:10}.tg-dt__loader-bar{height:100%;width:40%;background:var(--tg-color-primary);border-radius:var(--tg-radius-full);animation:tg-dt-load 1.2s ease-in-out infinite}@keyframes tg-dt-load{0%{transform:translateX(-100%)}100%{transform:translateX(350%)}}.tg-dt__scroll{overflow-x:auto}.tg-dt__table{width:100%;border-collapse:collapse}.tg-dt__th{padding:var(--tg-spacing-3) var(--tg-spacing-4);text-align:left;font-size:var(--tg-font-size-xs);font-weight:var(--tg-font-weight-semibold);color:var(--tg-color-text-secondary);text-transform:uppercase;letter-spacing:var(--tg-tracking-wide);background:var(--tg-color-surface-sunken);border-bottom:1px solid var(--tg-color-border);white-space:nowrap}.tg-dt__th--sortable{cursor:pointer;user-select:none}.tg-dt__th--sortable:hover{color:var(--tg-color-primary)}.tg-dt__th-content{display:inline-flex;align-items:center;gap:var(--tg-spacing-1)}.tg-dt__sort-icon{font-size:0.75rem}.tg-dt__th--check,.tg-dt__td--check{width:2.5rem;text-align:center}.tg-dt__td{padding:var(--tg-spacing-3) var(--tg-spacing-4);font-size:var(--tg-font-size-sm);color:var(--tg-color-text-primary);border-bottom:1px solid var(--tg-color-border)}.tg-dt--compact .tg-dt__th,.tg-dt--compact .tg-dt__td{padding:var(--tg-spacing-2) var(--tg-spacing-3)}.tg-dt__row--striped{background:var(--tg-color-surface-sunken)}.tg-dt__row--selected{background:var(--tg-color-primary-subtle)}.tg-dt__row:hover{background:var(--tg-color-primary-subtle)}.tg-dt__empty{text-align:center;padding:var(--tg-spacing-8);color:var(--tg-color-text-disabled);font-style:italic}`;
|
|
6
|
+
|
|
7
|
+
const TgDataTable = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.tgSort = index.createEvent(this, "tgSort");
|
|
11
|
+
this.tgRowSelect = index.createEvent(this, "tgRowSelect");
|
|
12
|
+
this.columns = [];
|
|
13
|
+
this.rows = [];
|
|
14
|
+
this.selectable = false;
|
|
15
|
+
this.striped = true;
|
|
16
|
+
this.compact = false;
|
|
17
|
+
this.loading = false;
|
|
18
|
+
this.emptyText = 'Aucune donn\u00e9e';
|
|
19
|
+
this.sortKey = '';
|
|
20
|
+
this.sortDir = 'asc';
|
|
21
|
+
this.selectedRows = new Set();
|
|
22
|
+
this.toggleAll = () => {
|
|
23
|
+
if (this.selectedRows.size === this.data.length)
|
|
24
|
+
this.selectedRows = new Set();
|
|
25
|
+
else
|
|
26
|
+
this.selectedRows = new Set(this.data.map((_, i) => i));
|
|
27
|
+
this.tgRowSelect.emit(Array.from(this.selectedRows));
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
get cols() {
|
|
31
|
+
if (typeof this.columns === 'string') {
|
|
32
|
+
try {
|
|
33
|
+
return JSON.parse(this.columns);
|
|
34
|
+
}
|
|
35
|
+
catch (_a) {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return this.columns;
|
|
40
|
+
}
|
|
41
|
+
get data() {
|
|
42
|
+
if (typeof this.rows === 'string') {
|
|
43
|
+
try {
|
|
44
|
+
return JSON.parse(this.rows);
|
|
45
|
+
}
|
|
46
|
+
catch (_a) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return this.rows;
|
|
51
|
+
}
|
|
52
|
+
get sortedData() {
|
|
53
|
+
if (!this.sortKey)
|
|
54
|
+
return this.data;
|
|
55
|
+
return [...this.data].sort((a, b) => {
|
|
56
|
+
const av = a[this.sortKey];
|
|
57
|
+
const bv = b[this.sortKey];
|
|
58
|
+
const cmp = typeof av === 'number' ? av - bv : String(av).localeCompare(String(bv));
|
|
59
|
+
return this.sortDir === 'asc' ? cmp : -cmp;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
handleSort(col) {
|
|
63
|
+
if (!col.sortable)
|
|
64
|
+
return;
|
|
65
|
+
if (this.sortKey === col.key)
|
|
66
|
+
this.sortDir = this.sortDir === 'asc' ? 'desc' : 'asc';
|
|
67
|
+
else {
|
|
68
|
+
this.sortKey = col.key;
|
|
69
|
+
this.sortDir = 'asc';
|
|
70
|
+
}
|
|
71
|
+
this.tgSort.emit({ key: this.sortKey, dir: this.sortDir });
|
|
72
|
+
}
|
|
73
|
+
toggleRow(idx) {
|
|
74
|
+
const s = new Set(this.selectedRows);
|
|
75
|
+
if (s.has(idx))
|
|
76
|
+
s.delete(idx);
|
|
77
|
+
else
|
|
78
|
+
s.add(idx);
|
|
79
|
+
this.selectedRows = s;
|
|
80
|
+
this.tgRowSelect.emit(Array.from(s));
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
const cols = this.cols;
|
|
84
|
+
const rows = this.sortedData;
|
|
85
|
+
return (index.h(index.Host, { key: '41340ae2532212cceb01cfca73359f91b99e76fa' }, index.h("div", { key: '7376c54b66c6037b227ce65c4f2e3e7b0bcda594', class: { 'tg-dt': true, 'tg-dt--compact': this.compact } }, this.loading && index.h("div", { key: '756436d24ca9bf79ba1fd6dfd720d75f1f0d5747', class: "tg-dt__loader" }, index.h("div", { key: '62c76d0b712a49653df7b60688293096ac8849b6', class: "tg-dt__loader-bar" })), index.h("div", { key: '8766278921bf7329af9d093cf6aaf3097bec07e7', class: "tg-dt__scroll" }, index.h("table", { key: '6e55bcbb7f2c3abc0ae38345afad6198c07a3ccb', class: "tg-dt__table" }, index.h("thead", { key: 'af7ee25ceec1bf9c3f47c17ba7c3dead48311def' }, index.h("tr", { key: '66147dd8631c01b5471a830cdd8538f3e660f058' }, this.selectable && index.h("th", { key: '35e58a867f102a8253cacae32a0c4151cfd7c2ad', class: "tg-dt__th tg-dt__th--check" }, index.h("input", { key: '1448d9ae15d0dea2abb47ca8c03348d54529705c', type: "checkbox", checked: this.selectedRows.size === rows.length && rows.length > 0, onChange: this.toggleAll })), cols.map(col => (index.h("th", { class: { 'tg-dt__th': true, 'tg-dt__th--sortable': col.sortable === true }, style: col.width ? { width: col.width } : {}, onClick: () => this.handleSort(col) }, index.h("span", { class: "tg-dt__th-content" }, col.label, col.sortable && index.h("span", { class: "tg-dt__sort-icon" }, this.sortKey === col.key ? (this.sortDir === 'asc' ? '\u2191' : '\u2193') : '\u2195'))))))), index.h("tbody", { key: '3ddcac1c70513b9513eedf3d22296f5781f21faa' }, rows.length === 0 && index.h("tr", { key: '136db0f95b7731b86739743f1d6f5ec36ddf05a0' }, index.h("td", { key: 'f55185e172a22eafef9906e3b7d592ad281e1cd6', class: "tg-dt__empty", colSpan: cols.length + (this.selectable ? 1 : 0) }, this.emptyText)), rows.map((row, i) => (index.h("tr", { class: { 'tg-dt__row': true, 'tg-dt__row--striped': this.striped && i % 2 === 1, 'tg-dt__row--selected': this.selectedRows.has(i) } }, this.selectable && index.h("td", { class: "tg-dt__td tg-dt__td--check" }, index.h("input", { type: "checkbox", checked: this.selectedRows.has(i), onChange: () => this.toggleRow(i) })), cols.map(col => index.h("td", { class: "tg-dt__td" }, row[col.key])))))))))));
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
TgDataTable.style = tgDataTableCss();
|
|
89
|
+
|
|
90
|
+
exports.tg_data_table = TgDataTable;
|