@neo4j-ndl/react 5.4.2 → 5.4.4
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/lib/cjs/button/ButtonBase.js +2 -2
- package/lib/cjs/button/ButtonBase.js.map +1 -1
- package/lib/cjs/button/stories/button-leading-icon.story.js +1 -1
- package/lib/cjs/button/stories/button-leading-icon.story.js.map +1 -1
- package/lib/cjs/button/stories/button-trailing-icon.story.js +31 -0
- package/lib/cjs/button/stories/button-trailing-icon.story.js.map +1 -0
- package/lib/cjs/button/stories/index.js +5 -1
- package/lib/cjs/button/stories/index.js.map +1 -1
- package/lib/cjs/data-grid/stories/datagrid-pinned-columns.stories.js +0 -1
- package/lib/cjs/data-grid/stories/datagrid-pinned-columns.stories.js.map +1 -1
- package/lib/cjs/data-grid/stories/datagrid-search-and-filters.stories.js +0 -1
- package/lib/cjs/data-grid/stories/datagrid-search-and-filters.stories.js.map +1 -1
- package/lib/cjs/select/stories/select-async.story.js +1 -3
- package/lib/cjs/select/stories/select-async.story.js.map +1 -1
- package/lib/cjs/select/stories/select-clean.story.js +1 -3
- package/lib/cjs/select/stories/select-clean.story.js.map +1 -1
- package/lib/cjs/select/stories/select-controlled.story.js +1 -3
- package/lib/cjs/select/stories/select-controlled.story.js.map +1 -1
- package/lib/cjs/select/stories/select-creatable.story.js +1 -3
- package/lib/cjs/select/stories/select-creatable.story.js.map +1 -1
- package/lib/cjs/select/stories/select-custom-label.story.js +1 -3
- package/lib/cjs/select/stories/select-custom-label.story.js.map +1 -1
- package/lib/cjs/select/stories/select-default.story.js +1 -3
- package/lib/cjs/select/stories/select-default.story.js.map +1 -1
- package/lib/cjs/select/stories/select-disabled.story.js +1 -3
- package/lib/cjs/select/stories/select-disabled.story.js.map +1 -1
- package/lib/cjs/select/stories/select-empty.story.js +1 -3
- package/lib/cjs/select/stories/select-empty.story.js.map +1 -1
- package/lib/cjs/select/stories/select-error-state.story.js +1 -3
- package/lib/cjs/select/stories/select-error-state.story.js.map +1 -1
- package/lib/cjs/select/stories/select-inside-dialog.story.js +1 -3
- package/lib/cjs/select/stories/select-inside-dialog.story.js.map +1 -1
- package/lib/cjs/select/stories/select-menu-positionings.story.js +1 -5
- package/lib/cjs/select/stories/select-menu-positionings.story.js.map +1 -1
- package/lib/cjs/select/stories/select-multi.story.js +1 -3
- package/lib/cjs/select/stories/select-multi.story.js.map +1 -1
- package/lib/cjs/select/stories/select-sizes.story.js +1 -5
- package/lib/cjs/select/stories/select-sizes.story.js.map +1 -1
- package/lib/cjs/spotlight/stories/spotlight-fixed-positioning.story.js +2 -9
- package/lib/cjs/spotlight/stories/spotlight-fixed-positioning.story.js.map +1 -1
- package/lib/cjs/spotlight/stories/spotlight-in-dialog.story.js +3 -9
- package/lib/cjs/spotlight/stories/spotlight-in-dialog.story.js.map +1 -1
- package/lib/cjs/spotlight/stories/spotlight-in-side-nav.story.js +2 -8
- package/lib/cjs/spotlight/stories/spotlight-in-side-nav.story.js.map +1 -1
- package/lib/cjs/spotlight/stories/spotlight-with-icon.story.js +2 -9
- package/lib/cjs/spotlight/stories/spotlight-with-icon.story.js.map +1 -1
- package/lib/cjs/spotlight/stories/spotlight-with-image.story.js +2 -9
- package/lib/cjs/spotlight/stories/spotlight-with-image.story.js.map +1 -1
- package/lib/cjs/spotlight/stories/spotlight-with-label.story.js +2 -9
- package/lib/cjs/spotlight/stories/spotlight-with-label.story.js.map +1 -1
- package/lib/cjs/spotlight/stories/spotlight-with-pointer.story.js +2 -9
- package/lib/cjs/spotlight/stories/spotlight-with-pointer.story.js.map +1 -1
- package/lib/cjs/timezone-picker/TimeZonePicker.js +6 -5
- package/lib/cjs/timezone-picker/TimeZonePicker.js.map +1 -1
- package/lib/esm/button/ButtonBase.js +2 -2
- package/lib/esm/button/ButtonBase.js.map +1 -1
- package/lib/esm/button/stories/button-leading-icon.story.js +2 -2
- package/lib/esm/button/stories/button-leading-icon.story.js.map +1 -1
- package/lib/esm/button/stories/button-trailing-icon.story.js +29 -0
- package/lib/esm/button/stories/button-trailing-icon.story.js.map +1 -0
- package/lib/esm/button/stories/index.js +3 -0
- package/lib/esm/button/stories/index.js.map +1 -1
- package/lib/esm/data-grid/stories/datagrid-pinned-columns.stories.js +0 -1
- package/lib/esm/data-grid/stories/datagrid-pinned-columns.stories.js.map +1 -1
- package/lib/esm/data-grid/stories/datagrid-search-and-filters.stories.js +0 -1
- package/lib/esm/data-grid/stories/datagrid-search-and-filters.stories.js.map +1 -1
- package/lib/esm/select/stories/select-async.story.js +1 -3
- package/lib/esm/select/stories/select-async.story.js.map +1 -1
- package/lib/esm/select/stories/select-clean.story.js +1 -3
- package/lib/esm/select/stories/select-clean.story.js.map +1 -1
- package/lib/esm/select/stories/select-controlled.story.js +1 -3
- package/lib/esm/select/stories/select-controlled.story.js.map +1 -1
- package/lib/esm/select/stories/select-creatable.story.js +1 -3
- package/lib/esm/select/stories/select-creatable.story.js.map +1 -1
- package/lib/esm/select/stories/select-custom-label.story.js +1 -3
- package/lib/esm/select/stories/select-custom-label.story.js.map +1 -1
- package/lib/esm/select/stories/select-default.story.js +1 -3
- package/lib/esm/select/stories/select-default.story.js.map +1 -1
- package/lib/esm/select/stories/select-disabled.story.js +1 -3
- package/lib/esm/select/stories/select-disabled.story.js.map +1 -1
- package/lib/esm/select/stories/select-empty.story.js +1 -3
- package/lib/esm/select/stories/select-empty.story.js.map +1 -1
- package/lib/esm/select/stories/select-error-state.story.js +1 -3
- package/lib/esm/select/stories/select-error-state.story.js.map +1 -1
- package/lib/esm/select/stories/select-inside-dialog.story.js +1 -3
- package/lib/esm/select/stories/select-inside-dialog.story.js.map +1 -1
- package/lib/esm/select/stories/select-menu-positionings.story.js +1 -5
- package/lib/esm/select/stories/select-menu-positionings.story.js.map +1 -1
- package/lib/esm/select/stories/select-multi.story.js +1 -3
- package/lib/esm/select/stories/select-multi.story.js.map +1 -1
- package/lib/esm/select/stories/select-sizes.story.js +1 -5
- package/lib/esm/select/stories/select-sizes.story.js.map +1 -1
- package/lib/esm/spotlight/stories/spotlight-fixed-positioning.story.js +2 -9
- package/lib/esm/spotlight/stories/spotlight-fixed-positioning.story.js.map +1 -1
- package/lib/esm/spotlight/stories/spotlight-in-dialog.story.js +4 -10
- package/lib/esm/spotlight/stories/spotlight-in-dialog.story.js.map +1 -1
- package/lib/esm/spotlight/stories/spotlight-in-side-nav.story.js +3 -9
- package/lib/esm/spotlight/stories/spotlight-in-side-nav.story.js.map +1 -1
- package/lib/esm/spotlight/stories/spotlight-with-icon.story.js +2 -9
- package/lib/esm/spotlight/stories/spotlight-with-icon.story.js.map +1 -1
- package/lib/esm/spotlight/stories/spotlight-with-image.story.js +2 -9
- package/lib/esm/spotlight/stories/spotlight-with-image.story.js.map +1 -1
- package/lib/esm/spotlight/stories/spotlight-with-label.story.js +2 -9
- package/lib/esm/spotlight/stories/spotlight-with-label.story.js.map +1 -1
- package/lib/esm/spotlight/stories/spotlight-with-pointer.story.js +2 -9
- package/lib/esm/spotlight/stories/spotlight-with-pointer.story.js.map +1 -1
- package/lib/esm/timezone-picker/TimeZonePicker.js +6 -5
- package/lib/esm/timezone-picker/TimeZonePicker.js.map +1 -1
- package/lib/types/button/ButtonBase.d.ts +3 -1
- package/lib/types/button/ButtonBase.d.ts.map +1 -1
- package/lib/types/button/stories/button-trailing-icon.story.d.ts +24 -0
- package/lib/types/button/stories/button-trailing-icon.story.d.ts.map +1 -0
- package/lib/types/button/stories/index.d.ts +2 -0
- package/lib/types/button/stories/index.d.ts.map +1 -1
- package/lib/types/data-grid/stories/datagrid-pinned-columns.stories.d.ts +0 -3
- package/lib/types/data-grid/stories/datagrid-pinned-columns.stories.d.ts.map +1 -1
- package/lib/types/data-grid/stories/datagrid-search-and-filters.stories.d.ts +0 -3
- package/lib/types/data-grid/stories/datagrid-search-and-filters.stories.d.ts.map +1 -1
- package/lib/types/select/stories/select-async.story.d.ts +1 -2
- package/lib/types/select/stories/select-async.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-clean.story.d.ts +1 -2
- package/lib/types/select/stories/select-clean.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-controlled.story.d.ts +2 -2
- package/lib/types/select/stories/select-controlled.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-creatable.story.d.ts +1 -2
- package/lib/types/select/stories/select-creatable.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-custom-label.story.d.ts +1 -2
- package/lib/types/select/stories/select-custom-label.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-default.story.d.ts +1 -2
- package/lib/types/select/stories/select-default.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-disabled.story.d.ts +1 -2
- package/lib/types/select/stories/select-disabled.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-empty.story.d.ts +1 -2
- package/lib/types/select/stories/select-empty.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-error-state.story.d.ts +1 -2
- package/lib/types/select/stories/select-error-state.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-inside-dialog.story.d.ts +1 -2
- package/lib/types/select/stories/select-inside-dialog.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-menu-positionings.story.d.ts +1 -2
- package/lib/types/select/stories/select-menu-positionings.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-multi.story.d.ts +1 -2
- package/lib/types/select/stories/select-multi.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-sizes.story.d.ts +1 -2
- package/lib/types/select/stories/select-sizes.story.d.ts.map +1 -1
- package/lib/types/spotlight/stories/spotlight-fixed-positioning.story.d.ts +1 -3
- package/lib/types/spotlight/stories/spotlight-fixed-positioning.story.d.ts.map +1 -1
- package/lib/types/spotlight/stories/spotlight-in-dialog.story.d.ts +1 -3
- package/lib/types/spotlight/stories/spotlight-in-dialog.story.d.ts.map +1 -1
- package/lib/types/spotlight/stories/spotlight-in-side-nav.story.d.ts +1 -3
- package/lib/types/spotlight/stories/spotlight-in-side-nav.story.d.ts.map +1 -1
- package/lib/types/spotlight/stories/spotlight-with-icon.story.d.ts +1 -3
- package/lib/types/spotlight/stories/spotlight-with-icon.story.d.ts.map +1 -1
- package/lib/types/spotlight/stories/spotlight-with-image.story.d.ts +1 -3
- package/lib/types/spotlight/stories/spotlight-with-image.story.d.ts.map +1 -1
- package/lib/types/spotlight/stories/spotlight-with-label.story.d.ts +1 -3
- package/lib/types/spotlight/stories/spotlight-with-label.story.d.ts.map +1 -1
- package/lib/types/spotlight/stories/spotlight-with-pointer.story.d.ts +1 -3
- package/lib/types/spotlight/stories/spotlight-with-pointer.story.d.ts.map +1 -1
- package/lib/types/timezone-picker/TimeZonePicker.d.ts.map +1 -1
- package/package.json +1 -2
- package/skills/ndl-react/SKILL.md +2 -2
- package/skills/ndl-react/components/filled-button.md +1 -0
- package/skills/ndl-react/components/outlined-button.md +1 -0
- package/skills/ndl-react/components/select.md +13 -30
- package/skills/ndl-react/components/spotlight.md +11 -75
- package/skills/ndl-react/components/text-button.md +1 -0
|
@@ -144,11 +144,9 @@ const TimeZonePicker = (_a) => {
|
|
|
144
144
|
}
|
|
145
145
|
else {
|
|
146
146
|
setTimeout(() => {
|
|
147
|
-
var _a
|
|
148
|
-
(_a =
|
|
149
|
-
const selectedIndex = (_b = filteredOptions.findIndex((opt) => opt.value === value)) !== null && _b !== void 0 ? _b : 0;
|
|
147
|
+
var _a;
|
|
148
|
+
const selectedIndex = (_a = filteredOptions.findIndex((opt) => opt.value === value)) !== null && _a !== void 0 ? _a : 0;
|
|
150
149
|
setFocusedIndex(selectedIndex >= 0 ? selectedIndex : 0);
|
|
151
|
-
setSearchQuery('');
|
|
152
150
|
}, 0);
|
|
153
151
|
}
|
|
154
152
|
}, [focusedIndex, isPopoverOpen, value, setFocusedIndex, filteredOptions]);
|
|
@@ -284,8 +282,11 @@ const TimeZonePicker = (_a) => {
|
|
|
284
282
|
if (((_a = event.relatedTarget) === null || _a === void 0 ? void 0 : _a.classList.contains('ndl-timezone-picker-popover-item')) === true) {
|
|
285
283
|
return;
|
|
286
284
|
}
|
|
287
|
-
// In UTC mode (utc or both), try to parse custom input on blur
|
|
285
|
+
// In UTC mode (utc or both), try to parse custom input on blur.
|
|
286
|
+
// An empty search query means nothing was typed since the last
|
|
287
|
+
// commit, e.g. the blur that follows selecting with Enter.
|
|
288
288
|
if ((mode === 'utc' || mode === 'both') &&
|
|
289
|
+
searchQuery !== '' &&
|
|
289
290
|
inputValue.trim().toUpperCase().startsWith('UTC')) {
|
|
290
291
|
const parsedOffset = (0, generate_timezone_options_1.parseCustomUTCOffset)(inputValue.trim());
|
|
291
292
|
if (parsedOffset) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeZonePicker.js","sourceRoot":"","sources":["../../../src/timezone-picker/TimeZonePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8CAc4B;AAC5B,yDAA8D;AAC9D,0CAAyC;AACzC,4DAAoC;AAEpC,iCAOe;AAEf,0DAIiC;AAEjC,0DAAsD;AACtD,6DAA6D;AAC7D,oCAA0C;AAC1C,2EAMqC;AACrC,mEAGiC;AAiD1B,MAAM,cAAc,GAAG,CAAC,EAqBa,EAAE,EAAE;;QArBjB,EAC7B,UAAU,EACV,OAAO,EACP,UAAU,EACV,UAAU,EACV,KAAK,EACL,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,EACL,IAAI,GAAG,QAAQ,EACf,QAAQ,EACR,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,UAAU,EAAE,cAAc,EAC1B,aAAa,EACb,IAAI,GAAG,MAAM,EACb,GAAG,OAEuC,EADvC,SAAS,cApBiB,yOAqB9B,CADa;IAEZ,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAC1C,KAAK;QACH,CAAC,CAAC,IAAA,0CAAc,EAAC,KAAK,EAAE,aAAa,CAAC;QACtC,CAAC,CAAC,IAAA,0CAAc,EACZ,IAAI,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,CACJ,GACE,IACD,GACe,GACP,CACnB,IACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAtiBW,QAAA,cAAc,kBAsiBzB","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n autoUpdate,\n type Boundary,\n flip,\n FloatingFocusManager,\n FloatingPortal,\n offset,\n shift,\n size as sizeMiddleware,\n useDismiss,\n useFloating,\n useInteractions,\n useMergeRefs,\n useTransitionStyles,\n} from '@floating-ui/react';\nimport { ChevronDownIcon } from '@heroicons/react/24/outline';\nimport { tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport {\n FormFieldLabel,\n FormFieldMessage,\n useFormField,\n} from '../_common/form-control';\nimport { type CommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { useNeedleTheme } from '../theme';\nimport {\n formatTimeZone,\n generateTimeZoneOptions,\n generateUTCTimeZoneOptions,\n isValidUTCFormat,\n parseCustomUTCOffset,\n} from './generate-timezone-options';\nimport {\n useKeyboardNavigation,\n useTimeZonePickerPopover,\n} from './timezone-picker-hooks';\n\nexport type TimeZonePickerProps = {\n /** The value of the timezone picker (IANA timezone identifier) */\n value?: string;\n /** Whether the timezone picker is fluid */\n isFluid?: boolean;\n /** Whether the timezone picker is read only */\n isReadOnly?: boolean;\n /** Whether the timezone picker is required */\n isRequired?: boolean;\n /** Whether the timezone picker is disabled */\n isDisabled?: boolean;\n /** The label of the timezone picker */\n label?: string;\n /** The size of the timezone picker */\n size?: 'small' | 'medium' | 'large';\n /** Assistive text displayed below the input. Replaced by `errorText` or an internal validation error while there is one */\n helpText?: React.ReactNode;\n /** Manually set the error text */\n errorText?: string;\n /** Callback function triggered when the timezone picker value changes */\n onChange?: (timezone: string) => void;\n /** Callback function triggered when the timezone picker encounters an error */\n onError?: (error: string, timezone: string) => void;\n /**\n * Strategy for the dropdown floating element.\n * By default it is absolute, but if the component is inside of a needle Dialog, it is set to fixed.\n * If this prop is set, no auto-detection of Dialog is done.\n */\n floatingStrategy?: 'absolute' | 'fixed';\n /** Whether the dropdown element is rendered in a portal. */\n isPortaled?: boolean;\n /** Reference date for calculating timezone offsets (useful for DST-aware offset display) */\n referenceDate?: Date;\n /**\n * Display mode: 'city', 'utc', or 'both'\n * 'city' - shows city-based timezones, This should be used when the user needs to select a timezone for themselves or if they are selecting a timezone that's related to a date.\n * 'utc' - shows UTC timezones, This should be used when the user needs to select a timezone for a database entry or a technical application.\n * 'both' - shows both city-based and UTC timezones in separate sections, This should be used when the user needs to select a timezone for a database entry or a technical application, but also wants to see the city-based timezones for context for example a zoned date time.\n * @default 'city'\n * @example\n * <TimeZonePicker mode=\"city\" />\n * <TimeZonePicker mode=\"utc\" />\n * <TimeZonePicker mode=\"both\" />\n */\n mode?: 'city' | 'utc' | 'both';\n};\n\nexport const TimeZonePicker = ({\n isDisabled,\n isFluid,\n isReadOnly,\n isRequired,\n value,\n label,\n onChange,\n className,\n onError,\n style,\n size = 'medium',\n helpText,\n errorText,\n htmlAttributes,\n floatingStrategy,\n isPortaled: isPortaledProp,\n referenceDate,\n mode = 'city',\n ref,\n ...restProps\n}: CommonProps<'input', TimeZonePickerProps>) => {\n const [inputValue, setInputValue] = useState<string>(\n value\n ? formatTimeZone(value, referenceDate)\n : formatTimeZone(\n new Date().toISOString().split('T')[1].split('.')[0],\n referenceDate,\n ),\n );\n const [searchQuery, setSearchQuery] = useState<string>('');\n const listRef = useRef<HTMLUListElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => inputRef.current as HTMLInputElement, []);\n const [error, setError] = useState<string | undefined>(undefined);\n const listboxId = useId();\n\n const timezoneOptions = useMemo(() => {\n if (mode === 'utc') {\n return generateUTCTimeZoneOptions(referenceDate);\n } else if (mode === 'city') {\n return generateTimeZoneOptions(referenceDate);\n } else {\n // 'both' mode - combine both lists, excluding UTC from city list to avoid duplication\n return [\n ...generateUTCTimeZoneOptions(referenceDate),\n ...generateTimeZoneOptions(referenceDate, true), // excludeUTC = true\n ];\n }\n }, [referenceDate, mode]);\n\n const { themeClassName } = useNeedleTheme();\n const { isPopoverOpen, setIsPopoverOpen } = useTimeZonePickerPopover(false);\n\n // Filter options based on search query\n const filteredOptions = useMemo(() => {\n if (!searchQuery) {\n return timezoneOptions;\n }\n\n const query = searchQuery.toLowerCase();\n return timezoneOptions.filter(\n (option) =>\n option.label.toLowerCase().includes(query) ||\n option.value.toLowerCase().includes(query),\n );\n }, [timezoneOptions, searchQuery]);\n\n // Split options into UTC and city-based sections for 'both' mode\n const { utcOptions, cityOptions } = useMemo(() => {\n if (mode !== 'both') {\n return { cityOptions: filteredOptions, utcOptions: [] };\n }\n\n const utc: typeof filteredOptions = [];\n const city: typeof filteredOptions = [];\n\n filteredOptions.forEach((option) => {\n // UTC options are those that start with \"UTC\" in their value or label\n if (\n option.value.toUpperCase().startsWith('UTC') ||\n option.label.toUpperCase().startsWith('UTC')\n ) {\n utc.push(option);\n } else {\n city.push(option);\n }\n });\n\n return { cityOptions: city, utcOptions: utc };\n }, [filteredOptions, mode]);\n\n const { focusedIndex, setFocusedIndex, handleArrowNavigation } =\n useKeyboardNavigation(filteredOptions.length);\n\n const errorToShow =\n errorText !== undefined && errorText !== '' ? errorText : error;\n // The shared form field resolves the ids and which message is displayed -\n // an error, set manually or by internal validation, replaces the help text.\n const { field, controlProps } = useFormField({\n errorText: errorToShow,\n helpText,\n isRequired,\n label,\n });\n\n const classes = {\n 'ndl-disabled': isDisabled,\n 'ndl-error': errorToShow !== undefined,\n 'ndl-fluid': isFluid,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-read-only': isReadOnly,\n 'ndl-small': size === 'small',\n };\n\n const inputWidth = isFluid === true ? '100%' : '16rem';\n\n useEffect(() => {\n if (error !== undefined) {\n onError?.(error, inputValue);\n }\n }, [error, inputValue, onError]);\n\n useEffect(() => {\n setInputValue(value ? formatTimeZone(value, referenceDate) : '');\n }, [value, referenceDate]);\n\n useEffect(() => {\n if (isPopoverOpen) {\n setTimeout(() => {\n listRef.current?.children[focusedIndex]?.scrollIntoView({\n block: 'center',\n inline: 'nearest',\n });\n }, 0);\n } else {\n setTimeout(() => {\n inputRef.current?.blur();\n const selectedIndex =\n filteredOptions.findIndex((opt) => opt.value === value) ?? 0;\n setFocusedIndex(selectedIndex >= 0 ? selectedIndex : 0);\n setSearchQuery('');\n }, 0);\n }\n }, [focusedIndex, isPopoverOpen, value, setFocusedIndex, filteredOptions]);\n\n const handleOnClick = (timezone: string) => {\n if (onChange) {\n onChange(timezone);\n }\n setError(undefined);\n setInputValue(formatTimeZone(timezone, referenceDate));\n setIsPopoverOpen(false);\n setSearchQuery('');\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const query = event.target.value;\n setSearchQuery(query);\n setInputValue(query);\n\n // In UTC mode (utc or both), validate custom UTC input\n if (\n (mode === 'utc' || mode === 'both') &&\n query.trim().toUpperCase().startsWith('UTC')\n ) {\n if (isValidUTCFormat(query.trim())) {\n setError(undefined);\n } else {\n setError('Invalid UTC format. Use UTC+H:MM or UTC-H:MM');\n }\n return;\n }\n\n // Try to find a matching timezone\n const matchingOption = timezoneOptions.find(\n (opt) =>\n opt.label.toLowerCase().includes(query.toLowerCase()) ||\n opt.value.toLowerCase().includes(query.toLowerCase()),\n );\n\n if (matchingOption) {\n setError(undefined);\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (isReadOnly === true || isDisabled === true) {\n event.preventDefault();\n return;\n }\n\n if (event.key === 'Escape') {\n setIsPopoverOpen(false);\n setSearchQuery('');\n setInputValue(value ? formatTimeZone(value, referenceDate) : '');\n }\n\n setIsPopoverOpen(true);\n\n if (event.key === 'Enter') {\n // In UTC mode (utc or both), allow custom UTC input\n if (\n (mode === 'utc' || mode === 'both') &&\n inputValue.trim().toUpperCase().startsWith('UTC')\n ) {\n const parsedOffset = parseCustomUTCOffset(inputValue.trim());\n if (parsedOffset) {\n handleOnClick(parsedOffset);\n return;\n }\n }\n\n if (filteredOptions.length > 0) {\n const selectedOption = filteredOptions[focusedIndex];\n if (selectedOption) {\n handleOnClick(selectedOption.value);\n }\n }\n } else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n handleArrowNavigation(event.key);\n }\n };\n\n /** Custom floating ui solution */\n const isInsideDialog = useIsInsideDialog();\n const isPortaled = isPortaledProp ?? !isInsideDialog;\n // Inside a Dialog the popover is fixed and not portaled. A transformed\n // ancestor (e.g. Popover) can make Floating UI under-measure available\n // space, so use the viewport as the boundary instead.\n const floatingBoundary: Boundary = isInsideDialog ? [] : 'clippingAncestors';\n const containerRef = useRef<HTMLDivElement>(null);\n const { refs, floatingStyles, context } = useFloating({\n elements: {\n reference: containerRef.current,\n },\n middleware: [\n offset(10),\n flip({\n fallbackPlacements: ['top'],\n fallbackStrategy: 'bestFit',\n }),\n shift({ boundary: floatingBoundary, padding: 5 }),\n sizeMiddleware({\n apply({ availableHeight, elements }) {\n Object.assign(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n });\n },\n boundary: floatingBoundary,\n padding: 5,\n }),\n ],\n onOpenChange: (open) => {\n setIsPopoverOpen(open);\n },\n open: isDisabled !== true && isReadOnly !== true && isPopoverOpen,\n placement: 'bottom',\n strategy: floatingStrategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n const dismiss = useDismiss(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([dismiss]);\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n });\n\n const mergedRef = useMergeRefs([refs.setReference, containerRef]);\n\n return (\n <>\n <div\n className={classNames('ndl-timezone-picker', className, {\n ...classes,\n })}\n ref={mergedRef}\n {...getReferenceProps()}\n style={{\n width: isFluid === true ? '100%' : 'fit-content',\n }}\n >\n <label className=\"ndl-timezone-picker-label\">\n {label !== undefined && (\n <FormFieldLabel field={field} size={size} association=\"implicit\" />\n )}\n <div\n className=\"ndl-timezone-picker-input-wrapper\"\n style={{\n width: inputWidth,\n ...style,\n }}\n >\n <input\n role=\"combobox\"\n aria-expanded={isPopoverOpen}\n aria-controls={listboxId}\n aria-activedescendant={\n isPopoverOpen && focusedIndex >= 0\n ? `${listboxId}-option-${focusedIndex}`\n : undefined\n }\n aria-label={label}\n {...controlProps}\n className=\"ndl-timezone-picker-input\"\n type=\"text\"\n ref={inputRef}\n value={inputValue}\n disabled={isDisabled}\n readOnly={isReadOnly}\n required={isRequired}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onClick={(event) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n setIsPopoverOpen(true);\n // Select all text on click for easy searching\n event.currentTarget.select();\n }}\n onFocus={(event) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n // Select all text on focus for easy searching\n event.currentTarget.select();\n }}\n onBlur={(event) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n\n if (\n event.relatedTarget?.classList.contains(\n 'ndl-timezone-picker-popover-item',\n ) === true\n ) {\n return;\n }\n\n // In UTC mode (utc or both), try to parse custom input on blur\n if (\n (mode === 'utc' || mode === 'both') &&\n inputValue.trim().toUpperCase().startsWith('UTC')\n ) {\n const parsedOffset = parseCustomUTCOffset(inputValue.trim());\n if (parsedOffset) {\n handleOnClick(parsedOffset);\n setError(undefined);\n return;\n }\n }\n\n // Reset to the current value if no valid selection was made\n if (value) {\n setInputValue(formatTimeZone(value, referenceDate));\n } else {\n setInputValue('');\n }\n setSearchQuery('');\n setError(undefined);\n }}\n placeholder={\n mode === 'city'\n ? 'Select timezone'\n : mode === 'utc'\n ? 'Select or type UTC offset (e.g., UTC+5:30)'\n : 'Select timezone or type UTC offset'\n }\n {...htmlAttributes}\n {...restProps}\n />\n <ChevronDownIcon className=\"ndl-icon-svg ndl-timezone-picker-icon\" />\n </div>\n </label>\n <FormFieldMessage field={field} size={size} />\n </div>\n\n {context.open && (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal>{wrapChildren}</FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={-1}\n >\n <div\n ref={refs.setFloating}\n className={classNames(\n themeClassName,\n 'ndl-timezone-picker-popover',\n {\n ...classes,\n },\n )}\n style={{\n ...transitionStyles,\n ...floatingStyles,\n width:\n isFluid === true\n ? containerRef.current?.clientWidth\n : undefined,\n }}\n {...getFloatingProps()}\n >\n <ul ref={listRef} role=\"listbox\" id={listboxId} tabIndex={-1}>\n {mode === 'both' ? (\n <>\n {utcOptions.length > 0 && (\n <>\n <li className=\"ndl-timezone-picker-section-header\">\n UTC Offsets\n </li>\n {utcOptions.map((option, index) => (\n <li\n id={`${listboxId}-option-${index}`}\n key={option.value}\n role=\"option\"\n aria-selected={value === option.value}\n value={option.value}\n onClick={(event) => {\n event.stopPropagation();\n event.preventDefault();\n handleOnClick(option.value);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(event) => {\n event.stopPropagation();\n event.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === index ? 'focused' : '',\n 'ndl-timezone-picker-popover-item',\n )}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.stopPropagation();\n handleOnClick(option.value);\n }\n }}\n >\n {option.label}\n </li>\n ))}\n </>\n )}\n {cityOptions.length > 0 && (\n <>\n <li className=\"ndl-timezone-picker-section-header\">\n City-Based Timezones\n </li>\n {cityOptions.map((option, index) => {\n const adjustedIndex = index + utcOptions.length;\n return (\n <li\n id={`${listboxId}-option-${adjustedIndex}`}\n key={option.value}\n role=\"option\"\n aria-selected={value === option.value}\n value={option.value}\n onClick={(event) => {\n event.stopPropagation();\n event.preventDefault();\n handleOnClick(option.value);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(event) => {\n event.stopPropagation();\n event.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === adjustedIndex ? 'focused' : '',\n 'ndl-timezone-picker-popover-item',\n )}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.stopPropagation();\n handleOnClick(option.value);\n }\n }}\n >\n {option.label}\n </li>\n );\n })}\n </>\n )}\n {utcOptions.length === 0 && cityOptions.length === 0 && (\n <li className=\"ndl-timezone-picker-popover-item ndl-timezone-picker-no-results\">\n No timezones found\n </li>\n )}\n </>\n ) : (\n <>\n {filteredOptions.length > 0 ? (\n filteredOptions.map((option, index) => (\n <li\n id={`${listboxId}-option-${index}`}\n key={option.value}\n role=\"option\"\n aria-selected={value === option.value}\n value={option.value}\n onClick={(event) => {\n event.stopPropagation();\n event.preventDefault();\n handleOnClick(option.value);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(event) => {\n event.stopPropagation();\n event.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === index ? 'focused' : '',\n 'ndl-timezone-picker-popover-item',\n )}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.stopPropagation();\n handleOnClick(option.value);\n }\n }}\n >\n {option.label}\n </li>\n ))\n ) : (\n <li className=\"ndl-timezone-picker-popover-item ndl-timezone-picker-no-results\">\n No timezones found\n </li>\n )}\n </>\n )}\n </ul>\n </div>\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"TimeZonePicker.js","sourceRoot":"","sources":["../../../src/timezone-picker/TimeZonePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8CAc4B;AAC5B,yDAA8D;AAC9D,0CAAyC;AACzC,4DAAoC;AAEpC,iCAOe;AAEf,0DAIiC;AAEjC,0DAAsD;AACtD,6DAA6D;AAC7D,oCAA0C;AAC1C,2EAMqC;AACrC,mEAGiC;AAiD1B,MAAM,cAAc,GAAG,CAAC,EAqBa,EAAE,EAAE;;QArBjB,EAC7B,UAAU,EACV,OAAO,EACP,UAAU,EACV,UAAU,EACV,KAAK,EACL,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,EACL,IAAI,GAAG,QAAQ,EACf,QAAQ,EACR,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,UAAU,EAAE,cAAc,EAC1B,aAAa,EACb,IAAI,GAAG,MAAM,EACb,GAAG,OAEuC,EADvC,SAAS,cApBiB,yOAqB9B,CADa;IAEZ,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAC1C,KAAK;QACH,CAAC,CAAC,IAAA,0CAAc,EAAC,KAAK,EAAE,aAAa,CAAC;QACtC,CAAC,CAAC,IAAA,0CAAc,EACZ,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EACpD,aAAa,CACd,CACN,CAAC;IACF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAS,EAAE,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,IAAA,cAAM,EAAmB,IAAI,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,IAAA,cA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AK,EACnB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;wCACjB,KAAK,CAAC,eAAe,EAAE,CAAC;wCACxB,KAAK,CAAC,cAAc,EAAE,CAAC;wCACvB,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;wCAC5B,gBAAgB,CAAC,KAAK,CAAC,CAAC;oCAC1B,CAAC,EACD,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE;wCACrB,KAAK,CAAC,eAAe,EAAE,CAAC;wCACxB,KAAK,CAAC,cAAc,EAAE,CAAC;oCACzB,CAAC,EACD,QAAQ,EAAE,CAAC,CAAC,EACZ,SAAS,EAAE,IAAA,oBAAU,EACnB,YAAY,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EACvC,kCAAkC,CACnC,EACD,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;wCACnB,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;4CAC1B,KAAK,CAAC,eAAe,EAAE,CAAC;4CACxB,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;wCAC9B,CAAC;oCACH,CAAC,YAEA,MAAM,CAAC,KAAK,IA1BR,MAAM,CAAC,KAAK,CA2Bd,CACN,CAAC,CACH,CAAC,CAAC,CAAC,CACF,+BAAI,SAAS,EAAC,iEAAiE,mCAE1E,CACN,GACA,CACJ,GACE,IACD,GACe,GACP,CACnB,IACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAviBW,QAAA,cAAc,kBAuiBzB","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n autoUpdate,\n type Boundary,\n flip,\n FloatingFocusManager,\n FloatingPortal,\n offset,\n shift,\n size as sizeMiddleware,\n useDismiss,\n useFloating,\n useInteractions,\n useMergeRefs,\n useTransitionStyles,\n} from '@floating-ui/react';\nimport { ChevronDownIcon } from '@heroicons/react/24/outline';\nimport { tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport {\n FormFieldLabel,\n FormFieldMessage,\n useFormField,\n} from '../_common/form-control';\nimport { type CommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { useNeedleTheme } from '../theme';\nimport {\n formatTimeZone,\n generateTimeZoneOptions,\n generateUTCTimeZoneOptions,\n isValidUTCFormat,\n parseCustomUTCOffset,\n} from './generate-timezone-options';\nimport {\n useKeyboardNavigation,\n useTimeZonePickerPopover,\n} from './timezone-picker-hooks';\n\nexport type TimeZonePickerProps = {\n /** The value of the timezone picker (IANA timezone identifier) */\n value?: string;\n /** Whether the timezone picker is fluid */\n isFluid?: boolean;\n /** Whether the timezone picker is read only */\n isReadOnly?: boolean;\n /** Whether the timezone picker is required */\n isRequired?: boolean;\n /** Whether the timezone picker is disabled */\n isDisabled?: boolean;\n /** The label of the timezone picker */\n label?: string;\n /** The size of the timezone picker */\n size?: 'small' | 'medium' | 'large';\n /** Assistive text displayed below the input. Replaced by `errorText` or an internal validation error while there is one */\n helpText?: React.ReactNode;\n /** Manually set the error text */\n errorText?: string;\n /** Callback function triggered when the timezone picker value changes */\n onChange?: (timezone: string) => void;\n /** Callback function triggered when the timezone picker encounters an error */\n onError?: (error: string, timezone: string) => void;\n /**\n * Strategy for the dropdown floating element.\n * By default it is absolute, but if the component is inside of a needle Dialog, it is set to fixed.\n * If this prop is set, no auto-detection of Dialog is done.\n */\n floatingStrategy?: 'absolute' | 'fixed';\n /** Whether the dropdown element is rendered in a portal. */\n isPortaled?: boolean;\n /** Reference date for calculating timezone offsets (useful for DST-aware offset display) */\n referenceDate?: Date;\n /**\n * Display mode: 'city', 'utc', or 'both'\n * 'city' - shows city-based timezones, This should be used when the user needs to select a timezone for themselves or if they are selecting a timezone that's related to a date.\n * 'utc' - shows UTC timezones, This should be used when the user needs to select a timezone for a database entry or a technical application.\n * 'both' - shows both city-based and UTC timezones in separate sections, This should be used when the user needs to select a timezone for a database entry or a technical application, but also wants to see the city-based timezones for context for example a zoned date time.\n * @default 'city'\n * @example\n * <TimeZonePicker mode=\"city\" />\n * <TimeZonePicker mode=\"utc\" />\n * <TimeZonePicker mode=\"both\" />\n */\n mode?: 'city' | 'utc' | 'both';\n};\n\nexport const TimeZonePicker = ({\n isDisabled,\n isFluid,\n isReadOnly,\n isRequired,\n value,\n label,\n onChange,\n className,\n onError,\n style,\n size = 'medium',\n helpText,\n errorText,\n htmlAttributes,\n floatingStrategy,\n isPortaled: isPortaledProp,\n referenceDate,\n mode = 'city',\n ref,\n ...restProps\n}: CommonProps<'input', TimeZonePickerProps>) => {\n const [inputValue, setInputValue] = useState<string>(\n value\n ? formatTimeZone(value, referenceDate)\n : formatTimeZone(\n new Date().toISOString().split('T')[1].split('.')[0],\n referenceDate,\n ),\n );\n const [searchQuery, setSearchQuery] = useState<string>('');\n const listRef = useRef<HTMLUListElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => inputRef.current as HTMLInputElement, []);\n const [error, setError] = useState<string | undefined>(undefined);\n const listboxId = useId();\n\n const timezoneOptions = useMemo(() => {\n if (mode === 'utc') {\n return generateUTCTimeZoneOptions(referenceDate);\n } else if (mode === 'city') {\n return generateTimeZoneOptions(referenceDate);\n } else {\n // 'both' mode - combine both lists, excluding UTC from city list to avoid duplication\n return [\n ...generateUTCTimeZoneOptions(referenceDate),\n ...generateTimeZoneOptions(referenceDate, true), // excludeUTC = true\n ];\n }\n }, [referenceDate, mode]);\n\n const { themeClassName } = useNeedleTheme();\n const { isPopoverOpen, setIsPopoverOpen } = useTimeZonePickerPopover(false);\n\n // Filter options based on search query\n const filteredOptions = useMemo(() => {\n if (!searchQuery) {\n return timezoneOptions;\n }\n\n const query = searchQuery.toLowerCase();\n return timezoneOptions.filter(\n (option) =>\n option.label.toLowerCase().includes(query) ||\n option.value.toLowerCase().includes(query),\n );\n }, [timezoneOptions, searchQuery]);\n\n // Split options into UTC and city-based sections for 'both' mode\n const { utcOptions, cityOptions } = useMemo(() => {\n if (mode !== 'both') {\n return { cityOptions: filteredOptions, utcOptions: [] };\n }\n\n const utc: typeof filteredOptions = [];\n const city: typeof filteredOptions = [];\n\n filteredOptions.forEach((option) => {\n // UTC options are those that start with \"UTC\" in their value or label\n if (\n option.value.toUpperCase().startsWith('UTC') ||\n option.label.toUpperCase().startsWith('UTC')\n ) {\n utc.push(option);\n } else {\n city.push(option);\n }\n });\n\n return { cityOptions: city, utcOptions: utc };\n }, [filteredOptions, mode]);\n\n const { focusedIndex, setFocusedIndex, handleArrowNavigation } =\n useKeyboardNavigation(filteredOptions.length);\n\n const errorToShow =\n errorText !== undefined && errorText !== '' ? errorText : error;\n // The shared form field resolves the ids and which message is displayed -\n // an error, set manually or by internal validation, replaces the help text.\n const { field, controlProps } = useFormField({\n errorText: errorToShow,\n helpText,\n isRequired,\n label,\n });\n\n const classes = {\n 'ndl-disabled': isDisabled,\n 'ndl-error': errorToShow !== undefined,\n 'ndl-fluid': isFluid,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-read-only': isReadOnly,\n 'ndl-small': size === 'small',\n };\n\n const inputWidth = isFluid === true ? '100%' : '16rem';\n\n useEffect(() => {\n if (error !== undefined) {\n onError?.(error, inputValue);\n }\n }, [error, inputValue, onError]);\n\n useEffect(() => {\n setInputValue(value ? formatTimeZone(value, referenceDate) : '');\n }, [value, referenceDate]);\n\n useEffect(() => {\n if (isPopoverOpen) {\n setTimeout(() => {\n listRef.current?.children[focusedIndex]?.scrollIntoView({\n block: 'center',\n inline: 'nearest',\n });\n }, 0);\n } else {\n setTimeout(() => {\n const selectedIndex =\n filteredOptions.findIndex((opt) => opt.value === value) ?? 0;\n setFocusedIndex(selectedIndex >= 0 ? selectedIndex : 0);\n }, 0);\n }\n }, [focusedIndex, isPopoverOpen, value, setFocusedIndex, filteredOptions]);\n\n const handleOnClick = (timezone: string) => {\n if (onChange) {\n onChange(timezone);\n }\n setError(undefined);\n setInputValue(formatTimeZone(timezone, referenceDate));\n setIsPopoverOpen(false);\n setSearchQuery('');\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const query = event.target.value;\n setSearchQuery(query);\n setInputValue(query);\n\n // In UTC mode (utc or both), validate custom UTC input\n if (\n (mode === 'utc' || mode === 'both') &&\n query.trim().toUpperCase().startsWith('UTC')\n ) {\n if (isValidUTCFormat(query.trim())) {\n setError(undefined);\n } else {\n setError('Invalid UTC format. Use UTC+H:MM or UTC-H:MM');\n }\n return;\n }\n\n // Try to find a matching timezone\n const matchingOption = timezoneOptions.find(\n (opt) =>\n opt.label.toLowerCase().includes(query.toLowerCase()) ||\n opt.value.toLowerCase().includes(query.toLowerCase()),\n );\n\n if (matchingOption) {\n setError(undefined);\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (isReadOnly === true || isDisabled === true) {\n event.preventDefault();\n return;\n }\n\n if (event.key === 'Escape') {\n setIsPopoverOpen(false);\n setSearchQuery('');\n setInputValue(value ? formatTimeZone(value, referenceDate) : '');\n }\n\n setIsPopoverOpen(true);\n\n if (event.key === 'Enter') {\n // In UTC mode (utc or both), allow custom UTC input\n if (\n (mode === 'utc' || mode === 'both') &&\n inputValue.trim().toUpperCase().startsWith('UTC')\n ) {\n const parsedOffset = parseCustomUTCOffset(inputValue.trim());\n if (parsedOffset) {\n handleOnClick(parsedOffset);\n return;\n }\n }\n\n if (filteredOptions.length > 0) {\n const selectedOption = filteredOptions[focusedIndex];\n if (selectedOption) {\n handleOnClick(selectedOption.value);\n }\n }\n } else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n handleArrowNavigation(event.key);\n }\n };\n\n /** Custom floating ui solution */\n const isInsideDialog = useIsInsideDialog();\n const isPortaled = isPortaledProp ?? !isInsideDialog;\n // Inside a Dialog the popover is fixed and not portaled. A transformed\n // ancestor (e.g. Popover) can make Floating UI under-measure available\n // space, so use the viewport as the boundary instead.\n const floatingBoundary: Boundary = isInsideDialog ? [] : 'clippingAncestors';\n const containerRef = useRef<HTMLDivElement>(null);\n const { refs, floatingStyles, context } = useFloating({\n elements: {\n reference: containerRef.current,\n },\n middleware: [\n offset(10),\n flip({\n fallbackPlacements: ['top'],\n fallbackStrategy: 'bestFit',\n }),\n shift({ boundary: floatingBoundary, padding: 5 }),\n sizeMiddleware({\n apply({ availableHeight, elements }) {\n Object.assign(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n });\n },\n boundary: floatingBoundary,\n padding: 5,\n }),\n ],\n onOpenChange: (open) => {\n setIsPopoverOpen(open);\n },\n open: isDisabled !== true && isReadOnly !== true && isPopoverOpen,\n placement: 'bottom',\n strategy: floatingStrategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n const dismiss = useDismiss(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([dismiss]);\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n });\n\n const mergedRef = useMergeRefs([refs.setReference, containerRef]);\n\n return (\n <>\n <div\n className={classNames('ndl-timezone-picker', className, {\n ...classes,\n })}\n ref={mergedRef}\n {...getReferenceProps()}\n style={{\n width: isFluid === true ? '100%' : 'fit-content',\n }}\n >\n <label className=\"ndl-timezone-picker-label\">\n {label !== undefined && (\n <FormFieldLabel field={field} size={size} association=\"implicit\" />\n )}\n <div\n className=\"ndl-timezone-picker-input-wrapper\"\n style={{\n width: inputWidth,\n ...style,\n }}\n >\n <input\n role=\"combobox\"\n aria-expanded={isPopoverOpen}\n aria-controls={listboxId}\n aria-activedescendant={\n isPopoverOpen && focusedIndex >= 0\n ? `${listboxId}-option-${focusedIndex}`\n : undefined\n }\n aria-label={label}\n {...controlProps}\n className=\"ndl-timezone-picker-input\"\n type=\"text\"\n ref={inputRef}\n value={inputValue}\n disabled={isDisabled}\n readOnly={isReadOnly}\n required={isRequired}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onClick={(event) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n setIsPopoverOpen(true);\n // Select all text on click for easy searching\n event.currentTarget.select();\n }}\n onFocus={(event) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n // Select all text on focus for easy searching\n event.currentTarget.select();\n }}\n onBlur={(event) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n\n if (\n event.relatedTarget?.classList.contains(\n 'ndl-timezone-picker-popover-item',\n ) === true\n ) {\n return;\n }\n\n // In UTC mode (utc or both), try to parse custom input on blur.\n // An empty search query means nothing was typed since the last\n // commit, e.g. the blur that follows selecting with Enter.\n if (\n (mode === 'utc' || mode === 'both') &&\n searchQuery !== '' &&\n inputValue.trim().toUpperCase().startsWith('UTC')\n ) {\n const parsedOffset = parseCustomUTCOffset(inputValue.trim());\n if (parsedOffset) {\n handleOnClick(parsedOffset);\n setError(undefined);\n return;\n }\n }\n\n // Reset to the current value if no valid selection was made\n if (value) {\n setInputValue(formatTimeZone(value, referenceDate));\n } else {\n setInputValue('');\n }\n setSearchQuery('');\n setError(undefined);\n }}\n placeholder={\n mode === 'city'\n ? 'Select timezone'\n : mode === 'utc'\n ? 'Select or type UTC offset (e.g., UTC+5:30)'\n : 'Select timezone or type UTC offset'\n }\n {...htmlAttributes}\n {...restProps}\n />\n <ChevronDownIcon className=\"ndl-icon-svg ndl-timezone-picker-icon\" />\n </div>\n </label>\n <FormFieldMessage field={field} size={size} />\n </div>\n\n {context.open && (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal>{wrapChildren}</FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={-1}\n >\n <div\n ref={refs.setFloating}\n className={classNames(\n themeClassName,\n 'ndl-timezone-picker-popover',\n {\n ...classes,\n },\n )}\n style={{\n ...transitionStyles,\n ...floatingStyles,\n width:\n isFluid === true\n ? containerRef.current?.clientWidth\n : undefined,\n }}\n {...getFloatingProps()}\n >\n <ul ref={listRef} role=\"listbox\" id={listboxId} tabIndex={-1}>\n {mode === 'both' ? (\n <>\n {utcOptions.length > 0 && (\n <>\n <li className=\"ndl-timezone-picker-section-header\">\n UTC Offsets\n </li>\n {utcOptions.map((option, index) => (\n <li\n id={`${listboxId}-option-${index}`}\n key={option.value}\n role=\"option\"\n aria-selected={value === option.value}\n value={option.value}\n onClick={(event) => {\n event.stopPropagation();\n event.preventDefault();\n handleOnClick(option.value);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(event) => {\n event.stopPropagation();\n event.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === index ? 'focused' : '',\n 'ndl-timezone-picker-popover-item',\n )}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.stopPropagation();\n handleOnClick(option.value);\n }\n }}\n >\n {option.label}\n </li>\n ))}\n </>\n )}\n {cityOptions.length > 0 && (\n <>\n <li className=\"ndl-timezone-picker-section-header\">\n City-Based Timezones\n </li>\n {cityOptions.map((option, index) => {\n const adjustedIndex = index + utcOptions.length;\n return (\n <li\n id={`${listboxId}-option-${adjustedIndex}`}\n key={option.value}\n role=\"option\"\n aria-selected={value === option.value}\n value={option.value}\n onClick={(event) => {\n event.stopPropagation();\n event.preventDefault();\n handleOnClick(option.value);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(event) => {\n event.stopPropagation();\n event.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === adjustedIndex ? 'focused' : '',\n 'ndl-timezone-picker-popover-item',\n )}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.stopPropagation();\n handleOnClick(option.value);\n }\n }}\n >\n {option.label}\n </li>\n );\n })}\n </>\n )}\n {utcOptions.length === 0 && cityOptions.length === 0 && (\n <li className=\"ndl-timezone-picker-popover-item ndl-timezone-picker-no-results\">\n No timezones found\n </li>\n )}\n </>\n ) : (\n <>\n {filteredOptions.length > 0 ? (\n filteredOptions.map((option, index) => (\n <li\n id={`${listboxId}-option-${index}`}\n key={option.value}\n role=\"option\"\n aria-selected={value === option.value}\n value={option.value}\n onClick={(event) => {\n event.stopPropagation();\n event.preventDefault();\n handleOnClick(option.value);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(event) => {\n event.stopPropagation();\n event.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === index ? 'focused' : '',\n 'ndl-timezone-picker-popover-item',\n )}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.stopPropagation();\n handleOnClick(option.value);\n }\n }}\n >\n {option.label}\n </li>\n ))\n ) : (\n <li className=\"ndl-timezone-picker-popover-item ndl-timezone-picker-no-results\">\n No timezones found\n </li>\n )}\n </>\n )}\n </ul>\n </div>\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </>\n );\n};\n"]}
|
|
@@ -33,7 +33,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
33
33
|
import classNames from 'classnames';
|
|
34
34
|
import { ButtonSpinner } from '../_common/ButtonSpinner';
|
|
35
35
|
export const ButtonBase = (_a) => {
|
|
36
|
-
var { as, buttonFill = 'filled', children, className, variant = 'primary', htmlAttributes, isDisabled = false, isFloating = false, isFluid = false, isLoading = false, leadingVisual, onClick, ref, size = 'medium', style, type = 'button', loadingMessage = 'Loading' } = _a, restProps = __rest(_a, ["as", "buttonFill", "children", "className", "variant", "htmlAttributes", "isDisabled", "isFloating", "isFluid", "isLoading", "leadingVisual", "onClick", "ref", "size", "style", "type", "loadingMessage"]);
|
|
36
|
+
var { as, buttonFill = 'filled', children, className, variant = 'primary', htmlAttributes, isDisabled = false, isFloating = false, isFluid = false, isLoading = false, leadingVisual, trailingVisual, onClick, ref, size = 'medium', style, type = 'button', loadingMessage = 'Loading' } = _a, restProps = __rest(_a, ["as", "buttonFill", "children", "className", "variant", "htmlAttributes", "isDisabled", "isFloating", "isFluid", "isLoading", "leadingVisual", "trailingVisual", "onClick", "ref", "size", "style", "type", "loadingMessage"]);
|
|
37
37
|
const Component = as !== null && as !== void 0 ? as : 'button';
|
|
38
38
|
const isInteractable = !isDisabled && !isLoading;
|
|
39
39
|
const classes = classNames(className, 'ndl-btn', {
|
|
@@ -59,6 +59,6 @@ export const ButtonBase = (_a) => {
|
|
|
59
59
|
onClick(event);
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
return (_jsx(Component, Object.assign({ type: type, onClick: handleClick, disabled: isDisabled, "aria-disabled": !isInteractable, className: classes, style: style, ref: ref }, restProps, htmlAttributes, { children: _jsxs("div", { className: "ndl-btn-inner", children: [Boolean(leadingVisual) && (_jsx("div", { className: "ndl-btn-leading-element", children: leadingVisual })), Boolean(children) && (_jsx("span", { className: "ndl-btn-content", children: children })), isLoading && (_jsx(ButtonSpinner, { loadingMessage: loadingMessage, size: size }))] }) })));
|
|
62
|
+
return (_jsx(Component, Object.assign({ type: type, onClick: handleClick, disabled: isDisabled, "aria-disabled": !isInteractable, className: classes, style: style, ref: ref }, restProps, htmlAttributes, { children: _jsxs("div", { className: "ndl-btn-inner", children: [Boolean(leadingVisual) && (_jsx("div", { className: "ndl-btn-leading-element", children: leadingVisual })), Boolean(children) && (_jsx("span", { className: "ndl-btn-content", children: children })), isLoading && (_jsx(ButtonSpinner, { loadingMessage: loadingMessage, size: size })), Boolean(trailingVisual) && (_jsx("div", { className: "ndl-btn-trailing-element", children: trailingVisual }))] }) })));
|
|
63
63
|
};
|
|
64
64
|
//# sourceMappingURL=ButtonBase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBase.js","sourceRoot":"","sources":["../../../src/button/ButtonBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ButtonBase.js","sourceRoot":"","sources":["../../../src/button/ButtonBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAkEzD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAyC,EAoBtB,EAAE,EAAE;QApBkB,EACjE,EAAE,EACF,UAAU,GAAG,QAAQ,EACrB,QAAQ,EACR,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,cAAc,EACd,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,OAAO,GAAG,KAAK,EACf,SAAS,GAAG,KAAK,EACjB,aAAa,EACb,cAAc,EACd,OAAO,EACP,GAAG,EACH,IAAI,GAAG,QAAQ,EACf,KAAK,EACL,IAAI,GAAG,QAAQ,EACf,cAAc,GAAG,SAAS,OAEiB,EADxC,SAAS,cAnBqD,8NAoBlE,CADa;IAEZ,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,QAAQ,CAAC;IACpD,MAAM,cAAc,GAAG,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC;IAEjD,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,EAAE,SAAS,EAAE;QAC/C,cAAc,EA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CAAC,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { ButtonSpinner } from '../_common/ButtonSpinner';\nimport {\n type HtmlAttributes,\n type PolymorphicCommonProps,\n} from '../_common/types';\n\n/**\n *\n * Types\n *\n */\n\ntype ButtonTypes = 'submit' | 'button' | 'reset';\nexport type ButtonSizes = 'small' | 'medium' | 'large';\nexport type ButtonVariants = 'primary' | 'danger' | 'neutral';\n\nexport type CommonButtonProps = {\n children?: React.ReactNode;\n /** Icon to display before the button content */\n leadingVisual?: React.ReactNode;\n /** Icon to display after the button content */\n trailingVisual?: React.ReactNode;\n /** If the button is doing something Async, it will display a loading spinner */\n isLoading?: boolean;\n /** If the button is in disabled state */\n isDisabled?: boolean;\n /** If the button is fluid, it will take the full width of its container */\n isFluid?: boolean;\n /** Type of button */\n type?: ButtonTypes;\n /** Size of button */\n size?: ButtonSizes;\n /** onClick callback */\n onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** onKeyDown callback */\n onKeyDown?: (event: React.KeyboardEvent<HTMLButtonElement>) => void;\n /** Accessible message for screen readers when the button is in a loading state */\n loadingMessage?: string;\n} /**\n * If `as=\"a\"`, `href` is required and `target` is available.\n * For all other elements, these props are not present.\n */ & (\n | {\n as: 'a';\n /** The URL to link to. Only applies when `as=\"a\"` */\n href?: HtmlAttributes<'a'>['href'];\n /**\n * The target window for the link. Only applies when `as=\"a\"`.\n * Not present or required for other element types.\n */\n target?: HtmlAttributes<'a'>['target'];\n }\n | {\n as?: React.ElementType;\n }\n);\n\ntype ButtonBaseProps = CommonButtonProps & {\n /** If the button is in floating state */\n isFloating?: boolean;\n /** variant of the button */\n variant?: ButtonVariants;\n /** fill of the button */\n buttonFill?: 'filled' | 'outlined' | 'text';\n};\n\nexport const ButtonBase = <T extends React.ElementType = 'button'>({\n as,\n buttonFill = 'filled',\n children,\n className,\n variant = 'primary',\n htmlAttributes,\n isDisabled = false,\n isFloating = false,\n isFluid = false,\n isLoading = false,\n leadingVisual,\n trailingVisual,\n onClick,\n ref,\n size = 'medium',\n style,\n type = 'button',\n loadingMessage = 'Loading',\n ...restProps\n}: PolymorphicCommonProps<T, ButtonBaseProps>) => {\n const Component: React.ElementType = as ?? 'button';\n const isInteractable = !isDisabled && !isLoading;\n\n const classes = classNames(className, 'ndl-btn', {\n 'ndl-disabled': isDisabled,\n 'ndl-floating': isFloating,\n 'ndl-fluid': isFluid,\n 'ndl-loading': isLoading,\n [`ndl-${size}`]: size,\n [`ndl-${buttonFill}-button`]: buttonFill,\n [`ndl-${variant}`]: variant,\n });\n\n const handleClick = (\n event: React.MouseEvent<HTMLButtonElement, MouseEvent>,\n ) => {\n if (!isInteractable) {\n // By default, a <button /> element with disabled set to true will not get its\n // on click handler called. To support the same behavior on <a /> tags we\n // swallow the event here when disabled, since the <a /> tag with disabled set to\n // true will have its onClick handler called\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n if (onClick) {\n onClick(event);\n }\n };\n\n return (\n <Component\n type={type}\n onClick={handleClick}\n disabled={isDisabled}\n aria-disabled={!isInteractable}\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-btn-inner\">\n {Boolean(leadingVisual) && (\n <div className=\"ndl-btn-leading-element\">{leadingVisual}</div>\n )}\n {Boolean(children) && (\n <span className=\"ndl-btn-content\">{children}</span>\n )}\n {isLoading && (\n <ButtonSpinner loadingMessage={loadingMessage} size={size} />\n )}\n {Boolean(trailingVisual) && (\n <div className=\"ndl-btn-trailing-element\">{trailingVisual}</div>\n )}\n </div>\n </Component>\n );\n};\n"]}
|
|
@@ -21,9 +21,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
21
21
|
*/
|
|
22
22
|
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
23
23
|
import { FilledButton } from '@neo4j-ndl/react';
|
|
24
|
-
import {
|
|
24
|
+
import { PanelLeftCollapseOutlineIcon } from '@neo4j-ndl/react/icons';
|
|
25
25
|
const Component = () => {
|
|
26
|
-
return (_jsx(FilledButton, { leadingVisual: _jsx(
|
|
26
|
+
return (_jsx(FilledButton, { leadingVisual: _jsx(PanelLeftCollapseOutlineIcon, {}), children: "Download" }));
|
|
27
27
|
};
|
|
28
28
|
export default Component;
|
|
29
29
|
//# sourceMappingURL=button-leading-icon.story.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-leading-icon.story.js","sourceRoot":"","sources":["../../../../src/button/stories/button-leading-icon.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"button-leading-icon.story.js","sourceRoot":"","sources":["../../../../src/button/stories/button-leading-icon.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,KAAC,YAAY,IAAC,aAAa,EAAE,KAAC,4BAA4B,KAAG,yBAE9C,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { FilledButton } from '@neo4j-ndl/react';\nimport { PanelLeftCollapseOutlineIcon } from '@neo4j-ndl/react/icons';\n\nconst Component = () => {\n return (\n <FilledButton leadingVisual={<PanelLeftCollapseOutlineIcon />}>\n Download\n </FilledButton>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*!
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
23
|
+
import { FilledButton } from '@neo4j-ndl/react';
|
|
24
|
+
import { PanelRightCollapseOutlineIcon } from '@neo4j-ndl/react/icons';
|
|
25
|
+
const Component = () => {
|
|
26
|
+
return (_jsx(FilledButton, { trailingVisual: _jsx(PanelRightCollapseOutlineIcon, {}), children: "Download" }));
|
|
27
|
+
};
|
|
28
|
+
export default Component;
|
|
29
|
+
//# sourceMappingURL=button-trailing-icon.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-trailing-icon.story.js","sourceRoot":"","sources":["../../../../src/button/stories/button-trailing-icon.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAEvE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,KAAC,YAAY,IAAC,cAAc,EAAE,KAAC,6BAA6B,KAAG,yBAEhD,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { FilledButton } from '@neo4j-ndl/react';\nimport { PanelRightCollapseOutlineIcon } from '@neo4j-ndl/react/icons';\n\nconst Component = () => {\n return (\n <FilledButton trailingVisual={<PanelRightCollapseOutlineIcon />}>\n Download\n </FilledButton>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
export { default as ButtonSizes } from './button-sizes.story';
|
|
22
22
|
export { default as ButtonLeadingIcon } from './button-leading-icon.story';
|
|
23
|
+
export { default as ButtonTrailingIcon } from './button-trailing-icon.story';
|
|
23
24
|
export { default as ButtonFluid } from './button-fluid.story';
|
|
24
25
|
export { default as ButtonVariants } from './button-variants.story';
|
|
25
26
|
export { default as ButtonLoading } from './button-loading.story';
|
|
@@ -34,9 +35,11 @@ import ButtonLeadingIconSrcRaw from './button-leading-icon.story?raw';
|
|
|
34
35
|
import ButtonLoadingSrcRaw from './button-loading.story?raw';
|
|
35
36
|
import ButtonRunningCancelSrcRaw from './button-running-cancel.story?raw';
|
|
36
37
|
import ButtonSizesSrcRaw from './button-sizes.story?raw';
|
|
38
|
+
import ButtonTrailingIconSrcRaw from './button-trailing-icon.story?raw';
|
|
37
39
|
import ButtonVariantsSrcRaw from './button-variants.story?raw';
|
|
38
40
|
export const ButtonSizesSrc = removeLicenseHeader(ButtonSizesSrcRaw);
|
|
39
41
|
export const ButtonLeadingIconSrc = removeLicenseHeader(ButtonLeadingIconSrcRaw);
|
|
42
|
+
export const ButtonTrailingIconSrc = removeLicenseHeader(ButtonTrailingIconSrcRaw);
|
|
40
43
|
export const ButtonFluidSrc = removeLicenseHeader(ButtonFluidSrcRaw);
|
|
41
44
|
export const ButtonVariantsSrc = removeLicenseHeader(ButtonVariantsSrcRaw);
|
|
42
45
|
export const ButtonLoadingSrc = removeLicenseHeader(ButtonLoadingSrcRaw);
|
|
@@ -1 +1 @@
|
|
|
1
|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,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CACvD,yBAAyB,CAC1B,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as ButtonSizes } from './button-sizes.story';\nexport { default as ButtonLeadingIcon } from './button-leading-icon.story';\nexport { default as ButtonFluid } from './button-fluid.story';\nexport { default as ButtonVariants } from './button-variants.story';\nexport { default as ButtonLoading } from './button-loading.story';\nexport { default as ButtonDisabled } from './button-disabled.story';\nexport { default as ButtonFloating } from './button-floating.story';\nexport { default as ButtonRunningCancel } from './button-running-cancel.story';\n\nimport { removeLicenseHeader } from '../../_common/export-stories-utils';\nimport ButtonDisabledSrcRaw from './button-disabled.story?raw';\nimport ButtonFloatingSrcRaw from './button-floating.story?raw';\nimport ButtonFluidSrcRaw from './button-fluid.story?raw';\nimport ButtonLeadingIconSrcRaw from './button-leading-icon.story?raw';\nimport ButtonLoadingSrcRaw from './button-loading.story?raw';\nimport ButtonRunningCancelSrcRaw from './button-running-cancel.story?raw';\nimport ButtonSizesSrcRaw from './button-sizes.story?raw';\nimport ButtonVariantsSrcRaw from './button-variants.story?raw';\n\nexport const ButtonSizesSrc = removeLicenseHeader(ButtonSizesSrcRaw);\nexport const ButtonLeadingIconSrc = removeLicenseHeader(\n ButtonLeadingIconSrcRaw,\n);\nexport const ButtonFluidSrc = removeLicenseHeader(ButtonFluidSrcRaw);\nexport const ButtonVariantsSrc = removeLicenseHeader(ButtonVariantsSrcRaw);\nexport const ButtonLoadingSrc = removeLicenseHeader(ButtonLoadingSrcRaw);\nexport const ButtonDisabledSrc = removeLicenseHeader(ButtonDisabledSrcRaw);\nexport const ButtonFloatingSrc = removeLicenseHeader(ButtonFloatingSrcRaw);\nexport const ButtonRunningCancelSrc = removeLicenseHeader(\n ButtonRunningCancelSrcRaw,\n);\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/button/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,oBAAoB,MAAM,6BAA6B,CAAC;AAC/D,OAAO,oBAAoB,MAAM,6BAA6B,CAAC;AAC/D,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AACzD,OAAO,uBAAuB,MAAM,iCAAiC,CAAC;AACtE,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAC7D,OAAO,yBAAyB,MAAM,mCAAmC,CAAC;AAC1E,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AACzD,OAAO,wBAAwB,MAAM,kCAAkC,CAAC;AACxE,OAAO,oBAAoB,MAAM,6BAA6B,CAAC;AAE/D,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CACrD,uBAAuB,CACxB,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CACtD,wBAAwB,CACzB,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CACvD,yBAAyB,CAC1B,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as ButtonSizes } from './button-sizes.story';\nexport { default as ButtonLeadingIcon } from './button-leading-icon.story';\nexport { default as ButtonTrailingIcon } from './button-trailing-icon.story';\nexport { default as ButtonFluid } from './button-fluid.story';\nexport { default as ButtonVariants } from './button-variants.story';\nexport { default as ButtonLoading } from './button-loading.story';\nexport { default as ButtonDisabled } from './button-disabled.story';\nexport { default as ButtonFloating } from './button-floating.story';\nexport { default as ButtonRunningCancel } from './button-running-cancel.story';\n\nimport { removeLicenseHeader } from '../../_common/export-stories-utils';\nimport ButtonDisabledSrcRaw from './button-disabled.story?raw';\nimport ButtonFloatingSrcRaw from './button-floating.story?raw';\nimport ButtonFluidSrcRaw from './button-fluid.story?raw';\nimport ButtonLeadingIconSrcRaw from './button-leading-icon.story?raw';\nimport ButtonLoadingSrcRaw from './button-loading.story?raw';\nimport ButtonRunningCancelSrcRaw from './button-running-cancel.story?raw';\nimport ButtonSizesSrcRaw from './button-sizes.story?raw';\nimport ButtonTrailingIconSrcRaw from './button-trailing-icon.story?raw';\nimport ButtonVariantsSrcRaw from './button-variants.story?raw';\n\nexport const ButtonSizesSrc = removeLicenseHeader(ButtonSizesSrcRaw);\nexport const ButtonLeadingIconSrc = removeLicenseHeader(\n ButtonLeadingIconSrcRaw,\n);\nexport const ButtonTrailingIconSrc = removeLicenseHeader(\n ButtonTrailingIconSrcRaw,\n);\nexport const ButtonFluidSrc = removeLicenseHeader(ButtonFluidSrcRaw);\nexport const ButtonVariantsSrc = removeLicenseHeader(ButtonVariantsSrcRaw);\nexport const ButtonLoadingSrc = removeLicenseHeader(ButtonLoadingSrcRaw);\nexport const ButtonDisabledSrc = removeLicenseHeader(ButtonDisabledSrcRaw);\nexport const ButtonFloatingSrc = removeLicenseHeader(ButtonFloatingSrcRaw);\nexport const ButtonRunningCancelSrc = removeLicenseHeader(\n ButtonRunningCancelSrcRaw,\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datagrid-pinned-columns.stories.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-pinned-columns.stories.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAE/B,eAAe;IACb,SAAS,EAAE,QAAQ;IACnB,EAAE,EAAE,qCAAqC;IACzC,UAAU,EAAE;QACV,SAAS,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;QACpC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;IACD,KAAK,EAAE,oCAAoC;CAC5C,CAAC;AAUF,MAAM,YAAY,GAAG,kBAAkB,EAAkB,CAAC;AAE1D,MAAM,iBAAiB,GACrB,kBAAkB,EAAsC,CAAC;AAE3D,MAAM,gBAAgB,GACpB,kBAAkB,EAAuC,CAAC;AAE5D,MAAM,eAAe,GAAG;IACtB,OAAO,EAAE;QACP,iBAAiB,CAAC,QAAQ,CAAC,MAAM,EAAE;YACjC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC/B,OAAO,EAAE,GAAG;SACb,CAAC;QACF,iBAAiB,CAAC,QAAQ,CAAC,KAAK,EAAE;YAChC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC/B,OAAO,EAAE,EAAE;SACZ,CAAC;QACF,iBA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;IAClC,MAAM,KAAK,GAAG,aAAa,iCACtB,eAAe,KAClB,mBAAmB,EAAE,IAAI,EACzB,aAAa,EAAE,IAAI,EACnB,eAAe,EAAE,eAAe,EAAE,EAClC,iBAAiB,EAAE,iBAAiB,EAAE,EACtC,KAAK,EAAE;YACL,aAAa,EAAE;gBACb,KAAK,EAAE,CAAC,aAAa,CAAC;aACvB;SACF,IACD,CAAC;IAEH,OAAO,CACL,eAAK,SAAS,EAAC,uBAAuB,aACpC,KAAC,UAAU,IAAC,OAAO,EAAC,SAAS,6DAEhB,EACb,KAAC,QAAQ,IACP,mBAAmB,EAAE,IAAI,EACzB,WAAW,EAAE,KAAK,EAClB,YAAY,EAAE,QAAQ,CAAC,IAAI,EAC3B,OAAO,EAAE;oBACP,WAAW,EAAE,WAAW;oBACxB,gBAAgB,EAAE,KAAK;iBACxB,EACD,aAAa,EAAE,KAAK,GACpB,IACE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { DataGrid, Typography } from '@neo4j-ndl/react';\nimport {\n createColumnHelper,\n getCoreRowModel,\n getSortedRowModel,\n useReactTable,\n} from '@tanstack/react-table';\n\nexport default {\n component: DataGrid,\n id: 'components-data-grid-pinned-columns',\n parameters: {\n chromatic: { disableSnapshot: true },\n controls: { disable: true },\n },\n title: 'Components/DataGrid/Pinned Columns',\n};\n\nexport type TestDataFormat = {\n age: number;\n cypherCommand: string;\n name: string;\n pinnedLeft: string;\n pinnedRight: string;\n};\n\nconst columnHelper = createColumnHelper<TestDataFormat>();\n\nconst columnHelperRight =\n createColumnHelper<Omit<TestDataFormat, 'pinnedLeft'>>();\n\nconst columnHelperLeft =\n createColumnHelper<Omit<TestDataFormat, 'pinnedRight'>>();\n\nconst tablePropsRight = {\n columns: [\n columnHelperRight.accessor('name', {\n cell: (info) => info.getValue(),\n minSize: 180,\n }),\n columnHelperRight.accessor('age', {\n cell: (info) => info.getValue(),\n minSize: 80,\n }),\n columnHelperRight.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\n minSize: 80,\n }),\n columnHelperRight.accessor('pinnedRight', {\n cell: (info) => info.getValue(),\n size: 300,\n }),\n ],\n data: [\n {\n age: 31,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 1',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 32,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 2',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 33,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 3',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 34,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 4',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 35,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 5',\n pinnedRight: 'Pinned Right',\n },\n ],\n};\n\nconst tablePropsBoth = {\n columns: [\n columnHelper.accessor('pinnedLeft', {\n cell: (info) => info.getValue(),\n size: 200,\n }),\n columnHelper.accessor('name', {\n cell: (info) => info.getValue(),\n minSize: 180,\n }),\n columnHelper.accessor('age', {\n cell: (info) => info.getValue(),\n minSize: 80,\n }),\n columnHelper.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\n minSize: 80,\n }),\n columnHelper.accessor('pinnedRight', {\n cell: (info) => info.getValue(),\n size: 200,\n }),\n ],\n data: [\n {\n age: 31,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 1',\n pinnedLeft: 'Pinned Left',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 32,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 2',\n pinnedLeft: 'Pinned Left',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 33,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 3',\n pinnedLeft: 'Pinned Left',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 34,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 4',\n pinnedLeft: 'Pinned Left',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 35,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 5',\n pinnedLeft: 'Pinned Left',\n pinnedRight: 'Pinned Right',\n },\n ],\n};\n\nconst tablePropsLeft = {\n columns: [\n columnHelperLeft.accessor('pinnedLeft', {\n cell: (info) => info.getValue(),\n size: 300,\n }),\n columnHelperLeft.accessor('name', {\n cell: (info) => info.getValue(),\n minSize: 180,\n }),\n columnHelperLeft.accessor('age', {\n cell: (info) => info.getValue(),\n minSize: 80,\n }),\n columnHelperLeft.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\n minSize: 80,\n }),\n ],\n data: [\n {\n age: 31,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 1',\n pinnedLeft: 'Pinned Left',\n },\n {\n age: 32,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 2',\n pinnedLeft: 'Pinned Left',\n },\n {\n age: 33,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 3',\n pinnedLeft: 'Pinned Left',\n },\n {\n age: 34,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 4',\n pinnedLeft: 'Pinned Left',\n },\n {\n age: 35,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 5',\n pinnedLeft: 'Pinned Left',\n },\n ],\n};\n\nexport const PinnedBothSides = () => {\n const table = useReactTable({\n ...tablePropsBoth,\n enableColumnPinning: true,\n enableSorting: true,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n state: {\n columnPinning: {\n left: ['pinnedLeft'],\n right: ['pinnedRight'],\n },\n },\n });\n\n return (\n <div className=\"w-w-full max-w-[1200px]\">\n <Typography variant=\"title-2\">\n Make the window smaller to test the overflow\n </Typography>\n <DataGrid\n isKeyboardNavigable={true}\n isResizable={false}\n portalTarget={document.body}\n styling={{\n borderStyle: 'all-sides',\n hasZebraStriping: false,\n }}\n tableInstance={table}\n />\n </div>\n );\n};\n\nexport const PinnedLeftSide = () => {\n const table = useReactTable({\n ...tablePropsLeft,\n enableColumnPinning: true,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n state: {\n columnPinning: {\n left: ['pinnedLeft'],\n },\n },\n });\n\n return (\n <div className=\"w-w-full max-w-[1200px]\">\n <Typography variant=\"title-2\">\n Make the window smaller to test the overflow\n </Typography>\n <DataGrid\n isKeyboardNavigable={true}\n isResizable={false}\n styling={{\n borderStyle: 'all-sides',\n hasZebraStriping: false,\n }}\n tableInstance={table}\n />\n </div>\n );\n};\n\nexport const PinnedRightSide = () => {\n const table = useReactTable({\n ...tablePropsRight,\n enableColumnPinning: true,\n enableSorting: true,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n state: {\n columnPinning: {\n right: ['pinnedRight'],\n },\n },\n });\n\n return (\n <div className=\"w-full max-w-[1200px]\">\n <Typography variant=\"title-2\">\n Make the window smaller to test the overflow\n </Typography>\n <DataGrid\n isKeyboardNavigable={true}\n isResizable={false}\n portalTarget={document.body}\n styling={{\n borderStyle: 'all-sides',\n hasZebraStriping: false,\n }}\n tableInstance={table}\n />\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"datagrid-pinned-columns.stories.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-pinned-columns.stories.tsx"],"names":[],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C,SAAS,6DAEhB,EACb,KAAC,QAAQ,IACP,mBAAmB,EAAE,IAAI,EACzB,WAAW,EAAE,KAAK,EAClB,YAAY,EAAE,QAAQ,CAAC,IAAI,EAC3B,OAAO,EAAE;oBACP,WAAW,EAAE,WAAW;oBACxB,gBAAgB,EAAE,KAAK;iBACxB,EACD,aAAa,EAAE,KAAK,GACpB,IACE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { DataGrid, Typography } from '@neo4j-ndl/react';\nimport {\n createColumnHelper,\n getCoreRowModel,\n getSortedRowModel,\n useReactTable,\n} from '@tanstack/react-table';\n\nexport default {\n component: DataGrid,\n id: 'components-data-grid-pinned-columns',\n parameters: {\n controls: { disable: true },\n },\n title: 'Components/DataGrid/Pinned Columns',\n};\n\nexport type TestDataFormat = {\n age: number;\n cypherCommand: string;\n name: string;\n pinnedLeft: string;\n pinnedRight: string;\n};\n\nconst columnHelper = createColumnHelper<TestDataFormat>();\n\nconst columnHelperRight =\n createColumnHelper<Omit<TestDataFormat, 'pinnedLeft'>>();\n\nconst columnHelperLeft =\n createColumnHelper<Omit<TestDataFormat, 'pinnedRight'>>();\n\nconst tablePropsRight = {\n columns: [\n columnHelperRight.accessor('name', {\n cell: (info) => info.getValue(),\n minSize: 180,\n }),\n columnHelperRight.accessor('age', {\n cell: (info) => info.getValue(),\n minSize: 80,\n }),\n columnHelperRight.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\n minSize: 80,\n }),\n columnHelperRight.accessor('pinnedRight', {\n cell: (info) => info.getValue(),\n size: 300,\n }),\n ],\n data: [\n {\n age: 31,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 1',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 32,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 2',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 33,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 3',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 34,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 4',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 35,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 5',\n pinnedRight: 'Pinned Right',\n },\n ],\n};\n\nconst tablePropsBoth = {\n columns: [\n columnHelper.accessor('pinnedLeft', {\n cell: (info) => info.getValue(),\n size: 200,\n }),\n columnHelper.accessor('name', {\n cell: (info) => info.getValue(),\n minSize: 180,\n }),\n columnHelper.accessor('age', {\n cell: (info) => info.getValue(),\n minSize: 80,\n }),\n columnHelper.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\n minSize: 80,\n }),\n columnHelper.accessor('pinnedRight', {\n cell: (info) => info.getValue(),\n size: 200,\n }),\n ],\n data: [\n {\n age: 31,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 1',\n pinnedLeft: 'Pinned Left',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 32,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 2',\n pinnedLeft: 'Pinned Left',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 33,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 3',\n pinnedLeft: 'Pinned Left',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 34,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 4',\n pinnedLeft: 'Pinned Left',\n pinnedRight: 'Pinned Right',\n },\n {\n age: 35,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 5',\n pinnedLeft: 'Pinned Left',\n pinnedRight: 'Pinned Right',\n },\n ],\n};\n\nconst tablePropsLeft = {\n columns: [\n columnHelperLeft.accessor('pinnedLeft', {\n cell: (info) => info.getValue(),\n size: 300,\n }),\n columnHelperLeft.accessor('name', {\n cell: (info) => info.getValue(),\n minSize: 180,\n }),\n columnHelperLeft.accessor('age', {\n cell: (info) => info.getValue(),\n minSize: 80,\n }),\n columnHelperLeft.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\n minSize: 80,\n }),\n ],\n data: [\n {\n age: 31,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 1',\n pinnedLeft: 'Pinned Left',\n },\n {\n age: 32,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 2',\n pinnedLeft: 'Pinned Left',\n },\n {\n age: 33,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 3',\n pinnedLeft: 'Pinned Left',\n },\n {\n age: 34,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 4',\n pinnedLeft: 'Pinned Left',\n },\n {\n age: 35,\n cypherCommand: 'MATCH (n) RETURN n',\n name: 'Name 5',\n pinnedLeft: 'Pinned Left',\n },\n ],\n};\n\nexport const PinnedBothSides = () => {\n const table = useReactTable({\n ...tablePropsBoth,\n enableColumnPinning: true,\n enableSorting: true,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n state: {\n columnPinning: {\n left: ['pinnedLeft'],\n right: ['pinnedRight'],\n },\n },\n });\n\n return (\n <div className=\"w-w-full max-w-[1200px]\">\n <Typography variant=\"title-2\">\n Make the window smaller to test the overflow\n </Typography>\n <DataGrid\n isKeyboardNavigable={true}\n isResizable={false}\n portalTarget={document.body}\n styling={{\n borderStyle: 'all-sides',\n hasZebraStriping: false,\n }}\n tableInstance={table}\n />\n </div>\n );\n};\n\nexport const PinnedLeftSide = () => {\n const table = useReactTable({\n ...tablePropsLeft,\n enableColumnPinning: true,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n state: {\n columnPinning: {\n left: ['pinnedLeft'],\n },\n },\n });\n\n return (\n <div className=\"w-w-full max-w-[1200px]\">\n <Typography variant=\"title-2\">\n Make the window smaller to test the overflow\n </Typography>\n <DataGrid\n isKeyboardNavigable={true}\n isResizable={false}\n styling={{\n borderStyle: 'all-sides',\n hasZebraStriping: false,\n }}\n tableInstance={table}\n />\n </div>\n );\n};\n\nexport const PinnedRightSide = () => {\n const table = useReactTable({\n ...tablePropsRight,\n enableColumnPinning: true,\n enableSorting: true,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n state: {\n columnPinning: {\n right: ['pinnedRight'],\n },\n },\n });\n\n return (\n <div className=\"w-full max-w-[1200px]\">\n <Typography variant=\"title-2\">\n Make the window smaller to test the overflow\n </Typography>\n <DataGrid\n isKeyboardNavigable={true}\n isResizable={false}\n portalTarget={document.body}\n styling={{\n borderStyle: 'all-sides',\n hasZebraStriping: false,\n }}\n tableInstance={table}\n />\n </div>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datagrid-search-and-filters.stories.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-search-and-filters.stories.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EACL,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,OAAO,EACP,UAAU,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,kBAAkB,EAElB,eAAe,E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,qBAAqB,EAAE;QAC9C,iBAAiB,EAAE,iBAAiB,EAAE;QACtC,YAAY,EAAE;YACZ,UAAU,EAAE;gBACV,QAAQ,EAAE,CAAC;aACZ;SACF;KACF,CAAC,CAAC;IAEH,OAAO,CACL,cAAK,SAAS,EAAC,iDAAiD,YAC9D,KAAC,QAAQ,IACP,mBAAmB,EAAE,IAAI,EACzB,WAAW,EAAE,IAAI,EACjB,aAAa,EAAE,KAAK,GACpB,GACE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport {\n Checkbox,\n CleanIconButton,\n DataGrid,\n Divider,\n IconButton,\n Popover,\n TextButton,\n TextInput,\n Typography,\n} from '@neo4j-ndl/react';\nimport {\n FunnelIconOutline,\n MagnifyingGlassIconOutline,\n XMarkIconOutline,\n} from '@neo4j-ndl/react/icons';\nimport {\n type ColumnFiltersState,\n type ColumnMeta,\n createColumnHelper,\n type FilterFn,\n getCoreRowModel,\n getFilteredRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n useReactTable,\n} from '@tanstack/react-table';\nimport { useRef, useState } from 'react';\n\nimport { TABLE_DEMO_DATA } from './staticData';\n\ntype TestDataFormat = {\n name: string;\n age: number;\n cypherCommand: string;\n};\n\nexport default {\n component: DataGrid,\n id: 'components-data-grid-search-and-filters',\n parameters: {\n chromatic: { disableSnapshot: true },\n controls: { disable: true },\n },\n title: 'Components/DataGrid/Search And Filters',\n};\n\ninterface AgeFilterOptions {\n min?: number;\n max?: number;\n}\n\n/**\n * Custom global function as there is a bug in current version:\n * https://github.com/TanStack/table/issues/4280#issuecomment-1244878232\n */\nconst globalFilterFn: FilterFn<TestDataFormat> = (\n row,\n columnId,\n filterValue: string,\n) => {\n const search = filterValue.toLowerCase();\n\n let value = row.getValue(columnId) as string;\n if (typeof value === 'number') {\n value = String(value);\n }\n\n return value?.toLowerCase().includes(search);\n};\n\nconst OpenFilterMenuIconButton = ({\n onClick,\n isOpen,\n description,\n ref,\n}: {\n isOpen: boolean;\n} & Omit<React.ComponentProps<typeof IconButton>, 'children'>) => (\n <IconButton\n ref={ref}\n onClick={onClick}\n aria-controls={isOpen ? 'default-menu' : undefined}\n aria-haspopup=\"true\"\n aria-expanded={isOpen}\n description={description}\n size=\"medium\"\n >\n <FunnelIconOutline />\n </IconButton>\n);\n\nexport const Searchable = () => {\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n const isOpen = Boolean(anchorEl);\n const ref = useRef<HTMLDivElement>(null);\n const [globalFilter, setGlobalFilter] = useState('');\n const [columnFilters, setColumnFilters] = useState<ColumnFiltersState>([]);\n\n const handleClick = (\n event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n ) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const columnHelper = createColumnHelper<TestDataFormat>();\n\n const columns = [\n columnHelper.accessor('name', {\n cell: (info) => info.getValue(),\n footer: (info) => info.column.id,\n header: () => 'Name',\n maxSize: 300,\n minSize: 180,\n size: 220,\n }),\n columnHelper.accessor('age', {\n cell: (info) => info.renderValue(),\n footer: (info) => info.column.id,\n header: () => 'Age',\n minSize: 80,\n }),\n columnHelper.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\n footer: (info) => info.column.id,\n header: () => 'Cypher Command',\n minSize: 400,\n size: 400,\n }),\n ];\n\n const table = useReactTable({\n columnResizeMode: 'onChange',\n columns,\n data: TABLE_DEMO_DATA,\n debugColumns: true,\n debugHeaders: true,\n debugTable: true,\n defaultColumn: {\n maxSize: 800,\n minSize: 80,\n },\n enableSorting: false,\n filterFns: {},\n getCoreRowModel: getCoreRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n globalFilterFn: globalFilterFn,\n initialState: {\n pagination: {\n pageSize: 5,\n },\n },\n onColumnFiltersChange: setColumnFilters,\n onGlobalFilterChange: setGlobalFilter,\n state: {\n columnFilters,\n globalFilter,\n },\n });\n\n const toggleAgeFilter = ({ min, max }: AgeFilterOptions) => {\n const ageColumn = table.getColumn('age');\n\n if (!ageColumn) {\n return;\n }\n\n const currentFilter = ageColumn.getFilterValue() as\n | [number?, number?]\n | undefined;\n\n // Helper function to determine the new filter value for a specific bound\n const determineNewBound = (currentBound?: number, newBound?: number) => {\n if (newBound !== undefined && currentBound === newBound) {\n return undefined;\n }\n return newBound !== undefined ? newBound : currentBound;\n };\n\n const newFilter: [number?, number?] = [\n determineNewBound(currentFilter?.[0], min),\n determineNewBound(currentFilter?.[1], max),\n ];\n\n // Update the filter value in the table state\n ageColumn.setFilterValue(\n newFilter[0] === undefined && newFilter[1] === undefined\n ? undefined\n : newFilter,\n );\n };\n\n const isAgeFilterApplied = (type: 'min' | 'max', value: number) => {\n const ageFilter = columnFilters.find((filter) => filter.id === 'age');\n if (ageFilter) {\n const [min, max] = ageFilter.value as [number, number];\n if (type === 'min') {\n return min === value;\n }\n if (type === 'max') {\n return max === value;\n }\n }\n return false;\n };\n\n return (\n <div className=\"flex flex-col\" ref={ref}>\n <div className=\"flex flex-col gap-token-16 pb-token-16\">\n <div className=\"flex gap-token-8\">\n <TextInput\n aria-label=\"Table search\"\n value={globalFilter}\n placeholder=\"Search\"\n leadingElement={<MagnifyingGlassIconOutline />}\n isClearable={true}\n onChange={(event) => setGlobalFilter(event.target.value)}\n />\n <OpenFilterMenuIconButton\n isOpen={isOpen}\n onClick={handleClick}\n description=\"Filter Menu\"\n />\n </div>\n </div>\n <Divider />\n <DataGrid isResizable={true} tableInstance={table} />\n <Popover\n isOpen={isOpen}\n anchorElement={anchorEl}\n onOpenChange={(isOpen) => {\n if (!isOpen) {\n handleClose();\n }\n }}\n offset={({ rects }) => ({\n crossAxis: -rects.floating.width,\n })}\n >\n <Popover.Content>\n <div className=\"grid gap-token-16 p-token-24 w-[300px]\">\n <div className=\"w-full flex justify-between items-center\">\n <Typography variant=\"title-4\">Filter</Typography>\n <CleanIconButton\n onClick={handleClose}\n description=\"Close filter menu\"\n size=\"medium\"\n htmlAttributes={{\n title: 'Close filter menu',\n }}\n >\n <XMarkIconOutline />\n </CleanIconButton>\n </div>\n <div className=\"flex flex-col gap-2\">\n <Typography\n variant=\"body-medium\"\n className=\"text-neutral-text-weaker pb-token-4\"\n >\n Age\n </Typography>\n <Checkbox\n isChecked={isAgeFilterApplied('min', 18)}\n label=\"Age >= 18\"\n onClick={() => toggleAgeFilter({ min: 18 })}\n />\n <Checkbox\n isChecked={isAgeFilterApplied('max', 63)}\n label=\"Age <= 63\"\n onClick={() => toggleAgeFilter({ max: 63 })}\n />\n </div>\n <TextButton\n className=\"mt-token-32 justify-self-end\"\n variant=\"danger\"\n aria-label=\"Clear filters\"\n onClick={() => {\n table.resetColumnFilters();\n }}\n >\n <Typography\n variant=\"body-medium\"\n className=\"text-danger-text font-bold\"\n >\n Clear all\n </Typography>\n </TextButton>\n </div>\n </Popover.Content>\n </Popover>\n </div>\n );\n};\n\nexport const ColumnFiltering = () => {\n const [tableData, setTableData] = useState(TABLE_DEMO_DATA);\n const [isAgeFilterApplied, setIsAgeFilterApplied] = useState(false);\n const columnHelper = createColumnHelper<TestDataFormat>();\n\n const ColumnActions: ColumnMeta<TestDataFormat, unknown> = {\n columnActions: {\n actions: [\n {\n onClick: () => {\n // Filter the input table data value, TABLE_DEMO_DATA\n if (isAgeFilterApplied) {\n setTableData(TABLE_DEMO_DATA);\n setIsAgeFilterApplied(false);\n return;\n } else {\n const filteredData = TABLE_DEMO_DATA.filter(\n (data) => data.age >= 18,\n );\n setTableData(filteredData);\n setIsAgeFilterApplied(true);\n }\n },\n title: 'Age >= 18',\n },\n ],\n },\n };\n\n const columns = [\n columnHelper.accessor('name', {\n cell: (info) => info.getValue(),\n maxSize: 300,\n minSize: 180,\n size: 220,\n }),\n columnHelper.accessor('age', {\n cell: (info) => info.getValue(),\n header: () => <div>Age</div>,\n meta: {\n ...ColumnActions,\n },\n minSize: 80,\n }),\n columnHelper.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\n minSize: 400,\n size: 400,\n }),\n ];\n\n const table = useReactTable({\n columnResizeMode: 'onChange',\n columns,\n data: tableData,\n debugColumns: true,\n debugHeaders: true,\n debugTable: true,\n defaultColumn: {\n maxSize: 800,\n minSize: 80,\n },\n enableSorting: true,\n getCoreRowModel: getCoreRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n getSortedRowModel: getSortedRowModel(),\n initialState: {\n pagination: {\n pageSize: 5,\n },\n },\n });\n\n return (\n <div className=\"h-[1000px] w-full bg-primary-bg-weak p-token-32\">\n <DataGrid\n isKeyboardNavigable={true}\n isResizable={true}\n tableInstance={table}\n />\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"datagrid-search-and-filters.stories.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-search-and-filters.stories.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EACL,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,OAAO,EACP,UAAU,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,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AiB,EAAE,iBAAiB,EAAE;QACtC,YAAY,EAAE;YACZ,UAAU,EAAE;gBACV,QAAQ,EAAE,CAAC;aACZ;SACF;KACF,CAAC,CAAC;IAEH,OAAO,CACL,cAAK,SAAS,EAAC,iDAAiD,YAC9D,KAAC,QAAQ,IACP,mBAAmB,EAAE,IAAI,EACzB,WAAW,EAAE,IAAI,EACjB,aAAa,EAAE,KAAK,GACpB,GACE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport {\n Checkbox,\n CleanIconButton,\n DataGrid,\n Divider,\n IconButton,\n Popover,\n TextButton,\n TextInput,\n Typography,\n} from '@neo4j-ndl/react';\nimport {\n FunnelIconOutline,\n MagnifyingGlassIconOutline,\n XMarkIconOutline,\n} from '@neo4j-ndl/react/icons';\nimport {\n type ColumnFiltersState,\n type ColumnMeta,\n createColumnHelper,\n type FilterFn,\n getCoreRowModel,\n getFilteredRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n useReactTable,\n} from '@tanstack/react-table';\nimport { useRef, useState } from 'react';\n\nimport { TABLE_DEMO_DATA } from './staticData';\n\ntype TestDataFormat = {\n name: string;\n age: number;\n cypherCommand: string;\n};\n\nexport default {\n component: DataGrid,\n id: 'components-data-grid-search-and-filters',\n parameters: {\n controls: { disable: true },\n },\n title: 'Components/DataGrid/Search And Filters',\n};\n\ninterface AgeFilterOptions {\n min?: number;\n max?: number;\n}\n\n/**\n * Custom global function as there is a bug in current version:\n * https://github.com/TanStack/table/issues/4280#issuecomment-1244878232\n */\nconst globalFilterFn: FilterFn<TestDataFormat> = (\n row,\n columnId,\n filterValue: string,\n) => {\n const search = filterValue.toLowerCase();\n\n let value = row.getValue(columnId) as string;\n if (typeof value === 'number') {\n value = String(value);\n }\n\n return value?.toLowerCase().includes(search);\n};\n\nconst OpenFilterMenuIconButton = ({\n onClick,\n isOpen,\n description,\n ref,\n}: {\n isOpen: boolean;\n} & Omit<React.ComponentProps<typeof IconButton>, 'children'>) => (\n <IconButton\n ref={ref}\n onClick={onClick}\n aria-controls={isOpen ? 'default-menu' : undefined}\n aria-haspopup=\"true\"\n aria-expanded={isOpen}\n description={description}\n size=\"medium\"\n >\n <FunnelIconOutline />\n </IconButton>\n);\n\nexport const Searchable = () => {\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n const isOpen = Boolean(anchorEl);\n const ref = useRef<HTMLDivElement>(null);\n const [globalFilter, setGlobalFilter] = useState('');\n const [columnFilters, setColumnFilters] = useState<ColumnFiltersState>([]);\n\n const handleClick = (\n event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n ) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const columnHelper = createColumnHelper<TestDataFormat>();\n\n const columns = [\n columnHelper.accessor('name', {\n cell: (info) => info.getValue(),\n footer: (info) => info.column.id,\n header: () => 'Name',\n maxSize: 300,\n minSize: 180,\n size: 220,\n }),\n columnHelper.accessor('age', {\n cell: (info) => info.renderValue(),\n footer: (info) => info.column.id,\n header: () => 'Age',\n minSize: 80,\n }),\n columnHelper.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\n footer: (info) => info.column.id,\n header: () => 'Cypher Command',\n minSize: 400,\n size: 400,\n }),\n ];\n\n const table = useReactTable({\n columnResizeMode: 'onChange',\n columns,\n data: TABLE_DEMO_DATA,\n debugColumns: true,\n debugHeaders: true,\n debugTable: true,\n defaultColumn: {\n maxSize: 800,\n minSize: 80,\n },\n enableSorting: false,\n filterFns: {},\n getCoreRowModel: getCoreRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n globalFilterFn: globalFilterFn,\n initialState: {\n pagination: {\n pageSize: 5,\n },\n },\n onColumnFiltersChange: setColumnFilters,\n onGlobalFilterChange: setGlobalFilter,\n state: {\n columnFilters,\n globalFilter,\n },\n });\n\n const toggleAgeFilter = ({ min, max }: AgeFilterOptions) => {\n const ageColumn = table.getColumn('age');\n\n if (!ageColumn) {\n return;\n }\n\n const currentFilter = ageColumn.getFilterValue() as\n | [number?, number?]\n | undefined;\n\n // Helper function to determine the new filter value for a specific bound\n const determineNewBound = (currentBound?: number, newBound?: number) => {\n if (newBound !== undefined && currentBound === newBound) {\n return undefined;\n }\n return newBound !== undefined ? newBound : currentBound;\n };\n\n const newFilter: [number?, number?] = [\n determineNewBound(currentFilter?.[0], min),\n determineNewBound(currentFilter?.[1], max),\n ];\n\n // Update the filter value in the table state\n ageColumn.setFilterValue(\n newFilter[0] === undefined && newFilter[1] === undefined\n ? undefined\n : newFilter,\n );\n };\n\n const isAgeFilterApplied = (type: 'min' | 'max', value: number) => {\n const ageFilter = columnFilters.find((filter) => filter.id === 'age');\n if (ageFilter) {\n const [min, max] = ageFilter.value as [number, number];\n if (type === 'min') {\n return min === value;\n }\n if (type === 'max') {\n return max === value;\n }\n }\n return false;\n };\n\n return (\n <div className=\"flex flex-col\" ref={ref}>\n <div className=\"flex flex-col gap-token-16 pb-token-16\">\n <div className=\"flex gap-token-8\">\n <TextInput\n aria-label=\"Table search\"\n value={globalFilter}\n placeholder=\"Search\"\n leadingElement={<MagnifyingGlassIconOutline />}\n isClearable={true}\n onChange={(event) => setGlobalFilter(event.target.value)}\n />\n <OpenFilterMenuIconButton\n isOpen={isOpen}\n onClick={handleClick}\n description=\"Filter Menu\"\n />\n </div>\n </div>\n <Divider />\n <DataGrid isResizable={true} tableInstance={table} />\n <Popover\n isOpen={isOpen}\n anchorElement={anchorEl}\n onOpenChange={(isOpen) => {\n if (!isOpen) {\n handleClose();\n }\n }}\n offset={({ rects }) => ({\n crossAxis: -rects.floating.width,\n })}\n >\n <Popover.Content>\n <div className=\"grid gap-token-16 p-token-24 w-[300px]\">\n <div className=\"w-full flex justify-between items-center\">\n <Typography variant=\"title-4\">Filter</Typography>\n <CleanIconButton\n onClick={handleClose}\n description=\"Close filter menu\"\n size=\"medium\"\n htmlAttributes={{\n title: 'Close filter menu',\n }}\n >\n <XMarkIconOutline />\n </CleanIconButton>\n </div>\n <div className=\"flex flex-col gap-2\">\n <Typography\n variant=\"body-medium\"\n className=\"text-neutral-text-weaker pb-token-4\"\n >\n Age\n </Typography>\n <Checkbox\n isChecked={isAgeFilterApplied('min', 18)}\n label=\"Age >= 18\"\n onClick={() => toggleAgeFilter({ min: 18 })}\n />\n <Checkbox\n isChecked={isAgeFilterApplied('max', 63)}\n label=\"Age <= 63\"\n onClick={() => toggleAgeFilter({ max: 63 })}\n />\n </div>\n <TextButton\n className=\"mt-token-32 justify-self-end\"\n variant=\"danger\"\n aria-label=\"Clear filters\"\n onClick={() => {\n table.resetColumnFilters();\n }}\n >\n <Typography\n variant=\"body-medium\"\n className=\"text-danger-text font-bold\"\n >\n Clear all\n </Typography>\n </TextButton>\n </div>\n </Popover.Content>\n </Popover>\n </div>\n );\n};\n\nexport const ColumnFiltering = () => {\n const [tableData, setTableData] = useState(TABLE_DEMO_DATA);\n const [isAgeFilterApplied, setIsAgeFilterApplied] = useState(false);\n const columnHelper = createColumnHelper<TestDataFormat>();\n\n const ColumnActions: ColumnMeta<TestDataFormat, unknown> = {\n columnActions: {\n actions: [\n {\n onClick: () => {\n // Filter the input table data value, TABLE_DEMO_DATA\n if (isAgeFilterApplied) {\n setTableData(TABLE_DEMO_DATA);\n setIsAgeFilterApplied(false);\n return;\n } else {\n const filteredData = TABLE_DEMO_DATA.filter(\n (data) => data.age >= 18,\n );\n setTableData(filteredData);\n setIsAgeFilterApplied(true);\n }\n },\n title: 'Age >= 18',\n },\n ],\n },\n };\n\n const columns = [\n columnHelper.accessor('name', {\n cell: (info) => info.getValue(),\n maxSize: 300,\n minSize: 180,\n size: 220,\n }),\n columnHelper.accessor('age', {\n cell: (info) => info.getValue(),\n header: () => <div>Age</div>,\n meta: {\n ...ColumnActions,\n },\n minSize: 80,\n }),\n columnHelper.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\n minSize: 400,\n size: 400,\n }),\n ];\n\n const table = useReactTable({\n columnResizeMode: 'onChange',\n columns,\n data: tableData,\n debugColumns: true,\n debugHeaders: true,\n debugTable: true,\n defaultColumn: {\n maxSize: 800,\n minSize: 80,\n },\n enableSorting: true,\n getCoreRowModel: getCoreRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n getSortedRowModel: getSortedRowModel(),\n initialState: {\n pagination: {\n pageSize: 5,\n },\n },\n });\n\n return (\n <div className=\"h-[1000px] w-full bg-primary-bg-weak p-token-32\">\n <DataGrid\n isKeyboardNavigable={true}\n isResizable={true}\n tableInstance={table}\n />\n </div>\n );\n};\n"]}
|
|
@@ -35,14 +35,12 @@ const loadOptions = (inputValue) => {
|
|
|
35
35
|
}, 1000);
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
|
-
const Component = (
|
|
39
|
-
var _a;
|
|
38
|
+
const Component = () => {
|
|
40
39
|
return (_jsx(Select, { label: "Label", helpText: "Start typing to load options dynamically", type: "async", selectProps: {
|
|
41
40
|
cacheOptions: true,
|
|
42
41
|
defaultOptions: true,
|
|
43
42
|
isClearable: true,
|
|
44
43
|
loadOptions,
|
|
45
|
-
menuIsOpen: (_a = props.selectProps) === null || _a === void 0 ? void 0 : _a.menuIsOpen,
|
|
46
44
|
placeholder: 'Type to search...',
|
|
47
45
|
} }));
|
|
48
46
|
};
|