Skip to content

Commit f8088b0

Browse files
Beta (#232)
* feat: searchbox-defaultvalue-set-option (#230) * feat: searchbox-defaultvalue-set-option * fixes calendar language support (#231)
1 parent be35cf6 commit f8088b0

File tree

11 files changed

+94
-21
lines changed

11 files changed

+94
-21
lines changed

Calendar/Calendar/loc/Readme.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ All the translation files are borrowed from contributions(Link at the bottom) an
66
- Galician(gl-ES)
77
- Hindi (hi-IN)
88
- Croatian(hr-HR)
9-
- Hungarian(hu-HU)
109
- Indonesian(id-ID)
1110
- Latvian(lv-LV)
1211
- Korean(ko-KR)
@@ -23,4 +22,6 @@ Inorder to include the above mentioned language file(s), headover to [loc folder
2322

2423
Note: Only languages which are supported by [Language function](https://docs.microsoft.com/en-us/power-platform/power-fx/reference/function-language) in PowerApps are considered, i.e. [IETF BCP-47 language tag](https://tools.ietf.org/html/bcp47) format.
2524

26-
Reference : https://github.com/pnp/sp-dev-fx-controls-react/tree/master/src/loc
25+
Important : Please submit a Pull Reuqest pointing to beta branch.
26+
27+
Reference : https://github.com/pnp/sp-dev-fx-controls-react/tree/master/src/loc

Calendar/Calendar/loc/da-dk.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@ define([], () => {
33
DatePickerMonthLongJanuary: 'Januar',
44
DatePickerMonthShortJanuary: 'Jan',
55
DatePickerMonthLongFebruary: 'Februar',
6-
DatePickerMonthShortFebruary: 'Februar',
6+
DatePickerMonthShortFebruary: 'Feb',
77
DatePickerMonthLongMarch: 'Marts',
88
DatePickerMonthShortMarch: 'Mar',
99
DatePickerMonthLongApril: 'April',
1010
DatePickerMonthShortApril: 'Apr',
11-
DatePickerMonthLongMay: 'Kan',
12-
DatePickerMonthShortMay: 'Kan',
11+
DatePickerMonthLongMay: 'Maj',
12+
DatePickerMonthShortMay: 'Maj',
1313
DatePickerMonthLongJune: 'Juni',
14-
DatePickerMonthShortJune: 'Juni',
14+
DatePickerMonthShortJune: 'Jun',
1515
DatePickerMonthLongJuly: 'Juli',
1616
DatePickerMonthShortJuly: 'Jul',
1717
DatePickerMonthLongAugust: 'August',
18-
DatePickerMonthShortAugust: 'August',
18+
DatePickerMonthShortAugust: 'Aug',
1919
DatePickerMonthLongSeptember: 'September',
20-
DatePickerMonthShortSeptember: 'Syv',
20+
DatePickerMonthShortSeptember: 'Sep',
2121
DatePickerMonthLongOctober: 'Oktober',
22-
DatePickerMonthShortOctober: 'Oktober',
22+
DatePickerMonthShortOctober: 'Okt',
2323
DatePickerMonthLongNovember: 'November',
24-
DatePickerMonthShortNovember: 'November',
24+
DatePickerMonthShortNovember: 'Nov',
2525
DatePickerMonthLongDecember: 'December',
26-
DatePickerMonthShortDecember: 'December',
26+
DatePickerMonthShortDecember: 'Dec',
2727
DatePickerDayLongSunday: 'Søndag',
28-
DatePickerDayShortSunday: 'Sun',
28+
DatePickerDayShortSunday: 'Søn',
2929
DatePickerDayLongMonday: 'Mandag',
30-
DatePickerDayShortMonday: 'Min',
30+
DatePickerDayShortMonday: 'Man',
3131
DatePickerDayLongTuesday: 'Tirsdag',
32-
DatePickerDayShortTuesday: 'Tue',
32+
DatePickerDayShortTuesday: 'Tir',
3333
DatePickerDayLongWednesday: 'Onsdag',
3434
DatePickerDayShortWednesday: 'Ons',
3535
DatePickerDayLongThursday: 'Torsdag',

Calendar/Calendar/loc/hu-hu.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
define([], () => {
2+
return {
3+
DatePickerMonthLongJanuary: 'Január',
4+
DatePickerMonthShortJanuary: 'Jan',
5+
DatePickerMonthLongFebruary: 'Február',
6+
DatePickerMonthShortFebruary: 'Feb',
7+
DatePickerMonthLongMarch: 'Március',
8+
DatePickerMonthShortMarch: 'Már',
9+
DatePickerMonthLongApril: 'Április',
10+
DatePickerMonthShortApril: 'Ápr',
11+
DatePickerMonthLongMay: 'Május',
12+
DatePickerMonthShortMay: 'Máj',
13+
DatePickerMonthLongJune: 'Június',
14+
DatePickerMonthShortJune: 'Jún',
15+
DatePickerMonthLongJuly: 'Július',
16+
DatePickerMonthShortJuly: 'Júl',
17+
DatePickerMonthLongAugust: 'Augusztus',
18+
DatePickerMonthShortAugust: 'Aug',
19+
DatePickerMonthLongSeptember: 'Szeptember',
20+
DatePickerMonthShortSeptember: 'Szept',
21+
DatePickerMonthLongOctober: 'Október',
22+
DatePickerMonthShortOctober: 'Okt',
23+
DatePickerMonthLongNovember: 'November',
24+
DatePickerMonthShortNovember: 'Nov',
25+
DatePickerMonthLongDecember: 'December',
26+
DatePickerMonthShortDecember: 'Dec',
27+
DatePickerDayLongSunday: 'Vasárnap',
28+
DatePickerDayShortSunday: 'Vas',
29+
DatePickerDayLongMonday: 'Hétfő',
30+
DatePickerDayShortMonday: 'Hé',
31+
DatePickerDayLongTuesday: 'Kedd',
32+
DatePickerDayShortTuesday: 'Ke',
33+
DatePickerDayLongWednesday: 'Szerda',
34+
DatePickerDayShortWednesday: 'Sze',
35+
DatePickerDayLongThursday: 'Csütörtök',
36+
DatePickerDayShortThursday: 'Csü',
37+
DatePickerDayLongFriday: 'Péntek',
38+
DatePickerDayShortFriday: 'Pé',
39+
DatePickerDayLongSaturday: 'Szombat',
40+
DatePickerDayShortSaturday: 'Szo',
41+
DatePickerGoToToday: 'Ma',
42+
DatePickerIsRequiredErrorMessage: '',
43+
DatePickerInvalidInputErrorMessage: '',
44+
DatePickerIsOutOfBoundsErrorMessage: '',
45+
DateTimePickerDate: 'Dátum',
46+
DateTimePickerTime: 'Idő',
47+
DateTimePickerTimeSeparator: ':',
48+
DateTimePickerHourValueInvalid: 'Helytelen óra érték',
49+
DateTimePickerMinuteValueInvalid: 'Helytelen perc érték',
50+
DateTimePickerSecondValueInvalid: 'Helytelen másodperc érték',
51+
DateTimePickerTextErrorMessage: 'Helyes dátum értéket adjon meg',
52+
};
53+
});

SearchBox/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This code component provides a wrapper around the [Fluent UI SearchBox](https://
88

99
## Properties
1010

11-
- **Search Text** - The action items to render. The first item is considered the root item.
11+
- **Search Text** - Use this property to get or set value for the control.
1212

1313
- **Icon Name** - Name of the Fluent UI icon (see [Fluent UI Icons](https://developer.microsoft.com/en-us/fluentui#/styles/web/icons)).
1414

SearchBox/SearchBox/ControlManifest.Input.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest>
33
<control namespace="PowerCAT" constructor="SearchBox" version="0.0.1" display-name-key="SearchBox" description-key="SearchBox_desc" control-type="virtual">
4-
<property name="SearchText" display-name-key="SearchBox_SearchText" description-key="SearchBox_SearchText_Desc" of-type="SingleLine.Text" usage="output" hidden="true" />
4+
<property name="SearchText" display-name-key="SearchBox_SearchText" description-key="SearchBox_SearchText_Desc" of-type="SingleLine.Text" usage="bound"/>
55
<property name="Theme" display-name-key="Theme" of-type="Multiple" usage="input" required="false" />
66
<property name="AccessibilityLabel" display-name-key="AccessibilityLabel" of-type="SingleLine.Text" usage="input" required="false" />
77
<property name="IconName" display-name-key="IconName" of-type="SingleLine.Text" usage="input" required="false" default-value="Search" />

SearchBox/SearchBox/__mocks__/mock-parameters.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ export function getMockParameters(): IInputs {
1313
DisableAnimation: new MockTwoOptionsProperty(),
1414
InputEvent: new MockStringProperty(),
1515
DelayOutput: new MockTwoOptionsProperty(),
16+
SearchText: new MockStringProperty(),
1617
};
1718
}

SearchBox/SearchBox/__tests__/__snapshots__/searchbox-lifecycle.test.ts.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ exports[`SearchBox renders 1`] = `
1212
setFocus=""
1313
themeJSON=""
1414
underLined={false}
15+
value=""
1516
width={-1}
1617
/>
1718
`;
@@ -155,7 +156,7 @@ exports[`SearchBox theme 1`] = `
155156
display: none;
156157
}
157158
disabled={false}
158-
id="SearchBox6"
159+
id="SearchBox3"
159160
onBlur={[Function]}
160161
onChange={[Function]}
161162
onInput={[Function]}

SearchBox/SearchBox/components/Component.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ export interface ISearchBoxComponentProps {
1010
disabled?: boolean;
1111
disableAnimation?: boolean;
1212
setFocus?: string;
13+
value?: string;
1314
}

SearchBox/SearchBox/components/SearchBox.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@ import { SearchBox, createTheme, IPartialTheme, ThemeProvider, IIconProps, merge
33
import { ISearchBoxComponentProps } from './Component.types';
44

55
export const SearchBoxComponent = React.memo((props: ISearchBoxComponentProps) => {
6-
const { onChanged, themeJSON, ariaLabel, placeholderText, underLined, disabled, disableAnimation, setFocus } =
7-
props;
6+
const {
7+
onChanged,
8+
themeJSON,
9+
ariaLabel,
10+
placeholderText,
11+
underLined,
12+
disabled,
13+
disableAnimation,
14+
setFocus,
15+
value,
16+
} = props;
817
const filterIcon: IIconProps = { iconName: props.iconName };
918
const rootRef = React.useRef<HTMLDivElement>(null);
1019
const theme = React.useMemo(() => {
@@ -44,6 +53,7 @@ export const SearchBoxComponent = React.memo((props: ISearchBoxComponentProps) =
4453
disableAnimation={disableAnimation}
4554
className={wrapperClass}
4655
ref={rootRef}
56+
value={value}
4757
/>
4858
</ThemeProvider>
4959
);

SearchBox/SearchBox/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@ export class SearchBox implements ComponentFramework.ReactControl<IInputs, IOutp
4646
this.delayOutput = context.parameters.DelayOutput.raw;
4747
const inputEvent = this.context.parameters.InputEvent.raw;
4848
const eventChanged = inputEvent && this.setFocus !== inputEvent;
49-
49+
this.searchTextValue = context.parameters.SearchText.raw ?? '';
5050
if (eventChanged && inputEvent.startsWith(InputEvents.SetFocus)) {
5151
this.setFocus = inputEvent;
5252
}
53-
5453
const props: ISearchBoxComponentProps = {
5554
onChanged: this.onChange,
5655
themeJSON: context.parameters.Theme.raw ?? '',
@@ -63,6 +62,7 @@ export class SearchBox implements ComponentFramework.ReactControl<IInputs, IOutp
6362
width: allocatedWidth,
6463
height: allocatedHeight,
6564
setFocus: this.setFocus,
65+
value: this.searchTextValue,
6666
};
6767

6868
return React.createElement(SearchBoxComponent, props);

SearchBox/SearchBox/strings/SearchBox.1033.resx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,10 @@
148148
<data name="SearchBox_desc" xml:space="preserve">
149149
<value>A component to get search text as input</value>
150150
</data>
151+
<data name="SearchBox_SearchText" xml:space="preserve">
152+
<value>Search text</value>
153+
</data>
154+
<data name="SearchBox_SearchText_Desc" xml:space="preserve">
155+
<value>Represents the default as well as the current value of search box</value>
156+
</data>
151157
</root>

0 commit comments

Comments
 (0)