Skip to content

Commit 9d885b8

Browse files
committed
fixup! fixup! refactor(utils): Replace GenRandomId with getRandomId
1 parent fb630c5 commit 9d885b8

File tree

24 files changed

+57
-57
lines changed

24 files changed

+57
-57
lines changed

src/components/NcActionButtonGroup/NcActionButtonGroup.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export default {
8787

8888
<script>
8989
import { defineComponent } from 'vue'
90-
import { getRandomId } from '../../utils/getRandomId.ts'
90+
import { getElementId } from '../../utils/getElementId.ts'
9191
import { t } from '../../l10n.js'
9292
9393
/**
@@ -116,7 +116,7 @@ export default defineComponent({
116116
117117
setup() {
118118
return {
119-
labelId: `nc-action-button-group-${getRandomId()}`,
119+
labelId: `nc-action-button-group-${getElementId()}`,
120120
}
121121
},
122122

src/components/NcActionCheckbox/NcActionCheckbox.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ This component is made to be used inside of the [NcActions](#NcActions) componen
3939

4040
<script>
4141
import ActionGlobalMixin from '../../mixins/actionGlobal.js'
42-
import { getRandomId } from '../../utils/getRandomId.ts'
42+
import { getElementId } from '../../utils/getElementId.ts'
4343
4444
export default {
4545
name: 'NcActionCheckbox',
@@ -59,7 +59,7 @@ export default {
5959
*/
6060
id: {
6161
type: String,
62-
default: () => 'action-' + getRandomId(),
62+
default: () => 'action-' + getElementId(),
6363
validator: id => id.trim() !== '',
6464
},
6565

src/components/NcActionInput/NcActionInput.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ import NcPasswordField from '../NcPasswordField/index.js'
246246
import NcSelect from '../NcSelect/index.js'
247247
import NcTextField from '../NcTextField/index.js'
248248
import ActionGlobalMixin from '../../mixins/actionGlobal.js'
249-
import { getRandomId } from '../../utils/getRandomId.ts'
249+
import { getElementId } from '../../utils/getElementId.ts'
250250
import { t } from '../../l10n.js'
251251
252252
export default {
@@ -270,15 +270,15 @@ export default {
270270
*/
271271
id: {
272272
type: String,
273-
default: () => 'action-' + getRandomId(),
273+
default: () => 'action-' + getElementId(),
274274
validator: id => id.trim() !== '',
275275
},
276276
/**
277277
* id attribute of the text input element
278278
*/
279279
inputId: {
280280
type: String,
281-
default: () => 'action-input-' + getRandomId(),
281+
default: () => 'action-input-' + getElementId(),
282282
validator: id => id.trim() !== '',
283283
},
284284
/**

src/components/NcActionRadio/NcActionRadio.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ So that only one of each name set can be selected at the same time.
4242

4343
<script>
4444
import ActionGlobalMixin from '../../mixins/actionGlobal.js'
45-
import { getRandomId } from '../../utils/getRandomId.ts'
45+
import { getElementId } from '../../utils/getElementId.ts'
4646
4747
export default {
4848
name: 'NcActionRadio',
@@ -62,7 +62,7 @@ export default {
6262
*/
6363
id: {
6464
type: String,
65-
default: () => 'action-' + getRandomId(),
65+
default: () => 'action-' + getElementId(),
6666
validator: id => id.trim() !== '',
6767
},
6868

src/components/NcActionTextEditable/NcActionTextEditable.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default {
8383

8484
<script>
8585
import ActionTextMixin from '../../mixins/actionText.js'
86-
import { getRandomId } from '../../utils/getRandomId.ts'
86+
import { getElementId } from '../../utils/getElementId.ts'
8787
8888
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
8989
@@ -102,7 +102,7 @@ export default {
102102
*/
103103
id: {
104104
type: String,
105-
default: () => 'action-' + getRandomId(),
105+
default: () => 'action-' + getElementId(),
106106
validator: id => id.trim() !== '',
107107
},
108108
/**
@@ -138,7 +138,7 @@ export default {
138138
},
139139
140140
computedId() {
141-
return getRandomId()
141+
return getElementId()
142142
},
143143
},
144144

src/components/NcActions/NcActions.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ import { t } from '../../l10n.js'
925925
926926
import NcButton from '../NcButton/index.ts'
927927
import NcPopover from '../NcPopover/index.js'
928-
import { getRandomId } from '../../utils/getRandomId.ts'
928+
import { getElementId } from '../../utils/getElementId.ts'
929929
import isSlotPopulated from '../../utils/isSlotPopulated.ts'
930930
931931
import IconDotsHorizontal from 'vue-material-design-icons/DotsHorizontal.vue'
@@ -1112,7 +1112,7 @@ export default {
11121112
],
11131113
11141114
setup(props) {
1115-
const randomId = `menu-${getRandomId()}`
1115+
const randomId = `menu-${getElementId()}`
11161116
const triggerRandomId = `trigger-${randomId}`
11171117
11181118
const triggerButton = ref()

src/components/NcAppNavigationItem/NcAppNavigationItem.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ import NcAppNavigationIconCollapsible from './NcAppNavigationIconCollapsible.vue
399399
import { useIsMobile } from '../../composables/useIsMobile/index.js'
400400
import NcInputConfirmCancel from './NcInputConfirmCancel.vue'
401401
import { t } from '../../l10n.js'
402-
import { getRandomId } from '../../utils/getRandomId.ts'
402+
import { getElementId } from '../../utils/getElementId.ts'
403403
404404
import Pencil from 'vue-material-design-icons/Pencil.vue'
405405
import Undo from 'vue-material-design-icons/Undo.vue'
@@ -449,7 +449,7 @@ export default {
449449
*/
450450
id: {
451451
type: String,
452-
default: () => 'app-navigation-item-' + getRandomId(),
452+
default: () => 'app-navigation-item-' + getElementId(),
453453
validator: id => id.trim() !== '',
454454
},
455455

src/components/NcAppSidebar/NcAppSidebar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ import NcEmptyContent from '../NcEmptyContent/index.js'
712712
import Focus from '../../directives/Focus/index.js'
713713
import Linkify from '../../directives/Linkify/index.js'
714714
import { useIsSmallMobile } from '../../composables/useIsMobile/index.js'
715-
import { getRandomId } from '../../utils/getRandomId.ts'
715+
import { getElementId } from '../../utils/getElementId.ts'
716716
import { getTrapStack } from '../../utils/focusTrap.js'
717717
import { t } from '../../l10n.js'
718718
import isSlotPopulated from '../../utils/isSlotPopulated.ts'
@@ -924,7 +924,7 @@ export default {
924924
925925
setup() {
926926
return {
927-
uid: getRandomId(),
927+
uid: getElementId(),
928928
isMobile: useIsSmallMobile(),
929929
}
930930
},

src/components/NcBreadcrumb/NcBreadcrumb.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Renders a button element when given no redirection props, otherwise, renders <a/
6161

6262
<script>
6363
import NcActions from '../NcActions/index.js'
64-
import { getRandomId } from '../../utils/getRandomId.ts'
64+
import { getElementId } from '../../utils/getElementId.ts'
6565
import NcButton from '../NcButton/NcButton.vue'
6666
6767
import ChevronRight from 'vue-material-design-icons/ChevronRight.vue'
@@ -172,7 +172,7 @@ export default {
172172
* The unique id of the breadcrumb. Necessary to append the
173173
* Actions menu to the correct crumb.
174174
*/
175-
crumbId: `crumb-id-${getRandomId()}`,
175+
crumbId: `crumb-id-${getElementId()}`,
176176
}
177177
},
178178
computed: {

src/components/NcCheckboxRadioSwitch/NcCheckboxRadioSwitch.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ export default {
303303

304304
<script>
305305
import NcCheckboxContent, { TYPE_BUTTON, TYPE_CHECKBOX, TYPE_RADIO, TYPE_SWITCH } from './NcCheckboxContent.vue'
306-
import { getRandomId } from '../../utils/getRandomId.ts'
306+
import { getElementId } from '../../utils/getElementId.ts'
307307
import { t, n } from '../../l10n.js'
308308
309309
export default {
@@ -322,7 +322,7 @@ export default {
322322
*/
323323
id: {
324324
type: String,
325-
default: () => 'checkbox-radio-switch-' + getRandomId(),
325+
default: () => 'checkbox-radio-switch-' + getElementId(),
326326
validator: id => id.trim() !== '',
327327
},
328328

0 commit comments

Comments
 (0)