@civicactions/cmsds-open-data-components 3.1.10-alpha.3 → 3.1.10-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1641,6 +1641,7 @@ const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: heade
1641
1641
  style: {
1642
1642
  maxWidth: header.getSize() - 16
1643
1643
  },
1644
+ title: header.column.columnDef.header,
1644
1645
  children: header.isPlaceholder ? null : (0, $hgUW1$flexRender)(header.column.columnDef.header, header.getContext())
1645
1646
  }),
1646
1647
  sortElement && /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
@@ -3011,8 +3012,72 @@ const $6765a74df807d015$var$DataDictionaryTable = ({ tableColumns: tableColumns,
3011
3012
  columnFilters: columnFilters
3012
3013
  }
3013
3014
  });
3015
+ const sortOptions = [
3016
+ {
3017
+ value: "default",
3018
+ label: "No Sort"
3019
+ },
3020
+ {
3021
+ value: "titleasc",
3022
+ label: "Title A-Z"
3023
+ },
3024
+ {
3025
+ value: "titledesc",
3026
+ label: "Title Z-A"
3027
+ },
3028
+ {
3029
+ value: "typeasc",
3030
+ label: "Type A-Z"
3031
+ },
3032
+ {
3033
+ value: "typedesc",
3034
+ label: "Type Z-A"
3035
+ }
3036
+ ];
3037
+ const sortStatesLookup = {
3038
+ default: [],
3039
+ titleasc: [
3040
+ {
3041
+ id: "titleResizable",
3042
+ desc: false
3043
+ }
3044
+ ],
3045
+ titledesc: [
3046
+ {
3047
+ id: "titleResizable",
3048
+ desc: true
3049
+ }
3050
+ ],
3051
+ typeasc: [
3052
+ {
3053
+ id: "type",
3054
+ desc: false
3055
+ }
3056
+ ],
3057
+ typedesc: [
3058
+ {
3059
+ id: "type",
3060
+ desc: true
3061
+ }
3062
+ ]
3063
+ };
3014
3064
  return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3015
3065
  children: [
3066
+ mobile && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3067
+ className: "ds-u-margin-bottom--3 ds-l-col--12 ds-l-sm-col--6",
3068
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
3069
+ labelClassName: "ds-u-margin-top--1 ds-u-sm-margin-top--0",
3070
+ options: sortOptions,
3071
+ label: "Sort",
3072
+ value: Object.keys(sortStatesLookup).find((key)=>{
3073
+ return JSON.stringify(sortStatesLookup[key]) == JSON.stringify(sorting);
3074
+ }),
3075
+ name: "dc-data-dictionary-type",
3076
+ onChange: (e)=>{
3077
+ setSorting(sortStatesLookup[e.target.value]);
3078
+ }
3079
+ })
3080
+ }),
3016
3081
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3017
3082
  className: "dc-c-datadictionary-table",
3018
3083
  children: [
@@ -3234,14 +3299,16 @@ const $a6e312940f7003ef$var$DatasetDictionaryTable = ({ datasetDictionary: datas
3234
3299
  name: "dc-data-dictionary-title",
3235
3300
  onChange: (e)=>setTitleFilter(e.target.value)
3236
3301
  }),
3237
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
3302
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3238
3303
  className: "ds-l-col--12 ds-l-sm-col--6",
3239
- labelClassName: "ds-u-margin-top--1 ds-u-sm-margin-top--0",
3240
- options: typeOptions,
3241
- label: "Type",
3242
- value: typeFilter,
3243
- name: "dc-data-dictionary-type",
3244
- onChange: (e)=>setTypeFilter(e.target.value)
3304
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
3305
+ labelClassName: "ds-u-margin-top--1 ds-u-sm-margin-top--0",
3306
+ options: typeOptions,
3307
+ label: "Type",
3308
+ value: typeFilter,
3309
+ name: "dc-data-dictionary-type",
3310
+ onChange: (e)=>setTypeFilter(e.target.value)
3311
+ })
3245
3312
  }),
3246
3313
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3247
3314
  className: "ds-u-float--right ds-u-padding-y--2 ds-l-col--12 ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end",