@hashicorp/design-system-components 4.23.1 → 4.24.0-rc-20250923215537
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/declarations/components/hds/advanced-table/index.d.ts +13 -3
- package/declarations/components/hds/advanced-table/models/column.d.ts +9 -2
- package/declarations/components/hds/advanced-table/models/row.d.ts +5 -1
- package/declarations/components/hds/advanced-table/models/table.d.ts +13 -2
- package/declarations/components/hds/advanced-table/td.d.ts +1 -1
- package/declarations/components/hds/advanced-table/th-context-menu.d.ts +16 -7
- package/declarations/components/hds/advanced-table/th-reorder-drop-target.d.ts +32 -0
- package/declarations/components/hds/advanced-table/th-reorder-handle.d.ts +24 -0
- package/declarations/components/hds/advanced-table/th-resize-handle.d.ts +2 -1
- package/declarations/components/hds/advanced-table/th-sort.d.ts +11 -3
- package/declarations/components/hds/advanced-table/th.d.ts +11 -4
- package/declarations/components/hds/advanced-table/tr.d.ts +7 -1
- package/declarations/components/hds/advanced-table/types.d.ts +15 -0
- package/declarations/components/hds/advanced-table/utils.d.ts +5 -0
- package/declarations/components/hds/dropdown/toggle/icon.d.ts +1 -1
- package/declarations/components/hds/flyout/index.d.ts +4 -1
- package/declarations/components/hds/form/index.d.ts +1 -1
- package/declarations/components/hds/form/key-value-inputs/index.d.ts +4 -4
- package/declarations/components/hds/form/radio-card/index.d.ts +2 -2
- package/declarations/components/hds/modal/index.d.ts +4 -2
- package/declarations/components/hds/popover-primitive/index.d.ts +3 -0
- package/declarations/components/hds/separator/index.d.ts +1 -1
- package/declarations/components/hds/stepper/list/step.d.ts +1 -1
- package/declarations/components/hds/stepper/task/indicator.d.ts +1 -1
- package/declarations/components/hds/table/index.d.ts +5 -5
- package/declarations/components/hds/table/td.d.ts +1 -1
- package/declarations/components/hds/table/th-sort.d.ts +1 -1
- package/declarations/components/hds/table/th.d.ts +1 -1
- package/declarations/template-registry.d.ts +6 -0
- package/dist/_app_/components/hds/advanced-table/th-reorder-drop-target.js +1 -0
- package/dist/_app_/components/hds/advanced-table/th-reorder-handle.js +1 -0
- package/dist/_app_/components/hds/advanced-table/utils.js +1 -0
- package/dist/components/hds/advanced-table/index.js +77 -17
- package/dist/components/hds/advanced-table/index.js.map +1 -1
- package/dist/components/hds/advanced-table/models/column.js +58 -13
- package/dist/components/hds/advanced-table/models/column.js.map +1 -1
- package/dist/components/hds/advanced-table/models/row.js +38 -3
- package/dist/components/hds/advanced-table/models/row.js.map +1 -1
- package/dist/components/hds/advanced-table/models/table.js +146 -2
- package/dist/components/hds/advanced-table/models/table.js.map +1 -1
- package/dist/components/hds/advanced-table/td.js.map +1 -1
- package/dist/components/hds/advanced-table/th-context-menu.js +124 -50
- package/dist/components/hds/advanced-table/th-context-menu.js.map +1 -1
- package/dist/components/hds/advanced-table/th-reorder-drop-target.js +133 -0
- package/dist/components/hds/advanced-table/th-reorder-drop-target.js.map +1 -0
- package/dist/components/hds/advanced-table/th-reorder-handle.js +104 -0
- package/dist/components/hds/advanced-table/th-reorder-handle.js.map +1 -0
- package/dist/components/hds/advanced-table/th-resize-handle.js +44 -21
- package/dist/components/hds/advanced-table/th-resize-handle.js.map +1 -1
- package/dist/components/hds/advanced-table/th-sort.js +20 -8
- package/dist/components/hds/advanced-table/th-sort.js.map +1 -1
- package/dist/components/hds/advanced-table/th.js +19 -7
- package/dist/components/hds/advanced-table/th.js.map +1 -1
- package/dist/components/hds/advanced-table/tr.js +1 -1
- package/dist/components/hds/advanced-table/tr.js.map +1 -1
- package/dist/components/hds/advanced-table/types.js +6 -1
- package/dist/components/hds/advanced-table/types.js.map +1 -1
- package/dist/components/hds/advanced-table/utils.js +23 -0
- package/dist/components/hds/advanced-table/utils.js.map +1 -0
- package/dist/components/hds/dropdown/toggle/icon.js.map +1 -1
- package/dist/components/hds/flyout/index.js +29 -6
- package/dist/components/hds/flyout/index.js.map +1 -1
- package/dist/components/hds/form/index.js.map +1 -1
- package/dist/components/hds/form/key-value-inputs/index.js.map +1 -1
- package/dist/components/hds/form/radio-card/index.js.map +1 -1
- package/dist/components/hds/modal/index.js +51 -37
- package/dist/components/hds/modal/index.js.map +1 -1
- package/dist/components/hds/popover-primitive/index.js +51 -35
- package/dist/components/hds/popover-primitive/index.js.map +1 -1
- package/dist/components/hds/separator/index.js.map +1 -1
- package/dist/components/hds/stepper/list/step.js.map +1 -1
- package/dist/components/hds/table/index.js.map +1 -1
- package/dist/components/hds/table/td.js.map +1 -1
- package/dist/components/hds/table/th-sort.js.map +1 -1
- package/dist/components/hds/table/th.js.map +1 -1
- package/dist/components.js +1 -1
- package/dist/styles/@hashicorp/design-system-components.css +196 -62
- package/dist/styles/components/advanced-table.scss +155 -6
- package/dist/styles/mixins/_focus-ring.scss +43 -0
- package/package.json +5 -2
- package/translations/hds/components/advanced-table/en-us.yaml +1 -0
- package/translations/hds/components/advanced-table/th-context-menu/en-us.yaml +3 -0
- package/translations/hds/components/advanced-table/th-reorder-handle/en-us.yaml +2 -0
|
@@ -8,7 +8,7 @@ import type { HdsIconSignature } from '../../icon';
|
|
|
8
8
|
import type { HdsStepperStatuses } from '../types.ts';
|
|
9
9
|
export declare const DEFAULT_STATUS = HdsStepperStatusesValues.Incomplete;
|
|
10
10
|
export declare const STATUSES: HdsStepperStatuses[];
|
|
11
|
-
export declare const MAPPING_STATUS_TO_ICONS: Record<HdsStepperStatusesValues, "type" | "map" | "filter" | "code" | "link" | "menu" | "search" | "video" | "circle" | "image" | "path" | "tag" | "repeat" | "hash" | "queue" | "shuffle" | "chevron-up" | "chevron-down" | "unfold-open" | "unfold-close" | "arrow-down" | "arrow-up" | "swap-vertical" | "top" | "key" | "end" | "start" | "change" | "pause" | "play" | "x" | "bottom" | "caret" | "grid" | "outline" | "text-wrap" | "loading" | "loading-static" | "running" | "running-static" | "apple" | "apple-color" | "alibaba" | "alibaba-color" | "amazon-ecs" | "amazon-ecs-color" | "amazon-eks" | "amazon-eks-color" | "auth0" | "auth0-color" | "aws" | "aws-color" | "aws-cdk" | "aws-cdk-color" | "aws-cloudwatch" | "aws-cloudwatch-color" | "aws-ec2" | "aws-ec2-color" | "aws-lambda" | "aws-lambda-color" | "aws-s3" | "aws-s3-color" | "azure" | "azure-color" | "azure-aks" | "azure-aks-color" | "azure-blob-storage" | "azure-blob-storage-color" | "azure-devops" | "azure-devops-color" | "azure-vms" | "azure-vms-color" | "bitbucket" | "bitbucket-color" | "bridgecrew" | "bridgecrew-color" | "cisco" | "cisco-color" | "codepen" | "codepen-color" | "confluence" | "confluence-color" | "confluent" | "confluent-color" | "datadog" | "datadog-color" | "digital-ocean" | "digital-ocean-color" | "docker" | "docker-color" | "duo" | "duo-color" | "elastic-observability" | "elastic-observability-color" | "f5" | "f5-color" | "facebook" | "facebook-color" | "figma" | "figma-color" | "gcp" | "gcp-color" | "git" | "git-color" | "gitlab" | "gitlab-color" | "github" | "github-color" | "google" | "google-color" | "google-docs" | "google-docs-color" | "google-drive" | "google-drive-color" | "google-forms" | "google-forms-color" | "google-sheets" | "google-sheets-color" | "google-slides" | "google-slides-color" | "grafana" | "grafana-color" | "helm" | "helm-color" | "infracost" | "infracost-color" | "jfrog" | "jfrog-color" | "jira" | "jira-color" | "jwt" | "jwt-color" | "kubernetes" | "kubernetes-color" | "lightlytics" | "lightlytics-color" | "linkedin" | "linkedin-color" | "linode" | "linode-color" | "linux" | "linux-color" | "loom" | "loom-color" | "meetup" | "meetup-color" | "microsoft" | "microsoft-color" | "microsoft-teams" | "microsoft-teams-color" | "minio" | "minio-color" | "mongodb" | "mongodb-color" | "new-relic" | "new-relic-color" | "okta" | "okta-color" | "oracle" | "oracle-color" | "opa" | "opa-color" | "openid" | "openid-color" | "pack" | "pack-color" | "pager-duty" | "pager-duty-color" | "ping-identity " | "ping-identity-color" | "postgres" | "postgres-color" | "rabbitmq" | "rabbitmq-color" | "saml" | "saml-color" | "service-now" | "service-now-color" | "slack" | "slack-color" | "snyk" | "snyk-color" | "splunk" | "splunk-color" | "twilio" | "twilio-color" | "twitch" | "twitch-color" | "twitter" | "twitter-color" | "twitter-x" | "twitter-x-color" | "vantage" | "vantage-color" | "venafi" | "venafi-color" | "vercel" | "vercel-color" | "vmware" | "vmware-color" | "youtube" | "youtube-color" | "boundary" | "boundary-color" | "boundary-fill" | "boundary-fill-color" | "boundary-square" | "boundary-square-color" | "consul" | "consul-color" | "consul-fill" | "consul-fill-color" | "consul-square" | "consul-square-color" | "nomad" | "nomad-color" | "nomad-fill" | "nomad-fill-color" | "nomad-square" | "nomad-square-color" | "packer" | "packer-color" | "packer-fill" | "packer-fill-color" | "packer-square" | "packer-square-color" | "terraform" | "terraform-color" | "terraform-fill" | "terraform-fill-color" | "terraform-square" | "terraform-square-color" | "vagrant" | "vagrant-color" | "vagrant-fill" | "vagrant-fill-color" | "vagrant-square" | "vagrant-square-color" | "vault" | "vault-color" | "vault-fill" | "vault-fill-color" | "vault-square" | "vault-square-color" | "vault-radar" | "vault-radar-color" | "vault-radar-fill" | "vault-radar-fill-color" | "vault-radar-square" | "vault-radar-square-color" | "vault-secrets" | "vault-secrets-color" | "vault-secrets-fill" | "vault-secrets-fill-color" | "vault-secrets-square" | "vault-secrets-square-color" | "waypoint" | "waypoint-color" | "waypoint-fill" | "waypoint-fill-color" | "waypoint-square" | "waypoint-square-color" | "hashicorp" | "hashicorp-color" | "hashicorp-fill" | "hashicorp-fill-color" | "hashicorp-square" | "hashicorp-square-color" | "hcp" | "hcp-color" | "hcp-fill" | "hcp-fill-color" | "hcp-square" | "hcp-square-color" | "accessibility" | "folder-users" | "frown" | "identity-service" | "identity-user" | "meh" | "robot" | "smile" | "user" | "user-check" | "user-circle" | "user-circle-fill" | "user-minus" | "user-plus" | "user-x" | "users" | "ampersand" | "beaker" | "bucket" | "bulb" | "circle-dot" | "circle-fill" | "circle-half" | "diamond" | "diamond-fill" | "disc" | "dot" | "dot-half" | "droplet" | "flag" | "gift" | "government" | "handshake" | "hexagon" | "hexagon-fill" | "labyrinth" | "layers" | "moon" | "octagon" | "random" | "rocket" | "sparkle" | "square" | "square-fill" | "sun" | "triangle" | "triangle-fill" | "truck" | "wand" | "zap" | "zap-off" | "docs" | "docs-download" | "docs-link" | "guide" | "guide-link" | "help" | "info" | "info-fill" | "learn" | "learn-link" | "support" | "alert-circle" | "alert-circle-fill" | "alert-diamond" | "alert-diamond-fill" | "alert-octagon" | "alert-octagon-fill" | "alert-triangle" | "alert-triangle-fill" | "check" | "check-circle" | "check-circle-fill" | "check-diamond" | "check-diamond-fill" | "check-hexagon" | "check-hexagon-fill" | "check-square" | "check-square-fill" | "skip" | "x-circle" | "x-circle-fill" | "x-diamond" | "x-diamond-fill" | "x-hexagon" | "x-hexagon-fill" | "x-square" | "x-square-fill" | "bug" | "certificate" | "eye" | "eye-off" | "fingerprint" | "keychain" | "lock" | "lock-fill" | "lock-off" | "shield" | "shield-alert" | "shield-check" | "shield-off" | "shield-x" | "token" | "unlock" | "verified" | "wall" | "minus" | "minus-circle" | "minus-circle-fill" | "minus-plus" | "minus-plus-circle" | "minus-plus-square" | "minus-square" | "minus-square-fill" | "plus" | "plus-circle" | "plus-circle-fill" | "plus-square" | "camera" | "camera-off" | "cast" | "closed-caption" | "fast-forward" | "film" | "headphones" | "music" | "pause-circle" | "play-circle" | "radio" | "rewind" | "rss" | "skip-back" | "skip-forward" | "speaker" | "stop-circle" | "volume" | "volume-down" | "volume-2" | "volume-x" | "wifi" | "wifi-off" | "compass" | "crosshair" | "map-pin" | "navigation" | "navigation-alt" | "redirect" | "target" | "align-center" | "align-justify" | "align-left" | "align-right" | "battery" | "battery-charging" | "bookmark" | "bookmark-add" | "bookmark-add-fill" | "bookmark-fill" | "bookmark-remove" | "bookmark-remove-fill" | "command" | "crop" | "dashboard" | "delete" | "download" | "edit" | "entry-point" | "exit-point" | "external-link" | "filter-circle" | "filter-fill" | "grid-alt" | "home" | "jump-link" | "layout" | "list" | "maximize" | "maximize-alt" | "minimize" | "minimize-alt" | "more-horizontal" | "more-vertical" | "mouse-pointer" | "move-horizontal" | "paperclip" | "pen-tool" | "pencil-tool" | "pin" | "pin-off" | "power" | "printer" | "reload" | "resize-column" | "rotate-cw" | "rotate-ccw" | "share" | "sidebar" | "sidebar-hide" | "sidebar-show" | "sign-in" | "sign-out" | "slash" | "slash-square" | "sort-asc" | "sort-desc" | "switcher" | "sync" | "sync-alert" | "sync-reverse" | "toggle-left" | "toggle-right" | "trash" | "upload" | "zoom-in" | "zoom-out" | "archive" | "clipboard" | "clipboard-checked" | "clipboard-copy" | "clipboard-x" | "file" | "file-change" | "file-check" | "file-diff" | "file-minus" | "file-plus" | "file-source" | "file-text" | "file-x" | "files" | "folder" | "folder-fill" | "folder-minus" | "folder-minus-fill" | "folder-plus" | "folder-plus-fill" | "folder-star" | "inbox" | "api" | "auto-apply" | "build" | "change-circle" | "change-square" | "channel" | "cloud" | "cloud-check" | "cloud-download" | "cloud-lightning" | "cloud-lock" | "cloud-off" | "cloud-upload" | "cloud-x" | "connection" | "connection-gateway" | "cpu" | "duplicate" | "gateway" | "git-branch" | "git-commit" | "git-merge" | "git-pull-request" | "git-repo" | "hammer" | "key-values" | "mainframe" | "mesh" | "module" | "monitor" | "network" | "network-alt" | "node" | "pipeline" | "plug" | "replication-direct" | "replication-perf" | "scissors" | "server" | "server-cluster" | "serverless" | "service" | "settings" | "sliders" | "smartphone" | "socket" | "step" | "tablet" | "terminal" | "terminal-screen" | "test" | "tools" | "transform-data" | "tv" | "webhook" | "wrench" | "calendar" | "clock" | "clock-filled" | "delay" | "event" | "history" | "hourglass" | "watch" | "bar-chart" | "bar-chart-alt" | "box" | "collections" | "database" | "hard-drive" | "line-chart" | "line-chart-up" | "logs" | "package" | "pie-chart" | "save" | "trend-down" | "trend-up" | "activity" | "at-sign" | "award" | "bell" | "bell-active" | "bell-active-fill" | "bell-off" | "discussion-circle" | "discussion-square" | "heart" | "heart-fill" | "heart-off" | "mail" | "mail-open" | "message-circle" | "message-circle-fill" | "message-square" | "message-square-fill" | "mic" | "mic-off" | "newspaper" | "phone" | "phone-call" | "phone-off" | "send" | "star" | "star-circle" | "star-fill" | "star-off" | "thumbs-down" | "thumbs-up" | "video-off" | "bank-vault" | "briefcase" | "credit-card" | "dollar-sign" | "enterprise" | "globe" | "globe-private" | "org" | "provider" | "shopping-bag" | "shopping-cart" | "arrow-down-circle" | "arrow-down-left" | "arrow-down-right" | "arrow-left" | "arrow-left-circle" | "arrow-right" | "arrow-right-circle" | "arrow-up-circle" | "arrow-up-left" | "arrow-up-right" | "chevron-left" | "chevron-right" | "chevrons-down" | "chevrons-left" | "chevrons-right" | "chevrons-up" | "corner-down-left" | "corner-down-right" | "corner-left-down" | "corner-left-up" | "corner-right-down" | "corner-right-up" | "corner-up-left" | "corner-up-right" | "load-balancer" | "migrate" | "move" | "swap-horizontal">;
|
|
11
|
+
export declare const MAPPING_STATUS_TO_ICONS: Record<HdsStepperStatusesValues, "type" | "map" | "filter" | "code" | "link" | "menu" | "search" | "video" | "circle" | "image" | "path" | "tag" | "repeat" | "hash" | "queue" | "shuffle" | "chevron-up" | "chevron-down" | "unfold-open" | "unfold-close" | "arrow-down" | "arrow-up" | "swap-vertical" | "top" | "key" | "move" | "change" | "pause" | "play" | "move-horizontal" | "loading" | "loading-static" | "running" | "running-static" | "apple" | "apple-color" | "alibaba" | "alibaba-color" | "amazon-ecs" | "amazon-ecs-color" | "amazon-eks" | "amazon-eks-color" | "auth0" | "auth0-color" | "aws" | "aws-color" | "aws-cdk" | "aws-cdk-color" | "aws-cloudwatch" | "aws-cloudwatch-color" | "aws-ec2" | "aws-ec2-color" | "aws-lambda" | "aws-lambda-color" | "aws-s3" | "aws-s3-color" | "azure" | "azure-color" | "azure-aks" | "azure-aks-color" | "azure-blob-storage" | "azure-blob-storage-color" | "azure-devops" | "azure-devops-color" | "azure-vms" | "azure-vms-color" | "bitbucket" | "bitbucket-color" | "bridgecrew" | "bridgecrew-color" | "cisco" | "cisco-color" | "codepen" | "codepen-color" | "confluence" | "confluence-color" | "confluent" | "confluent-color" | "datadog" | "datadog-color" | "digital-ocean" | "digital-ocean-color" | "docker" | "docker-color" | "duo" | "duo-color" | "elastic-observability" | "elastic-observability-color" | "f5" | "f5-color" | "facebook" | "facebook-color" | "figma" | "figma-color" | "gcp" | "gcp-color" | "git" | "git-color" | "gitlab" | "gitlab-color" | "github" | "github-color" | "google" | "google-color" | "google-docs" | "google-docs-color" | "google-drive" | "google-drive-color" | "google-forms" | "google-forms-color" | "google-sheets" | "google-sheets-color" | "google-slides" | "google-slides-color" | "grafana" | "grafana-color" | "helm" | "helm-color" | "infracost" | "infracost-color" | "jfrog" | "jfrog-color" | "jira" | "jira-color" | "jwt" | "jwt-color" | "kubernetes" | "kubernetes-color" | "lightlytics" | "lightlytics-color" | "linkedin" | "linkedin-color" | "linode" | "linode-color" | "linux" | "linux-color" | "loom" | "loom-color" | "meetup" | "meetup-color" | "microsoft" | "microsoft-color" | "microsoft-teams" | "microsoft-teams-color" | "minio" | "minio-color" | "mongodb" | "mongodb-color" | "new-relic" | "new-relic-color" | "okta" | "okta-color" | "oracle" | "oracle-color" | "opa" | "opa-color" | "openid" | "openid-color" | "pack" | "pack-color" | "pager-duty" | "pager-duty-color" | "ping-identity " | "ping-identity-color" | "postgres" | "postgres-color" | "rabbitmq" | "rabbitmq-color" | "saml" | "saml-color" | "service-now" | "service-now-color" | "slack" | "slack-color" | "snyk" | "snyk-color" | "splunk" | "splunk-color" | "twilio" | "twilio-color" | "twitch" | "twitch-color" | "twitter" | "twitter-color" | "twitter-x" | "twitter-x-color" | "vantage" | "vantage-color" | "venafi" | "venafi-color" | "vercel" | "vercel-color" | "vmware" | "vmware-color" | "youtube" | "youtube-color" | "boundary" | "boundary-color" | "boundary-fill" | "boundary-fill-color" | "boundary-square" | "boundary-square-color" | "consul" | "consul-color" | "consul-fill" | "consul-fill-color" | "consul-square" | "consul-square-color" | "nomad" | "nomad-color" | "nomad-fill" | "nomad-fill-color" | "nomad-square" | "nomad-square-color" | "packer" | "packer-color" | "packer-fill" | "packer-fill-color" | "packer-square" | "packer-square-color" | "terraform" | "terraform-color" | "terraform-fill" | "terraform-fill-color" | "terraform-square" | "terraform-square-color" | "vagrant" | "vagrant-color" | "vagrant-fill" | "vagrant-fill-color" | "vagrant-square" | "vagrant-square-color" | "vault" | "vault-color" | "vault-fill" | "vault-fill-color" | "vault-square" | "vault-square-color" | "vault-radar" | "vault-radar-color" | "vault-radar-fill" | "vault-radar-fill-color" | "vault-radar-square" | "vault-radar-square-color" | "vault-secrets" | "vault-secrets-color" | "vault-secrets-fill" | "vault-secrets-fill-color" | "vault-secrets-square" | "vault-secrets-square-color" | "waypoint" | "waypoint-color" | "waypoint-fill" | "waypoint-fill-color" | "waypoint-square" | "waypoint-square-color" | "hashicorp" | "hashicorp-color" | "hashicorp-fill" | "hashicorp-fill-color" | "hashicorp-square" | "hashicorp-square-color" | "hcp" | "hcp-color" | "hcp-fill" | "hcp-fill-color" | "hcp-square" | "hcp-square-color" | "accessibility" | "folder-users" | "frown" | "identity-service" | "identity-user" | "meh" | "robot" | "smile" | "user" | "user-check" | "user-circle" | "user-circle-fill" | "user-minus" | "user-plus" | "user-x" | "users" | "ampersand" | "beaker" | "bucket" | "bulb" | "circle-dot" | "circle-fill" | "circle-half" | "diamond" | "diamond-fill" | "disc" | "dot" | "dot-half" | "droplet" | "flag" | "gift" | "government" | "handshake" | "hexagon" | "hexagon-fill" | "labyrinth" | "layers" | "moon" | "octagon" | "outline" | "random" | "rocket" | "sparkle" | "square" | "square-fill" | "sun" | "triangle" | "triangle-fill" | "truck" | "wand" | "zap" | "zap-off" | "docs" | "docs-download" | "docs-link" | "guide" | "guide-link" | "help" | "info" | "info-fill" | "learn" | "learn-link" | "support" | "alert-circle" | "alert-circle-fill" | "alert-diamond" | "alert-diamond-fill" | "alert-octagon" | "alert-octagon-fill" | "alert-triangle" | "alert-triangle-fill" | "check" | "check-circle" | "check-circle-fill" | "check-diamond" | "check-diamond-fill" | "check-hexagon" | "check-hexagon-fill" | "check-square" | "check-square-fill" | "skip" | "x" | "x-circle" | "x-circle-fill" | "x-diamond" | "x-diamond-fill" | "x-hexagon" | "x-hexagon-fill" | "x-square" | "x-square-fill" | "bug" | "certificate" | "eye" | "eye-off" | "fingerprint" | "keychain" | "lock" | "lock-fill" | "lock-off" | "shield" | "shield-alert" | "shield-check" | "shield-off" | "shield-x" | "token" | "unlock" | "verified" | "wall" | "minus" | "minus-circle" | "minus-circle-fill" | "minus-plus" | "minus-plus-circle" | "minus-plus-square" | "minus-square" | "minus-square-fill" | "plus" | "plus-circle" | "plus-circle-fill" | "plus-square" | "camera" | "camera-off" | "cast" | "closed-caption" | "fast-forward" | "film" | "headphones" | "music" | "pause-circle" | "play-circle" | "radio" | "rewind" | "rss" | "skip-back" | "skip-forward" | "speaker" | "stop-circle" | "volume" | "volume-down" | "volume-2" | "volume-x" | "wifi" | "wifi-off" | "compass" | "crosshair" | "map-pin" | "navigation" | "navigation-alt" | "redirect" | "target" | "align-center" | "align-justify" | "align-left" | "align-right" | "battery" | "battery-charging" | "bookmark" | "bookmark-add" | "bookmark-add-fill" | "bookmark-fill" | "bookmark-remove" | "bookmark-remove-fill" | "bottom" | "start" | "end" | "command" | "crop" | "dashboard" | "delete" | "download" | "edit" | "entry-point" | "exit-point" | "external-link" | "filter-circle" | "filter-fill" | "grid" | "grid-alt" | "home" | "jump-link" | "layout" | "list" | "maximize" | "maximize-alt" | "minimize" | "minimize-alt" | "more-horizontal" | "more-vertical" | "mouse-pointer" | "paperclip" | "pen-tool" | "pencil-tool" | "pin" | "pin-off" | "power" | "printer" | "reload" | "resize-column" | "rotate-cw" | "rotate-ccw" | "share" | "sidebar" | "sidebar-hide" | "sidebar-show" | "sign-in" | "sign-out" | "slash" | "slash-square" | "sort-asc" | "sort-desc" | "switcher" | "sync" | "sync-alert" | "sync-reverse" | "toggle-left" | "toggle-right" | "trash" | "text-wrap" | "upload" | "zoom-in" | "zoom-out" | "archive" | "clipboard" | "clipboard-checked" | "clipboard-copy" | "clipboard-x" | "file" | "file-change" | "file-check" | "file-diff" | "file-minus" | "file-plus" | "file-source" | "file-text" | "file-x" | "files" | "folder" | "folder-fill" | "folder-minus" | "folder-minus-fill" | "folder-plus" | "folder-plus-fill" | "folder-star" | "inbox" | "api" | "auto-apply" | "build" | "change-circle" | "change-square" | "channel" | "cloud" | "cloud-check" | "cloud-download" | "cloud-lightning" | "cloud-lock" | "cloud-off" | "cloud-upload" | "cloud-x" | "connection" | "connection-gateway" | "cpu" | "duplicate" | "gateway" | "git-branch" | "git-commit" | "git-merge" | "git-pull-request" | "git-repo" | "hammer" | "key-values" | "mainframe" | "mesh" | "module" | "monitor" | "network" | "network-alt" | "node" | "pipeline" | "plug" | "replication-direct" | "replication-perf" | "scissors" | "server" | "server-cluster" | "serverless" | "service" | "settings" | "sliders" | "smartphone" | "socket" | "step" | "tablet" | "terminal" | "terminal-screen" | "test" | "tools" | "transform-data" | "tv" | "webhook" | "wrench" | "calendar" | "clock" | "clock-filled" | "delay" | "event" | "history" | "hourglass" | "watch" | "bar-chart" | "bar-chart-alt" | "box" | "collections" | "database" | "hard-drive" | "line-chart" | "line-chart-up" | "logs" | "package" | "pie-chart" | "save" | "trend-down" | "trend-up" | "activity" | "at-sign" | "award" | "bell" | "bell-active" | "bell-active-fill" | "bell-off" | "discussion-circle" | "discussion-square" | "heart" | "heart-fill" | "heart-off" | "mail" | "mail-open" | "message-circle" | "message-circle-fill" | "message-square" | "message-square-fill" | "mic" | "mic-off" | "newspaper" | "phone" | "phone-call" | "phone-off" | "send" | "star" | "star-circle" | "star-fill" | "star-off" | "thumbs-down" | "thumbs-up" | "video-off" | "bank-vault" | "briefcase" | "credit-card" | "dollar-sign" | "enterprise" | "globe" | "globe-private" | "org" | "provider" | "shopping-bag" | "shopping-cart" | "arrow-down-circle" | "arrow-down-left" | "arrow-down-right" | "arrow-left" | "arrow-left-circle" | "arrow-right" | "arrow-right-circle" | "arrow-up-circle" | "arrow-up-left" | "arrow-up-right" | "caret" | "chevron-left" | "chevron-right" | "chevrons-down" | "chevrons-left" | "chevrons-right" | "chevrons-up" | "corner-down-left" | "corner-down-right" | "corner-left-down" | "corner-left-up" | "corner-right-down" | "corner-right-up" | "corner-up-left" | "corner-up-right" | "load-balancer" | "migrate" | "swap-horizontal">;
|
|
12
12
|
export interface HdsStepperTaskIndicatorSignature {
|
|
13
13
|
Args: {
|
|
14
14
|
status?: HdsStepperStatuses;
|
|
@@ -17,7 +17,7 @@ export declare const DENSITIES: HdsTableDensities[];
|
|
|
17
17
|
export declare const DEFAULT_DENSITY = HdsTableDensityValues.Medium;
|
|
18
18
|
export declare const VALIGNMENTS: HdsTableVerticalAlignment[];
|
|
19
19
|
export declare const DEFAULT_VALIGN = HdsTableVerticalAlignmentValues.Top;
|
|
20
|
-
export interface HdsTableSignature {
|
|
20
|
+
export interface HdsTableSignature<T = HdsTableModel> {
|
|
21
21
|
Args: {
|
|
22
22
|
align?: HdsTableHorizontalAlignment;
|
|
23
23
|
caption?: string;
|
|
@@ -27,7 +27,7 @@ export interface HdsTableSignature {
|
|
|
27
27
|
isFixedLayout?: boolean;
|
|
28
28
|
isSelectable?: boolean;
|
|
29
29
|
isStriped?: boolean;
|
|
30
|
-
model?:
|
|
30
|
+
model?: T[];
|
|
31
31
|
onSelectionChange?: (selection: HdsTableOnSelectionChangeSignature) => void;
|
|
32
32
|
onSort?: (sortBy: string, sortOrder: HdsTableThSortOrder) => void;
|
|
33
33
|
selectionAriaLabelSuffix?: string;
|
|
@@ -53,7 +53,7 @@ export interface HdsTableSignature {
|
|
|
53
53
|
Td?: ComponentLike<HdsTableTdSignature>;
|
|
54
54
|
Tr?: ComponentLike<HdsTableTrSignature>;
|
|
55
55
|
Th?: ComponentLike<HdsTableThSignature>;
|
|
56
|
-
data?:
|
|
56
|
+
data?: T;
|
|
57
57
|
rowIndex?: number;
|
|
58
58
|
sortBy?: string;
|
|
59
59
|
sortOrder?: HdsTableThSortOrder;
|
|
@@ -62,14 +62,14 @@ export interface HdsTableSignature {
|
|
|
62
62
|
};
|
|
63
63
|
Element: HTMLTableElement;
|
|
64
64
|
}
|
|
65
|
-
export default class HdsTable extends Component<HdsTableSignature
|
|
65
|
+
export default class HdsTable<T = HdsTableModel> extends Component<HdsTableSignature<T>> {
|
|
66
66
|
hdsIntl: HdsIntlService;
|
|
67
67
|
sortBy: string | undefined;
|
|
68
68
|
sortOrder: "desc" | "asc" | HdsTableThSortOrderValues;
|
|
69
69
|
private _selectAllCheckbox?;
|
|
70
70
|
private _selectableRows;
|
|
71
71
|
private _isSelectAllCheckboxSelected?;
|
|
72
|
-
constructor(owner: Owner, args: HdsTableSignature['Args']);
|
|
72
|
+
constructor(owner: Owner, args: HdsTableSignature<T>['Args']);
|
|
73
73
|
get getSortCriteria(): string | HdsTableSortingFunction<unknown>;
|
|
74
74
|
get identityKey(): string | undefined;
|
|
75
75
|
get sortedMessageText(): string;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import Component from '@glimmer/component';
|
|
6
6
|
import type { HdsTableHorizontalAlignment } from './types.ts';
|
|
7
7
|
import { HdsTableHorizontalAlignmentValues } from './types.ts';
|
|
8
|
-
export declare const ALIGNMENTS:
|
|
8
|
+
export declare const ALIGNMENTS: HdsTableHorizontalAlignment[];
|
|
9
9
|
export declare const DEFAULT_ALIGN = HdsTableHorizontalAlignmentValues.Left;
|
|
10
10
|
export interface HdsTableTdSignature {
|
|
11
11
|
Args: {
|
|
@@ -6,7 +6,7 @@ import Component from '@glimmer/component';
|
|
|
6
6
|
import { HdsTableHorizontalAlignmentValues } from './types.ts';
|
|
7
7
|
import type { HdsTableHorizontalAlignment, HdsTableThSortOrder, HdsTableThSortOrderLabels } from './types.ts';
|
|
8
8
|
import type { HdsTableThButtonSortSignature } from './th-button-sort';
|
|
9
|
-
export declare const ALIGNMENTS:
|
|
9
|
+
export declare const ALIGNMENTS: HdsTableHorizontalAlignment[];
|
|
10
10
|
export declare const DEFAULT_ALIGN = HdsTableHorizontalAlignmentValues.Left;
|
|
11
11
|
export interface HdsTableThSortSignature {
|
|
12
12
|
Args: {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import Component from '@glimmer/component';
|
|
6
6
|
import type { HdsTableHorizontalAlignment, HdsTableScope } from './types.ts';
|
|
7
7
|
import { HdsTableHorizontalAlignmentValues } from './types.ts';
|
|
8
|
-
export declare const ALIGNMENTS:
|
|
8
|
+
export declare const ALIGNMENTS: HdsTableHorizontalAlignment[];
|
|
9
9
|
export declare const DEFAULT_ALIGN = HdsTableHorizontalAlignmentValues.Left;
|
|
10
10
|
export interface HdsTableThSignature {
|
|
11
11
|
Args: {
|
|
@@ -12,6 +12,8 @@ import type HdsAdvancedTableThButtonSortComponent from './components/hds/advance
|
|
|
12
12
|
import type HdsAdvancedTableThComponent from './components/hds/advanced-table/th';
|
|
13
13
|
import type HdsAdvancedTableThButtonTooltipComponent from './components/hds/advanced-table/th-button-tooltip';
|
|
14
14
|
import type HdsAdvancedTableThContextMenu from './components/hds/advanced-table/th-context-menu';
|
|
15
|
+
import type HdsAdvancedTableThReorderDropTarget from './components/hds/advanced-table/th-reorder-drop-target';
|
|
16
|
+
import type HdsAdvancedTableThReorderHandle from './components/hds/advanced-table/th-reorder-handle';
|
|
15
17
|
import type HdsAdvancedTableThResizeHandle from './components/hds/advanced-table/th-resize-handle';
|
|
16
18
|
import type HdsAdvancedTableThSortComponent from './components/hds/advanced-table/th-sort';
|
|
17
19
|
import type HdsAdvancedTableThSelectableComponent from './components/hds/advanced-table/th-selectable';
|
|
@@ -261,6 +263,10 @@ export default interface HdsComponentsRegistry {
|
|
|
261
263
|
'Hds::AdvancedTable::ThButtonTooltip': typeof HdsAdvancedTableThButtonTooltipComponent;
|
|
262
264
|
'Hds::AdvancedTable::ThContextMenu': typeof HdsAdvancedTableThContextMenu;
|
|
263
265
|
'hds/advanced-table/th-context-menu': typeof HdsAdvancedTableThContextMenu;
|
|
266
|
+
'Hds::AdvancedTable::ThReorderDropTarget': typeof HdsAdvancedTableThReorderDropTarget;
|
|
267
|
+
'hds/advanced-table/th-reorder-drop-target': typeof HdsAdvancedTableThReorderDropTarget;
|
|
268
|
+
'Hds::AdvancedTable::ThReorderHandle': typeof HdsAdvancedTableThReorderHandle;
|
|
269
|
+
'hds/advanced-table/th-reorder-handle': typeof HdsAdvancedTableThReorderHandle;
|
|
264
270
|
'Hds::AdvancedTable::ThResizeHandle': typeof HdsAdvancedTableThResizeHandle;
|
|
265
271
|
'hds/advanced-table/th-resize-handle': typeof HdsAdvancedTableThResizeHandle;
|
|
266
272
|
'hds/advanced-table/th-button-tooltip': typeof HdsAdvancedTableThButtonTooltipComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@hashicorp/design-system-components/components/hds/advanced-table/th-reorder-drop-target";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@hashicorp/design-system-components/components/hds/advanced-table/th-reorder-handle";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@hashicorp/design-system-components/components/hds/advanced-table/utils";
|
|
@@ -3,6 +3,7 @@ import { action } from '@ember/object';
|
|
|
3
3
|
import { assert } from '@ember/debug';
|
|
4
4
|
import { tracked } from '@glimmer/tracking';
|
|
5
5
|
import { guidFor } from '@ember/object/internals';
|
|
6
|
+
import { service } from '@ember/service';
|
|
6
7
|
import { modifier } from 'ember-modifier';
|
|
7
8
|
import HdsAdvancedTableTableModel from './models/table.js';
|
|
8
9
|
import { HdsAdvancedTableDensityValues, HdsAdvancedTableVerticalAlignmentValues } from './types.js';
|
|
@@ -10,7 +11,7 @@ import { precompileTemplate } from '@ember/template-compilation';
|
|
|
10
11
|
import { g, i, n } from 'decorator-transforms/runtime';
|
|
11
12
|
import { setComponentTemplate } from '@ember/component';
|
|
12
13
|
|
|
13
|
-
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<div\n class=\"hds-advanced-table__container\n {{(if this.isStickyHeaderPinned \'hds-advanced-table__container--header-is-pinned\')}}\"\n {{did-update this.setupTableModelData @columns @model @sortBy @sortOrder}}\n ...attributes\n>\n {{! Caption }}\n <div id={{this._captionId}} class=\"sr-only hds-advanced-table__caption\" aria-live=\"polite\">\n {{@caption}}\n {{this.sortedMessageText}}\n </div>\n\n {{! Grid }}\n <div\n class={{this.classNames}}\n role=\"grid\"\n aria-describedby={{this._captionId}}\n {{style\n grid-template-columns=this.gridTemplateColumns\n --hds-advanced-table-sticky-column-offset=this.stickyColumnOffset\n max-height=@maxHeight\n }}\n {{this._registerGridElement}}\n {{this._setUpScrollWrapper}}\n >\n {{! Header }}\n <div
|
|
14
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n\n<div\n class=\"hds-advanced-table__container\n {{(if this.isStickyHeaderPinned \'hds-advanced-table__container--header-is-pinned\')}}\"\n {{did-update this.setupTableModelData @columns @model @sortBy @sortOrder}}\n {{did-update this.updateTableModelColumnOrder @columnOrder}}\n ...attributes\n>\n {{! Caption }}\n <div id={{this._captionId}} class=\"sr-only hds-advanced-table__caption\" aria-live=\"polite\">\n {{@caption}}\n {{this.sortedMessageText}}\n {{this.reorderedMessageText}}\n </div>\n\n {{! Grid }}\n <div\n class={{this.classNames}}\n role=\"grid\"\n aria-describedby={{this._captionId}}\n {{style\n grid-template-columns=this.gridTemplateColumns\n --hds-advanced-table-sticky-column-offset=this.stickyColumnOffset\n max-height=@maxHeight\n }}\n {{this._registerGridElement}}\n {{this._setUpScrollWrapper}}\n >\n {{! Header }}\n <div\n class={{this.theadClassNames}}\n role=\"rowgroup\"\n {{this._setUpThead}}\n {{on \"dragleave\" (fn (mut this._tableModel.reorderHoveredColumn) null)}}\n >\n <Hds::AdvancedTable::Tr\n @selectionScope=\"col\"\n @onClickSortBySelected={{if @selectableColumnKey (fn this._tableModel.setSortBy @selectableColumnKey)}}\n @sortBySelectedOrder={{if (eq this._tableModel.sortBy @selectableColumnKey) this._tableModel.sortOrder}}\n @isSelectable={{this.isSelectable}}\n @onSelectionChange={{this.onSelectionAllChange}}\n @didInsert={{this.didInsertSelectAllCheckbox}}\n @willDestroy={{this.willDestroySelectAllCheckbox}}\n @selectionAriaLabelSuffix=\"all rows\"\n @hasStickyColumn={{this.hasStickyFirstColumn}}\n @isStickyColumnPinned={{this.isStickyColumnPinned}}\n >\n {{#each this._tableModel.orderedColumns as |column|}}\n {{#if column.isSortable}}\n <Hds::AdvancedTable::ThSort\n @column={{column}}\n @sortOrder={{if (eq column.key this._tableModel.sortBy) this._tableModel.sortOrder}}\n @onClickSort={{if column.key (fn this._tableModel.setSortBy column.key)}}\n @align={{column.align}}\n @tooltip={{column.tooltip}}\n @hasReorderableColumns={{@hasReorderableColumns}}\n @hasResizableColumns={{@hasResizableColumns}}\n @hasSelectableRows={{this.isSelectable}}\n @isStickyColumn={{this._isStickyColumn column}}\n @isStickyColumnPinned={{this.isStickyColumnPinned}}\n @tableHeight={{this._tableHeight}}\n @onColumnResize={{@onColumnResize}}\n @onPinFirstColumn={{this._onPinFirstColumn}}\n @onReorderDragEnd={{fn (mut this._tableModel.reorderDraggedColumn) null}}\n @onReorderDragStart={{fn (mut this._tableModel.reorderDraggedColumn)}}\n @onReorderDrop={{this._tableModel.moveColumnToDropTarget}}\n {{this._registerThElement column}}\n >\n {{column.label}}\n </Hds::AdvancedTable::ThSort>\n {{else}}\n <Hds::AdvancedTable::Th\n @align={{column.align}}\n @column={{column}}\n @hasExpandAllButton={{this._tableModel.hasRowsWithChildren}}\n @hasReorderableColumns={{@hasReorderableColumns}}\n @hasResizableColumns={{@hasResizableColumns}}\n @hasSelectableRows={{this.isSelectable}}\n @isExpanded={{this._tableModel.expandState}}\n @isExpandable={{column.isExpandable}}\n @isStickyColumn={{this._isStickyColumn column}}\n @isStickyColumnPinned={{this.isStickyColumnPinned}}\n @isVisuallyHidden={{column.isVisuallyHidden}}\n @tableHeight={{this._tableHeight}}\n @tooltip={{column.tooltip}}\n @onClickToggle={{this._tableModel.toggleAll}}\n @onColumnResize={{@onColumnResize}}\n @onPinFirstColumn={{this._onPinFirstColumn}}\n @onReorderDragEnd={{fn (mut this._tableModel.reorderDraggedColumn) null}}\n @onReorderDragStart={{fn (mut this._tableModel.reorderDraggedColumn)}}\n @onReorderDrop={{this._tableModel.moveColumnToDropTarget}}\n {{this._registerThElement column}}\n >\n {{column.label}}\n </Hds::AdvancedTable::Th>\n {{/if}}\n {{/each}}\n </Hds::AdvancedTable::Tr>\n\n {{#if this.showScrollIndicatorTop}}\n <div class=\"hds-advanced-table__scroll-indicator hds-advanced-table__scroll-indicator-top\" />\n {{/if}}\n </div>\n\n {{! Body }}\n <div class=\"hds-advanced-table__tbody\" role=\"rowgroup\">\n {{! ----------------------------------------------------------------------------------------\n IMPORTANT: we loop on the `model` array and for each record\n we yield the Tr/Td/Th elements _and_ the record itself as `data`\n this means the consumer will *have to* use the `data` key to access it in their template\n -------------------------------------------------------------------------------------------- }}\n {{#each this._tableModel.sortedRows key=this.identityKey as |record index|}}\n {{#if this._tableModel.hasRowsWithChildren}}\n <Hds::AdvancedTable::ExpandableTrGroup\n @record={{record}}\n @rowIndex={{index}}\n @onClickToggle={{record.onClickToggle}}\n as |T|\n >\n {{yield\n (hash\n Tr=(component\n \"hds/advanced-table/tr\"\n isLastRow=(eq this._tableModel.lastVisibleRow.id T.data.id)\n isParentRow=T.isExpandable\n depth=T.depth\n displayRow=T.shouldDisplayChildRows\n data=T.data\n )\n Th=(component\n \"hds/advanced-table/th\"\n depth=T.depth\n isExpandable=T.isExpandable\n isExpanded=T.isExpanded\n newLabel=T.id\n parentId=T.parentId\n scope=\"row\"\n onClickToggle=T.onClickToggle\n )\n Td=(component \"hds/advanced-table/td\" align=@align)\n data=T.data\n isOpen=T.isExpanded\n rowIndex=T.rowIndex\n )\n to=\"body\"\n }}\n </Hds::AdvancedTable::ExpandableTrGroup>\n {{else}}\n {{yield\n (hash\n Tr=(component\n \"hds/advanced-table/tr\"\n selectionScope=\"row\"\n isLastRow=(eq this._tableModel.lastVisibleRow.id record.id)\n isSelectable=this.isSelectable\n onSelectionChange=this.onSelectionRowChange\n didInsert=this.didInsertRowCheckbox\n willDestroy=this.willDestroyRowCheckbox\n selectionAriaLabelSuffix=@selectionAriaLabelSuffix\n hasStickyColumn=this.hasStickyFirstColumn\n isStickyColumnPinned=this.isStickyColumnPinned\n data=record\n )\n Th=(component\n \"hds/advanced-table/th\"\n scope=\"row\"\n isStickyColumn=this.hasStickyFirstColumn\n isStickyColumnPinned=this.isStickyColumnPinned\n )\n Td=(component \"hds/advanced-table/td\" align=@align)\n data=record\n rowIndex=index\n )\n to=\"body\"\n }}\n {{/if}}\n {{/each}}\n </div>\n </div>\n\n {{#if this.showScrollIndicatorLeft}}\n <div\n class=\"hds-advanced-table__scroll-indicator hds-advanced-table__scroll-indicator-left\"\n {{style height=this.scrollIndicatorDimensions.height left=this.scrollIndicatorDimensions.left}}\n />\n {{/if}}\n\n {{#if this.showScrollIndicatorRight}}\n <div\n class=\"hds-advanced-table__scroll-indicator hds-advanced-table__scroll-indicator-right\"\n {{style height=this.scrollIndicatorDimensions.height right=this.scrollIndicatorDimensions.right}}\n />\n {{/if}}\n\n {{#if this.showScrollIndicatorBottom}}\n <div\n class=\"hds-advanced-table__scroll-indicator hds-advanced-table__scroll-indicator-bottom\"\n {{style bottom=this.scrollIndicatorDimensions.bottom width=this.scrollIndicatorDimensions.width}}\n />\n {{/if}}\n</div>");
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Copyright (c) HashiCorp, Inc.
|
|
@@ -21,15 +22,15 @@ const DENSITIES = Object.values(HdsAdvancedTableDensityValues);
|
|
|
21
22
|
const DEFAULT_DENSITY = HdsAdvancedTableDensityValues.Medium;
|
|
22
23
|
const VALIGNMENTS = Object.values(HdsAdvancedTableVerticalAlignmentValues);
|
|
23
24
|
const DEFAULT_VALIGN = HdsAdvancedTableVerticalAlignmentValues.Top;
|
|
25
|
+
const BORDER_WIDTH = 1;
|
|
24
26
|
const DEFAULT_SCROLL_DIMENSIONS = {
|
|
25
27
|
bottom: '0px',
|
|
26
28
|
height: '0px',
|
|
27
29
|
left: '0px',
|
|
28
30
|
right: '0px',
|
|
29
|
-
top: '0px',
|
|
30
31
|
width: '0px'
|
|
31
32
|
};
|
|
32
|
-
const getScrollIndicatorDimensions = (scrollWrapper, theadElement,
|
|
33
|
+
const getScrollIndicatorDimensions = (scrollWrapper, theadElement, hasStickyFirstColumn, hasFirstColumnPxWidth, isStickyColumnPinned) => {
|
|
33
34
|
const horizontalScrollBarHeight = scrollWrapper.offsetHeight - scrollWrapper.clientHeight;
|
|
34
35
|
const verticalScrollBarWidth = scrollWrapper.offsetWidth - scrollWrapper.clientWidth;
|
|
35
36
|
let leftOffset = 0;
|
|
@@ -57,7 +58,6 @@ const getScrollIndicatorDimensions = (scrollWrapper, theadElement, hasStickyHead
|
|
|
57
58
|
height: `${scrollWrapper.offsetHeight - horizontalScrollBarHeight}px`,
|
|
58
59
|
left: `${leftOffset}px`,
|
|
59
60
|
right: `${verticalScrollBarWidth}px`,
|
|
60
|
-
top: hasStickyHeader ? `${theadElement.offsetHeight}px` : '0px',
|
|
61
61
|
width: `${scrollWrapper.offsetWidth - verticalScrollBarWidth}px`
|
|
62
62
|
};
|
|
63
63
|
};
|
|
@@ -74,6 +74,10 @@ const getStickyColumnLeftOffset = (theadElement, hasRowSelection, isStickyColumn
|
|
|
74
74
|
return `${leftOffset}px`;
|
|
75
75
|
};
|
|
76
76
|
class HdsAdvancedTable extends Component {
|
|
77
|
+
static {
|
|
78
|
+
g(this.prototype, "hdsIntl", [service]);
|
|
79
|
+
}
|
|
80
|
+
#hdsIntl = (i(this, "hdsIntl"), void 0);
|
|
77
81
|
static {
|
|
78
82
|
g(this.prototype, "_selectAllCheckbox", [tracked], function () {
|
|
79
83
|
return undefined;
|
|
@@ -123,6 +127,12 @@ class HdsAdvancedTable extends Component {
|
|
|
123
127
|
});
|
|
124
128
|
}
|
|
125
129
|
#hasPinnedFirstColumn = (i(this, "hasPinnedFirstColumn"), void 0);
|
|
130
|
+
static {
|
|
131
|
+
g(this.prototype, "reorderedMessageText", [tracked], function () {
|
|
132
|
+
return '';
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
#reorderedMessageText = (i(this, "reorderedMessageText"), void 0);
|
|
126
136
|
static {
|
|
127
137
|
g(this.prototype, "showScrollIndicatorLeft", [tracked], function () {
|
|
128
138
|
return false;
|
|
@@ -158,6 +168,7 @@ class HdsAdvancedTable extends Component {
|
|
|
158
168
|
const {
|
|
159
169
|
model,
|
|
160
170
|
columns,
|
|
171
|
+
columnOrder,
|
|
161
172
|
childrenKey,
|
|
162
173
|
hasResizableColumns,
|
|
163
174
|
sortBy,
|
|
@@ -168,19 +179,15 @@ class HdsAdvancedTable extends Component {
|
|
|
168
179
|
this._tableModel = new HdsAdvancedTableTableModel({
|
|
169
180
|
model,
|
|
170
181
|
columns,
|
|
182
|
+
columnOrder,
|
|
171
183
|
childrenKey,
|
|
172
184
|
hasResizableColumns,
|
|
173
185
|
sortBy,
|
|
174
186
|
sortOrder,
|
|
187
|
+
onColumnReorder: this._onColumnReorder.bind(this),
|
|
175
188
|
onSort
|
|
176
189
|
});
|
|
177
|
-
|
|
178
|
-
const sortableColumns = columns.filter(column => column.isSortable);
|
|
179
|
-
const sortableColumnLabels = sortableColumns.map(column => column.label);
|
|
180
|
-
assert(`Cannot have sortable columns if there are nested rows. Sortable columns are ${sortableColumnLabels.toString()}`, sortableColumns.length === 0);
|
|
181
|
-
assert('Cannot have a sticky first column if there are nested rows.', !hasStickyFirstColumn);
|
|
182
|
-
assert(`Cannot have resizable columns if there are nested rows.`, !hasResizableColumns);
|
|
183
|
-
}
|
|
190
|
+
this._runAssertions();
|
|
184
191
|
if (hasStickyFirstColumn) {
|
|
185
192
|
this.hasPinnedFirstColumn = true;
|
|
186
193
|
}
|
|
@@ -280,13 +287,13 @@ class HdsAdvancedTable extends Component {
|
|
|
280
287
|
isSelectable
|
|
281
288
|
} = this.args;
|
|
282
289
|
const {
|
|
283
|
-
|
|
290
|
+
orderedColumns
|
|
284
291
|
} = this._tableModel;
|
|
285
292
|
|
|
286
293
|
// if there is a select checkbox, the first column has a 'min-content' width to hug the checkbox content
|
|
287
294
|
let style = isSelectable ? 'min-content ' : '';
|
|
288
|
-
for (let i = 0; i <
|
|
289
|
-
style += ` ${
|
|
295
|
+
for (let i = 0; i < orderedColumns.length; i++) {
|
|
296
|
+
style += ` ${orderedColumns[i].appliedWidth}`;
|
|
290
297
|
}
|
|
291
298
|
return style;
|
|
292
299
|
}
|
|
@@ -338,9 +345,9 @@ class HdsAdvancedTable extends Component {
|
|
|
338
345
|
};
|
|
339
346
|
element.addEventListener('scroll', this._scrollHandler);
|
|
340
347
|
const updateMeasurements = () => {
|
|
341
|
-
this._tableHeight = element.
|
|
348
|
+
this._tableHeight = element.offsetHeight;
|
|
342
349
|
const hasFirstColumnPxWidth = this._tableModel.columns[0]?.pxWidth !== undefined;
|
|
343
|
-
this.scrollIndicatorDimensions = getScrollIndicatorDimensions(element, this._theadElement, this.
|
|
350
|
+
this.scrollIndicatorDimensions = getScrollIndicatorDimensions(element, this._theadElement, this.hasStickyFirstColumn ? true : false, hasFirstColumnPxWidth, this.isStickyColumnPinned);
|
|
344
351
|
if (this.hasStickyFirstColumn) {
|
|
345
352
|
this.stickyColumnOffset = getStickyColumnLeftOffset(this._theadElement, isSelectable, this.isStickyColumnPinned);
|
|
346
353
|
}
|
|
@@ -369,9 +376,53 @@ class HdsAdvancedTable extends Component {
|
|
|
369
376
|
this._resizeObserver.disconnect();
|
|
370
377
|
};
|
|
371
378
|
});
|
|
379
|
+
_runAssertions() {
|
|
380
|
+
const {
|
|
381
|
+
columns,
|
|
382
|
+
hasReorderableColumns,
|
|
383
|
+
hasResizableColumns,
|
|
384
|
+
hasStickyFirstColumn
|
|
385
|
+
} = this.args;
|
|
386
|
+
if (this._tableModel.hasRowsWithChildren) {
|
|
387
|
+
const sortableColumns = columns.filter(column => column.isSortable);
|
|
388
|
+
const sortableColumnLabels = sortableColumns.map(column => column.label);
|
|
389
|
+
assert('Cannot have reorderable columns if there are nested rows.', !hasReorderableColumns);
|
|
390
|
+
assert(`Cannot have sortable columns if there are nested rows. Sortable columns are ${sortableColumnLabels.toString()}`, sortableColumns.length === 0);
|
|
391
|
+
assert('Cannot have a sticky first column if there are nested rows.', hasStickyFirstColumn === undefined);
|
|
392
|
+
assert(`Cannot have resizable columns if there are nested rows.`, !hasResizableColumns);
|
|
393
|
+
}
|
|
394
|
+
if (hasReorderableColumns) {
|
|
395
|
+
assert('Cannot have both reorderable columns and a sticky first column.', hasStickyFirstColumn === undefined);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
372
398
|
_setUpThead = modifier(element => {
|
|
373
399
|
this._theadElement = element;
|
|
374
400
|
});
|
|
401
|
+
_onColumnReorder = ({
|
|
402
|
+
column,
|
|
403
|
+
newOrder,
|
|
404
|
+
insertedAt
|
|
405
|
+
}) => {
|
|
406
|
+
const {
|
|
407
|
+
reorderedMessageText
|
|
408
|
+
} = this.args;
|
|
409
|
+
if (reorderedMessageText !== undefined) {
|
|
410
|
+
this.reorderedMessageText = reorderedMessageText;
|
|
411
|
+
} else {
|
|
412
|
+
const newPosition = insertedAt + 1;
|
|
413
|
+
const translatedReorderedMessageText = this.hdsIntl.t('hds.advanced-table.reordered-message', {
|
|
414
|
+
default: `Moved ${column.label} column to position ${newPosition}`,
|
|
415
|
+
columnLabel: column.label,
|
|
416
|
+
newPosition
|
|
417
|
+
});
|
|
418
|
+
this.reorderedMessageText = translatedReorderedMessageText;
|
|
419
|
+
}
|
|
420
|
+
this.args.onColumnReorder?.({
|
|
421
|
+
column,
|
|
422
|
+
newOrder,
|
|
423
|
+
insertedAt
|
|
424
|
+
});
|
|
425
|
+
};
|
|
375
426
|
onSelectionChangeCallback(checkbox, selectionKey) {
|
|
376
427
|
const {
|
|
377
428
|
onSelectionChange
|
|
@@ -412,6 +463,15 @@ class HdsAdvancedTable extends Component {
|
|
|
412
463
|
static {
|
|
413
464
|
n(this.prototype, "setupTableModelData", [action]);
|
|
414
465
|
}
|
|
466
|
+
updateTableModelColumnOrder() {
|
|
467
|
+
if (this.args.columnOrder === undefined) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
this._tableModel.columnOrder = this.args.columnOrder;
|
|
471
|
+
}
|
|
472
|
+
static {
|
|
473
|
+
n(this.prototype, "updateTableModelColumnOrder", [action]);
|
|
474
|
+
}
|
|
415
475
|
onSelectionAllChange() {
|
|
416
476
|
this._selectableRows.forEach(row => {
|
|
417
477
|
row.checkbox.checked = this._selectAllCheckbox?.checked ?? false;
|
|
@@ -536,5 +596,5 @@ class HdsAdvancedTable extends Component {
|
|
|
536
596
|
}
|
|
537
597
|
setComponentTemplate(TEMPLATE, HdsAdvancedTable);
|
|
538
598
|
|
|
539
|
-
export { DEFAULT_DENSITY, DEFAULT_VALIGN, DENSITIES, VALIGNMENTS, HdsAdvancedTable as default };
|
|
599
|
+
export { BORDER_WIDTH, DEFAULT_DENSITY, DEFAULT_VALIGN, DENSITIES, VALIGNMENTS, HdsAdvancedTable as default };
|
|
540
600
|
//# sourceMappingURL=index.js.map
|